Skip to content

refactor: migrate from semver to verkit - #1379

Merged
danielroe merged 1 commit into
mainfrom
refactor/verkit
Jul 24, 2026
Merged

refactor: migrate from semver to verkit#1379
danielroe merged 1 commit into
mainfrom
refactor/verkit

Conversation

@danielroe

Copy link
Copy Markdown
Member

🔗 Linked issue

📚 Description

see nuxt/nuxt#35713 for motivation

CopilotAI review requested due to automatic review settings July 24, 2026 21:45
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

DiffPackageSupply Chain
Security
VulnerabilityQualityMaintenanceLicense
Addedverkit@​0.3.07610010092100

View full report

@pkg-pr-new

Copy link
Copy Markdown
  • nuxt-cli-playground

    npm i https://pkg.pr.new/create-nuxt@1379
    
    npm i https://pkg.pr.new/nuxi@1379
    
    npm i https://pkg.pr.new/@nuxt/cli@1379
    

commit: 47c7159

@codspeed-hq

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 2 untouched benchmarks


Comparing refactor/verkit (47c7159) with main (b545a2b)

Open in CodSpeed

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the Nuxt CLI codebase to replace semver usage with verkit, aligning with the motivation described in nuxt/nuxt#35713 and reducing dependency on node-semver.

Changes:

  • Replace semver (coerce, satisfies) with verkit across nuxi runtime utilities and commands.
  • Update package dependencies and lockfile to remove semver / @types/semver and add verkit.
  • Update knip.json ignore lists to reflect the dependency migration.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
pnpm-lock.yamlRemoves semver/@types/semver from importers and adds verkit resolution/snapshots.
packages/nuxt-cli/package.jsonReplaces semver dependency with verkit.
packages/nuxi/src/utils/versions.tsSwitches coerce import to verkit and adjusts returned value usage accordingly.
packages/nuxi/src/utils/engines.tsReplaces dynamic semver import with static verkitsatisfies.
packages/nuxi/src/commands/module/add.tsSwaps satisfies import from semver to verkit.
packages/nuxi/src/commands/module/_utils.tsSwaps satisfies import from semver to verkit (note: callsites still pass includePrerelease).
packages/nuxi/src/commands/dev.tsSwaps satisfies import from semver to verkit.
packages/nuxi/package.jsonRemoves semver/@types/semver, adds verkit.
knip.jsonReplaces ignored dependency semver with verkit.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 9 to +11
import { $fetch } from 'ofetch'
import { resolve } from 'pathe'
import { satisfies } from 'semver'
import { satisfies } from 'verkit'
@coderabbitai

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Replaces semver with verkit across nuxi version checks and Nuxt version coercion. Engine checks now use a statically imported satisfies helper, while dependency-based Nuxt version fallback returns the coerced value directly. Package dependencies and development dependencies are updated, and verkit is added to the relevant Knip ignore list.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 0.00% which is insufficient. The required threshold is 80.00%.Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check nameStatusExplanation
Title check✅ PassedThe title clearly summarizes the main change: migrating from semver to verkit.
Description check✅ PassedThe description is related to the change and references the migration motivation.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/verkit

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
packages/nuxi/src/utils/versions.ts (1)

15-15: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add regression coverage for the new coerce return contract.

Line 15 now passes verkit.coerce(pkgDep) through directly instead of extracting .version. Add cases for npm ranges, prereleases, and invalid dependency specs to verify the result remains a string and preserves the behavior expected by checkNuxtCompatibility().

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@packages/nuxi/src/utils/versions.ts` at line 15, Add regression tests around
the version resolution used by checkNuxtCompatibility(), covering npm ranges,
prerelease versions, and invalid dependency specifications. Assert that the
coerce result is returned as a string and retains the expected compatibility
behavior, including the fallback for invalid inputs.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/nuxi/src/utils/versions.ts`:
- Line 15: Add regression tests around the version resolution used by
checkNuxtCompatibility(), covering npm ranges, prerelease versions, and invalid
dependency specifications. Assert that the coerce result is returned as a string
and retains the expected compatibility behavior, including the fallback for
invalid inputs.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: def40880-61e6-4c99-b00c-aaebfe946c74

📥 Commits

Reviewing files that changed from the base of the PR and between b545a2b and 47c7159.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (8)
  • knip.json
  • packages/nuxi/package.json
  • packages/nuxi/src/commands/dev.ts
  • packages/nuxi/src/commands/module/_utils.ts
  • packages/nuxi/src/commands/module/add.ts
  • packages/nuxi/src/utils/engines.ts
  • packages/nuxi/src/utils/versions.ts
  • packages/nuxt-cli/package.json

@danielroe
danielroe merged commit 4d65c82 into mainJul 24, 2026
21 checks passed
@danielroe
danielroe deleted the refactor/verkit branch July 24, 2026 21:59
This was referenced Jul 24, 2026
@github-actionsgithub-actionsBot mentioned this pull request Jul 29, 2026
This was referenced Aug 24, 2026
Sign up for freeto 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.

2 participants

@danielroe