voidzero-dev / voidzero-dev/vite-plus

fix(migrate): detect Yarn PnP config even when env overrides nodeLinker

Đang mở
#2,001 0 bình luận 0 reaction 1 người được giao Được @fengmk2 nhận Xem trên GitHub
bug
Ngôn ngữ chính
Rust
Star
5.8k
Fork
262
Merge trung bình
1 ngày 34 phút
Pull request đã merge (30 ngày)
135

Mô tả

`vp migrate` currently treats `YARN_NODE_LINKER=node-modules` as enough to skip Yarn PnP handling. However, if the repository itself has `.yarnrc.yml` with `nodeLinker: pnp`, migration can complete successfully while leaving unsupported PnP config in the project. Future installs without that environment override will return to PnP mode.

Expected behavior:

- If `.yarnrc.yml` explicitly sets `nodeLinker: pnp`, migration should not silently pass just because `YARN_NODE_LINKER=node-modules` is set.
- Preferably, migration should stop and ask the user to change the project config manually, or apply the existing node-modules conversion flow if that is the intended behavior.
- `YARN_NODE_LINKER=pnp` should still hard-block migration as today.

Suggested test:

Create a Yarn Berry fixture with:

```yaml
# .yarnrc.yml
nodeLinker: pnp
```

Run migrate with:

```bash
YARN_NODE_LINKER=node-modules vp migrate --no-interactive
```

Assert that migration does not report the project as successfully migrated while leaving `nodeLinker: pnp` unchanged.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.