Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[BUG] Array dependencies can't handle scoped packages

Aperta
#105 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript
Ambito
tooling

Direzione di ricerca

Start in lib/fixer.js at depObjectify around line 381 and reproduce the scoped-package array case with the linked RunKit example. Compare it with non-scoped array dependencies and verify that normalization does not produce an empty dependency name or interpret the package as a GitHub specifier; clarify whether scoped array dependencies should work or be rejected before implementation.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

What / Why

If you run array dependencies through normalizePackageData (depObjectify specifically), the leading @ in a scoped package name will be incorrectly interpreted as the beginning of a range instead of the beginning of the package name, leading to the "fixed" dependency name being the empty string and the dependency semver range being a github specifier.

Screen Shot 2019-12-03 at 9 06 59 PM

While array dependencies are not encouraged, they are still allowed to be published, and if nothing else this leads to very strange error messages:

$ npm publish
$ 400 Bad Request - PUT https://registry.npmjs.org/your-package - "dependencies" dep "" is not a valid dependency name.

Again, non-scoped-package array dependencies can be published successfully, and if anything you'd want this message to say "scoped packages are not allowed in array dependencies".

When

Here is a reproducible test case: https://runkit.com/tolmasky/scoped-package-in-array-dependencies

Happy to submit a PR if it is agreed that this is not desired behavior.

Lingua principale
JavaScript
Stelle
204
Fork
53
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di npm/normalize-package-data

Tutte le issue di npm/normalize-package-data

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.