diff options
author | Luca Casonato <hello@lcas.dev> | 2024-04-17 21:15:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-17 19:15:02 +0000 |
commit | 71a1fa4c2ee2b5eab04e3293c116edd72177ba26 (patch) | |
tree | 2a4f3a740d193c8ef6a600bc0a85d8688268e08b /cli | |
parent | b3d7df55357ea6fc6f5141b64a9638ddb39b0f63 (diff) |
fix(publish): support import equals (#23421)
Diffstat (limited to 'cli')
-rw-r--r-- | cli/Cargo.toml | 12 | ||||
-rw-r--r-- | cli/emit.rs | 18 | ||||
-rw-r--r-- | cli/tools/repl/session.rs | 1 |
3 files changed, 16 insertions, 15 deletions
diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 33ab80b71..f7d403059 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -66,17 +66,17 @@ deno_ast = { workspace = true, features = ["bundler", "cjs", "codegen", "proposa deno_cache_dir = { workspace = true } deno_config = "=0.15.0" deno_core = { workspace = true, features = ["include_js_files_for_snapshotting"] } -deno_doc = { version = "=0.123.1", features = ["html"] } -deno_emit = "=0.39.0" -deno_graph = { version = "=0.71.5", features = ["tokio_executor"] } -deno_lint = { version = "=0.58.2", features = ["docs"] } +deno_doc = { version = "=0.124.0", features = ["html"] } +deno_emit = "=0.39.1" +deno_graph = { version = "=0.72.0", features = ["tokio_executor"] } +deno_lint = { version = "=0.58.3", features = ["docs"] } deno_lockfile.workspace = true deno_npm = "=0.17.0" deno_runtime = { workspace = true, features = ["include_js_files_for_snapshotting"] } deno_semver = "=0.5.4" deno_task_shell = "=0.16.0" deno_terminal.workspace = true -eszip = "=0.66.0" +eszip = "=0.67.0" napi_sym.workspace = true async-trait.workspace = true @@ -98,7 +98,7 @@ dotenvy = "0.15.7" dprint-plugin-json = "=0.19.2" dprint-plugin-jupyter = "=0.1.3" dprint-plugin-markdown = "=0.16.4" -dprint-plugin-typescript = "=0.90.1" +dprint-plugin-typescript = "=0.90.2" env_logger = "=0.10.0" fancy-regex = "=0.10.0" faster-hex.workspace = true diff --git a/cli/emit.rs b/cli/emit.rs index 07343f39d..923bb4ea0 100644 --- a/cli/emit.rs +++ b/cli/emit.rs @@ -5,6 +5,7 @@ use crate::cache::FastInsecureHasher; use crate::cache::ParsedSourceCache; use deno_ast::SourceMapOption; +use deno_ast::TranspileResult; use deno_core::error::AnyError; use deno_core::ModuleCodeString; use deno_core::ModuleSpecifier; @@ -32,7 +33,7 @@ impl Emitter { let transpile_and_emit_options_hash = { let mut hasher = FastInsecureHasher::default(); hasher.write_hashable(&transpile_options); - hasher.write_hashable(emit_options); + hasher.write_hashable(&emit_options); hasher.finish() }; Self { @@ -101,14 +102,12 @@ impl Emitter { media_type, )?; let transpiled_source = match parsed_source - .transpile_owned(&self.transpile_options, &self.emit_options) + .transpile(&self.transpile_options, &self.emit_options)? { - Ok(result) => result?, - Err(parsed_source) => { - // transpile_owned is more efficient and should be preferred + TranspileResult::Owned(source) => source, + TranspileResult::Cloned(source) => { debug_assert!(false, "Transpile owned failed."); - parsed_source - .transpile(&self.transpile_options, &self.emit_options)? + source } }; debug_assert!(transpiled_source.source_map.is_none()); @@ -135,10 +134,11 @@ impl Emitter { let parsed_source = self .parsed_source_cache .remove_or_parse_module(specifier, source_arc, media_type)?; - let mut options = self.emit_options; + let mut options = self.emit_options.clone(); options.source_map = SourceMapOption::None; let transpiled_source = parsed_source - .transpile_owned_with_fallback(&self.transpile_options, &options)?; + .transpile(&self.transpile_options, &options)? + .into_source(); Ok(transpiled_source.text) } diff --git a/cli/tools/repl/session.rs b/cli/tools/repl/session.rs index 840d85822..e4c50a33c 100644 --- a/cli/tools/repl/session.rs +++ b/cli/tools/repl/session.rs @@ -640,6 +640,7 @@ impl ReplSession { keep_comments: false, }, )? + .into_source() .text; let value = self |