From c2eaa669432fcfe899b9f54e185f61cf755f0365 Mon Sep 17 00:00:00 2001 From: ClarkXia Date: Thu, 1 Feb 2024 16:43:42 +0800 Subject: [PATCH 1/2] fix: change import source by config --- Cargo.lock | 202 +++++------- .../src/change_package_import.rs | 221 ++++++-------- .../tests/fixture.rs | 288 +++++++++++------- .../fixture/ice_matched_transform/output.js | 4 +- .../fixture/ice_multiple_transform/output.js | 2 +- .../multi_specific_transform/output.js | 9 +- 6 files changed, 371 insertions(+), 355 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 51e3189..7aaecdf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -82,12 +82,6 @@ dependencies = [ "libc", ] -[[package]] -name = "anes" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" - [[package]] name = "ansi_term" version = "0.12.1" @@ -97,12 +91,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "anstyle" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2faccea4cc4ab4a667ce676a30e8ec13922a692c99bb8f5b11f1502c72e04220" - [[package]] name = "anyhow" version = "1.0.79" @@ -532,58 +520,17 @@ dependencies = [ "windows-targets 0.48.5", ] -[[package]] -name = "ciborium" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" - -[[package]] -name = "ciborium-ll" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" -dependencies = [ - "ciborium-io", - "half", -] - [[package]] name = "clap" -version = "4.4.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" -dependencies = [ - "clap_builder", -] - -[[package]] -name = "clap_builder" -version = "4.4.18" +version = "2.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" dependencies = [ - "anstyle", - "clap_lex", + "bitflags 1.3.2", + "textwrap 0.11.0", + "unicode-width", ] -[[package]] -name = "clap_lex" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" - [[package]] name = "color-backtrace" version = "0.6.1" @@ -649,25 +596,25 @@ dependencies = [ [[package]] name = "criterion" -version = "0.5.1" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" +checksum = "b01d6de93b2b6c65e17c634a26653a29d107b3c98c607c765bf38d041531cd8f" dependencies = [ - "anes", + "atty", "cast", - "ciborium", "clap", "criterion-plot", + "csv", "futures", - "is-terminal", "itertools 0.10.5", + "lazy_static", "num-traits", - "once_cell", "oorandom", "plotters", "rayon", "regex", "serde", + "serde_cbor", "serde_derive", "serde_json", "tinytemplate", @@ -677,9 +624,9 @@ dependencies = [ [[package]] name = "criterion-plot" -version = "0.5.0" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" +checksum = "2673cc8207403546f45f5fd319a974b1e6983ad1a3ee7e6041650013be041876" dependencies = [ "cast", "itertools 0.10.5", @@ -715,12 +662,6 @@ version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - [[package]] name = "crypto-common" version = "0.1.6" @@ -731,6 +672,27 @@ dependencies = [ "typenum", ] +[[package]] +name = "csv" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac574ff4d437a7b5ad237ef331c17ccca63c46479e5b5453eb8e10bb99a759fe" +dependencies = [ + "csv-core", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "csv-core" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5efa2b3d7902f4b634a20cae3c9c4e6209dc4779feb6863329607560143efa70" +dependencies = [ + "memchr", +] + [[package]] name = "ctor" version = "0.2.5" @@ -1108,19 +1070,15 @@ checksum = "9985c9503b412198aa4197559e9a318524ebc4519c229bfa05a535828c950b9d" [[package]] name = "half" -version = "2.3.1" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc52e53916c08643f1b56ec082790d1e86a32e58dc5268f897f313fbae7b4872" -dependencies = [ - "cfg-if", - "crunchy", -] +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" [[package]] name = "handlebars" -version = "5.1.1" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c73166c591e67fb4bf9bc04011b4e35f12e89fe8d676193aa263df065955a379" +checksum = "faa67bab9ff362228eb3d00bd024a4965d8231bbb7921167f0cfa66c6626b225" dependencies = [ "log", "pest", @@ -1275,7 +1233,6 @@ checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", - "serde", ] [[package]] @@ -1412,9 +1369,9 @@ dependencies = [ [[package]] name = "jsonc-parser" -version = "0.23.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7725c320caac8c21d8228c1d055af27a995d371f78cc763073d3e068323641b5" +checksum = "538702ed54bac04d391352d4c9ad0ec2a9225e3c477ffa23fc44d0f04fa83c54" dependencies = [ "serde_json", ] @@ -1665,7 +1622,7 @@ dependencies = [ "supports-hyperlinks 1.2.0", "supports-unicode 1.0.2", "terminal_size", - "textwrap", + "textwrap 0.15.2", "thiserror", "unicode-width", ] @@ -1686,7 +1643,7 @@ dependencies = [ "supports-hyperlinks 2.1.0", "supports-unicode 2.0.0", "terminal_size", - "textwrap", + "textwrap 0.15.2", "thiserror", "unicode-width", ] @@ -2516,6 +2473,12 @@ version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +[[package]] +name = "regex-syntax" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" + [[package]] name = "regex-syntax" version = "0.8.2" @@ -2524,9 +2487,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "regress" -version = "0.7.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ed9969cad8051328011596bf549629f1b800cf1731e7964b1eef8dfc480d2c2" +checksum = "82a9ecfa0cb04d0b04dddb99b8ccf4f66bc8dfd23df694b398570bd8ae3a50fb" dependencies = [ "hashbrown 0.13.2", "memchr", @@ -2735,7 +2698,6 @@ dependencies = [ "futures", "glob-match", "hashlink", - "hex", "indexmap 2.1.0", "itertools 0.12.1", "json", @@ -2749,7 +2711,6 @@ dependencies = [ "regex", "rkyv", "rspack_ast", - "rspack_core_macros", "rspack_database", "rspack_error", "rspack_fs", @@ -2773,14 +2734,6 @@ dependencies = [ "ustr", ] -[[package]] -name = "rspack_core_macros" -version = "0.1.0" -dependencies = [ - "quote", - "syn 2.0.48", -] - [[package]] name = "rspack_database" version = "0.1.0" @@ -2799,13 +2752,10 @@ dependencies = [ "futures", "miette 5.10.0", "once_cell", - "owo-colors", "rspack_identifier", "swc_core", "termcolor", - "textwrap", "thiserror", - "unicode-width", ] [[package]] @@ -2909,7 +2859,7 @@ dependencies = [ "dashmap", "either", "indexmap 2.1.0", - "jsonc-parser 0.23.0", + "jsonc-parser 0.22.1", "once_cell", "rspack_ast", "rspack_core", @@ -2918,12 +2868,10 @@ dependencies = [ "rspack_plugin_javascript", "rspack_swc_visitors", "rspack_testing", - "rspack_util", "serde", "serde_json", "swc_config", "swc_core", - "tokio", "xxhash-rust", ] @@ -3023,7 +2971,7 @@ dependencies = [ "bitflags 2.4.2", "heck", "hrx-parser", - "indexmap 1.9.3", + "indexmap 2.1.0", "insta", "once_cell", "rayon", @@ -3035,7 +2983,6 @@ dependencies = [ "rspack_identifier", "rspack_plugin_runtime", "rspack_testing", - "rspack_util", "rustc-hash", "serde_json", "sugar_path", @@ -3050,8 +2997,6 @@ version = "0.1.0" dependencies = [ "async-trait", "dashmap", - "derivative", - "futures", "once_cell", "pathdiff", "rayon", @@ -3059,7 +3004,6 @@ dependencies = [ "rspack_base64", "rspack_core", "rspack_error", - "rspack_hash", "rspack_util", "rustc-hash", "serde_json", @@ -3102,7 +3046,6 @@ dependencies = [ "rspack_error", "rspack_hash", "rspack_identifier", - "rspack_util", "rustc-hash", "serde_json", ] @@ -3138,11 +3081,13 @@ version = "0.1.0" dependencies = [ "async-trait", "bitflags 2.4.2", + "either", "indexmap 2.1.0", "itertools 0.12.1", "linked_hash_set", "num-bigint", "once_cell", + "preset_env_base", "rayon", "regex", "rspack_ast", @@ -3156,7 +3101,6 @@ dependencies = [ "rspack_testing", "rspack_util", "rustc-hash", - "serde", "serde_json", "sugar_path", "swc_core", @@ -3220,7 +3164,6 @@ dependencies = [ "rspack_hash", "rspack_identifier", "rspack_loader_runner", - "rspack_util", "rustc-hash", "serde", "serde_json", @@ -3233,7 +3176,6 @@ version = "0.1.0" dependencies = [ "async-trait", "indicatif", - "linked-hash-map", "rspack_core", "rspack_error", ] @@ -3269,13 +3211,13 @@ dependencies = [ "indexmap 2.1.0", "itertools 0.12.1", "once_cell", + "rayon", "regex", "rspack_core", "rspack_error", "rspack_hash", "rspack_identifier", "rspack_plugin_javascript", - "rspack_util", "rustc-hash", "serde_json", ] @@ -3363,7 +3305,6 @@ dependencies = [ "rspack_error", "rspack_identifier", "rspack_testing", - "rspack_util", "serde_json", "swc_core", "wasmparser", @@ -3389,7 +3330,7 @@ dependencies = [ name = "rspack_regex" version = "0.1.0" dependencies = [ - "regex-syntax 0.8.2", + "regex-syntax 0.7.5", "regress", "rspack_error", "swc_core", @@ -3418,6 +3359,7 @@ dependencies = [ name = "rspack_swc_visitors" version = "0.1.0" dependencies = [ + "indexmap 2.1.0", "once_cell", "regex", "serde", @@ -3479,10 +3421,8 @@ name = "rspack_util" version = "0.1.0" dependencies = [ "concat-string", - "dashmap", "once_cell", "regex", - "rustc-hash", "sugar_path", "swc_core", ] @@ -3623,6 +3563,16 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde_cbor" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" +dependencies = [ + "half", + "serde", +] + [[package]] name = "serde_derive" version = "1.0.195" @@ -5411,6 +5361,15 @@ dependencies = [ "syn 2.0.48", ] +[[package]] +name = "textwrap" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" +dependencies = [ + "unicode-width", +] + [[package]] name = "textwrap" version = "0.15.2" @@ -5807,13 +5766,12 @@ checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" [[package]] name = "wasmparser" -version = "0.120.0" +version = "0.102.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9148127f39cbffe43efee8d5442b16ecdba21567785268daa1ec9e134389705" +checksum = "48134de3d7598219ab9eaf6b91b15d8e50d31da76b8519fe4ecfcec2cf35104b" dependencies = [ - "bitflags 2.4.2", - "indexmap 2.1.0", - "semver 1.0.20", + "indexmap 1.9.3", + "url", ] [[package]] diff --git a/crates/swc_change_package_import/src/change_package_import.rs b/crates/swc_change_package_import/src/change_package_import.rs index ce79792..8a178c3 100644 --- a/crates/swc_change_package_import/src/change_package_import.rs +++ b/crates/swc_change_package_import/src/change_package_import.rs @@ -1,10 +1,10 @@ use swc_core::{ - common::{util::take::Take, DUMMY_SP}, + common::DUMMY_SP, ecma::{ ast::*, atoms::JsWord, utils::{quote_str, swc_ecma_ast::ImportSpecifier}, - visit::{VisitMut, VisitMutWith}, + visit::{noop_fold_type, Fold, FoldWith}, }, }; @@ -13,142 +13,127 @@ use crate::config::{Config, ImportType}; pub struct ModuleImportVisitor { // 用户配置 pub options: Vec, - // 全新生成的导入声明 - new_stmts: Vec, } impl ModuleImportVisitor { pub fn new(options: Vec) -> Self { - Self { - options, - new_stmts: vec![], - } + Self { options } } } -impl VisitMut for ModuleImportVisitor { - fn visit_mut_import_decl(&mut self, import_decl: &mut ImportDecl) { - import_decl.visit_mut_children_with(self); - - for option in &self.options { - match option { - Config::LiteralConfig(src) => { - if is_hit_rule(import_decl, option) { - for specifier in &import_decl.specifiers { - match specifier { - ImportSpecifier::Named(named_import_spec) => { - let mut import_new_src = src.clone(); - import_new_src.push_str("/"); - import_new_src.push_str(&get_import_module_name(named_import_spec)); - - self.new_stmts.push(create_default_import_decl( - import_new_src, - named_import_spec.local.clone(), - )); +impl Fold for ModuleImportVisitor { + noop_fold_type!(); + + fn fold_module_items(&mut self, items: Vec) -> Vec { + let mut new_items: Vec = vec![]; + + for item in items { + let item = item.fold_children_with(self); + let mut hit_rule = false; + if let ModuleItem::ModuleDecl(ModuleDecl::Import(import_decl)) = &item { + for option in &self.options { + match option { + Config::LiteralConfig(src) => { + if is_hit_rule(import_decl, option) { + hit_rule = true; + for specifier in &import_decl.specifiers { + match specifier { + ImportSpecifier::Named(named_import_spec) => { + let mut import_new_src = src.clone(); + import_new_src.push_str("/"); + import_new_src.push_str(&get_import_module_name(named_import_spec)); + + new_items.push(create_default_import_decl( + import_new_src, + named_import_spec.local.clone(), + )); + } + _ => (), + } } - _ => (), + break; } } - // 清空当前导入声明,否则会被作为有效的声明添加至 new_stmts 中 - import_decl.take(); - break; - } - } - Config::SpecificConfig(config) => { - if is_hit_rule(import_decl, option) { - let target_fields: Vec<&String> = config.map.keys().clone().collect(); - let mut named_import_spec_copy = import_decl.clone(); - - // 获取未命中规则的导入声明 - named_import_spec_copy.specifiers = named_import_spec_copy - .specifiers - .into_iter() - .filter(|specifier| match specifier { - ImportSpecifier::Named(named_import_spec) => { - let import_object_name = get_import_module_name(named_import_spec); - !target_fields.contains(&&import_object_name) + Config::SpecificConfig(config) => { + if is_hit_rule(import_decl, option) { + hit_rule = true; + let target_fields: Vec<&String> = config.map.keys().clone().collect(); + let mut named_import_spec_copy = import_decl.clone(); + + named_import_spec_copy.specifiers = named_import_spec_copy + .specifiers + .into_iter() + .filter(|specifier| match specifier { + ImportSpecifier::Named(named_import_spec) => { + let import_object_name = get_import_module_name(named_import_spec); + !target_fields.contains(&&import_object_name) + } + _ => true, + }) + .collect::>(); + + if named_import_spec_copy.specifiers.len() != 0 { + // It no need to redirect import source, if some specifiers are not configured. + new_items.push(item.clone()); + break; } - _ => true, - }) - .collect::>(); - - if named_import_spec_copy.specifiers.len() != 0 { - self - .new_stmts - .push(ModuleItem::ModuleDecl(ModuleDecl::Import( - named_import_spec_copy, - ))); - } - - for (target, rules) in config.map.iter() { - for specifier in &import_decl.specifiers { - match specifier { - ImportSpecifier::Named(named_import_spec) => { - let import_object_name = get_import_module_name(named_import_spec); - if target == &import_object_name { - let new_import_decl: ModuleItem; - if rules.import_type.is_none() - || match rules.import_type.as_ref().unwrap() { - ImportType::Default => true, - _ => false, - } - { - // Default import mode - new_import_decl = create_default_import_decl( - rules.to.to_string(), - named_import_spec.local.clone(), - ); - } else { - // Named import mode - let mut named_import_spec_copy = named_import_spec.clone(); - - if rules.name.is_some() { - named_import_spec_copy.imported = Some(ModuleExportName::Str(Str { - span: named_import_spec.span, - value: rules.name.clone().unwrap().into(), - raw: Some(rules.name.clone().unwrap().clone().into()), - })) + for specifier in &import_decl.specifiers { + for (target, rules) in config.map.iter() { + match specifier { + ImportSpecifier::Named(named_import_spec) => { + let import_object_name = get_import_module_name(named_import_spec); + if target == &import_object_name { + let new_import_decl: ModuleItem; + if rules.import_type.is_none() + || match rules.import_type.as_ref().unwrap() { + ImportType::Default => true, + _ => false, + } + { + // Default import mode + new_import_decl = create_default_import_decl( + rules.to.to_string(), + named_import_spec.local.clone(), + ); + } else { + // Named import mode + let mut named_import_spec_copy = named_import_spec.clone(); + + if rules.name.is_some() { + named_import_spec_copy.imported = Some(ModuleExportName::Str(Str { + span: named_import_spec.span, + value: rules.name.clone().unwrap().into(), + raw: Some(rules.name.clone().unwrap().clone().into()), + })) + } + + new_import_decl = create_named_import_decl( + rules.to.to_string(), + vec![ImportSpecifier::Named(named_import_spec_copy)], + ); + } + + new_items.push(new_import_decl); } - - new_import_decl = create_named_import_decl( - rules.to.to_string(), - vec![ImportSpecifier::Named(named_import_spec_copy)], - ); } - - self.new_stmts.push(new_import_decl); + _ => (), } } - _ => (), } + break; } } - import_decl.take(); - break; } } - } - } - - if !is_empty_decl(import_decl) { - self - .new_stmts - .push(wrap_with_moudle_item(import_decl.clone())); - } - } - - fn visit_mut_module_item(&mut self, n: &mut ModuleItem) { - n.visit_mut_children_with(self); - if !n.is_module_decl() { - self.new_stmts.push(n.clone()); + if !hit_rule { + new_items.push(item); + } + } else { + new_items.push(item); + } } - } - - fn visit_mut_module_items(&mut self, stmts: &mut Vec) { - stmts.visit_mut_children_with(self); - - *stmts = self.new_stmts.clone(); + new_items } } @@ -169,10 +154,6 @@ fn is_hit_rule(cur_import: &ImportDecl, rule: &Config) -> bool { } } -fn is_empty_decl(decl: &ImportDecl) -> bool { - decl.specifiers.len() == 0 && decl.src.value == JsWord::from("".to_string()) -} - fn get_import_module_name(named_import_spec: &ImportNamedSpecifier) -> String { if named_import_spec.imported.is_none() { (&named_import_spec.local.sym).to_string() diff --git a/crates/swc_change_package_import/tests/fixture.rs b/crates/swc_change_package_import/tests/fixture.rs index 9623887..5b80eda 100644 --- a/crates/swc_change_package_import/tests/fixture.rs +++ b/crates/swc_change_package_import/tests/fixture.rs @@ -1,24 +1,17 @@ use std::collections::HashMap; use std::path::PathBuf; -use swc_core::ecma::{ - transforms::testing::{test_fixture, FixtureTestConfig}, - visit::as_folder, -}; use swc_change_package_import::{ Config, ImportType, MapProperty, ModuleImportVisitor, SpecificConfigs, }; +use swc_core::ecma::transforms::testing::{test_fixture, FixtureTestConfig}; #[testing::fixture("tests/fixture/single_literal_transform/input.js")] fn test_single_literal_transform(input: PathBuf) { let output = input.with_file_name("output.js"); test_fixture( Default::default(), - &|_t| { - as_folder(ModuleImportVisitor::new(vec![Config::LiteralConfig( - String::from("y"), - )])) - }, + &|_t| ModuleImportVisitor::new(vec![Config::LiteralConfig(String::from("y"))]), &input, &output, FixtureTestConfig { @@ -33,10 +26,10 @@ fn test_multi_literal_transform(input: PathBuf) { test_fixture( Default::default(), &|_t| { - as_folder(ModuleImportVisitor::new(vec![ + ModuleImportVisitor::new(vec![ Config::LiteralConfig(String::from("z")), Config::LiteralConfig(String::from("o")), - ])) + ]) }, &input, &output, @@ -53,19 +46,17 @@ fn test_single_specific_transform(input: PathBuf) { test_fixture( Default::default(), &|_t| { - as_folder(ModuleImportVisitor::new(vec![Config::SpecificConfig( - SpecificConfigs { - name: String::from("y"), - map: HashMap::from([( - "x".to_string(), - MapProperty { - to: String::from("m/n"), - import_type: Some(ImportType::Named), - name: Some(String::from("a")), - }, - )]), - }, - )])) + ModuleImportVisitor::new(vec![Config::SpecificConfig(SpecificConfigs { + name: String::from("y"), + map: HashMap::from([( + "x".to_string(), + MapProperty { + to: String::from("m/n"), + import_type: Some(ImportType::Named), + name: Some(String::from("a")), + }, + )]), + })]) }, &input, &output, @@ -81,19 +72,17 @@ fn test_single_specific_transform_2(input: PathBuf) { test_fixture( Default::default(), &|_t| { - as_folder(ModuleImportVisitor::new(vec![Config::SpecificConfig( - SpecificConfigs { - name: String::from("y"), - map: HashMap::from([( - "x".to_string(), - MapProperty { - to: String::from("m/n"), - import_type: Some(ImportType::Named), - name: Some(String::from("a")), - }, - )]), - }, - )])) + ModuleImportVisitor::new(vec![Config::SpecificConfig(SpecificConfigs { + name: String::from("y"), + map: HashMap::from([( + "x".to_string(), + MapProperty { + to: String::from("m/n"), + import_type: Some(ImportType::Named), + name: Some(String::from("a")), + }, + )]), + })]) }, &input, &output, @@ -109,7 +98,7 @@ fn test_mix_specific_transform(input: PathBuf) { test_fixture( Default::default(), &|_t| { - as_folder(ModuleImportVisitor::new(vec![ + ModuleImportVisitor::new(vec![ Config::LiteralConfig(String::from("antd")), Config::SpecificConfig(SpecificConfigs { name: String::from("ice"), @@ -122,7 +111,7 @@ fn test_mix_specific_transform(input: PathBuf) { }, )]), }), - ])) + ]) }, &input, &output, @@ -132,25 +121,72 @@ fn test_mix_specific_transform(input: PathBuf) { ); } -#[testing::fixture("tests/fixture/ice_basic_transform/input.js")] -fn test_ice_basic_transform(input: PathBuf) { +#[testing::fixture("tests/fixture/multi_specific_transform/input.js")] +fn test_multi_specific_transform(input: PathBuf) { let output = input.with_file_name("output.js"); test_fixture( Default::default(), &|_t| { - as_folder(ModuleImportVisitor::new(vec![Config::SpecificConfig( - SpecificConfigs { - name: String::from("ice"), + ModuleImportVisitor::new(vec![ + Config::SpecificConfig(SpecificConfigs { + name: String::from("e"), + map: HashMap::from([ + ( + "a".to_string(), + MapProperty { + to: String::from("@e/x"), + import_type: Some(ImportType::Default), + name: None, + }, + ), + ( + "b".to_string(), + MapProperty { + to: String::from("e"), + import_type: Some(ImportType::Named), + name: None, + }, + ), + ]), + }), + Config::SpecificConfig(SpecificConfigs { + name: String::from("k"), map: HashMap::from([( - "runApp".to_string(), + "j".to_string(), MapProperty { - to: String::from("@ice/runtime"), + to: String::from("@e/k"), import_type: Some(ImportType::Named), - name: None, + name: Some(String::from("jj")), }, )]), - }, - )])) + }), + ]) + }, + &input, + &output, + FixtureTestConfig { + ..Default::default() + }, + ); +} + +#[testing::fixture("tests/fixture/ice_basic_transform/input.js")] +fn test_ice_basic_transform(input: PathBuf) { + let output = input.with_file_name("output.js"); + test_fixture( + Default::default(), + &|_t| { + ModuleImportVisitor::new(vec![Config::SpecificConfig(SpecificConfigs { + name: String::from("ice"), + map: HashMap::from([( + "runApp".to_string(), + MapProperty { + to: String::from("@ice/runtime"), + import_type: Some(ImportType::Named), + name: None, + }, + )]), + })]) }, &input, &output, @@ -166,19 +202,17 @@ fn test_ice_as_transform(input: PathBuf) { test_fixture( Default::default(), &|_t| { - as_folder(ModuleImportVisitor::new(vec![Config::SpecificConfig( - SpecificConfigs { - name: String::from("ice"), - map: HashMap::from([( - "runApp".to_string(), - MapProperty { - to: String::from("@ice/runtime"), - import_type: Some(ImportType::Named), - name: None, - }, - )]), - }, - )])) + ModuleImportVisitor::new(vec![Config::SpecificConfig(SpecificConfigs { + name: String::from("ice"), + map: HashMap::from([( + "runApp".to_string(), + MapProperty { + to: String::from("@ice/runtime"), + import_type: Some(ImportType::Named), + name: None, + }, + )]), + })]) }, &input, &output, @@ -194,19 +228,17 @@ fn test_ice_alias_transform(input: PathBuf) { test_fixture( Default::default(), &|_t| { - as_folder(ModuleImportVisitor::new(vec![Config::SpecificConfig( - SpecificConfigs { - name: String::from("ice"), - map: HashMap::from([( - "Head".to_string(), - MapProperty { - to: String::from("react-helmet"), - import_type: Some(ImportType::Default), - name: Some("Helmet".to_string()), - }, - )]), - }, - )])) + ModuleImportVisitor::new(vec![Config::SpecificConfig(SpecificConfigs { + name: String::from("ice"), + map: HashMap::from([( + "Head".to_string(), + MapProperty { + to: String::from("react-helmet"), + import_type: Some(ImportType::Default), + name: Some("Helmet".to_string()), + }, + )]), + })]) }, &input, &output, @@ -222,19 +254,61 @@ fn test_ice_alias_with_as_transform(input: PathBuf) { test_fixture( Default::default(), &|_t| { - as_folder(ModuleImportVisitor::new(vec![Config::SpecificConfig( - SpecificConfigs { - name: String::from("ice"), - map: HashMap::from([( - "Head".to_string(), + ModuleImportVisitor::new(vec![Config::SpecificConfig(SpecificConfigs { + name: String::from("ice"), + map: HashMap::from([( + "Head".to_string(), + MapProperty { + to: String::from("react-helmet"), + import_type: Some(ImportType::Default), + name: None, + }, + )]), + })]) + }, + &input, + &output, + FixtureTestConfig { + ..Default::default() + }, + ); +} + +#[testing::fixture("tests/fixture/ice_multiple_transform/input.js")] +fn test_ice_multiple_transform(input: PathBuf) { + let output = input.with_file_name("output.js"); + test_fixture( + Default::default(), + &|_t| { + ModuleImportVisitor::new(vec![Config::SpecificConfig(SpecificConfigs { + name: String::from("ice"), + map: HashMap::from([ + ( + "request".to_string(), MapProperty { - to: String::from("react-helmet"), + to: String::from("axios"), + import_type: Some(ImportType::Named), + name: None, + }, + ), + ( + "test".to_string(), + MapProperty { + to: String::from("axios"), + import_type: Some(ImportType::Named), + name: None, + }, + ), + ( + "store".to_string(), + MapProperty { + to: String::from("@ice/store"), import_type: Some(ImportType::Default), name: None, }, - )]), - }, - )])) + ), + ]), + })]) }, &input, &output, @@ -250,19 +324,27 @@ fn test_ice_matched_transform(input: PathBuf) { test_fixture( Default::default(), &|_t| { - as_folder(ModuleImportVisitor::new(vec![Config::SpecificConfig( - SpecificConfigs { - name: String::from("ice"), - map: HashMap::from([( + ModuleImportVisitor::new(vec![Config::SpecificConfig(SpecificConfigs { + name: String::from("ice"), + map: HashMap::from([ + ( "runApp".to_string(), MapProperty { to: String::from("@ice/runtime"), import_type: Some(ImportType::Named), name: None, }, - )]), - }, - )])) + ), + ( + "defineDataLoader".to_string(), + MapProperty { + to: String::from("@ice/runtime"), + import_type: Some(ImportType::Named), + name: None, + }, + ), + ]), + })]) }, &input, &output, @@ -278,19 +360,17 @@ fn test_ice_miss_match_transform(input: PathBuf) { test_fixture( Default::default(), &|_t| { - as_folder(ModuleImportVisitor::new(vec![Config::SpecificConfig( - SpecificConfigs { - name: String::from("ice"), - map: HashMap::from([( - "runApp".to_string(), - MapProperty { - to: String::from("@ice/runtime"), - import_type: Some(ImportType::Named), - name: None, - }, - )]), - }, - )])) + ModuleImportVisitor::new(vec![Config::SpecificConfig(SpecificConfigs { + name: String::from("ice"), + map: HashMap::from([( + "runApp".to_string(), + MapProperty { + to: String::from("@ice/runtime"), + import_type: Some(ImportType::Named), + name: None, + }, + )]), + })]) }, &input, &output, diff --git a/crates/swc_change_package_import/tests/fixture/ice_matched_transform/output.js b/crates/swc_change_package_import/tests/fixture/ice_matched_transform/output.js index 842e852..9d8c759 100644 --- a/crates/swc_change_package_import/tests/fixture/ice_matched_transform/output.js +++ b/crates/swc_change_package_import/tests/fixture/ice_matched_transform/output.js @@ -1,2 +1,2 @@ -import { defineDataLoader } from "ice"; -import { runApp } from "@ice/runtime"; \ No newline at end of file +import { runApp } from "@ice/runtime"; +import { defineDataLoader } from "@ice/runtime"; \ No newline at end of file diff --git a/crates/swc_change_package_import/tests/fixture/ice_multiple_transform/output.js b/crates/swc_change_package_import/tests/fixture/ice_multiple_transform/output.js index d305c41..de0b219 100644 --- a/crates/swc_change_package_import/tests/fixture/ice_multiple_transform/output.js +++ b/crates/swc_change_package_import/tests/fixture/ice_multiple_transform/output.js @@ -1,3 +1,3 @@ import { request } from "axios"; +import store from "@ice/store"; import { test } from "axios"; -import store from "@ice/store"; \ No newline at end of file diff --git a/crates/swc_change_package_import/tests/fixture/multi_specific_transform/output.js b/crates/swc_change_package_import/tests/fixture/multi_specific_transform/output.js index 732b909..afcacdc 100644 --- a/crates/swc_change_package_import/tests/fixture/multi_specific_transform/output.js +++ b/crates/swc_change_package_import/tests/fixture/multi_specific_transform/output.js @@ -1,7 +1,4 @@ -import { c as d } from "e"; -import a from "@e/x"; -import { b } from "e"; -import { q } from "k"; // import "f"; +import { a, b, c as d } from "e"; +import { j, q } from "k"; // import "f"; // import g from "k"; - // import y from "z"; -import { jj as j } from "@e/k"; + // import y from "z"; \ No newline at end of file From 7bcb7d48dd851d63894481de355230aa22f0b289 Mon Sep 17 00:00:00 2001 From: ClarkXia Date: Fri, 2 Feb 2024 11:44:56 +0800 Subject: [PATCH 2/2] chore: update cargo lock --- Cargo.lock | 204 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 123 insertions(+), 81 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7aaecdf..793dad5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -82,6 +82,12 @@ dependencies = [ "libc", ] +[[package]] +name = "anes" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" + [[package]] name = "ansi_term" version = "0.12.1" @@ -91,6 +97,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "anstyle" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2faccea4cc4ab4a667ce676a30e8ec13922a692c99bb8f5b11f1502c72e04220" + [[package]] name = "anyhow" version = "1.0.79" @@ -520,17 +532,58 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "ciborium" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" +dependencies = [ + "ciborium-io", + "ciborium-ll", + "serde", +] + +[[package]] +name = "ciborium-io" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" + +[[package]] +name = "ciborium-ll" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" +dependencies = [ + "ciborium-io", + "half", +] + [[package]] name = "clap" -version = "2.34.0" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" +checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" dependencies = [ - "bitflags 1.3.2", - "textwrap 0.11.0", - "unicode-width", + "clap_builder", +] + +[[package]] +name = "clap_builder" +version = "4.4.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" +dependencies = [ + "anstyle", + "clap_lex", ] +[[package]] +name = "clap_lex" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" + [[package]] name = "color-backtrace" version = "0.6.1" @@ -596,25 +649,25 @@ dependencies = [ [[package]] name = "criterion" -version = "0.3.6" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b01d6de93b2b6c65e17c634a26653a29d107b3c98c607c765bf38d041531cd8f" +checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" dependencies = [ - "atty", + "anes", "cast", + "ciborium", "clap", "criterion-plot", - "csv", "futures", + "is-terminal", "itertools 0.10.5", - "lazy_static", "num-traits", + "once_cell", "oorandom", "plotters", "rayon", "regex", "serde", - "serde_cbor", "serde_derive", "serde_json", "tinytemplate", @@ -624,9 +677,9 @@ dependencies = [ [[package]] name = "criterion-plot" -version = "0.4.5" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2673cc8207403546f45f5fd319a974b1e6983ad1a3ee7e6041650013be041876" +checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" dependencies = [ "cast", "itertools 0.10.5", @@ -662,6 +715,12 @@ version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + [[package]] name = "crypto-common" version = "0.1.6" @@ -672,27 +731,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "csv" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac574ff4d437a7b5ad237ef331c17ccca63c46479e5b5453eb8e10bb99a759fe" -dependencies = [ - "csv-core", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "csv-core" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5efa2b3d7902f4b634a20cae3c9c4e6209dc4779feb6863329607560143efa70" -dependencies = [ - "memchr", -] - [[package]] name = "ctor" version = "0.2.5" @@ -1070,15 +1108,19 @@ checksum = "9985c9503b412198aa4197559e9a318524ebc4519c229bfa05a535828c950b9d" [[package]] name = "half" -version = "1.8.2" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" +checksum = "bc52e53916c08643f1b56ec082790d1e86a32e58dc5268f897f313fbae7b4872" +dependencies = [ + "cfg-if", + "crunchy", +] [[package]] name = "handlebars" -version = "4.5.0" +version = "5.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faa67bab9ff362228eb3d00bd024a4965d8231bbb7921167f0cfa66c6626b225" +checksum = "c73166c591e67fb4bf9bc04011b4e35f12e89fe8d676193aa263df065955a379" dependencies = [ "log", "pest", @@ -1233,6 +1275,7 @@ checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", + "serde", ] [[package]] @@ -1369,9 +1412,9 @@ dependencies = [ [[package]] name = "jsonc-parser" -version = "0.22.1" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "538702ed54bac04d391352d4c9ad0ec2a9225e3c477ffa23fc44d0f04fa83c54" +checksum = "7725c320caac8c21d8228c1d055af27a995d371f78cc763073d3e068323641b5" dependencies = [ "serde_json", ] @@ -1622,7 +1665,7 @@ dependencies = [ "supports-hyperlinks 1.2.0", "supports-unicode 1.0.2", "terminal_size", - "textwrap 0.15.2", + "textwrap", "thiserror", "unicode-width", ] @@ -1643,7 +1686,7 @@ dependencies = [ "supports-hyperlinks 2.1.0", "supports-unicode 2.0.0", "terminal_size", - "textwrap 0.15.2", + "textwrap", "thiserror", "unicode-width", ] @@ -2473,12 +2516,6 @@ version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" -[[package]] -name = "regex-syntax" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" - [[package]] name = "regex-syntax" version = "0.8.2" @@ -2487,9 +2524,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "regress" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82a9ecfa0cb04d0b04dddb99b8ccf4f66bc8dfd23df694b398570bd8ae3a50fb" +checksum = "4ed9969cad8051328011596bf549629f1b800cf1731e7964b1eef8dfc480d2c2" dependencies = [ "hashbrown 0.13.2", "memchr", @@ -2698,6 +2735,7 @@ dependencies = [ "futures", "glob-match", "hashlink", + "hex", "indexmap 2.1.0", "itertools 0.12.1", "json", @@ -2711,6 +2749,7 @@ dependencies = [ "regex", "rkyv", "rspack_ast", + "rspack_core_macros", "rspack_database", "rspack_error", "rspack_fs", @@ -2734,6 +2773,14 @@ dependencies = [ "ustr", ] +[[package]] +name = "rspack_core_macros" +version = "0.1.0" +dependencies = [ + "quote", + "syn 2.0.48", +] + [[package]] name = "rspack_database" version = "0.1.0" @@ -2752,10 +2799,13 @@ dependencies = [ "futures", "miette 5.10.0", "once_cell", + "owo-colors", "rspack_identifier", "swc_core", "termcolor", + "textwrap", "thiserror", + "unicode-width", ] [[package]] @@ -2859,7 +2909,7 @@ dependencies = [ "dashmap", "either", "indexmap 2.1.0", - "jsonc-parser 0.22.1", + "jsonc-parser 0.23.0", "once_cell", "rspack_ast", "rspack_core", @@ -2868,10 +2918,12 @@ dependencies = [ "rspack_plugin_javascript", "rspack_swc_visitors", "rspack_testing", + "rspack_util", "serde", "serde_json", "swc_config", "swc_core", + "tokio", "xxhash-rust", ] @@ -2971,7 +3023,7 @@ dependencies = [ "bitflags 2.4.2", "heck", "hrx-parser", - "indexmap 2.1.0", + "indexmap 1.9.3", "insta", "once_cell", "rayon", @@ -2983,6 +3035,7 @@ dependencies = [ "rspack_identifier", "rspack_plugin_runtime", "rspack_testing", + "rspack_util", "rustc-hash", "serde_json", "sugar_path", @@ -2997,6 +3050,8 @@ version = "0.1.0" dependencies = [ "async-trait", "dashmap", + "derivative", + "futures", "once_cell", "pathdiff", "rayon", @@ -3004,6 +3059,7 @@ dependencies = [ "rspack_base64", "rspack_core", "rspack_error", + "rspack_hash", "rspack_util", "rustc-hash", "serde_json", @@ -3046,6 +3102,7 @@ dependencies = [ "rspack_error", "rspack_hash", "rspack_identifier", + "rspack_util", "rustc-hash", "serde_json", ] @@ -3081,13 +3138,11 @@ version = "0.1.0" dependencies = [ "async-trait", "bitflags 2.4.2", - "either", "indexmap 2.1.0", "itertools 0.12.1", "linked_hash_set", "num-bigint", "once_cell", - "preset_env_base", "rayon", "regex", "rspack_ast", @@ -3101,6 +3156,7 @@ dependencies = [ "rspack_testing", "rspack_util", "rustc-hash", + "serde", "serde_json", "sugar_path", "swc_core", @@ -3164,6 +3220,7 @@ dependencies = [ "rspack_hash", "rspack_identifier", "rspack_loader_runner", + "rspack_util", "rustc-hash", "serde", "serde_json", @@ -3176,6 +3233,7 @@ version = "0.1.0" dependencies = [ "async-trait", "indicatif", + "linked-hash-map", "rspack_core", "rspack_error", ] @@ -3211,13 +3269,13 @@ dependencies = [ "indexmap 2.1.0", "itertools 0.12.1", "once_cell", - "rayon", "regex", "rspack_core", "rspack_error", "rspack_hash", "rspack_identifier", "rspack_plugin_javascript", + "rspack_util", "rustc-hash", "serde_json", ] @@ -3305,6 +3363,7 @@ dependencies = [ "rspack_error", "rspack_identifier", "rspack_testing", + "rspack_util", "serde_json", "swc_core", "wasmparser", @@ -3330,7 +3389,7 @@ dependencies = [ name = "rspack_regex" version = "0.1.0" dependencies = [ - "regex-syntax 0.7.5", + "regex-syntax 0.8.2", "regress", "rspack_error", "swc_core", @@ -3359,7 +3418,6 @@ dependencies = [ name = "rspack_swc_visitors" version = "0.1.0" dependencies = [ - "indexmap 2.1.0", "once_cell", "regex", "serde", @@ -3421,8 +3479,10 @@ name = "rspack_util" version = "0.1.0" dependencies = [ "concat-string", + "dashmap", "once_cell", "regex", + "rustc-hash", "sugar_path", "swc_core", ] @@ -3563,16 +3623,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde_cbor" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" -dependencies = [ - "half", - "serde", -] - [[package]] name = "serde_derive" version = "1.0.195" @@ -5361,15 +5411,6 @@ dependencies = [ "syn 2.0.48", ] -[[package]] -name = "textwrap" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -dependencies = [ - "unicode-width", -] - [[package]] name = "textwrap" version = "0.15.2" @@ -5766,12 +5807,13 @@ checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" [[package]] name = "wasmparser" -version = "0.102.0" +version = "0.120.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48134de3d7598219ab9eaf6b91b15d8e50d31da76b8519fe4ecfcec2cf35104b" +checksum = "e9148127f39cbffe43efee8d5442b16ecdba21567785268daa1ec9e134389705" dependencies = [ - "indexmap 1.9.3", - "url", + "bitflags 2.4.2", + "indexmap 2.1.0", + "semver 1.0.20", ] [[package]] @@ -6019,4 +6061,4 @@ dependencies = [ "proc-macro2", "quote", "syn 2.0.48", -] +] \ No newline at end of file