1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

refactor: move importMap with imports/scopes diagnostic to deno_config (#24553)

This commit is contained in:
David Sherret 2024-07-12 12:48:53 -04:00 committed by GitHub
parent 8cbf81cf08
commit 8ee14bd56a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 8 additions and 13 deletions

4
Cargo.lock generated
View file

@ -1308,9 +1308,9 @@ dependencies = [
[[package]]
name = "deno_config"
version = "0.21.3"
version = "0.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "13ad624cb26f547980ca481b1805c4b29d81c7631e791fe1b63f3cc697722722"
checksum = "866d351087e70f8db42d04a773b9a96444d2653ef4bb0fb104fe562b819a57c9"
dependencies = [
"anyhow",
"deno_semver",

View file

@ -101,7 +101,7 @@ console_static_text = "=0.8.1"
data-encoding = "2.3.3"
data-url = "=0.3.0"
deno_cache_dir = "=0.10.0"
deno_config = { version = "=0.21.3", default-features = false }
deno_config = { version = "=0.22.0", default-features = false }
dlopen2 = "0.6.1"
ecb = "=0.1.2"
elliptic-curve = { version = "0.13.4", features = ["alloc", "arithmetic", "ecdh", "std", "pem"] }

View file

@ -887,7 +887,7 @@ impl CliOptions {
};
for diagnostic in workspace.diagnostics() {
log::warn!("{}", colors::yellow(diagnostic));
log::warn!("{} {}", colors::yellow("Warning"), diagnostic);
}
let root_folder = workspace.root_folder().1;
@ -1789,12 +1789,6 @@ fn resolve_import_map_specifier(
format!("Bad URL (\"{import_map_path}\") for import map.")
})?;
Ok(Some(specifier))
} else if let Some(config_file) = &maybe_config_file {
// if the config file is an import map we prefer to use it, over `importMap` field
if config_file.is_an_import_map() && config_file.json.import_map.is_some() {
log::warn!("{} \"importMap\" setting is ignored when \"imports\" or \"scopes\" are specified in the config file.", colors::yellow("Warning"));
}
Ok(None)
} else {
Ok(None)
}

View file

@ -1,4 +1,5 @@
Warning "importMap" setting is ignored when "imports" or "scopes" are specified in the config file.
Warning "importMap" field is ignored when "imports" or "scopes" are specified in the config file.
at file:///[WILDLINE]/import_map_config/config.json
Hello from remapped moment!
Hello from remapped moment dir!
Hello from remapped lodash!

View file

@ -1,5 +1,5 @@
The "compilerOptions" field can only be specified in the root workspace deno.json file.
Warning "compilerOptions" field can only be specified in the workspace root deno.json file.
at file:///[WILDLINE]/sub/deno.json
The "lint.report" field can only be specified in the root workspace deno.json file.
Warning "lint.report" field can only be specified in the workspace root deno.json file.
at file:///[WILDLINE]/sub/deno.json
Checked 1 file