refactor: local registry
Precondition:
- #796
[!NOTE] It looks rather chunky but 25 of the files are renaming a target and 5 files are deleted. To make it easier to review I added comments for the deleted code blocks and their new location. I also added excessive docs to help debug and explain the current situation.
I suggest starting with the
CONTRIBUTING.mdand then dive into the comments.
This PR does not change the previous flow nor fixes bigger issues in the setup. It focuses on maintainability and documentation as well as good error handling and user feedback.
This PR includes:
- move all files to TS ๐ฅ
-
verdaccio
- separated logic into
verdacciofolder and created plugin to add targets dynamically - control port number
- unique folder per port for storage and registry folder
- added docs
- separated logic into
-
npm
- separated logic into
npmfolder and created plugin to add targets dynamically - intro bin folder for all executed scripts and added error handling and process exit
- dynamic targets:
-
nx npm-check <project-name> --pkgVersion=<version> -
nx npm-install <project-name> --pkgVersion=<version> --registry=<registry> --tag=<tag> -
nx npm-uninstall <project-name> --pkgVersion=<version> --registry=<registry> --tag=<tag> - added docs
-
- separated logic into
-
publish
- separated logic into
npmandpublishfolder and created plugins to add targets dynamically - intro bin folder for all executed scripts and added error handling and process exit
- untangle Nx graph logic out of publish script
- install packages only if they do not exist in the registry already
-
nx npm-check <project-name> --pkgVersion=<version> -
nx publish <project-name> --nextVersion=<version> --registry=<registry> --tag=<tag>
-
- added docs
- separated logic into
- updates
CONTRIBUTORS.mdwith information on the current e2e process
Before:
-
nx e2e cli-e2e-
global-setup.e2e.ts-
tools/scripts/start-registry.ts- one globally shared registry-
publish.mjsall packages -
npm install <package-name>all packages
-
-
npm uninstall <package-name>all packages
-
-
After:
-
nx e2e cli-e2e-
global-setup.e2e.ts-
nx start-verdaccio- one registry per e2e project but still one globally shared npm env (node_modules folder, npm config) -
nx publish <project-name>all packages -
nx npm-install <project-name>all packages -
nx npm-uninstall <project-name>all packages
-
-
Code PushUp
๐คจ Code PushUp report has both improvements and regressions โ compared target commit bece330baa2d762f47466e872d87dcca6fbcbe22 with source commit f8f6b7404cfd765f204e0a924746b2539cde52ff.
๐ต๏ธ See full comparison in Code PushUp portal ๐
๐ท๏ธ Categories
| ๐ท๏ธ Category | โญ Previous score | โญ Current score | ๐ Score change |
|---|---|---|---|
| Performance | ๐ด 38 | ๐ก 50 | |
| Security | ๐ข 100 | ๐ข 98 | |
| Updates | ๐ก 78 | ๐ก 78 | |
| Code coverage | ๐ก 90 | ๐ก 90 | |
| Custom checks | ๐ก 67 | ๐ก 67 | โ |
| Accessibility | ๐ข 91 | ๐ข 91 | โ |
| Best Practices | ๐ข 100 | ๐ข 100 | โ |
| SEO | ๐ก 61 | ๐ก 61 | โ |
| Bug prevention | ๐ข 100 | ๐ข 100 | โ |
| Code style | ๐ข 99 | ๐ข 99 | โ |
๐ 1 group improved, ๐ 3 groups regressed, ๐ 5 audits improved, ๐ 3 audits regressed, 13 audits changed without impacting score
๐๏ธ Groups
| ๐ Plugin | ๐๏ธ Group | โญ Previous score | โญ Current score | ๐ Score change |
|---|---|---|---|---|
| Lighthouse | Performance | ๐ด 38 | ๐ก 50 | |
| JS Packages | NPM audit | ๐ข 100 | ๐ข 98 | |
| JS Packages | NPM outdated dependencies | ๐ก 78 | ๐ก 78 | |
| Code coverage | Code coverage metrics | ๐ก 90 | ๐ก 90 |
16 other groups are unchanged.
๐ก๏ธ Audits
| ๐ Plugin | ๐ก๏ธ Audit | ๐ Previous value | ๐ Current value | ๐ Value change |
|---|---|---|---|---|
| Lighthouse | Speed Index | ๐ฅ 12.7ย s | ๐ฅ 6.5ย s | |
| Lighthouse | Largest Contentful Paint | ๐ฅ 4.4ย s | ๐จ 3.3ย s | |
| Lighthouse | First Meaningful Paint | ๐ฅ 4.4ย s | ๐จ 3.3ย s | |
| Lighthouse | First Contentful Paint | ๐ฅ 3.8ย s | ๐ฅ 3.3ย s | |
| JS Packages | Vulnerabilities for NPM dev dependencies. | ๐ฉ 0 vulnerabilities | ๐ฉ 2 vulnerabilities (2 moderate) | |
| Lighthouse | Time to Interactive | ๐ฅ 24.6ย s | ๐ฅ 15.8ย s | |
| JS Packages | Outdated NPM dev dependencies. | ๐จ 55 outdated package versions (30 major, 19 minor, 5 patch, 1 prerelease) | ๐จ 56 outdated package versions (31 major, 18 minor, 6 patch, 1 prerelease) | |
| Code coverage | Line coverage | ๐ฉ 91.9 % | ๐ฉ 91.9 % | |
| Lighthouse | Minimizes main-thread work | ๐ฅ 37.0ย s | ๐ฅ 17.6ย s | |
| Lighthouse | Total Blocking Time | ๐ฅ 18,340ย ms | ๐ฅ 5,230ย ms | |
| Lighthouse | Metrics | ๐ฉ 100% | ๐ฉ 100% | |
| Lighthouse | JavaScript execution time | ๐ฅ 14.9ย s | ๐ฅ 8.2ย s | |
| Lighthouse | Max Potential First Input Delay | ๐ฅ 5,460ย ms | ๐ฅ 2,660ย ms | |
| Lighthouse | Eliminate render-blocking resources | ๐ฅ Potential savings of 1,500ย ms | ๐ฅ Potential savings of 680ย ms | |
| Lighthouse | Avoids enormous network payloads | ๐ฉ Total size was 1,807ย KiB | ๐ฉ Total size was 1,807ย KiB | |
| Lighthouse | Reduce unused CSS | ๐ฅ Potential savings of 106ย KiB | ๐ฅ Potential savings of 106ย KiB | |
| Lighthouse | Network Round Trip Times | ๐ฉ 20ย ms | ๐ฉ 140ย ms | |
| Lighthouse | Uses efficient cache policy on static assets | ๐จ 27 resources found | ๐จ 27 resources found | |
| Lighthouse | Initial server response time was short | ๐ฉ Root document took 420ย ms | ๐ฉ Root document took 500ย ms | |
| Lighthouse | Server Backend Latencies | ๐ฉ 120ย ms | ๐ฉ 180ย ms | |
| Lighthouse | Avoids an excessive DOM size | ๐ฅ 2,213 elements | ๐ฅ 2,212 elements |
489 other audits are unchanged.
Nearly all of the above failed runs form revert nx-global setup on are format checks.