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

Remove package scope from default binary name #969

Merged
merged 1 commit into from Apr 14, 2021

Conversation

charlespierce
Copy link
Contributor

Closes #963

Info

  • When the bin field in package.json is a string (as opposed to a hash), that's interpreted as the path to the binary and the package name is used as the name of the binary.
  • However, when the package is scoped (e.g. @scope/package-name), then the binary should be named after the package without the scope (package-name in this example).
  • Including the scope causes problems when creating shims, as the / is interpreted as a filesystem directory separator.

Changes

  • Updated the logic that handles string-valued bin to strip off any scope when setting the name of the binary.

Tested

  • Added unit tests to confirm that removing the scope works as expected
  • Manual testing to confirm that a scoped package with a string bin can be installed correctly, with the appropriate binary name.

Copy link
Collaborator

@dherman dherman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very clear and readable! 🚢

@charlespierce charlespierce merged commit cb03e50 into volta-cli:main Apr 14, 2021
@charlespierce charlespierce deleted the scoped_package_bin branch April 14, 2021 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Don't include scope for string-valued bin
2 participants