diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2022-08-23 10:39:19 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-23 10:39:19 -0400 |
commit | e7367044d933ee3518ae583a43876a0ddab5b17e (patch) | |
tree | e557e3ea4faad632bcfafa6539f3bd0115dc6426 /cli/proc_state.rs | |
parent | 362af63c6f45e98948536d08d2d6195af87f729c (diff) |
feat: binary npm commands (#15542)
Diffstat (limited to 'cli/proc_state.rs')
-rw-r--r-- | cli/proc_state.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/cli/proc_state.rs b/cli/proc_state.rs index bed42b9b4..ee9098c76 100644 --- a/cli/proc_state.rs +++ b/cli/proc_state.rs @@ -443,12 +443,7 @@ impl ProcState { .add_package_reqs(npm_package_references) .await?; self.npm_resolver.cache_packages().await?; - - // add the builtin node modules to the graph data - let node_std_graph = self - .create_graph(vec![(compat::MODULE_ALL_URL.clone(), ModuleKind::Esm)]) - .await?; - self.graph_data.write().add_graph(&node_std_graph, false); + self.prepare_node_std_graph().await?; } // type check if necessary @@ -492,6 +487,15 @@ impl ProcState { Ok(()) } + /// Add the builtin node modules to the graph data. + pub async fn prepare_node_std_graph(&self) -> Result<(), AnyError> { + let node_std_graph = self + .create_graph(vec![(compat::MODULE_ALL_URL.clone(), ModuleKind::Esm)]) + .await?; + self.graph_data.write().add_graph(&node_std_graph, false); + Ok(()) + } + fn handle_node_resolve_result( &self, result: Result<Option<ResolveResponse>, AnyError>, |