summaryrefslogtreecommitdiff
path: root/cli/main.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2022-12-06 14:12:51 -0500
committerGitHub <noreply@github.com>2022-12-06 14:12:51 -0500
commitc03e0f3853490e804fe30fc566b45150061badc9 (patch)
tree0f23dad9542c8cf80d0861c2932e2eb1b9e6fc3a /cli/main.rs
parent3e47a27f4fa528b91ac60b07ee6931f47fed0bc5 (diff)
refactor: remove `deno_graph::Locker` usage (#16877)
This is just a straight refactor and doesn't make any improvements to the code that could now be made. Closes #16493
Diffstat (limited to 'cli/main.rs')
-rw-r--r--cli/main.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/cli/main.rs b/cli/main.rs
index ad585c415..445649e5f 100644
--- a/cli/main.rs
+++ b/cli/main.rs
@@ -61,7 +61,6 @@ use crate::util::display;
use crate::util::file_watcher::ResolutionResult;
use args::CliOptions;
-use args::Lockfile;
use deno_ast::MediaType;
use deno_core::anyhow::bail;
use deno_core::error::generic_error;
@@ -315,7 +314,6 @@ async fn create_graph_and_maybe_check(
Permissions::allow_all(),
Permissions::allow_all(),
);
- let maybe_locker = Lockfile::as_maybe_locker(ps.lockfile.clone());
let maybe_imports = ps.options.to_maybe_imports()?;
let maybe_cli_resolver = CliResolver::maybe_new(
ps.options.to_maybe_jsx_import_source_config(),
@@ -332,7 +330,6 @@ async fn create_graph_and_maybe_check(
is_dynamic: false,
imports: maybe_imports,
resolver: maybe_graph_resolver,
- locker: maybe_locker,
module_analyzer: Some(&*analyzer),
reporter: None,
},
@@ -353,7 +350,9 @@ async fn create_graph_and_maybe_check(
ps.npm_resolver
.add_package_reqs(graph_data.npm_package_reqs().clone())
.await?;
- graph_lock_or_exit(&graph);
+ if let Some(lockfile) = &ps.lockfile {
+ graph_lock_or_exit(&graph, &mut lockfile.lock());
+ }
if ps.options.type_check_mode() != TypeCheckMode::None {
let ts_config_result =
@@ -433,7 +432,6 @@ async fn bundle_command(
let mut paths_to_watch: Vec<PathBuf> = graph
.specifiers()
- .iter()
.filter_map(|(_, r)| {
r.as_ref().ok().and_then(|(s, _, _)| s.to_file_path().ok())
})
@@ -533,9 +531,8 @@ fn error_for_any_npm_specifier(
) -> Result<(), AnyError> {
let first_npm_specifier = graph
.specifiers()
- .values()
- .filter_map(|r| match r {
- Ok((specifier, kind, _)) if *kind == deno_graph::ModuleKind::External => {
+ .filter_map(|(_, r)| match r {
+ Ok((specifier, kind, _)) if kind == deno_graph::ModuleKind::External => {
Some(specifier.clone())
}
_ => None,