Available scripts
The following table describes script executing throughout development, or inside CI/CD processes.
Script | Description | CI | CD |
---|---|---|---|
Workflow | |||
dev | Initiates the application at http://localhost:3000. | ||
build | Builds the application. | ✅ | |
postbuild | Creates static site-map. | ✅ | |
start | Serves the built application. | ||
secrets | Initiates git-crypt and install secrets. | ✅ | |
Storybook | |||
storybook | Locally launches Storybook to develop React Component in isolation. | ||
storybook:build | Builds up the Storybook library which then can be hosted somewhere and be accessible to the team. | ||
Code generation | |||
codegen:graphql | (Shortcut) Executes all GraphQL based code generation. | ||
codegen:graphql:dato | Executes DatoCMS based code generation. | ||
codegen:graphql:local | Executes local GraphQL based code generation. Use this when updating .graphql and .gql files before pushing. | ||
codegen:graphql:clean | Removes all GraphQL based code generation. | ||
codegen:component | Generates a new component. | ||
Documentation | |||
docs:start | Initiates the documentation website. | ||
docs:build | Builds the documentation website. | ✅ | |
docs:clear | Cleans cache and temporary files of the documentation website. | ||
docs:serve | Serves the built documentation website. | ||
Code quality | |||
format:fix | Formats the codebase using Prettier. | ||
format:validate | Validates codebase format using Prettier. | ✅ | |
lint | Validates codebase style using ESLint. | ✅ | |
lint:fix | Fixes possible code style issues using ESLint. | ||
typecheck | Validates codebase typing using TypeScript. | ✅ | ✅ |
test | Switch command for test:run and test:watch (depending on CI). | ✅ | |
test:run | Executes tests once. | ||
test:watch | Executes tests in watch mode. | ||
test:coverage | Executes tests and generates coverage report. | ||
code-quality | (Shortcut) Executes all code-quality checks. | ||
Util/Tools | |||
utils:fix-layout | Helper to fix layouts after DatoCMS environment forking. |