Command | Description |
---|---|
npm run dev |
Start the frontend server on http://127.0.0.1:3021 |
npm run lint |
This will run the eslint linter to check for coding errors, it is recommend to have rubocop run automatically on save as it will keep the code formatted and help resolve errors as you work. It is recommend to use an Editor/IDE that supports linting as you code such as Jetbrains Webstorm/Rubymine or VSCode . You can also use npm run lint_watch to automatically update the linter as you make changes to files |
npm run test |
Run all cypress tests in Headless Mode. NOTE: A server must be running for cypress to work successfully. e.g. npm run dev |
npm run typecheck |
This will run typescript type checker to check for type related errors. Note there are 2 separate type checkers one for the project and another for Cypress testing this command runs both. You can use npm run typecheck_cypress and npm run typecheck_project to run them separately. You can also use npm tun typecheck_watch to automatically update type check as you make changes to files |
npm run watch |
This combines both linting and typechecking into a single command that updates as you make changes to files |
npm run codegen |
This reads the graphql configuration from the backend and the graphql queries and mutations on the frontend and create the relevant types in the src/graphql/schema folder. The contents of this folder are automatically generated but we keep them in git to keep track of changes over time, however if you get a git merge conflict its perfectly fine just to delete this folder and run npm run codegen again |
npm run cypress_dev |
Runs the Cypress testing app in dev mode, for building and running tests. NOTE: A server must be running for cypress to work successfully. e.g. npm run dev |
npm run build_translation |
When managing the default translation we split the translation over multiple files in the src/translations directory. This command will merge the default translation into a single file and place it in the messages folder as en.json it is important however to delete this file as it will override the translations defined in the src/translations directory. We generate it so we can then create other translations from it in the messages folder such as en-US.json and de-DE.json translation files which live in the messages directory. |
npm run build |
Build the project ready for production next build |
npm run start |
Start the frontend server in production mode (after being built) on http://127.0.0.1:3021 when deploying to a live site make sure to use port 80 or if using nginx configure it to route to port 3021 |