Skip to content

fix(cli): update .yarnrc template to use node_modules#1297

Merged
fengmk2 merged 1 commit into
voidzero-dev:mainfrom
rChaoz:fix/create-yarn-monorepo
Apr 5, 2026
Merged

fix(cli): update .yarnrc template to use node_modules#1297
fengmk2 merged 1 commit into
voidzero-dev:mainfrom
rChaoz:fix/create-yarn-monorepo

Conversation

@rChaoz

@rChaoz rChaoz commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

Closes #1295

Vite / Vite+ don't work correctly with Yarn's PNP, which is enabled by default.

Since PNP is experimental anyway, I think the better solution is to just disable it rather than make Vite+ compatible with PNP, which should be done once the feature is stabilized.

@netlify

netlify Bot commented Apr 4, 2026

Copy link
Copy Markdown

Deploy Preview for viteplus-preview canceled.

Name Link
🔨 Latest commit d21ac9f
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/69d14d349daf7d0008012890

@fengmk2 fengmk2 self-assigned this Apr 5, 2026
@fengmk2

fengmk2 commented Apr 5, 2026

Copy link
Copy Markdown
Member

@rChaoz thanks

@fengmk2 fengmk2 merged commit 3a1b440 into voidzero-dev:main Apr 5, 2026
32 checks passed
@rChaoz rChaoz deleted the fix/create-yarn-monorepo branch April 5, 2026 09:07
graphite-app Bot pushed a commit that referenced this pull request Apr 7, 2026
…1317)

## Summary

Motivated by #1297 the `.yarnrc` template fix revealed that `vp create` had no e2e test coverage, making it easy for template bugs to ship undetected.

- Add a new GitHub Actions workflow (`test-vp-create.yml`) that e2e tests `vp create` across all 3 built-in templates (monorepo, application, library) and all 4 package managers (pnpm, npm, yarn, bun) — 12 test combinations
- Fix bun monorepo migration writing empty `catalog` with dangling `catalog:` references when using `file:` protocol
- Fix yarn standalone projects missing `.yarnrc.yml` with `nodeLinker: node-modules`
- Pass `--no-frozen-lockfile` from `vp create` in CI so yarn Berry can create fresh lockfiles

## Changes

### New: `vp create` e2e test workflow

- Uses the same tgz-packaging approach as ecosystem-ci: build → pack → install vp from tgz → run `vp create` with `VP_OVERRIDE_PACKAGES`/`VP_VERSION` pointing to local packages
- Each test verifies: project structure, correct lockfile, `vite-plus@0.0.0` installed, `vp check`, and build/test commands
- Monorepo tests run `vp run ready` twice and assert 100% cache hit on the second run
- Triggered on push to main (path-filtered), PRs with `test: create-e2e` label, or create-related file changes

### Fix: bun monorepo catalog with `file:` protocol

- `rewriteBunCatalog()` unconditionally set all overrides to `catalog:` but skipped `file:` entries from the catalog, leaving unresolvable references
- Now uses `file:` paths directly in overrides when the value starts with `file:`

### Fix: yarn standalone projects

- `rewriteYarnrcYml()` now sets `nodeLinker: node-modules` when absent (yarn 4 defaults to PnP)
- `rewriteStandaloneProject()` now calls `rewriteYarnrcYml()` for yarn projects (previously only called for monorepos)
- `vp create` passes `--no-frozen-lockfile` to `vp install` in CI environments

## Test plan

- [x] All 12 matrix jobs pass in CI (3 templates × 4 package managers)
- [x] Existing migration tests pass (`vp test run packages/cli/src/migration/`)
- [x] New `bun-catalog-file-protocol.spec.ts` test verifies the bun override fix

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

Yarn monorepo creation fails

2 participants