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): nx migrate should accept tags other than latest and next for community packages #15673

Merged
merged 3 commits into from
Mar 16, 2023

Conversation

AgentEnder
Copy link
Member

Current Behavior

nx migrate mypackage@alpha fails, resolves the version as 0.0.0 since the tag is not normalized properly.

Expected Behavior

nx migrate mypackage@alpha fails, resolves the version as 0.0.0 since the tag is not normalized properly.

Alt solutions:

Instead of resolving on the registry ahead of time, we could feasibly just inline a list of accepted tags. This wouldn't fix the issue in the general case, but realistically a list of ['prev', 'previous', 'next', 'latest', 'beta', 'alpha', 'rc', 'dev'] would likely hit most use cases.

Related Issue(s)

Fixes #15633

@vercel
Copy link

vercel bot commented Mar 14, 2023

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

Name Status Preview Comments Updated
nx-dev ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 16, 2023 at 4:25PM (UTC)

// This doesn't seem like a valid version, lets check if its a tag on the registry.
if (!coerce(version))
return normalizeVersion(
execSync(`npm view ${pkg}@version version`).toString().trim()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use packageRegistryView

@nx-cloud
Copy link

nx-cloud bot commented Mar 14, 2023

☁️ Nx Cloud Report

CI is running/has finished running commands for commit bf66b65. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

packages/nx/src/command-line/migrate.ts Outdated Show resolved Hide resolved
packages/nx/src/command-line/migrate.ts Outdated Show resolved Hide resolved
@mauriziovitale
Copy link
Contributor

Great stuff. @AgentEnder
Another issue I spot was that the last bit of a version was lost when it was like 6.0.0-A.3-8385

the version used was 6.0.0-A.3 because of a split taking care only of part[0] and part[1]

@FrozenPandaz FrozenPandaz merged commit 9791f31 into nrwl:master Mar 16, 2023
FrozenPandaz pushed a commit that referenced this pull request Mar 17, 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 Mar 21, 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.

nx migrate should handle any tag of type string
3 participants