-
-
Notifications
You must be signed in to change notification settings - Fork 937
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(resolve-dependencies): not update git protocol dependency when add unrelated dependency #7054
Conversation
… unrelated dependency docs: add changeset chore: package.json
3c68847
to
d76b2d0
Compare
dev: false | ||
|
||
github.com/kevva/is-negative/219c424611ff4a2af15f7deeff4f93c62558c43d: | ||
resolution: {registry: http://localhost:4873/, tarball: https://codeload.github.com/kevva/is-negative/tar.gz/219c424611ff4a2af15f7deeff4f93c62558c43d} |
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.
Why is there a registry field here? There should be no registry field for the git-hosted resolutions.
But even if I am not right, then I guess the registry field would have to be https://github.com
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.
Thanks for pointing out the problem here. It should be my mistake here. I can't remember where it came from.
@@ -13,7 +14,7 @@ export function pkgSnapshotToResolution ( | |||
): Resolution { | |||
if ( | |||
Boolean((pkgSnapshot.resolution as TarballResolution).type) || | |||
(pkgSnapshot.resolution as TarballResolution).tarball?.startsWith('file:') | |||
(pkgSnapshot.resolution as TarballResolution).tarball?.startsWith('file:') || isGitHostedPkgUrl((pkgSnapshot.resolution as TarballResolution).tarball ?? '') |
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.
This change doesn't really make a difference because git-hosted deps should not have a registry field.
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.
For git-hosted dependencies that are already installed, the resolution is now also read from the lockfile (except for pnpm update), and if we don't exclude the git-hosted dependencies here, the new resolution will come with the registry info.
The registry(http://localhost:4873
) in the test fixture above should be the result of not excluding the git-hosted dependency in my local tests
fix #7008