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(resolve-dependencies): not update git protocol dependency when add unrelated dependency #7054

Merged
merged 7 commits into from
Sep 23, 2023

Conversation

await-ovo
Copy link
Member

fix #7008

… unrelated dependency

docs: add changeset

chore: package.json
@await-ovo await-ovo marked this pull request as draft September 5, 2023 16:12
@await-ovo await-ovo marked this pull request as ready for review September 7, 2023 09:59
dev: false

github.com/kevva/is-negative/219c424611ff4a2af15f7deeff4f93c62558c43d:
resolution: {registry: http://localhost:4873/, tarball: https://codeload.github.com/kevva/is-negative/tar.gz/219c424611ff4a2af15f7deeff4f93c62558c43d}
Copy link
Member

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

Copy link
Member Author

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 ?? '')
Copy link
Member

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.

Copy link
Member Author

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

@zkochan zkochan merged commit f394cfc into pnpm:main Sep 23, 2023
8 checks passed
nachoaldamav pushed a commit that referenced this pull request Sep 26, 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.

Installing packages bumps hash for unrelated git packages in lock file
2 participants