Reference repo for JS API project.
- We will use yarn to enable monorepo
- Not tested in M$ Windows.
This project requires mongodb server. You can easily set it up using docker compose. A docker-compose.yml
is included in the repo.
docker compose up -d
Example commands
# install all packages
yarn
# run npm script in root
yarn <script-name>
yarn lint-staged
# install an npm package in root project
yarn add some-package
yarn add serverless
yarn add -D prettier
# run npm script in sub package
yarn workspace <project-name> <script-name>
yarn workspace model lint
yarn workspace model test
# install an npm package in sub project
yarn workspace <project-name> add some-package
yarn workspace model add mongoose
yarn workspace model add -D eslint
We use prettier to format our codes and eslint to lint,
VSCode extensions:
We use lint-staged and husky to make this happen.
To configure, edit the file .lintstagedrc.json. For more info, go to lint-staged documentation.
# One time execution
yarn workspace <package-name> test
yarn workspace model test
# Run every time a file has changed
yarn workspace <package-name> test:watch
yarn workspace model test:watch
# One time execution
yarn workspace <package-name> build
yarn workspace model build
# Run every time a file has changed
yarn workspace <package-name> build:watch
yarn workspace model build:watch
Coming soon.
Coming soon.
Coming soon.
Coming soon.
Coming soon.
Coming soon.
Coming soon.