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

fix: add bin field to npm compat tarballs #284

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lucacasonato
Copy link
Member

Fixes #157

Still need to add tests.

Comment on lines +457 to +458
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`

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

Copy link
Member Author

@lucacasonato lucacasonato Mar 18, 2024

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.

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.

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.

Comment on lines +479 to +481
`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

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.

@pawk3k
Copy link

pawk3k commented Jul 23, 2024

@wojpawlik @lucacasonato , do you need some help to push it forward ?

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.

Add npx-like behavior
3 participants