Skip to main content

CLI commands

This page contains a list of CLI commands that you can use within the webapp package context.

pnpm run start

Start webapp development server

Alias for pnpm nx start:app. It starts Vite web application development server along with pnpm nx webapp:graphql:generate-types:watch.


pnpm run lint

Runs eslint and stylelint for the webapp package.

Find more about coding standards in the detailed stack description.


pnpm run type-check

Runs tsc compilation with disabled files emitting. It is used to check if there is no type errors in the code.


pnpm run test

Runs jest for the webapp package.


pnpm run test:watch

Runs jest with --watch flag. Useful for development purpose.


pnpm run plop

Run plop generator.

Find more about plop generator in the devtools section.


pnpm run storybook

Run and build storybooks

It runs start-storybook script along with pnpm nx run webapp-emails:vite-build which will prebuild email templates.

Storybook server will start on port 5002.


pnpm nx start:app

It will start Vite web application development server along with pnpm nx webapp:graphql:generate-types:watch.


pnpm nx run webapp:graphql:download-schema

It downloads and saves GraphQL schemas from back-end API and Contentful API. This should be run after every API schema change and before generating TypeScript types by calling pnpm nx run webapp:graphql:generate-types.

You can find more about updating GraphQL schema here


pnpm nx run webapp:graphql:generate-types

pnpm nx run webapp:graphql:generate-types:watch

Alias commands for pnpm nx run webapp-api-client:graphql:generate-types and pnpm nx run webapp-api-client:graphql:generate-types:watch


pnpm nx run webapp:build

Regenerate types by calling pnpm nx run webapp:graphql:generate-types and builds the web application using vite build with the correct configuration.


saas webapp test

Alias command for pnpm nx test.


pnpm shipfast webapp secrets

It starts secrets-editor with the webapp context (SERVICE_NAME=webapp): tool that helps to set up an environment variables for AWS environment. Find more about setting environment variables for a service here.

caution

This command should be called only after saas aws set-env [STAGE_NAME] command.


pnpm nx run extract-intl

It extracts all formatjs messages from the webapp and webapp-libs packages using formatjs extract command to webapp-libs/webapp-core/src/translations/en.json file.