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
docker
is available and running in your host system - Install the Devcontainer Extension
- Open the project root folder and select
Dev Containers: Reopen in Container
from 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
yarn devcontainer up --workspace-folder . yarn devcontainer exec -- workspace-folder . /bin/bash
This project use specific versions of node
, yarn
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
node
at the right version used by this projectcd path/to/io-messages nodenv install
-
Install
yarn
using corepack (Node Package Manager version manager, it is distributed withnode
). This step will also install all the required dependencies[!IMPORTANT] Yarn uses Plug and Play for dependency management. For more information, see: Yarn Plug’n’Play
corepack enable yarn
-
Build all the workspaces contained by this repo
yarn 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.
yarn changeset
This project uses yarn
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
yarn build
# or
yarn turbo build
# to execute COMMAND on WORKSPACE_NAME
yarn workspace WORKSPACE_NAME run command
# to execute COMMAD on all workspaces
yarn workspace foreach run command
# run unit tests on citizen-func
yarn workspace citizen-func run test
# or (with turbo)
yarn turbo test -- citizen-func
# run the typecheck script on all workspaces
yarn workspaces foreach run typecheck
# add a dependency to the workspace root
yarn add turbo
# add vitest as devDependency on citizen-func
yarn workspace citizen-func add -D vitest
# add zod as dependency on each workspace
yarn workspace foreach add zod