To install all dependencies used by this project, issue this command in your terminal:
$ npm ci
The project can be built manually by issuing the following command:
npm run build -- ${lib}
The build artifacts will be stored in the dist
folder.
Run this command in terminal to execute the unit tests via Jest:
$ npm t
Run his command in terminal to execute the end-to-end tests:
$ npm run e2e
Set NODE_ENV
variable to test
if you want to use test mock and stubs, to reduce overhead.
This project uses ESLint for code linting.
⚡ ESLint can be configured via
.eslintrc.json
file in the project root folder.
To lint all the apps and modules by running:
$ npm run nx run-many --all --target lint
To lint single module, run this command in terminal:
$ npm run lint -- ${lib}
To lint multiple modules at once:
$ npm run nx run-many -- --target=lint --projects=${lib},${lib1}
This project uses Prettier for code formatting.
⚡ ESLint can be configured via
.prettierrc
file in the project root folder.
To format all the apps and modules by running:
$ npm run nx run-many --all --target format
To format single module, run this command in terminal:
$ npm run format -- ${lib}
To format multiple modules at once:
$ npm run nx run-many -- --target=format --projects=${lib},${lib1}
To ensure consistency throughout the source code, keep these rules in mind as you are working:
- Inspect the format, syntax errors, deviations before pushing to the branch.
- Don't use transpilation mode of the compiler. You can use it only to debug.
- We love OOP and, whenever possible, prefer them over closures and functions.
⚡ We use husky, commitlint and lint-staged, they will help you to follow these rules.
Issue the following command to generate a new package:
$ nx generate @nrwl/node:lib ${lib} --importPath=@secbox/${lib}
⚡ It is important to have a clean git working directory before invoking a generator so that you can easily revert changes and re-invoke the generator with different inputs.
This will create a new library inside the working directory according to the schematic.
To generate the publish
executor to release a package, you just need to issue the following command:
nx workspace-generator publish ${lib} --buildTarget ${lib}:build
Copyright © 2022 NeuraLegion.
This project is licensed under the MIT License - see the LICENSE file for details.