Skip to content

fix(create): pin new libraries to the creating CLI version - #2721

Draft
SaKaNa-Y wants to merge 1 commit into
voidzero-dev:mainfrom
SaKaNa-Y:fix/create-library-version
Draft

SaKaNa-Y wants to merge 1 commit into
voidzero-dev:mainfrom
SaKaNa-Y:fix/create-library-version

Conversation

@SaKaNa-Y

@SaKaNa-Y SaKaNa-Y commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Problem

Running vp create vite:library --package-manager npm with Vite+ 0.3.2 generates a project with mismatched toolchain versions:

  • vite-plus is declared as ^0.2.4 and installs as 0.2.9.
  • The vite override points to @voidzero-dev/vite-plus-core@0.3.2.

The library comes from a remote template whose Vite+ dependency can lag behind the CLI. Scaffolding preserves that dependency, while project setup writes the current CLI's core override. The reproduced project still passes its checks, test and packaging; the confirmed defect is the version mismatch.

Fix

Set the newly downloaded built-in library's vite-plus dev dependency to VITE_PLUS_VERSION before project integration. The dependency and toolchain override then use the same version, and subsequent workspace integration can still convert the dependency to a catalog reference.

The change is confined to vite:library creation. It preserves unrelated dependencies and the existing migration rules for user-owned version pins, including the boundary established in #1697.

Verification

  • Regression tests fail before the fix and pass afterward for standalone and workspace library scaffolding.
  • Full unit suite: 1,210 passed, 1 skipped. Formatting, lint and type checks passed.
  • cargo test -p vp_cli_snapshots --offline -- create_library_npm: 1 case passed, asserting that both the declared and installed Vite+ versions match the core override.
  • Manual npm workflow: the generated dependency and installed package are both 0.3.2; project checks, its test and library packaging pass.

The full CLI snapshot suite was not run; CLI verification covered the npm library case above.

The remote library template can retain an older vite-plus range while project setup injects the current core override. Pin the newly scaffolded library to the creating CLI before integration, without changing migration rules for existing projects.
@SaKaNa-Y SaKaNa-Y changed the title fix(create): align new library dependencies with the CLI version fix(create): pin new libraries to the creating CLI version Sep 16, 2026
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