mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 18:38:33 +00:00
feat(npm): functionality to support child_process.fork (#15891)
This commit is contained in:
parent
23125b275f
commit
d677ba67f5
18 changed files with 232 additions and 21 deletions
|
@ -47,9 +47,10 @@ impl LocalNpmPackageResolver {
|
|||
cache: NpmCache,
|
||||
api: NpmRegistryApi,
|
||||
node_modules_folder: PathBuf,
|
||||
initial_snapshot: Option<NpmResolutionSnapshot>,
|
||||
) -> Self {
|
||||
let registry_url = api.base_url().to_owned();
|
||||
let resolution = Arc::new(NpmResolution::new(api));
|
||||
let resolution = Arc::new(NpmResolution::new(api, initial_snapshot));
|
||||
|
||||
Self {
|
||||
cache,
|
||||
|
@ -180,6 +181,10 @@ impl InnerNpmPackageResolver for LocalNpmPackageResolver {
|
|||
fn ensure_read_permission(&self, path: &Path) -> Result<(), AnyError> {
|
||||
ensure_registry_read_permission(&self.root_node_modules_path, path)
|
||||
}
|
||||
|
||||
fn snapshot(&self) -> NpmResolutionSnapshot {
|
||||
self.resolution.snapshot()
|
||||
}
|
||||
}
|
||||
|
||||
/// Creates a pnpm style folder structure.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue