Skip to content

r2d2bzh package to enforce rules for JS backend projects

Notifications You must be signed in to change notification settings

Zatchou/js-backend-rules

 
 

Repository files navigation

js-backend-rules

⚠️

This project requires the following minimal engine versions:

link:package.json[role=include]

The r2d2bzh product stack is composed of multiple NodeJS micro-services. The projects hosting these micro-services need to be structured with the same rules. As anyone can easily forget these many rules, js-backend-rules comes to the rescue.

📎

Some of these rules are already taken care of by @r2d2bzh/js-rules on which js-backend-rules relies. It is strongly advised to read the README of @r2d2bzh/js-rules.

Install

You need to add the following NPM development dependency to the project that needs to be ruled (which means here scaffolded/structured/checked/…​):

npm install --save-dev @r2d2bzh/js-backend-rules

Once installed, @r2d2bzh/js-rules provides the r2d2bzh-js-backend-rules executable from the node_modules executables. To ensure that the rules are enforced, call this executable by issuing npx r2d2bzh-js-backend-rules, this will:

  • ensure that the rules are enforced over time by launching r2d2bzh-js-backend-rules during the postinstall step of npm

  • immediately apply all the rules to the whole project

🔥
You should preferably commit your project’s current content to ensure nothing is lost in the process.

Adding a new service

Once installed, js-backend-rules provides the r2d2 npm script.

To add a new service to the project, issue the following command from the project’s root directory:
npm run r2d2 add <newServiceName>

About

r2d2bzh package to enforce rules for JS backend projects

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 83.7%
  • Dockerfile 14.7%
  • Shell 1.6%