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

feat: add --from-jsr-config option #68

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

marvinhagemeister
Copy link
Collaborator

@marvinhagemeister marvinhagemeister commented Mar 20, 2024

Based on a feature request on discord:

This option is useful for testing Deno-first JSR packages in Node. Passing this flag installs all jsr:* and npm:* packages defined in the "imports" field as npm package which effectively adds it to package.json.

Input:

// jsr.json or deno.json (or their *.jsonc variants)
{
  "imports": {
    "@std/encoding": "jsr:@std/encoding@^0.216.0"
    "preact": "npm:[email protected]"
  }
}

Run: npx jsr i --from-jsr-config

Result:

// package.json
{
  "dependencies": {
    "@std/encoding": "npm:@jsr/std__encoding@^0.216.0",
    "preact": "10.20.0"
  }
}

This option is useful for testing Deno-first JSR packages in Node. Passing this flag installs all `jsr:*` and `npm:*` packages defined in the `"imports"` field as npm package which effectively adds it to `package.json`.
Copy link
Member

@lucacasonato lucacasonato left a comment

Choose a reason for hiding this comment

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

imports is not valid in jsr.json, only in deno.json. The CLI allows this for deno publish right now (that's a bug), but not other subcommands. We should thus not detect imports in jsr.json.

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.

2 participants