Prompt before applying `AUTO_PIN` to `package.json`
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 38/100
- Type d'issue
- Fonctionnalité
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Stack technique
- nodejs, typescript
- Domaine
- cli, developer-experience, tooling
Piste de recherche
Commencez par localiser l’implémentation de AUTO_PIN de Corepack et ses tests existants. Suivez le chemin qui met à jour un package.json existant lorsque COREPACK_ENABLE_AUTO_PIN est défini sur 1, puis déterminez comment l’invite doit se comporter avant cette mise à jour. Le travail est terminé lorsque l’utilisateur peut accepter ou refuser la modification de packageManager sans affecter les scénarios npm et Yarn existants.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
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 contains[email protected]+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 [email protected]+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 [email protected] March 2024
- Langage dominant
- TypeScript
- Étoiles
- 3.8k
- Forks
- 282
- Merge moyen
- 3 h 21 min
- PR mergées (30 j)
- 1
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de nodejs/corepack
-
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
-
[BUG] corepack not use COREPACK_NPM_REGISTRY install of tarballPeut-être pris @Yash121l l’a pris il y a 27 jours. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
-
`Cannot find module .../bin/pnpm.cjs` after upgrading from Corepack <=0.34.4 with pnpm 12 cachedPeut-être pris @abappi19 l’a pris il y a 6 jours. Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 75/100
-
Support signature verification against a custom COREPACK_NPM_REGISTRYPeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouverte
Difficulté 4/5 3-5 jours Accessibilité débutants 68/100
-
Error when upgrading pnpm to latest in `devEngines.packageManager`Peut-être pris @thiagobarbosa l’a pris il y a 77 jours. Ouverte
Difficulté 3/5 1-2 jours Accessibilité débutants 52/100
Toutes les issues de nodejs/corepack
Issues similaires
-
./collections should export setUmbracoVersion and setAllowFilePathUploads for in-process consumersOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
umbraco/Umbraco-CMS-MCP-Dev#563 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
-
afk-ok area:data-quality importer size:S
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
enorm-labs/event-junkie#3166 ·
Les mainteneurs répondent en général sous 1 jour
-
enhancement
Difficulté 1/5 Moins d'une heure Accessibilité débutants 80/100
alunduil/projects-v2-sync#21 ·