fix(publish): better no-slow-types type discovery (#22517)

This commit is contained in:
David Sherret 2024-02-21 14:12:36 -05:00 committed by GitHub
parent 8aa529f1b8
commit a2c1cc5a1a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 16 additions and 15 deletions

4
Cargo.lock generated
View file

@ -1418,9 +1418,9 @@ dependencies = [
[[package]]
name = "deno_graph"
version = "0.68.0"
version = "0.68.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "47a122de1af66e3b5389a914ce0bf6296271138d259fb78259b839ca7e0722a7"
checksum = "85cc3b07418c76c385f51442a12ad679b38cdbf16ce2233fe8bd20d2a68b8bc2"
dependencies = [
"anyhow",
"async-trait",

View file

@ -68,7 +68,7 @@ deno_config = "=0.10.0"
deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] }
deno_doc = { version = "=0.110.0", features = ["html"] }
deno_emit = "=0.38.0"
deno_graph = "=0.68.0"
deno_graph = "=0.68.1"
deno_lint = { version = "=0.57.0", features = ["docs"] }
deno_lockfile.workspace = true
deno_npm = "=0.17.0"

View file

@ -142,12 +142,14 @@ impl<'a> ImportMapUnfurler<'a> {
);
if !success {
let start_pos =
parsed_source.text_info().line_start(dep.range.start.line)
+ dep.range.start.character;
let end_pos =
parsed_source.text_info().line_start(dep.range.end.line)
+ dep.range.end.character;
let start_pos = parsed_source
.text_info()
.line_start(dep.argument_range.start.line)
+ dep.argument_range.start.character;
let end_pos = parsed_source
.text_info()
.line_start(dep.argument_range.end.line)
+ dep.argument_range.end.character;
diagnostic_reporter(
ImportMapUnfurlDiagnostic::UnanalyzableDynamicImport {
specifier: url.to_owned(),

View file

@ -1054,7 +1054,7 @@ fn lock_deno_json_package_json_deps() {
},
"jsr": {
"@denotest/module_graph@1.4.0": {
"integrity": "555bbe259f55a4a2e7a39e8bf4bcbf25da4c874a313c3e98771eddceedac050b"
"integrity": "32de0973c5fa55772326fcd504a757f386d2b010db3e13e78f3bcf851e69473d"
}
},
"npm": {
@ -1106,7 +1106,7 @@ fn lock_deno_json_package_json_deps() {
},
"jsr": {
"@denotest/module_graph@1.4.0": {
"integrity": "555bbe259f55a4a2e7a39e8bf4bcbf25da4c874a313c3e98771eddceedac050b"
"integrity": "32de0973c5fa55772326fcd504a757f386d2b010db3e13e78f3bcf851e69473d"
}
},
"npm": {
@ -1146,7 +1146,7 @@ fn lock_deno_json_package_json_deps() {
},
"jsr": {
"@denotest/module_graph@1.4.0": {
"integrity": "555bbe259f55a4a2e7a39e8bf4bcbf25da4c874a313c3e98771eddceedac050b"
"integrity": "32de0973c5fa55772326fcd504a757f386d2b010db3e13e78f3bcf851e69473d"
}
}
},

View file

@ -8,7 +8,6 @@
"dependencies": [{
"kind": "import",
"type": "static",
"range": [[0, 0], [0, 35]],
"specifier": "./other.ts",
"specifierRange": [[0, 22], [0, 34]]
}]

View file

@ -2,10 +2,10 @@ Check file://[WILDCARD]/mod.ts
Checking for slow types in the public API...
Check file://[WILDCARD]/mod.ts
warning[unanalyzable-dynamic-import]: unable to analyze dynamic import
--> [WILDCARD]mod.ts:2:7
--> [WILDCARD]mod.ts:2:14
|
2 | await import("asd " + asd);
| ^^^^^^^^^^^^^^^^^^^^ the unanalyzable dynamic import
| ^^^^^^^^^^^^ the unanalyzable dynamic import
info: after publishing this package, imports from the local import map do not work
info: dynamic imports that can not be analyzed at publish time will not be rewritten automatically