mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 18:38:33 +00:00
refactor: upgrade to deno_npm 0.3.0 (#18671)
This allows us to specify the `@types/node` version constraint in the CLI instead of in deno_npm.
This commit is contained in:
parent
2eb0f9fb5c
commit
efa7c19890
12 changed files with 59 additions and 31 deletions
|
@ -16,6 +16,7 @@ use deno_core::serde_json;
|
|||
use deno_core::url::Url;
|
||||
use deno_npm::resolution::NpmResolutionSnapshot;
|
||||
use deno_npm::resolution::PackageReqNotFoundError;
|
||||
use deno_npm::resolution::SerializedNpmResolutionSnapshot;
|
||||
use deno_npm::NpmPackageId;
|
||||
use deno_runtime::deno_node::NodePermissions;
|
||||
use deno_runtime::deno_node::NodeResolutionMode;
|
||||
|
@ -41,7 +42,7 @@ use super::NpmCache;
|
|||
/// State provided to the process via an environment variable.
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct NpmProcessState {
|
||||
pub snapshot: NpmResolutionSnapshot,
|
||||
pub snapshot: SerializedNpmResolutionSnapshot,
|
||||
pub local_node_modules_path: Option<String>,
|
||||
}
|
||||
|
||||
|
@ -205,7 +206,7 @@ impl NpmPackageResolver {
|
|||
/// Gets the state of npm for the process.
|
||||
pub fn get_npm_process_state(&self) -> String {
|
||||
serde_json::to_string(&NpmProcessState {
|
||||
snapshot: self.snapshot(),
|
||||
snapshot: self.resolution.serialized_snapshot(),
|
||||
local_node_modules_path: self
|
||||
.fs_resolver
|
||||
.node_modules_path()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue