-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
deno
as defaultProvider is loading depdendencies from npm
#367
Comments
Looks like the bug might be from here if (opts.defaultRegistry) this.defaultRegistry = opts.defaultRegistry; Before assigning the if (opts.defaultRegistry) {
this.defaultRegistry =
registryProviders[`${opts.defaultProvider}:`] ?? opts.defaultRegistry;
} So, when a |
We have two separate providers for Deno:
That is, you would want to set |
Thanks for the clarification @guybedford. I am not aware of that, but looking like even when we set the const generator = new Generator({
defaultProvider: "denoland",
});
await generator.install("zod");
await generator.install("lodash");
console.log(
`Installing by passing defaultProvider as deno land\n`,
JSON.stringify(generator.getMap(), null, 2),
); is generating {
"imports": {
"lodash": "https://ga.jspm.io/npm:[email protected]/lodash.js",
"zod": "https://ga.jspm.io/npm:[email protected]/lib/index.mjs"
}
} |
When passing
defaultProvider
asdeno
toGenerator
. The dependencies should be loaded fromdenoland
. But instead the dependencies are being loaded fromnpm
but they are loading fromdenoland
if users passdenoland
protocol for the package name.Here are some examples
Will result in an importmap of
The dependencies are loaded from
ga.jspm.io
withnpm:
as prefix for protocol.When we pass the protocol for the package name. Then it loaded from deno registry.
Will result in an importmap of
Here the package
zod
comes fromdenoland
since theprotocol
isdenoland
. But we can see the packageloadash
is coming fromnpm
here as expected.Let's try the same with
skypack
This will result in an import of
Here the package loads from
skypack
respecting thedefaultProtocol
that is passed to the generator.Sandbox for the same to test.
The text was updated successfully, but these errors were encountered: