Repository navigation
fix(migrate): replace bundled packages only when they are devDependencies - #3593
Draft
liangmiQwQ wants to merge 2 commits into
Draft
liangmiQwQ wants to merge 2 commits into
liangmiQwQ wants to merge 2 commits into
Conversation
…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)
|
Note This PR is next to merge. This PR is in a stack (1 of 2). Learn more about stacked PRs created with forkstack and how to merge and rebase a stack. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The current
vp migrateremoves Oxlint, Oxfmt, tsdown,@vitest/browser, and@vitest/browser-previewfrom every dependency field. A tsdown plugin that liststsdownin bothdevDependenciesandpeerDependenciesloses both declarations, so the published package drops itstsdownpeer 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, orpeerDependencieskeeps every declaration of it, including the development copy. Such a package publishes or runs the tool, and its consumers may not use Vite+. A keptcatalog:reference becomes the range it pointed at, because migration still removes the catalog entry.This PR includes a shared
declaresRuntimeDependencycheck inmigrator/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. Optionaloxlintnow counts as a runtime declaration too.🤖 Generated with Claude Code