- How to start
- Angular workspace
- Debugging on External Workspaces
- Making a Contribution
- E2E test
- Smoke test
- Continuous Inspection (SonarQube)
- Test different node versions
- When are my changes going to be public?
As an essential start, you can start installing the project's dependencies:
yarn install
The development process and project architecture are like any other Nx Plugin.
The maintainers recommend having some knowledge about:
Watch this video to know pretty much everything about this plugin development; it's highly recommended.
To test the functionality on an Angular workspace, we need to perform some manual operations
-
Build the project
nx build ngx-deploy-npm
-
Go to the compiled files
cd dist/packages/ngx-deploy-npm
-
Create a local version of the package:
yarn link
yalc
yarn link
npx yalc link
-
On your Angular workspace and:
yarn link
(recomended)yalc
yarn link ngx-deploy-npm
npx yalc add ngx-deploy-npm
There are two ways of debugging:
⚡ Pre Step: follow the steps of yarn link as pre step
⚠️ Only works on VsCode!
- Place
debugger
statement or a red-point where you want your deployer to stop. - Build your project
nx build ngx-deploy-npm
.
On VsCode, create a JavaScript Debug Terminal and execute the command that you want to debug
⚡ Pre Step: follow the steps of yarn link as pre step
-
Use your favorite Inspector Client to debug
-
Now, run your command on debug mode using:
node --inspect-brk ./node_modules/@nx/cli/bin/nx
-
Use your favorite Inspector Client to debug
This is the standard procedure to debug a NodeJs project. If you need more information, you can read the official Docs of NodeJs to learn more about it.
https://nodejs.org/de/docs/guides/debugging-getting-started/
- Verify the issues. Maybe your problem or request already has been addressed by another member of the community
- Fork it
- Create your branch
- Create your commits using our guidelines
- If you need help use
yarn commit
- We use the commit history to generate the changelog automagically, do your best describing the changes that you introduce 😄. Creating the commit right is essential.
- We encourage the use of Unit Tests for the fixes and new features. Don't you know how to write Unit Tests? Don't let that stop your contribution; we are here to help 👋.
- If you need help use
- Make a PR against
main
- Wait for the review
- Merge and Party 🎉
We at this project have E2E tests. They are handy to test production-like scenarios and to have confidence in your changes.
We conduct a series of small and pragmatic e2e tests called the smoke test. This test is essential for testing the package's core functionality.
Using the smoke tests, we composed a series of more elaborate tests. Such as:
- Compatibility Observability Test: Scheduled test to verify daily if our package is working with the
latest
version of nx - Backwards Compatibility Test: To verify if the current changes work correctly with the supported versions of nx that we are committed to maintaining (see Compatibility overview with Nx ).
It's essential to handle the libraries' build before running these tests. These tests will use whatever is in the dist folder. This is done using the build closest to the actual build on the NPM registry.
We have continuous inspection for each PR that is made; we use SonarQube for this. It will suggest some changes, detect code smells in your changes and, security recommendations. We encourage implementing the changes that Sonar offers.
If you are changing the Sonar configuration file is highly recommended to test the changes locally.
To init the server
npm run sonar:init-server
To run the analysisnpm run sonar:analysis
To inspect the analysis, go to http://localhost:9000. The credentials are admin
and password 12345
Here, we run the unit, e2e, and regression tests against different node versions in our CI. We use the Nx NodeJs Compatibility Matrix to determine which versions should be tested.
The retro compatibility tests are a bit different since we match the Nx Workspace Version with the supported Node versions.
For local development, stick to the one defined in the .npmrc
file.
The CI handles the publishment of a new version. We use GitHub actions as CI.
When the maintainers integrate your PR to main
, go to the main branch actions and search for the one that belongs to you. The CI will run some tests, if they pass, the next job that publishes your introduced changes will be on hold waiting for approval; once the maintainers approve the launching, your changes will be packed and posted to NPM.