Repository navigation
fix(migrate): keep migrated toolchain specs resolvable and aligned - #3397
jong-kyung wants to merge 11 commits into
Conversation
Bun resolves catalog: references whenever the root package.json has a workspaces field, even an empty one. The upgrade path required a non-empty package list, so a single-package Bun project with workspaces.catalog had its catalog: specs rewritten to concrete versions. Fixes voidzero-dev#3375
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d230f70b81
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Bun before 1.2.21 reads only workspaces.catalog, so a top-level catalog fails to resolve there. Keep concrete specs on those versions unless the project already has a workspaces.catalog, which rewriteBunCatalog keeps in place.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 89c9c09115
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The fresh monorepo path always wrote a top-level catalog for Bun, which Bun before 1.2.21 cannot resolve. Share bunSupportsCatalog between the fresh and upgrade paths, keep root overrides concrete when catalogs are unsupported, and start the Bun 1.2.20 snapshot without vite-plus installed.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 91640ae94e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A catalog: vite-plus spec always looks current, so a stale catalog value let detectVitePlusBootstrapPending report a Bun workspace as migrated and skip the upgrade. Check the catalog value like the pnpm and Yarn paths do.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 26eadcb27c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b2cb1963b7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
alignVitestEcosystemPackages turns an alignable @vitest/* dependency into a catalog: reference, but the Bun catalog rewrite only updated entries it already had, so bun install failed with "not in catalog". Add the missing entries when the catalog owns vitest, matching the pnpm catalog.
When a named Bun catalog already owns the toolchain, new references point at it, but rewriteBunCatalog added missing entries only to the default catalog, so vite-plus@catalog:<name> failed to resolve. Add them to that named catalog instead of creating a default catalog beside it, as the pnpm catalog already does, and update the Bun migration rules.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 163939de46
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Thanks for both reviews. I had planned to handle these in a follow-up PR, but I'll widen the scope of this PR so the fixes apply to every package manager, then request another review. |
alignVitestEcosystemPackages turns an alignable @vitest/* dependency into a catalog: reference whenever catalogs are supported, but the pnpm and Bun catalog writers added the entry only when the catalog owned vitest. A project that declares only an excluded utility such as @vitest/utils has no vitest entry, so install failed. Add the entries regardless, as the migration rules describe.
rewritePackageJson normalized an existing plain vite-plus range only when catalogs were supported, so npm, pnpm before 9.5, Yarn before 4.10, and now Bun before 1.2.21 left a child package on its old version while the root and the shared vite override moved to the new one. Re-pin it to the concrete version in that case, keep protocol pins such as workspace:*, and check sibling alignment for npm in test-vp-create. The upgrade path already re-pins these specs, and the migration rules describe this behavior.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7711104505
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Fixes #3375.
Bun resolves
catalog:references whenever the rootpackage.jsonhas aworkspacesfield, even an empty one, butvp migraterequired a non-empty package list. Fixing that exposed other cases where migration wrote references the package manager cannot resolve, or left packages on different Vite+ versions.Bun:
workspaces. On those versions, migration keeps concrete specs unless the project already has a catalog there, in both fresh and upgrade migrations.vite-plusvalue in a Bun catalog is now reported as pending, so the upgrade is no longer skipped.All package managers:
@vitest/*packages that becomecatalog:references now always get a catalog entry. Previously pnpm and Bun added it only when the catalog hadvitest, so a project with only an excluded utility such as@vitest/utilsfailed to install.vite-plusrange in a child package is now re-pinned to the concrete version when catalogs are unavailable, which covers npm, pnpm before 9.5, Yarn before 4.10, and Bun before 1.2.21. This changes the choice made in fix(create): normalize sub-package vite-plus and drop aliased vite/vitest #1697 to leave these pins alone on npm, because the upgrade path already re-pins them and the root and sharedviteoverride otherwise move to a newer version than the child. Protocol pins such asworkspace:*are kept, andtest-vp-createnow checks sibling alignment on npm too.The Bun section of
docs/guide/migrate-rules.mdis updated. Each case has a unit test, and themigration_upgrade_bun_empty_workspaces_catalogandmigration_bun_old_no_top_level_catalogsnapshots cover the empty-workspace upgrade and the Bun 1.2.20 fresh migration.