Setup toolchain - serlo/documentation GitHub Wiki
Each repository contains a README.md
which describes the tools needed for development. Those are mainly:
-
docker
anddocker-compose
-
asdf-vm
(for installing and managing different versions of Node.JS, yarn or rust on your computer) Google cloud CLI
asdf-vm
is technically not needed but we highly recommend you using this rool.
Follow the following instructions
-
docker
: https://docs.docker.com/engine/install/ -
docker-compose
: https://docs.docker.com/compose/install/
We recommend asdf-vm for installing the tools you need (like NodeJS or Rust). Follow the instructions to install asdf
on their site "Getting started".
In order to install a tool you need to run the following commands:
# Install the asdf plugin for the tool, like `nodejs`
asdf plugin add <tool-name>
# List all available versions for the tool
asdf list all <tool-name>
# Install the tool in the version you need
asdf install <tool-name> <version>
Make yourself familiar on how you can set a version with asdf. For example for installing yarn the necessary command might look like:
asdf plugin add yarn
asdf list all yarn
asdf install yarn 1.22.18
Each repository contains a .tool-versions
file which describes which version of which tool is needed in development. Install the versions of each tool which is defined there. For example when .tool-versions
is
yarn 1.22.19
nodejs 18.14.0
you need to install nodejs
in version 18.14.0
and yarn
in version 1.22.19
.
Note: We are in the middle of adding .tool-versions
to the repositories. In case there is no .tool-versions
file you need to install:
-
nodejs
: Use the most recent version of the version which is mentioned inpackage.json
in the keywordengines
(see https://github.com/serlo/cloudflare-worker/blob/1bcbd91ec943daeecb042937b633c437ed7538c8/package.json#L92-L94 for an example which mentioned 16.x) -
yarn
: Use the most recent version -
rust
: Usestable
-
Follow the instructions at https://cloud.google.com/sdk/docs/install to install the Google Cloud CLI.
- Note for macOS users: The Google Cloud CLI installer works better than the recommended installation.
-
Run
gcloud init
to initialize gcloud.-
Note for macOS users: If you run into any network issues during the Network diagnostic step, check the Python version that is installed on your host (Python version
3.9.2
should work).
-
Note for macOS users: If you run into any network issues during the Network diagnostic step, check the Python version that is installed on your host (Python version
-
Use
gcloud auth login
to login with your@serlo.org
account.
- TypeScript: https://github.com/serlo/frontend/wiki/VS-Code
-
Rust plugin:
- Make sure to copy the
DATABASE_URL
env variable from.env
file to the VS Code Workspace Rust plugin settings, like:"rust-analyzer.check.extraEnv": { "DATABASE_URL": "mysql://root:secret@localhost:3306/serlo" }
- Make sure to copy the
- Git plugin
Note: WebStorm = Intellij + JavaScript plugins out of the box