Repository navigation
fix(cli): complete workspace catalogs in create and migrate - #3473
Conversation
Preserve existing catalog entries and locations when adding managed dependencies. Use concrete versions when the package manager does not support catalogs, and return a failing exit code when dependency installation fails.
Keep Yarn's named default catalog distinct from its unnamed catalog and use Bun's active catalog configuration without merging root entries. Cover installation and builds in both workspace layouts and preserve existing install-failure exit behavior.
|
@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. |
Move catalog interpretation helpers and their resolver type into utils/catalog.ts so create and migration callers share them without depending on migration internals. Keep catalog writers and runtime behavior unchanged.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6a98b9f7f1
ℹ️ 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".
Fill missing catalog entries for aligned Vitest packages referenced by a new workspace member. Preserve existing catalog values and leave Vitest packages unmanaged when the Vitest override is absent. Cover pnpm, Yarn, and Bun in unit tests and verify Yarn and Bun creation and frozen installs with CLI snapshots.
Resolve Bun's default catalog entries from both supported locations. Restore migration's named-target selection so it does not duplicate shorthand entries in catalogs.default. Cover root and nested configuration and verify creation, migration, frozen installs, and builds with Bun 1.4.4.
Use one helper to map pnpm and Yarn catalog references to their YAML paths. Keep create's explicit references and migrate's preferred-catalog selection unchanged.
Treat catalog and catalogs.default as one logical default catalog when adding managed dependencies. Update existing entries in place and reuse catalogs.default without creating a conflicting shorthand catalog. Keep the write decision in a private helper and cover default-only and split catalogs at both root and nested locations. Add a CLI regression case that verifies creation, migration, frozen installs, and builds with Bun 1.4.4.
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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: 3f0c9d759b
ℹ️ 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".
Use the original catalog definition when selecting the preferred pnpm catalog so dependency references and YAML writes agree. Keep Bun's merged default catalog and Yarn's existing behavior unchanged. Cover both declaration orders and verify migration followed by a frozen install with a CLI snapshot.
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Share named catalog and Bun configuration checks, route create through the common resolver, and avoid repeated workspace existence checks. Replace nested YAML path conditionals with early returns while preserving catalog precedence.
Remove the redundant resolver and writer comparison while retaining migration result checks. Parameterize nested Bun catalog cases without changing the inputs or preservation assertions.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: df47034988
ℹ️ 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 only merges catalog and catalogs.default from 1.4.0. Use the resolved package manager version consistently when resolving and completing catalogs during create, migration, and bootstrap. Fall back to the declared package manager version for read-only callers. Keep the two defaults independent on older Bun while preserving duplicate prevention on newer releases. Cover the version boundary, both catalog locations, named-default completion, and repeated migration. Add CLI snapshots for Bun 1.2.14 migration and Bun 1.3.14 creation with frozen installs.
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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 duplicate entry test used react, which the migrator never rewrites, so it passed without exercising the write path. Duplicate vite instead and assert that both catalogs are updated in place. Let the integrate helper take a package manager so the Yarn and Bun cases reuse it.
Share versionAtLeast between the migrator and the Bun default catalog check, and add workspaceSupportsCatalog for the create and migrate call sites that read Bun's workspace state from the root package.json. Reuse the pnpm workspace resolver and the active Bun catalog configuration instead of recomputing them.
|
@codex review |
A template that ships a catalog reference made creation add catalog settings to the root configuration even when the package manager cannot read them. Yarn before 4.10 rejects those settings and stops every command. Complete catalog entries only when the workspace supports catalogs, and cover Yarn 4.9 with a CLI snapshot that checks the root configuration stays readable.
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
vp createcould leave unresolved catalog references in existing Yarn and Bun workspaces, including aligned Vitest dependencies. On Bun 1.4.0 and later, migration could also duplicate entries betweencatalogandcatalogs.default, causing installation to fail.Complete missing managed entries during creation while preserving existing versions and catalog locations. Keep Yarn's
catalog:andcatalog:defaultdistinct, respect Bun's nested configuration precedence, and use concrete versions when catalogs are unsupported.Bun merges
catalogandcatalogs.defaultinto one default catalog from 1.4.0 and rejects names defined in both. For those versions, creation and migration update existing entries in place and check both forms before adding missing packages. Older Bun versions keep the two catalogs separate, so each reference is completed in the catalog it names.