mirror of
https://github.com/denoland/deno.git
synced 2025-02-01 12:16:11 -05:00
move remote specifier handling to deno_config
This commit is contained in:
parent
871750aaae
commit
f36d70d194
3 changed files with 4 additions and 37 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -1444,7 +1444,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "deno_config"
|
||||
version = "0.39.3"
|
||||
source = "git+https://github.com/denoland/deno_config.git?rev=81d8e844624a8f6b3961213d1480dcc923d08b11#81d8e844624a8f6b3961213d1480dcc923d08b11"
|
||||
source = "git+https://github.com/denoland/deno_config.git?rev=0d588fb1831bf4d33d3279a1a75db6138d81a75b#0d588fb1831bf4d33d3279a1a75db6138d81a75b"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"deno_package_json",
|
||||
|
|
|
@ -52,7 +52,7 @@ deno_core = { version = "0.324.0" }
|
|||
|
||||
deno_bench_util = { version = "0.175.0", path = "./bench_util" }
|
||||
# TODO(nayeemrmn): Use proper version when https://github.com/denoland/deno_config/pull/143 lands!
|
||||
deno_config = { git = "https://github.com/denoland/deno_config.git", rev = "81d8e844624a8f6b3961213d1480dcc923d08b11", features = ["workspace", "sync"] }
|
||||
deno_config = { git = "https://github.com/denoland/deno_config.git", rev = "0d588fb1831bf4d33d3279a1a75db6138d81a75b", features = ["workspace", "sync"] }
|
||||
deno_lockfile = "=0.23.2"
|
||||
deno_media_type = { version = "0.2.0", features = ["module_specifier"] }
|
||||
deno_npm = "=0.26.0"
|
||||
|
|
|
@ -9,8 +9,6 @@ use std::sync::Arc;
|
|||
|
||||
use deno_ast::MediaType;
|
||||
use deno_ast::ModuleSpecifier;
|
||||
use deno_config::glob::FilePatterns;
|
||||
use deno_config::glob::PathOrPattern;
|
||||
use deno_core::error::AnyError;
|
||||
use deno_core::futures::FutureExt;
|
||||
use deno_graph::Module;
|
||||
|
@ -59,45 +57,14 @@ pub async fn check(
|
|||
if is_discovered_config {
|
||||
let factory = CliFactory::from_flags(flags.clone());
|
||||
let cli_options = factory.cli_options()?;
|
||||
let (remote_files, files) = check_flags
|
||||
.files
|
||||
.iter()
|
||||
.cloned()
|
||||
.partition::<Vec<_>, _>(|f| {
|
||||
f.starts_with("http://")
|
||||
|| f.starts_with("https://")
|
||||
|| f.starts_with("npm:")
|
||||
|| f.starts_with("jsr:")
|
||||
});
|
||||
let mut by_workspace_directory = cli_options
|
||||
let by_workspace_directory = cli_options
|
||||
.resolve_file_flags_for_members(&FileFlags {
|
||||
ignore: Default::default(),
|
||||
include: files,
|
||||
include: check_flags.files,
|
||||
})?
|
||||
.into_iter()
|
||||
.map(|(d, p)| (d.dir_url().clone(), (Arc::new(d), p)))
|
||||
.collect::<BTreeMap<_, _>>();
|
||||
if !remote_files.is_empty() {
|
||||
by_workspace_directory
|
||||
.entry(cli_options.start_dir.dir_url().clone())
|
||||
.or_insert((
|
||||
cli_options.start_dir.clone(),
|
||||
FilePatterns {
|
||||
base: cli_options.initial_cwd().to_path_buf(),
|
||||
include: Some(Default::default()),
|
||||
exclude: Default::default(),
|
||||
},
|
||||
))
|
||||
.1
|
||||
.include
|
||||
.get_or_insert_with(Default::default)
|
||||
.append(
|
||||
remote_files
|
||||
.iter()
|
||||
.flat_map(|s| ModuleSpecifier::parse(s).ok())
|
||||
.map(PathOrPattern::RemoteUrl),
|
||||
);
|
||||
}
|
||||
let container = WorkspaceFileContainer::from_workspace_dirs_with_files(
|
||||
by_workspace_directory.into_values().collect(),
|
||||
|patterns, cli_options, _| {
|
||||
|
|
Loading…
Add table
Reference in a new issue