diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-04-06 18:46:44 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-06 18:46:44 -0400 |
commit | d07aa4a0723b04583b7cb1e09152457d866d13d3 (patch) | |
tree | f329a30becca95583fb71b4158c939c68228ce06 /cli/args/mod.rs | |
parent | 1586c52b5b5ad511ec0bf896e94de8585f743cf8 (diff) |
refactor(npm): use deno_npm and deno_semver (#18602)
Diffstat (limited to 'cli/args/mod.rs')
-rw-r--r-- | cli/args/mod.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/cli/args/mod.rs b/cli/args/mod.rs index bbf3f7efb..20c382622 100644 --- a/cli/args/mod.rs +++ b/cli/args/mod.rs @@ -8,14 +8,14 @@ mod lockfile; pub mod package_json; pub use self::import_map::resolve_import_map_from_specifier; +use self::lockfile::snapshot_from_lockfile; use self::package_json::PackageJsonDeps; use ::import_map::ImportMap; use deno_core::resolve_url_or_path; -use deno_graph::npm::NpmPackageReqReference; +use deno_npm::resolution::NpmResolutionSnapshot; +use deno_semver::npm::NpmPackageReqReference; use indexmap::IndexMap; -use crate::npm::NpmRegistryApi; -use crate::npm::NpmResolutionSnapshot; pub use config_file::BenchConfig; pub use config_file::CompilerOptions; pub use config_file::ConfigFile; @@ -65,6 +65,7 @@ use std::sync::Arc; use crate::cache::DenoDir; use crate::file_fetcher::FileFetcher; use crate::npm::NpmProcessState; +use crate::npm::NpmRegistry; use crate::util::fs::canonicalize_path_maybe_not_exists; use crate::version; @@ -745,7 +746,7 @@ impl CliOptions { pub async fn resolve_npm_resolution_snapshot( &self, - api: &NpmRegistryApi, + api: &NpmRegistry, ) -> Result<Option<NpmResolutionSnapshot>, AnyError> { if let Some(state) = &*NPM_PROCESS_STATE { // TODO(bartlomieju): remove this clone @@ -755,7 +756,7 @@ impl CliOptions { if let Some(lockfile) = self.maybe_lock_file() { if !lockfile.lock().overwrite { return Ok(Some( - NpmResolutionSnapshot::from_lockfile(lockfile.clone(), api) + snapshot_from_lockfile(lockfile.clone(), api) .await .with_context(|| { format!( |