mirror of
https://github.com/denoland/deno.git
synced 2025-01-21 04:52:26 -05:00
fix(publish): support import equals (#23421)
This commit is contained in:
parent
b3d7df5535
commit
71a1fa4c2e
6 changed files with 34 additions and 33 deletions
28
Cargo.lock
generated
28
Cargo.lock
generated
|
@ -1166,9 +1166,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "deno_ast"
|
||||
version = "0.36.2"
|
||||
version = "0.37.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "da1e05031ec63082cd9eaf103bee347120bf58cf8de5c880ab4c732b661c335f"
|
||||
checksum = "67f9b18b22c707b59cf1ee9cb6f0afbfcf0d03a59b9244ddadacf6a4dc7cfeba"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"base64",
|
||||
|
@ -1381,9 +1381,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "deno_doc"
|
||||
version = "0.123.1"
|
||||
version = "0.124.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a185c2d8aa17865002e9c5ee5652534ff11406b1633833306366e1aaa37a273a"
|
||||
checksum = "3e1215167b2d2a7595cf32737ff9c7802d7faf58dfbe8c9e5d8f07d4c3af4987"
|
||||
dependencies = [
|
||||
"ammonia",
|
||||
"anyhow",
|
||||
|
@ -1405,9 +1405,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "deno_emit"
|
||||
version = "0.39.0"
|
||||
version = "0.39.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9f13249307b7c8ae93989de7752f512acaea63ba1653717d432e69f22b2cd8af"
|
||||
checksum = "8928b70466b99a4fa6ad1e2334f5268eb319d1ddc7607b1ccbd6260cc5b45e6d"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"base64",
|
||||
|
@ -1477,9 +1477,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "deno_graph"
|
||||
version = "0.71.5"
|
||||
version = "0.72.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "89621fa4d9b33f67e7a390e07e300ac0979b9817921d63f1a5056d51e2ae932a"
|
||||
checksum = "508791f6140a8b5b1ac40bac1842db04281b61db4b64c5fd5bf9f1f7259f328a"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
|
@ -1592,9 +1592,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "deno_lint"
|
||||
version = "0.58.2"
|
||||
version = "0.58.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7b00040be64c6ef7b64feff6bc85c4622baad854f3677ed3ab9e90c8884918e5"
|
||||
checksum = "30be687298cff6a22aeaec8b1a6cf3ec0470d1c5cd582c2a2745713abcceea5f"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"deno_ast",
|
||||
|
@ -2302,9 +2302,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "dprint-plugin-typescript"
|
||||
version = "0.90.1"
|
||||
version = "0.90.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d7a7c11f665ef4e305eee57b7643fe5f639ae9c322b64cda115ab78b183c8dc1"
|
||||
checksum = "f46179b46809eb71f8d73898a5ef4660a0e60df4bf17821654eec771cbf457ec"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"deno_ast",
|
||||
|
@ -2530,9 +2530,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "eszip"
|
||||
version = "0.66.0"
|
||||
version = "0.67.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fcdec9b6ed381fb66c53ec7563f55db04885b7646fccfb7a58a807804c813db9"
|
||||
checksum = "6d43c01fc33df17895d3313cf01bf88dde2522ab19da95cddb881be1cb2642ac"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"base64",
|
||||
|
|
|
@ -43,7 +43,7 @@ license = "MIT"
|
|||
repository = "https://github.com/denoland/deno"
|
||||
|
||||
[workspace.dependencies]
|
||||
deno_ast = { version = "=0.36.2", features = ["transpiling"] }
|
||||
deno_ast = { version = "=0.37.0", features = ["transpiling"] }
|
||||
deno_core = { version = "0.275.0" }
|
||||
|
||||
deno_bench_util = { version = "0.141.0", path = "./bench_util" }
|
||||
|
|
|
@ -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
|
||||
|
|
18
cli/emit.rs
18
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)
|
||||
}
|
||||
|
||||
|
|
|
@ -640,6 +640,7 @@ impl ReplSession {
|
|||
keep_comments: false,
|
||||
},
|
||||
)?
|
||||
.into_source()
|
||||
.text;
|
||||
|
||||
let value = self
|
||||
|
|
|
@ -96,7 +96,7 @@ pub fn maybe_transpile_source(
|
|||
maybe_syntax: None,
|
||||
})?;
|
||||
let transpiled_source = parsed
|
||||
.transpile_owned(
|
||||
.transpile(
|
||||
&deno_ast::TranspileOptions {
|
||||
imports_not_used_as_values: deno_ast::ImportsNotUsedAsValues::Remove,
|
||||
..Default::default()
|
||||
|
@ -109,8 +109,8 @@ pub fn maybe_transpile_source(
|
|||
},
|
||||
..Default::default()
|
||||
},
|
||||
)
|
||||
.unwrap()?;
|
||||
)?
|
||||
.into_source();
|
||||
|
||||
let maybe_source_map: Option<SourceMapData> = transpiled_source
|
||||
.source_map
|
||||
|
|
Loading…
Add table
Reference in a new issue