Prompt before applying `AUTO_PIN` to `package.json`
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 38/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- nodejs, typescript
- Lĩnh vực
- cli, developer-experience, tooling
Hướng nghiên cứu
Bắt đầu bằng cách xác định phần triển khai AUTO_PIN của Corepack và các bài kiểm thử hiện có. Theo dõi luồng cập nhật một package.json hiện có khi COREPACK_ENABLE_AUTO_PIN được đặt thành 1, sau đó xác định prompt nên hoạt động như thế nào trước khi cập nhật đó diễn ra. Công việc được hoàn tất khi người dùng có thể chấp thuận hoặc từ chối thay đổi packageManager mà không ảnh hưởng đến các kịch bản npm và Yarn hiện có.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- 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ự
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
Độ 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ó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
-
Mend: dependency security vulnerability untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100