-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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(unstable): package manager #20517
Conversation
@@ -61,7 +60,7 @@ itest!(bundle_jsximportsource_importmap_config { | |||
itest!(jsx_not_checked { | |||
args: "check check/jsx_not_checked/main.jsx", | |||
output: "check/jsx_not_checked/main.out", | |||
envs: env_vars_for_npm_tests_no_sync_download(), | |||
envs: env_vars_for_npm_tests(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is some additional cleanup I forgot to do in #20504
output_lines.push(format!( | ||
"<FOUND>{}</FOUND>", | ||
colors::gray(annotate_whitespace(expected)) | ||
)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
import value from "jsr:@denotest/deps/mod.ts"; | ||
|
||
console.log(value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How are these files getting served?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't part of the test registry which is in testdata/jsr/registry
, so this is just a normal file in the testdata directory.
What does jsr mean? Is it an acronym? |
use util::TestContextBuilder; | ||
|
||
itest!(no_module_graph_run { | ||
args: "run jsr/no_module_graph/main.ts", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not requiring an --unstable
flag here at the moment because this feature is currently not usable so it will error every time anyway.
Note: Extremely experimental
As discussed in https://deno.com/blog/package-json-support#a-new-major-version and #17495 but making the specifiers non-Deno specific.
This PR adds an unstable built-in package manager to Deno, but it is currently not usable because the registry infrastructure hasn't been setup and it points to a non-existent url by default. The default registry url can be configured via the
DENO_REGISTRY_URL
environment variable.Using and installing packages
Packages are referenced via semvered specifiers, which can be defined in an application or package's import map:
Next, use the specifier in a JavaScript or TypeScript file:
Then it's as simple as:
Inline specifiers
Of course, these specifiers can be directly used inline in the code, which is useful for single file scripts or when distributing code:
Details
cargo run
.https:
specifiers.https:
specifiers can be imported without duplication of a module.https:
specifiers under the hood.https:
specifiers because there is no waterfalling within a package and the module graph information is computed ahead of time and distributed by the registry.The specific details on how packages might be created and distributed will be outlined soon for further discussion before stabilization. Again, to emphasize, this is all unstable experimental work.
Ref #17475
Ref #17495 -- won't close that one until this is fully functional