Getting Started
Step-by-step guide to set up and start working with the project.
Welcome to the initial setup guide for our project. This guide will walk you through setting up your environment and beginning development. Before you start, make sure you have the required global dependencies installed.
Node.js and .nvmrc
We use nvm to manage Node.js versions. First,
install nvm by following the
installation instructions .
In the project’s directory, run nvm use to switch to the Node.js version
specified in the .nvmrc file. For automatic version switching when navigating
directories, consider enabling deeper shell integrations
here .
Our
.nvmrcspecifies Node.js versionlts/hydrogen(v18), which is supported long-term.
If nvm isn’t for you, any method that installs and uses Node.js version 18
is fine.
Package Manager: pnpm
We use pnpm as our package manager. Install pnpm by following this guide . pnpm has several benefits:
- Speed: It is much faster than some alternatives.
- Disk Space Efficiency: It stores packages globally and links them to projects as needed.
- Security: It checks the integrity of packages before they are used.
Installing Dependencies
To install project dependencies, run:
pnpm installThis will install all dependencies listed in package.json according to the
pnpm-lock.yaml file.
Starting the Project
To start the project in development mode, use:
pnpm devThis starts all projects in the monorepo. To start a specific project, use the
--filter option with the project name:
pnpm dev --filter "@akinon/docs" # <- name from package.jsonYou can use the
--filteroption with almost any pnpm command to target specific projects.
Installing a New Package
To add a new package to a specific project, use:
pnpm add <package-name> --filter "<project-name>"If you don’t specify the project with --filter, the installation will attempt
and fail in the root directory. Unless you have a very good reason to do so, you
should not install packages in the root directory.
To install a package in the root directory:
pnpm add <package-name> -WRunning Tasks
You can execute tasks using pnpm <task-name>. You should always run commands
from the project root since it’s integrated with turbo caching mechanism.
Running commands from the package directories might result in unexpected
behaviour. Here’s a list of available tasks and what they do:
| Task Name | Description |
|---|---|
build | Builds all projects and packages for production. |
dev | Starts all projects in development mode. |
serve | Serves the built dist/ folder. |
test | Runs the test suite. |
test:coverage | Runs the test suite, generating a coverage report in the coverage directory. |
lint | Runs the linter. |
clean | Cleans the node_modules directory for all packages and root, preparing for a fresh install. |
typecheck | Checks for missing TypeScript type definitions. |
check:all | Runs install, lint, test, typecheck and build. |