mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
refactor(npm): use deno_npm and deno_semver (#18602)
This commit is contained in:
parent
1586c52b5b
commit
d07aa4a072
36 changed files with 759 additions and 5852 deletions
|
@ -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!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue