nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.81k stars 2.38k forks source link

Cannot Exclude Applications from Versioning and Release Process While Updating Dependencies with nx release #28118

Open Louis345 opened 2 months ago

Louis345 commented 2 months ago

Current Behavior

I'm using Nx to manage a monorepo that contains both libraries and applications. I want to release anew version of my libraries and update the dependencies in my applications to use these new library versions. However, I do not want to version or release the applications themselves during this process.

Despite setting "private": true in the applications' package.json files, the nx release and nx release version commands still:

Increment the versions of the applications. Include applications in the release process. Attempts to create tags

Do not update the dependencies in the applications' package.json files unless the applications are included in the release process. When using the project list filter, the negations are not respected when the "updateDependents": "auto", is set.

The main problem is when i mark updateDepdents in the nx config it ignores my filter and still attempts to release the applications.

Expected Behavior

Applications marked with "private": true in their package.json files should be excluded from the versioning and release process.

Dependencies in applications should be updated to reference the latest versions of the libraries without incrementing the applications' own versions or including them in the release.

The --projects option should support negations in the project list when running nx release commands to allow dynamic exclusion of certain projects (e.g., applications).

Additionally, when trying to exclude applications using negations in the project list filter (e.g., nx release version --projects="*, !apps/**") (perhaps this can be a new feature?), the negations are not respected. Negations work in the configuration files but not when passed directly via the command line.

GitHub Repo

No response

Nx Report

Node           : 18.20.4
OS             : darwin-arm64
Native Target  : aarch64-macos
yarn           : 4.3.0

nx (global)    : 19.6.2
nx             : 19.5.7
@nx/js         : 19.5.7
@nx/workspace  : 19.5.7
@nx/devkit     : 19.5.7
@nrwl/tao      : 19.5.7
typescript     : 5.4.4

Failure Logs

No response

Package Manager Version

No response

Operating System

Additional Information

No response

akinoccc commented 2 weeks ago

same issue

JamesHenry commented 2 weeks ago

Applications marked with "private": true in their package.json files should be excluded from the versioning and release process

This is not correct. Packages which are marked as private should not be published to a registry, but they should still be versioned in order to avoid stale dependency references. A private package does not need to have its own version field.

If you are versioning your packages and applications separately (but by the sounds of it both with nx release at some point?) you could leverage release groups and pass -g with the name of the packages groups when versioning those.

Does that work for your use-case?

Can you please be a bit more concrete about the setup in question and where the limitations are? E.g. by providing a minimal reproduction?

github-actions[bot] commented 1 week ago

This issue has been automatically marked as stale because no reproduction was provided within 7 days. Please help us help you. Providing a repository exhibiting the issue helps us diagnose and fix the issue. Any time that we spend reproducing this issue is time taken away from addressing this issue and other issues. This issue will be closed in 21 days if a reproduction is not provided. If a reproduction has been provided, please reply to keep it active. Thanks for being a part of the Nx community! 🙏

Louis345 commented 1 week ago

Thank you I will look into this.

github-actions[bot] commented 1 day ago

This issue has been automatically marked as stale because no reproduction was provided within 7 days. Please help us help you. Providing a repository exhibiting the issue helps us diagnose and fix the issue. Any time that we spend reproducing this issue is time taken away from addressing this issue and other issues. This issue will be closed in 21 days if a reproduction is not provided. If a reproduction has been provided, please reply to keep it active. Thanks for being a part of the Nx community! 🙏