mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 18:38:33 +00:00
refactor: move denort to separate crate (#27688)
This slightly degrades the performance of CJS export analysis on
subsequent runs because I changed it to no longer cache in the DENO_DIR
with this PR (denort now properly has no idea about the DENO_DIR). We'll
have to change it to embed this data in the binary and that will also
allow us to get rid of swc in denort (will do that in a follow-up PR).
(cherry picked from commit 57dd66ec3d
)
This commit is contained in:
parent
4fe353c961
commit
39d9047834
112 changed files with 5696 additions and 5500 deletions
|
@ -1,6 +1,5 @@
|
|||
// Copyright 2018-2025 the Deno authors. MIT license.
|
||||
|
||||
mod byonm;
|
||||
pub mod installer;
|
||||
mod managed;
|
||||
|
||||
|
@ -12,13 +11,12 @@ use deno_core::url::Url;
|
|||
use deno_error::JsErrorBox;
|
||||
use deno_npm::npm_rc::ResolvedNpmRc;
|
||||
use deno_npm::registry::NpmPackageInfo;
|
||||
use deno_runtime::deno_process::NpmProcessStateProviderRc;
|
||||
use deno_resolver::npm::ByonmNpmResolverCreateOptions;
|
||||
use deno_semver::package::PackageNv;
|
||||
use deno_semver::package::PackageReq;
|
||||
use http::HeaderName;
|
||||
use http::HeaderValue;
|
||||
|
||||
pub use self::byonm::CliByonmNpmResolverCreateOptions;
|
||||
pub use self::managed::CliManagedNpmResolverCreateOptions;
|
||||
pub use self::managed::CliNpmResolverManagedSnapshotOption;
|
||||
pub use self::managed::NpmResolutionInitializer;
|
||||
|
@ -37,6 +35,8 @@ pub type CliNpmResolver = deno_resolver::npm::NpmResolver<CliSys>;
|
|||
pub type CliManagedNpmResolver = deno_resolver::npm::ManagedNpmResolver<CliSys>;
|
||||
pub type CliNpmResolverCreateOptions =
|
||||
deno_resolver::npm::NpmResolverCreateOptions<CliSys>;
|
||||
pub type CliByonmNpmResolverCreateOptions =
|
||||
ByonmNpmResolverCreateOptions<CliSys>;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct CliNpmCacheHttpClient {
|
||||
|
@ -56,19 +56,6 @@ impl CliNpmCacheHttpClient {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn create_npm_process_state_provider(
|
||||
npm_resolver: &CliNpmResolver,
|
||||
) -> NpmProcessStateProviderRc {
|
||||
match npm_resolver {
|
||||
CliNpmResolver::Byonm(byonm_npm_resolver) => Arc::new(
|
||||
byonm::CliByonmNpmProcessStateProvider(byonm_npm_resolver.clone()),
|
||||
),
|
||||
CliNpmResolver::Managed(managed_npm_resolver) => Arc::new(
|
||||
managed::CliManagedNpmProcessStateProvider(managed_npm_resolver.clone()),
|
||||
),
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait::async_trait(?Send)]
|
||||
impl deno_npm_cache::NpmCacheHttpClient for CliNpmCacheHttpClient {
|
||||
async fn download_with_retries_on_any_tokio_runtime(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue