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!: save the whole tarball URL, when it doesn't use the standard format #6265

Merged
merged 3 commits into from
Mar 23, 2023

Conversation

zkochan
Copy link
Member

@zkochan zkochan commented Mar 23, 2023

pnpm doesn't store the URLs to package tarballs, when the package tarball URL may be calculated automatically using the registry, package name and version.

For instance, if we know that the package is hosted in the https://registry.npmjs.org registry and the name of the package is is-odd and the version of the package is 1.0.0, then we know that we can download the tarball from:

https://registry.npmjs.org/is-odd/-/is-odd-1.0.0.tgz

However, if the registry uses a different URL format for storing the tarballs, then we can't calculate it automatically and in this case we need to store that tarball URL in the lockfile. Currently, we don't store the whole URL in the lockfile, just the URL path. So, for instance, if the tarball was hosted at https://registry.npmjs.org/tar/is-odd@1.0.0.tgz, then we would add this to the lockfile:

tarball: tar/is-odd@1.0.0.tgz

The disadvantage of this approach is that if someone changes the registry and tries to run pnpm install, installation will probably fail with a 404 error because the other registry may use a different tarball URL.

@zkochan zkochan changed the title fix!: save the whole tarball URL, when in doesn't use the standard format fix!: save the whole tarball URL, when it doesn't use the standard format Mar 23, 2023
@zkochan zkochan requested a review from a team March 23, 2023 20:32
@zkochan zkochan added this to the v8.0 milestone Mar 23, 2023
@zkochan zkochan merged commit 1d105e7 into main Mar 23, 2023
@zkochan zkochan deleted the lockfile-url branch March 23, 2023 23:36
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.

None yet

2 participants