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 @@ + + + + + + + + Farm + React + TS + + +
+ + + diff --git a/rust-plugins/magic-comments/playground/index.js b/rust-plugins/magic-comments/playground/index.js new file mode 100644 index 00000000..065718f5 --- /dev/null +++ b/rust-plugins/magic-comments/playground/index.js @@ -0,0 +1 @@ +console.log("lib") diff --git a/rust-plugins/magic-comments/playground/package.json b/rust-plugins/magic-comments/playground/package.json new file mode 100644 index 00000000..549b4040 --- /dev/null +++ b/rust-plugins/magic-comments/playground/package.json @@ -0,0 +1,28 @@ +{ + "name": "playground", + "version": "1.0.0", + "type": "module", + "scripts": { + "dev": "farm start", + "start": "farm start", + "build": "farm build", + "preview": "farm preview", + "clean": "farm clean" + }, + "dependencies": { + "clsx": "^1.2.1", + "farm-plugin-magic-string": "workspace:*", + "react": "18", + "react-dom": "18", + "react-router-dom": "^6.4.0" + }, + "devDependencies": { + "@farmfe/cli": "/Users/adny/rust/farm/packages/cli", + "@farmfe/core": "/Users/adny/rust/farm/packages/core", + "@farmfe/plugin-react": "/Users/adny/rust/farm/rust-plugins/react", + "@types/react": "18", + "@types/react-dom": "18", + "core-js": "^3.36.1", + "react-refresh": "^0.14.0" + } +} diff --git a/rust-plugins/magic-comments/playground/public/favicon.ico b/rust-plugins/magic-comments/playground/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..80465dedc03cfd08b0e3b118db6e765f65e3adc3 GIT binary patch literal 4154 zcmb`~duWw)9LMqBoO)WB8>rdNSy794a8L80HKCYy;X53Ll~aB<(pZM`qE!25qV^T{4`B6-myS?o2hN82+<+U< zgU>Js#Y@ls0rgpHaWfVd>OhcuLiH?%JvX{-jp-L?TuqIfpde{Z+6RpMT(1M2a zNgW#BR8$vQhXMP8dvl>UUXQDxF|NSvPbf6_&zLFD zH5>=EtG%cFqj(pZ5A8>dbr{yJ+S~!fc|+tT()+LzipxT%okH!;)YStw?b>8VB6{p_in}7AeAdaJ^{r}^?eMB-Gk({ zrayu9w#~ow!{$co^?m3pP+TWG|G2Mpr`Uyk4031DEWT^Zs#|q!fzAf4HC z@HD383zV1%YP(h6O6-MVF$0><`LHpo%n?h&yyCS6;aV%P*?jSIU3mWM_tJK}3hkK- z(TTZGyGg9VBE;t=>{Gt7qs&mJ>d|=ip#xfr=c5gZ$yw07U$FsIX?|Ok>qC96J=cd; z@;YC2-m6XRg(lYaG*Z2nG~YT0)YowAdafLws6MUp<@g2%pfgBwk;0cy``Y{OLgf^v zvdn?TV0Do;U>(}g2+jRrsC}dJR{Q2sg!{9Maj?GBP`Bpc6{z<{_vLJy;6Olit;eS4G)6KtfV<)|&@?~GFW7k{s0_}^bcdli`x%y$}s)w9QNY*W`%sMACqBL=U`#(}{kZI}9O!ob|625;;!v7E?e72>_ YXKTD4qPpQwz4tCb{gqHVI7FV$f0MB}F8}}l literal 0 HcmV?d00001 diff --git a/rust-plugins/magic-comments/playground/src/About.tsx b/rust-plugins/magic-comments/playground/src/About.tsx new file mode 100644 index 00000000..8ba88f65 --- /dev/null +++ b/rust-plugins/magic-comments/playground/src/About.tsx @@ -0,0 +1,11 @@ +import React from 'react'; +function About() { + return ( +
+

About Page

+

This is the About Page.

+
+ ); +} + +export default About; diff --git a/rust-plugins/magic-comments/playground/src/Contact.tsx b/rust-plugins/magic-comments/playground/src/Contact.tsx new file mode 100644 index 00000000..8e42d3b5 --- /dev/null +++ b/rust-plugins/magic-comments/playground/src/Contact.tsx @@ -0,0 +1,12 @@ +import React from 'react'; + +function Contact() { + return ( +
+

Contact Page

+

Get in touch with us!

+
+ ); +} + +export default Contact; diff --git a/rust-plugins/magic-comments/playground/src/Home.tsx b/rust-plugins/magic-comments/playground/src/Home.tsx new file mode 100644 index 00000000..5b3f5a52 --- /dev/null +++ b/rust-plugins/magic-comments/playground/src/Home.tsx @@ -0,0 +1,12 @@ +import React from 'react'; + +function Home() { + return ( +
+

Home Page

+

Welcome to the Home Page!

+
+ ); +} + +export default Home; diff --git a/rust-plugins/magic-comments/playground/src/assets/logo.png b/rust-plugins/magic-comments/playground/src/assets/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..0caeb4381267cff0c3adf3020077c55bac612a20 GIT binary patch literal 16859 zcmXwBWmFtZ(`Avx3GS}JT>`-^IKkcB-DL^BXmE!RoZuGRLvVKu?(X_6&wIWf91d(x zb@gmbch$YOCQ?~Z8Wo8U2?`1dRpyI?3KSH81oDHA0EGO4z1=x3Tj;_n3fpCwAyh=i!LHY@WbqFI%s5*P^3b=Q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<^yeDWrUVXKq2RaoF6kkPFCc9?O7td*^*~lWkzF#VIDqmvyCS+*|m$Lt-ZZ# zg}cg%!oU{Tt9vI}q2es(a*7n(Y^3oi{ojo7JO(v#4s&+ChQ*MU)+dSM-?ByzMHxHF z9f_t?vRJI| z4u{8FBF+p~)po~Y7y|15PZ{UOCFx&eaz=pFeSCazrr^7L*8E5z{NFc+>XOF&xM_@P zQdcT(_sG{_i3lHTq)MFTAhB?s28g7uiq&f$!nC-zErr;vaB z#CUHKF5I{O+%4xr(S2z^~yXR z5}>sMdKAFHu5>zy>sQDF4GG~8yV-+g)7z}yz7=EKb5;6<2OC1_<6kPJZ4h0Jd`)dt zyhJHJ%e`RthA)iRD(4UXrB3~>Y4jI1NH5@!Qp`4*3-YO2IAVUyh#P*y9m7@pDSO4j z2iX{FUQV@NxNKf#rTB$Ulm7BvpysDnNcr>#E^?!cx}3>Z#nyl2ZL9(z1W~2me-v5x z@FUzSnH!+=*}9$IgJm~mhVQ(^zHl@tq(WBERoh}0=p}4Qm9^(Wy=zc zo1Kw46$76{Of`_83=g#lB~_`J`fn`$U_B(qw0EwaSGL=ftuRB!0P1_VrbQOsdiFoa zI|BUQ-wOaZ|ER@uJa)_U``W+Vt17A4Wf=mpE=NBSSIwq1R^;Wtq|FAw@3eIjAWJ#!;F|Jaf!Mdc zFB%I8k`OEr{-HgFX=%0O5DnmFj-DPNK{JAU$`7MhQ3Q+%N&}{dBn&;(Pf7CGUNgGu_lj z6gI%;KFGTVgh#{1BsrDgA)T+K!7_8=Gbs0w5Q703sM%2#d1&uZ2%q>XyoBH!3u5q@ ji-;d@RD^`>{4E>P*d_6jJR9=11}GUxMTtr=qi_EQr81c) literal 0 HcmV?d00001 diff --git a/rust-plugins/magic-comments/playground/src/assets/react.svg b/rust-plugins/magic-comments/playground/src/assets/react.svg new file mode 100644 index 00000000..6c87de9b --- /dev/null +++ b/rust-plugins/magic-comments/playground/src/assets/react.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/rust-plugins/magic-comments/playground/src/index.css b/rust-plugins/magic-comments/playground/src/index.css new file mode 100644 index 00000000..6cc4daf9 --- /dev/null +++ b/rust-plugins/magic-comments/playground/src/index.css @@ -0,0 +1,69 @@ +:root { + font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif; + line-height: 1.5; + font-weight: 400; + + color-scheme: light dark; + color: rgba(255, 255, 255, 0.87); + background-color: #242424; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-text-size-adjust: 100%; +} + +a { + font-weight: 500; + color: #9f1a8f; + text-decoration: inherit; +} +a:hover { + color: #9f1a8f; +} + +body { + margin: 0; + display: flex; + place-items: center; + min-width: 320px; + min-height: 100vh; +} + +h1 { + font-size: 3.2em; + line-height: 1.1; +} + +button { + border-radius: 8px; + border: 1px solid transparent; + padding: 0.6em 1.2em; + font-size: 1em; + font-weight: 500; + font-family: inherit; + background-color: #1a1a1a; + cursor: pointer; + transition: border-color 0.25s; +} +button:hover { + border-color: #9f1a8f; +} +button:focus, +button:focus-visible { + outline: 4px auto -webkit-focus-ring-color; +} + +@media (prefers-color-scheme: light) { + :root { + color: #213547; + background-color: #ffffff; + } + a:hover { + color: #9F1A8F; + } + button { + background-color: #f9f9f9; + } +} diff --git a/rust-plugins/magic-comments/playground/src/index.tsx b/rust-plugins/magic-comments/playground/src/index.tsx new file mode 100644 index 00000000..2640f5d8 --- /dev/null +++ b/rust-plugins/magic-comments/playground/src/index.tsx @@ -0,0 +1,10 @@ +import React from 'react'; +import { createRoot } from 'react-dom/client'; +import App from './main'; +import './index.css' + + +const container = document.querySelector('#root'); +const root = createRoot(container); + +root.render(); diff --git a/rust-plugins/magic-comments/playground/src/main.css b/rust-plugins/magic-comments/playground/src/main.css new file mode 100644 index 00000000..ff29d412 --- /dev/null +++ b/rust-plugins/magic-comments/playground/src/main.css @@ -0,0 +1,42 @@ +#root { + max-width: 1280px; + margin: 0 auto; + padding: 2rem; + text-align: center; +} + +.logo { + height: 6em; + padding: 1.5em; + will-change: filter; + transition: filter 300ms; +} +.logo:hover { + filter: drop-shadow(0 0 2em #9F1A8Faa); +} +.logo.react:hover { + filter: drop-shadow(0 0 2em #61dafbaa); +} + +@keyframes logo-spin { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} + +@media (prefers-reduced-motion: no-preference) { + a:nth-of-type(2) .logo { + animation: logo-spin infinite 20s linear; + } +} + +.card { + padding: 2em; +} + +.read-the-docs { + color: #888; +} diff --git a/rust-plugins/magic-comments/playground/src/main.tsx b/rust-plugins/magic-comments/playground/src/main.tsx new file mode 100644 index 00000000..8382a082 --- /dev/null +++ b/rust-plugins/magic-comments/playground/src/main.tsx @@ -0,0 +1,36 @@ +import React, { Suspense, lazy } from 'react'; +import { BrowserRouter, Routes, Route, Link } from 'react-router-dom'; + +// 懒加载组件 +const Home = lazy(() => import(/* preload: true */ './Home')); +const About = lazy(() => import(/* prefetch: true */ './About')); +const Contact = lazy(() => import(/* prefetch: true */ './Contact')); + +// 加载状态组件 +const Loading = () =>
Loading...
; + +function App() { + return ( + +
+ + + }> + + } /> + } /> + } /> + + +
+
+ ); +} + +export default App; diff --git a/rust-plugins/magic-comments/playground/src/typings.d.ts b/rust-plugins/magic-comments/playground/src/typings.d.ts new file mode 100644 index 00000000..fa0a2da5 --- /dev/null +++ b/rust-plugins/magic-comments/playground/src/typings.d.ts @@ -0,0 +1,3 @@ +declare module '*.svg'; +declare module '*.png'; +declare module '*.css'; diff --git a/rust-plugins/magic-comments/playground/tsconfig.json b/rust-plugins/magic-comments/playground/tsconfig.json new file mode 100644 index 00000000..7a7611e4 --- /dev/null +++ b/rust-plugins/magic-comments/playground/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src"], + "references": [{ "path": "./tsconfig.node.json" }] +} \ No newline at end of file diff --git a/rust-plugins/magic-comments/playground/tsconfig.node.json b/rust-plugins/magic-comments/playground/tsconfig.node.json new file mode 100644 index 00000000..8d423251 --- /dev/null +++ b/rust-plugins/magic-comments/playground/tsconfig.node.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "composite": true, + "skipLibCheck": true, + "module": "ESNext", + "moduleResolution": "bundler", + "allowSyntheticDefaultImports": true, + "strict": true + }, + "include": ["farm.config.ts"] +} diff --git a/rust-plugins/magic-comments/rust-toolchain.toml b/rust-plugins/magic-comments/rust-toolchain.toml new file mode 100644 index 00000000..0eb96b51 --- /dev/null +++ b/rust-plugins/magic-comments/rust-toolchain.toml @@ -0,0 +1,3 @@ +[toolchain] +channel = "nightly-2024-04-16" +components = ["clippy", "rustfmt", "rust-src", "rustc-dev"] diff --git a/rust-plugins/magic-comments/rustfmt.toml b/rust-plugins/magic-comments/rustfmt.toml new file mode 100644 index 00000000..cab5731e --- /dev/null +++ b/rust-plugins/magic-comments/rustfmt.toml @@ -0,0 +1,2 @@ +tab_spaces = 2 +edition = "2021" diff --git a/rust-plugins/magic-comments/scripts/func.js b/rust-plugins/magic-comments/scripts/func.js new file mode 100644 index 00000000..ebd41be5 --- /dev/null +++ b/rust-plugins/magic-comments/scripts/func.js @@ -0,0 +1,3 @@ +import binPath from "./index.js"; + +export default (options)=>[binPath,options]; diff --git a/rust-plugins/magic-comments/scripts/index.d.ts b/rust-plugins/magic-comments/scripts/index.d.ts new file mode 100644 index 00000000..ae1464ea --- /dev/null +++ b/rust-plugins/magic-comments/scripts/index.d.ts @@ -0,0 +1,3 @@ +import type { IPluginOptions } from '../options.d'; +declare const binPath: (options?: IPluginOptions) => [string, IPluginOptions]; +export default binPath; diff --git a/rust-plugins/magic-comments/scripts/index.js b/rust-plugins/magic-comments/scripts/index.js new file mode 100644 index 00000000..8c16e894 --- /dev/null +++ b/rust-plugins/magic-comments/scripts/index.js @@ -0,0 +1,124 @@ +import { existsSync, readFileSync } from 'fs'; +import { createRequire } from 'module'; +import { dirname, join } from 'path'; +import { fileURLToPath } from 'url'; + +const { platform, arch } = process; +const currentDir = dirname(fileURLToPath(import.meta.url)); + +let binPath = null; + +const require = createRequire(import.meta.url); + +function isMusl() { + // For Node 10 + if (!process.report || typeof process.report.getReport !== 'function') { + try { + return readFileSync('/usr/bin/ldd', 'utf8').includes('musl'); + } catch (e) { + return true; + } + } else { + const { glibcVersionRuntime } = process.report.getReport().header; + return !glibcVersionRuntime; + } +} + +switch (platform) { + case 'win32': + switch (arch) { + case 'x64': + if (existsSync(join(currentDir, '../npm/win32-x64-msvc/index.farm'))) { + binPath = join(currentDir, '../npm/win32-x64-msvc/index.farm'); + } else { + binPath = require.resolve('farm-plugin-magic-string-win32-x64-msvc'); + } + + break; + case 'ia32': + if (existsSync(join(currentDir, '../npm/win32-ia32-msvc/index.farm'))) { + binPath = join(currentDir, '../npm/win32-ia32-msvc/index.farm'); + } else { + binPath = require.resolve('farm-plugin-magic-string-win32-ia32-msvc'); + } + + break; + case 'arm64': + if (existsSync(join(currentDir, '../npm/win32-arm64-msvc/index.farm'))) { + binPath = join(currentDir, '../npm/win32-arm64-msvc/index.farm'); + } else { + binPath = require.resolve('farm-plugin-magic-string-win32-arm64-msvc'); + } + + break; + default: + throw new Error(`Unsupported architecture on Windows: ${arch}`); + } + break; + case 'darwin': + switch (arch) { + case 'x64': + if (existsSync(join(currentDir, '../npm/darwin-x64/index.farm'))) { + binPath = join(currentDir, '../npm/darwin-x64/index.farm'); + } else { + binPath = require.resolve('farm-plugin-magic-string-darwin-x64'); + } + break; + case 'arm64': + if (existsSync(join(currentDir, '../npm/darwin-arm64/index.farm'))) { + binPath = join(currentDir, '../npm/darwin-arm64/index.farm'); + } else { + binPath = require.resolve('farm-plugin-magic-string-darwin-arm64'); + } + break; + default: + throw new Error(`Unsupported architecture on macOS: ${arch}`); + } + break; + case 'linux': + switch (arch) { + case 'x64': + if (isMusl()) { + if (existsSync(join(currentDir, '../npm/linux-x64-musl/index.farm'))) { + binPath = join(currentDir, '../npm/linux-x64-musl/index.farm'); + } else { + binPath = require.resolve('farm-plugin-magic-string-linux-x64-musl'); + } + } else { + if (existsSync(join(currentDir, '../npm/linux-x64-gnu/index.farm'))) { + binPath = join(currentDir, '../npm/linux-x64-gnu/index.farm'); + } else { + binPath = require.resolve('farm-plugin-magic-string-linux-x64-gnu'); + } + } + + break; + + case 'arm64': + if (isMusl()) { + if ( + existsSync(join(currentDir, '../npm/linux-arm64-musl/index.farm')) + ) { + binPath = join(currentDir, '../npm/linux-arm64-musl/index.farm'); + } else { + binPath = require.resolve('farm-plugin-magic-string-linux-arm64-musl'); + } + } else { + if ( + existsSync(join(currentDir, '../npm/linux-arm64-gnu/index.farm')) + ) { + binPath = join(currentDir, '../npm/linux-arm64-gnu/index.farm'); + } else { + binPath = require.resolve('farm-plugin-magic-string-linux-arm64-gnu'); + } + } + break; + default: + throw new Error(`Unsupported architecture on Linux: ${arch}`); + } + break; + default: + throw new Error(`Unsupported OS: ${platform}, architecture: ${arch}`); +} + +export default binPath; diff --git a/rust-plugins/magic-comments/scripts/watch.sh b/rust-plugins/magic-comments/scripts/watch.sh new file mode 100755 index 00000000..255a484a --- /dev/null +++ b/rust-plugins/magic-comments/scripts/watch.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +npm run build diff --git a/rust-plugins/magic-comments/src/html_modifier.rs b/rust-plugins/magic-comments/src/html_modifier.rs new file mode 100644 index 00000000..3b1bb153 --- /dev/null +++ b/rust-plugins/magic-comments/src/html_modifier.rs @@ -0,0 +1,86 @@ +use lol_html::{element, html_content::ContentType, HtmlRewriter, Settings}; +use serde::{Deserialize, Serialize}; +use std::error::Error; + +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] +pub struct Attrs { + pub rel: String, + pub crossorigin: Option, + pub href: String, +} + +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] +pub struct Tag { + pub tag: String, + pub inject_to: String, + pub attrs: Attrs, +} + +pub fn inject_tags(html: &str, tags: Vec) -> Result> { + let mut output = Vec::new(); + let tags = &tags; + + let mut rewriter = HtmlRewriter::new( + Settings { + element_content_handlers: vec![element!("head, body", move |el| { + let binding = el.tag_name(); + let element_name = binding.as_str(); + for tag in tags { + if tag.inject_to == element_name { + let mut attrs_html = format!("rel=\"{}\" ", tag.attrs.rel); + + if let Some(true) = tag.attrs.crossorigin { + attrs_html.push_str("crossorigin "); + } + + attrs_html.push_str(&format!("href=\"{}\"", tag.attrs.href)); + + el.append(&format!("<{} {}>", tag.tag, attrs_html), ContentType::Html); + } + } + Ok(()) + })], + ..Settings::default() + }, + |c: &[u8]| output.extend_from_slice(c), + ); + + rewriter.write(html.as_bytes())?; + rewriter.end()?; + + Ok(String::from_utf8(output)?) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_inject_tags() { + let html = r#" + + + Test + + +

Hello 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, + crossorigin: Option, + comments: &'a SingleThreadedComments, + module_id: ModuleId, +} + +impl<'a> ImportVisitor<'a> { + fn new( + crossorigin: Option, + comments: &'a SingleThreadedComments, + module_id: ModuleId, + ) -> Self { + Self { + dynamic_imports: Vec::new(), + crossorigin, + comments, + module_id, + } + } + + fn handle_import_args( + dynamic_imports: &mut Vec, + args: &[ExprOrSpread], + from_module_id: &ModuleId, + comments: &SingleThreadedComments, + ) { + if let Some(arg) = args.first() { + if let Some(comments) = comments.get_leading(arg.span_lo()) { + if let Expr::Lit(Lit::Str(str_lit)) = &*arg.expr { + let import_path = str_lit.value.to_string(); + for comment in comments { + let comment_text = comment.text.trim(); + + if comment_text.contains("prefetch: true") || comment_text.contains("preload: true") { + dynamic_imports.push(PreloadModule { + from_module_id: from_module_id.clone(), + source: import_path.clone(), + rel: "prefetch".to_string(), + }); + } + } + } + } + } + } + + fn check_import_call( + dynamic_imports: &mut Vec, + call: &CallExpr, + from_module_id: &ModuleId, + comments: &SingleThreadedComments, + ) { + match &call.callee { + Callee::Import(_) => { + Self::handle_import_args(dynamic_imports, &call.args, from_module_id, comments); + } + Callee::Expr(expr) => { + if let Expr::Arrow(arrow) = &**expr { + if let swc_ecma_ast::BlockStmtOrExpr::Expr(expr) = &*arrow.body { + if let Expr::Call(inner_call) = &**expr { + if let Callee::Import(_) = &inner_call.callee { + Self::handle_import_args( + dynamic_imports, + &inner_call.args, + from_module_id, + comments, + ); + } + } + } + } + } + _ => {} + } + } +} + +impl<'a> VisitMut for ImportVisitor<'a> { + fn visit_mut_call_expr(&mut self, call: &mut CallExpr) { + if let Some(comments) = self.comments.get_leading(call.span_lo()) { + if comments + .iter() + .any(|comment| farmfe_utils::is_skip_action_by_comment(comment.text.as_str())) + { + return; + } + } + + Self::check_import_call( + &mut self.dynamic_imports, + &call, + &self.module_id, + self.comments, + ); + call.visit_mut_children_with(self); + } +} + +#[farm_plugin] +pub struct FarmPluginMagicString { + options: MagicStringOptions, + preload_modules: Arc>>, +} + +#[derive(serde::Deserialize)] +pub struct MagicStringOptions { + exclude: Vec, + include: Vec, + crossorigin: Option, +} + +impl Default for MagicStringOptions { + fn default() -> Self { + Self { + exclude: vec![ConfigRegex::new("node_modules/")], + include: vec![ConfigRegex::new(".(js|ts|jsx|tsx)$")], + crossorigin: Some(true), + } + } +} + +impl FarmPluginMagicString { + fn new(_: &Config, options: String) -> Self { + let options: MagicStringOptions = serde_json::from_str(&options).unwrap_or_default(); + Self { + options, + preload_modules: Arc::new(Mutex::new(Vec::new())), + } + } +} + +impl Plugin for FarmPluginMagicString { + fn name(&self) -> &str { + "FarmPluginMagicString" + } + + fn process_module( + &self, + param: &mut PluginProcessModuleHookParam, + _context: &Arc, + ) -> Result, CompilationError> { + let filter = PathFilter::new(&self.options.include, &self.options.exclude); + if !filter.execute(param.module_id.relative_path()) { + return Ok(None); + } + + if !matches!(param.meta, ModuleMetaData::Script(_)) { + return Ok(None); + } + + let script = param.meta.as_script_mut(); + let comments: SingleThreadedComments = script.take_comments().into(); + let ast = &mut script.ast; + let mut visitor = + ImportVisitor::new(self.options.crossorigin, &comments, param.module_id.clone()); + ast.visit_mut_with(&mut visitor); + + if !visitor.dynamic_imports.is_empty() { + if let Ok(mut modules) = self.preload_modules.lock() { + modules.extend(visitor.dynamic_imports); + } + } + + Ok(Some(())) + } + + fn finalize_resources( + &self, + params: &mut PluginFinalizeResourcesHookParams, + context: &Arc, + ) -> farmfe_core::error::Result> { + let dynamic_imports = self.preload_modules.lock().unwrap(); + let mut tags = Vec::new(); + // let mut preload_urls = Vec::new(); + + // 获取 module_graph 的读锁 + let module_graph = context.module_graph.read(); + let module_group_graph = context.module_group_graph.read(); + let resource_pot_map = context.resource_pot_map.read(); + // 处理每个动态导入 + for preload_module in dynamic_imports.iter() { + // 使用 get_dep_by_source 获取依赖模块 + if let Some(dep_module_id) = module_graph.get_dep_by_source_optional( + &preload_module.from_module_id, // 使用存储的源模块ID + &preload_module.source, + None, + ) { + // println!( + // "preload_module: {:?}", + // preload_module.from_module_id.relative_path() + // ); + // println!("Found dep module: {}", dep_module_id.relative_path()); + // 在 resources_map 中查找对应的资源 + if let Some(module) = module_graph.module(&dep_module_id) { + // 遍历 group 中的所有资源 + if let Some(group) = module_group_graph.module_group(&module.id) { + // 获取排序后的 resource pots + let sorted_pots = group.sorted_resource_pots(&module_graph, &resource_pot_map); + + // 遍历每个 resource pot + for pot_id in sorted_pots { + if let Some(pot) = resource_pot_map.resource_pot(&pot_id) { + // 获取 pot 中的资源 + // for resource in pot.resources() { + // println!("Found resource in pot: {}", resource); + // } + for resource in pot.resources() { + // println!("Creating tag for resource: {}", resource); + // 创建 Tag 结构体 + let tag = Tag { + tag: "link".to_string(), + inject_to: "head".to_string(), + attrs: Attrs { + rel: preload_module.rel.clone(), + crossorigin: self.options.crossorigin, + href: format!("/{}", resource), + }, + }; + tags.push(tag); + } + } + } + } + } + } + } + + for (_, resource) in params.resources_map.iter_mut() { + if matches!(resource.resource_type, ResourceType::Html) { + let html_content = String::from_utf8_lossy(&resource.bytes); + let new_html = match inject_tags(&html_content, tags.clone()) { + Ok(html) => html, + Err(e) => return Err(CompilationError::GenericError(e.to_string())), + }; + // println!("new_html: {}", new_html); + resource.bytes = new_html.into_bytes(); + } + } + // for (url, rel) in preload_urls.iter() { + // println!("Adding {} tag for: {}", rel, url); + // } + + Ok(None) + } +}