From bc8a0e6e68547cf07a246b8b6c886de155dc8282 Mon Sep 17 00:00:00 2001 From: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com> Date: Fri, 28 Jun 2024 17:18:21 -0700 Subject: refactor(cli): Create wrapper around `deno_lockfile::Lockfile` (#24366) As suggested in https://github.com/denoland/deno/pull/24355#discussion_r1657875422. I wasn't able to hide the mutex stuff as much as I'd like (ended up just adding an escape hatch `inner()` method that locks the inner mutex), because you can't return references to the inner fields through a mutex. This is mostly motivated by the frozen lockfile changes --- cli/graph_util.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cli/graph_util.rs') diff --git a/cli/graph_util.rs b/cli/graph_util.rs index 14f0aaace..f1e98e7c6 100644 --- a/cli/graph_util.rs +++ b/cli/graph_util.rs @@ -1,8 +1,8 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. use crate::args::jsr_url; +use crate::args::CliLockfile; use crate::args::CliOptions; -use crate::args::Lockfile; use crate::args::DENO_DISABLE_PEDANTIC_NODE_WARNINGS; use crate::cache; use crate::cache::GlobalHttpCache; @@ -354,7 +354,7 @@ pub struct ModuleGraphBuilder { npm_resolver: Arc, module_info_cache: Arc, parsed_source_cache: Arc, - lockfile: Option>>, + lockfile: Option>, maybe_file_watcher_reporter: Option, emit_cache: cache::EmitCache, file_fetcher: Arc, @@ -371,7 +371,7 @@ impl ModuleGraphBuilder { npm_resolver: Arc, module_info_cache: Arc, parsed_source_cache: Arc, - lockfile: Option>>, + lockfile: Option>, maybe_file_watcher_reporter: Option, emit_cache: cache::EmitCache, file_fetcher: Arc, @@ -412,7 +412,7 @@ impl ModuleGraphBuilder { } } - struct LockfileLocker<'a>(&'a Mutex); + struct LockfileLocker<'a>(&'a CliLockfile); impl<'a> deno_graph::source::Locker for LockfileLocker<'a> { fn get_remote_checksum( -- cgit v1.2.3