Skip to content

Commit 521702f

Browse files
chore: update swc to v1.15.30
1 parent 3a1b232 commit 521702f

271 files changed

Lines changed: 24496 additions & 2201 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: 96 additions & 92 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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@ walkdir = "2.4.0"
136136
wasi-common = { version = "38", default-features = false }
137137
wasm-bindgen = "0.2.100"
138138
wasm-bindgen-futures = "0.4.50"
139-
wasmer = { version = "6.1.0-rc.2", default-features = false }
140-
wasmer-wasix = { version = "0.601.0-rc.2", default-features = false }
139+
wasmer = { version = "6.1.0-rc.3", default-features = false }
140+
wasmer-wasix = { version = "0.601.0-rc.3", default-features = false }
141141
wasmtime = { version = "38", default-features = false }
142142

143143

deps/swc/bindings/binding_core_wasm/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ license = { workspace = true }
66
name = "binding_core_wasm"
77
publish = false
88
repository = { workspace = true }
9-
version = "1.15.24"
9+
version = "1.15.30"
1010

1111
[lib]
1212
bench = false

deps/swc/bindings/binding_core_wasm/src/types.rs

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ export interface JsMinifyOptions {
4949
5050
sourceMap?: boolean
5151
52+
/**
53+
* Serializable subset of terser-webpack-plugin's `extractComments`.
54+
* `true` behaves like `'some'`.
55+
*/
56+
extractComments?: boolean | "some" | "all" | { regex: string }
57+
5258
outputPath?: string
5359
5460
inlineSourcesContent?: boolean
@@ -708,7 +714,7 @@ export type JscTarget =
708714
| "es2021"
709715
| "es2022";
710716
711-
export type ParserConfig = TsParserConfig | EsParserConfig;
717+
export type ParserConfig = TsParserConfig | EsParserConfig | FlowParserConfig;
712718
export interface TsParserConfig {
713719
syntax: "typescript";
714720
/**
@@ -725,6 +731,38 @@ export interface TsParserConfig {
725731
dynamicImport?: boolean;
726732
}
727733
734+
export interface FlowParserConfig {
735+
syntax: "flow";
736+
/**
737+
* Defaults to `false`.
738+
*/
739+
jsx?: boolean;
740+
/**
741+
* Defaults to `false`.
742+
*/
743+
all?: boolean;
744+
/**
745+
* Defaults to `false`.
746+
*/
747+
requireDirective?: boolean;
748+
/**
749+
* Defaults to `false`.
750+
*/
751+
enums?: boolean;
752+
/**
753+
* Defaults to `false`.
754+
*/
755+
decorators?: boolean;
756+
/**
757+
* Defaults to `false`.
758+
*/
759+
components?: boolean;
760+
/**
761+
* Defaults to `false`.
762+
*/
763+
patternMatching?: boolean;
764+
}
765+
728766
export interface EsParserConfig {
729767
syntax: "ecmascript";
730768
/**
@@ -1165,6 +1203,10 @@ export interface Output {
11651203
* Sourcemap (**not** base64 encoded)
11661204
*/
11671205
map?: string;
1206+
/**
1207+
* Extracted comments collected during minification.
1208+
*/
1209+
extractedComments?: string[];
11681210
}
11691211
11701212
export interface MatchPattern { }

deps/swc/bindings/binding_es_ast_viewer/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ license = { workspace = true }
55
name = "binding_es_ast_viewer"
66
publish = false
77
repository = { workspace = true }
8-
version = "1.15.24"
8+
version = "1.15.30"
99

1010
[dependencies]
1111
anyhow = { workspace = true }

deps/swc/bindings/binding_html_wasm/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ license = { workspace = true }
66
name = "binding_html_wasm"
77
publish = false
88
repository = { workspace = true }
9-
version = "1.15.24"
9+
version = "1.15.30"
1010

1111
[lib]
1212
bench = false

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

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,18 @@ fn do_work(
181181
.clone()
182182
.into_inner()
183183
.unwrap_or(BoolOr::Data(JsMinifyCommentOption::PreserveSomeComments));
184-
minify_file_comments(
184+
let extracted_comments = minify_file_comments(
185185
&comments,
186186
preserve_comments,
187+
options
188+
.extract_comments
189+
.clone()
190+
.into_inner()
191+
.unwrap_or(BoolOr::Bool(false)),
187192
options.format.preserve_annotations,
188193
);
189194

190-
swc_compiler_base::print(
195+
let mut output = swc_compiler_base::print(
191196
cm.clone(),
192197
&module,
193198
PrintArgs {
@@ -209,7 +214,13 @@ fn do_work(
209214
),
210215
..Default::default()
211216
},
212-
)
217+
)?;
218+
219+
if !extracted_comments.is_empty() {
220+
output.extracted_comments = Some(extracted_comments);
221+
}
222+
223+
Ok(output)
213224
})
214225
}
215226

deps/swc/bindings/binding_minifier_wasm/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ license = { workspace = true }
66
name = "binding_minifier_wasm"
77
publish = false
88
repository = { workspace = true }
9-
version = "1.15.24"
9+
version = "1.15.30"
1010

1111
[lib]
1212
bench = false

deps/swc/bindings/binding_minifier_wasm/src/types.rs

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ export interface JsMinifyOptions {
4949
5050
sourceMap?: boolean
5151
52+
/**
53+
* Serializable subset of terser-webpack-plugin's `extractComments`.
54+
* `true` behaves like `'some'`.
55+
*/
56+
extractComments?: boolean | "some" | "all" | { regex: string }
57+
5258
outputPath?: string
5359
5460
inlineSourcesContent?: boolean
@@ -709,7 +715,7 @@ export type JscTarget =
709715
| "es2022"
710716
| "esnext";
711717
712-
export type ParserConfig = TsParserConfig | EsParserConfig;
718+
export type ParserConfig = TsParserConfig | EsParserConfig | FlowParserConfig;
713719
export interface TsParserConfig {
714720
syntax: "typescript";
715721
/**
@@ -726,6 +732,38 @@ export interface TsParserConfig {
726732
dynamicImport?: boolean;
727733
}
728734
735+
export interface FlowParserConfig {
736+
syntax: "flow";
737+
/**
738+
* Defaults to `false`.
739+
*/
740+
jsx?: boolean;
741+
/**
742+
* Defaults to `false`.
743+
*/
744+
all?: boolean;
745+
/**
746+
* Defaults to `false`.
747+
*/
748+
requireDirective?: boolean;
749+
/**
750+
* Defaults to `false`.
751+
*/
752+
enums?: boolean;
753+
/**
754+
* Defaults to `false`.
755+
*/
756+
decorators?: boolean;
757+
/**
758+
* Defaults to `false`.
759+
*/
760+
components?: boolean;
761+
/**
762+
* Defaults to `false`.
763+
*/
764+
patternMatching?: boolean;
765+
}
766+
729767
export interface EsParserConfig {
730768
syntax: "ecmascript";
731769
/**
@@ -1166,6 +1204,10 @@ export interface Output {
11661204
* Sourcemap (**not** base64 encoded)
11671205
*/
11681206
map?: string;
1207+
/**
1208+
* Extracted comments collected during minification.
1209+
*/
1210+
extractedComments?: string[];
11691211
}
11701212
11711213
export interface MatchPattern { }

deps/swc/bindings/binding_typescript_wasm/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ license = { workspace = true }
66
name = "binding_typescript_wasm"
77
publish = false
88
repository = { workspace = true }
9-
version = "1.15.24"
9+
version = "1.15.30"
1010

1111
[lib]
1212
bench = false

0 commit comments

Comments
 (0)