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(core): whitelist registries that support obtaining migration config via 'npm view' #16423

Merged
merged 2 commits into from
Apr 20, 2023

Conversation

CNManning
Copy link
Contributor

Current Behavior

Determining migration config for plugins that are published to a different registry than npmjs.org doesn't work if the registry doesn't support full package metadata. Such registries return no results via 'npm view' which causes migrate to think that no migrations are necessary.

Expected Behavior

Migrate will fallback to determining migration config via install in the event that no config is returned from 'npm view' for registries other then npmjs.org.

Related Issue(s)

Fixes #16387, #10223

…ig via 'npm view'

Registries other than npmjs.org may not support obtaining non standard package metadata via 'npm
view'.
In the event that migration config is not returned when using other registries, migration will
fallback to determining config using install.

closed nrwl#16387, nrwl#10223
@vercel
Copy link

vercel bot commented Apr 20, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Apr 20, 2023 8:16pm

Copy link
Member

@AgentEnder AgentEnder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me, I want to get 1 more opinion first.


// Registries other than npmjs and the local registry may not support full metadata via npm view
// so throw error so that fetcher falls back to getting config via install
if (!['registry.npmjs.org', 'localhost'].includes(registry)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yarn's registry just redirects to npmjs, and can be in lock files, but still shows npm's url for the tarball 🤔 interesting.

I think this is fine.

@FrozenPandaz FrozenPandaz merged commit a7c14fc into nrwl:master Apr 20, 2023
@github-actions
Copy link

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Plugin migrations not detected for plugins published to GitLab package registry
3 participants