mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 18:38:33 +00:00
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
This commit is contained in:
parent
2ddae872f9
commit
bc8a0e6e68
12 changed files with 181 additions and 141 deletions
|
@ -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<dyn CliNpmResolver>,
|
||||
module_info_cache: Arc<ModuleInfoCache>,
|
||||
parsed_source_cache: Arc<ParsedSourceCache>,
|
||||
lockfile: Option<Arc<Mutex<Lockfile>>>,
|
||||
lockfile: Option<Arc<CliLockfile>>,
|
||||
maybe_file_watcher_reporter: Option<FileWatcherReporter>,
|
||||
emit_cache: cache::EmitCache,
|
||||
file_fetcher: Arc<FileFetcher>,
|
||||
|
@ -371,7 +371,7 @@ impl ModuleGraphBuilder {
|
|||
npm_resolver: Arc<dyn CliNpmResolver>,
|
||||
module_info_cache: Arc<ModuleInfoCache>,
|
||||
parsed_source_cache: Arc<ParsedSourceCache>,
|
||||
lockfile: Option<Arc<Mutex<Lockfile>>>,
|
||||
lockfile: Option<Arc<CliLockfile>>,
|
||||
maybe_file_watcher_reporter: Option<FileWatcherReporter>,
|
||||
emit_cache: cache::EmitCache,
|
||||
file_fetcher: Arc<FileFetcher>,
|
||||
|
@ -412,7 +412,7 @@ impl ModuleGraphBuilder {
|
|||
}
|
||||
}
|
||||
|
||||
struct LockfileLocker<'a>(&'a Mutex<Lockfile>);
|
||||
struct LockfileLocker<'a>(&'a CliLockfile);
|
||||
|
||||
impl<'a> deno_graph::source::Locker for LockfileLocker<'a> {
|
||||
fn get_remote_checksum(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue