summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
Diffstat (limited to 'cli')
-rw-r--r--cli/Cargo.toml22
-rw-r--r--cli/cache/common.rs8
-rw-r--r--cli/lsp/documents.rs19
-rw-r--r--cli/proc_state.rs6
-rw-r--r--cli/tests/testdata/coverage/complex_expected.lcov5
-rw-r--r--cli/tests/testdata/coverage/complex_expected.out2
-rw-r--r--cli/tools/doc.rs4
7 files changed, 28 insertions, 38 deletions
diff --git a/cli/Cargo.toml b/cli/Cargo.toml
index d37dc6488..24494f7d2 100644
--- a/cli/Cargo.toml
+++ b/cli/Cargo.toml
@@ -38,7 +38,7 @@ deno_webgpu = { version = "0.68.0", path = "../ext/webgpu" }
deno_websocket = { version = "0.72.0", path = "../ext/websocket" }
deno_webstorage = { version = "0.62.0", path = "../ext/webstorage" }
regex = "=1.6.0"
-serde = { version = "=1.0.141", features = ["derive"] }
+serde = { version = "=1.0.144", features = ["derive"] }
zstd = '=0.11.1'
[target.'cfg(windows)'.build-dependencies]
@@ -46,12 +46,12 @@ winapi = "=0.3.9"
winres = "=0.1.12"
[dependencies]
-deno_ast = { version = "0.17.0", features = ["bundler", "cjs", "codegen", "dep_graph", "module_specifier", "proposal", "react", "sourcemap", "transforms", "transpiling", "typescript", "view", "visit"] }
+deno_ast = { version = "0.19.0", features = ["bundler", "cjs", "codegen", "dep_graph", "module_specifier", "proposal", "react", "sourcemap", "transforms", "transpiling", "typescript", "view", "visit"] }
deno_core = { version = "0.149.0", path = "../core" }
-deno_doc = "0.44.0"
-deno_emit = "0.8.0"
-deno_graph = "0.33.0"
-deno_lint = { version = "0.32.0", features = ["docs"] }
+deno_doc = "0.45.0"
+deno_emit = "0.9.0"
+deno_graph = "0.34.0"
+deno_lint = { version = "0.33.0", features = ["docs"] }
deno_runtime = { version = "0.75.0", path = "../runtime" }
deno_task_shell = "0.5.2"
@@ -64,12 +64,12 @@ clap_complete = "=3.1.2"
clap_complete_fig = "=3.1.5"
data-url = "=0.1.1"
dissimilar = "=1.0.3"
-dprint-plugin-json = "=0.15.5"
-dprint-plugin-markdown = "=0.14.0"
-dprint-plugin-typescript = "=0.71.2"
+dprint-plugin-json = "=0.15.6"
+dprint-plugin-markdown = "=0.14.1"
+dprint-plugin-typescript = "=0.73.1"
encoding_rs = "=0.8.31"
env_logger = "=0.9.0"
-eszip = "=0.26.0"
+eszip = "=0.27.0"
fancy-regex = "=0.10.0"
flate2 = "=1.0.24"
http = "=0.2.6"
@@ -93,7 +93,7 @@ rustyline = { version = "=10.0.0", default-features = false, features = ["custom
rustyline-derive = "=0.7.0"
secure_tempfile = { version = "=3.3.0", package = "tempfile" } # different name to discourage use in tests
semver = "=1.0.13"
-serde = { version = "=1.0.141", features = ["derive"] }
+serde = { version = "=1.0.144", features = ["derive"] }
serde_repr = "=0.1.8"
shell-escape = "=0.1.5"
tar = "=0.4.38"
diff --git a/cli/cache/common.rs b/cli/cache/common.rs
index d1578ce8d..94fe383a5 100644
--- a/cli/cache/common.rs
+++ b/cli/cache/common.rs
@@ -34,6 +34,14 @@ impl FastInsecureHasher {
self
}
+ pub fn write_hashable(
+ &mut self,
+ hashable: &impl std::hash::Hash,
+ ) -> &mut Self {
+ hashable.hash(&mut self.0);
+ self
+ }
+
pub fn finish(&self) -> u64 {
self.0.finish()
}
diff --git a/cli/lsp/documents.rs b/cli/lsp/documents.rs
index 0fa85c095..e395b565d 100644
--- a/cli/lsp/documents.rs
+++ b/cli/lsp/documents.rs
@@ -1149,7 +1149,7 @@ fn lsp_deno_graph_analyze(
let parsed_source_result = analyzer.parse_module(
specifier,
content.clone(),
- get_media_type(specifier, maybe_headers),
+ MediaType::from_specifier_and_headers(specifier, maybe_headers),
);
let module_result = match &parsed_source_result {
Ok(_) => deno_graph::parse_module(
@@ -1169,23 +1169,6 @@ fn lsp_deno_graph_analyze(
(Some(module_result), Some(parsed_source_result))
}
-// todo(dsherret): use `MediaType::from_specifier_and_headers` once
-// https://github.com/denoland/deno_ast/pull/108 is merged
-fn get_media_type(
- specifier: &ModuleSpecifier,
- maybe_headers: Option<&HashMap<String, String>>,
-) -> MediaType {
- if let Some(headers) = maybe_headers {
- if let Some(content_type) = headers.get("content-type") {
- MediaType::from_content_type(specifier, content_type)
- } else {
- MediaType::from(specifier)
- }
- } else {
- MediaType::from(specifier)
- }
-}
-
#[cfg(test)]
mod tests {
use super::*;
diff --git a/cli/proc_state.rs b/cli/proc_state.rs
index 3505d97d0..4a8deb1ca 100644
--- a/cli/proc_state.rs
+++ b/cli/proc_state.rs
@@ -226,15 +226,15 @@ impl ProcState {
cli_options.no_npm(),
);
+ let emit_options: deno_ast::EmitOptions = ts_config_result.ts_config.into();
Ok(ProcState(Arc::new(Inner {
dir,
options: cli_options,
emit_cache,
emit_options_hash: FastInsecureHasher::new()
- // todo(dsherret): use hash of emit options instead as it's more specific
- .write(&ts_config_result.ts_config.as_bytes())
+ .write_hashable(&emit_options)
.finish(),
- emit_options: ts_config_result.ts_config.into(),
+ emit_options,
file_fetcher,
graph_data: Default::default(),
lockfile,
diff --git a/cli/tests/testdata/coverage/complex_expected.lcov b/cli/tests/testdata/coverage/complex_expected.lcov
index c6f9a2578..188ebe542 100644
--- a/cli/tests/testdata/coverage/complex_expected.lcov
+++ b/cli/tests/testdata/coverage/complex_expected.lcov
@@ -11,6 +11,7 @@ FNF:4
FNH:2
BRF:0
BRH:0
+DA:1,1
DA:13,1
DA:14,1
DA:15,1
@@ -67,6 +68,6 @@ DA:70,1
DA:71,0
DA:73,1
DA:74,1
-LH:39
-LF:56
+LH:40
+LF:57
end_of_record
diff --git a/cli/tests/testdata/coverage/complex_expected.out b/cli/tests/testdata/coverage/complex_expected.out
index aeff4cd60..f2f9468f5 100644
--- a/cli/tests/testdata/coverage/complex_expected.out
+++ b/cli/tests/testdata/coverage/complex_expected.out
@@ -1,4 +1,4 @@
-cover [WILDCARD]/coverage/complex.ts ... 69.643% (39/56)
+cover [WILDCARD]/coverage/complex.ts ... 70.175% (40/57)
46 | export function unused(
47 | foo: string,
48 | bar: string,
diff --git a/cli/tools/doc.rs b/cli/tools/doc.rs
index aa2278131..106cacb85 100644
--- a/cli/tools/doc.rs
+++ b/cli/tools/doc.rs
@@ -27,10 +27,8 @@ pub async fn print_docs(
.unwrap_or_else(|| "--builtin".to_string());
let mut doc_nodes = if source_file == "--builtin" {
- // todo(dsherret): change this back to deno://lib.deno.d.ts once
- // https://github.com/denoland/deno_ast/issues/109 is fixed
let source_file_specifier =
- ModuleSpecifier::parse("deno://dts/lib.deno.d.ts").unwrap();
+ ModuleSpecifier::parse("deno://lib.deno.d.ts").unwrap();
let content = get_types(ps.options.unstable());
let mut loader = deno_graph::source::MemoryLoader::new(
vec![(