Skip to content

Setup

This document holds instructions on the development setup.

Node.js

We use Node.js version 18.15.0. To install node, use nvm or nvm-windows.

1
2
3
4
5
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
source ~/.bashrc

nvm install 18.15.0
nvm use 18.15.0

Yarn

We use Yarn 2 (Modern). Install it as follows.

corepack enable

Tasks

We use ./task as build tool.

Using Tasks

Execute a task as follows. On Windows, execute it using, e.g., Git Bash.

./task [task]

Get an overview of tasks as follows.

./task tasks:list

Get help for a specific task as follows.

./task tasks:help [task]

Writing Tasks

Tasks can be written in Bash, Typescript, and Python and are located in ./tasks/some/command/task{.sh,.ts,.py}. The following environment variables are available.

Environment Description
TASK_BINARY The absolute path of ./task.
TASK_ROOT_DIR The absolute path of the root directory of the project.
TASK_TASK_DIR The absolute path of the directory in which the task is located.

Some hints:

  • There is no need to include #!/usr/bin/bash or set -e in Bash tasks.
  • Bash tasks are executed from TASK_ROOT_DIR.
  • To add a summary, place a single line in ${TASK_TASK_DIR}/summary.
  • To add a help text for a task, place the text in ${TASK_TASK_DIR}/help.
  • Always add a new line at the end of every file.

Repository

The repository is a monorepo consisting of the CLI, server, docs, tests, etc. Clone it as follows.

1
2
3
4
5
6
git clone https://github.com/opentosca/opentosca-vintner.git
cd opentosca-vintner
git lfs install
git lfs pull
./task install
./task examples:pull:link

Large Files

Larges files, such as binaries or archives used in examples, are added using git lfs. This includes the file extensions .bin, .gz, .tar, .zip, .xz, and .jar.

Signed Commits

Commits are required to be signed. Therefore, register a signing key as follows.

Enable auto-signing inside the repository.

git config commit.gpgsign true

JetBrains

Warning

WebStorm Version 2022.3.3 seems to have problems with breakpoints when src/resolver/graph.ts is involved. However, WebStorm Version 2022.3.2 works fine.

We use WebStorm, which is free for students. Install Webstorm using JetBrains Toolbox.

ESLint

Open the Project Settings using Ctrl + Alt + S. ESLint should be configured as given in the figure below with the following pattern.

{**/*,*}.{ts}

IntelliJ ESLint Settings

Figure 1: IntelliJ ESLint Settings

Prettier

Open the Project Settings using Ctrl + Alt + S. Prettier should be configured as given in the figure below with the following pattern.

{**/*,*}.{ts,json,yaml,yml}

IntelliJ Prettier Settings

Figure 2: IntelliJ Prettier Settings

Excluded Directories

The following directories should be excluded from search by the IDE.

  • .nyc_output
  • docs/.venv
  • build
  • build-tasks
  • coverage
  • yarn
  • dist
  • node_modules

Last update: March 30, 2024