Generate a valid tarball url when publishing#987
Merged
Conversation
4068d2e to
d876fe9
Compare
nicolo-ribaudo
added a commit
to babel/babel
that referenced
this pull request
Feb 23, 2020
arcanis
reviewed
Feb 23, 2020
Comment on lines
+2
to
+30
| "@yarnpkg/builder": prerelease | ||
| "@yarnpkg/cli": prerelease | ||
| "@yarnpkg/core": prerelease | ||
| "@yarnpkg/doctor": prerelease | ||
| "@yarnpkg/plugin-compat": prerelease | ||
| "@yarnpkg/plugin-constraints": prerelease | ||
| "@yarnpkg/plugin-dlx": prerelease | ||
| "@yarnpkg/plugin-essentials": prerelease | ||
| "@yarnpkg/plugin-exec": prerelease | ||
| "@yarnpkg/plugin-file": prerelease | ||
| "@yarnpkg/plugin-git": prerelease | ||
| "@yarnpkg/plugin-github": prerelease | ||
| "@yarnpkg/plugin-http": prerelease | ||
| "@yarnpkg/plugin-init": prerelease | ||
| "@yarnpkg/plugin-interactive-tools": prerelease | ||
| "@yarnpkg/plugin-link": prerelease | ||
| "@yarnpkg/plugin-node-modules": prerelease | ||
| "@yarnpkg/plugin-npm": prerelease | ||
| "@yarnpkg/plugin-npm-cli": prerelease | ||
| "@yarnpkg/plugin-pack": prerelease | ||
| "@yarnpkg/plugin-patch": prerelease | ||
| "@yarnpkg/plugin-pnp": prerelease | ||
| "@yarnpkg/plugin-stage": prerelease | ||
| "@yarnpkg/plugin-typescript": prerelease | ||
| "@yarnpkg/plugin-version": prerelease | ||
| "@yarnpkg/plugin-workspace-tools": prerelease | ||
| "@yarnpkg/pnp": prerelease | ||
| "@yarnpkg/pnpify": prerelease | ||
| vscode-zipfs: prerelease |
Member
There was a problem hiding this comment.
Not a blocker, but in this case you only need to bump plugin-npm (for direct consumers) and cli (for a new binary to be released). The others don't need to be bumped.
| // other registries such as verdaccio. | ||
| const tarballName = `${name}-${version}.tgz`; | ||
| const tarballURL = new URL(`${name}/-/${tarballName}`, registry); | ||
| if (tarballURL.protocol === "https:") tarballURL.protocol = "http:"; |
Member
There was a problem hiding this comment.
🤨 What do you think of omitting this line if it works without? I don't understand it (all tarball fields returned from the registry are expected to be https), and it sounds counterintuitive and potentially dangerous.
d876fe9 to
74da6a3
Compare
1 task
nicolo-ribaudo
added a commit
to babel/babel
that referenced
this pull request
Feb 23, 2020
This reverts commit 1af74d9. See yarnpkg/berry#988
Contributor
Author
|
This seems to work in our tests. |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's the problem this PR addresses?
Packages published on a verdaccio registry had the wrong tarball URL, making it impossible to download them.
How did you fix it?
I copied the logic used by lerna (https://github.com/evocateur/libnpmpublish/blob/latest/publish.js#L142).
I couldn't find any test for the
npm publishcommand, but I'll check if this works with Babel.