Expand `corepack use` documentation description
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Lĩnh vực
- documentation
Hướng nghiên cứu
Cập nhật phần corepack use trong README, sử dụng ví dụ kiểm thử của issue 607 được liên kết và các lệnh shell của ví dụ đó làm tham chiếu về hành vi. Ghi lại cách lệnh tìm package.json thông qua hệ thống phân cấp thư mục và tạo ra gì khi không tồn tại tệp hoặc trường packageManager; được xem là hoàn tất khi cả hai hành vi đều được mô tả rõ ràng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.jsoncontains{} -
package.jsoncontains{ "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.jsonfile is determined. - Add text which describes how a
package.jsonfile and / or apackageManagerfield is created if they don't exist.
Related
- Ngôn ngữ chính
- TypeScript
- Star
- 3.8k
- Fork
- 279
- Merge trung bình
- 1 giờ 47 phút
- Pull request đã merge (30 ngày)
- 2
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của nodejs/corepack
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 68/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
Tất cả issue của nodejs/corepack
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
vercel-labs/just-bash#464 ·
-
looksLikeSlug() is ASCII-only, so non-Latin entity slugs (e.g. Korean) skip exact match and collapse Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
TanStack/tanstack.com#1293 ·