Skip to content

fix(migrate): replace bundled packages only when they are devDependencies - #3593

Draft
liangmiQwQ wants to merge 3 commits into
voidzero-dev:mainfrom
liangmiQwQ:migrate-bundled-dev-only
Draft

liangmiQwQ wants to merge 3 commits into
voidzero-dev:mainfrom
liangmiQwQ:migrate-bundled-dev-only

Conversation

@liangmiQwQ

@liangmiQwQ liangmiQwQ commented Nov 28, 2026 •

Copy link
Copy Markdown
Collaborator

The current vp migrate removes Oxlint, Oxfmt, tsdown, @vitest/browser, and @vitest/browser-preview from every dependency field. A tsdown plugin that lists tsdown in both devDependencies and peerDependencies loses both declarations, so the published package drops its tsdown peer and its own tests no longer run against a real tsdown.

This PR replaces these packages only when they are devDependencies. A package that also lists one in dependencies, optionalDependencies, or peerDependencies keeps every declaration of it, including the development copy. Such a package publishes or runs the tool, and its consumers may not use Vite+. Migration also keeps the catalog entry of such a package, so a kept catalog: reference still resolves.

This PR includes a shared declaresRuntimeDependency check in migrator/shared.ts. It replaces the Oxlint-only exception in both the fresh and existing Vite+ paths, and the tsx, oxnode, and ts-node runner check, which already followed this rule. Optional oxlint now counts as a runtime declaration too.

🤖 Generated with Claude Code

…cies

The current `vp migrate` removes Oxlint, Oxfmt, tsdown, `@vitest/browser`, and `@vitest/browser-preview` from every dependency field. A tsdown plugin that lists `tsdown` in both `devDependencies` and `peerDependencies` loses both declarations, so the published package drops its `tsdown` peer and its own tests no longer run against a real tsdown.

This PR replaces these packages only when they are devDependencies. A package that also lists one in `dependencies`, `optionalDependencies`, or `peerDependencies` keeps every declaration of it, including the development copy. Such a package publishes or runs the tool, and its consumers may not use Vite+. A kept `catalog:` reference becomes the range it pointed at, because migration still removes the catalog entry.

This PR includes a shared `declaresRuntimeDependency` check in `migrator/shared.ts`. It replaces the Oxlint-only exception in both the fresh and existing Vite+ paths, and the tsx, oxnode, and ts-node runner check, which already followed this rule. Optional `oxlint` now counts as a runtime declaration too.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@forkstack-service

forkstack-service commented Nov 28, 2026 •

Copy link
Copy Markdown

A bundled package that a package declares at runtime keeps its catalog entry, so a kept `catalog:` reference, including one written by Vitest alignment, still resolves.

This branch has not been deployed

No deployments
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.

2 participants