Skip to content

fix(cli): complete workspace catalogs in create and migrate - #3473

Merged
fengmk2 merged 16 commits into
voidzero-dev:mainfrom
jong-kyung:fix/create-workspace-catalogs
Nov 17, 2026
Merged

fengmk2 merged 16 commits into
voidzero-dev:mainfrom
jong-kyung:fix/create-workspace-catalogs

Conversation

@jong-kyung

@jong-kyung jong-kyung commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

vp create could 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 between catalog and catalogs.default, causing installation to fail.

Complete missing managed entries during creation while preserving existing versions and catalog locations. Keep Yarn's catalog: and catalog:default distinct, respect Bun's nested configuration precedence, and use concrete versions when catalogs are unsupported.

Bun merges catalog and catalogs.default into 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.

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.
@jong-kyung

Copy link
Copy Markdown
Collaborator Author

@codex review

@jong-kyung jong-kyung self-assigned this Nov 17, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T07:48:48.197417Z 8a90cf5 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@jong-kyung jong-kyung added test: e2e Auto run e2e tests test: create-e2e Run `vp create` e2e tests labels Nov 17, 2026
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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread packages/cli/src/create/utils.ts Resolved
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.
@jong-kyung

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: e0794c76a9

ℹ️ 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".

@jong-kyung jong-kyung changed the title fix(create): complete catalogs in Yarn and Bun workspaces fix(cli): complete workspace catalogs in create and migrate Nov 17, 2026
@jong-kyung
jong-kyung marked this pull request as ready for review November 17, 2026 04:34
@jong-kyung jong-kyung added test: sfw test: install-e2e run vite install e2e test labels Nov 17, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread packages/cli/src/create/utils.ts Resolved
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.
@jong-kyung

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: ee126bb89e

ℹ️ 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".

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.
@jong-kyung

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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.
@jong-kyung

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 👍

Reviewed commit: 103af51dda

ℹ️ 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 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.
@jong-kyung

Copy link
Copy Markdown
Collaborator Author

@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.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 8a90cf51a7

ℹ️ 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".

@fengmk2
fengmk2 merged commit 374667d into voidzero-dev:main Nov 17, 2026
121 checks passed
@jong-kyung
jong-kyung deleted the fix/create-workspace-catalogs branch November 17, 2026 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test: create-e2e Run `vp create` e2e tests test: e2e Auto run e2e tests test: install-e2e run vite install e2e test test: sfw

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants