gioragutt / nx-pwm Goto Github PK
View Code? Open in Web Editor NEWPlugin and CLI for managing nx workspaces of packages, inspired by the tooling in nrwl/nx
License: MIT License
Plugin and CLI for managing nx workspaces of packages, inspired by the tooling in nrwl/nx
License: MIT License
The init generator should
.nx-pwm.json
fileTemplate for the config file:
{
"$schema": "./node_modules/nx-pwm/src/lib/config-schema.json",
"versionType": "independent",
"depcheck": {
"ignore": {
"discrepancies": {
"*": []
},
"missing": {
"*": []
}
}
}
}
I need to test all of this, it's time.
nx-packages
andnx-plugins
are repos internal to my company. Both are packages workspaces, the plugins repo is synced-versions, and the packages repo is independent.
File Name | Purpose | Notes |
---|---|---|
tools/check-lock-files.js | Ensures that there’s no lock file but yarn.lock, and ensures that yarn.lock does not reference the local registry | |
tools/check-versions.ts | Checks library package json files, and dependencies that have newer versions | Contains a check to ignore libraries that are part of the repo |
tools/depcheck/discrepancies.ts | Looks for dependencies in project package.json files that do not satisfy the root package.json (or vice versa) | |
tools/depcheck/missing.ts | Uses the depcheck module to find missing imports in projects | |
tools/depcheck/index.ts | CLI entry point for running the discrepancies/missing checks are reporting those | Contains a check to ignore libraries that are part of the repo |
tools/library-publishing-plugin.js | NX Plugin that adds version/publish targets to packages | Only relevant for independent-versions libraries |
tools/local-registry.sh | Manages setting-up/tearing down and configuring package managers to work with verdaccio | |
tools/local-registry/config.yml | Verdaccio config | our configs might be invalid since it still only references @nrwl packages as a special case, something that we might be missing out |
tools/package.ts | Builds packages and updates the built package.json for local or prod publishing | |
tools/scripts/publish.mjs | Script generated by NX itself to be a good default script for publishing repositories | |
tools/tsconfig.scripts.json | tsconfig for .ts scripts | |
tools/tsconfig.tools.json | tsconfig generated by NX, difference is "rootDir": "*" | |
tools/workspace-utils.ts | Utility module that exports metadata about projects in the repository for other scripts |
File Name | Purpose | Notes |
---|---|---|
tools/check-lock-files.js | Same as in nx-packages | |
tools/check-versions.ts | Intended for use in plugins which have a lib/utils/versions.ts package. Checks for newer versions of packages specified there. | Requires external configuration to differentiate between scoped packages and other packages. |
tools/depcheck/discrepancies.ts tools/depcheck/index.ts tools/depcheck/missing.ts |
Should be the same as in nx-packages. | TODO: diff the code |
tools/find-affected.js | Basically a hack until affected --tags is added | Should be a reusable github action |
tools/local-registry.sh tools/local-registry/config.yml |
Same as in nx-packages | |
tools/nx-release.js | Script to release all packages in a synced-version workspace | |
tools/package.js | Should be more or less the same as in nx-packages, there is definitely a difference tho. | CHECKITOUT |
tools/publish.sh | Utility script of nx-release.js to publish all the packages | |
tools/tsconfig.scripts.json tools/tsconfig.tools.json |
Same as in nx-packages |
File Name | Purpose | Notes |
---|
Provides tooling for developing, validating, and optionally building & publishing packages in an NX workspace.
TODO: Check how the semver plugin works for synced-version. Perhaps nx-release.js is deprecated.
Take on the local-registry utility, improve it, add a status utility, etc.
check-version.ts
should be consolidated to a single tool and have it check plugins and normal libraries simultaneously.
Perhaps check-lock-files
should be adjusted to allow different package managers?
nx-pwm
should be a CLI so that it can be used the following way:
$ yarn add -D nx-pwm
$ yarn pwm check-versions
$ yarn pwm depcheck
nx-pwm
should also be a plugin so that it can be used the following way:
$ yarn add -D nx-pwm
$ yarn nx g nx-pwm:install
As far as I'm concerned, nx-pwm
can be generated with @nrwl/nx-plugin
.
This does limit the ability to extract logic to nx-based libraries.
For now, this is acceptable. If I want to extract certain behaviors to libraries, I might as well make nx-pwm
modular and publish the behaviors.
TBD
Please make this compatible with the newest version of Nx 👍
Also, add a status
subcommand to help users understand what registry they are using, and if possible - where it is configured.
See: https://github.com/gioragutt/nx-pwm/blob/main/packages/nx-pwm/package.json
To temporarily resolve, i've added the following overrides to my package.json
:
"overrides": {
"@nrwl/devkit@^15.2.4": "15.4.2",
"@nrwl/workspace@^15.2.4": "15.4.2",
"nx@^15.2.4": "15.4.2"
}
it fails to require the .ts
file due to export const ...
Can be done before #2 or after it
Tools to add:
husky
commitlint
commitizen
cz-customizable
Make sure every change is documented and automatable.
Think about incorporating https://github.com/jscutlery/semver into the automation.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.