Skip to content

fix(deps): key dependency patches by whole major - #707

Merged
harlan-zw merged 1 commit into
mainfrom
fix/nitro-patch-range-followups
Nov 18, 2026
Merged

harlan-zw merged 1 commit into
mainfrom
fix/nitro-patch-range-followups

Conversation

@harlan-zw

Copy link
Copy Markdown
Collaborator

🔗 Linked issue

Follow-up to the logged findings on #702. No GitHub issue.

❓ Type of change

  • 📖 Documentation
  • 🐞 Bug fix
  • 👌 Enhancement
  • ✨ New feature
  • 🧹 Chore
  • ⚠️ Breaking change

📚 Description

#702 keyed each patch by a caret range such as nitropack@^2.13.4. pnpm still skips a copy outside that range without a warning, so an older 2.x copy would ship unpatched, which is the failure #702 fixed. Each patch is now keyed by its whole major (hookable@5, hookable@6, nitropack@2): any copy in the major takes the patch, or the install fails.

Two gaps in the Vitest alias from #702 are also closed:

  • The nitropack/runtime prefix alias also caught nitropack/runtime/meta, a separate export, which then failed to resolve. It now has its own alias.
  • If @nuxt/nitro-server stops depending on nitropack, the config now throws instead of resolving pnpm's hoisted copy, which the build may not bundle.

🤖 AI disclosure: Harlan Agent Kit modified this description. My AI open-source policy.

A range such as ^2.13.4 still skips an older copy in the same major
without a warning, which is the failure #702 fixed. Each patch now
covers its whole major, so any copy takes the patch or fails install.

The Vitest prefix alias for nitropack/runtime also caught the separate
nitropack/runtime/meta export, which then failed to resolve, and a
missing nitropack dependency would have fallen back to the hoisted copy
without a warning.
@harlan-zw

Copy link
Copy Markdown
Collaborator Author

🤖 Harlan Agent Kit Agent assessment of head ef2e246.

The Service Review was stopped for this head because the review engine is down. An independent read-only subagent reviewed the diff. This is not a Service READY.

No blocker found (confidence 95/100). It confirmed in a pnpm 12.9.1 scratch project that hookable@5 patches 5.4.2 and 5.5.3, skips 4.4.1, and fails install with ERR_PNPM_PATCH_FAILED when a copy in the major cannot take the patch. The old ^5.5.3 key silently skipped 5.4.2. After the defineVitestConfig merge, both projects order nitropack/runtime/meta before nitropack/runtime.

Logged follow-ups, none above 80:

  • Impact 10: a major key skips prerelease copies such as hookable@5.0.0-2; the comment says "every copy".
  • Impact 8: the guard reads only dependencies; a move to peer or optional dependencies would throw with a misleading message.
  • Impact 8: no committed test imports nitropack/runtime/meta.
  • Impact 3, not caused by this PR: runtime-meta.mjs throws in the Nuxt test environment even by absolute path.

@harlan-zw
harlan-zw merged commit 90b2d7f into main Nov 18, 2026
7 checks passed
Sign up for free to 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.

1 participant