Skip to content
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

fix(link): change package version when exec link #4375

Closed
wants to merge 2 commits into from

Conversation

BlackHole1
Copy link
Member

Fixed: #4341

I will add the relevant unit tests tomorrow.
Before that, I need @zkochan your code review. I am not sure if this is a reasonable change.

@BlackHole1
Copy link
Member Author

I found it difficult to write unit tests for this change.
@zkochan Do you have any ideas?

@zkochan
Copy link
Member

zkochan commented Mar 30, 2022

Maybe the right way to fix this would be to update this function https://github.com/pnpm/pnpm/blob/main/packages/manifest-utils/src/updateProjectManifestObject.ts

The package spec here would expect a version not a pref. Then updateProjectManifestObject would look for the updated package in all dependencies fields (dev and optional deps as well). It would be also easier to cover that function with unit tests.

But there is an edge case. What to do when a user explicitly runs the command with --save-exact or --save-prefix. In this case, the existing dependency version prefix should be ignored.

@zkochan
Copy link
Member

zkochan commented May 7, 2023

It will be solved by this PR: #6513

@zkochan zkochan closed this May 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pnpm link should not change package.json
2 participants