feat(release): updateDependents generator option for versioning
Current Behavior
When releasing projects independently, if a dependent project is untouched directly by the changes, it will not have its version updated and there is no way to opt into this behavior.
Expected Behavior
When releasing projects independently, if a dependent project is untouched directly by the changes, BY DEFAULT it will not have its version updated, BUT you can opt into it always being updated via a generator option (release.version.generatorOptions.updateDependents.when = always and you can control what kind of semver bump should be applied to the otherwise unchanged dependent project. Transitive local dependents (A -> B -> C) will also be updated in this scenario.
Additionally, when opted into, such version only changes will appear in the changelog under a new Updated Dependencies section.
Related Issue(s)
Fixes #22268
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
| Name | Status | Preview | Updated (UTC) |
|---|---|---|---|
| nx-dev | ⬜️ Ignored (Inspect) | Visit Preview | May 2, 2024 10:30am |
☁️ Nx Cloud Report
CI is running/has finished running commands for commit eeca1fafb9242ffa56388e9de650301fa4f27a75. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.
📂 See all runs for this CI Pipeline Execution
✅ Successfully ran 4 targets
-
nx affected --targets=lint,test,build --base=2ee965042db22ae7b0276c3162daba35f5c74f4c --head=eeca1fafb9242ffa56388e9de650301fa4f27a75 --parallel=3 -
nx run-many -t check-imports check-commit check-lock-files check-codeowners documentation --parallel=1 --no-dte -
nx-cloud record -- nx format:check --base=2ee965042db22ae7b0276c3162daba35f5c74f4c --head=eeca1fafb9242ffa56388e9de650301fa4f27a75 -
nx documentation --no-dte
Sent with 💌 from NxCloud.
+1
@JamesHenry can you please check also the test transitive updateDependents with projects: Object.values(projectGraph.nodes), // version all projects
I was trying to update your test, But I'm not so sure about all snapshots.
We are using the nx release command with and nx configuration for projects like this "projects": ["libs/*", "!libs/workspace-extensions"], and when we do this for an dep. graph like this we will get strange output with your changes.
There is only one change in navigation, but the nx release will produce an changelog entry like this.
+ ## 1.0.2 (2024-04-22)
+
+
+ ### 🐞 Bug Fixes
+
+ - **ci:** fix ci ([*****](https://github.com/*****))
+
+
+ ### 🧱 Updated Dependencies
+
+ - Updated styles to null
+ - Updated badge to null
+ - Updated icons to null
+
+
+ ### ❤️ Thank You
+
+ - Matthias Hempel @fotopixel
I used this settings.
"updateDependents": {
"when": "auto",
"bump": "patch"
}
Hi @JamesHenry this would be a great addition to our setup. Any way I can help with this PR, to get it over the line?
Thank you!
Thanks @fotopixel I don't think using that unit test would help with what you are describing.
I added a filter to remove any dependency bumps where the newVersion is null, I believe that should take care of the issue you saw.
If you get chance to try the PR build again please let me know otherwise I will request final review on this
I'm really looking forward to this PR being completed.
I'm closing this one in favour of https://github.com/nrwl/nx/pull/23252 which will have enhanced caching for me directly on origin. We will get this merged very soon
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.