Skip to content

fix(create): complete catalogs in existing pnpm workspaces - #2808

Open
SaKaNa-Y wants to merge 2 commits into
voidzero-dev:mainfrom
SaKaNa-Y:fix/create-existing-pnpm-catalogs
Open

SaKaNa-Y wants to merge 2 commits into
voidzero-dev:mainfrom
SaKaNa-Y:fix/create-existing-pnpm-catalogs

Conversation

@SaKaNa-Y

@SaKaNa-Y SaKaNa-Y commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Important

Please take a moment to read this. Thank you!

I should include a brief explanation of the problem in my own words in every PR. If that explanation is missing, please @mention me and do not merge this PR until I have added it. You may also leave this PR unaddressed (because this means I have not fulfilled my responsibilities as the author).

If my explanation is unclear or difficult to follow, please ask me to clarify or provide reproduction steps or supporting evidence.

I welcome suggestions and counterarguments, especially questions about anything I may have overlooked. (Your feedback helps me learn and improve. 🙏)

I hold myself to this standard for every PR, regardless of its size.

When I run vp create vite:application in an existing pnpm workspace without the required catalog entries, dependency installation fails with ERR_PNPM_CATALOG_ENTRY_NOT_FOUND_FOR_SPEC. The create flow writes catalog: references for vite and vite-plus into the new application's package.json but leaves their version definitions missing from pnpm-workspace.yaml. The generated application should have resolvable dependencies so installation can complete.

This change reuses the workspace's catalog selection when rewriting the new application, then adds its missing Vite+-managed catalog entries before installation. It supports default and named catalogs, preserves explicit catalog references and existing versions, and limits updates to the entries needed by the new application.

Verification

  • The previously recorded focused test run passed all 7 regression tests, covering catalog selection, missing entries, and preservation of existing configuration.
  • just snapshot-test create_existing_pnpm_workspace previously passed: it checks catalog output and lockfile creation, then runs a frozen installation and application build. Before the fix, it failed because installation produced no lockfile.
  • GitHub CI: Lint and all Linux, macOS, and Windows CLI snapshot shards passed.

Reuse existing catalog selections and fill missing managed entries before installation. Preserve user-defined versions and unrelated workspace configuration.
@SaKaNa-Y

Copy link
Copy Markdown
Contributor Author

I found that using vp create to add an application to an existing pnpm workspace without the required catalog entries caused dependency installation to fail. The create flow rewrote the new application's dependencies to catalog references for vite and vite-plus, but did not ensure that the corresponding version entries existed in the workspace root.

@SaKaNa-Y
SaKaNa-Y marked this pull request as ready for review September 26, 2026 06:19

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.

1 participant