Repository navigation
fix: lockfile がない Node プロジェクトでも設定からパッケージマネージャーを選ぶ - #140
Merged
Merged
Conversation
通常の --install は lockfile がないと npm を選んでいたため、pnpm-workspace.yaml がある新規プロジェクトでも package-lock.json と npm の node_modules を作っていた。pnpm を選ぶ補助処理は --refresh-lock にしかなく、通常の install と lock の監査で判定が分かれていた。 既存の lockfile の優先順位を保ち、lockfile がない場合は package.json の packageManager、pnpm-workspace.yaml、.yarnrc.yml、bunfig.toml の順で判定する。認識できる印がなければ npm を使い、mise のツール設定は判定に使わない。--refresh-lock の個別処理を共通の判定へ統合し、BOM 付きの package.json にも対応する。 --verbose では install が lockfile を作る前に判定に使ったファイルやフィールドを表示する。判定の優先順位、通常と refresh の一致、pnpm の age 設定、新規 lock の保存・復元、CLI の実行先と表示を回帰テストで確認し、英語と日本語の使い方を更新する。
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
lockfile がない pnpm のプロジェクトで --install を実行すると npm が選ばれ、package-lock.json と npm の node_modules が作られていました。packageManager と設定ファイルから使用するパッケージマネージャーを判断し、pnpm-workspace.yaml がある新規プロジェクトでも pnpm を実行します。
原因と変更
通常の判定は lockfile がない場合に npm へ戻り、pnpm の補助判定は --refresh-lock だけが持っていました。判定を共通化し、既存の lockfile の優先順位を維持したうえで、package.json の packageManager、pnpm-workspace.yaml、.yarnrc.yml、bunfig.toml の順で調べます。該当する印がなければ npm を使います。mise のツール一覧は判定に使いません。
--verbose では install が lockfile を作る前に、判定に使ったファイルやフィールドを表示します。BOM 付き package.json と、ルートに package.json がない pnpm workspace も扱います。選択した pnpm は既存の age 設定・監査・復元処理を通ります。使い方の英語版と日本語版を更新しました。
検証
make ci(Windows ではMISEに実行ファイルを明示): pass。2,948 件成功、1 件は既存の ignoredmake checkとmise exec -- cargo test --locked node_pm_ --libも passastro-sight review --git: API 変更・未使用シンボル・呼び出し元の取り残しなしCloses #139