Skip to content

Commit 6f65e14

Browse files
nodejs-github-botmarco-ippolito
authored andcommitted
chore: update swc to v1.15.11
1 parent 7647826 commit 6f65e14

1,469 files changed

Lines changed: 2188937 additions & 9372 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

deps/swc/Cargo.lock

Lines changed: 1465 additions & 653 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

deps/swc/Cargo.toml

Lines changed: 329 additions & 147 deletions
Large diffs are not rendered by default.

deps/swc/bindings/Cargo.lock

Lines changed: 0 additions & 7084 deletions
This file was deleted.

deps/swc/bindings/Cargo.toml

Lines changed: 0 additions & 214 deletions
This file was deleted.

deps/swc/bindings/binding_core_node/Cargo.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ exclude = ["artifacts.json", "index.node"]
66
license = "Apache-2.0"
77
name = "binding_core_node"
88
publish = false
9-
version = "0.1.0"
9+
version = "0.2.0"
1010

1111
[lib]
1212
bench = false
@@ -38,18 +38,16 @@ anyhow = { workspace = true }
3838
backtrace = { workspace = true }
3939
napi = { workspace = true, features = ["napi3", "serde-json"] }
4040
napi-derive = { workspace = true, features = ["type-def"] }
41-
node_macro_deps = { path = "../node_macro_deps" }
4241
par-core = { workspace = true, features = ["chili"] }
4342
path-clean = { workspace = true }
4443
rustc-hash = { workspace = true }
4544
serde = { workspace = true, features = ["derive"] }
4645
serde_json = { workspace = true, features = ["unbounded_depth"] }
4746
tracing = { workspace = true, features = ["release_max_level_info"] }
4847
tracing-chrome = { workspace = true }
49-
tracing-futures = { workspace = true }
5048
tracing-subscriber = { workspace = true, features = ["env-filter"] }
5149

52-
swc_core = { workspace = true, features = [
50+
swc_core = { path = "../../crates/swc_core", features = [
5351
"allocator_node",
5452
"ecma_ast",
5553
"ecma_minifier",
@@ -63,5 +61,6 @@ swc_core = { workspace = true, features = [
6361
"ecma_visit",
6462
"base_node",
6563
"base_concurrent",
64+
"base_module",
6665
] }
67-
swc_malloc = { workspace = true }
66+
swc_malloc = { path = "../../crates/swc_malloc" }

deps/swc/bindings/binding_core_node/src/bundle.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ impl Task for BundleTask {
155155
if let Some(s) = err.downcast_ref::<String>() {
156156
return Err(napi::Error::new(
157157
Status::GenericFailure,
158-
format!("panic detected: {}", s),
158+
format!("panic detected: {s}"),
159159
));
160160
}
161161

deps/swc/bindings/binding_core_node/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ fn init() {
3434
if cfg!(debug_assertions) || env::var("SWC_DEBUG").unwrap_or_default() == "1" {
3535
set_hook(Box::new(|panic_info| {
3636
let backtrace = Backtrace::new();
37-
println!("Panic: {:?}\nBacktrace: {:?}", panic_info, backtrace);
37+
println!("Panic: {panic_info:?}\nBacktrace: {backtrace:?}");
3838
}));
3939
}
4040
}

deps/swc/bindings/binding_core_node/src/minify.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ fn minify(
9797
signal: Option<AbortSignal>,
9898
) -> AsyncTask<MinifyTask> {
9999
crate::util::init_default_trace_subscriber();
100-
let code = String::from_utf8_lossy(code.as_ref()).to_string();
101-
let options = String::from_utf8_lossy(opts.as_ref()).to_string();
100+
let code = String::from_utf8_lossy(code.as_ref()).into_owned();
101+
let options = String::from_utf8_lossy(opts.as_ref()).into_owned();
102102
let extras = JsMinifyExtras::default()
103-
.with_mangle_name_cache(extras.mangle_name_cache.as_deref().map(|s| (*s).clone()));
103+
.with_mangle_name_cache(extras.mangle_name_cache.map(|s| (*s).clone()));
104104

105105
let c = get_fresh_compiler();
106106

@@ -126,15 +126,15 @@ pub fn minify_sync(
126126
extras: NapiMinifyExtra,
127127
) -> napi::Result<TransformOutput> {
128128
crate::util::init_default_trace_subscriber();
129-
let code = String::from_utf8_lossy(code.as_ref()).to_string();
129+
let code = String::from_utf8_lossy(code.as_ref()).into_owned();
130130
let input = if is_json {
131131
MinifyTarget::Json(code)
132132
} else {
133133
MinifyTarget::Single(code)
134134
};
135135
let opts = get_deserialized(opts)?;
136136
let extras = JsMinifyExtras::default()
137-
.with_mangle_name_cache(extras.mangle_name_cache.as_deref().map(|s| (*s).clone()));
137+
.with_mangle_name_cache(extras.mangle_name_cache.map(|s| (*s).clone()));
138138

139139
let c = get_fresh_compiler();
140140

deps/swc/bindings/binding_core_node/src/parse.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ pub fn parse(
154154

155155
let c = get_compiler();
156156
let src = stringify(src);
157-
let options = String::from_utf8_lossy(options.as_ref()).to_string();
157+
let options = String::from_utf8_lossy(options.as_ref()).into_owned();
158158
let filename = if let Some(value) = filename {
159159
FileName::Real(value.into())
160160
} else {
@@ -272,7 +272,7 @@ pub fn parse_file(
272272

273273
let c = get_compiler();
274274
let path = PathBuf::from(&path);
275-
let options = String::from_utf8_lossy(options.as_ref()).to_string();
275+
let options = String::from_utf8_lossy(options.as_ref()).into_owned();
276276

277277
AsyncTask::with_optional_signal(ParseFileTask { c, path, options }, signal)
278278
}

deps/swc/bindings/binding_core_node/src/print.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ impl Task for PrintTask {
4848
codegen_config: swc_core::ecma::codegen::Config::default()
4949
.with_target(options.config.jsc.target.unwrap_or(EsVersion::Es2020))
5050
.with_minify(options.config.minify.into_bool()),
51+
source_file_name: Some(&options.filename),
5152
..Default::default()
5253
},
5354
)
@@ -69,7 +70,7 @@ pub fn print(
6970
crate::util::init_default_trace_subscriber();
7071

7172
let c = get_compiler();
72-
let options = String::from_utf8_lossy(&options).to_string();
73+
let options = String::from_utf8_lossy(&options).into_owned();
7374

7475
Ok(AsyncTask::with_optional_signal(
7576
PrintTask {
@@ -108,6 +109,7 @@ pub fn print_sync(program: String, options: Buffer) -> napi::Result<TransformOut
108109
codegen_config: swc_core::ecma::codegen::Config::default()
109110
.with_target(codegen_target)
110111
.with_minify(options.config.minify.into_bool()),
112+
source_file_name: Some(&options.filename),
111113
..Default::default()
112114
},
113115
)

0 commit comments

Comments
 (0)