The preferred way to setup your development environment is to use Devcontainer (Host system requirements).
Tip
If you are on macOS we recommend using Rancher Desktop configured to use VZ as Virtual Machine Type and virtiofs as volume Mount Type.
- Make sure
dockeris available and running in your host system - Install the Devcontainer Extension
- Open the project root folder and select
Dev Containers: Reopen in Containerfrom the command palette - Visual Studio Code will build the devcontainer image and then open the project inside the container, with all the needed tools and extension configured
If you use a code editor that doesn't support Dev Container, you can still run it in your terminal.
-
Follow the instruction of the following chapter ("Using local machine") to setup your local environment
-
Run devcontainer from your terminal
pnpm exec devcontainer up --workspace-folder . pnpm exec devcontainer exec -- workspace-folder . /bin/bash
This project use specific versions of node, pnpm and terraform. To make sure your development setup matches with production follow the recommended installation methods.
-
Install and configure the follow tool in your machine
- nodenv - Node version manager
- tfenv - Terraform version manager
- terraform-docs - Generate Terraform modules documentation in various formats
- tflint - A Pluggable Terraform Linter
- pre-commit - A framework for managing and maintaining multi-language pre-commit hooks
-
Install
nodeat the right version used by this projectcd path/to/io-messages nodenv install -
Install
pnpmusing corepack (Node Package Manager version manager, it is distributed withnode). This step will also install all the required dependenciescorepack enable pnpm -
Build all the workspaces contained by this repo
pnpm build
We use changesets to automate package versioning and releases.
Each Pull Request that includes changes that require a version bump must include a changeset file that describes the introduced changes.
To create a changeset file run the following command and follow the instructions.
pnpm changesetThis project uses pnpm and turbo with workspaces to manage projects and dependencies. Here is a list of useful commands to work in this repo.
# build all the workspaces using turbo
pnpm build
# or
pnpm turbo build
# to execute COMMAND on WORKSPACE_NAME
pnpm --filter WORKSPACE_NAME run command
# to execute COMMAD on all workspaces
pnpm -r run command
# run unit tests on citizen-func
pnpm --filter citizen-func run test
# or (with turbo)
pnpm turbo test -- citizen-func
# run the typecheck script on all workspaces
pnpm workspaces foreach run typecheck# add a dependency to the workspace root
pnpm add turbo
# add vitest as devDependency on citizen-func
pnpm --filter citizen-func add -D vitest
# add zod as dependency on each workspace
pnpm -r add zod