voidzero-dev / voidzero-dev/vite-plus

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

オープン
#2,001 コメント 0 件 リアクション 0 件 担当者 1 名 @fengmk2 が担当を希望しています GitHub で見る
bug
主要言語
Rust
スター
5.8k
フォーク
262
平均マージ
1日 34分
マージ済み PR(30日)
135

説明

`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.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。