diff --git a/Cargo.lock b/Cargo.lock index f1c4e9430996c..d353e84a0f519 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1625,20 +1625,20 @@ checksum = "9c6901729fa79e91a0913333229e9ca5dc725089d1c363b2f4b4760709dc4a52" name = "oxc" version = "0.97.0" dependencies = [ - "oxc_allocator 0.97.0", - "oxc_ast 0.97.0", - "oxc_ast_visit 0.97.0", + "oxc_allocator", + "oxc_ast", + "oxc_ast_visit", "oxc_cfg", - "oxc_codegen 0.97.0", - "oxc_diagnostics 0.97.0", + "oxc_codegen", + "oxc_diagnostics", "oxc_isolated_declarations", - "oxc_mangler 0.97.0", - "oxc_minifier 0.97.0", - "oxc_parser 0.97.0", - "oxc_regular_expression 0.97.0", - "oxc_semantic 0.97.0", - "oxc_span 0.97.0", - "oxc_syntax 0.97.0", + "oxc_mangler", + "oxc_minifier", + "oxc_parser", + "oxc_regular_expression", + "oxc_semantic", + "oxc_span", + "oxc_syntax", "oxc_transformer", "oxc_transformer_plugins", ] @@ -1705,57 +1705,27 @@ dependencies = [ "allocator-api2", "bumpalo", "hashbrown 0.16.0", - "oxc_ast_macros 0.97.0", - "oxc_data_structures 0.97.0", - "oxc_estree 0.97.0", + "oxc_ast_macros", + "oxc_data_structures", + "oxc_estree", "rustc-hash", "serde", "serde_json", ] -[[package]] -name = "oxc_allocator" -version = "0.97.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9500e5c4bf57e65f931518201a55658fa639a2b923e01a6467c82e18ef9dfdc2" -dependencies = [ - "allocator-api2", - "bumpalo", - "hashbrown 0.16.0", - "oxc_data_structures 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-hash", -] - -[[package]] -name = "oxc_ast" -version = "0.97.0" -dependencies = [ - "bitflags 2.10.0", - "oxc_allocator 0.97.0", - "oxc_ast_macros 0.97.0", - "oxc_data_structures 0.97.0", - "oxc_diagnostics 0.97.0", - "oxc_estree 0.97.0", - "oxc_regular_expression 0.97.0", - "oxc_span 0.97.0", - "oxc_syntax 0.97.0", -] - [[package]] name = "oxc_ast" version = "0.97.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73849bfea33c22b17c365cc032dc31132d1314a9afd54b9db7285d2660143ea3" dependencies = [ "bitflags 2.10.0", - "oxc_allocator 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_ast_macros 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_data_structures 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_diagnostics 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_estree 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_regular_expression 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_span 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_syntax 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", + "oxc_allocator", + "oxc_ast_macros", + "oxc_data_structures", + "oxc_diagnostics", + "oxc_estree", + "oxc_regular_expression", + "oxc_span", + "oxc_syntax", ] [[package]] @@ -1768,18 +1738,6 @@ dependencies = [ "syn", ] -[[package]] -name = "oxc_ast_macros" -version = "0.97.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc1b9a1ee12c5369a515460e7e4b2066e4b6249a1469394aa93dd0aa7f940387" -dependencies = [ - "phf", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "oxc_ast_tools" version = "0.0.0" @@ -1791,16 +1749,16 @@ dependencies = [ "indexmap", "itertools", "lazy-regex", - "oxc_allocator 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_ast 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_ast_visit 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_codegen 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_data_structures 0.97.0", + "oxc_allocator", + "oxc_ast", + "oxc_ast_visit", + "oxc_codegen", + "oxc_data_structures", "oxc_index", - "oxc_minifier 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_parser 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_span 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_syntax 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", + "oxc_minifier", + "oxc_parser", + "oxc_span", + "oxc_syntax", "phf", "phf_codegen", "prettyplease", @@ -1817,22 +1775,10 @@ dependencies = [ name = "oxc_ast_visit" version = "0.97.0" dependencies = [ - "oxc_allocator 0.97.0", - "oxc_ast 0.97.0", - "oxc_span 0.97.0", - "oxc_syntax 0.97.0", -] - -[[package]] -name = "oxc_ast_visit" -version = "0.97.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aafd28e1091e4ac2e257b7ee2da3e2368b5d10115b5c91553cfe13d8838b497" -dependencies = [ - "oxc_allocator 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_ast 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_span 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_syntax 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", + "oxc_allocator", + "oxc_ast", + "oxc_span", + "oxc_syntax", ] [[package]] @@ -1841,18 +1787,18 @@ version = "0.0.0" dependencies = [ "cow-utils", "criterion2", - "oxc_allocator 0.97.0", - "oxc_ast 0.97.0", - "oxc_ast_visit 0.97.0", - "oxc_codegen 0.97.0", + "oxc_allocator", + "oxc_ast", + "oxc_ast_visit", + "oxc_codegen", "oxc_formatter", "oxc_isolated_declarations", "oxc_linter", - "oxc_mangler 0.97.0", - "oxc_minifier 0.97.0", - "oxc_parser 0.97.0", - "oxc_semantic 0.97.0", - "oxc_span 0.97.0", + "oxc_mangler", + "oxc_minifier", + "oxc_parser", + "oxc_semantic", + "oxc_span", "oxc_tasks_common", "oxc_transformer", "rustc-hash", @@ -1867,7 +1813,7 @@ dependencies = [ "bitflags 2.10.0", "itertools", "oxc_index", - "oxc_syntax 0.97.0", + "oxc_syntax", "petgraph", "rustc-hash", ] @@ -1881,60 +1827,26 @@ dependencies = [ "dragonbox_ecma", "insta", "itoa", - "oxc_allocator 0.97.0", - "oxc_ast 0.97.0", - "oxc_data_structures 0.97.0", + "oxc_allocator", + "oxc_ast", + "oxc_data_structures", "oxc_index", - "oxc_parser 0.97.0", - "oxc_semantic 0.97.0", + "oxc_parser", + "oxc_semantic", "oxc_sourcemap", - "oxc_span 0.97.0", - "oxc_syntax 0.97.0", + "oxc_span", + "oxc_syntax", "pico-args", "rustc-hash", ] -[[package]] -name = "oxc_codegen" -version = "0.97.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ec5fe3835930195cd5a3362aa9559370ed8ce1aaf8f65d992dbb999075a6a68" -dependencies = [ - "bitflags 2.10.0", - "cow-utils", - "dragonbox_ecma", - "itoa", - "oxc_allocator 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_ast 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_data_structures 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_index", - "oxc_semantic 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_sourcemap", - "oxc_span 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_syntax 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-hash", -] - -[[package]] -name = "oxc_compat" -version = "0.97.0" -dependencies = [ - "cow-utils", - "oxc-browserslist", - "oxc_syntax 0.97.0", - "rustc-hash", - "serde", -] - [[package]] name = "oxc_compat" version = "0.97.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b73638911c4624a0f4fbbde909adc6ba4c0f3ed0666b8df349b15e04b5d12a0c" dependencies = [ "cow-utils", "oxc-browserslist", - "oxc_syntax 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", + "oxc_syntax", "rustc-hash", "serde", ] @@ -1988,12 +1900,6 @@ dependencies = [ "ropey", ] -[[package]] -name = "oxc_data_structures" -version = "0.97.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f6fb764c02ba8fd4b5a63fe35ec0d96b326a8a5a5ddd4251baea1d2b0c4f777" - [[package]] name = "oxc_diagnostics" version = "0.97.0" @@ -2003,17 +1909,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "oxc_diagnostics" -version = "0.97.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fd4d6311ab059f5a70bcb2ec03c156086242f4f5a8ed44fb59c6e4d1c89d98f" -dependencies = [ - "cow-utils", - "oxc-miette", - "percent-encoding", -] - [[package]] name = "oxc_ecmascript" version = "0.97.0" @@ -2021,25 +1916,10 @@ dependencies = [ "cow-utils", "num-bigint", "num-traits", - "oxc_allocator 0.97.0", - "oxc_ast 0.97.0", - "oxc_span 0.97.0", - "oxc_syntax 0.97.0", -] - -[[package]] -name = "oxc_ecmascript" -version = "0.97.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7371190f03d3de13c8c5123cb0aba670690b22fde2e068ee385caacd9e5b1e0f" -dependencies = [ - "cow-utils", - "num-bigint", - "num-traits", - "oxc_allocator 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_ast 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_span 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_syntax 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", + "oxc_allocator", + "oxc_ast", + "oxc_span", + "oxc_syntax", ] [[package]] @@ -2048,18 +1928,7 @@ version = "0.97.0" dependencies = [ "dragonbox_ecma", "itoa", - "oxc_data_structures 0.97.0", -] - -[[package]] -name = "oxc_estree" -version = "0.97.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e9149fe7697266369e9fa081970c13165a78e6c600ff95fb99202dacc518199" -dependencies = [ - "dragonbox_ecma", - "itoa", - "oxc_data_structures 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", + "oxc_data_structures", ] [[package]] @@ -2070,13 +1939,13 @@ dependencies = [ "insta", "json-strip-comments", "oxc-schemars", - "oxc_allocator 0.97.0", - "oxc_ast 0.97.0", - "oxc_data_structures 0.97.0", - "oxc_parser 0.97.0", - "oxc_semantic 0.97.0", - "oxc_span 0.97.0", - "oxc_syntax 0.97.0", + "oxc_allocator", + "oxc_ast", + "oxc_data_structures", + "oxc_parser", + "oxc_semantic", + "oxc_span", + "oxc_syntax", "phf", "pico-args", "project-root", @@ -2102,15 +1971,15 @@ version = "0.97.0" dependencies = [ "bitflags 2.10.0", "insta", - "oxc_allocator 0.97.0", - "oxc_ast 0.97.0", - "oxc_ast_visit 0.97.0", - "oxc_codegen 0.97.0", - "oxc_diagnostics 0.97.0", - "oxc_ecmascript 0.97.0", - "oxc_parser 0.97.0", - "oxc_span 0.97.0", - "oxc_syntax 0.97.0", + "oxc_allocator", + "oxc_ast", + "oxc_ast_visit", + "oxc_codegen", + "oxc_diagnostics", + "oxc_ecmascript", + "oxc_parser", + "oxc_span", + "oxc_syntax", "rustc-hash", ] @@ -2123,12 +1992,12 @@ dependencies = [ "ignore", "insta", "log", - "oxc_allocator 0.97.0", - "oxc_data_structures 0.97.0", - "oxc_diagnostics 0.97.0", + "oxc_allocator", + "oxc_data_structures", + "oxc_diagnostics", "oxc_formatter", "oxc_linter", - "oxc_parser 0.97.0", + "oxc_parser", "papaya", "rustc-hash", "serde", @@ -2158,23 +2027,23 @@ dependencies = [ "markdown", "memchr", "oxc-schemars", - "oxc_allocator 0.97.0", - "oxc_ast 0.97.0", - "oxc_ast_macros 0.97.0", - "oxc_ast_visit 0.97.0", + "oxc_allocator", + "oxc_ast", + "oxc_ast_macros", + "oxc_ast_visit", "oxc_cfg", - "oxc_codegen 0.97.0", - "oxc_data_structures 0.97.0", - "oxc_diagnostics 0.97.0", - "oxc_ecmascript 0.97.0", + "oxc_codegen", + "oxc_data_structures", + "oxc_diagnostics", + "oxc_ecmascript", "oxc_index", "oxc_macros", - "oxc_parser 0.97.0", - "oxc_regular_expression 0.97.0", + "oxc_parser", + "oxc_regular_expression", "oxc_resolver", - "oxc_semantic 0.97.0", - "oxc_span 0.97.0", - "oxc_syntax 0.97.0", + "oxc_semantic", + "oxc_span", + "oxc_syntax", "papaya", "phf", "project-root", @@ -2214,31 +2083,14 @@ name = "oxc_mangler" version = "0.97.0" dependencies = [ "itertools", - "oxc_allocator 0.97.0", - "oxc_ast 0.97.0", - "oxc_data_structures 0.97.0", - "oxc_index", - "oxc_parser 0.97.0", - "oxc_semantic 0.97.0", - "oxc_span 0.97.0", - "oxc_syntax 0.97.0", - "rustc-hash", -] - -[[package]] -name = "oxc_mangler" -version = "0.97.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a87f6565b64cacbecebe68996f2bf15877058fd792fdf09bb6ad778ea1ab2fa6" -dependencies = [ - "itertools", - "oxc_allocator 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_ast 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_data_structures 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", + "oxc_allocator", + "oxc_ast", + "oxc_data_structures", "oxc_index", - "oxc_semantic 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_span 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_syntax 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", + "oxc_parser", + "oxc_semantic", + "oxc_span", + "oxc_syntax", "rustc-hash", ] @@ -2249,51 +2101,26 @@ dependencies = [ "cow-utils", "insta", "javascript-globals", - "oxc_allocator 0.97.0", - "oxc_ast 0.97.0", - "oxc_ast_visit 0.97.0", - "oxc_codegen 0.97.0", - "oxc_compat 0.97.0", - "oxc_data_structures 0.97.0", - "oxc_ecmascript 0.97.0", + "oxc_allocator", + "oxc_ast", + "oxc_ast_visit", + "oxc_codegen", + "oxc_compat", + "oxc_data_structures", + "oxc_ecmascript", "oxc_index", - "oxc_mangler 0.97.0", - "oxc_parser 0.97.0", - "oxc_regular_expression 0.97.0", - "oxc_semantic 0.97.0", + "oxc_mangler", + "oxc_parser", + "oxc_regular_expression", + "oxc_semantic", "oxc_sourcemap", - "oxc_span 0.97.0", - "oxc_syntax 0.97.0", - "oxc_traverse 0.97.0", + "oxc_span", + "oxc_syntax", + "oxc_traverse", "pico-args", "rustc-hash", ] -[[package]] -name = "oxc_minifier" -version = "0.97.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aba67ad01f927ba0bb33c9f907ae388920cae4e3404b265164b01d1471396c89" -dependencies = [ - "cow-utils", - "oxc_allocator 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_ast 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_ast_visit 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_codegen 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_compat 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_data_structures 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_ecmascript 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_index", - "oxc_mangler 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_parser 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_regular_expression 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_semantic 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_span 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_syntax 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_traverse 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-hash", -] - [[package]] name = "oxc_minify_napi" version = "0.97.0" @@ -2302,15 +2129,15 @@ dependencies = [ "napi", "napi-build", "napi-derive", - "oxc_allocator 0.97.0", - "oxc_codegen 0.97.0", - "oxc_compat 0.97.0", - "oxc_diagnostics 0.97.0", - "oxc_minifier 0.97.0", + "oxc_allocator", + "oxc_codegen", + "oxc_compat", + "oxc_diagnostics", + "oxc_minifier", "oxc_napi", - "oxc_parser 0.97.0", + "oxc_parser", "oxc_sourcemap", - "oxc_span 0.97.0", + "oxc_span", ] [[package]] @@ -2320,12 +2147,12 @@ dependencies = [ "cow-utils", "flate2", "humansize", - "oxc_allocator 0.97.0", - "oxc_codegen 0.97.0", - "oxc_minifier 0.97.0", - "oxc_parser 0.97.0", - "oxc_semantic 0.97.0", - "oxc_span 0.97.0", + "oxc_allocator", + "oxc_codegen", + "oxc_minifier", + "oxc_parser", + "oxc_semantic", + "oxc_span", "oxc_tasks_common", "oxc_transformer_plugins", "pico-args", @@ -2340,11 +2167,11 @@ dependencies = [ "napi", "napi-build", "napi-derive", - "oxc_ast 0.97.0", - "oxc_ast_visit 0.97.0", - "oxc_diagnostics 0.97.0", - "oxc_span 0.97.0", - "oxc_syntax 0.97.0", + "oxc_ast", + "oxc_ast_visit", + "oxc_diagnostics", + "oxc_span", + "oxc_syntax", ] [[package]] @@ -2356,43 +2183,20 @@ dependencies = [ "memchr", "num-bigint", "num-traits", - "oxc_allocator 0.97.0", - "oxc_ast 0.97.0", - "oxc_ast_visit 0.97.0", - "oxc_data_structures 0.97.0", - "oxc_diagnostics 0.97.0", - "oxc_ecmascript 0.97.0", - "oxc_regular_expression 0.97.0", - "oxc_span 0.97.0", - "oxc_syntax 0.97.0", + "oxc_allocator", + "oxc_ast", + "oxc_ast_visit", + "oxc_data_structures", + "oxc_diagnostics", + "oxc_ecmascript", + "oxc_regular_expression", + "oxc_span", + "oxc_syntax", "pico-args", "rustc-hash", "seq-macro", ] -[[package]] -name = "oxc_parser" -version = "0.97.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "324174a2bc9857a6ad9bc62f6b99889416c6ff133d65af67d875ba83103013a3" -dependencies = [ - "bitflags 2.10.0", - "cow-utils", - "memchr", - "num-bigint", - "num-traits", - "oxc_allocator 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_ast 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_data_structures 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_diagnostics 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_ecmascript 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_regular_expression 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_span 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_syntax 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-hash", - "seq-macro", -] - [[package]] name = "oxc_parser_napi" version = "0.97.0" @@ -2402,8 +2206,8 @@ dependencies = [ "napi-build", "napi-derive", "oxc", - "oxc_ast_macros 0.97.0", - "oxc_estree 0.97.0", + "oxc_ast_macros", + "oxc_estree", "oxc_napi", "rustc-hash", ] @@ -2430,12 +2234,12 @@ name = "oxc_prettier_conformance" version = "0.0.0" dependencies = [ "cow-utils", - "oxc_allocator 0.97.0", - "oxc_ast 0.97.0", - "oxc_ast_visit 0.97.0", + "oxc_allocator", + "oxc_ast", + "oxc_ast_visit", "oxc_formatter", - "oxc_parser 0.97.0", - "oxc_span 0.97.0", + "oxc_parser", + "oxc_span", "oxc_tasks_common", "pico-args", "rustc-hash", @@ -2448,26 +2252,10 @@ name = "oxc_regular_expression" version = "0.97.0" dependencies = [ "bitflags 2.10.0", - "oxc_allocator 0.97.0", - "oxc_ast_macros 0.97.0", - "oxc_diagnostics 0.97.0", - "oxc_span 0.97.0", - "phf", - "rustc-hash", - "unicode-id-start", -] - -[[package]] -name = "oxc_regular_expression" -version = "0.97.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1896674a4e31a5332c7b57326c6327336a4848c1dc7d274658c3c86ad2be4100" -dependencies = [ - "bitflags 2.10.0", - "oxc_allocator 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_ast_macros 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_diagnostics 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_span 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", + "oxc_allocator", + "oxc_ast_macros", + "oxc_diagnostics", + "oxc_span", "phf", "rustc-hash", "unicode-id-start", @@ -2515,44 +2303,23 @@ version = "0.97.0" dependencies = [ "insta", "itertools", - "oxc_allocator 0.97.0", - "oxc_ast 0.97.0", - "oxc_ast_visit 0.97.0", + "oxc_allocator", + "oxc_ast", + "oxc_ast_visit", "oxc_cfg", - "oxc_data_structures 0.97.0", - "oxc_diagnostics 0.97.0", - "oxc_ecmascript 0.97.0", + "oxc_data_structures", + "oxc_diagnostics", + "oxc_ecmascript", "oxc_index", - "oxc_parser 0.97.0", - "oxc_span 0.97.0", - "oxc_syntax 0.97.0", + "oxc_parser", + "oxc_span", + "oxc_syntax", "phf", "rustc-hash", "self_cell", "serde_json", ] -[[package]] -name = "oxc_semantic" -version = "0.97.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c89cb4832fc494cd784154deaae4cbf1e8cd81a3f522c9046f18b516089dcf4" -dependencies = [ - "itertools", - "oxc_allocator 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_ast 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_ast_visit 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_data_structures 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_diagnostics 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_ecmascript 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_index", - "oxc_span 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_syntax 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "phf", - "rustc-hash", - "self_cell", -] - [[package]] name = "oxc_sourcemap" version = "6.0.1" @@ -2576,61 +2343,26 @@ dependencies = [ "compact_str", "oxc-miette", "oxc-schemars", - "oxc_allocator 0.97.0", - "oxc_ast_macros 0.97.0", - "oxc_estree 0.97.0", - "serde", -] - -[[package]] -name = "oxc_span" -version = "0.97.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b01d164645225a9e927de494609b1d981f0a828e4456e0caad097541ff9b81b5" -dependencies = [ - "compact_str", - "oxc-miette", - "oxc_allocator 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_ast_macros 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_estree 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde", -] - -[[package]] -name = "oxc_syntax" -version = "0.97.0" -dependencies = [ - "bitflags 2.10.0", - "cow-utils", - "dragonbox_ecma", - "nonmax", - "oxc_allocator 0.97.0", - "oxc_ast_macros 0.97.0", - "oxc_data_structures 0.97.0", - "oxc_estree 0.97.0", - "oxc_index", - "oxc_span 0.97.0", - "phf", + "oxc_allocator", + "oxc_ast_macros", + "oxc_estree", "serde", - "unicode-id-start", ] [[package]] name = "oxc_syntax" version = "0.97.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67543e785d7f4506ac4e95c90d7a6562be5a0c1e37e446a9d6fe6dd94d971f9e" dependencies = [ "bitflags 2.10.0", "cow-utils", "dragonbox_ecma", "nonmax", - "oxc_allocator 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_ast_macros 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_data_structures 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_estree 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", + "oxc_allocator", + "oxc_ast_macros", + "oxc_data_structures", + "oxc_estree", "oxc_index", - "oxc_span 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", + "oxc_span", "phf", "serde", "unicode-id-start", @@ -2641,7 +2373,7 @@ name = "oxc_tasks_common" version = "0.0.0" dependencies = [ "console 0.16.1", - "oxc_span 0.97.0", + "oxc_span", "project-root", "similar", "ureq", @@ -2652,13 +2384,13 @@ name = "oxc_tasks_transform_checker" version = "0.0.0" dependencies = [ "indexmap", - "oxc_allocator 0.97.0", - "oxc_ast 0.97.0", - "oxc_ast_visit 0.97.0", - "oxc_diagnostics 0.97.0", - "oxc_semantic 0.97.0", - "oxc_span 0.97.0", - "oxc_syntax 0.97.0", + "oxc_allocator", + "oxc_ast", + "oxc_ast_visit", + "oxc_diagnostics", + "oxc_semantic", + "oxc_span", + "oxc_syntax", "rustc-hash", ] @@ -2668,10 +2400,10 @@ version = "0.0.0" dependencies = [ "humansize", "mimalloc-safe", - "oxc_allocator 0.97.0", - "oxc_minifier 0.97.0", - "oxc_parser 0.97.0", - "oxc_semantic 0.97.0", + "oxc_allocator", + "oxc_minifier", + "oxc_parser", + "oxc_semantic", "oxc_tasks_common", "oxc_transformer", ] @@ -2714,20 +2446,20 @@ dependencies = [ "insta", "itoa", "memchr", - "oxc_allocator 0.97.0", - "oxc_ast 0.97.0", - "oxc_ast_visit 0.97.0", - "oxc_codegen 0.97.0", - "oxc_compat 0.97.0", - "oxc_data_structures 0.97.0", - "oxc_diagnostics 0.97.0", - "oxc_ecmascript 0.97.0", - "oxc_parser 0.97.0", - "oxc_regular_expression 0.97.0", - "oxc_semantic 0.97.0", - "oxc_span 0.97.0", - "oxc_syntax 0.97.0", - "oxc_traverse 0.97.0", + "oxc_allocator", + "oxc_ast", + "oxc_ast_visit", + "oxc_codegen", + "oxc_compat", + "oxc_data_structures", + "oxc_diagnostics", + "oxc_ecmascript", + "oxc_parser", + "oxc_regular_expression", + "oxc_semantic", + "oxc_span", + "oxc_syntax", + "oxc_traverse", "pico-args", "rustc-hash", "serde", @@ -2742,21 +2474,21 @@ dependencies = [ "cow-utils", "insta", "itoa", - "oxc_allocator 0.97.0", - "oxc_ast 0.97.0", - "oxc_ast_visit 0.97.0", - "oxc_codegen 0.97.0", - "oxc_diagnostics 0.97.0", - "oxc_ecmascript 0.97.0", - "oxc_minifier 0.97.0", - "oxc_parser 0.97.0", - "oxc_semantic 0.97.0", + "oxc_allocator", + "oxc_ast", + "oxc_ast_visit", + "oxc_codegen", + "oxc_diagnostics", + "oxc_ecmascript", + "oxc_minifier", + "oxc_parser", + "oxc_semantic", "oxc_sourcemap", - "oxc_span 0.97.0", - "oxc_syntax 0.97.0", + "oxc_span", + "oxc_syntax", "oxc_tasks_common", "oxc_transformer", - "oxc_traverse 0.97.0", + "oxc_traverse", "pico-args", "rustc-hash", "similar", @@ -2767,32 +2499,14 @@ name = "oxc_traverse" version = "0.97.0" dependencies = [ "itoa", - "oxc_allocator 0.97.0", - "oxc_ast 0.97.0", - "oxc_ast_visit 0.97.0", - "oxc_data_structures 0.97.0", - "oxc_ecmascript 0.97.0", - "oxc_semantic 0.97.0", - "oxc_span 0.97.0", - "oxc_syntax 0.97.0", - "rustc-hash", -] - -[[package]] -name = "oxc_traverse" -version = "0.97.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbf212ba99e891138336305be01047e9406bc0898671bf41c13a6fc075a4aa38" -dependencies = [ - "itoa", - "oxc_allocator 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_ast 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_ast_visit 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_data_structures 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_ecmascript 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_semantic 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_span 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", - "oxc_syntax 0.97.0 (registry+https://github.com/rust-lang/crates.io-index)", + "oxc_allocator", + "oxc_ast", + "oxc_ast_visit", + "oxc_data_structures", + "oxc_ecmascript", + "oxc_semantic", + "oxc_span", + "oxc_syntax", "rustc-hash", ] @@ -2808,11 +2522,11 @@ dependencies = [ "napi-build", "napi-derive", "oxc-miette", - "oxc_allocator 0.97.0", - "oxc_diagnostics 0.97.0", + "oxc_allocator", + "oxc_diagnostics", "oxc_formatter", - "oxc_parser 0.97.0", - "oxc_span 0.97.0", + "oxc_parser", + "oxc_span", "rayon", "tracing-subscriber", ] @@ -2831,10 +2545,10 @@ dependencies = [ "napi-build", "napi-derive", "oxc-miette", - "oxc_allocator 0.97.0", - "oxc_diagnostics 0.97.0", + "oxc_allocator", + "oxc_diagnostics", "oxc_linter", - "oxc_span 0.97.0", + "oxc_span", "rayon", "rustc-hash", "serde", @@ -3181,11 +2895,11 @@ dependencies = [ "convert_case", "handlebars", "lazy-regex", - "oxc_allocator 0.97.0", - "oxc_ast 0.97.0", - "oxc_ast_visit 0.97.0", - "oxc_parser 0.97.0", - "oxc_span 0.97.0", + "oxc_allocator", + "oxc_ast", + "oxc_ast_visit", + "oxc_parser", + "oxc_span", "oxc_tasks_common", "rustc-hash", "serde", @@ -4064,11 +3778,11 @@ dependencies = [ "itertools", "markdown", "oxc-schemars", - "oxc_allocator 0.97.0", - "oxc_diagnostics 0.97.0", + "oxc_allocator", + "oxc_diagnostics", "oxc_linter", - "oxc_parser 0.97.0", - "oxc_span 0.97.0", + "oxc_parser", + "oxc_span", "oxlint", "pico-args", "project-root", diff --git a/justfile b/justfile index bf5972b4f835d..33785da445289 100755 --- a/justfile +++ b/justfile @@ -123,10 +123,13 @@ codecov: # ==================== AST & CODEGEN ==================== -# Generate AST related boilerplate code +# Generate AST related boilerplate code. +# If fails first time, run with JS generators disabled first, and then again with JS generators enabled. +# This is necessary because JS generators use `oxc_*` crates (e.g. `oxc_minifier`), and those crates may not compile +# unless Rust code is generated first. +# See: https://github.com/oxc-project/oxc/issues/15564 ast: - cargo run -p oxc_ast_tools - just check + cargo run -p oxc_ast_tools || (cargo run -p oxc_ast_tools --no-default-features && cargo run -p oxc_ast_tools) # ==================== PARSER ==================== diff --git a/tasks/ast_tools/Cargo.toml b/tasks/ast_tools/Cargo.toml index 07f8dd7598e77..95c039d5e6389 100644 --- a/tasks/ast_tools/Cargo.toml +++ b/tasks/ast_tools/Cargo.toml @@ -14,18 +14,19 @@ test = true doctest = false [dependencies] -# NOT `workspace = true`. -# If AST is updated, the local versions of these crates may not compile until after the codegen has run. -# So the codegen itself (this crate) can't use local versions. +# These dependencies are only used by JS generators. +# So make them optional, and only enable them if `generate-js` feature is enabled. +# See comment on `js-generators` feature below. +# # `features = ["serialize"]` on `oxc_span` and `oxc_syntax` is needed to work around a bug in `oxc_index`. -oxc_allocator = { version = "0.97.0" } -oxc_ast = { version = "0.97.0" } -oxc_ast_visit = { version = "0.97.0" } -oxc_codegen = { version = "0.97.0" } -oxc_minifier = { version = "0.97.0" } -oxc_parser = { version = "0.97.0" } -oxc_span = { version = "0.97.0", features = ["serialize"] } -oxc_syntax = { version = "0.97.0", features = ["serialize"] } +oxc_allocator = { workspace = true, optional = true } +oxc_ast = { workspace = true, optional = true } +oxc_ast_visit = { workspace = true, optional = true } +oxc_codegen = { workspace = true, optional = true } +oxc_minifier = { workspace = true, optional = true } +oxc_parser = { workspace = true, optional = true } +oxc_span = { workspace = true, features = ["serialize"], optional = true } +oxc_syntax = { workspace = true, features = ["serialize"], optional = true } oxc_data_structures = { workspace = true, features = ["slice_iter"] } @@ -47,3 +48,20 @@ rustc-hash = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } syn = { workspace = true, features = ["clone-impls", "derive", "extra-traits", "full", "parsing", "printing", "proc-macro"] } + +[features] +default = ["generate-js"] +# Feature to enable JS generators that require `oxc_*` crates. +# Enabled by default, but can be disabled to break the circular dependency +# when AST changes prevent local crates from compiling. +# See: https://github.com/oxc-project/oxc/issues/15564 +generate-js = [ + "dep:oxc_allocator", + "dep:oxc_ast", + "dep:oxc_ast_visit", + "dep:oxc_codegen", + "dep:oxc_minifier", + "dep:oxc_parser", + "dep:oxc_span", + "dep:oxc_syntax", +] diff --git a/tasks/ast_tools/src/generators/mod.rs b/tasks/ast_tools/src/generators/mod.rs index 9165d6e09a2c1..f87e8e769b053 100644 --- a/tasks/ast_tools/src/generators/mod.rs +++ b/tasks/ast_tools/src/generators/mod.rs @@ -7,12 +7,16 @@ use crate::{ mod assert_layouts; mod ast_builder; mod ast_kind; +#[cfg(feature = "generate-js")] mod estree_visit; mod formatter; mod get_id; +#[cfg(feature = "generate-js")] mod raw_transfer; +#[cfg(feature = "generate-js")] mod raw_transfer_lazy; mod scopes_collector; +#[cfg(feature = "generate-js")] mod typescript; mod utf8_to_utf16; mod visit; @@ -20,12 +24,16 @@ mod visit; pub use assert_layouts::AssertLayouts; pub use ast_builder::AstBuilderGenerator; pub use ast_kind::AstKindGenerator; +#[cfg(feature = "generate-js")] pub use estree_visit::ESTreeVisitGenerator; pub use formatter::{FormatterAstNodesGenerator, FormatterFormatGenerator}; pub use get_id::GetIdGenerator; +#[cfg(feature = "generate-js")] pub use raw_transfer::RawTransferGenerator; +#[cfg(feature = "generate-js")] pub use raw_transfer_lazy::RawTransferLazyGenerator; pub use scopes_collector::ScopesCollectorGenerator; +#[cfg(feature = "generate-js")] pub use typescript::TypescriptGenerator; pub use utf8_to_utf16::Utf8ToUtf16ConverterGenerator; pub use visit::VisitGenerator; diff --git a/tasks/ast_tools/src/main.rs b/tasks/ast_tools/src/main.rs index 7fe39c1813963..7d0a5d74fad99 100644 --- a/tasks/ast_tools/src/main.rs +++ b/tasks/ast_tools/src/main.rs @@ -23,7 +23,7 @@ //! Code generation can be triggered by running this crate: //! //! ```sh -//! cargo run -p oxc_ast_tools +//! just ast //! ``` //! //! The generated code is checked into git. @@ -181,6 +181,9 @@ //! [`AttrLocation`]: parse::attr::AttrLocation //! [`AttrPart`]: parse::attr::AttrPart +// Prevent lint errors when JS generators are disabled +#![cfg_attr(not(feature = "generate-js"), allow(dead_code, unused_imports, unused_macros))] + use std::fs; use bpaf::{Bpaf, Parser}; @@ -283,9 +286,13 @@ const GENERATORS: &[&(dyn Generator + Sync)] = &[ &generators::VisitGenerator, &generators::ScopesCollectorGenerator, &generators::Utf8ToUtf16ConverterGenerator, + #[cfg(feature = "generate-js")] &generators::ESTreeVisitGenerator, + #[cfg(feature = "generate-js")] &generators::RawTransferGenerator, + #[cfg(feature = "generate-js")] &generators::RawTransferLazyGenerator, + #[cfg(feature = "generate-js")] &generators::TypescriptGenerator, &generators::FormatterFormatGenerator, &generators::FormatterAstNodesGenerator, @@ -347,12 +354,19 @@ fn main() { logln!("All Derives and Generators... Done!"); - // Edit `lib.rs` in `oxc_ast_macros` crate + // Generate `derived_traits.rs` in `oxc_ast_macros` crate outputs.push(generate_proc_macro()); + + // Edit `lib.rs` in `oxc_ast_macros` crate. + // Skip this step if JS generators are disabled, because those generators may define attributes. + #[cfg(feature = "generate-js")] outputs.push(generate_updated_proc_macro(&codegen)); - // Add CI filter file to outputs outputs.sort_unstable_by(|o1, o2| o1.path.cmp(&o2.path)); + + // Add CI filter file to outputs. + // Skip this step if JS generators are disabled, because not all files are generated. + #[cfg(feature = "generate-js")] outputs.push(generate_ci_filter(&outputs)); // Write outputs to disk diff --git a/tasks/ast_tools/src/output/mod.rs b/tasks/ast_tools/src/output/mod.rs index cf4bea2fa289d..a0475f1955ca2 100644 --- a/tasks/ast_tools/src/output/mod.rs +++ b/tasks/ast_tools/src/output/mod.rs @@ -5,9 +5,11 @@ use proc_macro2::TokenStream; use crate::{log, log_result}; +#[cfg(feature = "generate-js")] pub mod javascript; mod rust; mod yaml; +#[cfg(feature = "generate-js")] use javascript::print_javascript; use rust::{print_rust, rust_fmt}; use yaml::print_yaml; @@ -31,11 +33,27 @@ fn add_header(code: &str, generator_path: &str, comment_start: &str) -> String { /// Can be Rust, Javascript, or other formats. #[expect(dead_code)] pub enum Output { - Rust { path: String, tokens: TokenStream }, - RustString { path: String, code: String }, - Javascript { path: String, code: String }, - Yaml { path: String, code: String }, - Raw { path: String, code: String }, + Rust { + path: String, + tokens: TokenStream, + }, + RustString { + path: String, + code: String, + }, + #[cfg(feature = "generate-js")] + Javascript { + path: String, + code: String, + }, + Yaml { + path: String, + code: String, + }, + Raw { + path: String, + code: String, + }, } impl Output { @@ -54,6 +72,7 @@ impl Output { let code = rust_fmt(&code); (path, code) } + #[cfg(feature = "generate-js")] Self::Javascript { path, code } => { let code = print_javascript(&code, &generator_path); (path, code)