Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tolmasky opened this issue Dec 4, 2019 · 0 comments
Open

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

tolmasky opened this issue Dec 4, 2019 · 0 comments
Labels

Comments

@tolmasky
Copy link

tolmasky commented Dec 4, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants