-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for workspace level targets #10002
Comments
Hello Nx Team 👋 Unfortunately I had to:
From my knowledge, apart from this lint issue, there is no problem using this "virtual root project", but maybe it could conflict with some Nx internals i'm not aware of. The output of the workspace-lint command (v13.9.5):
We tried to change |
Hey @edbzn! I'm commenting back here with some of our thoughts after discussing this internally and giving the go-ahead if anyone would like to start working on impl (none of us have picked up that torch just yet). We agree, and this is a feature that's been talked about a few times before. Generally, our stance in the past has been "use npm scripts in the root package.json," but there are some things that doing it in that way doesn't quite capture. Using npm scripts, you miss out on:
Implementing this feature wouldn't be trivial, and it would need to update several places. After implementation, we imagine that it would work something like this:
If anyone plans on picking this up, let me know, and I can assign the issue to you (or if you have permissions, assign it yourself). I'll try to be responsive and help out as needed. |
Closing this as root-level scripts landed in Nx 15.3. Good job guys! |
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context. |
Description
Hi there, I'm working on @jscutlery/semver an Nx plugin for versioning your workspace. The plugin works with two modes inspired by Lerna, independent mode and sync mode. The independent mode releases each project independently with a separated tag, changelog, etc... Nx is working well for this use case but the problem comes from the second mode, the sync one.
The sync mode releases the whole workspace (multiple projects and root changelog file) with one single command like so:
To be able to do that we introduced an installation generator that tweaks the workspace definition by creating a virtual project named "workspace" with
"root"
property equal to"."
, this hack allows us to run the executor on the workspace level instead of the project level (since executors are usually defined in theproject.json
and scoped to a particular project).Here is a repository that uses that hack, you can see a root
project.json
.Motivation
Since Nx 13 this virtual "workspace" project hack based on the
"root"
property equal to"."
is not working anymore, that's why I would like to discuss the possibility of supporting workspace-level executors natively in Nx. This could be useful for any tool that needs to run something globally on the workspace. In the same way, we already have workspace generators that can update multiple projects at once.Suggested Implementation
Before going into the implementation I would like to discuss the viability of this workspace level executor idea. Is there any alternative solution for this? Maybe using NPM scripts and plain Node.js scripts, but we loose the consistency that Nx brings.
The text was updated successfully, but these errors were encountered: