-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
feat(@turbo/codemod): add support for custom NPM registries #9803
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Someone is attempting to deploy a commit to the Vercel Team on Vercel. A member of the Team first needs to authorize it. |
851efda
to
be0f731
Compare
@@ -12,9 +12,12 @@ interface PackageDetailsResponse { | |||
} | |||
|
|||
async function getPackageDetails({ packageName }: { packageName: string }) { | |||
const registry = | |||
process.env.npm_config_registry?.replace(/\/$/, "") || DEFAULT_REGISTRY; |
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.
Can you explain the reason for this .replace
here? grep.app doesn't show me any prior art for this, though without the regex does. I'm figuring there's something I'm missing, just can't tell what it is.
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.
The reason is to convert https://registry.npmjs.org/
to https://registry.npmjs.org
Happy to remove it though.
Fixes #4152
Description
NPM (and alternative tools like PNPM) pass the registry as an environment variable
npm_config_registry
.This allows the
codemod
package to use it when present (which is often the case).Testing Instructions
turbo-codemod
turbo run build
dist/cli.js migrate --to=latest --force
(maybe play with otherto
values also)