1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-23 15:49:44 -05:00

fix: handle specifying an import map in an ancestor dir of deno.json (#23602)

* https://github.com/denoland/deno_config/pull/51

Closes https://github.com/denoland/deno/issues/21440
This commit is contained in:
David Sherret 2024-04-29 14:32:27 -04:00 committed by GitHub
parent e6f4c8f531
commit 4384a126bb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 31 additions and 4 deletions

4
Cargo.lock generated
View file

@ -1272,9 +1272,9 @@ dependencies = [
[[package]]
name = "deno_config"
version = "0.16.1"
version = "0.16.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1bc55559b6b4ebf190c75ad76a4204c792ac27e64e83e685fb5f4e4317bb94c5"
checksum = "f28ad258b58ade470cd745191eacee35562db3c967ffb26b4aa6f0f88f0882dd"
dependencies = [
"anyhow",
"glob",

View file

@ -65,7 +65,7 @@ winres.workspace = true
[dependencies]
deno_ast = { workspace = true, features = ["bundler", "cjs", "codegen", "proposal", "react", "sourcemap", "transforms", "typescript", "view", "visit"] }
deno_cache_dir = { workspace = true }
deno_config = "=0.16.1"
deno_config = "=0.16.2"
deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] }
deno_doc = { version = "=0.128.1", features = ["html", "syntect"] }
deno_emit = "=0.40.1"

View file

@ -943,7 +943,7 @@ impl CliOptions {
&self,
) -> Result<Option<ModuleSpecifier>, AnyError> {
match self.overrides.import_map_specifier.clone() {
Some(maybe_path) => Ok(maybe_path),
Some(maybe_url) => Ok(maybe_url),
None => resolve_import_map_specifier(
self.flags.import_map_path.as_deref(),
self.maybe_config_file.as_ref(),

View file

@ -0,0 +1,9 @@
{
"steps": [{
"args": "info --config=sub/deno.json sub/main.ts",
"output": "info.out"
}, {
"args": "run --check sub/main.ts",
"output": "run.out"
}]
}

View file

@ -0,0 +1,5 @@
{
"imports": {
"~/shared/": "./shared/"
}
}

View file

@ -0,0 +1,7 @@
local: [WILDLINE]main.ts
type: TypeScript
dependencies: 1 unique
size: [WILDLINE]
file:///[WILDLINE]/sub/main.ts ([WILDLINE])
└── file:///[WILDLINE]/shared/models.ts ([WILDLINE])

View file

@ -0,0 +1 @@
Check file:///[WILDLINE]/main.ts

View file

@ -0,0 +1 @@
export class Model {}

View file

@ -0,0 +1,3 @@
{
"importMap": "../import_map.json"
}

View file

@ -0,0 +1 @@
import "~/shared/models.ts";