Prompt before applying `AUTO_PIN` to `package.json`
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 38/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- nodejs, typescript
調査の方向性
まず、Corepack の AUTO_PIN の実装と既存のテストを見つけます。COREPACK_ENABLE_AUTO_PIN が 1 に設定されている場合に既存の package.json を更新する経路を追跡し、その更新前にプロンプトがどのように動作すべきかを判断します。ユーザーが既存の npm および Yarn のシナリオに影響を与えずに packageManager の変更を承認または拒否できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
What would you like?
Corepack AUTO_PIN should prompt before adding a packageManager field to an existing package.json file. It may not be a desired change.
Why is this needed?
By default, and if the environment variable If COREPACK_ENABLE_AUTO_PIN is not set to 0COREPACK_ENABLE_AUTO_PIN is set to 1, then Corepack adds a packageManager field to an existing package.json file if the field is not present.
Especially when working in a hybrid environment using package managers npm and Yarn in a mixture of projects, some of which are set up to work with Corepack and others are not, then some actions can lead to a packageManager field being added to an existing package.json file where this is not desired.
Consider the following scenario:
Project-npmis configured for npm without Corepack (nopackageManagerfield)Project-yarn-v1-corepackis configured for Yarn Classic with Corepack (packageManagerfield containsyarn@1.22.22+sha512...)
If my working directory cwd is in Project-npm and I execute yarn -v overlooking what project I am in, then my npm project becomes corrupted with the unwanted Yarn packageManager field. There is no prompt to allow me to recognize my mistake and prevent the package.json from being updated.
$ yarn -v
! The local project doesn't define a 'packageManager' field. Corepack will now add one referencing yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e.
! For more details about this field, consult the documentation at https://nodejs.org/api/packages.html#packagemanager
Other
- https://github.com/nodejs/corepack/issues/485 proposes to disable
AUTO_PINby default. This is a related suggestion and it contains descriptions of scenarios whereAUTO_PINis not wanted. AUTO_PINwas added in corepack@0.26.0 March 2024
- 主要言語
- TypeScript
- スター
- 3.8k
- フォーク
- 279
- 平均マージ
- 1時間 47分
- マージ済み PR(30日)
- 2
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nodejs/corepack のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 68/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
nodejs/corepack の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
mksglu/context-mode#1200 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
jaegertracing/jaeger-ui#4506 ·
-
area:desktop area:ui bug platform:macos
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
anthropics/claude-code#96687 ·
-
good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
AOSSIE-Org/DebateAI#582 · コメント 2 件 ·