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

scripts defined in bin are not added to the node_modules/.bin directory #636

Closed
andeeplus opened this issue Jul 5, 2024 · 4 comments
Closed

Comments

@andeeplus
Copy link

andeeplus commented Jul 5, 2024

  • package json modified on publish
  • bin field is being stripped from package.json upon publication

When publishing packages to the jsr package registry, it appears that the package.json is being modified, and several fields are being stripped out, including the crucial bin field. This behavior affects the usability of packages intended to provide command-line tools or executables. I couldn't find any information about this behavior in jsr docs, am I missing something?

@github-project-automation github-project-automation bot moved this to Needs Triage in JSR Jul 5, 2024
@tungv
Copy link

tungv commented Jul 7, 2024

I'm not a contributor but I found this code that creates a modified version of the package.json for npm compatibility purpose. It doesn't actually change the package.json file you upload, it just creates another version (that overrides your file) when request by an npm client.

The doc does slightly touch this concept here

I think we can ask them to add the scripts and bin fields if they are provided.

@tungv
Copy link

tungv commented Jul 7, 2024

hi @dsherret, is this something the team is working on or we should add a repro here?

@andeeplus
Copy link
Author

Thanks for pointing out the docs @tungv, looks like this is the step where the package json for npm is generated. Definitely having the bin included in there would be great. I can create a repro later on today but probably is not needed due to the clear nature of the issue, @dsherret let me know if needed and I'll provide it, thanks a lot

@lucacasonato
Copy link
Member

Duplicate of #157

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

No branches or pull requests

3 participants