Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Expand `corepack use` documentation description

オープン
#610 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
1/5
見積もり時間
1〜3時間
初心者へのやさしさ
45/100
issue の種類
ドキュメント
明瞭さ
明確に書かれている
活発さ
停滞
領域
documentation

調査の方向性

リンクされた issue 607 のテスト例とその shell コマンドを動作の参考として使用し、README の corepack use セクションを更新してください。コマンドがディレクトリ階層をたどって package.json を見つける方法と、ファイルまたは packageManager フィールドが存在しない場合に何を作成するかを記載してください。両方の動作が明確に説明されていれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Issue

Under README > corepack use the complete description currently says:

corepack use <name[@]>

When run, this command will retrieve the latest release matching the provided descriptor, assign it to the project's package.json file, and automatically perform an install.

package.json location

There is no description of how the command navigates the directory hierarchy to locate a possible existing package.json to modify.

Using the test example of @arcanis in https://github.com/nodejs/corepack/issues/607#issuecomment-2609834263 shows that it operates on the root of a hierarchy:

corepack enable yarn
cd $(mktemp -d)
yarn init -2 -w
mkdir -p packages/foo
echo '{}' > packages/foo/package.json
jq .packageManager package.json
(cd packages/foo && corepack use yarn@4.5.0)
jq .packageManager package.json

In this example case, the result is that:

  • packages/foo/package.json contains {}

  • package.json contains

    {
      "name": "tmp.IcgYOXK7aS",
      "packageManager": "yarn@4.5.0+sha512.837566d24eec14ec0f5f1411adb544e892b3454255e61fdef8fd05f3429480102806bac7446bc9daff3896b01ae4b62d00096c7e989f1596f2af10b927532f39",
      "workspaces": [
        "packages/*"
      ]
    }
    
package.json creation

If no package.json file is found, then one is created. This effect of the command is not described.

Suggestion

For the README > corepack use section:

  • Add text to explain how the location for the package.json file is determined.
  • Add text which describes how a package.json file and / or a packageManager field is created if they don't exist.

Related

主要言語
TypeScript
スター
3.8k
フォーク
279
平均マージ
1時間 47分
マージ済み PR(30日)
2

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

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

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

nodejs/corepack のほかの issue

nodejs/corepack の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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