← NodeJS Teams

Dependencies & Tasks

Dependency Management

To avoid conflicts, version & API changes, etc, all dependencies should use deterministic versioning. This is done by using pnpm with a pnpm-lock.yaml.

Dependencies should be added with care to avoid unneccesary application size.

Separation of production and development dependencies should be ensured to ensure deployed services only contain needed dependencies.

You must also configure npm to use our internal registry for @banno packages.

TS Type Management

Any TypeScript definitions (@types/<name>) should be added with --dev flag.

Task Management

Tasks for development should be defined in the package.json in the scripts section and should follow the convention:

  • build: Build TS files to JS in /dist
  • docker:test: runs tests against the Docker container
  • test: runs all tests and coverage
  • test:watch: runs all tests and reruns on changes
  • test:unit: runs only unit tests (/test/unit/**/*.ts)
  • test:unit:watch: runs only unit tests and reruns on changes
  • test:e2e: runs only e2e tests (/test/e2e/**/*.ts)
  • test:e2e:watch: runs only e2e tests and reruns on changes
  • lint: runs linter
  • dev: starts service with nodemon
  • release:patch: versions and pushes patch release
  • release:minor: versions and pushes minor release
  • release:major: versions and pushes major release