Skip to content

[BUG] Array dependencies can't handle scoped packages #105

Open
@tolmasky

Description

@tolmasky

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions