git clone <url>
: Clone the project to your workspace
nvm install
: Install and use the correct version of node for the project
npm i
: Install required packages using npm
Enable these VSCode extensions in the project workspace:
These scripts are located in package.json
and can be run using npm run <script>
.
dev
: Runs cross-env LOG_LEVEL=debug nodemon --exec ts-node src/index.ts
to run a development server which reloads on changes to the source code.start
: Runs node src/index.js
to start the server.test
: Runs jest --runInBand --
to run unit tests. Pass globs for test files you want to run as arguments, e.g. npm run test app
to test app*.test.js
test:watch
: Runs jest --watch --runInBand --
to run unit tests and watch for changes to related files. Pass globs for test files you want to run as arguments, e.g. npm run test:watch app
to test app*.test.js
test:coverage
: Runs jest --runInBand --coverage
to run unit tests and generate a code coverage report.test:integration
: Runs hurl --test --glob \"tests/integration/**/*.hurl\"
to run integration tests. Server must be running on localhost:8080
.prettier
: Runs prettier --write .
to format all files in the project directory.lint
: Runs eslint .
to lint all files in the project directory.prepare
: Not intended for manual use. Used to run the pre-commit hook which formats and lints code before every commit.Please follow the GitHub flow for contributions:
Update your local main branch
Switch to your main branch and pull the latest changes from the remote repository:
git switch main
git pull --prune
--prune
option removes any references to branches that no longer exist on the remote.Create a new branch
Name your branch following the convention issue-number
(e.g., issue-1
):
git switch -c <issue-number> main
Make your changes
Start the development server:
npm run dev
Test your changes
Run the following checks to ensure everything works as expected:
npm run lint
npm run test
npm run start
npm run test:integration # Server must be running, so run "npm run start" first
Review your changes
Check which files have been changed:
git status
Stage your changes
Add the relevant files to staging:
git add <files>
Commit your changes
Write a meaningful commit message:
git commit -m "<commit message>"
Push your branch
Push your changes and set the upstream branch:
git push -u origin <your-branch-name>
Create a pull request
Create a pull request on GitHub. Fill in the template and link it to the issue using:
Fixes #[issue number]