From 4d9734d28c88173b6c57800b16362c1715231884 Mon Sep 17 00:00:00 2001 From: erkelost <1256029807@qq.com> Date: Wed, 22 Jan 2025 18:02:17 +0800 Subject: [PATCH] feat: add magic-comments plugin --- Cargo.lock | 1121 ++++++++++++++--- rust-plugins/magic-comments/.gitignore | 197 +++ rust-plugins/magic-comments/Cargo.toml | 20 + .../magic-comments/npm/darwin-arm64/README.md | 3 + .../npm/darwin-arm64/package.json | 18 + .../magic-comments/npm/darwin-x64/README.md | 3 + .../npm/darwin-x64/package.json | 18 + .../npm/linux-arm64-gnu/README.md | 3 + .../npm/linux-arm64-gnu/package.json | 21 + .../npm/linux-arm64-musl/README.md | 3 + .../npm/linux-arm64-musl/package.json | 21 + .../npm/linux-x64-gnu/README.md | 3 + .../npm/linux-x64-gnu/package.json | 21 + .../npm/linux-x64-musl/README.md | 3 + .../npm/linux-x64-musl/package.json | 18 + .../npm/win32-arm64-msvc/README.md | 3 + .../npm/win32-arm64-msvc/package.json | 18 + .../npm/win32-ia32-msvc/README.md | 3 + .../npm/win32-ia32-msvc/package.json | 18 + .../npm/win32-x64-msvc/README.md | 3 + .../npm/win32-x64-msvc/package.json | 18 + rust-plugins/magic-comments/options.d.ts | 3 + rust-plugins/magic-comments/package.json | 43 + .../magic-comments/playground/README.md | 37 + .../magic-comments/playground/farm.config.ts | 18 + .../magic-comments/playground/index.html | 14 + .../magic-comments/playground/index.js | 1 + .../magic-comments/playground/package.json | 28 + .../playground/public/favicon.ico | Bin 0 -> 4154 bytes .../magic-comments/playground/src/About.tsx | 11 + .../magic-comments/playground/src/Contact.tsx | 12 + .../magic-comments/playground/src/Home.tsx | 12 + .../playground/src/assets/logo.png | Bin 0 -> 16859 bytes .../playground/src/assets/react.svg | 1 + .../magic-comments/playground/src/index.css | 69 + .../magic-comments/playground/src/index.tsx | 10 + .../magic-comments/playground/src/main.css | 42 + .../magic-comments/playground/src/main.tsx | 36 + .../playground/src/typings.d.ts | 3 + .../magic-comments/playground/tsconfig.json | 25 + .../playground/tsconfig.node.json | 11 + .../magic-comments/rust-toolchain.toml | 3 + rust-plugins/magic-comments/rustfmt.toml | 2 + rust-plugins/magic-comments/scripts/func.js | 3 + .../magic-comments/scripts/index.d.ts | 3 + rust-plugins/magic-comments/scripts/index.js | 124 ++ rust-plugins/magic-comments/scripts/watch.sh | 3 + .../magic-comments/src/html_modifier.rs | 86 ++ rust-plugins/magic-comments/src/lib.rs | 279 ++++ 49 files changed, 2269 insertions(+), 146 deletions(-) create mode 100644 rust-plugins/magic-comments/.gitignore create mode 100644 rust-plugins/magic-comments/Cargo.toml create mode 100644 rust-plugins/magic-comments/npm/darwin-arm64/README.md create mode 100644 rust-plugins/magic-comments/npm/darwin-arm64/package.json create mode 100644 rust-plugins/magic-comments/npm/darwin-x64/README.md create mode 100644 rust-plugins/magic-comments/npm/darwin-x64/package.json create mode 100644 rust-plugins/magic-comments/npm/linux-arm64-gnu/README.md create mode 100644 rust-plugins/magic-comments/npm/linux-arm64-gnu/package.json create mode 100644 rust-plugins/magic-comments/npm/linux-arm64-musl/README.md create mode 100644 rust-plugins/magic-comments/npm/linux-arm64-musl/package.json create mode 100644 rust-plugins/magic-comments/npm/linux-x64-gnu/README.md create mode 100644 rust-plugins/magic-comments/npm/linux-x64-gnu/package.json create mode 100644 rust-plugins/magic-comments/npm/linux-x64-musl/README.md create mode 100644 rust-plugins/magic-comments/npm/linux-x64-musl/package.json create mode 100644 rust-plugins/magic-comments/npm/win32-arm64-msvc/README.md create mode 100644 rust-plugins/magic-comments/npm/win32-arm64-msvc/package.json create mode 100644 rust-plugins/magic-comments/npm/win32-ia32-msvc/README.md create mode 100644 rust-plugins/magic-comments/npm/win32-ia32-msvc/package.json create mode 100644 rust-plugins/magic-comments/npm/win32-x64-msvc/README.md create mode 100644 rust-plugins/magic-comments/npm/win32-x64-msvc/package.json create mode 100644 rust-plugins/magic-comments/options.d.ts create mode 100644 rust-plugins/magic-comments/package.json create mode 100644 rust-plugins/magic-comments/playground/README.md create mode 100644 rust-plugins/magic-comments/playground/farm.config.ts create mode 100644 rust-plugins/magic-comments/playground/index.html create mode 100644 rust-plugins/magic-comments/playground/index.js create mode 100644 rust-plugins/magic-comments/playground/package.json create mode 100644 rust-plugins/magic-comments/playground/public/favicon.ico create mode 100644 rust-plugins/magic-comments/playground/src/About.tsx create mode 100644 rust-plugins/magic-comments/playground/src/Contact.tsx create mode 100644 rust-plugins/magic-comments/playground/src/Home.tsx create mode 100644 rust-plugins/magic-comments/playground/src/assets/logo.png create mode 100644 rust-plugins/magic-comments/playground/src/assets/react.svg create mode 100644 rust-plugins/magic-comments/playground/src/index.css create mode 100644 rust-plugins/magic-comments/playground/src/index.tsx create mode 100644 rust-plugins/magic-comments/playground/src/main.css create mode 100644 rust-plugins/magic-comments/playground/src/main.tsx create mode 100644 rust-plugins/magic-comments/playground/src/typings.d.ts create mode 100644 rust-plugins/magic-comments/playground/tsconfig.json create mode 100644 rust-plugins/magic-comments/playground/tsconfig.node.json create mode 100644 rust-plugins/magic-comments/rust-toolchain.toml create mode 100644 rust-plugins/magic-comments/rustfmt.toml create mode 100644 rust-plugins/magic-comments/scripts/func.js create mode 100644 rust-plugins/magic-comments/scripts/index.d.ts create mode 100644 rust-plugins/magic-comments/scripts/index.js create mode 100755 rust-plugins/magic-comments/scripts/watch.sh create mode 100644 rust-plugins/magic-comments/src/html_modifier.rs create mode 100644 rust-plugins/magic-comments/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 465b1d18..869ce915 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -33,7 +33,7 @@ version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ - "getrandom", + "getrandom 0.2.15", "once_cell", "version_check", ] @@ -45,7 +45,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", - "getrandom", + "getrandom 0.2.15", "once_cell", "serde", "version_check", @@ -548,6 +548,12 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -622,6 +628,33 @@ dependencies = [ "typenum", ] +[[package]] +name = "cssparser" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "754b69d351cdc2d8ee09ae203db831e005560fc6030da058f86ad60c92a9cb0a" +dependencies = [ + "cssparser-macros", + "dtoa-short", + "itoa 0.4.8", + "matches", + "phf 0.8.0", + "proc-macro2", + "quote", + "smallvec", + "syn 1.0.109", +] + +[[package]] +name = "cssparser-macros" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" +dependencies = [ + "quote", + "syn 2.0.89", +] + [[package]] name = "csv" version = "1.3.0" @@ -629,7 +662,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac574ff4d437a7b5ad237ef331c17ccca63c46479e5b5453eb8e10bb99a759fe" dependencies = [ "csv-core", - "itoa", + "itoa 1.0.11", "ryu", "serde", ] @@ -726,6 +759,19 @@ dependencies = [ "powerfmt", ] +[[package]] +name = "derive_more" +version = "0.99.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version 0.4.1", + "syn 2.0.89", +] + [[package]] name = "digest" version = "0.10.7" @@ -758,12 +804,38 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + [[package]] name = "downcast-rs" version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" +[[package]] +name = "dtoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" + +[[package]] +name = "dtoa-short" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd1511a7b6a56299bd043a9c167a6d2bfb37bf84a6dfceaba651168adfb43c87" +dependencies = [ + "dtoa", +] + [[package]] name = "either" version = "1.13.0" @@ -776,6 +848,15 @@ version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if", +] + [[package]] name = "enhanced-magic-string" version = "0.0.16" @@ -815,14 +896,31 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "farm_plugin_magic_string" +version = "0.0.0" +dependencies = [ + "farmfe_compiler 0.0.16", + "farmfe_core", + "farmfe_macro_plugin", + "farmfe_toolkit 0.0.17", + "farmfe_toolkit_plugin_types 0.0.24", + "farmfe_utils", + "lol_html", + "regex", + "serde", + "serde_json", + "url", +] + [[package]] name = "farm_plugin_svgr" version = "0.0.0" dependencies = [ "farmfe_core", "farmfe_macro_plugin", - "farmfe_toolkit", - "farmfe_toolkit_plugin_types", + "farmfe_toolkit 0.0.16", + "farmfe_toolkit_plugin_types 0.0.23", "farmfe_utils", "globset", "serde", @@ -838,33 +936,62 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1f68cabfe0f14cb75925a6833b94ade861442e645466593f1a6aa6fcf424bea" dependencies = [ "farmfe_core", - "farmfe_plugin_bundle", - "farmfe_plugin_css", - "farmfe_plugin_define", - "farmfe_plugin_html", - "farmfe_plugin_json", - "farmfe_plugin_lazy_compilation", - "farmfe_plugin_minify", - "farmfe_plugin_partial_bundling", - "farmfe_plugin_polyfill", - "farmfe_plugin_progress", - "farmfe_plugin_resolve", - "farmfe_plugin_runtime", - "farmfe_plugin_script", - "farmfe_plugin_static_assets", - "farmfe_plugin_tree_shake", + "farmfe_plugin_bundle 0.0.8", + "farmfe_plugin_css 0.0.16", + "farmfe_plugin_define 0.0.14", + "farmfe_plugin_html 0.0.14", + "farmfe_plugin_json 0.0.14", + "farmfe_plugin_lazy_compilation 0.0.14", + "farmfe_plugin_minify 0.0.14", + "farmfe_plugin_partial_bundling 0.0.14", + "farmfe_plugin_polyfill 0.0.14", + "farmfe_plugin_progress 0.0.14", + "farmfe_plugin_resolve 0.0.14", + "farmfe_plugin_runtime 0.0.14", + "farmfe_plugin_script 0.0.13", + "farmfe_plugin_static_assets 0.0.14", + "farmfe_plugin_tree_shake 0.0.13", "farmfe_testing", - "farmfe_testing_helpers", - "farmfe_toolkit", + "farmfe_testing_helpers 0.0.16", + "farmfe_toolkit 0.0.16", + "farmfe_utils", + "num_cpus", +] + +[[package]] +name = "farmfe_compiler" +version = "0.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e0f974e7133007d352a70461bd06aa611627b9dcfc47c7e98680b01a9514a6b" +dependencies = [ + "farmfe_core", + "farmfe_plugin_bundle 0.0.9", + "farmfe_plugin_css 0.0.17", + "farmfe_plugin_define 0.0.15", + "farmfe_plugin_html 0.0.15", + "farmfe_plugin_json 0.0.15", + "farmfe_plugin_lazy_compilation 0.0.15", + "farmfe_plugin_minify 0.0.15", + "farmfe_plugin_partial_bundling 0.0.15", + "farmfe_plugin_polyfill 0.0.15", + "farmfe_plugin_progress 0.0.15", + "farmfe_plugin_resolve 0.0.15", + "farmfe_plugin_runtime 0.0.15", + "farmfe_plugin_script 0.0.15", + "farmfe_plugin_static_assets 0.0.15", + "farmfe_plugin_tree_shake 0.0.14", + "farmfe_testing", + "farmfe_testing_helpers 0.0.17", + "farmfe_toolkit 0.0.17", "farmfe_utils", "num_cpus", ] [[package]] name = "farmfe_core" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c15c436f18276a7be7f41385e10d276dff13998bedde13e2f94b30a8923076d" +checksum = "7b1796a8008e2f5bae7f334d546f1aca3dbe7f4aca986356fe50974dfe0701b7" dependencies = [ "blake2", "bytecheck 0.7.0", @@ -925,8 +1052,8 @@ version = "0.0.0" dependencies = [ "farmfe_core", "farmfe_macro_plugin", - "farmfe_toolkit", - "farmfe_toolkit_plugin_types", + "farmfe_toolkit 0.0.16", + "farmfe_toolkit_plugin_types 0.0.23", "farmfe_utils", "glob", "regress", @@ -941,8 +1068,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cca842ae26e6c0e072f403790e8384e7f53e6ae8c5b0ea37fd77c268dd06b618" dependencies = [ "farmfe_core", - "farmfe_testing_helpers", - "farmfe_toolkit", + "farmfe_testing_helpers 0.0.16", + "farmfe_toolkit 0.0.16", + "farmfe_utils", +] + +[[package]] +name = "farmfe_plugin_bundle" +version = "0.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b30629c50703c43dd570d4bc4f21111e9abdce184d302e1f5f5bfe60b543e87c" +dependencies = [ + "farmfe_core", + "farmfe_testing_helpers 0.0.17", + "farmfe_toolkit 0.0.17", "farmfe_utils", ] @@ -954,7 +1093,20 @@ checksum = "992e1eaf1cb7d3ad6cbd41a1bd12c876cb110d54ad1a5c09d49527ae6b9a48cf" dependencies = [ "farmfe_core", "farmfe_macro_cache_item", - "farmfe_toolkit", + "farmfe_toolkit 0.0.16", + "farmfe_utils", + "rkyv", +] + +[[package]] +name = "farmfe_plugin_css" +version = "0.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b95bcbf4c9802e146cf1294703ea5128d4f9a10029165258641ad365a530a86e" +dependencies = [ + "farmfe_core", + "farmfe_macro_cache_item", + "farmfe_toolkit 0.0.17", "farmfe_utils", "rkyv", ] @@ -966,8 +1118,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33300d2adec596514f318ecb5d7b4d0cbfa6501b6b11925d2694ec0d168f66da" dependencies = [ "farmfe_core", - "farmfe_testing_helpers", - "farmfe_toolkit", + "farmfe_testing_helpers 0.0.16", + "farmfe_toolkit 0.0.16", + "farmfe_utils", +] + +[[package]] +name = "farmfe_plugin_define" +version = "0.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b832a5bd3479e3908c33d6c5ab8f7b91a5586d9af1afb469658ff311cbd1ccf" +dependencies = [ + "farmfe_core", + "farmfe_testing_helpers 0.0.17", + "farmfe_toolkit 0.0.17", "farmfe_utils", ] @@ -978,8 +1142,8 @@ dependencies = [ "csv", "farmfe_core", "farmfe_macro_plugin", - "farmfe_toolkit", - "farmfe_toolkit_plugin_types", + "farmfe_toolkit 0.0.16", + "farmfe_toolkit_plugin_types 0.0.23", "serde", "serde_json", ] @@ -991,8 +1155,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8e08dfe3d49e0aa97152c2e81eb52601a4d1d3577d3514482ebb992aa6d5ccf" dependencies = [ "farmfe_core", - "farmfe_testing_helpers", - "farmfe_toolkit", + "farmfe_testing_helpers 0.0.16", + "farmfe_toolkit 0.0.16", + "rkyv", +] + +[[package]] +name = "farmfe_plugin_html" +version = "0.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "584420470f49994074df7853a302140ceafd3fac15783b1ee439a1561fb744cb" +dependencies = [ + "farmfe_core", + "farmfe_testing_helpers 0.0.17", + "farmfe_toolkit 0.0.17", "rkyv", ] @@ -1004,8 +1180,8 @@ dependencies = [ "cached", "farmfe_core", "farmfe_macro_plugin", - "farmfe_toolkit", - "farmfe_toolkit_plugin_types", + "farmfe_toolkit 0.0.16", + "farmfe_toolkit_plugin_types 0.0.23", "farmfe_utils", "fervid", "loading", @@ -1026,8 +1202,8 @@ dependencies = [ "base64 0.22.1", "farmfe_core", "farmfe_macro_plugin", - "farmfe_toolkit", - "farmfe_toolkit_plugin_types", + "farmfe_toolkit 0.0.16", + "farmfe_toolkit_plugin_types 0.0.23", "lazy_static", "mime_guess", "serde", @@ -1040,8 +1216,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc4ac61826d8588462c5bcaa142693bfa67c7e84cae6ba7441175d8139194d4b" dependencies = [ "farmfe_core", - "farmfe_testing_helpers", - "farmfe_toolkit", + "farmfe_testing_helpers 0.0.16", + "farmfe_toolkit 0.0.16", +] + +[[package]] +name = "farmfe_plugin_json" +version = "0.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0d58570a77076070aea968659df8e47218ddafed64bc5869f4cda80304939a1" +dependencies = [ + "farmfe_core", + "farmfe_testing_helpers 0.0.17", + "farmfe_toolkit 0.0.17", ] [[package]] @@ -1051,8 +1238,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcee653413d54bdc5175775ec0605b01a26190f2a9c80381528cbe5c63fa4ee3" dependencies = [ "farmfe_core", - "farmfe_testing_helpers", - "farmfe_toolkit", + "farmfe_testing_helpers 0.0.16", + "farmfe_toolkit 0.0.16", + "farmfe_utils", +] + +[[package]] +name = "farmfe_plugin_lazy_compilation" +version = "0.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d33d67ab1a955bf046e52de88e35c75e5619f32868930f64f1d995a41aa31a45" +dependencies = [ + "farmfe_core", + "farmfe_testing_helpers 0.0.17", + "farmfe_toolkit 0.0.17", "farmfe_utils", ] @@ -1062,7 +1261,7 @@ version = "0.0.0" dependencies = [ "farmfe_core", "farmfe_macro_plugin", - "farmfe_toolkit_plugin_types", + "farmfe_toolkit_plugin_types 0.0.23", "mdxjs", "regex", "serde", @@ -1075,8 +1274,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b83d63ee1a955b7658ae6477b89ee88b9587a9c0d2fd9e0c4fe2a63d3b12853f" dependencies = [ "farmfe_core", - "farmfe_testing_helpers", - "farmfe_toolkit", + "farmfe_testing_helpers 0.0.16", + "farmfe_toolkit 0.0.16", +] + +[[package]] +name = "farmfe_plugin_minify" +version = "0.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5008f75acbc075dcd637006d050c9966e24c3d17e6be30b6f5c9ba49fae90e65" +dependencies = [ + "farmfe_core", + "farmfe_testing_helpers 0.0.17", + "farmfe_toolkit 0.0.17", ] [[package]] @@ -1085,7 +1295,7 @@ version = "0.0.1" dependencies = [ "farmfe_core", "farmfe_macro_plugin", - "farmfe_toolkit_plugin_types", + "farmfe_toolkit_plugin_types 0.0.23", "regex", "serde", "serde_json", @@ -1098,8 +1308,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b63c4dafe3288d109dfa802a6b9f00bfc47170975142cb98c1c56d3472e6d375" dependencies = [ "farmfe_core", - "farmfe_testing_helpers", - "farmfe_toolkit", + "farmfe_testing_helpers 0.0.16", + "farmfe_toolkit 0.0.16", +] + +[[package]] +name = "farmfe_plugin_partial_bundling" +version = "0.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ea4b87001126a813408a1a6043d0ab62a11e1920148ed1e0827b816f48fa888" +dependencies = [ + "farmfe_core", + "farmfe_testing_helpers 0.0.17", + "farmfe_toolkit 0.0.17", ] [[package]] @@ -1109,8 +1330,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff97f6e77909c0ffa6ad1eb13ae0c0f9726c2ea1ac2a7ec36ccf940d50f1e562" dependencies = [ "farmfe_core", - "farmfe_testing_helpers", - "farmfe_toolkit", + "farmfe_testing_helpers 0.0.16", + "farmfe_toolkit 0.0.16", +] + +[[package]] +name = "farmfe_plugin_polyfill" +version = "0.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7d99974564981bc1560bccd227407c5f10c66e0a99feb16f01c0279ab234404" +dependencies = [ + "farmfe_core", + "farmfe_testing_helpers 0.0.17", + "farmfe_toolkit 0.0.17", ] [[package]] @@ -1121,7 +1353,19 @@ checksum = "1221785c3e3f576aff675bf1989700b5ba3c5ee4e1ab3debf7b8fb092540c276" dependencies = [ "console", "farmfe_core", - "farmfe_testing_helpers", + "farmfe_testing_helpers 0.0.16", + "indicatif", +] + +[[package]] +name = "farmfe_plugin_progress" +version = "0.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ff269da656cd7392583b70cf5b2dc4629959a2a56628ce3287c7ca16b261218" +dependencies = [ + "console", + "farmfe_core", + "farmfe_testing_helpers 0.0.17", "indicatif", ] @@ -1131,8 +1375,8 @@ version = "0.0.1" dependencies = [ "farmfe_core", "farmfe_macro_plugin", - "farmfe_toolkit", - "farmfe_toolkit_plugin_types", + "farmfe_toolkit 0.0.16", + "farmfe_toolkit_plugin_types 0.0.23", "farmfe_utils", "glob", "serde", @@ -1146,8 +1390,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3667da3dbea060aec7f6e05577aa20078784c7358083e4ab9eeba7935e64727" dependencies = [ "farmfe_core", - "farmfe_testing_helpers", - "farmfe_toolkit", + "farmfe_testing_helpers 0.0.16", + "farmfe_toolkit 0.0.16", + "farmfe_utils", + "once_cell", +] + +[[package]] +name = "farmfe_plugin_resolve" +version = "0.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c09571c168961bc2a9a2be297eddbebd200abf6ecc60732b49e7f566fd29a1dc" +dependencies = [ + "farmfe_core", + "farmfe_testing_helpers 0.0.17", + "farmfe_toolkit 0.0.17", "farmfe_utils", "once_cell", ] @@ -1159,8 +1416,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "910c712281a684f7437d476b47f9f23bdbba70d680f1cd34203cc536a63c15c6" dependencies = [ "farmfe_core", - "farmfe_testing_helpers", - "farmfe_toolkit", + "farmfe_testing_helpers 0.0.16", + "farmfe_toolkit 0.0.16", + "farmfe_utils", + "rkyv", +] + +[[package]] +name = "farmfe_plugin_runtime" +version = "0.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "533d83178a77a07d2cdcc3614c264099259f7ce114547c414fc1af9b6d8ded00" +dependencies = [ + "farmfe_core", + "farmfe_testing_helpers 0.0.17", + "farmfe_toolkit 0.0.17", "farmfe_utils", "rkyv", ] @@ -1172,9 +1442,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "889da3d0dfb22d962d0f5bca3937b93d544a367aa01b8d785ea92d4829b95170" dependencies = [ "farmfe_core", - "farmfe_swc_transformer_import_glob", - "farmfe_testing_helpers", - "farmfe_toolkit", + "farmfe_swc_transformer_import_glob 0.0.14", + "farmfe_testing_helpers 0.0.16", + "farmfe_toolkit 0.0.16", + "farmfe_utils", +] + +[[package]] +name = "farmfe_plugin_script" +version = "0.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d422745c9d81c3beadc57b897838bb05ee7a0565cdc9421be6aa6ec974703f8" +dependencies = [ + "farmfe_core", + "farmfe_swc_transformer_import_glob 0.0.16", + "farmfe_testing_helpers 0.0.17", + "farmfe_toolkit 0.0.17", "farmfe_utils", ] @@ -1186,8 +1469,23 @@ checksum = "c170158005e4f0533ddb97eeb02859a1b8d571c65e15f378cdf6ae0151346d22" dependencies = [ "base64 0.21.7", "farmfe_core", - "farmfe_testing_helpers", - "farmfe_toolkit", + "farmfe_testing_helpers 0.0.16", + "farmfe_toolkit 0.0.16", + "farmfe_utils", + "mime_guess", + "rkyv", +] + +[[package]] +name = "farmfe_plugin_static_assets" +version = "0.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89497f8a54450b68118f90b26eec9fb59d2e5cae988d17312093c4f547d4bf7a" +dependencies = [ + "base64 0.21.7", + "farmfe_core", + "farmfe_testing_helpers 0.0.17", + "farmfe_toolkit 0.0.17", "farmfe_utils", "mime_guess", "rkyv", @@ -1199,8 +1497,8 @@ version = "0.0.1" dependencies = [ "farmfe_core", "farmfe_macro_plugin", - "farmfe_toolkit", - "farmfe_toolkit_plugin_types", + "farmfe_toolkit 0.0.16", + "farmfe_toolkit_plugin_types 0.0.23", "regex", "serde", ] @@ -1212,8 +1510,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90a66d48425e11c4bf38387177261026ed95f7086d0ac72dca8da26a3a884f76" dependencies = [ "farmfe_core", - "farmfe_testing_helpers", - "farmfe_toolkit", + "farmfe_testing_helpers 0.0.16", + "farmfe_toolkit 0.0.16", + "farmfe_utils", +] + +[[package]] +name = "farmfe_plugin_tree_shake" +version = "0.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53dc8ac3e31383350bb1f8672d0c498a3381b5a1c665dd27707d3c34dcc559a2" +dependencies = [ + "farmfe_core", + "farmfe_testing_helpers 0.0.17", + "farmfe_toolkit 0.0.17", "farmfe_utils", ] @@ -1224,8 +1534,8 @@ dependencies = [ "base64 0.22.1", "farmfe_core", "farmfe_macro_plugin", - "farmfe_toolkit", - "farmfe_toolkit_plugin_types", + "farmfe_toolkit 0.0.16", + "farmfe_toolkit_plugin_types 0.0.23", "farmfe_utils", "lazy_static", "mime_guess", @@ -1238,7 +1548,7 @@ version = "0.0.1" dependencies = [ "farmfe_core", "farmfe_macro_plugin", - "farmfe_toolkit_plugin_types", + "farmfe_toolkit_plugin_types 0.0.23", "thiserror 2.0.3", ] @@ -1248,8 +1558,8 @@ version = "0.0.0" dependencies = [ "farmfe_core", "farmfe_macro_plugin", - "farmfe_toolkit", - "farmfe_toolkit_plugin_types", + "farmfe_toolkit 0.0.16", + "farmfe_toolkit_plugin_types 0.0.23", "rkyv", ] @@ -1258,11 +1568,11 @@ name = "farmfe_plugin_worker" version = "0.0.0" dependencies = [ "base64 0.22.1", - "farmfe_compiler", + "farmfe_compiler 0.0.14", "farmfe_core", "farmfe_macro_plugin", - "farmfe_toolkit", - "farmfe_toolkit_plugin_types", + "farmfe_toolkit 0.0.16", + "farmfe_toolkit_plugin_types 0.0.23", "farmfe_utils", "regress", "rkyv", @@ -1275,7 +1585,7 @@ version = "0.0.1" dependencies = [ "farmfe_core", "farmfe_macro_plugin", - "farmfe_toolkit_plugin_types", + "farmfe_toolkit_plugin_types 0.0.23", "globset", "lazy_static", "regex", @@ -1290,8 +1600,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e32e113cd79f0880e6638d64bb59371bd860388c272a97377d3aad2485c7593c" dependencies = [ "farmfe_core", - "farmfe_testing_helpers", - "farmfe_toolkit", + "farmfe_testing_helpers 0.0.16", + "farmfe_toolkit 0.0.16", + "farmfe_utils", +] + +[[package]] +name = "farmfe_swc_transformer_import_glob" +version = "0.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "559608a059aca5600349f194cb39b426cf6dc9a17a12afe573f33f3a2e8c3f77" +dependencies = [ + "farmfe_core", + "farmfe_testing_helpers 0.0.17", + "farmfe_toolkit 0.0.17", "farmfe_utils", ] @@ -1319,6 +1641,15 @@ dependencies = [ "farmfe_core", ] +[[package]] +name = "farmfe_testing_helpers" +version = "0.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbad219c6f3ca2999adec4dfe8ee2cf0de3992fe717e07ab9d84d2bb285a0cb3" +dependencies = [ + "farmfe_core", +] + [[package]] name = "farmfe_toolkit" version = "0.0.16" @@ -1327,8 +1658,44 @@ checksum = "4df94eae6d0f642217539e791adcee7e05a075bf847d560b70a41f5f7f84b0c4" dependencies = [ "anyhow", "farmfe_core", - "farmfe_testing_helpers", - "farmfe_toolkit_plugin_types", + "farmfe_testing_helpers 0.0.16", + "farmfe_toolkit_plugin_types 0.0.23", + "farmfe_utils", + "lazy_static", + "preset_env_base", + "sourcemap 8.0.1", + "swc_atoms 0.6.7", + "swc_css_codegen 0.152.0", + "swc_css_minifier", + "swc_css_modules", + "swc_css_parser 0.151.0", + "swc_css_prefixer", + "swc_css_visit 0.140.0", + "swc_ecma_codegen 0.151.1", + "swc_ecma_minifier", + "swc_ecma_parser 0.146.12", + "swc_ecma_preset_env", + "swc_ecma_transforms", + "swc_ecma_transforms_base 0.140.3", + "swc_ecma_utils 0.130.3", + "swc_ecma_visit 0.101.0", + "swc_error_reporters", + "swc_html_codegen", + "swc_html_minifier", + "swc_html_parser 0.40.0", + "swc_html_visit", +] + +[[package]] +name = "farmfe_toolkit" +version = "0.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3543d4d2ffad4081b105f7f45f053f8a5c051f7afd619624ba0fae2187dee137" +dependencies = [ + "anyhow", + "farmfe_core", + "farmfe_testing_helpers 0.0.17", + "farmfe_toolkit_plugin_types 0.0.24", "farmfe_utils", "lazy_static", "preset_env_base", @@ -1366,6 +1733,17 @@ dependencies = [ "libloading", ] +[[package]] +name = "farmfe_toolkit_plugin_types" +version = "0.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61ad8ed40d2afcd22baf1f884f767cb601ac0c5707a954d3fe37c103b8c30f4a" +dependencies = [ + "farmfe_core", + "lazy_static", + "libloading", +] + [[package]] name = "farmfe_utils" version = "0.1.6" @@ -1574,6 +1952,17 @@ dependencies = [ "version_check", ] +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + [[package]] name = "getrandom" version = "0.2.15" @@ -1582,7 +1971,7 @@ checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", ] [[package]] @@ -1642,6 +2031,15 @@ dependencies = [ "ahash 0.7.8", ] +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash 0.8.11", +] + [[package]] name = "hashbrown" version = "0.14.5" @@ -1698,7 +2096,7 @@ checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", - "itoa", + "itoa 1.0.11", ] [[package]] @@ -1742,7 +2140,7 @@ dependencies = [ "http", "http-body", "httparse", - "itoa", + "itoa 1.0.11", "pin-project-lite", "smallvec", "tokio", @@ -1787,26 +2185,144 @@ dependencies = [ ] [[package]] -name = "iana-time-zone" -version = "0.1.61" +name = "iana-time-zone" +version = "0.1.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core", + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", ] [[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" +name = "icu_provider_macros" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ - "cc", + "proc-macro2", + "quote", + "syn 2.0.89", ] [[package]] @@ -1817,12 +2333,23 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", ] [[package]] @@ -1951,6 +2478,12 @@ dependencies = [ "either", ] +[[package]] +name = "itoa" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" + [[package]] name = "itoa" version = "1.0.11" @@ -1972,6 +2505,12 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + [[package]] name = "lexical" version = "6.1.1" @@ -2089,6 +2628,12 @@ dependencies = [ "linked-hash-map", ] +[[package]] +name = "litemap" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" + [[package]] name = "loading" version = "0.4.0" @@ -2111,6 +2656,25 @@ version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +[[package]] +name = "lol_html" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "964b47c14635e111f7efddcd8f1f8794195f66225fef19822fa942b217a859cf" +dependencies = [ + "bitflags 2.6.0", + "cfg-if", + "cssparser", + "encoding_rs", + "hashbrown 0.13.2", + "lazy_static", + "lazycell", + "memchr", + "mime", + "selectors", + "thiserror 1.0.63", +] + [[package]] name = "markdown" version = "1.0.0-alpha.20" @@ -2120,6 +2684,12 @@ dependencies = [ "unicode-id", ] +[[package]] +name = "matches" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" + [[package]] name = "mdxjs" version = "0.2.5" @@ -2224,7 +2794,7 @@ checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ "hermit-abi", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.52.0", ] @@ -2234,6 +2804,12 @@ version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" + [[package]] name = "nom" version = "7.1.3" @@ -2422,6 +2998,17 @@ dependencies = [ "indexmap 2.5.0", ] +[[package]] +name = "phf" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3dfb61232e34fcb633f43d12c58f83c1df82962dcdfa565a4e866ffc17dafe12" +dependencies = [ + "phf_macros 0.8.0", + "phf_shared 0.8.0", + "proc-macro-hack", +] + [[package]] name = "phf" version = "0.10.1" @@ -2443,6 +3030,26 @@ dependencies = [ "phf_shared 0.11.2", ] +[[package]] +name = "phf_codegen" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbffee61585b0411840d3ece935cce9cb6321f01c45477d30066498cd5e1a815" +dependencies = [ + "phf_generator 0.8.0", + "phf_shared 0.8.0", +] + +[[package]] +name = "phf_generator" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17367f0cc86f2d25802b2c26ee58a7b23faeccf78a396094c13dced0d0182526" +dependencies = [ + "phf_shared 0.8.0", + "rand 0.7.3", +] + [[package]] name = "phf_generator" version = "0.10.0" @@ -2450,7 +3057,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6" dependencies = [ "phf_shared 0.10.0", - "rand", + "rand 0.8.5", ] [[package]] @@ -2460,7 +3067,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" dependencies = [ "phf_shared 0.11.2", - "rand", + "rand 0.8.5", +] + +[[package]] +name = "phf_macros" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6fde18ff429ffc8fe78e2bf7f8b7a5a5a6e2a8b58bc5a9ac69198bbda9189c" +dependencies = [ + "phf_generator 0.8.0", + "phf_shared 0.8.0", + "proc-macro-hack", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] @@ -2490,6 +3111,15 @@ dependencies = [ "syn 2.0.89", ] +[[package]] +name = "phf_shared" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c00cf8b9eafe68dde5e9eaa2cef8ee84a9336a47d566ec55ca16589633b65af7" +dependencies = [ + "siphasher", +] + [[package]] name = "phf_shared" version = "0.10.0" @@ -2700,7 +3330,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba92fb39ec7ad06ca2582c0ca834dfeadcaf06ddfc8e635c80aa7e1c05315fdd" dependencies = [ "bytes", - "rand", + "rand 0.8.5", "ring", "rustc-hash 2.0.0", "rustls", @@ -2744,6 +3374,20 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce082a9940a7ace2ad4a8b7d0b1eac6aa378895f18be598230c5f2284ac05426" +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", + "rand_pcg", +] + [[package]] name = "rand" version = "0.8.5" @@ -2751,8 +3395,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha", - "rand_core", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", ] [[package]] @@ -2762,7 +3416,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", ] [[package]] @@ -2771,7 +3434,25 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom", + "getrandom 0.2.15", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rand_pcg" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429" +dependencies = [ + "rand_core 0.5.1", ] [[package]] @@ -2818,16 +3499,16 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ - "getrandom", + "getrandom 0.2.15", "libredox", "thiserror 1.0.63", ] [[package]] name = "regex" -version = "1.10.6" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -2837,9 +3518,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -2848,9 +3529,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "regress" @@ -2927,7 +3608,7 @@ checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", "cfg-if", - "getrandom", + "getrandom 0.2.15", "libc", "spin", "untrusted", @@ -3057,6 +3738,15 @@ dependencies = [ "semver 0.9.0", ] +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver 1.0.23", +] + [[package]] name = "rustls" version = "0.23.16" @@ -3142,6 +3832,26 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" +[[package]] +name = "selectors" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df320f1889ac4ba6bc0cdc9c9af7af4bd64bb927bccdf32d81140dc1f9be12fe" +dependencies = [ + "bitflags 1.3.2", + "cssparser", + "derive_more", + "fxhash", + "log", + "matches", + "phf 0.8.0", + "phf_codegen", + "precomputed-hash", + "servo_arc", + "smallvec", + "thin-slice", +] + [[package]] name = "semver" version = "0.9.0" @@ -3168,18 +3878,18 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.213" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ea7893ff5e2466df8d720bb615088341b295f849602c6956047f8f80f0e9bc1" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.213" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e85ad2009c50b58e87caa8cd6dac16bdf511bbfb7af6c33df902396aa480fa5" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", @@ -3188,12 +3898,12 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "930cfb6e6abf99298aaad7d29abbef7a9999a9a8806a40088f55f0dcec03146b" dependencies = [ "indexmap 2.5.0", - "itoa", + "itoa 1.0.11", "memchr", "ryu", "serde", @@ -3206,7 +3916,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", - "itoa", + "itoa 1.0.11", "ryu", "serde", ] @@ -3218,12 +3928,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ "indexmap 2.5.0", - "itoa", + "itoa 1.0.11", "ryu", "serde", "unsafe-libyaml", ] +[[package]] +name = "servo_arc" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98238b800e0d1576d8b6e3de32827c2d74bee68bb97748dcf5071fb53965432" +dependencies = [ + "nodrop", + "stable_deref_trait", +] + [[package]] name = "sha1" version = "0.10.6" @@ -3349,7 +4069,7 @@ dependencies = [ "data-encoding", "debugid", "if_chain", - "rustc_version", + "rustc_version 0.2.3", "serde", "serde_json", "unicode-id", @@ -3368,7 +4088,7 @@ dependencies = [ "debugid", "if_chain", "rustc-hash 1.1.0", - "rustc_version", + "rustc_version 0.2.3", "serde", "serde_json", "unicode-id-start", @@ -3387,7 +4107,7 @@ dependencies = [ "debugid", "if_chain", "rustc-hash 1.1.0", - "rustc_version", + "rustc_version 0.2.3", "serde", "serde_json", "unicode-id-start", @@ -5188,6 +5908,17 @@ dependencies = [ "futures-core", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] + [[package]] name = "tap" version = "1.0.1" @@ -5215,6 +5946,12 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "thin-slice" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" + [[package]] name = "thiserror" version = "1.0.63" @@ -5272,7 +6009,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", - "itoa", + "itoa 1.0.11", "num-conv", "powerfmt", "serde", @@ -5296,6 +6033,16 @@ dependencies = [ "time-core", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -5425,12 +6172,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - [[package]] name = "unicode-id" version = "0.3.4" @@ -5455,15 +6196,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" -[[package]] -name = "unicode-normalization" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" -dependencies = [ - "tinyvec", -] - [[package]] name = "unicode-width" version = "0.1.13" @@ -5490,15 +6222,27 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.2" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna", "percent-encoding", ] +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.2" @@ -5569,6 +6313,12 @@ dependencies = [ "try-lock", ] +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -5906,6 +6656,18 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "wyz" version = "0.5.1" @@ -5930,6 +6692,30 @@ dependencies = [ "xml-rs", ] +[[package]] +name = "yoke" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", + "synstructure", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -5951,8 +6737,51 @@ dependencies = [ "syn 2.0.89", ] +[[package]] +name = "zerofrom" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", + "synstructure", +] + [[package]] name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.89", +] diff --git a/rust-plugins/magic-comments/.gitignore b/rust-plugins/magic-comments/.gitignore new file mode 100644 index 00000000..50e4f22f --- /dev/null +++ b/rust-plugins/magic-comments/.gitignore @@ -0,0 +1,197 @@ +# Created by https://www.toptal.com/developers/gitignore/api/node +# Edit at https://www.toptal.com/developers/gitignore?templates=node + +### Node ### +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# Next.js build output +.next + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# End of https://www.toptal.com/developers/gitignore/api/node + +# Created by https://www.toptal.com/developers/gitignore/api/macos +# Edit at https://www.toptal.com/developers/gitignore?templates=macos + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + +# End of https://www.toptal.com/developers/gitignore/api/macos + +# Created by https://www.toptal.com/developers/gitignore/api/windows +# Edit at https://www.toptal.com/developers/gitignore?templates=windows + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# End of https://www.toptal.com/developers/gitignore/api/windows + +#Added by cargo + +/target +# Cargo.lock + +.pnp.* +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/sdks +!.yarn/versions + +*.farm diff --git a/rust-plugins/magic-comments/Cargo.toml b/rust-plugins/magic-comments/Cargo.toml new file mode 100644 index 00000000..1f6d2ece --- /dev/null +++ b/rust-plugins/magic-comments/Cargo.toml @@ -0,0 +1,20 @@ +[package] +edition = "2021" +name = "farm_plugin_magic_string" +version = "0.0.0" + +[lib] +crate-type = ["cdylib", "rlib"] + +[dependencies] +regex = "1.11.1" +serde = { version = "1.0.217", features = ["derive", "rc"] } +serde_json = { version = "1.0.137", features = ["preserve_order"] } +url = "2.5.4" +farmfe_core = { version = "0.7.3" } +farmfe_utils = { version = "0.1.6" } +farmfe_toolkit_plugin_types = { version = "0.0.24" } +farmfe_macro_plugin = { version = "0.0.4" } +farmfe_toolkit = "0.0.17" +farmfe_compiler = { version = "0.0.16" } +lol_html = "=2.0.0" diff --git a/rust-plugins/magic-comments/npm/darwin-arm64/README.md b/rust-plugins/magic-comments/npm/darwin-arm64/README.md new file mode 100644 index 00000000..74bea15e --- /dev/null +++ b/rust-plugins/magic-comments/npm/darwin-arm64/README.md @@ -0,0 +1,3 @@ +# `farm-plugin-magic-string-darwin-arm64` + +This is the **aarch64-apple-darwin** binary for `farm-plugin-magic-string` diff --git a/rust-plugins/magic-comments/npm/darwin-arm64/package.json b/rust-plugins/magic-comments/npm/darwin-arm64/package.json new file mode 100644 index 00000000..0b48c20d --- /dev/null +++ b/rust-plugins/magic-comments/npm/darwin-arm64/package.json @@ -0,0 +1,18 @@ +{ + "name": "farm-plugin-magic-string-darwin-arm64", + "version": "0.1.2", + "os": [ + "darwin" + ], + "cpu": [ + "arm64" + ], + "main": "index.farm", + "files": [ + "index.farm" + ], + "license": "MIT", + "engines": { + "node": ">= 10" + } +} diff --git a/rust-plugins/magic-comments/npm/darwin-x64/README.md b/rust-plugins/magic-comments/npm/darwin-x64/README.md new file mode 100644 index 00000000..0b8fbda1 --- /dev/null +++ b/rust-plugins/magic-comments/npm/darwin-x64/README.md @@ -0,0 +1,3 @@ +# `farm-plugin-magic-string-darwin-x64` + +This is the **x86_64-apple-darwin** binary for `farm-plugin-magic-string` diff --git a/rust-plugins/magic-comments/npm/darwin-x64/package.json b/rust-plugins/magic-comments/npm/darwin-x64/package.json new file mode 100644 index 00000000..6d58fea4 --- /dev/null +++ b/rust-plugins/magic-comments/npm/darwin-x64/package.json @@ -0,0 +1,18 @@ +{ + "name": "farm-plugin-magic-string-darwin-x64", + "version": "0.0.0", + "os": [ + "darwin" + ], + "cpu": [ + "x64" + ], + "main": "index.farm", + "files": [ + "index.farm" + ], + "license": "MIT", + "engines": { + "node": ">= 10" + } +} diff --git a/rust-plugins/magic-comments/npm/linux-arm64-gnu/README.md b/rust-plugins/magic-comments/npm/linux-arm64-gnu/README.md new file mode 100644 index 00000000..ea7d50e7 --- /dev/null +++ b/rust-plugins/magic-comments/npm/linux-arm64-gnu/README.md @@ -0,0 +1,3 @@ +# `farm-plugin-magic-string-linux-arm64-gnu` + +This is the **aarch64-unknown-linux-gnu** binary for `farm-plugin-magic-string` diff --git a/rust-plugins/magic-comments/npm/linux-arm64-gnu/package.json b/rust-plugins/magic-comments/npm/linux-arm64-gnu/package.json new file mode 100644 index 00000000..3888fad1 --- /dev/null +++ b/rust-plugins/magic-comments/npm/linux-arm64-gnu/package.json @@ -0,0 +1,21 @@ +{ + "name": "farm-plugin-magic-string-linux-arm64-gnu", + "version": "0.0.0", + "os": [ + "linux" + ], + "cpu": [ + "arm64" + ], + "main": "index.farm", + "files": [ + "index.farm" + ], + "license": "MIT", + "engines": { + "node": ">= 10" + }, + "libc": [ + "glibc" + ] +} diff --git a/rust-plugins/magic-comments/npm/linux-arm64-musl/README.md b/rust-plugins/magic-comments/npm/linux-arm64-musl/README.md new file mode 100644 index 00000000..f85e95f8 --- /dev/null +++ b/rust-plugins/magic-comments/npm/linux-arm64-musl/README.md @@ -0,0 +1,3 @@ +# `farm-plugin-magic-string-linux-arm64-musl` + +This is the **aarch64-unknown-linux-musl** binary for `farm-plugin-magic-string` diff --git a/rust-plugins/magic-comments/npm/linux-arm64-musl/package.json b/rust-plugins/magic-comments/npm/linux-arm64-musl/package.json new file mode 100644 index 00000000..6bb75e4a --- /dev/null +++ b/rust-plugins/magic-comments/npm/linux-arm64-musl/package.json @@ -0,0 +1,21 @@ +{ + "name": "farm-plugin-magic-string-linux-arm64-musl", + "version": "0.0.0", + "os": [ + "linux" + ], + "cpu": [ + "arm64" + ], + "main": "index.farm", + "files": [ + "index.farm" + ], + "license": "MIT", + "engines": { + "node": ">= 10" + }, + "libc": [ + "glibc" + ] +} diff --git a/rust-plugins/magic-comments/npm/linux-x64-gnu/README.md b/rust-plugins/magic-comments/npm/linux-x64-gnu/README.md new file mode 100644 index 00000000..3407312d --- /dev/null +++ b/rust-plugins/magic-comments/npm/linux-x64-gnu/README.md @@ -0,0 +1,3 @@ +# `farm-plugin-magic-string-linux-x64-gnu` + +This is the **x86_64-unknown-linux-gnu** binary for `farm-plugin-magic-string` diff --git a/rust-plugins/magic-comments/npm/linux-x64-gnu/package.json b/rust-plugins/magic-comments/npm/linux-x64-gnu/package.json new file mode 100644 index 00000000..b9725ad8 --- /dev/null +++ b/rust-plugins/magic-comments/npm/linux-x64-gnu/package.json @@ -0,0 +1,21 @@ +{ + "name": "farm-plugin-magic-string-linux-x64-gnu", + "version": "0.0.0", + "os": [ + "linux" + ], + "cpu": [ + "x64" + ], + "main": "index.farm", + "files": [ + "index.farm" + ], + "license": "MIT", + "engines": { + "node": ">= 10" + }, + "libc": [ + "glibc" + ] +} diff --git a/rust-plugins/magic-comments/npm/linux-x64-musl/README.md b/rust-plugins/magic-comments/npm/linux-x64-musl/README.md new file mode 100644 index 00000000..0350a187 --- /dev/null +++ b/rust-plugins/magic-comments/npm/linux-x64-musl/README.md @@ -0,0 +1,3 @@ +# `farm-plugin-magic-string-linux-x64-musl` + +This is the **x86_64-unknown-linux-musl** binary for `farm-plugin-magic-string` diff --git a/rust-plugins/magic-comments/npm/linux-x64-musl/package.json b/rust-plugins/magic-comments/npm/linux-x64-musl/package.json new file mode 100644 index 00000000..e87eb891 --- /dev/null +++ b/rust-plugins/magic-comments/npm/linux-x64-musl/package.json @@ -0,0 +1,18 @@ +{ + "name": "farm-plugin-magic-string-linux-x64-musl", + "version": "0.0.0", + "os": [ + "linux" + ], + "cpu": [ + "x64" + ], + "main": "index.farm", + "files": [ + "index.farm" + ], + "license": "MIT", + "engines": { + "node": ">= 10" + } +} diff --git a/rust-plugins/magic-comments/npm/win32-arm64-msvc/README.md b/rust-plugins/magic-comments/npm/win32-arm64-msvc/README.md new file mode 100644 index 00000000..fb586fd8 --- /dev/null +++ b/rust-plugins/magic-comments/npm/win32-arm64-msvc/README.md @@ -0,0 +1,3 @@ +# `farm-plugin-magic-string-win32-arm64-msvc` + +This is the aarch64-pc-windows-msvc binary for `farm-plugin-magic-string` diff --git a/rust-plugins/magic-comments/npm/win32-arm64-msvc/package.json b/rust-plugins/magic-comments/npm/win32-arm64-msvc/package.json new file mode 100644 index 00000000..b6c0d615 --- /dev/null +++ b/rust-plugins/magic-comments/npm/win32-arm64-msvc/package.json @@ -0,0 +1,18 @@ +{ + "name": "farm-plugin-magic-string-win32-arm64-msvc", + "version": "0.0.0", + "os": [ + "win32" + ], + "cpu": [ + "arm64" + ], + "main": "index.farm", + "files": [ + "index.farm" + ], + "license": "MIT", + "engines": { + "node": ">= 10" + } +} diff --git a/rust-plugins/magic-comments/npm/win32-ia32-msvc/README.md b/rust-plugins/magic-comments/npm/win32-ia32-msvc/README.md new file mode 100644 index 00000000..f4caa187 --- /dev/null +++ b/rust-plugins/magic-comments/npm/win32-ia32-msvc/README.md @@ -0,0 +1,3 @@ +# `farm-plugin-magic-string-win32-ia32-msvc` + +This is the i686-pc-windows-msvc binary for `farm-plugin-magic-string` diff --git a/rust-plugins/magic-comments/npm/win32-ia32-msvc/package.json b/rust-plugins/magic-comments/npm/win32-ia32-msvc/package.json new file mode 100644 index 00000000..974daa1a --- /dev/null +++ b/rust-plugins/magic-comments/npm/win32-ia32-msvc/package.json @@ -0,0 +1,18 @@ +{ + "name": "farm-plugin-magic-string-win32-ia32-msvc", + "version": "0.0.0", + "os": [ + "win32" + ], + "cpu": [ + "ia32" + ], + "main": "index.farm", + "files": [ + "index.farm" + ], + "license": "MIT", + "engines": { + "node": ">= 10" + } +} diff --git a/rust-plugins/magic-comments/npm/win32-x64-msvc/README.md b/rust-plugins/magic-comments/npm/win32-x64-msvc/README.md new file mode 100644 index 00000000..9bdf3473 --- /dev/null +++ b/rust-plugins/magic-comments/npm/win32-x64-msvc/README.md @@ -0,0 +1,3 @@ +# `farm-plugin-magic-string-win32-x64-msvc` + +This is the **x86_64-pc-windows-msvc** binary for `farm-plugin-magic-string` diff --git a/rust-plugins/magic-comments/npm/win32-x64-msvc/package.json b/rust-plugins/magic-comments/npm/win32-x64-msvc/package.json new file mode 100644 index 00000000..ff4769a2 --- /dev/null +++ b/rust-plugins/magic-comments/npm/win32-x64-msvc/package.json @@ -0,0 +1,18 @@ +{ + "name": "farm-plugin-magic-string-win32-x64-msvc", + "version": "0.0.0", + "os": [ + "win32" + ], + "cpu": [ + "x64" + ], + "main": "index.farm", + "files": [ + "index.farm" + ], + "license": "MIT", + "engines": { + "node": ">= 10" + } +} diff --git a/rust-plugins/magic-comments/options.d.ts b/rust-plugins/magic-comments/options.d.ts new file mode 100644 index 00000000..876eb235 --- /dev/null +++ b/rust-plugins/magic-comments/options.d.ts @@ -0,0 +1,3 @@ +export interface IPluginOptions { + +} diff --git a/rust-plugins/magic-comments/package.json b/rust-plugins/magic-comments/package.json new file mode 100644 index 00000000..0012977e --- /dev/null +++ b/rust-plugins/magic-comments/package.json @@ -0,0 +1,43 @@ +{ + "name": "farm-plugin-magic-string", + "version": "0.0.0", + "main": "scripts/index.js", + "types": "scripts/index.d.ts", + "type": "module", + "license": "MIT", + "devDependencies": { + "@farmfe/plugin-tools": "latest" + }, + "napi": { + "name": "farm_plugin_magic_string", + "triples": { + "additional": [ + "aarch64-apple-darwin", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "x86_64-unknown-linux-musl", + "i686-pc-windows-msvc", + "aarch64-pc-windows-msvc" + ] + } + }, + "exports": { + ".": { + "import": "./scripts/func.js", + "types": "./scripts/index.d.ts", + "default": "./scripts/index.js" + }, + "./package.json": "./package.json" + }, + "scripts": { + "dev": "cargo watch -w src -s 'scripts/watch.sh'", + "bump": "npx changeset version", + "play": "pnpm --filter playground dev", + "build": "farm-plugin-tools build --platform --cargo-name farm_plugin_magic_string -p farm_plugin_magic_string --release", + "prepublishOnly": "farm-plugin-tools prepublish" + }, + "files": [ + "scripts", + "options.d.ts" + ] +} diff --git a/rust-plugins/magic-comments/playground/README.md b/rust-plugins/magic-comments/playground/README.md new file mode 100644 index 00000000..5802e857 --- /dev/null +++ b/rust-plugins/magic-comments/playground/README.md @@ -0,0 +1,37 @@ +# Farm + React + +This template should help you start developing using React and TypeScript in Farm. + +## Setup + +Install the dependencies: + +```bash +pnpm install +``` + +## Get Started + +Start the dev server: + +```bash +pnpm start +``` + +Build the app for production: + +```bash +pnpm build +``` + +Preview the Production build product: + +```bash +pnpm preview +``` + +Clear persistent cache local files + +```bash +pnpm clean +``` diff --git a/rust-plugins/magic-comments/playground/farm.config.ts b/rust-plugins/magic-comments/playground/farm.config.ts new file mode 100644 index 00000000..64224113 --- /dev/null +++ b/rust-plugins/magic-comments/playground/farm.config.ts @@ -0,0 +1,18 @@ +import { defineConfig } from "@farmfe/core"; +import react from '@farmfe/plugin-react'; +import farmPlugin from 'farm-plugin-magic-string'; +// console.log(__dirname); + +export default defineConfig({ + compilation: { + persistentCache: false, + progress: false, + runtime: { + isolate: true + } + }, + plugins: [ + react(), + farmPlugin() + ], +}); diff --git a/rust-plugins/magic-comments/playground/index.html b/rust-plugins/magic-comments/playground/index.html new file mode 100644 index 00000000..9d432285 --- /dev/null +++ b/rust-plugins/magic-comments/playground/index.html @@ -0,0 +1,14 @@ + + +
+ + + + +This is the About Page.
+Get in touch with us!
+Welcome to the Home Page!
+bna4S`8(?#dO7yno!F@ExlD
z)5RI8T3>@Dp_BCoyDNX8fq3zGs4D2T7oX)1k|}=_wHOS?_R59dqJuQVNtr;QP`pW@
zc(l_ae_w5glWE{c3iyD2bo_|o246P5;jXj)i~H_&JhK_L(sWbgo_ce7F{Pz|&-@`_
zzDb>^Kq{oT_dqLXm_e2(@zy03APgQ`g?$yJ=rucc#$XIEq-cDwOOU!I1$9_1v$L_9
z^v90w{S;nL3sU>Y|2^FzH5(7lkUB~5jvr;8aq@e7H%8bYRLR+)ACb}oXA#cwc+4j`
zE~Uk&B(DoBCSahjNxz`??2%MQK;K^+ZPjOdgv?Z7;s2n3VKPl=rci)kq#~r+#<>3>
z1{B+ngWy9N?;h|hhVZS|o8+!o>i(s8JvM*_8ff?}ijZYqz-fs64m?K6tyx{rQrXz91oBQ7e;!
zy7_7CN>u@4U(tly^GngznyZtlC%5^jWF-zx_RV@585&zP4J1chiweSv`eb|k%NR9i
zHqc~4p#L$&?0@uK^0oj-6_QkD1MV0OF%-C_FQ 9+Zc#9}u0
z=|=o`A%d%YEWoI=N)*fO+5Y>a;l@e{%NP5(LD-H4J=j)a%Niq$^myxsDBa)hr9?Ft
zrX+PNHello World
+
+ "#;
+
+ let tags = vec![Tag {
+ tag: "link".to_string(),
+ inject_to: "head".to_string(),
+ attrs: Attrs {
+ rel: "modulepreload".to_string(),
+ crossorigin: Some(true),
+ href: "/assets/main.js".to_string(),
+ },
+ }];
+
+ let result = inject_tags(html, tags).unwrap();
+ println!("result {:?}", result);
+ assert!(result.contains("modulepreload"));
+ assert!(result.contains("crossorigin"));
+ assert!(result.contains("/assets/main.js"));
+ }
+}
diff --git a/rust-plugins/magic-comments/src/lib.rs b/rust-plugins/magic-comments/src/lib.rs
new file mode 100644
index 00000000..e0dcd4d7
--- /dev/null
+++ b/rust-plugins/magic-comments/src/lib.rs
@@ -0,0 +1,279 @@
+#![deny(clippy::all)]
+
+mod html_modifier;
+
+pub use html_modifier::{inject_tags, Attrs, Tag};
+
+use farmfe_core::{
+ config::{config_regex::ConfigRegex, Config},
+ context::CompilationContext,
+ error::CompilationError,
+ module::{module_graph::ModuleGraph, ModuleId, ModuleMetaData},
+ plugin::{Plugin, PluginFinalizeResourcesHookParams, PluginProcessModuleHookParam},
+ resource::{Resource, ResourceOrigin, ResourceType},
+ swc_common::{
+ comments::{Comments, SingleThreadedComments},
+ Spanned,
+ },
+ swc_ecma_ast::{self, CallExpr, Callee, Expr, ExprOrSpread, Lit, Str},
+};
+use std::sync::{Arc, Mutex};
+
+use farmfe_macro_plugin::farm_plugin;
+use farmfe_toolkit::common::PathFilter;
+use farmfe_toolkit::swc_ecma_visit::{VisitMut, VisitMutWith};
+
+// 存储预加载模块的信息
+#[derive(Debug, Clone)]
+struct PreloadModule {
+ from_module_id: ModuleId,
+ source: String,
+ rel: String,
+}
+
+struct ImportVisitor<'a> {
+ dynamic_imports: Vec