jspm / generator

JSPM Import Map Generator
Apache License 2.0
160 stars 20 forks source link

Hook into `deno.json` when resolving dependencies for denoland packages. #289

Closed Bubblyworld closed 1 year ago

Bubblyworld commented 1 year ago
$ jspm i denoland:fresh/runtime.ts

Error: Deno provider does not support the npm registry for package "preact" - perhaps you mean to install "denoland:preact"?

fresh uses an import map for bare specifiers like preact, but the generator currently ignores the deno.json, so when it tries to resolve preact we hit the global fallback, which is to use npm:preact, and the deno provider throws as it doesn't support the npm registry.

guybedford commented 1 year ago

The workflow currently being recommended here is jspm i denoland:fresh/runtime.ts -m deno.json or jspm i denoland:fresh/runtime.ts -o browser.html --env=browser for dual browser / Deno workflows.

guybedford commented 1 year ago

Ah I realise you meant this for secondaries. This is not something we want to do actually because the deno.json is an exact resolution map not a constraint, whereas package management always operates on constraints (ie package.json dependencies).