-
Notifications
You must be signed in to change notification settings - Fork 113
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
fix: add bin
field to npm compat tarballs
#284
base: main
Are you sure you want to change the base?
Conversation
Unlike npm, JSR does not have a special field in the `jsr.json` / `deno.json` to | ||
specify bin entrypoints. Instead, include the bin entrypoints in the `exports` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That might make it difficult to publish existing packages to JSR, unless https://github.com/nodejs/modules/issues/274
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you say so? Your bin entrypoint does not have to be in the root entrypoint.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not exactly thrilled about having to resort to hacks, or rethink my package.json
to match JSR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be fine with this if JSR transpiled import.meta.main
to something Node can understand.
`bin` field is added to the `package.json` in the generated npm compatible | ||
tarball. JSR will put all files specified in the `exports` in this field that | ||
contain a [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)#Examples). JSR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docs should specify what shebang should universal code use. I believe it should be a Node shebang, since Deno will ignore it.
@wojpawlik @lucacasonato , do you need some help to push it forward ? |
Fixes #157
Still need to add tests.