Skip to main content

Common Commands

Omni Commands

Run application

Start just the frontend and backend app

npm run start:omni

Start just the docs

npm run start:omni:docs

Start frontend, backend, and docs

npm run start:omni:all

Start Omni application only (frontend)

npm run start -- omni

Start Omni API application only (backend)

npm run start -- omni-api

Lint

Lint affected (changes)

npm run lint:affected

Test

Test affected (changes)

npm run test:affected

Build application

Build application with release configuration (for distribution)

npm run build:omni

Other

Create HELM chart zip

# Update chart version(s).
cd apps/omni/charts
tar -czvf omni.tar.gz omni
# Upload to registry.
rm omni.tar.gz

Create new migration

TODO

General Repository Commands

The following are reference commands. For more details on CLI arguments, see the NX API documentation.

Run application

Start an application

npm run start -- {YOUR_APP}

Start multiple applications at the same time

npm run nx -- run-many --target=serve --projects={APP_1},{APP_2} --parallel

Create project

Create standard TS library

npm run nx -- generate @nx/js:library YOUR_LIB --unitTestRunner=jest --publishable --importPath=@rizing/YOUR_LIB --tags=pure --no-interactive

Create node library

npm run nx -- g @nrwl/node:lib some-lib --publishable --importPath=@rizing/some-lib

Create Angular library

npm run nx -- generate @nx/angular:library YOUR_LIB-angular --publishable --changeDetection=OnPush --importPath=@rizing/YOUR_LIB --prefix=rz --skipModule --standalone --style=scss --tags='angular' --no-interactive

Create Nest.js App

npm run nx -- g @nx/nest:app YOUR_APP --strict

Modify project

Remove project

npm run nx -- g remove {some-project} --forceRemove

Move project

npm run nx -- g move --project booking-some-library shared/some-library

Create Angular components

Create Angular component

npm run nx -- generate @nx/angular:component --standalone --changeDetection=OnPush --prefix=rz --no-interactive --project=YOUR_LIB YOUR_COMPONENT

Linting

Lint affected (changes)

npm run lint:affected

Lint a project

npm run lint -- YOUR_TARGET_PROJECT

Lint all projects

npm run nx -- run-many -t lint

Testing

Test affected (changes)

npm run test:affected

Test project (single run)

npm run test -- {YOUR_PROJECT}

Test project w/ hotreload (keep watching for changes)

npm run test -- {YOUR_PROJECT} --watch

Test project w/ debugging

npm run test -- {YOUR_PROJECT} --inspect

Build project

Build single project

# Swap "production" for desired configuration
npm run nx -- run YOUR_PROJECT:build:production

Storybook

Configure Storybook for a project

npm run nx -- g @nx/angular:storybook-configuration PROJECT_NAME

Start global story book

npx run storybook

Start storybook for a specific library

npm run nx -- storybook YOUR_LIBRARY

Build production storybook site

npm run nx -- run STORYBOOK_PROJECT:build-storybook

NX Workspace

Show NX graph

npm run nx -- graph

Clear NX cache

npm run nx -- clear-cache

Updates

Get latest updates

npm run nx -- migrate latest

Apply latest updates (apply migrations)

npm run nx -- migrate --run-migrations

Check for outdated NPM packages

npm outdated

TypeOrm

Create TypeOrm migration

npm run typeorm -- -d ./apps/omni-api/typeorm.config.ts  migration:generate ./apps/omni-api/src/migrations/YOUR_MIGRATION_NAME

Git

Delete all local git branches

# Mac:
git for-each-ref --format '%(refname:short)' refs/heads | grep -v master | xargs git branch -D

# Windows
git branch | grep -v "main" | xargs git branch -D