-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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(install): support npm specifiers #16634
feat(install): support npm specifiers #16634
Conversation
worker.preload_main_module().await?; | ||
let ps = ProcState::build(flags.clone()).await?; | ||
// ensure the module is cached | ||
load_and_type_check(&ps, &[install_flags.module_url.clone()]).await?; |
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.
Seemed like a lot of ceremony. Can we just use this instead?
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.
If the tests pass I think it's fine
@@ -189,7 +205,7 @@ pub fn uninstall(name: String, root: Option<PathBuf>) -> Result<(), AnyError> { | |||
|
|||
// There might be some extra files to delete | |||
for ext in ["tsconfig.json", "lock.json"] { | |||
file_path = file_path.with_extension(ext); | |||
let file_path = file_path.with_extension(ext); |
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.
Bug here. It would do file.tsconfig.json
then file.tsconfig.lock.json
. Now that's fixed.
@@ -995,10 +1098,14 @@ mod tests { | |||
} | |||
|
|||
// create extra files | |||
file_path = file_path.with_extension("tsconfig.json"); | |||
File::create(&file_path).unwrap(); | |||
file_path = file_path.with_extension("lock.json"); |
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.
Bug was also happening here where it would do echo_test.tsconfig.json
then echo_test.tsconfig.lock.json
, which is why this test didn't catch the bug.
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, nice tests!
Supports npm specifiers for
deno install
. This will by default always use a lockfile (which is generated on first run) unless--no-lock
is specified.