Skills in a workspace fall back to each package when one member's package.json has a BOM or does not parse

Ouverte
#432 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
52/100
Type d'issue
Bug
Clarté
Clairement spécifiée
Activité
Active
Stack technique
node.js, typescript
Domaine
cli, tooling

Piste de recherche

Start with packages/cli/src/lib/skills/workspace-members.ts and trace how @manypkg/tools handles workspace member manifests; check the skills sync and init paths that consume the member list. Reproduce with a workspace member whose package.json has a BOM or invalid JSON. Done when one bad manifest does not hide other members and the affected skills commands report a diagnostic instead of silently using the member directory.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

What happens

In a pnpm or npm workspace, a single member whose package.json starts with a byte order mark (BOM), or does not parse as JSON, makes the CLI treat the whole workspace as having no members.

packages/cli/src/lib/skills/workspace-members.ts lists members with @manypkg/tools, which throws on that file. The CLI then anchors agent skills at the current directory in every package, as it did before 8.0.0-rc.38:

  • prisma skills sync run in any member writes skill copies into that member, not the workspace root;
  • the out-of-date notice reads the member's own copies;
  • prisma init in a member writes the postinstall hook there, unless a parent prisma.config.ts governs it.

Nothing tells the user why.

Reproduction

  1. A pnpm workspace with pnpm-workspace.yaml listing packages/*, two members packages/a and packages/b, and a .git directory at the root.
  2. Save packages/b/package.json with a UTF-8 BOM (or break its JSON).
  3. In packages/a, run prisma skills sync. Expected: copies under the workspace root. Actual: copies under packages/a.

Expected

Listing members tolerates a BOM, and one unreadable member manifest does not drop every member. If a member cannot be read, the skills commands report it with a diagnostic, not silently fall back.

Found while reviewing the fix for init --postinstall in a workspace member.

Langage dominant
TypeScript
Étoiles
26
Forks
4
Merge moyen
12 h 11 min
PR mergées (30 j)
38

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de prisma/prisma-cli

Toutes les issues de prisma/prisma-cli

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.