-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
feat(devkit): add a flag to keep existing versions when calling addDependenciesToPackageJson #21123
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 4fa2cb2. 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 6 targets
Sent with 💌 from NxCloud. |
46c5a7e
to
9f32096
Compare
9f32096
to
b31bbc2
Compare
@@ -227,12 +240,24 @@ function removeLowerVersions( | |||
) { | |||
return Object.keys(incomingDeps).reduce((acc, d) => { | |||
if ( | |||
existingDeps?.[d] && | |||
!isIncomingVersionGreater(incomingDeps[d], existingDeps[d]) | |||
!existingDeps?.[d] || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not imagine this function should change at all in this change.
b31bbc2
to
7e27411
Compare
7e27411
to
911e58e
Compare
911e58e
to
2ed6ae1
Compare
2ed6ae1
to
5131029
Compare
5131029
to
8f60b29
Compare
8f60b29
to
76c16e8
Compare
76c16e8
to
c570219
Compare
…pendenciesToPackageJson
c570219
to
4fa2cb2
Compare
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. |
This PR adds a flag to
addDependenciesToPackageJson
function in devkit to prevent versions from being bumped. This will be used in init generators since usingnx init
andnx add
should not bump versions and risk breaking existing projects.Example:
If existing
package.json
already has[email protected]
, then calling this function:Will leave
next
at existing version of13.4.0
.Notes
addDependenciesToPackageJson(tree, {...}, {...}, customPackageJsonPath)
, unless we do function overrides.