cli icon indicating copy to clipboard operation
cli copied to clipboard

refactor: local registry

Open BioPhoton opened this issue 1 year ago โ€ข 2 comments

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.md and 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 verdaccio folder and created plugin to add targets dynamically
    • control port number
    • unique folder per port for storage and registry folder
    • added docs
  • npm
    • separated logic into npm folder 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
  • publish
    • separated logic into npm and publish folder 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
  • updates CONTRIBUTORS.md with 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.mjs all 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

BioPhoton avatar Aug 16 '24 02:08 BioPhoton

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 โ†‘ +12.5
Security ๐ŸŸข 100 ๐ŸŸข 98 โ†“ โˆ’1.6
Updates ๐ŸŸก 78 ๐ŸŸก 78 โ†“ โˆ’0.1
Code coverage ๐ŸŸก 90 ๐ŸŸก 90 โ†“ +0
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 โ†‘ +12.5
JS Packages NPM audit ๐ŸŸข 100 ๐ŸŸข 98 โ†“ โˆ’1.6
JS Packages NPM outdated dependencies ๐ŸŸก 78 ๐ŸŸก 78 โ†“ โˆ’0.1
Code coverage Code coverage metrics ๐ŸŸก 90 ๐ŸŸก 90 โ†“ +0

16 other groups are unchanged.

๐Ÿ›ก๏ธ Audits

๐Ÿ”Œ Plugin ๐Ÿ›ก๏ธ Audit ๐Ÿ“ Previous value ๐Ÿ“ Current value ๐Ÿ”„ Value change
Lighthouse Speed Index ๐ŸŸฅ 12.7ย s ๐ŸŸฅ 6.5ย s โ†“ โˆ’49โ€‰%
Lighthouse Largest Contentful Paint ๐ŸŸฅ 4.4ย s ๐ŸŸจ 3.3ย s โ†“ โˆ’25โ€‰%
Lighthouse First Meaningful Paint ๐ŸŸฅ 4.4ย s ๐ŸŸจ 3.3ย s โ†“ โˆ’25โ€‰%
Lighthouse First Contentful Paint ๐ŸŸฅ 3.8ย s ๐ŸŸฅ 3.3ย s โ†“ โˆ’13โ€‰%
JS Packages Vulnerabilities for NPM dev dependencies. ๐ŸŸฉ 0 vulnerabilities ๐ŸŸฉ 2 vulnerabilities (2 moderate) โ†‘ +โˆžโ€‰%
Lighthouse Time to Interactive ๐ŸŸฅ 24.6ย s ๐ŸŸฅ 15.8ย s โ†“ โˆ’36โ€‰%
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) โ†‘ +2โ€‰%
Code coverage Line coverage ๐ŸŸฉ 91.9 % ๐ŸŸฉ 91.9 % โ†“ +0โ€‰%
Lighthouse Minimizes main-thread work ๐ŸŸฅ 37.0ย s ๐ŸŸฅ 17.6ย s โ†“ โˆ’52โ€‰%
Lighthouse Total Blocking Time ๐ŸŸฅ 18,340ย ms ๐ŸŸฅ 5,230ย ms โ†“ โˆ’72โ€‰%
Lighthouse Metrics ๐ŸŸฉ 100% ๐ŸŸฉ 100% โ†“ โˆ’36โ€‰%
Lighthouse JavaScript execution time ๐ŸŸฅ 14.9ย s ๐ŸŸฅ 8.2ย s โ†“ โˆ’45โ€‰%
Lighthouse Max Potential First Input Delay ๐ŸŸฅ 5,460ย ms ๐ŸŸฅ 2,660ย ms โ†“ โˆ’51โ€‰%
Lighthouse Eliminate render-blocking resources ๐ŸŸฅ Potential savings of 1,500ย ms ๐ŸŸฅ Potential savings of 680ย ms โ†“ โˆ’55โ€‰%
Lighthouse Avoids enormous network payloads ๐ŸŸฉ Total size was 1,807ย KiB ๐ŸŸฉ Total size was 1,807ย KiB โ†“ +0โ€‰%
Lighthouse Reduce unused CSS ๐ŸŸฅ Potential savings of 106ย KiB ๐ŸŸฅ Potential savings of 106ย KiB โ†‘ +45โ€‰%
Lighthouse Network Round Trip Times ๐ŸŸฉ 20ย ms ๐ŸŸฉ 140ย ms โ†‘ +710โ€‰%
Lighthouse Uses efficient cache policy on static assets ๐ŸŸจ 27 resources found ๐ŸŸจ 27 resources found โ†“ +0โ€‰%
Lighthouse Initial server response time was short ๐ŸŸฉ Root document took 420ย ms ๐ŸŸฉ Root document took 500ย ms โ†‘ +18โ€‰%
Lighthouse Server Backend Latencies ๐ŸŸฉ 120ย ms ๐ŸŸฉ 180ย ms โ†‘ +53โ€‰%
Lighthouse Avoids an excessive DOM size ๐ŸŸฅ 2,213 elements ๐ŸŸฅ 2,212 elements โ†“ +0โ€‰%

489 other audits are unchanged.

github-actions[bot] avatar Aug 16 '24 02:08 github-actions[bot]

Nearly all of the above failed runs form revert nx-global setup on are format checks.

BioPhoton avatar Aug 19 '24 01:08 BioPhoton