This document describes how to set up your development environment to build and test.
git clone https://github.com/jolana-lab/jo-send.git
cd jo-send
npm ci
You need to write unit tests.
-
During coding:
Watching if the implemented codes pass the tests, and writing new tests.
npm run test:watch
-
After coding:
-
make sure all the tests are passed
npm run test
-
Check the test coverage (Tests of controllers and services are collected).
npm run test:cov
-
We use Prettier, and we follow TypeScript ESLint.
You can automatically format your code by running:
npm run lint
It will automatically pick up the settings from .vscode/settings.json
.
We provide two development setups:
- Default: Docker compose setup
- Recommended: Macos local setup
Docker compose is the easiest way to setup.
docker compose up
That's all. :)
This setup is more complicated than the previous one. But it's faster to launch and recompile. We recommend this way.
This setup needs you to install the software on your machine.
-
install the software:
-
start the software
-
mongodb
brew services start [email protected]
-
redis
redis-server
-
solana localhost
solana-test-validator
-
-
run nest dev server
npm run start:dev
ngrok http 3030
More details are presented in slack document.
Create .local.env
under the root (the same level of .env
), and override the variables in the .env
.
Tip: If you want to use Macos local setup setup, you can copy all the variables in the
.env
, and paste them in.local.env
.
The following example shows how to create a patch version.
-
update
CHANGELOG.md
changelog -p
- patch:
-p
- minor:
-m
- major:
-M
Then, commit the change.
- patch:
-
update Swagger version (Optional)
In
main.ts
, updatesetVersion
to match the lastest versionCHANGELOG.md
. then, commit the change. -
update
version
inpackage
npm version <patch|minor|major>