Skip to main content

Monorepo

Turborepo

The project uses Turborepo to orchestrate builds and dev servers. Configuration lives in turbo.json.

Main tasks

TaskDescription
devStart dev server (depends on ^build)
buildProduction build
startStart production server

Filters

To run tasks for specific apps:

turbo dev --filter=@nittio/bko-api...    # bko-api and its dependencies
turbo build --filter=@nittio/app-console # only app-console

Yarn Workspaces

Workspaces are configured in the root package.json:

{
"workspaces": ["apps/*", "packages/*"]
}

Adding dependencies

# To a specific workspace
yarn workspace @nittio/bko-api add <package>

# To the root (shared devDependencies)
yarn add -W -D <package>

Creating a new package

  1. Create the folder at packages/<name>/
  2. Add package.json with "name": "@nittio/<name>"
  3. Export the public API through index.ts
  4. Include fixture/ with CreateFixture and resetCounter
  5. Run yarn install at the root