diff --git a/Cargo.lock b/Cargo.lock index 6b9f6961fe2..8b92211b16d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "Inflector" @@ -155,14 +155,14 @@ dependencies = [ [[package]] name = "ast_node" -version = "2.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94741d66bdda032fcbf33e621b4e3a888d7d11bd3ac4446d82c5593a136936ff" +checksum = "91fb5864e2f5bf9fd9797b94b2dfd1554d4c3092b535008b27d7e15c86675a2f" dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.89", + "syn", ] [[package]] @@ -173,7 +173,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -567,7 +567,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a2785755761f3ddc1492979ce1e48d2c00d09311c39e4466429188f3dd6501" dependencies = [ "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -591,7 +591,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.89", + "syn", ] [[package]] @@ -602,7 +602,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -721,7 +721,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -731,7 +731,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" dependencies = [ "derive_builder_core", - "syn 2.0.89", + "syn", ] [[package]] @@ -861,7 +861,7 @@ checksum = "8d7ccf961415e7aa17ef93dcb6c2441faaa8e768abe09e659b908089546f74c5" dependencies = [ "proc-macro2", "swc_macros_common", - "syn 2.0.89", + "syn", ] [[package]] @@ -932,7 +932,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -1191,7 +1191,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -1312,7 +1312,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.89", + "syn", ] [[package]] @@ -1404,6 +1404,25 @@ version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +[[package]] +name = "markdown" +version = "1.0.0-alpha.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6491e6c702bf7e3b24e769d800746d5f2c06a6c6a2db7992612e0f429029e81" +dependencies = [ + "serde", + "unicode-id", +] + +[[package]] +name = "mdxjs" +version = "0.2.14" +source = "git+https://github.com/devongovett/mdxjs-rs?branch=export_phases#18805ce92d7e185d4a94d7748c7cb251e610e694" +dependencies = [ + "markdown", + "swc_core", +] + [[package]] name = "memchr" version = "2.7.4" @@ -1496,7 +1515,7 @@ dependencies = [ "napi-derive-backend", "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -1511,7 +1530,7 @@ dependencies = [ "quote", "regex", "semver 1.0.23", - "syn 2.0.89", + "syn", ] [[package]] @@ -1700,6 +1719,8 @@ dependencies = [ "dunce", "indexmap 1.9.3", "indoc", + "markdown", + "mdxjs", "parcel-macros", "parking_lot", "path-slash", @@ -1857,7 +1878,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -1974,22 +1995,22 @@ dependencies = [ [[package]] name = "ptr_meta" -version = "0.1.4" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +checksum = "fe9e76f66d3f9606f44e45598d155cb13ecf09f4a28199e48daf8c8fc937ea90" dependencies = [ "ptr_meta_derive", ] [[package]] name = "ptr_meta_derive" -version = "0.1.4" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" +checksum = "ca414edb151b4c8d125c12566ab0d74dc9cdba36fb80eb7b848c15f495fd32d1" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -2253,7 +2274,7 @@ checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -2425,7 +2446,7 @@ checksum = "710e9696ef338691287aeb937ee6ffe60022f579d3c8d2fd9d58973a9a10a466" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -2443,7 +2464,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.89", + "syn", ] [[package]] @@ -2454,9 +2475,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "swc_allocator" -version = "1.0.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52cacc28f0ada8e4e31a720dd849ff06864b10e6ab0a1aaa99c06456cfe046af" +checksum = "117d5d3289663f53022ebf157df8a42b3872d7ac759e63abf96b5987b85d4af3" dependencies = [ "bumpalo", "hashbrown 0.14.5", @@ -2467,9 +2488,9 @@ dependencies = [ [[package]] name = "swc_atoms" -version = "2.0.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d7211e5c57ea972f32b8a104d7006c4a68d094ec30c6a73bcd20d4d6c473c7c" +checksum = "151a6feb82b989a087433baca7f6a6eb4fcf83f828c479eecd039c9312d60e10" dependencies = [ "hstr", "once_cell", @@ -2493,9 +2514,9 @@ dependencies = [ [[package]] name = "swc_common" -version = "4.0.1" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f87a21612a324493fd065e9c6fea960b4031088a213db782e2ca71d2fabb3ec" +checksum = "a521e8120dc0401580864a643b5bffa035c29fc3fc41697c972743d4f008ed22" dependencies = [ "ahash", "ast_node", @@ -2542,14 +2563,14 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.89", + "syn", ] [[package]] name = "swc_core" -version = "6.0.1" +version = "9.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7891f75c3ecd9061dd9c70612cbfabaf8f06403d44f0094227ee29a29a7d2d" +checksum = "256edfa73cbfe2a560e74b63f9bd8a674bed913d8934dd0d78fbea92c15e8433" dependencies = [ "swc_allocator", "swc_atoms", @@ -2571,9 +2592,9 @@ dependencies = [ [[package]] name = "swc_ecma_ast" -version = "4.0.1" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bdab7759509c1b37ec77bd9fc231f525b888d9609c2963ce71995da1b27357c" +checksum = "94cf86f17358b93fcfe2876a9f0f7a7ebbff94cd6eaab4c809c7a0da1f4b892e" dependencies = [ "bitflags 2.6.0", "is-macro", @@ -2589,9 +2610,9 @@ dependencies = [ [[package]] name = "swc_ecma_codegen" -version = "4.0.2" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e474f6c2671524dbb179b44a36425cb1a58928f0f7211c45043f0951a1842c5d" +checksum = "fb17e77270860f2a975c546c4609e9fa7ae8dbcf85260497e31af19890645800" dependencies = [ "memchr", "num-bigint", @@ -2616,14 +2637,14 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.89", + "syn", ] [[package]] name = "swc_ecma_compat_bugfixes" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1329a40848de17863db27ab4d8840f5aa6a79e6655bab2a5abe0f4e7f5c56d6a" +checksum = "448864548ea7c1866d140e36829196e5d7b35a55b4a1563945a8ce39322b8e7a" dependencies = [ "swc_atoms", "swc_common", @@ -2638,9 +2659,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_common" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5d585318a0d8ad1465d68fb10c29674d41988f59f4fab1e162a2f0bf13dbdc2" +checksum = "9a04016559d293d2ac507d931e46ecfd92eb5e96ccf5452bc81c18c47806b858" dependencies = [ "swc_common", "swc_ecma_ast", @@ -2651,9 +2672,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2015" -version = "5.0.1" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb74db30bb816a950ebd453af38654660149df25e3b0ae26dc0d902a4295f17" +checksum = "aceb1b432819541aa1dd129b4a226f41cf881a53040efc711a625ee5f23e9afd" dependencies = [ "arrayvec", "indexmap 2.6.0", @@ -2678,9 +2699,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2016" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a329b3d6bcc4bebab396a556ec6accda6f7d4a8a1126ded05f2c7a705c6343e" +checksum = "fdc0d69f6541b781e4e95c1954e8ab916095b7369cdf69e14bf83be17b2dd943" dependencies = [ "swc_atoms", "swc_common", @@ -2695,9 +2716,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2017" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0a6f9d438b79763da23e9eb20f10c3d7f39d4c301047fef89a7e4c7cc1d3e7" +checksum = "1ac80866f541899e4c59a954c0a37a4fd21ea1455dc44400c088b72299c1d2cc" dependencies = [ "serde", "swc_atoms", @@ -2713,9 +2734,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2018" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d80354d791823c0fe754c5b9d35510e519261763e7871c6b3b15c57d54af928a" +checksum = "cdc28efd763ad5fea7acc2f1fc73ade5b334201369b88aff472053b64b304a76" dependencies = [ "serde", "swc_atoms", @@ -2732,9 +2753,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2019" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9389a8364fd44f041302b09ce46d54d42de033737597cf481c2bdc09ac8a899" +checksum = "f2439138f8b8c7cf1401395e0bbb6d3e35d20277268f8e8aa41fa64841af992e" dependencies = [ "swc_atoms", "swc_common", @@ -2748,9 +2769,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2020" -version = "6.0.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e3cdf2d9eceb73ecf6bb7253c6ebf291c777b4abf4d1f1157beeceb0452625f" +checksum = "b7a37218dcb1ad82943b9ebfbfbc283ba1ba542ed3c60aacea0b3a06e7f38809" dependencies = [ "serde", "swc_atoms", @@ -2766,9 +2787,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2021" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c59d09c7146386ca51e3eb225f4c7b392d7d9020742e7cf47bc3c4ceb6aa4a6" +checksum = "9c4c9d40dcf5094e863ceac27c92053ef970991e46f190ddad678b8e3ca3ecde" dependencies = [ "swc_atoms", "swc_common", @@ -2782,9 +2803,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2022" -version = "6.0.1" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df6241137f02e9bae0111e3461e230db6bafde458ad2eb9a5df1c5bb2c0df068" +checksum = "93edab9540513a7622addbf2494fa61f487daf98d2c1ed819958b2a3d271835e" dependencies = [ "swc_atoms", "swc_common", @@ -2801,9 +2822,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es3" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2241d79bc42ab25133b9107c0ec08aef55503dde6dac85debae7ba750b21afd4" +checksum = "0f158dcb284c676bfb425c42adf307a3259d71c999c0970370ed3e09886d83c9" dependencies = [ "swc_common", "swc_ecma_ast", @@ -2816,9 +2837,9 @@ dependencies = [ [[package]] name = "swc_ecma_parser" -version = "5.0.0" +version = "6.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c5ab8bd4cc4a4956514699c84d1a25cdb5a33f5ec760ec64ce712e973019c9" +checksum = "f92ea41c3c3f0fe77991fee96b91bc4c7af43b55fdb6564fdc31b8c2d0b1e220" dependencies = [ "either", "new_debug_unreachable", @@ -2838,9 +2859,9 @@ dependencies = [ [[package]] name = "swc_ecma_preset_env" -version = "6.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4feb3982daf0b3b09640678d1ad1569dd50aed1e1992856418dc9c81aca7ec1a" +checksum = "39ac4bd1620798c38f767417f9b364b87fd2505a9e748d6b1d7549f155a0aa96" dependencies = [ "anyhow", "dashmap 5.5.3", @@ -2863,9 +2884,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms" -version = "6.0.0" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3570a4bbd8596ee82ad6cb35e25b3ba57deda503191c104af98cf9994922fdb" +checksum = "dccedb5a1e52795e132615a3ca01e2adb8fc9214ee75c258f8a3124a9b42c47e" dependencies = [ "swc_atoms", "swc_common", @@ -2879,9 +2900,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "5.0.1" +version = "6.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eb4000822f02b54af0be4f668649fa1e5555f1e3392479d17a277eb81a841f0" +checksum = "f31557485025a2fd1f833d63601c53010857e45633f44bcc87510f3578bde0c5" dependencies = [ "better_scoped_tls", "bitflags 2.6.0", @@ -2902,9 +2923,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_classes" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63a93f8b41f89e08edf77f70a8fa959cd3b84d396c2c6a3e0b0cca62f1b89683" +checksum = "3cd3a9eacaf2aa2ec7a8139e3c3883ddf4f8e948a08ee378725a4ad658beb3d9" dependencies = [ "swc_atoms", "swc_common", @@ -2916,9 +2937,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_compat" -version = "6.0.1" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "918ef66efa6466a0c670a50d5257402b6f22476f1a33775200432890a1f4aef6" +checksum = "e245e2cb96ff093c0c3170dbe4c063a0b937ce4527d37f52f467529d4977634b" dependencies = [ "arrayvec", "indexmap 2.6.0", @@ -2959,14 +2980,14 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.89", + "syn", ] [[package]] name = "swc_ecma_transforms_optimization" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f63d691ccea03a8eb25f37c7498e7609ad76ca3dc2070b630596e49f0b8fd1f4" +checksum = "350a4965abfada7d5b23b3140896652acc11e110ac042a160bcea5bf8b08d367" dependencies = [ "dashmap 5.5.3", "indexmap 2.6.0", @@ -2988,9 +3009,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_proposal" -version = "5.0.1" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f963693bb6510f2bdb8227e918730bca30be29a9880614858f0c14ffe702fbf8" +checksum = "cba55188e66696c43333d19492f69a6f4a7785f9486ebc1b3cf7c5f743927505" dependencies = [ "either", "rustc-hash 1.1.0", @@ -3008,9 +3029,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_react" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90002fdbe17f10c84cb29a102154a30ee5ad3e7165f0610d18ba8aa3a592924c" +checksum = "4cabf9375cfb71fc0e3d98e07e6fca39a18daa23d4878d8d2daa4c2b6c07b379" dependencies = [ "base64", "dashmap 5.5.3", @@ -3033,9 +3054,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_typescript" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f67d5ff2ec723d075db340ac155877fea9607186f179e41ef2116aeef960a2cf" +checksum = "77346c37397fb238f991d6dccc027881caca539628e9a6c629299c7b94bdb08a" dependencies = [ "ryu-js", "serde", @@ -3050,9 +3071,9 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "5.0.1" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eb9a28511d17d1e6c5dfcf209368a1da4a542270c450fba7f27faf22c34df22" +checksum = "527fad9bdb16883782d55291fd3330925b3572f512ef89b3d92a29e2f713fe4f" dependencies = [ "indexmap 2.6.0", "num_cpus", @@ -3070,9 +3091,9 @@ dependencies = [ [[package]] name = "swc_ecma_visit" -version = "4.0.1" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5af5332117aa0424e418556f74e9cee335dc47eb7ae35dddbd9fd65fc01452c" +checksum = "b04c06c1805bda18c27165560f1617a57453feb9fb0638d90839053641af42d4" dependencies = [ "new_debug_unreachable", "num-bigint", @@ -3091,14 +3112,14 @@ checksum = "e96e15288bf385ab85eb83cff7f9e2d834348da58d0a31b33bdb572e66ee413e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] name = "swc_fast_graph" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f65856acf41991a43d47d19ca947ee34f1152fccc42f048063c64eaf45a8e26" +checksum = "c22e0a0478b1b06610453a97c8371cafa742e371a79aff860ccfbabe1ab160a7" dependencies = [ "indexmap 2.6.0", "petgraph", @@ -3114,7 +3135,7 @@ checksum = "a509f56fca05b39ba6c15f3e58636c3924c78347d63853632ed2ffcb6f5a0ac7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -3125,7 +3146,7 @@ checksum = "4c78717a841565df57f811376a3d19c9156091c55175e12d378f3a522de70cef" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -3138,17 +3159,6 @@ dependencies = [ "new_debug_unreachable", ] -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - [[package]] name = "syn" version = "2.0.89" @@ -3212,7 +3222,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -3266,7 +3276,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -3288,7 +3298,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] @@ -3460,7 +3470,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.89", + "syn", "wasm-bindgen-shared", ] @@ -3482,7 +3492,7 @@ checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3657,7 +3667,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.89", + "syn", ] [[package]] diff --git a/crates/macros/Cargo.toml b/crates/macros/Cargo.toml index 8cfecee7e1d..fb516791873 100644 --- a/crates/macros/Cargo.toml +++ b/crates/macros/Cargo.toml @@ -9,7 +9,7 @@ napi = ["dep:napi", "dep:napi-derive", "dep:crossbeam-channel"] [dependencies] indexmap = "1.9.2" -swc_core = { version = "6.0.1", features = [ +swc_core = { version = "9", features = [ "common", "common_ahash", "common_sourcemap", diff --git a/crates/macros/src/lib.rs b/crates/macros/src/lib.rs index aa65097fb25..0cefd52e0a6 100644 --- a/crates/macros/src/lib.rs +++ b/crates/macros/src/lib.rs @@ -377,7 +377,7 @@ pub enum JsValue { } pub struct Evaluator<'a> { - constants: HashMap>, + pub constants: HashMap>, source_map: &'a SourceMap, } diff --git a/packages/configs/default/index.json b/packages/configs/default/index.json index ea780c6b25a..d1ad484db4d 100644 --- a/packages/configs/default/index.json +++ b/packages/configs/default/index.json @@ -8,6 +8,13 @@ "@parcel/transformer-worklet", "..." ], + "*.mdx": [ + // For backward compatibility, include the old transformer + // so it is used if already installed in the project. + // Otherwise, the JS transformer will handle MDX. + "@parcel/transformer-mdx", + "@parcel/transformer-js" + ], "*.{js,mjs,jsm,jsx,es6,cjs,ts,tsx}": [ "@parcel/transformer-babel", "@parcel/transformer-js", @@ -33,7 +40,6 @@ "*.pug": ["@parcel/transformer-pug"], "*.coffee": ["@parcel/transformer-coffeescript"], "*.elm": ["@parcel/transformer-elm"], - "*.mdx": ["@parcel/transformer-mdx"], "*.vue": ["@parcel/transformer-vue"], "template:*.vue": ["@parcel/transformer-vue"], "script:*.vue": ["@parcel/transformer-vue"], diff --git a/packages/configs/default/package.json b/packages/configs/default/package.json index 8acae6b63bb..5717e3787cd 100644 --- a/packages/configs/default/package.json +++ b/packages/configs/default/package.json @@ -63,7 +63,6 @@ "@parcel/transformer-inline-string": "2.13.3", "@parcel/transformer-jsonld": "2.13.3", "@parcel/transformer-less": "2.13.3", - "@parcel/transformer-mdx": "2.13.3", "@parcel/transformer-pug": "2.13.3", "@parcel/transformer-sass": "2.13.3", "@parcel/transformer-stylus": "2.13.3", @@ -76,6 +75,9 @@ "@parcel/transformer-xml": "2.13.3", "@parcel/transformer-yaml": "2.13.3" }, + "optionalParcelDependencies": [ + "@parcel/transformer-mdx" + ], "peerDependencies": { "@parcel/core": "^2.13.3" } diff --git a/packages/configs/default/test/config.test.js b/packages/configs/default/test/config.test.js index d3b5d601870..94b703da3de 100644 --- a/packages/configs/default/test/config.test.js +++ b/packages/configs/default/test/config.test.js @@ -2,8 +2,9 @@ import assert from 'assert'; -import config from '../'; import packageJson from '../package.json'; +import json5 from 'json5'; +import fs from 'fs'; describe('@parcel/config-default', () => { let packageJsonDependencyNames: Set; @@ -13,7 +14,11 @@ describe('@parcel/config-default', () => { packageJsonDependencyNames = new Set([ ...Object.keys(packageJson.dependencies || {}), ...Object.keys(packageJson.parcelDependencies || {}), + ...packageJson.optionalParcelDependencies, ]); + let config = json5.parse( + fs.readFileSync(__dirname + '/../index.json', 'utf8'), + ); configPackageReferences = collectConfigPackageReferences(config); }); diff --git a/packages/core/core/src/ParcelConfig.js b/packages/core/core/src/ParcelConfig.js index 3895f0ce089..276f71da930 100644 --- a/packages/core/core/src/ParcelConfig.js +++ b/packages/core/core/src/ParcelConfig.js @@ -28,6 +28,7 @@ import ThrowableDiagnostic, { generateJSONCodeHighlights, } from '@parcel/diagnostic'; import json5 from 'json5'; +import nullthrows from 'nullthrows'; import {globToRegex} from '@parcel/utils'; import {basename} from 'path'; @@ -121,7 +122,7 @@ export default class ParcelConfig { version: Semver, resolveFrom: ProjectPath, range: ?SemverRange, - |}> { + |} | null> { let plugin = this.pluginCache.get(node.packageName); if (plugin) { return plugin; @@ -138,8 +139,11 @@ export default class ParcelConfig { return plugin; } - async loadPlugin(node: ParcelPluginNode): Promise> { + async loadPlugin(node: ParcelPluginNode): Promise | null> { let plugin = await this._loadPlugin(node); + if (!plugin) { + return null; + } return { ...plugin, name: node.packageName, @@ -151,10 +155,12 @@ export default class ParcelConfig { this.pluginCache.delete(packageName); } - loadPlugins( + async loadPlugins( plugins: PureParcelConfigPipeline, ): Promise>> { - return Promise.all(plugins.map(p => this.loadPlugin(p))); + return (await Promise.all(plugins.map(p => this.loadPlugin(p)))).filter( + Boolean, + ); } async getResolvers(): Promise>>> { @@ -228,7 +234,7 @@ export default class ParcelConfig { ); } - return this.loadPlugin>(this.bundler); + return nullthrows(await this.loadPlugin>(this.bundler)); } async getNamers(): Promise>>> { @@ -265,7 +271,7 @@ export default class ParcelConfig { '/packagers', ); } - return this.loadPlugin>(packager); + return nullthrows(await this.loadPlugin>(packager)); } _getOptimizerNodes( diff --git a/packages/core/core/src/Transformation.js b/packages/core/core/src/Transformation.js index ca25f703d85..8ae7ad459e2 100644 --- a/packages/core/core/src/Transformation.js +++ b/packages/core/core/src/Transformation.js @@ -569,6 +569,11 @@ export default class Transformation { configKeyPath?: string, parcelConfig: ParcelConfig, ): Promise<$ReadOnlyArray> { + if (asset.transformers.has(transformerName)) { + return [asset]; + } + asset.transformers.add(transformerName); + const logger = new PluginLogger({origin: transformerName}); const tracer = new PluginTracer({ origin: transformerName, diff --git a/packages/core/core/src/UncommittedAsset.js b/packages/core/core/src/UncommittedAsset.js index 6ff5b13db77..ea3921baeb2 100644 --- a/packages/core/core/src/UncommittedAsset.js +++ b/packages/core/core/src/UncommittedAsset.js @@ -55,6 +55,7 @@ export default class UncommittedAsset { idBase: ?string; invalidations: Invalidations; generate: ?() => Promise; + transformers: Set; constructor({ value, @@ -74,6 +75,7 @@ export default class UncommittedAsset { this.isASTDirty = isASTDirty || false; this.idBase = idBase; this.invalidations = invalidations || createInvalidations(); + this.transformers = new Set(); } /* diff --git a/packages/core/core/src/assetUtils.js b/packages/core/core/src/assetUtils.js index b55f3993704..92b24114b66 100644 --- a/packages/core/core/src/assetUtils.js +++ b/packages/core/core/src/assetUtils.js @@ -152,14 +152,16 @@ async function _generateFromAST(asset: CommittedAsset | UncommittedAsset) { } let pluginName = nullthrows(asset.value.plugin); - let {plugin} = await loadPlugin>( - pluginName, - fromProjectPath( - asset.options.projectRoot, - nullthrows(asset.value.configPath), + let {plugin} = nullthrows( + await loadPlugin>( + pluginName, + fromProjectPath( + asset.options.projectRoot, + nullthrows(asset.value.configPath), + ), + nullthrows(asset.value.configKeyPath), + asset.options, ), - nullthrows(asset.value.configKeyPath), - asset.options, ); let generate = plugin.generate?.bind(plugin); if (!generate) { diff --git a/packages/core/core/src/loadParcelPlugin.js b/packages/core/core/src/loadParcelPlugin.js index c703d26e202..488e09b50c0 100644 --- a/packages/core/core/src/loadParcelPlugin.js +++ b/packages/core/core/src/loadParcelPlugin.js @@ -31,10 +31,15 @@ export default async function loadPlugin( version: Semver, resolveFrom: ProjectPath, range: ?SemverRange, -|}> { +|} | null> { let resolveFrom = configPath; let range; - if (resolveFrom.includes(NODE_MODULES)) { + let isOptional = false; + if ( + resolveFrom.includes(NODE_MODULES) || + (process.env.PARCEL_BUILD_ENV !== 'production' && + /packages[/\\]configs/.test(resolveFrom)) + ) { // Config packages can reference plugins, but cannot contain other plugins within them. // This forces every published plugin to be published separately so they can be mixed and matched if needed. if (pluginName.startsWith('.')) { @@ -75,8 +80,11 @@ export default async function loadPlugin( // If not in the config's dependencies, the plugin will be auto installed with // the version declared in "parcelDependencies". range = configPkg.config.parcelDependencies?.[pluginName]; + isOptional = + Array.isArray(configPkg.config.optionalParcelDependencies) && + configPkg.config.optionalParcelDependencies.includes(pluginName); - if (range == null) { + if (range == null && !isOptional) { let contents = await options.inputFS.readFile( configPkg.files[0].filePath, 'utf8', @@ -122,7 +130,7 @@ export default async function loadPlugin( pluginName, resolveFrom, { - shouldAutoInstall: options.shouldAutoInstall, + shouldAutoInstall: options.shouldAutoInstall && !isOptional, range, }, )); @@ -131,6 +139,10 @@ export default async function loadPlugin( throw err; } + if (isOptional) { + return null; + } + let configContents = await options.inputFS.readFile(configPath, 'utf8'); let alternatives = await findAlternativeNodeModules( options.inputFS, diff --git a/packages/core/core/test/ParcelConfig.test.js b/packages/core/core/test/ParcelConfig.test.js index fa10031ff6b..17507d024e7 100644 --- a/packages/core/core/test/ParcelConfig.test.js +++ b/packages/core/core/test/ParcelConfig.test.js @@ -9,6 +9,7 @@ import {inputFS} from '@parcel/test-utils'; import {parseAndProcessConfig} from '../src/requests/ParcelConfigRequest'; import {DEFAULT_OPTIONS} from './test-utils'; import {toProjectPath} from '../src/projectPath'; +import nullthrows from 'nullthrows'; const PARCELRC_PATH = toProjectPath('/', '/.parcelrc'); @@ -148,11 +149,13 @@ describe('ParcelConfig', () => { ); let warnStub = sinon.stub(logger, 'warn'); - let {plugin} = await config.loadPlugin({ - packageName: 'parcel-transformer-no-engines', - resolveFrom: configFilePath, - keyPath: '/transformers/*.js/0', - }); + let {plugin} = nullthrows( + await config.loadPlugin({ + packageName: 'parcel-transformer-no-engines', + resolveFrom: configFilePath, + keyPath: '/transformers/*.js/0', + }), + ); assert(plugin); assert.equal(typeof plugin.transform, 'function'); assert(warnStub.calledOnce); diff --git a/packages/core/core/test/ParcelConfigRequest.test.js b/packages/core/core/test/ParcelConfigRequest.test.js index b1ad8e7eb58..27aaf187857 100644 --- a/packages/core/core/test/ParcelConfigRequest.test.js +++ b/packages/core/core/test/ParcelConfigRequest.test.js @@ -16,6 +16,8 @@ import { import {validatePackageName} from '../src/ParcelConfig.schema'; import {DEFAULT_OPTIONS, relative} from './test-utils'; import {toProjectPath} from '../src/projectPath'; +import json5 from 'json5'; +import fs from 'fs'; describe('ParcelConfigRequest', () => { describe('validatePackageName', () => { @@ -696,7 +698,7 @@ describe('ParcelConfigRequest', () => { let defaultConfigPath = require.resolve('@parcel/config-default'); let defaultConfig = await processConfig( { - ...require('@parcel/config-default'), + ...json5.parse(fs.readFileSync(defaultConfigPath, 'utf8')), filePath: defaultConfigPath, }, DEFAULT_OPTIONS, diff --git a/packages/core/integration-tests/test/integration/mdx/package.json b/packages/core/integration-tests/test/integration/mdx/package.json index e04e63e83ad..f0e3cd3c482 100644 --- a/packages/core/integration-tests/test/integration/mdx/package.json +++ b/packages/core/integration-tests/test/integration/mdx/package.json @@ -1,5 +1,5 @@ { "dependencies": { - "react": "*" + "react": "^19" } } diff --git a/packages/core/integration-tests/test/mdx.js b/packages/core/integration-tests/test/mdx.js index 585581d7770..c106882b8cc 100644 --- a/packages/core/integration-tests/test/mdx.js +++ b/packages/core/integration-tests/test/mdx.js @@ -1,14 +1,32 @@ -const assert = require('assert'); -const path = require('path'); -const {bundle, run} = require('@parcel/test-utils'); +import assert from 'assert'; +import path from 'path'; +import { + bundle, + run, + overlayFS, + fsFixture, + assertBundles, +} from '@parcel/test-utils'; +import React from 'react'; +import ReactDOM from 'react-dom/server'; describe('mdx', function () { + let count = 0; + let dir; + beforeEach(async () => { + dir = path.join(__dirname, 'mdx', '' + ++count); + await overlayFS.mkdirp(dir); + }); + + after(async () => { + await overlayFS.rimraf(path.join(__dirname, 'mdx')); + }); + it('should support bundling MDX', async function () { let b = await bundle(path.join(__dirname, '/integration/mdx/index.mdx')); let output = await run(b); assert.equal(typeof output.default, 'function'); - assert(output.default.isMDXComponent); }); it('should support bundling MDX with React 17', async function () { @@ -18,6 +36,198 @@ describe('mdx', function () { let output = await run(b); assert.equal(typeof output.default, 'function'); - assert(output.default.isMDXComponent); + }); + + it('should expose static exports on asset.meta', async function () { + await fsFixture(overlayFS, dir)` + index.mdx: + export const navTitle = 'Hello'; + + # Testing + + foo bar + `; + + let b = await bundle(path.join(dir, 'index.mdx'), {inputFS: overlayFS}); + let asset = b.getBundles()[0].getMainEntry(); + + assert.deepEqual(asset.meta.ssgMeta.exports, { + navTitle: 'Hello', + }); + }); + + it('should expose table of contents on asset.meta', async function () { + await fsFixture(overlayFS, dir)` + index.mdx: + # Testing + + foo bar + + ## Subtitle + + another paragraph + + ### Sub subtitle + + yo + + ## Another subtitle + + yay + `; + + let b = await bundle(path.join(dir, 'index.mdx'), {inputFS: overlayFS}); + let asset = b.getBundles()[0].getMainEntry(); + + assert.deepEqual(asset.meta.ssgMeta.tableOfContents, [ + { + level: 1, + title: 'Testing', + children: [ + { + level: 2, + title: 'Subtitle', + children: [ + { + level: 3, + title: 'Sub subtitle', + children: [], + }, + ], + }, + { + level: 2, + title: 'Another subtitle', + children: [], + }, + ], + }, + ]); + }); + + it('should support dependencies', async function () { + await fsFixture(overlayFS, dir)` + index.mdx: + Testing [urls](another.mdx). + +