Skip to content

RomanReznichenko/secbox-sdk-js

 
 

Repository files navigation

SecBox SDK for JavaScript

Maintainability Test Coverage Build Status NPM Downloads

Installation

To install all dependencies used by this project, issue this command in your terminal:

$ npm ci

Build

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.

Tests

Running unit tests

Run this command in terminal to execute the unit tests via Jest:

$ npm t

Running end-to-end tests

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.

Linting

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}

Formatting

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}

Contributing

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.

Creating publishable package

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

License

Copyright © 2022 NeuraLegion.

This project is licensed under the MIT License - see the LICENSE file for details.

About

Modularized SecBox SDK for JavaScript

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 96.7%
  • JavaScript 3.2%
  • Shell 0.1%