This adds a new resolveBuiltin provider method which is hooked both for generator.install('deno:x') as well as when resolving import 'deno:x'.
The hook is provided the conditional environment, allowing it to resolve to a final URL (deno:x itself being a valid return value), or it can optionally return an Install which corresponds to the standard library install to use for that module (either in JSPM core virtualization or directly against the Deno CDN like https://deno.land/std, just like normal installs).
In the process it was also necessary to separate the concept of subpaths of installs from subpath installs on the Install object, so that subpath installs are now a full first-class citizen for any install (generator.install({ alias: 'custom', target: { registry: 'deno', name: 'std' }, installSubpath: './node', subpath: './fs' }) would correspond to installing custom/fs where the custom/ package is effectively a subpackage install of https://deno.land/std@x.y.z/node/.
Still a bunch of use cases to work through thoroughly here, but this at least integrates the architeture to a point where all of these internal details are handled completely properly in the version management system.
This adds a new
resolveBuiltin
provider method which is hooked both forgenerator.install('deno:x')
as well as when resolvingimport 'deno:x'
.The hook is provided the conditional environment, allowing it to resolve to a final URL (
deno:x
itself being a valid return value), or it can optionally return anInstall
which corresponds to the standard library install to use for that module (either in JSPM core virtualization or directly against the Deno CDN likehttps://deno.land/std
, just like normal installs).In the process it was also necessary to separate the concept of subpaths of installs from subpath installs on the
Install
object, so that subpath installs are now a full first-class citizen for any install (generator.install({ alias: 'custom', target: { registry: 'deno', name: 'std' }, installSubpath: './node', subpath: './fs' })
would correspond to installingcustom/fs
where thecustom/
package is effectively a subpackage install ofhttps://deno.land/std@x.y.z/node/
.Still a bunch of use cases to work through thoroughly here, but this at least integrates the architeture to a point where all of these internal details are handled completely properly in the version management system.