diff --git a/.changeset/clever-wasps-battle.md b/.changeset/clever-wasps-battle.md new file mode 100644 index 0000000000..a3bd725c21 --- /dev/null +++ b/.changeset/clever-wasps-battle.md @@ -0,0 +1,5 @@ +--- +"@farmfe/core": major +--- + +export loadenv api diff --git a/.changeset/config.json b/.changeset/config.json index cee6df899d..d2b4e90311 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -5,7 +5,10 @@ "fixed": [], "linked": [], "access": "public", - "baseBranch": "main", + "baseBranch": "v2-dev", "updateInternalDependencies": "patch", - "ignore": [] + "ignore": ["@farmfe-examples/*", "farm-docs"], + "snapshot": { + "useCalculatedVersion": true + } } diff --git a/.changeset/dull-apes-raise.md b/.changeset/dull-apes-raise.md new file mode 100644 index 0000000000..cb82174434 --- /dev/null +++ b/.changeset/dull-apes-raise.md @@ -0,0 +1,5 @@ +--- +"@farmfe/plugin-dts": patch +--- + +feat: add farm dts generate rust plugin diff --git a/.changeset/sharp-pugs-lie.md b/.changeset/sharp-pugs-lie.md new file mode 100644 index 0000000000..14012966bd --- /dev/null +++ b/.changeset/sharp-pugs-lie.md @@ -0,0 +1,5 @@ +--- +"@farmfe/runtime-plugin-hmr": major +--- + +optimize runtime-hmr size diff --git a/.changeset/shiny-guests-deliver.md b/.changeset/shiny-guests-deliver.md new file mode 100644 index 0000000000..347ef30e4f --- /dev/null +++ b/.changeset/shiny-guests-deliver.md @@ -0,0 +1,5 @@ +--- +"@farmfe/core": major +--- + +build cjs script diff --git a/.changeset/ten-dolls-provide.md b/.changeset/ten-dolls-provide.md new file mode 100644 index 0000000000..7ee0cb18a7 --- /dev/null +++ b/.changeset/ten-dolls-provide.md @@ -0,0 +1,5 @@ +--- +"@farmfe/core": major +--- + +bump version diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 44e4cddb47..839ac60d96 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,6 +3,7 @@ on: pull_request: branches: - main + - v2-dev jobs: call-rust-build: @@ -50,6 +51,12 @@ jobs: name: ${{ github.sha }}-${{ matrix.settings.abi }}-plugin-react path: ./rust-plugins/react/npm/${{ matrix.settings.abi }} + - uses: actions/download-artifact@v4 + id: download-plugin-replace-dirname + with: + name: ${{ github.sha }}-${{ matrix.settings.abi }}-plugin-replace-dirname + path: ./rust-plugins/replace-dirname/npm/${{ matrix.settings.abi }} + - uses: actions/download-artifact@v4 id: download-create-farm-rust with: @@ -126,6 +133,11 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 18 + - uses: actions/download-artifact@v4 + id: download-plugin-replace-dirname + with: + name: ${{ github.sha }}-${{ matrix.settings.abi }}-plugin-replace-dirname + path: ./rust-plugins/replace-dirname/npm/${{ matrix.settings.abi }} - name: Install Dependencies run: npm install -g pnpm@9.1.0 && pnpm i --frozen-lockfile - name: Build CLI and Core @@ -189,6 +201,7 @@ jobs: settings: - name: plugin-sass - name: plugin-react + - name: plugin-replace-dirname steps: - uses: actions/download-artifact@v4 with: @@ -199,39 +212,3 @@ jobs: do test -f /tmp/artifacts/${{ github.sha }}-${abi}-${{ matrix.settings.name }}/index.farm done - - benchmarks: - needs: [call-rust-build] - runs-on: ${{ matrix.settings.os }} - strategy: - fail-fast: false - matrix: - settings: - - os: ubuntu-latest - abi: linux-x64-gnu - steps: - - uses: "actions/checkout@v3" - - uses: actions/setup-node@v3 - with: - node-version: 18 - - name: Install Dependencies - run: npm install -g pnpm@9.1.0 && pnpm i --frozen-lockfile - - name: Build CLI and Core - run: pnpm --filter @farmfe/cli run build - - uses: actions/download-artifact@v4 - id: download - with: - name: ${{ github.sha }}-${{ matrix.settings.abi }} - path: ./packages/core/binding - - name: Build Runtime - run: | - pnpm --filter "@farmfe/runtime" build - pnpm --filter "@farmfe/runtime-plugin-hmr" build - pnpm --filter "@farmfe/runtime-plugin-import-meta" build - - name: Build Core CJS - run: cd packages/core && pnpm run build:cjs - - name: Run benchmarks - uses: CodSpeedHQ/action@v3 - with: - run: npm exec vitest bench - token: ${{ secrets.CODSPEED_TOKEN }} diff --git a/.github/workflows/code-spell-check.yaml b/.github/workflows/code-spell-check.yaml index fa32f818fb..4f3991a4e1 100644 --- a/.github/workflows/code-spell-check.yaml +++ b/.github/workflows/code-spell-check.yaml @@ -10,7 +10,7 @@ jobs: - uses: actions/setup-node@v3 with: - node-version: '18' + node-version: "18" - name: Install pnpm run: npm install -g pnpm@9.1.0 - name: pnpm install diff --git a/.github/workflows/release-plz.yaml b/.github/workflows/release-plz.yaml index aba0b98601..f2383998b0 100644 --- a/.github/workflows/release-plz.yaml +++ b/.github/workflows/release-plz.yaml @@ -36,4 +36,4 @@ jobs: if: ${{ failure() }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} \ No newline at end of file + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 73e5fa9016..0302dea8cb 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -35,12 +35,14 @@ jobs: do mv /tmp/artifacts/${{ github.sha }}-${abi}/* ./packages/core/npm/${abi} mv /tmp/artifacts/${{ github.sha }}-${abi}-plugin-react/* ./rust-plugins/react/npm/${abi} + mv /tmp/artifacts/${{ github.sha }}-${abi}-plugin-replace-dirname/* ./rust-plugins/replace-dirname/npm/${abi} mv /tmp/artifacts/${{ github.sha }}-${abi}-plugin-sass/* ./rust-plugins/sass/npm/${abi} mv /tmp/artifacts/${{ github.sha }}-${abi}-create-farm/* ./packages/create-farm/npm/${abi} test -f ./packages/core/npm/${abi}/farm.${abi}.node test -f ./packages/create-farm/npm/${abi}/create-farm.${abi}.node test -f ./rust-plugins/react/npm/${abi}/index.farm + test -f ./rust-plugins/replace-dirname/npm/${abi}/index.farm test -f ./rust-plugins/sass/npm/${abi}/index.farm done for abi in android-arm-eabi linux-arm-gnueabihf android-arm64 freebsd-x64 @@ -58,8 +60,9 @@ jobs: id: changesets uses: changesets/action@v1 with: - version: pnpm bump - publish: pnpm release + version: ${{ github.ref_name == 'v2-dev' && 'pnpm run bump:nightly' || 'pnpm run bump' }} + publish: ${{ github.ref_name == 'v2-dev' && 'npm run release:nightly' || 'npm run release' }} + branch: ${{ github.ref_name == 'v2-dev' && 'v2-dev' || 'main' }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/rust-build.yaml b/.github/workflows/rust-build.yaml index 304d86e580..2a4d5c2851 100644 --- a/.github/workflows/rust-build.yaml +++ b/.github/workflows/rust-build.yaml @@ -21,6 +21,7 @@ jobs: cd ../create-farm && npm run build -- --target x86_64-unknown-linux-gnu && cd ../../rust-plugins/react && npm run build -- --target x86_64-unknown-linux-gnu --abi linux-x64-gnu && + cd ../replace-dirname && npm run build -- --target x86_64-unknown-linux-gnu --abi linux-x64-gnu && apt install -y protobuf-compiler && cd ../sass && npm run build -- --target x86_64-unknown-linux-gnu --abi linux-x64-gnu @@ -36,6 +37,7 @@ jobs: cd ../create-farm && npm run build -- --target x86_64-unknown-linux-musl && cd ../../rust-plugins/react && npm run build -- --target x86_64-unknown-linux-musl --abi linux-x64-musl && + cd ../replace-dirname && npm run build -- --target x86_64-unknown-linux-musl --abi linux-x64-musl && apk add protobuf && cd ../sass && npm run build -- --target x86_64-unknown-linux-musl --abi linux-x64-musl @@ -60,6 +62,7 @@ jobs: cd packages/core && npm run build:rs -- --target i686-pc-windows-msvc --cargo-flags="--no-default-features" cd ../create-farm && npm run build -- --target i686-pc-windows-msvc cd ../../rust-plugins/react && npm run build -- --target i686-pc-windows-msvc --abi win32-ia32-msvc + cd ../replace-dirname && npm run build -- --target i686-pc-windows-msvc --abi win32-ia32-msvc cd ../sass && npm run build -- --target i686-pc-windows-msvc --abi win32-ia32-msvc - os: windows-latest abi: win32-arm64-msvc @@ -71,6 +74,7 @@ jobs: cd packages/core && npm run build:rs -- --target aarch64-pc-windows-msvc --cargo-flags="--no-default-features" cd ../create-farm && npm run build -- --target aarch64-pc-windows-msvc cd ../../rust-plugins/react && npm run build -- --target aarch64-pc-windows-msvc --abi win32-arm64-msvc + cd ../replace-dirname && npm run build -- --target aarch64-pc-windows-msvc --abi win32-arm64-msvc cd ../sass && npm run build -- --target aarch64-pc-windows-msvc --abi win32-arm64-msvc # linux - os: ubuntu-latest @@ -117,7 +121,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: 18 - cache: 'pnpm' + cache: "pnpm" - name: Install Dependencies run: pnpm i --frozen-lockfile @@ -133,7 +137,7 @@ jobs: if: ${{ matrix.settings.osxcross }} # This builds executables & sets env variables for rust to consume. with: - osx-version: '12.3' + osx-version: "12.3" - uses: goto-bus-stop/setup-zig@v2 if: ${{ matrix.settings.zig }} with: @@ -151,6 +155,7 @@ jobs: cd packages/core && npm run build:rs:publish -- ${{ matrix.settings.target && format('--target {0}', matrix.settings.target) || '' }} ${{ matrix.settings.zig && '--zig' || '' }} && cd ../create-farm && npm run build -- ${{ matrix.settings.target && format('--target {0}', matrix.settings.target) || '' }} ${{ matrix.settings.zig && '--zig' || '' }} && cd ../../rust-plugins/react && npm run build -- ${{ matrix.settings.target && format('--target {0}', matrix.settings.target) || '' }} ${{ matrix.settings.zig && '--zig' || '' }} --abi ${{ matrix.settings.abi }} && + cd ../replace-dirname && npm run build -- ${{ matrix.settings.target && format('--target {0}', matrix.settings.target) || '' }} ${{ matrix.settings.zig && '--zig' || '' }} --abi ${{ matrix.settings.abi }} && cd ../sass && npm run build -- ${{ matrix.settings.target && format('--target {0}', matrix.settings.target) || '' }} ${{ matrix.settings.zig && '--zig' || '' }} --abi ${{ matrix.settings.abi }} shell: bash - name: Build @@ -177,6 +182,12 @@ jobs: with: name: ${{ github.sha }}-${{ matrix.settings.abi }}-plugin-react path: rust-plugins/react/npm/${{ matrix.settings.abi }}/index.farm + - name: Upload Plugin Replace Dirname + if: ${{ !matrix.settings.cli_only }} + uses: actions/upload-artifact@v4 + with: + name: ${{ github.sha }}-${{ matrix.settings.abi }}-plugin-replace-dirname + path: rust-plugins/replace-dirname/npm/${{ matrix.settings.abi }}/index.farm - name: Upload Plugin Sass if: ${{ !matrix.settings.cli_only }} uses: actions/upload-artifact@v4 @@ -221,7 +232,7 @@ jobs: freebsd-version echo "~~~~ Install dependencies ~~~~" - cd packages/create-farm && pnpm i --frozen-lockfile --ignore-scripts + cd packages/create-farm && pnpm i --no-frozen-lockfile --ignore-scripts echo "~~~~ Build ~~~~" pnpm build --target x86_64-unknown-freebsd echo "~~~~ ls -lah ~~~~" diff --git a/.github/workflows/rust-test.yaml b/.github/workflows/rust-test.yaml index 9afb2c882e..ae1e10f1de 100644 --- a/.github/workflows/rust-test.yaml +++ b/.github/workflows/rust-test.yaml @@ -3,6 +3,7 @@ on: pull_request: branches: - main + - v2-dev jobs: cargo-check: diff --git a/.gitignore b/.gitignore index 21b746af53..23e862fac4 100644 --- a/.gitignore +++ b/.gitignore @@ -110,3 +110,10 @@ build !crates/**/build .swc .DS_Store + + +# docs +.docusaurus + +# idea +.idea \ No newline at end of file diff --git a/.husky/pre-commit b/.husky/pre-commit old mode 100644 new mode 100755 diff --git a/.npmrc b/.npmrc index 0b6954a0e1..9f2a6cd4b9 100644 --- a/.npmrc +++ b/.npmrc @@ -2,3 +2,6 @@ registry = "https://registry.npmjs.org/" auto-install-peers = false electron-mirror="https://npmmirror.com/mirrors/electron/" link-workspace-packages=true +fetch-retries=0 +tag-version-prefix="" +git-tag-version=false diff --git a/.vscode/settings.json b/.vscode/settings.json index fc7d12d02e..738bd97087 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,12 +7,15 @@ "editor.defaultFormatter": "biomejs.biome" }, "[javascript]": { - "editor.defaultFormatter": "biomejs.biome" + "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[rust]": { "editor.defaultFormatter": "rust-lang.rust-analyzer" }, "[toml]": { "editor.defaultFormatter": "tamasfe.even-better-toml" + }, + "[yaml]": { + "editor.defaultFormatter": "esbenp.prettier-vscode" } } diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9883b3b661..1ae1786167 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -21,13 +21,9 @@ Please feel free to open an issue using the [feature request template](https://g ## Pull Request Guidelines - Please adhere to the code style that you see around the location you are working on. - - Setup Your Development Environment. - - Checkout a topic branch from a base branch, e.g. `main` . - - Run `cargo test` and make sure that it passes. - - If you've changed some packages And prepare for an updated version, you should output `npx changeset` in the root directory. we should try our best to keep releasing the `patch version`. If there are no major changes, please choose to update the `patch version`. - When you are done with your work, verify that it works locally with `pnpm run ready` @@ -46,7 +42,6 @@ Please feel free to open an issue using the [feature request template](https://g git branch --set-upstream-to=upstream/main main ``` - ## Development Environment Setup ### Dependencies @@ -57,7 +52,6 @@ Please feel free to open an issue using the [feature request template](https://g - [Pnpm](https://pnpm.io) **version 8+** - ### IDE We recommend that you use vscode for development and recommend two necessary plugins that you need to install @@ -112,6 +106,12 @@ We also need to test two parts, a set of `Rust` tests and a set of `Node` tests. cargo test ``` +If you want to update snapshot, you can use `INSTA_UPDATE=always cargo test` + +```sh +INSTA_UPDATE=always cargo test +``` + ### Node Testing - Input `pnpm test` in the root directory to run all test cases based on `vitest`. @@ -137,6 +137,5 @@ Farm is divided into two parts: the `JavaScript side` and the `Rust side`: - **the JavaScript side**: see code in the `packages` directory. contains core (dev server, file watcher, and compiler wrapper), CLI, runtime, and runtime plugins (module system, HMR). - - **the Rust side**: see code in the `crates` and `rust-plugins` directory. contains core (compilation context, plugin drivers, etc.), compiler (compile process, HMR update, etc.), and plugins. diff --git a/CONTRIBUTING.zh-CN.md b/CONTRIBUTING.zh-CN.md index 5c26c21403..56822e0887 100644 --- a/CONTRIBUTING.zh-CN.md +++ b/CONTRIBUTING.zh-CN.md @@ -17,11 +17,8 @@ ## 提交代码指南 - 编写代码的时候, 请遵循代码编写规范。 - - 设置您的本地开发环境。 - - 在您的本地从 `main` 分支切出一个新的功能特性分支。 - - 使用 `cargo test` 确保所有测试均能通过。 - 如果您已经更改了一些包并准备更新版本,则您应该在根目录中输出`npx changeset` 用来发布新版本并且提交。 我们应该尽量保持发布 `patch` 版本, 如果没有重大更改的情况下,请选择 更新 `patch` 版本 @@ -42,7 +39,6 @@ git branch --set-upstream-to=upstream/main main ``` - ## 设置您的本地开发环境 ### 依赖 @@ -107,6 +103,8 @@ pnpm start:rs cargo test ``` +如果需要更新测试快照,你可以使用 `INSTA_UPDATE=always cargo test` + ### Node 测试 - 在根目录下输入 `pnpm test` 基于 `vitest` 运行所有的 `Node` 代码测试用例。 @@ -131,5 +129,4 @@ $ farm plugin create # create a plugin support js or rust Farm 整个项目分为两个部分, JavaScript 和 Rust。 - **JavaScript** 部分: 查看 packages 文件夹中的代码, 包含核心包(开发服务, 文件监听, 编译器包装), 脚手架, 运行时和运行时插件 (模块系统, HMR 热更新)。 - - **Rust** 部分: 查看 crates 以及 rust-plugin 文件夹中的代码, 包含核心包 (编译上下文, 插件驱动等), 编译器 (编译进程、HMR 更新等), Rust 插件。 diff --git a/Cargo.lock b/Cargo.lock index bfcc20b612..70e5cffb0f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "Inflector" @@ -53,6 +53,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + [[package]] name = "adler32" version = "1.2.0" @@ -72,9 +78,9 @@ dependencies = [ [[package]] name = "ahash" -version = "0.8.8" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42cd52102d3df161c77a887b608d7a4897d7cc112886a9537b738a887a03aaff" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "getrandom", @@ -138,12 +144,6 @@ dependencies = [ "libc", ] -[[package]] -name = "anes" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "735d4f398ca57cfa2880225c2bf81c3b9af3be5bb22e44ae70118dad38713e84" - [[package]] name = "anstream" version = "0.6.9" @@ -200,9 +200,9 @@ checksum = "70033777eb8b5124a81a1889416543dddef2de240019b674c81285a2635a7e1e" [[package]] name = "anyhow" -version = "1.0.81" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" +checksum = "37bf3594c4c988a53154954629820791dde498571819ae4ca50ca811e060cc95" dependencies = [ "backtrace", ] @@ -236,14 +236,14 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "ast_node" -version = "0.9.8" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab31376d309dd3bfc9cfb3c11c93ce0e0741bbe0354b20e7f8c60b044730b79" +checksum = "94741d66bdda032fcbf33e621b4e3a888d7d11bd3ac4446d82c5593a136936ff" dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] @@ -254,7 +254,7 @@ checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] @@ -285,7 +285,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] @@ -304,7 +304,7 @@ dependencies = [ "cc", "cfg-if", "libc", - "miniz_oxide", + "miniz_oxide 0.7.1", "object", "rustc-demangle", ] @@ -332,9 +332,9 @@ dependencies = [ [[package]] name = "better_scoped_tls" -version = "0.1.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "794edcc9b3fb07bb4aecaa11f093fd45663b4feadb782d68303a2268bc2701de" +checksum = "50fd297a11c709be8348aec039c8b91de16075d2b2bdaee1bd562c0875993664" dependencies = [ "scoped-tls", ] @@ -356,9 +356,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" dependencies = [ "serde", ] @@ -440,22 +440,16 @@ dependencies = [ "objc2 0.5.2", ] -[[package]] -name = "bpaf" -version = "0.9.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3280efcf6d66bc77c2cf9b67dc8acee47a217d9be67dd590b3230dffe663724d" - [[package]] name = "browserslist-rs" version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdf0ca73de70c3da94e4194e4a01fe732378f55d47cf4c0588caab22a0dbfa14" dependencies = [ - "ahash 0.8.8", + "ahash 0.8.11", "chrono", "either", - "indexmap 2.2.6", + "indexmap 2.6.0", "itertools 0.13.0", "nom", "once_cell", @@ -476,28 +470,20 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" - -[[package]] -name = "bytecheck" -version = "0.6.11" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6372023ac861f6e6dc89c8344a8f398fb42aaba2b5dbc649ca0c0e9dbcb627" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" dependencies = [ - "bytecheck_derive 0.6.11", - "ptr_meta", - "simdutf8", + "allocator-api2", ] [[package]] name = "bytecheck" -version = "0.7.0" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41502630fe304ce54cbb2f8389e017784dee2b0328147779fcbe43b9db06d35d" +checksum = "8b6372023ac861f6e6dc89c8344a8f398fb42aaba2b5dbc649ca0c0e9dbcb627" dependencies = [ - "bytecheck_derive 0.7.0", + "bytecheck_derive", "ptr_meta", "simdutf8", ] @@ -513,17 +499,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "bytecheck_derive" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eda88c587085bc07dc201ab9df871bd9baa5e07f7754b745e4d7194b43ac1eda" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "bytemuck" version = "1.16.1" @@ -541,7 +516,7 @@ checksum = "1ee891b04274a59bd38b412188e24b849617b2e45a0fd8d057deb63e7403761b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] @@ -559,6 +534,15 @@ dependencies = [ "serde", ] +[[package]] +name = "bytesize" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" +dependencies = [ + "serde", +] + [[package]] name = "calloop" version = "0.10.6" @@ -574,10 +558,36 @@ dependencies = [ ] [[package]] -name = "cast" -version = "0.3.0" +name = "camino" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" +checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" +dependencies = [ + "camino", + "cargo-platform", + "semver 1.0.21", + "serde", + "serde_json", + "thiserror", +] [[package]] name = "cc" @@ -625,7 +635,7 @@ dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", - "windows-targets 0.52.0", + "windows-targets 0.52.6", ] [[package]] @@ -652,7 +662,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" dependencies = [ "ciborium-io", - "half 2.4.1", + "half", ] [[package]] @@ -686,7 +696,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] @@ -734,17 +744,6 @@ dependencies = [ "objc", ] -[[package]] -name = "codspeed" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" -dependencies = [ - "colored", - "libc", - "serde_json", -] - [[package]] name = "color_quant" version = "1.1.0" @@ -759,12 +758,11 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "colored" -version = "2.1.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" +checksum = "fde0e0ec90c9dfb3b4b1a0891a7dcd0e2bffde2f7efed5fe7c9bb00e5bfb915e" dependencies = [ - "lazy_static", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -786,7 +784,7 @@ dependencies = [ "encode_unicode", "lazy_static", "libc", - "unicode-width", + "unicode-width 0.1.11", "windows-sys 0.52.0", ] @@ -1017,25 +1015,6 @@ dependencies = [ "napi-derive", ] -[[package]] -name = "criterion2" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7258985df1aa8b33359ee2392cbc3b7802875242cdacdda91a17a602132c24a9" -dependencies = [ - "anes", - "bpaf", - "cast", - "ciborium", - "codspeed", - "colored", - "num-traits", - "oorandom", - "serde", - "serde_json", - "walkdir", -] - [[package]] name = "critical-section" version = "1.1.2" @@ -1118,7 +1097,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "30d2b3721e861707777e3195b0158f950ae6dc4a27e4d02ff9f67e3eb3de199e" dependencies = [ "quote", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] @@ -1133,12 +1112,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.3" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "darling_core 0.20.3", - "darling_macro 0.20.3", + "darling_core 0.20.10", + "darling_macro 0.20.10", ] [[package]] @@ -1157,15 +1136,16 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.3" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "syn 2.0.65", + "strsim 0.11.1", + "syn 2.0.87", ] [[package]] @@ -1181,13 +1161,13 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.3" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.20.3", + "darling_core 0.20.10", "quote", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] @@ -1203,7 +1183,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ "cfg-if", - "hashbrown 0.14.3", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core", +] + +[[package]] +name = "dashmap" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "hashbrown 0.14.5", "lock_api", "once_cell", "parking_lot_core", @@ -1251,7 +1245,16 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" dependencies = [ - "derive_builder_macro", + "derive_builder_macro 0.12.0", +] + +[[package]] +name = "derive_builder" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947" +dependencies = [ + "derive_builder_macro 0.20.2", ] [[package]] @@ -1266,16 +1269,38 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive_builder_core" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" +dependencies = [ + "darling 0.20.10", + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "derive_builder_macro" version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" dependencies = [ - "derive_builder_core", + "derive_builder_core 0.12.0", "syn 1.0.109", ] +[[package]] +name = "derive_builder_macro" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" +dependencies = [ + "derive_builder_core 0.20.2", + "syn 2.0.87", +] + [[package]] name = "dialoguer" version = "0.11.0" @@ -1354,7 +1379,16 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "libloading 0.8.1", + "libloading 0.8.6", +] + +[[package]] +name = "document-features" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" +dependencies = [ + "litrs", ] [[package]] @@ -1363,6 +1397,18 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + +[[package]] +name = "dyn-clone" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" + [[package]] name = "ecolor" version = "0.24.1" @@ -1413,7 +1459,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c55bcb864b764eb889515a38b8924757657a250738ad15126637ee2df291ee6b" dependencies = [ "accesskit", - "ahash 0.8.8", + "ahash 0.8.11", "epaint", "log", "nohash-hasher", @@ -1477,9 +1523,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "enhanced-magic-string" -version = "0.0.16" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583dde6b75010b4b1a91ab983d6ffbabf1e307a506b521409cb4ba0c1b69981e" +checksum = "2eaf1f42f1728b66a856f46546be619f3ed6ad03ba4266314082be2b5e8c5316" dependencies = [ "base64 0.22.1", "farmfe_utils 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1516,7 +1562,7 @@ checksum = "6fd000fd6988e73bbe993ea3db9b1aa64906ab88766d654973924340c8cddb42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] @@ -1534,10 +1580,10 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af" dependencies = [ - "darling 0.20.3", + "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] @@ -1547,7 +1593,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d1b9e000d21bab9b535ce78f9f7745be28b3f777f6c7223936561c5c7fefab8" dependencies = [ "ab_glyph", - "ahash 0.8.8", + "ahash 0.8.11", "bytemuck", "ecolor", "emath", @@ -1585,26 +1631,19 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" -[[package]] -name = "farmfe_bench" -version = "0.0.3" -dependencies = [ - "criterion2", - "farmfe_compiler", - "farmfe_core", -] - [[package]] name = "farmfe_compiler" version = "0.0.13" dependencies = [ "farmfe_core", - "farmfe_plugin_bundle", "farmfe_plugin_css", "farmfe_plugin_define", + "farmfe_plugin_file_size", "farmfe_plugin_html", "farmfe_plugin_json", "farmfe_plugin_lazy_compilation", + "farmfe_plugin_library", + "farmfe_plugin_mangle_exports", "farmfe_plugin_minify", "farmfe_plugin_partial_bundling", "farmfe_plugin_polyfill", @@ -1612,13 +1651,13 @@ dependencies = [ "farmfe_plugin_resolve", "farmfe_plugin_runtime", "farmfe_plugin_script", + "farmfe_plugin_script_meta", "farmfe_plugin_static_assets", "farmfe_plugin_tree_shake", "farmfe_testing", "farmfe_testing_helpers", "farmfe_toolkit", "farmfe_utils 0.1.6", - "num_cpus", ] [[package]] @@ -1626,27 +1665,31 @@ name = "farmfe_core" version = "0.7.1" dependencies = [ "blake2", - "bytecheck 0.7.0", - "dashmap", + "dashmap 5.5.3", "downcast-rs", "enhanced-magic-string", "farmfe_macro_cache_item", "farmfe_utils 0.1.6", "globset", - "heck 0.4.1", + "heck 0.5.0", "hex", + "lazy_static", + "num_cpus", "parking_lot", "petgraph", "ptr_meta", - "puffin", + "puffin 0.19.1", "rayon", "regex", "relative-path", "rkyv", "rkyv_dyn", "rkyv_typename", + "rustc-hash 2.0.0", "serde", "serde_json", + "serde_regex", + "swc_atoms", "swc_common", "swc_css_ast", "swc_css_prefixer", @@ -1683,8 +1726,7 @@ dependencies = [ "farmfe_compiler", "farmfe_core", "farmfe_toolkit", - "farmfe_toolkit_plugin_types", - "libloading 0.7.4", + "libloading 0.8.6", "napi", "napi-build", "napi-derive", @@ -1725,6 +1767,36 @@ dependencies = [ "farmfe_utils 0.1.6", ] +[[package]] +name = "farmfe_plugin_dts" +version = "0.0.0" +dependencies = [ + "farmfe_core", + "farmfe_macro_plugin", + "farmfe_plugin_resolve", + "farmfe_toolkit", + "pathdiff", + "regex", + "serde", + "serde_json", + "url", +] + +[[package]] +name = "farmfe_plugin_file_size" +version = "0.0.1" +dependencies = [ + "colored", + "farmfe_core", + "farmfe_macro_plugin", + "farmfe_testing_helpers", + "farmfe_toolkit", + "farmfe_utils 0.1.6", + "flate2", + "once_cell", + "unicode-width 0.2.0", +] + [[package]] name = "farmfe_plugin_html" version = "0.0.13" @@ -1754,6 +1826,26 @@ dependencies = [ "farmfe_utils 0.1.6", ] +[[package]] +name = "farmfe_plugin_library" +version = "0.0.1" +dependencies = [ + "farmfe_core", + "farmfe_testing_helpers", + "farmfe_toolkit", + "farmfe_utils 0.1.6", +] + +[[package]] +name = "farmfe_plugin_mangle_exports" +version = "0.0.1" +dependencies = [ + "farmfe_core", + "farmfe_testing_helpers", + "farmfe_toolkit", + "farmfe_utils 0.1.6", +] + [[package]] name = "farmfe_plugin_minify" version = "0.0.13" @@ -1799,11 +1891,24 @@ dependencies = [ "farmfe_core", "farmfe_macro_plugin", "farmfe_testing_helpers", - "farmfe_toolkit_plugin_types", + "farmfe_toolkit", "lazy_static", "serde", ] +[[package]] +name = "farmfe_plugin_replace_dirname" +version = "0.0.0" +dependencies = [ + "farmfe_core", + "farmfe_macro_plugin", + "farmfe_toolkit", + "regex", + "serde", + "serde_json", + "url", +] + [[package]] name = "farmfe_plugin_resolve" version = "0.0.13" @@ -1835,7 +1940,6 @@ dependencies = [ "farmfe_macro_plugin", "farmfe_testing_helpers", "farmfe_toolkit", - "farmfe_toolkit_plugin_types", "farmfe_utils 0.1.6", "sass-embedded", "serde", @@ -1857,6 +1961,16 @@ dependencies = [ "tokio", ] +[[package]] +name = "farmfe_plugin_script_meta" +version = "0.0.1" +dependencies = [ + "farmfe_core", + "farmfe_testing_helpers", + "farmfe_toolkit", + "farmfe_utils 0.1.6", +] + [[package]] name = "farmfe_plugin_static_assets" version = "0.0.13" @@ -1900,7 +2014,7 @@ dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] @@ -1908,6 +2022,7 @@ name = "farmfe_testing_helpers" version = "0.0.15" dependencies = [ "farmfe_core", + "insta", ] [[package]] @@ -1917,9 +2032,8 @@ dependencies = [ "anyhow", "farmfe_core", "farmfe_testing_helpers", - "farmfe_toolkit_plugin_types", "farmfe_utils 0.1.6", - "lazy_static", + "itertools 0.13.0", "preset_env_base", "sourcemap", "swc_atoms", @@ -1942,15 +2056,7 @@ dependencies = [ "swc_html_minifier", "swc_html_parser", "swc_html_visit", -] - -[[package]] -name = "farmfe_toolkit_plugin_types" -version = "0.0.22" -dependencies = [ - "farmfe_core", - "lazy_static", - "libloading 0.7.4", + "swc_typescript", ] [[package]] @@ -2008,12 +2114,12 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", - "miniz_oxide", + "miniz_oxide 0.8.4", ] [[package]] @@ -2048,13 +2154,13 @@ dependencies = [ [[package]] name = "from_variant" -version = "0.1.8" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc9cc75639b041067353b9bce2450d6847e547276c6fbe4487d7407980e07db" +checksum = "8d7ccf961415e7aa17ef93dcb6c2441faaa8e768abe09e659b908089546f74c5" dependencies = [ "proc-macro2", "swc_macros_common", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] @@ -2134,7 +2240,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] @@ -2198,9 +2304,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "js-sys", @@ -2217,7 +2323,7 @@ checksum = "b0e085ded9f1267c32176b40921b9754c474f7dd96f7e808d4a982e48aa1e854" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] @@ -2343,12 +2449,6 @@ dependencies = [ "gl_generator", ] -[[package]] -name = "half" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" - [[package]] name = "half" version = "2.4.1" @@ -2383,19 +2483,25 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.8", + "ahash 0.8.11", ] [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ - "ahash 0.8.8", + "ahash 0.8.11", "allocator-api2", ] +[[package]] +name = "hashbrown" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" + [[package]] name = "heapless" version = "0.7.17" @@ -2462,23 +2568,23 @@ dependencies = [ [[package]] name = "hstr" -version = "0.2.8" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0f5356d62012374578cd3a5c013d6586de3efbca3b53379fc1edfbb95c9db14" +checksum = "63d6824358c0fd9a68bb23999ed2ef76c84f79408a26ef7ae53d5f370c94ad36" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.14.5", "new_debug_unreachable", "once_cell", "phf", - "rustc-hash", + "rustc-hash 1.1.0", "triomphe", ] [[package]] name = "http" -version = "0.2.11" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", @@ -2536,6 +2642,22 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" +[[package]] +name = "ignore" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b46810df39e66e925525d6e38ce1e7f6e1d208f72dc39757880fcb66e2c58af1" +dependencies = [ + "crossbeam-deque", + "globset", + "log", + "memchr", + "regex-automata", + "same-file", + "walkdir", + "winapi-util", +] + [[package]] name = "image" version = "0.24.9" @@ -2569,7 +2691,7 @@ dependencies = [ "libflate", "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] @@ -2585,12 +2707,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.15.0", "serde", ] @@ -2604,7 +2726,7 @@ dependencies = [ "instant", "number_prefix", "portable-atomic", - "unicode-width", + "unicode-width 0.1.11", ] [[package]] @@ -2628,8 +2750,20 @@ dependencies = [ ] [[package]] -name = "instant" -version = "0.1.13" +name = "insta" +version = "1.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "810ae6042d48e2c9e9215043563a58a80b877bc863228a74cf10c49d4620a6f5" +dependencies = [ + "console", + "lazy_static", + "linked-hash-map", + "similar", +] + +[[package]] +name = "instant" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ @@ -2670,7 +2804,7 @@ dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] @@ -2892,7 +3026,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6e0d73b369f386f1c44abd9c570d5318f55ccde816ff4b562fa452e5182863d" dependencies = [ "core2", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "rle-decode-fast", ] @@ -2908,12 +3042,12 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.1" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" +checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", - "windows-sys 0.48.0", + "windows-targets 0.52.6", ] [[package]] @@ -2922,7 +3056,7 @@ version = "0.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3af92c55d7d839293953fcd0fda5ecfe93297cfde6ffbdec13b41d99c0ba6607" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", "redox_syscall 0.4.1", ] @@ -2933,7 +3067,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", ] @@ -2958,6 +3092,12 @@ version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +[[package]] +name = "litrs" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" + [[package]] name = "lock_api" version = "0.4.11" @@ -2988,12 +3128,15 @@ name = "lz4_flex" version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75761162ae2b0e580d7e7c390558127e5f01b4194debd6221fd8c207fc80e3f5" +dependencies = [ + "twox-hash", +] [[package]] -name = "mach" -version = "0.3.2" +name = "mach2" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" dependencies = [ "libc", ] @@ -3007,11 +3150,17 @@ dependencies = [ "libc", ] +[[package]] +name = "managed" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca88d725a0a943b096803bd34e73a4437208b6077654cc4ecb2947a5f91618d" + [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" @@ -3051,9 +3200,9 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" dependencies = [ "autocfg", ] @@ -3067,7 +3216,7 @@ dependencies = [ "miette-derive 5.10.0", "once_cell", "thiserror", - "unicode-width", + "unicode-width 0.1.11", ] [[package]] @@ -3081,7 +3230,7 @@ dependencies = [ "owo-colors", "textwrap", "thiserror", - "unicode-width", + "unicode-width 0.1.11", ] [[package]] @@ -3092,7 +3241,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] @@ -3103,7 +3252,7 @@ checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] @@ -3138,6 +3287,15 @@ dependencies = [ "simd-adler32", ] +[[package]] +name = "miniz_oxide" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3b1c9bd4fe1f0f8b387f6eb9eb3b4a1aa26185e5750efb9140301703f62cd1b" +dependencies = [ + "adler2", +] + [[package]] name = "mio" version = "0.8.11" @@ -3162,7 +3320,7 @@ version = "2.16.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1bd081bbaef43600fd2c5dd4c525b8ecea7dfdacf40ebc674e87851dce6559e" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "ctor 0.2.6", "napi-derive", "napi-sys", @@ -3188,7 +3346,7 @@ dependencies = [ "napi-derive-backend", "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] @@ -3203,7 +3361,7 @@ dependencies = [ "quote", "regex", "semver 1.0.21", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] @@ -3212,7 +3370,7 @@ version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "427802e8ec3a734331fec1035594a210ce1ff4dc5bc1950530920ab717964ea3" dependencies = [ - "libloading 0.8.1", + "libloading 0.8.6", ] [[package]] @@ -3312,7 +3470,7 @@ version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "crossbeam-channel", "filetime", "fsevent-sys", @@ -3327,11 +3485,10 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ - "autocfg", "num-integer", "num-traits", "serde", @@ -3345,11 +3502,10 @@ checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] name = "num-integer" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] @@ -3411,7 +3567,16 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.87", +] + +[[package]] +name = "num_threads" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" +dependencies = [ + "libc", ] [[package]] @@ -3468,7 +3633,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "block2 0.5.1", "libc", "objc2 0.5.2", @@ -3484,7 +3649,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "block2 0.5.1", "objc2 0.5.2", "objc2-foundation", @@ -3523,7 +3688,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "block2 0.5.1", "libc", "objc2 0.5.2", @@ -3535,7 +3700,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "block2 0.5.1", "objc2 0.5.2", "objc2-foundation", @@ -3547,7 +3712,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "block2 0.5.1", "objc2 0.5.2", "objc2-foundation", @@ -3569,12 +3734,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "oorandom" -version = "11.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" - [[package]] name = "option-ext" version = "0.2.0" @@ -3607,9 +3766,9 @@ dependencies = [ [[package]] name = "owo-colors" -version = "4.0.0" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caff54706df99d2a78a5a4e3455ff45448d81ef1bb63c22cd14052ca0e993a3f" +checksum = "fb37767f6569cd834a413442455e0f066d0d522de8630436e2a1761d9726ba56" [[package]] name = "parking_lot" @@ -3663,12 +3822,12 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "petgraph" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.2.6", + "indexmap 2.6.0", ] [[package]] @@ -3701,7 +3860,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] @@ -3730,7 +3889,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] @@ -3761,7 +3920,7 @@ dependencies = [ "crc32fast", "fdeflate", "flate2", - "miniz_oxide", + "miniz_oxide 0.7.1", ] [[package]] @@ -3793,14 +3952,14 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "preset_env_base" -version = "0.5.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b30eab18be480c194938e433e269d5298a279f6410f02fbc73f3576a325c110" +checksum = "7c8a797e42c09d55157424ac6e9b6e9e5843fc68b887691b280b055e8c3ca5e4" dependencies = [ - "ahash 0.8.8", + "ahash 0.8.11", "anyhow", "browserslist-rs", - "dashmap", + "dashmap 5.5.3", "from_variant", "once_cell", "semver 1.0.21", @@ -3845,9 +4004,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.81" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] @@ -3920,6 +4079,23 @@ dependencies = [ "serde", ] +[[package]] +name = "puffin" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa9dae7b05c02ec1a6bc9bcf20d8bc64a7dcbf57934107902a872014899b741f" +dependencies = [ + "anyhow", + "bincode", + "byteorder", + "cfg-if", + "itertools 0.10.5", + "lz4_flex", + "once_cell", + "parking_lot", + "serde", +] + [[package]] name = "puffin_egui" version = "0.24.0" @@ -3930,7 +4106,7 @@ dependencies = [ "indexmap 1.9.3", "natord", "once_cell", - "puffin", + "puffin 0.18.1", "time", "vec1", "web-time", @@ -4067,9 +4243,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.2" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" dependencies = [ "aho-corasick", "memchr", @@ -4079,9 +4255,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", @@ -4090,20 +4266,20 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "region" -version = "3.0.0" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e" +checksum = "e6b6ebd13bc009aef9cd476c1310d49ac354d36e240cf1bd753290f3dc7199a7" dependencies = [ "bitflags 1.3.2", "libc", - "mach", - "winapi", + "mach2", + "windows-sys 0.52.0", ] [[package]] @@ -4118,7 +4294,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2571463863a6bd50c32f94402933f03457a3fbaf697a707c5be741e459f08fd" dependencies = [ - "bytecheck 0.6.11", + "bytecheck", ] [[package]] @@ -4129,12 +4305,12 @@ checksum = "e3a8614ee435691de62bcffcf4a66d91b3594bf1428a5722e79103249a095690" [[package]] name = "rkyv" -version = "0.7.44" +version = "0.7.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cba464629b3394fc4dbc6f940ff8f5b4ff5c7aef40f29166fd4ad12acbc99c0" +checksum = "9008cd6385b9e161d8229e1f6549dd23c3d022f132a2ea37ac3a10ac4935779b" dependencies = [ "bitvec", - "bytecheck 0.6.11", + "bytecheck", "bytes", "hashbrown 0.12.3", "indexmap 1.9.3", @@ -4148,9 +4324,9 @@ dependencies = [ [[package]] name = "rkyv_derive" -version = "0.7.44" +version = "0.7.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7dddfff8de25e6f62b9d64e6e432bf1c6736c57d20323e15ee10435fbda7c65" +checksum = "503d1d27590a2b0a3a4ca4c94755aa2875657196ecbf401a42eff41d7de532c0" dependencies = [ "proc-macro2", "quote", @@ -4215,7 +4391,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" dependencies = [ "base64 0.21.7", - "bitflags 2.5.0", + "bitflags 2.6.0", "serde", "serde_derive", ] @@ -4242,7 +4418,7 @@ dependencies = [ "quote", "rust-embed-utils", "shellexpand", - "syn 2.0.65", + "syn 2.0.87", "walkdir", ] @@ -4268,6 +4444,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +[[package]] +name = "rustc-hash" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" + [[package]] name = "rustc_version" version = "0.2.3" @@ -4292,13 +4474,19 @@ version = "0.38.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", "windows-sys 0.52.0", ] +[[package]] +name = "rustversion" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" + [[package]] name = "rusty_pool" version = "0.7.0" @@ -4320,9 +4508,9 @@ checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "ryu-js" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4950d85bc52415f8432144c97c4791bd0c4f7954de32a7270ee9cccd3c22b12b" +checksum = "ad97d4ce1560a5e27cec89519dc8300d1aa6035b099821261c651486a19e44d5" [[package]] name = "same-file" @@ -4341,17 +4529,42 @@ checksum = "043fea16ac00f7132b50dce6094873fee0d328bd43c0f552faeb33d989d97b77" dependencies = [ "atty", "crossbeam-channel", - "dashmap", + "dashmap 5.5.3", "parking_lot", "prost", "regex", - "rustc-hash", + "rustc-hash 1.1.0", "serde", "serde_json", "url", "urlencoding", ] +[[package]] +name = "schemars" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09c024468a378b7e36765cd36702b7a90cc3cba11654f6685c8f233408e89e92" +dependencies = [ + "dyn-clone", + "schemars_derive", + "serde", + "serde_json", + "url", +] + +[[package]] +name = "schemars_derive" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1eee588578aff73f856ab961cd2f79e36bc45d7ded33a7562adba4667aecc0e" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.87", +] + [[package]] name = "scoped-tls" version = "1.0.1" @@ -4402,9 +4615,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.204" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] @@ -4421,66 +4634,66 @@ dependencies = [ ] [[package]] -name = "serde_cbor" -version = "0.11.2" +name = "serde_derive" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ - "half 1.8.2", - "serde", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] -name = "serde_derive" -version = "1.0.204" +name = "serde_derive_internals" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] name = "serde_json" -version = "1.0.120" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.6.0", "itoa", + "memchr", "ryu", "serde", ] [[package]] -name = "serde_spanned" -version = "0.6.5" +name = "serde_regex" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "a8136f1a4ea815d7eac4101cfd0b16dc0cb5e1fe1b8609dfd728058656b7badf" dependencies = [ + "regex", "serde", ] [[package]] -name = "serde_yaml" -version = "0.8.26" +name = "serde_spanned" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" dependencies = [ - "indexmap 1.9.3", - "ryu", "serde", - "yaml-rust", ] [[package]] name = "serde_yaml" -version = "0.9.30" +version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1bf28c79a99f70ee1f1d83d10c875d2e70618417fda01ad1785e027579d9d38" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.6.0", "itoa", "ryu", "serde", @@ -4555,6 +4768,12 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" +[[package]] +name = "similar" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa42c91313f1d05da9b26f267f931cf178d4aba455b4c4622dd7355eb80c6640" + [[package]] name = "siphasher" version = "0.3.11" @@ -4637,6 +4856,17 @@ dependencies = [ "wayland-client", ] +[[package]] +name = "smoltcp" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee34c1e1bfc7e9206cc0fb8030a90129b4e319ab53856249bb27642cab914fb3" +dependencies = [ + "bitflags 1.3.2", + "byteorder", + "managed", +] + [[package]] name = "socket2" version = "0.4.10" @@ -4649,16 +4879,16 @@ dependencies = [ [[package]] name = "sourcemap" -version = "8.0.1" +version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "208d40b9e8cad9f93613778ea295ed8f3c2b1824217c6cfc7219d3f6f45b96d4" +checksum = "dab08a862c70980b8e23698b507e272317ae52a608a164a844111f5372374f1f" dependencies = [ "base64-simd", "bitvec", "data-encoding", "debugid", "if_chain", - "rustc-hash", + "rustc-hash 1.1.0", "rustc_version 0.2.3", "serde", "serde_json", @@ -4712,7 +4942,7 @@ checksum = "9cf483ea7e0e3a03d1b91687895814425149ad77facd3e2b6839dde26da98454" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] @@ -4723,14 +4953,14 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "string_enum" -version = "0.4.4" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05e383308aebc257e7d7920224fa055c632478d92744eca77f99be8fa1545b90" +checksum = "c9fe66b8ee349846ce2f9557a26b8f1e74843c4a13fb381f9a3d73617a5f956a" dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] @@ -4751,29 +4981,42 @@ version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" +[[package]] +name = "swc_allocator" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52cacc28f0ada8e4e31a720dd849ff06864b10e6ab0a1aaa99c06456cfe046af" +dependencies = [ + "bumpalo", + "hashbrown 0.14.5", + "ptr_meta", + "rustc-hash 1.1.0", + "triomphe", +] + [[package]] name = "swc_atoms" -version = "0.6.7" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb6567e4e67485b3e7662b486f1565bdae54bd5b9d6b16b2ba1a9babb1e42125" +checksum = "5d7211e5c57ea972f32b8a104d7006c4a68d094ec30c6a73bcd20d4d6c473c7c" dependencies = [ - "bytecheck 0.6.11", + "bytecheck", "hstr", "once_cell", "rkyv", - "rustc-hash", + "rustc-hash 1.1.0", "serde", ] [[package]] name = "swc_cached" -version = "0.3.20" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83406221c501860fce9c27444f44125eafe9e598b8b81be7563d7036784cd05c" +checksum = "96b6a5ef4cfec51d3fa30b73600f206453a37fc30cf1141e4644a57b1ed88616" dependencies = [ - "ahash 0.8.8", + "ahash 0.8.11", "anyhow", - "dashmap", + "dashmap 5.5.3", "once_cell", "regex", "serde", @@ -4781,14 +5024,14 @@ dependencies = [ [[package]] name = "swc_common" -version = "0.34.4" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9087befec6b63911f9d2f239e4f91c9b21589c169b86ed2d616944d23cf4a243" +checksum = "992b89cdcff8e61c1308a984af5450a60a382b106f3e79fd6aabf9e2e193d076" dependencies = [ "anyhow", "ast_node", "better_scoped_tls", - "bytecheck 0.6.11", + "bytecheck", "cfg-if", "either", "from_variant", @@ -4797,26 +5040,27 @@ dependencies = [ "once_cell", "parking_lot", "rkyv", - "rustc-hash", + "rustc-hash 1.1.0", "serde", "siphasher", "sourcemap", + "swc_allocator", "swc_atoms", "swc_eq_ignore_macros", "swc_visit", "tracing", - "unicode-width", + "unicode-width 0.1.11", "url", ] [[package]] name = "swc_config" -version = "0.1.14" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84b67e115ab136fe0eb03558bb0508ca7782eeb446a96d165508c48617e3fd94" +checksum = "4aa30931f9b26af8edcb4cce605909d15dcfd7577220b22c50a2988f2a53c4c1" dependencies = [ "anyhow", - "indexmap 2.2.6", + "indexmap 2.6.0", "serde", "serde_json", "sourcemap", @@ -4826,21 +5070,21 @@ dependencies = [ [[package]] name = "swc_config_macro" -version = "0.1.4" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c5f56139042c1a95b54f5ca48baa0e0172d369bcc9d3d473dad1de36bae8399" +checksum = "7f2ebd37ef52a8555c8c9be78b694d64adcb5e3bc16c928f030d82f1d65fac57" dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] name = "swc_css_ast" -version = "0.141.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89a5f28ff625a89de2a269bde3ed3b99be74bb9d3dc78dea6f3b071991b2cbf4" +checksum = "43788e36555d955b60a215bdb43501f7e3794dc57ead6796d2e67933a8a4fe07" dependencies = [ "is-macro", "rkyv", @@ -4851,13 +5095,13 @@ dependencies = [ [[package]] name = "swc_css_codegen" -version = "0.152.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "894275a04a693db249903c29b31dfc71fae0bde68c49d4c4a935243f9eeba691" +checksum = "5975118f6d3fe1cff7e7073999a9ffc37f55b9f57c1e4e11d81ca3cb6dda2d1c" dependencies = [ "auto_impl", - "bitflags 2.5.0", - "rustc-hash", + "bitflags 2.6.0", + "rustc-hash 1.1.0", "serde", "swc_atoms", "swc_common", @@ -4868,21 +5112,21 @@ dependencies = [ [[package]] name = "swc_css_codegen_macros" -version = "0.2.4" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de2ece8c7dbdde85aa1bcc9764c5f41f7450d8bf1312eac2375b8dc0ecbc13d7" +checksum = "50abd25b3b79f18423cdf99b0d11dee24e64496be3b8abe18c10a2c40bd6c91f" dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] name = "swc_css_minifier" -version = "0.117.1" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3018ef38941e9b5681af7651047cd42af8bcb1635ba1d99eee182aafd84bb3" +checksum = "1dec819da5e8eeec6404d6a48ec70bab02bf86c14881c3857ba578092b53477b" dependencies = [ "serde", "swc_atoms", @@ -4894,11 +5138,11 @@ dependencies = [ [[package]] name = "swc_css_modules" -version = "0.30.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02cf9cf88016e0445fafa1335b7727d4c17ff7a3a7f43da4a81657c517f71720" +checksum = "cf51da567426fa8850597ccd115572aca04b93dfaeb2a43ee8e5fc5d5849ba6c" dependencies = [ - "rustc-hash", + "rustc-hash 1.1.0", "serde", "swc_atoms", "swc_common", @@ -4910,9 +5154,9 @@ dependencies = [ [[package]] name = "swc_css_parser" -version = "0.151.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee5dbaaea0df38195d137bcfc68149906bba9c9dffebf5e846234e286f82992" +checksum = "597975ab645e4aa0786058b91ed9507b556c08fcd4d2c2a4a4d2ea5a492d1095" dependencies = [ "lexical", "serde", @@ -4923,9 +5167,9 @@ dependencies = [ [[package]] name = "swc_css_prefixer" -version = "0.155.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc9930655060121c32d829e13fe4fa11294c03e71eb84c22e039703c929dcdf7" +checksum = "4155decb66c6c72df1c07545935cc833ed5f35f1d16db46eb242973b90c68a51" dependencies = [ "once_cell", "preset_env_base", @@ -4940,9 +5184,9 @@ dependencies = [ [[package]] name = "swc_css_utils" -version = "0.138.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b135df778449825f38d54664bb179c839b3285f9a553ec10dd3cc3eafb751599" +checksum = "1d35b03bb3012c4bf3b7bb2c20b842e4bb0349a2c98eeae309f3ffbd4d321cc4" dependencies = [ "once_cell", "serde", @@ -4955,9 +5199,9 @@ dependencies = [ [[package]] name = "swc_css_visit" -version = "0.140.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c97dceaa18c8ae7f5a4c991e15efc5c333e5880b58ee6d61e42fd1365748ff05" +checksum = "5f55edb2505f0ca68d3190086bcf589df41b1e698bd9c8a824a3e05c39cbfdfc" dependencies = [ "serde", "swc_atoms", @@ -4968,12 +5212,12 @@ dependencies = [ [[package]] name = "swc_ecma_ast" -version = "0.115.1" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7be1306930c235435a892104c00c2b5e16231043c085d5a10bd3e7537b15659b" +checksum = "99e7c0cd9dfe2a49c8f0b4ce699c13c9e270b8487a0176e1d89e5a9a586d0b3b" dependencies = [ - "bitflags 2.5.0", - "bytecheck 0.6.11", + "bitflags 2.6.0", + "bytecheck", "is-macro", "num-bigint", "phf", @@ -4983,21 +5227,23 @@ dependencies = [ "string_enum", "swc_atoms", "swc_common", + "swc_visit", "unicode-id-start", ] [[package]] name = "swc_ecma_codegen" -version = "0.151.1" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5141a8cb4eb69e090e6aea5d49061b46919be5210f3d084f9d9ad63d30f5cff" +checksum = "09236707a86e5d9f24c58e46c7f0efcc728daf1dd48167b2071f7afc11b7ea67" dependencies = [ "memchr", "num-bigint", "once_cell", - "rustc-hash", + "regex", "serde", "sourcemap", + "swc_allocator", "swc_atoms", "swc_common", "swc_ecma_ast", @@ -5007,21 +5253,21 @@ dependencies = [ [[package]] name = "swc_ecma_codegen_macros" -version = "0.7.6" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090e409af49c8d1a3c13b3aab1ed09dd4eda982207eb3e63c2ad342f072b49c8" +checksum = "5f9a42f479a6475647e248fa9750982c87cd985e19d1016a1fc18a70682305d1" dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] name = "swc_ecma_compat_bugfixes" -version = "0.7.1" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04182e17ec1343e355c4150b51226627d0160b8c0fb612bfcf3faa3d030a3866" +checksum = "b75e7322ae25d39db5fc3e1022c9044415578646ad2b0e776d3651ea72c6c5ef" dependencies = [ "swc_atoms", "swc_common", @@ -5036,9 +5282,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_common" -version = "0.7.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d2f791e974b5dd20a72c50aaf5507a07c6b7c2778711a4b8f62b881b92035b1" +checksum = "41265d5e64e9e72e7916be2bc491529be6386f276878a5f938abd3de3e804ae2" dependencies = [ "swc_common", "swc_ecma_ast", @@ -5049,13 +5295,14 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2015" -version = "0.7.1" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d23a9a192078d1d074113d77d8ad811f2a81a4447ae967739824da5d391616bf" +checksum = "2091f28686c27c001d661397078438ef7af3d5e63986fd3ebad406757221997a" dependencies = [ "arrayvec", - "indexmap 2.2.6", + "indexmap 2.6.0", "is-macro", + "rustc-hash 1.1.0", "serde", "serde_derive", "smallvec", @@ -5075,9 +5322,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2016" -version = "0.7.1" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a166a024e6415bb6e6e326ed6ebe2fadcea093408f0de3cf1308b4f971c171b0" +checksum = "7e7a93d54a35e32b14d676ce212af86ad12a3ed6a9e1a777592ca03ad530d380" dependencies = [ "swc_atoms", "swc_common", @@ -5092,9 +5339,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2017" -version = "0.7.1" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65f84891ddbc61b105222e64f7f33cf8a27d4020cbae2e7381899eacb69c540a" +checksum = "85b0f6ba7783a1fb34839b9c28c630b724b440fda93cccb7c62f0c689fb91155" dependencies = [ "serde", "swc_atoms", @@ -5110,9 +5357,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2018" -version = "0.7.1" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe11cda413787f46bef9a66752933fb8f6f2e509cb938758ad67d27710619ee6" +checksum = "76dc53785f2354b3f2adc828e6e1210f6358dac9d6bbdcb7aabd6953b1ea7d3d" dependencies = [ "serde", "swc_atoms", @@ -5129,9 +5376,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2019" -version = "0.7.1" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce2888fa110ff41e36bd824fa8636f876f812e64c8b12d721df90a133c28ee86" +checksum = "2dcd6f4d5adf45ee2f9a32b0ef8ae57064cc6ad9994b6b83ab8779a3cf4e2c88" dependencies = [ "swc_atoms", "swc_common", @@ -5145,9 +5392,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2020" -version = "0.7.2" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3baf93ce04ee5a888e41265280dcb12d4e6a7bcf907ef2526b69d2aed9187607" +checksum = "1103f8814cf15a841dfe3be7f236ba4ed7eeba99dd70ba95a6c50d3f06f98470" dependencies = [ "serde", "swc_atoms", @@ -5163,9 +5410,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2021" -version = "0.7.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "529b0368f8ada330a928ecf82c6c480eefd51cacd2d6e9f3bdedf9187782f0da" +checksum = "f8bfc3e80b008c849c9fccfeacbf0c96b7a7bcc8cc36b80f5a36a2589e43112b" dependencies = [ "swc_atoms", "swc_common", @@ -5179,9 +5426,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es2022" -version = "0.7.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fb64c1ee316e05823b6b698d44017848241626f1e11eaf394a642bc99d4d4cd" +checksum = "c2c99e6bb989a1eeb0372a244eaecff7afe97ac9d5c90ff910fd9624fbb91b55" dependencies = [ "swc_atoms", "swc_common", @@ -5198,9 +5445,9 @@ dependencies = [ [[package]] name = "swc_ecma_compat_es3" -version = "0.7.1" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2d6a9792a2f534232b98a1564e3982d9135d86f6948a55e8f944ab3b960e602" +checksum = "2d713149adf01aea336eab6dfd71efc69b47bd4c23bf00d94676b29a7a4399c2" dependencies = [ "swc_common", "swc_ecma_ast", @@ -5213,12 +5460,12 @@ dependencies = [ [[package]] name = "swc_ecma_loader" -version = "0.46.1" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9febebf047d1286e7b723fa2758f3229da2c103834f3eaee69833f46692612" +checksum = "3990b0a3db49dc0d6310b24487f502152c1cc92adea4fbe4335907fce4b13e42" dependencies = [ "anyhow", - "dashmap", + "dashmap 5.5.3", "lru", "normpath", "once_cell", @@ -5235,12 +5482,12 @@ dependencies = [ [[package]] name = "swc_ecma_minifier" -version = "0.197.3" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adde00302d7ddb37f312ee6d07078c7f3c7ede36c0f81c5050bae1d4c3fe501c" +checksum = "1ef4de55c8a57d10a2683157b4d17301482518a07fd15c3d71000fe0d1b99328" dependencies = [ "arrayvec", - "indexmap 2.2.6", + "indexmap 2.6.0", "num-bigint", "num_cpus", "once_cell", @@ -5248,10 +5495,11 @@ dependencies = [ "phf", "radix_fmt", "regex", - "rustc-hash", + "rustc-hash 1.1.0", "ryu-js", "serde", "serde_json", + "swc_allocator", "swc_atoms", "swc_common", "swc_config", @@ -5269,9 +5517,9 @@ dependencies = [ [[package]] name = "swc_ecma_parser" -version = "0.146.12" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a4e0c2e85f12c63b85c805e923079b04d1fb3e25edd069d638eed5f2098de74" +checksum = "a49f6ab5fa19498d0feb45a4943e1ad962736ee251e8f0f885330f7aeca39c39" dependencies = [ "either", "new_debug_unreachable", @@ -5291,16 +5539,16 @@ dependencies = [ [[package]] name = "swc_ecma_preset_env" -version = "0.210.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cd4847a3356a01bb9a73ccdd1c462dfdaed66d27d7ea6d6785ee1b54c9556ce" +checksum = "cfe5e2978c94c480735ac2153e082cf3cdd25b27eb5b6e8053b11275a64ee7a5" dependencies = [ "anyhow", - "dashmap", - "indexmap 2.2.6", + "dashmap 5.5.3", + "indexmap 2.6.0", "once_cell", "preset_env_base", - "rustc-hash", + "rustc-hash 1.1.0", "semver 1.0.21", "serde", "serde_json", @@ -5316,9 +5564,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms" -version = "0.232.1" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6845e7a7001aa2793225568e0661b55f57352a2103fa28934dd9cbc0d41cd933" +checksum = "8a3e411329a10c03a9d7a006be3e0b556bf6ab7f557466e681f8fdedb6551122" dependencies = [ "swc_atoms", "swc_common", @@ -5336,17 +5584,17 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "0.140.3" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d37dc505c92af56d0f77cf6f31a6ccd37ac40cad1e01ff77277e0b1c70e8f8ff" +checksum = "a6f43d1983d48dca819a7d0c79c5eb98011a2f8759acbddd972858ec228c66d4" dependencies = [ "better_scoped_tls", - "bitflags 2.5.0", - "indexmap 2.2.6", + "bitflags 2.6.0", + "indexmap 2.6.0", "once_cell", "phf", "rayon", - "rustc-hash", + "rustc-hash 1.1.0", "serde", "smallvec", "swc_atoms", @@ -5360,9 +5608,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_classes" -version = "0.129.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3eab5f8179e5b0aedf385eacc2c033691c6d211a7babd1bbbff12cf794a824e" +checksum = "8edd0cf96f8f06071e164343829eb393e5824e0fd9fecfe02188448a29751b80" dependencies = [ "swc_atoms", "swc_common", @@ -5374,12 +5622,12 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_compat" -version = "0.166.1" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "626198f214d4c09adc98ab14565c19d72b6df9630f7e806ef9b2ef05a5fd17a5" +checksum = "66fe50b2f009c63d4e77a4fa9001af7c04be58824bc9748f576b614c65e80e9b" dependencies = [ "arrayvec", - "indexmap 2.2.6", + "indexmap 2.6.0", "is-macro", "num-bigint", "rayon", @@ -5411,28 +5659,28 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_macros" -version = "0.5.5" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500a1dadad1e0e41e417d633b3d6d5de677c9e0d3159b94ba3348436cdb15aab" +checksum = "6845dfb88569f3e8cd05901505916a8ebe98be3922f94769ca49f84e8ccec8f7" dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] name = "swc_ecma_transforms_module" -version = "0.183.1" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7dc1df5996d98d1a27995e8b8a13f805a801d9286cb9ed29103662c767c747e" +checksum = "25f8b1f049d172e4b83167751293728ce0c4692e364c1ffbce7af35bb7dad855" dependencies = [ "Inflector", "anyhow", - "bitflags 2.5.0", - "indexmap 2.2.6", + "bitflags 2.6.0", + "indexmap 2.6.0", "is-macro", - "path-clean 0.1.0", + "path-clean 1.0.1", "pathdiff", "regex", "serde", @@ -5450,16 +5698,16 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_optimization" -version = "0.201.2" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "724a8306e98c1b1f9640fc44c1acc0c971f6daa17651919e06b64f905d4a4564" +checksum = "30019eed0d2bf516f08216c87c89e372c91750c1bae8a3254335c5f6ad044852" dependencies = [ - "dashmap", - "indexmap 2.2.6", + "dashmap 5.5.3", + "indexmap 2.6.0", "once_cell", "petgraph", "rayon", - "rustc-hash", + "rustc-hash 1.1.0", "serde_json", "swc_atoms", "swc_common", @@ -5475,12 +5723,12 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_proposal" -version = "0.174.3" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6df8aa6752cc2fcf3d78ac67827542fb666e52283f2b26802aa058906bb750d3" +checksum = "c3090cde1901f95b5430171709acc319cd36acda5c2a4a77706656ede5fbdd4f" dependencies = [ "either", - "rustc-hash", + "rustc-hash 1.1.0", "serde", "smallvec", "swc_atoms", @@ -5495,18 +5743,19 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_react" -version = "0.186.2" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "446da32cac8299973aaf1d37496562bfd0c1e4f3c3ab5d0af6f07f42e8184102" +checksum = "dff97567117214938c3a5f397cd9c4ecb5945778982d918471b9623da351f1f0" dependencies = [ "base64 0.21.7", - "dashmap", - "indexmap 2.2.6", + "dashmap 5.5.3", + "indexmap 2.6.0", "once_cell", "rayon", "serde", "sha1", "string_enum", + "swc_allocator", "swc_atoms", "swc_common", "swc_config", @@ -5520,9 +5769,9 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_typescript" -version = "0.191.2" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1ce8af2865449e714ae56dacb6b54b3f6dc4cc25074da4e39b878bd93c5e39c" +checksum = "0c4056d06593b73a3149530fdbd4f44e7692cb801c03750ec874c1753b68c6c6" dependencies = [ "ryu-js", "serde", @@ -5537,12 +5786,12 @@ dependencies = [ [[package]] name = "swc_ecma_usage_analyzer" -version = "0.26.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146562ac3515c8de0fa9d479c43ae673cf9df9ece814f8b8130686080a7251ac" +checksum = "c85c31dad1d402a52394eb184742a7095ba02277c55df327b89fb8bd65e59a7c" dependencies = [ - "indexmap 2.2.6", - "rustc-hash", + "indexmap 2.6.0", + "rustc-hash 1.1.0", "swc_atoms", "swc_common", "swc_ecma_ast", @@ -5554,15 +5803,15 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "0.130.3" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e62b199454a576c5fdbd7e1bef8ab88a395427456d8a713d994b7d469833aa" +checksum = "9371e7e39fca55508ae91abf28fd3d8dae8eff3782e918081f6932523c68789c" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.6.0", "num_cpus", "once_cell", "rayon", - "rustc-hash", + "rustc-hash 1.1.0", "ryu-js", "swc_atoms", "swc_common", @@ -5574,10 +5823,11 @@ dependencies = [ [[package]] name = "swc_ecma_visit" -version = "0.101.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce0d997f0c9b4e181225f603d161f6757c2a97022258170982cfe005ec69ec92" +checksum = "a380252c317c67f321b8e0d66dbc2427842bd184505e12016f0d3f811776af86" dependencies = [ + "new_debug_unreachable", "num-bigint", "swc_atoms", "swc_common", @@ -5588,20 +5838,20 @@ dependencies = [ [[package]] name = "swc_eq_ignore_macros" -version = "0.1.3" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "695a1d8b461033d32429b5befbf0ad4d7a2c4d6ba9cd5ba4e0645c615839e8e4" +checksum = "e96e15288bf385ab85eb83cff7f9e2d834348da58d0a31b33bdb572e66ee413e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] name = "swc_error_reporters" -version = "0.18.1" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4689d9bb6092b5e6a0b79c0152336a8bd7f0acaf70dcf4133f86deb01775baa0" +checksum = "44f6ddeea4e330922832e5f1544f8097b46b786c86d200eb3a6ef761ba83ce12" dependencies = [ "anyhow", "miette 7.2.0", @@ -5612,21 +5862,21 @@ dependencies = [ [[package]] name = "swc_fast_graph" -version = "0.22.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c00cf5c1687e9858fb9de1ffa90a3e21369095406e97ace870a389320d105b0a" +checksum = "b1b3add3571bc073f49b4f4fb4326f54c24fe7799296e0ad5341af895150e79c" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.6.0", "petgraph", - "rustc-hash", + "rustc-hash 1.1.0", "swc_common", ] [[package]] name = "swc_html_ast" -version = "0.34.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b909aca7c9cbd630a461d4a0a1d476ac13704dc515d2a79264c93d3280b02d23" +checksum = "2a551d9898a7528b652b19fb4b1003450aee5b5f6e7182b89aadb832d9fe3ca5" dependencies = [ "is-macro", "rkyv", @@ -5637,13 +5887,13 @@ dependencies = [ [[package]] name = "swc_html_codegen" -version = "0.43.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0c66d0bd8beac55009066d2a721ed0ef02541774c9efba13225fbe7bbdf224" +checksum = "12419d070a0d184f599e804394d357d5c05f9a4264543ab62a057429ba86a95d" dependencies = [ "auto_impl", - "bitflags 2.5.0", - "rustc-hash", + "bitflags 2.6.0", + "rustc-hash 1.1.0", "swc_atoms", "swc_common", "swc_html_ast", @@ -5653,21 +5903,21 @@ dependencies = [ [[package]] name = "swc_html_codegen_macros" -version = "0.2.4" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e593a6cbb3a49230fbab3171d4493f7d0fb1e20a34d9a9f9e972550690408ba8" +checksum = "faba8a7b6944ce27a17de34a6578e6900bb13db4247c2a004e6ed22658e9cad5" dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] name = "swc_html_minifier" -version = "0.139.1" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4123894a8afd7b8d160d1b45c74fc33edb4259d76d06b6c67ff2d9d0f6aea3a8" +checksum = "72cd273c60195f88ab0651492c8a223923dc91d42602dec07555900aff648d44" dependencies = [ "once_cell", "serde", @@ -5694,9 +5944,9 @@ dependencies = [ [[package]] name = "swc_html_parser" -version = "0.40.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0558d837b555f0b964d8a3ec94fef3fab31f89a685154cb208bfc968d29b437" +checksum = "fb4f2850e8108394c5cdd4f3a3b4715eb99acd4fed30e6da35f090414f13af61" dependencies = [ "swc_atoms", "swc_common", @@ -5706,9 +5956,9 @@ dependencies = [ [[package]] name = "swc_html_utils" -version = "0.19.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcffb3ca55f7cf634247930aa1c4d8368bdf37140622d62af91a02e9dfa867a0" +checksum = "c17d92636f5e4c64bb9417eb69c97ae5d45d1915f6e97d22c36e1621d53867be" dependencies = [ "once_cell", "serde", @@ -5719,9 +5969,9 @@ dependencies = [ [[package]] name = "swc_html_visit" -version = "0.34.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37918caedd27d784ebd0a0b6f2489a01f7cff4a1a2fba58fd90d8912e0938159" +checksum = "191ea427c86b7f7c0fe07db1047de818c5a4f7076ddf97aa779d636a6941f794" dependencies = [ "serde", "swc_atoms", @@ -5732,20 +5982,20 @@ dependencies = [ [[package]] name = "swc_macros_common" -version = "0.3.11" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91745f3561057493d2da768437c427c0e979dff7396507ae02f16c981c4a8466" +checksum = "a509f56fca05b39ba6c15f3e58636c3924c78347d63853632ed2ffcb6f5a0ac7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] name = "swc_plugin_proxy" -version = "0.44.2" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d5460f8f89905a6d698d8d9a965f6c99888c8ebcbb5a0266556d06ad39f09f7" +checksum = "676d058cb956ea0ec542b47930b22b045c388cac6d43c2afac83687b2e560957" dependencies = [ "better_scoped_tls", "rkyv", @@ -5757,9 +6007,9 @@ dependencies = [ [[package]] name = "swc_plugin_runner" -version = "0.109.1" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "633742a4ee0d51337b7b29771e94f93badd6944919eaff0515c4a14e7993fc4d" +checksum = "f0f16f595767d7ab0b962a9b59f3ec5ea0c8a205e0e0940ef5ee3a1b39d3dc0c" dependencies = [ "anyhow", "enumset", @@ -5772,6 +6022,7 @@ dependencies = [ "swc_ecma_ast", "swc_plugin_proxy", "tracing", + "vergen", "virtual-fs", "wasmer", "wasmer-cache", @@ -5781,45 +6032,44 @@ dependencies = [ [[package]] name = "swc_timer" -version = "0.22.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f2460de9f00f2af53f65b787c771a6ba90c719d600adb3c71cbb87219646ab4" +checksum = "4db06b46cc832f7cf83c2ce21905fc465d01443a2bdccf63644383e1f5847532" dependencies = [ "tracing", ] [[package]] name = "swc_trace_macro" -version = "0.1.3" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff9719b6085dd2824fd61938a881937be14b08f95e2d27c64c825a9f65e052ba" +checksum = "4c78717a841565df57f811376a3d19c9156091c55175e12d378f3a522de70cef" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] -name = "swc_visit" -version = "0.5.14" +name = "swc_typescript" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043d11fe683dcb934583ead49405c0896a5af5face522e4682c16971ef7871b9" +checksum = "b70dfbda2233c81ecd0da521c6b2e1b318a7f57dc0e8186b7157ed5576db1e02" dependencies = [ - "either", - "swc_visit_macros", + "swc_atoms", + "swc_common", + "swc_ecma_ast", + "thiserror", ] [[package]] -name = "swc_visit_macros" -version = "0.5.12" +name = "swc_visit" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae9ef18ff8daffa999f729db056d2821cd2f790f3a11e46422d19f46bb193e7" +checksum = "9138b6a36bbe76dd6753c4c0794f7e26480ea757bee499738bedbbb3ae3ec5f3" dependencies = [ - "Inflector", - "proc-macro2", - "quote", - "swc_macros_common", - "syn 2.0.65", + "either", + "new_debug_unreachable", ] [[package]] @@ -5835,9 +6085,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.65" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2863d96a84c6439701d7a38f9de935ec562c8832cc55d1dde0f513b52fad106" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2", "quote", @@ -5891,13 +6141,13 @@ dependencies = [ ] [[package]] -name = "term_size" -version = "0.3.2" +name = "terminal_size" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e4129646ca0ed8f45d09b929036bafad5377103edd06e50bf574b353d2b08d9" +checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" dependencies = [ - "libc", - "winapi", + "rustix", + "windows-sys 0.48.0", ] [[package]] @@ -5911,13 +6161,13 @@ dependencies = [ [[package]] name = "textwrap" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" +checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" dependencies = [ "smawk", "unicode-linebreak", - "unicode-width", + "unicode-width 0.1.11", ] [[package]] @@ -5937,7 +6187,7 @@ checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] @@ -5952,13 +6202,15 @@ dependencies = [ [[package]] name = "time" -version = "0.3.34" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", + "libc", "num-conv", + "num_threads", "powerfmt", "serde", "time-core", @@ -5973,9 +6225,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ "num-conv", "time-core", @@ -6017,38 +6269,51 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] -name = "toml" -version = "0.7.8" +name = "tokio-stream" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit 0.19.15", + "futures-core", + "pin-project-lite", + "tokio", + "tokio-util", +] + +[[package]] +name = "tokio-util" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", ] [[package]] name = "toml" -version = "0.8.8" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.21.0", + "toml_edit 0.22.22", ] [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] @@ -6059,24 +6324,22 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.2.6", - "serde", - "serde_spanned", + "indexmap 2.6.0", "toml_datetime", - "winnow", + "winnow 0.5.34", ] [[package]] name = "toml_edit" -version = "0.21.0" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.6.0", "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.6.20", ] [[package]] @@ -6099,7 +6362,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] @@ -6113,9 +6376,9 @@ dependencies = [ [[package]] name = "triomphe" -version = "0.1.11" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859eb650cfee7434994602c3a68b25d77ad9e68c8a6cd491616ef86661382eb3" +checksum = "ef8f7726da4807b58ea5c96fdc122f80702030edc33b35aff9190a51148ccc85" dependencies = [ "serde", "stable_deref_trait", @@ -6127,6 +6390,16 @@ version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8686b91785aff82828ed725225925b33b4fde44c4bb15876e5f7c832724c420a" +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "static_assertions", +] + [[package]] name = "typed-arena" version = "2.0.2" @@ -6162,9 +6435,9 @@ checksum = "b1b6def86329695390197b82c1e244a54a131ceb66c996f2088a3876e2ae083f" [[package]] name = "unicode-id-start" -version = "1.0.4" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02aebfa694eccbbbffdd92922c7de136b9fe764396d2f10e21bce1681477cfc1" +checksum = "97e2a3c5fc9de285c0e805d98eba666adb4b2d9e1049ce44821ff7707cc34e91" [[package]] name = "unicode-ident" @@ -6199,6 +6472,12 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +[[package]] +name = "unicode-width" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" + [[package]] name = "unicode-xid" version = "0.2.4" @@ -6207,9 +6486,9 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "unsafe-libyaml" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" [[package]] name = "url" @@ -6253,6 +6532,32 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" +[[package]] +name = "vergen" +version = "9.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349ed9e45296a581f455bc18039878f409992999bc1d5da12a6800eb18c8752f" +dependencies = [ + "anyhow", + "cargo_metadata", + "derive_builder 0.20.2", + "regex", + "rustversion", + "time", + "vergen-lib", +] + +[[package]] +name = "vergen-lib" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "229eaddb0050920816cf051e619affaf18caa3dd512de8de5839ccbc8e53abb0" +dependencies = [ + "anyhow", + "derive_builder 0.20.2", + "rustversion", +] + [[package]] name = "version_check" version = "0.9.4" @@ -6261,14 +6566,16 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "virtual-fs" -version = "0.11.1" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce7b7674a3d0ddb5915b8f4feccdd6e8680c5980c296688e0f0e7378b8c69e1" +checksum = "e60ef133d8336b201a1618252518d81f9e9d30fbe27449dab706699a549216bc" dependencies = [ "anyhow", "async-trait", "bytes", + "dashmap 6.1.0", "derivative", + "dunce", "filetime", "fs_extra", "futures", @@ -6288,9 +6595,9 @@ dependencies = [ [[package]] name = "virtual-mio" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f38a379f14296f9fb93eda42ece4d57b568af417569102c3dcfeb88ab4800f" +checksum = "ff8026c9d7575dc9afd8a0907357acb7aa55ec262097fbccae5da42f67773b3c" dependencies = [ "async-trait", "bytes", @@ -6305,20 +6612,24 @@ dependencies = [ [[package]] name = "virtual-net" -version = "0.6.2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75b66781480898ee7ee62a2bbe2955ce1bb5a90fdc8bfedbdabe3537b177fa3e" +checksum = "05d9551aa47efdb28093f79845d40858baf5075e4b4a09c7d9c8a0edd42f942b" dependencies = [ "anyhow", "async-trait", "base64 0.21.7", "bincode", + "bytecheck", "bytes", "derivative", "futures-util", "pin-project-lite", + "rkyv", "serde", + "smoltcp", "thiserror", + "tokio", "tracing", "virtual-mio", ] @@ -6354,17 +6665,6 @@ dependencies = [ "wai-bindgen-gen-rust", ] -[[package]] -name = "wai-bindgen-gen-wasmer" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f61484185d8c520a86d5a7f7f8265f446617c2f9774b2e20a52de19b6e53432" -dependencies = [ - "heck 0.3.3", - "wai-bindgen-gen-core", - "wai-bindgen-gen-rust", -] - [[package]] name = "wai-bindgen-rust" version = "0.2.3" @@ -6387,33 +6687,6 @@ dependencies = [ "wai-bindgen-gen-rust-wasm", ] -[[package]] -name = "wai-bindgen-wasmer" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00f4a7cb5421959864b139870a7ebba26eafc9b46648feda9ac143528e9a8769" -dependencies = [ - "anyhow", - "bitflags 1.3.2", - "once_cell", - "thiserror", - "tracing", - "wai-bindgen-wasmer-impl", - "wasmer", -] - -[[package]] -name = "wai-bindgen-wasmer-impl" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b3488ed88d4dd0e3bf85bad4e27dac6cb31aae5d122a5dda2424803c8dc863a" -dependencies = [ - "proc-macro2", - "syn 1.0.109", - "wai-bindgen-gen-core", - "wai-bindgen-gen-wasmer", -] - [[package]] name = "wai-parser" version = "0.2.3" @@ -6470,7 +6743,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.87", "wasm-bindgen-shared", ] @@ -6504,7 +6777,7 @@ checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.87", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6526,9 +6799,9 @@ dependencies = [ [[package]] name = "wasmer" -version = "4.2.5" +version = "4.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5467c7a23f9be04d5691590bea509dbea27e5ba5810d0020bef908456a495f33" +checksum = "4b28d4251f96ece14460328c56ee0525edcf4bbb08748cfd87fef3580ae4d403" dependencies = [ "bytes", "cfg-if", @@ -6542,6 +6815,7 @@ dependencies = [ "shared-buffer", "target-lexicon", "thiserror", + "tracing", "wasm-bindgen", "wasmer-compiler", "wasmer-compiler-cranelift", @@ -6549,14 +6823,14 @@ dependencies = [ "wasmer-types", "wasmer-vm", "wat", - "winapi", + "windows-sys 0.59.0", ] [[package]] name = "wasmer-cache" -version = "4.2.5" +version = "4.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1613ff5e7db7645eab2f003411b1e7a12dcf0ff4677f6e7712ba74ebf40b276" +checksum = "c3b1f3ef1d5a81b101513a125b3aede723a6f0991cb1c85d1fcc252aa4ced011" dependencies = [ "blake3", "hex", @@ -6566,9 +6840,9 @@ dependencies = [ [[package]] name = "wasmer-compiler" -version = "4.2.5" +version = "4.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "510ad01a668d774f3a103a7c219bbc0970be93e8f1b27e2fdb48d1f4ccd1deff" +checksum = "009b8417d51dbca8ac9a640ea999cc924fc59040a81245ecd0e092cb7c45dc10" dependencies = [ "backtrace", "bytes", @@ -6577,6 +6851,7 @@ dependencies = [ "enumset", "lazy_static", "leb128", + "libc", "memmap2 0.5.10", "more-asserts", "region", @@ -6588,14 +6863,15 @@ dependencies = [ "wasmer-types", "wasmer-vm", "wasmparser", - "winapi", + "windows-sys 0.59.0", + "xxhash-rust", ] [[package]] name = "wasmer-compiler-cranelift" -version = "4.2.5" +version = "4.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54bf93078990d83960d798de3c5935bddaba771fc2fefb9ed6bab9c0bbdea5c1" +checksum = "2445c6fb03824979448293e91d8a6daf0cdf66e8d996f31ef270e0d2cc3ea1f3" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -6610,11 +6886,33 @@ dependencies = [ "wasmer-types", ] +[[package]] +name = "wasmer-config" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "644b7e3547bd7e796d92220f60bf57734914254c6cee56607e80177a3e8a28da" +dependencies = [ + "anyhow", + "bytesize", + "ciborium", + "derive_builder 0.12.0", + "hex", + "indexmap 2.6.0", + "schemars", + "semver 1.0.21", + "serde", + "serde_json", + "serde_yaml", + "thiserror", + "toml", + "url", +] + [[package]] name = "wasmer-derive" -version = "4.2.5" +version = "4.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b374fd34d97b1c091d8675f9bc472df52dc6787d139d3762d42c7dc84813a9b" +checksum = "02592d86ac19fb09c972e72edeb3e57ac5c569eac7e77b919b165da014e8c139" dependencies = [ "proc-macro-error", "proc-macro2", @@ -6623,81 +6921,97 @@ dependencies = [ ] [[package]] -name = "wasmer-toml" -version = "0.9.2" +name = "wasmer-journal" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d21472954ee9443235ca32522b17fc8f0fe58e2174556266a0d9766db055cc52" +checksum = "3045807a8a70da47eb06cb55aad673d5774f87f26ee11b7758d63c54b67bc5f4" dependencies = [ "anyhow", - "derive_builder", - "indexmap 2.2.6", - "semver 1.0.21", + "async-trait", + "base64 0.21.7", + "bincode", + "bytecheck", + "bytes", + "derivative", + "lz4_flex", + "num_enum 0.5.11", + "rkyv", "serde", - "serde_cbor", "serde_json", - "serde_yaml 0.9.30", "thiserror", - "toml 0.8.8", + "tracing", + "virtual-fs", + "virtual-net", + "wasmer", + "wasmer-wasix-types", ] [[package]] name = "wasmer-types" -version = "4.2.5" +version = "4.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0caf1c87937b52aba8e9f920a278e1beda282f7439612c0b48f51a58e7a87bab" +checksum = "3d22a00f1a90e9e66d5427853f41e76d8ab89e03eb3034debd11933607fef56a" dependencies = [ - "bytecheck 0.6.11", + "bytecheck", "enum-iterator", "enumset", + "getrandom", + "hex", "indexmap 1.9.3", "more-asserts", "rkyv", "serde", + "sha2", "target-lexicon", "thiserror", + "xxhash-rust", ] [[package]] name = "wasmer-vm" -version = "4.2.5" +version = "4.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58315c25492bc72a33f47a7d7fb0869a0106fc0164ec051e349a9e1eddba9a01" +checksum = "87d88e8355157cd730fb81e33c3b4d6849fd44c26d32bf78820638e1d935967b" dependencies = [ "backtrace", "cc", "cfg-if", "corosensei", "crossbeam-queue", - "dashmap", + "dashmap 6.1.0", "derivative", "enum-iterator", "fnv", "indexmap 1.9.3", "lazy_static", "libc", - "mach", - "memoffset 0.9.0", + "mach2", + "memoffset 0.9.1", "more-asserts", "region", "scopeguard", "thiserror", "wasmer-types", - "winapi", + "windows-sys 0.59.0", ] [[package]] name = "wasmer-wasix" -version = "0.18.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9697b8ffc3a37c193648919018848171de0d75e6e955377893d258431b19d7a" +checksum = "dbfe427dbe359e037e1e33ff13b3a5473706e5679df2dbb0e71b5b46c9bb6ce3" dependencies = [ + "ahash 0.8.11", "anyhow", "async-trait", + "base64 0.21.7", "bincode", + "blake3", + "bytecheck", "bytes", "cfg-if", "cooked-waker", - "dashmap", + "dashmap 6.1.0", "derivative", "futures", "getrandom", @@ -6707,45 +7021,52 @@ dependencies = [ "lazy_static", "libc", "linked_hash_set", + "lz4_flex", + "num_enum 0.5.11", "once_cell", "petgraph", "pin-project", + "pin-utils", "rand", + "rkyv", "rusty_pool", "semver 1.0.21", "serde", - "serde_cbor", "serde_derive", "serde_json", - "serde_yaml 0.8.26", + "serde_yaml", "sha2", + "shared-buffer", "tempfile", - "term_size", + "terminal_size", "termios", "thiserror", "tokio", + "tokio-stream", + "toml", "tracing", "url", "urlencoding", "virtual-fs", "virtual-mio", "virtual-net", - "wai-bindgen-wasmer", "waker-fn", "wasmer", + "wasmer-config", + "wasmer-journal", "wasmer-types", "wasmer-wasix-types", "webc", "weezl", - "winapi", + "windows-sys 0.59.0", "xxhash-rust", ] [[package]] name = "wasmer-wasix-types" -version = "0.18.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65ca293eae6e3af6e4fd9fe1c8e096151d4f06cbb405ce5dd65edb779aba42d9" +checksum = "9b9304c02de27468ea4154a31f8758343717d03a29d2a620bc652e8217baab75" dependencies = [ "anyhow", "bitflags 1.3.2", @@ -6767,12 +7088,13 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.95.0" +version = "0.121.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2ea896273ea99b15132414be1da01ab0d8836415083298ecaffbe308eaac87a" +checksum = "9dbe55c8f9d0dbd25d9447a5a889ff90c0cc3feaa7395310d3d826b2c703eaab" dependencies = [ - "indexmap 1.9.3", - "url", + "bitflags 2.6.0", + "indexmap 2.6.0", + "semver 1.0.21", ] [[package]] @@ -6783,7 +7105,7 @@ checksum = "a259b226fd6910225aa7baeba82f9d9933b6d00f2ce1b49b80fa4214328237cc" dependencies = [ "leb128", "memchr", - "unicode-width", + "unicode-width 0.1.11", "wasm-encoder", ] @@ -6937,34 +7259,36 @@ dependencies = [ [[package]] name = "webc" -version = "5.8.1" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "973ca5a91b4fb3e4bb37cfebe03ef9364d0aff2765256abefdb7e79dc9188483" +checksum = "cdea84cf234555864ca9b7a5084c1a99dbdf2d148035f62a09b19ce5606532c1" dependencies = [ "anyhow", - "base64 0.21.7", - "byteorder", + "base64 0.22.1", "bytes", + "cfg-if", + "ciborium", + "document-features", "flate2", + "ignore", "indexmap 1.9.3", "leb128", "lexical-sort", + "libc", "once_cell", "path-clean 1.0.1", "rand", "semver 1.0.21", "serde", - "serde_cbor", "serde_json", "sha2", "shared-buffer", "tar", "tempfile", "thiserror", - "toml 0.7.8", + "toml", "url", - "walkdir", - "wasmer-toml", + "wasmer-config", ] [[package]] @@ -7010,7 +7334,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.6", ] [[package]] @@ -7050,7 +7374,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -7085,17 +7418,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -7112,9 +7446,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -7136,9 +7470,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -7160,9 +7494,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -7184,9 +7524,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -7208,9 +7548,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -7226,9 +7566,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -7250,9 +7590,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winit" @@ -7297,6 +7637,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "winnow" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +dependencies = [ + "memchr", +] + [[package]] name = "wyz" version = "0.5.1" @@ -7359,18 +7708,9 @@ checksum = "791978798f0597cfc70478424c2b4fdc2b7a8024aaff78497ef00f24ef674193" [[package]] name = "xxhash-rust" -version = "0.8.8" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53be06678ed9e83edb1745eb72efc0bbcd7b5c3c35711a860906aed827a13d61" - -[[package]] -name = "yaml-rust" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" -dependencies = [ - "linked-hash-map", -] +checksum = "6a5cbf750400958819fb6178eaa83bee5cd9c29a26a40cc241df8c70fdd46984" [[package]] name = "zerocopy" @@ -7389,7 +7729,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.87", ] [[package]] diff --git a/bench/benches/example.bench.ts b/bench/benches/example.bench.ts deleted file mode 100644 index ef36dd6e0c..0000000000 --- a/bench/benches/example.bench.ts +++ /dev/null @@ -1,25 +0,0 @@ -import path from 'node:path'; -import { build } from '@farmfe/core'; -import { bench, describe } from 'vitest'; - -async function build_react_example() { - await build({ - root: path.resolve(process.cwd(), './examples/react'), - configPath: path.resolve('./examples/react'), - compilation: { input: {}, output: {} } - }); -} - -describe('react_example_bench', () => { - let hasRun = false; - bench( - 'build_react_example', - async () => { - if (!hasRun) { - await build_react_example(); - hasRun = true; - } - }, - { warmupIterations: 0 } - ); -}); diff --git a/bench/vitest.config.mts b/bench/vitest.config.mts deleted file mode 100644 index 81970d7aff..0000000000 --- a/bench/vitest.config.mts +++ /dev/null @@ -1,6 +0,0 @@ -import { defineConfig } from 'vitest/config'; -import codspeedPlugin from '@codspeed/vitest-plugin'; - -export default defineConfig({ - plugins: [codspeedPlugin()] -}); diff --git a/biome.json b/biome.json index df15d80b53..dca2c3fc0a 100644 --- a/biome.json +++ b/biome.json @@ -4,7 +4,7 @@ "clientKind": "git", "enabled": true, "useIgnoreFile": true, - "defaultBranch": "main" + "defaultBranch": "v2-dev" }, "files": { "ignore": [ @@ -48,12 +48,12 @@ "rules": { "recommended": false, "complexity": { - "noBannedTypes": "warn", + "noBannedTypes": "off", "noExtraBooleanCast": "error", "noMultipleSpacesInRegularExpressionLiterals": "error", - "noUselessCatch": "error", "noUselessTypeConstraint": "error", - "noWith": "error" + "noWith": "error", + "noUselessCatch": "off" }, "correctness": { "noConstAssign": "error", @@ -75,7 +75,7 @@ "noUnsafeFinally": "error", "noUnsafeOptionalChaining": "error", "noUnusedLabels": "error", - "noUnusedVariables": "warn", + "noUnusedVariables": "off", "useIsNan": "error", "useValidForDirection": "error", "useYield": "error" @@ -119,6 +119,7 @@ "**/binding/**", "**/templates/**", "**/dist/**", + "**/docs/**", "**/node_modules/**", "**/*.config.js", "**/*.config.ts" diff --git a/configs/farm-js-plugin.base.config.mjs b/configs/farm-js-plugin.base.config.mjs index 57e9b229a5..5659b702fe 100644 --- a/configs/farm-js-plugin.base.config.mjs +++ b/configs/farm-js-plugin.base.config.mjs @@ -1,46 +1,49 @@ -import { builtinModules } from 'module'; +import { builtinModules } from "module"; -const format = process.env.FARM_FORMAT || 'cjs'; -const ext = format === 'esm' ? 'mjs' : 'cjs'; +const format = process.env.FARM_FORMAT || "cjs"; +const ext = format === "esm" ? "mjs" : "cjs"; export function createFarmJsPluginBuildConfig(plugins, options = {}) { return { compilation: { input: { - index: './src/index.ts' + index: "./src/index.ts", }, output: { path: `build/${format}`, entryFilename: `[entryName].${ext}`, - targetEnv: 'node', - format + targetEnv: "node", + format, }, external: [ - '@farmfe/core', + "@farmfe/core", ...builtinModules.map((m) => `^${m}$`), ...builtinModules.map((m) => `^node:${m}$`), - ...(options.external || []) + ...(options.external || []), ], partialBundling: { enforceResources: [ { - name: 'index.js', - test: ['.+'] - } - ] + name: "index.js", + test: [".+"], + }, + ], }, + progress: false, minify: false, sourcemap: false, presetEnv: false, - persistentCache: { - envs: { - FARM_FORMAT: format - } - } + persistentCache: false, + lazyCompilation: false, + // persistentCache: { + // envs: { + // FARM_FORMAT: format + // } + // } }, server: { - hmr: false + hmr: false, }, - plugins + plugins, }; } diff --git a/crates/bench/CHANGELOG.md b/crates/bench/CHANGELOG.md deleted file mode 100644 index 59148875e1..0000000000 --- a/crates/bench/CHANGELOG.md +++ /dev/null @@ -1,20 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - -## [Unreleased] - -## [0.0.3](https://github.com/farm-fe/farm/compare/farmfe_bench-v0.0.2...farmfe_bench-v0.0.3) - 2024-12-09 - -### Other - -- updated the following local packages: farmfe_compiler, farmfe_core - -## [0.0.2](https://github.com/farm-fe/farm/compare/farmfe_bench-v0.0.1...farmfe_bench-v0.0.2) - 2024-10-31 - -### Other - -- simplify string formatting for readability ([#1828](https://github.com/farm-fe/farm/pull/1828)) diff --git a/crates/bench/Cargo.toml b/crates/bench/Cargo.toml deleted file mode 100644 index 30d835de93..0000000000 --- a/crates/bench/Cargo.toml +++ /dev/null @@ -1,22 +0,0 @@ -[package] -name = "farmfe_bench" -version = "0.0.3" -edition = "2021" -authors = ["brightwu(吴明亮) <1521488775@qq.com>"] -license = "MIT" -description = "Farm Bench" -homepage = "https://farmfe.org" -repository = "https://github.com/farm-fe/farm" -documentation = "https://docs.rs/farmfe_bench" - -[dependencies] -criterion2 = { version = "0.11.0", default-features = false } -farmfe_core = { path = "../core", version = "0.7.1" } -farmfe_compiler = { path = "../compiler", version = "0.0.13" } - -[[bench]] -name = "compiler_bench" -harness = false - -[features] -codspeed = ["criterion2/codspeed"] diff --git a/crates/bench/benches/compiler_bench.rs b/crates/bench/benches/compiler_bench.rs deleted file mode 100644 index b52d9b4c1b..0000000000 --- a/crates/bench/benches/compiler_bench.rs +++ /dev/null @@ -1,56 +0,0 @@ -use criterion::{black_box, criterion_group, criterion_main, Criterion}; -// use codspeed_criterion_compat::{black_box, criterion_group, criterion_main, Criterion}; - -use farmfe_compiler::Compiler; -use farmfe_core::{ - config::{Config, RuntimeConfig}, - relative_path::RelativePath, -}; - -fn setup_compiler() -> Compiler { - let relative_root = RelativePath::new("./index.ts"); - let cwd = std::env::current_dir().unwrap(); - let react_examples_root = relative_root.to_logical_path(cwd.clone()); - - Compiler::new( - Config { - root: react_examples_root.to_string_lossy().to_string(), - runtime: Box::new(RuntimeConfig { - path: cwd - .join("packages") - .join("runtime") - .join("src") - .join("index.ts") - .to_string_lossy() - .to_string(), - plugins: vec![], - swc_helpers_path: cwd - .join("packages") - .join("core") - .join("node_modules") - .join("@swc") - .join("helpers") - .read_link() - .unwrap() - .to_string_lossy() - .to_string(), - ..Default::default() - }), - ..Default::default() - }, - vec![], - ) - .unwrap() -} - -fn bench_compiler_compile(c: &mut Criterion) { - let compiler = setup_compiler(); - c.bench_function("compiler_compile", |b| { - b.iter(|| { - black_box(compiler.compile().unwrap()); - }) - }); -} - -criterion_group!(benches, bench_compiler_compile); -criterion_main!(benches); diff --git a/crates/compiler/Cargo.toml b/crates/compiler/Cargo.toml index f93fe17e61..e6e11bb823 100644 --- a/crates/compiler/Cargo.toml +++ b/crates/compiler/Cargo.toml @@ -14,6 +14,7 @@ farmfe_core = { path = "../core", version = "0.7.1" } farmfe_plugin_partial_bundling = { path = "../plugin_partial_bundling", version = "0.0.13" } farmfe_plugin_resolve = { path = "../plugin_resolve", version = "0.0.13" } farmfe_plugin_script = { path = "../plugin_script", version = "0.0.12" } +farmfe_plugin_script_meta = { path = "../plugin_script_meta", version = "0.0.1" } farmfe_plugin_runtime = { path = "../plugin_runtime", version = "0.0.13" } farmfe_plugin_html = { path = "../plugin_html", version = "0.0.13" } farmfe_plugin_tree_shake = { path = "../plugin_tree_shake", version = "0.0.12" } @@ -28,8 +29,9 @@ farmfe_plugin_json = { path = "../plugin_json", version = "0.0.13" } farmfe_plugin_polyfill = { path = "../plugin_polyfill", version = "0.0.13" } farmfe_plugin_progress = { path = "../plugin_progress", version = "0.0.13" } farmfe_plugin_define = { path = "../plugin_define", version = "0.0.13" } -farmfe_plugin_bundle = { path = "../plugin_bundle", version = "0.0.7" } -num_cpus = "1.16.0" +farmfe_plugin_mangle_exports = { path = "../plugin_mangle_exports", version = "0.0.1" } +farmfe_plugin_library = { path = "../plugin_library", version = "0.0.1" } +farmfe_plugin_file_size = { path = "../plugin_file_size", version = "0.0.1" } farmfe_testing = { path = "../macro_testing", version = "0.0.2" } [features] diff --git a/crates/compiler/src/build/finalize_module.rs b/crates/compiler/src/build/finalize_module.rs index 8929c97014..b757b37613 100644 --- a/crates/compiler/src/build/finalize_module.rs +++ b/crates/compiler/src/build/finalize_module.rs @@ -9,7 +9,7 @@ use farmfe_core::{ pub fn finalize_module( module: &mut Module, - deps: &Vec, + deps: &mut Vec, context: &Arc, ) -> Result<()> { #[cfg(feature = "profile")] diff --git a/crates/compiler/src/build/finalize_module_graph.rs b/crates/compiler/src/build/finalize_module_graph.rs new file mode 100644 index 0000000000..1f06dc046d --- /dev/null +++ b/crates/compiler/src/build/finalize_module_graph.rs @@ -0,0 +1,147 @@ +use std::sync::Arc; + +use farmfe_core::{ + context::CompilationContext, + farm_profile_function, farm_profile_scope, + module::{ + module_graph::{ModuleGraph, ModuleGraphEdge}, + ModuleId, + }, + plugin::hooks::freeze_module::PluginFreezeModuleHookParam, + rayon::iter::{IntoParallelRefMutIterator, ParallelIterator}, + HashMap, +}; + +use super::module_cache::set_module_graph_cache; + +/// Finalize module graph when module graph is built: +/// 1. call module_graph_build_end hook +/// 2. update execution order of module graph +pub fn finalize_module_graph(context: &Arc) -> farmfe_core::error::Result<()> { + let mut module_graph = context.module_graph.write(); + + { + farm_profile_scope!("call module_graph_build_end hook".to_string()); + context + .plugin_driver + .module_graph_build_end(&mut module_graph, context)?; + } + + // update execution order when the module graph is freezed in build stage + module_graph.update_execution_order_for_modules(); + + Ok(()) +} + +pub(super) fn cache_module_graph(context: &Arc) { + let module_ids = { + let module_graph = context.module_graph.read(); + module_graph + .modules() + .iter() + .map(|m| m.id.clone()) + .collect::>() + }; + + // set new module cache + set_module_graph_cache(module_ids, context); +} + +pub(super) fn freeze_module_of_module_graph( + context: &Arc, +) -> farmfe_core::error::Result<()> { + farm_profile_function!("call freeze_module hook".to_string()); + let mut module_graph = context.module_graph.write(); + + let module_ids = module_graph.modules().into_iter().map(|m| m.id.clone()); + + let mut resolved_deps_map = get_resolved_deps_of_modules(module_ids.collect(), &module_graph); + + let hook_params = module_graph + .modules_mut() + .into_iter() + .map(|module| { + let resolved_deps = resolved_deps_map.remove(&module.id).unwrap(); + PluginFreezeModuleHookParam { + module, + resolved_deps, + } + }) + .collect::>(); + + let module_resolved_deps = call_freeze_module_with_params(hook_params, context)?; + + update_modules_resolved_deps(module_resolved_deps, &mut module_graph); + + Ok(()) +} + +pub fn get_resolved_deps_of_modules( + module_ids: Vec, + module_graph: &ModuleGraph, +) -> HashMap> { + let mut resolved_deps = HashMap::default(); + + for module_id in module_ids { + let deps = module_graph.dependencies(&module_id); + resolved_deps.insert( + module_id, + deps + .into_iter() + .map(|(id, edge)| (id, edge.clone())) + .collect::>(), + ); + } + + resolved_deps +} + +/// Call freeze module hook with persistent cache +pub fn call_freeze_module_hook( + param: &mut PluginFreezeModuleHookParam, + context: &Arc, +) -> farmfe_core::error::Result<()> { + // the result of freeze_module will be used from module cache if the module does not change + if context + .cache_manager + .module_cache + .is_cache_changed(param.module) + { + return context.plugin_driver.freeze_module(param, context); + } + + Ok(()) +} + +pub type ModuleResolvedDeps = Vec<(ModuleId, Vec<(ModuleId, ModuleGraphEdge)>)>; + +pub fn call_freeze_module_with_params( + mut hook_params: Vec, + context: &Arc, +) -> farmfe_core::error::Result { + hook_params + .par_iter_mut() + .try_for_each(|param| call_freeze_module_hook(param, context))?; + + Ok( + hook_params + .into_iter() + .map(|param| (param.module.id.clone(), param.resolved_deps)) + .collect::>(), + ) +} + +pub fn update_modules_resolved_deps( + module_resolved_deps: Vec<(ModuleId, Vec<(ModuleId, ModuleGraphEdge)>)>, + module_graph: &mut ModuleGraph, +) { + for (module_id, resolved_deps) in module_resolved_deps { + for (dep_id, edge) in resolved_deps { + if module_graph.has_edge(&module_id, &dep_id) { + module_graph.update_edge(&module_id, &dep_id, edge).unwrap(); + } else { + module_graph.add_edge(&module_id, &dep_id, edge).unwrap(); + } + } + } +} diff --git a/crates/compiler/src/build/mod.rs b/crates/compiler/src/build/mod.rs index bb3acf990a..0dd9944222 100644 --- a/crates/compiler/src/build/mod.rs +++ b/crates/compiler/src/build/mod.rs @@ -1,5 +1,4 @@ use std::{ - collections::HashMap, path::PathBuf, sync::{ mpsc::{channel, Receiver, Sender}, @@ -24,23 +23,28 @@ use farmfe_core::{ }, rayon::ThreadPool, serde_json::json, + HashMap, }; use farmfe_plugin_lazy_compilation::DYNAMIC_VIRTUAL_SUFFIX; use farmfe_toolkit::resolve::load_package_json; use farmfe_utils::stringify_query; +use finalize_module_graph::{ + cache_module_graph, finalize_module_graph, freeze_module_of_module_graph, +}; use crate::{ build::{ analyze_deps::analyze_deps, finalize_module::finalize_module, load::load, parse::parse, resolve::resolve, transform::transform, }, + utils::get_module_ids_from_compilation_errors, Compiler, }; use self::module_cache::{ get_content_hash_of_module, get_timestamp_of_module, handle_cached_modules, - set_module_graph_cache, try_get_module_cache_by_hash, try_get_module_cache_by_timestamp, + try_get_module_cache_by_hash, try_get_module_cache_by_timestamp, }; macro_rules! call_and_catch_error { @@ -55,7 +59,9 @@ macro_rules! call_and_catch_error { } pub(crate) mod analyze_deps; +// pub(crate) mod dynamic_input; pub(crate) mod finalize_module; +pub(crate) mod finalize_module_graph; pub(crate) mod load; pub(crate) mod module_cache; pub(crate) mod parse; @@ -104,25 +110,33 @@ impl Compiler { fn set_module_graph_stats(&self) { if self.context.config.record { let module_graph = self.context.module_graph.read(); + self.context.stats.set_module_graph_stats(&module_graph); self .context - .record_manager - .set_module_graph_stats(&module_graph); - self - .context - .record_manager - .set_entries(module_graph.entries.keys().cloned().collect()) + .stats + .set_entries(module_graph.entries.keys().cloned().collect()); + } + } + + pub fn set_last_fail_module_ids(&self, errors: &[CompilationError]) { + let mut last_fail_module_ids = self.last_fail_module_ids.lock(); + last_fail_module_ids.clear(); + + for id in get_module_ids_from_compilation_errors(errors) { + if !last_fail_module_ids.contains(&id) { + last_fail_module_ids.push(id); + } } } pub(crate) fn build(&self) -> Result<()> { self.context.plugin_driver.build_start(&self.context)?; + // TODO: support context.add_dynamic_input for plugins to call Compiler::build_module_graph_threaded through thread channel let (err_sender, err_receiver) = Self::create_thread_channel(); - for (order, (name, source)) in self.context.config.input.iter().enumerate() { let params = BuildModuleGraphThreadedParams { - thread_pool: self.thread_pool.clone(), + thread_pool: self.context.thread_pool.clone(), resolve_param: PluginResolveHookParam { source: source.clone(), importer: None, @@ -145,12 +159,16 @@ impl Compiler { } self.handle_global_log(&mut errors); + if !errors.is_empty() { // set stats if stats is enabled - self.context.record_manager.set_build_end_time(); - self.context.record_manager.set_end_time(); + self.context.stats.set_build_end_time(); + self.context.stats.set_end_time(); self.set_module_graph_stats(); + // set last failed module ids + self.set_last_fail_module_ids(&errors); + let mut error_messages = vec![]; for error in errors { error_messages.push(error.to_string()); @@ -160,34 +178,27 @@ impl Compiler { .map(|e| e.to_string()) .collect::>()); return Err(CompilationError::GenericError(errors_json.to_string())); + } else { + self.set_last_fail_module_ids(&[]); } - // set module graph cache + freeze_module_of_module_graph(&self.context)?; + if self.context.config.persistent_cache.enabled() { - let module_ids = self - .context - .module_graph - .read() - .modules() - .into_iter() - .map(|m| m.id.clone()) - .collect(); - // set new module cache - set_module_graph_cache(module_ids, &self.context); + cache_module_graph(&self.context); } - // Topo sort the module graph - let mut module_graph = self.context.module_graph.write(); - module_graph.update_execution_order_for_modules(); - drop(module_graph); + finalize_module_graph(&self.context)?; // set stats if stats is enabled self.set_module_graph_stats(); { farm_profile_scope!("call build_end hook".to_string()); - self.context.plugin_driver.build_end(&self.context) + self.context.plugin_driver.build_end(&self.context)?; } + + Ok(()) } pub(crate) fn handle_global_log(&self, errors: &mut Vec) { @@ -227,7 +238,7 @@ impl Compiler { let hook_context = PluginHookContext { caller: None, - meta: HashMap::new(), + meta: HashMap::default(), }; let resolve_kind = resolve_param.kind.clone(); let mut resolve_result = match resolve(resolve_param, context, &hook_context) { @@ -279,7 +290,7 @@ impl Compiler { let hook_context = PluginHookContext { caller: None, - meta: HashMap::new(), + meta: HashMap::default(), }; // ================ Load Start =============== @@ -345,7 +356,7 @@ impl Compiler { fn build_module_after_transform( resolve_result: PluginResolveHookResult, load_module_type: ModuleType, - transform_result: PluginDriverTransformHookResult, + mut transform_result: PluginDriverTransformHookResult, module: &mut Module, context: &Arc, hook_context: &PluginHookContext, @@ -367,8 +378,9 @@ impl Compiler { &mut PluginProcessModuleHookParam { module_id: &parse_param.module_id, module_type: &parse_param.module_type, - content: module.content.clone(), + content: &mut module.content, meta: &mut module_meta, + source_map_chain: &mut transform_result.source_map_chain, }, context, ) { @@ -393,11 +405,11 @@ impl Compiler { module.package_version = package_info.version.unwrap_or("0.0.0".to_string()); // ================ Analyze Deps Start =============== - let analyze_deps_result = call_and_catch_error!(analyze_deps, module, context); + let mut analyze_deps_result = call_and_catch_error!(analyze_deps, module, context); // ================ Analyze Deps End =============== // ================ Finalize Module Start =============== - call_and_catch_error!(finalize_module, module, &analyze_deps_result, context); + call_and_catch_error!(finalize_module, module, &mut analyze_deps_result, context); // ================ Finalize Module End =============== Ok(analyze_deps_result) @@ -462,14 +474,32 @@ impl Compiler { resolve_module_id_result, }) => { farm_profile_scope!(format!("new module {:?}", module.id)); + if resolve_module_id_result.resolve_result.external { // insert external module to the graph let module_id = module.id.clone(); - Self::add_module(module, &resolve_param.kind, &context); + Self::add_module(module, &context); Self::add_edge(&resolve_param, module_id, order, &context); return; } + // mark entry module first after resolving + if let ResolveKind::Entry(ref name) = resolve_param.kind { + context + .module_graph + .write() + .entries + .insert(module.id.clone(), name.to_string()); + module.is_entry = true; + } else if let ResolveKind::DynamicEntry { ref name, .. } = resolve_param.kind { + context + .module_graph + .write() + .dynamic_entries + .insert(module.id.clone(), name.to_string()); + module.is_dynamic_entry = true; + } + match Self::build_module( resolve_module_id_result.resolve_result, &mut module, @@ -510,7 +540,7 @@ impl Compiler { let module_id = module.id.clone(); let immutable = module.immutable; // add module to the graph - Self::add_module(module, &resolve_param.kind, &context); + Self::add_module(module, &context); // add edge to the graph Self::add_edge(&resolve_param, module_id.clone(), order, &context); @@ -554,16 +584,9 @@ impl Compiler { } /// add a module to the module graph, if the module already exists, update it - pub(crate) fn add_module(module: Module, kind: &ResolveKind, context: &CompilationContext) { + pub(crate) fn add_module(module: Module, context: &CompilationContext) { let mut module_graph = context.module_graph.write(); - // mark entry module - if let ResolveKind::Entry(name) = kind { - module_graph - .entries - .insert(module.id.clone(), name.to_string()); - } - // check if the module already exists if module_graph.has_module(&module.id) { module_graph.replace_module(module); diff --git a/crates/compiler/src/build/module_cache.rs b/crates/compiler/src/build/module_cache.rs index baf558b746..b5be32c8bc 100644 --- a/crates/compiler/src/build/module_cache.rs +++ b/crates/compiler/src/build/module_cache.rs @@ -1,18 +1,16 @@ -use std::{ - collections::{HashMap, HashSet}, - path::PathBuf, - sync::Arc, - time::SystemTime, -}; +use std::{path::PathBuf, sync::Arc, time::SystemTime}; use farmfe_core::{ cache::module_cache::{CachedModule, CachedModuleDependency, CachedWatchDependency}, - context::CompilationContext, + context::{create_swc_source_map, CompilationContext}, dashmap::DashMap, farm_profile_function, module::ModuleId, rayon::prelude::*, + swc_common::Globals, + HashMap, HashSet, }; +use farmfe_toolkit::script::swc_try_with::resolve_module_mark; pub fn get_timestamp_of_module(module_id: &ModuleId, root: &str) -> u128 { farm_profile_function!(format!("get_timestamp_of_module: {:?}", module_id)); @@ -161,7 +159,7 @@ pub fn try_get_module_cache_by_hash( pub fn set_module_graph_cache(module_ids: Vec, context: &Arc) { farm_profile_function!("set_module_graph_cache".to_string()); let module_graph = context.module_graph.read(); - let mut cacheable_modules = HashSet::new(); + let mut cacheable_modules = HashSet::default(); let modules = module_ids .iter() @@ -249,12 +247,30 @@ pub fn handle_cached_modules( cached_module: &mut CachedModule, context: &Arc, ) -> farmfe_core::error::Result<()> { + // create a new sourcemap for the cached module cause the sourcemap of swc is not cacheable + let (source_map, _) = create_swc_source_map( + &cached_module.module.id, + cached_module.module.content.clone(), + ); + context + .meta + .set_module_source_map(&cached_module.module.id, source_map); + context + .meta + .set_globals(&cached_module.module.id, Globals::new()); + // using swc resolver match &mut cached_module.module.meta { box farmfe_core::module::ModuleMetaData::Script(script) => { - // reset the mark to prevent the mark from being reused, it will be re-resolved later - script.top_level_mark = 0; - script.unresolved_mark = 0; + // reset the mark to prevent the mark from being reused + let (unresolved_mark, top_level_mark) = resolve_module_mark( + &mut script.ast, + cached_module.module.module_type.is_typescript(), + context.meta.get_globals(&cached_module.module.id).value(), + ); + + script.top_level_mark = unresolved_mark.as_u32(); + script.unresolved_mark = top_level_mark.as_u32(); } box farmfe_core::module::ModuleMetaData::Css(_) | box farmfe_core::module::ModuleMetaData::Html(_) => { /* do nothing */ } @@ -270,7 +286,7 @@ pub fn handle_cached_modules( // clear module groups and resource pot as it will be re-resolved later cached_module.module.module_groups.clear(); - cached_module.module.resource_pot = None; + cached_module.module.resource_pots = Default::default(); cached_module.module.used_exports.clear(); // TODO: return of resolve hook should be treated as part of the cache key @@ -355,6 +371,7 @@ fn is_watch_dependencies_content_hash_changed( .collect::>(); for dep in relation_dependencies { + // TODO using context.load first for virtual modules, then read file string if context.load returns None let resolved_path = PathBuf::from(dep.resolved_path(&context.config.root)); let cached_hash = cached_dep_hash_map.get(dep); diff --git a/crates/compiler/src/generate/finalize_resources.rs b/crates/compiler/src/generate/finalize_resources.rs index 58df151bf3..a429ad58a7 100644 --- a/crates/compiler/src/generate/finalize_resources.rs +++ b/crates/compiler/src/generate/finalize_resources.rs @@ -1,14 +1,27 @@ use std::sync::Arc; use farmfe_core::{ - config::Mode, context::CompilationContext, plugin::PluginFinalizeResourcesHookParams, + config::Mode, + context::CompilationContext, + module::{ + module_group::{ModuleGroupId, ModuleGroupType}, + ModuleId, + }, + plugin::{PluginFinalizeResourcesHookParam, PluginHandleEntryResourceHookParam}, + resource::{Resource, ResourceType}, + HashMap, +}; +use farmfe_toolkit::resources::{ + get_dynamic_resources_code, get_dynamic_resources_map, get_initial_resources, InitialResources, }; pub fn finalize_resources(context: &Arc) -> farmfe_core::error::Result<()> { { let mut resources_map = context.resources_map.lock(); - let mut param = PluginFinalizeResourcesHookParams { + handle_entry_resource(&mut resources_map, context)?; + + let mut param = PluginFinalizeResourcesHookParam { resources_map: &mut resources_map, config: &context.config, }; @@ -45,3 +58,115 @@ pub fn finalize_resources(context: &Arc) -> farmfe_core::err Ok(()) } + +fn handle_entry_resource( + resources_map: &mut HashMap, + context: &Arc, +) -> farmfe_core::error::Result<()> { + 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(); + + let mut runtime_code = String::new(); + let mut runtime_resource_name = String::new(); + + for resource in resources_map.values() { + if matches!(resource.resource_type, ResourceType::Runtime) { + runtime_code = String::from_utf8(resource.bytes.clone()).unwrap(); + runtime_resource_name = resource.name.clone(); + } + } + + let mut params = PluginHandleEntryResourceHookParam { + resource: Resource::default(), + resource_sourcemap: None, + module_graph: &module_graph, + module_group_graph: &module_group_graph, + resource_pot_map: &resource_pot_map, + entry_module_id: &ModuleId::new("", "", ""), + initial_resources: vec![], + dynamic_resources: String::new(), + dynamic_module_resources_map: String::new(), + runtime_code: &runtime_code, + runtime_resource_name: &runtime_resource_name, + emit_runtime: false, + additional_inject_resources: Default::default(), + }; + + for entry_module_id in module_graph.entries.keys() { + params.entry_module_id = entry_module_id; + + let InitialResources { + entry_resource_name, + entry_resource_sourcemap_name, + initial_resources, + } = get_initial_resources( + entry_module_id, + &module_graph, + &module_group_graph, + &resource_pot_map, + resources_map, + ); + + let entry_resource = resources_map + .get_mut(&entry_resource_name) + .unwrap_or_else(|| { + panic!( + "entry resource {:?} not found in resources_map. Entry module id: {:?}", + entry_resource_name, entry_module_id + ) + }); + params.resource = std::mem::take(entry_resource); + + if let Some(entry_resource_sourcemap_name) = entry_resource_sourcemap_name { + let entry_resource_sourcemap = resources_map + .get_mut(&entry_resource_sourcemap_name) + .unwrap(); + params.resource_sourcemap = Some(std::mem::take(entry_resource_sourcemap)); + } + + params.initial_resources = initial_resources; + + let module_group_id = ModuleGroupId::new(entry_module_id, &ModuleGroupType::Entry); + + let dynamic_resources_map = get_dynamic_resources_map( + &module_group_graph, + &module_group_id, + &resource_pot_map, + resources_map, + &module_graph, + ); + let (dynamic_resources, dynamic_module_resources_map) = if !dynamic_resources_map.is_empty() { + get_dynamic_resources_code(&dynamic_resources_map, context.config.mode) + } else { + ("".to_string(), "".to_string()) + }; + + params.dynamic_resources = dynamic_resources; + params.dynamic_module_resources_map = dynamic_module_resources_map; + + context + .plugin_driver + .handle_entry_resource(&mut params, context)?; + + // write entry resource back to resources_map + let resource = resources_map.get_mut(¶ms.resource.name).unwrap(); + *resource = params.resource; + + if let Some(sourcemap_resource) = std::mem::take(&mut params.resource_sourcemap) { + let resource = resources_map.get_mut(&sourcemap_resource.name).unwrap(); + *resource = sourcemap_resource; + } + } + + if params.emit_runtime { + let runtime_resource = resources_map.get_mut(&runtime_resource_name).unwrap(); + runtime_resource.emitted = false; + } + + for (name, resource) in params.additional_inject_resources { + resources_map.insert(name, resource); + } + + Ok(()) +} diff --git a/crates/compiler/src/generate/mod.rs b/crates/compiler/src/generate/mod.rs index 473bc1d0bb..ebaa78564c 100644 --- a/crates/compiler/src/generate/mod.rs +++ b/crates/compiler/src/generate/mod.rs @@ -1,5 +1,4 @@ -use std::collections::HashMap; - +use farmfe_core::HashMap; use farmfe_core::{error::Result, plugin::PluginHookContext}; use crate::{ @@ -19,10 +18,9 @@ impl Compiler { /// the generate stage pub(crate) fn generate(&self) -> Result<()> { self.context.plugin_driver.generate_start(&self.context)?; - let hook_context = PluginHookContext { caller: None, - meta: HashMap::new(), + meta: HashMap::default(), }; self.optimize_module_graph()?; diff --git a/crates/compiler/src/generate/partial_bundling.rs b/crates/compiler/src/generate/partial_bundling.rs index 6587a770b5..1a4200d338 100644 --- a/crates/compiler/src/generate/partial_bundling.rs +++ b/crates/compiler/src/generate/partial_bundling.rs @@ -1,16 +1,20 @@ -use std::collections::HashSet; use std::sync::Arc; use farmfe_core::{ config::partial_bundling::PartialBundlingEnforceResourceConfig, context::CompilationContext, error::CompilationError, - module::{module_graph::ModuleGraph, module_group::ModuleGroupGraph, Module, ModuleId}, + module::{ + module_graph::ModuleGraph, + module_group::{ModuleGroup, ModuleGroupGraph, ModuleGroupType}, + Module, ModuleId, + }, plugin::PluginHookContext, resource::{ resource_pot::{ResourcePot, ResourcePotType}, resource_pot_map::ResourcePotMap, }, + HashSet, }; pub fn partial_bundling( @@ -55,11 +59,15 @@ pub fn generate_resource_pot_map( hook_context: &PluginHookContext, ) -> farmfe_core::error::Result { let (enforce_resource_pots, modules) = generate_enforce_resource_pots(context); + let dynamic_entry_resource_pots = generate_dynamic_entry_resource_pots(context); let mut resources_pots = call_partial_bundling_hook(&modules, context, hook_context)?; // extends enforce resource pots resources_pots.extend(enforce_resource_pots); + fill_necessary_fields_for_resource_pot(resources_pots.iter_mut().collect(), context); + // the neccessary fields are filled when generating dynamic entry resource pots, so we push them after calling fill_necessary_fields_for_resource_pot + resources_pots.extend(dynamic_entry_resource_pots); let mut resource_pot_map = ResourcePotMap::new(); @@ -110,17 +118,31 @@ pub fn fill_necessary_fields_for_resource_pot( let mut module_group_graph = context.module_group_graph.write(); for resource_pot in resources_pots { - let mut module_groups = HashSet::new(); + let mut module_groups = HashSet::default(); let mut entry_module = None; for module_id in resource_pot.modules() { let module = module_graph.module_mut(module_id).unwrap(); - module.resource_pot = Some(resource_pot.id.clone()); - module_groups.extend(module.module_groups.clone()); + module.resource_pots.insert(resource_pot.id.clone()); + module_groups.extend( + module + .module_groups + .iter() + .filter(|mg| { + // ignore dynamic entry module group when filling necessary fields + // for dynamic entry resource pots the necessary fields are filled when generating dynamic entry resource pots + let module_group = module_group_graph.module_group(mg).unwrap(); + !matches!( + module_group.module_group_type, + ModuleGroupType::DynamicEntry + ) + }) + .cloned(), + ); if module_graph.entries.contains_key(module_id) { if entry_module.is_some() { - panic!("a resource pot can only have one entry module, but both {:?} and {:?} are entry modules", entry_module.unwrap(), module_id); + panic!("a resource pot({}) can only have one entry module, but both {:?} and {:?} are entry modules", resource_pot.id, entry_module.unwrap(), module_id); } entry_module = Some(module_id.clone()); } @@ -163,13 +185,18 @@ pub fn get_resource_pot_id_for_enforce_resources_by_removed_module( fn generate_enforce_resource_pots( context: &Arc, ) -> (Vec, Vec) { - let mut modules = HashSet::new(); + let mut modules = HashSet::default(); let mut enforce_resource_pot_map = ResourcePotMap::new(); let module_graph = context.module_graph.read(); let module_group_graph = context.module_group_graph.read(); // generate enforce resource pots first for g in module_group_graph.module_groups() { + // skip dynamic entry module group + if matches!(g.module_group_type, ModuleGroupType::DynamicEntry) { + continue; + } + for module_id in g.modules() { // ignore external module if module_graph.module(module_id).unwrap().external { @@ -206,9 +233,60 @@ fn generate_enforce_resource_pots( (enforce_resource_pot_map.take_resource_pots(), modules) } +fn generate_dynamic_entry_resource_pots(context: &Arc) -> Vec { + let mut module_graph = context.module_graph.write(); + let mut module_group_graph = context.module_group_graph.write(); + let mut resource_pots = vec![]; + + for module_group in module_group_graph + .module_groups_mut() + .into_iter() + .filter(|m| matches!(m.module_group_type, ModuleGroupType::DynamicEntry)) + { + if let Some(resource_pot) = + dynamic_entry_module_group_to_resource_pot(&mut module_graph, module_group) + { + resource_pots.push(resource_pot); + } + } + + resource_pots +} + +pub fn dynamic_entry_module_group_to_resource_pot( + module_graph: &mut ModuleGraph, + module_group: &mut ModuleGroup, +) -> Option { + if let Some(name) = module_graph + .dynamic_entries + .get(&module_group.entry_module_id) + { + let entry_module = module_graph.module(&module_group.entry_module_id).unwrap(); + let mut resource_pot = ResourcePot::new( + name.to_string(), + ResourcePotType::from(entry_module.module_type.clone()), + ); + resource_pot.entry_module = Some(module_group.entry_module_id.clone()); + resource_pot.module_groups = HashSet::from_iter([module_group.id.clone()]); + resource_pot.is_dynamic_entry = true; + + for module_id in module_group.modules() { + resource_pot.add_module(module_id.clone()); + + let module = module_graph.module_mut(module_id).unwrap(); + module.resource_pots.insert(resource_pot.id.clone()); + } + + module_group.add_resource_pot(resource_pot.id.clone()); + + return Some(resource_pot); + } + + None +} + #[cfg(test)] mod tests { - use std::collections::HashSet; use std::sync::Arc; use farmfe_core::{ @@ -219,7 +297,7 @@ mod tests { plugin::{Plugin, PluginHookContext}, }; use farmfe_plugin_partial_bundling::module_group_graph_from_entries; - use farmfe_testing_helpers::construct_test_module_graph_complex; + use farmfe_testing_helpers::{assert_resource_pots, construct_test_module_graph_complex}; use super::generate_resource_pot_map; @@ -227,10 +305,7 @@ mod tests { fn test_generate_resource_pot_map() { let mut module_graph = construct_test_module_graph_complex(); let module_group_graph = module_group_graph_from_entries( - &module_graph - .entries - .clone().into_keys() - .collect(), + &module_graph.entries.clone().into_keys().collect(), &mut module_graph, ); @@ -261,43 +336,7 @@ mod tests { resource_pots.sort_by_key(|p| p.id.clone()); assert_eq!(resource_pots.len(), 5); - // A, C - assert_eq!(resource_pots[0].modules(), vec![&"A".into(), &"C".into()]); - assert_eq!(resource_pots[0].entry_module, Some("A".into())); - // B, E - assert_eq!(resource_pots[1].modules(), vec![&"B".into(), &"E".into()]); - assert_eq!(resource_pots[1].entry_module, Some("B".into())); - // D - assert_eq!(resource_pots[2].modules(), vec![&"D".into()]); - // G - assert_eq!(resource_pots[3].modules(), vec![&"G".into()]); - // F, H - assert_eq!(resource_pots[4].modules(), vec![&"F".into(), &"H".into()]); - - // assert necessary fields are filled - assert_eq!( - resource_pots[0].module_groups, - HashSet::from(["A".into(), "F".into()]) - ); - assert_eq!(resource_pots[0].entry_module, Some("A".into())); - - assert_eq!(resource_pots[1].module_groups, HashSet::from(["B".into()])); - assert_eq!(resource_pots[1].entry_module, Some("B".into())); - - assert_eq!( - resource_pots[2].module_groups, - HashSet::from(["D".into(), "B".into()]) - ); - assert_eq!(resource_pots[2].entry_module, None); - - assert_eq!(resource_pots[3].module_groups, HashSet::from(["G".into()])); - assert_eq!(resource_pots[3].entry_module, None); - - assert_eq!( - resource_pots[4].module_groups, - HashSet::from(["F".into(), "G".into(), "B".into(), "D".into()]) - ); - assert_eq!(resource_pots[4].entry_module, None); + assert_resource_pots!(resource_pots); } #[test] @@ -307,10 +346,7 @@ mod tests { module_graph.module_mut(&"H".into()).unwrap().external = true; let module_group_graph = module_group_graph_from_entries( - &module_graph - .entries - .clone().into_keys() - .collect(), + &module_graph.entries.clone().into_keys().collect(), &mut module_graph, ); @@ -337,39 +373,7 @@ mod tests { resource_pots.sort_by_key(|p| p.id.clone()); assert_eq!(resource_pots.len(), 5); - // A, C - assert_eq!(resource_pots[0].modules(), vec![&"A".into(), &"C".into()]); - assert_eq!(resource_pots[0].entry_module, Some("A".into())); - // B, E - assert_eq!(resource_pots[1].modules(), vec![&"B".into(), &"E".into()]); - assert_eq!(resource_pots[1].entry_module, Some("B".into())); - // D - assert_eq!(resource_pots[2].modules(), vec![&"D".into()]); - // F, H - assert_eq!(resource_pots[3].modules(), vec![&"F".into()]); - // G - assert_eq!(resource_pots[4].modules(), vec![&"G".into()]); - - // assert necessary fields are filled - assert_eq!( - resource_pots[0].module_groups, - HashSet::from(["A".into(), "F".into()]) - ); - assert_eq!(resource_pots[0].entry_module, Some("A".into())); - - assert_eq!(resource_pots[1].module_groups, HashSet::from(["B".into()])); - assert_eq!(resource_pots[1].entry_module, Some("B".into())); - - assert_eq!( - resource_pots[2].module_groups, - HashSet::from(["D".into(), "B".into()]) - ); - assert_eq!(resource_pots[2].entry_module, None); - - assert_eq!(resource_pots[3].module_groups, HashSet::from(["F".into()])); - assert_eq!(resource_pots[3].entry_module, None); - assert_eq!(resource_pots[4].module_groups, HashSet::from(["G".into()])); - assert_eq!(resource_pots[4].entry_module, None); + assert_resource_pots!(&mut resource_pots); } } diff --git a/crates/compiler/src/generate/render_resource_pots.rs b/crates/compiler/src/generate/render_resource_pots.rs index 2ae30b9d89..174debce79 100644 --- a/crates/compiler/src/generate/render_resource_pots.rs +++ b/crates/compiler/src/generate/render_resource_pots.rs @@ -4,18 +4,14 @@ use farmfe_core::{ context::CompilationContext, error::{CompilationError, Result}, parking_lot::Mutex, - plugin::{ - PluginGenerateResourcesHookResult, PluginHookContext, PluginRenderResourcePotHookParam, - }, + plugin::{GeneratedResource, PluginGenerateResourcesHookResult, PluginHookContext}, rayon::prelude::{IntoParallelIterator, ParallelIterator}, - resource::{ - resource_pot::{ResourcePot, ResourcePotInfo}, - ResourceType, - }, + resource::resource_pot::ResourcePot, + HashMap, }; use farmfe_toolkit::{ - common::append_source_map_comment, fs::{transform_output_entry_filename, transform_output_filename}, + sourcemap::append_sourcemap_comment, }; use crate::generate::resource_cache::{set_resource_cache, try_get_resource_cache}; @@ -30,6 +26,7 @@ pub fn render_resource_pots_and_generate_resources( let resources = Mutex::new(vec![]); let entries = context.module_graph.read().entries.clone(); + let dynamic_entries = context.module_graph.read().dynamic_entries.clone(); let mut resource_pots_need_render = vec![]; @@ -37,22 +34,23 @@ pub fn render_resource_pots_and_generate_resources( let cached_resource_pot = try_get_resource_cache(resource_pot, context)?; if let Some(cached_resource_pot) = cached_resource_pot { - let rendered_resource_pot_info = ResourcePotInfo::new(resource_pot); - - let mut cached_resource = cached_resource_pot.resources; + let cached_resources = cached_resource_pot.resources; let cached_meta = cached_resource_pot.meta; resource_pot.meta = cached_meta; - resource_pot.add_resource(cached_resource.resource.name.clone()); - cached_resource.resource.info = Some(rendered_resource_pot_info); + for cached_resource in &cached_resources.resources { + resource_pot.add_resource(cached_resource.resource.name.clone()); + } - resources.lock().push(cached_resource.resource); + for cached_resource in cached_resources.resources { + resources.lock().push(cached_resource.resource); - if let Some(map) = cached_resource.source_map { - resource_pot.add_resource(map.name.clone()); + if let Some(map) = cached_resource.source_map { + resource_pot.add_resource(map.name.clone()); - resources.lock().push(map); + resources.lock().push(map); + } } } else { resource_pots_need_render.push(resource_pot); @@ -75,90 +73,95 @@ pub fn render_resource_pots_and_generate_resources( #[cfg(feature = "profile")] farmfe_core::puffin::profile_scope!(id); - let mut resource_pot_info: Option = None; - let (mut res, augment_resource_hash) = render_resource_pot_generate_resources( - resource_pot, - context, - hook_context, - false, - &mut resource_pot_info, - )?; - - let r = &mut res.resource; - let resource_pot_info: ResourcePotInfo = resource_pot_info.unwrap(); - - // ignore runtime resource - if !matches!(r.resource_type, ResourceType::Runtime) { - let content_with_extra_content_hash = &[ - &r.bytes, - augment_resource_hash.unwrap_or_default().as_bytes(), - ] - .concat(); - if let Some(name) = resource_pot.entry_module.as_ref() { - let entry_name = entries.get(name).unwrap(); - r.name = transform_output_entry_filename( - context.config.output.entry_filename.clone(), - resource_pot.id.to_string().as_str(), - entry_name, - content_with_extra_content_hash, - &r.resource_type.to_ext(), - ); - } else { - r.name = transform_output_filename( - context.config.output.filename.clone(), - &r.name, - content_with_extra_content_hash, - &r.resource_type.to_ext(), - ); + // let mut resource_pot_info: Option = None; + let (mut generated_resources, augment_resource_hash) = + render_resource_pot_generate_resources(resource_pot, context, hook_context)?; + + let mut cached_result: PluginGenerateResourcesHookResult = + PluginGenerateResourcesHookResult { resources: vec![] }; + let augment_resource_hash = augment_resource_hash.unwrap_or_default(); + let augment_resource_hash_bytes = augment_resource_hash.as_bytes(); + + for res in &mut generated_resources.resources { + let r = &mut res.resource; + + // ignore runtime resource + if r.should_transform_output_filename { + let content_with_extra_content_hash = &[&r.bytes, augment_resource_hash_bytes].concat(); + if let Some(name) = resource_pot.entry_module.as_ref() { + let entry_name = entries + .get(name) + .or_else(|| dynamic_entries.get(name)) + .unwrap(); + + r.name = transform_output_entry_filename( + context.config.output.entry_filename.clone(), + resource_pot.id.to_string().as_str(), + entry_name, + content_with_extra_content_hash, + &r.resource_type.to_ext(), + ); + } else { + r.name = transform_output_filename( + context.config.output.filename.clone(), + &r.name, + content_with_extra_content_hash, + &r.resource_type.to_ext(), + ); + } } } // process generated resources after rendering context .plugin_driver - .process_generated_resources(&mut res, context)?; + .process_generated_resources(&mut generated_resources, context)?; - let mut cached_result: PluginGenerateResourcesHookResult = - PluginGenerateResourcesHookResult { + for mut res in generated_resources.resources { + let mut cached_resource = GeneratedResource { resource: Default::default(), source_map: None, }; - // if source map is generated, we need to update the resource name and the content of the resource - // to make sure the source map can be found. - if let Some(mut source_map) = res.source_map { - source_map.name = format!( - "{}.{}", - res.resource.name, - source_map.resource_type.to_ext() - ); - append_source_map_comment(&mut res.resource, &source_map, &context.config.sourcemap); + // if source map is generated, we need to update the resource name and the content of the resource + // to make sure the source map can be found. + if let Some(mut source_map) = res.source_map { + source_map.name = format!( + "{}.{}", + res.resource.name, + source_map.resource_type.to_ext() + ); + append_sourcemap_comment(&mut res.resource, &source_map, &context.config.sourcemap); + + if context.config.persistent_cache.enabled() { + cached_resource.source_map = Some(source_map.clone()); + } + + resource_pot.add_resource(source_map.name.clone()); + + resources.lock().push(source_map); + } if context.config.persistent_cache.enabled() { - cached_result.source_map = Some(source_map.clone()); + cached_resource.resource = res.resource.clone(); + cached_result.resources.push(cached_resource); } - resource_pot.add_resource(source_map.name.clone()); + resource_pot.add_resource(res.resource.name.clone()); - resources.lock().push(source_map); + resources.lock().push(res.resource); } - if context.config.persistent_cache.enabled() { - cached_result.resource = res.resource.clone(); - set_resource_cache(resource_pot, &cached_result, context); + if !cached_result.resources.is_empty() { + set_resource_cache(resource_pot, cached_result, context); } - resource_pot.add_resource(res.resource.name.clone()); - - res.resource.info = Some(resource_pot_info); - - resources.lock().push(res.resource); Ok::<(), CompilationError>(()) })?; let mut resources_map: farmfe_core::parking_lot::lock_api::MutexGuard< '_, farmfe_core::parking_lot::RawMutex, - std::collections::HashMap, + HashMap, > = context.resources_map.lock(); for resource in resources.lock().drain(..) { @@ -172,12 +175,11 @@ pub fn render_resource_pot_generate_resources( resource_pot: &mut ResourcePot, context: &Arc, hook_context: &PluginHookContext, - skip_render: bool, - chunk_resource_info: &mut Option, + // chunk_resource_info: &mut Option, ) -> Result<(PluginGenerateResourcesHookResult, Option)> { let mut augment_resource_hash = None; - if !skip_render { + { #[cfg(feature = "profile")] let id = farmfe_utils::transform_string_to_static_str(format!( "Render resource pot {:?}", @@ -185,33 +187,24 @@ pub fn render_resource_pot_generate_resources( )); #[cfg(feature = "profile")] farmfe_core::puffin::profile_scope!(id); + let meta = context .plugin_driver - .render_resource_pot_modules(resource_pot, context, hook_context)? + .render_resource_pot(resource_pot, context, hook_context)? .ok_or(CompilationError::PluginHookResultCheckError { - hook_name: format!("render_resource_pot_modules({:?})", resource_pot.id), + hook_name: format!( + "render_resource_pot(name:{}, type:{:?})", + resource_pot.id, resource_pot.resource_pot_type + ), })?; resource_pot.meta = meta; - let mut param = PluginRenderResourcePotHookParam { - content: resource_pot.meta.rendered_content.clone(), - source_map_chain: resource_pot.meta.rendered_map_chain.clone(), - resource_pot_info: ResourcePotInfo::new(resource_pot), - }; - - let result = context - .plugin_driver - .render_resource_pot(&mut param, context)?; - - resource_pot.meta.rendered_content = result.content; - resource_pot.meta.rendered_map_chain = result.source_map_chain; - augment_resource_hash = context .plugin_driver - .augment_resource_hash(¶m.resource_pot_info, context)?; + .augment_resource_hash(resource_pot, context)?; - *chunk_resource_info = Some(param.resource_pot_info); + // TODO augment resource hash } { diff --git a/crates/compiler/src/generate/resource_cache.rs b/crates/compiler/src/generate/resource_cache.rs index 4c27c04069..1fc14295dd 100644 --- a/crates/compiler/src/generate/resource_cache.rs +++ b/crates/compiler/src/generate/resource_cache.rs @@ -75,7 +75,7 @@ pub fn try_get_resource_cache( pub fn set_resource_cache( resource_pot: &ResourcePot, - resource: &PluginGenerateResourcesHookResult, + resource: PluginGenerateResourcesHookResult, context: &Arc, ) { let cache_key = get_resource_cache_key(resource_pot, context); @@ -83,7 +83,7 @@ pub fn set_resource_cache( context.cache_manager.resource_cache.set_cache( &resource_pot.id, CachedResourcePot { - resources: resource.clone(), + resources: resource, meta: resource_pot.meta.clone(), hash: cache_key, }, diff --git a/crates/compiler/src/generate/snapshots/generate_resource_pot_map-2.snap b/crates/compiler/src/generate/snapshots/generate_resource_pot_map-2.snap new file mode 100644 index 0000000000..d5de4966ef --- /dev/null +++ b/crates/compiler/src/generate/snapshots/generate_resource_pot_map-2.snap @@ -0,0 +1,62 @@ +--- +source: crates/compiler/src/generate/partial_bundling.rs +input_file: crates/testing_helpers/src/lib.rs +--- +name: A_66be +id: A_66be +immutable: false +resource_pot_type: Js +entry: Some( + ModuleId { + relative_path: "A", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "A_Entry", + ), + ModuleGroupId( + "F_DynamicImport", + ), +] +modules: [ + ModuleId { + relative_path: "A", + query_string: "", + }, + ModuleId { + relative_path: "C", + query_string: "", + }, +] +resources: [] + +------- + +name: B_2f5d +id: B_2f5d +immutable: false +resource_pot_type: Js +entry: Some( + ModuleId { + relative_path: "B", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "B_Entry", + ), +] +modules: [ + ModuleId { + relative_path: "B", + query_string: "", + }, + ModuleId { + relative_path: "E", + query_string: "", + }, +] +resources: [] diff --git a/crates/compiler/src/generate/snapshots/generate_resource_pot_map-3.snap b/crates/compiler/src/generate/snapshots/generate_resource_pot_map-3.snap new file mode 100644 index 0000000000..8d2c09fe08 --- /dev/null +++ b/crates/compiler/src/generate/snapshots/generate_resource_pot_map-3.snap @@ -0,0 +1,85 @@ +--- +source: crates/compiler/src/generate/partial_bundling.rs +input_file: crates/testing_helpers/src/lib.rs +--- +name: A_66be +id: A_66be +immutable: false +resource_pot_type: Js +entry: Some( + ModuleId { + relative_path: "A", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "A_Entry", + ), + ModuleGroupId( + "F_DynamicImport", + ), +] +modules: [ + ModuleId { + relative_path: "A", + query_string: "", + }, + ModuleId { + relative_path: "C", + query_string: "", + }, +] +resources: [] + +------- + +name: B_2f5d +id: B_2f5d +immutable: false +resource_pot_type: Js +entry: Some( + ModuleId { + relative_path: "B", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "B_Entry", + ), +] +modules: [ + ModuleId { + relative_path: "B", + query_string: "", + }, + ModuleId { + relative_path: "E", + query_string: "", + }, +] +resources: [] + +------- + +name: B_3f39 +id: B_3f39 +immutable: false +resource_pot_type: Js +entry: None +module_groups: [ + ModuleGroupId( + "B_Entry", + ), + ModuleGroupId( + "D_DynamicImport", + ), +] +modules: [ + ModuleId { + relative_path: "D", + query_string: "", + }, +] +resources: [] diff --git a/crates/compiler/src/generate/snapshots/generate_resource_pot_map-4.snap b/crates/compiler/src/generate/snapshots/generate_resource_pot_map-4.snap new file mode 100644 index 0000000000..3e8557676f --- /dev/null +++ b/crates/compiler/src/generate/snapshots/generate_resource_pot_map-4.snap @@ -0,0 +1,105 @@ +--- +source: crates/compiler/src/generate/partial_bundling.rs +input_file: crates/testing_helpers/src/lib.rs +--- +name: A_66be +id: A_66be +immutable: false +resource_pot_type: Js +entry: Some( + ModuleId { + relative_path: "A", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "A_Entry", + ), + ModuleGroupId( + "F_DynamicImport", + ), +] +modules: [ + ModuleId { + relative_path: "A", + query_string: "", + }, + ModuleId { + relative_path: "C", + query_string: "", + }, +] +resources: [] + +------- + +name: B_2f5d +id: B_2f5d +immutable: false +resource_pot_type: Js +entry: Some( + ModuleId { + relative_path: "B", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "B_Entry", + ), +] +modules: [ + ModuleId { + relative_path: "B", + query_string: "", + }, + ModuleId { + relative_path: "E", + query_string: "", + }, +] +resources: [] + +------- + +name: B_3f39 +id: B_3f39 +immutable: false +resource_pot_type: Js +entry: None +module_groups: [ + ModuleGroupId( + "B_Entry", + ), + ModuleGroupId( + "D_DynamicImport", + ), +] +modules: [ + ModuleId { + relative_path: "D", + query_string: "", + }, +] +resources: [] + +------- + +name: G_DynamicImport_333e +id: G_DynamicImport_333e +immutable: false +resource_pot_type: Js +entry: None +module_groups: [ + ModuleGroupId( + "G_DynamicImport", + ), +] +modules: [ + ModuleId { + relative_path: "G", + query_string: "", + }, +] +resources: [] diff --git a/crates/compiler/src/generate/snapshots/generate_resource_pot_map-5.snap b/crates/compiler/src/generate/snapshots/generate_resource_pot_map-5.snap new file mode 100644 index 0000000000..b0dfe05202 --- /dev/null +++ b/crates/compiler/src/generate/snapshots/generate_resource_pot_map-5.snap @@ -0,0 +1,138 @@ +--- +source: crates/compiler/src/generate/partial_bundling.rs +input_file: crates/testing_helpers/src/lib.rs +--- +name: A_66be +id: A_66be +immutable: false +resource_pot_type: Js +entry: Some( + ModuleId { + relative_path: "A", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "A_Entry", + ), + ModuleGroupId( + "F_DynamicImport", + ), +] +modules: [ + ModuleId { + relative_path: "A", + query_string: "", + }, + ModuleId { + relative_path: "C", + query_string: "", + }, +] +resources: [] + +------- + +name: B_2f5d +id: B_2f5d +immutable: false +resource_pot_type: Js +entry: Some( + ModuleId { + relative_path: "B", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "B_Entry", + ), +] +modules: [ + ModuleId { + relative_path: "B", + query_string: "", + }, + ModuleId { + relative_path: "E", + query_string: "", + }, +] +resources: [] + +------- + +name: B_3f39 +id: B_3f39 +immutable: false +resource_pot_type: Js +entry: None +module_groups: [ + ModuleGroupId( + "B_Entry", + ), + ModuleGroupId( + "D_DynamicImport", + ), +] +modules: [ + ModuleId { + relative_path: "D", + query_string: "", + }, +] +resources: [] + +------- + +name: G_DynamicImport_333e +id: G_DynamicImport_333e +immutable: false +resource_pot_type: Js +entry: None +module_groups: [ + ModuleGroupId( + "G_DynamicImport", + ), +] +modules: [ + ModuleId { + relative_path: "G", + query_string: "", + }, +] +resources: [] + +------- + +name: test +id: test_js +immutable: false +resource_pot_type: Js +entry: None +module_groups: [ + ModuleGroupId( + "B_Entry", + ), + ModuleGroupId( + "D_DynamicImport", + ), + ModuleGroupId( + "F_DynamicImport", + ), + ModuleGroupId( + "G_DynamicImport", + ), +] +modules: [ + ModuleId { + relative_path: "F", + query_string: "", + }, + ModuleId { + relative_path: "H", + query_string: "", + }, +] +resources: [] diff --git a/crates/compiler/src/generate/snapshots/generate_resource_pot_map.snap b/crates/compiler/src/generate/snapshots/generate_resource_pot_map.snap new file mode 100644 index 0000000000..2dd80b217a --- /dev/null +++ b/crates/compiler/src/generate/snapshots/generate_resource_pot_map.snap @@ -0,0 +1,33 @@ +--- +source: crates/compiler/src/generate/partial_bundling.rs +input_file: crates/testing_helpers/src/lib.rs +--- +name: A_66be +id: A_66be +immutable: false +resource_pot_type: Js +entry: Some( + ModuleId { + relative_path: "A", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "A_Entry", + ), + ModuleGroupId( + "F_DynamicImport", + ), +] +modules: [ + ModuleId { + relative_path: "A", + query_string: "", + }, + ModuleId { + relative_path: "C", + query_string: "", + }, +] +resources: [] diff --git a/crates/compiler/src/generate/snapshots/generate_resource_pot_map_external-2.snap b/crates/compiler/src/generate/snapshots/generate_resource_pot_map_external-2.snap new file mode 100644 index 0000000000..d5de4966ef --- /dev/null +++ b/crates/compiler/src/generate/snapshots/generate_resource_pot_map_external-2.snap @@ -0,0 +1,62 @@ +--- +source: crates/compiler/src/generate/partial_bundling.rs +input_file: crates/testing_helpers/src/lib.rs +--- +name: A_66be +id: A_66be +immutable: false +resource_pot_type: Js +entry: Some( + ModuleId { + relative_path: "A", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "A_Entry", + ), + ModuleGroupId( + "F_DynamicImport", + ), +] +modules: [ + ModuleId { + relative_path: "A", + query_string: "", + }, + ModuleId { + relative_path: "C", + query_string: "", + }, +] +resources: [] + +------- + +name: B_2f5d +id: B_2f5d +immutable: false +resource_pot_type: Js +entry: Some( + ModuleId { + relative_path: "B", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "B_Entry", + ), +] +modules: [ + ModuleId { + relative_path: "B", + query_string: "", + }, + ModuleId { + relative_path: "E", + query_string: "", + }, +] +resources: [] diff --git a/crates/compiler/src/generate/snapshots/generate_resource_pot_map_external-3.snap b/crates/compiler/src/generate/snapshots/generate_resource_pot_map_external-3.snap new file mode 100644 index 0000000000..8d2c09fe08 --- /dev/null +++ b/crates/compiler/src/generate/snapshots/generate_resource_pot_map_external-3.snap @@ -0,0 +1,85 @@ +--- +source: crates/compiler/src/generate/partial_bundling.rs +input_file: crates/testing_helpers/src/lib.rs +--- +name: A_66be +id: A_66be +immutable: false +resource_pot_type: Js +entry: Some( + ModuleId { + relative_path: "A", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "A_Entry", + ), + ModuleGroupId( + "F_DynamicImport", + ), +] +modules: [ + ModuleId { + relative_path: "A", + query_string: "", + }, + ModuleId { + relative_path: "C", + query_string: "", + }, +] +resources: [] + +------- + +name: B_2f5d +id: B_2f5d +immutable: false +resource_pot_type: Js +entry: Some( + ModuleId { + relative_path: "B", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "B_Entry", + ), +] +modules: [ + ModuleId { + relative_path: "B", + query_string: "", + }, + ModuleId { + relative_path: "E", + query_string: "", + }, +] +resources: [] + +------- + +name: B_3f39 +id: B_3f39 +immutable: false +resource_pot_type: Js +entry: None +module_groups: [ + ModuleGroupId( + "B_Entry", + ), + ModuleGroupId( + "D_DynamicImport", + ), +] +modules: [ + ModuleId { + relative_path: "D", + query_string: "", + }, +] +resources: [] diff --git a/crates/compiler/src/generate/snapshots/generate_resource_pot_map_external-4.snap b/crates/compiler/src/generate/snapshots/generate_resource_pot_map_external-4.snap new file mode 100644 index 0000000000..9b3342028a --- /dev/null +++ b/crates/compiler/src/generate/snapshots/generate_resource_pot_map_external-4.snap @@ -0,0 +1,105 @@ +--- +source: crates/compiler/src/generate/partial_bundling.rs +input_file: crates/testing_helpers/src/lib.rs +--- +name: A_66be +id: A_66be +immutable: false +resource_pot_type: Js +entry: Some( + ModuleId { + relative_path: "A", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "A_Entry", + ), + ModuleGroupId( + "F_DynamicImport", + ), +] +modules: [ + ModuleId { + relative_path: "A", + query_string: "", + }, + ModuleId { + relative_path: "C", + query_string: "", + }, +] +resources: [] + +------- + +name: B_2f5d +id: B_2f5d +immutable: false +resource_pot_type: Js +entry: Some( + ModuleId { + relative_path: "B", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "B_Entry", + ), +] +modules: [ + ModuleId { + relative_path: "B", + query_string: "", + }, + ModuleId { + relative_path: "E", + query_string: "", + }, +] +resources: [] + +------- + +name: B_3f39 +id: B_3f39 +immutable: false +resource_pot_type: Js +entry: None +module_groups: [ + ModuleGroupId( + "B_Entry", + ), + ModuleGroupId( + "D_DynamicImport", + ), +] +modules: [ + ModuleId { + relative_path: "D", + query_string: "", + }, +] +resources: [] + +------- + +name: F_DynamicImport_f67a +id: F_DynamicImport_f67a +immutable: false +resource_pot_type: Js +entry: None +module_groups: [ + ModuleGroupId( + "F_DynamicImport", + ), +] +modules: [ + ModuleId { + relative_path: "F", + query_string: "", + }, +] +resources: [] diff --git a/crates/compiler/src/generate/snapshots/generate_resource_pot_map_external-5.snap b/crates/compiler/src/generate/snapshots/generate_resource_pot_map_external-5.snap new file mode 100644 index 0000000000..d132b75938 --- /dev/null +++ b/crates/compiler/src/generate/snapshots/generate_resource_pot_map_external-5.snap @@ -0,0 +1,125 @@ +--- +source: crates/compiler/src/generate/partial_bundling.rs +input_file: crates/testing_helpers/src/lib.rs +--- +name: A_66be +id: A_66be +immutable: false +resource_pot_type: Js +entry: Some( + ModuleId { + relative_path: "A", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "A_Entry", + ), + ModuleGroupId( + "F_DynamicImport", + ), +] +modules: [ + ModuleId { + relative_path: "A", + query_string: "", + }, + ModuleId { + relative_path: "C", + query_string: "", + }, +] +resources: [] + +------- + +name: B_2f5d +id: B_2f5d +immutable: false +resource_pot_type: Js +entry: Some( + ModuleId { + relative_path: "B", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "B_Entry", + ), +] +modules: [ + ModuleId { + relative_path: "B", + query_string: "", + }, + ModuleId { + relative_path: "E", + query_string: "", + }, +] +resources: [] + +------- + +name: B_3f39 +id: B_3f39 +immutable: false +resource_pot_type: Js +entry: None +module_groups: [ + ModuleGroupId( + "B_Entry", + ), + ModuleGroupId( + "D_DynamicImport", + ), +] +modules: [ + ModuleId { + relative_path: "D", + query_string: "", + }, +] +resources: [] + +------- + +name: F_DynamicImport_f67a +id: F_DynamicImport_f67a +immutable: false +resource_pot_type: Js +entry: None +module_groups: [ + ModuleGroupId( + "F_DynamicImport", + ), +] +modules: [ + ModuleId { + relative_path: "F", + query_string: "", + }, +] +resources: [] + +------- + +name: G_DynamicImport_333e +id: G_DynamicImport_333e +immutable: false +resource_pot_type: Js +entry: None +module_groups: [ + ModuleGroupId( + "G_DynamicImport", + ), +] +modules: [ + ModuleId { + relative_path: "G", + query_string: "", + }, +] +resources: [] diff --git a/crates/compiler/src/generate/snapshots/generate_resource_pot_map_external.snap b/crates/compiler/src/generate/snapshots/generate_resource_pot_map_external.snap new file mode 100644 index 0000000000..2dd80b217a --- /dev/null +++ b/crates/compiler/src/generate/snapshots/generate_resource_pot_map_external.snap @@ -0,0 +1,33 @@ +--- +source: crates/compiler/src/generate/partial_bundling.rs +input_file: crates/testing_helpers/src/lib.rs +--- +name: A_66be +id: A_66be +immutable: false +resource_pot_type: Js +entry: Some( + ModuleId { + relative_path: "A", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "A_Entry", + ), + ModuleGroupId( + "F_DynamicImport", + ), +] +modules: [ + ModuleId { + relative_path: "A", + query_string: "", + }, + ModuleId { + relative_path: "C", + query_string: "", + }, +] +resources: [] diff --git a/crates/compiler/src/lib.rs b/crates/compiler/src/lib.rs index 7f229284b5..ed42fb9910 100644 --- a/crates/compiler/src/lib.rs +++ b/crates/compiler/src/lib.rs @@ -12,31 +12,41 @@ use farmfe_core::{ context::CompilationContext, error::Result, farm_profile_function, + module::ModuleId, + parking_lot::Mutex, plugin::Plugin, - rayon::{ThreadPool, ThreadPoolBuilder}, }; pub use farmfe_plugin_css::FARM_CSS_MODULES_SUFFIX; pub use farmfe_plugin_lazy_compilation::DYNAMIC_VIRTUAL_SUFFIX; -pub use farmfe_plugin_runtime::RUNTIME_SUFFIX; +pub use farmfe_plugin_runtime::RUNTIME_INPUT_SCOPE; pub mod build; pub mod generate; pub mod trace_module_graph; pub mod update; +pub mod utils; +pub mod write; pub struct Compiler { context: Arc, - pub thread_pool: Arc, + pub last_fail_module_ids: Mutex>, } impl Compiler { /// The params are [farmfe_core::config::Config] and dynamic load rust plugins and js plugins [farmfe_core::plugin::Plugin] pub fn new(config: Config, mut plugin_adapters: Vec>) -> Result { + let render_plugin: Arc = if config.output.target_env.is_library() { + Arc::new(farmfe_plugin_library::FarmPluginLibrary::new(&config)) as _ + } else { + Arc::new(farmfe_plugin_runtime::FarmPluginRuntime::new(&config)) as _ + }; + let mut plugins = vec![ - Arc::new(farmfe_plugin_runtime::FarmPluginRuntime::new(&config)) as _, - Arc::new(farmfe_plugin_bundle::FarmPluginBundle::new()) as _, + // script meta features plugin should be executed before render plugin + Arc::new(farmfe_plugin_script_meta::FarmPluginScriptMetaFeatures::new(&config)) as _, // register internal core plugins + render_plugin, Arc::new(farmfe_plugin_script::FarmPluginScript::new(&config)) as _, Arc::new(farmfe_plugin_partial_bundling::FarmPluginPartialBundling::new(&config)) as _, Arc::new(farmfe_plugin_html::FarmPluginHtml::new(&config)) as _, @@ -49,6 +59,9 @@ impl Compiler { Arc::new(farmfe_plugin_static_assets::FarmPluginRaw::new(&config)) as _, Arc::new(farmfe_plugin_json::FarmPluginJson::new(&config)) as _, Arc::new(farmfe_plugin_define::FarmPluginDefine::new(&config)) as _, + Arc::new(farmfe_plugin_script_meta::FarmPluginScriptMeta::new( + &config, + )) as _, ]; if config.progress { @@ -65,9 +78,26 @@ impl Compiler { plugins.push(Arc::new(farmfe_plugin_tree_shake::FarmPluginTreeShake::new(&config)) as _); } + // script meta exports plugin should be executed after tree shake and before mangle exports + plugins.push( + Arc::new(farmfe_plugin_script_meta::FarmPluginScriptMetaExports::new( + &config, + )) as _, + ); + if config.minify.enabled() { plugins.push(Arc::new(farmfe_plugin_minify::FarmPluginMinify::new(&config)) as _); plugins.push(Arc::new(farmfe_plugin_html::FarmPluginMinifyHtml::new(&config)) as _); + + if let Some(options) = config.minify.as_obj() { + if options.mangle_exports { + plugins.push( + Arc::new(farmfe_plugin_mangle_exports::FarmPluginMangleExports::new( + &config, + )) as _, + ); + } + } } if config.preset_env.enabled() { @@ -77,6 +107,10 @@ impl Compiler { // but it will be executed earlier than external plugins plugins.push(Arc::new(farmfe_plugin_resolve::FarmPluginResolve::new(&config)) as _); + if config.output.show_file_size && matches!(config.mode, Mode::Production) { + plugins.push(Arc::new(farmfe_plugin_file_size::FarmPluginFileSize::new(&config)) as _); + } + plugins.append(&mut plugin_adapters); Self::new_without_internal_plugins(config, plugins) @@ -94,12 +128,7 @@ impl Compiler { Ok(Self { context: Arc::new(context), - thread_pool: Arc::new( - ThreadPoolBuilder::new() - .num_threads(num_cpus::get()) - .build() - .unwrap(), - ), + last_fail_module_ids: Mutex::new(vec![]), }) } @@ -126,7 +155,7 @@ impl Compiler { /// Compile the project using the configuration pub fn compile(&self) -> Result<()> { - self.context.record_manager.set_start_time(); + self.context.stats.set_start_time(); if self.context.config.persistent_cache.enabled() { self .context @@ -139,18 +168,20 @@ impl Compiler { #[cfg(feature = "profile")] farmfe_core::puffin::profile_scope!("Build Stage"); self.build()?; - } - self.context.record_manager.set_build_end_time(); + }; + + self.context.stats.set_build_end_time(); { #[cfg(feature = "profile")] farmfe_core::puffin::profile_scope!("Generate Stage"); self.generate()?; } - self - .context - .plugin_driver - .finish(&self.context.record_manager, &self.context)?; + { + #[cfg(feature = "profile")] + farmfe_core::puffin::profile_scope!("Write Stage"); + self.write()?; + } if self.context.config.persistent_cache.enabled() { self @@ -171,7 +202,7 @@ impl Compiler { } } - self.context.record_manager.set_end_time(); + self.context.stats.set_end_time(); Ok(()) } diff --git a/crates/compiler/src/trace_module_graph.rs b/crates/compiler/src/trace_module_graph.rs index abfcdca10c..e596bfda63 100644 --- a/crates/compiler/src/trace_module_graph.rs +++ b/crates/compiler/src/trace_module_graph.rs @@ -1,6 +1,5 @@ -use std::collections::HashMap; - use farmfe_core::serde::{Deserialize, Serialize}; +use farmfe_core::HashMap; use crate::Compiler; @@ -27,8 +26,8 @@ impl TracedModuleGraph { Self { root, modules: vec![], - edges: HashMap::new(), - reverse_edges: HashMap::new(), + edges: HashMap::default(), + reverse_edges: HashMap::default(), } } diff --git a/crates/compiler/src/update/diff_and_patch_module_graph.rs b/crates/compiler/src/update/diff_and_patch_module_graph.rs index 491452ce39..606a58d193 100644 --- a/crates/compiler/src/update/diff_and_patch_module_graph.rs +++ b/crates/compiler/src/update/diff_and_patch_module_graph.rs @@ -1,16 +1,15 @@ //! diff the module_graph and update_module_graph, analyze the changes and then patch the module_graph -use std::{ - cmp::Ordering, - collections::{HashMap, HashSet, VecDeque}, -}; +use std::{cmp::Ordering, collections::VecDeque}; use farmfe_core::{ module::{ module_graph::{ModuleGraph, ModuleGraphEdge}, Module, ModuleId, }, + plugin::ResolveKind, serde::Serialize, + HashMap, HashSet, }; /// the diff result of a module's dependencies @@ -96,8 +95,8 @@ pub fn diff_module_graph( ) -> DiffResult { let mut res: DiffResult = DiffResult { deps_changes: vec![], - added_modules: HashSet::new(), - removed_modules: HashSet::new(), + added_modules: HashSet::default(), + removed_modules: HashSet::default(), }; let (mut diff_result, added_modules, remove_modules) = @@ -135,12 +134,23 @@ pub fn patch_module_graph( module_graph: &mut ModuleGraph, update_module_graph: &mut ModuleGraph, ) -> HashMap { - let mut removed_modules = HashMap::new(); - let mut added_edge_info = HashMap::<(ModuleId, ModuleId), ModuleGraphEdge>::new(); + let mut removed_modules = HashMap::default(); + let mut added_edge_info = HashMap::<(ModuleId, ModuleId), ModuleGraphEdge>::default(); for (module_id, deps_diff_result) in diff_result.deps_changes.iter() { - for (removed_dep, _) in &deps_diff_result.removed { + for (removed_dep, edge_info) in &deps_diff_result.removed { module_graph.remove_edge(module_id, removed_dep).unwrap(); + + if edge_info.contains_dynamic_entry() { + let dependents = module_graph.dependents(removed_dep); + + if dependents + .into_iter() + .all(|(_, edge_info)| !edge_info.contains_dynamic_entry()) + { + module_graph.dynamic_entries.remove(removed_dep); + } + } } for (added_dep, _) in &deps_diff_result.added { @@ -159,6 +169,16 @@ pub fn patch_module_graph( } for ((from, to), edge_info) in added_edge_info { + if edge_info.contains_dynamic_entry() { + let name = edge_info.items().iter().find_map(|item| match &item.kind { + ResolveKind::DynamicEntry { name, .. } => Some(name.clone()), + _ => None, + }); + module_graph + .dynamic_entries + .insert(to.clone(), name.unwrap()); + } + module_graph.add_edge(&from, &to, edge_info).unwrap(); } @@ -174,7 +194,7 @@ pub fn patch_module_graph( let mut m = update_module_graph.take_module(&updated); let previous_module = module_graph.module(&updated).unwrap(); m.module_groups = previous_module.module_groups.clone(); - m.resource_pot = previous_module.resource_pot.clone(); + m.resource_pots = previous_module.resource_pots.clone(); m }; @@ -195,7 +215,7 @@ pub fn patch_module_graph( /// a(changed) -> b -> c /// \-> d /// diff_result: -/// (ModuleDepsDiffResult { added: [], removed: [] }, HashSet::new(), HashSet::new()) +/// (ModuleDepsDiffResult { added: [], removed: [] }, HashSet::default(), HashSet::default()) /// /// 2. when the deps changed /// module_graph: @@ -248,10 +268,10 @@ fn diff_module_deps( HashSet, ) { // added_deps of to_id(the to node of the removed edge) -> from_id - let mut all_added_deps_reverse = HashMap::new(); + let mut all_added_deps_reverse = HashMap::default(); // removed_deps of to_id(the to node of the removed edge) -> from_id - let mut all_removed_deps_reverse = HashMap::new(); - let mut added_modules = HashSet::new(); + let mut all_removed_deps_reverse = HashMap::default(); + let mut added_modules = HashSet::default(); let mut diff_result = Vec::new(); @@ -291,7 +311,7 @@ fn diff_module_deps( for (added_dep, _) in &added_deps { all_added_deps_reverse .entry(added_dep.clone()) - .or_insert_with(HashSet::new) + .or_insert_with(HashSet::default) .insert(module_id.clone()); if !module_graph.has_module(added_dep) { @@ -305,7 +325,7 @@ fn diff_module_deps( for (removed_dep, _) in &removed_deps { all_removed_deps_reverse .entry(removed_dep.clone()) - .or_insert_with(HashSet::new) + .or_insert_with(HashSet::default) .insert(module_id.clone()); } // all_removed_deps.insert(module_id.clone(), removed_deps.clone()); @@ -322,7 +342,7 @@ fn diff_module_deps( } if diff_result.is_empty() { - return (diff_result, HashSet::new(), HashSet::new()); + return (diff_result, HashSet::default(), HashSet::default()); } let all_removed_deps = all_removed_deps_reverse.keys().cloned(); @@ -359,7 +379,7 @@ fn diff_module_deps( let mut added_modules_vec = added_modules.clone().into_iter().collect::>(); added_modules_vec.sort(); let mut added_queue = VecDeque::from(added_modules_vec); - let mut added_visited = HashSet::new(); + let mut added_visited = HashSet::default(); while let Some(dep) = added_queue.pop_front() { if added_visited.contains(&dep) { @@ -380,7 +400,7 @@ fn diff_module_deps( children_added.push((child.clone(), edge_info.clone())); all_added_deps_reverse .entry(child.clone()) - .or_insert_with(HashSet::new) + .or_insert_with(HashSet::default) .insert(dep.clone()); if !module_graph.has_module(&child) { @@ -409,7 +429,7 @@ fn diff_module_deps( } let mut removed_queue = VecDeque::from(removed_modules_vec); - let mut removed_visited = HashSet::new(); + let mut removed_visited = HashSet::default(); while let Some(dep) = removed_queue.pop_front() { let children = module_graph.dependencies_ids(&dep); diff --git a/crates/compiler/src/update/diff_and_patch_module_graph/test_diff_module_deps.rs b/crates/compiler/src/update/diff_and_patch_module_graph/test_diff_module_deps.rs index 77daa00a1a..dcbf25ff12 100644 --- a/crates/compiler/src/update/diff_and_patch_module_graph/test_diff_module_deps.rs +++ b/crates/compiler/src/update/diff_and_patch_module_graph/test_diff_module_deps.rs @@ -1,11 +1,10 @@ -use std::collections::{HashMap, HashSet}; - use farmfe_core::{ module::{ module_graph::{ModuleGraph, ModuleGraphEdge, ModuleGraphEdgeDataItem}, Module, }, plugin::ResolveKind, + HashMap, HashSet, }; use farmfe_testing_helpers::construct_test_module_graph; @@ -35,7 +34,7 @@ pub fn create_basic_graph() -> ModuleGraph { module_graph .add_edge(&"b".into(), &"c".into(), ModuleGraphEdge::default()) .unwrap(); - module_graph.entries = HashMap::from([("a".into(), "a".to_string())]); + module_graph.entries = HashMap::from_iter([("a".into(), "a".to_string())]); module_graph } @@ -103,8 +102,11 @@ fn test_diff_module_deps_2() { let (diff_result, added_modules, removed_modules) = super::diff_module_deps(&vec!["a".into()], &module_graph, &update_module_graph); - assert_eq!(added_modules, HashSet::from(["f".into()])); - assert_eq!(removed_modules, HashSet::from(["b".into(), "c".into()])); + assert_eq!(added_modules, HashSet::from_iter(["f".into()])); + assert_eq!( + removed_modules, + HashSet::from_iter(["b".into(), "c".into()]) + ); assert_eq!( diff_result, @@ -155,7 +157,7 @@ fn test_diff_module_deps_3() { let (diff_result, added_modules, removed_modules) = super::diff_module_deps(&vec!["a".into()], &module_graph, &update_module_graph); - assert_eq!(added_modules, HashSet::from(["d".into()])); + assert_eq!(added_modules, HashSet::from_iter(["d".into()])); assert!(removed_modules.is_empty()); assert_eq!( @@ -210,7 +212,7 @@ fn test_diff_module_deps_4() { let (diff_result, added_modules, removed_modules) = super::diff_module_deps(&vec!["a".into()], &module_graph, &update_module_graph); assert!(added_modules.is_empty()); - assert_eq!(removed_modules, HashSet::from(["d".into()])); + assert_eq!(removed_modules, HashSet::from_iter(["d".into()])); assert_eq!( diff_result, @@ -286,8 +288,11 @@ fn test_diff_module_deps_complex_2() { let (diff_result, added_modules, removed_modules) = super::diff_module_deps(&vec!["B".into()], &module_graph, &update_module_graph); - assert_eq!(added_modules, HashSet::from(["H".into()])); - assert_eq!(removed_modules, HashSet::from(["E".into(), "G".into()])); + assert_eq!(added_modules, HashSet::from_iter(["H".into()])); + assert_eq!( + removed_modules, + HashSet::from_iter(["E".into(), "G".into()]) + ); assert_eq!( diff_result, @@ -359,7 +364,7 @@ fn test_diff_module_deps_complex_3() { let (diff_result, added_modules, removed_modules) = super::diff_module_deps(&vec!["F".into()], &module_graph, &update_module_graph); - assert_eq!(added_modules, HashSet::from(["H".into()])); + assert_eq!(added_modules, HashSet::from_iter(["H".into()])); assert!(removed_modules.is_empty()); assert_eq!( diff_result, @@ -407,7 +412,7 @@ fn test_diff_module_deps_complex_4() { let (diff_result, added_modules, removed_modules) = super::diff_module_deps(&vec!["E".into()], &module_graph, &update_module_graph); assert!(added_modules.is_empty()); - assert_eq!(removed_modules, HashSet::from(["G".into()])); + assert_eq!(removed_modules, HashSet::from_iter(["G".into()])); assert_eq!( diff_result, Vec::from([( @@ -446,8 +451,8 @@ fn test_diff_module_deps_add_and_remove() { let (diff_result, added_modules, removed_modules) = super::diff_module_deps(&vec!["a".into()], &module_graph, &update_module_graph); - assert_eq!(added_modules, HashSet::from(["e".into()])); - assert_eq!(removed_modules, HashSet::from([])); + assert_eq!(added_modules, HashSet::from_iter(["e".into()])); + assert_eq!(removed_modules, HashSet::from_iter([])); assert_eq!( diff_result, Vec::from([ @@ -486,8 +491,8 @@ fn test_diff_module_deps_remove_and_add() { let (diff_result, added_modules, removed_modules) = super::diff_module_deps(&vec!["a".into()], &module_graph, &update_module_graph); - assert_eq!(removed_modules, HashSet::from(["e".into()])); - assert_eq!(added_modules, HashSet::from([])); + assert_eq!(removed_modules, HashSet::from_iter(["e".into()])); + assert_eq!(added_modules, HashSet::from_iter([])); assert_eq!( diff_result, Vec::from([ @@ -532,8 +537,11 @@ fn test_diff_module_deps_remove_and_add_complex() { &module_graph, &update_module_graph, ); - assert_eq!(added_modules, HashSet::from(["e".into(), "c".into()])); - assert_eq!(removed_modules, HashSet::from([])); + assert_eq!( + added_modules, + HashSet::from_iter(["e".into(), "c".into()]) + ); + assert_eq!(removed_modules, HashSet::from_iter([])); assert_eq!( diff_result, Vec::from([ diff --git a/crates/compiler/src/update/diff_and_patch_module_graph/test_diff_module_graph.rs b/crates/compiler/src/update/diff_and_patch_module_graph/test_diff_module_graph.rs index 34e8ee14c1..2fba872dad 100644 --- a/crates/compiler/src/update/diff_and_patch_module_graph/test_diff_module_graph.rs +++ b/crates/compiler/src/update/diff_and_patch_module_graph/test_diff_module_graph.rs @@ -1,11 +1,10 @@ -use std::collections::HashSet; - use farmfe_core::{ module::{ module_graph::{ModuleGraph, ModuleGraphEdge, ModuleGraphEdgeDataItem}, Module, }, plugin::ResolveKind, + HashSet, }; use farmfe_testing_helpers::construct_test_module_graph; @@ -84,10 +83,10 @@ fn test_diff_module_graph_complex_2() { let removed_modules = diff_result.removed_modules; let diff_result = diff_result.deps_changes; - assert_eq!(added_modules, HashSet::from(["H".into()])); + assert_eq!(added_modules, HashSet::from_iter(["H".into()])); assert_eq!( removed_modules, - HashSet::from(["D".into(), "E".into(), "G".into()]) + HashSet::from_iter(["D".into(), "E".into(), "G".into()]) ); assert_eq!( @@ -218,7 +217,7 @@ fn test_diff_module_graph_complex_3() { &module_graph, &update_module_graph, ); - assert_eq!(diff_result.added_modules, HashSet::from(["H".into()])); + assert_eq!(diff_result.added_modules, HashSet::from_iter(["H".into()])); assert!(diff_result.removed_modules.is_empty()); assert_eq!( diff_result.deps_changes, @@ -344,8 +343,8 @@ fn test_diff_module_graph_complex_5() { let diff_result = super::diff_module_graph(vec!["D".into()], &module_graph, &update_module_graph); - assert_eq!(diff_result.added_modules, HashSet::from(["H".into()])); - assert_eq!(diff_result.removed_modules, HashSet::from([])); + assert_eq!(diff_result.added_modules, HashSet::from_iter(["H".into()])); + assert_eq!(diff_result.removed_modules, HashSet::from_iter([])); assert_eq!( diff_result.deps_changes, Vec::from([ diff --git a/crates/compiler/src/update/diff_and_patch_module_graph/test_patch_module_graph.rs b/crates/compiler/src/update/diff_and_patch_module_graph/test_patch_module_graph.rs index 9b12766456..4844a42a5c 100644 --- a/crates/compiler/src/update/diff_and_patch_module_graph/test_patch_module_graph.rs +++ b/crates/compiler/src/update/diff_and_patch_module_graph/test_patch_module_graph.rs @@ -4,6 +4,7 @@ use farmfe_core::{ Module, ModuleId, ModuleType, }, plugin::ResolveKind, + HashMap, }; use farmfe_testing_helpers::construct_test_module_graph; @@ -159,7 +160,7 @@ fn test_patch_module_graph_2() { let edge_info = module_graph .edge_info(&changed_module_id, &"b".into()) .unwrap(); - assert!(edge_info.is_dynamic()); + assert!(edge_info.is_dynamic_import()); } // TODO update these complex 1 2 3 tests @@ -416,3 +417,81 @@ fn test_diff_module_deps_remove_and_add_complex() { is_module_graph_equals(&module_graph, &create_update_module_graph()); } + +#[test] +fn test_patch_module_graph_add_remove_dynamic_entry() { + let mut module_graph = construct_test_module_graph(); + module_graph + .update_edge( + &"A".into(), + &"D".into(), + ModuleGraphEdge::new(vec![ModuleGraphEdgeDataItem { + kind: ResolveKind::DynamicEntry { + name: "AD".to_string(), + output_filename: None, + }, + ..Default::default() + }]), + ) + .unwrap(); + module_graph + .dynamic_entries + .insert("D".into(), "D".to_string()); + + let mut update_module_graph = construct_test_module_graph(); + + update_module_graph.remove_module(&"G".into()); + update_module_graph + .remove_edge(&"A".into(), &"D".into()) + .unwrap(); + + update_module_graph.add_module(Module::new("H".into())); + update_module_graph + .add_edge( + &"B".into(), + &"H".into(), + ModuleGraphEdge::new(vec![ModuleGraphEdgeDataItem { + kind: ResolveKind::DynamicEntry { + name: "BH".to_string(), + output_filename: None, + }, + ..Default::default() + }]), + ) + .unwrap(); + update_module_graph + .add_edge(&"H".into(), &"F".into(), Default::default()) + .unwrap(); + + let diff_result = super::diff_module_graph( + vec!["A".into(), "B".into()], + &module_graph, + &update_module_graph, + ); + + assert!(module_graph.has_edge(&"F".into(), &"A".into())); + assert!(module_graph.has_edge(&"B".into(), &"D".into())); + assert!(module_graph.has_edge(&"D".into(), &"F".into())); + assert_eq!(module_graph.modules().len(), 7); + assert_eq!(module_graph.edge_count(), 8); + + patch_module_graph( + vec!["A".into(), "B".into()], + &diff_result, + &mut module_graph, + &mut update_module_graph, + ); + + assert!(!module_graph.has_edge(&"A".into(), &"D".into())); + assert!(module_graph.has_module(&"H".into())); + assert!(module_graph.has_edge(&"H".into(), &"F".into())); + assert!(module_graph.has_edge(&"B".into(), &"H".into())); + + assert_eq!(module_graph.modules().len(), 8); + assert_eq!(module_graph.edge_count(), 9); + + assert_eq!( + module_graph.dynamic_entries, + HashMap::from_iter([("H".into(), "BH".to_string())]) + ); +} diff --git a/crates/compiler/src/update/finalize_module_graph.rs b/crates/compiler/src/update/finalize_module_graph.rs new file mode 100644 index 0000000000..1364b34964 --- /dev/null +++ b/crates/compiler/src/update/finalize_module_graph.rs @@ -0,0 +1,67 @@ +use std::sync::Arc; + +use farmfe_core::{ + context::CompilationContext, farm_profile_function, module::ModuleId, + plugin::hooks::freeze_module::PluginFreezeModuleHookParam, +}; + +use crate::build::finalize_module_graph::{ + call_freeze_module_with_params, get_resolved_deps_of_modules, update_modules_resolved_deps, +}; + +use super::diff_and_patch_module_graph::DiffResult; + +/// Finalize module graph when updated module graph is built +pub fn finalize_updated_module_graph( + updated_modules: &Vec, + removed_module_ids: Vec, + diff_result: &DiffResult, + context: &Arc, +) -> farmfe_core::error::Result<()> { + // call module graph updated hook + context.plugin_driver.module_graph_updated( + &farmfe_core::plugin::PluginModuleGraphUpdatedHookParam { + added_modules_ids: diff_result.added_modules.clone().into_iter().collect(), + removed_modules_ids: removed_module_ids, + updated_modules_ids: updated_modules.clone(), + }, + context, + )?; + + Ok(()) +} + +pub(super) fn freeze_module_of_affected_module_graph( + updated_modules: &Vec, + diff_result: &DiffResult, + context: &Arc, +) -> farmfe_core::error::Result<()> { + farm_profile_function!("call freeze_module hook".to_string()); + + let mut module_graph = context.module_graph.write(); + + let mut modules_ids = diff_result.added_modules.clone(); + modules_ids.extend(updated_modules.clone()); + let modules_ids_vec = modules_ids.clone().into_iter().collect::>(); + + let mut resolved_deps_map = get_resolved_deps_of_modules(modules_ids_vec, &module_graph); + + let hook_params = module_graph + .modules_mut() + .into_iter() + .filter(|module| modules_ids.contains(&module.id)) + .map(|module| { + let resolved_deps = resolved_deps_map.remove(&module.id).unwrap(); + PluginFreezeModuleHookParam { + module, + resolved_deps, + } + }) + .collect::>(); + + let module_resolved_deps = call_freeze_module_with_params(hook_params, context)?; + + update_modules_resolved_deps(module_resolved_deps, &mut module_graph); + + Ok(()) +} diff --git a/crates/compiler/src/update/find_hmr_boundaries.rs b/crates/compiler/src/update/find_hmr_boundaries.rs index 7ed3bfb096..88bab52bac 100644 --- a/crates/compiler/src/update/find_hmr_boundaries.rs +++ b/crates/compiler/src/update/find_hmr_boundaries.rs @@ -1,40 +1,34 @@ -use std::{ - collections::{HashMap, HashSet}, - sync::Arc, -}; +use std::sync::Arc; use farmfe_core::{ context::CompilationContext, module::{module_graph::ModuleGraph, ModuleId}, + HashMap, HashSet, }; pub fn find_hmr_boundaries( update_module_ids: &Vec, context: &Arc, ) -> HashMap>> { - let mut boundaries = HashMap::new(); + let mut boundaries = HashMap::default(); let module_graph = context.module_graph.read(); for id in update_module_ids { let mut stack = vec![id.clone()]; - let mut visited = HashSet::new(); + let mut visited = HashSet::default(); let mut res = vec![]; let all_path_accepted = find_hmr_accepted_recursively(id, &module_graph, &mut stack, &mut visited, &mut res); // if any of the path is not accepted, reload the whole page if !all_path_accepted { - return HashMap::new(); + return HashMap::default(); } boundaries.insert( - id.id(context.config.mode.clone()), + id.id(context.config.mode), res .into_iter() - .map(|v| { - v.into_iter() - .map(|id| id.id(context.config.mode.clone())) - .collect() - }) + .map(|v| v.into_iter().map(|id| id.id(context.config.mode)).collect()) .collect(), ); } @@ -106,16 +100,17 @@ fn find_hmr_accepted_recursively( #[cfg(test)] mod tests { - use std::{ - collections::{HashMap, HashSet}, - sync::Arc, - }; + use std::sync::Arc; use farmfe_core::{ config::{Config, Mode}, context::CompilationContext, - module::{module_graph::ModuleGraph, ModuleMetaData, ModuleType, ScriptModuleMetaData}, + module::{ + meta_data::script::ScriptModuleMetaData, module_graph::ModuleGraph, ModuleMetaData, + ModuleType, + }, parking_lot::RwLock, + HashMap, HashSet, }; use farmfe_testing_helpers::construct_test_module_graph; @@ -140,15 +135,15 @@ mod tests { let module_a = module_graph.module_mut(&"A".into()).unwrap(); module_a.module_type = ModuleType::Js; - module_a.meta = Box::new(ModuleMetaData::Script(ScriptModuleMetaData { + module_a.meta = Box::new(ModuleMetaData::Script(Box::new(ScriptModuleMetaData { hmr_self_accepted: true, ..Default::default() - })); + }))); let context = create_context(module_graph); let boundaries = find_hmr_boundaries(&vec!["F".into()], &context); - assert_eq!(boundaries, HashMap::new()); + assert_eq!(boundaries, HashMap::default()); } #[test] @@ -157,16 +152,16 @@ mod tests { let module_d = module_graph.module_mut(&"D".into()).unwrap(); module_d.module_type = ModuleType::Js; - module_d.meta = Box::new(ModuleMetaData::Script(ScriptModuleMetaData { + module_d.meta = Box::new(ModuleMetaData::Script(Box::new(ScriptModuleMetaData { hmr_self_accepted: true, ..Default::default() - })); + }))); let module_c = module_graph.module_mut(&"C".into()).unwrap(); module_c.module_type = ModuleType::Js; - module_c.meta = Box::new(ModuleMetaData::Script(ScriptModuleMetaData { + module_c.meta = Box::new(ModuleMetaData::Script(Box::new(ScriptModuleMetaData { hmr_self_accepted: true, ..Default::default() - })); + }))); let context = create_context(module_graph); let boundaries = find_hmr_boundaries(&vec!["F".into()], &context); @@ -188,15 +183,15 @@ mod tests { let module_d = module_graph.module_mut(&"D".into()).unwrap(); module_d.module_type = ModuleType::Js; - module_d.meta = Box::new(ModuleMetaData::Script(ScriptModuleMetaData { + module_d.meta = Box::new(ModuleMetaData::Script(Box::new(ScriptModuleMetaData { hmr_self_accepted: true, ..Default::default() - })); + }))); let context = create_context(module_graph); let boundaries = find_hmr_boundaries(&vec!["F".into()], &context); // Be careful, the order of the paths may not be guaranteed. check the order if the test fails. - assert_eq!(boundaries, HashMap::new()); + assert_eq!(boundaries, HashMap::default()); } #[test] @@ -205,18 +200,18 @@ mod tests { let module_d = module_graph.module_mut(&"D".into()).unwrap(); module_d.module_type = ModuleType::Js; - module_d.meta = Box::new(ModuleMetaData::Script(ScriptModuleMetaData { + module_d.meta = Box::new(ModuleMetaData::Script(Box::new(ScriptModuleMetaData { hmr_self_accepted: false, - hmr_accepted_deps: HashSet::from(["F".into()]), + hmr_accepted_deps: HashSet::from_iter(["F".into()]), ..Default::default() - })); + }))); let module_c = module_graph.module_mut(&"C".into()).unwrap(); module_c.module_type = ModuleType::Js; - module_c.meta = Box::new(ModuleMetaData::Script(ScriptModuleMetaData { + module_c.meta = Box::new(ModuleMetaData::Script(Box::new(ScriptModuleMetaData { hmr_self_accepted: false, - hmr_accepted_deps: HashSet::from(["F".into()]), + hmr_accepted_deps: HashSet::from_iter(["F".into()]), ..Default::default() - })); + }))); let context = create_context(module_graph); let boundaries = find_hmr_boundaries(&vec!["F".into()], &context); @@ -238,23 +233,23 @@ mod tests { let module_d = module_graph.module_mut(&"D".into()).unwrap(); module_d.module_type = ModuleType::Js; - module_d.meta = Box::new(ModuleMetaData::Script(ScriptModuleMetaData { + module_d.meta = Box::new(ModuleMetaData::Script(Box::new(ScriptModuleMetaData { hmr_self_accepted: false, - hmr_accepted_deps: HashSet::from(["F".into()]), + hmr_accepted_deps: HashSet::from_iter(["F".into()]), ..Default::default() - })); + }))); let module_f = module_graph.module_mut(&"F".into()).unwrap(); module_f.module_type = ModuleType::Js; - module_f.meta = Box::new(ModuleMetaData::Script(ScriptModuleMetaData { + module_f.meta = Box::new(ModuleMetaData::Script(Box::new(ScriptModuleMetaData { hmr_self_accepted: false, ..Default::default() - })); + }))); let context = create_context(module_graph); let boundaries = find_hmr_boundaries(&vec!["F".into()], &context); // Be careful, the order of the paths may not be guaranteed. check the order if the test fails. - assert_eq!(boundaries, HashMap::new()); + assert_eq!(boundaries, HashMap::default()); } #[test] @@ -263,25 +258,25 @@ mod tests { let module_b = module_graph.module_mut(&"B".into()).unwrap(); module_b.module_type = ModuleType::Js; - module_b.meta = Box::new(ModuleMetaData::Script(ScriptModuleMetaData { + module_b.meta = Box::new(ModuleMetaData::Script(Box::new(ScriptModuleMetaData { hmr_self_accepted: false, - hmr_accepted_deps: HashSet::from(["E".into()]), + hmr_accepted_deps: HashSet::from_iter(["E".into()]), ..Default::default() - })); + }))); let module_e = module_graph.module_mut(&"E".into()).unwrap(); module_e.module_type = ModuleType::Js; - module_e.meta = Box::new(ModuleMetaData::Script(ScriptModuleMetaData { + module_e.meta = Box::new(ModuleMetaData::Script(Box::new(ScriptModuleMetaData { hmr_self_accepted: false, ..Default::default() - })); + }))); let module_g = module_graph.module_mut(&"G".into()).unwrap(); module_g.module_type = ModuleType::Js; - module_g.meta = Box::new(ModuleMetaData::Script(ScriptModuleMetaData { + module_g.meta = Box::new(ModuleMetaData::Script(Box::new(ScriptModuleMetaData { hmr_self_accepted: false, ..Default::default() - })); + }))); let context = create_context(module_graph); let boundaries = find_hmr_boundaries(&vec!["G".into()], &context); diff --git a/crates/compiler/src/update/handle_update_modules.rs b/crates/compiler/src/update/handle_update_modules.rs index 6c91c73220..290e7940a6 100644 --- a/crates/compiler/src/update/handle_update_modules.rs +++ b/crates/compiler/src/update/handle_update_modules.rs @@ -1,16 +1,18 @@ -use std::{collections::HashMap, sync::Arc}; +use std::sync::Arc; use farmfe_core::{ context::CompilationContext, module::ModuleId, - plugin::{PluginUpdateModulesHookParams, UpdateResult, UpdateType}, + plugin::{PluginUpdateModulesHookParam, UpdateResult, UpdateType}, serde_json, stats::CompilationPluginHookStats, + HashMap, }; use farmfe_utils::relative; pub fn handle_update_modules( paths: Vec<(String, UpdateType)>, + last_fail_module_ids: &[ModuleId], context: &Arc, update_result: &mut UpdateResult, ) -> farmfe_core::error::Result> { @@ -26,13 +28,15 @@ pub fn handle_update_modules( (vec![], 0) }; let paths = resolve_watch_graph_paths(paths, context); + let paths = resolve_last_failed_module_paths(paths, last_fail_module_ids, context); + if context.config.record { let end_time = std::time::SystemTime::now() .duration_since(std::time::UNIX_EPOCH) .unwrap() .as_millis(); context - .record_manager + .stats .add_plugin_hook_stats(CompilationPluginHookStats { plugin_name: "InternalWatchGraphPlugin".to_string(), hook_name: "update_modules".to_string(), @@ -45,7 +49,7 @@ pub fn handle_update_modules( end_time, }) } - let mut plugin_update_modules_hook_params = PluginUpdateModulesHookParams { paths }; + let mut plugin_update_modules_hook_params = PluginUpdateModulesHookParam { paths }; context .plugin_driver @@ -93,7 +97,7 @@ pub fn handle_update_modules( // group the paths by same resolved_path let grouped_paths = paths.iter().fold( - HashMap::>::new(), + HashMap::>::default(), |mut acc, (path, _)| { let resolved_path = path.split('?').next().unwrap().to_string(); @@ -164,7 +168,7 @@ pub fn handle_update_modules( .unwrap() .as_millis(); context - .record_manager + .stats .add_plugin_hook_stats(CompilationPluginHookStats { plugin_name: "InternalUpdateModulesPlugin".to_string(), hook_name: "update_modules".to_string(), @@ -181,6 +185,7 @@ pub fn handle_update_modules( end_time, }) } + Ok(result) } @@ -231,3 +236,17 @@ fn resolve_watch_graph_paths( }) .collect() } + +fn resolve_last_failed_module_paths( + mut paths: Vec<(String, UpdateType)>, + last_fail_module_ids: &[ModuleId], + context: &Arc, +) -> Vec<(String, UpdateType)> { + paths.extend( + last_fail_module_ids + .iter() + .map(|id| (id.resolved_path(&context.config.root), UpdateType::Updated)), + ); + + paths +} diff --git a/crates/compiler/src/update/mod.rs b/crates/compiler/src/update/mod.rs index 60d7371ca9..a55217f91b 100644 --- a/crates/compiler/src/update/mod.rs +++ b/crates/compiler/src/update/mod.rs @@ -1,21 +1,26 @@ -use std::{ - collections::{HashMap, HashSet}, - sync::Arc, -}; +use std::sync::Arc; use farmfe_core::{ cache::module_cache::CachedModule, context::CompilationContext, error::CompilationError, - module::{module_graph::ModuleGraphEdgeDataItem, module_group::ModuleGroupId, Module, ModuleId}, + module::{ + module_graph::ModuleGraphEdgeDataItem, + module_group::{ModuleGroupId, ModuleGroupType}, + Module, ModuleId, + }, plugin::{PluginResolveHookParam, ResolveKind, UpdateResult, UpdateType}, resource::ResourceType, serde::Serialize, serde_json::{self, json}, stats::CompilationPluginHookStats, + HashMap, HashSet, }; -use farmfe_toolkit::get_dynamic_resources_map::get_dynamic_resources_map; +use farmfe_toolkit::resources::get_dynamic_resources_map; +use finalize_module_graph::{ + finalize_updated_module_graph, freeze_module_of_affected_module_graph, +}; use crate::{ build::{ @@ -39,6 +44,7 @@ use self::{ }; mod diff_and_patch_module_graph; +mod finalize_module_graph; mod find_hmr_boundaries; mod handle_update_modules; mod module_cache; @@ -75,11 +81,11 @@ impl Compiler { let update_module_graph = update_context.module_graph.read(); self .context - .record_manager + .stats .set_module_graph_stats(&update_module_graph); self .context - .record_manager + .stats .set_entries(update_module_graph.entries.keys().cloned().collect()) } } @@ -89,7 +95,7 @@ impl Compiler { let module_group_graph = self.context.module_group_graph.read(); self .context - .record_manager + .stats .add_plugin_hook_stats(CompilationPluginHookStats { plugin_name: "HmrUpdate".to_string(), hook_name: "analyze_module_graph".to_string(), @@ -115,7 +121,7 @@ impl Compiler { if self.context.config.record { self .context - .record_manager + .stats .add_plugin_hook_stats(CompilationPluginHookStats { plugin_name: "HmrUpdate".to_string(), hook_name: "diffAndPatchContext".to_string(), @@ -146,11 +152,11 @@ impl Compiler { where F: FnOnce() + Send + Sync + 'static, { - self.context.record_manager.add_hmr_compilation_stats(); - self.context.record_manager.set_start_time(); + self.context.stats.add_hmr_compilation_stats(); + self.context.stats.set_start_time(); // mark the compilation as update - self.context.set_update(); + // self.context.set_update(); let (err_sender, err_receiver) = Self::create_thread_channel(); let update_context = Arc::new(UpdateContext::new()); @@ -165,7 +171,15 @@ impl Compiler { let mut update_result = UpdateResult::default(); self.context.clear_log_store(); - let paths = handle_update_modules(paths, &self.context, &mut update_result)?; + + let last_failed_module_ids = self.last_fail_module_ids.lock(); + let paths = handle_update_modules( + paths, + &last_failed_module_ids, + &self.context, + &mut update_result, + )?; + drop(last_failed_module_ids); for (path, update_type) in paths.clone() { match update_type { @@ -187,7 +201,7 @@ impl Compiler { resolve_param, context: self.context.clone(), err_sender: err_sender.clone(), - thread_pool: self.thread_pool.clone(), + thread_pool: self.context.thread_pool.clone(), order: 0, cached_dependency: None, }, @@ -216,9 +230,10 @@ impl Compiler { self.handle_global_log(&mut errors); if !errors.is_empty() { - self.context.record_manager.set_build_end_time(); - self.context.record_manager.set_end_time(); + self.context.stats.set_build_end_time(); + self.context.stats.set_end_time(); self.set_update_module_graph_stats(&update_context); + self.set_last_fail_module_ids(&errors); let mut error_messages = vec![]; for error in errors { @@ -229,9 +244,11 @@ impl Compiler { .map(|e| e.to_string()) .collect::>()); return Err(CompilationError::GenericError(errors_json.to_string())); + } else { + self.set_last_fail_module_ids(&[]); } - self.context.record_manager.set_build_end_time(); + self.context.stats.set_build_end_time(); self.set_update_module_graph_stats(&update_context); let previous_module_groups = { @@ -248,31 +265,20 @@ impl Compiler { // record graph patch result self.set_module_group_graph_stats(); + freeze_module_of_affected_module_graph(&updated_module_ids, &diff_result, &self.context)?; + // update cache if self.context.config.persistent_cache.enabled() { set_updated_modules_cache(&updated_module_ids, &diff_result, &self.context); } - // call module graph updated hook - self.context.plugin_driver.module_graph_updated( - &farmfe_core::plugin::PluginModuleGraphUpdatedHookParams { - added_modules_ids: diff_result.added_modules.clone().into_iter().collect(), - removed_modules_ids: removed_modules.clone().into_keys().collect(), - updated_modules_ids: updated_module_ids.clone(), - }, + finalize_updated_module_graph( + &updated_module_ids, + removed_modules.keys().cloned().collect(), + &diff_result, &self.context, )?; - let dynamic_resources_map = self.regenerate_resources( - affected_module_groups, - previous_module_groups, - &updated_module_ids, - diff_result.clone(), - removed_modules, - callback, - sync, - ); - // after update_module, diff old_resource and new_resource { let watch_graph = self.context.watch_graph.read(); @@ -314,6 +320,16 @@ impl Compiler { // find the boundaries. let boundaries = find_hmr_boundaries::find_hmr_boundaries(&updated_module_ids, &self.context); + let dynamic_resources_map = self.regenerate_resources( + affected_module_groups, + previous_module_groups, + &updated_module_ids, + diff_result.clone(), + removed_modules, + callback, + sync, + ); + update_result .added_module_ids .extend(diff_result.added_modules); @@ -325,6 +341,7 @@ impl Compiler { update_result.mutable_resources = mutable_resources; update_result.boundaries = boundaries; update_result.dynamic_resources_map = dynamic_resources_map; + Ok(update_result) } @@ -551,7 +568,7 @@ impl Compiler { paths: Vec<(String, UpdateType)>, update_context: &Arc, ) -> ( - HashSet, + HashSet, Vec, DiffResult, HashMap, @@ -638,12 +655,12 @@ impl Compiler { let resources_map = self.context.resources_map.lock(); let module_graph = self.context.module_graph.read(); - let mut dynamic_resources = HashMap::new(); + let mut dynamic_resources = HashMap::default(); for entry_id in module_graph.entries.keys() { dynamic_resources.extend(get_dynamic_resources_map( &module_group_graph, - entry_id, + &ModuleGroupId::new(entry_id, &ModuleGroupType::Entry), &resource_pot_map, &resources_map, &module_graph, @@ -657,7 +674,7 @@ impl Compiler { .plugin_driver .update_finished(&self.context) .unwrap(); - self.context.record_manager.set_end_time(); + self.context.stats.set_end_time(); } else { std::thread::spawn(move || { if let Err(e) = regenerate_resources_for_affected_module_groups( @@ -677,7 +694,7 @@ impl Compiler { .plugin_driver .update_finished(&cloned_context) .unwrap(); - cloned_context.record_manager.set_end_time(); + cloned_context.stats.set_end_time(); }); } diff --git a/crates/compiler/src/update/patch_module_group_graph.rs b/crates/compiler/src/update/patch_module_group_graph.rs index b3b7d64ac5..6ec822b283 100644 --- a/crates/compiler/src/update/patch_module_group_graph.rs +++ b/crates/compiler/src/update/patch_module_group_graph.rs @@ -1,11 +1,15 @@ -use std::collections::{HashMap, HashSet, VecDeque}; +use std::collections::VecDeque; +use farmfe_core::module::module_graph::ModuleGraphEdge; +use farmfe_core::module::module_group::{ModuleGroupId, ModuleGroupType}; use farmfe_core::module::{ module_graph::ModuleGraph, module_group::{ModuleGroup, ModuleGroupGraph}, Module, ModuleId, }; +use farmfe_core::{HashMap, HashSet}; + use super::diff_and_patch_module_graph::DiffResult; pub fn patch_module_group_graph( @@ -14,8 +18,8 @@ pub fn patch_module_group_graph( removed_modules: &HashMap, module_graph: &mut ModuleGraph, module_group_graph: &mut ModuleGroupGraph, -) -> HashSet { - let mut affected_module_groups = HashSet::new(); +) -> HashSet { + let mut affected_module_groups = HashSet::default(); for updated_module_id in &updated_module_ids { let module = module_graph.module(updated_module_id).unwrap(); @@ -25,299 +29,618 @@ pub fn patch_module_group_graph( let deps_changes = &diff_result.deps_changes; - let get_previous_module_groups = |module_id: &ModuleId, module_graph: &mut ModuleGraph| { - if module_graph.has_module(module_id) { + for (module_id, deps_diff_result) in deps_changes { + for (added_module_id, edge_info) in &deps_diff_result.added { + patch_added_dynamic_import_and_dynamic_entry( + added_module_id, + module_id, + edge_info, + diff_result, + removed_modules, + module_graph, + module_group_graph, + &mut affected_module_groups, + ); + } + + for (removed_module_id, edge_info) in &deps_diff_result.removed { + patch_removed_dynamic_import_and_dynamic_entry( + removed_module_id, + module_id, + edge_info, + removed_modules, + module_graph, + module_group_graph, + &mut affected_module_groups, + ); + } + } + + // Do not handle removed module group + let affected_module_groups = affected_module_groups + .into_iter() + .filter(|g_id| module_group_graph.has(g_id)) + .collect::>(); + + let mut final_affected_module_groups = HashSet::default(); + let mut queue = VecDeque::from(affected_module_groups); + // makes sure that all module groups that are affected are included + while !queue.is_empty() { + let module_group_id = queue.pop_front().unwrap(); + let module_group = module_group_graph.module_group(&module_group_id).unwrap(); + + for module_id in module_group.modules() { let module = module_graph.module(module_id).unwrap(); - module.module_groups.clone() - } else { - let removed_module = removed_modules.get(module_id).unwrap(); - removed_module.module_groups.clone() + + for module_group_id in &module.module_groups { + if !final_affected_module_groups.contains(module_group_id) { + final_affected_module_groups.insert(module_group_id.clone()); + queue.push_back(module_group_id.clone()); + } + } } - }; + } - for (module_id, deps_diff_result) in deps_changes { - for (added_module_id, edge_items) in &deps_diff_result.added { - if edge_items.iter().any(|item| item.kind.is_dynamic()) { - // create new module group only when the module group does not exist - if module_group_graph.has(added_module_id) { - continue; + final_affected_module_groups +} + +fn get_previous_module_groups( + module_id: &ModuleId, + module_graph: &mut ModuleGraph, + removed_modules: &HashMap, +) -> HashSet { + if module_graph.has_module(module_id) { + let module = module_graph.module(module_id).unwrap(); + module.module_groups.clone() + } else { + let removed_module = removed_modules.get(module_id).unwrap(); + removed_module.module_groups.clone() + } +} + +fn add_dynamic_module_group( + added_module_id: &ModuleId, + module_id: &ModuleId, + module_group_type: ModuleGroupType, + diff_result: &DiffResult, + module_graph: &mut ModuleGraph, + module_group_graph: &mut ModuleGroupGraph, + affected_module_groups: &mut HashSet, +) { + let added_module_group_id = ModuleGroupId::new(added_module_id, &module_group_type); + + let add_edges = |module_group_graph: &mut ModuleGroupGraph| { + // only add edge for dynamic import + if !matches!(module_group_type, ModuleGroupType::DynamicEntry) { + let module_group_ids = { + let module = module_graph + .module(module_id) + .unwrap_or_else(|| panic!("module {module_id:?} not found")); + module.module_groups.clone() + }; + + for module_group_id in &module_group_ids { + if !module_group_graph.has_edge(module_group_id, &added_module_group_id) { + module_group_graph.add_edge(module_group_id, &added_module_group_id); } - // if the edge is a dynamic import, we need to create a new module group for this module - let module_group_id = added_module_id.clone(); - let module_group = ModuleGroup::new(module_group_id.clone()); - module_group_graph.add_module_group(module_group); + } + } + }; + + // create new module group only when the module group does not exist + if module_group_graph.has(&added_module_group_id) { + add_edges(module_group_graph); + return; + } + + let module_group = ModuleGroup::new(added_module_id.clone(), module_group_type.clone()); + module_group_graph.add_module_group(module_group); + + add_edges(module_group_graph); + + affected_module_groups.insert(added_module_group_id.clone()); + + // if the dynamic import is not a new module, we need to add the module to the module group of the parent module + if diff_result.added_modules.contains(added_module_id) { + let module = module_graph.module_mut(added_module_id).unwrap(); + module.module_groups.insert(added_module_group_id.clone()); + } else { + patch_existing_added_non_dynamic_children( + added_module_id, + HashSet::from_iter([added_module_group_id]), + module_graph, + module_group_graph, + affected_module_groups, + &mut HashSet::default(), + ); + } +} + +fn remove_dynamic_module_group( + removed_group_id: &ModuleGroupId, + module_graph: &mut ModuleGraph, + module_group_graph: &mut ModuleGroupGraph, + affected_module_groups: &mut HashSet, +) { + if !module_group_graph.has(removed_group_id) { + return; + } + + // means this module is no longer imported by any dynamic import, and its module group should be removed, + // as well as all modules inside this module group + let module_group = module_group_graph + .module_group_mut(removed_group_id) + .unwrap_or_else(|| panic!("module group {removed_group_id:?} not found")); + + module_group.modules().iter().for_each(|module_id| { + let module = module_graph.module_mut(module_id).unwrap(); + module.module_groups.remove(removed_group_id); + affected_module_groups.extend(module.module_groups.clone()); + }); + // do not need to remove the edge cause it will be removed automatically when the module is removed + module_group_graph.remove_module_group(removed_group_id); +} + +/// Patch the module group graph when a dynamic import is added +/// - If the added module is a dynamic import, create a new module group for this module +/// - If the added module is a normal import, extend the module group of the parent module +fn patch_added_dynamic_import_and_dynamic_entry( + added_module_id: &ModuleId, + module_id: &ModuleId, + edge_info: &ModuleGraphEdge, + diff_result: &DiffResult, + removed_modules: &HashMap, + module_graph: &mut ModuleGraph, + module_group_graph: &mut ModuleGroupGraph, + affected_module_groups: &mut HashSet, +) { + if edge_info.contains_dynamic_entry() { + add_dynamic_module_group( + added_module_id, + module_id, + ModuleGroupType::DynamicEntry, + diff_result, + module_graph, + module_group_graph, + affected_module_groups, + ); + } + + let previous_parent_groups = get_previous_module_groups(module_id, module_graph, removed_modules); + + if edge_info.contains_dynamic_import() { + // if the edge is a dynamic import, we need to create a new module group for this module + add_dynamic_module_group( + added_module_id, + module_id, + ModuleGroupType::DynamicImport, + diff_result, + module_graph, + module_group_graph, + affected_module_groups, + ); + // for dynamic entry groups, we have to patch the module group no matter it is dynamic import or not + patch_dynamic_entry_group_for_added_dynamic_import( + vec![added_module_id.clone()], + previous_parent_groups.clone(), + module_graph, + module_group_graph, + affected_module_groups, + &mut HashSet::default(), + ); + } + + if edge_info.contains_static() { + // if the edge is a normal import, we need to add this module to the module group of the parent module + // new module + if diff_result.added_modules.contains(added_module_id) { + for module_group_id in &previous_parent_groups { + let module_group = module_group_graph + .module_group_mut(module_group_id) + .unwrap(); + module_group.add_module(added_module_id.clone()); affected_module_groups.insert(module_group_id.clone()); + } + let module = module_graph.module_mut(added_module_id).unwrap(); + module.module_groups.extend(previous_parent_groups); + } else { + // also need to handle all of its non-dynamic children + patch_existing_added_non_dynamic_children( + added_module_id, + previous_parent_groups, + module_graph, + module_group_graph, + affected_module_groups, + &mut HashSet::default(), + ); + } + } +} + +fn patch_removed_dynamic_import_and_dynamic_entry( + removed_module_id: &ModuleId, + module_id: &ModuleId, + edge_info: &ModuleGraphEdge, + removed_modules: &HashMap, + module_graph: &mut ModuleGraph, + module_group_graph: &mut ModuleGroupGraph, + affected_module_groups: &mut HashSet, +) { + if module_graph.has_module(removed_module_id) { + let previous_parent_groups = + get_previous_module_groups(module_id, module_graph, removed_modules); + let mut module_groups_to_remove = HashSet::default(); + // a edge is removed, so we need to remove the module from the module group if necessary + let current_parents = module_graph.dependents(removed_module_id); + + // if dynamic entry is removed and there is no other dynamic entry parent, remove the module group + if edge_info.contains_dynamic_entry() + && current_parents + .iter() + .all(|(_, edge_info)| !edge_info.contains_dynamic_entry()) + { + let removed_group_id = ModuleGroupId::new(removed_module_id, &ModuleGroupType::DynamicEntry); + module_groups_to_remove.insert(removed_group_id); + } + + if edge_info.contains_dynamic_import() && !edge_info.contains_static() { + let removed_group_id = ModuleGroupId::new(removed_module_id, &ModuleGroupType::DynamicImport); + if current_parents + .iter() + .filter(|(_, edge_info)| edge_info.is_dynamic_import()) + .count() + == 0 + { + module_groups_to_remove.insert(removed_group_id); + } else { let module_group_ids = { - let module = module_graph - .module(module_id) - .unwrap_or_else(|| panic!("module {module_id:?} not found")); - module.module_groups.clone() + if removed_modules.contains_key(module_id) { + let removed_module = removed_modules.get(module_id).unwrap(); + removed_module.module_groups.clone() + } else { + let module = module_graph + .module(module_id) + .unwrap_or_else(|| panic!("module {module_id:?} not found")); + module.module_groups.clone() + } }; - + // remove the edge for module_group_id in &module_group_ids { - if !module_group_graph.has_edge(module_group_id, added_module_id) { - module_group_graph.add_edge(module_group_id, added_module_id); + if current_parents + .iter() + .filter(|(p, edge_info)| { + if edge_info.is_dynamic_import() { + let parent = module_graph.module(p).unwrap(); + return parent.module_groups.contains(module_group_id); + } + + false + }) + .count() + == 0 + && module_group_graph.has_edge(module_group_id, &removed_group_id) + { + module_group_graph.remove_edge(module_group_id, &removed_group_id); } } + } - let module = module_graph.module_mut(added_module_id).unwrap(); - module.module_groups.insert(module_group_id); - } else { - // if the edge is a normal import, we need to add this module to the module group of the parent module - let previous_parent_groups = get_previous_module_groups(module_id, module_graph); - // new module - if diff_result.added_modules.contains(added_module_id) { - for module_group_id in &previous_parent_groups { - let module_group = module_group_graph - .module_group_mut(module_group_id) - .unwrap(); - module_group.add_module(added_module_id.clone()); - affected_module_groups.insert(module_group_id.clone()); - } - let module = module_graph.module_mut(added_module_id).unwrap(); - module.module_groups.extend(previous_parent_groups); - } else { - // also need to handle all of its non-dynamic children - let mut queue = VecDeque::from([added_module_id.clone()]); - let mut visited = HashSet::new(); + patch_dynamic_entry_group_for_removed_dynamic_import( + vec![removed_module_id.clone()], + previous_parent_groups, + module_graph, + module_group_graph, + affected_module_groups, + &mut HashSet::default(), + ); + } else { + patch_existing_removed_non_dynamic_children( + removed_module_id, + previous_parent_groups, + module_graph, + module_group_graph, + affected_module_groups, + &mut HashSet::default(), + ); + } - while !queue.is_empty() { - let current_module_id = queue.pop_front().unwrap(); + for removed_group_id in module_groups_to_remove { + remove_dynamic_module_group( + &removed_group_id, + module_graph, + module_group_graph, + affected_module_groups, + ); + } + } else { + // this module is removed, all module groups that contains this module should remove this module + let removed_module = removed_modules.get(removed_module_id).unwrap(); - if visited.contains(¤t_module_id) { - continue; - } - visited.insert(current_module_id.clone()); + for removed_module_group_id in &removed_module.module_groups { + let module_group = module_group_graph.module_group_mut(removed_module_group_id); - let mut current_module_group_change = false; + if let Some(module_group) = module_group { + module_group.remove_module(removed_module_id); + affected_module_groups.insert(removed_module_group_id.clone()); + let modules_len = module_group.modules().len(); - for module_group_id in &previous_parent_groups { - let current_module = module_graph - .module(¤t_module_id) - .unwrap_or_else(|| panic!("module {current_module_id:?} not found")); + if modules_len == 0 { + module_group_graph.remove_module_group(removed_module_group_id); + } + } + } + } +} - if current_module.module_groups.contains(module_group_id) { - continue; - } +fn patch_existing_added_non_dynamic_children( + added_module_id: &ModuleId, + previous_parent_groups: HashSet, + module_graph: &mut ModuleGraph, + module_group_graph: &mut ModuleGroupGraph, + affected_module_groups: &mut HashSet, + visited: &mut HashSet, +) { + let mut queue = VecDeque::from([added_module_id.clone()]); - current_module_group_change = true; + while !queue.is_empty() { + let current_module_id = queue.pop_front().unwrap(); - let module_group = module_group_graph - .module_group_mut(module_group_id) - .unwrap(); + if visited.contains(¤t_module_id) { + continue; + } + visited.insert(current_module_id.clone()); - module_group.add_module(current_module_id.clone()); - let current_module = module_graph.module_mut(¤t_module_id).unwrap(); - current_module.module_groups.insert(module_group_id.clone()); - affected_module_groups.insert(module_group_id.clone()); + let mut current_module_group_change = false; - for (child, edge_info) in module_graph.dependencies(¤t_module_id) { - if edge_info.is_dynamic() && !module_group_graph.has_edge(module_group_id, &child) { - module_group_graph.add_edge(module_group_id, &child); - } - } - } + for module_group_id in &previous_parent_groups { + let current_module = module_graph + .module(¤t_module_id) + .unwrap_or_else(|| panic!("module {current_module_id:?} not found")); - if current_module_group_change { - for (child, edge_info) in module_graph.dependencies(¤t_module_id) { - if !edge_info.is_dynamic() { - queue.push_back(child); - } - } - } + if current_module.module_groups.contains(module_group_id) { + continue; + } + + current_module_group_change = true; + + let module_group = module_group_graph + .module_group_mut(module_group_id) + .unwrap(); + + module_group.add_module(current_module_id.clone()); + let current_module = module_graph.module_mut(¤t_module_id).unwrap(); + current_module.module_groups.insert(module_group_id.clone()); + affected_module_groups.insert(module_group_id.clone()); + + // only add edge for dynamic import or static import + if !matches!( + module_group.module_group_type, + ModuleGroupType::DynamicEntry + ) { + for (child, edge_info) in module_graph.dependencies(¤t_module_id) { + let child_group_id = ModuleGroupId::new(&child, &ModuleGroupType::DynamicImport); + + if edge_info.is_dynamic_import() + && !module_group_graph.has_edge(module_group_id, &child_group_id) + { + module_group_graph.add_edge(module_group_id, &child_group_id); } } } } - for (removed_module_id, edge_info) in &deps_diff_result.removed { - if module_graph.has_module(removed_module_id) { - let previous_parent_groups = get_previous_module_groups(module_id, module_graph); - // a edge is removed, so we need to remove the module from the module group if necessary - let current_parents = module_graph.dependents(removed_module_id); + if current_module_group_change { + let mut dynamic_imported_children = vec![]; - if edge_info.is_dynamic() { - if current_parents - .iter() - .filter(|(_, edge_info)| edge_info.is_dynamic()) - .count() - == 0 - { - // means this module is no longer imported by any dynamic import, and its module group should be removed, - // as well as all modules inside this module group - let module_group = module_group_graph - .module_group_mut(removed_module_id) - .unwrap(); - module_group.modules().iter().for_each(|module_id| { - let module = module_graph.module_mut(module_id).unwrap(); - module.module_groups.remove(removed_module_id); - affected_module_groups.extend(module.module_groups.clone()); - }); - // do not need to remove the edge cause it will be removed automatically when the module is removed - module_group_graph.remove_module_group(removed_module_id); - } else { - let module_group_ids = { - if removed_modules.contains_key(module_id) { - let removed_module = removed_modules.get(module_id).unwrap(); - removed_module.module_groups.clone() - } else { - let module = module_graph - .module(module_id) - .unwrap_or_else(|| panic!("module {module_id:?} not found")); - module.module_groups.clone() - } - }; - // remove the edge - for module_group_id in &module_group_ids { - if current_parents - .iter() - .filter(|(p, edge_info)| { - if edge_info.is_dynamic() { - let parent = module_graph.module(p).unwrap(); - return parent.module_groups.contains(module_group_id); - } - - false - }) - .count() - == 0 - && module_group_graph.has_edge(module_group_id, removed_module_id) - { - module_group_graph.remove_edge(module_group_id, removed_module_id); - } - } - } + for (child, edge_info) in module_graph.dependencies(¤t_module_id) { + if !edge_info.is_dynamic_import() { + queue.push_back(child); } else { - let mut queue = VecDeque::from([removed_module_id.clone()]); - let mut visited = HashSet::new(); + dynamic_imported_children.push(child); + } + } - while !queue.is_empty() { - let current_module_id = queue.pop_front().unwrap(); + if dynamic_imported_children.is_empty() { + continue; + } - if visited.contains(¤t_module_id) { - continue; - } - visited.insert(current_module_id.clone()); - - let current_parents = module_graph - .dependents(¤t_module_id) - .into_iter() - .map(|(id, edge_info)| (id, edge_info.is_dynamic())) - .collect::>(); - let mut current_module_group_change = false; - - for module_group_id in &previous_parent_groups { - // if current parents don't contain previous parent's module group, remove the module from existing module groups - // Note: current_parents don't contain module_id because the edge is removed - if current_parents - .iter() - .filter(|(_, is_dynamic)| !is_dynamic) - .all(|(id, _)| { - let parent = module_graph.module(id).unwrap(); - !parent.module_groups.contains(module_group_id) - }) - { - current_module_group_change = true; - let module_group = module_group_graph - .module_group_mut(module_group_id) - .unwrap(); - - module_group.remove_module(¤t_module_id); - let current_module = module_graph.module_mut(¤t_module_id).unwrap(); - affected_module_groups.extend(current_module.module_groups.clone()); - current_module.module_groups.remove(module_group_id); - - let modules_len = module_group.modules().len(); - - if modules_len == 0 { - module_group_graph.remove_module_group(module_group_id); - } else { - // determine if there are edges that should be removed - let children = module_graph.dependencies(¤t_module_id); - - for (child, edge_info) in children { - if edge_info.is_dynamic() - && module_group_graph - .dependencies_ids(module_group_id) - .contains(&child) - { - let parents = module_graph - .dependents(&child) - .into_iter() - .filter(|(_, edge_info)| edge_info.is_dynamic()) - .collect::>(); - let parents_in_module_group = parents.iter().any(|(id, _)| { - let parent = module_graph.module(id).unwrap(); - parent.module_groups.contains(module_group_id) - }); - - if !parents_in_module_group { - module_group_graph.remove_edge(module_group_id, &child); - } - } - } - } - } - } + // for dynamic entry groups, we have to patch the module group no matter it is dynamic import or not + patch_dynamic_entry_group_for_added_dynamic_import( + dynamic_imported_children, + previous_parent_groups.clone(), + module_graph, + module_group_graph, + affected_module_groups, + visited, + ); + } + } +} + +fn patch_existing_removed_non_dynamic_children( + removed_module_id: &ModuleId, + previous_parent_groups: HashSet, + module_graph: &mut ModuleGraph, + module_group_graph: &mut ModuleGroupGraph, + affected_module_groups: &mut HashSet, + visited: &mut HashSet, +) { + let mut queue = VecDeque::from([removed_module_id.clone()]); + + while !queue.is_empty() { + let current_module_id = queue.pop_front().unwrap(); - if current_module_group_change { - for (child, edge_info) in module_graph.dependencies(¤t_module_id) { - if !edge_info.is_dynamic() { - queue.push_back(child); - } + if visited.contains(¤t_module_id) { + continue; + } + visited.insert(current_module_id.clone()); + + let current_parents = module_graph + .dependents(¤t_module_id) + .into_iter() + .map(|(id, edge_info)| (id, edge_info.is_dynamic_import())) + .collect::>(); + let mut current_module_group_change = false; + + for module_group_id in &previous_parent_groups { + // if current parents don't contain previous parent's module group, remove the module from existing module groups + // Note: current_parents don't contain module_id because the edge is removed + if current_parents + .iter() + .filter(|(_, is_dynamic)| !is_dynamic) + .all(|(id, _)| { + let parent = module_graph.module(id).unwrap(); + !parent.module_groups.contains(module_group_id) + }) + { + current_module_group_change = true; + let module_group = module_group_graph + .module_group_mut(module_group_id) + .unwrap_or_else(|| panic!("module group {module_group_id:?} not found")); + + module_group.remove_module(¤t_module_id); + let current_module = module_graph.module_mut(¤t_module_id).unwrap(); + affected_module_groups.extend(current_module.module_groups.clone()); + current_module.module_groups.remove(module_group_id); + + let modules_len = module_group.modules().len(); + + if modules_len == 0 { + module_group_graph.remove_module_group(module_group_id); + } else if !matches!( + module_group.module_group_type, + ModuleGroupType::DynamicEntry + ) { + // determine if there are edges that should be removed + let children = module_graph.dependencies(¤t_module_id); + + for (child, edge_info) in children { + let child_group_id = ModuleGroupId::new(&child, &ModuleGroupType::DynamicImport); + + if edge_info.is_dynamic_import() + && module_group_graph + .dependencies_ids(module_group_id) + .contains(&child_group_id) + { + let parents = module_graph + .dependents(&child) + .into_iter() + .filter(|(_, edge_info)| edge_info.is_dynamic_import()) + .collect::>(); + let parents_in_module_group = parents.iter().any(|(id, _)| { + let parent = module_graph.module(id).unwrap(); + parent.module_groups.contains(module_group_id) + }); + + if !parents_in_module_group { + module_group_graph.remove_edge(module_group_id, &child_group_id); } } } } - } else { - // this module is removed, all module groups that contains this module should remove this module - let removed_module = removed_modules.get(removed_module_id).unwrap(); - - for removed_module_group_id in &removed_module.module_groups { - let module_group = module_group_graph.module_group_mut(removed_module_group_id); + } + } - if let Some(module_group) = module_group { - module_group.remove_module(removed_module_id); - affected_module_groups.insert(removed_module_group_id.clone()); - let modules_len = module_group.modules().len(); + if current_module_group_change { + let mut dynamic_imported_children = vec![]; - if modules_len == 0 { - module_group_graph.remove_module_group(removed_module_group_id); - } - } + for (child, edge_info) in module_graph.dependencies(¤t_module_id) { + if !edge_info.is_dynamic_import() { + queue.push_back(child); + } else { + dynamic_imported_children.push(child); } } + + if dynamic_imported_children.is_empty() { + continue; + } + + // for dynamic entry groups, we have to patch the module group no matter it is dynamic import or not + patch_dynamic_entry_group_for_removed_dynamic_import( + dynamic_imported_children, + previous_parent_groups.clone(), + module_graph, + module_group_graph, + affected_module_groups, + visited, + ); } } +} - // Do not handle removed module group - let affected_module_groups = affected_module_groups - .into_iter() - .filter(|g_id| module_group_graph.has(g_id)) - .collect::>(); - - let mut final_affected_module_groups = HashSet::new(); - let mut queue = VecDeque::from(affected_module_groups); - // makes sure that all module groups that are affected are included - while !queue.is_empty() { - let module_group_id = queue.pop_front().unwrap(); - let module_group = module_group_graph.module_group(&module_group_id).unwrap(); +fn get_dynamic_entry_group_ids( + previous_parent_groups: &HashSet, + module_group_graph: &ModuleGroupGraph, +) -> HashSet { + previous_parent_groups + .iter() + .filter(|group_id| { + if !module_group_graph.has(group_id) { + return false; + } - for module_id in module_group.modules() { - let module = module_graph.module(module_id).unwrap(); + let group = module_group_graph.module_group(group_id).unwrap(); + matches!(group.module_group_type, ModuleGroupType::DynamicEntry) + }) + .cloned() + .collect::>() +} - for module_group_id in &module.module_groups { - if !final_affected_module_groups.contains(module_group_id) { - final_affected_module_groups.insert(module_group_id.clone()); - queue.push_back(module_group_id.clone()); - } - } +fn patch_dynamic_entry_group_for_added_dynamic_import( + dynamic_imported_children: Vec, + previous_parent_groups: HashSet, + module_graph: &mut ModuleGraph, + module_group_graph: &mut ModuleGroupGraph, + affected_module_groups: &mut HashSet, + visited: &mut HashSet, +) { + let dynamic_entry_group_ids = + get_dynamic_entry_group_ids(&previous_parent_groups, module_group_graph); + + if !dynamic_entry_group_ids.is_empty() { + for child in dynamic_imported_children { + // patch the module group for dynamic entry recursively for dynamic import + patch_existing_added_non_dynamic_children( + &child, + dynamic_entry_group_ids.clone(), + module_graph, + module_group_graph, + affected_module_groups, + visited, + ); } } +} - final_affected_module_groups +fn patch_dynamic_entry_group_for_removed_dynamic_import( + dynamic_imported_children: Vec, + previous_parent_groups: HashSet, + module_graph: &mut ModuleGraph, + module_group_graph: &mut ModuleGroupGraph, + affected_module_groups: &mut HashSet, + visited: &mut HashSet, +) { + let dynamic_entry_group_ids = + get_dynamic_entry_group_ids(&previous_parent_groups, module_group_graph); + + if !dynamic_entry_group_ids.is_empty() { + for child in dynamic_imported_children { + // patch the module group for dynamic entry recursively for dynamic import + patch_existing_removed_non_dynamic_children( + &child, + dynamic_entry_group_ids.clone(), + module_graph, + module_group_graph, + affected_module_groups, + visited, + ); + } + } } +#[cfg(test)] +mod test_dynamic_entries; #[cfg(test)] mod tests; diff --git a/crates/compiler/src/update/patch_module_group_graph/test_dynamic_entries.rs b/crates/compiler/src/update/patch_module_group_graph/test_dynamic_entries.rs new file mode 100644 index 0000000000..47afb1d906 --- /dev/null +++ b/crates/compiler/src/update/patch_module_group_graph/test_dynamic_entries.rs @@ -0,0 +1,272 @@ +use farmfe_core::{ + module::{ + module_graph::{ModuleGraphEdge, ModuleGraphEdgeDataItem}, + module_group::{ModuleGroupId, ModuleGroupType}, + Module, + }, + plugin::ResolveKind, + HashMap, HashSet, +}; +use farmfe_plugin_partial_bundling::module_group_graph_from_module_graph; +use farmfe_testing_helpers::construct_test_module_graph_complex; + +use crate::update::{ + diff_and_patch_module_graph::{diff_module_graph, patch_module_graph}, + patch_module_group_graph::patch_module_group_graph, +}; + +#[test] +fn test_patch_module_group_graph_dynamic_entry_complex() { + let mut module_graph = construct_test_module_graph_complex(); + module_graph.dynamic_entries = HashMap::from_iter([("D".into(), "D".to_string())]); + module_graph + .update_edge( + &"A".into(), + &"D".into(), + ModuleGraphEdge::new(vec![ModuleGraphEdgeDataItem { + kind: ResolveKind::DynamicEntry { + name: "AD".to_string(), + output_filename: None, + }, + ..Default::default() + }]), + ) + .unwrap(); + + let mut update_module_graph = construct_test_module_graph_complex(); + update_module_graph.add_module(Module::new("I".into())); + update_module_graph + .add_edge( + &"E".into(), + &"I".into(), + ModuleGraphEdge::new(vec![ModuleGraphEdgeDataItem { + kind: ResolveKind::DynamicEntry { + name: "EI".to_string(), + output_filename: None, + }, + ..Default::default() + }]), + ) + .unwrap(); + update_module_graph + .add_edge( + &"I".into(), + &"H".into(), + ModuleGraphEdge::new(vec![ModuleGraphEdgeDataItem { + kind: ResolveKind::Import, + ..Default::default() + }]), + ) + .unwrap(); + update_module_graph.remove_module(&"F".into()); + update_module_graph.remove_module(&"B".into()); + update_module_graph.remove_module(&"D".into()); + update_module_graph.entries = + HashMap::from_iter([("A".into(), "A".to_string()), ("E".into(), "E".to_string())]); + update_module_graph.update_execution_order_for_modules(); + + let mut module_group_graph = module_group_graph_from_module_graph(&mut module_graph); + + let start_points = vec!["A".into(), "E".into()]; + let diff_result = diff_module_graph(start_points.clone(), &module_graph, &update_module_graph); + let removed_modules = patch_module_graph( + start_points.clone(), + &diff_result, + &mut module_graph, + &mut update_module_graph, + ); + + assert_eq!( + module_graph.entries, + HashMap::from_iter([("A".into(), "A".to_string()), ("B".into(), "B".to_string()),]) + ); + + assert_eq!( + module_graph.dynamic_entries, + HashMap::from_iter([("I".into(), "EI".to_string())]) + ); + + let affected_groups = patch_module_group_graph( + start_points.clone(), + &diff_result, + &removed_modules, + &mut module_graph, + &mut module_group_graph, + ); + + let group_id_a = ModuleGroupId::new(&"A".into(), &ModuleGroupType::Entry); + let group_id_b = ModuleGroupId::new(&"B".into(), &ModuleGroupType::Entry); + let group_id_f = ModuleGroupId::new(&"F".into(), &ModuleGroupType::DynamicImport); + let group_id_g = ModuleGroupId::new(&"G".into(), &ModuleGroupType::DynamicImport); + let group_id_i = ModuleGroupId::new(&"I".into(), &ModuleGroupType::DynamicEntry); + + assert_eq!( + affected_groups, + HashSet::from_iter([ + group_id_a.clone(), + group_id_b.clone(), + group_id_f.clone(), + group_id_g.clone(), + group_id_i.clone() + ]) + ); + + let update_module_group_graph = module_group_graph_from_module_graph(&mut module_graph); + + assert_eq!(module_group_graph, update_module_group_graph); + + // makes sure that module_groups field of each module is correct + let module_a = module_graph.module(&"A".into()).unwrap(); + assert_eq!( + module_a.module_groups, + HashSet::from_iter([group_id_a.clone(), group_id_f.clone()]) + ); + let module_b = module_graph.module(&"B".into()).unwrap(); + assert_eq!( + module_b.module_groups, + HashSet::from_iter([group_id_b.clone()]) + ); + let module_c = module_graph.module(&"C".into()).unwrap(); + assert_eq!( + module_c.module_groups, + HashSet::from_iter([group_id_a.clone(), group_id_f.clone()]) + ); + let module_d = module_graph.module(&"D".into()).unwrap(); + assert_eq!( + module_d.module_groups, + HashSet::from_iter([group_id_b.clone()]) + ); + let module_e = module_graph.module(&"E".into()).unwrap(); + assert_eq!( + module_e.module_groups, + HashSet::from_iter([group_id_b.clone()]) + ); + let module_i = module_graph.module(&"I".into()).unwrap(); + assert_eq!( + module_i.module_groups, + HashSet::from_iter([group_id_i.clone()]) + ); + let module_h = module_graph.module(&"H".into()).unwrap(); + assert_eq!( + module_h.module_groups, + HashSet::from_iter([ + group_id_i.clone(), + group_id_f.clone(), + group_id_g.clone(), + group_id_b.clone() + ]) + ); +} + +#[test] +fn test_patch_module_group_graph_dynamic_entry_update_dynamic_entry() { + let mut module_graph = construct_test_module_graph_complex(); + let mut update_module_graph = construct_test_module_graph_complex(); + update_module_graph + .update_edge( + &"A".into(), + &"D".into(), + ModuleGraphEdge::new(vec![ModuleGraphEdgeDataItem { + kind: ResolveKind::DynamicEntry { + name: "AD".to_string(), + output_filename: None, + }, + ..Default::default() + }]), + ) + .unwrap(); + update_module_graph.remove_module(&"F".into()); + update_module_graph.remove_module(&"B".into()); + update_module_graph.remove_module(&"E".into()); + update_module_graph.remove_module(&"G".into()); + update_module_graph.remove_module(&"H".into()); + update_module_graph.entries = HashMap::from_iter([("A".into(), "A".to_string())]); + update_module_graph.update_execution_order_for_modules(); + + let mut module_group_graph = module_group_graph_from_module_graph(&mut module_graph); + + let start_points = vec!["A".into()]; + let diff_result = diff_module_graph(start_points.clone(), &module_graph, &update_module_graph); + let removed_modules = patch_module_graph( + start_points.clone(), + &diff_result, + &mut module_graph, + &mut update_module_graph, + ); + + assert_eq!( + module_graph.entries, + HashMap::from_iter([("A".into(), "A".to_string()), ("B".into(), "B".to_string()),]) + ); + + assert_eq!( + module_graph.dynamic_entries, + HashMap::from_iter([("D".into(), "AD".to_string())]) + ); + + let affected_groups = patch_module_group_graph( + start_points.clone(), + &diff_result, + &removed_modules, + &mut module_graph, + &mut module_group_graph, + ); + + let group_id_a = ModuleGroupId::new(&"A".into(), &ModuleGroupType::Entry); + let group_id_b = ModuleGroupId::new(&"B".into(), &ModuleGroupType::Entry); + let group_id_f = ModuleGroupId::new(&"F".into(), &ModuleGroupType::DynamicImport); + let group_id_g = ModuleGroupId::new(&"G".into(), &ModuleGroupType::DynamicImport); + let group_id_d = ModuleGroupId::new(&"D".into(), &ModuleGroupType::DynamicEntry); + + assert_eq!( + affected_groups, + HashSet::from_iter([ + group_id_a.clone(), + group_id_b.clone(), + group_id_f.clone(), + group_id_g.clone(), + group_id_d.clone() + ]) + ); + + let update_module_group_graph = module_group_graph_from_module_graph(&mut module_graph); + + assert_eq!(module_group_graph, update_module_group_graph); + + // makes sure that module_groups field of each module is correct + let module_a = module_graph.module(&"A".into()).unwrap(); + assert_eq!( + module_a.module_groups, + HashSet::from_iter([group_id_a.clone(), group_id_f.clone(), group_id_d.clone()]) + ); + let module_b = module_graph.module(&"B".into()).unwrap(); + assert_eq!( + module_b.module_groups, + HashSet::from_iter([group_id_b.clone()]) + ); + let module_c = module_graph.module(&"C".into()).unwrap(); + assert_eq!( + module_c.module_groups, + HashSet::from_iter([group_id_a.clone(), group_id_f.clone(), group_id_d.clone()]) + ); + let module_d = module_graph.module(&"D".into()).unwrap(); + assert_eq!( + module_d.module_groups, + HashSet::from_iter([group_id_b.clone(), group_id_d.clone()]) + ); + let module_e = module_graph.module(&"E".into()).unwrap(); + assert_eq!( + module_e.module_groups, + HashSet::from_iter([group_id_b.clone()]) + ); + let module_h = module_graph.module(&"H".into()).unwrap(); + assert_eq!( + module_h.module_groups, + HashSet::from_iter([ + group_id_d.clone(), + group_id_f.clone(), + group_id_g.clone(), + group_id_b.clone() + ]) + ); +} diff --git a/crates/compiler/src/update/patch_module_group_graph/tests.rs b/crates/compiler/src/update/patch_module_group_graph/tests.rs index 99c78c2cbe..ab3369e9ed 100644 --- a/crates/compiler/src/update/patch_module_group_graph/tests.rs +++ b/crates/compiler/src/update/patch_module_group_graph/tests.rs @@ -1,14 +1,16 @@ -use std::collections::HashSet; - use farmfe_core::{ module::{ module_graph::{ModuleGraph, ModuleGraphEdge, ModuleGraphEdgeDataItem}, + module_group::{ModuleGroupId, ModuleGroupType}, Module, }, plugin::ResolveKind, + HashMap, HashSet, +}; +use farmfe_plugin_partial_bundling::{ + module_group_graph_from_entries, module_group_graph_from_module_graph, }; -use farmfe_plugin_partial_bundling::module_group_graph_from_entries; -use farmfe_testing_helpers::construct_test_module_graph; +use farmfe_testing_helpers::{construct_test_module_graph, construct_test_module_graph_complex}; use crate::update::diff_and_patch_module_graph::{diff_module_graph, patch_module_graph}; @@ -70,7 +72,14 @@ fn test_patch_module_group_graph_1() { &mut module_graph, &mut module_group_graph, ); - assert_eq!(affected_groups, HashSet::from(["A".into(), "B".into()])); + + let group_id_a = ModuleGroupId::new(&"A".into(), &ModuleGroupType::Entry); + let group_id_b = ModuleGroupId::new(&"B".into(), &ModuleGroupType::Entry); + + assert_eq!( + affected_groups, + HashSet::from_iter([group_id_a.clone(), group_id_b.clone()]) + ); let update_module_group_graph = module_group_graph_from_entries(&entries, &mut module_graph); @@ -78,15 +87,27 @@ fn test_patch_module_group_graph_1() { // makes sure that module_groups field of each module is correct let module_a = module_graph.module(&"A".into()).unwrap(); - assert_eq!(module_a.module_groups, HashSet::from(["A".into()])); + assert_eq!( + module_a.module_groups, + HashSet::from_iter([group_id_a.clone()]) + ); let module_b = module_graph.module(&"B".into()).unwrap(); - assert_eq!(module_b.module_groups, HashSet::from(["B".into()])); + assert_eq!( + module_b.module_groups, + HashSet::from_iter([group_id_b.clone()]) + ); let module_c = module_graph.module(&"C".into()).unwrap(); - assert_eq!(module_c.module_groups, HashSet::from(["A".into()])); + assert_eq!(module_c.module_groups, HashSet::from_iter([group_id_a])); let module_d = module_graph.module(&"D".into()).unwrap(); - assert_eq!(module_d.module_groups, HashSet::from(["B".into()])); + assert_eq!( + module_d.module_groups, + HashSet::from_iter([group_id_b.clone()]) + ); let module_e = module_graph.module(&"E".into()).unwrap(); - assert_eq!(module_e.module_groups, HashSet::from(["B".into()])); + assert_eq!( + module_e.module_groups, + HashSet::from_iter([group_id_b.clone()]) + ); } #[test] @@ -128,14 +149,19 @@ fn test_patch_module_group_graph_2() { &mut module_graph, &mut module_group_graph, ); + + let group_id_a = ModuleGroupId::new(&"A".into(), &ModuleGroupType::Entry); + let group_id_b = ModuleGroupId::new(&"B".into(), &ModuleGroupType::Entry); + let group_id_f = ModuleGroupId::new(&"F".into(), &ModuleGroupType::DynamicImport); + assert_eq!( affected_groups, - HashSet::from(["A".into(), "B".into(), "F".into()]) + HashSet::from_iter([group_id_a.clone(), group_id_b.clone(), group_id_f.clone()]) ); - let module_group_b = module_group_graph.module_group(&"B".into()).unwrap(); + let module_group_b = module_group_graph.module_group(&group_id_b).unwrap(); assert_eq!( module_group_b.modules(), - &HashSet::from(["B".into(), "H".into(), "F".into(), "C".into(), "A".into()]) + &HashSet::from_iter(["B".into(), "H".into(), "F".into(), "C".into(), "A".into()]) ); let update_module_group_graph = module_group_graph_from_entries(&start_points, &mut module_graph); @@ -146,29 +172,35 @@ fn test_patch_module_group_graph_2() { let module_a = module_graph.module(&"A".into()).unwrap(); assert_eq!( module_a.module_groups, - HashSet::from(["A".into(), "F".into(), "B".into()]) + HashSet::from_iter([group_id_a.clone(), group_id_b.clone(), group_id_f.clone()]) ); let module_b = module_graph.module(&"B".into()).unwrap(); - assert_eq!(module_b.module_groups, HashSet::from(["B".into()])); + assert_eq!( + module_b.module_groups, + HashSet::from_iter([group_id_b.clone()]) + ); let module_c = module_graph.module(&"C".into()).unwrap(); assert_eq!( module_c.module_groups, - HashSet::from(["A".into(), "F".into(), "B".into()]) + HashSet::from_iter([group_id_a.clone(), group_id_b.clone(), group_id_f.clone()]) ); let module_f = module_graph.module(&"F".into()).unwrap(); assert_eq!( module_f.module_groups, - HashSet::from(["B".into(), "F".into()]) + HashSet::from_iter([group_id_b.clone(), group_id_f.clone()]) ); let module_h = module_graph.module(&"H".into()).unwrap(); - assert_eq!(module_h.module_groups, HashSet::from(["B".into()])); + assert_eq!( + module_h.module_groups, + HashSet::from_iter([group_id_b.clone()]) + ); } #[test] fn test_patch_module_group_graph_3() { let mut module_graph = construct_test_module_graph(); let mut update_module_graph = construct_test_module_graph(); - update_module_graph.remove_module(&"G".into()); + update_module_graph.remove_module(&"C".into()); update_module_graph .remove_edge(&"F".into(), &"A".into()) .unwrap(); @@ -182,10 +214,7 @@ fn test_patch_module_group_graph_3() { let updated_modules = vec!["F".into(), "E".into(), "B".into()]; let mut module_group_graph = module_group_graph_from_entries( - &module_graph - .entries - .clone().into_keys() - .collect(), + &module_graph.entries.clone().into_keys().collect(), &mut module_graph, ); let diff_result = diff_module_graph(updated_modules.clone(), &module_graph, &update_module_graph); @@ -204,16 +233,24 @@ fn test_patch_module_group_graph_3() { &mut module_graph, &mut module_group_graph, ); + + let group_id_a = ModuleGroupId::new(&"A".into(), &ModuleGroupType::Entry); + let group_id_b = ModuleGroupId::new(&"B".into(), &ModuleGroupType::Entry); + let group_id_d = ModuleGroupId::new(&"D".into(), &ModuleGroupType::DynamicImport); + let group_id_f = ModuleGroupId::new(&"F".into(), &ModuleGroupType::DynamicImport); + assert_eq!( affected_groups, - HashSet::from(["A".into(), "B".into(), "F".into(), "D".into()]) + HashSet::from_iter([ + group_id_a.clone(), + group_id_b.clone(), + group_id_d.clone(), + group_id_f.clone() + ]) ); let update_module_group_graph = module_group_graph_from_entries( - &module_graph - .entries - .clone().into_keys() - .collect(), + &module_graph.entries.clone().into_keys().collect(), &mut module_graph, ); @@ -221,25 +258,40 @@ fn test_patch_module_group_graph_3() { // makes sure that module_groups field of each module is correct let module_a = module_graph.module(&"A".into()).unwrap(); - assert_eq!(module_a.module_groups, HashSet::from(["A".into()])); + assert_eq!( + module_a.module_groups, + HashSet::from_iter([group_id_a.clone()]) + ); let module_b = module_graph.module(&"B".into()).unwrap(); - assert_eq!(module_b.module_groups, HashSet::from(["B".into()])); + assert_eq!( + module_b.module_groups, + HashSet::from_iter([group_id_b.clone()]) + ); let module_c = module_graph.module(&"C".into()).unwrap(); - assert_eq!(module_c.module_groups, HashSet::from(["A".into()])); + assert_eq!( + module_c.module_groups, + HashSet::from_iter([group_id_a.clone()]) + ); let module_d = module_graph.module(&"D".into()).unwrap(); assert_eq!( module_d.module_groups, - HashSet::from(["B".into(), "D".into()]) + HashSet::from_iter([group_id_b.clone(), group_id_d.clone()]) ); let module_e = module_graph.module(&"E".into()).unwrap(); - assert_eq!(module_e.module_groups, HashSet::from(["B".into()])); + assert_eq!( + module_e.module_groups, + HashSet::from_iter([group_id_b.clone()]) + ); let module_f = module_graph.module(&"F".into()).unwrap(); assert_eq!( module_f.module_groups, - HashSet::from(["F".into(), "B".into()]) + HashSet::from_iter([group_id_f.clone(), group_id_b.clone()]) ); let module_h = module_graph.module(&"H".into()).unwrap(); - assert_eq!(module_h.module_groups, HashSet::from(["B".into()])); + assert_eq!( + module_h.module_groups, + HashSet::from_iter([group_id_b.clone()]) + ); } fn get_edge_info(kind: ResolveKind) -> ModuleGraphEdge { @@ -291,10 +343,7 @@ fn test_patch_module_group_graph_css_modules() { let start_points = vec!["D".into()]; let mut module_group_graph = module_group_graph_from_entries( - &module_graph - .entries - .clone().into_keys() - .collect(), + &module_graph.entries.clone().into_keys().collect(), &mut module_graph, ); let diff_result = diff_module_graph(start_points.clone(), &module_graph, &update_module_graph); @@ -312,13 +361,17 @@ fn test_patch_module_group_graph_css_modules() { &mut module_graph, &mut module_group_graph, ); - assert_eq!(affected_groups, HashSet::from(["D".into(), "B".into()])); + + let group_id_b = ModuleGroupId::new(&"B".into(), &ModuleGroupType::Entry); + let group_id_d = ModuleGroupId::new(&"D".into(), &ModuleGroupType::DynamicImport); + + assert_eq!( + affected_groups, + HashSet::from_iter([group_id_b.clone(), group_id_d.clone()]) + ); let update_module_group_graph = module_group_graph_from_entries( - &module_graph - .entries - .clone().into_keys() - .collect(), + &module_graph.entries.clone().into_keys().collect(), &mut module_graph, ); @@ -360,7 +413,9 @@ fn test_patch_module_group_graph_add_and_remove() { &mut module_group_graph, ); - assert_eq!(affected_groups, HashSet::from(["a".into()])); + let group_id_a = ModuleGroupId::new(&"a".into(), &ModuleGroupType::Entry); + + assert_eq!(affected_groups, HashSet::from_iter([group_id_a.clone()])); let update_module_group_graph = module_group_graph_from_entries(&start_points, &mut module_graph); @@ -368,7 +423,10 @@ fn test_patch_module_group_graph_add_and_remove() { // makes sure that module_groups field of each module is correct for module in module_graph.modules() { - assert_eq!(module.module_groups, HashSet::from(["a".into()])); + assert_eq!( + module.module_groups, + HashSet::from_iter([group_id_a.clone()]) + ); } } @@ -406,7 +464,9 @@ fn test_patch_module_group_graph_remove_and_add() { &mut module_group_graph, ); - assert_eq!(affected_groups, HashSet::from(["a".into()])); + let group_id_a = ModuleGroupId::new(&"a".into(), &ModuleGroupType::Entry); + + assert_eq!(affected_groups, HashSet::from_iter([group_id_a.clone()])); let update_module_group_graph = module_group_graph_from_entries(&vec!["a".into()], &mut module_graph); @@ -415,7 +475,10 @@ fn test_patch_module_group_graph_remove_and_add() { // makes sure that module_groups field of each module is correct for module in module_graph.modules() { - assert_eq!(module.module_groups, HashSet::from(["a".into()])); + assert_eq!( + module.module_groups, + HashSet::from_iter([group_id_a.clone()]) + ); } } @@ -465,7 +528,9 @@ fn test_diff_module_deps_remove_and_add_complex() { &mut module_group_graph, ); - assert_eq!(affected_groups, HashSet::from(["a".into()])); + let group_id_a = ModuleGroupId::new(&"a".into(), &ModuleGroupType::Entry); + + assert_eq!(affected_groups, HashSet::from_iter([group_id_a.clone()])); let update_module_group_graph = module_group_graph_from_entries(&vec!["a".into()], &mut module_graph); @@ -474,6 +539,272 @@ fn test_diff_module_deps_remove_and_add_complex() { // makes sure that module_groups field of each module is correct for module in module_graph.modules() { - assert_eq!(module.module_groups, HashSet::from(["a".into()])); + assert_eq!( + module.module_groups, + HashSet::from_iter([group_id_a.clone()]) + ); } } + +#[test] +fn test_patch_module_group_graph_remove_normal_edge() { + let mut module_graph = construct_test_module_graph_complex(); + let module_i = Module::new("I".into()); + module_graph.add_module(module_i); + module_graph + .add_edge(&"D".into(), &"I".into(), Default::default()) + .unwrap(); + let mut update_module_graph = construct_test_module_graph_complex(); + update_module_graph.remove_module(&"F".into()); + update_module_graph.remove_module(&"G".into()); + update_module_graph.remove_module(&"A".into()); + update_module_graph.remove_module(&"C".into()); + update_module_graph.remove_module(&"D".into()); + update_module_graph.remove_module(&"H".into()); + + let entries = vec!["A".into(), "B".into()]; + let start_points = vec!["B".into()]; + let mut module_group_graph = module_group_graph_from_entries(&entries, &mut module_graph); + + let diff_result = diff_module_graph(start_points.clone(), &module_graph, &update_module_graph); + let removed_modules = patch_module_graph( + start_points.clone(), + &diff_result, + &mut module_graph, + &mut update_module_graph, + ); + + let affected_groups = patch_module_group_graph( + start_points.clone(), + &diff_result, + &removed_modules, + &mut module_graph, + &mut module_group_graph, + ); + + let group_id_a = ModuleGroupId::new(&"A".into(), &ModuleGroupType::Entry); + let group_id_d = ModuleGroupId::new(&"D".into(), &ModuleGroupType::DynamicImport); + let group_id_g = ModuleGroupId::new(&"G".into(), &ModuleGroupType::DynamicImport); + let group_id_f = ModuleGroupId::new(&"F".into(), &ModuleGroupType::DynamicImport); + let group_id_b = ModuleGroupId::new(&"B".into(), &ModuleGroupType::Entry); + + assert_eq!( + affected_groups, + HashSet::from_iter([ + group_id_d.clone(), + group_id_b.clone(), + group_id_g.clone(), + group_id_a.clone(), + group_id_f.clone() + ]) + ); + + let update_module_group_graph = module_group_graph_from_entries(&entries, &mut module_graph); + + assert_eq!(module_group_graph, update_module_group_graph); + + // makes sure that module_groups field of each module is correct + let module_a = module_graph.module(&"A".into()).unwrap(); + assert_eq!( + module_a.module_groups, + HashSet::from_iter([group_id_a.clone(), group_id_f.clone()]) + ); + let module_b = module_graph.module(&"B".into()).unwrap(); + assert_eq!( + module_b.module_groups, + HashSet::from_iter([group_id_b.clone()]) + ); + let module_c = module_graph.module(&"C".into()).unwrap(); + assert_eq!( + module_c.module_groups, + HashSet::from_iter([group_id_a, group_id_f.clone()]) + ); + let module_d = module_graph.module(&"D".into()).unwrap(); + assert_eq!( + module_d.module_groups, + HashSet::from_iter([group_id_d.clone()]) + ); + let module_e = module_graph.module(&"E".into()).unwrap(); + assert_eq!( + module_e.module_groups, + HashSet::from_iter([group_id_b.clone()]) + ); + let module_h = module_graph.module(&"H".into()).unwrap(); + assert_eq!( + module_h.module_groups, + HashSet::from_iter([group_id_d.clone(), group_id_f.clone(), group_id_g.clone()]) + ); + let module_i = module_graph.module(&"I".into()).unwrap(); + assert_eq!( + module_i.module_groups, + HashSet::from_iter([group_id_d.clone()]) + ); +} + +#[test] +fn test_patch_module_group_graph_remove_dynamic_import_edge() { + let mut module_graph = construct_test_module_graph_complex(); + let module_i = Module::new("I".into()); + module_graph.add_module(module_i); + module_graph + .add_edge(&"D".into(), &"I".into(), Default::default()) + .unwrap(); + let mut update_module_graph = construct_test_module_graph_complex(); + update_module_graph.remove_module(&"F".into()); + update_module_graph.remove_module(&"G".into()); + update_module_graph.remove_module(&"B".into()); + update_module_graph.remove_module(&"E".into()); + update_module_graph.remove_module(&"D".into()); + update_module_graph.remove_module(&"H".into()); + + let entries = vec!["A".into(), "B".into()]; + let start_points = vec!["A".into()]; + let mut module_group_graph = module_group_graph_from_entries(&entries, &mut module_graph); + + let diff_result = diff_module_graph(start_points.clone(), &module_graph, &update_module_graph); + let removed_modules = patch_module_graph( + start_points.clone(), + &diff_result, + &mut module_graph, + &mut update_module_graph, + ); + + let affected_groups = patch_module_group_graph( + start_points.clone(), + &diff_result, + &removed_modules, + &mut module_graph, + &mut module_group_graph, + ); + + let group_id_a = ModuleGroupId::new(&"A".into(), &ModuleGroupType::Entry); + // let group_id_d = ModuleGroupId::new(&"D".into(), &ModuleGroupType::DynamicImport); + let group_id_g = ModuleGroupId::new(&"G".into(), &ModuleGroupType::DynamicImport); + let group_id_f = ModuleGroupId::new(&"F".into(), &ModuleGroupType::DynamicImport); + let group_id_b = ModuleGroupId::new(&"B".into(), &ModuleGroupType::Entry); + + assert_eq!( + affected_groups, + HashSet::from_iter([ + // group_id_d.clone(), + group_id_b.clone(), + group_id_g.clone(), + group_id_a.clone(), + group_id_f.clone() + ]) + ); + + let update_module_group_graph = module_group_graph_from_entries(&entries, &mut module_graph); + + assert_eq!(module_group_graph, update_module_group_graph); + + // makes sure that module_groups field of each module is correct + let module_a = module_graph.module(&"A".into()).unwrap(); + assert_eq!( + module_a.module_groups, + HashSet::from_iter([group_id_a.clone(), group_id_f.clone()]) + ); + let module_b = module_graph.module(&"B".into()).unwrap(); + assert_eq!( + module_b.module_groups, + HashSet::from_iter([group_id_b.clone()]) + ); + let module_c = module_graph.module(&"C".into()).unwrap(); + assert_eq!( + module_c.module_groups, + HashSet::from_iter([group_id_a, group_id_f.clone()]) + ); + let module_d = module_graph.module(&"D".into()).unwrap(); + assert_eq!( + module_d.module_groups, + HashSet::from_iter([group_id_b.clone()]) + ); + let module_e = module_graph.module(&"E".into()).unwrap(); + assert_eq!( + module_e.module_groups, + HashSet::from_iter([group_id_b.clone()]) + ); + let module_h = module_graph.module(&"H".into()).unwrap(); + assert_eq!( + module_h.module_groups, + HashSet::from_iter([group_id_b.clone(), group_id_f.clone(), group_id_g.clone()]) + ); + let module_i = module_graph.module(&"I".into()).unwrap(); + assert_eq!( + module_i.module_groups, + HashSet::from_iter([group_id_b.clone()]) + ); +} + +#[test] +fn test_patch_module_group_graph_update_dynamic_import_edge() { + let mut module_graph = construct_test_module_graph_complex(); + // make E -> G non-dynamic import, then in update_module_graph make it dynamic import + module_graph + .update_edge( + &"E".into(), + &"G".into(), + ModuleGraphEdge::new(vec![ModuleGraphEdgeDataItem { + kind: ResolveKind::Import, + ..Default::default() + }]), + ) + .unwrap(); + let mut update_module_graph = construct_test_module_graph_complex(); + update_module_graph + .update_edge( + &"B".into(), + &"D".into(), + ModuleGraphEdge::new(vec![ModuleGraphEdgeDataItem { + kind: ResolveKind::DynamicImport, + ..Default::default() + }]), + ) + .unwrap(); + update_module_graph.remove_module(&"F".into()); + update_module_graph.remove_module(&"A".into()); + update_module_graph.remove_module(&"C".into()); + update_module_graph.remove_module(&"H".into()); + update_module_graph.entries = + HashMap::from_iter([("B".into(), "B".to_string()), ("E".into(), "E".to_string())]); + update_module_graph.update_execution_order_for_modules(); + + let mut module_group_graph = module_group_graph_from_module_graph(&mut module_graph); + let start_points = vec!["B".into(), "E".into()]; + let diff_result = diff_module_graph(start_points.clone(), &module_graph, &update_module_graph); + let removed_modules = patch_module_graph( + start_points.clone(), + &diff_result, + &mut module_graph, + &mut update_module_graph, + ); + + let affected_groups = patch_module_group_graph( + start_points, + &diff_result, + &removed_modules, + &mut module_graph, + &mut module_group_graph, + ); + + let group_id_a = ModuleGroupId::new(&"A".into(), &ModuleGroupType::Entry); + let group_id_b = ModuleGroupId::new(&"B".into(), &ModuleGroupType::Entry); + let group_id_f = ModuleGroupId::new(&"F".into(), &ModuleGroupType::DynamicImport); + let group_id_g = ModuleGroupId::new(&"G".into(), &ModuleGroupType::DynamicImport); + let group_id_d = ModuleGroupId::new(&"D".into(), &ModuleGroupType::DynamicImport); + + assert_eq!( + affected_groups, + HashSet::from_iter([ + group_id_a.clone(), + group_id_b.clone(), + group_id_f.clone(), + group_id_g.clone(), + group_id_d.clone() + ]) + ); + + let update_module_group_graph = module_group_graph_from_module_graph(&mut module_graph); + + assert_eq!(module_group_graph, update_module_group_graph); +} diff --git a/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots.rs b/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots.rs index 79f79f1620..f3a7918f16 100644 --- a/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots.rs +++ b/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots.rs @@ -1,16 +1,24 @@ use farmfe_core::{ context::CompilationContext, - module::{module_group::ModuleGroupId, Module, ModuleId}, + module::{ + module_graph::ModuleGraph, + module_group::{ModuleGroupId, ModuleGroupType}, + Module, ModuleId, + }, plugin::PluginHookContext, - resource::resource_pot::{ResourcePot, ResourcePotId}, + resource::{ + resource_pot::{ResourcePot, ResourcePotId}, + resource_pot_map, + }, + HashMap, HashSet, }; -use std::collections::{HashMap, HashSet}; use std::sync::Arc; use crate::{ generate::partial_bundling::{ - call_partial_bundling_hook, fill_necessary_fields_for_resource_pot, - get_enforce_resource_name_for_module, get_resource_pot_id_for_enforce_resources, + call_partial_bundling_hook, dynamic_entry_module_group_to_resource_pot, + fill_necessary_fields_for_resource_pot, get_enforce_resource_name_for_module, + get_resource_pot_id_for_enforce_resources, get_resource_pot_id_for_enforce_resources_by_removed_module, }, update::diff_and_patch_module_graph::DiffResult, @@ -40,6 +48,9 @@ pub fn generate_and_diff_resource_pots( context, ); + // handle dynamic entry resource pots + let dynamic_entry_resource_pot_ids = handle_dynamic_entry_resource_pots(module_groups, context); + // for enforce resource pots, only rerender it when it's modules are changed, added or removed. let mut resources_pots = call_partial_bundling_hook(&modules, context, &PluginHookContext::default())?; @@ -60,12 +71,13 @@ pub fn generate_and_diff_resource_pots( let mut new_resource_pot_ids = diff_and_patch_resource_pot_map(resources_pots, &enforce_resource_pot_ids, context); - // alway render affected resource pots + // alway render enforce resource pots and dynamic entry resource pots enforce_resource_pot_ids.into_iter().for_each(|id| { if !new_resource_pot_ids.contains(&id) { new_resource_pot_ids.insert(id); } }); + new_resource_pot_ids.extend(dynamic_entry_resource_pot_ids); Ok(new_resource_pot_ids.into_iter().collect()) } @@ -75,12 +87,20 @@ fn get_affected_modules( context: &Arc, ) -> Vec { let module_group_graph = context.module_group_graph.read(); - // let mut enforce_resource_pots = HashSet::new(); + module_groups .iter() - .fold(HashSet::new(), |mut acc, module_group_id| { + .fold(HashSet::default(), |mut acc, module_group_id| { let module_group = module_group_graph.module_group(module_group_id).unwrap(); - acc.extend(module_group.modules().clone()); + + // ignore dynamic entry module group + if !matches!( + module_group.module_group_type, + ModuleGroupType::DynamicEntry + ) { + acc.extend(module_group.modules().clone()); + } + acc }) .into_iter() @@ -94,6 +114,36 @@ enum ChangedModuleType { Updated, } +fn is_module_external( + module_id: &ModuleId, + removed_modules: &HashMap, + module_graph: &ModuleGraph, +) -> bool { + let module = if let Some(module) = removed_modules.get(module_id) { + module + } else { + module_graph.module(module_id).unwrap() + }; + + module.external +} + +fn remove_empty_resource_pots( + affected_resource_pot_ids: &HashSet, + resource_pot_map: &mut resource_pot_map::ResourcePotMap, +) { + // remove the resource pot if it's modules are empty + for id in affected_resource_pot_ids { + let resource_pot = resource_pot_map.resource_pot_mut(id).unwrap_or_else(|| { + panic!("resource pot not found: {id:?}"); + }); + + if resource_pot.modules().is_empty() { + resource_pot_map.remove_resource_pot(id); + } + } +} + /// Handle the enforce resource pots. /// return (enforce_resource_pot_ids, un_enforced_modules) fn handle_enforce_resource_pots( @@ -105,23 +155,13 @@ fn handle_enforce_resource_pots( ) -> (Vec, Vec) { let module_graph = context.module_graph.read(); let mut resource_pot_map = context.resource_pot_map.write(); - let mut un_enforced_modules = HashSet::new(); - let mut affected_resource_pot_ids = HashSet::new(); - - let is_module_external = |module_id: &ModuleId| { - let module = if let Some(module) = removed_modules.get(module_id) { - module - } else { - module_graph.module(module_id).unwrap() - }; - - module.external - }; + let mut un_enforced_modules = HashSet::default(); + let mut affected_resource_pot_ids = HashSet::default(); let mut handle_changed_modules = |module_ids: &HashSet, ty: ChangedModuleType| { for module_id in module_ids { // ignore external module - if is_module_external(module_id) { + if is_module_external(module_id, removed_modules, &module_graph) { continue; } @@ -167,7 +207,7 @@ fn handle_enforce_resource_pots( // Filter out the modules that are not in any enforce resource pot for module_id in affected_modules { - if is_module_external(module_id) { + if is_module_external(module_id, removed_modules, &module_graph) { continue; } @@ -186,16 +226,7 @@ fn handle_enforce_resource_pots( } } - // remove the resource pot if it's modules are empty - for id in &affected_resource_pot_ids { - let resource_pot = resource_pot_map.resource_pot_mut(id).unwrap_or_else(|| { - panic!("resource pot not found: {id:?}"); - }); - - if resource_pot.modules().is_empty() { - resource_pot_map.remove_resource_pot(id); - } - } + remove_empty_resource_pots(&affected_resource_pot_ids, &mut resource_pot_map); let mut modules = un_enforced_modules.into_iter().collect::>(); modules.sort(); @@ -206,6 +237,71 @@ fn handle_enforce_resource_pots( ) } +/// Add or update dynamic entry resource pots, return the affected resource pot ids +fn handle_dynamic_entry_resource_pots( + affected_module_groups: &HashSet, + context: &Arc, +) -> HashSet { + let mut module_group_graph = context.module_group_graph.write(); + let mut module_graph = context.module_graph.write(); + + let mut resource_pots = vec![]; + + for module_group_id in affected_module_groups { + let module_group = module_group_graph + .module_group_mut(module_group_id) + .unwrap(); + + if matches!( + module_group.module_group_type, + ModuleGroupType::DynamicEntry + ) { + if let Some(resource_pot) = + dynamic_entry_module_group_to_resource_pot(&mut module_graph, module_group) + { + resource_pots.push(resource_pot); + } + } + } + + let mut resource_pot_map = context.resource_pot_map.write(); + let resource_pot_ids = resource_pots + .iter() + .map(|rp| rp.id.clone()) + .collect::>(); + + for resource_pot in resource_pots { + // diff modules: added and removed + for module_group_id in &resource_pot.module_groups { + let module_group = module_group_graph + .module_group_mut(module_group_id) + .unwrap(); + // remove old resource pots + for rp_id in module_group.resource_pots().clone() { + module_group.remove_resource_pot(&rp_id); + remove_resource_pot( + &resource_pot.id, + &mut resource_pot_map, + context, + &mut module_graph, + ); + } + + // add new resource pots + module_group.add_resource_pot(resource_pot.id.clone()); + } + + for module_id in resource_pot.modules() { + let module = module_graph.module_mut(module_id).unwrap(); + module.resource_pots.insert(resource_pot.id.clone()); + } + + resource_pot_map.add_resource_pot(resource_pot); + } + + resource_pot_ids +} + fn diff_and_patch_resource_pot_map( resources_pots: Vec, enforce_resource_pot_ids: &Vec, @@ -216,14 +312,14 @@ fn diff_and_patch_resource_pot_map( .map(|rp| rp.id.clone()) .collect::>(); - let module_graph = context.module_graph.read(); + let mut module_graph = context.module_graph.write(); let mut resource_pot_map = context.resource_pot_map.write(); let mut module_group_graph = context.module_group_graph.write(); - let mut new_resource_pot_ids = HashSet::new(); + let mut new_resource_pot_ids = HashSet::default(); for mut resource_pot in resources_pots { - let mut module_groups = HashSet::new(); + let mut module_groups = HashSet::default(); for module_id in resource_pot.modules() { let module = module_graph.module(module_id).unwrap(); @@ -245,20 +341,12 @@ fn diff_and_patch_resource_pot_map( { resources_pots_to_remove.push(resource_pot.clone()); - if resource_pot_map.has_resource_pot(resource_pot) { - let resource_pot = resource_pot_map - .remove_resource_pot(resource_pot) - .unwrap_or_else(|| { - panic!("The resource pot {resource_pot:?} should be in the resource pot map") - }); - - // also remove the related resource - let mut resource_maps = context.resources_map.lock(); - - for resource in resource_pot.resources() { - resource_maps.remove(resource); - } - } + remove_resource_pot( + resource_pot, + &mut resource_pot_map, + context, + &mut module_graph, + ); } } @@ -284,8 +372,36 @@ fn diff_and_patch_resource_pot_map( new_resource_pot_ids } -#[cfg(test)] -mod test_handle_enforce_resource_pots; +fn remove_resource_pot( + resource_pot: &ResourcePotId, + resource_pot_map: &mut resource_pot_map::ResourcePotMap, + context: &Arc, + module_graph: &mut ModuleGraph, +) { + if resource_pot_map.has_resource_pot(resource_pot) { + let resource_pot = resource_pot_map + .remove_resource_pot(resource_pot) + .unwrap_or_else(|| { + panic!("The resource pot {resource_pot:?} should be in the resource pot map") + }); + + // also remove the related resource + let mut resource_maps = context.resources_map.lock(); + + for resource in resource_pot.resources() { + resource_maps.remove(resource); + } + + for module_id in resource_pot.modules() { + let module = module_graph.module_mut(module_id).unwrap(); + module.resource_pots.remove(&resource_pot.id); + } + } +} #[cfg(test)] mod test_generate_and_diff_resource_pots; +#[cfg(test)] +mod test_handle_dynamic_entry_resource_pots; +#[cfg(test)] +mod test_handle_enforce_resource_pots; diff --git a/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/snapshots/generate_and_diff_resource_pots-2.snap b/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/snapshots/generate_and_diff_resource_pots-2.snap new file mode 100644 index 0000000000..d48ed7487f --- /dev/null +++ b/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/snapshots/generate_and_diff_resource_pots-2.snap @@ -0,0 +1,49 @@ +--- +source: crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/test_generate_and_diff_resource_pots.rs +input_file: crates/testing_helpers/src/lib.rs +--- +[ + GroupResourcePotsSnapshotItem { + id: ModuleGroupId( + "A_Entry", + ), + resource_pots: { + "A_66be", + }, + }, + GroupResourcePotsSnapshotItem { + id: ModuleGroupId( + "B_Entry", + ), + resource_pots: { + "test_custom(\"__farm_unknown\")", + "test_js", + "B_3f39", + "B_2f5d", + }, + }, + GroupResourcePotsSnapshotItem { + id: ModuleGroupId( + "D_DynamicImport", + ), + resource_pots: { + "B_3f39", + }, + }, + GroupResourcePotsSnapshotItem { + id: ModuleGroupId( + "F_DynamicImport", + ), + resource_pots: { + "test_js", + }, + }, + GroupResourcePotsSnapshotItem { + id: ModuleGroupId( + "I_DynamicEntry", + ), + resource_pots: { + "EI_custom(\"__farm_unknown\")", + }, + }, +] diff --git a/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/snapshots/generate_and_diff_resource_pots-3.snap b/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/snapshots/generate_and_diff_resource_pots-3.snap new file mode 100644 index 0000000000..c1c81ebd78 --- /dev/null +++ b/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/snapshots/generate_and_diff_resource_pots-3.snap @@ -0,0 +1,52 @@ +--- +source: crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/test_generate_and_diff_resource_pots.rs +input_file: crates/testing_helpers/src/lib.rs +--- +[ + ModuleResourcePotSnapshotItem { + id: ModuleId { + relative_path: "B", + query_string: "", + }, + resource_pots: { + "B_2f5d", + }, + }, + ModuleResourcePotSnapshotItem { + id: ModuleId { + relative_path: "E", + query_string: "", + }, + resource_pots: { + "B_2f5d", + }, + }, + ModuleResourcePotSnapshotItem { + id: ModuleId { + relative_path: "F", + query_string: "", + }, + resource_pots: { + "EI_custom(\"__farm_unknown\")", + "test_js", + }, + }, + ModuleResourcePotSnapshotItem { + id: ModuleId { + relative_path: "H", + query_string: "", + }, + resource_pots: { + "test_custom(\"__farm_unknown\")", + }, + }, + ModuleResourcePotSnapshotItem { + id: ModuleId { + relative_path: "I", + query_string: "", + }, + resource_pots: { + "EI_custom(\"__farm_unknown\")", + }, + }, +] diff --git a/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/snapshots/generate_and_diff_resource_pots-4.snap b/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/snapshots/generate_and_diff_resource_pots-4.snap new file mode 100644 index 0000000000..2da2eace42 --- /dev/null +++ b/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/snapshots/generate_and_diff_resource_pots-4.snap @@ -0,0 +1,30 @@ +--- +source: crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/test_generate_and_diff_resource_pots.rs +input_file: crates/testing_helpers/src/lib.rs +--- +name: A_66be +id: A_66be +immutable: false +resource_pot_type: Js +entry: Some( + ModuleId { + relative_path: "A", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "A_Entry", + ), +] +modules: [ + ModuleId { + relative_path: "A", + query_string: "", + }, + ModuleId { + relative_path: "C", + query_string: "", + }, +] +resources: [] diff --git a/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/snapshots/generate_and_diff_resource_pots-5.snap b/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/snapshots/generate_and_diff_resource_pots-5.snap new file mode 100644 index 0000000000..47daae05ec --- /dev/null +++ b/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/snapshots/generate_and_diff_resource_pots-5.snap @@ -0,0 +1,59 @@ +--- +source: crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/test_generate_and_diff_resource_pots.rs +input_file: crates/testing_helpers/src/lib.rs +--- +name: A_66be +id: A_66be +immutable: false +resource_pot_type: Js +entry: Some( + ModuleId { + relative_path: "A", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "A_Entry", + ), +] +modules: [ + ModuleId { + relative_path: "A", + query_string: "", + }, + ModuleId { + relative_path: "C", + query_string: "", + }, +] +resources: [] + +------- + +name: B_2f5d +id: B_2f5d +immutable: false +resource_pot_type: Js +entry: Some( + ModuleId { + relative_path: "B", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "B_Entry", + ), +] +modules: [ + ModuleId { + relative_path: "B", + query_string: "", + }, + ModuleId { + relative_path: "E", + query_string: "", + }, +] +resources: [] diff --git a/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/snapshots/generate_and_diff_resource_pots-6.snap b/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/snapshots/generate_and_diff_resource_pots-6.snap new file mode 100644 index 0000000000..5df9c568aa --- /dev/null +++ b/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/snapshots/generate_and_diff_resource_pots-6.snap @@ -0,0 +1,82 @@ +--- +source: crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/test_generate_and_diff_resource_pots.rs +input_file: crates/testing_helpers/src/lib.rs +--- +name: A_66be +id: A_66be +immutable: false +resource_pot_type: Js +entry: Some( + ModuleId { + relative_path: "A", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "A_Entry", + ), +] +modules: [ + ModuleId { + relative_path: "A", + query_string: "", + }, + ModuleId { + relative_path: "C", + query_string: "", + }, +] +resources: [] + +------- + +name: B_2f5d +id: B_2f5d +immutable: false +resource_pot_type: Js +entry: Some( + ModuleId { + relative_path: "B", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "B_Entry", + ), +] +modules: [ + ModuleId { + relative_path: "B", + query_string: "", + }, + ModuleId { + relative_path: "E", + query_string: "", + }, +] +resources: [] + +------- + +name: B_3f39 +id: B_3f39 +immutable: false +resource_pot_type: Js +entry: None +module_groups: [ + ModuleGroupId( + "B_Entry", + ), + ModuleGroupId( + "D_DynamicImport", + ), +] +modules: [ + ModuleId { + relative_path: "D", + query_string: "", + }, +] +resources: [] diff --git a/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/snapshots/generate_and_diff_resource_pots-7.snap b/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/snapshots/generate_and_diff_resource_pots-7.snap new file mode 100644 index 0000000000..73b9920c99 --- /dev/null +++ b/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/snapshots/generate_and_diff_resource_pots-7.snap @@ -0,0 +1,111 @@ +--- +source: crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/test_generate_and_diff_resource_pots.rs +input_file: crates/testing_helpers/src/lib.rs +--- +name: A_66be +id: A_66be +immutable: false +resource_pot_type: Js +entry: Some( + ModuleId { + relative_path: "A", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "A_Entry", + ), +] +modules: [ + ModuleId { + relative_path: "A", + query_string: "", + }, + ModuleId { + relative_path: "C", + query_string: "", + }, +] +resources: [] + +------- + +name: B_2f5d +id: B_2f5d +immutable: false +resource_pot_type: Js +entry: Some( + ModuleId { + relative_path: "B", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "B_Entry", + ), +] +modules: [ + ModuleId { + relative_path: "B", + query_string: "", + }, + ModuleId { + relative_path: "E", + query_string: "", + }, +] +resources: [] + +------- + +name: B_3f39 +id: B_3f39 +immutable: false +resource_pot_type: Js +entry: None +module_groups: [ + ModuleGroupId( + "B_Entry", + ), + ModuleGroupId( + "D_DynamicImport", + ), +] +modules: [ + ModuleId { + relative_path: "D", + query_string: "", + }, +] +resources: [] + +------- + +name: EI +id: EI_custom("__farm_unknown") +immutable: false +resource_pot_type: Custom("__farm_unknown") +entry: Some( + ModuleId { + relative_path: "I", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "I_DynamicEntry", + ), +] +modules: [ + ModuleId { + relative_path: "F", + query_string: "", + }, + ModuleId { + relative_path: "I", + query_string: "", + }, +] +resources: [] diff --git a/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/snapshots/generate_and_diff_resource_pots-8.snap b/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/snapshots/generate_and_diff_resource_pots-8.snap new file mode 100644 index 0000000000..efd569f120 --- /dev/null +++ b/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/snapshots/generate_and_diff_resource_pots-8.snap @@ -0,0 +1,131 @@ +--- +source: crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/test_generate_and_diff_resource_pots.rs +input_file: crates/testing_helpers/src/lib.rs +--- +name: A_66be +id: A_66be +immutable: false +resource_pot_type: Js +entry: Some( + ModuleId { + relative_path: "A", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "A_Entry", + ), +] +modules: [ + ModuleId { + relative_path: "A", + query_string: "", + }, + ModuleId { + relative_path: "C", + query_string: "", + }, +] +resources: [] + +------- + +name: B_2f5d +id: B_2f5d +immutable: false +resource_pot_type: Js +entry: Some( + ModuleId { + relative_path: "B", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "B_Entry", + ), +] +modules: [ + ModuleId { + relative_path: "B", + query_string: "", + }, + ModuleId { + relative_path: "E", + query_string: "", + }, +] +resources: [] + +------- + +name: B_3f39 +id: B_3f39 +immutable: false +resource_pot_type: Js +entry: None +module_groups: [ + ModuleGroupId( + "B_Entry", + ), + ModuleGroupId( + "D_DynamicImport", + ), +] +modules: [ + ModuleId { + relative_path: "D", + query_string: "", + }, +] +resources: [] + +------- + +name: EI +id: EI_custom("__farm_unknown") +immutable: false +resource_pot_type: Custom("__farm_unknown") +entry: Some( + ModuleId { + relative_path: "I", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "I_DynamicEntry", + ), +] +modules: [ + ModuleId { + relative_path: "F", + query_string: "", + }, + ModuleId { + relative_path: "I", + query_string: "", + }, +] +resources: [] + +------- + +name: test +id: test_custom("__farm_unknown") +immutable: false +resource_pot_type: Custom("__farm_unknown") +entry: None +module_groups: [ + ModuleGroupId( + "B_Entry", + ), +] +modules: [ + ModuleId { + relative_path: "H", + query_string: "", + }, +] +resources: [] diff --git a/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/snapshots/generate_and_diff_resource_pots-9.snap b/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/snapshots/generate_and_diff_resource_pots-9.snap new file mode 100644 index 0000000000..08d0b77f35 --- /dev/null +++ b/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/snapshots/generate_and_diff_resource_pots-9.snap @@ -0,0 +1,154 @@ +--- +source: crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/test_generate_and_diff_resource_pots.rs +input_file: crates/testing_helpers/src/lib.rs +--- +name: A_66be +id: A_66be +immutable: false +resource_pot_type: Js +entry: Some( + ModuleId { + relative_path: "A", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "A_Entry", + ), +] +modules: [ + ModuleId { + relative_path: "A", + query_string: "", + }, + ModuleId { + relative_path: "C", + query_string: "", + }, +] +resources: [] + +------- + +name: B_2f5d +id: B_2f5d +immutable: false +resource_pot_type: Js +entry: Some( + ModuleId { + relative_path: "B", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "B_Entry", + ), +] +modules: [ + ModuleId { + relative_path: "B", + query_string: "", + }, + ModuleId { + relative_path: "E", + query_string: "", + }, +] +resources: [] + +------- + +name: B_3f39 +id: B_3f39 +immutable: false +resource_pot_type: Js +entry: None +module_groups: [ + ModuleGroupId( + "B_Entry", + ), + ModuleGroupId( + "D_DynamicImport", + ), +] +modules: [ + ModuleId { + relative_path: "D", + query_string: "", + }, +] +resources: [] + +------- + +name: EI +id: EI_custom("__farm_unknown") +immutable: false +resource_pot_type: Custom("__farm_unknown") +entry: Some( + ModuleId { + relative_path: "I", + query_string: "", + }, +) +module_groups: [ + ModuleGroupId( + "I_DynamicEntry", + ), +] +modules: [ + ModuleId { + relative_path: "F", + query_string: "", + }, + ModuleId { + relative_path: "I", + query_string: "", + }, +] +resources: [] + +------- + +name: test +id: test_custom("__farm_unknown") +immutable: false +resource_pot_type: Custom("__farm_unknown") +entry: None +module_groups: [ + ModuleGroupId( + "B_Entry", + ), +] +modules: [ + ModuleId { + relative_path: "H", + query_string: "", + }, +] +resources: [] + +------- + +name: test +id: test_js +immutable: false +resource_pot_type: Js +entry: None +module_groups: [ + ModuleGroupId( + "B_Entry", + ), + ModuleGroupId( + "F_DynamicImport", + ), +] +modules: [ + ModuleId { + relative_path: "F", + query_string: "", + }, +] +resources: [] diff --git a/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/snapshots/generate_and_diff_resource_pots.snap b/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/snapshots/generate_and_diff_resource_pots.snap new file mode 100644 index 0000000000..c9845467ea --- /dev/null +++ b/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/snapshots/generate_and_diff_resource_pots.snap @@ -0,0 +1,9 @@ +--- +source: crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/test_generate_and_diff_resource_pots.rs +input_file: crates/testing_helpers/src/lib.rs +--- +[ + "EI_custom(\"__farm_unknown\")", + "test_custom(\"__farm_unknown\")", + "test_js", +] diff --git a/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/test_generate_and_diff_resource_pots.rs b/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/test_generate_and_diff_resource_pots.rs index cc5da1e101..c8c8cf0d02 100644 --- a/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/test_generate_and_diff_resource_pots.rs +++ b/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/test_generate_and_diff_resource_pots.rs @@ -1,4 +1,3 @@ -use std::collections::HashSet; use std::sync::Arc; use farmfe_core::{ @@ -8,12 +7,18 @@ use farmfe_core::{ context::CompilationContext, module::{ module_graph::{ModuleGraphEdge, ModuleGraphEdgeDataItem}, - Module, + module_group::{ModuleGroupId, ModuleGroupType}, + Module, ModuleId, }, plugin::{Plugin, PluginHookContext, ResolveKind}, + resource::resource_pot::ResourcePotId, + HashSet, }; use farmfe_plugin_partial_bundling::module_group_graph_from_entries; -use farmfe_testing_helpers::{construct_test_module_graph, construct_test_module_graph_complex}; +use farmfe_testing_helpers::{ + assert_debug_snapshot, assert_resource_pots, assert_sorted_iter_eq, construct_test_module_graph, + construct_test_module_graph_complex, +}; use crate::{ generate::partial_bundling::generate_resource_pot_map, @@ -40,12 +45,27 @@ fn test_generate_and_diff_resource_pots() { .add_edge(&"H".into(), &"F".into(), Default::default()) .unwrap(); + update_module_graph.add_module(Module::new("I".into())); + update_module_graph + .add_edge( + &"E".into(), + &"I".into(), + ModuleGraphEdge::new(vec![ModuleGraphEdgeDataItem { + kind: ResolveKind::DynamicEntry { + name: "EI".to_string(), + output_filename: None, + }, + ..Default::default() + }]), + ) + .unwrap(); + update_module_graph + .update_edge(&"I".into(), &"F".into(), Default::default()) + .unwrap(); + let updated_modules = vec!["F".into(), "E".into(), "B".into()]; let mut module_group_graph = module_group_graph_from_entries( - &module_graph - .entries - .clone().into_keys() - .collect(), + &module_graph.entries.clone().into_keys().collect(), &mut module_graph, ); let diff_result = diff_module_graph(updated_modules.clone(), &module_graph, &update_module_graph); @@ -64,9 +84,22 @@ fn test_generate_and_diff_resource_pots() { &mut module_graph, &mut module_group_graph, ); + + let group_id_a = ModuleGroupId::new(&"A".into(), &ModuleGroupType::Entry); + let group_id_b = ModuleGroupId::new(&"B".into(), &ModuleGroupType::Entry); + let group_id_d = ModuleGroupId::new(&"D".into(), &ModuleGroupType::DynamicImport); + let group_id_f = ModuleGroupId::new(&"F".into(), &ModuleGroupType::DynamicImport); + let group_id_i = ModuleGroupId::new(&"I".into(), &ModuleGroupType::DynamicEntry); + assert_eq!( affected_groups, - HashSet::from(["A".into(), "B".into(), "F".into(), "D".into()]) + HashSet::from_iter([ + group_id_a.clone(), + group_id_b.clone(), + group_id_f.clone(), + group_id_d.clone(), + group_id_i.clone() + ]) ); let mut config = Config::default(); @@ -93,7 +126,7 @@ fn test_generate_and_diff_resource_pots() { generate_resource_pot_map(&context, &PluginHookContext::default()).unwrap(); context.resource_pot_map.write().replace(resource_pot_map); - let resource_pot_ids = generate_and_diff_resource_pots( + let mut resource_pot_ids = generate_and_diff_resource_pots( &affected_groups, &diff_result, &updated_modules, @@ -101,61 +134,100 @@ fn test_generate_and_diff_resource_pots() { &context, ) .unwrap(); - println!("{resource_pot_ids:?}"); - assert_eq!( - resource_pot_ids, - vec![String::from("test_custom(\"__farm_unknown\")")] - ); + resource_pot_ids.sort(); + assert_debug_snapshot!(resource_pot_ids); + + #[derive(Clone, Debug, PartialEq, Eq)] + struct GroupResourcePotsSnapshotItem { + pub id: ModuleGroupId, + pub resource_pots: HashSet, + } + + impl PartialOrd for GroupResourcePotsSnapshotItem { + fn partial_cmp(&self, other: &Self) -> Option { + self.id.partial_cmp(&other.id) + } + } + impl Ord for GroupResourcePotsSnapshotItem { + fn cmp(&self, other: &Self) -> std::cmp::Ordering { + self.id.cmp(&other.id) + } + } let module_group_graph = context.module_group_graph.read(); + let mut group_resource_pots = vec![]; + let module_group_a = module_group_graph.module_group(&group_id_a).unwrap(); + group_resource_pots.push(GroupResourcePotsSnapshotItem { + id: module_group_a.id.clone(), + resource_pots: module_group_a.resource_pots().clone(), + }); + let module_group_b = module_group_graph.module_group(&group_id_b).unwrap(); + group_resource_pots.push(GroupResourcePotsSnapshotItem { + id: module_group_b.id.clone(), + resource_pots: module_group_b.resource_pots().clone(), + }); + let module_group_d = module_group_graph.module_group(&group_id_d).unwrap(); + group_resource_pots.push(GroupResourcePotsSnapshotItem { + id: module_group_d.id.clone(), + resource_pots: module_group_d.resource_pots().clone(), + }); + let module_group_f = module_group_graph.module_group(&group_id_f).unwrap(); + group_resource_pots.push(GroupResourcePotsSnapshotItem { + id: module_group_f.id.clone(), + resource_pots: module_group_f.resource_pots().clone(), + }); + let module_group_i = module_group_graph.module_group(&group_id_i).unwrap(); + group_resource_pots.push(GroupResourcePotsSnapshotItem { + id: module_group_i.id.clone(), + resource_pots: module_group_i.resource_pots().clone(), + }); + assert_sorted_iter_eq!(group_resource_pots); - let module_group_a = module_group_graph.module_group(&"A".into()).unwrap(); - assert_eq!( - module_group_a.resource_pots(), - &HashSet::from(["A_66be_custom(\"__farm_unknown\")".to_string()]) - ); - let module_group_b = module_group_graph.module_group(&"B".into()).unwrap(); - assert_eq!( - module_group_b.resource_pots(), - &HashSet::from([ - "B_2f5d_custom(\"__farm_unknown\")".to_string(), - "B_3f39_custom(\"__farm_unknown\")".to_string(), - "test_custom(\"__farm_unknown\")".to_string() - ]) - ); - let module_group_d = module_group_graph.module_group(&"D".into()).unwrap(); - assert_eq!( - module_group_d.resource_pots(), - &HashSet::from(["B_3f39_custom(\"__farm_unknown\")".to_string()]) - ); - let module_group_f = module_group_graph.module_group(&"F".into()).unwrap(); - assert_eq!( - module_group_f.resource_pots(), - &HashSet::from(["test_custom(\"__farm_unknown\")".to_string()]) - ); + #[derive(Clone, Debug, PartialEq, Eq)] + struct ModuleResourcePotSnapshotItem { + pub id: ModuleId, + pub resource_pots: HashSet, + } + impl PartialOrd for ModuleResourcePotSnapshotItem { + fn partial_cmp(&self, other: &Self) -> Option { + self.id.partial_cmp(&other.id) + } + } + impl Ord for ModuleResourcePotSnapshotItem { + fn cmp(&self, other: &Self) -> std::cmp::Ordering { + self.id.cmp(&other.id) + } + } let module_graph = context.module_graph.read(); + let mut module_resource_pots = vec![]; // F, E, B, H let module_f = module_graph.module(&"F".into()).unwrap(); - assert_eq!( - module_f.resource_pot.as_ref().unwrap(), - "test_custom(\"__farm_unknown\")" - ); + module_resource_pots.push(ModuleResourcePotSnapshotItem { + id: module_f.id.clone(), + resource_pots: module_f.resource_pots.clone(), + }); let module_e = module_graph.module(&"E".into()).unwrap(); - assert_eq!( - module_e.resource_pot.as_ref().unwrap(), - "B_2f5d_custom(\"__farm_unknown\")" - ); + module_resource_pots.push(ModuleResourcePotSnapshotItem { + id: module_e.id.clone(), + resource_pots: module_e.resource_pots.clone(), + }); let module_b = module_graph.module(&"B".into()).unwrap(); - assert_eq!( - module_b.resource_pot.as_ref().unwrap(), - "B_2f5d_custom(\"__farm_unknown\")" - ); + module_resource_pots.push(ModuleResourcePotSnapshotItem { + id: module_b.id.clone(), + resource_pots: module_b.resource_pots.clone(), + }); let module_h = module_graph.module(&"H".into()).unwrap(); - assert_eq!( - module_h.resource_pot.as_ref().unwrap(), - "test_custom(\"__farm_unknown\")" - ); + module_resource_pots.push(ModuleResourcePotSnapshotItem { + id: module_h.id.clone(), + resource_pots: module_h.resource_pots.clone(), + }); + let module_i = module_graph.module(&"I".into()).unwrap(); + module_resource_pots.push(ModuleResourcePotSnapshotItem { + id: module_i.id.clone(), + resource_pots: module_i.resource_pots.clone(), + }); + assert_sorted_iter_eq!(module_resource_pots); let resource_pot_map = context.resource_pot_map.read(); println!( @@ -167,51 +239,11 @@ fn test_generate_and_diff_resource_pots() { .collect::>() ); - let resource_pot_test = resource_pot_map - .resource_pot(&"test_custom(\"__farm_unknown\")".into()) - .unwrap(); - assert_eq!(resource_pot_test.entry_module, None); - assert_eq!(resource_pot_test.modules(), vec![&"F".into(), &"H".into()]); - assert_eq!( - resource_pot_test.module_groups, - HashSet::from(["F".into(), "B".into()]) - ); + let mut resource_pots = resource_pot_map.resource_pots(); - let resource_pot_b_2f5d = resource_pot_map - .resource_pot(&"B_2f5d_custom(\"__farm_unknown\")".into()) - .unwrap(); - assert_eq!(resource_pot_b_2f5d.entry_module, Some("B".into())); - assert_eq!( - resource_pot_b_2f5d.modules(), - vec![&"B".into(), &"E".into()] - ); - assert_eq!( - resource_pot_b_2f5d.module_groups, - HashSet::from(["B".into()]) - ); - - let resource_pot_b_3f39 = resource_pot_map - .resource_pot(&"B_3f39_custom(\"__farm_unknown\")".into()) - .unwrap(); - assert_eq!(resource_pot_b_3f39.entry_module, None); - assert_eq!(resource_pot_b_3f39.modules(), vec![&"D".into()]); - assert_eq!( - resource_pot_b_3f39.module_groups, - HashSet::from(["D".into(), "B".into()]) - ); + resource_pots.sort_by(|a, b| a.id.cmp(&b.id)); - let resource_pot_a_66be = resource_pot_map - .resource_pot(&"A_66be_custom(\"__farm_unknown\")".into()) - .unwrap(); - assert_eq!(resource_pot_a_66be.entry_module, Some("A".into())); - assert_eq!( - resource_pot_a_66be.modules(), - vec![&"A".into(), &"C".into()] - ); - assert_eq!( - resource_pot_a_66be.module_groups, - HashSet::from(["A".into()]) - ); + assert_resource_pots!(resource_pots); } /// the enforce resource pot should be unchanged when only one module is changed @@ -244,10 +276,7 @@ fn test_generate_and_diff_resource_pots_one_module_changed() { ) .unwrap(); let mut module_group_graph = module_group_graph_from_entries( - &module_graph - .entries - .clone().into_keys() - .collect(), + &module_graph.entries.clone().into_keys().collect(), &mut module_graph, ); let updated_modules = vec!["I".into()]; @@ -268,7 +297,10 @@ fn test_generate_and_diff_resource_pots_one_module_changed() { &mut module_graph, &mut module_group_graph, ); - assert_eq!(affected_groups, HashSet::from(["I".into()])); + + let group_id_i = ModuleGroupId::new(&"I".into(), &ModuleGroupType::DynamicImport); + + assert_eq!(affected_groups, HashSet::from_iter([group_id_i])); let mut config = Config::default(); config.partial_bundling.enforce_resources = vec![PartialBundlingEnforceResourceConfig { diff --git a/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/test_handle_dynamic_entry_resource_pots.rs b/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/test_handle_dynamic_entry_resource_pots.rs new file mode 100644 index 0000000000..ad224478e0 --- /dev/null +++ b/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/test_handle_dynamic_entry_resource_pots.rs @@ -0,0 +1,146 @@ +use std::sync::Arc; + +use farmfe_core::{ + config::Config, + context::CompilationContext, + module::{ + module_graph::{ModuleGraphEdge, ModuleGraphEdgeDataItem}, + module_group::{ModuleGroupId, ModuleGroupType}, + Module, ModuleType, + }, + plugin::{Plugin, PluginHookContext}, + HashSet, +}; +use farmfe_plugin_partial_bundling::module_group_graph_from_entries; +use farmfe_testing_helpers::construct_test_module_graph; + +use crate::{ + generate::partial_bundling::generate_resource_pot_map, + update::{ + diff_and_patch_module_graph::{diff_module_graph, patch_module_graph}, + patch_module_group_graph, + regenerate_resources::generate_and_diff_resource_pots::handle_dynamic_entry_resource_pots, + }, +}; + +#[test] +fn test_handle_dynamic_entry_resource_pots() { + let mut module_graph = construct_test_module_graph(); + let mut update_module_graph = construct_test_module_graph(); + update_module_graph.remove_module(&"C".into()); + update_module_graph + .remove_edge(&"F".into(), &"A".into()) + .unwrap(); + update_module_graph.add_module({ + let mut m = Module::new("H".into()); + + m.module_type = ModuleType::Js; + + m + }); + update_module_graph + .add_edge( + &"B".into(), + &"H".into(), + ModuleGraphEdge::new(vec![ModuleGraphEdgeDataItem { + kind: farmfe_core::plugin::ResolveKind::DynamicEntry { + name: "BH".to_string(), + output_filename: None, + }, + ..Default::default() + }]), + ) + .unwrap(); + update_module_graph + .add_edge(&"H".into(), &"F".into(), Default::default()) + .unwrap(); + + let updated_modules = vec!["F".into(), "E".into(), "B".into()]; + let mut module_group_graph = module_group_graph_from_entries( + &module_graph.entries.clone().into_keys().collect(), + &mut module_graph, + ); + let diff_result = diff_module_graph(updated_modules.clone(), &module_graph, &update_module_graph); + + let removed_modules = patch_module_graph( + updated_modules.clone(), + &diff_result, + &mut module_graph, + &mut update_module_graph, + ); + + let affected_groups = patch_module_group_graph( + updated_modules.clone(), + &diff_result, + &removed_modules, + &mut module_graph, + &mut module_group_graph, + ); + + let group_id_a = ModuleGroupId::new(&"A".into(), &ModuleGroupType::Entry); + let group_id_b = ModuleGroupId::new(&"B".into(), &ModuleGroupType::Entry); + let group_id_d = ModuleGroupId::new(&"D".into(), &ModuleGroupType::DynamicImport); + let group_id_f = ModuleGroupId::new(&"F".into(), &ModuleGroupType::DynamicImport); + let group_id_h = ModuleGroupId::new(&"H".into(), &ModuleGroupType::DynamicEntry); + + assert_eq!( + affected_groups, + HashSet::from_iter([group_id_a, group_id_b, group_id_f, group_id_d, group_id_h]) + ); + + let affected_modules = affected_groups + .iter() + .fold(vec![], |mut acc, group_id| { + let group = module_group_graph.module_group(group_id).unwrap(); + acc.extend(group.modules().clone()); + acc + }) + .into_iter() + .collect::>(); + assert_eq!( + affected_modules.clone().into_iter().collect::>(), + HashSet::from_iter([ + "A".into(), + "B".into(), + "C".into(), + "D".into(), + "E".into(), + "F".into(), + "H".into() + ]) + ); + + let config = Config::default(); + let plugins: Vec> = vec![Arc::new( + farmfe_plugin_partial_bundling::FarmPluginPartialBundling::new(&config), + )]; + let context = Arc::new(CompilationContext::new(config, plugins).unwrap()); + + { + let mut mg = context.module_graph.write(); + *mg = module_graph; + } + + { + let mut mgg = context.module_group_graph.write(); + *mgg = module_group_graph; + } + + let resource_pot_map = + generate_resource_pot_map(&context, &PluginHookContext::default()).unwrap(); + context.resource_pot_map.write().replace(resource_pot_map); + + let dynamic_entry_resource_pots = handle_dynamic_entry_resource_pots(&affected_groups, &context); + + assert_eq!(dynamic_entry_resource_pots.len(), 1); + assert_eq!( + dynamic_entry_resource_pots, + HashSet::from_iter(["BH_js".to_string()]) + ); + let resource_pot_map = context.resource_pot_map.read(); + let dynamic_resource_pot = resource_pot_map.resource_pot(&"BH_js".into()).unwrap(); + assert_eq!( + dynamic_resource_pot.modules, + HashSet::from_iter(["F".into(), "H".into()]) + ); +} diff --git a/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/test_handle_enforce_resource_pots.rs b/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/test_handle_enforce_resource_pots.rs index 3def4f4204..872e35983b 100644 --- a/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/test_handle_enforce_resource_pots.rs +++ b/crates/compiler/src/update/regenerate_resources/generate_and_diff_resource_pots/test_handle_enforce_resource_pots.rs @@ -1,4 +1,3 @@ -use std::collections::HashSet; use std::sync::Arc; use farmfe_core::{ @@ -8,9 +7,11 @@ use farmfe_core::{ context::CompilationContext, module::{ module_graph::{ModuleGraphEdge, ModuleGraphEdgeDataItem}, - Module, + module_group::{ModuleGroupId, ModuleGroupType}, + Module, ModuleType, }, plugin::{Plugin, PluginHookContext, ResolveKind}, + HashSet, }; use farmfe_plugin_partial_bundling::module_group_graph_from_entries; use farmfe_testing_helpers::{construct_test_module_graph, construct_test_module_graph_complex}; @@ -33,7 +34,13 @@ fn test_handle_enforce_resource_pots() { update_module_graph .remove_edge(&"F".into(), &"A".into()) .unwrap(); - update_module_graph.add_module(Module::new("H".into())); + update_module_graph.add_module({ + let mut m = Module::new("H".into()); + + m.module_type = ModuleType::Js; + + m + }); update_module_graph .add_edge(&"B".into(), &"H".into(), Default::default()) .unwrap(); @@ -43,10 +50,7 @@ fn test_handle_enforce_resource_pots() { let updated_modules = vec!["F".into(), "E".into(), "B".into()]; let mut module_group_graph = module_group_graph_from_entries( - &module_graph - .entries - .clone().into_keys() - .collect(), + &module_graph.entries.clone().into_keys().collect(), &mut module_graph, ); let diff_result = diff_module_graph(updated_modules.clone(), &module_graph, &update_module_graph); @@ -65,9 +69,15 @@ fn test_handle_enforce_resource_pots() { &mut module_graph, &mut module_group_graph, ); + + let group_id_a = ModuleGroupId::new(&"A".into(), &ModuleGroupType::Entry); + let group_id_b = ModuleGroupId::new(&"B".into(), &ModuleGroupType::Entry); + let group_id_d = ModuleGroupId::new(&"D".into(), &ModuleGroupType::DynamicImport); + let group_id_f = ModuleGroupId::new(&"F".into(), &ModuleGroupType::DynamicImport); + assert_eq!( affected_groups, - HashSet::from(["A".into(), "B".into(), "F".into(), "D".into()]) + HashSet::from_iter([group_id_a, group_id_b, group_id_f, group_id_d]) ); let affected_modules = affected_groups @@ -81,7 +91,7 @@ fn test_handle_enforce_resource_pots() { .collect::>(); assert_eq!( affected_modules.clone().into_iter().collect::>(), - HashSet::from([ + HashSet::from_iter([ "A".into(), "B".into(), "C".into(), @@ -128,10 +138,7 @@ fn test_handle_enforce_resource_pots() { &context, ); - assert_eq!( - enforce_resource_pots, - vec!["test_custom(\"__farm_unknown\")".to_string()] - ); + assert_eq!(enforce_resource_pots, vec!["test_js".to_string()]); un_enforce_resource_pots.sort(); assert_eq!( un_enforce_resource_pots, @@ -169,10 +176,7 @@ fn test_handle_enforce_resource_pots_one_module_changed() { ) .unwrap(); let mut module_group_graph = module_group_graph_from_entries( - &module_graph - .entries - .clone().into_keys() - .collect(), + &module_graph.entries.clone().into_keys().collect(), &mut module_graph, ); let updated_modules = vec!["I".into()]; @@ -193,7 +197,10 @@ fn test_handle_enforce_resource_pots_one_module_changed() { &mut module_graph, &mut module_group_graph, ); - assert_eq!(affected_groups, HashSet::from(["I".into()])); + + let group_id_i = ModuleGroupId::new(&"I".into(), &ModuleGroupType::DynamicImport); + + assert_eq!(affected_groups, HashSet::from_iter([group_id_i])); let affected_modules = affected_groups .iter() diff --git a/crates/compiler/src/update/regenerate_resources/mod.rs b/crates/compiler/src/update/regenerate_resources/mod.rs index 4595e65ff9..59e5434df8 100644 --- a/crates/compiler/src/update/regenerate_resources/mod.rs +++ b/crates/compiler/src/update/regenerate_resources/mod.rs @@ -1,26 +1,26 @@ -use std::collections::{HashMap, HashSet}; use std::sync::Arc; +use farmfe_core::config::FARM_MODULE_SYSTEM; +use farmfe_core::enhanced_magic_string::collapse_sourcemap::{ + collapse_sourcemap_chain, CollapseSourcemapOptions, +}; +use farmfe_core::enhanced_magic_string::magic_string::MagicString; +use farmfe_core::enhanced_magic_string::types::SourceMapOptions; +use farmfe_core::plugin::PluginHookContext; use farmfe_core::{ context::CompilationContext, - enhanced_magic_string::types::SourceMapOptions, error::CompilationError, module::{module_group::ModuleGroupId, Module, ModuleId}, - resource::resource_pot::{ResourcePot, ResourcePotMetaData, ResourcePotType}, -}; - -use farmfe_plugin_runtime::render_resource_pot::{ - resource_pot_to_runtime_object, RenderedJsResourcePot, + resource::resource_pot::{ResourcePot, ResourcePotType}, }; -use farmfe_plugin_runtime::ASYNC_MODULES; -use farmfe_toolkit::hash::base64_encode; -use farmfe_utils::relative; +use farmfe_core::{HashMap, HashSet}; +use farmfe_toolkit::html::get_farm_global_this; +use farmfe_toolkit::sourcemap::SourceMap; +use farmfe_utils::hash::base64_encode; +use crate::generate::render_resource_pots::render_resource_pot_generate_resources; use crate::{ - generate::render_resource_pots::{ - render_resource_pot_generate_resources, render_resource_pots_and_generate_resources, - }, - write_cache, + generate::render_resource_pots::render_resource_pots_and_generate_resources, write_cache, }; use super::diff_and_patch_module_graph::DiffResult; @@ -29,6 +29,7 @@ mod generate_and_diff_resource_pots; use generate_and_diff_resource_pots::generate_and_diff_resource_pots; +/// This function only works when targetEnv is browser pub fn render_and_generate_update_resource( updated_module_ids: &Vec, diff_result: &DiffResult, @@ -78,68 +79,63 @@ pub fn render_and_generate_update_resource( let gen_resource_pot_code = |resource_pot: &mut ResourcePot| -> farmfe_core::error::Result { - let async_modules = context.custom.get(ASYNC_MODULES).unwrap(); - let async_modules = async_modules.downcast_ref::>().unwrap(); - if !resource_pot.modules().is_empty() { - let RenderedJsResourcePot { - mut bundle, - rendered_modules, - .. - } = resource_pot_to_runtime_object(resource_pot, &module_graph, async_modules, context)?; - bundle.prepend("("); - bundle.append(")", None); - - let mut rendered_map_chain = vec![]; - - if context.config.sourcemap.enabled(resource_pot.immutable) { - let root = context.config.root.clone(); - let map = bundle - .generate_map(SourceMapOptions { - include_content: Some(true), - remap_source: Some(Box::new(move |src| format!("/{}", relative(&root, src)))), - ..Default::default() - }) - .map_err(|_| CompilationError::GenerateSourceMapError { - id: resource_pot.id.clone(), - })?; - - let mut buf = vec![]; - map.to_writer(&mut buf).expect("failed to write sourcemap"); - rendered_map_chain.push(Arc::new(String::from_utf8(buf).unwrap())); - } - // The hmr result should alway be a js resource - resource_pot.meta = ResourcePotMetaData { - rendered_modules, - rendered_content: Arc::new(bundle.to_string()), - rendered_map_chain, - ..Default::default() - }; - - let (mut update_resources, _) = render_resource_pot_generate_resources( - resource_pot, - context, - &Default::default(), - true, - &mut None, - )?; - - if let Some(map) = update_resources.source_map { - // inline source map - update_resources.resource.bytes.append( - &mut format!( - "\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,{}", - base64_encode(&map.bytes) - ) - .into_bytes(), - ); - } - - let code = String::from_utf8(update_resources.resource.bytes).unwrap(); - - return Ok(code); - } - - Ok("{}".to_string()) + let hook_context = PluginHookContext::default(); + let res = context + .plugin_driver + .render_resource_pot(resource_pot, context, &hook_context)? + .ok_or(CompilationError::GenerateResourcesError { + name: resource_pot.id.clone(), + ty: resource_pot.resource_pot_type.clone(), + source: None, + })?; + resource_pot.meta = res; + let (mut updated_result, _) = + render_resource_pot_generate_resources(resource_pot, context, &Default::default())?; + let update_resources = updated_result.resources.remove(0); + + let sourcemap = update_resources + .source_map + .map(|map| SourceMap::from_slice(&map.bytes).unwrap()); + + let code = String::from_utf8(update_resources.resource.bytes).unwrap(); + let global_this = get_farm_global_this( + &context.config.runtime.namespace, + &context.config.output.target_env, + ); + let mut magic_string = MagicString::new(&code, None); + + // force re-register the affected modules when hmr + magic_string.prepend(&format!("{global_this}.{FARM_MODULE_SYSTEM}._rg=true;")); + magic_string.append(&format!("{global_this}.{FARM_MODULE_SYSTEM}._rg=false;")); + + let code = magic_string.to_string(); + + let map = if let Some(sourcemap) = sourcemap { + // the updated code will be executed in the browser using new Function(code), so we need to + // add extra (function anonymous() {})() to wrap the code to make sure the sourcemap works as expected + magic_string.prepend("(function anonymous(\n) {\n"); + magic_string.append("\n})"); + + let map = magic_string + .generate_map(SourceMapOptions::default()) + .unwrap(); + let sourcemap = + collapse_sourcemap_chain(vec![sourcemap, map], CollapseSourcemapOptions::default()); + + let mut buf = vec![]; + sourcemap.to_writer(&mut buf).unwrap(); + let map_code = String::from_utf8(buf).unwrap(); + + // inline source map + format!( + "\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,{}", + base64_encode(map_code.as_bytes()) + ) + } else { + "".to_string() + }; + + Ok(format!("{}{}", code, map)) }; let immutable_update_resource = gen_resource_pot_code(&mut immutable_update_resource_pot)?; @@ -184,21 +180,22 @@ pub fn regenerate_resources_for_affected_module_groups( for updated_module_id in updated_module_ids { let module = module_graph.module(updated_module_id).unwrap(); - let resource_pot_id = module.resource_pot.as_ref().unwrap(); - if !affected_resource_pots_ids.contains(resource_pot_id) { - affected_resource_pots_ids.push(resource_pot_id.clone()); - } + for resource_pot_id in &module.resource_pots { + if !affected_resource_pots_ids.contains(resource_pot_id) { + affected_resource_pots_ids.push(resource_pot_id.clone()); + } - // also remove the related resources, the resources will be regenerated later - let mut resource_maps = context.resources_map.lock(); - let resource_pot = resource_pot_map.resource_pot_mut(resource_pot_id).unwrap(); + // also remove the related resources, the resources will be regenerated later + let mut resource_maps = context.resources_map.lock(); + let resource_pot = resource_pot_map.resource_pot_mut(resource_pot_id).unwrap(); - for resource in resource_pot.resources() { - resource_maps.remove(resource); - } + for resource in resource_pot.resources() { + resource_maps.remove(resource); + } - resource_pot.clear_resources(); + resource_pot.clear_resources(); + } } let mut resource_pots = resource_pot_map @@ -209,7 +206,7 @@ pub fn regenerate_resources_for_affected_module_groups( drop(module_graph); - // call process_resource_pot_map hook + // call process_resource_pots hook context .plugin_driver .process_resource_pots(&mut resource_pots, context)?; @@ -234,14 +231,15 @@ fn clear_resource_pot_of_modules_in_module_groups( module_group_id: &HashSet, context: &Arc, ) { + let mut module_graph = context.module_graph.write(); + let module_group_graph = context.module_group_graph.read(); + for module_group_id in module_group_id { - let mut module_graph = context.module_graph.write(); - let module_group_graph = context.module_group_graph.read(); let module_group = module_group_graph.module_group(module_group_id).unwrap(); for module_id in module_group.modules() { let module = module_graph.module_mut(module_id).unwrap(); - module.resource_pot = None; + module.resource_pots = Default::default(); } } } diff --git a/crates/compiler/src/utils.rs b/crates/compiler/src/utils.rs new file mode 100644 index 0000000000..2f342da7b2 --- /dev/null +++ b/crates/compiler/src/utils.rs @@ -0,0 +1,24 @@ +use farmfe_core::module::ModuleId; + +pub fn get_module_ids_from_compilation_errors( + errors: &[farmfe_core::error::CompilationError], +) -> Vec { + errors + .iter() + .filter_map(|e| match e { + farmfe_core::error::CompilationError::ResolveError { importer, .. } => { + Some(importer.as_str().into()) + } + farmfe_core::error::CompilationError::LoadError { resolved_path, .. } => { + Some(resolved_path.as_str().into()) + } + farmfe_core::error::CompilationError::TransformError { resolved_path, .. } => { + Some(resolved_path.as_str().into()) + } + farmfe_core::error::CompilationError::ParseError { resolved_path, .. } => { + Some(resolved_path.as_str().into()) + } + _ => None, + }) + .collect() +} diff --git a/crates/compiler/src/write/mod.rs b/crates/compiler/src/write/mod.rs new file mode 100644 index 0000000000..6bff8e78ee --- /dev/null +++ b/crates/compiler/src/write/mod.rs @@ -0,0 +1,197 @@ +use crate::Compiler; +use farmfe_core::error::Result; +use farmfe_core::rayon::iter::{IntoParallelRefIterator, ParallelIterator}; +use farmfe_core::resource::Resource; +use farmfe_core::HashMap; + +use std::collections::HashSet; +use std::fs::{copy, create_dir_all, read_dir, File}; +use std::io::{BufWriter, Write}; +use std::path::{Path, PathBuf}; + +// default set to 8192 Memory allocation threshold issues Ensure that the code runs perfectly +// TODO may be different for different platforms threshold will be different linux / macos / windows +const SMALL_FILE_THRESHOLD: usize = 8192; + +// TODO use error::{CompilationError} we need refactor Error mod +impl Compiler { + pub(crate) fn write(&self) -> Result<()> { + // TODO add writeBundle write hooks plugin_driver + self.write_resources_to_disk()?; + self + .context + .plugin_driver + .finish(&self.context.stats, &self.context)?; + + Ok(()) + } + + pub fn write_resources_to_disk(&self) -> Result<()> { + #[cfg(feature = "profile")] + farmfe_core::puffin::profile_function!(); + + let output_dir = Path::new(&self.context.config.output.path); + + { + let resources_map = self.context.resources_map.lock(); + + // create output directories for all resources + self.create_output_directories(&resources_map, output_dir); + + let (small_files, large_files) = self.split_resources(&resources_map); + + self.write_large_files(&large_files, output_dir); + + self.write_small_files(&small_files, output_dir); + } + + self.copy_public_dir(output_dir); + + Ok(()) + } + + fn copy_public_dir(&self, output_dir: &Path) -> Result<()> { + let build_config = &self.context.config; + let output_dir_path = Path::new(&output_dir); + let public_dir_path = match &build_config.assets.public_dir { + Some(dir) => Path::new(dir), + None => return Ok(()), + }; + if !public_dir_path.exists() { + return Ok(()); + } + + if !self.are_separate_folders(output_dir_path, public_dir_path) { + // TODO: add Farm rust logger + println!( + "\n(!) Warning: The public directory feature may not work correctly. \ + outDir {} and publicDir {} are not separate folders.\n", + output_dir_path.display(), + public_dir_path.display() + ); + } + + self.copy_dir(public_dir_path, output_dir_path); + + Ok(()) + } + + fn are_separate_folders(&self, dir1: &Path, dir2: &Path) -> bool { + if let Ok(relative) = dir2.strip_prefix(dir1) { + if !relative.as_os_str().is_empty() && !relative.to_string_lossy().starts_with("..") { + return false; + } + } + + if let Ok(relative) = dir1.strip_prefix(dir2) { + if !relative.as_os_str().is_empty() && !relative.to_string_lossy().starts_with("..") { + return false; + } + } + + true + } + + fn copy_dir(&self, from: &Path, to: &Path) { + if !from.exists() { + return; + } + + if !to.exists() { + create_dir_all(to).unwrap(); + } + + // TODO use parallel iterator + for entry in read_dir(from).unwrap() { + let entry = entry.unwrap(); + let file_type = entry.file_type().unwrap(); + let to_path = to.join(entry.file_name()); + + if file_type.is_dir() { + self.copy_dir(&entry.path(), &to_path); + } else { + copy(entry.path(), to_path).unwrap(); + } + } + } + + fn create_output_directories( + &self, + resources_map: &HashMap, + output_dir: &Path, + ) -> Result<()> { + let mut dirs = HashSet::new(); + for name in resources_map.keys() { + let path = Path::new(output_dir).join(name.split(['?', '#']).next().unwrap()); + if let Some(parent) = path.parent() { + dirs.insert(parent.to_path_buf()); + } + } + + // TODO try catch error + for dir in dirs { + create_dir_all(&dir).unwrap(); + } + + Ok(()) + } + + fn split_resources<'a>( + &self, + resources_map: &'a HashMap, + ) -> ( + Vec<(&'a String, &'a Resource)>, + Vec<(&'a String, &'a Resource)>, + ) { + let mut small_files = Vec::new(); + let mut large_files = Vec::new(); + + for (name, resource) in resources_map.iter() { + if resource.emitted { + continue; + } + + if resource.bytes.len() < SMALL_FILE_THRESHOLD { + small_files.push((name, resource)); + } else { + large_files.push((name, resource)); + } + } + + (small_files, large_files) + } + + fn write_large_files( + &self, + large_files: &[(&String, &Resource)], + output_dir: &Path, + ) -> Result<()> { + // temporary use try_for_each to avoid panic and ok return instead of Result + large_files.par_iter().for_each(|&(name, resource)| { + let path = output_dir.join(name.split(['?', '#']).next().unwrap()); + self.write_file(&path, &resource.bytes); + }); + + Ok(()) + } + + fn write_small_files( + &self, + small_files: &[(&String, &Resource)], + output_dir: &Path, + ) -> Result<()> { + for (name, resource) in small_files { + let path = output_dir.join(name.split(['?', '#']).next().unwrap()); + self.write_file(&path, &resource.bytes); + } + Ok(()) + } + + // TODO use error::{CompilationError} we need refactor Error mod + fn write_file(&self, path: &Path, content: &[u8]) { + let file = File::create(path).unwrap(); + let mut writer = BufWriter::new(file); + writer.write_all(content).unwrap(); + writer.flush().unwrap(); + } +} diff --git a/crates/compiler/tests/bundle.rs b/crates/compiler/tests/bundle.rs index f06cd8a1da..716f77c31e 100644 --- a/crates/compiler/tests/bundle.rs +++ b/crates/compiler/tests/bundle.rs @@ -1,14 +1,20 @@ -use std::{collections::HashMap, path::PathBuf}; +use std::path::PathBuf; + +use farmfe_core::config::{ + bool_or_obj::BoolOrObj, config_regex::ConfigRegex, + partial_bundling::PartialBundlingEnforceResourceConfig, Mode, TargetEnv, +}; +use farmfe_core::HashMap; -use farmfe_core::config::{bool_or_obj::BoolOrObj, config_regex::ConfigRegex, Mode, TargetEnv}; mod common; use crate::common::{ assert_compiler_result_with_config, create_compiler_with_args, AssertCompilerResultConfig, }; +use farmfe_core::config::Config; #[allow(dead_code)] #[cfg(test)] -fn test(file: String, crate_path: String) { +fn test(file: String, crate_path: String, f: Option) { use common::{format_output_name, get_dir_config_files, try_merge_config_file}; use farmfe_core::config::partial_bundling::PartialBundlingEnforceResourceConfig; @@ -19,15 +25,15 @@ fn test(file: String, crate_path: String) { let entry_name = "index".to_string(); - let runtime_entry = cwd.to_path_buf().join("runtime.ts"); let files = get_dir_config_files(cwd); + let runtime_entry = cwd.to_path_buf().join("runtime.ts"); for (name, config_entry) in files { let compiler = create_compiler_with_args( cwd.to_path_buf(), create_path_buf.clone(), |mut config, plugins| { - config.mode = Mode::Production; + config.mode = Mode::Development; if runtime_entry.is_file() { let runtime_entry = runtime_entry.to_string_lossy().to_string(); @@ -40,7 +46,8 @@ fn test(file: String, crate_path: String) { config.tree_shaking = Box::new(BoolOrObj::Bool(false)); config.external = vec![ConfigRegex::new("(^node:.*)"), ConfigRegex::new("^fs$")]; - config.output.target_env = TargetEnv::Custom("library-browser".to_string()); + config.output.target_env = TargetEnv::Custom("library-node".to_string()); + config.resolve.auto_external_failed_resolve = true; // config.output.format = ModuleFormat::CommonJs; // TODO: multiple bundle @@ -51,6 +58,10 @@ fn test(file: String, crate_path: String) { config = try_merge_config_file(config, config_entry); + if let Some(f) = f.as_ref() { + f(&mut config); + } + (config, plugins) }, ); @@ -61,11 +72,37 @@ fn test(file: String, crate_path: String) { &compiler, AssertCompilerResultConfig { entry_name: Some(entry_name.clone()), - ignore_emitted_field: false, output_file: Some(format_output_name(name)), + ignore_emitted_field: false, + ..Default::default() }, ); } } -farmfe_testing::testing! {"tests/fixtures/bundle/library/**/index.ts", test} +fn single_bundle_test(file: String, crate_path: String) { + test(file, crate_path, None::); +} + +fn multiple_bundle_test(file: String, crate_path: String) { + test( + file, + crate_path, + Some(|config: &mut Config| { + config.partial_bundling.enforce_resources = vec![PartialBundlingEnforceResourceConfig { + name: "bundle1".to_string(), + test: vec![ConfigRegex::new("^bundle2.+")], + }]; + }), + ); +} + +// farmfe_testing::testing! {"tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/namespace/**/index.ts", single_bundle_test} + +farmfe_testing::testing! { + "tests/fixtures/bundle/**/index.ts", + // "tests/fixtures/bundle/library/reexport/use_external_reexport/**/index.ts", + // "tests/fixtures/bundle/library/reexport/reexport/**/index.ts", + // "tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/default/**/index.ts", + multiple_bundle_test +} diff --git a/crates/compiler/tests/common/mod.rs b/crates/compiler/tests/common/mod.rs index 074903c2bb..e6b49557cc 100644 --- a/crates/compiler/tests/common/mod.rs +++ b/crates/compiler/tests/common/mod.rs @@ -1,7 +1,6 @@ #![allow(clippy::needless_update)] use std::{ - collections::HashMap, fs, path::{Path, PathBuf}, sync::Arc, @@ -14,8 +13,8 @@ use farmfe_core::{ preset_env::PresetEnvConfig, Config, CssConfig, Mode, RuntimeConfig, SourcemapConfig, }, plugin::Plugin, - serde::de::DeserializeOwned, serde_json::{self, Value}, + HashMap, }; use farmfe_testing_helpers::is_update_snapshot_from_env; use farmfe_toolkit::fs::read_file_utf8; @@ -33,7 +32,6 @@ pub fn generate_runtime(crate_path: PathBuf) -> Box { .join("fixtures") .join("_internal") .join("runtime") - .join("index.js") .to_string_lossy() .to_string(); @@ -127,7 +125,7 @@ pub fn try_merge_config_file(origin: Config, file: PathBuf) -> Config { #[allow(dead_code)] pub fn create_config(cwd: PathBuf, crate_path: PathBuf) -> Config { Config { - input: HashMap::new(), + input: HashMap::default(), root: cwd.to_string_lossy().to_string(), runtime: generate_runtime(crate_path), output: Default::default(), @@ -225,7 +223,6 @@ pub fn create_compiler_with_plugins( .join("fixtures") .join("_internal") .join("runtime") - .join("index.js") .to_string_lossy() .to_string(); @@ -342,7 +339,13 @@ pub fn assert_compiler_result_with_config(compiler: &Compiler, config: AssertCom assert_eq!(expected.trim(), result.trim()); // ignore whitespace } - assert_eq!(expected_lines.len(), result_lines.len()); + assert_eq!( + expected_lines.len(), + result_lines.len(), + "expect: \n{} result: \n{}", + expected_result, + result + ); } } @@ -357,21 +360,6 @@ pub fn assert_compiler_result(compiler: &Compiler, entry_name: Option<&String>) ); } -#[allow(dead_code)] -#[deprecated] -pub fn get_config_field(value: &Value, keys: &[&str]) -> Option { - let mut v: &Value = value; - - for key in keys.iter() { - v = v.get(key)?; - } - - Some( - serde_json::from_value(v.clone()) - .unwrap_or_else(|_| panic!("{} type is not correct", keys.join("."))), - ) -} - #[allow(dead_code)] pub fn get_dir_config_files(cwd: &Path) -> Vec<(String, PathBuf)> { // println!("fs::read_dir(cwd): {:#?}", fs::read(format!("{}/", cwd.to_string_lossy().to_string()))); @@ -477,7 +465,7 @@ pub fn test_builder(options: TestBuilderOptions) { cwd.clone(), crate_path.clone(), |mut config, mut plugins| { - config.input = HashMap::from([(entry_name.clone(), file.clone())]); + config.input = HashMap::from_iter([(entry_name.clone(), file.clone())]); if let Some(_config) = _config.clone() { let v1 = serde_json::to_value(config).expect("cannot convert config to value"); diff --git a/crates/compiler/tests/css.rs b/crates/compiler/tests/css.rs index 82b5b1f061..c621ea64d3 100644 --- a/crates/compiler/tests/css.rs +++ b/crates/compiler/tests/css.rs @@ -1,6 +1,5 @@ -use std::collections::HashMap; - use farmfe_core::config::{CssConfig, CssModulesConfig, CssPrefixerConfig}; +use farmfe_core::HashMap; use farmfe_testing_helpers::fixture; mod common; @@ -15,7 +14,7 @@ fn css_modules() { let entry_name = "index".to_string(); let compiler = create_css_compiler( - HashMap::from([(entry_name.clone(), "./index.ts".into())]), + HashMap::from_iter([(entry_name.clone(), "./index.ts".into())]), cwd.to_path_buf(), crate_path, CssConfig { @@ -41,7 +40,7 @@ fn css_prefixer() { let entry_name = "index".to_string(); let compiler = create_css_compiler( - HashMap::from([(entry_name.clone(), "./index.ts".into())]), + HashMap::from_iter([(entry_name.clone(), "./index.ts".into())]), cwd.to_path_buf(), crate_path, CssConfig { @@ -68,7 +67,7 @@ fn css_url_replacer() { let entry_name = "index".to_string(); let compiler = create_css_compiler( - HashMap::from([(entry_name.clone(), "./index.ts".into())]), + HashMap::from_iter([(entry_name.clone(), "./index.ts".into())]), cwd.to_path_buf(), crate_path, CssConfig { diff --git a/crates/compiler/tests/external.rs b/crates/compiler/tests/external.rs index ecb9a806a6..091995737c 100644 --- a/crates/compiler/tests/external.rs +++ b/crates/compiler/tests/external.rs @@ -1,10 +1,11 @@ mod common; use crate::common::{assert_compiler_result, create_compiler_with_args}; -use std::{collections::HashMap, path::PathBuf}; +use std::path::PathBuf; use farmfe_core::config::{ config_regex::ConfigRegex, custom::CUSTOM_CONFIG_EXTERNAL_RECORD, ModuleFormat, TargetEnv, }; +use farmfe_core::HashMap; fn test(file: String, crate_path: String) { let file_path_buf = PathBuf::from(file.clone()); diff --git a/crates/compiler/tests/fixtures/_internal/runtime/index.js b/crates/compiler/tests/fixtures/_internal/runtime/index.js deleted file mode 100644 index b2ca3ebb0a..0000000000 --- a/crates/compiler/tests/fixtures/_internal/runtime/index.js +++ /dev/null @@ -1 +0,0 @@ -console.log('runtime/index.js') \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/_internal/runtime/src/module-system.ts b/crates/compiler/tests/fixtures/_internal/runtime/src/module-system.ts new file mode 100644 index 0000000000..43b7c07996 --- /dev/null +++ b/crates/compiler/tests/fixtures/_internal/runtime/src/module-system.ts @@ -0,0 +1 @@ +export const moduleSystem = {}; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/_internal/runtime/src/modules/dynamic-import.ts b/crates/compiler/tests/fixtures/_internal/runtime/src/modules/dynamic-import.ts new file mode 100644 index 0000000000..b59b0e4a15 --- /dev/null +++ b/crates/compiler/tests/fixtures/_internal/runtime/src/modules/dynamic-import.ts @@ -0,0 +1,3 @@ +export function initModuleSystem() { + console.log('dynamic-import.ts'); +} \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/_internal/runtime/src/modules/module-helper.ts b/crates/compiler/tests/fixtures/_internal/runtime/src/modules/module-helper.ts new file mode 100644 index 0000000000..38eaa56217 --- /dev/null +++ b/crates/compiler/tests/fixtures/_internal/runtime/src/modules/module-helper.ts @@ -0,0 +1,3 @@ +export function initModuleSystem() { + console.log('module-helper.ts'); +} \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/_internal/runtime/src/modules/module-system-helper.ts b/crates/compiler/tests/fixtures/_internal/runtime/src/modules/module-system-helper.ts new file mode 100644 index 0000000000..2e8bdc3a2f --- /dev/null +++ b/crates/compiler/tests/fixtures/_internal/runtime/src/modules/module-system-helper.ts @@ -0,0 +1,3 @@ +export function initModuleSystem() { + console.log('module-system-helper.ts'); +} \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/concatenate_module/circle/config.json b/crates/compiler/tests/fixtures/bundle/concatenate_module/circle/config.json new file mode 100644 index 0000000000..fc58f11aa3 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/concatenate_module/circle/config.json @@ -0,0 +1,8 @@ +{ + "concatenateModules": true, + "output": { + "targetEnv": "browser" + }, + "comments": true, + "minify": false +} \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/concatenate_module/circle/foo.ts b/crates/compiler/tests/fixtures/bundle/concatenate_module/circle/foo.ts new file mode 100644 index 0000000000..8f652274aa --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/concatenate_module/circle/foo.ts @@ -0,0 +1,4 @@ +import { reexport } from './reexport'; + + +export const foo = reexport + 'foo'; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/concatenate_module/circle/index.ts b/crates/compiler/tests/fixtures/bundle/concatenate_module/circle/index.ts new file mode 100644 index 0000000000..3084b71bf1 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/concatenate_module/circle/index.ts @@ -0,0 +1,3 @@ +import * as ns from './reexport'; + +console.log(ns); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/concatenate_module/circle/output.js b/crates/compiler/tests/fixtures/bundle/concatenate_module/circle/output.js new file mode 100644 index 0000000000..ed36a3f207 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/concatenate_module/circle/output.js @@ -0,0 +1,53 @@ +//index.js: + window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};;((function(){// module_id: ../../../_internal/runtime/index.js.farm-runtime +function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; + } + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); + } + return module.exports; + }; +} +var index_js_cjs = __commonJs({ + "../../../_internal/runtime/index.js.farm-runtime": (module, exports)=>{ + "use strict"; + console.log('runtime/index.js'); + window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); + } +}); +index_js_cjs(); +})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_830e.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"foo.ts":function (module, exports, farmRequire, farmDynamicRequire) { + module._m(exports); + module.o(exports, "foo", function() { + return foo; + }); + var _f_reexport = farmRequire("reexport.ts"); + var foo = _f_reexport.reexport + 'foo'; +} +, +"index.ts":function (module, exports, farmRequire, farmDynamicRequire) { + module._m(exports); + var _f_reexport = module.w(farmRequire("reexport.ts")); + var ns = _f_reexport; + console.log(ns); +} +, +"reexport.ts":function (module, exports, farmRequire, farmDynamicRequire) { + module._m(exports); + module.o(exports, "reexport", function() { + return reexport; + }); + var reexport = 'reexport'; + var _f_foo = farmRequire("foo.ts"); + module._e(exports, _f_foo); +} +,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("index.ts"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/concatenate_module/circle/reexport.ts b/crates/compiler/tests/fixtures/bundle/concatenate_module/circle/reexport.ts new file mode 100644 index 0000000000..de4f783757 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/concatenate_module/circle/reexport.ts @@ -0,0 +1,3 @@ + +export const reexport = 'reexport'; +export * from './foo'; diff --git a/crates/compiler/tests/fixtures/bundle/concatenate_module/export/config.json b/crates/compiler/tests/fixtures/bundle/concatenate_module/export/config.json new file mode 100644 index 0000000000..d376774c4e --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/concatenate_module/export/config.json @@ -0,0 +1,6 @@ +{ + "concatenateModules": true, + "output": { + "targetEnv": "browser" + } +} \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/concatenate_module/export/index.ts b/crates/compiler/tests/fixtures/bundle/concatenate_module/export/index.ts new file mode 100644 index 0000000000..d165b1eaae --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/concatenate_module/export/index.ts @@ -0,0 +1,3 @@ +import { createEmotion } from './reexport'; + +console.log(createEmotion); diff --git a/crates/compiler/tests/fixtures/bundle/concatenate_module/export/output.js b/crates/compiler/tests/fixtures/bundle/concatenate_module/export/output.js new file mode 100644 index 0000000000..58450003e9 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/concatenate_module/export/output.js @@ -0,0 +1,33 @@ +//index.js: + window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};;((function(){// module_id: ../../../_internal/runtime/index.js.farm-runtime +function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; + } + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); + } + return module.exports; + }; +} +var index_js_cjs = __commonJs({ + "../../../_internal/runtime/index.js.farm-runtime": (module, exports)=>{ + "use strict"; + console.log('runtime/index.js'); + window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); + } +}); +index_js_cjs(); +})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_b752.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"index.ts":function (module, exports, farmRequire, farmDynamicRequire) { + module._m(exports); + var _f_xxx = farmRequire("xxx"); + console.log(_f_xxx.default); +} +,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("index.ts"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/concatenate_module/export/reexport.ts b/crates/compiler/tests/fixtures/bundle/concatenate_module/export/reexport.ts new file mode 100644 index 0000000000..ad41e147eb --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/concatenate_module/export/reexport.ts @@ -0,0 +1,2 @@ +// @ts-ignore +export { default as createEmotion } from 'xxx'; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/export/doubleReexportAll/config.cjs.json b/crates/compiler/tests/fixtures/bundle/export/doubleReexportAll/config.cjs.json new file mode 100644 index 0000000000..a54e6cace5 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/export/doubleReexportAll/config.cjs.json @@ -0,0 +1,5 @@ +{ + "output": { + "format": "cjs" + } +} \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/export/doubleReexportAll/foo.ts b/crates/compiler/tests/fixtures/bundle/export/doubleReexportAll/foo.ts new file mode 100644 index 0000000000..6e0a357a60 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/export/doubleReexportAll/foo.ts @@ -0,0 +1 @@ +export { Worker } from './reexport'; diff --git a/crates/compiler/tests/fixtures/bundle/export/doubleReexportAll/index.ts b/crates/compiler/tests/fixtures/bundle/export/doubleReexportAll/index.ts new file mode 100644 index 0000000000..e2a0cb45c4 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/export/doubleReexportAll/index.ts @@ -0,0 +1,7 @@ + +import { readFile } from './reexport'; +import { Worker } from './foo' + +console.log({ readFile, Worker }); + +export * from './reexport'; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/export/doubleReexportAll/output.cjs.js b/crates/compiler/tests/fixtures/bundle/export/doubleReexportAll/output.cjs.js new file mode 100644 index 0000000000..211fdff6b1 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/export/doubleReexportAll/output.cjs.js @@ -0,0 +1,96 @@ +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ +function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; + } + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); + } + return module.exports; + }; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function(nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interop_require_wildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) return obj; + if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { + default: obj + }; + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) return cache.get(obj); + var newObj = { + __proto__: null + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for(var key in obj){ + if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); + else newObj[key] = obj[key]; + } + } + newObj.default = obj; + if (cache) cache.set(obj, newObj); + return newObj; +} +function _export_star(from, to) { + Object.keys(from).forEach(function(k) { + if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { + Object.defineProperty(to, k, { + enumerable: true, + get: function() { + return from[k]; + } + }); + } + }); + return from; +} +module.exports.__commonJs = __commonJs; +module.exports._export_star = _export_star; +module.exports._interop_require_wildcard = _interop_require_wildcard; +Object.defineProperty(exports, "__esModule", { + value: true +}); + + +//index.js: + // module_id: reexport.ts +var farm_runtime_js_ns = require("./farm_runtime.js"); +var __commonJs = farm_runtime_js_ns.__commonJs, _export_star = farm_runtime_js_ns._export_star, _interop_require_wildcard = farm_runtime_js_ns._interop_require_wildcard; +var reexport_cjs = __commonJs({ + "reexport.ts": (module, exports)=>{ + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + _export_star(require("node:fs"), exports); + _export_star(require("node:cluster"), exports); + const readFile = 123; + module.exports.name = 123; + } +}); +var reexport_ns = _interop_require_wildcard(reexport_cjs()), Worker = reexport_cjs()["Worker"], readFile = reexport_cjs()["readFile"]; + +// module_id: foo.ts + +// module_id: index.ts +console.log({ + readFile: readFile, + Worker: Worker +}); +_export_star(reexport_cjs(), module.exports); diff --git a/crates/compiler/tests/fixtures/bundle/export/doubleReexportAll/output.js b/crates/compiler/tests/fixtures/bundle/export/doubleReexportAll/output.js new file mode 100644 index 0000000000..1b957a730f --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/export/doubleReexportAll/output.js @@ -0,0 +1,53 @@ +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ +function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; + } + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); + } + return module.exports; + }; +} +import __farmNodeModule from 'module'; +var __nodeRequireInstance = __farmNodeModule.createRequire(import.meta.url); +function _nodeRequire() { + return __nodeRequireInstance.apply(null, arguments); +} +export { __commonJs, _nodeRequire }; + + +//index.js: + // module_id: reexport.ts +import { __commonJs, _nodeRequire } from "./farm_runtime.js"; +var reexport_cjs = __commonJs({ + "reexport.ts": (module, exports)=>{ + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + _export_star(_nodeRequire("node:fs"), exports); + _export_star(_nodeRequire("node:cluster"), exports); + const readFile = 123; + module.exports.name = 123; + } +}); +var Worker = reexport_cjs()["Worker"], readFile = reexport_cjs()["readFile"]; + +// module_id: foo.ts + +// module_id: index.ts +console.log({ + readFile: readFile, + Worker: Worker +}); +export * from "node:cluster"; +export * from "node:fs"; diff --git a/crates/compiler/tests/fixtures/bundle/export/doubleReexportAll/reexport.ts b/crates/compiler/tests/fixtures/bundle/export/doubleReexportAll/reexport.ts new file mode 100644 index 0000000000..09cbdc7b00 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/export/doubleReexportAll/reexport.ts @@ -0,0 +1,5 @@ +export * from 'node:fs'; +export * from 'node:cluster'; + +const readFile = 123; +module.exports.name = 123; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/export/reexportExternal/foo.ts b/crates/compiler/tests/fixtures/bundle/export/reexportExternal/foo.ts new file mode 100644 index 0000000000..f4596d5406 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/export/reexportExternal/foo.ts @@ -0,0 +1 @@ +export const foo = 'foo'; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/export/reexportExternal/index.ts b/crates/compiler/tests/fixtures/bundle/export/reexportExternal/index.ts new file mode 100644 index 0000000000..66662bf8a4 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/export/reexportExternal/index.ts @@ -0,0 +1 @@ +export * from './reexport'; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/export/reexportExternal/output.js b/crates/compiler/tests/fixtures/bundle/export/reexportExternal/output.js new file mode 100644 index 0000000000..477db36232 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/export/reexportExternal/output.js @@ -0,0 +1,14 @@ +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ + + +//index.js: + // module_id: foo.ts +import { readFile } from "node:fs"; +const foo = 'foo'; + +// module_id: reexport.ts + +// module_id: index.ts +export { foo as bar }; +export { readFile as rf } from "node:fs"; diff --git a/crates/compiler/tests/fixtures/bundle/export/reexportExternal/reexport.ts b/crates/compiler/tests/fixtures/bundle/export/reexportExternal/reexport.ts new file mode 100644 index 0000000000..1b7b69ce19 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/export/reexportExternal/reexport.ts @@ -0,0 +1,2 @@ +export { readFile as rf } from 'node:fs'; +export { foo as bar } from './foo'; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/library/execute/bundle2.ts b/crates/compiler/tests/fixtures/bundle/library/execute/bundle2.ts new file mode 100644 index 0000000000..8f6945224f --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/library/execute/bundle2.ts @@ -0,0 +1,3 @@ +console.log('hello world'); + +export default {} \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/library/execute/index.ts b/crates/compiler/tests/fixtures/bundle/library/execute/index.ts new file mode 100644 index 0000000000..05885d4eb8 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/library/execute/index.ts @@ -0,0 +1 @@ +import './bundle2'; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/library/execute/output.js b/crates/compiler/tests/fixtures/bundle/library/execute/output.js new file mode 100644 index 0000000000..21f3edd32c --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/library/execute/output.js @@ -0,0 +1,14 @@ +//bundle1.js: + // module_id: bundle2.ts +console.log('hello world'); +var bundle2_default = {}; +export { bundle2_default }; + + +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ + + +//index.js: + // module_id: index.ts +import "./bundle1.js"; diff --git a/crates/compiler/tests/fixtures/bundle/library/external/importNamespace/output.cjs.js b/crates/compiler/tests/fixtures/bundle/library/external/importNamespace/output.cjs.js deleted file mode 100644 index 582bbe45ae..0000000000 --- a/crates/compiler/tests/fixtures/bundle/library/external/importNamespace/output.cjs.js +++ /dev/null @@ -1,54 +0,0 @@ -//index.js: - function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}var node_fs_ns = _interop_require_wildcard(require("node:fs")); -var fs$1 = _interop_require_default(node_fs_ns).default; -const fs = 'a.ts'; -console.log(fs); -var a_default = 'a.ts'; - -console.log('b.ts', node_fs_ns); - -console.log('index.ts', fs$1); diff --git a/crates/compiler/tests/fixtures/bundle/library/external/importNamespace/output.js b/crates/compiler/tests/fixtures/bundle/library/external/importNamespace/output.js deleted file mode 100644 index 35b6de91b3..0000000000 --- a/crates/compiler/tests/fixtures/bundle/library/external/importNamespace/output.js +++ /dev/null @@ -1,54 +0,0 @@ -//index.js: - function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}import * as node_fs_ns from "node:fs"; -import fs$1 from "node:fs"; -const fs = 'a.ts'; -console.log(fs); -var a_default = 'a.ts'; - -console.log('b.ts', node_fs_ns); - -console.log('index.ts', fs$1); diff --git a/crates/compiler/tests/fixtures/bundle/library/external/importNamespace/output.json.js b/crates/compiler/tests/fixtures/bundle/library/external/importNamespace/output.json.js deleted file mode 100644 index 35b6de91b3..0000000000 --- a/crates/compiler/tests/fixtures/bundle/library/external/importNamespace/output.json.js +++ /dev/null @@ -1,54 +0,0 @@ -//index.js: - function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}import * as node_fs_ns from "node:fs"; -import fs$1 from "node:fs"; -const fs = 'a.ts'; -console.log(fs); -var a_default = 'a.ts'; - -console.log('b.ts', node_fs_ns); - -console.log('index.ts', fs$1); diff --git a/crates/compiler/tests/fixtures/bundle/library/global_variable/config.json b/crates/compiler/tests/fixtures/bundle/library/global_variable/config.json deleted file mode 100644 index f3bd025f22..0000000000 --- a/crates/compiler/tests/fixtures/bundle/library/global_variable/config.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "output": { - "targetEnv": "library-browser" - } -} \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/library/global_variable/output.js b/crates/compiler/tests/fixtures/bundle/library/global_variable/output.js deleted file mode 100644 index e62312eaba..0000000000 --- a/crates/compiler/tests/fixtures/bundle/library/global_variable/output.js +++ /dev/null @@ -1,50 +0,0 @@ -//index.js: - function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}console.log(hello); - -console.log(hello); -const hello$1 = 123; -console.log(hello$1); diff --git a/crates/compiler/tests/fixtures/bundle/library/hybrid/defaultParams/bundle2-foo.ts b/crates/compiler/tests/fixtures/bundle/library/hybrid/defaultParams/bundle2-foo.ts new file mode 100644 index 0000000000..8eaf3cd755 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/library/hybrid/defaultParams/bundle2-foo.ts @@ -0,0 +1,7 @@ +const foo = { + Provider: 'bundle2-foo', +}; + +export { + foo as ReactProvider +}; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/library/hybrid/defaultParams/foo.ts b/crates/compiler/tests/fixtures/bundle/library/hybrid/defaultParams/foo.ts new file mode 100644 index 0000000000..f4596d5406 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/library/hybrid/defaultParams/foo.ts @@ -0,0 +1 @@ +export const foo = 'foo'; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/library/hybrid/defaultParams/index.ts b/crates/compiler/tests/fixtures/bundle/library/hybrid/defaultParams/index.ts new file mode 100644 index 0000000000..6ab0301ab5 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/library/hybrid/defaultParams/index.ts @@ -0,0 +1,35 @@ +import { foo as defaultFoo } from './foo'; +import { ReactProvider } from './bundle2-foo'; + + +function loadFoo(foo = defaultFoo) { + return +} + +const loadFooArrowExpr = () => { + return (foo: string) => { + console.log(foo, ReactProvider.Provider); + } +} + +class LoadFoo { + constructor(public foo = defaultFoo) {} + + getFoo() { + return this.foo; + } +} + +loadFoo(); + +new LoadFoo(); + +const bar = 2; + +function computed(bar = 1) { + return { + [bar]: 123, + [defaultFoo]: 234, + } +} +computed(); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/library/hybrid/defaultParams/output.js b/crates/compiler/tests/fixtures/bundle/library/hybrid/defaultParams/output.js new file mode 100644 index 0000000000..e930df08e8 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/library/hybrid/defaultParams/output.js @@ -0,0 +1,45 @@ +//bundle1.js: + // module_id: bundle2-foo.ts +const foo$5 = { + Provider: 'bundle2-foo' +}; +export { foo$5 }; + + +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ + + +//index.js: + // module_id: foo.ts +import { foo$5 } from "./bundle1.js"; +const foo$1 = 'foo'; + +// module_id: index.ts +function loadFoo(foo = foo$1) { + return; +} +const loadFooArrowExpr = ()=>{ + return (foo)=>{ + console.log(foo, foo$5.Provider); + }; +}; +class LoadFoo { + foo; + constructor(foo = foo$1){ + this.foo = foo; + } + getFoo() { + return this.foo; + } +} +loadFoo(); +new LoadFoo(); +const bar$1 = 2; +function computed(bar = 1) { + return { + [bar]: 123, + [foo$1]: 234 + }; +} +computed(); diff --git a/crates/compiler/tests/fixtures/bundle/library/hybrid/esm_export_cjs/output.cjs.js b/crates/compiler/tests/fixtures/bundle/library/hybrid/esm_export_cjs/output.cjs.js index 996845e049..0e66c7b009 100644 --- a/crates/compiler/tests/fixtures/bundle/library/hybrid/esm_export_cjs/output.cjs.js +++ b/crates/compiler/tests/fixtures/bundle/library/hybrid/esm_export_cjs/output.cjs.js @@ -1,9 +1,23 @@ -//index.js: - function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ +function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; + } + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); + } + return module.exports; }; -}function _export_star(from, to) { +} +function _export_star(from, to) { Object.keys(from).forEach(function(k) { if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { Object.defineProperty(to, k, { @@ -15,54 +29,28 @@ } }); return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); +} +module.exports.__commonJs = __commonJs; +module.exports._export_star = _export_star; +Object.defineProperty(exports, "__esModule", { + value: true +}); + + +//index.js: + // module_id: index.ts +var farm_runtime_js_ns = require("./farm_runtime.js"); +var __commonJs = farm_runtime_js_ns.__commonJs, _export_star = farm_runtime_js_ns._export_star; +var index_cjs = __commonJs({ + "index.ts": (module, exports)=>{ + "use strict"; + module.exports = { + name: 'foo', + age: 18 + }; } - return module.exports; - }; -}var index_cjs = __commonJs((module, exports)=>{ - module.exports = { - name: 'foo', - age: 18 - }; }); _export_star(index_cjs(), module.exports); +Object.defineProperty(exports, "__esModule", { + value: true +}); diff --git a/crates/compiler/tests/fixtures/bundle/library/hybrid/esm_export_cjs/output.js b/crates/compiler/tests/fixtures/bundle/library/hybrid/esm_export_cjs/output.js index 8ec97094a4..536ec6cbf5 100644 --- a/crates/compiler/tests/fixtures/bundle/library/hybrid/esm_export_cjs/output.js +++ b/crates/compiler/tests/fixtures/bundle/library/hybrid/esm_export_cjs/output.js @@ -1,68 +1,35 @@ -//index.js: - function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ +function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); +} +export { __commonJs }; + + +//index.js: + // module_id: index.ts +import { __commonJs } from "./farm_runtime.js"; +var index_cjs = __commonJs({ + "index.ts": (module, exports)=>{ + "use strict"; + module.exports = { + name: 'foo', + age: 18 + }; } - return module.exports; - }; -}var index_cjs = __commonJs((module, exports)=>{ - module.exports = { - name: 'foo', - age: 18 - }; }); export default index_cjs(); diff --git a/crates/compiler/tests/fixtures/bundle/library/hybrid/hybrid_entry_should_reexport/output.cjs.js b/crates/compiler/tests/fixtures/bundle/library/hybrid/hybrid_entry_should_reexport/output.cjs.js index ed7dc81484..cd560be8b5 100644 --- a/crates/compiler/tests/fixtures/bundle/library/hybrid/hybrid_entry_should_reexport/output.cjs.js +++ b/crates/compiler/tests/fixtures/bundle/library/hybrid/hybrid_entry_should_reexport/output.cjs.js @@ -1,9 +1,23 @@ -//index.js: - function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ +function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; + } + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); + } + return module.exports; }; -}function _export_star(from, to) { +} +function _export_star(from, to) { Object.keys(from).forEach(function(k) { if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { Object.defineProperty(to, k, { @@ -15,67 +29,43 @@ } }); return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { +} +function _interop_require_default(obj) { + return obj && obj.__esModule ? obj : { default: obj }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}var node_fs_ns = require("node:fs"); +} +module.exports.__commonJs = __commonJs; +module.exports._export_star = _export_star; +module.exports._interop_require_default = _interop_require_default; +Object.defineProperty(exports, "__esModule", { + value: true +}); + + +//index.js: + // module_id: index.ts +var farm_runtime_js_ns = require("./farm_runtime.js"); +var __commonJs = farm_runtime_js_ns.__commonJs, _export_star = farm_runtime_js_ns._export_star, _interop_require_default = farm_runtime_js_ns._interop_require_default; +var node_fs_ns = require("node:fs"); var fs = _interop_require_default(node_fs_ns).default; -var index_cjs = __commonJs((module, exports)=>{ - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - Object.defineProperty(exports, "name", { - enumerable: true, - get: function() { - return name; - } - }); - const os = require('node:os'); - console.log(fs.read, os.cpus); - const name = 'foo'; - module.exports.age = 18; +var index_cjs = __commonJs({ + "index.ts": (module, exports)=>{ + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.defineProperty(exports, "name", { + enumerable: true, + get: function() { + return name; + } + }); + const os = require('node:os'); + console.log(fs.read, os.cpus); + const name = 'foo'; + module.exports.age = 18; + } }); var name = index_cjs()["name"]; module.exports.name = name; diff --git a/crates/compiler/tests/fixtures/bundle/library/hybrid/hybrid_entry_should_reexport/output.js b/crates/compiler/tests/fixtures/bundle/library/hybrid/hybrid_entry_should_reexport/output.js index dcce038bc6..eb47be36ae 100644 --- a/crates/compiler/tests/fixtures/bundle/library/hybrid/hybrid_entry_should_reexport/output.js +++ b/crates/compiler/tests/fixtures/bundle/library/hybrid/hybrid_entry_should_reexport/output.js @@ -1,81 +1,51 @@ -//index.js: - import __farmNodeModule from 'module'; -global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ +function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); +} +import __farmNodeModule from 'module'; +var __nodeRequireInstance = __farmNodeModule.createRequire(import.meta.url); +function _nodeRequire() { + return __nodeRequireInstance.apply(null, arguments); +} +export { __commonJs, _nodeRequire }; + + +//index.js: + // module_id: index.ts +import { __commonJs, _nodeRequire } from "./farm_runtime.js"; +import fs from "node:fs"; +var index_cjs = __commonJs({ + "index.ts": (module, exports)=>{ + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.defineProperty(exports, "name", { + enumerable: true, + get: function() { + return name; + } + }); + const os = _nodeRequire('node:os'); + console.log(fs.read, os.cpus); + const name = 'foo'; + module.exports.age = 18; } - return module.exports; - }; -}import fs from "node:fs"; -var index_cjs = __commonJs((module, exports)=>{ - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - Object.defineProperty(exports, "name", { - enumerable: true, - get: function() { - return name; - } - }); - const os = global.nodeRequire('node:os'); - console.log(fs.read, os.cpus); - const name = 'foo'; - module.exports.age = 18; }); var name = index_cjs()["name"]; export { name }; diff --git a/crates/compiler/tests/fixtures/bundle/library/hybrid/importCjsNamespace/a.ts b/crates/compiler/tests/fixtures/bundle/library/hybrid/importCjsNamespace/a.ts index 769d5241a4..d25772398b 100644 --- a/crates/compiler/tests/fixtures/bundle/library/hybrid/importCjsNamespace/a.ts +++ b/crates/compiler/tests/fixtures/bundle/library/hybrid/importCjsNamespace/a.ts @@ -1,5 +1,5 @@ const lodash = 'a.ts'; -console.log(lodash); +console.log(lodash, 'a.ts'); export default 'a.ts'; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/library/hybrid/importCjsNamespace/output.cjs.js b/crates/compiler/tests/fixtures/bundle/library/hybrid/importCjsNamespace/output.cjs.js index f38d44cc6b..62a6f1e6e5 100644 --- a/crates/compiler/tests/fixtures/bundle/library/hybrid/importCjsNamespace/output.cjs.js +++ b/crates/compiler/tests/fixtures/bundle/library/hybrid/importCjsNamespace/output.cjs.js @@ -1,21 +1,31 @@ -//index.js: - function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ +function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); + } + return module.exports; + }; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function(nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interop_require_wildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) return obj; if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { default: obj @@ -36,39 +46,39 @@ newObj.default = obj; if (cache) cache.set(obj, newObj); return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, +} +function _interop_require_default(obj) { + return obj && obj.__esModule ? obj : { + default: obj }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); +} +module.exports.__commonJs = __commonJs; +module.exports._interop_require_default = _interop_require_default; +module.exports._interop_require_wildcard = _interop_require_wildcard; +Object.defineProperty(exports, "__esModule", { + value: true +}); + + +//index.js: + // module_id: lodash.ts +var farm_runtime_js_ns = require("./farm_runtime.js"); +var __commonJs = farm_runtime_js_ns.__commonJs, _interop_require_default = farm_runtime_js_ns._interop_require_default, _interop_require_wildcard = farm_runtime_js_ns._interop_require_wildcard; +var lodash_cjs = __commonJs({ + "lodash.ts": (module, exports)=>{ + module.exports.name = 'lodash'; + module.exports.default = 'foo'; } - return module.exports; - }; -}var lodash_cjs = __commonJs((module, exports)=>{ - module.exports.name = 'lodash'; - module.exports.default = 'foo'; }); var lodash$1 = _interop_require_default(lodash_cjs()).default, lodash_ns = _interop_require_wildcard(lodash_cjs()); +// module_id: a.ts const lodash = 'a.ts'; -console.log(lodash); +console.log(lodash, 'a.ts'); var a_default = 'a.ts'; +// module_id: b.ts console.log('b.ts', lodash_ns); +// module_id: index.ts console.log('index.ts', lodash$1); diff --git a/crates/compiler/tests/fixtures/bundle/library/hybrid/importCjsNamespace/output.js b/crates/compiler/tests/fixtures/bundle/library/hybrid/importCjsNamespace/output.js index f38d44cc6b..7777ea74cd 100644 --- a/crates/compiler/tests/fixtures/bundle/library/hybrid/importCjsNamespace/output.js +++ b/crates/compiler/tests/fixtures/bundle/library/hybrid/importCjsNamespace/output.js @@ -1,21 +1,31 @@ -//index.js: - function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ +function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; + } + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { + return module.exports; + }; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function(nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interop_require_wildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) return obj; if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { default: obj @@ -36,39 +46,33 @@ newObj.default = obj; if (cache) cache.set(obj, newObj); return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, +} +function _interop_require_default(obj) { + return obj && obj.__esModule ? obj : { + default: obj }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); +} +export { __commonJs, _interop_require_default, _interop_require_wildcard }; + + +//index.js: + // module_id: lodash.ts +import { __commonJs, _interop_require_default, _interop_require_wildcard } from "./farm_runtime.js"; +var lodash_cjs = __commonJs({ + "lodash.ts": (module, exports)=>{ + module.exports.name = 'lodash'; + module.exports.default = 'foo'; } - return module.exports; - }; -}var lodash_cjs = __commonJs((module, exports)=>{ - module.exports.name = 'lodash'; - module.exports.default = 'foo'; }); var lodash$1 = _interop_require_default(lodash_cjs()).default, lodash_ns = _interop_require_wildcard(lodash_cjs()); +// module_id: a.ts const lodash = 'a.ts'; -console.log(lodash); +console.log(lodash, 'a.ts'); var a_default = 'a.ts'; +// module_id: b.ts console.log('b.ts', lodash_ns); +// module_id: index.ts console.log('index.ts', lodash$1); diff --git a/crates/compiler/tests/fixtures/bundle/library/hybrid/importZip/bar.ts b/crates/compiler/tests/fixtures/bundle/library/hybrid/importZip/bar.ts new file mode 100644 index 0000000000..c69d49c0d6 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/library/hybrid/importZip/bar.ts @@ -0,0 +1,6 @@ +import cjs, { cjsName } from './cjs'; +import esm, { esmName } from './esm'; +import bundle2, { bundle2Name } from './bundle2'; +import { readFile } from 'node:fs'; + +console.log({ cjs: { cjs, cjsName }, readFile, esm: { esm, esmName }, bundle2: { bundle2, bundle2Name } }, 'bar.ts'); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/library/hybrid/importZip/bundle2.ts b/crates/compiler/tests/fixtures/bundle/library/hybrid/importZip/bundle2.ts new file mode 100644 index 0000000000..a05cf35e20 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/library/hybrid/importZip/bundle2.ts @@ -0,0 +1,6 @@ +export const bundle2Name = 'bundle2'; +export const bundle2Age = 18; + +export default function bundle2() { + +} \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/library/hybrid/importZip/cjs.ts b/crates/compiler/tests/fixtures/bundle/library/hybrid/importZip/cjs.ts new file mode 100644 index 0000000000..5e509d98b2 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/library/hybrid/importZip/cjs.ts @@ -0,0 +1,4 @@ +module.exports.cjsName = 'foo'; +module.exports.cjsAge = 18; + +export default function cjs() {} \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/library/hybrid/importZip/esm.ts b/crates/compiler/tests/fixtures/bundle/library/hybrid/importZip/esm.ts new file mode 100644 index 0000000000..8808c9ed50 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/library/hybrid/importZip/esm.ts @@ -0,0 +1,4 @@ +export const esmName = 'esm'; +export const esmAge = 19 + +export default function esm() {} \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/library/hybrid/importZip/foo.ts b/crates/compiler/tests/fixtures/bundle/library/hybrid/importZip/foo.ts new file mode 100644 index 0000000000..60cb7377e7 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/library/hybrid/importZip/foo.ts @@ -0,0 +1,7 @@ +import cjs, { cjsAge } from './cjs'; +import { readFile } from 'node:fs'; +import esm, { esmAge } from './esm'; +import bundle2, { bundle2Age } from './bundle2'; + + +console.log({ cjs: { cjs, cjsAge }, esm: { esm, esmAge }, bundle2: { bundle2, bundle2Age }, readFile }, 'foo.ts'); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/library/hybrid/importZip/index.ts b/crates/compiler/tests/fixtures/bundle/library/hybrid/importZip/index.ts new file mode 100644 index 0000000000..a7fb77d09d --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/library/hybrid/importZip/index.ts @@ -0,0 +1,2 @@ +import './bar'; +import './foo'; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/library/hybrid/importZip/output.js b/crates/compiler/tests/fixtures/bundle/library/hybrid/importZip/output.js new file mode 100644 index 0000000000..8cbe5705d1 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/library/hybrid/importZip/output.js @@ -0,0 +1,99 @@ +//bundle1.js: + // module_id: bundle2.ts +const bundle2Name = 'bundle2'; +const bundle2Age = 18; +function bundle2() {} +export { bundle2, bundle2Age, bundle2Name }; + + +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ +function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; + } + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); + } + return module.exports; + }; +} +function _interop_require_default(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} +export { __commonJs, _interop_require_default }; + + +//index.js: + // module_id: cjs.ts +import { __commonJs, _interop_require_default } from "./farm_runtime.js"; +import { bundle2, bundle2Age, bundle2Name } from "./bundle1.js"; +import { readFile } from "node:fs"; +var cjs_cjs = __commonJs({ + "cjs.ts": (module, exports)=>{ + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + Object.defineProperty(exports, "default", { + enumerable: true, + get: function() { + return cjs; + } + }); + module.exports.cjsName = 'foo'; + module.exports.cjsAge = 18; + function cjs() {} + } +}); +var cjs = _interop_require_default(cjs_cjs()).default, cjsAge = cjs_cjs()["cjsAge"], cjsName = cjs_cjs()["cjsName"]; + +// module_id: esm.ts +const esmName = 'esm'; +const esmAge = 19; +function esm() {} + +// module_id: bar.ts +console.log({ + cjs: { + cjs: cjs, + cjsName: cjsName + }, + readFile: readFile, + esm: { + esm: esm, + esmName: esmName + }, + bundle2: { + bundle2: bundle2, + bundle2Name: bundle2Name + } +}, 'bar.ts'); + +// module_id: foo.ts +console.log({ + cjs: { + cjs: cjs, + cjsAge: cjsAge + }, + esm: { + esm: esm, + esmAge: esmAge + }, + bundle2: { + bundle2: bundle2, + bundle2Age: bundle2Age + }, + readFile: readFile +}, 'foo.ts'); + +// module_id: index.ts diff --git a/crates/compiler/tests/fixtures/bundle/library/hybrid/normal/output.cjs.js b/crates/compiler/tests/fixtures/bundle/library/hybrid/normal/output.cjs.js index 9e04cdcf2a..0895589688 100644 --- a/crates/compiler/tests/fixtures/bundle/library/hybrid/normal/output.cjs.js +++ b/crates/compiler/tests/fixtures/bundle/library/hybrid/normal/output.cjs.js @@ -1,96 +1,72 @@ -//index.js: - function _interop_require_default(obj) { +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ +function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; + } + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); + } + return module.exports; + }; +} +function _interop_require_default(obj) { return obj && obj.__esModule ? obj : { default: obj }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { +} +module.exports.__commonJs = __commonJs; +module.exports._interop_require_default = _interop_require_default; +Object.defineProperty(exports, "__esModule", { + value: true +}); + + +//index.js: + // module_id: index.ts +var farm_runtime_js_ns = require("./farm_runtime.js"); +var __commonJs = farm_runtime_js_ns.__commonJs, _interop_require_default = farm_runtime_js_ns._interop_require_default; +var node_fs_ns = require("node:fs"); +var fs = _interop_require_default(node_fs_ns).default; +var index_cjs = __commonJs({ + "index.ts": (module, exports)=>{ + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + function _export(target, all) { + for(var name in all)Object.defineProperty(target, name, { enumerable: true, - get: function() { - return from[k]; - } + get: all[name] }); } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}var node_fs_ns = require("node:fs"); -var fs = _interop_require_default(node_fs_ns).default; -var index_cjs = __commonJs((module, exports)=>{ - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - function _export(target, all) { - for(var name in all)Object.defineProperty(target, name, { - enumerable: true, - get: all[name] + _export(exports, { + bar: function() { + return bar; + }, + default: function() { + return _default; + }, + foo: function() { + return foo; + } }); + const os = require('node:os'); + console.log(fs.read, os.cpus); + var _default = { + read: fs.read, + c: 1 + }; + const foo = 'foo'; + const bar = 'bar'; } - _export(exports, { - bar: function() { - return bar; - }, - default: function() { - return _default; - }, - foo: function() { - return foo; - } - }); - const os = require('node:os'); - console.log(fs.read, os.cpus); - var _default = { - read: fs.read, - c: 1 - }; - const foo = 'foo'; - const bar = 'bar'; }); var index_default = _interop_require_default(index_cjs()).default, bar = index_cjs()["bar"], foo = index_cjs()["foo"]; module.exports.bar = bar; diff --git a/crates/compiler/tests/fixtures/bundle/library/hybrid/normal/output.js b/crates/compiler/tests/fixtures/bundle/library/hybrid/normal/output.js index d5e79b13a6..5b8a4b2c9c 100644 --- a/crates/compiler/tests/fixtures/bundle/library/hybrid/normal/output.js +++ b/crates/compiler/tests/fixtures/bundle/library/hybrid/normal/output.js @@ -1,97 +1,71 @@ -//index.js: - import __farmNodeModule from 'module'; -global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);function _interop_require_default(obj) { +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ +function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; + } + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); + } + return module.exports; + }; +} +function _interop_require_default(obj) { return obj && obj.__esModule ? obj : { default: obj }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { +} +import __farmNodeModule from 'module'; +var __nodeRequireInstance = __farmNodeModule.createRequire(import.meta.url); +function _nodeRequire() { + return __nodeRequireInstance.apply(null, arguments); +} +export { __commonJs, _interop_require_default, _nodeRequire }; + + +//index.js: + // module_id: index.ts +import { __commonJs, _interop_require_default, _nodeRequire } from "./farm_runtime.js"; +import fs from "node:fs"; +var index_cjs = __commonJs({ + "index.ts": (module, exports)=>{ + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + function _export(target, all) { + for(var name in all)Object.defineProperty(target, name, { enumerable: true, - get: function() { - return from[k]; - } + get: all[name] }); } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}import fs from "node:fs"; -var index_cjs = __commonJs((module, exports)=>{ - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - function _export(target, all) { - for(var name in all)Object.defineProperty(target, name, { - enumerable: true, - get: all[name] + _export(exports, { + bar: function() { + return bar; + }, + default: function() { + return _default; + }, + foo: function() { + return foo; + } }); + const os = _nodeRequire('node:os'); + console.log(fs.read, os.cpus); + var _default = { + read: fs.read, + c: 1 + }; + const foo = 'foo'; + const bar = 'bar'; } - _export(exports, { - bar: function() { - return bar; - }, - default: function() { - return _default; - }, - foo: function() { - return foo; - } - }); - const os = global.nodeRequire('node:os'); - console.log(fs.read, os.cpus); - var _default = { - read: fs.read, - c: 1 - }; - const foo = 'foo'; - const bar = 'bar'; }); var index_default = _interop_require_default(index_cjs()).default, bar = index_cjs()["bar"], foo = index_cjs()["foo"]; -export { bar, foo }; -export default index_default; +export { bar, foo, index_default as default }; diff --git a/crates/compiler/tests/fixtures/bundle/library/reexport/esm/default/output.js b/crates/compiler/tests/fixtures/bundle/library/reexport/esm/default/output.js index 9cf3a76324..a2e8f323b9 100644 --- a/crates/compiler/tests/fixtures/bundle/library/reexport/esm/default/output.js +++ b/crates/compiler/tests/fixtures/bundle/library/reexport/esm/default/output.js @@ -1,48 +1,10 @@ +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ + + //index.js: - function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}var foo_default = 'foo'; + // module_id: foo.ts +var foo_default = 'foo'; +// module_id: index.ts export { foo_default as default }; diff --git a/crates/compiler/tests/fixtures/bundle/library/reexport/esm/named/output.js b/crates/compiler/tests/fixtures/bundle/library/reexport/esm/named/output.js index c4feebfd58..be43adb9af 100644 --- a/crates/compiler/tests/fixtures/bundle/library/reexport/esm/named/output.js +++ b/crates/compiler/tests/fixtures/bundle/library/reexport/esm/named/output.js @@ -1,49 +1,11 @@ +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ + + //index.js: - function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}const foo = 'foo'; + // module_id: foo.ts +const foo = 'foo'; const bar = 'bar'; +// module_id: index.ts export { bar, foo }; diff --git a/crates/compiler/tests/fixtures/bundle/library/reexport/esm/namespace/output.js b/crates/compiler/tests/fixtures/bundle/library/reexport/esm/namespace/output.js index 4cb7c1d6b1..ef05d3b9b4 100644 --- a/crates/compiler/tests/fixtures/bundle/library/reexport/esm/namespace/output.js +++ b/crates/compiler/tests/fixtures/bundle/library/reexport/esm/namespace/output.js @@ -1,58 +1,20 @@ +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ + + //index.js: - function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}var foo_default = 'foo'; -const foo$1 = 'foo'; + // module_id: foo.ts +var foo_default = 'foo'; +const foo = 'foo'; const bar = 'bar'; var foo_ns = { bar: bar, - foo: foo$1, + foo: foo, "default": foo_default, __esModule: true }; -const foo = 123; -console.log(foo_ns.default, foo_ns.foo, foo); +// module_id: index.ts +const foo$1 = 123; +console.log(foo_ns.default, foo_ns.foo, foo$1); export { foo_ns as ns }; diff --git a/crates/compiler/tests/fixtures/bundle/library/reexport/esm/star/output.js b/crates/compiler/tests/fixtures/bundle/library/reexport/esm/star/output.js index d33ca68f78..eb92c361c2 100644 --- a/crates/compiler/tests/fixtures/bundle/library/reexport/esm/star/output.js +++ b/crates/compiler/tests/fixtures/bundle/library/reexport/esm/star/output.js @@ -1,57 +1,12 @@ +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ + + //index.js: - function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}var foo_default = 'foo'; + // module_id: foo.ts +var foo_default = 'foo'; const foo = 'foo'; const bar = 'bar'; -var foo_ns = { - bar: bar, - foo: foo, - "default": foo_default, - __esModule: true -}; -export { bar, foo }; -export default foo_default; +// module_id: index.ts +export { bar, foo, foo_default as default }; diff --git a/crates/compiler/tests/fixtures/bundle/library/reexport/reexport/index.ts b/crates/compiler/tests/fixtures/bundle/library/reexport/reexport/index.ts new file mode 100644 index 0000000000..194ef63e6c --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/library/reexport/reexport/index.ts @@ -0,0 +1,4 @@ +export * from './reexport'; +// TODO: external +// TODO: improve reexport external +const Foo1 = '123'; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/library/reexport/reexport/output.js b/crates/compiler/tests/fixtures/bundle/library/reexport/reexport/output.js new file mode 100644 index 0000000000..d7dddc2f7e --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/library/reexport/reexport/output.js @@ -0,0 +1,13 @@ +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ + + +//index.js: + // module_id: reexport.ts +import { default as Foo1 } from "foo1"; +import { default as Foo2 } from "foo2"; + +// module_id: index.ts +const Foo1 = '123'; +export { default as Foo1 } from "foo1"; +export { default as Foo2 } from "foo2"; diff --git a/crates/compiler/tests/fixtures/bundle/library/reexport/reexport/reexport.ts b/crates/compiler/tests/fixtures/bundle/library/reexport/reexport/reexport.ts new file mode 100644 index 0000000000..1ae4fa357e --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/library/reexport/reexport/reexport.ts @@ -0,0 +1,3 @@ +// @ts-nocheck +export { default as Foo1 } from 'foo1' +export { default as Foo2 } from 'foo2' \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/default/circle.ts b/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/default/circle.ts new file mode 100644 index 0000000000..20d6a2b6f3 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/default/circle.ts @@ -0,0 +1,3 @@ +import * as ns from './reexport'; + +console.log({ ns }); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/default/foo.ts b/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/default/foo.ts index 8af2ad9ac7..f618a47710 100644 --- a/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/default/foo.ts +++ b/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/default/foo.ts @@ -1,2 +1,3 @@ module.exports.cjs = true; -export default 'foo'; \ No newline at end of file +var a = 'foo'; +export default a; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/default/index.ts b/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/default/index.ts index 2f816c828c..061b1c23c0 100644 --- a/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/default/index.ts +++ b/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/default/index.ts @@ -1 +1,4 @@ -export { default } from './foo.ts'; +import _default_import from './reexport'; + +export default _default_import; +export * from './reexport'; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/default/output.js b/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/default/output.js index e29a879d72..cb89a80a0e 100644 --- a/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/default/output.js +++ b/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/default/output.js @@ -1,78 +1,15 @@ +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ + + //index.js: - function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); + // module_id: reexport.ts +class foo { + constructor(){ + console.log(this.constructor === foo); } - return module.exports; - }; -}var foo_cjs = __commonJs((module, exports)=>{ - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - Object.defineProperty(exports, "default", { - enumerable: true, - get: function() { - return _default; - } - }); - module.exports.cjs = true; - var _default = 'foo'; -}); -var foo_default = foo_cjs()["default"]; +} +const bar = 'foo'; -export { foo_default as default }; +// module_id: index.ts +export { bar, foo as default }; diff --git a/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/default/reexport.ts b/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/default/reexport.ts new file mode 100644 index 0000000000..50b6156107 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/default/reexport.ts @@ -0,0 +1,12 @@ +// export { default } from './foo.ts'; +// import './circle'; + +class foo { + constructor() { + console.log(this.constructor === foo); + } +}; + +export const bar = 'foo'; + +export { foo as default }; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/named/output.js b/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/named/output.js index f1996fe320..646fc60684 100644 --- a/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/named/output.js +++ b/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/named/output.js @@ -1,87 +1,54 @@ -//index.js: - function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ +function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; + } + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); + } + return module.exports; }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { +} +export { __commonJs }; + + +//index.js: + // module_id: foo.ts +import { __commonJs } from "./farm_runtime.js"; +var foo_cjs = __commonJs({ + "foo.ts": (module, exports)=>{ + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + function _export(target, all) { + for(var name in all)Object.defineProperty(target, name, { enumerable: true, - get: function() { - return from[k]; - } + get: all[name] }); } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}var foo_cjs = __commonJs((module, exports)=>{ - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - function _export(target, all) { - for(var name in all)Object.defineProperty(target, name, { - enumerable: true, - get: all[name] + _export(exports, { + bar: function() { + return bar; + }, + foo: function() { + return foo; + } }); + const foo = 'foo'; + const bar = 'bar'; + module.exports.cjs = true; } - _export(exports, { - bar: function() { - return bar; - }, - foo: function() { - return foo; - } - }); - const foo = 'foo'; - const bar = 'bar'; - module.exports.cjs = true; }); var bar = foo_cjs()["bar"], foo = foo_cjs()["foo"]; +// module_id: index.ts export { bar, foo }; diff --git a/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/namespace/output.js b/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/namespace/output.js index 46366be2be..319073cfe2 100644 --- a/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/namespace/output.js +++ b/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/namespace/output.js @@ -1,21 +1,31 @@ -//index.js: - function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ +function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; + } + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { + return module.exports; + }; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function(nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interop_require_wildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) return obj; if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { default: obj @@ -36,56 +46,43 @@ newObj.default = obj; if (cache) cache.set(obj, newObj); return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}var foo_cjs = __commonJs((module, exports)=>{ - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - function _export(target, all) { - for(var name in all)Object.defineProperty(target, name, { - enumerable: true, - get: all[name] +} +export { __commonJs, _interop_require_wildcard }; + + +//index.js: + // module_id: foo.ts +import { __commonJs, _interop_require_wildcard } from "./farm_runtime.js"; +var foo_cjs = __commonJs({ + "foo.ts": (module, exports)=>{ + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true }); - } - _export(exports, { - bar: function() { - return bar; - }, - default: function() { - return _default; - }, - foo: function() { - return foo; + function _export(target, all) { + for(var name in all)Object.defineProperty(target, name, { + enumerable: true, + get: all[name] + }); } - }); - var _default = 'foo'; - const foo = 'foo'; - const bar = 'bar'; - module.exports.cjs = true; + _export(exports, { + bar: function() { + return bar; + }, + default: function() { + return _default; + }, + foo: function() { + return foo; + } + }); + var _default = 'foo'; + const foo = 'foo'; + const bar = 'bar'; + module.exports.cjs = true; + } }); var foo_ns = _interop_require_wildcard(foo_cjs()); +// module_id: index.ts export { foo_ns as ns }; diff --git a/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/output.js b/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/output.js new file mode 100644 index 0000000000..b484195ee7 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/output.js @@ -0,0 +1,20 @@ +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ + + +//index.js: + // module_id: default/reexport.ts +class foo { + constructor(){ + console.log(this.constructor === foo); + } +} +const bar = 'foo'; +var reexport_ns = { + bar: bar, + default: foo, + __esModule: true +}; + +// module_id: default/index.ts +export { bar, foo as default }; diff --git a/crates/compiler/tests/fixtures/bundle/library/external/importNamespace/config.cjs.json b/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/star/config.cjs.json similarity index 100% rename from crates/compiler/tests/fixtures/bundle/library/external/importNamespace/config.cjs.json rename to crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/star/config.cjs.json diff --git a/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/star/output.cjs.js b/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/star/output.cjs.js new file mode 100644 index 0000000000..ca911db808 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/star/output.cjs.js @@ -0,0 +1,107 @@ +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ +function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; + } + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); + } + return module.exports; + }; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function(nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interop_require_wildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) return obj; + if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { + default: obj + }; + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) return cache.get(obj); + var newObj = { + __proto__: null + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for(var key in obj){ + if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); + else newObj[key] = obj[key]; + } + } + newObj.default = obj; + if (cache) cache.set(obj, newObj); + return newObj; +} +function _export_star(from, to) { + Object.keys(from).forEach(function(k) { + if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { + Object.defineProperty(to, k, { + enumerable: true, + get: function() { + return from[k]; + } + }); + } + }); + return from; +} +module.exports.__commonJs = __commonJs; +module.exports._export_star = _export_star; +module.exports._interop_require_wildcard = _interop_require_wildcard; +Object.defineProperty(exports, "__esModule", { + value: true +}); + + +//index.js: + // module_id: foo.ts +var farm_runtime_js_ns = require("./farm_runtime.js"); +var __commonJs = farm_runtime_js_ns.__commonJs, _export_star = farm_runtime_js_ns._export_star, _interop_require_wildcard = farm_runtime_js_ns._interop_require_wildcard; +var foo_cjs = __commonJs({ + "foo.ts": (module, exports)=>{ + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + function _export(target, all) { + for(var name in all)Object.defineProperty(target, name, { + enumerable: true, + get: all[name] + }); + } + _export(exports, { + bar: function() { + return bar; + }, + default: function() { + return _default; + }, + foo: function() { + return foo; + } + }); + var _default = 'foo'; + const foo = 'foo'; + const bar = 'bar'; + module.exports.cjs = true; + } +}); +var foo_ns = _interop_require_wildcard(foo_cjs()); + +// module_id: index.ts +_export_star(foo_cjs(), module.exports); diff --git a/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/star/output.js b/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/star/output.js index f2320e3c3f..ca84b23811 100644 --- a/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/star/output.js +++ b/crates/compiler/tests/fixtures/bundle/library/reexport/reexport_hybrid_cjs/star/output.js @@ -1,92 +1,63 @@ -//index.js: - function _interop_require_default(obj) { +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ +function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; + } + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); + } + return module.exports; + }; +} +function _interop_require_default(obj) { return obj && obj.__esModule ? obj : { default: obj }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { +} +export { __commonJs, _interop_require_default }; + + +//index.js: + // module_id: foo.ts +import { __commonJs, _interop_require_default } from "./farm_runtime.js"; +var foo_cjs = __commonJs({ + "foo.ts": (module, exports)=>{ + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + function _export(target, all) { + for(var name in all)Object.defineProperty(target, name, { enumerable: true, - get: function() { - return from[k]; - } + get: all[name] }); } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}var foo_cjs = __commonJs((module, exports)=>{ - "use strict"; - Object.defineProperty(exports, "__esModule", { - value: true - }); - function _export(target, all) { - for(var name in all)Object.defineProperty(target, name, { - enumerable: true, - get: all[name] + _export(exports, { + bar: function() { + return bar; + }, + default: function() { + return _default; + }, + foo: function() { + return foo; + } }); + var _default = 'foo'; + const foo = 'foo'; + const bar = 'bar'; + module.exports.cjs = true; } - _export(exports, { - bar: function() { - return bar; - }, - default: function() { - return _default; - }, - foo: function() { - return foo; - } - }); - var _default = 'foo'; - const foo = 'foo'; - const bar = 'bar'; - module.exports.cjs = true; }); var foo_default = _interop_require_default(foo_cjs()).default, bar = foo_cjs()["bar"], foo = foo_cjs()["foo"]; -export { bar, foo }; -export default foo_default; +// module_id: index.ts +export { bar, foo, foo_default as default }; diff --git a/crates/compiler/tests/fixtures/bundle/library/reexport/use_external_reexport/index.ts b/crates/compiler/tests/fixtures/bundle/library/reexport/use_external_reexport/index.ts new file mode 100644 index 0000000000..b65de00546 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/library/reexport/use_external_reexport/index.ts @@ -0,0 +1,6 @@ +import r1, { foo, unstable_batchedUpdates as batch } from './reexport'; + +const unstable_batchedUpdates = 123; +console.log({ unstable_batchedUpdates }); + +console.log({ r1, foo, batch }); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/library/reexport/use_external_reexport/output.js b/crates/compiler/tests/fixtures/bundle/library/reexport/use_external_reexport/output.js new file mode 100644 index 0000000000..49c4bb5900 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/library/reexport/use_external_reexport/output.js @@ -0,0 +1,20 @@ +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ + + +//index.js: + // module_id: reexport.ts +import { foo } from "foo"; +import { readFile } from "node:fs"; +import { unstable_batchedUpdates } from "react-dom"; + +// module_id: index.ts +const unstable_batchedUpdates$1 = 123; +console.log({ + unstable_batchedUpdates: unstable_batchedUpdates$1 +}); +console.log({ + r1: readFile, + foo: foo, + batch: unstable_batchedUpdates +}); diff --git a/crates/compiler/tests/fixtures/bundle/library/reexport/use_external_reexport/reexport.ts b/crates/compiler/tests/fixtures/bundle/library/reexport/use_external_reexport/reexport.ts new file mode 100644 index 0000000000..44f74ada83 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/library/reexport/use_external_reexport/reexport.ts @@ -0,0 +1,5 @@ +// @ts-nocheck +export { readFile as default } from 'node:fs'; +export { foo } from 'foo'; + +export { unstable_batchedUpdates } from 'react-dom'; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/multiple_bundle/lodash_export/bundle2.ts b/crates/compiler/tests/fixtures/bundle/multiple_bundle/lodash_export/bundle2.ts new file mode 100644 index 0000000000..1ae84b9330 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/lodash_export/bundle2.ts @@ -0,0 +1,9 @@ +// @ts-nocheck + +function lodash() {} + +lodash.merge = function() {} + +const _ = lodash; + +(module.exports = _)._ = _; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/library/external/importNamespace/config.json b/crates/compiler/tests/fixtures/bundle/multiple_bundle/lodash_export/config.cjs.json similarity index 72% rename from crates/compiler/tests/fixtures/bundle/library/external/importNamespace/config.json rename to crates/compiler/tests/fixtures/bundle/multiple_bundle/lodash_export/config.cjs.json index eb309261d4..932c1085fb 100644 --- a/crates/compiler/tests/fixtures/bundle/library/external/importNamespace/config.json +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/lodash_export/config.cjs.json @@ -1,6 +1,6 @@ { "output": { "targetEnv": "library-node", - "format": "esm" + "format": "cjs" } } \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/multiple_bundle/lodash_export/index.ts b/crates/compiler/tests/fixtures/bundle/multiple_bundle/lodash_export/index.ts new file mode 100644 index 0000000000..d7441d779b --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/lodash_export/index.ts @@ -0,0 +1,3 @@ +import lodash, { merge } from './bundle2'; + +console.log(lodash, merge); diff --git a/crates/compiler/tests/fixtures/bundle/multiple_bundle/lodash_export/output.cjs.js b/crates/compiler/tests/fixtures/bundle/multiple_bundle/lodash_export/output.cjs.js new file mode 100644 index 0000000000..387e516892 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/lodash_export/output.cjs.js @@ -0,0 +1,54 @@ +//bundle1.js: + // module_id: bundle2.ts +var farm_runtime_js_ns = require("./farm_runtime.js"); +var __commonJs = farm_runtime_js_ns.__commonJs; +var bundle2_cjs = __commonJs({ + "bundle2.ts": (module, exports)=>{ + function lodash() {} + lodash.merge = function() {}; + const _ = lodash; + (module.exports = _)._ = _; + } +}); +module.exports.bundle2_cjs = bundle2_cjs; + + +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ +function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; + } + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); + } + return module.exports; + }; +} +function _interop_require_default(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} +module.exports.__commonJs = __commonJs; +module.exports._interop_require_default = _interop_require_default; +Object.defineProperty(exports, "__esModule", { + value: true +}); + + +//index.js: + // module_id: index.ts +var farm_runtime_js_ns = require("./farm_runtime.js"); +var _interop_require_default = farm_runtime_js_ns._interop_require_default; +var bundle1_js_ns = require("./bundle1.js"); +var bundle2_cjs = bundle1_js_ns.bundle2_cjs; +var lodash = _interop_require_default(bundle2_cjs()).default, merge = bundle2_cjs()["merge"]; +console.log(lodash, merge); diff --git a/crates/compiler/tests/fixtures/bundle/multiple_bundle/lodash_export/output.js b/crates/compiler/tests/fixtures/bundle/multiple_bundle/lodash_export/output.js new file mode 100644 index 0000000000..9f67ed91ca --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/lodash_export/output.js @@ -0,0 +1,47 @@ +//bundle1.js: + // module_id: bundle2.ts +import { __commonJs } from "./farm_runtime.js"; +var bundle2_cjs = __commonJs({ + "bundle2.ts": (module, exports)=>{ + function lodash() {} + lodash.merge = function() {}; + const _ = lodash; + (module.exports = _)._ = _; + } +}); +export { bundle2_cjs }; + + +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ +function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; + } + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); + } + return module.exports; + }; +} +function _interop_require_default(obj) { + return obj && obj.__esModule ? obj : { + default: obj + }; +} +export { __commonJs, _interop_require_default }; + + +//index.js: + // module_id: index.ts +import { _interop_require_default } from "./farm_runtime.js"; +import { bundle2_cjs } from "./bundle1.js"; +var lodash = _interop_require_default(bundle2_cjs()).default, merge = bundle2_cjs()["merge"]; +console.log(lodash, merge); diff --git a/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/cross_bundle/namespace/bundle2.ts b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/cross_bundle/namespace/bundle2.ts new file mode 100644 index 0000000000..c96c4108f3 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/cross_bundle/namespace/bundle2.ts @@ -0,0 +1,2 @@ +export * as ns from './namespace'; +export { default } from './default'; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/cross_bundle/namespace/config.cjs.json b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/cross_bundle/namespace/config.cjs.json new file mode 100644 index 0000000000..a54e6cace5 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/cross_bundle/namespace/config.cjs.json @@ -0,0 +1,5 @@ +{ + "output": { + "format": "cjs" + } +} \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/cross_bundle/namespace/default.ts b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/cross_bundle/namespace/default.ts new file mode 100644 index 0000000000..517359f06a --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/cross_bundle/namespace/default.ts @@ -0,0 +1,3 @@ +const d = 'default'; + +export default d; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/cross_bundle/namespace/index.ts b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/cross_bundle/namespace/index.ts new file mode 100644 index 0000000000..80a6223b54 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/cross_bundle/namespace/index.ts @@ -0,0 +1,3 @@ +import bundle2, { ns } from './bundle2'; + +console.log({ ns, bundle2 }); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/cross_bundle/namespace/namespace.ts b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/cross_bundle/namespace/namespace.ts new file mode 100644 index 0000000000..3bf7f28e5f --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/cross_bundle/namespace/namespace.ts @@ -0,0 +1,4 @@ +export const ns_named = 'ns named'; +export const ns_default = 'ns default'; + +module.exports.name = '123'; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/cross_bundle/namespace/output.cjs.js b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/cross_bundle/namespace/output.cjs.js new file mode 100644 index 0000000000..bd25a37139 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/cross_bundle/namespace/output.cjs.js @@ -0,0 +1,118 @@ +//bundle1.js: + // module_id: bundle2.ts +var farm_runtime_js_ns = require("./farm_runtime.js"); +var _interop_require_wildcard = farm_runtime_js_ns._interop_require_wildcard; +var index_1175_ns = require("./index.js"); +var d = index_1175_ns.d, namespace_cjs = index_1175_ns.namespace_cjs; +var ns = _interop_require_wildcard(namespace_cjs()); +module.exports.d = d; +module.exports.ns = ns; +Object.defineProperty(exports, "__esModule", { + value: true +}); + + +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ +function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; + } + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); + } + return module.exports; + }; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function(nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interop_require_wildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) return obj; + if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { + default: obj + }; + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) return cache.get(obj); + var newObj = { + __proto__: null + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for(var key in obj){ + if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); + else newObj[key] = obj[key]; + } + } + newObj.default = obj; + if (cache) cache.set(obj, newObj); + return newObj; +} +module.exports.__commonJs = __commonJs; +module.exports._interop_require_wildcard = _interop_require_wildcard; +Object.defineProperty(exports, "__esModule", { + value: true +}); + + +//index.js: + // module_id: namespace.ts +var farm_runtime_js_ns = require("./farm_runtime.js"); +var __commonJs = farm_runtime_js_ns.__commonJs; +var bundle1_js_ns = require("./bundle1.js"); +var ns = bundle1_js_ns.ns; +var namespace_cjs = __commonJs({ + "namespace.ts": (module, exports)=>{ + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + function _export(target, all) { + for(var name in all)Object.defineProperty(target, name, { + enumerable: true, + get: all[name] + }); + } + _export(exports, { + ns_default: function() { + return ns_default; + }, + ns_named: function() { + return ns_named; + } + }); + const ns_named = 'ns named'; + const ns_default = 'ns default'; + module.exports.name = '123'; + } +}); +var ns_default = namespace_cjs()["ns_default"], ns_named = namespace_cjs()["ns_named"]; + +// module_id: default.ts +const d = 'default'; + +// module_id: index.ts +console.log({ + ns: ns, + bundle2: d +}); +module.exports.d = d; +module.exports.namespace_cjs = namespace_cjs; +module.exports.ns_default = ns_default; +module.exports.ns_named = ns_named; +Object.defineProperty(exports, "__esModule", { + value: true +}); diff --git a/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/cross_bundle/namespace/output.js b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/cross_bundle/namespace/output.js new file mode 100644 index 0000000000..11bc8ca0c4 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/cross_bundle/namespace/output.js @@ -0,0 +1,100 @@ +//bundle1.js: + // module_id: bundle2.ts +import { _interop_require_wildcard } from "./farm_runtime.js"; +import { d, namespace_cjs } from "./index.js"; +var ns = _interop_require_wildcard(namespace_cjs()); +export { d, ns }; + + +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ +function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; + } + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); + } + return module.exports; + }; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function(nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interop_require_wildcard(obj, nodeInterop) { + if (!nodeInterop && obj && obj.__esModule) return obj; + if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { + default: obj + }; + var cache = _getRequireWildcardCache(nodeInterop); + if (cache && cache.has(obj)) return cache.get(obj); + var newObj = { + __proto__: null + }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + for(var key in obj){ + if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); + else newObj[key] = obj[key]; + } + } + newObj.default = obj; + if (cache) cache.set(obj, newObj); + return newObj; +} +export { __commonJs, _interop_require_wildcard }; + + +//index.js: + // module_id: namespace.ts +import { __commonJs } from "./farm_runtime.js"; +import { ns } from "./bundle1.js"; +var namespace_cjs = __commonJs({ + "namespace.ts": (module, exports)=>{ + "use strict"; + Object.defineProperty(exports, "__esModule", { + value: true + }); + function _export(target, all) { + for(var name in all)Object.defineProperty(target, name, { + enumerable: true, + get: all[name] + }); + } + _export(exports, { + ns_default: function() { + return ns_default; + }, + ns_named: function() { + return ns_named; + } + }); + const ns_named = 'ns named'; + const ns_default = 'ns default'; + module.exports.name = '123'; + } +}); +var ns_default = namespace_cjs()["ns_default"], ns_named = namespace_cjs()["ns_named"]; + +// module_id: default.ts +const d = 'default'; + +// module_id: index.ts +console.log({ + ns: ns, + bundle2: d +}); +export { d, namespace_cjs, ns_default, ns_named }; diff --git a/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/entry_export/bundle2.ts b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/entry_export/bundle2.ts new file mode 100644 index 0000000000..3291b0ab20 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/entry_export/bundle2.ts @@ -0,0 +1,2 @@ +export const named = 'bundle2 named'; +export default 'bundle2 default' \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/entry_export/index.ts b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/entry_export/index.ts new file mode 100644 index 0000000000..b4dd6e9efc --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/entry_export/index.ts @@ -0,0 +1,4 @@ +export { named, default } from './bundle2'; + +// TODO: fix it +// export * as ns from './bundle2'; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/entry_export/output.js b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/entry_export/output.js new file mode 100644 index 0000000000..f630c8a370 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/entry_export/output.js @@ -0,0 +1,15 @@ +//bundle1.js: + // module_id: bundle2.ts +const named = 'bundle2 named'; +var bundle2_default = 'bundle2 default'; +export { bundle2_default, named }; + + +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ + + +//index.js: + // module_id: index.ts +import { bundle2_default, named } from "./bundle1.js"; +export { bundle2_default as default, named }; diff --git a/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/namespace/bundle2.ts b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/namespace/bundle2.ts new file mode 100644 index 0000000000..5d870bd6ae --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/namespace/bundle2.ts @@ -0,0 +1 @@ +export * as ns from './bundle2_namespace'; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/namespace/bundle2_namespace.ts b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/namespace/bundle2_namespace.ts new file mode 100644 index 0000000000..4e6fb12068 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/namespace/bundle2_namespace.ts @@ -0,0 +1,2 @@ +export const ns_named = 'ns named'; +export const ns_default = 'ns default'; diff --git a/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/namespace/index.ts b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/namespace/index.ts new file mode 100644 index 0000000000..01711ceb8d --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/namespace/index.ts @@ -0,0 +1,3 @@ +import { ns } from './bundle2'; + +console.log({ ns }); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/namespace/output.js b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/namespace/output.js new file mode 100644 index 0000000000..16c9eee9c4 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/namespace/output.js @@ -0,0 +1,24 @@ +//bundle1.js: + // module_id: bundle2_namespace.ts +const ns_named = 'ns named'; +const ns_default = 'ns default'; +var bundle2_namespace_ns = { + ns_default: ns_default, + ns_named: ns_named, + __esModule: true +}; + +// module_id: bundle2.ts +export { bundle2_namespace_ns }; + + +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ + + +//index.js: + // module_id: index.ts +import { bundle2_namespace_ns } from "./bundle1.js"; +console.log({ + ns: bundle2_namespace_ns +}); diff --git a/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle/bundle2-foo.ts b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle/bundle2-foo.ts new file mode 100644 index 0000000000..d1c6b14bbd --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle/bundle2-foo.ts @@ -0,0 +1,5 @@ +const bundle_str1 = 'bundle2 str1'; + +console.log(bundle_str1); + +export default 'bundle2 foo'; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle/bundle2.ts b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle/bundle2.ts new file mode 100644 index 0000000000..822733fdf8 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle/bundle2.ts @@ -0,0 +1,7 @@ +import { foo_str1, foo_str2 } from './foo'; +import './bundle2-foo'; + +console.log({ foo_str1, foo_str2 }); + +export const bundle_str1 = 'bundle str1'; +export const bundle_str2 = 'bundle str2'; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle/foo.ts b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle/foo.ts new file mode 100644 index 0000000000..2d6a02f3fa --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle/foo.ts @@ -0,0 +1,11 @@ + +export const foo_str1 = 'foo str1'; +export const foo_str2 = 'foo str2'; + +const foo_str3 = 'foo str3'; + +const index_foo = 234; + +console.log(foo_str1, index_foo, foo_str3); + +export default 'foo default'; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle/index.ts b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle/index.ts new file mode 100644 index 0000000000..45cf5fffbd --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle/index.ts @@ -0,0 +1,14 @@ +import { bundle_str1 } from './bundle2'; + +console.log(bundle_str1); + +export const index_foo = 'index foo'; +export const index_bar = 'index bar'; + +const foo_str1 = 123; +const foo_str3 = 'index-foo_str3'; +console.log(foo_str1, foo_str3); + +export default 'index default'; + +// export * from './bundle2'; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle/output.js b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle/output.js new file mode 100644 index 0000000000..13cc90bba4 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle/output.js @@ -0,0 +1,41 @@ +//bundle1.js: + // module_id: bundle2-foo.ts +import { foo_str1, foo_str2 } from "./index.js"; +const bundle_str1 = 'bundle2 str1'; +console.log(bundle_str1); +var bundle2_foo_default = 'bundle2 foo'; + +// module_id: bundle2.ts +console.log({ + foo_str1: foo_str1, + foo_str2: foo_str2 +}); +const bundle_str1$1 = 'bundle str1'; +const bundle_str2 = 'bundle str2'; +export { bundle_str1$1, bundle_str2 }; + + +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ + + +//index.js: + // module_id: foo.ts +import { bundle_str1$1 } from "./bundle1.js"; +const foo_str1 = 'foo str1'; +const foo_str2 = 'foo str2'; +const foo_str3 = 'foo str3'; +const index_foo = 234; +console.log(foo_str1, index_foo, foo_str3); +var foo_default = 'foo default'; + +// module_id: index.ts +console.log(bundle_str1$1); +const index_foo$1 = 'index foo'; +const index_bar = 'index bar'; +const foo_str1$1 = 123; +const foo_str3$1 = 'index-foo_str3'; +console.log(foo_str1$1, foo_str3$1); +var index_default = 'index default'; +export { index_bar, index_foo$1 as index_foo, index_default as default }; +export { foo_default, foo_str1, foo_str2 }; diff --git a/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle_1/bundle2.ts b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle_1/bundle2.ts new file mode 100644 index 0000000000..5afe391621 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle_1/bundle2.ts @@ -0,0 +1,7 @@ +import bundle2_default from './default'; +import * as bundle2_namespace from './namespace'; +import { foo_named as bundle2_named } from './named'; + +console.log({ bundle2_default, bundle2_namespace, bundle2_named }); + +export { bundle2_default, bundle2_namespace, bundle2_named } \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle_1/config.cjs.json b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle_1/config.cjs.json new file mode 100644 index 0000000000..a54e6cace5 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle_1/config.cjs.json @@ -0,0 +1,5 @@ +{ + "output": { + "format": "cjs" + } +} \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle_1/default.ts b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle_1/default.ts new file mode 100644 index 0000000000..7df88d7283 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle_1/default.ts @@ -0,0 +1 @@ +export default '123'; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle_1/index.ts b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle_1/index.ts new file mode 100644 index 0000000000..94a8d33ca5 --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle_1/index.ts @@ -0,0 +1,5 @@ +import { bundle2_default, bundle2_named, bundle2_namespace } from './bundle2'; + +console.log(bundle2_default, bundle2_named, bundle2_namespace); + +export default 'index'; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle_1/named.ts b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle_1/named.ts new file mode 100644 index 0000000000..911b22928a --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle_1/named.ts @@ -0,0 +1 @@ +export const foo_named = '123'; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle_1/namespace.ts b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle_1/namespace.ts new file mode 100644 index 0000000000..d7a5dde9be --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle_1/namespace.ts @@ -0,0 +1,2 @@ +export const foo_ns = 'ns_foo'; +export default 'ns_default'; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle_1/output.cjs.js b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle_1/output.cjs.js new file mode 100644 index 0000000000..aba014a29b --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle_1/output.cjs.js @@ -0,0 +1,49 @@ +//bundle1.js: + // module_id: bundle2.ts +var index_c86a_ns = require("./index.js"); +var default_default$1 = index_c86a_ns.default_default$1, foo_named = index_c86a_ns.foo_named, namespace_ns = index_c86a_ns.namespace_ns; +console.log({ + bundle2_default: default_default$1, + bundle2_namespace: namespace_ns, + bundle2_named: foo_named +}); +module.exports.default_default$1 = default_default$1; +module.exports.foo_named = foo_named; +module.exports.namespace_ns = namespace_ns; +Object.defineProperty(exports, "__esModule", { + value: true +}); + + +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ + + +//index.js: + // module_id: default.ts +var default_default$1 = '123'; + +// module_id: namespace.ts +const foo_ns = 'ns_foo'; +var namespace_default = 'ns_default'; +var namespace_ns = { + foo_ns: foo_ns, + "default": namespace_default, + __esModule: true +}; + +// module_id: named.ts +const foo_named = '123'; + +// module_id: index.ts +console.log(default_default$1, foo_named, namespace_ns); +var index_default = 'index'; +module.exports.default = index_default; +Object.defineProperty(exports, "__esModule", { + value: true +}); +module.exports.default_default$1 = default_default$1; +module.exports.foo_named = foo_named; +module.exports.foo_ns = foo_ns; +module.exports.namespace_default = namespace_default; +module.exports.namespace_ns = namespace_ns; diff --git a/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle_1/output.js b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle_1/output.js new file mode 100644 index 0000000000..117f69defd --- /dev/null +++ b/crates/compiler/tests/fixtures/bundle/multiple_bundle/reexport/reexport_cross_bundle_1/output.js @@ -0,0 +1,36 @@ +//bundle1.js: + // module_id: bundle2.ts +import { default_default$1, foo_named, namespace_ns } from "./index.js"; +console.log({ + bundle2_default: default_default$1, + bundle2_namespace: namespace_ns, + bundle2_named: foo_named +}); +export { default_default$1, foo_named, namespace_ns }; + + +//farm_runtime.js: + // module_id: __FARM_BUNDLE_POLYFILL_SLOT__ + + +//index.js: + // module_id: default.ts +var default_default$1 = '123'; + +// module_id: namespace.ts +const foo_ns = 'ns_foo'; +var namespace_default = 'ns_default'; +var namespace_ns = { + foo_ns: foo_ns, + "default": namespace_default, + __esModule: true +}; + +// module_id: named.ts +const foo_named = '123'; + +// module_id: index.ts +console.log(default_default$1, foo_named, namespace_ns); +var index_default = 'index'; +export { index_default as default }; +export { default_default$1, foo_named, foo_ns, namespace_default, namespace_ns }; diff --git a/crates/compiler/tests/fixtures/css/modules/composes/external_import/output.js b/crates/compiler/tests/fixtures/css/modules/composes/external_import/output.js index d18e06667e..d73584c96e 100644 --- a/crates/compiler/tests/fixtures/css/modules/composes/external_import/output.js +++ b/crates/compiler/tests/fixtures/css/modules/composes/external_import/output.js @@ -1,65 +1,22 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};;((function(){function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ +} +var index_js_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('runtime/index.js'); window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/css/modules/composes/global_import/output.js b/crates/compiler/tests/fixtures/css/modules/composes/global_import/output.js index b4fba74eff..6f9bcd26b8 100644 --- a/crates/compiler/tests/fixtures/css/modules/composes/global_import/output.js +++ b/crates/compiler/tests/fixtures/css/modules/composes/global_import/output.js @@ -1,65 +1,22 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};;((function(){function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ +} +var index_js_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('runtime/index.js'); window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/css/modules/composes/local_import/output.js b/crates/compiler/tests/fixtures/css/modules/composes/local_import/output.js index cdbcc4dc5b..255d959d7c 100644 --- a/crates/compiler/tests/fixtures/css/modules/composes/local_import/output.js +++ b/crates/compiler/tests/fixtures/css/modules/composes/local_import/output.js @@ -1,65 +1,22 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};;((function(){function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ +} +var index_js_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('runtime/index.js'); window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/css/modules/global/output.js b/crates/compiler/tests/fixtures/css/modules/global/output.js index 769e291b9b..3f9b888a40 100644 --- a/crates/compiler/tests/fixtures/css/modules/global/output.js +++ b/crates/compiler/tests/fixtures/css/modules/global/output.js @@ -1,65 +1,22 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};;((function(){function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ +} +var index_js_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('runtime/index.js'); window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/css/modules/local/output.js b/crates/compiler/tests/fixtures/css/modules/local/output.js index 217242e3b4..3b12127de3 100644 --- a/crates/compiler/tests/fixtures/css/modules/local/output.js +++ b/crates/compiler/tests/fixtures/css/modules/local/output.js @@ -1,65 +1,22 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};;((function(){function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ +} +var index_js_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('runtime/index.js'); window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/css/modules/normal/output.js b/crates/compiler/tests/fixtures/css/modules/normal/output.js index 22e259fdc1..c5934b8f09 100644 --- a/crates/compiler/tests/fixtures/css/modules/normal/output.js +++ b/crates/compiler/tests/fixtures/css/modules/normal/output.js @@ -1,65 +1,22 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};;((function(){function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ +} +var index_js_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('runtime/index.js'); window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/css/prefixer/normal/output.js b/crates/compiler/tests/fixtures/css/prefixer/normal/output.js index ae831aa220..77a3f398ba 100644 --- a/crates/compiler/tests/fixtures/css/prefixer/normal/output.js +++ b/crates/compiler/tests/fixtures/css/prefixer/normal/output.js @@ -1,65 +1,22 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};;((function(){function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ +} +var index_js_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('runtime/index.js'); window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/css/url_replacer/absolute/output.js b/crates/compiler/tests/fixtures/css/url_replacer/absolute/output.js index 4bdbac715a..a3cf5927e0 100644 --- a/crates/compiler/tests/fixtures/css/url_replacer/absolute/output.js +++ b/crates/compiler/tests/fixtures/css/url_replacer/absolute/output.js @@ -1,65 +1,22 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};;((function(){function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ +} +var index_js_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('runtime/index.js'); window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/css/url_replacer/ignored/output.js b/crates/compiler/tests/fixtures/css/url_replacer/ignored/output.js index 2b6d8f8d3e..7cc7c39d1f 100644 --- a/crates/compiler/tests/fixtures/css/url_replacer/ignored/output.js +++ b/crates/compiler/tests/fixtures/css/url_replacer/ignored/output.js @@ -1,65 +1,22 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};;((function(){function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ +} +var index_js_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('runtime/index.js'); window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/external/browser/normal/cjs/output.js b/crates/compiler/tests/fixtures/external/browser/normal/cjs/output.js index 9f1bb24fa7..0f678e449a 100644 --- a/crates/compiler/tests/fixtures/external/browser/normal/cjs/output.js +++ b/crates/compiler/tests/fixtures/external/browser/normal/cjs/output.js @@ -1,65 +1,22 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};;((function(){function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ +} +var index_js_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('runtime/index.js'); window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/external/browser/normal/esm/output.js b/crates/compiler/tests/fixtures/external/browser/normal/esm/output.js index f416e942cc..44e191eae9 100644 --- a/crates/compiler/tests/fixtures/external/browser/normal/esm/output.js +++ b/crates/compiler/tests/fixtures/external/browser/normal/esm/output.js @@ -1,65 +1,22 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};;((function(){function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ +} +var index_js_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('runtime/index.js'); window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/external/browser/object/cjs/output.js b/crates/compiler/tests/fixtures/external/browser/object/cjs/output.js index 6446dc365c..161ab6ef46 100644 --- a/crates/compiler/tests/fixtures/external/browser/object/cjs/output.js +++ b/crates/compiler/tests/fixtures/external/browser/object/cjs/output.js @@ -1,65 +1,22 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};;((function(){function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ +} +var index_js_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('runtime/index.js'); window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/external/browser/object/esm/output.js b/crates/compiler/tests/fixtures/external/browser/object/esm/output.js index a1b2cfdea1..5bb6f114bf 100644 --- a/crates/compiler/tests/fixtures/external/browser/object/esm/output.js +++ b/crates/compiler/tests/fixtures/external/browser/object/esm/output.js @@ -1,65 +1,22 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};;((function(){function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ +} +var index_js_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('runtime/index.js'); window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/external/node/hosting/import/output.js b/crates/compiler/tests/fixtures/external/node/hosting/import/output.js index 684c67f249..45db8c3817 100644 --- a/crates/compiler/tests/fixtures/external/node/hosting/import/output.js +++ b/crates/compiler/tests/fixtures/external/node/hosting/import/output.js @@ -1,65 +1,22 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}var index_js_cjs = __commonJs((module, exports)=>{ +} +var index_js_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('runtime/index.js'); global['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/external/node/hosting/require/output.js b/crates/compiler/tests/fixtures/external/node/hosting/require/output.js index b166c6bd51..74e0daf61d 100644 --- a/crates/compiler/tests/fixtures/external/node/hosting/require/output.js +++ b/crates/compiler/tests/fixtures/external/node/hosting/require/output.js @@ -1,65 +1,22 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}var index_js_cjs = __commonJs((module, exports)=>{ +} +var index_js_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('runtime/index.js'); global['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/external/node/normala/cjs/output.js b/crates/compiler/tests/fixtures/external/node/normala/cjs/output.js index 100146c4f2..9bd80e4147 100644 --- a/crates/compiler/tests/fixtures/external/node/normala/cjs/output.js +++ b/crates/compiler/tests/fixtures/external/node/normala/cjs/output.js @@ -1,65 +1,22 @@ //index.js: - global.nodeRequire = require;global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + global.nodeRequire = require;global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}var index_js_cjs = __commonJs((module, exports)=>{ +} +var index_js_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('runtime/index.js'); global['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/external/node/normala/esm/output.js b/crates/compiler/tests/fixtures/external/node/normala/esm/output.js index 6582219e7b..1de55d7f6d 100644 --- a/crates/compiler/tests/fixtures/external/node/normala/esm/output.js +++ b/crates/compiler/tests/fixtures/external/node/normala/esm/output.js @@ -1,65 +1,22 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}var index_js_cjs = __commonJs((module, exports)=>{ +} +var index_js_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('runtime/index.js'); global['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/library/external/import-named/index.ts b/crates/compiler/tests/fixtures/library/external/import-named/index.ts new file mode 100644 index 0000000000..1492523a80 --- /dev/null +++ b/crates/compiler/tests/fixtures/library/external/import-named/index.ts @@ -0,0 +1,7 @@ +import { readFile as r1, readFileSync as r2 } from 'node:fs'; + + +const readFile = 1; +const readFileSync = 2; + +console.log({ readFile, readFileSync, r1, r2 }); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/library/external/import-named/output.js b/crates/compiler/tests/fixtures/library/external/import-named/output.js new file mode 100644 index 0000000000..ae6c4e448e --- /dev/null +++ b/crates/compiler/tests/fixtures/library/external/import-named/output.js @@ -0,0 +1,10 @@ +//index.js: + import { readFile as r1, readFileSync as r2 } from 'node:fs'; +const readFile = 1; +const readFileSync = 2; +console.log({ + readFile, + readFileSync, + r1, + r2 +}); diff --git a/crates/compiler/tests/fixtures/bundle/library/external/importNamespace/a.ts b/crates/compiler/tests/fixtures/library/external/import-namespace/a.ts similarity index 100% rename from crates/compiler/tests/fixtures/bundle/library/external/importNamespace/a.ts rename to crates/compiler/tests/fixtures/library/external/import-namespace/a.ts diff --git a/crates/compiler/tests/fixtures/bundle/library/external/importNamespace/b.ts b/crates/compiler/tests/fixtures/library/external/import-namespace/b.ts similarity index 100% rename from crates/compiler/tests/fixtures/bundle/library/external/importNamespace/b.ts rename to crates/compiler/tests/fixtures/library/external/import-namespace/b.ts diff --git a/crates/compiler/tests/fixtures/library/external/import-namespace/config.cjs.json b/crates/compiler/tests/fixtures/library/external/import-namespace/config.cjs.json new file mode 100644 index 0000000000..ecaa704e73 --- /dev/null +++ b/crates/compiler/tests/fixtures/library/external/import-namespace/config.cjs.json @@ -0,0 +1,6 @@ +{ + "output": { + "targetEnv": "library", + "format": "cjs" + } +} \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/library/external/import-namespace/config.json b/crates/compiler/tests/fixtures/library/external/import-namespace/config.json new file mode 100644 index 0000000000..076c8401de --- /dev/null +++ b/crates/compiler/tests/fixtures/library/external/import-namespace/config.json @@ -0,0 +1,6 @@ +{ + "output": { + "targetEnv": "library", + "format": "esm" + } +} \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/library/external/importNamespace/index.ts b/crates/compiler/tests/fixtures/library/external/import-namespace/index.ts similarity index 100% rename from crates/compiler/tests/fixtures/bundle/library/external/importNamespace/index.ts rename to crates/compiler/tests/fixtures/library/external/import-namespace/index.ts diff --git a/crates/compiler/tests/fixtures/library/external/import-namespace/output.cjs.js b/crates/compiler/tests/fixtures/library/external/import-namespace/output.cjs.js new file mode 100644 index 0000000000..3b478f6d61 --- /dev/null +++ b/crates/compiler/tests/fixtures/library/external/import-namespace/output.cjs.js @@ -0,0 +1,8 @@ +//index.js: + import fs$2 from 'node:fs'; +import * as fs$1 from 'node:fs'; +const fs = 'a.ts'; +console.log(fs); +var a_ts_default = 'a.ts'; +console.log('b.ts', fs$1); +console.log('index.ts', fs$2); diff --git a/crates/compiler/tests/fixtures/library/external/import-namespace/output.js b/crates/compiler/tests/fixtures/library/external/import-namespace/output.js new file mode 100644 index 0000000000..3b478f6d61 --- /dev/null +++ b/crates/compiler/tests/fixtures/library/external/import-namespace/output.js @@ -0,0 +1,8 @@ +//index.js: + import fs$2 from 'node:fs'; +import * as fs$1 from 'node:fs'; +const fs = 'a.ts'; +console.log(fs); +var a_ts_default = 'a.ts'; +console.log('b.ts', fs$1); +console.log('index.ts', fs$2); diff --git a/crates/compiler/tests/fixtures/library/ident-conflicts/global-variable/config.json b/crates/compiler/tests/fixtures/library/ident-conflicts/global-variable/config.json new file mode 100644 index 0000000000..ad27114293 --- /dev/null +++ b/crates/compiler/tests/fixtures/library/ident-conflicts/global-variable/config.json @@ -0,0 +1,5 @@ +{ + "output": { + "targetEnv": "library" + } +} \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/bundle/library/global_variable/index.ts b/crates/compiler/tests/fixtures/library/ident-conflicts/global-variable/index.ts similarity index 100% rename from crates/compiler/tests/fixtures/bundle/library/global_variable/index.ts rename to crates/compiler/tests/fixtures/library/ident-conflicts/global-variable/index.ts diff --git a/crates/compiler/tests/fixtures/library/ident-conflicts/global-variable/output.js b/crates/compiler/tests/fixtures/library/ident-conflicts/global-variable/output.js new file mode 100644 index 0000000000..b233445c65 --- /dev/null +++ b/crates/compiler/tests/fixtures/library/ident-conflicts/global-variable/output.js @@ -0,0 +1,6 @@ +//index.js: + var reexport_ts_default = hello; +console.log(hello); +console.log(reexport_ts_default); +const hello$1 = 123; +console.log(hello$1); diff --git a/crates/compiler/tests/fixtures/bundle/library/global_variable/reexport.ts b/crates/compiler/tests/fixtures/library/ident-conflicts/global-variable/reexport.ts similarity index 100% rename from crates/compiler/tests/fixtures/bundle/library/global_variable/reexport.ts rename to crates/compiler/tests/fixtures/library/ident-conflicts/global-variable/reexport.ts diff --git a/crates/compiler/tests/fixtures/library/reexport/basic/a.js b/crates/compiler/tests/fixtures/library/reexport/basic/a.js new file mode 100644 index 0000000000..a1e3403531 --- /dev/null +++ b/crates/compiler/tests/fixtures/library/reexport/basic/a.js @@ -0,0 +1,6 @@ +// a.js +export * from "./b.js"; +export { bar } from "./c.js"; +export { default as baz } from "./d.js"; +export * as ns from "./e.js"; +export * from "./f.js"; diff --git a/crates/compiler/tests/fixtures/library/reexport/basic/b.js b/crates/compiler/tests/fixtures/library/reexport/basic/b.js new file mode 100644 index 0000000000..ee913fe862 --- /dev/null +++ b/crates/compiler/tests/fixtures/library/reexport/basic/b.js @@ -0,0 +1,4 @@ +// b.js +export * as a from "./a.js"; +export * from "./a.js"; +export var foo = "foo" + 1; diff --git a/crates/compiler/tests/fixtures/library/reexport/basic/c.js b/crates/compiler/tests/fixtures/library/reexport/basic/c.js new file mode 100644 index 0000000000..556372c2f1 --- /dev/null +++ b/crates/compiler/tests/fixtures/library/reexport/basic/c.js @@ -0,0 +1,3 @@ +// c.js +export * as d from "./d.js"; +export var bar = "bar" + 2; diff --git a/crates/compiler/tests/fixtures/library/reexport/basic/d.js b/crates/compiler/tests/fixtures/library/reexport/basic/d.js new file mode 100644 index 0000000000..252716eb2a --- /dev/null +++ b/crates/compiler/tests/fixtures/library/reexport/basic/d.js @@ -0,0 +1,3 @@ +// d.js +export * from "./e.js"; +export default 3; diff --git a/crates/compiler/tests/fixtures/library/reexport/basic/e.js b/crates/compiler/tests/fixtures/library/reexport/basic/e.js new file mode 100644 index 0000000000..07edecbc81 --- /dev/null +++ b/crates/compiler/tests/fixtures/library/reexport/basic/e.js @@ -0,0 +1,5 @@ +// e.js +export var e = 4; +export default function () { + console.log("e" + e); +} diff --git a/crates/compiler/tests/fixtures/library/reexport/basic/f.js b/crates/compiler/tests/fixtures/library/reexport/basic/f.js new file mode 100644 index 0000000000..c7da2a6b7e --- /dev/null +++ b/crates/compiler/tests/fixtures/library/reexport/basic/f.js @@ -0,0 +1,5 @@ +// f.js +var f = 5; +var f_local = "f"; +var f_d = "f_d"; +export { f, f_local as f_renamed, f_d as default }; diff --git a/crates/compiler/tests/fixtures/library/reexport/basic/index.ts b/crates/compiler/tests/fixtures/library/reexport/basic/index.ts new file mode 100644 index 0000000000..ae3de46c68 --- /dev/null +++ b/crates/compiler/tests/fixtures/library/reexport/basic/index.ts @@ -0,0 +1,30 @@ +/// ``` +/// The output should be: +/// ```js +/// // exports of a.js +/// { foo: 1, bar: 2, baz: 3, ns: e_ns, f: 5 } +/// +/// // exports of b.js +/// { a: a_ns, foo: 1, bar: 2, baz: 3, ns: e_ns, f: 5, default: 'f_d' } +/// +/// // exports of c.js +/// { d: d_ns, bar: 2 } +/// +/// // exports of d.js +/// { e: 4, default: 3 } +/// +/// // exports of e.js +/// { e: 4, default: function() { console.log('e'); } } +/// +/// // exports of f.js +/// { f: 5, default: 'f_d' } +/// ``` + +import * as a from "./a.js"; +import * as b from "./b.js"; + +console.log(Object.entries(a), Object.entries(b)); + +export { a, b } + +export * from './a.js'; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/library/reexport/basic/output.js b/crates/compiler/tests/fixtures/library/reexport/basic/output.js new file mode 100644 index 0000000000..28581c0c99 --- /dev/null +++ b/crates/compiler/tests/fixtures/library/reexport/basic/output.js @@ -0,0 +1,72 @@ +//index.js: + var foo = "foo" + 1; +var b_js_namespace_farm_internal_ = { + get "a" () { + return a_js_namespace_farm_internal_; + }, + get "bar" () { + return bar; + }, + get "baz" () { + return d_js_default; + }, + get "f" () { + return f; + }, + get "f_renamed" () { + return f_local; + }, + get "foo" () { + return foo; + }, + get "ns" () { + return e_js_namespace_farm_internal_; + } +}; +var e = 4; +var e_js_default = function() { + console.log("e" + e); +}; +var e_js_namespace_farm_internal_ = { + "default": e_js_default, + "e": e +}; +var d_js_default = 3; +var d_js_namespace_farm_internal_ = { + "default": d_js_default, + "e": e +}; +var bar = "bar" + 2; +var f = 5; +var f_local = "f"; +var f_d = "f_d"; +var a_js_namespace_farm_internal_ = { + get "a" () { + return a_js_namespace_farm_internal_; + }, + get "bar" () { + return bar; + }, + get "baz" () { + return d_js_default; + }, + get "f" () { + return f; + }, + get "f_renamed" () { + return f_local; + }, + get "foo" () { + return foo; + }, + get "ns" () { + return e_js_namespace_farm_internal_; + } +}; +console.log(Object.entries(a_js_namespace_farm_internal_), Object.entries(b_js_namespace_farm_internal_)); +export { a_js_namespace_farm_internal_ as a, foo as foo }; +export { d_js_default as baz }; +export { bar as bar }; +export { f as f, f_local as f_renamed }; +export { e_js_namespace_farm_internal_ as ns }; +export { b_js_namespace_farm_internal_ as b }; diff --git a/crates/compiler/tests/fixtures/library/runtime/index.ts b/crates/compiler/tests/fixtures/library/runtime/index.ts new file mode 100644 index 0000000000..c9b1d3940d --- /dev/null +++ b/crates/compiler/tests/fixtures/library/runtime/index.ts @@ -0,0 +1,6 @@ +import { moduleSystem } from "./module-system"; +import { initModuleSystem as initModuleSystem1 } from "./modules/plugin"; +import { initModuleSystem as initModuleSystem2 } from "./modules/module-helper"; + +initModuleSystem1(moduleSystem); +initModuleSystem2(moduleSystem); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/library/runtime/module-system.ts b/crates/compiler/tests/fixtures/library/runtime/module-system.ts new file mode 100644 index 0000000000..043482095e --- /dev/null +++ b/crates/compiler/tests/fixtures/library/runtime/module-system.ts @@ -0,0 +1,2 @@ + +export const moduleSystem = {}; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/library/runtime/modules/module-helper.ts b/crates/compiler/tests/fixtures/library/runtime/modules/module-helper.ts new file mode 100644 index 0000000000..ccec3163f5 --- /dev/null +++ b/crates/compiler/tests/fixtures/library/runtime/modules/module-helper.ts @@ -0,0 +1,5 @@ +export function initModuleSystem(ms) { + ms._m = function() { + console.log('module-system'); + } +} \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/library/runtime/modules/plugin.ts b/crates/compiler/tests/fixtures/library/runtime/modules/plugin.ts new file mode 100644 index 0000000000..87cdd5fc8f --- /dev/null +++ b/crates/compiler/tests/fixtures/library/runtime/modules/plugin.ts @@ -0,0 +1,7 @@ + + +export function initModuleSystem(ms) { + ms.p = function() { + console.log('plugin'); + } +} \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/library/runtime/output.js b/crates/compiler/tests/fixtures/library/runtime/output.js new file mode 100644 index 0000000000..a1993d0c9c --- /dev/null +++ b/crates/compiler/tests/fixtures/library/runtime/output.js @@ -0,0 +1,14 @@ +//index.js: + const moduleSystem = {}; +function initModuleSystem(ms) { + ms.p = function() { + console.log('plugin'); + }; +} +function initModuleSystem$1(ms) { + ms._m = function() { + console.log('module-system'); + }; +} +initModuleSystem(moduleSystem); +initModuleSystem$1(moduleSystem); diff --git a/crates/compiler/tests/fixtures/partial_bundling/basic/output.js b/crates/compiler/tests/fixtures/partial_bundling/basic/output.js index fb51200e38..5d905d2f58 100644 --- a/crates/compiler/tests/fixtures/partial_bundling/basic/output.js +++ b/crates/compiler/tests/fixtures/partial_bundling/basic/output.js @@ -1,65 +1,22 @@ //__farm_runtime.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};;((function(){function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ +} +var index_js_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('runtime/index.js'); window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/runtime/bundle/browser/external/output.js b/crates/compiler/tests/fixtures/runtime/bundle/browser/external/output.js index b1aa5867f5..43b8d20591 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/browser/external/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/browser/external/output.js @@ -1,49 +1,5 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}((function(){import fs from "node:fs.farm-runtime"; + window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};;((function(){import fs from "node:fs.farm-runtime"; console.log(fs); window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); })());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_dcdc.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) {} diff --git a/crates/compiler/tests/fixtures/runtime/bundle/browser/normal/output.js b/crates/compiler/tests/fixtures/runtime/bundle/browser/normal/output.js index 41197b9831..3d60a9f2f7 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/browser/normal/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/browser/normal/output.js @@ -1,65 +1,22 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};;((function(){function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var runtime_ts_cjs = __commonJs((module, exports)=>{ +} +var runtime_ts_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('hello world'); window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/runtime/bundle/cjs/export/circlesImportCjs/output.js b/crates/compiler/tests/fixtures/runtime/bundle/cjs/export/circlesImportCjs/output.js index 0fe67de7ff..3a4863dcf1 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/cjs/export/circlesImportCjs/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/cjs/export/circlesImportCjs/output.js @@ -1,65 +1,22 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}var cjs_ts_cjs = __commonJs((module, exports)=>{ +} +var cjs_ts_cjs = __commonJs((module, exports)=>{ const foo = export_ts_cjs(); module.exports.name = "foo"; module.exports.age = 18; diff --git a/crates/compiler/tests/fixtures/runtime/bundle/cjs/export/entryExportStar/output.js b/crates/compiler/tests/fixtures/runtime/bundle/cjs/export/entryExportStar/output.js index fdb27f82f0..1792b03ac4 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/cjs/export/entryExportStar/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/cjs/export/entryExportStar/output.js @@ -1,21 +1,30 @@ //index.js: - global.nodeRequire = require;global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + global.nodeRequire = require;global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); + } + return module.exports; + }; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function(nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interop_require_wildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) return obj; if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { default: obj @@ -36,30 +45,8 @@ newObj.default = obj; if (cache) cache.set(obj, newObj); return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}var node_fs_ns = _interop_require_wildcard(require("node:fs.farm-runtime")); +} +var node_fs_ns = _interop_require_wildcard(require("node:fs.farm-runtime")); var cjsExport_ts_cjs = __commonJs((module, exports)=>{ "use strict"; Object.defineProperty(exports, "__esModule", { @@ -78,10 +65,6 @@ var cjsExport_ts_cjs = __commonJs((module, exports)=>{ var cjsExport_ts_ns = _interop_require_wildcard(cjsExport_ts_cjs()); const foo = "foo"; -var esmExport_ts_ns = { - foo: foo, - __esModule: true -}; const esmName = 'repeat-esm-shulan'; global['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/runtime/bundle/cjs/export/exportNamed/output.js b/crates/compiler/tests/fixtures/runtime/bundle/cjs/export/exportNamed/output.js index e8b049537d..6f7b1d8f93 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/cjs/export/exportNamed/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/cjs/export/exportNamed/output.js @@ -1,65 +1,22 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};// module_id: dep.ts.farm-runtime +function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}// module_id: dep.ts.farm-runtime +} var dep_ts_cjs = __commonJs({ "dep.ts.farm-runtime": (module, exports)=>{ module.exports.name = 'shulan'; diff --git a/crates/compiler/tests/fixtures/runtime/bundle/cjs/export/exportNamespace/output.js b/crates/compiler/tests/fixtures/runtime/bundle/cjs/export/exportNamespace/output.js index a6c23ef033..f2c77616e6 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/cjs/export/exportNamespace/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/cjs/export/exportNamespace/output.js @@ -1,21 +1,30 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; + } + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { + return module.exports; + }; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function(nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interop_require_wildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) return obj; if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { default: obj @@ -36,30 +45,8 @@ newObj.default = obj; if (cache) cache.set(obj, newObj); return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}var dep_ts_cjs = __commonJs((module, exports)=>{ +} +var dep_ts_cjs = __commonJs((module, exports)=>{ module.exports.name = 'shulan'; module.exports.age = 18; module.exports.default = 'default'; diff --git a/crates/compiler/tests/fixtures/runtime/bundle/cjs/export/exportStar/output.js b/crates/compiler/tests/fixtures/runtime/bundle/cjs/export/exportStar/output.js index 613ff1cc15..1c10531636 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/cjs/export/exportStar/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/cjs/export/exportStar/output.js @@ -1,78 +1,38 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function _mergeNamespaces(n, m) { - m.forEach(function (e) { - e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { + return module.exports; + }; +} +function _mergeNamespaces(n, m) { + m.forEach(function(e) { + e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function(k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, - get: function () { return e[k]; } + get: function() { + return e[k]; + } }); } }); }); return Object.freeze(n); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}var cjsExport_ts_cjs = __commonJs((module, exports)=>{ +} +var cjsExport_ts_cjs = __commonJs((module, exports)=>{ module.exports.name = 'shulan'; module.exports.age = 18; module.exports.default = 'default'; diff --git a/crates/compiler/tests/fixtures/runtime/bundle/cjs/export/repeatUsingCjs/output.js b/crates/compiler/tests/fixtures/runtime/bundle/cjs/export/repeatUsingCjs/output.js index eec0b8f6ce..528610944f 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/cjs/export/repeatUsingCjs/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/cjs/export/repeatUsingCjs/output.js @@ -1,21 +1,30 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); + } + return module.exports; + }; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function(nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interop_require_wildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) return obj; if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { default: obj @@ -36,30 +45,13 @@ newObj.default = obj; if (cache) cache.set(obj, newObj); return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, +} +function _interop_require_default(obj) { + return obj && obj.__esModule ? obj : { + default: obj }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}var cjs_ts_cjs = __commonJs((module, exports)=>{ +} +var cjs_ts_cjs = __commonJs((module, exports)=>{ module.exports.name = "foo"; module.exports.age = 18; }); diff --git a/crates/compiler/tests/fixtures/runtime/bundle/cjs/hybrid/exportStar/output.js b/crates/compiler/tests/fixtures/runtime/bundle/cjs/hybrid/exportStar/output.js index f163ac559f..4f6e48d57c 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/cjs/hybrid/exportStar/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/cjs/hybrid/exportStar/output.js @@ -1,78 +1,38 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};// module_id: cjsExport.ts.farm-runtime +function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function _mergeNamespaces(n, m) { - m.forEach(function (e) { - e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { + return module.exports; + }; +} +function _mergeNamespaces(n, m) { + m.forEach(function(e) { + e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function(k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, - get: function () { return e[k]; } + get: function() { + return e[k]; + } }); } }); }); return Object.freeze(n); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}// module_id: cjsExport.ts.farm-runtime +} import * as node_fs_ns from "node:fs.farm-runtime"; var cjsExport_ts_cjs = __commonJs({ "cjsExport.ts.farm-runtime": (module, exports)=>{ @@ -124,7 +84,7 @@ var cjsExportEsm_ts_cjs = __commonJs({ } }); _export_star(esmExport_ts_ns, exports); - var _esmExport2 = _interop_require_wildcard(esmExport2_ts_ns); + var _esmExport2 = /*#__PURE__*/ _interop_require_wildcard(esmExport2_ts_ns); module.exports.cjs_export_esm = 'shulan'; } }); diff --git a/crates/compiler/tests/fixtures/runtime/bundle/cjs/hybrid/nested_require/output.js b/crates/compiler/tests/fixtures/runtime/bundle/cjs/hybrid/nested_require/output.js index 8fc56a41a3..e5fbb2cecf 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/cjs/hybrid/nested_require/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/cjs/hybrid/nested_require/output.js @@ -1,65 +1,22 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}function cjs_ts_default() { +} +function cjs_ts_default() { console.log('foo'); } var cjs_ts_ns = { diff --git a/crates/compiler/tests/fixtures/runtime/bundle/cjs/hybrid/unresolved_variables/output.js b/crates/compiler/tests/fixtures/runtime/bundle/cjs/hybrid/unresolved_variables/output.js index 1971257aaa..280cbf65ed 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/cjs/hybrid/unresolved_variables/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/cjs/hybrid/unresolved_variables/output.js @@ -1,65 +1,22 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}var cjs_ts_cjs = __commonJs((module, exports)=>{ +} +var cjs_ts_cjs = __commonJs((module, exports)=>{ module.exports.name = "shulan"; module.exports.age = 18; foo = "unresolved_variable"; diff --git a/crates/compiler/tests/fixtures/runtime/bundle/cjs/normal/output.js b/crates/compiler/tests/fixtures/runtime/bundle/cjs/normal/output.js index a5fe855461..254f7bc323 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/cjs/normal/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/cjs/normal/output.js @@ -1,21 +1,31 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};// module_id: esmExport.ts.farm-runtime +function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); + } + return module.exports; + }; +} +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function(nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interop_require_wildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) return obj; if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { default: obj @@ -36,30 +46,12 @@ newObj.default = obj; if (cache) cache.set(obj, newObj); return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, +} +function _interop_require_default(obj) { + return obj && obj.__esModule ? obj : { + default: obj }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}// module_id: esmExport.ts.farm-runtime +} const name = 'name'; const age = 18; var esmExport_ts_default = { diff --git a/crates/compiler/tests/fixtures/runtime/bundle/decl/export_default_decl/no_ident/output.js b/crates/compiler/tests/fixtures/runtime/bundle/decl/export_default_decl/no_ident/output.js index 04684f50e1..7df0ab3827 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/decl/export_default_decl/no_ident/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/decl/export_default_decl/no_ident/output.js @@ -1,49 +1,5 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}class export_class_ts_default { + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};class export_class_ts_default { constructor(){ console.log('class foo'); } diff --git a/crates/compiler/tests/fixtures/runtime/bundle/decl/forward_export/output.js b/crates/compiler/tests/fixtures/runtime/bundle/decl/forward_export/output.js index 943e070e0c..16d22c4c9d 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/decl/forward_export/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/decl/forward_export/output.js @@ -1,65 +1,22 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}function Layout() {} +} +function Layout() {} function wrap(fn) { return ()=>{ return fn(); diff --git a/crates/compiler/tests/fixtures/runtime/bundle/decl/normal/output.js b/crates/compiler/tests/fixtures/runtime/bundle/decl/normal/output.js index 9662a3fb84..d94cb2c2d2 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/decl/normal/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/decl/normal/output.js @@ -1,65 +1,22 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}var runtime_2_ts_cjs = __commonJs((module, exports)=>{ +} +var runtime_2_ts_cjs = __commonJs((module, exports)=>{ "use strict"; const a = 3; const b = 4; diff --git a/crates/compiler/tests/fixtures/runtime/bundle/decl/self_ref/output.js b/crates/compiler/tests/fixtures/runtime/bundle/decl/self_ref/output.js index 357475efc3..1f58bd03cb 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/decl/self_ref/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/decl/self_ref/output.js @@ -1,49 +1,5 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function addClass() { + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function addClass() { console.log('addClass'); } diff --git a/crates/compiler/tests/fixtures/runtime/bundle/decl/spread/output.js b/crates/compiler/tests/fixtures/runtime/bundle/decl/spread/output.js index 8eb8028aa8..1fb080a31f 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/decl/spread/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/decl/spread/output.js @@ -1,65 +1,22 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}const Row = ()=>{}; +} +const Row = ()=>{}; const Col = ()=>{}; const Grid = { Row: Row, diff --git a/crates/compiler/tests/fixtures/runtime/bundle/decl/unresolved_variable/output.js b/crates/compiler/tests/fixtures/runtime/bundle/decl/unresolved_variable/output.js index 098ceb79a5..5cb90e73e4 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/decl/unresolved_variable/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/decl/unresolved_variable/output.js @@ -1,49 +1,5 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}const name = 100; + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};const name = 100; foo = "bar"; let foo$1 = 200; diff --git a/crates/compiler/tests/fixtures/runtime/bundle/decl/var/output.js b/crates/compiler/tests/fixtures/runtime/bundle/decl/var/output.js index da68672494..2a797ef2ff 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/decl/var/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/decl/var/output.js @@ -1,49 +1,5 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}const foo = 'foo', arrowFn = ()=>{}, fn = function() {}, obj = { + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};const foo = 'foo', arrowFn = ()=>{}, fn = function() {}, obj = { key: 'value' }, arr = []; diff --git a/crates/compiler/tests/fixtures/runtime/bundle/dynamic/normal/output.js b/crates/compiler/tests/fixtures/runtime/bundle/dynamic/normal/output.js index 569123ce95..e203890336 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/dynamic/normal/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/dynamic/normal/output.js @@ -1,58 +1,14 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function foo$1() { + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function foo() { console.log('foo'); } var dynamic_ts_ns = { - "default": foo$1, + "default": foo, __esModule: true }; Promise.resolve(dynamic_ts_ns).then((res)=>res.default()); -const foo = ()=>Promise.resolve(dynamic_ts_ns); +const foo$1 = ()=>Promise.resolve(dynamic_ts_ns); function loader(m) {} loader(Promise.resolve(dynamic_ts_ns)); Promise.resolve(dynamic_ts_ns); diff --git a/crates/compiler/tests/fixtures/runtime/bundle/export/emptyExport/output.js b/crates/compiler/tests/fixtures/runtime/bundle/export/emptyExport/output.js index 93c221847d..555f0999ab 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/export/emptyExport/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/export/emptyExport/output.js @@ -1,49 +1,5 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -} + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'}; console.log(fs); global['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); (function(_){var filename = ((function(){return import.meta.url})());for(var r in _){_[r].__farm_resource_pot__=filename;global['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) {} diff --git a/crates/compiler/tests/fixtures/runtime/bundle/export/entryExport1/output.js b/crates/compiler/tests/fixtures/runtime/bundle/export/entryExport1/output.js index 4daee744b0..da389e8006 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/export/entryExport1/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/export/entryExport1/output.js @@ -1,49 +1,5 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}const a = 10; + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};const a = 10; function b() { return 20; } diff --git a/crates/compiler/tests/fixtures/runtime/bundle/export/entryExport2/output.js b/crates/compiler/tests/fixtures/runtime/bundle/export/entryExport2/output.js index 4daee744b0..da389e8006 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/export/entryExport2/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/export/entryExport2/output.js @@ -1,49 +1,5 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}const a = 10; + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};const a = 10; function b() { return 20; } diff --git a/crates/compiler/tests/fixtures/runtime/bundle/export/entryExport3/output.js b/crates/compiler/tests/fixtures/runtime/bundle/export/entryExport3/output.js index 2c887e9ddd..730c0a3ffc 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/export/entryExport3/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/export/entryExport3/output.js @@ -1,49 +1,5 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}const a = 3; + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};const a = 3; const b = 4; const c = 5; function BB() { @@ -73,19 +29,19 @@ var exportAll_ts_ns = { const bundle2A = 'bundle2A'; const bundle2B = 'bundle2B'; -var bundle2_dep_ts_ns = { + +var exportOtherBundle_ts_ns = { bundle2A: bundle2A, bundle2B: bundle2B, __esModule: true }; -var exportOtherBundle_ts_ns = { +var bundle2_index_ts_ns = { bundle2A: bundle2A, bundle2B: bundle2B, __esModule: true }; - global['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); (function(_){var filename = ((function(){return import.meta.url})());for(var r in _){_[r].__farm_resource_pot__=filename;global['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) {} ,});global['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);global['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = global['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/runtime/bundle/export/exportDefault1/output.js b/crates/compiler/tests/fixtures/runtime/bundle/export/exportDefault1/output.js index d681fea234..922541dcc6 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/export/exportDefault1/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/export/exportDefault1/output.js @@ -1,49 +1,5 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}const a = 3; + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};const a = 3; const a$1 = 3 + a; diff --git a/crates/compiler/tests/fixtures/runtime/bundle/export/exportDefaultDecl/output.js b/crates/compiler/tests/fixtures/runtime/bundle/export/exportDefaultDecl/output.js index bd08684e40..30343a3392 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/export/exportDefaultDecl/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/export/exportDefaultDecl/output.js @@ -1,49 +1,5 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}const a = 3; + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};const a = 3; class getA { constructor(){} getA() { diff --git a/crates/compiler/tests/fixtures/runtime/bundle/export/exportDefaultExpr/output.js b/crates/compiler/tests/fixtures/runtime/bundle/export/exportDefaultExpr/output.js index 37c769025a..66abe247ca 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/export/exportDefaultExpr/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/export/exportDefaultExpr/output.js @@ -1,49 +1,5 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}const a = 3; + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};const a = 3; var runtime_2_ts_default = a + 10; var runtime_1_ts_default = runtime_2_ts_default + 20; diff --git a/crates/compiler/tests/fixtures/runtime/bundle/export/exportNamed1/output.js b/crates/compiler/tests/fixtures/runtime/bundle/export/exportNamed1/output.js index fdec240c70..c54a00eadb 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/export/exportNamed1/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/export/exportNamed1/output.js @@ -1,49 +1,5 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}const a = 'a-runtime.2.ts'; + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};const a = 'a-runtime.2.ts'; const b = 'b-runtime.2.ts'; function BB() { const a$1 = 5; diff --git a/crates/compiler/tests/fixtures/runtime/bundle/export/exportNamed2/output.js b/crates/compiler/tests/fixtures/runtime/bundle/export/exportNamed2/output.js index 2ab1779f80..3160473d6f 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/export/exportNamed2/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/export/exportNamed2/output.js @@ -1,49 +1,5 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}const a = 'a-runtime2-a.ts'; + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};const a = 'a-runtime2-a.ts'; const b = 'b-runtime2-b.ts'; function BB() { const a$1 = 5; diff --git a/crates/compiler/tests/fixtures/runtime/bundle/export/exportNamed3/output.js b/crates/compiler/tests/fixtures/runtime/bundle/export/exportNamed3/output.js index 140cba36d1..a2c1d42ab1 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/export/exportNamed3/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/export/exportNamed3/output.js @@ -1,49 +1,5 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}const isString = (v)=>{ + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};const isString = (v)=>{ console.log('isString1'); return typeof v === 'string'; }; diff --git a/crates/compiler/tests/fixtures/runtime/bundle/external/export/from_source/export_all/output.js b/crates/compiler/tests/fixtures/runtime/bundle/external/export/from_source/export_all/output.js index ea6272b43a..608d32c150 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/external/export/from_source/export_all/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/external/export/from_source/export_all/output.js @@ -1,62 +1,21 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function _mergeNamespaces(n, m) { - m.forEach(function (e) { - e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _mergeNamespaces(n, m) { + m.forEach(function(e) { + e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function(k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, - get: function () { return e[k]; } + get: function() { + return e[k]; + } }); } }); }); return Object.freeze(n); -}import * as node_fs_ns from "node:fs.farm-runtime"; +} +import * as node_fs_ns from "node:fs.farm-runtime"; var exportAll_ts_ns = _mergeNamespaces({ __esModule: true }, [ @@ -65,11 +24,6 @@ var exportAll_ts_ns = _mergeNamespaces({ const bundle2A = 'bundle2A'; const bundle2B = 'bundle2B'; -var bundle2_dep_ts_ns = { - bundle2A: bundle2A, - bundle2B: bundle2B, - __esModule: true -}; var bundle2_index_ts_ns = { bundle2A: bundle2A, diff --git a/crates/compiler/tests/fixtures/runtime/bundle/external/export/from_source/export_as_namespace/output.js b/crates/compiler/tests/fixtures/runtime/bundle/external/export/from_source/export_as_namespace/output.js index 69571c388b..42d68869a1 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/external/export/from_source/export_as_namespace/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/external/export/from_source/export_as_namespace/output.js @@ -1,78 +1,39 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function _mergeNamespaces(n, m) { - m.forEach(function (e) { - e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { + return module.exports; + }; +} +function _mergeNamespaces(n, m) { + m.forEach(function(e) { + e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function(k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, - get: function () { return e[k]; } + get: function() { + return e[k]; + } }); } }); }); return Object.freeze(n); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}var exportCjs_ts_cjs = __commonJs((module, exports)=>{ +} +import { readFile, readFileSync } from "node:fs.farm-runtime"; +var exportCjs_ts_cjs = __commonJs((module, exports)=>{ module.exports.name = "shulan"; module.exports.age = 18; }); diff --git a/crates/compiler/tests/fixtures/runtime/bundle/external/export/from_source/export_named/output.js b/crates/compiler/tests/fixtures/runtime/bundle/external/export/from_source/export_named/output.js index 3f344353f0..596df20f62 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/external/export/from_source/export_named/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/external/export/from_source/export_named/output.js @@ -1,57 +1,33 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _mergeNamespaces(n, m) { + m.forEach(function(e) { + e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function(k) { + if (k !== 'default' && !(k in n)) { + var d = Object.getOwnPropertyDescriptor(e, k); + Object.defineProperty(n, k, d.get ? d : { + enumerable: true, + get: function() { + return e[k]; + } + }); + } + }); }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}import { readFileSync, readSync } from "node:fs.farm-runtime"; + return Object.freeze(n); +} +import { readFileSync, readSync } from "node:fs.farm-runtime"; +import * as node_fs_ns from "node:fs.farm-runtime"; +var exportNamed_ts_ns = _mergeNamespaces({ + readFileSync: readFileSync, + readSync: readSync, + __esModule: true +}, [ + node_fs_ns +]); +var readFile = exportNamed_ts_ns["readFile"], writeFileSync = exportNamed_ts_ns["writeFileSync"]; const bundle2A = 'bundle2A'; const bundle2B = 'bundle2B'; -var bundle2_dep_ts_ns = { - bundle2A: bundle2A, - bundle2B: bundle2B, - __esModule: true -}; var bundle2_index_ts_ns = { bundle2A: bundle2A, diff --git a/crates/compiler/tests/fixtures/runtime/bundle/external/export/from_source/export_namespace/output.js b/crates/compiler/tests/fixtures/runtime/bundle/external/export/from_source/export_namespace/output.js index befd944a4d..ae69fa8a14 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/external/export/from_source/export_namespace/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/external/export/from_source/export_namespace/output.js @@ -1,21 +1,14 @@ //index.js: - global.nodeRequire = require;global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { + global.nodeRequire = require;global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};// module_id: exportNamespace.ts.farm-runtime +function _getRequireWildcardCache(nodeInterop) { + if (typeof WeakMap !== "function") return null; + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + return (_getRequireWildcardCache = function(nodeInterop) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} +function _interop_require_wildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) return obj; if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { default: obj @@ -36,14 +29,7 @@ newObj.default = obj; if (cache) cache.set(obj, newObj); return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}// module_id: exportNamespace.ts.farm-runtime +} var node_fs_ns = _interop_require_wildcard(require("node:fs.farm-runtime")); console.log('export namespace'); var exportNamespace_ts_ns = { @@ -54,11 +40,6 @@ var exportNamespace_ts_ns = { // module_id: bundle2-dep.ts.farm-runtime const bundle2A = 'bundle2A'; const bundle2B = 'bundle2B'; -var bundle2_dep_ts_ns = { - bundle2A: bundle2A, - bundle2B: bundle2B, - __esModule: true -}; // module_id: bundle2-index.ts.farm-runtime var bundle2_index_ts_ns = { diff --git a/crates/compiler/tests/fixtures/runtime/bundle/external/import/default/output.js b/crates/compiler/tests/fixtures/runtime/bundle/external/import/default/output.js index 490bf23e49..5a50da5546 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/external/import/default/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/external/import/default/output.js @@ -1,49 +1,5 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}import fs$1 from "fs.farm-runtime"; + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};import fs$1 from "fs.farm-runtime"; import fs from "node:fs.farm-runtime"; console.log('external 1', fs); diff --git a/crates/compiler/tests/fixtures/runtime/bundle/external/import/named/output.js b/crates/compiler/tests/fixtures/runtime/bundle/external/import/named/output.js index 4083e2bb99..63fdf2ce19 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/external/import/named/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/external/import/named/output.js @@ -1,49 +1,5 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}import { read } from "node:fs.farm-runtime"; + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};import { read } from "node:fs.farm-runtime"; console.log('external 1', read); console.log('external 2', read); diff --git a/crates/compiler/tests/fixtures/runtime/bundle/external/import/namespace/output.js b/crates/compiler/tests/fixtures/runtime/bundle/external/import/namespace/output.js index d202dae26c..2ddb89fd5f 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/external/import/namespace/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/external/import/namespace/output.js @@ -1,49 +1,5 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}import * as node_fs_ns from "node:fs.farm-runtime"; + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};import * as node_fs_ns from "node:fs.farm-runtime"; console.log('external 1', node_fs_ns); console.log('external 1', node_fs_ns); diff --git a/crates/compiler/tests/fixtures/runtime/bundle/function/output.js b/crates/compiler/tests/fixtures/runtime/bundle/function/output.js index c5eac5dd04..33238d27c5 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/function/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/function/output.js @@ -1,49 +1,5 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}const MIN_CHART_WIDTH = 1; + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};const MIN_CHART_WIDTH = 1; const MIN_CHART_HEIGHT = 1; function getElementSize(ele) { var style = getComputedStyle(ele); diff --git a/crates/compiler/tests/fixtures/runtime/bundle/import/importDefault/output.js b/crates/compiler/tests/fixtures/runtime/bundle/import/importDefault/output.js index 174d6b6da0..a9e3924ba0 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/import/importDefault/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/import/importDefault/output.js @@ -1,49 +1,5 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}class DC { + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};class DC { constructor(){} } diff --git a/crates/compiler/tests/fixtures/runtime/bundle/import/importNamed/output.js b/crates/compiler/tests/fixtures/runtime/bundle/import/importNamed/output.js index a027aa7a1b..774606bdeb 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/import/importNamed/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/import/importNamed/output.js @@ -1,49 +1,5 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}const a = 3; + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};const a = 3; const b = 4; function BB() { const a$1 = 5; diff --git a/crates/compiler/tests/fixtures/runtime/bundle/import/importNamespace/output.js b/crates/compiler/tests/fixtures/runtime/bundle/import/importNamespace/output.js index 2ef469aab1..f7756dca66 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/import/importNamespace/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/import/importNamespace/output.js @@ -1,49 +1,5 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}const a = 3; + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};const a = 3; const b = 4; const c = 5; function BB() { diff --git a/crates/compiler/tests/fixtures/runtime/bundle/import/importedInScope/output.js b/crates/compiler/tests/fixtures/runtime/bundle/import/importedInScope/output.js index f081979911..678e2c43e1 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/import/importedInScope/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/import/importedInScope/output.js @@ -1,65 +1,21 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}const hello$5 = 'hello1'; + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};const hello = 'hello1'; const hello$1 = 'hello'; -console.log(hello$5, hello$1); +console.log(hello, hello$1); function export_nested() { - const hello = 'hello'; - console.log(hello); + const hello$2 = 'hello'; + console.log(hello$2); } -var hello$2 = hello$5; +var hello$3 = hello; function say() { - var hello$3 = hello$5; - var hello$1$1 = hello$5; - console.log(hello$3); + var hello$4 = hello; + var hello$1$1 = hello; + console.log(hello$4); function nested_say() { - var hello$4 = hello$5; - var hello$2$1 = hello$5; - console.log(hello$4); + var hello$5 = hello; + var hello$2$1 = hello; + console.log(hello$5); } } say(); diff --git a/crates/compiler/tests/fixtures/runtime/bundle/import/sameImport/output.js b/crates/compiler/tests/fixtures/runtime/bundle/import/sameImport/output.js index bd50fe0b5f..408a1c037a 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/import/sameImport/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/import/sameImport/output.js @@ -1,65 +1,27 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; + }; +} +function _interop_require_default(obj) { + return obj && obj.__esModule ? obj : { + default: obj }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}var export_ts_cjs = __commonJs((module, exports)=>{ +} +var export_ts_cjs = __commonJs((module, exports)=>{ module.exports = function() { console.log('safe import'); }; diff --git a/crates/compiler/tests/fixtures/runtime/bundle/interface/output.js b/crates/compiler/tests/fixtures/runtime/bundle/interface/output.js index ced229bb8c..c5392501b7 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/interface/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/interface/output.js @@ -1,49 +1,5 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -} + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'}; const foo = 10; console.log(1, 10, foo); global['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/runtime/bundle/issues/merge_props/output.js b/crates/compiler/tests/fixtures/runtime/bundle/issues/merge_props/output.js index cb4b22c74a..db6147bc81 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/issues/merge_props/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/issues/merge_props/output.js @@ -1,49 +1,5 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}var __assign = this && this.__assign || function() { + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};var __assign = this && this.__assign || function() { __assign = Object.assign || function(t) { for(var s, i = 1, n = arguments.length; i < n; i++){ s = arguments[i]; @@ -53,15 +9,15 @@ }; return __assign.apply(this, arguments); }; -function mergeProps$1(componentProps, defaultProps, globalComponentConfig) { +function mergeProps(componentProps, defaultProps, globalComponentConfig) { var _defaultProps = __assign(__assign({}, defaultProps), globalComponentConfig); - var props = __assign({}, componentProps); + var props$1 = __assign({}, componentProps); for(var propName in _defaultProps){ - if (props[propName] === undefined) { - props[propName] = _defaultProps[propName]; + if (props$1[propName] === undefined) { + props$1[propName] = _defaultProps[propName]; } } - return props; + return props$1; } var Trigger = function(_super) { @@ -70,8 +26,8 @@ var Trigger = function(_super) { var _this = _super.call(this, props, context) || this; _this.getMergedProps = function(baseProps) { var componentConfig = _this.context.componentConfig; - var props$1 = mergeProps$1(baseProps || _this.props, defaultProps, componentConfig === null || componentConfig === void 0 ? void 0 : componentConfig.Trigger); - return props$1; + var props$3 = mergeProps(baseProps || _this.props, defaultProps, componentConfig === null || componentConfig === void 0 ? void 0 : componentConfig.Trigger); + return props$3; }; return _this; } @@ -86,59 +42,59 @@ var Trigger = function(_super) { if (!popup) { return null; } - var mergeProps = {}; + var mergeProps$1 = {}; var popupEventProps = { onMouseDown: this.onPopupMouseDown }; if (this.isHoverTrigger() && !disabled) { - mergeProps.onMouseEnter = this.onMouseEnter; - mergeProps.onMouseLeave = this.onMouseLeave; + mergeProps$1.onMouseEnter = this.onMouseEnter; + mergeProps$1.onMouseLeave = this.onMouseLeave; if (alignPoint) { - mergeProps.onMouseMove = this.onMouseMove; + mergeProps$1.onMouseMove = this.onMouseMove; } if (!this.isPopupHoverHide()) { popupEventProps.onMouseEnter = this.onPopupMouseEnter; popupEventProps.onMouseLeave = this.onPopupMouseLeave; } } else { - mergeProps.onMouseEnter = this.triggerOriginEvent('onMouseEnter'); - mergeProps.onMouseLeave = this.triggerOriginEvent('onMouseLeave'); + mergeProps$1.onMouseEnter = this.triggerOriginEvent('onMouseEnter'); + mergeProps$1.onMouseLeave = this.triggerOriginEvent('onMouseLeave'); } if (this.isContextMenuTrigger() && !disabled) { - mergeProps.onContextMenu = this.onContextMenu; - mergeProps.onClick = this.hideContextMenu; + mergeProps$1.onContextMenu = this.onContextMenu; + mergeProps$1.onClick = this.hideContextMenu; } else { - mergeProps.onContextMenu = this.triggerOriginEvent('onContextMenu'); + mergeProps$1.onContextMenu = this.triggerOriginEvent('onContextMenu'); } if (this.isClickTrigger() && !disabled) { - mergeProps.onClick = this.onClick; + mergeProps$1.onClick = this.onClick; } else { - mergeProps.onClick = mergeProps.onClick || this.triggerOriginEvent('onClick'); + mergeProps$1.onClick = mergeProps$1.onClick || this.triggerOriginEvent('onClick'); } if (this.isFocusTrigger() && !disabled) { - mergeProps.onFocus = this.onFocus; + mergeProps$1.onFocus = this.onFocus; if (this.isBlurToHide()) { - mergeProps.onBlur = this.onBlur; + mergeProps$1.onBlur = this.onBlur; } } else { - mergeProps.onFocus = this.triggerOriginEvent('onFocus'); - mergeProps.onBlur = this.triggerOriginEvent('onBlur'); + mergeProps$1.onFocus = this.triggerOriginEvent('onFocus'); + mergeProps$1.onBlur = this.triggerOriginEvent('onBlur'); } if (!disabled) { - mergeProps.onKeyDown = this.onKeyDown; + mergeProps$1.onKeyDown = this.onKeyDown; } else { - mergeProps.onKeyDown = this.triggerOriginEvent('onKeyDown'); + mergeProps$1.onKeyDown = this.triggerOriginEvent('onKeyDown'); } var child = this.getChild(); var popupChildren = React.Children.only(popup()); if (child.props.className) { - mergeProps.className = child.props.className; + mergeProps$1.className = child.props.className; } if (childrenPrefix && popupVisible) { - mergeProps.className = mergeProps.className ? mergeProps.className + " " + childrenPrefix + "-open" : childrenPrefix + "-open"; + mergeProps$1.className = mergeProps$1.className ? mergeProps$1.className + " " + childrenPrefix + "-open" : childrenPrefix + "-open"; } if (this.isFocusTrigger()) { - mergeProps.tabIndex = disabled ? -1 : 0; + mergeProps$1.tabIndex = disabled ? -1 : 0; } }; return Trigger$1; diff --git a/crates/compiler/tests/fixtures/runtime/bundle/lazy_compilation/output.js b/crates/compiler/tests/fixtures/runtime/bundle/lazy_compilation/output.js index 860a46ecda..b4cd59e423 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/lazy_compilation/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/lazy_compilation/output.js @@ -1,49 +1,5 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}((function(){const name = 'foo'; + window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};;((function(){const name = 'foo'; var foo_ts_ns = { name: name, __esModule: true diff --git a/crates/compiler/tests/fixtures/runtime/bundle/polyfill/reserved_word/cjs/output.js b/crates/compiler/tests/fixtures/runtime/bundle/polyfill/reserved_word/cjs/output.js index 1127622201..e2515155b9 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/polyfill/reserved_word/cjs/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/polyfill/reserved_word/cjs/output.js @@ -1,65 +1,22 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}function foo() {} +} +function foo() {} var dep_ts_ns = { "default": foo, __esModule: true diff --git a/crates/compiler/tests/fixtures/runtime/bundle/polyfill/reserved_word/esm/output.js b/crates/compiler/tests/fixtures/runtime/bundle/polyfill/reserved_word/esm/output.js index 915a324595..f9c53f2187 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/polyfill/reserved_word/esm/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/polyfill/reserved_word/esm/output.js @@ -1,49 +1,5 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}const a = 10; + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};const a = 10; function foo() {} var dep_ts_ns = { a: a, diff --git a/crates/compiler/tests/fixtures/runtime/bundle/rename/output.js b/crates/compiler/tests/fixtures/runtime/bundle/rename/output.js index df55cde470..f8c6f6096b 100644 --- a/crates/compiler/tests/fixtures/runtime/bundle/rename/output.js +++ b/crates/compiler/tests/fixtures/runtime/bundle/rename/output.js @@ -1,49 +1,5 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}const namedA = 10; + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};const namedA = 10; const namedB = 20; const namedC = 30; const sameNameWithFile_ts = 1; diff --git a/crates/compiler/tests/fixtures/script/accept_deps/output.js b/crates/compiler/tests/fixtures/script/accept_deps/output.js index f4860de018..d1c2c42329 100644 --- a/crates/compiler/tests/fixtures/script/accept_deps/output.js +++ b/crates/compiler/tests/fixtures/script/accept_deps/output.js @@ -1,65 +1,22 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};;((function(){function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ +} +var index_js_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('runtime/index.js'); window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/script/comments/output.js b/crates/compiler/tests/fixtures/script/comments/output.js index fc1540e415..a09c06b110 100644 --- a/crates/compiler/tests/fixtures/script/comments/output.js +++ b/crates/compiler/tests/fixtures/script/comments/output.js @@ -1,65 +1,22 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};;((function(){function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ +} +var index_js_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('runtime/index.js'); window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/script/import_equals/output.js b/crates/compiler/tests/fixtures/script/import_equals/output.js index e64e641dd0..db2b5a3365 100644 --- a/crates/compiler/tests/fixtures/script/import_equals/output.js +++ b/crates/compiler/tests/fixtures/script/import_equals/output.js @@ -1,65 +1,22 @@ //__farm_runtime.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};;((function(){function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ +} +var index_js_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('runtime/index.js'); window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); @@ -73,12 +30,11 @@ index_js_cjs(); } , "b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); const fs = farmRequire("e4b1dea3", true); const utils = farmRequire("363fc137", true); console.log(fs, utils); } -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources(['index_7ecc.js']);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); +,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources(['index_7ecc.js']);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806");export default entry; //index_7ecc.js: (function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_7ecc.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"e4b1dea3":function (module, exports, farmRequire, farmDynamicRequire) { diff --git a/crates/compiler/tests/fixtures/script/import_meta/url/import_meta_url_with_URL/absolute_public_path/lit_str/output.js b/crates/compiler/tests/fixtures/script/import_meta/url/import_meta_url_with_URL/absolute_public_path/lit_str/output.js index aae7b8e2cf..74bf20850d 100644 --- a/crates/compiler/tests/fixtures/script/import_meta/url/import_meta_url_with_URL/absolute_public_path/lit_str/output.js +++ b/crates/compiler/tests/fixtures/script/import_meta/url/import_meta_url_with_URL/absolute_public_path/lit_str/output.js @@ -2,67 +2,24 @@ foo //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};;((function(){function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ +} +var index_js_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('runtime/index.js'); window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/script/import_meta/url/import_meta_url_with_URL/relative_public_path/tip/complate/output.js b/crates/compiler/tests/fixtures/script/import_meta/url/import_meta_url_with_URL/relative_public_path/tip/complate/output.js index bdb36276b1..f5ca580168 100644 --- a/crates/compiler/tests/fixtures/script/import_meta/url/import_meta_url_with_URL/relative_public_path/tip/complate/output.js +++ b/crates/compiler/tests/fixtures/script/import_meta/url/import_meta_url_with_URL/relative_public_path/tip/complate/output.js @@ -2,67 +2,24 @@ foo_bar //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};;((function(){function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ +} +var index_js_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('runtime/index.js'); window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/script/import_meta/url/import_meta_url_with_URL/relative_public_path/tip/normal/output.js b/crates/compiler/tests/fixtures/script/import_meta/url/import_meta_url_with_URL/relative_public_path/tip/normal/output.js index 1bed467ac9..c0735ea453 100644 --- a/crates/compiler/tests/fixtures/script/import_meta/url/import_meta_url_with_URL/relative_public_path/tip/normal/output.js +++ b/crates/compiler/tests/fixtures/script/import_meta/url/import_meta_url_with_URL/relative_public_path/tip/normal/output.js @@ -5,67 +5,24 @@ foo //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};;((function(){function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ +} +var index_js_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('runtime/index.js'); window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/script/import_meta/url/import_meta_url_with_URL/relative_public_path/tip/tip_star_star/output.js b/crates/compiler/tests/fixtures/script/import_meta/url/import_meta_url_with_URL/relative_public_path/tip/tip_star_star/output.js index 16684c9c40..209bade22f 100644 --- a/crates/compiler/tests/fixtures/script/import_meta/url/import_meta_url_with_URL/relative_public_path/tip/tip_star_star/output.js +++ b/crates/compiler/tests/fixtures/script/import_meta/url/import_meta_url_with_URL/relative_public_path/tip/tip_star_star/output.js @@ -2,67 +2,24 @@ foo //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};;((function(){function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ +} +var index_js_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('runtime/index.js'); window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/script/import_meta/url/node/output.browser-cjs.js b/crates/compiler/tests/fixtures/script/import_meta/url/node/output.browser-cjs.js index 48b1a2085e..44fbc111f9 100644 --- a/crates/compiler/tests/fixtures/script/import_meta/url/node/output.browser-cjs.js +++ b/crates/compiler/tests/fixtures/script/import_meta/url/node/output.browser-cjs.js @@ -1,65 +1,22 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};;((function(){function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ +} +var index_js_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('runtime/index.js'); window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/script/import_meta/url/node/output.browser-esm.js b/crates/compiler/tests/fixtures/script/import_meta/url/node/output.browser-esm.js index 48b1a2085e..44fbc111f9 100644 --- a/crates/compiler/tests/fixtures/script/import_meta/url/node/output.browser-esm.js +++ b/crates/compiler/tests/fixtures/script/import_meta/url/node/output.browser-esm.js @@ -1,65 +1,22 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};;((function(){function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ +} +var index_js_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('runtime/index.js'); window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/script/import_meta/url/node/output.js b/crates/compiler/tests/fixtures/script/import_meta/url/node/output.js index 48b1a2085e..44fbc111f9 100644 --- a/crates/compiler/tests/fixtures/script/import_meta/url/node/output.js +++ b/crates/compiler/tests/fixtures/script/import_meta/url/node/output.js @@ -1,65 +1,22 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};;((function(){function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ +} +var index_js_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('runtime/index.js'); window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/script/import_meta/url/node/output.library-browser-cjs.js b/crates/compiler/tests/fixtures/script/import_meta/url/node/output.library-browser-cjs.js index 15b796c9b4..dc4c5bd542 100644 --- a/crates/compiler/tests/fixtures/script/import_meta/url/node/output.library-browser-cjs.js +++ b/crates/compiler/tests/fixtures/script/import_meta/url/node/output.library-browser-cjs.js @@ -1,69 +1,2 @@ //index.js: - function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}var index_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log(new URL(__filename, "file:").href); -}); -_export_star(index_cjs(), module.exports); -Object.defineProperty(exports, "__esModule", { - value: true -}); + console.log(new URL(__filename, "file:").href); diff --git a/crates/compiler/tests/fixtures/script/import_meta/url/node/output.library-browser-esm.js b/crates/compiler/tests/fixtures/script/import_meta/url/node/output.library-browser-esm.js index 4e8633139c..d1412c12e0 100644 --- a/crates/compiler/tests/fixtures/script/import_meta/url/node/output.library-browser-esm.js +++ b/crates/compiler/tests/fixtures/script/import_meta/url/node/output.library-browser-esm.js @@ -1,66 +1,2 @@ //index.js: - function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}var index_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log(import.meta.url); -}); -export default index_cjs(); + console.log(import.meta.url); diff --git a/crates/compiler/tests/fixtures/script/import_meta/url/node/output.library-node-cjs.js b/crates/compiler/tests/fixtures/script/import_meta/url/node/output.library-node-cjs.js index 15b796c9b4..dc4c5bd542 100644 --- a/crates/compiler/tests/fixtures/script/import_meta/url/node/output.library-node-cjs.js +++ b/crates/compiler/tests/fixtures/script/import_meta/url/node/output.library-node-cjs.js @@ -1,69 +1,2 @@ //index.js: - function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}var index_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log(new URL(__filename, "file:").href); -}); -_export_star(index_cjs(), module.exports); -Object.defineProperty(exports, "__esModule", { - value: true -}); + console.log(new URL(__filename, "file:").href); diff --git a/crates/compiler/tests/fixtures/script/import_meta/url/node/output.library-node-esm.js b/crates/compiler/tests/fixtures/script/import_meta/url/node/output.library-node-esm.js index 4e8633139c..d1412c12e0 100644 --- a/crates/compiler/tests/fixtures/script/import_meta/url/node/output.library-node-esm.js +++ b/crates/compiler/tests/fixtures/script/import_meta/url/node/output.library-node-esm.js @@ -1,66 +1,2 @@ //index.js: - function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}var index_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log(import.meta.url); -}); -export default index_cjs(); + console.log(import.meta.url); diff --git a/crates/compiler/tests/fixtures/script/import_meta/url/node/output.node-cjs.js b/crates/compiler/tests/fixtures/script/import_meta/url/node/output.node-cjs.js index ef05df83b5..ba4b400494 100644 --- a/crates/compiler/tests/fixtures/script/import_meta/url/node/output.node-cjs.js +++ b/crates/compiler/tests/fixtures/script/import_meta/url/node/output.node-cjs.js @@ -1,65 +1,22 @@ //index.js: - global.nodeRequire = require;global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + global.nodeRequire = require;global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}var index_js_cjs = __commonJs((module, exports)=>{ +} +var index_js_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('runtime/index.js'); global['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/script/import_meta/url/node/output.node-esm.js b/crates/compiler/tests/fixtures/script/import_meta/url/node/output.node-esm.js index 31a45801c8..68cc2488bf 100644 --- a/crates/compiler/tests/fixtures/script/import_meta/url/node/output.node-esm.js +++ b/crates/compiler/tests/fixtures/script/import_meta/url/node/output.node-esm.js @@ -1,65 +1,22 @@ //index.js: - import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + import __farmNodeModule from 'node:module';global.nodeRequire = __farmNodeModule.createRequire(import.meta.url);global['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'node'};function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}var index_js_cjs = __commonJs((module, exports)=>{ +} +var index_js_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('runtime/index.js'); global['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/script/native_top_level_await/output.js b/crates/compiler/tests/fixtures/script/native_top_level_await/output.js index 2042971962..c0d3b1c9e4 100644 --- a/crates/compiler/tests/fixtures/script/native_top_level_await/output.js +++ b/crates/compiler/tests/fixtures/script/native_top_level_await/output.js @@ -1,65 +1,22 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};;((function(){function __commonJs(mod) { + var module; + return ()=>{ + if (module) { + return module.exports; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + module = { + exports: {} + }; + if (typeof mod === "function") { + mod(module, module.exports); + } else { + mod[Object.keys(mod)[0]](module, module.exports); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, + return module.exports; }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ +} +var index_js_cjs = __commonJs((module, exports)=>{ "use strict"; console.log('runtime/index.js'); window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); diff --git a/crates/compiler/tests/fixtures/tree_shake/basic/output.js b/crates/compiler/tests/fixtures/tree_shake/basic/output.js index cd8202f423..57a4fb36f9 100644 --- a/crates/compiler/tests/fixtures/tree_shake/basic/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/basic/output.js @@ -1,81 +1,26 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); +})(window["__farm_default_namespace__"].m, { + "05ee5ec7": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "a", function() { + return a; + }); + var a = '1'; + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_dep = farmRequire("05ee5ec7"); + console.log(_f_dep.a); } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_ddf1.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"05ee5ec7":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "a", function() { - return a; - }); - var a = '1'; -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_dep = farmRequire("05ee5ec7"); - console.log(_f_dep.a); -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/changed_ast/output.js b/crates/compiler/tests/fixtures/tree_shake/changed_ast/output.js index 48a14eaa31..7276dfcc1e 100644 --- a/crates/compiler/tests/fixtures/tree_shake/changed_ast/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/changed_ast/output.js @@ -1,142 +1,87 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){// module_id: ../../_internal/runtime/index.js.farm-runtime -var index_js_cjs = __commonJs({ - "../../_internal/runtime/index.js.farm-runtime": (module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-system-helper.ts'); +} +function initModuleSystem$1() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +initModuleSystem$1(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); } -}); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_4924.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"comp.tsx":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "Description", function() { - return Description; - }); - var _f_dep = module.w(farmRequire("dep.ts")); - const LazyComp = module.f(_f_dep).lazy(()=>Promise.resolve({ - default: ()=>module.f(_f_dep).createElement("div", { +})(window["__farm_default_namespace__"].m, { + "comp.tsx": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "Description", function() { + return Description; + }); + var _f_dep = farmRequire.w(farmRequire("dep.ts")); + const LazyComp = farmRequire.f(_f_dep).lazy(()=>Promise.resolve({ + default: ()=>farmRequire.f(_f_dep).createElement("div", { + __source: { + fileName: "comp.tsx", + lineNumber: 3, + columnNumber: 73 + }, + __self: this + }, "Lazy") + })); + _c = LazyComp; + function Description() { + console.trace('In Description, the sourcemap should be correct'); + return farmRequire.f(_f_dep).createElement(_f_dep.Suspense, { + fallback: farmRequire.f(_f_dep).createElement("div", { __source: { fileName: "comp.tsx", - lineNumber: 3, - columnNumber: 73 - }, - __self: this - }, "Lazy") - })); - _c = LazyComp; - function Description() { - console.trace('In Description, the sourcemap should be correct'); - return module.f(_f_dep).createElement(_f_dep.Suspense, { - fallback: module.f(_f_dep).createElement("div", { + lineNumber: 8, + columnNumber: 30 + } + }, "Loading..."), __source: { fileName: "comp.tsx", lineNumber: 8, - columnNumber: 30 - } - }, "Loading..."), - __source: { - fileName: "comp.tsx", - lineNumber: 8, - columnNumber: 10 - }, - __self: this - }, module.f(_f_dep).createElement(LazyComp, { - __source: { - fileName: "comp.tsx", - lineNumber: 8, - columnNumber: 53 + columnNumber: 10 + }, + __self: this + }, farmRequire.f(_f_dep).createElement(LazyComp, { + __source: { + fileName: "comp.tsx", + lineNumber: 8, + columnNumber: 53 + }, + __self: this + })); + } + _c1 = Description; + var _c, _c1; + $RefreshReg$(_c, "LazyComp"); + $RefreshReg$(_c1, "Description"); + }, + "dep.ts": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "Suspense", function() { + return Suspense; + }); + var Suspense = function() { + console.log('Suspense'); + }; + exports.default = { + createElement (comp, ...args) { + console.log(comp(), args); }, - __self: this - })); + lazy: (promise)=>{ + console.log('lazy', promise); + } + }; + }, + "entry.ts": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_comp = farmRequire("comp.tsx"); + console.log(_f_comp.Description()); } - _c1 = Description; - var _c, _c1; - $RefreshReg$(_c, "LazyComp"); - $RefreshReg$(_c1, "Description"); -} -, -"dep.ts":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "Suspense", function() { - return Suspense; - }); - var Suspense = function() { - console.log('Suspense'); - }; - exports.default = { - createElement (comp, ...args) { - console.log(comp(), args); - }, - lazy: (promise)=>{ - console.log('lazy', promise); - } - }; -} -, -"entry.ts":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_comp = farmRequire("comp.tsx"); - console.log(_f_comp.Description()); -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("entry.ts"); \ No newline at end of file +}); +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("entry.ts"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/cjs/output.js b/crates/compiler/tests/fixtures/tree_shake/cjs/output.js index 4a03de2425..f2cc32f3d2 100644 --- a/crates/compiler/tests/fixtures/tree_shake/cjs/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/cjs/output.js @@ -1,90 +1,34 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); +})(window["__farm_default_namespace__"].m, { + "3da733a3": function(module, exports, farmRequire, farmDynamicRequire) { + module.exports = function() { + return 'b'; + }; + }, + "a3823798": function(module, exports, farmRequire, farmDynamicRequire) { + const b = farmRequire("3da733a3"); + function a() { + return b(); + } + module.exports = { + a, + b + }; + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_cjs_1 = farmRequire.i(farmRequire("a3823798")); + console.log(farmRequire.f(_f_cjs_1)); } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_6889.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"3da733a3":function (module, exports, farmRequire, farmDynamicRequire) { - module.exports = function() { - return 'b'; - }; -} -, -"a3823798":function (module, exports, farmRequire, farmDynamicRequire) { - const b = farmRequire("3da733a3", true); - function a() { - return b(); - } - module.exports = { - a, - b - }; -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_cjs_1 = module.i(farmRequire("a3823798")); - console.log(module.f(_f_cjs_1)); -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/compiled-vue-comp/output.js b/crates/compiler/tests/fixtures/tree_shake/compiled-vue-comp/output.js index 00e251e553..defcfe939a 100644 --- a/crates/compiler/tests/fixtures/tree_shake/compiled-vue-comp/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/compiled-vue-comp/output.js @@ -1,152 +1,98 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());window['__farm_default_namespace__'].m.se({ + "vue": window['vue'] || {} +}); +(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); +})(window["__farm_default_namespace__"].m, { + "8cea7e1d": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + exports.default = (a)=>a; + }, + "ae8e2392": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_vue = farmRequire('vue'); + var _f_vue1 = farmRequire("vue"); + const _imports_0 = "URL_ADDRESS"; + const _hoisted_1 = { + class: "container" + }; + const _hoisted_2 = _f_vue1.createStaticVNode("
\"Farm", 2); + const _hoisted_4 = { + href: "https://vuejs.org/", + target: "_blank" + }; + const HelloWorld = _f_vue.defineComponent({}); + const Formatter = _f_vue.defineComponent({}); + exports.default = _f_vue.defineComponent({ + __name: 'index', + setup (__props) { + return (_ctx, _cache)=>{ + const _component_el_button = _f_vue1.resolveComponent("el-button"); + const _component_my_svg_icon = _f_vue1.resolveComponent("my-svg-icon"); + const _component_el_config_provider = _f_vue1.resolveComponent("el-config-provider"); + return _f_vue1.openBlock(), _f_vue1.createElementBlock(_f_vue1.Fragment, null, [ + _f_vue1.createVNode(_component_el_button, { + type: "primary", + onClick: _cache[0] || (_cache[0] = ($event)=>_ctx.$router.push('/about')) + }, { + default: _f_vue1.withCtx(()=>[ + _f_vue1.createTextVNode("to about page") + ]), + _: 1 + }), + _f_vue1.createElementVNode("div", _hoisted_1, [ + _hoisted_2, + _f_vue1.createElementVNode("a", _hoisted_4, [ + _f_vue1.createVNode(_component_my_svg_icon, { + name: "icon-vue", + class: "logo", + style: { + "height": "6.25rem", + "width": "6.25rem" + } + }) + ]) + ]), + _f_vue1.createVNode(_component_el_config_provider, { + size: 'large', + "z-index": 3000 + }, { + default: _f_vue1.withCtx(()=>[ + _f_vue1.createVNode(HelloWorld, { + msg: "Farm + Vue" + }), + _f_vue1.createVNode(Formatter) + ]), + _: 1 + }) + ], 64); + }; + } + }); + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_comp = farmRequire.i(farmRequire("d1fd5279")); + var _f_comp1 = farmRequire("d1fd5279"); + farmRequire._e(exports, _f_comp1); + console.log(farmRequire.f(_f_comp)); + }, + "d1fd5279": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_comp_ts = farmRequire.i(farmRequire("ae8e2392")); + var _f_helper = farmRequire.i(farmRequire("8cea7e1d")); + var _f_comp_ts1 = farmRequire("ae8e2392"); + farmRequire._e(exports, _f_comp_ts1); + exports.default = farmRequire.f(_f_helper)(farmRequire.f(_f_comp_ts)); } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());window['__farm_default_namespace__'].__farm_module_system__.setExternalModules({"vue": (window['vue']||{}).default && !(window['vue']||{}).__esModule ? {...(window['vue']||{}),__esModule:true} : window['vue']||{}});(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_236f.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"8cea7e1d":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - exports.default = (a)=>a; -} -, -"ae8e2392":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_vue = farmRequire('vue'); - var _f_vue1 = farmRequire("vue"); - const _imports_0 = "URL_ADDRESS"; - const _hoisted_1 = { - class: "container" - }; - const _hoisted_2 = _f_vue1.createStaticVNode("
\"Farm", 2); - const _hoisted_4 = { - href: "https://vuejs.org/", - target: "_blank" - }; - const HelloWorld = _f_vue.defineComponent({}); - const Formatter = _f_vue.defineComponent({}); - exports.default = _f_vue.defineComponent({ - __name: 'index', - setup (__props) { - return (_ctx, _cache)=>{ - const _component_el_button = _f_vue1.resolveComponent("el-button"); - const _component_my_svg_icon = _f_vue1.resolveComponent("my-svg-icon"); - const _component_el_config_provider = _f_vue1.resolveComponent("el-config-provider"); - return _f_vue1.openBlock(), _f_vue1.createElementBlock(_f_vue1.Fragment, null, [ - _f_vue1.createVNode(_component_el_button, { - type: "primary", - onClick: _cache[0] || (_cache[0] = ($event)=>_ctx.$router.push('/about')) - }, { - default: _f_vue1.withCtx(()=>[ - _f_vue1.createTextVNode("to about page") - ]), - _: 1 - }), - _f_vue1.createElementVNode("div", _hoisted_1, [ - _hoisted_2, - _f_vue1.createElementVNode("a", _hoisted_4, [ - _f_vue1.createVNode(_component_my_svg_icon, { - name: "icon-vue", - class: "logo", - style: { - "height": "6.25rem", - "width": "6.25rem" - } - }) - ]) - ]), - _f_vue1.createVNode(_component_el_config_provider, { - size: 'large', - "z-index": 3000 - }, { - default: _f_vue1.withCtx(()=>[ - _f_vue1.createVNode(HelloWorld, { - msg: "Farm + Vue" - }), - _f_vue1.createVNode(Formatter) - ]), - _: 1 - }) - ], 64); - }; - } - }); -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_comp = module.i(farmRequire("d1fd5279")); - var _f_comp1 = farmRequire("d1fd5279"); - module._e(exports, _f_comp1); - console.log(module.f(_f_comp)); -} -, -"d1fd5279":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_comp_ts = module.i(farmRequire("ae8e2392")); - var _f_helper = module.i(farmRequire("8cea7e1d")); - var _f_comp_ts1 = farmRequire("ae8e2392"); - module._e(exports, _f_comp_ts1); - exports.default = module.f(_f_helper)(module.f(_f_comp_ts)); -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/css/output.js b/crates/compiler/tests/fixtures/tree_shake/css/output.js index d755410b25..7f2e5bb152 100644 --- a/crates/compiler/tests/fixtures/tree_shake/css/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/css/output.js @@ -1,90 +1,37 @@ +//farm_internal_runtime_index.js: + const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); + + //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; + import "./farm_internal_runtime_index.js";import "./index_3b2e.css";(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); +})(window["__farm_default_namespace__"].m, { + "44a34200": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "c", function() { + return c; + }); + ""; + var c = 2; + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_export = farmRequire("44a34200"); + console.log(_f_export.c); + }, + "def8d5dc": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + exports.default = "/logo-73d4a8.png"; } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_cb11.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"44a34200":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "c", function() { - return c; - }); - ""; - var c = 2; -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_export = farmRequire("44a34200"); - console.log(_f_export.c); -} -, -"def8d5dc":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - exports.default = "/logo-73d4a8.png"; -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); //index_3b2e.css: * { @@ -93,6 +40,5 @@ index_js_cjs(); background: url("/logo-73d4a8.png"); } - //logo-73d4a8.png: \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/cyclic_deps/output.js b/crates/compiler/tests/fixtures/tree_shake/cyclic_deps/output.js index 27732bd7cf..d9127bccd3 100644 --- a/crates/compiler/tests/fixtures/tree_shake/cyclic_deps/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/cyclic_deps/output.js @@ -1,86 +1,31 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); +})(window["__farm_default_namespace__"].m, { + "05ee5ec7": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "a", function() { + return a; + }); + farmRequire("b5d64806"); + var a = '1'; + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "b", function() { + return b; + }); + var _f_dep = farmRequire("05ee5ec7"); + console.log(_f_dep.a); + var b = '2'; } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_ddf1.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"05ee5ec7":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "a", function() { - return a; - }); - farmRequire("b5d64806"); - var a = '1'; -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "b", function() { - return b; - }); - var _f_dep = farmRequire("05ee5ec7"); - console.log(_f_dep.a); - var b = '2'; -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806");var b=entry.b;export { b }; \ No newline at end of file +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806");var __farm_entry_b__=__farm_entry__.b;export {__farm_entry_b__ as b}; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/cyclic_export_all/output.js b/crates/compiler/tests/fixtures/tree_shake/cyclic_export_all/output.js index 7f217d8bcd..1a93f06661 100644 --- a/crates/compiler/tests/fixtures/tree_shake/cyclic_export_all/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/cyclic_export_all/output.js @@ -1,104 +1,46 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); +})(window["__farm_default_namespace__"].m, { + "569704c1": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_b = farmRequire("f380ea31"); + farmRequire._e(exports, _f_b); + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_a = farmRequire("569704c1"); + console.log(_f_a.c1); + }, + "c23f7b06": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "d1", function() { + return d1; + }); + var d1 = 3; + }, + "f06623f5": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "c1", function() { + return c1; + }); + farmRequire("f380ea31"); + var c1 = 1; + }, + "f380ea31": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_d = farmRequire("c23f7b06"); + var _f_c = farmRequire("f06623f5"); + farmRequire._e(exports, _f_c); + console.log(_f_d.d1); } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_dd58.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"569704c1":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_b = farmRequire("f380ea31"); - module._e(exports, _f_b); -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_a = farmRequire("569704c1"); - console.log(_f_a.c1); -} -, -"c23f7b06":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "d1", function() { - return d1; - }); - var d1 = 3; -} -, -"f06623f5":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "c1", function() { - return c1; - }); - farmRequire("f380ea31"); - var c1 = 1; -} -, -"f380ea31":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_d = farmRequire("c23f7b06"); - var _f_c = farmRequire("f06623f5"); - module._e(exports, _f_c); - console.log(_f_d.d1); -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/decl/self-ref/output.js b/crates/compiler/tests/fixtures/tree_shake/decl/self-ref/output.js index bdc62378e8..0a3574bc4e 100644 --- a/crates/compiler/tests/fixtures/tree_shake/decl/self-ref/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/decl/self-ref/output.js @@ -1,84 +1,29 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); +})(window["__farm_default_namespace__"].m, { + "3e3af5b6": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var rsAstralRange = '\\ud800-\\udfff', rsComboMarksRange = '\\u0300-\\u036f', reComboHalfMarksRange = '\\ufe20-\\ufe2f', rsComboSymbolsRange = '\\u20d0-\\u20ff', rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsVarRange = '\\ufe0e\\ufe0f'; + var rsZWJ = '\\u200d'; + var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); + function hasUnicode(string) { + return reHasUnicode.test(string); + } + exports.default = hasUnicode; + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_dep = farmRequire.i(farmRequire("3e3af5b6")); + console.log(farmRequire.f(_f_dep)('123')); } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_d7d4.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"3e3af5b6":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var rsAstralRange = '\\ud800-\\udfff', rsComboMarksRange = '\\u0300-\\u036f', reComboHalfMarksRange = '\\ufe20-\\ufe2f', rsComboSymbolsRange = '\\u20d0-\\u20ff', rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsVarRange = '\\ufe0e\\ufe0f'; - var rsZWJ = '\\u200d'; - var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); - function hasUnicode(string) { - return reHasUnicode.test(string); - } - exports.default = hasUnicode; -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_dep = module.i(farmRequire("3e3af5b6")); - console.log(module.f(_f_dep)('123')); -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/deep_dynamic_import/output.js b/crates/compiler/tests/fixtures/tree_shake/deep_dynamic_import/output.js index a60d92727e..bda50b569f 100644 --- a/crates/compiler/tests/fixtures/tree_shake/deep_dynamic_import/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/deep_dynamic_import/output.js @@ -1,103 +1,58 @@ //dep_8b00.js: - (function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("dep_8b00.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"05ee5ec7":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "dep", function() { - return dep; - }); - var _f_dep1 = module.i(farmRequire("ef0c4c9d")); - var dep = 'dep'; - exports.default = function() { - return module.f(_f_dep1)(); - }; - console.log('side effect in dep.ts'); -} -, -"ef0c4c9d":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - exports.default = function() { - console.log('1111'); - }; -} -,}); - -//index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; + (function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); +})(window["__farm_default_namespace__"].m, { + "05ee5ec7": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "dep", function() { + return dep; + }); + var _f_dep1 = farmRequire.i(farmRequire("ef0c4c9d")); + var dep = 'dep'; + exports.default = function() { + return farmRequire.f(_f_dep1)(); + }; + console.log('side effect in dep.ts'); + }, + "ef0c4c9d": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + exports.default = function() { + console.log('1111'); + }; } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_5d9b.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"7c4a34c2":async function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - exports.default = await farmDynamicRequire("05ee5ec7"); + + +//index.js: + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('dynamic-import.ts'); } -, -"b5d64806":async function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - const [_f_main__f] = await Promise.all([ - farmRequire("7c4a34c2") - ]); - var _f_main = module.i(_f_main__f); - console.log(module.f(_f_main)); +function initModuleSystem$1() { + console.log('module-helper.ts'); } -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([{ path: 'dep_8b00.js', type: 0 }],{ '05ee5ec7': [0] });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +initModuleSystem(moduleSystem); +initModuleSystem$1(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); + } +})(window["__farm_default_namespace__"].m, { + "7c4a34c2": async function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + exports.default = await farmDynamicRequire("05ee5ec7"); + }, + "b5d64806": async function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + const [_f_main__f] = await Promise.all([ + farmRequire("7c4a34c2") + ]); + var _f_main = farmRequire.i(_f_main__f); + console.log(farmRequire.f(_f_main)); + } +}); +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.si([]);__farm_ms__.sd([{ path: 'dep_8b00.js', type: 0 }],{ '05ee5ec7': [0] });__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/dynamic-import/output.js b/crates/compiler/tests/fixtures/tree_shake/dynamic-import/output.js index 7ab879b675..74c7d537a8 100644 --- a/crates/compiler/tests/fixtures/tree_shake/dynamic-import/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/dynamic-import/output.js @@ -1,95 +1,51 @@ //dep_8b00.js: - (function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("dep_8b00.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"05ee5ec7":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "dep", function() { - return dep; - }); - var _f_dep1 = module.i(farmRequire("ef0c4c9d")); - var dep = 'dep'; - exports.default = function() { - return module.f(_f_dep1)(); - }; - console.log('side effect in dep.ts'); -} -, -"ef0c4c9d":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - exports.default = function() { - console.log('1111'); - }; -} -,}); + (function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); + } +})(window["__farm_default_namespace__"].m, { + "05ee5ec7": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "dep", function() { + return dep; + }); + var _f_dep1 = farmRequire.i(farmRequire("ef0c4c9d")); + var dep = 'dep'; + exports.default = function() { + return farmRequire.f(_f_dep1)(); + }; + console.log('side effect in dep.ts'); + }, + "ef0c4c9d": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + exports.default = function() { + console.log('1111'); + }; + } +}); + //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('dynamic-import.ts'); +} +function initModuleSystem$1() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +initModuleSystem$1(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); +})(window["__farm_default_namespace__"].m, { + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmDynamicRequire("05ee5ec7").then((dep)=>{ + console.log(dep); + }); } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_dcdc.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - farmDynamicRequire("05ee5ec7").then((dep)=>{ - console.log(dep); - }); -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([{ path: 'dep_8b00.js', type: 0 }],{ '05ee5ec7': [0] });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.si([]);__farm_ms__.sd([{ path: 'dep_8b00.js', type: 0 }],{ '05ee5ec7': [0] });__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/empty_module/output.js b/crates/compiler/tests/fixtures/tree_shake/empty_module/output.js index 25c7ad63fb..b24650f1f6 100644 --- a/crates/compiler/tests/fixtures/tree_shake/empty_module/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/empty_module/output.js @@ -1,81 +1,20 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); +})(window["__farm_default_namespace__"].m, { + "569704c1": function(module, exports, farmRequire, farmDynamicRequire) {}, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_a = farmRequire("569704c1"); + farmRequire._e(exports, _f_a); } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_6b9f.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"569704c1":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_b = farmRequire("f380ea31"); - module._e(exports, _f_b); -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_a = farmRequire("569704c1"); - module._e(exports, _f_a); -} -, -"f380ea31":function (module, exports, farmRequire, farmDynamicRequire) {} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/empty_specifier_export_all/output.js b/crates/compiler/tests/fixtures/tree_shake/empty_specifier_export_all/output.js index b3366f8b79..ac1d469076 100644 --- a/crates/compiler/tests/fixtures/tree_shake/empty_specifier_export_all/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/empty_specifier_export_all/output.js @@ -1,93 +1,37 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); +})(window["__farm_default_namespace__"].m, { + "05ee5ec7": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_dep1 = farmRequire("ef0c4c9d"); + farmRequire._e(exports, _f_dep1); + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_dep = farmRequire("05ee5ec7"); + farmRequire._e(exports, _f_dep); + exports.default = 2; + }, + "ef0c4c9d": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "a", function() { + return a; + }); + farmRequire.o(exports, "b", function() { + return b; + }); + var a = '1'; + var b = '2'; + console.log(a, b); } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_b85a.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"05ee5ec7":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_dep1 = farmRequire("ef0c4c9d"); - module._e(exports, _f_dep1); -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_dep = farmRequire("05ee5ec7"); - module._e(exports, _f_dep); - exports.default = 2; -} -, -"ef0c4c9d":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "a", function() { - return a; - }); - module.o(exports, "b", function() { - return b; - }); - var a = '1'; - var b = '2'; - console.log(a, b); -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806");var a=entry.a;export { a };var b=entry.b;export { b };export default entry.default || entry; \ No newline at end of file +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806");var __farm_entry_a__=__farm_entry__.a;var __farm_entry_b__=__farm_entry__.b;var __farm_entry_default__=__farm_entry__.default;export {__farm_entry_a__ as a,__farm_entry_b__ as b,__farm_entry_default__ as default}; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/empty_specifiers/output.js b/crates/compiler/tests/fixtures/tree_shake/empty_specifiers/output.js index f218c98c89..e3fd19cabb 100644 --- a/crates/compiler/tests/fixtures/tree_shake/empty_specifiers/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/empty_specifiers/output.js @@ -1,88 +1,35 @@ +//farm_internal_runtime_index.js: + const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); + + //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; + import "./farm_internal_runtime_index.js";import "./index_337c.css";(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); +})(window["__farm_default_namespace__"].m, { + "6f462555": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + ""; + exports.default = 'comp'; + }, + "b3d9bc98": function(module, exports, farmRequire, farmDynamicRequire) { + console.log('resolved.ts'); + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire("b3d9bc98"); + var _f_comp = farmRequire.i(farmRequire("6f462555")); + console.log(farmRequire.f(_f_comp)); + exports.default = 2; } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_5de5.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"6f462555":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - ""; - exports.default = 'comp'; -} -, -"b3d9bc98":function (module, exports, farmRequire, farmDynamicRequire) { - console.log('resolved.ts'); -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - farmRequire("b3d9bc98"); - var _f_comp = module.i(farmRequire("6f462555")); - console.log(module.f(_f_comp)); - exports.default = 2; -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806");export default entry.default || entry; +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806");var __farm_entry_default__=__farm_entry__.default;export {__farm_entry_default__ as default}; //index_337c.css: .body { diff --git a/crates/compiler/tests/fixtures/tree_shake/export_all/a.ts b/crates/compiler/tests/fixtures/tree_shake/export_all/a.ts index b93abce260..a63c001dca 100644 --- a/crates/compiler/tests/fixtures/tree_shake/export_all/a.ts +++ b/crates/compiler/tests/fixtures/tree_shake/export_all/a.ts @@ -1 +1,2 @@ export * from './b'; +export * from './c'; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/export_all/c.ts b/crates/compiler/tests/fixtures/tree_shake/export_all/c.ts new file mode 100644 index 0000000000..406dddf822 --- /dev/null +++ b/crates/compiler/tests/fixtures/tree_shake/export_all/c.ts @@ -0,0 +1 @@ +export const c_str = 'c_str'; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/export_all/output.js b/crates/compiler/tests/fixtures/tree_shake/export_all/output.js index a548b49ac9..43b5571605 100644 --- a/crates/compiler/tests/fixtures/tree_shake/export_all/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/export_all/output.js @@ -1,87 +1,31 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); +})(window["__farm_default_namespace__"].m, { + "569704c1": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_b = farmRequire("f380ea31"); + farmRequire._e(exports, _f_b); + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_a = farmRequire("569704c1"); + console.log(_f_a.b); + }, + "f380ea31": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "b", function() { + return b; + }); + var b = '2'; } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_6b9f.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"569704c1":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_b = farmRequire("f380ea31"); - module._e(exports, _f_b); -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_a = farmRequire("569704c1"); - console.log(_f_a.b); -} -, -"f380ea31":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "b", function() { - return b; - }); - var b = '2'; -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/farm_config/output.js b/crates/compiler/tests/fixtures/tree_shake/farm_config/output.js index 951026014f..adcdb8059c 100644 --- a/crates/compiler/tests/fixtures/tree_shake/farm_config/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/farm_config/output.js @@ -1,97 +1,44 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); -}); -index_js_cjs(); -})());window['__farm_default_namespace__'].__farm_module_system__.setExternalModules({"module": (window['module']||{}).default && !(window['module']||{}).__esModule ? {...(window['module']||{}),__esModule:true} : window['module']||{}});(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_7f1c.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"052dab48":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - exports.default = { - main: './main.tsx' - }; + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); } -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_module = farmRequire('module'); - var _f_config = farmRequire("edceee38"); - var _f_util = module.i(farmRequire("052dab48")); - exports.default = _f_config.defineFarmConfig({ - compilation: { - input: module.f(_f_util), - external: _f_module.builtinModules +initModuleSystem(moduleSystem); +}());window['__farm_default_namespace__'].m.se({ + "module": window['module'] || {} +}); +(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); + } +})(window["__farm_default_namespace__"].m, { + "052dab48": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + exports.default = { + main: './main.tsx' + }; + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_module = farmRequire('module'); + var _f_config = farmRequire("edceee38"); + var _f_util = farmRequire.i(farmRequire("052dab48")); + exports.default = _f_config.defineFarmConfig({ + compilation: { + input: farmRequire.f(_f_util), + external: _f_module.builtinModules + } + }); + }, + "edceee38": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "defineFarmConfig", function() { + return defineFarmConfig; + }); + function defineFarmConfig(userConfig) { + return userConfig; } - }); -} -, -"edceee38":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "defineFarmConfig", function() { - return defineFarmConfig; - }); - function defineFarmConfig(userConfig) { - return userConfig; } -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806");export default entry.default || entry; \ No newline at end of file +}); +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806");var __farm_entry_default__=__farm_entry__.default;export {__farm_entry_default__ as default}; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/html_entry/basic/output.js b/crates/compiler/tests/fixtures/tree_shake/html_entry/basic/output.js index 6908b976e9..57a6ee6525 100644 --- a/crates/compiler/tests/fixtures/tree_shake/html_entry/basic/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/html_entry/basic/output.js @@ -1,89 +1,24 @@ //index.html: - - - - - - + + + + Document - + - + //index_564c.js: - (function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_564c.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"7c4a34c2":function (module, exports, farmRequire, farmDynamicRequire) { - console.log('1111'); -} -,}); \ No newline at end of file + (function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); + } +})(window["__farm_default_namespace__"].m, { + "7c4a34c2": function(module, exports, farmRequire, farmDynamicRequire) { + console.log('1111'); + } +}); diff --git a/crates/compiler/tests/fixtures/tree_shake/import-glob-eager/output.js b/crates/compiler/tests/fixtures/tree_shake/import-glob-eager/output.js index b328c6c6dd..0bb7903d96 100644 --- a/crates/compiler/tests/fixtures/tree_shake/import-glob-eager/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/import-glob-eager/output.js @@ -1,107 +1,51 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); +})(window["__farm_default_namespace__"].m, { + "05ee5ec7": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "routes", function() { + return routes; + }); + var _f_dep = farmRequire.w(farmRequire("edfa0cee")); + var __glob__0_0 = _f_dep; + var routes = { + "./modules/dep.ts": __glob__0_0 + }; + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_dep = farmRequire("05ee5ec7"); + console.log(_f_dep.routes); + }, + "edfa0cee": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + exports.default = { + path: "/vue-flow", + redirect: "/vue-flow/index", + meta: { + icon: "ep:set-up", + title: "vue-flow" + }, + children: [ + { + path: "/vue-flow/index", + name: "VueFlow", + meta: { + title: "vue-flow", + extraIcon: "IF-pure-iconfont-new svg" + } + } + ] + }; } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_de21.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"05ee5ec7":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "routes", function() { - return routes; - }); - var _f_dep = module.w(farmRequire("edfa0cee")); - var __glob__0_0 = _f_dep; - var routes = { - "./modules/dep.ts": __glob__0_0 - }; -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_dep = farmRequire("05ee5ec7"); - console.log(_f_dep.routes); -} -, -"edfa0cee":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - exports.default = { - path: "/vue-flow", - redirect: "/vue-flow/index", - meta: { - icon: "ep:set-up", - title: "vue-flow" - }, - children: [ - { - path: "/vue-flow/index", - name: "VueFlow", - meta: { - title: "vue-flow", - extraIcon: "IF-pure-iconfont-new svg" - } - } - ] - }; -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/import_meta_hot/output.js b/crates/compiler/tests/fixtures/tree_shake/import_meta_hot/output.js index 9b760537de..355d35fb6a 100644 --- a/crates/compiler/tests/fixtures/tree_shake/import_meta_hot/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/import_meta_hot/output.js @@ -1,105 +1,50 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); + } +})(window["__farm_default_namespace__"].m, { + "05ee5ec7": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "a", function() { + return a; + }); + farmRequire.o(exports, "invalidate", function() { + return invalidate; + }); + ; + var a = '1'; + function invalidate() { + return `invalidate data`; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "InvalidateParent", function() { + return InvalidateParent; + }); + var _f_dep = farmRequire("05ee5ec7"); + console.log(_f_dep.a); + const id = "InvalidateParent"; + function InvalidateParent() { + return { + render: ()=>{ + const renderData = _f_dep.invalidate(); + const div = document.createElement("div", {}); + div.id = id; + div.innerText = renderData; + div.className = "box"; + return div; + } + }; } + ; } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_ddf1.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"05ee5ec7":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "a", function() { - return a; - }); - module.o(exports, "invalidate", function() { - return invalidate; - }); - ; - var a = '1'; - function invalidate() { - return `invalidate data`; - } -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "InvalidateParent", function() { - return InvalidateParent; - }); - var _f_dep = farmRequire("05ee5ec7"); - console.log(_f_dep.a); - const id = "InvalidateParent"; - function InvalidateParent() { - return { - render: ()=>{ - const renderData = _f_dep.invalidate(); - const div = document.createElement("div", {}); - div.id = id; - div.innerText = renderData; - div.className = "box"; - return div; - } - }; - } - ; -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806");var InvalidateParent=entry.InvalidateParent;export { InvalidateParent }; \ No newline at end of file +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806");var __farm_entry_InvalidateParent__=__farm_entry__.InvalidateParent;export {__farm_entry_InvalidateParent__ as InvalidateParent}; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/import_namespace/output.js b/crates/compiler/tests/fixtures/tree_shake/import_namespace/output.js index 0a1ae74ec0..c49b11ecfa 100644 --- a/crates/compiler/tests/fixtures/tree_shake/import_namespace/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/import_namespace/output.js @@ -1,90 +1,35 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); +})(window["__farm_default_namespace__"].m, { + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_b = farmRequire.w(farmRequire("f380ea31")); + var A = _f_b; + console.log(A); + }, + "f380ea31": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "A", function() { + return A; + }); + farmRequire.o(exports, "B", function() { + return B; + }); + farmRequire.o(exports, "C", function() { + return C; + }); + var A = 10; + var B = 20; + var C = 30; } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_7104.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_b = module.w(farmRequire("f380ea31")); - var A = _f_b; - console.log(A); -} -, -"f380ea31":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "A", function() { - return A; - }); - module.o(exports, "B", function() { - return B; - }); - module.o(exports, "C", function() { - return C; - }); - var A = 10; - var B = 20; - var C = 30; -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/import_namespace_partial/output.js b/crates/compiler/tests/fixtures/tree_shake/import_namespace_partial/output.js index 713572ed1e..6e3b224464 100644 --- a/crates/compiler/tests/fixtures/tree_shake/import_namespace_partial/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/import_namespace_partial/output.js @@ -1,88 +1,33 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); +})(window["__farm_default_namespace__"].m, { + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_b = farmRequire.w(farmRequire("f380ea31")); + var A = _f_b; + console.log(A.A); + const B = A['B']; + console.log(B); + }, + "f380ea31": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "A", function() { + return A; + }); + farmRequire.o(exports, "B", function() { + return B; + }); + var A = 10; + var B = 20; } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_7104.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_b = module.w(farmRequire("f380ea31")); - var A = _f_b; - console.log(A.A); - const B = A['B']; - console.log(B); -} -, -"f380ea31":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "A", function() { - return A; - }); - module.o(exports, "B", function() { - return B; - }); - var A = 10; - var B = 20; -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/issue_1424/output.js b/crates/compiler/tests/fixtures/tree_shake/issue_1424/output.js index 0674f72ac7..fc899bb89c 100644 --- a/crates/compiler/tests/fixtures/tree_shake/issue_1424/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/issue_1424/output.js @@ -1,86 +1,31 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); +})(window["__farm_default_namespace__"].m, { + "05ee5ec7": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "Holder", function() { + return Holder; + }); + const DEFAULT_DURATION = 3; + var Holder = React.forwardRef((props, ref)=>{ + const { duration = DEFAULT_DURATION } = props; + console.log(duration); + return null; + }); + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_dep = farmRequire("05ee5ec7"); + console.log(_f_dep.Holder); } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_ddf1.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"05ee5ec7":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "Holder", function() { - return Holder; - }); - const DEFAULT_DURATION = 3; - var Holder = React.forwardRef((props, ref)=>{ - const { duration = DEFAULT_DURATION } = props; - console.log(duration); - return null; - }); -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_dep = farmRequire("05ee5ec7"); - console.log(_f_dep.Holder); -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/issue_337/output.js b/crates/compiler/tests/fixtures/tree_shake/issue_337/output.js index 96db037584..5a73b6f3f8 100644 --- a/crates/compiler/tests/fixtures/tree_shake/issue_337/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/issue_337/output.js @@ -1,270 +1,213 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); + } +})(window["__farm_default_namespace__"].m, { + "066a321b": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "default", function() { + return resolve; + }); + const schemeRegex = /^[\w+.-]+:\/\//; + const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/; + const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i; + var UrlType; + (function(UrlType) { + UrlType[UrlType["Empty"] = 1] = "Empty"; + UrlType[UrlType["Hash"] = 2] = "Hash"; + UrlType[UrlType["Query"] = 3] = "Query"; + UrlType[UrlType["RelativePath"] = 4] = "RelativePath"; + UrlType[UrlType["AbsolutePath"] = 5] = "AbsolutePath"; + UrlType[UrlType["SchemeRelative"] = 6] = "SchemeRelative"; + UrlType[UrlType["Absolute"] = 7] = "Absolute"; + })(UrlType || (UrlType = {})); + function isAbsoluteUrl(input) { + return schemeRegex.test(input); } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + function isSchemeRelativeUrl(input) { + return input.startsWith('//'); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); -}); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_a93b.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"066a321b":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "default", function() { - return resolve; - }); - const schemeRegex = /^[\w+.-]+:\/\//; - const urlRegex = /^([\w+.-]+:)\/\/([^@/#?]*@)?([^:/#?]*)(:\d+)?(\/[^#?]*)?(\?[^#]*)?(#.*)?/; - const fileRegex = /^file:(?:\/\/((?![a-z]:)[^/#?]*)?)?(\/?[^#?]*)(\?[^#]*)?(#.*)?/i; - var UrlType; - (function(UrlType) { - UrlType[UrlType["Empty"] = 1] = "Empty"; - UrlType[UrlType["Hash"] = 2] = "Hash"; - UrlType[UrlType["Query"] = 3] = "Query"; - UrlType[UrlType["RelativePath"] = 4] = "RelativePath"; - UrlType[UrlType["AbsolutePath"] = 5] = "AbsolutePath"; - UrlType[UrlType["SchemeRelative"] = 6] = "SchemeRelative"; - UrlType[UrlType["Absolute"] = 7] = "Absolute"; - })(UrlType || (UrlType = {})); - function isAbsoluteUrl(input) { - return schemeRegex.test(input); - } - function isSchemeRelativeUrl(input) { - return input.startsWith('//'); - } - function isAbsolutePath(input) { - return input.startsWith('/'); - } - function isFileUrl(input) { - return input.startsWith('file:'); - } - function isRelative(input) { - return /^[.?#]/.test(input); - } - function parseAbsoluteUrl(input) { - const match = urlRegex.exec(input); - return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/', match[6] || '', match[7] || ''); - } - function parseFileUrl(input) { - const match = fileRegex.exec(input); - const path = match[2]; - return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path, match[3] || '', match[4] || ''); - } - function makeUrl(scheme, user, host, port, path, query, hash) { - return { - scheme, - user, - host, - port, - path, - query, - hash, - type: UrlType.Absolute - }; - } - function parseUrl(input) { - if (isSchemeRelativeUrl(input)) { - const url = parseAbsoluteUrl('http:' + input); - url.scheme = ''; - url.type = UrlType.SchemeRelative; - return url; + function isAbsolutePath(input) { + return input.startsWith('/'); + } + function isFileUrl(input) { + return input.startsWith('file:'); + } + function isRelative(input) { + return /^[.?#]/.test(input); } - if (isAbsolutePath(input)) { - const url = parseAbsoluteUrl('http://foo.com' + input); + function parseAbsoluteUrl(input) { + const match = urlRegex.exec(input); + return makeUrl(match[1], match[2] || '', match[3], match[4] || '', match[5] || '/', match[6] || '', match[7] || ''); + } + function parseFileUrl(input) { + const match = fileRegex.exec(input); + const path = match[2]; + return makeUrl('file:', '', match[1] || '', '', isAbsolutePath(path) ? path : '/' + path, match[3] || '', match[4] || ''); + } + function makeUrl(scheme, user, host, port, path, query, hash) { + return { + scheme, + user, + host, + port, + path, + query, + hash, + type: UrlType.Absolute + }; + } + function parseUrl(input) { + if (isSchemeRelativeUrl(input)) { + const url = parseAbsoluteUrl('http:' + input); + url.scheme = ''; + url.type = UrlType.SchemeRelative; + return url; + } + if (isAbsolutePath(input)) { + const url = parseAbsoluteUrl('http://foo.com' + input); + url.scheme = ''; + url.host = ''; + url.type = UrlType.AbsolutePath; + return url; + } + if (isFileUrl(input)) return parseFileUrl(input); + if (isAbsoluteUrl(input)) return parseAbsoluteUrl(input); + const url = parseAbsoluteUrl('http://foo.com/' + input); url.scheme = ''; url.host = ''; - url.type = UrlType.AbsolutePath; + url.type = input ? input.startsWith('?') ? UrlType.Query : input.startsWith('#') ? UrlType.Hash : UrlType.RelativePath : UrlType.Empty; return url; } - if (isFileUrl(input)) return parseFileUrl(input); - if (isAbsoluteUrl(input)) return parseAbsoluteUrl(input); - const url = parseAbsoluteUrl('http://foo.com/' + input); - url.scheme = ''; - url.host = ''; - url.type = input ? input.startsWith('?') ? UrlType.Query : input.startsWith('#') ? UrlType.Hash : UrlType.RelativePath : UrlType.Empty; - return url; - } - function stripPathFilename(path) { - if (path.endsWith('/..')) return path; - const index = path.lastIndexOf('/'); - return path.slice(0, index + 1); - } - function mergePaths(url, base) { - normalizePath(base, base.type); - if (url.path === '/') { - url.path = base.path; - } else { - url.path = stripPathFilename(base.path) + url.path; + function stripPathFilename(path) { + if (path.endsWith('/..')) return path; + const index = path.lastIndexOf('/'); + return path.slice(0, index + 1); } - } - function normalizePath(url, type) { - const rel = type <= UrlType.RelativePath; - const pieces = url.path.split('/'); - let pointer = 1; - let positive = 0; - let addTrailingSlash = false; - for(let i = 1; i < pieces.length; i++){ - const piece = pieces[i]; - if (!piece) { - addTrailingSlash = true; - continue; + function mergePaths(url, base) { + normalizePath(base, base.type); + if (url.path === '/') { + url.path = base.path; + } else { + url.path = stripPathFilename(base.path) + url.path; } - addTrailingSlash = false; - if (piece === '.') continue; - if (piece === '..') { - if (positive) { + } + function normalizePath(url, type) { + const rel = type <= UrlType.RelativePath; + const pieces = url.path.split('/'); + let pointer = 1; + let positive = 0; + let addTrailingSlash = false; + for(let i = 1; i < pieces.length; i++){ + const piece = pieces[i]; + if (!piece) { addTrailingSlash = true; - positive--; - pointer--; - } else if (rel) { - pieces[pointer++] = piece; + continue; } - continue; + addTrailingSlash = false; + if (piece === '.') continue; + if (piece === '..') { + if (positive) { + addTrailingSlash = true; + positive--; + pointer--; + } else if (rel) { + pieces[pointer++] = piece; + } + continue; + } + pieces[pointer++] = piece; + positive++; } - pieces[pointer++] = piece; - positive++; - } - let path = ''; - for(let i = 1; i < pointer; i++){ - path += '/' + pieces[i]; - } - if (!path || addTrailingSlash && !path.endsWith('/..')) { - path += '/'; + let path = ''; + for(let i = 1; i < pointer; i++){ + path += '/' + pieces[i]; + } + if (!path || addTrailingSlash && !path.endsWith('/..')) { + path += '/'; + } + url.path = path; } - url.path = path; - } - function resolve(input, base) { - if (!input && !base) return ''; - const url = parseUrl(input); - let inputType = url.type; - if (base && inputType !== UrlType.Absolute) { - const baseUrl = parseUrl(base); - const baseType = baseUrl.type; + function resolve(input, base) { + if (!input && !base) return ''; + const url = parseUrl(input); + let inputType = url.type; + if (base && inputType !== UrlType.Absolute) { + const baseUrl = parseUrl(base); + const baseType = baseUrl.type; + switch(inputType){ + case UrlType.Empty: + url.hash = baseUrl.hash; + case UrlType.Hash: + url.query = baseUrl.query; + case UrlType.Query: + case UrlType.RelativePath: + mergePaths(url, baseUrl); + case UrlType.AbsolutePath: + url.user = baseUrl.user; + url.host = baseUrl.host; + url.port = baseUrl.port; + case UrlType.SchemeRelative: + url.scheme = baseUrl.scheme; + } + if (baseType > inputType) inputType = baseType; + } + normalizePath(url, inputType); + const queryHash = url.query + url.hash; switch(inputType){ - case UrlType.Empty: - url.hash = baseUrl.hash; case UrlType.Hash: - url.query = baseUrl.query; case UrlType.Query: + return queryHash; case UrlType.RelativePath: - mergePaths(url, baseUrl); + { + const path = url.path.slice(1); + if (!path) return queryHash || '.'; + if (isRelative(base || input) && !isRelative(path)) { + return './' + path + queryHash; + } + return path + queryHash; + } case UrlType.AbsolutePath: - url.user = baseUrl.user; - url.host = baseUrl.host; - url.port = baseUrl.port; - case UrlType.SchemeRelative: - url.scheme = baseUrl.scheme; + return url.path + queryHash; + default: + return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash; } - if (baseType > inputType) inputType = baseType; - } - normalizePath(url, inputType); - const queryHash = url.query + url.hash; - switch(inputType){ - case UrlType.Hash: - case UrlType.Query: - return queryHash; - case UrlType.RelativePath: - { - const path = url.path.slice(1); - if (!path) return queryHash || '.'; - if (isRelative(base || input) && !isRelative(path)) { - return './' + path + queryHash; - } - return path + queryHash; - } - case UrlType.AbsolutePath: - return url.path + queryHash; - default: - return url.scheme + '//' + url.user + url.host + url.port + url.path + queryHash; } - } -} -, -"7cd09bc5":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f__root = module.i(farmRequire("b5147996")); - var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; - var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; - var moduleExports = freeModule && freeModule.exports === freeExports; - var Buffer = moduleExports ? module.f(_f__root).Buffer : undefined, allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined; - function cloneBuffer(buffer, isDeep) { - if (isDeep) { - return buffer.slice(); + }, + "7cd09bc5": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f__root = farmRequire.i(farmRequire("b5147996")); + var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + var moduleExports = freeModule && freeModule.exports === freeExports; + var Buffer = moduleExports ? farmRequire.f(_f__root).Buffer : undefined, allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined; + function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + buffer.copy(result); + return result; } - var length = buffer.length, result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); - buffer.copy(result); - return result; + exports.default = cloneBuffer; + }, + "b5147996": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + exports.default = '/home'; + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f__cloneBuffer = farmRequire.i(farmRequire("7cd09bc5")); + var _f_resolve_uri = farmRequire.i(farmRequire("066a321b")); + console.log(farmRequire.f(_f__cloneBuffer)(Buffer.from("test"))); + console.log(farmRequire.f(_f_resolve_uri)("test")); } - exports.default = cloneBuffer; -} -, -"b5147996":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - exports.default = '/home'; -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f__cloneBuffer = module.i(farmRequire("7cd09bc5")); - var _f_resolve_uri = module.i(farmRequire("066a321b")); - console.log(module.f(_f__cloneBuffer)(Buffer.from("test"))); - console.log(module.f(_f_resolve_uri)("test")); -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +}); +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/issue_344/output.js b/crates/compiler/tests/fixtures/tree_shake/issue_344/output.js index 97e94b8dfa..4550c48e82 100644 --- a/crates/compiler/tests/fixtures/tree_shake/issue_344/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/issue_344/output.js @@ -1,118 +1,62 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); +})(window["__farm_default_namespace__"].m, { + "4ef5be87": function(module, exports, farmRequire, farmDynamicRequire) { + module.exports = { + program: function() {} + }; + }, + "abc9a879": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "Argument", function() { + return Argument; + }); + farmRequire.o(exports, "Command", function() { + return Command; + }); + farmRequire.o(exports, "CommanderError", function() { + return CommanderError; + }); + farmRequire.o(exports, "Help", function() { + return Help; + }); + farmRequire.o(exports, "InvalidArgumentError", function() { + return InvalidArgumentError; + }); + farmRequire.o(exports, "InvalidOptionArgumentError", function() { + return InvalidOptionArgumentError; + }); + farmRequire.o(exports, "Option", function() { + return Option; + }); + farmRequire.o(exports, "createArgument", function() { + return createArgument; + }); + farmRequire.o(exports, "createCommand", function() { + return createCommand; + }); + farmRequire.o(exports, "createOption", function() { + return createOption; + }); + farmRequire.o(exports, "program", function() { + return program; + }); + var _f_command = farmRequire.i(farmRequire("4ef5be87")); + var { program, createCommand, createArgument, createOption, CommanderError, InvalidArgumentError, InvalidOptionArgumentError, Command, Argument, Option, Help } = farmRequire.f(_f_command); + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_esm = farmRequire("abc9a879"); + _f_esm.program(); } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_51e4.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"4ef5be87":function (module, exports, farmRequire, farmDynamicRequire) { - module.exports = { - program: function() {} - }; -} -, -"abc9a879":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "Argument", function() { - return Argument; - }); - module.o(exports, "Command", function() { - return Command; - }); - module.o(exports, "CommanderError", function() { - return CommanderError; - }); - module.o(exports, "Help", function() { - return Help; - }); - module.o(exports, "InvalidArgumentError", function() { - return InvalidArgumentError; - }); - module.o(exports, "InvalidOptionArgumentError", function() { - return InvalidOptionArgumentError; - }); - module.o(exports, "Option", function() { - return Option; - }); - module.o(exports, "createArgument", function() { - return createArgument; - }); - module.o(exports, "createCommand", function() { - return createCommand; - }); - module.o(exports, "createOption", function() { - return createOption; - }); - module.o(exports, "program", function() { - return program; - }); - var _f_command = module.i(farmRequire("4ef5be87")); - var { program, createCommand, createArgument, createOption, CommanderError, InvalidArgumentError, InvalidOptionArgumentError, Command, Argument, Option, Help } = module.f(_f_command); -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_esm = farmRequire("abc9a879"); - _f_esm.program(); -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/issue_625/output.js b/crates/compiler/tests/fixtures/tree_shake/issue_625/output.js index 6855c0fbdb..d73b950e7a 100644 --- a/crates/compiler/tests/fixtures/tree_shake/issue_625/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/issue_625/output.js @@ -1,106 +1,49 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); + } +})(window["__farm_default_namespace__"].m, { + "10c43cb2": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "registerTickMethod", function() { + return registerTickMethod; + }); + const cache = {}; + function registerTickMethod(id, method) { + cache[id] = method; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + }, + "11ecb1ee": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "scaleFunc", function() { + return scaleFunc; + }); + farmRequire("3e3af5b6"); + function scaleFunc() { + return 'tick'; + } + }, + "3e3af5b6": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_register = farmRequire("10c43cb2"); + _f_register.registerTickMethod('xxx', ()=>console.log('xxx')); + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "tick", function() { + return tick; + }); + var _f_dep_index = farmRequire("11ecb1ee"); + function tick() { + _f_dep_index.scaleFunc(); } } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_2c69.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"10c43cb2":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "registerTickMethod", function() { - return registerTickMethod; - }); - const cache = {}; - function registerTickMethod(id, method) { - cache[id] = method; - } -} -, -"11ecb1ee":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "scaleFunc", function() { - return scaleFunc; - }); - farmRequire("3e3af5b6"); - function scaleFunc() { - return 'tick'; - } -} -, -"3e3af5b6":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_register = farmRequire("10c43cb2"); - _f_register.registerTickMethod('xxx', ()=>console.log('xxx')); -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "tick", function() { - return tick; - }); - var _f_dep_index = farmRequire("11ecb1ee"); - function tick() { - _f_dep_index.scaleFunc(); - } -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806");var tick=entry.tick;export { tick }; \ No newline at end of file +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806");var __farm_entry_tick__=__farm_entry__.tick;export {__farm_entry_tick__ as tick}; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/non_script/output.js b/crates/compiler/tests/fixtures/tree_shake/non_script/output.js index b4f2c59708..0f2d51031c 100644 --- a/crates/compiler/tests/fixtures/tree_shake/non_script/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/non_script/output.js @@ -1,76 +1,25 @@ +//farm_internal_runtime_index.js: + const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); + + //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } + import "./farm_internal_runtime_index.js";import "./index_337c.css";(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; +})(window["__farm_default_namespace__"].m, { + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + ""; + console.log('Hello, world!'); } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_dcdc.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - ""; - console.log('Hello, world!'); -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); //index_337c.css: body { diff --git a/crates/compiler/tests/fixtures/tree_shake/partial_cyclic_deps/output.js b/crates/compiler/tests/fixtures/tree_shake/partial_cyclic_deps/output.js index 0e6c96d630..ce969e4f52 100644 --- a/crates/compiler/tests/fixtures/tree_shake/partial_cyclic_deps/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/partial_cyclic_deps/output.js @@ -1,101 +1,44 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); + } +})(window["__farm_default_namespace__"].m, { + "25593d80": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_b = farmRequire.i(farmRequire("f380ea31")); + farmRequire._(exports, "B1", _f_b, "default"); + var _f_a = farmRequire("569704c1"); + farmRequire._(exports, "A1", _f_a); + }, + "569704c1": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "A1", function() { + return A1; + }); + function A1() { + console.log('a1'); } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_exportAll = farmRequire("25593d80"); + console.log(_f_exportAll.B1, _f_exportAll.A1); + }, + "f380ea31": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "default", function() { + return B1; + }); + function B1() { + console.log('b1'); } } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_6d6c.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"25593d80":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_b = module.i(farmRequire("f380ea31")); - module._(exports, "B1", _f_b, "default"); - var _f_a = farmRequire("569704c1"); - module._(exports, "A1", _f_a); -} -, -"569704c1":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "A1", function() { - return A1; - }); - function A1() { - console.log('a1'); - } -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_exportAll = farmRequire("25593d80"); - console.log(_f_exportAll.B1, _f_exportAll.A1); -} -, -"f380ea31":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "default", function() { - return B1; - }); - function B1() { - console.log('b1'); - } -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/remove_module/output.js b/crates/compiler/tests/fixtures/tree_shake/remove_module/output.js index ae1e7a7162..324fd8d1cc 100644 --- a/crates/compiler/tests/fixtures/tree_shake/remove_module/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/remove_module/output.js @@ -1,83 +1,28 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); +})(window["__farm_default_namespace__"].m, { + "569704c1": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "appendA", function() { + return appendA; + }); + function appendA() { + return 'a'; + } + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_a = farmRequire("569704c1"); + console.log(_f_a.appendA()); } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_ecb7.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"569704c1":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "appendA", function() { - return appendA; - }); - function appendA() { - return 'a'; - } -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_a = farmRequire("569704c1"); - console.log(_f_a.appendA()); -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/self-executed/assign/output.js b/crates/compiler/tests/fixtures/tree_shake/self-executed/assign/output.js index 74d113b0d0..f779f27b89 100644 --- a/crates/compiler/tests/fixtures/tree_shake/self-executed/assign/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/self-executed/assign/output.js @@ -1,99 +1,43 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); + } +})(window["__farm_default_namespace__"].m, { + "569704c1": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_b = farmRequire.i(farmRequire("f380ea31")); + function MapCache(entries) { + var index = -1, length = entries == null ? 0 : entries.length; + this.clear(); + while(++index < length){ + var entry = entries[index]; + this.set(entry[0], entry[1]); + } } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + var a = null; + MapCache.prototype.clear = farmRequire.f(_f_b); + MapCache.prototype.clear = ()=>(a, farmRequire.f(_f_b)); + exports.default = MapCache; + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_a = farmRequire.i(farmRequire("569704c1")); + console.log(farmRequire.f(_f_a)); + }, + "f380ea31": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + function mapCacheClear() { + this.size = 0; + this.__data__ = {}; } + exports.default = mapCacheClear; } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_6b9f.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"569704c1":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_b = module.i(farmRequire("f380ea31")); - function MapCache(entries) { - var index = -1, length = entries == null ? 0 : entries.length; - this.clear(); - while(++index < length){ - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } - var a = null; - MapCache.prototype.clear = module.f(_f_b); - MapCache.prototype.clear = ()=>(a, module.f(_f_b)); - exports.default = MapCache; -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_a = module.i(farmRequire("569704c1")); - console.log(module.f(_f_a)); -} -, -"f380ea31":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - function mapCacheClear() { - this.size = 0; - this.__data__ = {}; - } - exports.default = mapCacheClear; -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/self-executed/axios/output.js b/crates/compiler/tests/fixtures/tree_shake/self-executed/axios/output.js index 5b78656373..f19f0b1925 100644 --- a/crates/compiler/tests/fixtures/tree_shake/self-executed/axios/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/self-executed/axios/output.js @@ -1,118 +1,63 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); + } +})(window["__farm_default_namespace__"].m, { + "05ee5ec7": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "AxiosURLSearchParams2", function() { + return AxiosURLSearchParams2; + }); + function encode(str) { + const charMap = { + '!': '%21', + "'": '%27', + '(': '%28', + ')': '%29', + '~': '%7E', + '%20': '+', + '%00': '\x00' + }; + return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { + return charMap[match]; }); } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + function AxiosURLSearchParams(params, options) { + this._pairs = []; + params; } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); -}); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_ddf1.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"05ee5ec7":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "AxiosURLSearchParams2", function() { - return AxiosURLSearchParams2; - }); - function encode(str) { - const charMap = { - '!': '%21', - "'": '%27', - '(': '%28', - ')': '%29', - '~': '%7E', - '%20': '+', - '%00': '\x00' + const prototype = AxiosURLSearchParams.prototype; + prototype.append = function append(name, value) { + this._pairs.push([ + name, + value + ]); }; - return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) { - return charMap[match]; - }); - } - function AxiosURLSearchParams(params, options) { - this._pairs = []; - params; - } - const prototype = AxiosURLSearchParams.prototype; - prototype.append = function append(name, value) { - this._pairs.push([ - name, - value - ]); - }; - prototype.toString = function toString(encoder) { - const _encode = encoder ? function(value) { - return encoder.call(this, value, encode); - } : encode; - return this._pairs.map(function each(pair) { - return _encode(pair[0]) + '=' + _encode(pair[1]); - }, '').join('&'); - }; - exports.default = AxiosURLSearchParams; - function AxiosURLSearchParams2(params, options) { - this._pairs = []; - params; + prototype.toString = function toString(encoder) { + const _encode = encoder ? function(value) { + return encoder.call(this, value, encode); + } : encode; + return this._pairs.map(function each(pair) { + return _encode(pair[0]) + '=' + _encode(pair[1]); + }, '').join('&'); + }; + exports.default = AxiosURLSearchParams; + function AxiosURLSearchParams2(params, options) { + this._pairs = []; + params; + } + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_dep = farmRequire.w(farmRequire("05ee5ec7")); + console.log(farmRequire.f(_f_dep), _f_dep.AxiosURLSearchParams2); } -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_dep = module.w(farmRequire("05ee5ec7")); - console.log(module.f(_f_dep), _f_dep.AxiosURLSearchParams2); -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +}); +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/self-executed/class/static/output.js b/crates/compiler/tests/fixtures/tree_shake/self-executed/class/static/output.js index 52551e1f2b..4c5700ee8e 100644 --- a/crates/compiler/tests/fixtures/tree_shake/self-executed/class/static/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/self-executed/class/static/output.js @@ -1,84 +1,29 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); +})(window["__farm_default_namespace__"].m, { + "6d686e48": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "Foo", function() { + return Foo; + }); + class Foo { + static bar() {} + } + Foo.bar(); + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_foo = farmRequire("6d686e48"); + console.log(_f_foo.Foo); } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_e094.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"6d686e48":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "Foo", function() { - return Foo; - }); - class Foo { - static bar() {} - } - Foo.bar(); -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_foo = farmRequire("6d686e48"); - console.log(_f_foo.Foo); -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/self-executed/decl/basis/output.js b/crates/compiler/tests/fixtures/tree_shake/self-executed/decl/basis/output.js index 8dc9ec2ace..18145a60e3 100644 --- a/crates/compiler/tests/fixtures/tree_shake/self-executed/decl/basis/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/self-executed/decl/basis/output.js @@ -1,99 +1,44 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); + } +})(window["__farm_default_namespace__"].m, { + "569704c1": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var a1 = 11; + console.log(a1); + const aValue = 'a'; + var a = aValue; + console.log(a); + { + let c = 1000; + console.log(c); } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + function AAA() { + console.log('aaa'); } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); -}); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_ecb7.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"569704c1":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var a1 = 11; - console.log(a1); - const aValue = 'a'; - var a = aValue; - console.log(a); - { - let c = 1000; - console.log(c); - } - function AAA() { - console.log('aaa'); - } - AAA(); - class Foo { - constructor(){ - console.log('foo'); + AAA(); + class Foo { + constructor(){ + console.log('foo'); + } } + new Foo(); + exports.default = function() { + console.log('foo'); + }; + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_a = farmRequire.i(farmRequire("569704c1")); + console.log(farmRequire.f(_f_a)); } - new Foo(); - exports.default = function() { - console.log('foo'); - }; -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_a = module.i(farmRequire("569704c1")); - console.log(module.f(_f_a)); -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +}); +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/self-executed/decl/class/output.js b/crates/compiler/tests/fixtures/tree_shake/self-executed/decl/class/output.js index a63693c3ac..4b1885a2ad 100644 --- a/crates/compiler/tests/fixtures/tree_shake/self-executed/decl/class/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/self-executed/decl/class/output.js @@ -1,101 +1,46 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); + } +})(window["__farm_default_namespace__"].m, { + "05ee5ec7": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "Foo", function() { + return Foo; + }); + class Foo { } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + Foo.create = function() { + return new Validate(); + }; + class Validate { + constructor(obj, options){ + this.obj = obj; + this.options = options; + this.globalConfig = BValidate.globalConfig; + } } + var BValidate = function(obj, options) { + return new Validate(obj, Object.assign({ + field: 'value' + }, options)); + }; + BValidate.globalConfig = {}; + BValidate.setGlobalConfig = function(options) { + BValidate.globalConfig = options || {}; + }; + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_dep = farmRequire("05ee5ec7"); + console.log(_f_dep.Foo); } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_ddf1.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"05ee5ec7":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "Foo", function() { - return Foo; - }); - class Foo { - } - Foo.create = function() { - return new Validate(); - }; - class Validate { - constructor(obj, options){ - this.obj = obj; - this.options = options; - this.globalConfig = BValidate.globalConfig; - } - } - var BValidate = function(obj, options) { - return new Validate(obj, Object.assign({ - field: 'value' - }, options)); - }; - BValidate.globalConfig = {}; - BValidate.setGlobalConfig = function(options) { - BValidate.globalConfig = options || {}; - }; -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_dep = farmRequire("05ee5ec7"); - console.log(_f_dep.Foo); -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/self-executed/decl/function/output.js b/crates/compiler/tests/fixtures/tree_shake/self-executed/decl/function/output.js index 2575c02e7b..e2103dd5c9 100644 --- a/crates/compiler/tests/fixtures/tree_shake/self-executed/decl/function/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/self-executed/decl/function/output.js @@ -1,82 +1,27 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); +})(window["__farm_default_namespace__"].m, { + "05ee5ec7": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + function foo() {} + foo.create = function() { + console.log('hello world'); + }; + exports.default = foo; + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_dep = farmRequire.i(farmRequire("05ee5ec7")); + console.log(farmRequire.f(_f_dep)); } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_ddf1.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"05ee5ec7":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - function foo() {} - foo.create = function() { - console.log('hello world'); - }; - exports.default = foo; -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_dep = module.i(farmRequire("05ee5ec7")); - console.log(module.f(_f_dep)); -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/self-executed/decl/var_side_effect/a.js b/crates/compiler/tests/fixtures/tree_shake/self-executed/decl/var_side_effect/a.js index a2a8ed45e7..da47f29baf 100644 --- a/crates/compiler/tests/fixtures/tree_shake/self-executed/decl/var_side_effect/a.js +++ b/crates/compiler/tests/fixtures/tree_shake/self-executed/decl/var_side_effect/a.js @@ -1,4 +1,3 @@ -/* eslint-disable import/prefer-default-export */ function invariant(condition, message) { if (condition) return; var error = new Error('loadable: ' + message); @@ -7,7 +6,6 @@ function invariant(condition, message) { throw error; } function warn(message) { - // eslint-disable-next-line no-console console.warn('loadable: ' + message); } @@ -461,14 +459,11 @@ function createLoadable(_ref) { } function defaultResolveComponent(loadedModule) { - // eslint-disable-next-line no-underscore-dangle return loadedModule.__esModule ? loadedModule['default'] : loadedModule['default'] || loadedModule; } -/* eslint-disable no-use-before-define, react/no-multi-comp */ - var _createLoadable = /*#__PURE__*/ createLoadable({ @@ -482,8 +477,6 @@ var _createLoadable = loadable = _createLoadable.loadable, lazy = _createLoadable.lazy; -/* eslint-disable no-use-before-define, react/no-multi-comp */ - var _createLoadable$1 = /*#__PURE__*/ createLoadable({ @@ -510,7 +503,6 @@ var _createLoadable$1 = loadable$1 = _createLoadable$1.loadable, lazy$1 = _createLoadable$1.lazy; -/* eslint-disable no-underscore-dangle, camelcase */ var BROWSER = typeof window !== 'undefined'; function loadableReady(done, _temp) { if (done === void 0) { @@ -597,7 +589,6 @@ function loadableReady(done, _temp) { }).then(done); } -/* eslint-disable no-underscore-dangle */ var loadable$2 = loadable; loadable$2.lib = loadable$1; var lazy$2 = lazy; diff --git a/crates/compiler/tests/fixtures/tree_shake/self-executed/decl/var_side_effect/output.js b/crates/compiler/tests/fixtures/tree_shake/self-executed/decl/var_side_effect/output.js index 640bfd8423..9fc2f6f4ad 100644 --- a/crates/compiler/tests/fixtures/tree_shake/self-executed/decl/var_side_effect/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/self-executed/decl/var_side_effect/output.js @@ -1,378 +1,323 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); -}); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_5314.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_a = module.i(farmRequire("fa8c9120")); - console.log(module.f(_f_a)()); + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); } -, -"fa8c9120":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - function invariant(condition, message) { - if (condition) return; - var error = new Error('loadable: ' + message); - error.framesToPop = 1; - error.name = 'Invariant Violation'; - throw error; +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); } - var Context = React.createContext(); - var LOADABLE_SHARED = { - initialChunks: {} - }; - var STATUS_PENDING = 'PENDING'; - var STATUS_RESOLVED = 'RESOLVED'; - var STATUS_REJECTED = 'REJECTED'; - function resolveConstructor(ctor) { - if (typeof ctor === 'function') { - return { - requireAsync: ctor, - resolve: function resolve() { - return undefined; - }, - chunkName: function chunkName() { - return undefined; - } - }; +})(window["__farm_default_namespace__"].m, { + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_a = farmRequire.i(farmRequire("fa8c9120")); + console.log(farmRequire.f(_f_a)()); + }, + "fa8c9120": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + function invariant(condition, message) { + if (condition) return; + var error = new Error('loadable: ' + message); + error.framesToPop = 1; + error.name = 'Invariant Violation'; + throw error; } - return ctor; - } - var withChunkExtractor = function withChunkExtractor(Component) { - var LoadableWithChunkExtractor = function LoadableWithChunkExtractor(props) { - return React.createElement(Context.Consumer, null, function(extractor) { - return React.createElement(Component, Object.assign({ - __chunkExtractor: extractor - }, props)); - }); + var Context = React.createContext(); + var LOADABLE_SHARED = { + initialChunks: {} }; - if (Component.displayName) { - LoadableWithChunkExtractor.displayName = Component.displayName + 'WithChunkExtractor'; - } - return LoadableWithChunkExtractor; - }; - var identity = function identity(v) { - return v; - }; - function createLoadable(_ref) { - var _ref$defaultResolveCo = _ref.defaultResolveComponent, defaultResolveComponent = _ref$defaultResolveCo === void 0 ? identity : _ref$defaultResolveCo, _render = _ref.render, onLoad = _ref.onLoad; - function loadable(loadableConstructor, options) { - if (options === void 0) { - options = {}; - } - var ctor = resolveConstructor(loadableConstructor); - var cache = {}; - function _getCacheKey(props) { - if (options.cacheKey) { - return options.cacheKey(props); - } - if (ctor.resolve) { - return ctor.resolve(props); - } - return 'static'; + var STATUS_PENDING = 'PENDING'; + var STATUS_RESOLVED = 'RESOLVED'; + var STATUS_REJECTED = 'REJECTED'; + function resolveConstructor(ctor) { + if (typeof ctor === 'function') { + return { + requireAsync: ctor, + resolve: function resolve() { + return undefined; + }, + chunkName: function chunkName() { + return undefined; + } + }; } - function resolve(module1, props, Loadable) { - var Component = options.resolveComponent ? options.resolveComponent(module1, props) : defaultResolveComponent(module1); - if (options.resolveComponent && !isValidElementType(Component)) { - throw new Error('resolveComponent returned something that is not a React component!'); - } - hoistNonReactStatics(Loadable, Component, { - preload: true + return ctor; + } + var withChunkExtractor = function withChunkExtractor(Component) { + var LoadableWithChunkExtractor = function LoadableWithChunkExtractor(props) { + return React.createElement(Context.Consumer, null, function(extractor) { + return React.createElement(Component, Object.assign({ + __chunkExtractor: extractor + }, props)); }); - return Component; + }; + if (Component.displayName) { + LoadableWithChunkExtractor.displayName = Component.displayName + 'WithChunkExtractor'; } - var cachedLoad = function cachedLoad(props) { - var cacheKey = _getCacheKey(props); - var promise = cache[cacheKey]; - if (!promise || promise.status === STATUS_REJECTED) { - promise = ctor.requireAsync(props); - promise.status = STATUS_PENDING; - cache[cacheKey] = promise; - promise.then(function() { - promise.status = STATUS_RESOLVED; - }, function(error) { - console.error('loadable-components: failed to asynchronously load component', { - fileName: ctor.resolve(props), - chunkName: ctor.chunkName(props), - error: error ? error.message : error - }); - promise.status = STATUS_REJECTED; - }); + return LoadableWithChunkExtractor; + }; + var identity = function identity(v) { + return v; + }; + function createLoadable(_ref) { + var _ref$defaultResolveCo = _ref.defaultResolveComponent, defaultResolveComponent = _ref$defaultResolveCo === void 0 ? identity : _ref$defaultResolveCo, _render = _ref.render, onLoad = _ref.onLoad; + function loadable(loadableConstructor, options) { + if (options === void 0) { + options = {}; } - return promise; - }; - var InnerLoadable = function(_React$Component) { - _inheritsLoose(InnerLoadable, _React$Component); - InnerLoadable.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) { - var cacheKey = _getCacheKey(props); - return _extends({}, state, { - cacheKey: cacheKey, - loading: state.loading || state.cacheKey !== cacheKey - }); - }; - function InnerLoadable(props) { - var _this; - _this = _React$Component.call(this, props) || this; - _this.state = { - result: null, - error: null, - loading: true, - cacheKey: _getCacheKey(props) - }; - invariant(!props.__chunkExtractor || ctor.requireSync, 'SSR requires `@loadable/babel-plugin`, please install it'); - if (props.__chunkExtractor) { - if (options.ssr === false) { - return _assertThisInitialized(_this); - } - ctor.requireAsync(props)['catch'](function() { - return null; - }); - _this.loadSync(); - props.__chunkExtractor.addChunk(ctor.chunkName(props)); - return _assertThisInitialized(_this); + var ctor = resolveConstructor(loadableConstructor); + var cache = {}; + function _getCacheKey(props) { + if (options.cacheKey) { + return options.cacheKey(props); } - if (options.ssr !== false && (ctor.isReady && ctor.isReady(props) || ctor.chunkName && LOADABLE_SHARED.initialChunks[ctor.chunkName(props)])) { - _this.loadSync(); + if (ctor.resolve) { + return ctor.resolve(props); } - return _this; + return 'static'; } - var _proto = InnerLoadable.prototype; - _proto.componentDidMount = function componentDidMount() { - this.mounted = true; - var cachedPromise = this.getCache(); - if (cachedPromise && cachedPromise.status === STATUS_REJECTED) { - this.setCache(); - } - if (this.state.loading) { - this.loadAsync(); + function resolve(module, props, Loadable) { + var Component = options.resolveComponent ? options.resolveComponent(module, props) : defaultResolveComponent(module); + if (options.resolveComponent && !isValidElementType(Component)) { + throw new Error('resolveComponent returned something that is not a React component!'); } - }; - _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) { - if (prevState.cacheKey !== this.state.cacheKey) { - this.loadAsync(); - } - }; - _proto.componentWillUnmount = function componentWillUnmount() { - this.mounted = false; - }; - _proto.safeSetState = function safeSetState(nextState, callback) { - if (this.mounted) { - this.setState(nextState, callback); - } - }; - _proto.getCacheKey = function getCacheKey() { - return _getCacheKey(this.props); - }; - _proto.getCache = function getCache() { - return cache[this.getCacheKey()]; - }; - _proto.setCache = function setCache(value) { - if (value === void 0) { - value = undefined; - } - cache[this.getCacheKey()] = value; - }; - _proto.triggerOnLoad = function triggerOnLoad() { - var _this2 = this; - if (onLoad) { - setTimeout(function() { - onLoad(_this2.state.result, _this2.props); + hoistNonReactStatics(Loadable, Component, { + preload: true + }); + return Component; + } + var cachedLoad = function cachedLoad(props) { + var cacheKey = _getCacheKey(props); + var promise = cache[cacheKey]; + if (!promise || promise.status === STATUS_REJECTED) { + promise = ctor.requireAsync(props); + promise.status = STATUS_PENDING; + cache[cacheKey] = promise; + promise.then(function() { + promise.status = STATUS_RESOLVED; + }, function(error) { + console.error('loadable-components: failed to asynchronously load component', { + fileName: ctor.resolve(props), + chunkName: ctor.chunkName(props), + error: error ? error.message : error + }); + promise.status = STATUS_REJECTED; }); } + return promise; }; - _proto.loadSync = function loadSync() { - if (!this.state.loading) return; - try { - var loadedModule = ctor.requireSync(this.props); - var result = resolve(loadedModule, this.props, Loadable); - this.state.result = result; - this.state.loading = false; - } catch (error) { - console.error('loadable-components: failed to synchronously load component, which expected to be available', { - fileName: ctor.resolve(this.props), - chunkName: ctor.chunkName(this.props), - error: error ? error.message : error + var InnerLoadable = function(_React$Component) { + _inheritsLoose(InnerLoadable, _React$Component); + InnerLoadable.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) { + var cacheKey = _getCacheKey(props); + return _extends({}, state, { + cacheKey: cacheKey, + loading: state.loading || state.cacheKey !== cacheKey }); - this.state.error = error; + }; + function InnerLoadable(props) { + var _this; + _this = _React$Component.call(this, props) || this; + _this.state = { + result: null, + error: null, + loading: true, + cacheKey: _getCacheKey(props) + }; + invariant(!props.__chunkExtractor || ctor.requireSync, 'SSR requires `@loadable/babel-plugin`, please install it'); + if (props.__chunkExtractor) { + if (options.ssr === false) { + return _assertThisInitialized(_this); + } + ctor.requireAsync(props)['catch'](function() { + return null; + }); + _this.loadSync(); + props.__chunkExtractor.addChunk(ctor.chunkName(props)); + return _assertThisInitialized(_this); + } + if (options.ssr !== false && (ctor.isReady && ctor.isReady(props) || ctor.chunkName && LOADABLE_SHARED.initialChunks[ctor.chunkName(props)])) { + _this.loadSync(); + } + return _this; } - }; - _proto.loadAsync = function loadAsync() { - var _this3 = this; - var promise = this.resolveAsync(); - promise.then(function(loadedModule) { - var result = resolve(loadedModule, _this3.props, Loadable); - _this3.safeSetState({ - result: result, - loading: false - }, function() { - return _this3.triggerOnLoad(); + var _proto = InnerLoadable.prototype; + _proto.componentDidMount = function componentDidMount() { + this.mounted = true; + var cachedPromise = this.getCache(); + if (cachedPromise && cachedPromise.status === STATUS_REJECTED) { + this.setCache(); + } + if (this.state.loading) { + this.loadAsync(); + } + }; + _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) { + if (prevState.cacheKey !== this.state.cacheKey) { + this.loadAsync(); + } + }; + _proto.componentWillUnmount = function componentWillUnmount() { + this.mounted = false; + }; + _proto.safeSetState = function safeSetState(nextState, callback) { + if (this.mounted) { + this.setState(nextState, callback); + } + }; + _proto.getCacheKey = function getCacheKey() { + return _getCacheKey(this.props); + }; + _proto.getCache = function getCache() { + return cache[this.getCacheKey()]; + }; + _proto.setCache = function setCache(value) { + if (value === void 0) { + value = undefined; + } + cache[this.getCacheKey()] = value; + }; + _proto.triggerOnLoad = function triggerOnLoad() { + var _this2 = this; + if (onLoad) { + setTimeout(function() { + onLoad(_this2.state.result, _this2.props); + }); + } + }; + _proto.loadSync = function loadSync() { + if (!this.state.loading) return; + try { + var loadedModule = ctor.requireSync(this.props); + var result = resolve(loadedModule, this.props, Loadable); + this.state.result = result; + this.state.loading = false; + } catch (error) { + console.error('loadable-components: failed to synchronously load component, which expected to be available', { + fileName: ctor.resolve(this.props), + chunkName: ctor.chunkName(this.props), + error: error ? error.message : error + }); + this.state.error = error; + } + }; + _proto.loadAsync = function loadAsync() { + var _this3 = this; + var promise = this.resolveAsync(); + promise.then(function(loadedModule) { + var result = resolve(loadedModule, _this3.props, Loadable); + _this3.safeSetState({ + result: result, + loading: false + }, function() { + return _this3.triggerOnLoad(); + }); + })['catch'](function(error) { + return _this3.safeSetState({ + error: error, + loading: false + }); }); - })['catch'](function(error) { - return _this3.safeSetState({ - error: error, - loading: false + return promise; + }; + _proto.resolveAsync = function resolveAsync() { + var _this$props = this.props, __chunkExtractor = _this$props.__chunkExtractor, forwardedRef = _this$props.forwardedRef, props = _objectWithoutPropertiesLoose(_this$props, [ + '__chunkExtractor', + 'forwardedRef' + ]); + return cachedLoad(props); + }; + _proto.render = function render() { + var _this$props2 = this.props, forwardedRef = _this$props2.forwardedRef, propFallback = _this$props2.fallback, __chunkExtractor = _this$props2.__chunkExtractor, props = _objectWithoutPropertiesLoose(_this$props2, [ + 'forwardedRef', + 'fallback', + '__chunkExtractor' + ]); + var _this$state = this.state, error = _this$state.error, loading = _this$state.loading, result = _this$state.result; + if (options.suspense) { + var cachedPromise = this.getCache() || this.loadAsync(); + if (cachedPromise.status === STATUS_PENDING) { + throw this.loadAsync(); + } + } + if (error) { + throw error; + } + var fallback = propFallback || options.fallback || null; + if (loading) { + return fallback; + } + return _render({ + fallback: fallback, + result: result, + options: options, + props: _extends({}, props, { + ref: forwardedRef + }) }); - }); - return promise; + }; + return InnerLoadable; + }(React.Component); + var EnhancedInnerLoadable = withChunkExtractor(InnerLoadable); + var Loadable = React.forwardRef(function(props, ref) { + return React.createElement(EnhancedInnerLoadable, Object.assign({ + forwardedRef: ref + }, props)); + }); + Loadable.displayName = 'Loadable'; + Loadable.preload = function(props) { + Loadable.load(props); }; - _proto.resolveAsync = function resolveAsync() { - var _this$props = this.props, __chunkExtractor = _this$props.__chunkExtractor, forwardedRef = _this$props.forwardedRef, props = _objectWithoutPropertiesLoose(_this$props, [ - '__chunkExtractor', - 'forwardedRef' - ]); + Loadable.load = function(props) { return cachedLoad(props); }; - _proto.render = function render() { - var _this$props2 = this.props, forwardedRef = _this$props2.forwardedRef, propFallback = _this$props2.fallback, __chunkExtractor = _this$props2.__chunkExtractor, props = _objectWithoutPropertiesLoose(_this$props2, [ - 'forwardedRef', - 'fallback', - '__chunkExtractor' - ]); - var _this$state = this.state, error = _this$state.error, loading = _this$state.loading, result = _this$state.result; - if (options.suspense) { - var cachedPromise = this.getCache() || this.loadAsync(); - if (cachedPromise.status === STATUS_PENDING) { - throw this.loadAsync(); - } - } - if (error) { - throw error; - } - var fallback = propFallback || options.fallback || null; - if (loading) { - return fallback; - } - return _render({ - fallback: fallback, - result: result, - options: options, - props: _extends({}, props, { - ref: forwardedRef - }) - }); - }; - return InnerLoadable; - }(React.Component); - var EnhancedInnerLoadable = withChunkExtractor(InnerLoadable); - var Loadable = React.forwardRef(function(props, ref) { - return React.createElement(EnhancedInnerLoadable, Object.assign({ - forwardedRef: ref - }, props)); - }); - Loadable.displayName = 'Loadable'; - Loadable.preload = function(props) { - Loadable.load(props); - }; - Loadable.load = function(props) { - return cachedLoad(props); + return Loadable; + } + function lazy(ctor, options) { + return loadable(ctor, _extends({}, options, { + suspense: true + })); + } + return { + loadable: loadable, + lazy: lazy }; - return Loadable; } - function lazy(ctor, options) { - return loadable(ctor, _extends({}, options, { - suspense: true - })); + function defaultResolveComponent(loadedModule) { + return loadedModule.__esModule ? loadedModule['default'] : loadedModule['default'] || loadedModule; } - return { - loadable: loadable, - lazy: lazy - }; - } - function defaultResolveComponent(loadedModule) { - return loadedModule.__esModule ? loadedModule['default'] : loadedModule['default'] || loadedModule; - } - var _createLoadable = createLoadable({ - defaultResolveComponent: defaultResolveComponent, - render: function render(_ref) { - var Component = _ref.result, props = _ref.props; - return React.createElement(Component, props); - } - }), loadable = _createLoadable.loadable, lazy = _createLoadable.lazy; - var _createLoadable$1 = createLoadable({ - onLoad: function onLoad(result, props) { - if (result && props.forwardedRef) { - if (typeof props.forwardedRef === 'function') { - props.forwardedRef(result); - } else { - props.forwardedRef.current = result; - } + var _createLoadable = createLoadable({ + defaultResolveComponent: defaultResolveComponent, + render: function render(_ref) { + var Component = _ref.result, props = _ref.props; + return React.createElement(Component, props); } - }, - render: function render(_ref) { - var result = _ref.result, props = _ref.props; - if (props.children) { - return props.children(result); + }), loadable = _createLoadable.loadable, lazy = _createLoadable.lazy; + var _createLoadable$1 = createLoadable({ + onLoad: function onLoad(result, props) { + if (result && props.forwardedRef) { + if (typeof props.forwardedRef === 'function') { + props.forwardedRef(result); + } else { + props.forwardedRef.current = result; + } + } + }, + render: function render(_ref) { + var result = _ref.result, props = _ref.props; + if (props.children) { + return props.children(result); + } + return null; } - return null; - } - }), loadable$1 = _createLoadable$1.loadable, lazy$1 = _createLoadable$1.lazy; - var loadable$2 = loadable; - loadable$2.lib = loadable$1; - var lazy$2 = lazy; - lazy$2.lib = lazy$1; - exports.default = loadable$2; -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file + }), loadable$1 = _createLoadable$1.loadable, lazy$1 = _createLoadable$1.lazy; + var loadable$2 = loadable; + loadable$2.lib = loadable$1; + var lazy$2 = lazy; + lazy$2.lib = lazy$1; + exports.default = loadable$2; + } +}); +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/self-executed/decl/vars/output.js b/crates/compiler/tests/fixtures/tree_shake/self-executed/decl/vars/output.js index a3ea4c5a8c..ef95c20bd3 100644 --- a/crates/compiler/tests/fixtures/tree_shake/self-executed/decl/vars/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/self-executed/decl/vars/output.js @@ -1,97 +1,42 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); +})(window["__farm_default_namespace__"].m, { + "05ee5ec7": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "foo1", function() { + return foo1; + }); + farmRequire.o(exports, "foo2", function() { + return foo2; + }); + farmRequire.o(exports, "foo3", function() { + return foo3; + }); + farmRequire.o(exports, "foo4", function() { + return foo4; + }); + function foo() { + console.log('hello world'); + } + let foo1 = 1, foo2 = 2; + foo1 = 2; + var foo3 = foo; + var foo4 = foo; + foo3.create = foo; + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_dep = farmRequire("05ee5ec7"); + console.log(_f_dep.foo1, _f_dep.foo2, _f_dep.foo3, _f_dep.foo4); } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_ddf1.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"05ee5ec7":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "foo1", function() { - return foo1; - }); - module.o(exports, "foo2", function() { - return foo2; - }); - module.o(exports, "foo3", function() { - return foo3; - }); - module.o(exports, "foo4", function() { - return foo4; - }); - function foo() { - console.log('hello world'); - } - let foo1 = 1, foo2 = 2; - foo1 = 2; - var foo3 = foo; - var foo4 = foo; - foo3.create = foo; -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_dep = farmRequire("05ee5ec7"); - console.log(_f_dep.foo1, _f_dep.foo2, _f_dep.foo3, _f_dep.foo4); -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/self-executed/decl/vars_reverse_read/output.js b/crates/compiler/tests/fixtures/tree_shake/self-executed/decl/vars_reverse_read/output.js index 9acd0b94a8..5e626a3bbe 100644 --- a/crates/compiler/tests/fixtures/tree_shake/self-executed/decl/vars_reverse_read/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/self-executed/decl/vars_reverse_read/output.js @@ -1,101 +1,46 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); +})(window["__farm_default_namespace__"].m, { + "05ee5ec7": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "a1", function() { + return a1; + }); + farmRequire.o(exports, "a2", function() { + return a2; + }); + farmRequire.o(exports, "a3", function() { + return a3; + }); + const a1 = {}; + const a2 = {}; + const b2 = { + a2 + }; + b2.a2.aaa = 2; + const a3 = {}; + const b3 = { + a3 + }; + console.log(b3); + const c3 = { + b3 + }; + console.log(c3); + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_dep = farmRequire("05ee5ec7"); + console.log(_f_dep.a1, _f_dep.a2, _f_dep.a3); } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_ddf1.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"05ee5ec7":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "a1", function() { - return a1; - }); - module.o(exports, "a2", function() { - return a2; - }); - module.o(exports, "a3", function() { - return a3; - }); - const a1 = {}; - const a2 = {}; - const b2 = { - a2 - }; - b2.a2.aaa = 2; - const a3 = {}; - const b3 = { - a3 - }; - console.log(b3); - const c3 = { - b3 - }; - console.log(c3); -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_dep = farmRequire("05ee5ec7"); - console.log(_f_dep.a1, _f_dep.a2, _f_dep.a3); -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/self-executed/deep_side_effect/output.js b/crates/compiler/tests/fixtures/tree_shake/self-executed/deep_side_effect/output.js index 10152adff2..8b6fad7bd5 100644 --- a/crates/compiler/tests/fixtures/tree_shake/self-executed/deep_side_effect/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/self-executed/deep_side_effect/output.js @@ -1,130 +1,72 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); + } +})(window["__farm_default_namespace__"].m, { + "446ec84b": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "result", function() { + return farmRequire.f(_f_use); + }); + farmRequire("bebcbd1b"); + var _f_use = farmRequire.i(farmRequire("e0004d19")); + }, + "8fb552f8": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "set", function() { + return set; + }); + farmRequire.o(exports, "get", function() { + return get; + }); + let cache = {}; + function set(key, obj) { + cache[key] = obj; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + function get(key) { + return cache[key]; } + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_export = farmRequire("446ec84b"); + console.log(_f_export.result); + }, + "bebcbd1b": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_cache = farmRequire("8fb552f8"); + _f_cache.set('1', { + a: 1 + }); + _f_cache.set('2', { + a: 2 + }); + _f_cache.set('3', { + a: 3 + }); + _f_cache.set('4', { + a: 4 + }); + _f_cache.set('5', { + a: 5 + }); + _f_cache.set('6', { + a: 6 + }); + }, + "e0004d19": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_cache = farmRequire("8fb552f8"); + console.log(_f_cache.get('1').a); + const r = _f_cache.get('1').a; + exports.default = r; } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_d7f6.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"446ec84b":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "result", function() { - return module.f(_f_use); - }); - farmRequire("bebcbd1b"); - var _f_use = module.i(farmRequire("e0004d19")); -} -, -"8fb552f8":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "set", function() { - return set; - }); - module.o(exports, "get", function() { - return get; - }); - let cache = {}; - function set(key, obj) { - cache[key] = obj; - } - function get(key) { - return cache[key]; - } -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_export = farmRequire("446ec84b"); - console.log(_f_export.result); -} -, -"bebcbd1b":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_cache = farmRequire("8fb552f8"); - _f_cache.set('1', { - a: 1 - }); - _f_cache.set('2', { - a: 2 - }); - _f_cache.set('3', { - a: 3 - }); - _f_cache.set('4', { - a: 4 - }); - _f_cache.set('5', { - a: 5 - }); - _f_cache.set('6', { - a: 6 - }); -} -, -"e0004d19":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_cache = farmRequire("8fb552f8"); - console.log(_f_cache.get('1').a); - const r = _f_cache.get('1').a; - exports.default = r; -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/self-executed/enum/output.js b/crates/compiler/tests/fixtures/tree_shake/self-executed/enum/output.js index 95b07cb2a5..a9d5355af4 100644 --- a/crates/compiler/tests/fixtures/tree_shake/self-executed/enum/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/self-executed/enum/output.js @@ -1,202 +1,147 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); + } +})(window["__farm_default_namespace__"].m, { + "569704c1": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "resolveValue", function() { + return resolveValue; + }); + function parse() { + const mode = 1; + const typeMap = pathStateMachine[mode]; + return typeMap; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + const pathStateMachine = []; + pathStateMachine[0] = { + ['w']: [ + 0 + ], + ['i']: [ + 3, + 0 + ], + ['[']: [ + 4 + ], + ['o']: [ + 7 + ] + }; + pathStateMachine[1] = { + ['w']: [ + 1 + ], + ['.']: [ + 2 + ], + ['[']: [ + 4 + ], + ['o']: [ + 7 + ] + }; + pathStateMachine[2] = { + ['w']: [ + 2 + ], + ['i']: [ + 3, + 0 + ], + ['0']: [ + 3, + 0 + ] + }; + pathStateMachine[3] = { + ['i']: [ + 3, + 0 + ], + ['0']: [ + 3, + 0 + ], + ['w']: [ + 1, + 1 + ], + ['.']: [ + 2, + 1 + ], + ['[']: [ + 4, + 1 + ], + ['o']: [ + 7, + 1 + ] + }; + pathStateMachine[4] = { + ["'"]: [ + 5, + 0 + ], + ['"']: [ + 6, + 0 + ], + ['[']: [ + 4, + 2 + ], + [']']: [ + 1, + 3 + ], + ['o']: 8, + ['l']: [ + 4, + 0 + ] + }; + pathStateMachine[5] = { + ["'"]: [ + 4, + 0 + ], + ['o']: 8, + ['l']: [ + 5, + 0 + ] + }; + pathStateMachine[6] = { + ['"']: [ + 4, + 0 + ], + ['o']: 8, + ['l']: [ + 6, + 0 + ] + }; + function resolveValue() { + parse(); } + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_a = farmRequire("569704c1"); + console.log(_f_a.resolveValue); } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_ecb7.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"569704c1":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "resolveValue", function() { - return resolveValue; - }); - function parse() { - const mode = 1; - const typeMap = pathStateMachine[mode]; - return typeMap; - } - const pathStateMachine = []; - pathStateMachine[0] = { - ['w']: [ - 0 - ], - ['i']: [ - 3, - 0 - ], - ['[']: [ - 4 - ], - ['o']: [ - 7 - ] - }; - pathStateMachine[1] = { - ['w']: [ - 1 - ], - ['.']: [ - 2 - ], - ['[']: [ - 4 - ], - ['o']: [ - 7 - ] - }; - pathStateMachine[2] = { - ['w']: [ - 2 - ], - ['i']: [ - 3, - 0 - ], - ['0']: [ - 3, - 0 - ] - }; - pathStateMachine[3] = { - ['i']: [ - 3, - 0 - ], - ['0']: [ - 3, - 0 - ], - ['w']: [ - 1, - 1 - ], - ['.']: [ - 2, - 1 - ], - ['[']: [ - 4, - 1 - ], - ['o']: [ - 7, - 1 - ] - }; - pathStateMachine[4] = { - ["'"]: [ - 5, - 0 - ], - ['"']: [ - 6, - 0 - ], - ['[']: [ - 4, - 2 - ], - [']']: [ - 1, - 3 - ], - ['o']: 8, - ['l']: [ - 4, - 0 - ] - }; - pathStateMachine[5] = { - ["'"]: [ - 4, - 0 - ], - ['o']: 8, - ['l']: [ - 5, - 0 - ] - }; - pathStateMachine[6] = { - ['"']: [ - 4, - 0 - ], - ['o']: 8, - ['l']: [ - 6, - 0 - ] - }; - function resolveValue() { - parse(); - } -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_a = farmRequire("569704c1"); - console.log(_f_a.resolveValue); -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/self-executed/iife/output.js b/crates/compiler/tests/fixtures/tree_shake/self-executed/iife/output.js index 625f944a26..7516928934 100644 --- a/crates/compiler/tests/fixtures/tree_shake/self-executed/iife/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/self-executed/iife/output.js @@ -1,93 +1,38 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); +})(window["__farm_default_namespace__"].m, { + "569704c1": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + (function() { + const iife_foo = 'iife-foo'; + })(); + var UrlType; + (function(UrlType) { + UrlType[UrlType['Empty'] = 1] = 'Empty'; + UrlType[UrlType['Hash'] = 2] = 'Hash'; + UrlType[UrlType['Query'] = 3] = 'Query'; + UrlType[UrlType['RelativePath'] = 4] = 'RelativePath'; + UrlType[UrlType['AbsolutePath'] = 5] = 'AbsolutePath'; + UrlType[UrlType['SchemeRelative'] = 6] = 'SchemeRelative'; + UrlType[UrlType['Absolute'] = 7] = 'Absolute'; + })(UrlType || (UrlType = {})); + exports.default = function() { + console.log('foo'); + }; + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_a = farmRequire.i(farmRequire("569704c1")); + console.log(farmRequire.f(_f_a)); } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_ecb7.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"569704c1":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - (function() { - const iife_foo = 'iife-foo'; - })(); - var UrlType; - (function(UrlType) { - UrlType[UrlType['Empty'] = 1] = 'Empty'; - UrlType[UrlType['Hash'] = 2] = 'Hash'; - UrlType[UrlType['Query'] = 3] = 'Query'; - UrlType[UrlType['RelativePath'] = 4] = 'RelativePath'; - UrlType[UrlType['AbsolutePath'] = 5] = 'AbsolutePath'; - UrlType[UrlType['SchemeRelative'] = 6] = 'SchemeRelative'; - UrlType[UrlType['Absolute'] = 7] = 'Absolute'; - })(UrlType || (UrlType = {})); - exports.default = function() { - console.log('foo'); - }; -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_a = module.i(farmRequire("569704c1")); - console.log(module.f(_f_a)); -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/self-executed/import/output.js b/crates/compiler/tests/fixtures/tree_shake/self-executed/import/output.js index 6eff260ccb..cccf7cecc5 100644 --- a/crates/compiler/tests/fixtures/tree_shake/self-executed/import/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/self-executed/import/output.js @@ -1,84 +1,28 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); +})(window["__farm_default_namespace__"].m, { + "569704c1": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire("f380ea31"); + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire("569704c1"); + }, + "f380ea31": function(module, exports, farmRequire, farmDynamicRequire) { + const a = 10; + const b = 20; + const c = 30; + console.log(a, b); } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_6b9f.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"569704c1":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - farmRequire("f380ea31"); -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - farmRequire("569704c1"); -} -, -"f380ea31":function (module, exports, farmRequire, farmDynamicRequire) { - const a = 10; - const b = 20; - const c = 30; - console.log(a, b); -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/self-executed/new-call/output.js b/crates/compiler/tests/fixtures/tree_shake/self-executed/new-call/output.js index 00f7acd868..07149f7fd2 100644 --- a/crates/compiler/tests/fixtures/tree_shake/self-executed/new-call/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/self-executed/new-call/output.js @@ -1,121 +1,65 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); + } +})(window["__farm_default_namespace__"].m, { + "4312d062": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "default", function() { + return F; + }); + function $e() { + return { + seed: (e)=>{ + return e; } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + }; } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); -}); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_f1d9.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"4312d062":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "default", function() { - return F; - }); - function $e() { - return { - seed: (e)=>{ - return e; + var F = class { + constructor(e = {}){ + let { randomizer: r = $e() } = e; + this._randomizer = r; } - }; - } - var F = class { - constructor(e = {}){ - let { randomizer: r = $e() } = e; - this._randomizer = r; - } - get defaultRefDate() { - return this._defaultRefDate; - } - setDefaultRefDate(e = ()=>new Date) { - typeof e == "function" ? this._defaultRefDate = e : this._defaultRefDate = ()=>new Date(e); - } - seed(e = Math.ceil(Math.random() * Number.MAX_SAFE_INTEGER)) { - return this._randomizer.seed(e), e; + get defaultRefDate() { + return this._defaultRefDate; + } + setDefaultRefDate(e = ()=>new Date) { + typeof e == "function" ? this._defaultRefDate = e : this._defaultRefDate = ()=>new Date(e); + } + seed(e = Math.ceil(Math.random() * Number.MAX_SAFE_INTEGER)) { + return this._randomizer.seed(e), e; + } + }, Yt = new F; + }, + "81077a1f": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "useFullscreen", function() { + return useFullscreen; + }); + farmRequire.o(exports, "document1", function() { + return document1; + }); + const defaultDocument = globalThis.isClient ? window.document : undefined; + const defaultWindow = globalThis.isClient ? window : undefined; + const F = {}; + function useFullscreen(target, options = {}) { + const { document = defaultDocument, autoExit = false } = options; + return document; } - }, Yt = new F; -} -, -"81077a1f":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "useFullscreen", function() { - return useFullscreen; - }); - module.o(exports, "document1", function() { - return document1; - }); - const defaultDocument = globalThis.isClient ? window.document : undefined; - const defaultWindow = globalThis.isClient ? window : undefined; - const F = {}; - function useFullscreen(target, options = {}) { - const { document = defaultDocument, autoExit = false } = options; - return document; + const { document: { document1 } = defaultWindow.document } = F; + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_dep = farmRequire.i(farmRequire("4312d062")); + var _f_object_assign = farmRequire("81077a1f"); + console.log(farmRequire.f(_f_dep), _f_object_assign.useFullscreen, _f_object_assign.document1); } - const { document: { document1 } = defaultWindow.document } = F; -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_dep = module.i(farmRequire("4312d062")); - var _f_object_assign = farmRequire("81077a1f"); - console.log(module.f(_f_dep), _f_object_assign.useFullscreen, _f_object_assign.document1); -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +}); +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/self-executed/set/output.js b/crates/compiler/tests/fixtures/tree_shake/self-executed/set/output.js index e8eb941b9a..dc80232125 100644 --- a/crates/compiler/tests/fixtures/tree_shake/self-executed/set/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/self-executed/set/output.js @@ -1,80 +1,25 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); +})(window["__farm_default_namespace__"].m, { + "569704c1": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + exports.default = function() { + console.log('a'); + }; + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_a = farmRequire.i(farmRequire("569704c1")); + console.log(farmRequire.f(_f_a)); } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); }); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_ecb7.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"569704c1":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - exports.default = function() { - console.log('a'); - }; -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_a = module.i(farmRequire("569704c1")); - console.log(module.f(_f_a)); -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake/self-executed/side_effect/output.js b/crates/compiler/tests/fixtures/tree_shake/self-executed/side_effect/output.js index e24b6e3fd6..e898ed7a6e 100644 --- a/crates/compiler/tests/fixtures/tree_shake/self-executed/side_effect/output.js +++ b/crates/compiler/tests/fixtures/tree_shake/self-executed/side_effect/output.js @@ -1,133 +1,75 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); + } +})(window["__farm_default_namespace__"].m, { + "070fbe2d": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + let foo = 0; + function setFoo() { + let foo = 0; + foo++; } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + function getFoo() { + return foo; } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){var index_js_cjs = __commonJs((module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); -}); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_98b2.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"070fbe2d":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - let foo = 0; - function setFoo() { + let v = setFoo(); + console.log(getFoo()); + exports.default = {}; + }, + "694da995": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); let foo = 0; - foo++; - } - function getFoo() { - return foo; - } - let v = setFoo(); - console.log(getFoo()); - exports.default = {}; -} -, -"694da995":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - let foo = 0; - function setFoo() { - foo += 1; - } - function getFoo() { - return foo; - } - function Bar() { - console.log('Bar'); - } - Bar.prototype.foo = setFoo(); - console.log(getFoo()); - exports.default = {}; -} -, -"6d686e48":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "setFoo", function() { - return setFoo; - }); - module.o(exports, "getFoo", function() { - return getFoo; - }); - let foo = 0; - function setFoo() { - foo++; - } - function getFoo() { - return foo; + function setFoo() { + foo += 1; + } + function getFoo() { + return foo; + } + function Bar() { + console.log('Bar'); + } + Bar.prototype.foo = setFoo(); + console.log(getFoo()); + exports.default = {}; + }, + "6d686e48": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "setFoo", function() { + return setFoo; + }); + farmRequire.o(exports, "getFoo", function() { + return getFoo; + }); + let foo = 0; + function setFoo() { + foo++; + } + function getFoo() { + return foo; + } + }, + "b5d64806": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_inner_side_effect = farmRequire.i(farmRequire("070fbe2d")); + var _f_import_side_effect = farmRequire.i(farmRequire("fc5423a5")); + var _f_write_use_side_effect_stmt = farmRequire.i(farmRequire("694da995")); + console.log(farmRequire.f(_f_inner_side_effect), farmRequire.f(_f_import_side_effect), farmRequire.f(_f_write_use_side_effect_stmt)); + }, + "fc5423a5": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + var _f_foo = farmRequire("6d686e48"); + const slot = 'slot'; + const v = _f_foo.setFoo(); + console.log(_f_foo.getFoo()); + exports.default = slot; } -} -, -"b5d64806":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_inner_side_effect = module.i(farmRequire("070fbe2d")); - var _f_import_side_effect = module.i(farmRequire("fc5423a5")); - var _f_write_use_side_effect_stmt = module.i(farmRequire("694da995")); - console.log(module.f(_f_inner_side_effect), module.f(_f_import_side_effect), module.f(_f_write_use_side_effect_stmt)); -} -, -"fc5423a5":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - var _f_foo = farmRequire("6d686e48"); - const slot = 'slot'; - const v = _f_foo.setFoo(); - console.log(_f_foo.getFoo()); - exports.default = slot; -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("b5d64806"); \ No newline at end of file +}); +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("b5d64806"); \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/tree_shake_development/css/output.js b/crates/compiler/tests/fixtures/tree_shake_development/css/output.js index 2e4f1e00e7..717c0d9b05 100644 --- a/crates/compiler/tests/fixtures/tree_shake_development/css/output.js +++ b/crates/compiler/tests/fixtures/tree_shake_development/css/output.js @@ -1,141 +1,84 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } - }); - } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){// module_id: ../../_internal/runtime/index.js.farm-runtime -var index_js_cjs = __commonJs({ - "../../_internal/runtime/index.js.farm-runtime": (module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); - } -}); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_4246.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"index.ts":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "c", function() { - return c; - }); - farmRequire("style/a.css"); - var _f_logo1 = module.i(farmRequire("style/logo1.png")); - var c = module.f(_f_logo1); + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-system-helper.ts'); } -, -"style/a.css":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - farmRequire("style/b.css"); - const cssCode = ` -`; - const farmId = 'style/a.css'; - const previousStyle = document.querySelector(`style[data-farm-id="${farmId}"]`); - const style = document.createElement('style'); - style.setAttribute('data-farm-id', farmId); - style.innerHTML = cssCode; - if (previousStyle) { - previousStyle.replaceWith(style); - } else { - document.head.appendChild(style); +function initModuleSystem$1() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +initModuleSystem$1(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); } - if (module.meta.hot) { - module.meta.hot.accept(); - module.meta.hot.prune(()=>{ - style.remove(); +})(window["__farm_default_namespace__"].m, { + "index.ts": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "c", function() { + return c; }); - } -} -, -"style/b.css":function (module, exports, farmRequire, farmDynamicRequire) { - const cssCode = `* { + farmRequire("style/a.css"); + var _f_logo1 = farmRequire.i(farmRequire("style/logo1.png")); + var c = farmRequire.f(_f_logo1); + }, + "style/a.css": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire("style/b.css"); + const cssCode = ` +`; + const farmId = 'style/a.css'; + const previousStyle = document.querySelector(`style[data-farm-id="${farmId}"]`); + const style = document.createElement('style'); + style.setAttribute('data-farm-id', farmId); + style.innerHTML = cssCode; + if (previousStyle) { + previousStyle.replaceWith(style); + } else { + document.head.appendChild(style); + } + if (module.meta.hot) { + module.meta.hot.accept(); + module.meta.hot.prune(()=>{ + style.remove(); + }); + } + }, + "style/b.css": function(module, exports, farmRequire, farmDynamicRequire) { + const cssCode = `* { margin: 0; padding: 0; background: url("/logo-73d4a8.png"); } `; - const farmId = 'style/b.css'; - const previousStyle = document.querySelector(`style[data-farm-id="${farmId}"]`); - const style = document.createElement('style'); - style.setAttribute('data-farm-id', farmId); - style.innerHTML = cssCode; - if (previousStyle) { - previousStyle.replaceWith(style); - } else { - document.head.appendChild(style); - } - if (module.meta.hot) { - module.meta.hot.accept(); - module.meta.hot.prune(()=>{ - style.remove(); - }); + const farmId = 'style/b.css'; + const previousStyle = document.querySelector(`style[data-farm-id="${farmId}"]`); + const style = document.createElement('style'); + style.setAttribute('data-farm-id', farmId); + style.innerHTML = cssCode; + if (previousStyle) { + previousStyle.replaceWith(style); + } else { + document.head.appendChild(style); + } + if (module.meta.hot) { + module.meta.hot.accept(); + module.meta.hot.prune(()=>{ + style.remove(); + }); + } + }, + "style/logo.png": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + exports.default = "/logo-73d4a8.png"; + }, + "style/logo1.png": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + exports.default = "/logo1-cbaed8.png"; } -} -, -"style/logo.png":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - exports.default = "/logo-73d4a8.png"; -} -, -"style/logo1.png":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - exports.default = "/logo1-cbaed8.png"; -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("index.ts");var c=entry.c;export { c }; +}); +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("index.ts");var __farm_entry_c__=__farm_entry__.c;export {__farm_entry_c__ as c}; //logo-73d4a8.png: diff --git a/crates/compiler/tests/fixtures/tree_shake_development/import_meta_hot/output.js b/crates/compiler/tests/fixtures/tree_shake_development/import_meta_hot/output.js index 120a49fc27..346f64451c 100644 --- a/crates/compiler/tests/fixtures/tree_shake_development/import_meta_hot/output.js +++ b/crates/compiler/tests/fixtures/tree_shake_development/import_meta_hot/output.js @@ -1,120 +1,66 @@ //index.js: - window['__farm_default_namespace__'] = {__FARM_TARGET_ENV__: 'browser'};function _interop_require_default(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; -}function _export_star(from, to) { - Object.keys(from).forEach(function(k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { - enumerable: true, - get: function() { - return from[k]; - } + (function(){const moduleSystem = {}; +function initModuleSystem() { + console.log('module-system-helper.ts'); +} +function initModuleSystem$1() { + console.log('module-helper.ts'); +} +initModuleSystem(moduleSystem); +initModuleSystem$1(moduleSystem); +}());(function(moduleSystem, modules) { + for(var moduleId in modules){ + var module = modules[moduleId]; + moduleSystem.g(moduleId, module); + } +})(window["__farm_default_namespace__"].m, { + "dep.ts": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "a", function() { + return a; + }); + farmRequire.o(exports, "invalidate", function() { + return invalidate; + }); + if (module.meta.hot) { + module.meta.hot.accept(()=>{ + module.meta.hot.invalidate('parent module should accept this'); }); } - }); - return from; -}function _interop_require_wildcard(obj, nodeInterop) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { - default: obj - }; - var cache = _getRequireWildcardCache(nodeInterop); - if (cache && cache.has(obj)) return cache.get(obj); - var newObj = { - __proto__: null - }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - for(var key in obj){ - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; + var a = '1'; + function invalidate() { + return `invalidate data`; } - } - newObj.default = obj; - if (cache) cache.set(obj, newObj); - return newObj; -}function _getRequireWildcardCache(nodeInterop) { - if (typeof WeakMap !== "function") return null; - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - return (_getRequireWildcardCache = function(nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); -}function __commonJs(mod) { - var module; - return () => { - if (module) { - return module.exports; - } - module = { - exports: {}, - }; - if(typeof mod === "function") { - mod(module, module.exports); - }else { - mod[Object.keys(mod)[0]](module, module.exports); - } - return module.exports; - }; -}((function(){// module_id: ../../_internal/runtime/index.js.farm-runtime -var index_js_cjs = __commonJs({ - "../../_internal/runtime/index.js.farm-runtime": (module, exports)=>{ - "use strict"; - console.log('runtime/index.js'); - window['__farm_default_namespace__'].__farm_module_system__.setPlugins([]); - } -}); -index_js_cjs(); -})());(function(_){var filename = ((function(){var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;return typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("index_ddf1.js", document.baseURI).href})());for(var r in _){_[r].__farm_resource_pot__=filename;window['__farm_default_namespace__'].__farm_module_system__.register(r,_[r])}})({"dep.ts":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "a", function() { - return a; - }); - module.o(exports, "invalidate", function() { - return invalidate; - }); - if (module.meta.hot) { - module.meta.hot.accept(()=>{ - module.meta.hot.invalidate('parent module should accept this'); + }, + "index.ts": function(module, exports, farmRequire, farmDynamicRequire) { + farmRequire._m(exports); + farmRequire.o(exports, "InvalidateParent", function() { + return InvalidateParent; }); - } - var a = '1'; - function invalidate() { - return `invalidate data`; - } -} -, -"index.ts":function (module, exports, farmRequire, farmDynamicRequire) { - module._m(exports); - module.o(exports, "InvalidateParent", function() { - return InvalidateParent; - }); - var _f_dep = farmRequire("dep.ts"); - console.log(_f_dep.a); - const id = 'InvalidateParent'; - function InvalidateParent() { - return { - render: ()=>{ - const renderData = _f_dep.invalidate(); - const div = document.createElement('div', {}); - div.id = id; - div.innerText = renderData; - div.className = 'box'; - return div; + var _f_dep = farmRequire("dep.ts"); + console.log(_f_dep.a); + const id = 'InvalidateParent'; + function InvalidateParent() { + return { + render: ()=>{ + const renderData = _f_dep.invalidate(); + const div = document.createElement('div', {}); + div.id = id; + div.innerText = renderData; + div.className = 'box'; + return div; + } + }; + } + if (module.meta.hot) { + module.meta.hot.accept(); + const div = document.getElementById(id); + if (div) { + const comp = InvalidateParent().render(); + console.log(div, comp); + div.replaceWith(comp); } - }; - } - if (module.meta.hot) { - module.meta.hot.accept(); - const div = document.getElementById(id); - if (div) { - const comp = InvalidateParent().render(); - console.log(div, comp); - div.replaceWith(comp); } } -} -,});window['__farm_default_namespace__'].__farm_module_system__.setInitialLoadedResources([]);window['__farm_default_namespace__'].__farm_module_system__.setDynamicModuleResourcesMap([],{ });var farmModuleSystem = window['__farm_default_namespace__'].__farm_module_system__;farmModuleSystem.bootstrap();var entry = farmModuleSystem.require("index.ts");var InvalidateParent=entry.InvalidateParent;export { InvalidateParent }; \ No newline at end of file +}); +var __farm_ms__ = window['__farm_default_namespace__'].m;__farm_ms__.b();var __farm_entry__=__farm_ms__.r("index.ts");var __farm_entry_InvalidateParent__=__farm_entry__.InvalidateParent;export {__farm_entry_InvalidateParent__ as InvalidateParent}; \ No newline at end of file diff --git a/crates/compiler/tests/fixtures/update/lazy-compilation/update0.output.js b/crates/compiler/tests/fixtures/update/lazy-compilation/update0.output.js index e2c3479cf1..f2ff421689 100644 --- a/crates/compiler/tests/fixtures/update/lazy-compilation/update0.output.js +++ b/crates/compiler/tests/fixtures/update/lazy-compilation/update0.output.js @@ -5,10 +5,9 @@ , "dep.ts.farm_dynamic_import_virtual_module":function (module, exports, farmRequire, farmDynamicRequire) { module._m(exports); - var _f_dep = module.i(farmRequire("dep.ts")); - exports.default = module.f(_f_dep); - var _f_dep1 = farmRequire("dep.ts"); - module._e(exports, _f_dep1); + var _f_dep = module.w(farmRequire("dep.ts")); + var ns = _f_dep; + module.exports = ns; } ,}) {} \ No newline at end of file diff --git a/crates/compiler/tests/library.rs b/crates/compiler/tests/library.rs new file mode 100644 index 0000000000..8ab5ed0d1b --- /dev/null +++ b/crates/compiler/tests/library.rs @@ -0,0 +1,69 @@ +use std::path::PathBuf; + +use farmfe_core::config::{bool_or_obj::BoolOrObj, config_regex::ConfigRegex, Mode, TargetEnv}; +use farmfe_core::HashMap; + +mod common; +use crate::common::{ + assert_compiler_result_with_config, create_compiler_with_args, AssertCompilerResultConfig, +}; + +#[allow(dead_code)] +fn test(file_path_buf: PathBuf, crate_path_buf: PathBuf) { + use common::{format_output_name, get_dir_config_files, try_merge_config_file}; + + let cwd = file_path_buf.parent().unwrap(); + println!("testing test case: {cwd:?}"); + + let entry_name = "index".to_string(); + + let files = get_dir_config_files(cwd); + + for (name, config_entry) in files { + let compiler = create_compiler_with_args( + cwd.to_path_buf(), + crate_path_buf.clone(), + |mut config, plugins| { + config.mode = Mode::Development; + config.input = HashMap::from_iter(vec![( + entry_name.clone(), + file_path_buf.to_string_lossy().to_string().clone(), + )]); + config.minify = Box::new(BoolOrObj::Bool(false)); + config.tree_shaking = Box::new(BoolOrObj::Bool(false)); + config.external = vec![ConfigRegex::new("(^node:.*)"), ConfigRegex::new("^fs$")]; + config.output.target_env = TargetEnv::Library; + config.resolve.auto_external_failed_resolve = true; + // config.output.format = ModuleFormat::CommonJs; + + config = try_merge_config_file(config, config_entry); + + (config, plugins) + }, + ); + + compiler.compile().unwrap(); + + assert_compiler_result_with_config( + &compiler, + AssertCompilerResultConfig { + entry_name: Some(entry_name.clone()), + output_file: Some(format_output_name(name)), + ignore_emitted_field: false, + ..Default::default() + }, + ); + } +} + +#[test] +fn library_test() { + use farmfe_testing_helpers::fixture; + + fixture!("tests/fixtures/library/**/index.ts", test); +} + +// farmfe_testing::testing! { +// "tests/fixtures/library/**/index.ts", +// test +// } diff --git a/crates/compiler/tests/minify.rs b/crates/compiler/tests/minify.rs index 3d22e9ef30..28250a71ac 100644 --- a/crates/compiler/tests/minify.rs +++ b/crates/compiler/tests/minify.rs @@ -1,5 +1,4 @@ -use std::collections::HashMap; - +use farmfe_core::HashMap; use farmfe_testing_helpers::fixture; mod common; @@ -16,7 +15,7 @@ fn minify_script_test() { let entry_name = "index".to_string(); let compiler = create_compiler( - HashMap::from([(entry_name.clone(), "./index.ts".to_string())]), + HashMap::from_iter([(entry_name.clone(), "./index.ts".to_string())]), cwd.to_path_buf(), crate_path, true, @@ -38,7 +37,7 @@ fn minify_css_test() { let entry_name = "index".to_string(); let compiler = create_compiler( - HashMap::from([(entry_name.clone(), "./index.ts".to_string())]), + HashMap::from_iter([(entry_name.clone(), "./index.ts".to_string())]), cwd.to_path_buf(), crate_path, true, @@ -60,7 +59,7 @@ fn minify_html_test() { let entry_name = "index".to_string(); let compiler = create_compiler( - HashMap::from([(entry_name.clone(), "./index.html".to_string())]), + HashMap::from_iter([(entry_name.clone(), "./index.html".to_string())]), cwd.to_path_buf(), crate_path, true, diff --git a/crates/compiler/tests/partial_bundling.rs b/crates/compiler/tests/partial_bundling.rs index e802296db2..cdcc000db1 100644 --- a/crates/compiler/tests/partial_bundling.rs +++ b/crates/compiler/tests/partial_bundling.rs @@ -1,5 +1,4 @@ -use std::collections::HashMap; - +use farmfe_core::HashMap; use farmfe_testing_helpers::fixture; use crate::common::{assert_compiler_result, create_compiler}; @@ -16,7 +15,7 @@ fn partial_bundling_test() { let entry_name = "index".to_string(); let compiler = create_compiler( - HashMap::from([(entry_name.clone(), "./index.ts".to_string())]), + HashMap::from_iter([(entry_name.clone(), "./index.ts".to_string())]), cwd.to_path_buf(), crate_path, false, diff --git a/crates/compiler/tests/runtime.rs b/crates/compiler/tests/runtime.rs index 23442bc3c9..3e470cd561 100644 --- a/crates/compiler/tests/runtime.rs +++ b/crates/compiler/tests/runtime.rs @@ -1,9 +1,7 @@ -use std::{collections::HashMap, path::PathBuf}; +use std::path::PathBuf; -use farmfe_core::config::{ - bool_or_obj::BoolOrObj, config_regex::ConfigRegex, - partial_bundling::PartialBundlingEnforceResourceConfig, Mode, TargetEnv, -}; +use farmfe_core::config::{bool_or_obj::BoolOrObj, config_regex::ConfigRegex, Mode, TargetEnv}; +use farmfe_core::HashMap; mod common; use crate::common::{ assert_compiler_result_with_config, create_compiler_with_args, AssertCompilerResultConfig, @@ -12,9 +10,7 @@ use crate::common::{ #[allow(dead_code)] #[cfg(test)] fn test(file: String, crate_path: String) { - use common::get_config_field; - - use crate::common::try_read_config_from_json; + use common::{format_output_name, get_dir_config_files, try_merge_config_file}; let file_path_buf = PathBuf::from(file.clone()); let create_path_buf = PathBuf::from(crate_path); @@ -23,67 +19,48 @@ fn test(file: String, crate_path: String) { let entry_name = "index".to_string(); - let config_entry = cwd.to_path_buf().join("config.json"); - let runtime_entry = cwd.to_path_buf().join("runtime.ts"); - - let config_from_file = try_read_config_from_json(config_entry); - - let compiler = - create_compiler_with_args(cwd.to_path_buf(), create_path_buf, |mut config, plugins| { - config.mode = Mode::Production; - - if runtime_entry.is_file() { - let runtime_entry = runtime_entry.to_string_lossy().to_string(); - config.runtime.path = runtime_entry; - } - - config.input = HashMap::from_iter(vec![(entry_name.clone(), file)]); + let files = get_dir_config_files(cwd); - config.minify = Box::new(BoolOrObj::Bool(false)); - config.tree_shaking = Box::new(BoolOrObj::Bool(false)); + for (name, config_entry) in files { + let runtime_entry = cwd.to_path_buf().join("runtime.ts"); - config.external = vec![ConfigRegex::new("(^node:.*)"), ConfigRegex::new("^fs$")]; - config.output.target_env = TargetEnv::Node; - // config.output.format = ModuleFormat::CommonJs; + let compiler = create_compiler_with_args( + cwd.to_path_buf(), + create_path_buf.clone(), + |mut config, plugins| { + config.mode = Mode::Production; - // TODO: multiple bundle - config.partial_bundling.enforce_resources = vec![PartialBundlingEnforceResourceConfig { - test: vec![ConfigRegex::new("^bundle2.*")], - name: "bundle2".to_string(), - }]; - - if let Some(config_from_file) = config_from_file { - // TODO: macro - if let Some(mode) = get_config_field(&config_from_file, &["mode"]) { - config.mode = mode; + if runtime_entry.is_file() { + let runtime_entry = runtime_entry.to_string_lossy().to_string(); + config.runtime.path = runtime_entry; } - if let Some(format) = get_config_field(&config_from_file, &["output", "format"]) { - config.output.format = format; - } + config.input = HashMap::from_iter(vec![(entry_name.clone(), file.clone())]); - if let Some(target_env) = get_config_field(&config_from_file, &["output", "targetEnv"]) { - config.output.target_env = target_env; - } + config.minify = Box::new(BoolOrObj::Bool(false)); + config.tree_shaking = Box::new(BoolOrObj::Bool(false)); - if let Some(lazy_compilation) = get_config_field(&config_from_file, &["lazyCompilation"]) { - config.lazy_compilation = lazy_compilation; - } - } + config.external = vec![ConfigRegex::new("(^node:.*)"), ConfigRegex::new("^fs$")]; + config.output.target_env = TargetEnv::Node; + + config = try_merge_config_file(config, config_entry); - (config, plugins) - }); + (config, plugins) + }, + ); - compiler.compile().unwrap(); + compiler.compile().unwrap(); - assert_compiler_result_with_config( - &compiler, - AssertCompilerResultConfig { - entry_name: Some(entry_name), - ignore_emitted_field: false, - ..Default::default() - }, - ); + assert_compiler_result_with_config( + &compiler, + AssertCompilerResultConfig { + entry_name: Some(entry_name.clone()), + output_file: Some(format_output_name(name)), + ignore_emitted_field: false, + ..Default::default() + }, + ); + } } farmfe_testing::testing! {"tests/fixtures/runtime/bundle/**/index.ts", test} diff --git a/crates/compiler/tests/tree_shake.rs b/crates/compiler/tests/tree_shake.rs index 296edfcbd8..d0a56aa55b 100644 --- a/crates/compiler/tests/tree_shake.rs +++ b/crates/compiler/tests/tree_shake.rs @@ -1,20 +1,21 @@ -use std::{collections::HashMap, path::PathBuf, sync::Arc}; +use std::{path::PathBuf, sync::Arc}; use farmfe_core::{ module::ModuleType, plugin::Plugin, swc_common::{comments::NoopComments, Mark}, + swc_ecma_ast::Program, + HashMap, }; use farmfe_testing_helpers::fixture; use farmfe_toolkit::{ - common::{create_swc_source_map, Source}, script::swc_try_with::try_with, + sourcemap::create_swc_source_map, swc_ecma_transforms::{ helpers::inject_helpers, react::{react, Options}, typescript::tsx, }, - swc_ecma_visit::VisitMutWith, }; use crate::common::{ @@ -33,7 +34,7 @@ fn tree_shake_test() { let entry_name = "index".to_string(); let compiler = create_compiler( - HashMap::from([(entry_name.clone(), "./index.ts".to_string())]), + HashMap::from_iter([(entry_name.clone(), "./index.ts".to_string())]), cwd.to_path_buf(), crate_path, false, @@ -55,7 +56,7 @@ fn tree_shake_development() { println!("testing tree shake: {cwd:?}"); let compiler = create_compiler_with_args(cwd.into(), crate_path, |mut config, plguin| { - config.input = HashMap::from([(entry_name.clone(), "./index.ts".to_string())]); + config.input = HashMap::from_iter([(entry_name.clone(), "./index.ts".to_string())]); config.mode = farmfe_core::config::Mode::Development; (config, plguin) }); @@ -77,7 +78,7 @@ fn tree_shake_html_entry() { let entry_name = "index".to_string(); let compiler = create_compiler( - HashMap::from([(entry_name, "./index.html".to_string())]), + HashMap::from_iter([(entry_name, "./index.html".to_string())]), cwd.to_path_buf(), crate_path, false, @@ -111,23 +112,23 @@ fn tree_shake_changed_ast() { return Ok(None); } - let (cm, _) = create_swc_source_map(Source { - path: PathBuf::from(¶m.module_id.to_string()), - content: param.content.clone(), - }); - try_with(cm.clone(), &context.meta.script.globals, || { + let (cm, _) = create_swc_source_map(¶m.module_id, param.content.clone()); + let globals = context.meta.get_globals(¶m.module_id); + try_with(cm.clone(), globals.value(), || { let top_level_mark = Mark::from_u32(param.meta.as_script_mut().top_level_mark); let unresolved_mark = Mark::from_u32(param.meta.as_script_mut().unresolved_mark); - let ast = &mut param.meta.as_script_mut().ast; - ast.visit_mut_with(&mut tsx( + let ast = param.meta.as_script_mut().take_ast(); + let mut program = Program::Module(ast); + program.mutate(&mut tsx( cm.clone(), Default::default(), Default::default(), None as Option, + unresolved_mark, top_level_mark, )); - ast.visit_mut_with(&mut react::( + program.mutate(&mut react::( cm.clone(), None, Options { @@ -138,7 +139,9 @@ fn tree_shake_changed_ast() { top_level_mark, unresolved_mark, )); - ast.visit_mut_with(&mut inject_helpers(unresolved_mark)); + program.mutate(&mut inject_helpers(unresolved_mark)); + + param.meta.as_script_mut().set_ast(program.expect_module()); }) .unwrap(); @@ -157,7 +160,7 @@ fn tree_shake_changed_ast() { let entry_name = "index".to_string(); let compiler = create_compiler_with_plugins( - HashMap::from([(entry_name.clone(), "./entry.ts".to_string())]), + HashMap::from_iter([(entry_name.clone(), "./entry.ts".to_string())]), cwd.to_path_buf(), crate_path, false, diff --git a/crates/compiler/tests/update.rs b/crates/compiler/tests/update.rs index ddfeaeb3c1..123e75a372 100644 --- a/crates/compiler/tests/update.rs +++ b/crates/compiler/tests/update.rs @@ -1,4 +1,3 @@ -use std::collections::HashMap; use std::fs::File; use std::io::{Read, Write}; use std::path::PathBuf; @@ -11,6 +10,7 @@ use farmfe_core::config::persistent_cache::PersistentCacheConfig; use farmfe_core::config::TargetEnv; use farmfe_core::config::{preset_env::PresetEnvConfig, Config, Mode, SourcemapConfig}; use farmfe_core::plugin::UpdateType; +use farmfe_core::HashMap; use farmfe_testing_helpers::{fixture, is_update_snapshot_from_env}; mod common; @@ -112,7 +112,7 @@ fn update_without_dependencies_change() { |file, crate_path| { let cwd = file.parent().unwrap().to_path_buf(); let compiler = create_update_compiler( - HashMap::from([("index".to_string(), "./index.html".to_string())]), + HashMap::from_iter([("index".to_string(), "./index.html".to_string())]), cwd.clone(), crate_path, false, @@ -146,7 +146,7 @@ fn update_without_dependencies_change_css() { |file, crate_path| { let cwd = file.parent().unwrap().to_path_buf(); let compiler = create_update_compiler( - HashMap::from([("index".to_string(), "./index.html".to_string())]), + HashMap::from_iter([("index".to_string(), "./index.html".to_string())]), cwd.clone(), crate_path, false, @@ -195,7 +195,7 @@ fn update_with_dependencies_change_css_modules() { |file, crate_path| { let cwd = file.parent().unwrap().to_path_buf(); let compiler = create_update_compiler( - HashMap::from([("index".to_string(), "./index.html".to_string())]), + HashMap::from_iter([("index".to_string(), "./index.html".to_string())]), cwd.clone(), crate_path, false, @@ -303,7 +303,7 @@ fn update_css_and_css_raw() { fixture!("tests/fixtures/update/raw/index.ts", |file, crate_path| { let cwd = file.parent().unwrap().to_path_buf(); let compiler = create_update_compiler( - HashMap::from([("index".to_string(), "./index.ts".to_string())]), + HashMap::from_iter([("index".to_string(), "./index.ts".to_string())]), cwd.clone(), crate_path, false, @@ -346,7 +346,7 @@ fn update_lazy_compilation() { |file, crate_path| { let cwd = file.parent().unwrap().to_path_buf(); let compiler = create_lazy_update_compiler( - HashMap::from([("index".to_string(), "./index.ts".to_string())]), + HashMap::from_iter([("index".to_string(), "./index.ts".to_string())]), cwd.clone(), crate_path, false, @@ -383,7 +383,7 @@ fn update_lazy_compilation_node() { |file, crate_path| { let cwd = file.parent().unwrap().to_path_buf(); let compiler = create_lazy_update_compiler( - HashMap::from([("index".to_string(), "./index.ts".to_string())]), + HashMap::from_iter([("index".to_string(), "./index.ts".to_string())]), cwd.clone(), crate_path, false, diff --git a/crates/core/Cargo.toml b/crates/core/Cargo.toml index e6cc886f33..852a77c3be 100644 --- a/crates/core/Cargo.toml +++ b/crates/core/Cargo.toml @@ -18,6 +18,7 @@ farmfe_macro_cache_item = { version = "0.1.3", path = "../macro_cache_item" } farmfe_utils = { version = "0.1.6", path = "../utils" } serde = { version = "1.0", features = ["derive", "rc"] } serde_json = { version = "1.0", features = ["preserve_order"] } +serde_regex = "1.1.0" parking_lot = { version = "0.12", features = ["deadlock_detection"] } relative-path = "1.7" dashmap = "5.0" @@ -30,31 +31,34 @@ ptr_meta = "0.1.4" thiserror = "1.0" rayon = "1.5" petgraph = "0.6" -bytecheck = "0.7.0" downcast-rs = "1.2" wax = { version = "0.6", default-features = false, features = [ "miette", "walk", ] } globset = { version = "0.4.14" } -swc_ecma_ast = { version = "0.115.1", features = ["rkyv-impl", "serde-impl"] } -swc_ecma_parser = { version = "0.146.12" } -swc_common = { version = "0.34.4", features = [ +swc_ecma_ast = { version = "3.0.0", features = ["rkyv-impl", "serde-impl"] } +swc_ecma_parser = { version = "4.0.0" } +swc_common = { version = "3.0.0", features = [ "concurrent", "sourcemap", "rkyv-impl", ] } -swc_css_ast = { version = "0.141.0", features = ["rkyv-impl"] } -swc_css_prefixer = { version = "0.155.0" } -swc_html_ast = { version = "0.34.0", features = ["rkyv-impl"] } -heck = "0.4.1" -puffin = { version = "0.18.0", features = [ +swc_css_ast = { version = "3.0.0", features = ["rkyv-impl"] } +swc_css_prefixer = { version = "3.0.0" } +swc_html_ast = { version = "3.0.0", features = ["rkyv-impl"] } +swc_atoms = { version = "2.0.0" } +heck = "0.5.0" +puffin = { version = "0.19.1", features = [ "packing", "lz4", "serialization", ], optional = true } regex = "1.7.3" -enhanced-magic-string = { version = "0.0.16" } +enhanced-magic-string = { version = "0.1.0" } +rustc-hash = "2.0.0" +num_cpus = "1.16.0" +lazy_static = "1.4.0" [features] profile = ["dep:puffin"] diff --git a/crates/core/src/cache/cache_store.rs b/crates/core/src/cache/cache_store.rs index 58739becbc..7daaf44e56 100644 --- a/crates/core/src/cache/cache_store.rs +++ b/crates/core/src/cache/cache_store.rs @@ -1,15 +1,13 @@ //! Cache store of the persistent cache, responsible for reading and writing the cache from the disk. +use crate::HashMap; use dashmap::{mapref::multiple::RefMulti, DashMap}; use rayon::iter::{IntoParallelIterator, ParallelIterator}; -use std::{ - collections::HashMap, - path::{Path, PathBuf}, -}; +use std::path::{Path, PathBuf}; use crate::config::Mode; -const FARM_CACHE_VERSION: &str = "0.4.20"; +const FARM_CACHE_VERSION: &str = "0.6.1"; const FARM_CACHE_MANIFEST_FILE: &str = "farm-cache.json"; // TODO make CacheStore a trait and implement DiskCacheStore or RemoteCacheStore or more. diff --git a/crates/core/src/cache/cacheable.rs b/crates/core/src/cache/cacheable.rs new file mode 100644 index 0000000000..3a36c075bf --- /dev/null +++ b/crates/core/src/cache/cacheable.rs @@ -0,0 +1,10 @@ +use downcast_rs::{impl_downcast, Downcast}; + +pub trait Cacheable: std::any::Any + Send + Sync + Downcast { + /// Serialize the data to bytes + fn serialize_bytes(&self) -> Result, String>; + /// Deserialize the bytes to data + fn deserialize_bytes(&self, bytes: Vec) -> Result, String>; +} + +impl_downcast!(Cacheable); diff --git a/crates/core/src/cache/mod.rs b/crates/core/src/cache/mod.rs index e879a840ff..53f1da0c97 100644 --- a/crates/core/src/cache/mod.rs +++ b/crates/core/src/cache/mod.rs @@ -5,6 +5,7 @@ use crate::config::Mode; use self::{cache_store::CacheStore, plugin_cache::PluginCacheManager}; pub mod cache_store; +pub mod cacheable; pub mod module_cache; pub mod plugin_cache; pub mod resource_cache; @@ -13,7 +14,6 @@ pub mod utils; /// All cache related operation are charged by [CacheManager] /// Note: that you should use CacheManager::new to create a new instance so that the cache can be read from disk. /// It would do nothing if you create a new instance by CacheManager::default(). - pub struct CacheManager { pub module_cache: module_cache::ModuleCacheManager, pub resource_cache: resource_cache::ResourceCacheManager, @@ -27,16 +27,15 @@ pub struct CacheManager { impl CacheManager { pub fn new(cache_dir: &str, namespace: &str, mode: Mode) -> Self { - let module_cache = module_cache::ModuleCacheManager::new(cache_dir, namespace, mode.clone()); - let resource_cache = - resource_cache::ResourceCacheManager::new(cache_dir, namespace, mode.clone()); + let module_cache = module_cache::ModuleCacheManager::new(cache_dir, namespace, mode); + let resource_cache = resource_cache::ResourceCacheManager::new(cache_dir, namespace, mode); Self { module_cache, resource_cache, // plugin cache is not initialized here. it will be initialized when compile starts. - plugin_cache: PluginCacheManager::new(cache_dir, namespace, mode.clone()), - custom: CacheStore::new(cache_dir, namespace, mode.clone(), "custom"), + plugin_cache: PluginCacheManager::new(cache_dir, namespace, mode), + custom: CacheStore::new(cache_dir, namespace, mode, "custom"), lazy_compile_store: CacheStore::new(cache_dir, namespace, mode, "lazy-compilation"), lock: Mutex::new(false), } diff --git a/crates/core/src/cache/module_cache.rs b/crates/core/src/cache/module_cache.rs index a9f236d890..154220b9af 100644 --- a/crates/core/src/cache/module_cache.rs +++ b/crates/core/src/cache/module_cache.rs @@ -86,7 +86,7 @@ impl CachedModule { impl ModuleCacheManager { pub fn new(cache_dir_str: &str, namespace: &str, mode: Mode) -> Self { Self { - mutable_modules_store: MutableModulesMemoryStore::new(cache_dir_str, namespace, mode.clone()), + mutable_modules_store: MutableModulesMemoryStore::new(cache_dir_str, namespace, mode), immutable_modules_store: ImmutableModulesMemoryStore::new(cache_dir_str, namespace, mode), } } @@ -127,10 +127,10 @@ impl ModuleCacheManager { return module; } - return self + self .immutable_modules_store .get_cache_ref(key) - .expect("Cache broken, please remove node_modules/.farm and retry."); + .expect("Cache broken, please remove node_modules/.farm and retry.") } pub fn get_cache_mut_ref(&self, key: &ModuleId) -> RefMut<'_, ModuleId, CachedModule> { @@ -138,10 +138,10 @@ impl ModuleCacheManager { return module; } - return self + self .immutable_modules_store .get_cache_mut_ref(key) - .expect("Cache broken, please remove node_modules/.farm and retry."); + .expect("Cache broken, please remove node_modules/.farm and retry.") } /// Write the cache map to the disk. diff --git a/crates/core/src/cache/module_cache/immutable_modules.rs b/crates/core/src/cache/module_cache/immutable_modules.rs index 7560f87e99..c08eb80de0 100644 --- a/crates/core/src/cache/module_cache/immutable_modules.rs +++ b/crates/core/src/cache/module_cache/immutable_modules.rs @@ -1,5 +1,3 @@ -use std::collections::{HashMap, HashSet}; - use dashmap::DashMap; use farmfe_macro_cache_item::cache_item; use farmfe_utils::hash::sha256; @@ -13,6 +11,7 @@ use crate::{ }, config::Mode, module::ModuleId, + HashMap, HashSet, }; use super::{module_memory_store::ModuleMemoryStore, CachedModule}; @@ -65,7 +64,7 @@ impl ImmutableModulesMemoryStore { for (key, value) in manifest.iter() { let mut set = manifest_reversed .entry(value.clone()) - .or_insert_with(HashSet::new); + .or_insert_with(HashSet::default); set.insert(key.clone()); } @@ -170,9 +169,9 @@ impl ModuleMemoryStore for ImmutableModulesMemoryStore { } fn write_cache(&self) { - let mut packages = HashMap::new(); - let mut pending_remove_modules = HashSet::new(); - let mut maybe_remove_package = HashSet::new(); + let mut packages = HashMap::default(); + let mut pending_remove_modules = HashSet::default(); + let mut maybe_remove_package = HashSet::default(); for item in self.cached_modules.iter() { let module = item.value(); diff --git a/crates/core/src/cache/module_cache/mutable_modules.rs b/crates/core/src/cache/module_cache/mutable_modules.rs index 95ed0b4bea..ad1483b439 100644 --- a/crates/core/src/cache/module_cache/mutable_modules.rs +++ b/crates/core/src/cache/module_cache/mutable_modules.rs @@ -1,5 +1,3 @@ -use std::collections::HashMap; - use dashmap::DashMap; use farmfe_utils::hash::sha256; use rayon::iter::{IntoParallelIterator, ParallelIterator}; @@ -10,7 +8,7 @@ use crate::{ config::Mode, deserialize, module::ModuleId, - serialize, + serialize, HashMap, }; use super::{module_memory_store::ModuleMemoryStore, CachedModule}; @@ -120,8 +118,9 @@ impl ModuleMemoryStore for MutableModulesMemoryStore { } fn write_cache(&self) { - let mut cache_map = HashMap::new(); + let mut cache_map = HashMap::default(); let mut pending_removed_modules = vec![]; + for entry in self.cached_modules.iter() { let module = entry.value(); if module.is_expired { diff --git a/crates/core/src/cache/plugin_cache.rs b/crates/core/src/cache/plugin_cache.rs index 9d810700a1..68e926216d 100644 --- a/crates/core/src/cache/plugin_cache.rs +++ b/crates/core/src/cache/plugin_cache.rs @@ -1,8 +1,8 @@ -use std::collections::HashMap; - use dashmap::{mapref::one::Ref, DashMap}; use farmfe_utils::hash::sha256; +use crate::HashMap; + use crate::config::Mode; use super::cache_store::{CacheStore, CacheStoreKey}; diff --git a/crates/core/src/cache/resource_cache/resource_memory_store.rs b/crates/core/src/cache/resource_cache/resource_memory_store.rs index 1d45c8a852..94e7774f0a 100644 --- a/crates/core/src/cache/resource_cache/resource_memory_store.rs +++ b/crates/core/src/cache/resource_cache/resource_memory_store.rs @@ -1,8 +1,6 @@ use farmfe_macro_cache_item::cache_item; -use crate::{ - plugin::PluginGenerateResourcesHookResult, resource::resource_pot::ResourcePotMetaData, -}; +use crate::{plugin::PluginGenerateResourcesHookResult, resource::meta_data::ResourcePotMetaData}; #[cache_item] #[derive(Clone)] diff --git a/crates/core/src/cache/resource_cache/resource_pot.rs b/crates/core/src/cache/resource_cache/resource_pot.rs index 082e86cd6b..9e65d63455 100644 --- a/crates/core/src/cache/resource_cache/resource_pot.rs +++ b/crates/core/src/cache/resource_cache/resource_pot.rs @@ -1,5 +1,3 @@ -use std::collections::HashMap; - use dashmap::DashMap; use rayon::iter::{IntoParallelIterator, ParallelIterator}; use rkyv::Deserialize; @@ -7,7 +5,7 @@ use rkyv::Deserialize; use crate::{ cache::cache_store::{CacheStore, CacheStoreKey}, config::Mode, - deserialize, serialize, + deserialize, serialize, HashMap, }; use super::resource_memory_store::{CachedResourcePot, ResourceMemoryStore}; @@ -67,7 +65,7 @@ impl ResourceMemoryStore for ResourcePotMemoryStore { } fn write_cache(&self) { - let mut cache_map = HashMap::new(); + let mut cache_map = HashMap::default(); for entry in self.cached_resources.iter() { let store_key = CacheStoreKey { diff --git a/crates/core/src/config/bool_or_obj.rs b/crates/core/src/config/bool_or_obj.rs index 57bccecd75..e60923e604 100644 --- a/crates/core/src/config/bool_or_obj.rs +++ b/crates/core/src/config/bool_or_obj.rs @@ -15,6 +15,13 @@ impl BoolOrObj { } } + pub fn as_obj(&self) -> Option<&T> { + match self { + BoolOrObj::Obj(v) => Some(v), + BoolOrObj::Bool(_) => None, + } + } + pub fn unwrap_as_option(self, default: F) -> Option where F: FnOnce(Option) -> Option, diff --git a/crates/core/src/config/css.rs b/crates/core/src/config/css.rs index e6381ef5ff..6ea8299bbd 100644 --- a/crates/core/src/config/css.rs +++ b/crates/core/src/config/css.rs @@ -1,6 +1,5 @@ use heck::{ToLowerCamelCase, ToSnakeCase, ToUpperCamelCase}; use serde::{Deserialize, Serialize}; - #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub enum NameConversion { /// @@ -24,7 +23,6 @@ pub enum NameConversion { /// ``` #[serde(rename = "upperCamel")] UpperCamel, - /// ```md /// "We carry a new world here, in our hearts." /// // => @@ -33,7 +31,6 @@ pub enum NameConversion { #[serde(rename = "snake")] Snake, } - impl NameConversion { pub fn transform(&self, name: &str) -> String { match self { diff --git a/crates/core/src/config/custom.rs b/crates/core/src/config/custom.rs index 5c002baf28..f86a0a5adf 100644 --- a/crates/core/src/config/custom.rs +++ b/crates/core/src/config/custom.rs @@ -1,8 +1,9 @@ -use std::{collections::HashMap, sync::Arc}; +use std::sync::Arc; -use serde::{de::DeserializeOwned, Deserialize}; +use serde::de::DeserializeOwned; use crate::context::CompilationContext; +use crate::HashMap; use super::{ asset::AssetFormatMode, @@ -16,6 +17,8 @@ const CUSTOM_CONFIG_RUNTIME_ISOLATE: &str = "runtime.isolate"; pub const CUSTOM_CONFIG_EXTERNAL_RECORD: &str = "external.record"; pub const CUSTOM_CONFIG_RESOLVE_DEDUPE: &str = "resolve.dedupe"; pub const CUSTOM_CONFIG_CSS_MODULES_LOCAL_CONVERSION: &str = "css.modules.locals_conversion"; +pub const CUSTOM_CONFIG_PARTIAL_BUNDLING_GROUPS_ENFORCE_MAP: &str = + "partial_bundling.groups.enforce"; pub const CUSTOM_CONFIG_ASSETS_MODE: &str = "assets.mode"; pub fn get_config_runtime_isolate(context: &Arc) -> bool { diff --git a/crates/core/src/config/minify.rs b/crates/core/src/config/minify.rs index 070b311f95..026de21ba6 100644 --- a/crates/core/src/config/minify.rs +++ b/crates/core/src/config/minify.rs @@ -3,15 +3,6 @@ use serde_json::Value; use super::{bool_or_obj::BoolOrObj, config_regex::ConfigRegex}; -#[derive(Debug, Default, Clone, Deserialize, Serialize, PartialEq, Eq)] -pub enum MinifyMode { - #[serde(rename = "minify-resource-pot")] - ResourcePot, - #[default] - #[serde(rename = "minify-module")] - Module, -} - #[derive(Debug, Clone, Deserialize, Serialize)] #[serde(default, rename_all = "camelCase")] pub struct MinifyOptions { @@ -19,8 +10,7 @@ pub struct MinifyOptions { pub mangle: BoolOrObj, pub include: Vec, pub exclude: Vec, - pub mode: MinifyMode, - pub module_decls: bool, + pub mangle_exports: bool, } impl Default for MinifyOptions { @@ -30,91 +20,7 @@ impl Default for MinifyOptions { mangle: BoolOrObj::Bool(true), include: vec![], exclude: vec![ConfigRegex::new(".+\\.min\\.(js|css|html)$")], - mode: MinifyMode::Module, - module_decls: false, + mangle_exports: true, } } } - -impl From for MinifyOptions { - fn from(val: Value) -> Self { - serde_json::from_value(val) - .expect("failed parser MinifyOptions, please ensure your options is correct") - } -} - -impl From<&BoolOrObj> for Option { - fn from(value: &BoolOrObj) -> Self { - match value { - BoolOrObj::Bool(v) => { - if *v { - Some(Default::default()) - } else { - None - } - } - - BoolOrObj::Obj(v) => Some(MinifyOptions::from(v.clone())), - } - } -} - -#[cfg(test)] -mod tests { - use crate::config::minify::MinifyMode; - - #[test] - fn deserialize_minify_mode() { - use super::MinifyMode; - use serde_json::json; - - let mode = json!("minify-resource-pot"); - let mode: MinifyMode = serde_json::from_value(mode).unwrap(); - assert!(matches!(mode, MinifyMode::ResourcePot)); - - let mode = json!("minify-module"); - let mode: MinifyMode = serde_json::from_value(mode).unwrap(); - assert!(matches!(mode, MinifyMode::Module)); - } - - #[test] - fn deserialize_minify_options() { - use super::MinifyOptions; - use crate::config::bool_or_obj::BoolOrObj; - use serde_json::json; - - let options = json!({ - // "compress": true, - // "mangle": true, - // "include": ["@farmfe/runtime"], - "exclude": ["node_modules/"], - // "mode": "minify-resource-pot", - }); - let minify = - BoolOrObj::Obj(options).map(|val| serde_json::from_value::(val).unwrap()); - - assert!(matches!(minify, BoolOrObj::Obj(MinifyOptions { .. }))); - - let options = json!({ - "compress": true, - "mangle": true, - "include": ["@farmfe/runtime"], - "exclude": ["node_modules/"], - "mode": "minify-resource-pot", - "moduleDecls": false, - }); - let minify = - BoolOrObj::Obj(options).map(|val| serde_json::from_value::(val).unwrap()); - - assert!(matches!( - minify, - BoolOrObj::Obj(MinifyOptions { - compress: BoolOrObj::Bool(true), - mangle: BoolOrObj::Bool(true), - mode: MinifyMode::ResourcePot, - module_decls: false, - .. - }) - )); - } -} diff --git a/crates/core/src/config/mod.rs b/crates/core/src/config/mod.rs index cfaa05cfec..31ca5897e0 100644 --- a/crates/core/src/config/mod.rs +++ b/crates/core/src/config/mod.rs @@ -1,16 +1,19 @@ -use std::collections::HashMap; - +use minify::MinifyOptions; +use regex::Regex; use serde::{Deserialize, Serialize}; use swc_css_prefixer::options::Targets; use swc_ecma_parser::{EsSyntax as EsConfig, TsSyntax as TsConfig}; +use tree_shaking::TreeShakingConfig; use self::{ bool_or_obj::BoolOrObj, comments::CommentsConfig, config_regex::ConfigRegex, html::HtmlConfig, partial_bundling::PartialBundlingConfig, preset_env::PresetEnvConfig, script::ScriptConfig, }; -pub const FARM_MODULE_SYSTEM: &str = "__farm_module_system__"; +use crate::HashMap; + +pub const FARM_MODULE_SYSTEM: &str = "m"; // transformed from dynamic import, e.g `import('./xxx')` pub const FARM_DYNAMIC_REQUIRE: &str = "farmDynamicRequire"; // transformed from static import, e.g `import xxx from './xxx'` @@ -38,6 +41,25 @@ use asset::AssetsConfig; pub use output::*; +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum AliasItem { + // TODO keep hashmap for compatibility simple alias to string & string hashmap + // Simple(String), + Complex { + find: StringOrRegex, + replacement: String, + }, +} + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum StringOrRegex { + String(String), + #[serde(with = "serde_regex")] + Regex(Regex), +} + #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase", default)] pub struct Config { @@ -57,8 +79,8 @@ pub struct Config { pub partial_bundling: Box, pub lazy_compilation: bool, pub core_lib_path: Option, - pub tree_shaking: Box>, - pub minify: Box>, + pub tree_shaking: Box>, + pub minify: Box>, pub preset_env: Box, /// whether to record the compilation flow stats, default is false. pub record: bool, @@ -81,12 +103,12 @@ impl Default for Config { .to_string(); Self { - input: HashMap::from([("index".to_string(), "./index.html".to_string())]), + input: HashMap::from_iter([("index".to_string(), "./index.html".to_string())]), root: root.clone(), output: Default::default(), mode: Mode::Development, resolve: Default::default(), - define: HashMap::new(), + define: HashMap::default(), external: Default::default(), runtime: Default::default(), script: Default::default(), @@ -120,7 +142,6 @@ pub enum TargetEnv { Browser, #[serde(rename = "node")] Node, - /// [TargetEnv::Library] is alias of [TargetEnv::Custom("library-browser")] #[serde(rename = "library")] Library, #[serde(untagged)] @@ -129,18 +150,26 @@ pub enum TargetEnv { impl TargetEnv { pub fn is_browser(&self) -> bool { - matches!(self, TargetEnv::Browser | TargetEnv::Library) - || matches!(self, TargetEnv::Custom(custom) if custom == "library-browser") + matches!(self, TargetEnv::Browser) } pub fn is_node(&self) -> bool { matches!(self, TargetEnv::Node) - || matches!(self, TargetEnv::Custom(custom) if custom == "library-node") } pub fn is_library(&self) -> bool { matches!(self, TargetEnv::Library) - || matches!(self, TargetEnv::Custom(custom) if custom == "library-browser" || custom == "library-node") + } +} + +impl ToString for TargetEnv { + fn to_string(&self) -> String { + match self { + TargetEnv::Browser => "browser".to_string(), + TargetEnv::Node => "node".to_string(), + TargetEnv::Library => "library".to_string(), + TargetEnv::Custom(s) => s.clone(), + } } } @@ -153,7 +182,7 @@ pub enum ModuleFormat { CommonJs, } -#[derive(Clone, Debug, Serialize, Deserialize)] +#[derive(Clone, Copy, Debug, Serialize, Deserialize)] pub enum Mode { #[serde(rename = "development")] Development, @@ -161,6 +190,16 @@ pub enum Mode { Production, } +impl Mode { + pub fn is_dev(&self) -> bool { + matches!(self, Mode::Development) + } + + pub fn is_prod(&self) -> bool { + matches!(self, Mode::Production) + } +} + impl Default for Mode { fn default() -> Self { Self::Development @@ -223,10 +262,59 @@ pub struct ScriptParserConfig { pub ts_config: TsConfig, } +#[derive(Debug, Serialize, Deserialize, Clone)] +#[serde(untagged)] +pub enum AliasConfig { + // TODO keep hashmap for compatibility + Map(HashMap), + Array(Vec), +} + +impl AliasConfig { + pub fn insert(&mut self, key: String, value: String) { + match self { + AliasConfig::Map(map) => { + map.insert(key, value); + } + AliasConfig::Array(array) => { + array.push(AliasItem::Complex { + find: StringOrRegex::String(key), + replacement: value, + }); + } + } + } +} + +impl Default for AliasConfig { + fn default() -> Self { + AliasConfig::Map(HashMap::default()) + } +} + +impl ResolveConfig { + pub fn format_alias(&mut self, alias_config: AliasConfig) { + match alias_config { + AliasConfig::Map(map) => { + self.alias = map + .into_iter() + .map(|(find, replacement)| AliasItem::Complex { + find: StringOrRegex::String(find), + replacement, + }) + .collect(); + } + AliasConfig::Array(array) => { + self.alias = array; + } + } + } +} + #[derive(Debug, Serialize, Deserialize, Clone)] #[serde(rename_all = "camelCase", default)] pub struct ResolveConfig { - pub alias: HashMap, + pub alias: Vec, pub main_fields: Vec, pub main_files: Vec, pub extensions: Vec, @@ -239,7 +327,7 @@ pub struct ResolveConfig { impl Default for ResolveConfig { fn default() -> Self { Self { - alias: HashMap::new(), + alias: vec![], main_fields: vec![ String::from("browser"), String::from("module"), @@ -344,6 +432,13 @@ impl SourcemapConfig { Self::AllInline => true, } } + + pub fn is_false(&self) -> bool { + match self { + Self::Bool(b) => !*b, + _ => false, + } + } } mod tests { @@ -389,20 +484,5 @@ mod tests { assert!(env.is_library()); assert!(!env.is_node()); assert!(env.is_browser()); - - let env = TargetEnv::Custom("library-browser".to_string()); - assert!(env.is_library()); - assert!(!env.is_node()); - assert!(env.is_browser()); - - let env = TargetEnv::Custom("library-node".to_string()); - assert!(env.is_library()); - assert!(env.is_node()); - assert!(!env.is_browser()); - - let env: TargetEnv = serde_json::from_str("\"library-browser\"").expect("failed to parse"); - assert!(env.is_library()); - assert!(!env.is_node()); - assert!(env.is_browser()); } } diff --git a/crates/core/src/config/output.rs b/crates/core/src/config/output.rs index d086b11e76..644760a8e6 100644 --- a/crates/core/src/config/output.rs +++ b/crates/core/src/config/output.rs @@ -12,6 +12,7 @@ pub struct OutputConfig { pub assets_filename: String, pub target_env: TargetEnv, pub format: ModuleFormat, + pub show_file_size: bool, } impl Default for OutputConfig { @@ -26,6 +27,7 @@ impl Default for OutputConfig { path: "dist".to_string(), target_env: TargetEnv::default(), format: ModuleFormat::default(), + show_file_size: true, } } } diff --git a/crates/core/src/config/persistent_cache.rs b/crates/core/src/config/persistent_cache.rs index 331e349393..85ea8b3257 100644 --- a/crates/core/src/config/persistent_cache.rs +++ b/crates/core/src/config/persistent_cache.rs @@ -1,8 +1,11 @@ -use std::{collections::HashMap, path::PathBuf}; +use std::path::PathBuf; use farmfe_utils::hash::sha256; use relative_path::RelativePath; use serde::{Deserialize, Serialize}; +use serde_json::Value; + +use crate::HashMap; #[derive(Debug, Serialize, Deserialize, Clone)] #[serde(untagged)] @@ -48,7 +51,7 @@ impl PersistentCacheConfig { }, // build dependencies are set by node side build_dependencies: vec![], - envs: HashMap::new(), + envs: HashMap::default(), }) } @@ -76,11 +79,14 @@ impl PersistentCacheConfig { .clone_from(&default_config.as_raw_object().cache_dir); } - let mut envs = cloned_obj.envs.iter().collect::>(); - envs.sort(); - let config_str = envs + let mut keys: Vec<_> = cloned_obj.envs.keys().collect(); + keys.sort(); + let config_str = keys .into_iter() - .map(|(k, v)| format!("{k}={v}")) + .map(|k| { + let v = cloned_obj.envs.get(k).unwrap(); + format!("{k}={v}") + }) .collect::>() .join("&"); let config_hash = sha256(config_str.as_bytes(), 32); @@ -138,7 +144,7 @@ pub struct PersistentCacheConfigObj { /// It's absolute paths of farm.config by default. Farm will use their timestamp and hash to invalidate cache. /// Note that farm will resolve the config file dependencies from node side pub build_dependencies: Vec, - pub envs: HashMap, + pub envs: HashMap, } #[derive(Debug, Serialize, Deserialize, Clone)] diff --git a/crates/core/src/config/tree_shaking.rs b/crates/core/src/config/tree_shaking.rs index df8b4df8d8..a9b278e937 100644 --- a/crates/core/src/config/tree_shaking.rs +++ b/crates/core/src/config/tree_shaking.rs @@ -2,8 +2,7 @@ use serde::{Deserialize, Serialize}; use super::config_regex::ConfigRegex; -// TODO: implement this for treeShaking -#[derive(Debug, Serialize, Deserialize)] +#[derive(Debug, Clone, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct TreeShakingConfig { /// exclude some side effects files diff --git a/crates/core/src/context/mod.rs b/crates/core/src/context/mod.rs index a95bf0d346..4b766a0638 100644 --- a/crates/core/src/context/mod.rs +++ b/crates/core/src/context/mod.rs @@ -1,10 +1,15 @@ -use std::{any::Any, path::Path, sync::Arc}; +use std::{ + any::Any, + path::{Path, PathBuf}, + sync::Arc, +}; -use dashmap::DashMap; +use dashmap::{mapref::one::Ref, DashMap}; use parking_lot::{Mutex, RwLock}; +use rayon::{ThreadPool, ThreadPoolBuilder}; +use regex::Regex; use serde::{Deserialize, Serialize}; -use std::collections::HashMap; -use swc_common::Globals; +use swc_common::{FileName, Globals, SourceFile, SourceMap}; use crate::{ cache::CacheManager, @@ -14,15 +19,22 @@ use crate::{ module_graph::ModuleGraph, module_group::ModuleGroupGraph, watch_graph::WatchGraph, ModuleId, }, plugin::{plugin_driver::PluginDriver, Plugin, PluginResolveHookParam, PluginResolveHookResult}, - resource::{resource_pot_map::ResourcePotMap, Resource, ResourceOrigin, ResourceType}, + resource::{ + resource_pot::ResourcePotId, resource_pot_map::ResourcePotMap, Resource, ResourceOrigin, + ResourceType, + }, stats::Stats, + HashMap, }; use self::log_store::LogStore; pub mod log_store; pub(crate) const EMPTY_STR: &str = ""; -pub const IS_UPDATE: &str = ""; + +lazy_static::lazy_static! { + pub static ref REPLACE_FILENAME_REGEX: Regex = Regex::new(r"[^a-zA-Z0-9._/\\]").unwrap(); +} /// Shared context through the whole compilation. pub struct CompilationContext { @@ -34,9 +46,10 @@ pub struct CompilationContext { pub resource_pot_map: Box>, pub resources_map: Box>>, pub cache_manager: Box, + pub thread_pool: Arc, pub meta: Box, /// Record stats for the compilation, for example, compilation time, plugin hook time, etc. - pub record_manager: Box, + pub stats: Box, pub log_store: Box>, pub resolve_cache: Box>>, pub custom: Box>>, @@ -51,30 +64,24 @@ impl CompilationContext { module_graph: Box::new(RwLock::new(ModuleGraph::new())), module_group_graph: Box::new(RwLock::new(ModuleGroupGraph::new())), resource_pot_map: Box::new(RwLock::new(ResourcePotMap::new())), - resources_map: Box::new(Mutex::new(HashMap::new())), + resources_map: Box::new(Mutex::new(HashMap::default())), plugin_driver: Box::new(Self::create_plugin_driver(plugins, config.record)), - cache_manager: Box::new(CacheManager::new( - &cache_dir, - &namespace, - config.mode.clone(), - )), + cache_manager: Box::new(CacheManager::new(&cache_dir, &namespace, config.mode)), + thread_pool: Arc::new( + ThreadPoolBuilder::new() + .num_threads(num_cpus::get()) + .build() + .unwrap(), + ), config: Box::new(config), meta: Box::new(ContextMetaData::new()), - record_manager: Box::new(Stats::new()), + stats: Box::new(Stats::new()), log_store: Box::new(Mutex::new(LogStore::new())), - resolve_cache: Box::new(Mutex::new(HashMap::new())), - custom: Box::new(DashMap::new()), + resolve_cache: Box::new(Mutex::new(HashMap::default())), + custom: Box::new(DashMap::default()), }) } - pub fn set_update(&self) { - self.custom.insert(IS_UPDATE.to_string(), Box::new(true)); - } - - pub fn is_update(&self) -> bool { - self.custom.contains_key(IS_UPDATE) - } - pub fn create_plugin_driver(plugins: Vec>, record: bool) -> PluginDriver { PluginDriver::new(plugins, record) } @@ -133,9 +140,10 @@ impl CompilationContext { name: params.name, bytes: params.content, emitted: false, + should_transform_output_filename: true, resource_type: params.resource_type, origin: ResourceOrigin::Module(module_id), - info: None, + meta: Default::default(), }, ); } @@ -183,11 +191,22 @@ impl Default for CompilationContext { /// Shared meta info for the core and core plugins, for example, shared swc [SourceMap] /// The **custom** field can be used for custom plugins to store shared meta data across compilation pub struct ContextMetaData { - // shared meta by core plugins + /// shared meta by plugins pub script: ScriptContextMetaData, pub css: CssContextMetaData, pub html: HtmlContextMetaData, - // custom meta map + + /// shared swc sourcemap cache for module + pub module_source_maps: DashMap>, + /// shared swc sourcemap cache for hoisted modules + pub hoisted_modules_source_maps: DashMap>, + /// shared swc sourcemap cache for resource pot + pub resource_pot_source_maps: DashMap>, + + /// Globals map for each module + globals_map: DashMap, + + /// custom meta map pub custom: DashMap>, } @@ -197,9 +216,71 @@ impl ContextMetaData { script: ScriptContextMetaData::new(), css: CssContextMetaData::new(), html: HtmlContextMetaData::new(), + module_source_maps: DashMap::new(), + hoisted_modules_source_maps: DashMap::new(), + resource_pot_source_maps: DashMap::new(), + globals_map: DashMap::new(), custom: DashMap::new(), } } + + /// get swc source map from module id + pub fn get_module_source_map(&self, module_id: &ModuleId) -> Arc { + self + .module_source_maps + .get(module_id) + .map(|value| value.clone()) + .unwrap_or_else(|| panic!("no source map found for module {:?}", module_id)) + } + + /// set swc source map for module id + /// this should be called after every time the module is parsed and updated to the module graph + pub fn set_module_source_map(&self, module_id: &ModuleId, cm: Arc) { + self.module_source_maps.insert(module_id.clone(), cm); + } + + pub fn get_hoisted_modules_source_map(&self, module_id: &ModuleId) -> Arc { + self + .hoisted_modules_source_maps + .get(module_id) + .map(|value| value.clone()) + .unwrap() + } + + pub fn set_hoisted_modules_source_map(&self, module_id: &ModuleId, cm: Arc) { + self + .hoisted_modules_source_maps + .insert(module_id.clone(), cm); + } + + pub fn get_resource_pot_source_map(&self, resource_pot_id: &ResourcePotId) -> Arc { + self + .resource_pot_source_maps + .get(resource_pot_id) + .map(|value| value.clone()) + .unwrap_or_else(|| panic!("no source map found for resource pot {:?}", resource_pot_id)) + } + + /// set swc source map for resource pot + /// this should be called after every time the resource pot is parsed and updated to the resource pot map + pub fn set_resource_pot_source_map(&self, resource_pot_id: &ResourcePotId, cm: Arc) { + self + .resource_pot_source_maps + .insert(resource_pot_id.clone(), cm); + } + + pub fn set_globals(&self, module_id: &ModuleId, globals: Globals) { + self.globals_map.insert(module_id.clone(), globals); + } + + pub fn get_globals(&self, module_id: &ModuleId) -> Ref { + let globals = self + .globals_map + .get(module_id) + .unwrap_or_else(|| panic!("no globals found for module {:?}", module_id)); + + globals + } } impl Default for ContextMetaData { @@ -208,16 +289,32 @@ impl Default for ContextMetaData { } } -/// Shared script meta data used for [swc] -pub struct ScriptContextMetaData { - pub globals: Globals, +/// get swc source map filename from module id. +/// you can get module id from sourcemap filename too, by +pub fn get_swc_sourcemap_filename(module_id: &ModuleId) -> FileName { + // replace all invalid characters to _ to make sure the filename is valid + let module_id = module_id.to_string(); + let module_id = REPLACE_FILENAME_REGEX.replace_all(&module_id, "_"); + FileName::Real(PathBuf::from(module_id.to_string())) +} + +/// create a swc source map from a source +pub fn create_swc_source_map( + id: &ModuleId, + content: Arc, +) -> (Arc, Arc) { + let cm = Arc::new(SourceMap::default()); + let sf = cm.new_source_file_from(Arc::new(get_swc_sourcemap_filename(id)), content); + + (cm, sf) } +/// Shared script meta data used for [swc] +pub struct ScriptContextMetaData {} + impl ScriptContextMetaData { pub fn new() -> Self { - Self { - globals: Globals::new(), - } + Self {} } } @@ -227,15 +324,11 @@ impl Default for ScriptContextMetaData { } } -pub struct CssContextMetaData { - pub globals: Globals, -} +pub struct CssContextMetaData {} impl CssContextMetaData { pub fn new() -> Self { - Self { - globals: Globals::new(), - } + Self {} } } @@ -245,15 +338,11 @@ impl Default for CssContextMetaData { } } -pub struct HtmlContextMetaData { - pub globals: Globals, -} +pub struct HtmlContextMetaData {} impl HtmlContextMetaData { pub fn new() -> Self { - Self { - globals: Globals::new(), - } + Self {} } } diff --git a/crates/core/src/error/mod.rs b/crates/core/src/error/mod.rs index 1aeecc01ea..fd57fd3576 100644 --- a/crates/core/src/error/mod.rs +++ b/crates/core/src/error/mod.rs @@ -1,36 +1,53 @@ use std::{error::Error, sync::LockResult}; +use serde::Serialize; +use serde_json::json; use thiserror::Error; use crate::resource::resource_pot::ResourcePotType; -#[derive(Debug, Error)] +#[derive(Debug, Error, Serialize)] +#[serde(tag = "type", rename_all = "snake_case")] pub enum CompilationError { - #[error("Can not resolve `{src}` from {importer}.\nOriginal error: {source:?}.\n\nPotential Causes:\n1.The file that `{src}` points to does not exist.\n2.Install it first if `{src}` is an dependency from node_modules, if you are using pnpm refer to [https://pnpm.io/faq#pnpm-does-not-work-with-your-project-here] for solutions.\n3. If `{src}` is a alias, make sure your alias config is correct.\n")] + // #[error("Can not resolve `{src}` from {importer}.\nOriginal error: {source:?}.\n\nPotential Causes:\n1.The file that `{src}` points to does not exist.\n2.Install it first if `{src}` is an dependency from node_modules, if you are using pnpm refer to [https://pnpm.io/faq#pnpm-does-not-work-with-your-project-here] for solutions.\n3. If `{src}` is a alias, make sure your alias config is correct.\n")] + #[error("{}", serde_json::to_string(&serialize_resolve_error(src, importer, source)) + .map_err(|_| "Failed to serialize resolve error type message".to_string()) + .unwrap_or_else(|e| e))] ResolveError { importer: String, src: String, #[source] + #[serde(skip)] source: Option>, }, // TODO, give the specific recommended plugin of this kind of module + // TODO add potential causes #[error("Can not load `{resolved_path}`. Original error: \n{source:?}.\n\nPotential Causes:\n1.This kind of module is not supported, you may need plugins to support it.\n")] LoadError { resolved_path: String, #[source] + #[serde(skip)] source: Option>, }, - #[error("Transform `{resolved_path}` failed.\nError: {msg}")] + // #[error("Transform `{resolved_path}` failed.\n {msg}")] + #[error("{}", serde_json::to_string(&serialize_transform_error(resolved_path, msg)) + .map_err(|_| "Failed to serialize transform error type message".to_string()) + .unwrap_or_else(|e| e))] TransformError { resolved_path: String, msg: String }, + // TODO, give the specific recommended plugin of this kind of module - #[error("Parse `{resolved_path}` failed.\n Error: {msg}\nPotential Causes:\n1.The module have syntax error.\n2.This kind of module is not supported, you may need plugins to support it\n")] + // #[error("Parse `{resolved_path}` failed.\n {msg}\nPotential Causes:\n1.The module have syntax error.\n2.This kind of module is not supported, you may need plugins to support it\n")] + #[error("{}", serde_json::to_string(&serialize_parse_error(resolved_path, msg)) + .map_err(|_| "Failed to serialize parse error type message".to_string()) + .unwrap_or_else(|e| e))] ParseError { resolved_path: String, msg: String }, #[error("Hook `process_module` execute failed for module `{resolved_path}`.\nOriginal error: {source:?}.")] ProcessModuleError { resolved_path: String, #[source] + #[serde(skip)] source: Option>, }, @@ -40,6 +57,7 @@ pub enum CompilationError { AnalyzeDepsError { resolved_path: String, #[source] + #[serde(skip)] source: Option>, }, @@ -53,6 +71,7 @@ pub enum CompilationError { #[error("Hook `analyze_module_graph` execute failed.\nOriginal error: {source:?}.\n")] AnalyzeModuleGraphError { #[source] + #[serde(skip)] source: Option>, }, @@ -64,6 +83,7 @@ pub enum CompilationError { name: String, ty: ResourcePotType, #[source] + #[serde(skip)] source: Option>, }, @@ -80,6 +100,7 @@ pub enum CompilationError { RenderScriptModuleError { id: String, #[source] + #[serde(skip)] source: Option>, }, @@ -91,6 +112,61 @@ pub enum CompilationError { }, } +fn serialize_resolve_error( + src: &str, + importer: &str, + source: &Option>, +) -> serde_json::Value { + let mut msg = format!("Can not resolve `{}` from `{}`.", src, importer); + if let Some(source) = source { + msg.push_str(&format!("\nOriginal error: {}.", source)); + } + + let cause = format!( + "Potential Causes:\n\ + 1. The file that `{}` points to does not exist.\n\ + 2. Install it first if `{}` is a dependency from node_modules. If you are using pnpm, refer to [https://pnpm.io/faq#pnpm-does-not-work-with-your-project-here] for solutions.\n\ + 3. If `{}` is an alias, make sure your alias config is correct.", + src, src, src + ); + + let full_message = format!("{}\n{}", msg, cause); + + json!({ + "id": importer, + "type": "Resolve Error", + "errorFrame": msg, + "message": full_message, + "cause": cause + }) +} + +fn serialize_parse_error(resolved_path: &str, msg: &str) -> serde_json::Value { + if let Ok(parsed) = serde_json::from_str::(msg) { + return parsed; + } + json!({ + "id": resolved_path, + "errorFrame": msg, + "type": "Parse Error", + "cause": "Potential Causes:\n1.The module have syntax error.\n2.This kind of module is not supported, you may need plugins to support it.\n", + "message": format!("Parse `{}` failed.\n {}", resolved_path, msg) + }) +} + +fn serialize_transform_error(resolved_path: &str, msg: &str) -> serde_json::Value { + if let Ok(parsed) = serde_json::from_str::(msg) { + return parsed; + } + json!({ + "type": "Transform Error", + "id": resolved_path, + "errorFrame": msg, + "cause": "Potential Causes:\n1.This kind of module is not supported, you may need plugins to support it.\n", + "message": format!("Transform `{}` failed.\n {}", resolved_path, msg) + }) +} + pub type Result = core::result::Result; pub trait ToResolveError diff --git a/crates/core/src/lib.rs b/crates/core/src/lib.rs index 2178213ffe..836e52d0bb 100644 --- a/crates/core/src/lib.rs +++ b/crates/core/src/lib.rs @@ -1,8 +1,12 @@ +#![feature(let_chains)] #![deny(clippy::all)] #![allow(clippy::ptr_arg)] #![feature(trivial_bounds)] #![allow(clippy::redundant_closure_call)] #![allow(clippy::to_string_trait_impl)] +#![allow(clippy::macro_metavars_in_unsafe)] +#![allow(clippy::too_long_first_doc_paragraph)] + // #![feature(unsize)] // #![feature(trait_upcasting)] pub mod cache; @@ -15,15 +19,20 @@ pub mod plugin; pub mod resource; pub mod stats; +pub use cache::cacheable::*; pub use farmfe_macro_cache_item::cache_item; -/// Version of this core crate, if the core data structures changed, and the changes will affect the memory layout, -/// like adding or removing a field, this version should be bumped. So plugin loader can recognize compatibility of the dynamic library plugins and the core. +/// Version of this core crate, if the core data structures changed, +/// and the changes will affect the memory layout, +/// like adding or removing a field, this version should be bumped. +/// So plugin loader can recognize compatibility of the dynamic library plugins and the core. pub const VERSION: &str = "0.5.0"; // re-export common external crates pub use dashmap; pub use enhanced_magic_string; +pub use heck; +pub use lazy_static; pub use parking_lot; pub use petgraph; #[cfg(feature = "profile")] @@ -42,7 +51,11 @@ pub use swc_ecma_ast; pub use swc_ecma_parser; pub use swc_html_ast; pub use wax; -pub use heck; + +// re-export common type alias +pub type HashMap = rustc_hash::FxHashMap; +pub type HashSet = rustc_hash::FxHashSet; +pub type DashMap = dashmap::DashMap; #[macro_export] macro_rules! farm_profile_scope { diff --git a/crates/core/src/module/meta_data/css.rs b/crates/core/src/module/meta_data/css.rs new file mode 100644 index 0000000000..38acd57a12 --- /dev/null +++ b/crates/core/src/module/meta_data/css.rs @@ -0,0 +1,52 @@ +use farmfe_macro_cache_item::cache_item; +use swc_common::DUMMY_SP; +use swc_css_ast::Stylesheet; + +use crate::HashMap; + +use super::{custom::CustomMetaDataMap, script::CommentsMetaData}; + +#[cache_item] +pub struct CssModuleMetaData { + pub ast: Stylesheet, + pub comments: CommentsMetaData, + pub custom: CustomMetaDataMap, +} + +impl Clone for CssModuleMetaData { + fn clone(&self) -> Self { + let custom = if self.custom.is_empty() { + HashMap::default() + } else { + let mut custom = HashMap::default(); + for (k, v) in self.custom.iter() { + let cloned_data = v.serialize_bytes().unwrap(); + let cloned_custom = v.deserialize_bytes(cloned_data).unwrap(); + custom.insert(k.clone(), cloned_custom); + } + custom + }; + + Self { + ast: self.ast.clone(), + comments: self.comments.clone(), + custom: CustomMetaDataMap::from(custom), + } + } +} + +impl CssModuleMetaData { + pub fn take_ast(&mut self) -> Stylesheet { + std::mem::replace( + &mut self.ast, + Stylesheet { + span: DUMMY_SP, + rules: vec![], + }, + ) + } + + pub fn set_ast(&mut self, ast: Stylesheet) { + self.ast = ast; + } +} diff --git a/crates/core/src/module/meta_data/custom.rs b/crates/core/src/module/meta_data/custom.rs new file mode 100644 index 0000000000..179f7b0a6d --- /dev/null +++ b/crates/core/src/module/meta_data/custom.rs @@ -0,0 +1,207 @@ +use crate::{Cacheable, HashMap}; +use dashmap::DashMap; +use rkyv::*; +use std::{ + collections::hash_map::Iter, + fmt::{Debug, Formatter}, +}; + +#[derive(Default)] +pub struct CustomMetaDataMap { + map: HashMap>, + /// The bytes map is used to store the serialized data of the map above + bytes_map: DashMap>, +} + +impl Debug for CustomMetaDataMap { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + f.debug_struct("CustomMetaDataMap") + .field( + "map_keys", + &self.map.iter().map(|item| item.0).collect::>() as _, + ) + .field( + "bytes_map_keys", + &self + .bytes_map + .iter() + .map(|item| item.key().to_string()) + .collect::>() as _, + ) + .finish() + } +} + +impl serde::Serialize for CustomMetaDataMap { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + let mut map = HashMap::>::default(); + + for (k, v) in self.map.iter() { + let cloned_data = v.serialize_bytes().unwrap(); + map.insert(k.clone(), cloned_data); + } + + serde::Serialize::serialize(&map, serializer) + } +} + +impl<'de> serde::Deserialize<'de> for CustomMetaDataMap { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let map: HashMap> = serde::Deserialize::deserialize(deserializer)?; + let mut res = CustomMetaDataMap { + map: HashMap::default(), + bytes_map: DashMap::new(), + }; + + res.bytes_map = map.into_iter().collect(); + Ok(res) + } +} + +impl CustomMetaDataMap { + pub fn new() -> Self { + Self { + map: HashMap::default(), + bytes_map: DashMap::new(), + } + } + + pub fn is_empty(&self) -> bool { + self.map.is_empty() + } + + pub fn iter(&self) -> Iter> { + self.map.iter() + } + + pub fn get_mut(&mut self, key: &str) -> Option<&mut T> { + if let Some((_, bytes)) = self.bytes_map.remove(key) { + let value = T::deserialize_bytes(&T::default(), bytes).unwrap(); + self.map.insert(key.to_string(), value); + } + + self.map.get_mut(key).and_then(|v| v.downcast_mut::()) + } + + pub fn insert(&mut self, key: String, value: Box) { + self.map.insert(key, value); + } + + pub fn remove(&mut self, key: &str) { + self.map.remove(key); + } +} + +impl From>> for CustomMetaDataMap { + fn from(map: HashMap>) -> Self { + Self { + map, + bytes_map: DashMap::new(), + } + } +} + +impl Clone for CustomMetaDataMap { + fn clone(&self) -> Self { + let custom = if self.map.is_empty() { + HashMap::default() + } else { + let mut custom = HashMap::default(); + for (k, v) in self.map.iter() { + let cloned_data = v.serialize_bytes().unwrap(); + let cloned_custom = v.deserialize_bytes(cloned_data).unwrap(); + custom.insert(k.clone(), cloned_custom); + } + custom + }; + + Self { + map: custom, + bytes_map: self.bytes_map.clone(), + } + } +} + +impl<__D: Fallible + ?Sized> Deserialize for Archived { + #[inline] + fn deserialize( + &self, + deserializer: &mut __D, + ) -> ::core::result::Result { + let map = Deserialize::>, __D>::deserialize(&self.map, deserializer)?; + let mut res = CustomMetaDataMap { + map: HashMap::default(), + bytes_map: DashMap::new(), + }; + + res.bytes_map = map.into_iter().collect(); + Ok(res) + } +} + +impl<__S: Fallible + ?Sized> Serialize<__S> for CustomMetaDataMap +where + __S: rkyv::ser::Serializer + rkyv::ser::ScratchSpace, +{ + #[inline] + fn serialize(&self, serializer: &mut __S) -> ::core::result::Result { + let mut map = HashMap::>::default(); + + for (k, v) in self.map.iter() { + let cloned_data = v.serialize_bytes().unwrap(); + map.insert(k.clone(), cloned_data); + } + + let resolver_map = Serialize::<__S>::serialize(&map, serializer)?; + + for (k, v) in map { + self.bytes_map.insert(k, v); + } + + Ok(CustomMetaDataMapResolver { map: resolver_map }) + } +} + +pub struct ArchivedCustomMetaDataMap { + ///The archived counterpart of [`CustomMetaDataMap::map`] + pub map: ::rkyv::Archived>>, +} + +pub struct CustomMetaDataMapResolver { + map: ::rkyv::Resolver>>, +} + +impl Archive for CustomMetaDataMap { + type Archived = ArchivedCustomMetaDataMap; + type Resolver = CustomMetaDataMapResolver; + #[allow(clippy::unit_arg)] + #[inline] + unsafe fn resolve(&self, pos: usize, resolver: Self::Resolver, out: *mut Self::Archived) { + let (fp, fo) = { + #[allow(unused_unsafe)] + unsafe { + let fo = &raw mut (*out).map; + (fo.cast::().offset_from(out.cast::()) as usize, fo) + } + }; + let mut map = HashMap::>::default(); + let mut keys = vec![]; + + for item in self.bytes_map.iter() { + keys.push(item.key().clone()); + } + + for key in keys { + let (k, v) = self.bytes_map.remove(&key).unwrap(); + map.insert(k, v); + } + + ::rkyv::Archive::resolve(&map, pos + fp, resolver.map, fo); + } +} diff --git a/crates/core/src/module/meta_data/html.rs b/crates/core/src/module/meta_data/html.rs new file mode 100644 index 0000000000..662b1a37a6 --- /dev/null +++ b/crates/core/src/module/meta_data/html.rs @@ -0,0 +1,32 @@ +use farmfe_macro_cache_item::cache_item; +use swc_html_ast::Document; + +use super::custom::CustomMetaDataMap; +use crate::HashMap; + +#[cache_item] +pub struct HtmlModuleMetaData { + pub ast: Document, + pub custom: CustomMetaDataMap, +} + +impl Clone for HtmlModuleMetaData { + fn clone(&self) -> Self { + let custom = if self.custom.is_empty() { + HashMap::default() + } else { + let mut custom = HashMap::default(); + for (k, v) in self.custom.iter() { + let cloned_data = v.serialize_bytes().unwrap(); + let cloned_custom = v.deserialize_bytes(cloned_data).unwrap(); + custom.insert(k.clone(), cloned_custom); + } + custom + }; + + Self { + ast: self.ast.clone(), + custom: CustomMetaDataMap::from(custom), + } + } +} diff --git a/crates/core/src/module/meta_data/mod.rs b/crates/core/src/module/meta_data/mod.rs new file mode 100644 index 0000000000..df150a515f --- /dev/null +++ b/crates/core/src/module/meta_data/mod.rs @@ -0,0 +1,119 @@ +use std::collections::HashMap; + +use css::CssModuleMetaData; +use custom::CustomMetaDataMap; +use farmfe_macro_cache_item::cache_item; +use html::HtmlModuleMetaData; +use script::ScriptModuleMetaData; + +use crate::Cacheable; + +pub mod css; +pub mod custom; +pub mod html; +pub mod script; + +/// Module meta data shared by core plugins through the compilation +/// Meta data which is not shared by core plugins should be stored in [ModuleMetaData::Custom] +#[cache_item] +pub enum ModuleMetaData { + Script(Box), + Css(Box), + Html(Box), + Custom(CustomMetaDataMap), +} + +impl Default for ModuleMetaData { + fn default() -> Self { + Self::Custom(CustomMetaDataMap::default()) + } +} + +impl ToString for ModuleMetaData { + fn to_string(&self) -> String { + match self { + Self::Script(_) => "script".to_string(), + Self::Css(_) => "css".to_string(), + Self::Html(_) => "html".to_string(), + Self::Custom(_) => "custom".to_string(), + } + } +} + +impl Clone for ModuleMetaData { + fn clone(&self) -> Self { + match self { + Self::Script(script) => Self::Script(script.clone()), + Self::Css(css) => Self::Css(css.clone()), + Self::Html(html) => Self::Html(html.clone()), + Self::Custom(custom) => { + let mut custom_new = HashMap::default(); + for (k, v) in custom.iter() { + let cloned_data = v.serialize_bytes().unwrap(); + let cloned_custom = v.deserialize_bytes(cloned_data).unwrap(); + custom_new.insert(k.clone(), cloned_custom); + } + Self::Custom(CustomMetaDataMap::from(custom_new)) + } + } + } +} + +impl ModuleMetaData { + pub fn as_script_mut(&mut self) -> &mut ScriptModuleMetaData { + if let Self::Script(script) = self { + script + } else { + panic!("ModuleMetaData is not Script but {:?}", self.to_string()) + } + } + + pub fn as_script(&self) -> &ScriptModuleMetaData { + if let Self::Script(script) = self { + script + } else { + panic!("ModuleMetaData is not Script but {:?}", self.to_string()) + } + } + + pub fn as_css(&self) -> &CssModuleMetaData { + if let Self::Css(css) = self { + css + } else { + panic!("ModuleMetaData is not css") + } + } + + pub fn as_css_mut(&mut self) -> &mut CssModuleMetaData { + if let Self::Css(css) = self { + css + } else { + panic!("ModuleMetaData is not css") + } + } + + pub fn as_html(&self) -> &HtmlModuleMetaData { + if let Self::Html(html) = self { + html + } else { + panic!("ModuleMetaData is not html") + } + } + + pub fn as_html_mut(&mut self) -> &mut HtmlModuleMetaData { + if let Self::Html(html) = self { + html + } else { + panic!("ModuleMetaData is not html") + } + } + + /// get custom meta data by key + pub fn get_custom_mut(&mut self, key: &str) -> &mut T { + if let Self::Custom(custom) = self { + custom.get_mut(key).unwrap() + } else { + panic!("ModuleMetaData is not Custom") + } + } +} diff --git a/crates/core/src/module/meta_data/script.rs b/crates/core/src/module/meta_data/script.rs new file mode 100644 index 0000000000..3f4af54e78 --- /dev/null +++ b/crates/core/src/module/meta_data/script.rs @@ -0,0 +1,258 @@ +use std::{cell::RefCell, rc::Rc}; + +use farmfe_macro_cache_item::cache_item; +use feature_flag::FeatureFlag; +use swc_common::{ + comments::{ + Comment, SingleThreadedComments, SingleThreadedCommentsMap, SingleThreadedCommentsMapInner, + }, + BytePos, +}; +use swc_ecma_ast::Module as SwcModule; + +use crate::module::ModuleId; +use crate::{HashMap, HashSet}; + +use super::custom::CustomMetaDataMap; + +use statement::{Statement, SwcId}; + +pub mod feature_flag; +pub mod statement; + +pub const EXPORT_NAMESPACE: &str = "namespace_farm_internal_"; +pub const EXPORT_DEFAULT: &str = "default"; + +#[cache_item] +#[derive(Debug, Clone, Hash, PartialEq, Eq)] +pub struct ModuleExportIdent { + pub module_id: ModuleId, + pub ident: SwcId, +} + +/// Script specific meta data, for example, [swc_ecma_ast::Module] +#[cache_item] +pub struct ScriptModuleMetaData { + pub ast: SwcModule, + pub top_level_mark: u32, + pub unresolved_mark: u32, + pub module_system: ModuleSystem, + /// true if this module calls `import.meta.hot.accept()` or `import.meta.hot.accept(mod => {})` + pub hmr_self_accepted: bool, + pub hmr_accepted_deps: HashSet, + pub comments: CommentsMetaData, + pub statements: Vec, + pub top_level_idents: HashSet, + pub unresolved_idents: HashSet, + pub is_async: bool, + pub feature_flags: HashSet, + /// real export ident map, for example: + /// export { m as bar } + /// export { foo as default } from './module'; + /// => + /// Map { bar -> m#1, default -> foo#1 where foo#1 is defined in './module' } + pub export_ident_map: HashMap, + pub custom: CustomMetaDataMap, +} + +impl Default for ScriptModuleMetaData { + fn default() -> Self { + Self { + ast: SwcModule::default(), + top_level_mark: 0, + unresolved_mark: 0, + module_system: ModuleSystem::EsModule, + hmr_self_accepted: false, + hmr_accepted_deps: Default::default(), + comments: Default::default(), + statements: vec![], + top_level_idents: Default::default(), + unresolved_idents: Default::default(), + is_async: false, + feature_flags: Default::default(), + export_ident_map: Default::default(), + custom: Default::default(), + } + } +} + +impl Clone for ScriptModuleMetaData { + fn clone(&self) -> Self { + let custom = if self.custom.is_empty() { + HashMap::default() + } else { + let mut custom = HashMap::default(); + for (k, v) in self.custom.iter() { + let cloned_data = v.serialize_bytes().unwrap(); + let cloned_custom = v.deserialize_bytes(cloned_data).unwrap(); + custom.insert(k.clone(), cloned_custom); + } + custom + }; + + Self { + ast: self.ast.clone(), + top_level_mark: self.top_level_mark, + unresolved_mark: self.unresolved_mark, + module_system: self.module_system.clone(), + hmr_self_accepted: self.hmr_self_accepted, + hmr_accepted_deps: self.hmr_accepted_deps.clone(), + comments: self.comments.clone(), + statements: self.statements.clone(), + top_level_idents: self.top_level_idents.clone(), + unresolved_idents: self.unresolved_idents.clone(), + is_async: self.is_async, + feature_flags: self.feature_flags.clone(), + export_ident_map: self.export_ident_map.clone(), + custom: CustomMetaDataMap::from(custom), + } + } +} + +impl ScriptModuleMetaData { + pub fn take_ast(&mut self) -> SwcModule { + std::mem::replace( + &mut self.ast, + SwcModule { + span: Default::default(), + body: Default::default(), + shebang: None, + }, + ) + } + + pub fn set_ast(&mut self, ast: SwcModule) { + self.ast = ast; + } + + pub fn take_comments(&mut self) -> CommentsMetaData { + std::mem::take(&mut self.comments) + } + + pub fn set_comments(&mut self, comments: CommentsMetaData) { + self.comments = comments; + } + + pub fn is_cjs(&self) -> bool { + matches!(self.module_system, ModuleSystem::CommonJs) + } + + pub fn is_esm(&self) -> bool { + matches!(self.module_system, ModuleSystem::EsModule) + } + + pub fn is_hybrid(&self) -> bool { + matches!(self.module_system, ModuleSystem::Hybrid) + } + + pub fn get_export_idents(&self) -> Vec<(String, ModuleExportIdent)> { + let mut export_idents = self + .export_ident_map + .iter() + .filter(|(k, _)| *k != EXPORT_NAMESPACE) + .map(|(k, v)| (k.clone(), v.clone())) + .collect::>(); + export_idents.sort_by_key(|a| a.0.clone()); + + export_idents + } +} + +#[cache_item] +#[derive(Clone)] +pub struct CommentsMetaDataItem { + pub byte_pos: BytePos, + pub comment: Vec, +} + +#[cache_item] +#[derive(Clone, Default)] +pub struct CommentsMetaData { + pub leading: Vec, + pub trailing: Vec, +} + +impl From for CommentsMetaData { + fn from(value: SingleThreadedComments) -> Self { + let (swc_leading_map, swc_trailing_map) = value.take_all(); + let transform_comment_map = |map: SingleThreadedCommentsMap| { + map + .take() + .into_iter() + .map(|(byte_pos, comments)| CommentsMetaDataItem { + byte_pos, + comment: comments, + }) + .collect::>() + }; + + let leading = transform_comment_map(swc_leading_map); + let trailing = transform_comment_map(swc_trailing_map); + + Self { leading, trailing } + } +} + +impl From for SingleThreadedComments { + fn from(value: CommentsMetaData) -> Self { + let transform_comment_map = |comments: Vec| { + Rc::new(RefCell::new( + comments + .into_iter() + .map(|item| (item.byte_pos, item.comment)) + .collect::(), + )) + }; + + let leading = transform_comment_map(value.leading); + let trailing = transform_comment_map(value.trailing); + + SingleThreadedComments::from_leading_and_trailing(leading, trailing) + } +} + +#[cache_item] +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum ModuleSystem { + UnInitial, + EsModule, + CommonJs, + // Hybrid of commonjs and es-module + Hybrid, + Custom(String), +} + +impl ModuleSystem { + pub fn merge(&self, module_system: ModuleSystem) -> ModuleSystem { + if matches!(module_system, ModuleSystem::UnInitial) { + return self.clone(); + } + + match self { + ModuleSystem::UnInitial => module_system, + ModuleSystem::EsModule => { + if matches!(module_system, ModuleSystem::CommonJs) { + ModuleSystem::Hybrid + } else { + module_system + } + } + + ModuleSystem::CommonJs => { + if matches!(module_system, ModuleSystem::EsModule) { + ModuleSystem::Hybrid + } else { + module_system + } + } + + ModuleSystem::Hybrid => ModuleSystem::Hybrid, + + ModuleSystem::Custom(_) => module_system, + } + } + + pub fn contains_commonjs(&self) -> bool { + matches!(self, ModuleSystem::CommonJs | ModuleSystem::Hybrid) + } +} diff --git a/crates/core/src/module/meta_data/script/feature_flag.rs b/crates/core/src/module/meta_data/script/feature_flag.rs new file mode 100644 index 0000000000..24af4c3c4a --- /dev/null +++ b/crates/core/src/module/meta_data/script/feature_flag.rs @@ -0,0 +1,46 @@ +use farmfe_macro_cache_item::cache_item; + +pub const FARM_ENABLE_TOP_LEVEL_AWAIT: &str = "__FARM_ENABLE_TOP_LEVEL_AWAIT__"; +pub const FARM_ENABLE_EXPORT_HELPER: &str = "__FARM_ENABLE_EXPORT_HELPER__"; +pub const FARM_ENABLE_EXPORT_ALL_HELPER: &str = "__FARM_ENABLE_EXPORT_ALL_HELPER__"; +pub const FARM_ENABLE_IMPORT_ALL_HELPER: &str = "__FARM_ENABLE_IMPORT_ALL_HELPER__"; +pub const FARM_IMPORT_EXPORT_FROM_HELPER: &str = "__FARM_IMPORT_EXPORT_FROM_HELPER__"; +pub const FARM_ENABLE_IMPORT_DEFAULT_HELPER: &str = "__FARM_ENABLE_IMPORT_DEFAULT_HELPER__"; + +/// Features that used in a script module +#[cache_item] +#[derive(Debug, Clone, Hash, PartialEq, Eq)] +#[archive_attr(derive(Hash, Eq, PartialEq))] +pub enum FeatureFlag { + /// import('xxx') + DynamicImport, + /// use `await xxx` in top level scope + TopLevelAwait, + /// import xxx from 'xxx' + ImportDefault, + /// import * as xxx from 'xxx' + ImportNamespace, + /// import { xxx } from 'xxx' + ImportNamed, + /// export * from 'xxx' + ExportAll, + ExportFrom, + ExportStatement, + ImportStatement, +} + +impl FeatureFlag { + pub fn as_str(&self) -> &str { + match self { + FeatureFlag::DynamicImport => "DynamicImport", + FeatureFlag::TopLevelAwait => FARM_ENABLE_TOP_LEVEL_AWAIT, + FeatureFlag::ImportDefault => FARM_ENABLE_IMPORT_DEFAULT_HELPER, + FeatureFlag::ImportNamespace => FARM_ENABLE_IMPORT_ALL_HELPER, + FeatureFlag::ExportAll => FARM_ENABLE_EXPORT_ALL_HELPER, + FeatureFlag::ExportFrom => FARM_IMPORT_EXPORT_FROM_HELPER, + FeatureFlag::ExportStatement => FARM_ENABLE_EXPORT_HELPER, + FeatureFlag::ImportStatement => "ImportStatement", + FeatureFlag::ImportNamed => "ImportStatement", + } + } +} diff --git a/crates/core/src/module/meta_data/script/statement.rs b/crates/core/src/module/meta_data/script/statement.rs new file mode 100644 index 0000000000..4ce93265f6 --- /dev/null +++ b/crates/core/src/module/meta_data/script/statement.rs @@ -0,0 +1,261 @@ +use farmfe_macro_cache_item::cache_item; +use swc_ecma_ast::{Id, Ident, ImportSpecifier, ModuleExportName}; + +use crate::HashSet; + +pub type StatementId = usize; + +#[derive(Debug, Clone)] +#[cache_item] +pub struct Statement { + pub id: StatementId, + pub import_info: Option, + pub export_info: Option, + pub defined_idents: HashSet, + pub top_level_await: bool, + + /// Only set in plugin_tree_shake. Used idents of defined idents, updated when trace the statement graph + pub used_defined_idents: HashSet, + /// Only set in plugin_tree_shake. Whether the statement has side effects, the side effect statement will be preserved + pub side_effects: StatementSideEffects, +} + +impl Statement { + pub fn new( + id: StatementId, + export_info: Option, + import_info: Option, + defined_idents: HashSet, + top_level_await: bool, + ) -> Self { + Self { + id, + import_info, + export_info, + defined_idents, + top_level_await, + used_defined_idents: HashSet::default(), // updated when trace the statement graph while tree shaking + side_effects: StatementSideEffects::NoSideEffects, + } + } +} + +#[derive(Debug, Clone, PartialEq, Eq)] +#[cache_item] +pub enum StatementSideEffects { + /// If the statement is a write operation, it will be considered as a side effect, when the written value is used, the statement will be preserved, otherwise it will be removed + /// Example: + /// ```js + /// a = 2, b = 3; + /// a.prototype.b = 3; + /// a.set('c', 4); + /// ``` + WriteTopLevelVar(HashSet), + + /// Example: + /// ```js + /// const a = {}; + /// const p = a.prototype; // p is read top level value + /// ``` + ReadTopLevelVar(HashSet), + + /// Maybe modify global variable, it's always preserved, for example: + /// ```js + /// console.log('123'); + /// window.b = 3; + /// document.body.addEventListener('click', () =/* */> {}); + /// ``` + WriteOrCallGlobalVar, + + /// Unclassified default self executed statements are always treated as side effects. For example: + /// ```js + /// for (let i = 0; i < 10; i++) { + /// a[i] = i; + /// b[i] = a[i] + i; + /// } + /// (function() { + /// a = 2; + /// })() + /// function foo() { + /// console.log('123'); + /// } + /// foo(); + /// ``` + /// They may be classified in the future to improve the accuracy of tree shaking + UnclassifiedSelfExecuted, + /// The statement does not have side effects, for example: + /// ```js + /// const a = 2; + /// function foo() {} + /// ``` + NoSideEffects, +} + +impl StatementSideEffects { + pub fn is_preserved(&self) -> bool { + matches!( + self, + Self::WriteOrCallGlobalVar | Self::UnclassifiedSelfExecuted + ) + } + + pub fn merge_side_effects(&mut self, other: Self) { + let mut original_self_value = std::mem::replace(self, Self::NoSideEffects); + + match (&mut original_self_value, &other) { + (StatementSideEffects::WriteTopLevelVar(a), StatementSideEffects::WriteTopLevelVar(b)) => { + a.extend(b.iter().cloned()) + } + (StatementSideEffects::WriteTopLevelVar(_), StatementSideEffects::ReadTopLevelVar(_)) => {} + (StatementSideEffects::WriteTopLevelVar(_), StatementSideEffects::WriteOrCallGlobalVar) => { + original_self_value = other; + } + ( + StatementSideEffects::WriteTopLevelVar(_), + StatementSideEffects::UnclassifiedSelfExecuted, + ) => { + original_self_value = other; + } + (StatementSideEffects::WriteTopLevelVar(_), StatementSideEffects::NoSideEffects) => {} + (StatementSideEffects::ReadTopLevelVar(_), StatementSideEffects::WriteTopLevelVar(_)) => { + original_self_value = other; + } + (StatementSideEffects::ReadTopLevelVar(a), StatementSideEffects::ReadTopLevelVar(b)) => { + a.extend(b.iter().cloned()); + } + (StatementSideEffects::ReadTopLevelVar(_), StatementSideEffects::WriteOrCallGlobalVar) => { + original_self_value = other; + } + ( + StatementSideEffects::ReadTopLevelVar(_), + StatementSideEffects::UnclassifiedSelfExecuted, + ) => { + original_self_value = other; + } + (StatementSideEffects::ReadTopLevelVar(_), StatementSideEffects::NoSideEffects) => {} + ( + StatementSideEffects::WriteOrCallGlobalVar | StatementSideEffects::UnclassifiedSelfExecuted, + _, + ) => {} + (StatementSideEffects::NoSideEffects, _) => original_self_value = other, + } + + *self = original_self_value; + } +} + +#[cache_item] +#[derive( + Debug, Clone, Hash, PartialEq, Eq, PartialOrd, Ord, serde::Serialize, serde::Deserialize, +)] +#[archive_attr(derive(Hash, Eq, PartialEq))] +pub struct SwcId { + pub sym: swc_atoms::Atom, + ctxt: u32, +} + +impl From for SwcId { + fn from(value: Id) -> Self { + Self { + sym: value.0, + ctxt: value.1.as_u32(), + } + } +} + +impl From for SwcId { + fn from(value: Ident) -> Self { + Self { + sym: value.sym, + ctxt: value.ctxt.as_u32(), + } + } +} + +impl SwcId { + pub fn ctxt(&self) -> swc_common::SyntaxContext { + swc_common::SyntaxContext::from_u32(self.ctxt) + } +} + +#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)] +#[cache_item] +#[serde(rename_all = "camelCase")] +pub enum ImportSpecifierInfo { + /// import * as foo from 'foo'; + Namespace(SwcId), + /// import { foo, bar as zoo } from 'foo'; + Named { + /// foo or zoo in `import { foo, bar as zoo } from 'foo';` + local: SwcId, + /// bar in `import { foo, bar as zoo } from 'foo';` + imported: Option, + }, + /// import foo from 'foo'; + Default(SwcId), +} + +impl From<&ImportSpecifier> for ImportSpecifierInfo { + fn from(value: &ImportSpecifier) -> Self { + match value { + ImportSpecifier::Named(named) => ImportSpecifierInfo::Named { + local: named.local.to_id().into(), + imported: named.imported.as_ref().map(|i| match i { + ModuleExportName::Ident(i) => i.to_id().into(), + _ => panic!("non-ident imported is not supported when tree shaking"), + }), + }, + ImportSpecifier::Default(default) => { + ImportSpecifierInfo::Default(default.local.to_id().into()) + } + ImportSpecifier::Namespace(ns) => ImportSpecifierInfo::Namespace(ns.local.to_id().into()), + } + } +} + +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] +#[cache_item] +#[serde(rename_all = "camelCase")] +pub struct ImportInfo { + pub source: String, + pub specifiers: Vec, + /// index of the import statement in the module's body + pub stmt_id: StatementId, +} + +/// collect all exports and gathering them into a simpler structure +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] +#[cache_item] +#[serde(rename_all = "camelCase")] +pub enum ExportSpecifierInfo { + /// export * from 'foo'; + All, + /// export { foo, bar, default as zoo } from 'foo'; + Named { + local: SwcId, + exported: Option, + }, + /// export default xxx; + Default, + /// export * as foo from 'foo'; + Namespace(SwcId), +} + +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] +#[cache_item] +#[serde(rename_all = "camelCase")] +pub struct ExportInfo { + pub source: Option, + pub specifiers: Vec, + /// index of the import statement in the module's body + pub stmt_id: StatementId, +} + +impl ExportInfo { + pub fn contains_default_export(&self) -> bool { + self + .specifiers + .iter() + .any(|s| matches!(s, ExportSpecifierInfo::Default)) + } +} diff --git a/crates/core/src/module/mod.rs b/crates/core/src/module/mod.rs index 0f82725146..1db02fdadb 100644 --- a/crates/core/src/module/mod.rs +++ b/crates/core/src/module/mod.rs @@ -1,34 +1,22 @@ -use std::{ - any::Any, cell::RefCell, collections::HashMap, hash::Hash, path::Path, rc::Rc, sync::Arc, -}; +use std::{hash::Hash, path::Path, sync::Arc}; +use crate::HashSet; use blake2::{ digest::{Update, VariableOutput}, Blake2bVar, }; -use downcast_rs::{impl_downcast, Downcast}; use farmfe_macro_cache_item::cache_item; use farmfe_utils::relative; use heck::AsLowerCamelCase; +pub use meta_data::{custom::CustomMetaDataMap, script::ModuleSystem, ModuleMetaData}; use relative_path::RelativePath; use rkyv::Deserialize; -use rkyv_dyn::archive_dyn; -use rkyv_typename::TypeName; -use std::collections::HashSet; -use swc_common::{ - comments::{ - Comment, SingleThreadedComments, SingleThreadedCommentsMap, SingleThreadedCommentsMapInner, - }, - BytePos, DUMMY_SP, -}; -use swc_css_ast::Stylesheet; -use swc_ecma_ast::Module as SwcModule; -use swc_html_ast::Document; use crate::{config::Mode, resource::resource_pot::ResourcePotId}; use self::module_group::ModuleGroupId; +pub mod meta_data; pub mod module_graph; pub mod module_group; pub mod watch_graph; @@ -38,6 +26,7 @@ pub const VIRTUAL_MODULE_PREFIX: &str = "virtual:"; /// A [Module] is a basic compilation unit /// The [Module] is created by plugins in the parse hook of build stage #[cache_item] +#[derive(Clone)] pub struct Module { /// the id of this module, generated from the resolved id. pub id: ModuleId, @@ -45,8 +34,8 @@ pub struct Module { pub module_type: ModuleType, /// the module groups this module belongs to, used to construct [crate::module::module_group::ModuleGroupGraph] pub module_groups: HashSet, - /// the resource pot this module belongs to - pub resource_pot: Option, + /// the resource pot this module belongs to. A module may belongs multiple resource pots. + pub resource_pots: HashSet, /// the meta data of this module custom by plugins pub meta: Box, /// whether this module has side_effects @@ -75,46 +64,18 @@ pub struct Module { pub package_name: String, /// package version of this module pub package_version: String, + /// whether this module is a entry module + pub is_entry: bool, + /// whether this module is a dynamic entry module + pub is_dynamic_entry: bool, // custom meta map - pub custom: HashMap>, + pub custom: CustomMetaDataMap, } -impl Clone for Module { - fn clone(&self) -> Self { - let custom = if self.custom.is_empty() { - HashMap::new() - } else { - let mut custom = HashMap::new(); - for (k, v) in self.custom.iter() { - let cloned_data = crate::serialize!(v); - let cloned_custom = - crate::deserialize!(&cloned_data, Box); - custom.insert(k.clone(), cloned_custom); - } - custom - }; - - Self { - id: self.id.clone(), - module_type: self.module_type.clone(), - module_groups: self.module_groups.clone(), - resource_pot: self.resource_pot.clone(), - meta: self.meta.clone(), - side_effects: self.side_effects, - source_map_chain: self.source_map_chain.clone(), - external: self.external, - immutable: self.immutable, - execution_order: self.execution_order, - size: self.size, - content: self.content.clone(), - used_exports: self.used_exports.clone(), - last_update_timestamp: self.last_update_timestamp, - content_hash: self.content_hash.clone(), - package_name: self.package_name.clone(), - package_version: self.package_version.clone(), - custom, - } +impl Default for Module { + fn default() -> Self { + Self::new(ModuleId::from("")) } } @@ -123,9 +84,9 @@ impl Module { Self { id, module_type: ModuleType::Custom("__farm_unknown".to_string()), - meta: Box::new(ModuleMetaData::Custom(Box::new(EmptyModuleMetaData) as _)), - module_groups: HashSet::new(), - resource_pot: None, + meta: Box::new(ModuleMetaData::default()), + module_groups: HashSet::default(), + resource_pots: Default::default(), side_effects: true, source_map_chain: vec![], external: false, @@ -139,383 +100,9 @@ impl Module { content_hash: "".to_string(), package_name: "".to_string(), package_version: "".to_string(), - custom: HashMap::new(), - } - } -} - -/// Module meta data shared by core plugins through the compilation -/// Meta data which is not shared by core plugins should be stored in [ModuleMetaData::Custom] -#[cache_item] -pub enum ModuleMetaData { - Script(ScriptModuleMetaData), - Css(CssModuleMetaData), - Html(HtmlModuleMetaData), - Custom(Box), -} - -impl ToString for ModuleMetaData { - fn to_string(&self) -> String { - match self { - Self::Script(_) => "script".to_string(), - Self::Css(_) => "css".to_string(), - Self::Html(_) => "html".to_string(), - Self::Custom(_) => "custom".to_string(), - } - } -} - -impl Clone for ModuleMetaData { - fn clone(&self) -> Self { - match self { - Self::Script(script) => Self::Script(script.clone()), - Self::Css(css) => Self::Css(css.clone()), - Self::Html(html) => Self::Html(html.clone()), - Self::Custom(custom) => { - let cloned_data = crate::serialize!(custom); - let cloned_custom = - crate::deserialize!(&cloned_data, Box); - Self::Custom(cloned_custom) - } - } - } -} - -impl ModuleMetaData { - pub fn as_script_mut(&mut self) -> &mut ScriptModuleMetaData { - if let Self::Script(script) = self { - script - } else { - panic!("ModuleMetaData is not Script") - } - } - - pub fn as_script(&self) -> &ScriptModuleMetaData { - if let Self::Script(script) = self { - script - } else { - panic!("ModuleMetaData is not Script but {:?}", self.to_string()) - } - } - - pub fn as_css(&self) -> &CssModuleMetaData { - if let Self::Css(css) = self { - css - } else { - panic!("ModuleMetaData is not css") - } - } - - pub fn as_css_mut(&mut self) -> &mut CssModuleMetaData { - if let Self::Css(css) = self { - css - } else { - panic!("ModuleMetaData is not css") - } - } - - pub fn as_html(&self) -> &HtmlModuleMetaData { - if let Self::Html(html) = self { - html - } else { - panic!("ModuleMetaData is not html") - } - } - - pub fn as_html_mut(&mut self) -> &mut HtmlModuleMetaData { - if let Self::Html(html) = self { - html - } else { - panic!("ModuleMetaData is not html") - } - } - - pub fn as_custom_mut(&mut self) -> &mut T { - if let Self::Custom(custom) = self { - if let Some(c) = custom.downcast_mut::() { - c - } else { - panic!("custom meta type is not serializable"); - } - } else { - panic!("ModuleMetaData is not Custom") - } - } - - pub fn as_custom(&self) -> &T { - if let Self::Custom(custom) = self { - if let Some(c) = custom.downcast_ref::() { - c - } else { - panic!("custom meta type is not serializable"); - } - } else { - panic!("ModuleMetaData is not Custom") - } - } -} - -/// Trait that makes sure the trait object implements [rkyv::Serialize] and [rkyv::Deserialize] -#[archive_dyn(deserialize)] -pub trait CustomModuleMetaData: Any + Send + Sync + Downcast {} - -impl_downcast!(SerializeCustomModuleMetaData); - -/// initial empty custom data, plugins may replace this -#[cache_item(CustomModuleMetaData)] -pub struct EmptyModuleMetaData; - -#[cache_item] -#[derive(Clone)] -pub struct CommentsMetaDataItem { - pub byte_pos: BytePos, - pub comment: Vec, -} - -#[cache_item] -#[derive(Clone, Default)] -pub struct CommentsMetaData { - pub leading: Vec, - pub trailing: Vec, -} - -impl From for CommentsMetaData { - fn from(value: SingleThreadedComments) -> Self { - let (swc_leading_map, swc_trailing_map) = value.take_all(); - let transform_comment_map = |map: SingleThreadedCommentsMap| { - map - .take() - .into_iter() - .map(|(byte_pos, comments)| CommentsMetaDataItem { - byte_pos, - comment: comments, - }) - .collect::>() - }; - - let leading = transform_comment_map(swc_leading_map); - let trailing = transform_comment_map(swc_trailing_map); - - Self { leading, trailing } - } -} - -impl From for SingleThreadedComments { - fn from(value: CommentsMetaData) -> Self { - let transform_comment_map = |comments: Vec| { - Rc::new(RefCell::new( - comments - .into_iter() - .map(|item| (item.byte_pos, item.comment)) - .collect::(), - )) - }; - - let leading = transform_comment_map(value.leading); - let trailing = transform_comment_map(value.trailing); - - SingleThreadedComments::from_leading_and_trailing(leading, trailing) - } -} - -/// Script specific meta data, for example, [swc_ecma_ast::Module] -#[cache_item] -pub struct ScriptModuleMetaData { - pub ast: SwcModule, - pub top_level_mark: u32, - pub unresolved_mark: u32, - pub module_system: ModuleSystem, - /// true if this module calls `import.meta.hot.accept()` or `import.meta.hot.accept(mod => {})` - pub hmr_self_accepted: bool, - pub hmr_accepted_deps: HashSet, - pub comments: CommentsMetaData, - pub custom: HashMap>, -} - -impl Default for ScriptModuleMetaData { - fn default() -> Self { - Self { - ast: SwcModule { - span: Default::default(), - body: Default::default(), - shebang: None, - }, - top_level_mark: 0, - unresolved_mark: 0, - module_system: ModuleSystem::EsModule, - hmr_self_accepted: false, - hmr_accepted_deps: Default::default(), - comments: Default::default(), - custom: Default::default(), - } - } -} - -impl Clone for ScriptModuleMetaData { - fn clone(&self) -> Self { - let custom = if self.custom.is_empty() { - HashMap::new() - } else { - let mut custom = HashMap::new(); - for (k, v) in self.custom.iter() { - let cloned_data = crate::serialize!(v); - let cloned_custom = - crate::deserialize!(&cloned_data, Box); - custom.insert(k.clone(), cloned_custom); - } - custom - }; - - Self { - ast: self.ast.clone(), - top_level_mark: self.top_level_mark, - unresolved_mark: self.unresolved_mark, - module_system: self.module_system.clone(), - hmr_self_accepted: self.hmr_self_accepted, - hmr_accepted_deps: self.hmr_accepted_deps.clone(), - comments: self.comments.clone(), - custom, - } - } -} - -impl ScriptModuleMetaData { - pub fn take_ast(&mut self) -> SwcModule { - std::mem::replace( - &mut self.ast, - SwcModule { - span: Default::default(), - body: Default::default(), - shebang: None, - }, - ) - } - - pub fn set_ast(&mut self, ast: SwcModule) { - self.ast = ast; - } - - pub fn take_comments(&mut self) -> CommentsMetaData { - std::mem::take(&mut self.comments) - } - - pub fn set_comments(&mut self, comments: CommentsMetaData) { - self.comments = comments; - } -} - -#[cache_item] -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub enum ModuleSystem { - UnInitial, - EsModule, - CommonJs, - // Hybrid of commonjs and es-module - Hybrid, - Custom(String), -} - -impl ModuleSystem { - pub fn merge(&self, module_system: ModuleSystem) -> ModuleSystem { - if matches!(module_system, ModuleSystem::UnInitial) { - return self.clone(); - } - - match self { - ModuleSystem::UnInitial => module_system, - ModuleSystem::EsModule => { - if matches!(module_system, ModuleSystem::CommonJs) { - ModuleSystem::Hybrid - } else { - module_system - } - } - - ModuleSystem::CommonJs => { - if matches!(module_system, ModuleSystem::EsModule) { - ModuleSystem::Hybrid - } else { - module_system - } - } - - ModuleSystem::Hybrid => ModuleSystem::Hybrid, - - ModuleSystem::Custom(_) => module_system, - } - } -} - -#[cache_item] -pub struct CssModuleMetaData { - pub ast: Stylesheet, - pub comments: CommentsMetaData, - pub custom: HashMap>, -} - -impl Clone for CssModuleMetaData { - fn clone(&self) -> Self { - let custom = if self.custom.is_empty() { - HashMap::new() - } else { - let mut custom = HashMap::new(); - for (k, v) in self.custom.iter() { - let cloned_data = crate::serialize!(v); - let cloned_custom = - crate::deserialize!(&cloned_data, Box); - custom.insert(k.clone(), cloned_custom); - } - custom - }; - - Self { - ast: self.ast.clone(), - comments: self.comments.clone(), - custom, - } - } -} - -impl CssModuleMetaData { - pub fn take_ast(&mut self) -> Stylesheet { - std::mem::replace( - &mut self.ast, - Stylesheet { - span: DUMMY_SP, - rules: vec![], - }, - ) - } - - pub fn set_ast(&mut self, ast: Stylesheet) { - self.ast = ast; - } -} - -#[cache_item] -pub struct HtmlModuleMetaData { - pub ast: Document, - pub custom: HashMap>, -} - -impl Clone for HtmlModuleMetaData { - fn clone(&self) -> Self { - let custom = if self.custom.is_empty() { - HashMap::new() - } else { - let mut custom = HashMap::new(); - for (k, v) in self.custom.iter() { - let cloned_data = crate::serialize!(v); - let cloned_custom = - crate::deserialize!(&cloned_data, Box); - custom.insert(k.clone(), cloned_custom); - } - custom - }; - - Self { - ast: self.ast.clone(), - custom, + is_entry: false, + is_dynamic_entry: false, + custom: CustomMetaDataMap::default(), } } } @@ -533,7 +120,7 @@ pub enum ModuleType { Css, Html, Asset, - Runtime, + // Runtime, // custom module type from using by custom plugins Custom(String), } @@ -562,6 +149,49 @@ impl ModuleType { matches!(self, ModuleType::Ts) || matches!(self, ModuleType::Tsx) } + pub fn to_custom_css(&self, scope: &str) -> Option { + if self.is_css() && !matches!(self, Self::Custom(_)) { + return Some(ModuleType::Custom(format!("farm_css:{}", scope))); + } + + None + } + + pub fn to_custom_script(&self, scope: &str) -> Option { + if self.is_script() && !matches!(self, Self::Custom(_)) { + return Some(ModuleType::Custom(format!("farm_script:{}", scope))); + } + + None + } + + pub fn to_custom(&self, scope: &str) -> ModuleType { + if let Some(css) = self.to_custom_css(scope) { + return css; + } + + if let Some(script) = self.to_custom_script(scope) { + return script; + } + + panic!( + "Unsupported module type: {:?} when calling ModuleType::to_custom", + self + ); + } + + pub fn is_css(&self) -> bool { + let mut m = matches!(self, ModuleType::Css); + + if !m { + if let ModuleType::Custom(s) = self { + m = s.starts_with("farm_css:"); + } + } + + m + } + pub fn is_script(&self) -> bool { let mut m = matches!( self, @@ -599,7 +229,7 @@ impl> From for ModuleType { "css" => Self::Css, "html" => Self::Html, "asset" => Self::Asset, - "runtime" => Self::Runtime, + // "runtime" => Self::Runtime, custom => Self::Custom(custom.to_string()), } } @@ -759,16 +389,18 @@ impl serde::Serialize for ModuleId { #[cfg(test)] mod tests { - use crate::config::Mode; + use crate::{ + config::Mode, + module::{ + meta_data::{custom::CustomMetaDataMap, script::ModuleSystem}, + module_group::{ModuleGroupId, ModuleGroupType}, + }, + Cacheable, + }; use farmfe_macro_cache_item::cache_item; - use rkyv_dyn::archive_dyn; - use rkyv_typename::TypeName; - use std::collections::HashSet; - use super::{ - CustomModuleMetaData, DeserializeCustomModuleMetaData, Module, ModuleId, ModuleMetaData, - ModuleSystem, ModuleType, SerializeCustomModuleMetaData, - }; + use super::{Module, ModuleId, ModuleMetaData, ModuleType}; + use crate::{HashMap, HashSet}; #[test] fn module_type() { @@ -864,25 +496,39 @@ mod tests { fn module_serialization() { let mut module = Module::new(ModuleId::new("/root/index.ts", "", "/root")); - #[cache_item(CustomModuleMetaData)] + #[cache_item] + #[derive(Default)] pub struct StructModuleData { ast: String, imports: Vec, } - module.module_groups = HashSet::from([ModuleId::new("1", "", ""), ModuleId::new("2", "", "")]); - - module.meta = Box::new(ModuleMetaData::Custom(Box::new(StructModuleData { - ast: String::from("ast"), - imports: vec![String::from("./index")], - }) as _)); - - let bytes = rkyv::to_bytes::<_, 256>(&module).unwrap(); - - let archived = unsafe { rkyv::archived_root::(&bytes[..]) }; - let mut deserialized_module: Module = archived - .deserialize(&mut rkyv::de::deserializers::SharedDeserializeMap::new()) - .unwrap(); + module.module_groups = HashSet::from_iter([ + ModuleGroupId::new(&"1".into(), &ModuleGroupType::Entry), + ModuleGroupId::new(&"2".into(), &ModuleGroupType::Entry), + ]); + + module.meta = Box::new(ModuleMetaData::Custom(CustomMetaDataMap::from( + HashMap::from_iter([( + "custom".to_string(), + Box::new(StructModuleData { + ast: "ast".to_string(), + imports: vec!["./index".to_string()], + }) as Box, + )]), + ))); + + // let mut v = Box::new(StructModuleData { + // ast: String::from("ast"), + // imports: vec![String::from("./index")], + // }) as Box; + + // let value = v.as_any_mut().downcast_mut::().unwrap(); + // let module = std::mem::take(value); + + let bytes = module.serialize_bytes().unwrap(); + let mut deserialized_module = module.deserialize_bytes(bytes).unwrap(); + let deserialized_module = deserialized_module.downcast_mut::().unwrap(); assert_eq!( deserialized_module.id.relative_path(), @@ -892,7 +538,7 @@ mod tests { assert_eq!( deserialized_module .meta - .as_custom_mut::() + .get_custom_mut::("custom") .ast, "ast" ); @@ -900,17 +546,17 @@ mod tests { assert_eq!( deserialized_module .meta - .as_custom::() + .get_custom_mut::("custom") .imports, vec![String::from("./index")] ); assert!(deserialized_module .module_groups - .contains(&ModuleId::new("1", "", ""))); + .contains(&ModuleGroupId::new(&"1".into(), &ModuleGroupType::Entry))); assert!(deserialized_module .module_groups - .contains(&ModuleId::new("2", "", ""))); + .contains(&ModuleGroupId::new(&"2".into(), &ModuleGroupType::Entry))); } #[test] diff --git a/crates/core/src/module/module_graph.rs b/crates/core/src/module/module_graph.rs index 7c6dffbc9c..521cb6fb30 100644 --- a/crates/core/src/module/module_graph.rs +++ b/crates/core/src/module/module_graph.rs @@ -1,7 +1,7 @@ use std::cmp::Ordering; +use crate::{HashMap, HashSet}; use farmfe_macro_cache_item::cache_item; -use std::collections::{HashMap, HashSet}; use petgraph::{ graph::{DefaultIx, NodeIndex}, @@ -32,7 +32,7 @@ pub struct ModuleGraphEdgeDataItem { pub order: usize, } -#[derive(Debug, Default, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize)] #[cache_item] pub struct ModuleGraphEdge(pub(crate) Vec); @@ -63,13 +63,34 @@ impl ModuleGraphEdge { self.0.push(item); } - // true if all of the edge data items are dynamic - pub fn is_dynamic(&self) -> bool { + /// true if all of the edge data items are dynamic import + pub fn is_dynamic_import(&self) -> bool { + if self.0.is_empty() { + return false; + } + + self.0.iter().all(|item| item.kind.is_dynamic_import()) + } + + /// true if all of the edge data items are dynamic entry + pub fn is_dynamic_entry(&self) -> bool { + if self.0.is_empty() { + return false; + } + + self.0.iter().all(|item| item.kind.is_dynamic_entry()) + } + + /// true if all of the edge data items are not dynamic entry or dynamic import + pub fn is_static(&self) -> bool { if self.0.is_empty() { return false; } - self.0.iter().all(|item| item.kind.is_dynamic()) + self + .0 + .iter() + .all(|item| !item.kind.is_dynamic_entry() && !item.kind.is_dynamic_import()) } pub fn contains_export_from(&self) -> bool { @@ -88,12 +109,31 @@ impl ModuleGraphEdge { self.0.iter().any(|item| item.kind.is_require()) } - pub fn contains_dynamic(&self) -> bool { + pub fn contains_dynamic_import(&self) -> bool { + if self.0.is_empty() { + return false; + } + + self.0.iter().any(|item| item.kind.is_dynamic_import()) + } + + pub fn contains_dynamic_entry(&self) -> bool { + if self.0.is_empty() { + return false; + } + + self.0.iter().any(|item| item.kind.is_dynamic_entry()) + } + + pub fn contains_static(&self) -> bool { if self.0.is_empty() { return false; } - self.0.iter().any(|item| item.kind.is_dynamic()) + self + .0 + .iter() + .any(|item| !item.kind.is_dynamic_entry() && !item.kind.is_dynamic_import()) } pub fn is_empty(&self) -> bool { @@ -101,6 +141,29 @@ impl ModuleGraphEdge { } } +impl Default for ModuleGraphEdge { + fn default() -> Self { + Self::new(vec![ModuleGraphEdgeDataItem::default()]) + } +} + +#[derive(Debug, Default)] +pub struct CircleRecord { + sets: HashSet, +} + +impl CircleRecord { + pub fn new(circles: Vec>) -> Self { + Self { + sets: circles.into_iter().flatten().collect(), + } + } + + pub fn is_in_circle(&self, module_id: &ModuleId) -> bool { + self.sets.contains(module_id) + } +} + pub struct ModuleGraph { /// internal graph g: StableDiGraph, @@ -111,15 +174,19 @@ pub struct ModuleGraph { /// entry modules of this module graph. /// (Entry Module Id, Entry Name) pub entries: HashMap, + pub dynamic_entries: HashMap, + pub circle_record: CircleRecord, } impl ModuleGraph { pub fn new() -> Self { Self { g: StableDiGraph::new(), - id_index_map: HashMap::new(), - file_module_ids_map: HashMap::new(), - entries: HashMap::new(), + id_index_map: HashMap::default(), + file_module_ids_map: HashMap::default(), + entries: HashMap::default(), + dynamic_entries: HashMap::default(), + circle_record: CircleRecord::default(), } } @@ -361,7 +428,7 @@ impl ModuleGraph { Ok(()) } - pub fn remove_edge(&mut self, from: &ModuleId, to: &ModuleId) -> Result<()> { + pub fn remove_edge(&mut self, from: &ModuleId, to: &ModuleId) -> Result> { let from_index = self.id_index_map.get(from).ok_or_else(|| { CompilationError::GenericError(format!( r#"from node "{}" does not exist in the module graph when remove edge"#, @@ -384,9 +451,9 @@ impl ModuleGraph { )) })?; - self.g.remove_edge(edge); + let edge = self.g.remove_edge(edge); - Ok(()) + Ok(edge) } pub fn has_edge(&self, from: &ModuleId, to: &ModuleId) -> bool { @@ -507,7 +574,17 @@ impl ModuleGraph { /// sort the module graph topologically using post order dfs, note this topo sort also keeps the original import order. /// return (topologically sorted modules, cyclic modules stack) /// - /// **Unsupported Situation**: if the two entries shares the same dependencies but the import order is not the same, may cause one entry don't keep original import order, this may bring problems in css as css depends on the order. + /// **Unsupported Situation**: if the two input entries depend on the same dependencies but the import order is not the same, may cause one entry don't keep original import order, this may bring problems in css as css depends on the order. + /// for example: + /// ```js + /// // entry input a.js + /// import c from './c.js'; + /// import d from './d.js'; + /// + /// // entry input b.js + /// import d from './d.js'; + /// import c from './c.js'; + /// ``` pub fn toposort(&self) -> (Vec, Vec>) { fn dfs( entry: &ModuleId, @@ -545,9 +622,12 @@ impl ModuleGraph { // sort entries to make sure it is stable let mut entries = self.entries.iter().collect::>(); + let mut dynamic_entries = self.dynamic_entries.iter().collect::>(); + dynamic_entries.sort(); + entries.extend(dynamic_entries); entries.sort(); - let mut visited = HashSet::new(); + let mut visited = HashSet::default(); for (entry, _) in entries { let mut res = vec![]; @@ -561,8 +641,8 @@ impl ModuleGraph { (result, cyclic) } - pub fn update_execution_order_for_modules(&mut self) { - let (mut topo_sorted_modules, _) = self.toposort(); + pub fn update_execution_order_for_modules(&mut self) -> Vec { + let (mut topo_sorted_modules, circles) = self.toposort(); topo_sorted_modules.reverse(); @@ -573,6 +653,10 @@ impl ModuleGraph { let module = self.module_mut(module_id).unwrap(); module.execution_order = order; }); + + self.circle_record = CircleRecord::new(circles); + + topo_sorted_modules } pub fn internal_graph(&self) -> &StableDiGraph { @@ -587,38 +671,6 @@ impl ModuleGraph { } } - pub fn dfs_breakable( - &self, - entries: Vec, - op: &mut dyn FnMut(Option<&ModuleId>, &ModuleId) -> bool, - ) { - fn dfs( - parent: Option<&ModuleId>, - entry: &ModuleId, - op: &mut dyn FnMut(Option<&ModuleId>, &ModuleId) -> bool, - visited: &mut HashSet, - graph: &ModuleGraph, - ) { - if !op(parent, entry) || visited.contains(entry) { - return; - } - - visited.insert(entry.clone()); - - let deps = graph.dependencies(entry); - - for (dep, _) in &deps { - dfs(Some(entry), dep, op, visited, graph) - } - } - - let mut visited = HashSet::new(); - - for entry in entries { - dfs(None, &entry, op, &mut visited, self); - } - } - pub fn bfs(&self, entry: &ModuleId, op: &mut dyn FnMut(&ModuleId)) { let mut bfs = Bfs::new(&self.g, *self.id_index_map.get(entry).unwrap()); @@ -658,11 +710,11 @@ impl ModuleGraph { self.g[*i] = module; } - pub fn is_dynamic(&self, module_id: &ModuleId) -> bool { + pub fn is_dynamic_import(&self, module_id: &ModuleId) -> bool { self .dependents(module_id) .iter() - .any(|(_, edge)| edge.is_dynamic()) + .any(|(_, edge)| edge.is_dynamic_import()) } pub fn copy_to(&self, other: &mut Self, overwrite: bool) -> Result<()> { @@ -692,7 +744,7 @@ impl Default for ModuleGraph { #[cfg(test)] mod tests { - use std::collections::HashMap; + use crate::HashMap; use crate::{ module::{Module, ModuleId}, @@ -767,7 +819,8 @@ mod tests { ) .unwrap(); - graph.entries = HashMap::from([("A".into(), "A".to_string()), ("B".into(), "B".to_string())]); + graph.entries = + HashMap::from_iter([("A".into(), "A".to_string()), ("B".into(), "B".to_string())]); graph } diff --git a/crates/core/src/module/module_group.rs b/crates/core/src/module/module_group.rs index fb162a2f31..b98fe8106e 100644 --- a/crates/core/src/module/module_group.rs +++ b/crates/core/src/module/module_group.rs @@ -1,12 +1,12 @@ -use std::collections::{HashMap, HashSet}; - +use farmfe_macro_cache_item::cache_item; use petgraph::{ stable_graph::{DefaultIx, NodeIndex, StableDiGraph}, visit::{Bfs, Dfs, DfsPostOrder, EdgeRef, IntoEdgeReferences}, }; -use serde::{Deserialize, Serialize}; +use rkyv::Deserialize; use crate::resource::{resource_pot::ResourcePotId, resource_pot_map::ResourcePotMap}; +use crate::{HashMap, HashSet}; use super::{module_graph::ModuleGraph, ModuleId}; @@ -16,14 +16,14 @@ pub struct ModuleGroupGraph { /// internal graph g: StableDiGraph, /// to index module in the graph using [ModuleId] - id_index_map: HashMap>, + id_index_map: HashMap>, } impl ModuleGroupGraph { pub fn new() -> Self { Self { g: StableDiGraph::new(), - id_index_map: HashMap::new(), + id_index_map: HashMap::default(), } } @@ -43,14 +43,14 @@ impl ModuleGroupGraph { self.id_index_map.insert(module_group_id, node_index); } - pub fn add_edge(&mut self, from: &ModuleId, to: &ModuleId) { + pub fn add_edge(&mut self, from: &ModuleGroupId, to: &ModuleGroupId) { let from_node_index = self.id_index_map.get(from).unwrap(); let to_node_index = self.id_index_map.get(to).unwrap(); self.g.add_edge(*from_node_index, *to_node_index, ()); } - pub fn remove_edge(&mut self, from: &ModuleId, to: &ModuleId) { + pub fn remove_edge(&mut self, from: &ModuleGroupId, to: &ModuleGroupId) { let from_node_index = self.id_index_map.get(from).unwrap_or_else(|| { panic!( "ModuleGroupGraph::remove_edge: from {} to {}. Not found: {}", @@ -101,7 +101,7 @@ impl ModuleGroupGraph { self.id_index_map.contains_key(id) } - pub fn has_edge(&self, from: &ModuleId, to: &ModuleId) -> bool { + pub fn has_edge(&self, from: &ModuleGroupId, to: &ModuleGroupId) -> bool { let from_node_index = self.id_index_map.get(from); let to_node_index = self.id_index_map.get(to); @@ -147,7 +147,7 @@ impl ModuleGroupGraph { } } - pub fn dependencies(&self, module_id: &ModuleId) -> Vec<&ModuleGroup> { + pub fn dependencies(&self, module_id: &ModuleGroupId) -> Vec<&ModuleGroup> { let node_index = self.id_index_map.get(module_id).unwrap(); let mut dependencies = Vec::new(); @@ -158,7 +158,7 @@ impl ModuleGroupGraph { dependencies } - pub fn dependencies_ids(&self, module_id: &ModuleId) -> Vec { + pub fn dependencies_ids(&self, module_id: &ModuleGroupId) -> Vec { let node_index = self.id_index_map.get(module_id).unwrap(); let mut dependencies = Vec::new(); @@ -169,7 +169,7 @@ impl ModuleGroupGraph { dependencies } - pub fn dependents(&self, module_id: &ModuleId) -> Vec<&ModuleGroup> { + pub fn dependents(&self, module_id: &ModuleGroupId) -> Vec<&ModuleGroup> { let node_index = self.id_index_map.get(module_id).unwrap(); let mut dependents = Vec::new(); @@ -185,7 +185,7 @@ impl ModuleGroupGraph { pub fn toposort(&self, entries: Vec) -> Vec { let mut sorted = Vec::new(); - let mut visited = HashSet::new(); + let mut visited = HashSet::default(); for entry in entries { self.dfs_post_order(&entry, &mut |id| { @@ -220,7 +220,7 @@ impl ModuleGroupGraph { } } -#[derive(Debug, Default, Clone, Serialize, Deserialize)] +#[derive(Debug, Default, Clone, serde::Serialize, serde::Deserialize)] pub struct PrintedModuleGroupGraph { pub module_groups: Vec, pub edges: Vec<(String, String)>, @@ -264,18 +264,47 @@ impl PartialEq for ModuleGroupGraph { .collect::>(); other_edges.sort(); + // println!("self_module_groups: {:#?}", self_module_groups); + // println!("other_module_groups: {:#?}", other_module_groups); + // println!("self_edges: {:#?}", self_edges); + // println!("other_edges: {:#?}", other_edges); + // println!( + // "self_module_groups == other_module_groups: {}", + // self_module_groups == other_module_groups + // ); + // println!("self_edges == other_edges: {}", self_edges == other_edges); + self_module_groups == other_module_groups && self_edges == other_edges } } impl Eq for ModuleGroupGraph {} -pub type ModuleGroupId = ModuleId; +#[cache_item] +#[derive( + Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, serde::Serialize, serde::Deserialize, +)] +#[archive_attr(derive(Hash, Eq, PartialEq))] +pub struct ModuleGroupId(String); + +impl ModuleGroupId { + pub fn new(id: &ModuleId, ty: &ModuleGroupType) -> Self { + Self(format!("{}_{:?}", id.to_string(), ty)) + } +} + +impl ToString for ModuleGroupId { + fn to_string(&self) -> String { + self.0.clone() + } +} -#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Eq, Clone, serde::Serialize, serde::Deserialize)] pub struct ModuleGroup { - /// the module group's id is the same as its entry module's id. pub id: ModuleGroupId, + /// the module group's id is the same as its entry module's id. + pub entry_module_id: ModuleId, + pub module_group_type: ModuleGroupType, /// the modules that this group has modules: HashSet, /// the [ResourcePot]s this group merged to @@ -283,11 +312,13 @@ pub struct ModuleGroup { } impl ModuleGroup { - pub fn new(id: ModuleGroupId) -> Self { + pub fn new(module_id: ModuleId, ty: ModuleGroupType) -> Self { Self { - modules: HashSet::from([id.clone()]), - id, - resource_pots: HashSet::new(), + id: ModuleGroupId::new(&module_id, &ty), + modules: HashSet::from_iter([module_id.clone()]), + entry_module_id: module_id, + module_group_type: ty, + resource_pots: HashSet::default(), } } @@ -320,7 +351,7 @@ impl ModuleGroup { module_graph: &ModuleGraph, resource_pot_map: &ResourcePotMap, ) -> Vec { - let mut resource_pots_order_map = HashMap::::new(); + let mut resource_pots_order_map = HashMap::::default(); let mut sorted_resource_pots = self.resource_pots().iter().cloned().collect::>(); sorted_resource_pots.iter().for_each(|rp| { @@ -356,3 +387,13 @@ impl ModuleGroup { self.resource_pots.contains(resource_pot_id) } } + +#[derive(Debug, PartialEq, Eq, Clone, serde::Serialize, serde::Deserialize)] +pub enum ModuleGroupType { + /// module group created from config.input + Entry, + /// module group created from dynamic input return by analyze_deps or finalize_module hook. e.g. ResolveKind::DynamicEntry { name: "a", output_filename: None } + DynamicEntry, + /// module group created from dynamic import. e.g. `import('./a').then(module => console.log(module))` + DynamicImport, +} diff --git a/crates/core/src/module/watch_graph.rs b/crates/core/src/module/watch_graph.rs index 4bdf65265c..033a586979 100644 --- a/crates/core/src/module/watch_graph.rs +++ b/crates/core/src/module/watch_graph.rs @@ -1,4 +1,4 @@ -use std::collections::{HashMap, HashSet, VecDeque}; +use std::collections::VecDeque; use std::hash::Hash; use petgraph::{ @@ -8,6 +8,7 @@ use petgraph::{ }; use crate::error::{CompilationError, Result}; +use crate::{HashMap, HashSet}; use super::ModuleId; @@ -44,7 +45,7 @@ impl WatchGraph { pub fn new() -> Self { Self { g: StableDiGraph::new(), - id_index_map: HashMap::new(), + id_index_map: HashMap::default(), } } @@ -108,7 +109,7 @@ impl WatchGraph { } pub fn modules(&self) -> Vec<&ModuleId> { - let mut res = HashSet::new(); + let mut res = HashSet::default(); for node in self.g.edge_indices() { if matches!(self.g.edge_weight(node), Some(EdgeMode::WatchImport)) { @@ -122,7 +123,7 @@ impl WatchGraph { } pub fn relation_roots(&self, dep: &ModuleId) -> Vec<&ModuleId> { - let mut result = HashSet::new(); + let mut result = HashSet::default(); if let Some(index) = self.id_index_map.get(dep) { let mut edges = self @@ -169,7 +170,7 @@ impl WatchGraph { pub fn relation_dependencies(&self, root: &ModuleId) -> Vec<&ModuleId> { let mut queue = self.dependencies(root).into_iter().collect::>(); - let mut visited = HashSet::new(); + let mut visited = HashSet::default(); let mut result = vec![]; while !queue.is_empty() { diff --git a/crates/core/src/plugin/hooks/analyze_deps.rs b/crates/core/src/plugin/hooks/analyze_deps.rs new file mode 100644 index 0000000000..a22f48cef1 --- /dev/null +++ b/crates/core/src/plugin/hooks/analyze_deps.rs @@ -0,0 +1,17 @@ +use farmfe_macro_cache_item::cache_item; + +use crate::{module::Module, plugin::ResolveKind}; + +#[derive(Clone)] +pub struct PluginAnalyzeDepsHookParam<'a> { + pub module: &'a Module, + /// analyzed deps from previous plugins, you can push new entries to it for your plugin. + pub deps: Vec, +} + +#[derive(Debug, PartialEq, Eq, Clone, serde::Serialize, serde::Deserialize)] +#[cache_item] +pub struct PluginAnalyzeDepsHookResultEntry { + pub source: String, + pub kind: ResolveKind, +} diff --git a/crates/core/src/plugin/hooks/finalize_module.rs b/crates/core/src/plugin/hooks/finalize_module.rs new file mode 100644 index 0000000000..a5236146ac --- /dev/null +++ b/crates/core/src/plugin/hooks/finalize_module.rs @@ -0,0 +1,8 @@ +use crate::module::Module; + +use super::analyze_deps::PluginAnalyzeDepsHookResultEntry; + +pub struct PluginFinalizeModuleHookParam<'a> { + pub module: &'a mut Module, + pub deps: &'a mut Vec, +} diff --git a/crates/core/src/plugin/hooks/finalize_resources.rs b/crates/core/src/plugin/hooks/finalize_resources.rs new file mode 100644 index 0000000000..3ff876a2cb --- /dev/null +++ b/crates/core/src/plugin/hooks/finalize_resources.rs @@ -0,0 +1,6 @@ +use crate::{config::Config, resource::Resource, HashMap}; + +pub struct PluginFinalizeResourcesHookParam<'a> { + pub resources_map: &'a mut HashMap, + pub config: &'a Config, +} diff --git a/crates/core/src/plugin/hooks/freeze_module.rs b/crates/core/src/plugin/hooks/freeze_module.rs new file mode 100644 index 0000000000..ad6ccac05a --- /dev/null +++ b/crates/core/src/plugin/hooks/freeze_module.rs @@ -0,0 +1,6 @@ +use crate::module::{module_graph::ModuleGraphEdge, Module, ModuleId}; + +pub struct PluginFreezeModuleHookParam<'a> { + pub module: &'a mut Module, + pub resolved_deps: Vec<(ModuleId, ModuleGraphEdge)>, +} diff --git a/crates/core/src/plugin/hooks/generate_resources.rs b/crates/core/src/plugin/hooks/generate_resources.rs new file mode 100644 index 0000000000..553ba41e77 --- /dev/null +++ b/crates/core/src/plugin/hooks/generate_resources.rs @@ -0,0 +1,19 @@ +use farmfe_macro_cache_item::cache_item; + +use crate::resource::Resource; + +#[cache_item] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct GeneratedResource { + pub resource: Resource, + pub source_map: Option, +} + +#[cache_item] +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct PluginGenerateResourcesHookResult { + /// A resource pot can generate multiple resources, for example: generating cjs/esm at the same time + pub resources: Vec, +} diff --git a/crates/core/src/plugin/hooks/handle_entry_resource.rs b/crates/core/src/plugin/hooks/handle_entry_resource.rs new file mode 100644 index 0000000000..844226d83b --- /dev/null +++ b/crates/core/src/plugin/hooks/handle_entry_resource.rs @@ -0,0 +1,27 @@ +use crate::{ + module::{module_graph::ModuleGraph, module_group::ModuleGroupGraph, ModuleId}, + resource::{resource_pot_map::ResourcePotMap, Resource, ResourceType}, + HashMap, +}; + +pub struct PluginHandleEntryResourceHookParam<'a> { + pub resource: Resource, + pub resource_sourcemap: Option, + + pub module_graph: &'a ModuleGraph, + pub module_group_graph: &'a ModuleGroupGraph, + pub resource_pot_map: &'a ResourcePotMap, + pub entry_module_id: &'a ModuleId, + + /// Initial resources including entry resource + pub initial_resources: Vec<(String, ResourceType)>, + pub dynamic_resources: String, + pub dynamic_module_resources_map: String, + + pub runtime_code: &'a str, + pub runtime_resource_name: &'a str, + /// Set it to true if runtime needs to be emitted as a separate + pub emit_runtime: bool, + + pub additional_inject_resources: HashMap, +} diff --git a/crates/core/src/plugin/hooks/load.rs b/crates/core/src/plugin/hooks/load.rs new file mode 100644 index 0000000000..3e96102e16 --- /dev/null +++ b/crates/core/src/plugin/hooks/load.rs @@ -0,0 +1,26 @@ +use crate::{module::ModuleType, HashMap}; + +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct PluginLoadHookParam<'a> { + /// the module id string + pub module_id: String, + /// the resolved path from resolve hook + pub resolved_path: &'a str, + /// the query map + pub query: Vec<(String, String)>, + /// the meta data passed between plugins and hooks + pub meta: HashMap, +} + +#[derive(Debug, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct PluginLoadHookResult { + /// the source content of the module + pub content: String, + /// the type of the module, for example [ModuleType::Js] stands for a normal javascript file, + /// usually end with `.js` extension + pub module_type: ModuleType, + /// source map of the module + pub source_map: Option, +} diff --git a/crates/core/src/plugin/hooks/mod.rs b/crates/core/src/plugin/hooks/mod.rs new file mode 100644 index 0000000000..bdc5927759 --- /dev/null +++ b/crates/core/src/plugin/hooks/mod.rs @@ -0,0 +1,13 @@ +pub mod analyze_deps; +pub mod finalize_module; +pub mod finalize_resources; +pub mod freeze_module; +pub mod generate_resources; +pub mod handle_entry_resource; +pub mod load; +pub mod module_graph_updated; +pub mod parse; +pub mod process_module; +pub mod resolve; +pub mod transform; +pub mod update_modules; diff --git a/crates/core/src/plugin/hooks/module_graph_updated.rs b/crates/core/src/plugin/hooks/module_graph_updated.rs new file mode 100644 index 0000000000..da6e2ccaf5 --- /dev/null +++ b/crates/core/src/plugin/hooks/module_graph_updated.rs @@ -0,0 +1,9 @@ +use crate::module::ModuleId; + +#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "camelCase", default)] +pub struct PluginModuleGraphUpdatedHookParam { + pub added_modules_ids: Vec, + pub removed_modules_ids: Vec, + pub updated_modules_ids: Vec, +} diff --git a/crates/core/src/plugin/hooks/parse.rs b/crates/core/src/plugin/hooks/parse.rs new file mode 100644 index 0000000000..285acd152f --- /dev/null +++ b/crates/core/src/plugin/hooks/parse.rs @@ -0,0 +1,16 @@ +use std::sync::Arc; + +use crate::module::{ModuleId, ModuleType}; + +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct PluginParseHookParam { + /// module id + pub module_id: ModuleId, + /// resolved path + pub resolved_path: String, + /// resolved query + pub query: Vec<(String, String)>, + pub module_type: ModuleType, + /// source content(after transform) + pub content: Arc, +} diff --git a/crates/core/src/plugin/hooks/process_module.rs b/crates/core/src/plugin/hooks/process_module.rs new file mode 100644 index 0000000000..9312573b58 --- /dev/null +++ b/crates/core/src/plugin/hooks/process_module.rs @@ -0,0 +1,11 @@ +use std::sync::Arc; + +use crate::module::{ModuleId, ModuleMetaData, ModuleType}; + +pub struct PluginProcessModuleHookParam<'a> { + pub module_id: &'a ModuleId, + pub module_type: &'a ModuleType, + pub content: &'a mut Arc, + pub meta: &'a mut ModuleMetaData, + pub source_map_chain: &'a mut Vec>, +} diff --git a/crates/core/src/plugin/hooks/resolve.rs b/crates/core/src/plugin/hooks/resolve.rs new file mode 100644 index 0000000000..a5bf43cd52 --- /dev/null +++ b/crates/core/src/plugin/hooks/resolve.rs @@ -0,0 +1,115 @@ +use farmfe_macro_cache_item::cache_item; + +use crate::module::ModuleId; +use crate::HashMap; + +#[derive(Debug, Clone, Hash, PartialEq, Eq, serde::Serialize, serde::Deserialize, Default)] +#[serde(rename_all = "camelCase")] +#[cache_item] +pub enum ResolveKind { + /// entry input in the config + Entry(String), + /// dynamic entry input, which will always be bundled as a separate resource + /// all deep dependencies of a dynamic entry will be merged into a special module group + DynamicEntry { + name: String, + /// the same as config.output.filename, default to config.output.filename + output_filename: Option, + }, + /// static import, e.g. `import a from './a'` + #[default] + Import, + /// static export, e.g. `export * from './a'` + ExportFrom, + /// dynamic import, e.g. `import('./a').then(module => console.log(module))` + DynamicImport, + /// cjs require, e.g. `require('./a')` + Require, + /// @import of css, e.g. @import './a.css' + CssAtImport, + /// url() of css, e.g. url('./a.png') + CssUrl, + /// ` +``` + +You should replace `
app-html-to-replace
` to the server-rendered `markup`. + +:::tip +We have to build the SSR application **twice**, one for `client`(browser) and one for `server`(Node.js). So `farm.config.ts` and `farm.config.server.ts` are needed, we'll discuss the details in later sections. +::: + +## Setting up Dev Server +For above example, `farm.config.ts` is used to **build the project for browser** and setting up DevServer for server rendering. The content of `farm.config.ts` normally would be: + +```ts title="farm.config.ts" +import path from 'path'; +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + compilation: { + input: { + index_client: './index.html' + }, + output: { + path: './build' + }, + }, + server: { + hmr: true, + cors: true, + middlewares: [ + // register a middleware that render the application on the server, + // inject server rendered markup and return final index.html + (server) => { + server.app().use(async (ctx, next) => { + await next(); + + // handle index.html or SPA fallback + if (ctx.path === '/' || ctx.status === 404) { + // loading the server entry, and render it by ctx.path + const render = await import(path.join(process.cwd(), 'dist', 'index.js')).then( + (m) => m.default + ); + const renderedHtml = render(ctx.path); + + // get compiled index.html content from server.getCompiler() + // The html is compiled for client with all client bundles injected + const template = server + .getCompiler() + .resource('index_client.html') + .toString(); + + // replace the placeholder to rendered markup and return it as html + const html = template.replace( + '
app-html-to-replace
', + renderedHtml + ); + ctx.body = html; + ctx.type = 'text/html'; + ctx.status = 200; + } + + console.log('ctx.path outer', ctx.path); + }); + } + ] + }, + plugins: ['@farmfe/plugin-react', '@farmfe/plugin-sass'] +}); +``` + +In above example, a `middleware` is required for rendering the application to markup and serve it as html. Normal workflow for SSR in the `middleware`: +* **Load compiled server entry:** A `index-server` entry which exports a `render` function is required, we need to `import(server_entry_path)` to get the `render` function. +* **Get compiled client index.html:** All client bundles and Farm runtime are injected to `index.html`, so the client can `hydrate` successfully. +* **Replace the placeholder to rendered markup:** Replace the placeholder and return the `final html`. + +:::note +In this example, we are building a `SPA` SSR application with `if (ctx.path === '/' || ctx.status === 404) {`, if you are building a `MPA` SSR application, guard `ctx.path` to your pages. +::: + +## Building for Node.js +`farm.config.server.ts` is used to **build the project for Node.js**, producing the compiled server entry which can be used to rendering the application to markup on the server side. + +```ts title="farm.config.server.ts" +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + compilation: { + // c-highlight-start + input: { + index: './src/index-server.tsx' + }, + output: { + path: './dist', + targetEnv: 'node' + } + // c-highlight-end + }, + plugins: [ + [ + '@farmfe/plugin-react', + { + refresh: false, + development: false + } + ], + '@farmfe/plugin-sass' + ] +}); +``` + +For `farm.config.server.ts`, we set `input` to **server entry** and [`output.targetEnv`](/docs/config/compilation-options#output-targetenv) to `node`. + +:::note +By default, Farm compiles server entry script to `esm`, if you want to compile it to `cjs`, try set [`output.format`](/docs/config/compilation-options#output-format). +::: + +## Develop SSR Project +You have start compilation for both `client` and `server`, for example, you may have following `scripts` in `package.json`: + +```json title="package.json" +{ + "name": "@farmfe-examples/react-ssr", + "scripts": { + // c-highlight-start + "start": "farm start", + "start:server": "farm watch --config farm.config.server.mjs", + // c-highlight-end + } +} +``` + +When starting your SSR project, you should run both `npm run start` and `npm run start:server` in different terminal. + +## Building for Production +You have build both `client` and `server`, for example, you may add following command to `scripts`: + +```json title="package.json" +{ + "name": "@farmfe-examples/react-ssr", + "scripts": { + "start": "farm start", + "start:server": "farm watch --config farm.config.server.mjs", + // c-highlight-start + "build": "farm build", + "build:server": "farm build --config farm.config.server.mjs" + // c-highlight-end + } +} +``` + +When building for production, you should run both `npm run build` and `npm run build:server`, the client bundles will be emitted to `build` dir, and the server bundles will be emitted to `dist` dir. + +For production, you need a `node server` for `rendering` and serving `rendered html`, in this example, we provide a `server.js` as production server: + +```js title="server.js" +import path from 'node:path'; +import { fileURLToPath } from 'node:url' +import fsp from 'fs/promises'; +import express from 'express'; + +function resolve(p) { + const __dirname = path.dirname(fileURLToPath(import.meta.url)); + return path.resolve(__dirname, p); +} + +// create a node production server +async function createServer() { + let app = express(); + // serve the client builds as static assets, you can also deploy client builds to CDN or separate dev server as you wish. + app.use(express.static(resolve('build'))); + // listen '/' route, you can replace it to the routes you use. + app.use('/', async (req, res) => { + let url = req.originalUrl; + + try { + let template; + let render; + + // load client html + template = await fsp.readFile(resolve('build/index_client.html'), 'utf8'); + // load server render function + render = await import(resolve('dist/index.js')).then( + (m) => m.default + ); + // render the application to markup + const markup = render(url); + + let html = template.replace( + '
app-html-to-replace
', + markup + ); + // return the rendered html with client bundles, the client bundles hydrate the server rendered markup and make it interactive + res.setHeader('Content-Type', 'text/html'); + return res.status(200).end(html); + } catch (error) { + console.log(error.stack); + res.status(500).end(error.stack); + } + }); + + return app; +} +// create and listen the server +createServer().then((app) => { + app.listen(3000, () => { + console.log('HTTP server is running at http://localhost:3000'); + }); +}); +``` + +We use `express` as server here, but you can use whatever server frameworks you want. The rendering process are the same: +* Loading client compiled html +* Loading `render` function from compiled server script +* Call `const markup = render(url)` function to get the server-side rendered markup of your application +* Replace the `placeholder` in `client index.html` to the `rendered markup` and return the replaced html as final result + +## Static-Site Generation(SSG) +The same flow of SSG is the same as SSR, the difference is SSG that emits to `replaced html` to the final resources. Example scripts for SSG: + +```ts +// load client html +const template = await fsp.readFile(resolve('build/index_client.html'), 'utf8'); +// load server render function +const render = await import(resolve('dist/index.js')).then( + (m) => m.default +); + +const pages = renderDirEntry('src/pages'); + +for (const page of pages) { + // render the application to markup + const markup = render(url); + const html = template.replace( + '
app-html-to-replace
', + markup + ); + // emit the static generated page, for example writing it to disk + emitPage(page, html); +} +``` diff --git a/docs/docs/advanced/tree-shake.md b/docs/docs/advanced/tree-shake.md new file mode 100644 index 0000000000..0efbf6ddc0 --- /dev/null +++ b/docs/docs/advanced/tree-shake.md @@ -0,0 +1,82 @@ +# Tree Shake +Farm supports Tree Shake, which is automatically enabled in the default Production environment. It can be turned on or off by the [`compilation.treeShaking`](/docs/config/compilation-options#treeshaking) option. + +During Tree Shake, the `sideEffects` field in package.json will be automatically read, and modules with `sideEffects` will not perform Tree Shake. + +:::note +Farm will treat all circularly dependent modules as sideEffects and will not perform Tree Shake. Please try to avoid circular dependencies in your project. +::: + +Tree shake example: +```js title="a.js" +import { b1, b2 } from 'b'; +console.log(b1); +``` +```js title="b.js" +export b1 = "B1"; +export b2 = "B2"; +``` +`a.js` is entry and it imports `b.js`, after tree shaking, the result is: +```js title="a.js" +import { b1 } from 'b'; +console.log(b1); +``` +```js title="b.js" +export b1 = "B1"; +``` +`b2` is not used and will be removed in both `a.js` and `b.js` + +## Configuring Tree Shake +Tree Shake is enabled in production mode by default, to disable tree shake, use `compilation.treeShake`: + +```ts title="farm.config.ts" +export default { + compilation: { + treeShake: false, + }, +}; +``` + +## Deal With Side Effects +When a module contains `side effects`, Farm won't apply tree shake for it, and all of its imported and exports are treated as used. Farm will think following modules have `side effects`: +1. CommonJs modules always have side effects. +2. A module contains `self-executed` statement at global scope has side effects +3. Modules that contains cyclic dependencies has side effects +4. Modules matches `sideEffects` config in its closest `package.json` +5. Entry modules are always has side effects. + +Example 1: +```js +const a = require('./') +module.exports = a; +``` +CommonJs module are always has side effects. + +Example 2: +```js +import a from './'; + +a(); +``` +`a()` is executed at global scope and we treat it as side effect. + +Example 3: +```js +// a.js +import b from './b.js' + +// b.js +import a from './a.js' +``` +`a`, `b` are cyclic dependencies, so they will be treated as side effects too. + +Example 4: +```json title="package.json" +{ + "name": "my-package", + "sideEffects": [ + "./global/**.ts" + ] +} +``` +all ts modules under `global/` are treat as side effects. \ No newline at end of file diff --git a/docs/docs/api/hmr-api.md b/docs/docs/api/hmr-api.md new file mode 100644 index 0000000000..2383c73345 --- /dev/null +++ b/docs/docs/api/hmr-api.md @@ -0,0 +1,191 @@ +# Hmr Api +:::note +The Farm HMR API is compatible with [Vite's HMR API](https://vitejs.dev/guide/api-hmr.html). +::: + +Farm exports its HMR API via the special `import.meta.hot` object(compatible with Vite): +```ts +export interface ViteHotContext { + readonly data: any; + + accept(): void; + accept(cb: (mod: ModuleNamespace | undefined) => void): void; + accept(dep: string, cb: (mod: ModuleNamespace | undefined) => void): void; + accept( + deps: readonly string[], + cb: (mods: Array) => void + ): void; + + dispose(cb: (data: any) => void): void; + prune(cb: (data: any) => void): void; + invalidate(message?: string): void; + + on( + event: T, + cb: (payload: InferCustomEventPayload) => void + ): void; + off( + event: T, + cb: (payload: InferCustomEventPayload) => void + ): void; + send(event: T, data?: InferCustomEventPayload): void; +} +``` + +## Required Conditional Guard +HMR only works for development mode, make sure to guard HMR API usage with a conditional block: + +```ts +if (import.meta.hot) { + // HMR Code +} +``` + +## IntelliSense for TypeScript +The same as Vite, Farm provides type definitions for `import.meta.hot` in `@farmfe/core/client.d.ts`. You can create an `env.d.ts` in the src directory so TypeScript picks up the type definitions: + +```ts +/// +``` + +## hot.accept() +For a self-accepted module, use `import.meta.hot.accept()`: + +```ts +if (import.meta.hot) { + // self accept without reload the page + import.meta.hot.accept(); + + const div = document.getElementById(id); + // update the page + if (div) { + const comp = SelfAcceptedEmpty().render(); + div.replaceWith(comp); + } +} +``` + +## hot.accept(cb) +If you want to update the module status based on `exports of updated module`, you can use `import.meta.hot.accept(cb)`: + +```ts +if (import.meta.hot) { + // self accept without reload the page + import.meta.hot.accept(mod => { + const div = document.getElementById(id); + const comp = mod[id]().render(); + div?.replaceWith(comp); + }); +} +``` +Arguments of `cb` is the `exports of updated module`, you can do updates based on it. + +## hot.accept(deps, cb) +A module can also accept updates from direct dependencies without reloading itself. + +Accept single dependency: +```ts +if (import.meta.hot) { + // accept dependencies + import.meta.hot.accept('./accept-deps-data', (data) => { + console.log(data); + const div = document.getElementById(id); + const renderData = data.compData(id); + div!.innerText = renderData; + }); +} +``` + +Accept multiple dependencies: +```ts +if (import.meta.hot) { + // accept dependencies + import.meta.hot.accept(['./accept-deps-data'], ([data]) => { + console.log(data); + const div = document.getElementById(id); + const renderData = data.compData(id); + div!.innerText = renderData; + }); +} +``` + +## hot.dispose(cb) +A self-accepting module or a module that expects to be accepted by others can use hot.dispose to clean-up any persistent side effects created by its updated copy: + +```ts +if (import.meta.hot) { + // self accept without reload the page + import.meta.hot.accept(mod => { + const div = document.getElementById(id); + div?.appendChild(mod.createChild()); + }); + + // clean side effects + import.meta.hot.dispose(() => { + // remove all children of the div + const div = document.getElementById(id); + + if (div) { + while (div.firstChild) { + console.log('dispose', div.firstChild); + div.removeChild(div.firstChild); + } + } + }); +} +``` + +## hot.prune(cb) +Register a callback that will call when the module is no longer imported on the page. Compared to hot.dispose, this can be used if the source code cleans up side-effects by itself on updates and you only need to clean-up when it's removed from the page. Farm currently uses this for .css imports(the same as Vite). + +```ts +if (import.meta.hot) {{ + import.meta.hot.accept(); + import.meta.hot.prune(() => {{ + style.remove(); + }}); +}} +``` + +## hot.data + +The import.meta.hot.data object is persisted across different instances of the same updated module. It can be used to pass on information from a previous version of the module to the next one. + +```ts +import.meta.hot.data.value = 'value'; +``` + +## hot.invalidate(message?: string) +A self-accepting module may realize during runtime that it can't handle a HMR update, and so the update needs to be forcefully propagated to importers. By calling import.meta.hot.invalidate(), the HMR server will invalidate the importers of the caller, as if the caller wasn't self-accepting. This will log a message both in the browser console and in the terminal. You can pass a message to give some context on why the invalidation happened. + +Note that you should always call import.meta.hot.accept even if you plan to call invalidate immediately afterwards, or else the HMR client won't listen for future changes to the self-accepting module. To communicate your intent clearly, we recommend calling invalidate within the accept callback like so: + +```ts +if (import.meta.hot) { + // accept dependencies + import.meta.hot.accept((mod) => { + if (cannotHandleUpdate(mod)) { + import.meta.hot.invalidate('parent module should accept this'); + } + }); +} +``` + +## hot.on(event, cb) +The same as Vite, see [Vite hot.on](https://vitejs.dev/guide/api-hmr.html#hot-on-event-cb) + +## hot.off(event, cb) +Remove callback from the event listeners + +## hot.send(event, data) +Send message from HMR client to dev server: + +```ts +import.meta.hot.send('event-name', { data: '123' }); +``` + +Receive message on dev server: + +```ts +server.ws.on('event-name', (data) => {}); +``` \ No newline at end of file diff --git a/docs/docs/api/javascript-api.mdx b/docs/docs/api/javascript-api.mdx new file mode 100644 index 0000000000..febe630e40 --- /dev/null +++ b/docs/docs/api/javascript-api.mdx @@ -0,0 +1,576 @@ +import { PackageManagerTabs } from "../../src/theme/PackageManagerTabs"; + +# Javascript Api + +`Farm` provides a comprehensive set of APIs for development servers, compilers, watchers, etc. Developers can use these APIs by importing the `@farmfe/core` package. + +Install the `@farmfe/core` package: + + + +## Start + +The `start` method is used to quickly launch the development server. + +After calling the `start` method, you can see the log information of the available `ip` address in the current console. By default, it compiles the `index.html` file in the current directory. + +Type: + +```typescript +start(options: InlineConfig): Promise +``` +Basic example: + +```javascript +import { start, logger } from "@farmfe/core"; +try { + await start({ + compilation: { + output: { + publicPath: "/dist" + }, + input: { + index: "./base.html" + } + }, + server: { + port: 6532, + hmr: { + path: "/__farm_hmr", + } + }, + plugins: [ + '@farmfe/plugin-react', + '@farmfe/plugin-sass' + ], + }); +} catch (error) { + logger.error(`Failed to start server:\n ${error.stack}`); + process.exit(1); +} + +``` + +another way is use more deep api to start server: + + + +```javascript +import { + createCompiler, + createDevServer, + resolveConfig +} from '@farmfe/core'; + +const resolveUserConfig = await resolveConfig({ + compilation: { + output: { + publicPath: "/dist" + }, + input: { + index: "./base.html" + } + }, + server: { + port: 6532, + hmr: { + path: "/__farm_hmr", + } + }, + plugins: [ + '@farmfe/plugin-react', + '@farmfe/plugin-sass' + ], +}) + +// create compiler +const compiler = await createCompiler(resolveUserConfig); +const server = await createDevServer(compiler, resolveUserConfig); +server.listen(); +``` + +## Build +The build method is used to build for the production environment. + +After calling the build method, it defaults to building browser artifacts and generates a dist folder in the current directory. If you need to build artifacts for different environments and versions, such as node, node-next, browser, browser-es2017, etc., you can configure it by checking output targetEnv. + +Type: + +```typescript +build(options: InlineConfig): Promise +``` +Basic example: + +```javascript +import { build, logger } from "@farmfe/core"; +try { + await build(options); +} catch (error) { + logger.error(`error during build:\n ${error.stack}`); + process.exit(1); +} +``` +## Watch +The watch method provides real-time updates for the compilation of the current project, equivalent to npx farm build --watch. Generally used in the node environment. + +Type: + +```typescript +watch(options: InlineConfig): Promise +``` +Basic example: + +```javascript +import { watch, logger } from "@farmfe/core"; +try { + await watch(defaultOptions); +} catch (error) { + logger.error(`error during watch project:\n ${error.stack}`); + process.exit(1); +} +``` +## Preview +The preview method starts a preview server for previewing production artifacts. Make sure to have built the artifacts using the build method and have the correct production artifacts. + +Type: + +```typescript +preview(options: InlineConfig): Promise +``` +Basic example: + +```javascript +import { preview, logger } from "@farmfe/core"; +try { + await preview(defaultOptions); +} catch (error) { + logger.error(`Failed to start preview server:\n ${error.stack}`); + process.exit(1); +} +``` +## Clean +The clean method clears the cache generated by the farm incremental build. If you have issues with the incremental build causing crashes due to unforeseen or undiscovered problems, clearing the cache might help. + +:::warning +If there are problems with the incremental build causing crashes that are not resolved by clearing the cache, please submit an issue on GitHub. +::: + +Type: + +```typescript +clean(options: InlineConfig): Promise +``` +Basic example: + +```javascript +import { clean, logger } from "@farmfe/core"; +try { + await clean(defaultOptions); +} catch (error) { + logger.error(`Failed to clean cache:\n ${error.stack}`); + process.exit(1); +} +``` + +## loadEnv +Load environment variables from the .env file. + +```ts +type LoadEnvFunc = ( + mode: string, + envDir: string, + prefixes: string | string[] = ['FARM_', 'VITE_'] +) => [env: Record, existsEnvFiles: string[]]; +``` + +* `mode` is `development`, `production` or any string. `loadEnv` will try load `[``.env``, ``.env.local``, ``.env.${mode}``, ``.env.${mode}.local``]` for `envDir`. +* `envDir` is the directory where the `.env` file is located. +* `prefixes` is the prefix of the environment variable. The default value is `['FARM_', 'VITE_']`. Env variables with these prefixes will be injected into `define` automatically. + +```js +const [env, files] = loadEnv('development', '/path/to/project/env'); +// use env +``` + +## createDevServer +The createDevServer method is used to start a local development server. You need to instantiate the Server object first and pass the compiler as a parameter. + +Type: + +```typescript +createDevServer(options: DevServerOptions): Promise +``` +Basic example: + +```javascript +import { Server } from "@farmfe/core"; +const server = new Server(); +await server.createDevServer(options); +server.listen() +``` +## createPreviewServer +Create a preview server for previewing production artifacts. + +Type: + +```typescript +createPreviewServer(options: DevServerOptions): Promise +``` +Basic example: + +```javascript + +import { Server } from "@farmfe/core"; +const server = new Server(); +await server.createPreviewServer(options); +``` +## getCompiler +Get the current development server's compiler instance. Pass the compiler as a parameter when instantiating the Server. + +Type: + +```typescript + +getCompiler(): Compiler +``` +Basic example: + +```javascript + +import { Server, Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +const server = new Server({ + compiler +}); +const compilerInstance = server.getCompiler(); +``` +## close +Close all servers and WebSocket services opened by createDevServer. + +Basic example: + +```javascript + +import { Server } from "@farmfe/core"; +const server = new Server(); +await server.createDevServer(options); +server.listen() +await server.close(); +``` +## Compiler +The Compiler provides a set of compiler APIs. You can create a compiler instance by instantiating Compiler. + +Basic example: + +```javascript + +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +await compiler.compile(); +``` +### compile +Asynchronously start the compilation process. Returns a Promise. + +:::note +If specific environment variables are set (process.env.FARM_PROFILE), it performs a synchronous compilation. +::: + +Type: + +```typescript + +compile(): Promise +``` +Basic example: + +```javascript + +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +await compiler.compile(); +``` +### compileSync +Synchronously start the compilation process. + +Type: + +```typescript + +compileSync(): void +``` +Basic example: + +```javascript + +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +compiler.compileSync(); +``` +### traceDependencies +Trace dependencies between files. Returns an array of all dependencies for the provided input in the compiler configuration. Useful for restarting compilation based on file dependencies. + +Type: + +```typescript + +traceDependencies(): Array +``` +Basic example: + +```javascript + +import { Compiler } from "@farmfe/core"; + +const config = { + input: "./farm.config.js" +} +const compiler = new Compiler(config); +const dependencies = compiler.traceDependencies(); +``` +Returns an array of paths representing all dependencies. + +### update +Update compilation based on the provided paths. Returns a Promise resolving to a JsUpdateResult. If compilation is already in progress, it waits for completion and updates. If ignoreCompilingCheck is set to true, it won't check the compilation status. + +```typescript + +type JsUpdateResult = { + success: boolean + errors: Array + warnings: Array +} + +update(paths: Array, sync: boolean, ignoreCompilingCheck: boolean): JsUpdateResult +``` +Basic example: + +```javascript + +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +const result = await compiler.update(paths, true, true); +``` +### hasModule +Pass a path to determine if the current path is within the modules compiled by the compiler. + +Type: + +```typescript + +hasModule(path: string): boolean +``` +Basic example: + +```javascript + +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +const result = compiler.hasModule(path); +``` +### getParentFiles +Retrieve the current file that a module import with the module import name (id) or resolved path identifier (resolvedPath) imports. + +Type: + +```typescript + +getParentFiles(resolvedPath: string): Array +``` +Basic example: + +```javascript + +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +const result = compiler.getParentFiles(resolvedPath); +``` +### resources +Return all resources compiled by the compiler. + +Type: + +```typescript + +type Resource = { + path: string + buffer: Buffer +} +resources(): Array +``` +Basic example: + +```javascript + +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +await compiler.compile() +const result = compiler.resources(); +``` +### Resource +Return the buffer of the current artifact based on the given file. + +Type: + +```typescript + +resource(path: string): Buffer | null +``` +Basic example: + +```javascript + +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +await compiler.compile() +const result = compiler.resource(path); +``` +### writeResourcesToDisk +Write resources to disk based on the configured output path. + +Type: + +```typescript + +writeResourcesToDisk(): void +``` +Basic example: + +```javascript + +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +await compiler.compile() +compiler.writeResourcesToDisk(); +``` +### removeOutputPathDir +Remove the output path directory. + +Type: + +```typescript + +removeOutputPathDir(): void +``` +Basic example: + +```javascript + +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +await compiler.compile() +compiler.removeOutputPathDir(); +``` +### resolvedWatchPaths +Return resolved watch paths. + +Type: + +```typescript + +resolvedWatchPaths(): Array +``` +Basic example: + +```javascript + +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +await compiler.compile() +const result = compiler.resolvedWatchPaths(); +``` +### resolvedModulePaths +Return resolved module paths relative to the provided root path. + +Type: + +```typescript + +resolvedModulePaths(rootPath: string): Array +``` +Basic example: + +```javascript + +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +await compiler.compile() +const result = compiler.resolvedModulePaths(rootPath); +``` +### onUpdateFinish +Add a callback to be executed after the update process is complete. + +Type: + +```typescript + +onUpdateFinish(callback: (...args: any[]) => any): void +``` +Basic example: + +```javascript + +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +compiler.onUpdateFinish(callback); +``` +### outputPath +Return the resolved output path. + +Type: + +```typescript + +outputPath(): string +``` +Basic example: + +```javascript + +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +const result = compiler.outputPath(); +``` +### addExtraWatchFile +Add extra watch files for the compiler. + +Type: + +```typescript + +addExtraWatchFile(rootPath: string, filePath: string[]): void +``` +Basic example: + +```javascript + +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +compiler.addExtraWatchFile(rootPath, filePath); +``` +### modules +Return an array of objects representing file module resolutions. + +Type: + +```typescript + +export interface Module { + id: string + moduleType: string + moduleGroups: Array + resourcePot?: string + sideEffects: boolean + sourceMapChain: Array + external: boolean + immutable: boolean +} +modules(): Array +``` +Basic example: + +```javascript + +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +const result = compiler.modules(); +``` diff --git a/docs/docs/api/js-plugin-api.md b/docs/docs/api/js-plugin-api.md new file mode 100644 index 0000000000..0a3939469b --- /dev/null +++ b/docs/docs/api/js-plugin-api.md @@ -0,0 +1,884 @@ +# Js Plugin Api + +Farm Js Plugin has designed a similar rollup style design plugin system and easy to migrate your plugins/projects from Rollup/Vite/Webpack. + + +## Configuring Js Plugins + +Adding JS plugins by `plugins` option: + +```ts title="farm.config.ts" {3,7} +import { defineConfig } from "@farmfe/core"; +// import a js plugin +import farmPluginFoo from "farm-plugin-foo"; + +export default defineConfig({ + // configuring it in plugins + plugins: [farmPluginFoo()], +}); +``` + +## Writing Js Plugins +A Farm Js Plugin is a plain javascript object which exposes a set of `hook`s. for example: + +```ts title="my-farm-plugin.ts" +// Create a plugin file that exports a plugin function which returns a `JsPlugin` Object: +import type { JsPlugin } from '@farmfe/core'; + +// Plugin Options +export interface PluginOptions { + test: boolean; +} +// export a Plugin Function +export default function MyPlugin(options: PluginOptions): JsPlugin { + // reading options + const { test } = options; + + // return a object that exposes hook + return { + name: 'my-farm-plugin', + // using load hook to load custom modules + load: { + filters: { + resolvedPaths: ['\\.test$'] // filter files to improve performance + }, + async executor({ resolvedPath }) { + if (test && resolvedPath.endsWith('.test')) { + return { + content: 'test file', + sourceMap: null + } + } + } + } + } +} +``` + +:::note +* Farm provided `create-farm-plugin` tool to help you create and develop you js plugin quickly. For more details about writing JS plugins, refer to [Writing JS Plugins](/docs/plugins/writing-plugins/js-plugin) +::: + +## Plugin Hook Overview +The Js plugin hook is the same as the Rust plugin, See [Rust Plugin Hook Overview](/docs/api/rust-plugin-api#plugin-hooks-overview). + +:::note +Not all hooks are exposed to Js Plugins, only hooks listed in this document are available. +::: + +## hooks +### name +- **type: `string`** +- **required: `true`** + +The name of this plugins, MUST not be empty. +```ts +export default function MyPlugin() { + return { + name: 'my-plugin', + // ... + } +} +``` + +### priority +- **type: `number`** +- **required: `false`** +- **default: `100`** + +The priority of this plugins, default to `100`. `priority` controls the execution order of plugins, the larger the value, the earlier the plugin is executed. + +```ts +export default function MyPlugin() { + return { + name: 'my-plugin', + priority: 1000, // make this plugins execute before all other plugins + // ... + } +} +``` +:::note +Note that the priority of most farm internal plugins like `plugin-script`, `plugin-resolve` is `99`, which means your plugins is always executed before the internal plugins. If your want to make your plugin executed after farm internal plugins, set `priority` to a value that smaller than `99`, for example: `98`. Also the priority value can be negative, you can set it to `-9999` to make sure it is always executed at last. +::: + +### config +- **type: `config?: (config: UserConfig) => UserConfig | Promise;`** +- **hook type: `serial`** +- **required: `false`** + +Modify [Farm config](/docs/config/configuring-farm.md) in `config` hook, return the (partial) `modified config`, the returned config will be deeply merged into the config resolved from cli and config file. You can also directly mutate the config. + +Example: +```ts +const resolveConfigPlugin = () => ({ + name: 'return-resolve-config-plugin', + config: (_config) => ({ + compilation: { + resolve: { + alias: { + foo: 'bar' + } + } + } + }) +}); +``` + +:::note +`config` hook is called after all `user plugins` are resolved, so add new plugins into the config has no effect. +::: + + +### configResolved +- **type: `configResolved?: (config: ResolvedUserConfig) => void | Promise;`** +- **hook type: `serial`** +- **required: `false`** + +Called when the config resolved(after all plugin's `config` hook being called). Useful when you want to get the final resolved config for your plugin. + +Example: +```ts +const myPlugin = () => { + let farmConfig; + + return { + name: 'my-plugin', + configResolved(resolvedConfig) { + // get resolved config + resolvedConfig = farmConfig; + }, + transform: { + filters: { + moduleTypes: ['js'] + }, + async executor(param) { + if (farmConfig.xxx) { + // ... + } + } + } + } +} +``` + +### configureDevServer +- **type: `configureDevServer?: (server: Server) => void | Promise;`** +- **hook type: `serial`** +- **required: `false`** + +:::note +Note that this hook runs in development mode only. +::: + +Called when `Dev Server` is ready, you can get the dev server instance. + +Example: +```ts +const myPlugin = () => { + let devServer; + + return { + name: 'my-plugin', + configureDevServer(server) { + devServer = server; + } + } +} +``` + +:::note +Both `config` and `configResolved` hook of `js plugin` are called before `config` hook of `rust plugin`. +::: + +### configureCompiler +- **type: `configureCompiler?: (compiler: Compiler) => void | Promise;`** +- **hook type: `serial`** +- **required: `false`** + +Called when `Rust Compiler` is ready, this hook runs in both development and production. You can get `Compiler` instance here + +Example: +```ts +const myPlugin = () => { + let farmCompiler; + + return { + name: 'my-plugin', + configureCompiler(compiler) { + farmCompiler = compiler; + } + } +} +``` + +### buildStart +- **type: `buildStart?: { executor: Callback, void> };`** +- **hook type: `parallel`** +- **required: `false`** + +Called before the compilation starts. You can do some initialization work here. + +Example: +```ts +const myPlugin = () => { + // your plugin operations + let myPluginContext = createMyPluginContext(); + + return { + name: 'my-plugin', + buildStart: { + async executor() { + // set up my plugin before compilation. + myPluginContext.setup(); + } + } + } +} +``` +:::note +`buildStart` is only called once for the first compile. Later compiling like `Lazy Compilation` and `HMR Update` won't trigger `buildStart`. +::: + +### resolve +- **required: `false`** +- **hook type: `first`** +- **type:** +```ts +type ResolveHook = { + filters: { + importers: string[]; + sources: string[]; + }; + executor: Callback +}; + +type Callback = ( + param: P, + context?: CompilationContext, + hookContext?: { caller?: string; meta: Record } +) => Promise; + +/// Parameter of the resolve hook +export interface PluginResolveHookParam { + /// the start location to resolve `source`, being [None] if resolving a entry or resolving a hmr update. + /// it's id of the parent module, for example: `src/index.ts` or `src/index.vue?vue&type=xxx` + importer: string | null; + /// for example, [ResolveKind::Import] for static import (`import a from './a'`) + kind: ResolveKind; + /// source of the import. for example in index.ts (import App from "./App.vue") + /// source should be './App.vue' + source: string; +} +/// Resolve result of the resolve hook +export interface PluginResolveHookResult { + /// resolved path, normally a absolute path. you can also return a virtual path, and use [PluginLoadHookResult] to provide the content of the virtual path + resolvedPath: string; + /// whether this module should be external, if true, the module won't present in the final result + external: boolean; + /// whether this module has side effects, affects tree shaking + sideEffects: boolean; + /// the query parsed from specifier, for example, query should be `{ inline: true }` if specifier is `./a.png?inline` + /// if you custom plugins, your plugin should be responsible for parsing query + /// if you just want a normal query parsing like the example above, [crate::utils::parse_query] is for you + query: [string, string][] | null; + /// meta data of the module, will be passed to [PluginLoadHookParam] and [PluginTransformHookParam] + meta: Record | null; +} +``` + +:::note +All filters `sources` and `importers` of resolve hook are `regex string`. +::: + +Custom `source` resolving from `importer`, for example, resolving `./b` from `a.ts`: +```ts title="a.ts" +import b from './b?raw'; +// ... +``` +Then the resolve params would be: +```ts +const param = { + source: "./b", + importer: { relative_path: "a.ts", query_string: "" }, + kind: 'import' +} +``` +The resolve result of default resolver would be: +```rust +const resolve_result = { + resolved_path: "/root/b.ts", // resolved absolute path of the module + external: false, // this module should be included in the final compiled resources and should not be external + side_effects: false, // this module may be tree shaken as it does not contains side effects + query: [["raw", ""]], // query from the source. + meta: {} +} +``` + +The `HookContext` is used to pass status when you can the hooks recursively, for example, your plugin call `context.resolve` in `resolve hook`: +```ts +const myPlugin = () => ({ + name: 'my-plugin', + resolve: { + filters: { + sources: ['^.+foo.+$'], + importers: ['^src/index.ts$'] + }, + executor: async (param, context, hookContext) => { + console.log(param); + if (hookContext.caller === 'my-plugin') { + return null; + } + // replace the original source and resolve new source + const newSource = param.source.replace('foo', 'bar'); + return context.resolve({ + ...param, + source: newSource + }, { + caller: 'my-plugin', + meta: {} + }); + } + } +}); +``` + +In above example, we call `context.resolve` and pass `caller` as parameter, then we should add a guard like `if (hookContext.caller === 'my-plugin') {` to avoid infinite loop. + +Note: +* By default, you `resolve hook` are executed **after** the default resolver inside Farm, only the sources that can not be resolved by internal resolver will be passed to your plugin, which means if you want to override the default resolve, you need to set your **plugin's priority larger** than `101`. +* Usually `resolved_path` is the real absolute path that points to a file. But you can still return a `virtual module id` like `virtual:my-module`, but for virtual module you need to implement `load` hook to custom how to load your virtual module. And in Farm, `resolved_path + query = module_id`. +* `ResolveKind` presents the `import type`, Example values: `require`(imported by commonjs require), `cssImport`(imported by css's import statement), etc. +* `meta` can be shared between plugins and hooks, you can get `meta` from params of `load`, `transform` and `parse` hooks in any plugin. + +### load +- **required: `false`** +- **hook type: `first`** +- **type:** +```ts +type LoadHook = { + filters: { + importers: string[]; + sources: string[]; + }; + executor: Callback +}; + +type Callback = ( + param: P, + context?: CompilationContext, + hookContext?: { caller?: string; meta: Record } +) => Promise; + +export interface PluginLoadHookParam { + moduleId: string; + resolvedPath: string; + query: [string, string][]; + meta: Record | null; +} + +export interface PluginLoadHookResult { + /// the content of the module + content: string; + /// the type of the module, for example [ModuleType::Js] stands for a normal javascript file, + /// usually end with `.js` extension + moduleType: ModuleType; + /// source map of the module + sourceMap?: string | null; +} +``` + +Custom how to load your module from a resolved module path or module id. For example, load a virtual module: +```ts +const myPlugin = () => ({ + name: 'my-plugin', + load: { + filters: { + resolvedPaths: ['^virtual:my-plugin$'], + }, + executor: async (param, context, hookContext) => { + if (param.resolvedPath === 'virutal:my-plugin') { + return { + content: 'export default "foo"', + moduleType: 'js' + }; + } + } + } +}); +``` + +`module_type` and `content` is required when loading modules in your `load` hook. `source_map` is optional, you can return source map if you do transform in the `load` hook(which is not recommended, we recommend to use `transform` hook for this situation) or you load original source map from other locations. + + +`filters.resolvedPath` of `load hook` is `resolvedPath + query`, for example: `/root/src/index.vue?vue&type=style&lang=css`. If you want to ignore query when filtering modules, you can use `$`: `src/index\\.vue$`; If you want to filter modules by query, for example, filtering `lang=css`, you can use `src/index.vue\\.+\\?vue&.+lang=css`. + +### transform +- **required: `false`** +- **hook type: `serial`** +- **type:** +```ts +type TransformHook = { + filters: { + importers: string[]; + sources: string[]; + }; + executor: Callback +}; + +type Callback = ( + param: P, + context?: CompilationContext, + hookContext?: { caller?: string; meta: Record } +) => Promise; + +export interface PluginTransformHookParam { + moduleId: string; + /// source content after load or transformed result of previous plugin + content: string; + /// module type after load + moduleType: ModuleType; // Module Type is 'js' | 'jsx' | 'ts' | 'tsx' | 'css' | 'html'... + resolvedPath: string; + query: [string, string][]; + meta: Record | null; + sourceMapChain: string[]; +} + +export interface PluginTransformHookResult { + /// transformed source content, will be passed to next plugin. + content: string; + /// you can change the module type after transform. + moduleType?: ModuleType; + /// transformed source map, all plugins' transformed source map will be stored as a source map chain. + sourceMap?: string | null; + // ignore previous source map. if true, the source map chain will be cleared. and this result should return a new source map that combines all previous source map. + ignorePreviousSourceMap?: boolean; +} +``` + +Do transformation based on **`module content`** and **`module type`**. Example for transforming `sass` to `css`: + +```ts +export default function farmSassPlugin( + options: SassPluginOptions = {} +): JsPlugin { + return { + name: pluginName, + load: { + filters: { resolvedPaths: ['\\.(scss|sass)$'] }, + async executor(param) { + if (param.query.length === 0 && existsSync(param.resolvedPath)) { + const data = await readFile(param.resolvedPath); + return { + content: data, + moduleType: 'sass' + }; + } + + return null; + } + }, + transform: { + filters: { + moduleTypes: ['sass'] + }, + async executor(param, ctx) { + const { css: compiledCss, map } = compileSass(param.content); + return { + content: compiledCss, + moduleType: 'css' // transformed sass to css, + sourceMap: JSON.stringify(map) + ignorePreviousSourceMap: false, + } + } + } + } +} +``` +Normal steps for writing `transform hook`: +1. add a `if` guard based `moduleType` or `resolvedPath` or `moduleId` +2. do transformation of the `content` +3. return the transformed `content`, `sourceMap` and `moduleType` + +For `ignorePreviousSourceMap`, if you handled `param.sourceMapChain` and collapsed the source maps of previous plugins in the `transform hook`. You should set `ignorePreviousSourceMap` to `true` to ensure source map is correct. Otherwise, you should always set this option to `false` and leave source map chain handled by Farm. + +For filters: +* When both `resolvedPaths` and `moduleTypes` are specified, take the union. +* `filters.resolvedPaths` is `resolvedPath + query`, for example: `/root/src/index.vue?vue&type=style&lang=css`. If you want to ignore query when filtering modules, you can use `$`: `src/index\\.vue$`; If you want to filter modules by query, for example, filtering `lang=css`, you can use `src/index.vue\\.+\\?vue&.+lang=css`. +* `filters.moduleTypes` is **NOT** `regex`, it must exactly match the `ModuleType` like `css`, `js`, `tsx`, etc. + +:::note +`transform` hook is **content to content**. There is a similar hook called `process_module`, `process_module` is **ast to ast**. Js plugin does not support `process_module` hook due to performance issues, if you want **ast to ast** transformations, try [`Rust Plugin`](/docs/plugins/writing-plugins/rust-plugin) instead. +::: + +### buildEnd +- **type: `buildEnd?: { executor: Callback, void> };`** +- **hook type: `parallel`** +- **required: `false`** + +Called after the `ModuleGraph` built, but before the resources render and generation starts. You can do some status updating or finalization work here. + +Example: +```ts +const myPlugin = () => { + // your plugin operations + let myPluginContext = createMyPluginContext(); + + return { + name: 'my-plugin', + buildEnd: { + async executor() { + // update my plugin status + myPluginContext.updateStatus('module-graph-built'); + } + } + } +} +``` +:::note +`buildEnd` is only called once for the first compile. Later compiling like `Lazy Compilation` and `HMR Update` won't trigger `buildEnd`. +::: + +### renderStart +- **type: `renderStart?: { executor: Callback; };`** +- **hook type: `parallel`** +- **required: `false`** + +Called before the resources render starts. + +Example: +```ts +const myPlugin = () => { + // your plugin operations + let myPluginContext = createMyPluginContext(); + + return { + name: 'my-plugin', + renderStart: { + async executor() { + // update my plugin status + myPluginContext.updateStatus('render-start'); + } + } + } +} +``` +:::note +`renderStart` is only called once for the first compile. Later compiling like `Lazy Compilation` and `HMR Update` won't trigger `renderStart`. +::: + +### renderResourcePot +- **required: `false`** +- **hook type: `serial`** +- **type:** +```ts +type RenderResourcePotHook = JsPluginHook< + { + resourcePotTypes?: ResourcePotType[]; + moduleIds?: string[]; + }, + RenderResourcePotParams, + RenderResourcePotResult +>; + +type Callback = ( + param: P, + context?: CompilationContext, +) => Promise; +type JsPluginHook = { filters: F; executor: Callback }; + +export interface RenderResourcePotParams { + content: string; + sourceMapChain: string[]; + resourcePotInfo: { + id: string; + name: string; + resourcePotType: ResourcePotType; + map?: string; + modules: Record; + moduleIds: ModuleId[]; + data: JsResourcePotInfoData; + custom: Record; + }; +} +export interface RenderResourcePotResult { + content: string; + sourceMap?: string; +} +``` + +`Resource Pot` is the abstract representation of the final output bundle file, you can return transformed `resourcePot content` to mutate the final bundle. For example, rendering css: + +```ts +const myPlugin = () => ({ + name: 'test-render-resource-pot', + renderResourcePot: { + filters: { + moduleIds: ['^index.ts\\?foo=bar$'], + resourcePotTypes: ['css'] + }, + executor: async (param) => { + return { + content: param.content.replace( + '<--layer-->', + cssCode + ), + sourceMap + }; + } + } +}) +``` +We transform all `<--layer-->` in css resource pot and replace them to real `css code`. + +:::note +When both `filters.moduleIds` and `filters.resourcePotTypes` are specified, take the union. +::: + +### augmentResourceHash +- **required: `false`** +- **hook type: `serial`** +- **type:** +```ts +type AugmentResourceHash = JsPluginHook< + { + resourcePotTypes?: ResourcePotType[]; + moduleIds?: string[]; + }, + { + id: string; + name: string; + resourcePotType: ResourcePotType; + map?: string; + modules: Record; + moduleIds: ModuleId[]; + data: JsResourcePotInfoData; + custom: Record; + }, + string +>; + +type Callback = ( + param: P, + context?: CompilationContext, +) => Promise; +type JsPluginHook = { filters: F; executor: Callback }; +``` + +Append resource hash for give Resource Pot. Useful if you want to add additional conditions when generating resource hash. + + +```ts +const myPlugin = () => ({ + name: 'test-augment-resource-pot', + renderResourcePot: { + filters: { + moduleIds: ['^index.ts\\?foo=bar$'], + resourcePotTypes: ['css'] + }, + executor: async (param) => { + return 'my-hash-args'; + } + } +}) +``` + +:::note +When both `filters.moduleIds` and `filters.resourcePotTypes` are specified, take the union. +::: + +### finalizeResources +- **required: `false`** +- **hook type: `serial`** +- **type:** +```ts +type FinalizeResourcesHook = { + executor: Callback< + FinalizeResourcesHookParams, + FinalizeResourcesHookParams['resourcesMap'] + >; +}; + +export type FinalizeResourcesHookParams = { + resourcesMap: Record; + config: Config['config']; +}; + +export interface Resource { + name: string; + bytes: number[]; + emitted: boolean; + resourceType: string; + origin: { type: 'ResourcePot' | 'Module'; value: string }; + info?: ResourcePotInfo; +} +``` + +Do some transformations for all generated resources, return `transformed resourcesMap`. You can `add`, `remove`, `modify` final generated resources in this hook. + +Note: +* `bytes` is binary of the final output, for `js/css/html` code, you can use `Buffer.from(bytes).toString()` to get the code. +* `name` is the final file name. +* `origin` represent where this `Resource` is from, `ResourcePot` means it's generated from `ResourcePot` which is a modules bundle; `Module` means it's from `Module`, for example, static files like `.png/.jpg` are from `Module`. + +### transformHtml +- **required: `false`** +- **hook type: `serial`** +- **type:** +```ts +type TransformHtmlHook = { + order?: 0 | 1 | 2; + executor: Callback<{ htmlResource: Resource }, Resource>; +}; +``` + +The `order` is used to configure when to execute `transformHtml` hook: +* `0`: means `pre`, executed before parse and generate resources. You can transform original html in this stage. +* `1` and `2`: means `normal` and `post`, executed after parse and generate resources. In this stage, all ` + + +``` + +and when loading dynamic scripts and css, the dynamic fetched resources url would also be: `https://cdn.com/` + +#### `output.assetsFileName` + +- **Default value**: `"[resourceName].[ext]"` + +The filename configuration for static resource output, the placeholder is the same as `output.filename`. + +#### `output.targetEnv` + +- **default**: `"browser-es2017"` + +Configure the execution environment of the product, which can be `"browser"` or `"node"`. Farm will automatically inject polyfill and downgrade syntax(for both script and css) for your specified targetEnv, the supported `targetEnv`s is below: + +Targeting `browser`: +* **`browser-es2017`**: Compiling the project to browsers that support `async await` natively. +* **`browser-es2015`**: Compiling the project to browsers that support `es6 features` natively. +* **`browser-legacy`**: Compile the project to `ES5`, for example, `IE9`. Note that this may introduce lots of polyfills which makes production size larger. Make sure you really need to support legacy browsers like `IE9`. +* **`browser-esnext`**: Compile the project to latest modern browsers, no polyfill will be injected. +* **`browser`**: Alias of `browser-es2017` + +Targeting `node`: +* **`node16`**: Compile the project to `Node 16`. +* **`node-legacy`**: Compile the project to `Node 10`. +* **`node-next`**: Compile the project to latest Node Version, no polyfill will be injected. +* **`node`**: Alias of `node16` + + +#### `output.format` + +- **default**: `"esm"` + +The format of the configuration product, which can be `"esm"` or `"cjs"`. + +:::note +This option is only valid for Js products +::: + +### resolve + +- **type**: `ResolveOptions` + +```ts +interface ResolveOptions { + extensions?: string[]; + alias?: Record; + mainFields?: string[]; + conditions?: string[]; + symlinks?: boolean; + strictExports?: boolean; +} +``` + +#### `resolve.extensions` + +- **default**: `["tsx", "ts", "jsx", "js", "mjs", "json", "html", "css"]` + +Configure the suffix when parsing dependencies. For example, when parsing `./index`, if it is not resolved, the suffix parsing will be automatically added, such as trying `./index.tsx`, `./index.css`, etc. + +#### `resolve.alias` + +- **Default value**: `{}` + +Configure parsing alias, example: + +```ts +export default defineConfig({ + compilation: { + resolve: { + alias: { + "/@": path.join(process.cwd(), "src"), + stream$: "readable-stream", + "$__farm_regex:^/(utils)$": path.join(process.cwd(), "src/$1"), + }, + }, + }, +}); +``` + +alias is prefix replacement, for the above example `/@/pages` will be replaced by `/root/src/pages`. + +If you want an exact match, you can add `$`, for example `stream$` will only replace `stream`, but not `stream/xxx`. + +If you want to use regex, you can use `$__farm_regex:`, for example `$__farm_regex:^/(utils)$` will replace `/utils` to `/root/src/utils`. + +#### `resolve. mainFields` + +- **default**: `["exports", "browser", "module", "main"]` + +When parsing dependencies under node_modules, the fields and order configured in `mainFields` will be parsed from package.json. For `package.json` + +```json +{ + "name": "package-a", + "module": "es/index.js", + "main": "lib/index.js" +} +``` + +Will use `es/index.js` first (if the path exists), and will continue to search backwards if it does not exist. + +#### `resolve.conditions` + +Configuration is not currently supported. + +#### `resolve.symlinks` + +- **default**: `true` + +When parsing a file, whether to track the real directory corresponding to the symlink, and start parsing the next dependency from the real directory. If pnpm is used to manage dependencies, this option must be configured as true. + +#### `resolve. strictExports` + +- **default**: `false` + +Whether to strictly follow the exports defined in `exports` in `package.json`. If set to true, when `exports` is defined in `package.json`, but `exports` does not define the corresponding export, an error will be reported directly. If set to true, it will continue to try other entries according to mainFields. + +### define + +- **Default value**: `{}` + +Global variable injection, the configured variable name and value will be injected into the product at compile time. Farm injects `process.env.NODE_ENV` and some variables used by Farm itself such as `FARM_HMR_PORT` by default + +```ts +export default defineConfig({ + compilation: { + define: { + MY_VAR: 123, + }, + }, +}); +``` + +### external + +- **default**: `[]` +- **type**: `(string | Record)[]` + +Configure the imports that are external, and the imports that are external will not appear in the compiled product. However, the corresponding import statement will not be deleted. You need to customize how to deal with external, otherwise an error will be reported at runtime. If targetEnv is an external module under node, it will automatically try to require the module. + +It needs to be configured in a regular way, for example: + +```ts +export default defineConfig({ + compilation: { + external: ["^stream$", { jquery: "Jquery" }], + }, +}); +``` + +### externalNodeBuiltins +- **default**: `true` + +External `module.builtinModules` or not, by default, all builtin modules like `fs` will be external. You can also set `externalNodeBuiltins` as `array` to specify the modules to external manually: + +```ts +export default defineConfig({ + compilation: { + externalNodeBuiltins: ["^stream$"], + }, +}); +``` + +### mode + +- **default**: `development` for start, watch commands, `production` for build commands + +Configure the compilation mode. In order to optimize the performance during development, if there is no manual configuration of production optimization related options (minify, tree shake, etc.), the production environment optimization such as compression and tree shake will be disabled by default under `development`. In `production` mode enabled. + + +### runtime + +Configure Farm runtime capabilities. The types are as follows: + +```ts +interface FarmRuntimeOptions { + runtime?: { + path: string; + plugins?: string[]; + namespace?: string; + isolate?: boolean; + }; +} +``` + +#### `runtime.path` + +- **Default value**: The path of Farm's built-in runtime + +Customize a Runtime to replace Farm's built-in Runtime. + +:::warning +It is not recommended to configure this option under normal circumstances, because once this option is configured, the pointed runtime needs all +::: + +#### `runtime.plugins` + +- **Default value**: The path of Farm's built-in runtime-plugin-hmr + +Configure the Runtime plug-in, through the Runtime plug-in, you can intervene in Runtime behavior, such as module loading, resource loading, etc. For details, please refer to: WIP. + +#### `runtime.namespace` + +- **default**: name field of project package.json + +Configure the namespace of Farm Runtime to ensure that the execution of different products under the same window or global can be isolated from each other. By default, the name field of the project package.json is used as the namespace. + +#### `runtime.isolate` + +- **default**: `false` + +By default, runtime files in html are written inline. If you want to reduce the size of the html file by popping it up as a separate file, then you can set this attribute to true. +If set to true, the farm entry script will be emitted as a separate file. + + +### assets + +#### `assets.include` + +- **default**: `[]` + +Additional file suffixes that are regarded as static resources, such as the following example, `txt` will be regarded as posture resources, and will be treated as static resources when importing txt files: + +```ts +export default defineConfig({ + compilation: { + assets: { + include: ["txt"], + }, + }, +}); +``` + +### script + +#### `script.target` + +- **Default value**: `esnext` (dynamically adjusted according to the iteration of Farm) + +Configure Farm to parse the AST of `js/jsx/ts/tsx` and support the ES syntax version when generating code. Possible values: `es5`, `es6`, `es2015` - `es2023`, `esnext` + +#### `script.parser` + +- **default**: same as SWC + +Configure the behavior of SWC when parsing AST, configuration item reference: https://swc.rs/docs/configuration/compilation#jscparser + +#### `script.plugins` + +- **default**: `[]` + +Configure the swc plugin array, each item of the array contains three fields: + +- **name**: the package name of the swc plugin +- **options**: Configuration items passed to swc plugin +- **filters**: Which modules to execute the plug-in, must be configured, support `resolvedPaths` and `moduleTypes` these two filter items, if both are specified at the same time, take the union. + +An example of a configuration that supports JSX for a Vue project is as follows: + +```ts +import jsPluginVue from "@farmfe/js-plugin-vue"; + +/** + * @type {import('@farmfe/core').UserConfig} + */ +export default { + compilation: { + script: { + plugins: [ + { + name: "swc-plugin-vue-jsx", + options: { + transformOn: true, + optimize: true, + }, + filters: { + // resolvedPaths: [".+"] + moduleTypes: ["tsx", "jsx"], + }, + }, + ], + }, + }, + plugins: [jsPluginVue()], +}; +``` + +#### `script.decorators` + +```ts +export interface DecoratorsConfig { + legacyDecorator: boolean; + decoratorMetadata: boolean; + /** + * The version of the decorator proposal to use. 2021-12 or 2022-03 + * @default 2021-12 + */ + decoratorVersion: "2021-12" | "2022-03" | null; + /** + * @default [] + */ + includes: string[]; + /** + * @default ["node_modules/"] + */ + excludes: string[]; +} +``` + +It's recommended to use default decorators configuration of Farm, unless you want to improve performance, you can set `includes` and `excludes`. + +Options: + +- **legacyDecorator**: default to `true`. Using legacy decorator proposal. +- **decoratorMetadata**: default to `false`. You have to set `legacyDecorator` to `false` if you want to set it to true. +- **decoratorVersion**: default to '2021-12', proposal version. The value is 2021-12 or 2022-03. +- **includes**: default to `[]`. If you want to include modules that are excluded, you can set this option. Regex supported. +- **excludes**: default to `['node_modules/']`. Modules under these paths are ignored when transform decorators. Regex supported + +### css + +#### `css.modules` + +Configure Farm CSS Modules. + +```ts +interface FarmCssModulesConfig { + // Configure which paths will be processed as css modules, using regular strings + // defaults to `.module.css` or `.module.scss` or `.module.less` + paths?: string[]; + // configure the generated css class name, the default is `[name]-[hash]` + indentName?: string; +} +``` + +##### `css.modules.paths` + +- **default**: `["\\.module\\.(css|scss|sass|less)"]` + +Configure which paths correspond to modules that will be treated as CSS Modules. A regular string needs to be configured. Defaults to files ending in `.module.(css|scss|sass|less)`. + +##### `css.modules.identName` + +- **default**: `[name]-[hash]` + +Configure the generated CSS Modules class name, the default is `[name]-[hash]`, `[name]`, `[hash]` are placeholders (also all currently supported placeholders). `[name]` means the original class name, `[hash]` means the hash of the modified css file id. + +#### `css.prefixer` + +Configure CSS compatibility prefixes, such as `-webkit-`. + +```ts +interface FarmCssPrefixer { + targets?: string[] | string | BrowserTargetsRecord; +} + +type BrowserTargetsRecord = Partial< + Record< + | "chrome" + | "opera" + | "edge" + | "firefox" + | "safari" + | "ie" + | "ios" + | "android" + | "node" + | "electron", + string + > +> & { [key: string]: string }; +``` + +##### `css.prefixer.targets` + +- **Default value**: `undefined` + +Configure which target browsers or browser versions to enable, for example: + +```ts +import { defineConfig } from "@farmfe/core"; + +function defineConfig(config: UserConfig) { + return config; +} + +export default defineConfig({ + compilation: { + css: { + prefix: { + targets: ["last 2 versions", "Firefox ESR", "> 1%", "ie >= 11"], + }, + }, + }, +}); +``` + +### html + +#### `html.base` + +- **Default value**: `undefined` + +All HTML entries will inherit `html.base`, for details, refer to [Guide - HTML](/docs/features/html) + +### sourcemap + +- **default**: `true` + +Configure whether to enable sourcemap, optional configuration items and descriptions are as follows: + +- **`true`**: Only generate sourcemap for files not under `node_modules`, and generate a separate sourcemap file +- **`false`**: turn off sourcemap +- **`inline`**: Only generate sourcemap for files not under `node_modules`, and inline sourcemap into the product, do not generate a separate file +- **`all`**: generate sourcemap for all files, and generate a separate sourcemap file +- **`all-inline`**: Generate sourcemaps for all files, and inline sourcemaps into the product, do not generate separate files + +### partialBundling + +Configure the behavior of Farm's partial bundling. For details, please refer to [Partial Bundling](/docs/features/partial-bundling) + +```ts +export interface FarmPartialBundlingConfig { + targetConcurrentRequests?: number; + targetMinSize?: number; + targetMaxSize?: number; + groups?: { + name: string; + test: string[]; + groupType?: "mutable" | "immutable"; + resourceType?: "all" | "initial" | "async"; + }[]; + enforceResources?: { + name: string; + test: string[]; + }[]; + enforceTargetConcurrentRequests?: boolean; + enforceTargetMinSize?: boolean; + immutableModules?: string[]; +} +``` + +#### `partialBundling.targetConcurrentRequests` + +- **default**: `25` + +Farm tries to generate resource numbers as closer as possible to this config value for initial resource loading or a dynamic resource loading. + +#### `partialBundling.targetMinSize` + +- **default**: `20 * 1024` bytes, 20 KB + +The minimum size of each generated resources **before minify and gzip**. Note that `targetMinSize` will not be satisfied if `ModuleBucket's size` is less than `targetMinSize`, `ModuleBucket` will be given priority. Config `enforceTargetMinSize` can be used to enforce size. + +#### `partialBundling.targetMaxSize` + +- **default**: `1500 * 1024` bytes, 1500 KB + +The maximum size of generated resources before minify and gzip. + +#### `partialBundling.groups` + +- **default**: `[]` + +A group of modules that should be placed together. Note that this group config is only a hit to the compiler that these modules should be placed together, it may produce multiple resources, if you want to enforce modules in the same resource, you should use `enforceResources`. + +Options for each item: + +- **name**: Name of this group. +- **test**: Regex array to match the modules which are in this group. +- **groupType**: `mutable` or `immutable`, this group only applies to the specified type of modules. +- **resourceType**: `all`, `initial` or `async`, this group only applies to the specified type of resources. + +```ts title="farm.config.ts" {4-9} +export default defineConfig({ + compilation: { + partialBundling: { + groups: [ + { + name: "vendor-react", + test: ["node_modules/"], + }, + ], + }, + }, +}); +``` + +#### `partialBundling.enforceResources` + +- **default**: `[]` + +Array to match the modules that should always be in the same output resource, ignore all other constraints. + +Options for each item: + +- **name**: Name of this resource. +- **test**: Regex array to match the modules which are in this resource. + +```ts title="farm.config.ts" {4-9} +export default defineConfig({ + compilation: { + partialBundling: { + enforceResources: [ + { + name: "index", + test: [".+"], + }, + ], + }, + }, +}); +``` + +:::warning +`enforceResources` will ignore all Farm's internal optimization, be careful when you use it. +::: + +#### `partialBundling.enforceTargetConcurrentRequests` + +- **default**: `false` + +Enforce target concurrent requests for every resource loading, when true, smaller resource will be merged into bigger resource to meet the target concurrent requests. this may cause issue for css resource, be careful to use this option. + +#### `partialBundling.enforceTargetMinSize` + +- **default**: `false` + +Enforce target min size for every resource, when tue, smaller resource will be merged into bigger resource to meet the target concurrent requests. this may cause issue for css resource, be careful to use this option + +#### `partialBundling.immutableModules` + +- **default**: `['node_modules']` + +Regex array to match the immutable modules. + +```ts title="farm.config.ts" +export default defineConfig({ + compilation: { + partialBundling: { + immutableModules: ["node_modules/", "/global-constants"], + }, + }, +}); +``` + +Immutable module can affect bundling and incoming persistent cache, be careful if you want to change it. + +#### `partialBundling.immutableModulesWeight` + +- **default**: `0.8` + +Default to `0.8`, means the output bundles of immutable module takes 80%. for example, if `targetConcurrentRequest` is `25`,then immutable bundles files numbers are `25 * 80% = 20`. This option is used isolate your mutable and immutable module, if you modified your business code, bundles generating from `node_modules` won't be affected. + +### lazyCompilation + +- **default**: `true` in development mode, `false` in build mode + +Whether to enable lazy compilation, configure to false to close. See [lazy compilation](/docs/features/lazy-compilation). + +### treeShaking + +- **default**: `false` in development mode, `true` in build mode + +Whether to enable tree shake, set to false to close. See [Tree Shake](/docs/features/tree-shake). + +### minify + +- **default**: `false` in development mode, `true` in build mode + +Whether to enable compression, the product will be compressed and confused after it is turned on. See [Minification](/docs/advanced/minification). + +```ts +type MinifyOptions = boolean | { + compress?: ToSnakeCaseProperties | boolean; + mangle?: ToSnakeCaseProperties | boolean; +}; +``` +The `compress` and `mangle` options is the same as [swc's minify config](https://swc.rs/docs/configuration/minification). + +#### `minify.compress` + +- **default**: `{}` +- **type**: [`TerserCompressOptions`](https://swc.rs/docs/configuration/minification#jscminifycompress) + +compress option + +#### `minify.mangle` + +- **default**: `{}` +- **type**: [`TerserMangleOptions`](https://swc.rs/docs/configuration/minification#jscminifymangle) + +compress variable parameters + +#### `minify.include` + +- **default**: `[]` +- **type**: `string[]` + +contains modules that need to be compressed, defaults to all, only takes effect when `minify.mode` is `minify-module`. + +#### `minify.exclude` + +- **default**: `["*.min.js"]` +- **type**: `string[]` + +exclude unnecessary compression modules, only takes effect when `minify.mode` is `minify-module`. + +#### `minify.mode` + +- **default**: `'minify-module'` +- **type**: `'minify-module' | 'minify-resource-pot'` + +`minify-module` module level `minify`, you can control which modules need to be minified through parameters, the compression is more refined and the efficiency is better + +`minify-resource-pot` `ResourcePot` level `minify`, specific modules cannot be controlled through parameters + +### presetEnv + +- **default**: `false` in development mode, `true` in build mode + +```ts +type FarmPresetEnvConfig = + | boolean + | { + include?: string[]; + exclude?: string[]; + // TODO using swc's config + options?: any; + assumptions?: any; + }; +``` + +By default, polyfills will not be injected into modules under node_modules, if necessary, please use `include` to add polyfills. + +#### `presetEnv.include` + +- **default**: `[]` + +Include additional modules that require polyfill, configure regular strings, for example `include: ['node_modules/(es6-package|my-package)/']` + +#### `presetEnv. exclude` + +- **default**: `['node_modules/']` + +Configure modules that do not require polyfill, and configure regular strings, such as `exclude: ['custom-path/(es5-package|my-package)/']`. By default node_modules is excluded, if you need to include excluded modules, it is recommended to use `include` + +#### `presetEnv.options` + +- **default**: `downgrade to ES5` + +Options passed to swc preset env, see https://swc.rs/docs/configuration/compilation#env. + +### persistentCache + +- **default**: `true` + +Options for [Persistent Cache](/docs/features/persistent-cache). Configuring it `false` to disable cache. + +```ts +export type PersistentCache = + | boolean + | { + namespace?: string; + cacheDir?: string; + buildDependencies?: string[]; + moduleCacheKeyStrategy?: { + timestamp?: boolean; + hash?: boolean; + }; + }; +``` + +#### `persistentCache.namespace` + +- **default**: `farm-cache` + +Namespace for the cache, caches under different namespace will be isolated. + +#### `persistentCache.cacheDir` + +- **default**: `node_modules/.farm/cache` + +Cache store directory. + +#### `persistentCache.buildDependencies` + +- **default**: `farm.config.ts and all its deep dependencies` + +File path or package name that may affect the compilation, for example, plugins. By default, `farm.config.ts/js/mjs` and all of its deep dependencies will be treated as build dependencies, if any of these files changed, all cache will be invalidated. + +it can be a file path or a package name, for example: + +```ts +import { defineConfig } from "@farmfe/core"; +import path from "node:path"; + +export default defineConfig({ + persistentCache: { + buildDependencies: [ + // a file path + path.resolve(process.cwd(), "./plugins/my-plugin.js"), + // a package name, note that this package must expose package.json + "farm-plugin-custom-xxx", + ], + }, +}); +``` + +#### `persistentCache.moduleCacheKeyStrategy` + +- **default**: `{ timestamp: true, hash: true }` + +How to generate cache key when trying to reuse cache. if `timestamp` is true and the timestamp of the module is not changed, then all build stage hooks like `load`, `transform` will be skipped and the cached module will be reused. if `hash` is true and the content of the module is not changed, `load` and `transform` hook will be called to get the transformed content, other hooks will be skipped and the cached module will be reused. + +- `timestamp`: whether check timestamp of the module, which has the best performance +- `hash`: whether check content hash after load and transform + +#### `persistentCache.envs` + +- **default**: [Farm Env](/docs/config/farm-config#environment-variable) + +Envs used to invalidate cache, if the configured env changed, then all cache will be invalidated. + + + +### progress +- **default**: `true` + +Enable progress bar or not. + +### comments +- **default**: `license` + +Preserve comments or not: +* `true`: Preserve all comments +* `false`: Remove all comments +* `license`: Preserve all **LICENSE comments**, and remove the others diff --git a/docs/docs/config/configuring-farm.md b/docs/docs/config/configuring-farm.md new file mode 100644 index 0000000000..b2568d9e50 --- /dev/null +++ b/docs/docs/config/configuring-farm.md @@ -0,0 +1,96 @@ +# Configuring Farm + +## Config File Spec +By default, Farm reads the configuration from the `farm.config.ts|js|mjs` file in the project root directory, an example configuration file: + +```ts title="farm.config.ts" {5-7} +import { defineConfig } from "@farmfe/core"; + +export default defineConfig({ + root: process.cwd(), // compiled root directory + // compile options + compilation: { + //... + }, + // Dev Server options + server: { + hmr: true, + //... + }, + // plugin configuration + plugins: [], +}); +``` + +For config options details, refer to: +* [`Compiler Options`](/docs/config/compilation-options): Configuring compiler options(`compilation` field), like `input`, `output`, `css compilation`, `bundling rules` and so on. +* [`Dev Server Options`](/docs/config/dev-server): Configuring dev server options(`server` field), like `port`, `host`, `protocol` and so on. +* [`Shared Options`](/docs/config/shared): Configuring shared options between `compiler options` and `dev server options`, like `root`, `env` and so on. + +:::note +You can also use `farm start/build -c my-config.ts` to use a custom file as config file. +::: + +## Loading Ts Config File +Farm support load ts config file like `farm.config.ts` out of box. Farm will bundle `farm.config.ts` and it's local ts dependencies into `farm-config.xxx.mjs` file first and load it from disk. Because Farm compiles the `farm.config.ts` into `mjs` file, you **CAN NOT** use `__dirname` or `__filename` in your `farm.config.ts`, use `import.meta.url` instead. + +Or you can use `farm.config.mjs` or `farm.config.cjs` with `@type` to support types avoid bundling `farm.config.ts`: + +```js title="farm.config.mjs" +/** + * @type {import('@farmfe/core').UserConfig} + */ +export default { + // ... +} +``` + +## Examples +### Input and Output +```ts title="farm.config.ts" {5-7} +import { defineConfig } from "@farmfe/core"; + +export default defineConfig({ + // compile options + compilation: { + input: { + index: './src/index.html', + about: './src/about.html', + }, + output: { + path: 'build', + publicPath: process.env.NODE_ENV === 'production' ? 'https://my-cdn.com' : '/' + } + }, +}); +``` + +In above example, we configured `./src/index.html` and `./src/about.html` as input, then output the compiled resources to `build` dir. + +### Dev Server Port + +```ts title="farm.config.ts" {5-7} +import { defineConfig } from "@farmfe/core"; + +export default defineConfig({ + server: { + port: 9801 + } +}); +``` + +### Disable Default Optimizations +```ts title="farm.config.ts" {5-7} +import { defineConfig } from "@farmfe/core"; + +export default defineConfig({ + // compile options + compilation: { + lazyCompilation: false, + persistentCache: false, + minify: false, + treeShake: false + }, +}); +``` + diff --git a/docs/docs/config/dev-server.md b/docs/docs/config/dev-server.md new file mode 100644 index 0000000000..813dea8c61 --- /dev/null +++ b/docs/docs/config/dev-server.md @@ -0,0 +1,184 @@ +# Dev Server Options + +## DevServer Options - server + +Configure the behavior of Farm Dev Server. Example: + +```ts +import { defineConfig } from "@farmfe/core"; + +export default defineConfig({ + // All dev server options are under server + server: { + port: 9000, + //... + }, +}); +``` + +type: + +```ts +export interface UserServerConfig { + headers?: OutgoingHttpHeaders | undefined; + port?: number; + https?: SecureServerOptions; + protocol?: 'http' | 'https'; + // http2?: boolean; + hmr?: boolean | HmrOptions; + proxy?: Record; + strictPort?: boolean; + open?: boolean; + host?: string | boolean; + cors?: boolean | cors.Options; + // whether to serve static assets in spa mode, default to true + spa?: boolean; + middlewares?: DevServerMiddleware[]; + writeToDisk?: boolean; +} +``` + +### port + +- **default**: `9000` + +The port the DevServer listens on. + +### https +- **default**: `undefined` + +Enable TLS + HTTP2. The value is [options](https://nodejs.org/api/http2.html#http2createsecureserveroptions-onrequesthandler) that passes to [http2.createSecureServer](https://nodejs.org/api/http2.html#http2createsecureserveroptions-onrequesthandler). + +:::note +Note that a **valid certificate** is needed if `https` enabled. +::: + +### headers +- **default**: `undefined` + +Setup global http response headers for the DevServer. + +```ts +import { defineConfig } from '@farmfe/core' + +export default defineConfig({ + server: { + headers: { + 'Accept': 'xxxx' + } + } +}) +``` + +### strictPort +- **default**: `false` + +By default, Farm will automatically resolve to a new port when given port is used. For example, if `9001` is used, then `9001` will be tried. But if `strictPort` is `true`, a error will be thrown when port conflicts, instead of try other ports automatically. + +### cors +- **default**: `false` + +Configure [@koa/cors options](https://www.npmjs.com/package/@koa/cors). + + +### spa +- **default**: `true` + +Enable fallback to `index.html` or not. + +### hmr + +- **default**: `true` for start command, false for other commands + +Enable HMR. After enabling the HMR capability, it will monitor the changes of the modules involved in the compilation process. When the modules change, it will automatically trigger recompilation and push the results to Farm Runtime for update. HMR can also be configured through an object, for example: + +```ts +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + // All dev server options are under server + server: { + hmr: { + // Configure the port for web socket listening + port: 9802 + // Configure the host for web socket listening + host: 'localhost', + // Files to ignore when configuring file monitoring + ignores: ['auto_generated/*'] + } + //... + } +}); +``` + +#### `hmr.port` + +- **default**: `9801` + +The port the Web Socket server listens on + +#### `hmr.host` + +- **default**: `localhost` + +Host on which the Web Socket server listens. + +### proxy + +- **Default value**: `undefined` + +Configure server proxy. farm uses `http-proxy` as a proxy for the development server. Based on [http-proxy](https://github.com/http-party/node-http-proxy?tab=readme-ov-file#options) implementation, specific options refer to its documentation, example: + +```ts +import { defineConfig } from "@farmfe/core"; + +export default defineConfig({ + server: { + proxy: { + "/api": { + target: "https://music-erkelost.vercel.app/banner", + changeOrigin: true, + pathRewrite: (path: any) => path.replace(/^\/api/, ""), + }, + }, + }, +}); +``` + +### open + +- **default**: `false` + +After the compilation is completed, the browser is automatically opened to the corresponding page. + +### host + +- **default**: `localhost` + +The host that the Dev Server listens on. + +### middlewares + +- **default**: `[]` + +Configuring middlewares for the dev server. + +```ts +import { defineConfig } from "@farmfe/core"; +import compression from 'koa-compress'; + +export default defineConfig({ + server: { + middlewares: [ + compression + ] + }, +}); +``` + +Note that a `middleware` is a function that returns a koa middleware. + +## writeToDisk +- **default**: `false` + +By default the compiled resources are stored and served in memory, set `writeToDisk` to `true` to emitted dev resources to the disk. diff --git a/docs/docs/config/shared.md b/docs/docs/config/shared.md new file mode 100644 index 0000000000..7c50e3b649 --- /dev/null +++ b/docs/docs/config/shared.md @@ -0,0 +1,80 @@ +# Shared Options + +Configure shared options for Both Farm's DevServer and Compiler. Example: + +```ts +import { defineConfig } from "@farmfe/core"; + +export default defineConfig({ + // All dev server options are under server + root: process.cwd(), +}); +``` + +Type: +```ts +export interface UserConfig { + /** current root of this project, default to current working directory */ + root?: string; + clearScreen?: boolean; + envDir?: string; + envPrefix?: string | string[]; + /** Files under this dir will always be treated as static assets. serve it in dev, and copy it to output.path when build */ + publicDir?: string; + /** js plugin(which is a javascript object) and rust plugin(which is string refer to a .farm file or a package) */ + plugins?: (RustPlugin | JsPlugin | JsPlugin[])[]; + /** vite plugins */ + vitePlugins?: (object | (() => { vitePlugin: any; filters: string[] }))[]; + // /** config related to compilation */ + // compilation?: Pick; + // /** config related to dev server */ + // server?: UserServerConfig; +} +``` +## root + +- **default**: `process.cwd()` + +Configure the root directory for project compilation. All relative paths are relative to `root` during compilation. + +## clearScreen +- **default**: `true` + +Whether to clear the screen when start to compile the project. + +## envDir +- **default**: `` + +Configuring the directory to load `.env`, `.env.development`, `.env.production` files. By default it's the same as root. + +```ts +import { defineConfig } from '@farmfe/core'; +import { resolve } from 'path'; +export default defineConfig({ + envPrefix: ['FARM_', 'CUSTOM_PREFIX_', 'NEW_'], + envDir: resolve(process.cwd(), './env'), +}); +``` +In above example, will load `.env`, `.env.development`, `.env.production` files from `/env` directory. + +## envPrefix +- **default**: `['FARM_', 'VITE_']` + +Env variables starts with `envPrefix` will be injected [`define`](/docs/config/compilation-options#define) automatically. + +## publicDir +- **default**: `public` + +Files under `publicDir` will always be treated as static assets. serve it in dev, and copy it to output.path when build. + +For example, you can add static assets like font to `public` dir and using them as `/xxx.ttf`. + +## plugins +- **default**: `[]` + +Configure Farm Plugins. See [Using Farm Plugins](/docs/using-plugins#farm-compilation-plugins) + +## vitePlugins +- **default**: `[]` + +Configure Vite/Rollup/Unplugin plugins. See [Using Vite Plugins](/docs/using-plugins#using-viterollupunplugin-plugins-in-farm) \ No newline at end of file diff --git a/docs/docs/contribution.mdx b/docs/docs/contribution.mdx new file mode 100644 index 0000000000..026d1d644d --- /dev/null +++ b/docs/docs/contribution.mdx @@ -0,0 +1,157 @@ +import { PackageManagerTabs } from '../src/theme/PackageManagerTabs'; + +# Contribution Guide + +Thank you for your interest in contributing to Farm! Farm is currently actively developing version 2.0. We will be introducing numerous new features, expanding ecosystem compatibility, and implementing various optimizations and updates to address current issues. Before submitting your contribution, please make sure to take a moment and read through the following guidelines. + +## Code of Conduct + +All contributors are expected to follow our [Code of Conduct](https://www.rust-lang.org/policies/code-of-conduct). + +## Bug reports + +As farm is currently in the process of rapid development iteration, some unexpected problems may be encountered in the process of development. + +We can't fix what we don't know about, so please report problems and unexpected behavior. + +You can open a new issue by following [new-issues](https://github.com/farm-fe/farm/issues/new/choose) and choosing one of the issue templates. + +## Feature requests + +Please feel free to open an issue using the [feature request template](https://github.com/farm-fe/farm/issues/new/choose). + +## Pull Request Guidelines + +- Please adhere to the code style that you see around the location you are working on. + +- Setup Your Development Environment. + +- Checkout a topic branch from a base branch, e.g. `main` . + +- Run `cargo test` and make sure that it passes. + +- If you've changed some packages And prepare for an updated version, you should output `npx changeset` in the root directory. we should try our best to keep releasing the `patch version`. If there are no major changes, please choose to update the `patch version`. + +- When you are done with your work, verify that it works locally with `pnpm run ready` + +## Setup + +### Branches + +- `main` -> Farm v1.x +- `v2-dev` -> Farm v2.0.0-nightly + +--- + +- Fork and clone the repo. + +- Create a branch for your PR with `git checkout -b your-branch-name`. + +- To keep `main` branch pointing to remote repository and make pull requests from branches on your fork. To do this, run: + + +- adds a new remote repository named "upstream" that points to the original repository +```bash + git remote add upstream https://github.com/farm-fe/farm.git +``` + +- retrieves all the branches and their respective commits from the upstream repository that you just configured +```bash + git fetch upstream +``` + +- sets up tracking between your local main branch and the main branch of the upstream repository +```bash + git branch --set-upstream-to=upstream/main main +``` + + +## Development Environment Setup + +### Dependencies + + + +- Install Rust using [rustup](https://www.rust-lang.org/tools/install). + +- [Node.js](https://nodejs.org) **version 16+** + +- [Pnpm](https://pnpm.io) **version 8+** + + +### IDE + +We recommend that you use vscode for development and recommend two necessary plugins that you need to install + +- `rust-analyzer` support rust language +- `biome` farm use biome as lint and format the code + +You can install them in the extension + +### Setup Other Dependencies + +- Install [protoc](https://grpc.io/docs/protoc-installation/) for building `sass-embedded`. + +**TIP:** When you run `pnpm bootstrap` and you use mac or linux systems, farm will automatically install protoc for you system + +## Start running + +Farm development is very simple. You only need to execute `pnpm bootstrap` in the root directory for development. + + + +- use `pnpm bootstrap` to install dependencies and build core packages with series of initialization operations. + +- Work with examples (open a new terminal): `cd examples/refactor-react && pnpm start`, report an issue if the example does not start normally. + +- If `examples/refactor-react` project runs successfully, the development environment has been configured successfully + +- If you changed Rust code in `crates`, run `npm run build:rs` under `packages/core` again to get the latest binary. + +When you are developing node side code, the root directory executes pnpm start to debug the code in real time, and when you are developing rust side code, the root directory executes pnpm start:rs to debug the code in real time. + + + + + +## Testing + +We also need to test two parts, a set of `Rust` tests and a set of `Node` tests. Make sure all the tests pass before you submit the code. + +### Rust Testing + +- Input `cargo test` in the root directory will run all the test cases. + +```sh +# root path or crates path +cargo test +``` + +### Node Testing + +- Input `pnpm test` in the root directory to run all test cases based on `vitest`. + +```sh +# root path +pnpm test +``` + +## Quickly create plugins through scaffold + +If you want to develop a plugin for farm, farm provides a scaffolding to help you quickly create a plugin, which you can create with the following command. +You can go to the `cd packages/ cli` directory, run `npm link` or global installation `@ farmfe/ cli` to use this CLI, after the installation is complete, You can create a plugin through `farm plugin create`. +Farm supports the creation of rust and js plugins. + +```bash +$ farm plugin create # create a plugin support js or rust +``` + +## Pull Request Preface Tip + +Farm is divided into two parts: the `JavaScript side` and the `Rust side`: + +- **the JavaScript side**: + see code in the `packages` directory. contains core (dev server, file watcher, and compiler wrapper), CLI, runtime, and runtime plugins (module system, HMR). + +- **the Rust side**: + see code in the `crates` and `rust-plugins` directory. contains core (compilation context, plugin drivers, etc.), compiler (compile process, HMR update, etc.), and plugins. diff --git a/docs/docs/features/_category_.json b/docs/docs/features/_category_.json new file mode 100644 index 0000000000..f64dcb8082 --- /dev/null +++ b/docs/docs/features/_category_.json @@ -0,0 +1,8 @@ +{ + "label": "Features", + "position": 3, + "link": { + "type": "generated-index", + "description": "Features supported by Farm" + } +} diff --git a/docs/docs/features/css.md b/docs/docs/features/css.md new file mode 100644 index 0000000000..842c5ef00c --- /dev/null +++ b/docs/docs/features/css.md @@ -0,0 +1,178 @@ +# Css/Sass/Less +Farm support Css out of box, just import the css file: + +```tsx +import './index.css'; +``` + +Then farm will auto enable HMR for css module, and generating bundled resources for css. + +## Css Modules +Farm support css modules out of box, the modules end with `.module.css|less|scss|sass` will be treated as css modules by default. + +```tsx title="comp.tsx" +import styles from './index.module.css' + +export function Comp() { + return
Main
+} +``` +```css title="index.module.css" +.main { + color: green; +} +``` +You can configuring css modules by [`css.modules`](/docs/config/compilation-options#cssmodules). for example you can set `css.modules.paths` to `['.css|sass|less|scss']` then all css files will be treated as css modules. + +## Css Pre-Processor +Farm provide official sass, less, postcss plugins to support css pre-processor. + +### Sass +Farm sass plugin is a Rust Plugin and use `sass-embeded`(we may migrate to [grass](https://github.com/connorskees/grass) in the future). + +Steps to compile `sass/scss` modules in Farm. +1. Install dependencies +```sh +# npm or yarn or pnpm, choose your favorite package manager +pnpm add -D @farmfe/plugin-sass +``` + +2. Configure the plugin +```ts +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + // ... + plugins: ['@farmfe/plugin-sass'] // to use a rust plugin, just configure its package name as a string + // if you want to specify options for plugin-sass, use + // plugins: [ + // ['@farmfe/plugin-sass', { sourceMap: false }] + // ] +}); +``` + +3. Import sass module +```ts +import './index.scss'; +``` + +To use sass with css modules, change the file name from `index.scss` to `index.module.scss`, see [css modules](/docs/config/farm-config#cssmodules). + +`@farmfe/plugin-sass` supports a lot of options, use the array syntax of `plugins` to specify options for plugin sass: + +```ts +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + // if you want to specify options for plugin-sass, use + plugins: [ + [ + '@farmfe/plugin-sass', + // all supported options as below + { + sourceMap: true // bool + sourceMapIncludeSources: true, // bool + alertAscii: true, // bool + alertColor: true, // bool + charset: true, // bool + quietDeps: true, // bool + verbose: false, // bool + style: 'expanded' | 'compressed' // output code style + } + ] + ] +}); +``` + + +### Less +Farm less plugin is a Js Plugin. Steps to compile `less` modules in Farm. + +1. Install dependencies +```sh +# npm or yarn or pnpm, choose your favorite package manager +pnpm add -D @farmfe/js-plugin-less +``` + +2. Configure the plugin +```ts +import { defineConfig } from '@farmfe/core'; +import less from '@farmfe/js-plugin-less'; + +export default defineConfig({ + // ... + plugins: [less()] // pass argument to the less function like `less({ /* your options */ })` to specify less options +}); +``` + +3. Import sass module +```ts +import './index.less'; +``` + +To use sass with css modules, change the file name from `index.less` to `index.module.less`, see [css modules](/docs/config/farm-config#cssmodules) + +### Postcss +The Farm postcss plugin is a JS plugin. The steps to introduce postcss in Farm are as follows: + +1. Install dependencies +```sh +# npm or yarn or pnpm, choose your favorite package manager +pnpm add -D @farmfe/js-plugin-postcss +``` + +2. Configure the plugin +```ts +import { defineConfig } from '@farmfe/core'; +import postcss from '@farmfe/js-plugin-postcss'; + +export default defineConfig({ + //... + plugins: [postcss()] // pass argument to the less function like `less({ /* your options */ })` to specify less options +}); +``` + +3. Configure `postcss.config.js` and import the required postcss plugins + +```js title=postcss.config.js +module.exports = { + plugins: [ + require('postcss-pxtorem')({ + rootValue: 16, + propList: ['*'], + }), + require('tailwindcss'), + ] +} +``` + +## Css Prefixer +Farm supports css prefixer out of box, you can configure it using `compilation.css.prefixer`. + +:::note +`css.prefix.targets` will be set automatically when [`output.targetEnv`](/docs/config/compilation-options#output-targetenv). Normally set [`output.targetEnv`](/docs/config/compilation-options#output-targetenv) would be enough. +::: + +```ts title="farm.config.ts" +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + compilation: { + css: { + prefix: { + targets: ['ie >= 10'] + } + }, + }, +}); +``` +Then for input code: +```css +div { + display: flex; +} +``` +output code: +```css +div{display:-ms-flexbox;display:flex} +``` diff --git a/docs/docs/features/dev-server.md b/docs/docs/features/dev-server.md new file mode 100644 index 0000000000..090bdf7066 --- /dev/null +++ b/docs/docs/features/dev-server.md @@ -0,0 +1,82 @@ +# DevServer and HMR +Farm provides `DevServer` and enabled `HMR` in `development` by default. + +## Configuring Dev Server +Farm provides a lot of useful options to configure dev server. All dev server options are configured by [`server`](/docs/config/dev-server). + +```ts +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + server: { + port: 9801, + cors: true, + proxy: { + // ... + }, + open: true, + } +}) +``` + +:::note +If you are built tools on top of farm, refer to [Javascript API](/docs/api/javascript-api) for creating a Dev Server programmatically. +::: + +## Dev Server Middlewares +You can use [`middlewares`](/docs/config/dev-server#middlewares) to handle dev server requests. For example: + +```ts title="farm.config.ts" +import { Middleware } from 'koa'; +import { Server, defineConfig } from '@farmfe/core'; + +export function headers(devSeverContext: Server): Middleware { + const { config } = devSeverContext; + if (!config.headers) return; + + return async (ctx, next) => { + if (config.headers) { + for (const name in config.headers) { + ctx.set(name, config.headers[name] as string | string[]); + } + } + await next(); + }; +} + +export default defineConfig({ + server: { + middlewares: [ + headers + ] + } +}) +``` + +In above example, a Farm middleware is a function that expose `Koa Middleware`. Common Koa middlewares can be used directly, for example: + +```ts {2,7} +import { defineConfig } from "@farmfe/core"; +import compression from 'koa-compress'; + +export default defineConfig({ + server: { + middlewares: [ + compression + ] + }, +}); +``` + +## Hot Module Replacement(HMR) +Farm provides a [Vite-compatible HMR API](/docs/api/hmr-api). If you are framework authors, leverage the API to update your Application instance, precise without reloading the page. + +* For React, **React Refresh** are enabled automatically by official plugins [@farmfe/plugin-react](/docs/plugins/official-plugins/react). +* For Vue, Solid and other frameworks, it's HMR are supported by there plugins like `@vitejs/plugin-vue`, `vite-plugin-solid` and so on. + +Farm provides official templates that set all these capabilities up already, create an app via [create-farm](/docs/quick-start) then all HMR abilities are ready. + +:::note +* Usually HMR is supported out of box for app users, refer to [Vite-compatible HMR API](/docs/api/hmr-api) if you are framework author. +* Refer to [HMR Options](/docs/config/dev-server#hmr) for how to configuring HMR. +::: diff --git a/docs/docs/features/env.md b/docs/docs/features/env.md new file mode 100644 index 0000000000..decd750b5c --- /dev/null +++ b/docs/docs/features/env.md @@ -0,0 +1,64 @@ +# Environment Variables and Modes + +`Farm` distinguishes between `development` and `production` environments through `process.env.NODE_ENV`. + +In different environments, environment variables are replaced statically, so use static constants to represent environment variables instead of dynamic expressions. + +## `.env` file + +`Farm` uses `dotenv` to load your additional environment variables, such as `.env` files. By default `.env` file are loaded from [`root`](/docs/config/shared#root), you can use [`envDir`](#envdir) to customize. + +```js +// .env +FARM_APP_SECRET=secret +Farm_APP_PASSWORD=password +APP_VERSION=1.0.0 +``` + +`Farm` loads the file `.env` via dotenv, and loads it into `process.env` and finally injects it into define. + +:::danger +In order to ensure the security of the client, preventing the environment variables in the current system from being exposed to the client `Farm` will only identify some important environment variables that start with `FARM_`、`VITE_` (In order to better compatible with vite and its ecological environment). +::: + +`Farm` expands environment variables through dotenv-expand. For development only envs use `.env.development`, for production only envs use `.env.production`, for custom mode passed by `--mode `, load from `.env.` file. + +* If you want to customize the directory to load `.env` file, you can configure [`envDir`](#envdir). +* If you want to customize the prefix of env variables which are injected to [`define`](/docs/config/compilation-options#define), you can configure [`envPrefix`](#envprefix). + + +## envPrefix + +- **default value**: `FARM_`、`VITE_` + +Customize the prefix of the `env` variable by configuring `envPrefix`. Env variables start with `envPrefix` will be injected into define automatically. For example, in the `.env` file: + +```js +// .env +FARM_CUSTOM_VERSION=1.0.0 +APP_VERSION=0.1.0 +``` +Then `FARM_CUSTOM_VERSION` will be injected, but not `APP_VERSION`, in your business code: + +```tsx +export function MyComp() { + const farmCustomVersion = FARM_CUSTOM_VERSION; + return
Farm Custom Version: {farmCustomVersion}
+} +``` +`FARM_CUSTOM_VERSION` will be replaced by `'1.0.0'` automatically. + + + +## envDir +- **default value**: `` + +The directory to load [`env file`](#env-file). By default Farm load `env file` from root. + +```ts +export defineConfig({ + envDir: './env' +}) +``` + +For above config example, Farm will load `.env`, `.env.development`, etc from `/env` dir. diff --git a/docs/docs/features/html.md b/docs/docs/features/html.md new file mode 100644 index 0000000000..cb0c91e209 --- /dev/null +++ b/docs/docs/features/html.md @@ -0,0 +1,114 @@ +--- +sidebar_position: 1 +--- + +# Html + +## Basic Usage + +Farm support compile Html out of box, **and you should use Html as entry when build a web project**, for example: + +```ts title="farm.config.ts" +import type { defineConfig } from "@farmfe/core"; + +export default defineConfig({ + input: { + index: "./index.html", // using ./index.html as entry + }, +}); +``` + +:::note +If the input is not specified, default to `{ index: 'index.html' }`. +::: + +and in `./index.html`, a ` + + +``` + +and you can also use `` to refer to your global css. + +Farm will transform these `scripts` and `links` to final production resources when compiling. Note that you have to use `relative path` when you want to refer to a local module, for example `` will refer to a local module and compile it, but `` or `` would not. + +:::tip +The `script` and `link` can refer to any module types that farm support, for example, `js`, `jsx`, `ts`, `tsx`, or other module types supported by plugins. You can use as many `scripts` or `links` as you want. +::: + +## Multi Page App + +If you are building a Multi Page Application, just configure multiple html input, for example: + +```ts title="farm.config.ts" +import { defineConfig } from "@farmfe/core"; + +export default defineConfig({ + compilation: { + input: { + home: "./index.html", // Home Page + about: "./about.html", // About Page + // ... more pages + }, + }, +}); +``` + +Farm will compile these pages in parallel, and all dependencies of these pages will be shared too. + +## Inherit html template + +Farm supports inherit html template by using `html.base` config, which is helpful when building a multi-page application with html shared. + +```ts title="farm.config.ts" +import { defineConfig } from "@farmfe/core"; + +export default defineConfig({ + // ... + compilation: { + input: { + home: "./index.html", // Home Page + about: "./about.html", // About Page + // ... more pages + }, + // c-highlight-start + html: { + base: "./base.html", + }, + // c-highlight-end + }, +}); +``` + +Then add a `base.html`, placeholder `{{children}}` will be replaced by children's content. + +```html title="./base.html" + + + + + + + Document + + +
+ + {{children}} + + +``` + +Inherit `./base.html`: + +```html title="./src/home.html" + + +``` diff --git a/docs/docs/features/lazy-compilation.md b/docs/docs/features/lazy-compilation.md new file mode 100644 index 0000000000..5c7752e158 --- /dev/null +++ b/docs/docs/features/lazy-compilation.md @@ -0,0 +1,58 @@ +# Lazy Compilation +When comes to a big project, you may want to split them into small pieces and load on demand. This can be achieved by dynamic imports. + +```js +const page = React.lazy(() => import('./page')); // lazy load page +``` + +By default, Farm will lazy compile these dynamic imports in development, only compile them when the module is really executed. Lazy compilation can really speedup the compiling of a large project. + +:::note +Lazy Compilation are always disabled for production build. +::: + +Note that it is important to use the `dynamic import` properly to make `lazy compilation` work better. For example, if one of your page has a big dependencies, but this dependencies won't be used until this page rendered, then it is necessary to make sure that this big dependencies are dynamic imported, so it won't be compiled util the page rendered. + +## Configuring Lazy Compilation +Using `compilation.lazyCompilation` to enable or disable it: +```ts title="farm.config.ts" +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + compilation: { + lazyCompilation: true, + }, +}); +``` + +## How Lazy Compilation Work +When lazy compilation is enabled, Farm will analyze all of your `dynamic import` first, for example: + +```js +const page = React.lazy(() => import('./page')); +``` +Farm will treat `./page` as a module that should be lazy compiled and won't compile it, instead, Farm will return a virtual placeholder module for `./page` like: +```ts +// ... other actions +const compilingModules = FarmModuleSystem.compilingModules; +// return a promise, this promise will be resolved when lazy compilation finished. +let promise = Promise.resolve(); + +// it has lazy been lazy compiling +if (compilingModules.has(modulePath)) { + promise = promise.then(() => compilingModules.get(modulePath)); +} else { + // request the dev server for lazy compilation + const url = '/__lazy_compile?paths=' + paths.join(',') + `&t=${Date.now()}`; + promise = import(url).then((module: any) => { + const result: LazyCompileResult = module.default; + // ... + }); + // ... more actions +} + +export const __farm_async = true; +export default promise; +``` + +Above example illustrated a basic structure of that virtual placeholder module. When the placeholder executed, it will request the dev server to compile this module and its dependencies. After getting the lazy compiled result from dev server, the placeholder module will patch these changes to Farm's runtime module system. \ No newline at end of file diff --git a/docs/docs/features/script.md b/docs/docs/features/script.md new file mode 100644 index 0000000000..67a1a65a0f --- /dev/null +++ b/docs/docs/features/script.md @@ -0,0 +1,198 @@ +# TS/TSX +Farm support compiling `Js/Jsx/Ts/Tsx` out of box, and compile `Jsx/Tsx` to React by default. + +```tsx title="./button.tsx" +import Button from "./Button"; + +function ButtonGroup(props: ButtonProps) { + return ( +
+ {props.buttons.map((b) => ( + + ))} +
+ ); +} +``` + +Farm using SWC to compile scripts, and Farm has set reasonable default configurations for script compilation. Also, you can use `compilation.script` to configure how to compile your script file. see [compilation.script](/docs/config/compilation-options#script) for details. + +## Configuring Swc Parser + +You can configuring the SWC Parser through `compilation.script.parser`. Refer to https://swc.rs/docs/configuration/compilation#jscparser. + +For example, if you want to enable decorator, you can set `compilation.script.parser.esConfig.decorators`(or `tsConfig.decorators` if the module is TS): + +```ts title="farm.config.ts" +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + compilation: { + script: { + // for .js/.jsx files + esConfig: { + decorators: true, + }, + // for .ts/.tsx files + tsConfig: { + decorators: true, + }, + }, + }, +}); +``` + +By default Farm set `jsx: true` for `.jsx|.tsx` files. Other field are default to SWC's defaults. + +## Configuring Target + +Using `compilation.script.target` to configure your target env when running your project, Farm set it based on [`output.targetEnv`](/docs/config/compilation-options#output-targetenv). +:::note +Farm set `compilation.script.target` automatically based on [`output.targetEnv`](/docs/config/compilation-options#output-targetenv). Normally you should not set `target` manually, use [`output.targetEnv`](/docs/config/compilation-options#output-targetenv) would be enough. +::: + +This option can be used along with `compilation.presetEnv` to gracefully downgrade your project for old browsers. For example, you can set target to `ES5` and enable `presetEnv`, then your project will be fully downgrade to ES5. + +```ts title="farm.config.ts" +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + compilation: { + script: { + target: "ES5", + }, + presetEnv: true, + }, +}); +``` + +Refer to [Syntax Downgrade and Polyfill](/docs/advanced/polyfill) for more about `presetEnv` and `target`. + + +## Decorators + +Decorators is disabled by default, you can set `compilation.script.parser.tsConfig.decorators` to `true` to enable decorators. + +```ts +import { defineConfig } from "@farmfe/core"; + +export default defineConfig({ + compilation: { + script: { + parser: { + tsConfig: { + // support decorators + decorators: true, + }, + }, + // configuring decorators + decorators: { + legacyDecorator: true, + decoratorMetadata: false, + decoratorVersion: '2021-12', + includes: ["src/broken.ts"], + excludes: ['node_modules/'], + } + }, + }, +}); +``` + +> Farm provide a example for supporting decorators, see https://github.com/farm-fe/farm/tree/main/examples/decorators +> By default, Farm won't transform decorators for modules under `node_modules`, refer to [compilation.script.decorators.excludes](/docs/config/compilation-options#scriptdecorators). + + +## Using SWC Plugins + +SWC Plugins can be used directly in Farm, for example, we use `swc-plugin-vue-jsx` to compiling vue jsx in Farm: + +```ts title="farm.config.ts" +import { defineConfig } from '@farmfe/core'; +import jsPluginVue from "@farmfe/js-plugin-vue"; + +export default defineConfig({ + compilation: { + script: { + plugins: [ + { + name: "swc-plugin-vue-jsx", + options: { + transformOn: true, + optimize: true, + }, + filters: { + // resolvedPaths: [".+"] + moduleTypes: ["tsx", "jsx"], + }, + }, + ], + }, + }, + plugins: [jsPluginVue()], +}); +``` + +Refer to [Using Plugins](/docs/using-plugins#using-swc-plugins) for more details. + +## Vite-style `import.meta.glob` + +Farm fully support Vite-style `import.meta.glob`, see [glob import](https://vitejs.dev/guide/features.html#glob-import). + +for example: + +```ts +const modules = import.meta.glob("./dir/*.js"); +``` + +The above will be transformed into the following: + +```ts +// code produced by Farm +const modules = { + "./dir/foo.js": () => import("./dir/foo.js"), + "./dir/bar.js": () => import("./dir/bar.js"), +}; +``` + +Using `{ eager: true }`: + +```ts +const modules = import.meta.glob("./dir/*.js", { eager: true }); +``` + +The above will be transformed into the following: + +```ts +// code produced by Farm +import * as __glob__0_0 from "./dir/foo.js"; +import * as __glob__0_1 from "./dir/bar.js"; +const modules = { + "./dir/foo.js": __glob__0_0, + "./dir/bar.js": __glob__0_1, +}; +``` + +multiple patterns are supported: + +```ts +const modules = import.meta.glob(["./dir/*.js", "./another/*.js"]); +``` + +negative patterns are also supported: + +```ts +const modules = import.meta.glob(["./dir/*.js", "!**/bar.js"]); +``` + +```ts +// code produced by Farm +const modules = { + "./dir/foo.js": () => import("./dir/foo.js"), +}; +``` + +:::note + +- You should also be aware that all the arguments in the import.meta.glob must be passed as literals. You can NOT use variables or expressions in them. +- `import.meta.glob` transformed by Farm in compile time, it does not exist in runtime. + ::: diff --git a/docs/docs/features/sourcemap.md b/docs/docs/features/sourcemap.md new file mode 100644 index 0000000000..589f0c26c7 --- /dev/null +++ b/docs/docs/features/sourcemap.md @@ -0,0 +1,26 @@ +# Source Map +Farm supports `Source Map`, which is automatically enabled by default. Sourcemap can be `enable` or `disable` via the [`compilation.sourcemap`](/docs/config/compilation-options#sourcemap) option. + +:::note +Farm will not generate sourcemap for files under `node_modules` by default, if you want to generate sourcemap for files under node_modules, configure `compilation.sourcemap` to `all`. +::: + +Using `compilation.sourcemap` to configuring sourcemap generation: +```ts title="farm.config.ts" +export default { + compilation: { + sourcemap: 'all', // generate sourcemap for modules under node_modules + }, +}; +``` + +All options are as below: +* **`true`**: Only generate sourcemap for files not under `node_modules`, and generate a **separate sourcemap file** +* **`false`**: disable sourcemap +* **`inline`**: Only generate sourcemap for files not under `node_modules`, and inline sourcemap into the product, do not generate a separate file +* **`all`**: generate sourcemap for all files, and generate a separate sourcemap file +* **`all-inline`**: Generate source maps for all files, and inline source maps into the product, do not generate separate files + +:::note +For plugin authors, if you transform the code in [`transform hook`](/docs/api/rust-plugin-api#transform) or [`renderResourcePot hook`](/docs/api/rust-plugin-api#render_resource_pot), you should return the source map of your transformation to ensure source map is correct. Farm maintains a **source map chain** of plugins to trace the final resources back to the real original code. +::: \ No newline at end of file diff --git a/docs/docs/features/static.md b/docs/docs/features/static.md new file mode 100644 index 0000000000..bbe34fd74e --- /dev/null +++ b/docs/docs/features/static.md @@ -0,0 +1,59 @@ +# Static Assets + +Farm treat modules that is not treated as `code` as `Static Assets`, for example, images like `png/svg/etc`, text files like `txt/xlsx/etc`. This document describes how Farm deal with these assets. + +## url +Import a image: +```jsx +import rocketUrl from './assets/rocket.svg'; // return the url of this image + +export function Main() { + return // using the url +} +``` +Default to use url method when import a image. When using url methods to import a image, the image will be emitted to the output dir directly, and the image module itself will be compiled to a js module like: + +```js +export default '/rocket..svg' +``` +using [`compilation.output.assetFilename`](/docs/config/compilation-options#outputassetsfilename) to config your asset name。 + +## inline +Using query `?inline` to tell Farm that you want to inline your assets,then the assets will be transformed to base64,for example: + +```js +// importer +import logo from './assets/logo.png?inline'; // logo is a base 64 str + +// the image module will be compiled to: +export default 'data:image/png,base64,xxxxx=='; +``` + +## raw +Using query `?raw` to tell Farm that you want to read the raw string of the assets, for example +```js +// import +import logo from './assets/license.txt?raw'; // return the content string of the assets + +// the txt file will be compiled to: +export default 'MIT xxxx'; +``` + +## Configuring Assets +* Using [`compilation.output.assetFileName`](/docs/config/compilation-options#outputassetsfilename) to control the production file name +* using [`compilation.assets.include`](/docs/config/compilation-options#assetsinclude) to treat more kind of files as asset modules. + +```js +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + compilation: { + output: { + assetsFilename: 'assets/[resourceName].[hash].[ext]', // [] is a placeholder, Farm currently only these three kind of placeholders + }, + assets: { + include: ['txt'] // extra static asset extension + } + } +}); +``` diff --git a/docs/docs/frameworks/electron.mdx b/docs/docs/frameworks/electron.mdx new file mode 100644 index 0000000000..788ae1ece5 --- /dev/null +++ b/docs/docs/frameworks/electron.mdx @@ -0,0 +1,52 @@ +import { PackageManagerTabs } from "../../src/theme/PackageManagerTabs"; + +# Electron + +Create a `Electron` project based on `Farm`. + +`Farm` provides two approaches to support creating `Electron` projects: +- Use the `create-farm` scaffold to create a scaffold project +- You can manually create a `Electron` project following the current documentation + +### Creating a Electron Project + + + + +Select `Electron` template in `Select Framework` + +After selecting `Electron`, you can continue to select all sub templates already supported by `Farm` + +```ts +- React +- Vue +- Preact +- Svelte +- Solid +``` + +You can choose the framework you want to use to run on electron, farm wrote electron js plugin + +such as react template + +```ts +import { defineConfig } from '@farmfe/core'; +import electron from '@farmfe/js-plugin-electron'; + +export default defineConfig({ + plugins: [ + '@farmfe/plugin-react', + electron({ + main: { + input: 'electron/main.ts', + }, + preload: { + input: 'electron/preload.ts', + }, + }), + ] +}); + +``` + +For more example details: [Electron Example](https://github.com/farm-fe/farm/tree/main/examples/electron) diff --git a/docs/docs/frameworks/lit.mdx b/docs/docs/frameworks/lit.mdx new file mode 100644 index 0000000000..721c7f4a06 --- /dev/null +++ b/docs/docs/frameworks/lit.mdx @@ -0,0 +1,43 @@ +import { PackageManagerTabs } from "../../src/theme/PackageManagerTabs"; + +# Lit + +Create a `Lit` project based on `Farm`. + +`Farm` provides two approaches to support creating `Lit` projects: +- Use the `create-farm` scaffold to create a scaffold project +- You can manually create a `Lit` project following the current documentation + +### Creating a Lit Project + + + + +Select `Lit` template in `Select Framework` + +If you use lit then we need to configure the decorator + +```javascript title="farm.config.ts" +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + compilation: { + presetEnv: false, + script: { + plugins: [], + target: 'es2022', + parser: { + tsConfig: { + decorators: true, + dts: false, + noEarlyErrors: false, + tsx: false + } + } + } + } +}); + +``` + +For more example details: [React Example](https://github.com/farm-fe/farm/tree/main/examples/Lit) diff --git a/docs/docs/frameworks/nestjs.mdx b/docs/docs/frameworks/nestjs.mdx new file mode 100644 index 0000000000..19a9c220c9 --- /dev/null +++ b/docs/docs/frameworks/nestjs.mdx @@ -0,0 +1,26 @@ +import { PackageManagerTabs } from "../../src/theme/PackageManagerTabs"; + +# NestJs + +Create a `NestJs` project based on `Farm`. + +`Farm` provides two approaches to support creating `NestJs` projects: +- Use the `create-farm` scaffold to create a scaffold project +- You can manually create a `NestJs` project following the current documentation + +### Creating a NestJs Project + + + +Select `NestJs` template in `Select Framework` + +The nestjs project uses [farmup](https://github.com/farm-fe/farmup) to start and build the project. [Farmup](https://github.com/farm-fe/farmup) is built based on farm to simplify the way you run ts files in node js. + +After downloading the template, run pnpm dev to start the nestjs project + + + + +Start enjoying the development experience of millisecond builds + +For more example details: [React Example](https://github.com/farm-fe/farm/tree/main/examples/react) diff --git a/docs/docs/frameworks/preact.mdx b/docs/docs/frameworks/preact.mdx new file mode 100644 index 0000000000..492d83e2da --- /dev/null +++ b/docs/docs/frameworks/preact.mdx @@ -0,0 +1,42 @@ +import { PackageManagerTabs } from "../../src/theme/PackageManagerTabs"; + +# Preact + +Create a `Preact` project based on `Farm`. + +`Farm` provides two approaches to support creating `Preact` projects: +- Use the `create-farm` scaffold to create a scaffold project +- You can manually create a `Preact` project following the current documentation + +### Creating a Preact Project + + + +Select `Preact` template in `Select Framework` + +:::warning Preact +For `Preact` support, `Farm` recommends using `Vite` plugins. +::: + +```javascript title="farm.config.ts" +import { defineConfig } from '@farmfe/core'; +import Preact from "vite-plugin-preact"; + +export default defineConfig({ + plugins: [Preact()], +}); +``` + +If you want to start DevServer + + + +If you need to run the build production environment product command + + + +If you need to preview your build product + + + +For more example details: [Preact Example](https://github.com/farm-fe/farm/tree/main/examples/preact) diff --git a/docs/docs/frameworks/react.mdx b/docs/docs/frameworks/react.mdx new file mode 100644 index 0000000000..fd25aef330 --- /dev/null +++ b/docs/docs/frameworks/react.mdx @@ -0,0 +1,118 @@ +import { PackageManagerTabs } from "../../src/theme/PackageManagerTabs"; + +# React + +Create a `React` project based on `Farm`. + +`Farm` provides two approaches to support creating `React` projects: +- Use the `create-farm` scaffold to create a scaffold project +- You can manually create a `React` project following the current documentation + +### Creating a React Project + + + +Select `React` template in `Select Framework` + +`Farm` requires the registration of the `@farmfe/plugin-react` plugin to support `React` projects. + +```javascript title="farm.config.ts" +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + plugins: ['@farmfe/plugin-react'], +}); +``` + +The `@farmfe/plugin-react` plugin is written in `Rust`, so you do not need to explicitly import it; you can register it by passing a string package name. + +### Integrating emotion +You can support `emotion` by registering the `@swc/plugin-emotion` plugin. + + +```javascript title="farm.config.ts" +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + compilation: { + script: { + plugins: [ + { + name: '@swc/plugin-emotion', + options: {}, + filters: { + moduleTypes: ['tsx'], + }, + }, + ], + }, + }, + plugins: [['@farmfe/plugin-react', { "importSource": "@emotion/react" }]], +}); + +``` + +```javascript title="src/index.tsx" +import { css } from '@emotion/react'; + +const color = 'white'; + +export function Main() { + return ( +
setCount((c) => c + 1)} + css={css` + padding: 32px; + background-color: hotpink; + font-size: 24px; + border-radius: 4px; + &:hover { + color: ${color}; + } + `} + > + {a}: {count} +
+ ); +} +``` + + +### Integrating svgr +`SVGR` is a tool for transforming svgs into React components. Farm offers a Js plugin to support SVGR. + +```javascript title="farm.config.ts" +import { defineConfig } from '@farmfe/core'; +import farmJsPluginSvgr from '@farmfe/js-plugin-svgr'; + +export default defineConfig(async (env) => { + return { + plugins: [ + [ + '@farmfe/plugin-react', + { + refresh: process.env.NODE_ENV === 'development', + development: process.env.NODE_ENV === 'development' + } + ], + farmJsPluginSvgr() + ] + }; +}); + + +``` + +If you want to start DevServer + + + +If you need to run the build production environment product command + + + +If you need to preview your build product + + + +For more example details: [React Example](https://github.com/farm-fe/farm/tree/main/examples/react) diff --git a/docs/docs/frameworks/solid.mdx b/docs/docs/frameworks/solid.mdx new file mode 100644 index 0000000000..6d66117799 --- /dev/null +++ b/docs/docs/frameworks/solid.mdx @@ -0,0 +1,46 @@ +import { PackageManagerTabs } from "../../src/theme/PackageManagerTabs"; + +# Solid + +Create a `Solid` project based on `Farm`. + +`Farm` provides two approaches to support creating `Solid` projects: +- Use the `create-farm` scaffold to create a scaffold project +- You can manually create a `Solid` project following the current documentation + +### Creating a Solid Project + + + +Select `Solid` template in `Select Framework` + +:::warning Solid +For `Solid` support, `Farm` recommends using `Vite` plugins. +::: + +```javascript title="farm.config.ts" +import { defineConfig } from '@farmfe/core'; +import solid from 'vite-plugin-solid'; + +export default defineConfig({ + vitePlugins: [ + () => ({ + vitePlugin: solid(), + filters: ['\\.tsx$', '\\.jsx$'] + }) + ] +}); +``` +If you want to start DevServer + + + +If you need to run the build production environment product command + + + +If you need to preview your build product + + + +For more example details: [Solid Example](https://github.com/farm-fe/farm/tree/main/examples/vite-adapter-solid) diff --git a/docs/docs/frameworks/svelte.mdx b/docs/docs/frameworks/svelte.mdx new file mode 100644 index 0000000000..cd617efd48 --- /dev/null +++ b/docs/docs/frameworks/svelte.mdx @@ -0,0 +1,50 @@ +import { PackageManagerTabs } from "../../src/theme/PackageManagerTabs"; + +# Svelte + +Create a `Svelte` project based on `Farm`. + +`Farm` provides two approaches to support creating `Svelte` projects: +- Use the `create-farm` scaffold to create a scaffold project +- You can manually create a `Svelte` project following the current documentation + +### Creating a Svelte Project + + + +Select `Svelte` template in `Select Framework` + +:::warning Svelte +For `Svelte` support, `Farm` recommends using `Vite` plugins. +::: + +```javascript title="farm.config.ts" +import { defineConfig } from '@farmfe/core' +import { svelte } from '@sveltejs/vite-plugin-svelte' + +export default defineConfig({ + vitePlugins: [svelte()], +}) + +``` + +```javascript title="svelte.config.ts" +import { vitePreprocess } from '@sveltejs/vite-plugin-svelte' + +export default { + preprocess: vitePreprocess(), +} +``` +If you want to start DevServer + + + +If you need to run the build production environment product command + + + +If you need to preview your build product + + + +For more example details: [Svelte Example](https://github.com/farm-fe/farm/tree/main/examples/vite-adapter-svelte) diff --git a/docs/docs/frameworks/tauri.mdx b/docs/docs/frameworks/tauri.mdx new file mode 100644 index 0000000000..604e5fd154 --- /dev/null +++ b/docs/docs/frameworks/tauri.mdx @@ -0,0 +1,40 @@ +import { PackageManagerTabs } from "../../src/theme/PackageManagerTabs"; + +# Tauri + +Create a `Tauri` project based on `Farm`. + +`Farm` provides two approaches to support creating `Tauri` projects: +- Use the `create-farm` scaffold to create a scaffold project +- You can manually create a `Tauri` project following the current documentation + +### Creating a Tauri Project + + + + +Select `Tauri` template in `Select Framework` + +1. project name + +2. choose sub template + +In your terminal, cd into the new Tauri project folder. + +Update the file with the following content: + +```ts +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + plugins: ['@farmfe/plugin-react'], + server: { + port: 1420 + } +}); + +``` + +then run `pnpm tauri dev` + +For more example details: [React Example](https://github.com/farm-fe/farm/tree/main/examples/Tauri) diff --git a/docs/docs/frameworks/vanilla.mdx b/docs/docs/frameworks/vanilla.mdx new file mode 100644 index 0000000000..047820362b --- /dev/null +++ b/docs/docs/frameworks/vanilla.mdx @@ -0,0 +1,30 @@ +import { PackageManagerTabs } from "../../src/theme/PackageManagerTabs"; + +# Vanilla + +Create a `Vanilla` project based on `Farm`. + +`Farm` provides two approaches to support creating `Vanilla` projects: +- Use the `create-farm` scaffold to create a scaffold project +- You can manually create a `Vanilla` project following the current documentation + +### Creating a Vanilla Project + + + + +Select `Vanilla` template in `Select Framework` + +Using the vanilla template you do not need to install any other framework dependencies, just run dev to start devServer + + + +If you need to run the build production environment product command + + + +If you need to preview your build product + + + +For more example details: [React Example](https://github.com/farm-fe/farm/tree/main/crates/create-farm-rs/template/vanilla) diff --git a/docs/docs/frameworks/vue.mdx b/docs/docs/frameworks/vue.mdx new file mode 100644 index 0000000000..e6264c5981 --- /dev/null +++ b/docs/docs/frameworks/vue.mdx @@ -0,0 +1,54 @@ +import { PackageManagerTabs } from "../../src/theme/PackageManagerTabs"; + +# Vue + +Create a `Vue` project based on `Farm`. + +`Farm` provides two approaches to support creating `Vue` projects: +- Use the `create-farm` scaffold to create a scaffold project +- You can manually create a `Vue` project following the current documentation + +### Creating a Vue Project + + + +Select `Vue` template in `Select Framework` + +:::warning +Currently, `Farm` uses `Vite` plugins for both `vue2` and `vue3` and `vue2.7` compilation. Also the development of Rust Vue plugin [fervid](https://github.com/phoenix-ru/fervid) is also underway. +::: + +```javascript title="farm.config.ts" +import { defineConfig } from '@farmfe/core'; +import Vue from '@vitejs/plugin-vue' + +export default defineConfig({ + vitePlugins: [Vue()], +}); +``` + +### Integrating jsx + +```javascript title="farm.config.ts" +import { defineConfig } from '@farmfe/core'; +import VueJsx from '@vitejs/plugin-vue-jsx' + +export default defineConfig({ + vitePlugins: [VueJsx()], +}); +``` + + +If you want to start DevServer + + + +If you need to run the build production environment product command + + + +If you need to preview your build product + + + +For more example details: [Vue Example](https://github.com/farm-fe/farm/tree/main/examples/vite-adapter-vue) diff --git a/docs/docs/migration/from-vite.md b/docs/docs/migration/from-vite.md new file mode 100644 index 0000000000..1cbec69a64 --- /dev/null +++ b/docs/docs/migration/from-vite.md @@ -0,0 +1,15 @@ +# Migrate From Vite +:::note +Vite plugins like `unocss` are deeply integrated with `Vite`, these plugins may not be compatible with Farm due to the difference of internal design. You can try other method like `unocss postcss plugin` as walk-around. +::: + +Migrating from Vite is really simple as Farm is Vite-compatible. All you need to do is transforming `vite.config.ts` to `farm.config.ts`: +* Refer to [Configuring Farm](/docs/config/configuring-farm) for mapping farm config options to vite config options. +* For `Vite Plugins`, move `plugins` in `vite.config.ts` to `vitePlugins` in `farm.config.ts`. + +Note that: +* Some Vite config options is not needed in Farm, like `optimizeDeps`, you can ignore these options when migrating to Farm. +* For SSR, you need to refactor it to [Farm SSR](/docs/advanced/ssr) + + +We have migrated a [Real Vite Admin Project](https://github.com/farm-fe/farm-soybean-admin) to Farm. Check this migration example for details. diff --git a/docs/docs/plugins/community-plugins.md b/docs/docs/plugins/community-plugins.md new file mode 100644 index 0000000000..cf09f876dc --- /dev/null +++ b/docs/docs/plugins/community-plugins.md @@ -0,0 +1,94 @@ +# Community Plugins + +## Vite/Rollup Plugins + +Farm support `Vite/Rollup` plugins out of box. So `Vite/Rollup` or `unplugin` plugins can be used in Farm directly. + +:::tip +Farm recommends to write Farm Plugins instead of `Vite/Rollup` plugins for Farm. Because Farm Plugins have the best compatibility and performance. Still, PR welcome if you developed a Farm compatible plugin and you want to list it here. +::: + +using `vitePlugins` in `farm.config.ts` to configure `Vite/Rollup` plugins. + +```ts +import { UserConfig } from "@farmfe/core"; +import vue from "@vitejs/plugin-vue"; +import vueJsx from "@vitejs/plugin-vue-jsx"; + +const config: UserConfig = { + vitePlugins: [vue(), vueJsx()], +}; +``` + +- **[`@vitejs/plugin-vue`](https://github.com/vitejs/vite-plugin-vue/blob/main/packages/plugin-vue/README.md)**: Vue support. +- **[`@vitejs/plugin-vue-jsx`](https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue-jsx)**: Vue Jsx/Tsx support. +- **[`vite-plugin-solid`](https://www.npmjs.com/package/vite-plugin-solid)**: Solid support for Farm. +- **[`vite-plugin-mock`](https://www.npmjs.com/package/vite-plugin-solid)**: Mock data in both dev and prod. +- ... + +## unplugin + +:::note +Currently you can use `unplugin/farm`, `unplugin/vite` and `unplugin/rollup` in Farm. If you are using `unplugin/vite` or `unplugin/rollup`, some attributes may not have been fully adapted, or the Farm team believes that the api does not have the adaptation conditions, you can provide [issues](https://github.com/farm-fe/farm/issues/new/choose). +::: + +```ts +import Icons from "unplugin-icons/vite"; +import IconsResolver from "unplugin-icons/resolver"; +import Components from "unplugin-vue-components/rollup"; +import { NaiveUiResolver } from "unplugin-vue-components/resolvers"; +import { FileSystemIconLoader } from "unplugin-icons/loaders"; + +const config: UserConfig = { + vitePlugins: [ + Icons({ + compiler: "vue3", + customCollections: { + [collectionName]: FileSystemIconLoader(localIconPath, (svg) => + svg.replace(/^ + +## Usage + +Create a `farm.config.js` [configuration file](https://www.farmfe.org/docs/config/configuring-farm) and import the plugin: + +```js +import { defineConfig } from '@farmfe/core'; +import dsv from '@farmfe/plugin-dsv'; + +export default defineConfig({ + plugins: [ + [ + dsv() + ] + ], +}); +``` + +## Practical Example + +Suppose that you have a CSV (or TSV!) file which contains some information on delicious fruits: + +```csv +type,count +apples,7 +pears,4 +bananas,5 +``` + +And suppose you'd like to import that CSV as an `Array` within some part of your code. After adding the plugin (as shown above), you may `import` (or `require`) the CSV file directly. The import will provide an `Array` of `Objects` representing rows from the CSV file: + +```js +import fruit from './fruit.csv'; + +console.log(fruit); +// [ +// { type: 'apples', count: '7' }, +// { type: 'pears', count: '4' }, +// { type: 'bananas', count: '5' } +// ] +``` diff --git a/docs/docs/plugins/official-plugins/js-dts.mdx b/docs/docs/plugins/official-plugins/js-dts.mdx new file mode 100644 index 0000000000..468f98d868 --- /dev/null +++ b/docs/docs/plugins/official-plugins/js-dts.mdx @@ -0,0 +1,108 @@ +import CodeBlock from "@theme/CodeBlock"; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# @farmfe/js-plugin-dts +Support `Generate .d.ts files` for Farm. This plugin is used for building tools and libraries, generate `.d.ts` for your typescript code. + +## Installation + + + + npm install @farmfe/js-plugin-dts + + + yarn add @farmfe/js-plugin-dts + + + pnpm add @farmfe/js-plugin-dts + + + +## Usage +```ts {2,6} +import { UserConfig } from '@farmfe/core'; +import farmJsPluginDts from '@farmfe/js-plugin-dts'; + +const config: UserConfig = { + plugins: [ + farmJsPluginDts({ /* options */ }) + ] +} +``` + +## Options +```ts +import type { ts, Diagnostic } from 'ts-morph'; + +export interface DtsPluginOptions { + /** + * Depends on the root directory + */ + root?: string; + + /** + * Declaration files output directory + */ + outputDir?: string | string[]; + + /** + * set the root path of the entry files + */ + entryRoot?: string; + + /** + * Project init compilerOptions using by ts-morph + */ + compilerOptions?: ts.CompilerOptions | null; + + /** + * Project init tsconfig.json file path by ts-morph + */ + tsConfigPath?: string; + + /** + * set include glob + */ + include?: string | string[]; + + /** + * set exclude glob + */ + exclude?: string | string[]; + + /** + * Whether copy .d.ts source files into outputDir + * + * @default false + */ + copyDtsFiles?: boolean; + + /** + * Whether emit nothing when has any diagnostic + * + * @default false + */ + noEmitOnError?: boolean; + + /** + * Whether skip typescript diagnostics + * + * @default true + */ + skipDiagnostics?: boolean; + + /** + * Customize typescript lib folder path + * + * @default undefined + */ + libFolderPath?: string; + + /** + * According to the length to judge whether there is any type error + */ + afterDiagnostic?: (diagnostics: Diagnostic[]) => void | Promise; +} + +``` diff --git a/docs/docs/plugins/official-plugins/js-less.mdx b/docs/docs/plugins/official-plugins/js-less.mdx new file mode 100644 index 0000000000..35053e81cb --- /dev/null +++ b/docs/docs/plugins/official-plugins/js-less.mdx @@ -0,0 +1,156 @@ +import CodeBlock from "@theme/CodeBlock"; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# @farmfe/js-plugin-less +Support `less` for Farm. + +## Installation + + + + npm install @farmfe/js-plugin-less less + + + yarn add @farmfe/js-plugin-less less + + + pnpm add @farmfe/js-plugin-less less + + + +## Usage +```ts {2,6} +import { UserConfig } from '@farmfe/core'; +import farmJsPluginLess from '@farmfe/js-plugin-less'; + +const config: UserConfig = { + plugins: [ + farmJsPluginLess({ /* options */ }) + ] +} +``` + +## Options +```ts +export type LessPluginOptions = { + lessOptions?: Less.Options; + implementation?: string; + filters?: { + resolvedPaths?: string[]; + moduleTypes?: string[]; + }; + additionalData?: + | string + | ((context?: string, resolvePath?: string) => string | Promise); +}; +``` + +### lessOptions +Less options. See [less options](https://lesscss.org/usage/#less-options). + +Example: +```ts +import path from 'node:path'; +import { UserConfig } from '@farmfe/core'; +import farmJsPluginLess from '@farmfe/js-plugin-less'; + +const config: UserConfig = { + plugins: [ + farmJsPluginLess({ + lessOptions: { + paths: [path.resolve(process.cwd(), 'styles')] + } + }) + ] +} + +export default config; +``` + +### filters +Which files should be processed by `less`. default to `{ resolvedPaths: ['\\.less$'] }` for load and `{ moduleTypes: ['less'] }` for transform. + +* `resolvedPaths`: Only files under these paths will be processed. Support regex. +* `moduleTypes`: Only files with these module types will be processed. + +`resolvedPaths` and `moduleTypes` are unioned, which means files match any of them will be processed. + +Example: +```ts +import { UserConfig } from '@farmfe/core'; +import farmJsPluginLess from '@farmfe/js-plugin-less'; + +const config: UserConfig = { + plugins: [ + farmJsPluginLess({ + filters: { + // all files end with .custom-css will be processed + resolvedPaths: ['\\.custom-less$'], + moduleTypes: ['less'] + } + }) + ] +} + +export default config; +``` + +### implementation +`implementation` package name of `less`. Default to `less`. + +### additionalData +```ts +type AdditionalDataOption = string | ((content?: string, resolvePath?: string) => string | Promise); +``` +Additional data to be added to every less file. Example: +```ts +import { UserConfig } from '@farmfe/core'; +import farmJsPluginLess from '@farmfe/js-plugin-less'; + +const config: UserConfig = { + plugins: [ + farmJsPluginLess({ + // add variables.less to every less file + additionalData: ` + @import "./src/styles/variables.less"; + ` + }) + ] +} +``` +For less file: +```less title="index.less" +.foo { + color: @primary-color; +} +``` +`additionalData` will be added to the top of the file: +```less title="index.less" +@import "./src/styles/variables.less"; + +.foo { + color: @primary-color; +} +``` + +Function form: +```ts +import { UserConfig } from '@farmfe/core'; +import farmJsPluginLess from '@farmfe/js-plugin-less'; + +const config: UserConfig = { + plugins: [ + farmJsPluginLess({ + // add variables.less to every less file + additionalData: (content, resolvePath) => { + if (resolvePath === '/path/to/index.less') { + return ` + @import "./src/styles/variables.less"; + `; + } + } + }) + ] +} +``` diff --git a/docs/docs/plugins/official-plugins/js-postcss.mdx b/docs/docs/plugins/official-plugins/js-postcss.mdx new file mode 100644 index 0000000000..5a99822131 --- /dev/null +++ b/docs/docs/plugins/official-plugins/js-postcss.mdx @@ -0,0 +1,107 @@ +import CodeBlock from "@theme/CodeBlock"; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# @farmfe/js-plugin-postcss +Support `postcss` for Farm. + +## Installation + + + + npm install @farmfe/js-plugin-postcss postcss + + + yarn add @farmfe/js-plugin-postcss postcss + + + pnpm add @farmfe/js-plugin-postcss postcss + + + +## Usage +```ts {2,6} +import { UserConfig } from '@farmfe/core'; +import farmJsPluginPostcss from '@farmfe/js-plugin-postcss'; + +const config: UserConfig = { + plugins: [ + farmJsPluginPostcss({ /* options */ }) + ] +} +``` + +## Options +```ts +export type PostcssPluginOptions = { + /** + * @default undefined + * postcss-load-config options. path default to farm.config.js root. + */ + postcssLoadConfig?: { + ctx?: postcssLoadConfig.ConfigContext; + path?: string; + options?: Parameters[2]; + }; + filters?: { + resolvedPaths?: string[]; + moduleTypes?: string[]; + }; + implementation?: string; +}; + +``` + +### postcssLoadConfig +Farm uses `postcss-load-config` to load `postcss` config, so you can use `postcss-load-config`'s options. Refer to [postcss-load-config](https://github.com/postcss/postcss-load-config). + +Example: +```ts +import path from 'node:path'; +import { UserConfig } from '@farmfe/core'; +import farmJsPluginPostcss from '@farmfe/js-plugin-postcss'; + +const config: UserConfig = { + plugins: [ + farmJsPluginPostcss({ + postcssLoadConfig: { + // load config from client/postcss.config.js + path: path.join(process.cwd(), 'client') + } + }) + ] +} + +export default config; +``` + +### filters +Which files should be processed by `postcss`. default to `{ moduleTypes: ['css'] }`. + +* `resolvedPaths`: Only files under these paths will be processed. Support regex. +* `moduleTypes`: Only files with these module types will be processed. note that less/sass files should be processed by `@farmfe/js-plugin-less`/`@farmfe/plugin-sass` first. + +`resolvedPaths` and `moduleTypes` are unioned, which means files match any of them will be processed. + +Example: +```ts +import { UserConfig } from '@farmfe/core'; +import farmJsPluginPostcss from '@farmfe/js-plugin-postcss'; + +const config: UserConfig = { + plugins: [ + farmJsPluginPostcss({ + filters: { + // all files end with .custom-css will be processed + resolvedPaths: ['\\.custom-css$'], + moduleTypes: ['css'] + } + }) + ] +} + +export default config; +``` + +### implementation +`implementation` package name of `postcss`. Default to `postcss`. \ No newline at end of file diff --git a/docs/docs/plugins/official-plugins/js-sass.mdx b/docs/docs/plugins/official-plugins/js-sass.mdx new file mode 100644 index 0000000000..29b854665f --- /dev/null +++ b/docs/docs/plugins/official-plugins/js-sass.mdx @@ -0,0 +1,185 @@ +import CodeBlock from "@theme/CodeBlock"; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# @farmfe/js-plugin-sass +Support `sass` for Farm. + +## Installation + + + + npm install @farmfe/js-plugin-sass sass + + + yarn add @farmfe/js-plugin-sass sass + + + pnpm add @farmfe/js-plugin-sass sass + + + +## Usage +```ts {2,6} +import { UserConfig } from '@farmfe/core'; +import farmJsPluginSass from '@farmfe/js-plugin-sass'; + +const config: UserConfig = { + plugins: [ + farmJsPluginSass({ /* options */ }) + ] +} +``` + +## Options +```ts +export type SassPluginOptions = { + sassOptions?: StringOptions<'async'>; + filters?: { + resolvedPaths?: string[]; + moduleTypes?: string[]; + }; + + /** + * - relative or absolute path + * - globals file will be added to the top of the sass file + * - when file changed, the file can't be hot-reloaded + * + * relative to project root or cwd + */ + implementation?: string | undefined; + globals?: string[]; + additionalData?: + | string + | ((content?: string, resolvePath?: string) => string | Promise); +}; +``` + +### sassOptions +Sass options. See [sass options](https://sass-lang.com/documentation/js-api/interfaces/options/) for more details. + +Example: +```ts +import path from 'node:path'; +import { UserConfig } from '@farmfe/core'; +import farmJsPluginSass from '@farmfe/js-plugin-sass'; + +const config: UserConfig = { + plugins: [ + farmJsPluginSass({ + sassOptions: { + loadPaths: [path.resolve(process.cwd(), 'styles')] + } + }) + ] +} + +export default config; +``` + +### filters +Which files should be processed by `sass`. Default to `{ resolvedPaths: ['\\.(s[ac]ss)$'] }` for load and `{ moduleTypes: ['sass'] }` for transform. + +* `resolvedPaths`: Only files under these paths will be processed. Support regex. +* `moduleTypes`: Only files with these module types will be processed. + +`resolvedPaths` and `moduleTypes` are unioned, which means files match any of them will be processed. + +Example: +```ts +import { UserConfig } from '@farmfe/core'; +import farmJsPluginSass from '@farmfe/js-plugin-sass'; + +const config: UserConfig = { + plugins: [ + farmJsPluginSass({ + filters: { + // all files end with .custom-css will be processed + resolvedPaths: ['\\.custom-sass$'], + moduleTypes: ['sass'] + } + }) + ] +} + +export default config; +``` + +### implementation +`implementation` package name of `sass`. Default to `sass`. If you want to use `sass-embedded`, you can set it to `sass-embedded`. + +```ts +import { UserConfig } from '@farmfe/core'; +import farmJsPluginSass from '@farmfe/js-plugin-sass'; + +const config: UserConfig = { + plugins: [ + farmJsPluginSass({ + implementation: 'sass-embedded' + }) + ] +} +``` +:::note +You should install `sass-embedded` manually. +::: + +### additionalData +```ts +type AdditionalDataOption = string | ((content?: string, resolvePath?: string) => string | Promise); +``` +Additional data to be added to every sass file. Example: +```ts +import { UserConfig } from '@farmfe/core'; +import farmJsPluginSass from '@farmfe/js-plugin-sass'; + +const config: UserConfig = { + plugins: [ + farmJsPluginSass({ + // add variables.sass to every sass file + additionalData: ` + @import "./src/styles/variables.scss"; + ` + }) + ] +} +``` +For sass file: +```sass title="index.scss" +.foo { + color: @primary-color; +} +``` +`additionalData` will be added to the top of the file: +```sass title="index.scss" +@import "./src/styles/variables.scss"; + +.foo { + color: @primary-color; +} +``` + +Function form: +```ts +import { UserConfig } from '@farmfe/core'; +import farmJsPluginSass from '@farmfe/js-plugin-sass'; + +const config: UserConfig = { + plugins: [ + farmJsPluginSass({ + // add variables.sass to every sass file + additionalData: (content, resolvePath) => { + if (resolvePath === '/path/to/index.sass') { + return ` + @import "./src/styles/variables.sass"; + `; + } + } + }) + ] +} +``` + +### globals +Global sass files. These files will be added to the top of every sass file. It's the same as `additionalData` but more convenient. + diff --git a/docs/docs/plugins/official-plugins/js-svgr.mdx b/docs/docs/plugins/official-plugins/js-svgr.mdx new file mode 100644 index 0000000000..8af583b668 --- /dev/null +++ b/docs/docs/plugins/official-plugins/js-svgr.mdx @@ -0,0 +1,88 @@ +import CodeBlock from "@theme/CodeBlock"; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# @farmfe/js-plugin-svgr +Support `React SVG Components` for Farm. + +## Installation + + + + npm install @farmfe/js-plugin-svgr + + + yarn add @farmfe/js-plugin-svgr + + + pnpm add @farmfe/js-plugin-svgr + + + +## Usage +```ts {2,6} +import { UserConfig } from '@farmfe/core'; +import farmJsPluginSvgr from '@farmfe/js-plugin-svgr'; + +const config: UserConfig = { + plugins: [ + farmJsPluginSvgr({ /* options */ }) + ] +} +``` + +## Options +```ts +export interface FarmSvgrPluginOptions { + svgrOptions?: SvgrOptions; + filters?: { + resolvedPaths?: string[]; + }; +} +``` + +### svgrOptions +See [svgr options](https://react-svgr.com/docs/options/) for more details. + +Example: +```ts +import path from 'node:path'; +import { UserConfig } from '@farmfe/core'; +import farmJsPluginSvgr from '@farmfe/js-plugin-svgr'; + +const config: UserConfig = { + plugins: [ + farmJsPluginSvgr({ + svgrOptions: { + loadPaths: [path.resolve(process.cwd(), 'styles')] + } + }) + ] +} + +export default config; +``` + +### filters +Which files should be processed by `svgr`. Default to `{ resolvedPaths: ['\\.svg$'] }`. + +* `resolvedPaths`: Only files under these paths will be processed. Support regex. + +Example: +```ts +import { UserConfig } from '@farmfe/core'; +import farmJsPluginSvgr from '@farmfe/js-plugin-svgr'; + +const config: UserConfig = { + plugins: [ + farmJsPluginSvgr({ + filters: { + // all files end with .custom-svg will be processed + resolvedPaths: ['\\.custom-svg$'], + } + }) + ] +} + +export default config; +``` \ No newline at end of file diff --git a/docs/docs/plugins/official-plugins/overview.md b/docs/docs/plugins/official-plugins/overview.md new file mode 100644 index 0000000000..f7152a9a75 --- /dev/null +++ b/docs/docs/plugins/official-plugins/overview.md @@ -0,0 +1,31 @@ +# Overview + +Farm officially provides a lot of useful plugins, including Rust plugins and JS plugins. Rust plugins are much faster than Js plugins, we recommend to use Rust plugins whenever possible. + +:::tip +Refer to [Using Plugins](/docs/using-plugins) for how to use plugins in Farm. +::: + +## Rust Plugins + +* **[`@farmfe/plugin-react`](./react)**:Support React `jsx` and `react-refresh`. +* **[`@farmfe/plugin-sass`](./sass)**:Support compiling `sass/scss` files. +* **[`@farmfe/plugin-strip`](./strip)**:A Farm rust plugin to remove `debugger` statements and functions like `assert.equal` and `console.log` from your code. +* **[`@farmfe/plugin-dsv`](./dsv)**:A Farm plugin which converts `.csv` and `.tsv` files into JavaScript modules. +* **[`@farmfe/plugin-yaml`](./yaml)**:A Farm plugin which Converts YAML files to ES6 modules. +* **[`@farmfe/plugin-virtual`](./virtual)**:A rust plugin for farm to easily use virtual module. +* **[`@farmfe/plugin-react-components`](./react-components)**:On-demand components auto importing for React. + +## Js Plugins + +* **[`@farmfe/js-plugin-postcss`](./js-postcss)**:Support `postcss` in your project. +* **[`@farmfe/js-plugin-less`](./js-less)**:Support compiling `less` files. +* **[`@farmfe/js-plugin-svgr`](./js-svgr)**:Support compiling `svg` files. +* **[`@farmfe/js-plugin-dts`](./js-dts)**:Support compiling `*.d.ts` files. +* **[`@farmfe/js-plugin-sass`](./js-sass)**:Support compiling `sass/scss` files. + +## Community Plugins + +If official plugins doesn't meet your needs, you can try [Community Plugins](../community-plugins) + +And of course check out [awesome-farm](https://github.com/farm-fe/awesome-farm) - you can also submit a PR to list your plugins there. diff --git a/docs/docs/plugins/official-plugins/react-components.mdx b/docs/docs/plugins/official-plugins/react-components.mdx new file mode 100644 index 0000000000..67be2324ae --- /dev/null +++ b/docs/docs/plugins/official-plugins/react-components.mdx @@ -0,0 +1,157 @@ +import CodeBlock from "@theme/CodeBlock"; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# @farmfe/plugin-react-components + +On-demand components auto importing for React. + +## Installation + + + + npm install @farmfe/plugin-react-components + + + yarn add @farmfe/plugin-react-components + + + pnpm add @farmfe/plugin-react-components + + + +## Usage +`@farmfe/plugin-react-components` is a Rust plugin, you only need to configure its package name in `plugins` field in `farm.config.ts`. +```ts {4} +import { UserConfig } from '@farmfe/core'; + +const config: UserConfig = { + plugins: ['@farmfe/plugin-react-components', { /** options here */}] +} +``` + +## Features + +- 💚 Supports React out-of-the-box. +- ✨ Supports both components and directives. +- 🏝 Tree-shakable, only registers the components you use. +- 🪐 Folder names as namespaces. +- 🦾 Full TypeScript support. +- 🌈 [Built-in resolvers](#importing-from-ui-libraries) for popular UI libraries. + +## Usage + +Use components in templates as you would usually do, it will import components on demand, and there is no `import` and `component registration` required anymore! If you register the parent component asynchronously (or lazy route), the auto-imported components will be code-split along with their parent. + +It will automatically turn this + +```tsx +export function Main() { + return +} +``` + +into this + +```tsx +import HelloWorld from './src/components/HelloWorld' + +export function Main() { + return +} +``` + +> **Note** +> By default this plugin will import components in the `src/components` path. You can customize it using the `dirs` option. + +## TypeScript + +To get TypeScript support for auto-imported components. + +```ts +Components({ + dts: true, // enabled by default if `typescript` is installed +}) +``` + +Once the setup is done, a `components.d.ts` will be generated and updates automatically with the type definitions. Feel free to commit it into git or not as you want. + +> **Make sure you also add `components.d.ts` to your `tsconfig.json` under `include`.** + +## Importing from UI Libraries + +We have several built-in resolvers for popular UI libraries like **Ant Design**, **Arco Design**, and **Material UI**, where you can enable them by: + +Supported Resolvers: + +- [Ant Design](https://ant.design/) +- [Arco Design](https://arco.design/react/docs/start) +- [Material UI](https://mui.com/) + +```ts +// farm.config.js + +import { UserConfig } from '@farmfe/core'; + +const config: UserConfig = { + plugins: ['@farmfe/plugin-react-components', { + local: true, + resolvers:[ + { + module: "antd", + prefix: "Ant" + }, + { + module:"@arco-design/web-react", + prefix: "Arco", + import_style: true // style/index.js + } + ] + }] +} +``` + +## Configuration + +The following show the default values of the configuration +component +```ts +{ + // relative paths to the directory to search for components. + dirs: ['src/components'], + + // resolvers for custom components. + resolvers: [], + + /** + * Components are introduced with Absolute or Relative path. + * + * @default Absolute + */ + import_mode: "Absolute" + + /** + * Is it valid for local components + * + * @default true + */ + local: true, + + /** + * import style `style/index.js` , also accepts a path for custom path (/**) with components + * + * @default false + */ + importStyle?: boolean | string + + // generate `components.d.ts` global declarations, + // also accepts a path for custom filename + // default: `true` if package typescript is installed + dts: true, + + // Filters for transforming targets (components to insert the auto import) + // Note these are NOT about including/excluding components registered - use `Regex` for that + include: ["src/components"], + exclude: ["node_modules"], +} +``` diff --git a/docs/docs/plugins/official-plugins/react.mdx b/docs/docs/plugins/official-plugins/react.mdx new file mode 100644 index 0000000000..d603c89024 --- /dev/null +++ b/docs/docs/plugins/official-plugins/react.mdx @@ -0,0 +1,33 @@ +import CodeBlock from "@theme/CodeBlock"; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# @farmfe/plugin-react +Support `React Jsx` and `React Refresh` for Farm. + +## Installation + + + + npm install @farmfe/plugin-react react-refresh + + + yarn add @farmfe/plugin-react react-refresh + + + pnpm add @farmfe/plugin-react react-refresh + + + +## Usage +`@farmfe/plugin-react` is a Rust plugin, you only need to configure its package name in `plugins` field in `farm.config.ts`. +```ts {4} +import { UserConfig } from '@farmfe/core'; + +const config: UserConfig = { + plugins: ['@farmfe/plugin-react', { /** options here */}] +} +``` + +## Options +See [SWC Transform React Options](https://swc.rs/docs/configuration/compilation#jsctransformreact). diff --git a/docs/docs/plugins/official-plugins/sass.mdx b/docs/docs/plugins/official-plugins/sass.mdx new file mode 100644 index 0000000000..eb8cc55119 --- /dev/null +++ b/docs/docs/plugins/official-plugins/sass.mdx @@ -0,0 +1,37 @@ +import CodeBlock from "@theme/CodeBlock"; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# @farmfe/plugin-sass + +Support `Sass` for Farm. + +## Installation + + + + npm install @farmfe/plugin-sass + + + yarn add @farmfe/plugin-sass + + + pnpm add @farmfe/plugin-sass + + + +## Usage +`@farmfe/plugin-sass` is a Rust plugin, you only need to configure its package name in `plugins` field in `farm.config.ts`. +```ts {4} +import { UserConfig } from '@farmfe/core'; + +const config: UserConfig = { + plugins: ['@farmfe/plugin-sass', { /** options here */}] +} +``` + +## Options +### additionalData +* **Type**: `string` + +Add extra content to the head of each `sass` file, such as an `@import '@/styles/variables.scss';` statement. \ No newline at end of file diff --git a/docs/docs/plugins/official-plugins/strip.mdx b/docs/docs/plugins/official-plugins/strip.mdx new file mode 100644 index 0000000000..b8968fef6a --- /dev/null +++ b/docs/docs/plugins/official-plugins/strip.mdx @@ -0,0 +1,103 @@ +import CodeBlock from "@theme/CodeBlock"; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + + +# @farmfe/plugin-strip + +🍣 A Farm rust plugin to remove `debugger` statements and functions like `assert.equal` and `console.log` from your code. + +## Requirements + +This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v18.0.0+) and Farm v1.0.0+. + +## Installation + + + + npm install @farmfe/plugin-strip + + + yarn add @farmfe/plugin-strip + + + pnpm add @farmfe/plugin-strip + + + +## Usage + +Create a `farm.config.js` [configuration file](https://www.farmfe.org/docs/config/configuring-farm) and import the plugin: + +```js +import { defineConfig } from '@farmfe/core'; +import strip from '@farmfe/plugin-strip'; + +export default defineConfig({ + // ... + plugins: [ + [ + strip({ + // plugin options + functions:[ 'console.*', 'assert.*' ], + labels: ['unittest'] + }) + ] + ], + // ... +}); +``` + +## Options + +### `include` + +Type: `String | RegExp | Array[...String|RegExp]`
+Default: `['**/*.js']`
+Example: `include: '**/*.(mjs|js)',`
+ +A pattern, or array of patterns, which specify the files in the build the plugin should operate on. + +### `exclude` + +Type: `String | RegExp | Array[...String|RegExp]`
+Default: `[]`
+Example: `exlude: 'tests/**/*',`
+ +A pattern, or array of patterns, which specify the files in the build the plugin should _ignore_. + +### `debugger` + +Type: `Boolean`
+Default: `true`
+Example: `debugger: false,`
+ +If `true` instructs the plugin to remove debugger statements. + +### `functions` + +Type: `Array[...String]`
+Default: `[ 'console.*', 'assert.*' ]`
+Example: `functions: [ 'console.log', 'MyClass.Test' ],`
+ +Specifies the functions that the plugin will target and remove. + +_Note: specifying functions that are used at the begining of a chain, such as 'a().b().c()', will result in '(void 0).b().c()' which will generate an error at runtime._ + +### `labels` + +Type: `Array[...String]`
+Default: `[]`
+Example: `labels: ['unittest'],`
+ +Specifies the [labeled blocks or statements](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/label) that the plugin will target and remove. + +_Note: the '**:**' is implied and should not be specified in the config._ + +### `sourceMap` + +Type: `Boolean`
+Default: `true`
+Example: `sourceMap: false,`
+ +If `true`, instructs the plugin to update source maps accordingly after removing configured targets from the bundle. diff --git a/docs/docs/plugins/official-plugins/virtual.mdx b/docs/docs/plugins/official-plugins/virtual.mdx new file mode 100644 index 0000000000..2378da4412 --- /dev/null +++ b/docs/docs/plugins/official-plugins/virtual.mdx @@ -0,0 +1,55 @@ +import CodeBlock from "@theme/CodeBlock"; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# @farmfe/plugin-virtual + +Inspired By [@rollup/plugin-virtual](https://www.npmjs.com/package/@rollup/plugin-virtual) + +A rust plugin for farm to easily use virtual module + +## Installation + + + + npm install @farmfe/plugin-virtual + + + yarn add @farmfe/plugin-virtual + + + pnpm add @farmfe/plugin-virtual + + + +## Usage + +farm.config.ts + +```typescript +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + plugins: [ + [ + '@farmfe/plugin-virtual', + { + 'virtual-module': 'export const a = 1', + 'src/01.js': 'export const module01 = "virtual-module"', + }, + ], + ], +}); +``` + +index.js + +```javascript +import { a } from 'virtual-module'; +``` + +src/02.js + +```javascript +import { module01 } from './01.js'; +``` diff --git a/docs/docs/plugins/official-plugins/yaml.mdx b/docs/docs/plugins/official-plugins/yaml.mdx new file mode 100644 index 0000000000..0c51019064 --- /dev/null +++ b/docs/docs/plugins/official-plugins/yaml.mdx @@ -0,0 +1,48 @@ +import CodeBlock from "@theme/CodeBlock"; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# @farmfe/plugin-yaml + +Inspired By [@rollup/plugin-yaml](https://www.npmjs.com/package/@rollup/plugin-yaml) + +🍣 A Farm plugin which Converts YAML files to ES6 modules. + +## Installation + + + + npm install @farmfe/plugin-yaml + + + yarn add @farmfe/plugin-yaml + + + pnpm add @farmfe/plugin-yaml + + + +## Usage + +farm.config.ts + +```typescript +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + plugins: [ + [ + '@farmfe/plugin-yaml', + { + documentMode: 'single' | 'multi', // default single + include: Regex, // default None, + exclude: Regex, // default None + }, + ], + ], +}); +``` + +notice: + +include or exclude is Regex not glob For example `**/01.yaml` is not illegal。What is right is like `".*\\/01.yaml"` diff --git a/docs/docs/plugins/writing-plugins/js-plugin.mdx b/docs/docs/plugins/writing-plugins/js-plugin.mdx new file mode 100644 index 0000000000..fda5d4290b --- /dev/null +++ b/docs/docs/plugins/writing-plugins/js-plugin.mdx @@ -0,0 +1,203 @@ +import CodeBlock from "@theme/CodeBlock"; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + + +# Writing JavaScript Plugins + +A JavaScript plugin is simply a pure JavaScript object that defines a set of property hooks: + +```js +// farm.config.ts +import { defineConfig } from "@farmfe/core"; + +export default defineConfig({ + // ... + plugins: [ + // a plugin object + { + name: "my-resolve-plugin", + priority: 1000, // the priority of this plugin, the larger the value, the earlier the execution. Normally internal plugins is 100. + resolve: { + filters: { + // Only execute the hook when following conditions satisfied + sources: ["\\./index.ts"], // a regex array + importers: ["None"], + }, + executor: async (param) => { + // this hook executor + console.log(param); // resolve params + // return the resolve result + return { + resolvedPath: "virtual:my-module", + query: {}, + sideEffects: false, + external: false, + }; + }, + }, + }, + // load, transform are similar to resolve, refer to their types + ], +}); +``` + +If you want to pass args to your plugins,you can use a closure. + +```ts +// my-resolve-plugin.ts +export function myResolvePlugin(options: Options) { + const { xx } = options; + + return { + name: "my-resolve-plugin", + resolve: { + // ... + }, + }; +} + +// farm.config.ts +import { defineConfig } from "@farmfe/core"; +import { myResolvePlugin } from "./myResolvePlugin.ts"; + +export default defineConfig({ + // ... + plugins: [myResolvePlugin({ xx: "xx" })], +}); +``` + +:::note +* See [Create Plugin](#create-plugin) to create a new plugin quickly based on official plugin templates. +* This document only covers how to create, develop and publish a js plugin, for more detail about the plugin hooks, see [Js Plugin Hooks](/docs/api/js-plugin-api). +::: + +## Conventions + +For farm specific js plugins: + +- The Farm Js plugin should have a name with a `farm-plugin-` prefix and clear semantics. +- Include the `farm-plugin-` keyword in package.json. + +If your plugin is only applicable to a specific framework, its name should follow the following prefix format: + +- `farm-plugin-vue-`: Prefix as a Vue plugin +- `farm-plugin-react-`: Prefix as a React plugin +- `farm-plugin-svelte-`: Prefix as a svelte plugin +- ... + +## Concepts +Before you start to write your js plugin, you should know the following concepts: +* **filters**: Cause Js Plugins are much slower than Rust Plugins, your js plugin need to set explicit filters to avoid unnecessary call for js plugins hook. For example, you should set `transform.filters.moduleTypes = ['js']` to make sure that the transform hook of your js plugin only runs for `.js/mjs/cjs` files. +* **module_type**: The type of the module, it can be `js`, `ts`, `css`, `sass`, `json`, etc. Farm supports `js/ts/jsx/tsx`, `css`, `html`, `json`, `static assets(png, svg, etc)` natively. `module_type` is returned by `load` hook or `transform` hook. +* **resolved_path and module_id**: `resolved_path` is the absolute path of the module, and `module_id` is the unique id of the module, it's usually `relative path of the module from the project root` + `query`. For example, we import a module as `import './a?query'`, the resolved_path is `/project/src/a.ts` and the module_id is `src/a.ts?query`. +* **context**: All the hooks in the plugin accept a `context` argument, it's the compilation context of the farm project, you can use it to get the ModuleGraph, Module, Resources, etc. +* **Resource and Resource Pot**: `Resource` is the final output bundle file, and `Resource Pot` is the abstract representation of the resource, similar to `Chunk` of other bundlers. Inside Farm, first we will generate `Resource Pots` from `ModuleGraph`, render `Resource Pots` and finally generate `Resources` from `Resource Pots`. + +### Filters +Cause `Js Plugins` are much slower than `Rust Plugins`, Farm use `filters` to control the execution of js plugin hooks. The plugin hook executes only when given `filters` matched to improve performance. `filters` is neccessary for some commonly used hooks, such as `resolve`, `load`, `transform`, etc. + +For example, if you want to transform css files, you can use `transform.filters.moduleTypes = ['css']` to make sure that the transform hook of your js plugin only runs for `.css` files: + +```ts +const myCssPlugin = { + name: "my-css-plugin", + transform: { + filters: { + // Only execute the hook when following conditions satisfied + // resolvedPaths: ["\\./index.ts"], // a regex array to match the resolvedPaths + moduleTypes: ["css"], + }, + executor: async (param) => { + // transform css + }, + }, +}; +``` + +### Module Type +In Farm, every thing is `First Class Citizens`, so Farm designs `module_type` to identify the type of a module and handle different kinds of ModuleTypes in different plugins. + +`module_type` returned by `load` hook, and can be transformed by `transform` hook. Farm supports `js/ts/jsx/tsx`, `css`, `html`, `json`, `static assets(png, svg, etc)` natively. For these module types, you can return them directly in `load` or `transform` hook directly. But if you want to handle custom module types, you may need to implement ohter hooks like `parse`, `render_resource_pot_modules`, `generate resources`, etc to control how to parse, render and generate resources for the custom module types. + +:::note +Js Plugins don't support `parse`, `render_resource_pot_modules`, `generate resources` hooks, you have to use Rust Plugins to handle custom module types. +::: + +## Create Plugin +Farm provides official templates to help your create your js plugins quickly: +<> + + + pnpm create farm-plugin + + + npm create farm-plugin@latest + + + + yarn create farm-plugin + + + + +then follow the prompts to create your plugin. + +or you can create a plugin derectly by running the following command: + + + pnpm create farm-plugin my-farm-plugin --type js + + + npm create my-farm-plugin --type js + + + + yarn create my-farm-plugin --type js + + +Above command will create new js plugin with name `my-farm-plugin` in the current directory. `--type` can be `rust` or `js` + +## Develop Plugin +After creating the plugin, you can start to develop your plugin. The plugin is a pure JavaScript object that defines a set of property hooks: + +```ts +// import { readFileSync } from 'node:fs'; +import type { JsPlugin } from '@farmfe/core'; + +interface Options { + /* Your options here */ +} + +export default function farmPlugin(options: Options): JsPlugin { + return { + name: '', + /* Your plugin hooks here: */ + + // transform: { + // filters: { + // moduleTypes: ['js'] + // }, + // async executor(params) { + // const { content } = params; + // return { + // content, + // moduleType: 'js' + // }; + // } + // }, + // finish: { + // executor() {} + // } + }; +} +``` + +:::tip +For more detail about the plugin hooks, see [Js Plugin Hooks](/docs/api/js-plugin-api). +::: + +Run `npm run dev` to compile the plugin and watch for changes. Run `npm run build` to build the plugin. + +## Publish Plugin +A js plugin package is a normal npm package, you can publish it to npm registry by running `npm publish`. \ No newline at end of file diff --git a/docs/docs/plugins/writing-plugins/overview.md b/docs/docs/plugins/writing-plugins/overview.md new file mode 100644 index 0000000000..20bd1ed6e0 --- /dev/null +++ b/docs/docs/plugins/writing-plugins/overview.md @@ -0,0 +1,22 @@ + +# Overview +To use a Rust plugin, configuring `plugins` in `farm.config.ts`. + +```ts +import { defineFarmConfig } from '@farmfe/core'; + +defineFarmConfig({ + // ... + plugins: [ + { /*..*/ }, // Js plugin, a object with hook defined + '@farmfe/plugin-react', // rust plugin package name + ] +}) + +``` + +Farm support both rust plugins and js plugins: + +* [Writing Rust Plugin](/docs/plugins/writing-plugins/rust-plugin) +* [Writing Js Plugin](/docs/plugins/writing-plugins/js-plugin) + \ No newline at end of file diff --git a/docs/docs/plugins/writing-plugins/runtime-plugin.md b/docs/docs/plugins/writing-plugins/runtime-plugin.md new file mode 100644 index 0000000000..4f99504c05 --- /dev/null +++ b/docs/docs/plugins/writing-plugins/runtime-plugin.md @@ -0,0 +1,166 @@ +# Writing Runtime Plugin +A Farm runtime plugin is a pure javascript object that define a set of hooks to enhance Farm runtime. Example: + +```ts +/** + * HMR client as a Farm Runtime Plugin + */ +import type { Plugin } from '@farmfe/runtime'; +import { createHotContext } from './hot-module-state'; +import { HmrClient } from './hmr-client'; + +let hmrClient: HmrClient; +// export a Farm runtime plugin object +export default { + name: 'farm-runtime-hmr-client-plugin', + // define hooks + bootstrap(moduleSystem) { + hmrClient = new HmrClient(moduleSystem); + hmrClient.connect(); + }, + moduleCreated(module) { + // create a hot context for each module + module.meta.hot = createHotContext(module.id, hmrClient); + } +}; +``` + +Above it's a runtime plugin that supports HMR for Farm. Essentials: +* A runtime plugin entry file should **`export`** a default object that defines a set of hooks. e.g `export default {/*...*/}` +* `name` is required to identify the plugin, make sure `name` is unique +* A `hook` is a method that defined in the exported object. + +:::note +See [@farmfe/runtime-plugin-hmr](https://github.com/farm-fe/farm/tree/main/packages/runtime-plugin-hmr) for full implementation of above examples. +::: + +## Caveat +You should make your runtime plugin as **simple** as possible. You **SHOULD NOT**: +* Use **big dependencies** from node_modules, this would make your farm plugin very large, it's really bad for performance. +* Use new features like `top level await` as these runtime related features are hard to polyfill for low level runtime. + +It's really recommended to make sure your runtime plugin **as small and simple as possible**. + +:::tip +`import.meta.xxx` will be compiled to `module.meta.xxx`, you can `append values` to `module.meta` in runtime plugins to enhance `import.meta`. For example, `module.meta.hot = createHotContext(module.id, hmrClient)` makes `import.meta.hot` available. +::: + +## Conventions +A Farm runtime plugin name should be prefixed by `farm-runtime-plugin`, e.g `farm-runtime-plugin-xxx`. + +:::note +Both `plugin.name` and `package name`(Only if you publish your plugin as a package) should be prefixed. +::: + + +## Using Runtime Plugins +Use `compilation.runtime.plugins` to configure runtime plugins for your project: + +```ts +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + compilation: { + runtime: { + plugins: [ + // relative path + './src/my-plugin1.ts', + // absolute path + '/root/project/src/my-plugin2.ts', + // package name + '@scope/plugin-package-from-node-modules' + ] + } + } +}); +``` + +You can configure runtime plugin item by 3 ways: +* **`relative path`**: Path that is relative to `root`, e.g `./src/my-plugin1.ts` will try load plugin from `/src/my-plugin1.ts`. +* **`absolute path`**: e.g `/root/project/src/my-plugin2.ts`. (Absolute path should be `C:\project\src\my-plugin2.ts` on windows). +* **`package name`**: Farm will try load this package from `node_modules`, e.g `@scope/plugin-package-from-node-modules`. + +## Writing Runtime Plugins +:::tip +Farm support loading `.ts` file directly, so you can configure a `.ts` file(or a package whose entry is a `ts` file) in `runtime.plugins` directly. + +```ts +export default defineConfig({ + compilation: { + runtime: { + plugins: [ + // configuring ts file directly + './src/my-plugin.ts', + ] + } + } +}); +``` +::: + +### Create a Plugin +As we mentioned above, a Farm runtime plugin is a pure javascript object that define a set of hooks, you can just create a ts file like: + +```ts title="./plugins/runtime.ts" +import type { Plugin } from '@farmfe/runtime'; + +export default { + name: 'my-plugin', + // ... +} +``` + +Then define [hooks](#runtime-plugin-hooks) you need in the exported object: + +```ts title="./plugins/runtime.ts" +import type { Plugin } from '@farmfe/runtime'; + +export default { + name: 'my-plugin', + moduleCreated(module) { + // ... + }, + readModuleCache(module) { + // ... + }, + loadResource(resource, targetEnv) { + // ... + }, + // ... more hooks as long as you need +} +``` + +### Debug the Plugin +Configure the plugin you created in `runtime.plugins`: + +```ts +export default defineConfig({ + compilation: { + runtime: { + plugins: [ + './plugins/runtime.ts', + ] + } + } +}); +``` +Then start the Farm project, this plugin will be injected in the runtime of output resources. + +### Publish the Plugin(Optional) +You can publish the runtime plugin to npm registry to share your Farm runtime plugin. Just create a `package.json` like: + +```json +{ + "name": "@farmfe/runtime-plugin-hmr", + "version": "3.4.2", + "description": "Runtime hmr plugin of Farm", + // c-highlight-start + "main": "src/index.ts", + // c-highlight-end + // ... ignore other fields +} +``` +You can just export `ts` file using `"main": "src/index.ts"`. + +## Runtime Plugin Hooks +See [Runtime Plugin API](/docs/api/runtime-plugin-api) \ No newline at end of file diff --git a/docs/docs/plugins/writing-plugins/rust-plugin.mdx b/docs/docs/plugins/writing-plugins/rust-plugin.mdx new file mode 100644 index 0000000000..11053a4872 --- /dev/null +++ b/docs/docs/plugins/writing-plugins/rust-plugin.mdx @@ -0,0 +1,514 @@ +import CodeBlock from "@theme/CodeBlock"; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# Writing Rust Plugins +Rust plugins are the recommended way to write your plugins cause Rust plugins are much **faster and powerful** than Js Plugins. A Rust plugin is a `struct` that implements `farmfe_core::plugin::Plugin` trait, example: + +```rust +#![deny(clippy::all)] + +use farmfe_core::{config::Config, plugin::Plugin}; + +use farmfe_macro_plugin::farm_plugin; + +// define your rust plugins +#[farm_plugin] +pub struct FarmPluginExample {} + +impl FarmPluginExample { + // a Rust plugin must export a new method that accepts 2 arguments for initialization。 + fn new(config: &Config, options: String) -> Self { + Self {} + } +} +// Implement Plugin trait to define plugin hooks +impl Plugin for FarmPluginExample { + fn name(&self) -> &str { + "FarmPluginExample" + } + + // more hooks here +} +``` +Note for a Rust plugin struct: +- The struct must be `pub` and `#[farm_plugin]` attribute is required. +- The struct must implement `Plugin` trait, and the `name` method must be implemented. +- The struct must export a `new` method that accepts 2 arguments for initialization, the first argument is `&Config` and the second argument is `String`. The `new` method is called when the plugin is loaded, and the `Config` is the farm project config, and the `String` is the plugin options. + +We also provide a Rust plugin example repository: [farm-rust-plugin-example](https://github.com/farm-fe/rust-plugin-example). + +:::note +This document only covers how to create, develop and publish a rust plugin, for more detail about the plugin hooks, see [Plugin Hooks](/docs/api/rust-plugin-api). +::: + +## Conventions + +For farm specific Rust plugins: + +- The Farm plugin should have a name with a `farm-plugin-` prefix and clear semantics. +- Include the `farm-plugin-` keyword in package.json. + +If your plugin is only applicable to a specific framework, its name should follow the following prefix format: + +- `farm-plugin-vue-`: Prefix as a Vue plugin +- `farm-plugin-react-`: Prefix as a React plugin +- `farm-plugin-svelte-`: Prefix as a svelte plugin +- ... + +## Concepts +Before you start to write your rust plugin, you should know the following concepts: +* **module_type**: The type of the module, it can be `js`, `ts`, `css`, `sass`, `json`, etc. Farm supports `js/ts/jsx/tsx`, `css`, `html`, `json`, `static assets(png, svg, etc)` natively. `module_type` is returned by `load` hook. You can extend natively supported module type by Rust plugins the same as Farm internal plugins. +* **resolved_path and module_id**: `resolved_path` is the absolute path of the module, and `module_id` is the unique id of the module, it's usually `relative path of the module from the project root` + `query`. For example, we import a module as `import './a?query'`, the resolved_path is `/project/src/a.ts` and the module_id is `src/a.ts?query`. +* **context**: All the hooks in the plugin accept a `context` argument, it's the compilation context of the farm project, you can use it to get the ModuleGraph, Module, Resources, etc. +* **Resource and Resource Pot**: `Resource` is the final output bundle file, and `Resource Pot` is the abstract representation of the resource, similar to `Chunk` of other bundlers. Inside Farm, first we will generate `Resource Pots` from `ModuleGraph`, render `Resource Pots` and finally generate `Resources` from `Resource Pots`. + +### Module Type +In Farm, every thing is `First Class Citizens`, so Farm designs `module_type` to identify the type of a module and handle different kinds of ModuleTypes in different plugins. + +`module_type` returned by `load` hook, and can be transformed by `transform` hook. Farm supports `js/ts/jsx/tsx`, `css`, `html`, `json`, `static assets(png, svg, etc)` natively. For these module types, you can return them directly in `load` or `transform` hook directly. But if you want to handle custom module types, you may need to implement ohter hooks like `parse`, `render_resource_pot_modules`, `generate resources`, etc to control how to parse, render and generate resources for the custom module types. + + +## Create Plugin +Farm provides official templates to help your create your rust plugins quickly: +<> + + + pnpm create farm-plugin + + + npm create farm-plugin@latest + + + + yarn create farm-plugin + + + + +then follow the prompts to create your plugin. + +or you can create a plugin derectly by running the following command: + + + pnpm create farm-plugin my-farm-plugin --type rust + + + npm create my-farm-plugin --type rust + + + + yarn create my-farm-plugin --type rust + + +Above command will create new rust plugin with name `my-farm-plugin` in the current directory. `--type` can be `rust` or `js` + +## Plugin Project Structure +The plugin project structure is as follows: +```plaintext +my-farm-plugin +├── .github +│ └── workflows +| ├── release.yml +| ├── build.yml +│ └── ci.yml +├── Cargo.toml +|── .gitignore +├── npm +│ ├── darwin-x64 +│ ├── linux-x64-gnu +| ├── win32-x64-msvc +│ └── ... +├── package.json +├── src +│ └── lib.rs +└── rust-toolchain.toml +``` +Notable files and directories: +- `src/lib.rs`: The main file of the plugin, where you define your plugin. +- `Cargo.toml`: The manifest file for Rust. +- `package.json`: The manifest file for npm. +- `npm`: Where your platform specific binary packages placed. These packages should be published to npm registry before publish the plugin. +- `.github/workflows`: Used to cross build and publish your plugin in github actions. +- `rust-toolchain.toml`: The rust toolchain file, it should **not be modified manually**, it should always using **the same version as the farm core**. + +Farm provides a tool(`@farmfe/plugin-tools`) to help you build and publish your rust plugin, see `package.json`: +```json +{ + // ... + "scripts": { + // build your plugin for current platform + "build": "farm-plugin-tools build --platform --cargo-name my_farm_plugin -p my_farm_plugin --release", + // publish all platform packages under npm directory to npm registry + "prepublishOnly": "farm-plugin-tools prepublish" + }, + // ... +} +``` +More detail about building and publishing your plugin, see [buidling](#cross-build) and [publishing](#publish) sections. + +## Develop Plugin +To develop and test your plugin locally, you should build your plugin for your platform first, run: +```bash +pnpm build +``` +Then you can use the built plugin in your farm project by adding the plugin to the `plugins` field in `farm.config.ts`: +```javascript +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + plugins: [ + 'my-farm-plugin' + ] +}); +``` +and execute `pnpm i` in your farm project, and run `farm start` to start your farm project with your plugin. + +when you make changes to your plugin, you should rebuild your plugin and restart your farm project to see the changes. for example, add `load` hook to your plugin: +```rust {8-18} title="src/lib.rs" +// ... ignore other code + +impl Plugin for FarmPluginExample { + fn name(&self) -> &str { + "FarmPluginExample" + } + + fn load( + &self, + param: &farmfe_core::plugin::PluginLoadHookParam, + _context: &std::sync::Arc, + _hook_context: &farmfe_core::plugin::PluginHookContext, + ) -> farmfe_core::error::Result> { + println!( + "load path: {:?}, id: {:?}", + param.resolved_path, param.module_id + ); + Ok(None) + } +} +``` +Then rebuild your plugin with `pnpm build` and restart your farm project with `farm start`, you will see the `load` hook is called when compiling your farm project. + +:::note +For more detail about the plugin hooks, see [Plugin Hooks](/docs/api/rust-plugin-api). +::: + +### Handle ModuleType +`module_type` is returned by the `load` hook or `transform` hook. Your set any module type to the module in the `load` hook, and the module will be processed by the corresponding plugin that supports the module type. + +For native supported module types, you can just return the module type in the `load` hook: +```rust {8-18} title="src/lib.rs" +// ... ignore other code + +impl Plugin for FarmPluginExample { + fn name(&self) -> &str { + "FarmPluginExample" + } + + fn load( + &self, + param: &farmfe_core::plugin::PluginLoadHookParam, + _context: &std::sync::Arc, + _hook_context: &farmfe_core::plugin::PluginHookContext, + ) -> farmfe_core::error::Result> { + // handle virtual module + if param.module_id.starts_with("virtual:my-css:css") { + // return module type and content + Ok(Some(farmfe_core::plugin::PluginLoadHookResult { + module_type: "css".to_string(), + content: ".red { color: red; }".to_string(), + ..Default::default() + })) + } else { + Ok(None) + } + } +} +``` + +For non-native supported module types, you should use `transform` hook to transform the module type to a native supported module type, otherwise you need to implement `parse`, `renderResourcePot` hook to handle your custom module type: + +```rust {8-18} title="src/lib.rs" +// ... ignore other code + +impl Plugin for FarmPluginExample { + fn name(&self) -> &str { + "FarmPluginExample" + } + + fn transform( + &self, + param: &farmfe_core::plugin::PluginTransformHookParam, + _context: &std::sync::Arc, + _hook_context: &farmfe_core::plugin::PluginHookContext, + ) -> farmfe_core::error::Result> { + // module type guard is required + if matches!(param.module_type, ModuleType::Custom("sass")) { + // compile sass and transform the module type from sass to css + Ok(Some(farmfe_core::plugin::PluginTransformHookResult { + module_type: "css".to_string(), + content: compileSass(param.content), + ..Default::default() + })) + } else { + Ok(None) + } + } +} +``` + +:::note +Module type guard like `matches!(param.module_type, ModuleType::Custom("sass"))` is required in the `transform` hook, cause the `transform` hook will be called for all module types, and you should only handle your custom module type in the `transform` hook. So do the `parse` and other hooks. +::: + + +or implement `parse`, `render_resource_pot_modules` hook to handle your custom module type, see how native farm css plugin handle `css` module type in [farm-plugin-css](https://github.com/farm-fe/farm/blob/main/crates/plugin_html/src/lib.rs#L159). + + +### Handle Plugin Options +The rust plugin options can be configured in `farm.config.ts`: +```javascript +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + plugins: [ + ['my-farm-plugin', { + // plugin options + myOption: 'myOption' + }] + ] +}); +``` +The Option will be json serialized and passed to the `new` method of your plugin, you can handle the options in the `new` method: +```rust title="src/lib.rs" +// ... ignore other code + +// define your rust plugin options +#[derive(serde::Deserialize)] +pub struct Options { + pub my_option: Option, +} + +impl FarmPluginExample { + fn new(config: &Config, options: String) -> Self { + // deserialize the options + let my_option: Options = serde_json::from_str(&options).unwrap(); + // handle the options... + Self {} + } +} +``` + +Note that you should add dependencies `serde` and `serde_json` to your `Cargo.toml` to support options deserialization: + +```toml +[dependencies] +# ... ignore other code +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +``` + +:::note +Non json serializable options are not supported. Which means you can only use types like string, number, boolean, array, object, etc. `function options` are not supported. +::: + +### Using farm_core In Plugin +Farm exposes all core structures and utilities in [`farmfe_core`](https://docs.rs/farmfe_core) crate. Refer to the [farmfe_core](https://docs.rs/farmfe_core) documentation for more detail. + +:::note +If you want to use swc structures like `Module`, `Program`, etc. in your plugin, you should use `farmfe_core::swc_ast` that re-exposed by farm core. Cause the swc version used by farm core may be different from the swc version you used in your plugin, and the swc version used by farm core is guaranteed to be compatible with farm core. +::: + +### Caveats +#### Using SWC In Plugin +Note that your rust plugin should not use any SWC related packages like `swc_common`, `swc_transforms`, etc. Cause SWC stores the global state in the process, it may cause **dead lock** when you use SWC in your plugin. + +Farm recommended to write [SWC Plugin](/docs/using-plugins#using-swc-plugins) if you want to make changes to the AST of your farm project. For how to write SWC plugin, see [Write SWC Plugin](https://swc.rs/docs/plugin/ecmascript/getting-started). + +#### Choosing Rust toolchain +Cause Farm Rust Plugin is a dynamic linked library, you should always use the same version of the rust toolchain as the farm core. The rust toolchain is defined in `rust-toolchain.toml`, it should **not be modified manually**. +And should should always build your plugin from Rust, cause Farm Core does not support FFI and not promise ABI stability to provide best performance. + +### Plugin Compatibility +Farm core maintains a API version that exposes to the plugin. If you met a message like `Incompatible Rust Plugin: Current core's version...`, it means your plugin is not compatible with the current farm core version. You should update your plugin to the latest version to fix the issue. + +For plugin authors, you should rebuild and publish your plugin for the latest farm core version to make your plugin compatible with the latest farm core version. + +:::note +Farm promises API Compatibility for the same major version, for example, if your plugin is compatible with farm core 1.0.0, it should also be compatible with farm core 1.1.0, 1.2.0, etc. which means your plugin will always work for the same major version of farm. +::: + +## Cross Build +A Farm Rust Plugin is a **platform specific dynamic linked library**, you should build your plugin for all platforms you want to support. +Farm provided a example for how to build your plugin using github actions, see [.github/workflows/build.yml](https://github.com/farm-fe/rust-plugin-example/blob/main/.github/workflows/build.yaml) + +By default, A farm rust plugin should be built for the following platforms: +- `linux-x64-gnu ` +- `linux-x64-musl` +- `darwin-x64` +- `win32-x64-msvc` +- `linux-arm64-musl` +- `linux-arm64-gnu` +- `darwin-arm64` +- `win32-ia32-msvc` +- `win32-arm64-msvc` + +For a public plugin that published to npm registry, we recommend you to publish your plugin for all platforms above. For a private rust plugin, you can build your plugin for any platform you want to support. + +:::tip +Cause a rust plugin is a pure dynamic linked library, if you have questions about how to build your plugin for a specific platform, just google how to build a dynamic linked library for that platform in Rust. +::: + +## Publish + +Steps to publish your Rust plugin: +1. Cross build the Rust plugin to dynamic linked library, see [Cross Build](#cross-build) for detail. +2. Copy the binary artifacts to npm dir, for example: Copy to `npm/linux-x64-gnu/index.farm`. +3. Publish platform specific packages under npm dir, you can use `farm-plugin-tool prepublish` to publish packages under `npm` dir. +4. Publish the package itself + +see example [github actions publish workflow](https://github.com/farm-fe/rust-plugin-example/blob/main/.github/workflows/release.yml) + + +## Examples +We will use `@farmfe/plugin-sass` as demostration to a real Rust plugin example. This plugin will support compiling `.scss` and `.sass` file in your farm project. + +### Define Plugin +Exports a Rust struct named `FarmPluginSass`. + +```rust title="src/lib.rs" +use farmfe_macro_plugin::farm_plugin; + +// 1. define a struct with #[farm_plugin] attribute +#[farm_plugin] +pub struct FarmPluginSass { + sass_options: String, + regex: Regex, +} + +impl FarmPluginSass { + // 2. define a new method with 2 arguments + pub fn new(_config: &Config, options: String) -> Self { + Self { + sass_options: options, + regex: Regex::new(r#"\.(sass|scss)$"#).unwrap(), + } + } +} +``` + +- The struct must be `pub` and `#[farm_plugin]` attribute is required. +- The struct must export a `new` method that accepts 2 arguments for initialization, the first argument is `&Config` and the second argument is `String`. + +### Implement Plugin Trait +`Plugin` trait is used to define `hooks` that can hook into Farm compiler. + +```rust {21-30} +use farmfe_core::plugin::Plugin; +use farmfe_macro_plugin::farm_plugin; + +// 1. define a struct with #[farm_plugin] attribute +#[farm_plugin] +pub struct FarmPluginSass { + sass_options: String, + regex: Regex, +} + +impl FarmPluginSass { + // 2. define a new method with 2 arguments + pub fn new(_config: &Config, options: String) -> Self { + Self { + sass_options: options, + regex: Regex::new(r#"\.(sass|scss)$"#).unwrap(), + } + } +} +// Implement Plugin Trait +impl Plugin for FarmPluginSass { + fn name(&self) -> &str { + "FarmPluginSass" + } + + // this plugin should be executed before internal plugins + fn priority(&self) -> i32 { + 101 + } +} +``` + +### Load `.scss` File +Implement `load` hook to support load `.scss` files. + +```rust {14-32} +// ignore other code ... + +// Implement Plugin Trait +impl Plugin for FarmPluginSass { + fn name(&self) -> &str { + "FarmPluginSass" + } + + // this plugin should be executed before internal plugins + fn priority(&self) -> i32 { + 101 + } + + fn load( + &self, + param: &farmfe_core::plugin::PluginLoadHookParam, + _context: &std::sync::Arc, + _hook_context: &farmfe_core::plugin::PluginHookContext, + ) -> farmfe_core::error::Result> { + if param.query.is_empty() && self.regex.is_match(param.resolved_path) { + let content = fs::read_file_utf8(param.resolved_path); + + if let Ok(content) = content { + return Ok(Some(farmfe_core::plugin::PluginLoadHookResult { + content, + module_type: ModuleType::Custom(String::from("sass")), + })); + } + } + + Ok(None) + } +} +``` + +In the `load` hook, we only read the file that ends with `.scss` or `.sass`, return the file content and maked its module_type as `ModuleType::Custom(String::from("sass"))`. + +### Transform `sass` File +After we load the `.scss` file, we need to transform it to `css` in `transform` hook, then Farm will treat it as css in following process. + +```rust +// ignore other code ... +fn transform( + &self, + param: &farmfe_core::plugin::PluginTransformHookParam, + context: &std::sync::Arc, +) -> farmfe_core::error::Result> { + // module type guard is neccessary + if param.module_type == ModuleType::Custom(String::from("sass")) { + // ... ignore other code + + // parse options + const options = parse_options(&self.options, param.module_id); + // compile sass to css + let compile_result = compileSass(¶m.content, options); + + return Ok(Some(farmfe_core::plugin::PluginTransformHookResult { + content: compile_result.css, + source_map: compile_result.source_map, + // tell farm compiler that we have transformed this module to css + module_type: Some(farmfe_core::module::ModuleType::Css), + ignore_previous_source_map: false, + })); + } + + Ok(None) +} +``` + +:::tip +This example only covers how to implement a transformer plugin. For more abilities that Farm support, refer to [Plugin Hooks](/docs/api/rust-plugin-api). +::: \ No newline at end of file diff --git a/docs/docs/quick-start.mdx b/docs/docs/quick-start.mdx new file mode 100644 index 0000000000..e19a165041 --- /dev/null +++ b/docs/docs/quick-start.mdx @@ -0,0 +1,118 @@ +--- +sidebar_position: 1 +--- + +import { PackageManagerTabs } from "@site/src/theme/PackageManagerTabs"; + +# Quick Start + + +:::warning Nightly Warning +If you are using version 2.0.0-nightly, please note the following: + +- The Farm team is working hard on version 2.0. We have refactored the entire Node backend and added many practical features. Please check our RoadMap for future updates. + +- This is a nightly build version that may contain new features and fixes that haven't been fully tested. As a result, unstable behavior or unexpected errors may occur. + +- Since this version is in the development phase, features and APIs may change in future versions. Please regularly check the changelog for the latest information. + +- We recommend against using this version in production environments unless you are prepared to handle potential issues. + +If you encounter any problems, please feel free to create an Issue to provide feedback to us. Your feedback is crucial for improving Farm's functionality and stability. +and we will continue to update the documentation in the coming days. Thank you for your understanding and support. +::: + + +:::warning +Farm needs **Node 16.18.0 and above**. +::: + +## Online experience + +[![Edit Farm](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/p/github/ErKeLost/react/main) + +## Create a Farm Project + + + +:::warning +If you are using the nightly version, you need to install all Farm dependencies as nightly versions. We have provided nightly versions for all core packages and plugins. e.g: +::: + + + +:::note{title="Then follow the prompts!"} + +You can also directly specify the project name and the template you want to use via additional command line options: +::: + + + +| Template | Description | Optional Features | +|:-------:|:--------:|:-------:| +| vanilla | Vanilla JavaScript | TypeScript | +| react | react18 | TypeScript | +| vue3 | vue3 | TypeScript | +| vue2 | vue2 | TypeScript | +| svelte | svelte | TypeScript | +| solid | solid | TypeScript | +| preact | preact | TypeScript | +| lit | lit | TypeScript | +| nestjs | nestjs | TypeScript | +| tauri | tauri2 | TypeScript | +| electron | electron | TypeScript | + + + +## 2. Start the Project + +Choose the package manager you like, install dependencies, then start the project. +Then, start the project: + + + +> The project will start at `http://localhost:9000` by default. + +## 3. Configuring the Project + +The project is configured by `farm.config.ts/js/mjs` file in the root directory of the project. + +```ts title="farm.config.ts" +import { defineConfig } from "@farmfe/core"; +import react from '@farmfe/plugin-react'; + +export default defineConfig({ + // Additional plugins + plugins: [react()], +}); +``` + +:::note +See **[Configuring Farm](/docs/config/configuring-farm)** for details. +::: + +## 4. Building the project + +Build the Farm project as production-ready static files: + + + +The built product is downgraded to `ES2017` by default, and the product will be compressed and Tree Shake. If you want to preview the build product locally, you can execute `npm run preview` or `npx farm preview`. + +:::note +See **[Build For Production](/docs/tutorials/build)** for details. +::: + +## 4. Preview the build products + +Start preview server + + + +## Next Steps + +- [Why Farm?](/docs/why-farm) +- [Features](/docs/features/html) +- [Configuring Farm](/docs/config/configuring-farm) +- [Plugins](/docs/plugins/official-plugins/overview) +--- diff --git a/docs/docs/tutorials/0-overview.md b/docs/docs/tutorials/0-overview.md new file mode 100644 index 0000000000..0b1ad4530f --- /dev/null +++ b/docs/docs/tutorials/0-overview.md @@ -0,0 +1,27 @@ +# Overview +In this tutorial, we will create a Farm react project from scratch, and introducing how to add useful component libraries and Farm plugins. + +:::note +Vue project is also fully supported by Farm. You can directly use `Vite`'s `@vitejs/plugin-vue` in Farm. Farm is compatible with most vite plugins and can use them out of box. +::: + +you will learn: +* How to build a production ready Farm React project from scratch. We will introduce how to add popular component library +* The basic concept of Farm, like `input`, `output`, `dev-server`, `HMR` and `plugins` +* Farm's daily configurations and commonly used plugins. + +We aim to make you familiar quickly with Farm concepts and ecosystem through this tutorial. And it can also be helpful if you want to migrate from other tools to Farm. + +:::note +This tutorial is `build a Farm react project from scratch`, If you are trying to init a new Farm Project rapidly, use our official template with command `pnpm create farm`. See **[Quick Start](/docs/quick-start)** +::: + +Following our tutorial, and open your super-fast Farm develop journey! + +* [1. Create A Farm React Project](/docs/tutorials/create) +* [2. Develop Project With Farm](/docs/tutorials/start) +* [3. Build For Production](/docs/tutorials/build) + +:::note +The source code of this tutorial is in [farm tutorials](https://github.com/farm-fe/tutorials) +::: diff --git a/docs/docs/tutorials/1-create.md b/docs/docs/tutorials/1-create.md new file mode 100644 index 0000000000..25fcc070ea --- /dev/null +++ b/docs/docs/tutorials/1-create.md @@ -0,0 +1,145 @@ +# Create A Project +In this chapter, we will create a new Farm React project **from scratch**, and launch it in development mode. + +:::note +In this tutorial, we use `pnpm` as default package manager. This chapter is `build a Farm react project from scratch`, If you are trying to init a new Farm Project rapidly, use our official template with command `pnpm create farm`. See **[Quick Start](/docs/quick-start)**. +::: + +## Create A Package +First we execute `pnpm init` to create a new package. + +```bash +mkdir farm-react && cd farm-react && pnpm init +``` + +A `package.json` file will be autogenerated. + +## Install Dependencies +Install necessary dependencies: + +react and react-dom: +```bash +pnpm add react react-dom && pnpm add react-refresh @types/react @types/react-dom -D +``` + +farm related dependencies: +```bash +pnpm add -D @farmfe/cli @farmfe/core @farmfe/plugin-react +``` +There are 3 packages that are necessary for a react project: +* **`@farmfe/cli`**: This package provides commands like `farm start`, `farm build`, `farm preview`, it must be used with `@farmfe/core` and can not be used separately. +* **`@farmfe/core`**: This package provides `Compilation` and `Dev Server` abilities, provides all necessary component for local development and product build. It exports `Compiler`, `DevServer` and `Watcher`, which is used for `compile the project`, `serve the project in development mode` and `watch the project for Hot Module Replacement`. +* **`@farmfe/plugin-react`**: This package provides abilities for React Jsx compilation, and react-refresh support. + +## Create Farm Config File +Create a `farm.config.ts` file under project root: +```text {2} +. +├── farm.config.ts +├── package.json +└── pnpm-lock.yaml +``` +and add following configuration: +```ts +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + compilation: { + input: { + index: './src/index.html' + }, + output: { + path: 'build', + publicPath: '/', + targetEnv: 'browser' + } + }, + plugins: [ + '@farmfe/plugin-react', + ] +}); +``` +For configuration file above, we use `input`, `output` and `plugins`, which is the most basic configuration in Farm. +* **`input`**: Configure the entry point. Farm will compile and build a module graph from the entries. +* **`output`**: Confiture the output dir, file name and so on. For full options, see [compilation.output](/docs/config/compilation-options#output). +* **`plugins`**: Configure farm plugins, all extended abilities like React, Vue SFC are supported by plugins. Here we use a Rust Plugin(`@farmfe/plugin-react`) to support compiling React jsx. + +Check [Configuring Farm](/docs/config/configuring-farm) for more options. + +:::note +In above example, we config input as `index: './src/index.html'`, if we do not configure `input`, it's default to `index: './index.html'`. And we can configure multiple entries in `input`, see [Multi Page App](/docs/features/html#multi-page-app) for details +::: + +## Create A Entry Html and Tsx File +Create 2 files `src/index.html` and `src/index.tsx` under project root: +```text {5-7} +. +├── farm.config.ts +├── package.json +├── pnpm-lock.yaml +└── src + ├── index.html + └── index.tsx +``` +Content of `src/index.html` is: +```html + + + + + + Document + + +
+ + + + +``` +:::note +Note that we must add at least one ` + + +``` + +and when loading dynamic scripts and css, the dynamic fetched resources url would also be: `https://cdn.com/` + +## Configuring Alias And Externals + +Alias and externals are also most useful configurations, we can use `compilation.resolve.alias` and `compilation.externals` in Farm: + +```ts title="farm.config.ts" +// ... + +export default defineConfig({ + compilation: { + resolve: { + alias: { + "@/": path.join(process.cwd(), "src"), + }, + }, + externals: ["node:fs"], + }, + // ... +}); +``` + +## Configuring DevServer + +You can find server configuration in [Farm Dev Server Options](/docs/config/dev-server). + +### Useful Configuration + +Example configuration: + +```ts +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + // All dev server options are under server + server: { + open: true, + port: 9001, + hmr: { + // Configure the port for web socket listening + port: 9801 + // Configure the host for web socket listening + host: 'localhost', + // Files to ignore when configuring file monitoring + ignores: ['auto_generated/*'] + } + //... + } +}); +``` + +For above examples, we used following options: + +- **open**: open the browser with specified port automatically +- **port**: set the dev sever port to `9001` +- **hmr**: set the hmr port and watched files, we ignores file changes under `auto_generated` directory. + +### Setup Proxy + +Configure server proxy. farm uses `http-proxy` as a proxy for the development server. Based on [http-proxy](https://github.com/http-party/node-http-proxy?tab=readme-ov-file#options) implementation, specific options refer to its documentation, example: + +```ts +import { defineConfig } from "@farmfe/core"; + +export default defineConfig({ + server: { + proxy: { + "/api": { + target: "https://music-erkelost.vercel.app/banner", + changeOrigin: true, + pathRewrite: (path: any) => path.replace(/^\/api/, ""), + }, + }, + }, +}); +``` + +## Configuring root and envDir + +Use `root` and `envDir` to specify your project root and the directory to load env variables. Add following options in `farm.config.ts`: + +```ts title="farm.config.ts" +import path from "node:path"; +import { defineConfig } from "@farmfe/core"; + +export default defineConfig({ + root: path.join(process.cwd(), "client"), + envDir: "my-env-dir", +}); +``` + +:::note +For details about `envDir`, see [Environment Variables and Modes](/docs/features/env) +::: diff --git a/docs/docs/tutorials/3-build.md b/docs/docs/tutorials/3-build.md new file mode 100644 index 0000000000..9eac7e4af1 --- /dev/null +++ b/docs/docs/tutorials/3-build.md @@ -0,0 +1,126 @@ +# Build For Production +By default, Farm has enabled support for the following features for production builds: +* **`Tree Shake`**: Crop and filter irrelevant modules and code +* **`Compression`**: Compress and mangle the output resources. +* **`Automatically inject Polyfill`**: Farm downgrades to modern browsers(ES7) by default, if you need legacy browsers support, configuring [`targetEnv`](/docs/config/compilation-options#output-targetenv) +* **`Automatic partial packaging`**: Based on dependencies and size, the project is partially bundled. For each resource request, about 25 resources are generated to ensure parallel loading performance and improve cache hits rate as much as possible. + +## Configuring Output Dir +Add build script in `package.json`: +```json title="package.json" {7-8} +{ + "name": "1-create-a-project", + "version": "1.0.0", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "start": "farm start", + "build": "farm build", + "preview": "farm preview" + }, + // ...ignore other fields +} +``` +Then execute `npm run build`, the built resources will be emitted to `build` dir: + +```text title="Project Build Resource Structure" +build +├─ favicon.ico +├─ index.html +├─ index_02bc.bd68e90b.js +├─ index_02bc.bd68e90b.js.map +├─ index_1c74.4b50f73e.js +├─ index_7734.440d56a3.js +├─ index_880b.4631ecee.js +├─ index_8d49.63f7b906.css +├─ index_8d49.63f7b906.css.map +├─ index_9025.84e1f8e6.js +├─ index_ca37.f2c276ef.js +├─ index_ef2f.e25349d8.js +├─ index_f346.369a7312.js +``` + +If you want to custom the path that the resources emitted to, you can use: +* [`output.filename`](/docs/config/compilation-options#outputfilename) +* [`output.assetsFilename`](/docs/config/compilation-options#outputassetsfilename) + +```ts title="farm.config.ts" +import defineConfig from '@farmfe/core'; + +export default defineConfig({ + compilation: { + output: { + path: 'build', + filename: 'assets/[name].[hash].[ext]', + assetsFilename: 'static/[resourceName].[ext]' + } + } +}) +``` + +For above example, all `js/css` will be emitted to `build/assets/`(example: `build/assets/index-ea54.abbe3e.js`). All static assets like image will be emitted to `build/static`(example: `build/static/background.png`) + +## Preview Built Resources +After the resources built, you can preview them by `npm run preview`: + +```sh +$ npm run preview + +> 3-build@1.0.0 preview +> farm preview + +[ Farm ] Using config file at /root/tutorials/3-build-for-production/farm.config.ts +[ Farm ] preview server running at: + +[ Farm ] > Local: http://localhost:1911/ +[ Farm ] > Network: http://198.18.0.1:1911/ +[ Farm ] > Network: http://10.242.197.146:1911/ +[ Farm ] > Network: http://192.168.1.31:1911/ +``` + +open `http://localhost:1911/` to preview your project. + +## Browser Compatibility +By default, Farm build projects to Modern Browsers that natively support `async/await`: + +* Chrome >= 62 +* Firefox >= 63 +* Safari >= 13.1 +* Edge >= 79 + +You can use [output.targetEnv](/docs/config/compilation-options#output-targetenv) to configuring your target browsers: + +```ts +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + compilation: { + output: { + targetEnv: 'browser-legacy' + } + } +}) +``` +In above example, Farm will downgrade the syntax to `es5` and inject polyfill automatically. Then we have to install `core-js@3` to polyfill injection: + +```sh +pnpm add -D core-js@3 +``` + +:::note +* You need to install `core-js@3` manually if your target to legacy browsers. +* If you want to configure browsers targets more precisely, see [Syntax Downgrade And Polyfill](/docs/advanced/polyfill) +::: + +## Configure Tree Shake and Minify +Production optimization like `treeShake` and `minify` are **disabled** by default in `development` for performance reasons, and **enabled** by default in `production`. But if `treeShake` or `minify` are configured manually, the default value will be used regardless of `development` or `production`. + +For details about tree shake and minify, see: +* [Tree Shake](/docs/advanced/tree-shake) +* [Minification](/docs/advanced/minification) + +## Configure Partial Bundling +:::note +Refer to [Partial Bundling](/docs/advanced/partial-bundling) for details. +::: + +Farm enabled best practice of bundling already, make sure you really need to configure bundles manually. See [Partial Bundling](/docs/advanced/partial-bundling) for details. diff --git a/docs/docs/using-plugins.mdx b/docs/docs/using-plugins.mdx new file mode 100644 index 0000000000..d940f2ae90 --- /dev/null +++ b/docs/docs/using-plugins.mdx @@ -0,0 +1,288 @@ +# Using Plugins +There are 4 kinds of plugins supported in Farm: +* **`Farm Compilation Plugins`**: Support both Rust Plugins and Js Plugins, which adopt a rollup-style hooks. +* **`Vite/Rollup/Unplugin Plugin`**: Vite/Rollup/Unplugin plugins are supported in Farm out of Box. +* **`Farm Runtime Plugin`**: Adding abilities for Farm's runtime system. +* **`Swc Plugins`**: Swc plugins are supported in Farm out of Box. + +Farm adopt Vite/Rollup ecosystem, Vite/Rollup Plugins can be used directly in Farm. + +:::tip +For how to write your own plugins, refer to [Writing Plugins](/docs/plugins/writing-plugins/overview) +::: + +## Farm Compilation Plugins +First, install the plugins your need, for example: +```bash +pnpm add -D @farmfe/plugin-sass @farmfe/js-plugin-postcss +``` + +Using `plugins` to configure Farm compilation plugins: +```ts title="farm.config.ts" +import farmPostcssPlugin from "@farmfe/js-plugin-postcss"; + +export default defineConfig({ + // ... + plugins: [ + // Rust plugin, configure its package name + "@farmfe/plugin-sass", + // Js plugin, configure the plugin object + farmPostcssPlugin() + ], +}); +``` + +There are 2 kinds of Farm compilation plugins: +* **`Rust Plugins`**: which is written in Rust and has best performance. +* **`Js Plugins`**: which is written in JS/TS, and it's used for compatibility with current JS ecosystem + +### Using Rust Plugins +Using `package name` to configure a Rust Plugin, for example: +```ts title="farm.config.ts" +export default defineConfig({ + // ... + plugins: [ + // Rust plugin, configure its package name + "@farmfe/plugin-sass", + ], +}); +``` +For above example, Farm will resolve package `@farmfe/plugin-sass` and treat it as a Farm Rust Plugin. + +If you want to configure options for rust plugins, you can use `array syntax` like `[packageName, optionsObject]`, for example: +```ts title="farm.config.ts" +export default defineConfig({ + // ... + plugins: [ + // using array syntax to configure a rust plugin + [ + // rust plugin's name + "@farmfe/plugin-sass", + // rust plugin's options + { + additionalData: '@use "@/global-variables.scss";' + } + ], + ], +}); +``` +Currently Farm supports 2 rust plugins officially: +* **`@farmfe/plugin-react`**: Farm rust plugin for react jsx compilation and react-refresh injection. +* **`@farmfe/plugin-sass`**: Farm rust plugin for scss files compilation, uses `sass-embedded` internally. + +:::tip +To learn more about rust plugins, see [Rust Plugins](/docs/plugins/official-plugins/overview#rust-plugins) +::: + +### Using Js Plugins +Farm JS plugin is a JS object with methods as hooks, for example: +```ts title="farm.config.ts" +import farmPostcssPlugin from "@farmfe/js-plugin-postcss"; + +export default defineConfig({ + plugins: [ + // Js plugin, configure the plugin object + farmPostcssPlugin({ + // ... configure postcss options + }) + ], +}); +``` +`farmPostcssPlugin()` returns a plugin object, and you can pass any postcss options by its arguments. + +You can use `priority` to control the order of your plugins, for example: +```ts title="farm.config.ts" {10,11} +import farmPostcssPlugin from "@farmfe/js-plugin-postcss"; + +export default defineConfig({ + plugins: [ + // Js plugin, configure the plugin object + { + ...farmPostcssPlugin({ + // ... configure postcss options + }), + // larger priority will be executed first, priority of internal plugin are 100. + priority: 1000, + } + ], +}); +``` +priority of internal plugin are 100, if you want the plugin execute first, set it larger than 100, otherwise set it smaller than 100. + +If you want to add a Farm JS plugin quickly, you can just configure a plugin object: +```ts title="farm.config.ts" +import readFileSync from 'fs'; + +export default defineConfig({ + plugins: [ + // configure a custom plugin + { + // plugin name, required + name: 'my-first-farm-plugin', + // this priority of this plugin, bigger value will be executed first, default to 100. + priority: 1000, + // define a load hook to determine how to load a more + load: { + // to improve performance, modules will be skipped if they don't match the filters. + filters: { + // only be executed for .png files. + resolvedPaths: ['\\.png$'] + }, + // executor callback for this hook + executor: (params, context) => { + const { resolvedPath } = params; + const content = readFileSync(resolvedPath, 'utf-8'); + + return { + content: `export default '${content}'`, + moduleType: 'js' + } + } + } + } + ], +}); +``` +:::note +`filters` is required in Farm for js plugins. Because Js Plugin is really slow and we should avoid executing it as much as possible. For those modules that don't match the filters, Farm won't trigger js plugin hook for them at all! Which means Farm can handle them only on Rust side safely and concurrently. +::: + +:::tip +To learn more about Farm Js Plugins, refer to [JS Plugin](/docs/plugins/official-plugins/overview#js-plugins) +::: + +## Using Vite/Rollup/Unplugin Plugins In Farm +Farm supports Vite plugins out of Box. First you need to install vite plugins,for example: +```bash +pnpm add @vitejs/plugin-vue @vitejs/plugin-vue-jsx vite -D +``` + +Then you can use vite plugins directly by `vitePlugins` in `farm.config.ts`. + +```ts title="farm.config.ts" +import vue from '@vitejs/plugin-vue', +import vueJsx from '@vitejs/plugin-vue-jsx'; + +export default defineConfig({ + // configuring vite plugins + vitePlugins: [ + vue(), + vueJsx() + ] +}); +``` +To improve performance of vite plugins, you can use `function syntax` that returns a `filters`, for example: + +```ts title="farm.config.ts" +import vue from '@vitejs/plugin-vue', + +// Using function syntax of Vite plugin +function configureVitePluginVue() { + // return plugin and its filters + return { + // using plugin vue + vitePlugin: vue(), + // configuring filters for it. Unmatched module paths will be skipped. + filters: ['\\.vue$', '\\\\0.+'] + }; +} + +export default defineConfig({ + // configuring vite plugins + vitePlugins: [ + configureVitePluginVue + ] +}); +``` + +Using unplugin: +```bash +pnpm add unplugin-auto-import unplugin-vue-components -D +``` +configuring unplugin in `vitePlugins` via `unplugin/vite` or `unplugin/rollup`: +```ts title="farm.config.ts" +import vue from '@vitejs/plugin-vue', +import AutoImport from 'unplugin-auto-import/vite' +import Components from 'unplugin-vue-components/vite' +import { ElementPlusResolver } from 'unplugin-vue-components/resolvers' + +export default defineConfig({ + vitePlugins: [ + vue(), + // ... + AutoImport({ + resolvers: [ElementPlusResolver({ importStyle: 'sass' })], + }), + Components({ + resolvers: [ElementPlusResolver({ importStyle: 'sass' })], + }), + ] +}); +``` +:::note +Currently you can use `unplugin/vite` or `unplugin/rollup`. `unplugin/farm` will be available as soon as [this unplugin PR](https://github.com/unjs/unplugin/pull/341) merged. +::: + + +## Farm Runtime Plugin +Farm has a runtime module system to control how to load and execute modules. Configuring `compilation.runtime.plugins` to add more runtime plugin, for example: +```ts +export default defineConfig({ + compilation: { + // configure Farm runtime module system + runtime: { + plugins: [ + // a runtime plugin package + require.resolve('farm-plugin-runtime-mock'), + // a local runtime plugin + path.join(process.cwd(), "build/runtime-plugin.ts") + ] + } + } +}); +``` +you have to configure a path that point to your runtime plugin's entry. Recommend to a absolute path to avoid path issue. + +:::tip +To learn more about runtime plugin refer to [Runtime Plugin](/docs/plugins/writing-plugins/runtime-plugin) +::: + +## Using SWC Plugins +Swc Plugin can also be used directly in Farm, Configuring `compilation.script.plugins` to add SWC plugins, for example: +```ts +import jsPluginVue from '@farmfe/js-plugin-vue'; + +/** + * @type {import('@farmfe/core').UserConfig} + */ +export default { + compilation: { + script: { + plugins: [{ + // the package name of the swc plugin + name: 'swc-plugin-vue-jsx', + // options of this swc plugin + options: { + "transformOn": true, + "optimize": true + }, + // plugin execute when the filters are matched. + filters: { + // resolvedPaths: [".+"] + moduleTypes: ['tsx', 'jsx'], + } + }] + } + }, + plugins: [jsPluginVue()], +}; +``` + +Each plugin item of the array contains three fields: +* **name**: the package name of the swc plugin +* **options**: Configuration items passed to swc plugin +* **filters**: Which modules to execute the plug-in, must be configured, support `resolvedPaths` and `moduleTypes` these two filter items, if both are specified at the same time, take the union. + +:::note +`SWC plugin` may not be compatible with the `SWC version`(rust crate `swc_core v0.90`) that Farm uses. If a error occurred, try upgrade the plugin version. +::: diff --git a/docs/docs/why-farm.md b/docs/docs/why-farm.md new file mode 100644 index 0000000000..d1b47a4d23 --- /dev/null +++ b/docs/docs/why-farm.md @@ -0,0 +1,35 @@ +--- +sidebar_position: 2 +--- + +# Why Farm? + +## What is Farm? +Farm is an extremely fast Rust-based web build tool, like `webpack` and `vite`, but **`much faster`**. Farm resolves, loads, and transforms all of your `assets(js/jsx/ts/tsx, css/sass/less, html, static assets, json, etc)`, and bundle them into a set of `deployable files`. Farm is an extremely fast build tool that helps you build faster `web/nodejs` apps. + +## Why Farm? + +As web projects scale, build performance has been their major bottleneck. For a huge project compiling with webpack may cost 10 or more minutes and an HMR update may cost 10s or more, heavily reducing development efficiency. + +Then, tools like Vite came out. It uses native ESM and is unbundled for source files in dev mode, pre-bundles dependencies using esbuild, which makes the dev server launch and the HMR very fast. + +But Unbundled is not perfect, there are still big problems when comes to a large project: +* **The huge number of module requests**: For a large project, there may be thousands of modules that need to be loaded. Using the native module system to load thousands of modules will make the browser get stuck or even cause it to crash. +* **Inconsistency between Dev and Production**: Native modules cannot be used in production for most situations, due to compatibility and request number issues. So Unbundled tools choose to bundle in production. This brings inconsistency, when there are production bugs caused by this inconsistency, it's really hard to debug and really painful. Vite uses esbuild in dev and using rollup in production, which makes the inconsistency worse. +* **Inflexible Chunk Splitting**: Configuration for Chunk Splitting is not flexible enough. +* Vite is so fast in dev because of esbuild, which is written in go. Go takes advantage of the native platform and is much faster than JS. + +So I think we just need a fast, powerful, consistent web bundler, which can solve the problems above and fast, then I designed and implemented Farm. + +And Farm is not just a normal bundler re-written in Rust, it has a lot of powerful and progressive designs: + +## Farm Design Philosophy + +* **Performance first**: Everything will be written in Rust for as long as we can; only several parts which are not the performance bottleneck will be written in JS. +* **Consistency first**: Make sure that development and production are exactly the same by default. What you see in development will be the same as what you get in production. +* **Partial Bundling**: The bundling goal of Farm is not to bundle everything together, but to limit the request numbers of resources. Farm will bundle your project into 20-30 small resources according to the dependency relation and resource size, to get the best resource loading performance without losing caching granularity. +* **First class citizen support of all web assets**: Farm won't need to transform everything to Javascript any more, it treats anything as first class citizen, assets like `html`, `js/jsx/ts/tsx`, `css/scss`, `png/svg/...` are all basic modules supported by Farm, more assets can be supported by plugins. +* **Compatibility**: Farm will work with both legacy (ES5) and modern browsers. +* **Rollup style plugin system and vite/rollup compatible js-plugins**: Easy to create your own plugins and easy to migrate your plugins/projects from rollup/vite. Support both Rust and JS plugins. + +Farm's goal is to be the real next generation build tool, inherit all advantages from existing tools, and to be fast, powerful, consistent, and provide the best development experience for web developers. diff --git a/docs/documate.json b/docs/documate.json new file mode 100644 index 0000000000..344a02b221 --- /dev/null +++ b/docs/documate.json @@ -0,0 +1,5 @@ +{ + "root": "docs", + "include": ["**/*.md", "**/*.mdx"], + "backend": "https://8gw8jajsc1.us.aircode.run/upload" +} diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js new file mode 100644 index 0000000000..d4901b5001 --- /dev/null +++ b/docs/docusaurus.config.js @@ -0,0 +1,203 @@ +import { themes as prismThemes } from "prism-react-renderer"; +import remarkGfm from "remark-gfm"; + +/** @type {import('@docusaurus/types').Config} */ +const config = { + title: "Farm", + tagline: "Super fast web build tool written in Rust", + favicon: "img/favicon.ico", + + url: "https://farmfe.org", + // Set the // pathname under which your site is served + // For GitHub pages deployment, it is often '//' + baseUrl: "/", + // GitHub pages deployment config. + // If you aren't using GitHub pages, you don't need these. + organizationName: "farm-fe", // Usually your GitHub org/user name. + projectName: "farm-fe.github.io", // Usually your repo name. + deploymentBranch: "gh-pages", + onBrokenLinks: "ignore", + // onBrokenLinks: "throw", + onBrokenMarkdownLinks: "warn", + + i18n: { + defaultLocale: "en", + locales: ["en", "zh"], + localeConfigs: { + en: { + label: "English", + direction: "ltr", + }, + zh: { + label: `简体中文`, + direction: "ltr", + }, + }, + }, + + presets: [ + [ + "@docusaurus/preset-classic", + /** @type {import('@docusaurus/preset-classic').Options} */ + ({ + docs: { + sidebarPath: require.resolve("./sidebars.js"), + // Please change this to your repo. + // Remove this to remove the "edit this page" links. + // remarkPlugins: [remarkGfm], + editUrl: "https://github.com/farm-fe/farm-fe.github.io/tree/main/", + lastVersion: "current", + versions: { + current: { + label: "2.0.0-nightly Version", + }, + }, + }, + theme: { + customCss: require.resolve("./src/css/custom.scss"), + }, + }), + ], + ], + themeConfig: + /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ + ({ + // Replace with your project's social card + image: "img/farm-social-card.png", + navbar: { + title: "Farm", + logo: { + alt: "My Site Logo", + src: "img/logo.png", + }, + items: [ + { + type: "doc", + docId: "quick-start", + position: "left", + label: "Guides", + }, + { + type: "doc", + docId: "config/configuring-farm", + position: "left", + label: "Config", + }, + { + type: "doc", + docId: "api/rust-plugin-api", + position: "left", + label: "API", + }, + { + type: "doc", + docId: "plugins/official-plugins/overview", + position: "left", + label: "Plugins", + }, + { + position: "left", + label: "Community", + items: [ + { + label: "Team", + to: "/team", + }, + { + label: "Blog", + to: "/blog/index", + }, + { + label: "Awesome Farm", + href: "https://github.com/farm-fe/awesome-farm", + }, + { + label: "Discord", + href: "https://discord.com/invite/mDErq9aFnF", + }, + { + label: "Twitter", + href: "https://x.com/brightwwu46799", + }, + { + label: "WeChat Group", + href: "https://github.com/farm-fe/farm?tab=readme-ov-file#chat-with-us", + }, + ], + }, + { + to: "/roadmap", + position: "left", + label: "Roadmap", + }, + { + type: "docsVersionDropdown", + position: "right", + }, + { + type: "localeDropdown", + position: "right", + }, + + { + href: "https://github.com/farm-fe/farm", + position: "right", + className: "header-github-link", + "aria-label": "GitHub repository", + }, + ], + }, + docs: { + versionPersistence: "localStorage", + }, + prism: { + additionalLanguages: ["powershell"], + theme: prismThemes.nightOwlLight, + darkTheme: prismThemes.oneDark, + magicComments: [ + // Remember to extend the default highlight class name as well! + { + className: "theme-code-block-highlighted-line", + line: "highlight-next-line", + block: { start: "highlight-start", end: "highlight-end" }, + }, + { + className: "code-block-highlight-line", + line: "c-highlight-next-line", + block: { start: "c-highlight-start", end: "c-highlight-end" }, + }, + ], + }, + // announcementBar: { + // id: "announcementBar-2", // Increment on change + // content: `🎉 Farm is now in 1.0.0 stable and production ready. If you like Farm, give it a ⭐️ on GitHub`, + // }, + customFields: { + customFooter: "src/theme/Footer/index.tsx", + }, + algolia: { + appId: "G3J92PUFY2", + apiKey: "2b0f3f1f06f381249d44682a21206f4f", + indexName: "farm-feio", + }, + colorMode: { + defaultMode: "light", + }, + }), + plugins: [ + "docusaurus-plugin-sass", + async function TailwindCSSPlugin(context, options) { + return { + name: "docusaurus-tailwindcss", + configurePostCss(postcssOptions) { + // Appends TailwindCSS and AutoPrefixer. + postcssOptions.plugins.push(require("tailwindcss")); + postcssOptions.plugins.push(require("autoprefixer")); + return postcssOptions; + }, + }; + }, + ], +}; + +module.exports = config; diff --git a/docs/i18n/zh/code.json b/docs/i18n/zh/code.json new file mode 100644 index 0000000000..0a9dd01c00 --- /dev/null +++ b/docs/i18n/zh/code.json @@ -0,0 +1,518 @@ +{ + "theme.ErrorPageContent.title": { + "message": "页面已崩溃。", + "description": "The title of the fallback page when the page crashed" + }, + "theme.ErrorPageContent.tryAgain": { + "message": "重试", + "description": "The label of the button to try again rendering when the React error boundary captures an error" + }, + "theme.NotFound.title": { + "message": "找不到页面", + "description": "The title of the 404 page" + }, + "theme.NotFound.p1": { + "message": "我们找不到您要找的页面。", + "description": "The first paragraph of the 404 page" + }, + "theme.NotFound.p2": { + "message": "请联系原始链接来源网站的所有者,并告知他们链接已损坏。", + "description": "The 2nd paragraph of the 404 page" + }, + "theme.admonition.note": { + "message": "备注", + "description": "The default label used for the Note admonition (:::note)" + }, + "theme.admonition.tip": { + "message": "提示", + "description": "The default label used for the Tip admonition (:::tip)" + }, + "theme.admonition.danger": { + "message": "危险", + "description": "The default label used for the Danger admonition (:::danger)" + }, + "theme.admonition.info": { + "message": "信息", + "description": "The default label used for the Info admonition (:::info)" + }, + "theme.admonition.caution": { + "message": "警告", + "description": "The default label used for the Caution admonition (:::caution)" + }, + "theme.blog.archive.title": { + "message": "历史博文", + "description": "The page & hero title of the blog archive page" + }, + "theme.blog.archive.description": { + "message": "历史博文", + "description": "The page & hero description of the blog archive page" + }, + "theme.BackToTopButton.buttonAriaLabel": { + "message": "回到顶部", + "description": "The ARIA label for the back to top button" + }, + "theme.blog.paginator.navAriaLabel": { + "message": "博文列表分页导航", + "description": "The ARIA label for the blog pagination" + }, + "theme.blog.paginator.newerEntries": { + "message": "较新的博文", + "description": "The label used to navigate to the newer blog posts page (previous page)" + }, + "theme.blog.paginator.olderEntries": { + "message": "较旧的博文", + "description": "The label used to navigate to the older blog posts page (next page)" + }, + "theme.blog.post.paginator.navAriaLabel": { + "message": "博文分页导航", + "description": "The ARIA label for the blog posts pagination" + }, + "theme.blog.post.paginator.newerPost": { + "message": "较新一篇", + "description": "The blog post button label to navigate to the newer/previous post" + }, + "theme.blog.post.paginator.olderPost": { + "message": "较旧一篇", + "description": "The blog post button label to navigate to the older/next post" + }, + "theme.blog.post.plurals": { + "message": "{count} 篇博文", + "description": "Pluralized label for \"{count} posts\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.blog.tagTitle": { + "message": "{nPosts} 含有标签「{tagName}」", + "description": "The title of the page for a blog tag" + }, + "theme.tags.tagsPageLink": { + "message": "查看所有标签", + "description": "The label of the link targeting the tag list page" + }, + "theme.colorToggle.ariaLabel": { + "message": "切换浅色/暗黑模式(当前为{mode})", + "description": "The ARIA label for the navbar color mode toggle" + }, + "theme.colorToggle.ariaLabel.mode.dark": { + "message": "暗黑模式", + "description": "The name for the dark color mode" + }, + "theme.colorToggle.ariaLabel.mode.light": { + "message": "浅色模式", + "description": "The name for the light color mode" + }, + "theme.docs.breadcrumbs.navAriaLabel": { + "message": "页面路径", + "description": "The ARIA label for the breadcrumbs" + }, + "theme.docs.DocCard.categoryDescription": { + "message": "{count} 个项目", + "description": "The default description for a category card in the generated index about how many items this category includes" + }, + "theme.docs.paginator.navAriaLabel": { + "message": "文档分页导航", + "description": "The ARIA label for the docs pagination" + }, + "theme.docs.paginator.previous": { + "message": "上一页", + "description": "The label used to navigate to the previous doc" + }, + "theme.docs.paginator.next": { + "message": "下一页", + "description": "The label used to navigate to the next doc" + }, + "theme.docs.tagDocListPageTitle.nDocsTagged": { + "message": "{count} 篇文档带有标签", + "description": "Pluralized label for \"{count} docs tagged\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.docs.tagDocListPageTitle": { + "message": "{nDocsTagged}「{tagName}」", + "description": "The title of the page for a docs tag" + }, + "theme.docs.versionBadge.label": { + "message": "版本:{versionLabel}" + }, + "theme.docs.versions.unreleasedVersionLabel": { + "message": "此为 {siteTitle} {versionLabel} 版尚未发行的文档。", + "description": "The label used to tell the user that he's browsing an unreleased doc version" + }, + "theme.docs.versions.unmaintainedVersionLabel": { + "message": "此为 {siteTitle} {versionLabel} 版的文档,现已不再积极维护。", + "description": "The label used to tell the user that he's browsing an unmaintained doc version" + }, + "theme.docs.versions.latestVersionSuggestionLabel": { + "message": "最新的文档请参阅 {latestVersionLink} ({versionLabel})。", + "description": "The label used to tell the user to check the latest version" + }, + "theme.docs.versions.latestVersionLinkLabel": { + "message": "最新版本", + "description": "The label used for the latest version suggestion link label" + }, + "theme.common.editThisPage": { + "message": "编辑此页", + "description": "The link label to edit the current page" + }, + "theme.common.headingLinkTitle": { + "message": "{heading}的直接链接", + "description": "Title for link to heading" + }, + "theme.lastUpdated.atDate": { + "message": "于 {date} ", + "description": "The words used to describe on which date a page has been last updated" + }, + "theme.lastUpdated.byUser": { + "message": "由 {user} ", + "description": "The words used to describe by who the page has been last updated" + }, + "theme.lastUpdated.lastUpdatedAtBy": { + "message": "最后{byUser}{atDate}更新", + "description": "The sentence used to display when a page has been last updated, and by who" + }, + "theme.navbar.mobileVersionsDropdown.label": { + "message": "选择版本", + "description": "The label for the navbar versions dropdown on mobile view" + }, + "theme.tags.tagsListLabel": { + "message": "标签:", + "description": "The label alongside a tag list" + }, + "theme.AnnouncementBar.closeButtonAriaLabel": { + "message": "关闭", + "description": "The ARIA label for close button of announcement bar" + }, + "theme.blog.sidebar.navAriaLabel": { + "message": "最近博文导航", + "description": "The ARIA label for recent posts in the blog sidebar" + }, + "theme.CodeBlock.copied": { + "message": "复制成功", + "description": "The copied button label on code blocks" + }, + "theme.CodeBlock.copyButtonAriaLabel": { + "message": "复制代码到剪贴板", + "description": "The ARIA label for copy code blocks button" + }, + "theme.CodeBlock.copy": { + "message": "复制", + "description": "The copy button label on code blocks" + }, + "theme.CodeBlock.wordWrapToggle": { + "message": "切换自动换行", + "description": "The title attribute for toggle word wrapping button of code block lines" + }, + "theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel": { + "message": "打开/收起侧边栏菜单「{label}」", + "description": "The ARIA label to toggle the collapsible sidebar category" + }, + "theme.NavBar.navAriaLabel": { + "message": "主导航", + "description": "The ARIA label for the main navigation" + }, + "theme.navbar.mobileLanguageDropdown.label": { + "message": "选择语言", + "description": "The label for the mobile language switcher dropdown" + }, + "theme.TOCCollapsible.toggleButtonLabel": { + "message": "本页总览", + "description": "The label used by the button on the collapsible TOC component" + }, + "theme.blog.post.readMore": { + "message": "阅读更多", + "description": "The label used in blog post item excerpts to link to full blog posts" + }, + "theme.blog.post.readMoreLabel": { + "message": "阅读 {title} 的全文", + "description": "The ARIA label for the link to full blog posts from excerpts" + }, + "theme.blog.post.readingTime.plurals": { + "message": "阅读需 {readingTime} 分钟", + "description": "Pluralized label for \"{readingTime} min read\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.docs.breadcrumbs.home": { + "message": "主页面", + "description": "The ARIA label for the home page in the breadcrumbs" + }, + "theme.docs.sidebar.collapseButtonTitle": { + "message": "收起侧边栏", + "description": "The title attribute for collapse button of doc sidebar" + }, + "theme.docs.sidebar.collapseButtonAriaLabel": { + "message": "收起侧边栏", + "description": "The title attribute for collapse button of doc sidebar" + }, + "theme.docs.sidebar.navAriaLabel": { + "message": "文档侧边栏", + "description": "The ARIA label for the sidebar navigation" + }, + "theme.docs.sidebar.closeSidebarButtonAriaLabel": { + "message": "关闭导航栏", + "description": "The ARIA label for close button of mobile sidebar" + }, + "theme.navbar.mobileSidebarSecondaryMenu.backButtonLabel": { + "message": "← 回到主菜单", + "description": "The label of the back button to return to main menu, inside the mobile navbar sidebar secondary menu (notably used to display the docs sidebar)" + }, + "theme.docs.sidebar.toggleSidebarButtonAriaLabel": { + "message": "切换导航栏", + "description": "The ARIA label for hamburger menu button of mobile navigation" + }, + "theme.docs.sidebar.expandButtonTitle": { + "message": "展开侧边栏", + "description": "The ARIA label and title attribute for expand button of doc sidebar" + }, + "theme.docs.sidebar.expandButtonAriaLabel": { + "message": "展开侧边栏", + "description": "The ARIA label and title attribute for expand button of doc sidebar" + }, + "theme.SearchPage.documentsFound.plurals": { + "message": "找到 {count} 份文件", + "description": "Pluralized label for \"{count} documents found\". Use as much plural forms (separated by \"|\") as your language support (see https://www.unicode.org/cldr/cldr-aux/charts/34/supplemental/language_plural_rules.html)" + }, + "theme.SearchPage.existingResultsTitle": { + "message": "「{query}」的搜索结果", + "description": "The search page title for non-empty query" + }, + "theme.SearchPage.emptyResultsTitle": { + "message": "在文档中搜索", + "description": "The search page title for empty query" + }, + "theme.SearchPage.inputPlaceholder": { + "message": "在此输入搜索字词", + "description": "The placeholder for search page input" + }, + "theme.SearchPage.inputLabel": { + "message": "搜索", + "description": "The ARIA label for search page input" + }, + "theme.SearchPage.algoliaLabel": { + "message": "通过 Algolia 搜索", + "description": "The ARIA label for Algolia mention" + }, + "theme.SearchPage.noResultsText": { + "message": "未找到任何结果", + "description": "The paragraph for empty search result" + }, + "theme.SearchPage.fetchingNewResults": { + "message": "正在获取新的搜索结果...", + "description": "The paragraph for fetching new search results" + }, + "theme.SearchBar.seeAll": { + "message": "查看全部 {count} 个结果" + }, + "theme.SearchBar.label": { + "message": "搜索", + "description": "The ARIA label and placeholder for search button" + }, + "theme.SearchModal.searchBox.resetButtonTitle": { + "message": "清除查询", + "description": "The label and ARIA label for search box reset button" + }, + "theme.SearchModal.searchBox.cancelButtonText": { + "message": "取消", + "description": "The label and ARIA label for search box cancel button" + }, + "theme.SearchModal.startScreen.recentSearchesTitle": { + "message": "最近搜索", + "description": "The title for recent searches" + }, + "theme.SearchModal.startScreen.noRecentSearchesText": { + "message": "没有最近搜索", + "description": "The text when no recent searches" + }, + "theme.SearchModal.startScreen.saveRecentSearchButtonTitle": { + "message": "保存这个搜索", + "description": "The label for save recent search button" + }, + "theme.SearchModal.startScreen.removeRecentSearchButtonTitle": { + "message": "从历史记录中删除这个搜索", + "description": "The label for remove recent search button" + }, + "theme.SearchModal.startScreen.favoriteSearchesTitle": { + "message": "收藏", + "description": "The title for favorite searches" + }, + "theme.SearchModal.startScreen.removeFavoriteSearchButtonTitle": { + "message": "从收藏列表中删除这个搜索", + "description": "The label for remove favorite search button" + }, + "theme.SearchModal.errorScreen.titleText": { + "message": "无法获取结果", + "description": "The title for error screen of search modal" + }, + "theme.SearchModal.errorScreen.helpText": { + "message": "你可能需要检查网络连接。", + "description": "The help text for error screen of search modal" + }, + "theme.SearchModal.footer.selectText": { + "message": "选中", + "description": "The explanatory text of the action for the enter key" + }, + "theme.SearchModal.footer.selectKeyAriaLabel": { + "message": "Enter 键", + "description": "The ARIA label for the Enter key button that makes the selection" + }, + "theme.SearchModal.footer.navigateText": { + "message": "导航", + "description": "The explanatory text of the action for the Arrow up and Arrow down key" + }, + "theme.SearchModal.footer.navigateUpKeyAriaLabel": { + "message": "向上键", + "description": "The ARIA label for the Arrow up key button that makes the navigation" + }, + "theme.SearchModal.footer.navigateDownKeyAriaLabel": { + "message": "向下键", + "description": "The ARIA label for the Arrow down key button that makes the navigation" + }, + "theme.SearchModal.footer.closeText": { + "message": "关闭", + "description": "The explanatory text of the action for Escape key" + }, + "theme.SearchModal.footer.closeKeyAriaLabel": { + "message": "Esc 键", + "description": "The ARIA label for the Escape key button that close the modal" + }, + "theme.SearchModal.footer.searchByText": { + "message": "搜索提供", + "description": "The text explain that the search is making by Algolia" + }, + "theme.SearchModal.noResultsScreen.noResultsText": { + "message": "没有结果:", + "description": "The text explains that there are no results for the following search" + }, + "theme.SearchModal.noResultsScreen.suggestedQueryText": { + "message": "试试搜索", + "description": "The text for the suggested query when no results are found for the following search" + }, + "theme.SearchModal.noResultsScreen.reportMissingResultsText": { + "message": "认为这个查询应该有结果?", + "description": "The text for the question where the user thinks there are missing results" + }, + "theme.SearchModal.noResultsScreen.reportMissingResultsLinkText": { + "message": "请告知我们。", + "description": "The text for the link to report missing results" + }, + "theme.SearchModal.placeholder": { + "message": "搜索文档", + "description": "The placeholder of the input of the DocSearch pop-up modal" + }, + "theme.common.skipToMainContent": { + "message": "跳到主要内容", + "description": "The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation" + }, + "theme.tags.tagsPageTitle": { + "message": "标签", + "description": "The title of the tag list page" + }, + "Super Fast Web": { + "message": "Super Fast Web" + }, + "Build Tool": { + "message": "Build Tool" + }, + "Written In": { + "message": "Written In" + }, + "Quick Start": { + "message": "快速开始" + }, + "Why Farm?": { + "message": "为什么选择 Farm ?" + }, + "Super Fast": { + "message": "超级快" + }, + "Super Fast: Written in Rust, start a React / Vue project in milliseconds and perform an HMR update within 10ms for most situations.": { + "message": "超快: 用 Rust 编写, 在毫秒内启动 React / Vue 项目, 并在大多数情况下在10毫秒内执行热更新。" + }, + "Rich Features": { + "message": "丰富的特性" + }, + "Rich Features and Fully Pluggable": { + "message": "丰富的特性和完全可插拔" + }, + "Fully Pluggable": { + "message": "完全可插拔" + }, + "Partial Bundling": { + "message": "局部打包" + }, + "Consistency": { + "message": "一致性" + }, + "Extremely Fast": { + "message": "超级快" + }, + "Extremely": { + "message": "极速" + }, + " Fast ": { + "message": "的" + }, + " Build Tool .": { + "message": "构建工具" + }, + "Written in": { + "message": "使用 " + }, + " Rust": { + "message": "Rust 编写" + }, + "Incremental Building": { + "message": "增量构建" + }, + "Get to know our team": { + "message": "认识我们的团队" + }, + "is a Rust-Based Web Building Engine to Facilitate Your Web Program and JavaScript Library": { + "message": "是一个基于 Rust 实现的极速构建引擎,帮助您更快地构建 Web 程序 和 JavaScript 库。" + }, + "Written in Rust, start a React / Vue project in milliseconds and perform an HMR update within 10ms for most situations.": { + "message": "用Rust编写,可以在毫秒内启动React/Vue项目,并在大多数情况下在10毫秒内进行热模块替换(HMR)更新。" + }, + "What you see in development will be the same as what you get in production. Supports both legacy (ES5) and modern browsers.": { + "message": "一致性: 开发环境和生产环境的表现一致,所见即所得。支持传统(ES5)和现代浏览器。" + }, + "Incremental Building: Support persistent cache, module level cache enabled by default, any module won't be compiled twice until it's changed!": { + "message": "增量构建:默认启用, 支持持久缓存,模块级别缓存,任何模块在未发生变化之前不会被重新编译!" + }, + "Farm support compiling Html, Css, Css Modules, Js/Jsx/Ts/Tsx, Json, Static Assets out of box, support sass, less, postcss, vue, react, solid by official plugins, support lazy compiling, partial bundling and more": { + "message": "丰富的编译能力支持: 开箱即用, Farm 内置了 Js/Ts/Jsx/Tsx、Css/Css Modules/Sass/Less、HTML 和静态资源,可以通过官方插件支持 sass、less、postcss、react、vue、solid 等常用技术栈,支持懒编译、局部打包等海量特性。" + }, + "Fully Pluggable and Vite Compatible": { + "message": "完全可插拔 & 兼容 Vite 生态" + }, + "Consistency and Compatibility": { + "message": "一致性 & 兼容性" + }, + "Everything inside Farm is powered by plugins, Supports both Rust and JavaScript plugins. Support Vite plugins out of box.": { + "message": "Farm 由插件驱动, 通过创建插件来实现任何您想要的功能, 同时支持 Rust 和 JavaScript 两种插件模式, 开箱即用支持 Vite 插件。" + }, + "Farm supports compiling HTML, CSS, CSS Modules, Js/Jsx/Ts/Tsx, JSON, Static Assets out of the box, supports Sass, Less, PostCSS, Vue, React, Solid by way of official plugins, supports lazy compiling, partial bundling and more. Everything inside Farm is powered by plugins, Supports both Rust and JavaScript plugins. Support Vite plugins out of box.": { + "message": "丰富的编译能力支持: 开箱即用, Farm 内置了 Js/Ts/Jsx/Tsx、Css/Css Modules/Sass/Less、HTML 和静态资源,可以通过官方插件支持 sass、less、postcss、react、vue、solid 等常用技术栈,支持懒编译、局部打包等海量特性。并且 Farm 由插件驱动, 通过创建插件来实现任何您想要的功能, 同时支持 Rust 和 JavaScript 两种插件模式, 开箱即用支持 Vite 插件。" + }, + "Partial Bundling: Bundle your project into a few reasonable bundles, speeding up resource loading without losing caching granularity.": { + "message": "自动根据依赖关系、资源大小,将项目打包成若干个资源,提升资源加载性能的同时,保证缓存命中率。" + }, + "Contributors": { + "message": "感谢贡献者" + }, + "ColdStart": { + "message": "冷启动" + }, + "HotStart": { + "message": "热启动" + }, + "HmrRoot": { + "message": "热更新 (根模块)" + }, + "HmrLeaf": { + "message": "热更新 (子模块)" + }, + "ColdBuild": { + "message": "冷构建" + }, + "HotBuild": { + "message": "热构建" + }, + "See benchmark details": { + "message": "查看 benchmark 详情" + } +} diff --git a/docs/i18n/zh/docusaurus-plugin-content-blog/options.json b/docs/i18n/zh/docusaurus-plugin-content-blog/options.json new file mode 100644 index 0000000000..9239ff706c --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-blog/options.json @@ -0,0 +1,14 @@ +{ + "title": { + "message": "Blog", + "description": "The title for the blog used in SEO" + }, + "description": { + "message": "Blog", + "description": "The description for the blog used in SEO" + }, + "sidebar.title": { + "message": "Recent posts", + "description": "The label for the left sidebar" + } +} diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current.json b/docs/i18n/zh/docusaurus-plugin-content-docs/current.json new file mode 100644 index 0000000000..a07aaf700e --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current.json @@ -0,0 +1,50 @@ +{ + "version.label": { + "message": "1.0.0", + "description": "当前文档版本" + }, + "sidebar.tutorialSidebar.category.Features": { + "message": "编译能力", + "description": "Farm 的各项编译能力文档" + }, + "sidebar.tutorialSidebar.category.Benchmarks": { + "message": "基准测试", + "description": "Farm 的各项编译能力以及其他框架基准测试的对比" + }, + "sidebar.tutorialSidebar.category.Getting Started": { + "message": "快速开始", + "description": "Farm 的快速开始以及介绍" + }, + "sidebar.tutorialSidebar.category.Tutorial": { + "message": "教程", + "description": "Farm 的教程文档" + }, + "sidebar.tutorialSidebar.category.Advanced": { + "message": "高级用法", + "description": "Farm 的进阶用法介绍" + }, + "sidebar.tutorialSidebar.category.Frameworks": { + "message": "框架模版", + "description": "Farm 的框架支持模版" + }, + "sidebar.tutorialSidebar.category.Migration": { + "message": "迁移指南", + "description": "从其他构建工具迁移到Farm 的指南" + }, + "sidebar.pluginSidebar.category.Writing Plugins": { + "message": "编写插件", + "description": "编写 Farm 插件" + }, + "sidebar.pluginSidebar.category.Official Plugins": { + "message": "官方插件", + "description": "Farm 官方插件介绍" + }, + "sidebar.pluginSidebar.category.Rust Plugins": { + "message": "Rust 插件", + "description": "Farm Rust 官方插件介绍" + }, + "sidebar.pluginSidebar.category.Js Plugins": { + "message": "Js 插件", + "description": "Farm Js 官方插件介绍" + } +} \ No newline at end of file diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/advanced/minification.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/advanced/minification.md new file mode 100644 index 0000000000..1f48f6caf0 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/advanced/minification.md @@ -0,0 +1,22 @@ +# 产物压缩 + +Farm 支持开箱即用的生产压缩,默认情况下在生产中自动启用,可以通过[compilation.minify](/zh/docs/config/compilation-options#minify) 选项启用或禁用。 + +```ts title="farm.config.ts" +export default { + compilation: { + // enable minification for both development and production + minify: true, + }, +}; +``` + +如果启用压缩: + +- 对于 js/ts 模块,代码将被`compressed`和 `mangled`,所有空白字符将被删除. +- 对于css和html模块,所有空格都将被删除 + +:::note + +Farm 使用 swc minifier,有关详细选项,请参阅[compilation.minify](/zh/docs/config/compilation-options#minify) +::: diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/advanced/partial-bundling.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/advanced/partial-bundling.md new file mode 100644 index 0000000000..2aa3fdedc1 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/advanced/partial-bundling.md @@ -0,0 +1,278 @@ +# 局部打包 +局部打包(`Partial Bundling`)是 Farm 用来打包模块的策略,类似于其他打包工具,但 Farm 的 `局部打包` 目标不同。 + +与其它打包工具不同,Farm不会尝试将所有内容打包在一起,而是使用像 `splitChunks` 之类的优化策略将其拆分出来,相反,Farm会将项目直接捆打包成多个输出文件。例如,如果需要数百个模块来启动一个html页面,Farm将尝试将它们直接打包成20到30个输出文件。Farm将这种行为称为`局部打包`。 + +Farm局部打包的目标是: +1. **减少请求数量和请求层次**: 将数百上千个模块请求减少到20-30个请求,避免由于依赖层次结构而逐个加载模块,从而加快资源的加载。 +2. **提高缓存命中率**: 当模块发生更改时,确保只有少数输出文件受到影响,因此可以为项目提高缓存命中率。 + +对于传统打包工具,我们可能很难通过复杂的 `splitChunks` 或 `manualChunks` 配置来实现上述目标,但是 Farm 原生支持`局部打包`。 + +请注意,默认的打包策略是为浏览器设计的,但它也适用于 Node.js。 如果想要更改 Node.js 的打包策略,请尝试[配置局部打包](#configuring-partial-bundling)。 + +:::tip +请参考 [RFC-003 Partial Bundling](https://github.com/farm-fe/rfcs/blob/main/rfcs/003-partial-bundling/rfc.md) 局部打包以获取更多技术细节。 +::: + +## 动机 +目前,Web构建工具处理模块的主要方法有两种:完全打包或原生ESM。但它们都有缺点: +* 对于完全打包,打包工具旨在将所有内容打包在一起,然后拆分出来进行优化,但拆分通常难以配置,手动平衡资源加载性能和缓存命中率很难。 +* 对于原生ESM,每个模块都可以单独编译和缓存,但当有数百个模块请求时,会严重影响加载性能。 + +因此,我一直在思考是否有一种策略可以避免这两种极端情况 - 也许我们可以进行局部打包?我们可以直接将项目打包成几个有限、大小平衡的资源,并且自动进行。我将这种思考命名为`模块合并` ( `Module Merging` )- 在全量打包和非打包之间找到平衡,只打包几个相关的模块以提高加载性能,同时不失去缓存颗粒度。 + +> 后来,我将`模块合并`更名为`局部打包`,因为我认为`局部打包`更能准确地表达我的想法。 + +## 局部打包规则 +> 在这一节中,我们将通过示例介绍`局部打包`的基本规则。 + +首先,我们来看一个基本的React项目示例。对于一个基本的React项目,我们只在入口文件中导入react和react-dom: + +```tsx title="index.tsx" +import React from 'react'; +import { createRoot } from 'react-dom/client'; +import './index.scss'; + +const container = document.querySelector('#root'); +const root = createRoot(container); + +root.render( + <> +
Index page
+ +); +``` + +打包结果将如下所示: + +```text +./dist/ +├── index_9c07.49b83356.js # contains react-dom +├── index_a35f.0ac21082.js # contains ./index.tsx +├── index_b7e0.7ab9ca2d.js # contains react and its dependencies +├── index_ce26.7f833381.css $ contains ./index.scss +└── index.html # contains ./index.html +``` + +默认情况下,Farm会将你的项目打包成5个文件: + +* 2个js文件来自 `node_modules` ,包含 `react` 、 `react-dom` 其依赖项。 +* 1个js文件来自 `./index.tsx` +* 1个css文件来自 `./index.scss`; +* 1个html文件来自 `./index.html`; + +Farm使用以下规则来获得上述结果: + +1. **可变和不可变模块应始终位于不同的输出文件中**: 默认情况下,Farm 将 `node_modules` 下的所有模块视为不可变的,否则它们是可变的。因此 `./index.tsx` 位于单独的文件中,因为它是一个可变模块,因此它永远不会与 `react` 和 `react-dom` 位于同一输出文件中。 +2. **不同类型的模块应始终位于不同的输出文件中**: 因此 `./index.scss` 位于单独的文件中。 +3. **同一包中的模块应位于同一输出文件中**: 因此,所有 `react` 模块始终位于同一输出文件中, `react-dom` 也是如此。 +4. **资源加载的目标并发请求应默认在20-30之间**: 因此有3个js输出文件,而不是1个js输出文件。 +5. **输出文件应具有相似的大小,最小资源大小应默认大于20KB**: 因为 `react-dom` 是最大的,超过100KB,所以它位于单独的文件中,而 `react` 及其依赖项小于20KB,因此被合并到同一输出文件中。 + +现在我们已经熟悉了`局部打包`的基本规则,如果遇到局部打包问题,请使用上述规则调试您的项目。接下来,我们将介绍如何配置局部打包。 + +## 配置局部打包 +### 两种配置方法 + +有两种不同的方式来控制打包: +* **`groups`**: 告诉Farm您希望将这些模块尽可能地打包在一起,但由于Farm的优化策略,这并不是强制执行的。请参阅[模块分组](#模块分组)以了解此方法。 +* **`enforceResources`**: 告诉Farm您希望这些模块始终打包在一起,忽略所有其他优化策略约束。请参阅使用 [`enforceResources`](#使用-enforceresources) 以了解此方法。 + +### 局部打包选项 + +`局部打包`支持许多选项,使用户可以自定义其行为。所有选项如下: + +1. **`targetConcurrentRequests`**: Farm尝试为初始资源加载或动态资源加载生成尽可能接近此配置值的资源数量。 +2. **`targetMinSize`**: 生成资源的最小大小,在压缩和gzip之前。请注意,如果 `ModuleBucket的大小` 小于 `targetMinSize`, `ModuleBucket` 将优先考虑,这时候大小限制不一定会被强制保证。可以使用配置 `enforceTargetMinSize` 来强制保证大小,但是这样可能会导致一些共享模块的优化策略失效。 +3. **`targetMaxSize`**: 类似 `targetMinSize`,生成资源的最大大小,在压缩和gzip之前。 +4. **`groups`**: 一组应该放在一起的模块。请注意,此组配置只是告诉编译器这些模块应该放在一起,它可能会产生多个资源,如果您想强制将模块放在同一资源中,应该使用 `enforceResources`。 + * **name**: 这组资源的名称. + * **test**: 匹配属于该组的模块的正则表达式数组。 + * **groupType**: `mutable` 或 `immutable` ,此组仅用于指定模块的类型。 + * **resourceType**: `all`、 `initial` 或 `async`,此组仅用于指定资源的类型。 +5. **`enforceResources`**: 匹配应该始终位于同一输出资源中的模块的数组,忽略所有其他约束。 + * **name**: 资源的名称. + * **test**: 匹配属于该资源的模块的正则表达式数组。 +6. **`enforceTargetConcurrentRequests`**: 强制目标并发请求对于每个资源加载,当为true时,较小的资源将被合并到较大的资源中以满足目标并发请求。这可能会导致css资源出现问题,请谨慎使用此选项。 +7. **`enforceTargetMinSize`**: 强制设置对于每个资源的目标最小大小,当为true时,较小的资源将被合并到较大的资源中以满足目标并发请求。这可能会导致css资源出现问题,请谨慎使用此选项。 +8. **`immutableModules`**: 匹配不可变模块的正则表达式数组。 +9. **`immutableModulesWeight`**: 默认为0.8,不可变模块将具有80%的请求数量。例如,如果 `targetConcurrentRequest` 为25,则不可变资源将默认为 `25 * 80% = 20` 。此选项是为了确保可变和不可变模块是隔离的,如果您更改了业务代码,node_modules下的代码将不会受到影响。 + +:::note +通常,您可以使用 `targetConcurrentRequests` 、 `targetMinSize` 和 `targetMaxSize` 来控制局部打包的默认行为。Farm设置的默认值基于最佳实践,因此请确认是否必须修改默认值。 +::: + +### 模块分组 +您可以使用 `groups` 将模块分组在一起。对于上述基本React项目示例,可以使用以下配置将 `node_modules` 下的模块打包在一起: +```ts title="farm.config.ts" {4-9} +export default defineConfig({ + compilation: { + partialBundling: { + groups: [ + { + name: 'vendor-react', + test: ['node_modules/'], + } + ] + }, + }, +}); +``` +我们添加了一个 `group item` ,其中包含 `name` 和 `test` ,以将 `react` 和 `react-dom` 分组在一起。打包结果如下: +``` +./dist/ +├── index_499e.72cf733c.js # contains `react`, `react-dom` and all other files under node_modules +├── index_a35f.0ac21082.js # contains `./index.tsx` +├── index_ce26.7f833381.css # contains `./index.scss` +└── index.html # contains `./index.html` +``` + +现在, `node_modules` 下的所有模块都打包到 `index_499e.72cf733c.js` 中。请注意,groups并不强制所有匹配该组的模块都打包在一起,一个 `group`可以产生多个 `output file` ,因为: +1. 可变和不可变模块始终位于不同的输出文件中。当可变和不可变模块都匹配到这个 `group` 时,它们将位于不同的输出中。 +2. 对于多页面应用或动态导入的入口,可能存在共享模块,这些模块应始终位于不同的输出文件中。 + +如果您需要强制将模块放在同一输出文件中,可以使用 `enforceResources` + +### 使用 `enforceResources` +要将所有模块分组在一起并忽略所有其他条件,可以使用 `enforceResources` ,例如: +```ts title="farm.config.ts" +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + compilation: { + partialBundling: { + // c-highlight-start + enforceResources: [ + { + name: 'index', + test: ['.+'], + } + ] + // c-highlight-end + }, + }, +}); +``` + +打包结果: + +``` +./dist/ +├── index.7f833381.css # all css modules are bundled together +├── index.ba5550d9.js # all script modules are bundled together +└── index.html +``` + +:::warning +`enforceResources` 将忽略Farm的所有内部优化,使用时请小心。 +::: + +### 配置 `immutable modules` + +使用 `immutableModules` 配置不可变模块,默认情况下,Farm将其设置为 `node_modules/` 。 + +```ts title="farm.config.ts" +export default defineConfig({ + compilation: { + partialBundling: { + immutableModules: ['node_modules/', '/global-constants'] + }, + }, +}); +``` + +不可变模块会影响打包和传入的持久化缓存,如果您想修改它,请小心。 + +## 示例 +:::note +通常您不需要手动配置打包,如果您想手动配置打包,请确保您确实需要它。这些示例仅用于帮助您轻松学习如何配置打包策略。 +::: + +### 将同一目录下的文件分组 + +将 `src/components` 下的 `modules` 分组,并**尽可能**将它们输出到同一资源中。 + +```ts title="farm.config.ts" +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + compilation: { + partialBundling: { + // c-highlight-start + groups: [ + { + name: 'components', + test: ['./src/components'], + } + ] + // c-highlight-end + }, + }, +}); +``` + +### 配置打包的数量和大小 +```ts title="farm.config.ts" +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + compilation: { + partialBundling: { + // c-highlight-start + targetConcurrentRequests: 15, + targetMinSize: 200 * 1024 // 200 KB + // c-highlight-end + }, + }, +}); +``` + +在上面的示例中,Farm将尝试**尽可能**地将您的项目打包到 `15` 个文件中,每个文件的最小大小**尽可能**大于 `200KB` 。 + +### 将所有模块打包在一起 +```ts +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + compilation: { + partialBundling: { + // c-highlight-start + enforceResources: [ + { + name: 'index', + test: ['.+'], + } + ] + // c-highlight-end + }, + }, +}); +``` + +在上面的示例中,我们强制将所有模块打包在一起,并忽略所有其他约束(例如,请求数量、文件大小)。您也可以使用 `enforceResources` 强制将某些模块打包在一起: + +```ts +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + compilation: { + partialBundling: { + // c-highlight-start + enforceResources: [ + { + name: 'index', + test: ['\\./src/components/.+'], + } + ] + // c-highlight-end + }, + }, +}); +``` + +我们强制将 `src/components` 目录下的所有模块打包在一起。 + +:::note +`enforceResources` 会破坏打包的内部优化,使用时请小心。 +::: diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/advanced/persistent-cache.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/advanced/persistent-cache.md new file mode 100644 index 0000000000..707724f9a8 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/advanced/persistent-cache.md @@ -0,0 +1,114 @@ +# 增量构建 + +:::tip +Farm 从`v0.14.0`开始支持通过持久缓存的增量构建 +::: + +从`v0.14.0`开始,Farm 支持将编译结果缓存到磁盘,这可以大大加快热启动/热构建的编译速度。当启用`persistentCache`时,编译时间可以减少**高达`80%`**。 + +冷启动(无缓存)和热启动(有缓存)的性能比较使用 [examples/argo-pro](https://github.com/farm-fe/farm/tree/main/examples/arco-pro): + +| | Cold(without cache) | Hot(with cache) | diff | +| ----- | ------------------- | --------------- | ----------- | +| start | 1519ms | 371ms | reduced 75% | +| build | 3582ms | 562ms | reduced 84% | + +## 使用缓存 + +使用[`compilation.persistentCache`](/zh/docs/config/compilation-options#persistentcache) 来`启用/禁用`缓存: + +```ts +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + compilation: { + persistentCache: true, + }, +}); +``` + +:::note +`persistentCache: true` 相当于: + +```js +({ + persistentCache: { + // Directory that cache is stored + cacheDir: 'node_modules/.farm/cache', + // namespace of the cache + namespace: 'farm-cache', + buildDependencies: [ + 'farm.config.ts', + '@farmfe/core', + '@farmfe/plugin-react', + // ... all other dependencies + ], + moduleCacheKeyStrategy: { + timestamp: true, + hash: true, + }, + }, +}); +``` + +::: +将`persistentCache`为`false`以禁用缓存 + +## 缓存验证 + +缓存在尝试重用时会通过以下条件进行验证,如果以下任何条件发生变化,所有缓存都将失效 + +- **Env Object**:由`persistentCache.envs`配置,默认为`Farm Env Mode`(`process.env.NODE_ENV`, `process.env.DEV`, `process.env.PROD`),参见 **[`环境变量和模式`](/zh/docs/features/env)**。 + +- **lockfile**:如果你的 lockfile (例如 pnpm-lock.yaml) 改变了,意味着有依赖项改变,缓存将失效。 + +- **构建依赖项**:由`persistentCache.buildDependencies`配置,如果任何 buildDependency 更改,所有缓存将失效。 + +- **Cache 命名空间**:由`persistentCache.namespace`配置,不同命名空间下的缓存不会重复使用。如果要使所有缓存失效,可以配置不同的命名空间。 + +- **内部缓存版本**:Farm 内部维护一个缓存版本,如果 Farm 本身发生了变化,例如,影响 Farm 版本之间输出的渲染优化,Farm 将碰撞缓存版本,所有缓存将失效。 + +如果您的缓存不起作用,请查看上述条件以找出原因。如果缓存损坏,您还可以删除 `node_modules/.farm/cache` 以手动删除缓存。 + +## 构建依赖项 + +构建依赖是可以影响编译过程或编译输出的依赖,例如插件或 config 文件。如果这些依赖中的任何一个发生了变化,所有缓存都将失效 + +构建依赖项可以是包名的文件路径,例如: + +```ts +import { defineConfig } from '@farmfe/core'; +import path from 'node:path'; + +export default defineConfig({ + persistentCache: { + buildDependencies: [ + // a file path + path.resolve(process.cwd(), './plugins/my-plugin.js'), + // a package name, note that this package must expose package.json + 'farm-plugin-custom-xxx', + ], + }, +}); +``` + +:::note +默认情况下,所有配置文件及其依赖项都包含在内。但是,如果您想添加一些额外的文件或依赖项来使缓存失效,您可以使用`buildDependencies`一旦这些文件更改,所有缓存都将失效 +::: + +## 模块缓存密钥策略 + +Farm 提供了 2 种策略来控制如何生成模块缓存键: + +- `timestamp`: 检查模块的时间戳,如果更新时间戳没有变化,则跳过此模块的构建,具有最佳性能. +- `hash`: 加载和转换后检查 content hash,如果内容没有变化,将跳过此模块的剩余构建. + +默认情况下,`timestamp`和`hash`都是启用的 + +## 插件注意事项 + +当启用`timestamp`时,不会调用所有构建阶段钩子,如`load`和`transform`。因此,如果插件依赖于`load`和`transform`,并且没有实现 `plugin_cache_loaded` 和 `write_plugin_cache` 钩子,它可能无法按预期工作。例如,如果插件在`load`和`transform`中收集信息,所有在`finish` hook 时发出它们,它应该实现 `plugin_cache_loaded` 和 `write_plugin_cache` hook 来加载和写入缓存,否则它将无法按预期工作。 + +Farm 将设置`timestamp`为`false` 当 `output.targetEnv`是 `node` + + diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/advanced/polyfill.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/advanced/polyfill.md new file mode 100644 index 0000000000..9133f8fd58 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/advanced/polyfill.md @@ -0,0 +1,79 @@ +# 语法降级和 Polyfill + +默认情况下,Farm 将降级到 ES2017(原生支持 async/await),并在生产模式下自动注入必要的`polyfills` + +:::note +默认情况下,Farm 不会为 `node_modules/` 下的模块进行转换和注入 polyfills ,如果您需要降级语法并为 `node_modules/` 注入 polyfills ,您可以使用 `compilation.presetEnv.include` +::: + +## 配置 `targetEnv` + +Farm 提供一个规范化的[`output.targetEnv`](/zh/docs/config/compilation-options#output-targetenv)选项来配置你的应用程序的目标执行环境。Farm 会自动为你的目标环境执行正确的`syntax downgrade`和`polyfill injection`。例如: + +```ts title="farm.config.ts" +export default { + compilation: { + output: { + targetEnv: 'browser-legacy', + }, + }, +}; +``` + +Farm 会将您的应用程序编译为旧版浏览器(ES5) + +- 将所有的 `Js/Jsx/Ts/Tsx`模块编译到 ES5,并注入所有的 polyfills(Promise,regenerator-runtime 等) +- 为所有 `css/scss/less` 模块添加前缀,例如`--webkit-` + +Farm 支持许多规范化的`targetEnv`选项,如`browser-modern`,`browser-es2017`,`browser-es2015`,`node16`,`node-legacy`等。**默认情况下,`targetEnv`是`browser-es2017`**。请参阅[`output.targetEnv`](/zh/docs/config/compilation-options#output-targetenv) + +:::note +您可能需要手动安装 `core-js@3`或`regeneration-runtime`,如果需要 polyfill 。尝试运行`pnpm add core-js` 如果你遇到了一些错误例如:`can not resolve 'core-js/modules/xxx'` +::: + +## 分别配置语法和 Polyfill + +在内部,`targetEnv`只是 `presetEnv`、`script.target` 和 `css.prefixer`的预设。如果需要,您可以更精确地配置它们 + +### 配置 `presetEnv` + +您可以使用 `compilation.presetEnv` 自定义语法降级和 polyfill injection。默认情况下,`node_modules`下的所有模块都将被忽略。使用`include`添加需要被 polyfill 的额外模块。 + +```ts title="farm.config.ts" +export default { + compilation: { + presetEnv: { + // include a package under node_modules + include: ['node_modules/package-name'], + options: { + targets: 'Chrome >= 48', + }, + }, + }, +}; +``` + +请注意,如果您的项目不需要浏览器兼容性,您可以为 `targets` 设置一个较宽松的值,那么注入的 polyfills 会更少,产物体积也会更小 + +有关更多选项,请参阅[compilation.presetEnv](/docs/config/compilation-options#presetenv) + +### 配置 `script.target` + +`script.target` 用于在生成代码时控制目标环境。如果要将项目降级为 `ES5`,则应同时设置: + +```ts title="farm.config.ts" +export default { + compilation: { + script: { + target: 'ES5', + }, + presetEnv: { + // include a package under node_modules + include: ['node_modules/package-name'], + options: { + targets: '> 0.25%, not dead', + }, + }, + }, +}; +``` diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/advanced/ssr.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/advanced/ssr.md new file mode 100644 index 0000000000..99c7903749 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/advanced/ssr.md @@ -0,0 +1,282 @@ +# 服务端渲染 (SSR) +Server-Side Rendering(SSR)意味着在Node.js(服务器端)中将前端框架(例如React、Vue、Solid等)渲染为 `html` ,并在客户端对已经渲染好的HTML( `rendered html` )进行注水 (hydrate)。 + +:::note +本文档描述了如何从头开始在 Farm 上构建 SSR 应用程序。 +::: + +## 示例项目 +Farm为流行的框架提供了 SSR [示例](https://github.com/farm-fe/farm/tree/main/examples): + +* **[React](https://github.com/farm-fe/farm/tree/main/examples/react-ssr)** +* **[Vue](https://github.com/farm-fe/farm/tree/main/examples/vue-ssr)** +* **[Solid](https://github.com/farm-fe/farm/tree/main/examples/solid-ssr)** + +## Project Structure +一个[典型的SSR应用程序](https://github.com/farm-fe/farm/tree/main/examples)通常具有以下源文件结构: + +``` +. +├── index.html +├── farm.config.ts +├── farm.config.server.ts +├── server.js +└── src + ├── index-client.tsx + ├── index-server.tsx + └── main.tsx +``` + +* **`index.html`**: 应用程序运行在客户端(浏览器)上的入口HTML +* **`farm.config.ts`**: 构建项目到客户端的farm配置 +* **`farm.config.server.ts`**: 构建项目到Node.js(服务端)的farm配置 +* **`server.js`**: 应该部署到生产环境的服务端脚本 +* **`src/index-client.tsx`**: 客户端入口脚本 +* **`src/index-server.tsx`**: 服务端入口脚本 +* **`src/main.tsx`**: 客户端和服务器共享的应用程序代码 + +`index.html` 需要引用 `index-client.tsx` 并包含一个占位符,其中应注入服务器渲染的标记(`markup`): + +```html +
app-html-to-replace
+ +``` + +你应该将 `
app-html-to-replace
` 替换为服务器渲染的`markup`。 + +:::tip +我们必须为客户端(浏览器)和服务端(Node.js)分别构建SSR应用程序**共两次**。因此,需要 `farm.config.ts` 和 `farm.config.server.ts` ,我们将在后面的章节中讨论详细信息。 +::: + +## 设置开发服务器 +对于上述示例, `farm.config.ts` 用于**构建浏览器端项目**并设置开发服务器进行服务器渲染。 `farm.config.ts` 的通常这样写: + +```ts title="farm.config.ts" +import path from 'path'; +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + compilation: { + input: { + index_client: './index.html' + }, + output: { + path: './build' + }, + }, + server: { + hmr: true, + cors: true, + middlewares: [ + // 注册一个中间件,在服务端渲染应用, + // 然后注入到服务器渲染的标记并返回最终的index.html + (server) => { + server.app().use(async (ctx, next) => { + await next(); + + // 处理index.html或单页面应用路由设置 + if (ctx.path === '/' || ctx.status === 404) { + // 加载服务端入口,并通过ctx.path渲染 + const render = await import(path.join(process.cwd(), 'dist', 'index.js')).then( + (m) => m.default + ); + const renderedHtml = render(ctx.path); + + // 通过server.getCompiler()获取编译的index.html内容 + // 这里的html经过编译并注入了所有客户端bundles文件 + const template = server + .getCompiler() + .resource('index_client.html') + .toString(); + + // 将占位符替换为渲染好的内容,并将其作为HTML返回 + const html = template.replace( + '
app-html-to-replace
', + renderedHtml + ); + ctx.body = html; + ctx.type = 'text/html'; + ctx.status = 200; + } + + console.log('ctx.path outer', ctx.path); + }); + } + ] + }, + plugins: ['@farmfe/plugin-react', '@farmfe/plugin-sass'] +}); +``` + +在上面的示例中,需要一个中间件(`middleware`)来将应用程序渲染为标记并将其作为HTML提供。中间件中SSR的正常工作流程: +* **加载编译后的服务端入口:** 需要一个导出 `render` 函数的index-server入口,然后通过 `import(server_entry_path)` 来获取这个 `render` 函数。 +* **获取编译后的客户端index.html:** 所有客户端打包代码和Farm运行时都注入到 `index.html`中,用于在客户端进行水合作用(`hydrate`)。 +* **将占位符替换为渲染后的代码:** 替换占位符并返回最终的html代码(`final html`)。 + +:::note +在这个示例中,我们使用 `if (ctx.path === '/' || ctx.status === 404) {` 来构建一个 `SPA` SSR应用程序,如果你需要构建一个 `MPA` SSR应用程序,请将 `ctx.path` 传递到你的页面。 +::: + +## 构建 Node.js 服务端产物 +`farm.config.server.ts` 用于**构建 Node.js 端产物**,生成编译后的服务端入口,可用于在服务端将应用渲染为标记(`markup`)。 + +```ts title="farm.config.server.ts" +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + compilation: { + // c-highlight-start + input: { + index: './src/index-server.tsx' + }, + output: { + path: './dist', + targetEnv: 'node' + } + // c-highlight-end + }, + plugins: [ + [ + '@farmfe/plugin-react', + { + refresh: false, + development: false + } + ], + '@farmfe/plugin-sass' + ] +}); +``` + +对于 `farm.config.server.ts` ,我们将 `input` 设置为**服务端入口**,并将 [`output.targetEnv`](/zh/docs/config/compilation-options#output-targetenv) 设置为 `node` 。 + +:::note +默认情况下,Farm将服务端入口脚本编译为 `esm` ,如果你想要将其编译为cjs,请尝试设置 [`output.format`](/zh/docs/config/compilation-options#output-format)。 +::: + +## 开发SSR项目 +你需要为客户端和服务端启动编译,例如,你可能会在package.json中有以下脚本: + +```json title="package.json" +{ + "name": "@farmfe-examples/react-ssr", + "scripts": { + // c-highlight-start + "start": "farm start", + "start:server": "farm watch --config farm.config.server.mjs", + // c-highlight-end + } +} +``` + +当你开发SSR项目时,你需要在不同的终端中运行 `npm run start` 和 `npm run start:server` 。同时监听 server 和 client 的变动并重新编译。 + +## 生产环境构建 +你需要同时为客户端和服务器构建项目,例如,你可能需要在 `scripts` 中添加以下命令: + +```json title="package.json" +{ + "name": "@farmfe-examples/react-ssr", + "scripts": { + "start": "farm start", + "start:server": "farm watch --config farm.config.server.mjs", + // c-highlight-start + "build": "farm build", + "build:server": "farm build --config farm.config.server.mjs" + // c-highlight-end + } +} +``` + +打包构建时,你需要运行 `npm run build` 和 `npm run build:server`,客户端打包将被输出到 `build` 目录,服务端打包将被输出到 `dist` 目录。 + +对于生产环境,你需要一个 `node server` 来渲染和提供 `rendered html`。在这个示例中,我们使用了一个 `server.js` 作为生产服务端: + +```js title="server.js" +import path from 'node:path'; +import { fileURLToPath } from 'node:url' +import fsp from 'fs/promises'; +import express from 'express'; + +function resolve(p) { + const __dirname = path.dirname(fileURLToPath(import.meta.url)); + return path.resolve(__dirname, p); +} + +// 创建一个Node生产服务端 +async function createServer() { + let app = express(); + // 为客户端打包产物提供静态文件服务,也可以将客户端构建部署到CDN或单独的开发服务器,按照你的需求。 + app.use(express.static(resolve('build'))); + // 监听 '/' 路由, 你也可以将其替换为你需要的路由. + app.use('/', async (req, res) => { + let url = req.originalUrl; + + try { + let template; + let render; + + // 加载客户端html + template = await fsp.readFile(resolve('build/index_client.html'), 'utf8'); + // 加载服务端渲染函数 + render = await import(resolve('dist/index.js')).then( + (m) => m.default + ); + // 将应用渲染为标记 + const markup = render(url); + + let html = template.replace( + '
app-html-to-replace
', + markup + ); + // 返回包含客户端打包的rendered html + // 客户端打包代码和服务器渲染的标记进行水和作用, + // 并使其具有交互性 + res.setHeader('Content-Type', 'text/html'); + return res.status(200).end(html); + } catch (error) { + console.log(error.stack); + res.status(500).end(error.stack); + } + }); + + return app; +} +// create and listen the server +createServer().then((app) => { + app.listen(3000, () => { + console.log('HTTP server is running at http://localhost:3000'); + }); +}); +``` + +我们在这里使用 `express` 作为服务端,但你可以使用任何你想要的服务端框架。渲染过程是相同的: +* 加载客户端编译后的HTML(`client index.html`) +* 从服务端脚本代码加载 `render` 函数 +* 调用 `const markup = render(url)` 函数以获取应用的服务器端渲染标记 +* 将 `client index.html` 中占位符替换为服务端渲染标记,并将替换后的html作为最终结果返回 + +## 静态站点生成(SSG) +SSG的流程与SSR相同,不同的是SSG将替换的html输出到最终产物。SSG的示例脚本: + +```ts +// 加载 client html +const template = await fsp.readFile(resolve('build/index_client.html'), 'utf8'); +// 加载服务端渲染函数 +const render = await import(resolve('dist/index.js')).then( + (m) => m.default +); + +const pages = renderDirEntry('src/pages'); + +for (const page of pages) { + // 将应用渲染为标记 + const markup = render(url); + const html = template.replace( + '
app-html-to-replace
', + markup + ); + // 输出静态生成的页面,例如将其写入硬盘 + emitPage(page, html); +} +``` diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/advanced/tree-shake.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/advanced/tree-shake.md new file mode 100644 index 0000000000..757b1ef6e8 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/advanced/tree-shake.md @@ -0,0 +1,98 @@ +# Tree Shake + +Farm 支持 Tree Shake,该功能在默认的生产环境中自动启用,可以通过[compilation.treeShaking](/zh/document/config/compcompation-option#treeshaking)选项打开或关闭。 + +在 Tree Shake 期间,package.json 中的 sideEffects 字段将被自动读取,具有 sideEffects 的模块将不会执行 Tree Shake。 + +:::note +Farm 会将所有循环依赖的模块视为 sideEffects,不会执行 Tree Shake。请尽量避免项目中的循环依赖。 +::: + +Tree shake 示例: + +```js title="a.js" +import { b1, b2 } from 'b'; +console.log(b1); +``` + +```js title="b.js" +export b1 = "B1"; +export b2 = "B2"; +``` + +`a.js` 是 entry,它导入`b.js`,tree shaking 后,结果是: + +```js title="a.js" +import { b1 } from 'b'; +console.log(b1); +``` + +```js title="b.js" +export b1 = "B1"; +``` + +`b2`未使用,将在`a.js`和 `b.js`中删除 + +## 配置 Tree Shake + +Tree Shake 默认在生产模式下启用,要禁用 tree Shake,请使用 `compilation. treeShake`: + +```ts title="farm.config.ts" +export default { + compilation: { + treeShake: false, + }, +}; +``` + +## 处理 Side Effects + +当一个模块包含`Side Effects`时,Farm 不会为其应用 tree shake,其所有导入和导出都被视为已使用。Farm 会认为以下模块有 `Side effects`: + +1. Common Js 模块总是有副作用. +2. 一个模块包含`自执行`的语句在全局范围有副作用 +3. 包含循环依赖的模块有副作用 +4. 模块匹配 `sideEffects` 配置在其最接近的 `package. json` +5. 入口模块总是有副作用 + +示例 1: + +```js +const a = require('./'); +module.exports = a; +``` + +Common Js 模块总是有副作用. + +示例 2: + +```js +import a from './'; + +a(); +``` + +`a()` 在全局范围内执行,我们将其视为副作用. + +Example 3: + +```js +// a.js +import b from './b.js'; + +// b.js +import a from './a.js'; +``` + +`a`,`b`是循环依赖关系,所以它们也会被视为副作用. + +Example 4: + +```json title="package.json" +{ + "name": "my-package", + "sideEffects": ["./global/**.ts"] +} +``` + +所有 `global/` 下的 ts 模块都被视为副作用. diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/api/hmr-api.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/api/hmr-api.md new file mode 100644 index 0000000000..8dd98aa5fc --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/api/hmr-api.md @@ -0,0 +1,193 @@ +# Hmr Api +:::note +HMR API 兼容[Vite 的 HMR API](https://vitejs.dev/guide/api-hmr.html)。 +::: + +Farm 通过特殊的 `import.meta.hot` 对象导出 HMR API(与Vite兼容): + +```ts +export interface ViteHotContext { + readonly data: any; + + accept(): void; + accept(cb: (mod: ModuleNamespace | undefined) => void): void; + accept(dep: string, cb: (mod: ModuleNamespace | undefined) => void): void; + accept( + deps: readonly string[], + cb: (mods: Array) => void + ): void; + + dispose(cb: (data: any) => void): void; + prune(cb: (data: any) => void): void; + invalidate(message?: string): void; + + on( + event: T, + cb: (payload: InferCustomEventPayload) => void + ): void; + off( + event: T, + cb: (payload: InferCustomEventPayload) => void + ): void; + send(event: T, data?: InferCustomEventPayload): void; +} +``` + +## HMR 前置判断 +HMR 仅适用于开发模式,请确保使用条件块保护 HMR API 使用: + +```ts +if (import.meta.hot) { + // HMR Code +} +``` + +## Typescript 支持 + +和 Vite 一样,Farm 在 @farmfe/core/client.d.ts 中提供了 import.meta.hot 的类型定义。 您可以在 src 目录中创建一个 `env.d.ts` ,以便 TypeScript 获取类型定义: + +```ts +/// +``` + +## hot.accept() +对于接收自身更新的模块,请使用 `import.meta.hot.accept()` : + +```ts +if (import.meta.hot) { + // self accept without reload the page + import.meta.hot.accept(); + + const div = document.getElementById(id); + // update the page + if (div) { + const comp = SelfAcceptedEmpty().render(); + div.replaceWith(comp); + } +} +``` + +## hot.accept(cb) +如果你想根据 `更新模块的导出` 来更新模块状态,可以使用 `import.meta.hot.accept(cb)` : + +```ts +if (import.meta.hot) { + // self accept without reload the page + import.meta.hot.accept(mod => { + const div = document.getElementById(id); + const comp = mod[id]().render(); + div?.replaceWith(comp); + }); +} +``` + + `cb` 的参数是 `更新模块的导出` ,您可以基于它进行更新。 + +## hot.accept(deps, cb) +模块还可以接受来自直接依赖项的更新,而无需重新加载自身。 + +接受单一依赖: +```ts +if (import.meta.hot) { + // accept dependencies + import.meta.hot.accept('./accept-deps-data', (data) => { + console.log(data); + const div = document.getElementById(id); + const renderData = data.compData(id); + div!.innerText = renderData; + }); +} +``` + +接受多个依赖项: +```ts +if (import.meta.hot) { + // accept dependencies + import.meta.hot.accept(['./accept-deps-data'], ([data]) => { + console.log(data); + const div = document.getElementById(id); + const renderData = data.compData(id); + div!.innerText = renderData; + }); +} +``` + +## hot.dispose(cb) +自我接受模块或期望被其他模块接受的模块可以使用 hot.dispose 来清理其更新副本所产生的任何持久副作用: + +```ts +if (import.meta.hot) { + // 接受 HMR 更新以避免页面刷新 + import.meta.hot.accept(mod => { + const div = document.getElementById(id); + div?.appendChild(mod.createChild()); + }); + + // 清理副作用 + import.meta.hot.dispose(() => { + // 删除div的所有子元素 + const div = document.getElementById(id); + + if (div) { + while (div.firstChild) { + console.log('dispose', div.firstChild); + div.removeChild(div.firstChild); + } + } + }); +} +``` + +## hot.prune(cb) + +注册一个回调,当页面上不再导入模块时将调用该回调。 与 hot.dispose 相比,如果源代码在更新时自行清除副作用,并且您只需要在从页面中删除它时进行清除,则可以使用此方法。 Farm 目前使用它来导入 .css(与 Vite 相同)。 + +```ts +if (import.meta.hot) {{ + import.meta.hot.accept(); + import.meta.hot.prune(() => {{ + style.remove(); + }}); +}} +``` + +## hot.data +import.meta.hot.data 对象在同一更新模块的不同实例中保留。 它可用于将信息从模块的前一版本传递到下一版本。 + +````ts +import.meta.hot.data.value = 'value'; +```` + +## hot.invalidate(message?: string) +自接受模块可能会在运行时意识到它无法处理 HMR 更新,因此需要将更新强制传播到祖先模块。 通过调用 import.meta.hot.invalidate(),HMR 服务器将使调用者的接收更新状态失效,并将此次更新通知以此到所有祖先模块,如果有任意祖先模块接收本次更新,HMR 成功,否则,将会刷新页面。 这将在浏览器控制台和终端中打印一条消息。 您可以传递一条消息来提供有关失效发生原因的一些背景信息。 + +请注意,即使您计划随后立即调用 invalidate,您也应该始终调用 import.meta.hot.accept,否则 HMR 客户端将不会监听自我接受模块的未来更改。 为了清楚地传达您的意图,我们建议在接受回调中调用 invalidate,如下所示: + +```ts +if (import.meta.hot) { + import.meta.hot.accept((mod) => { + if (cannotHandleUpdate(mod)) { + import.meta.hot.invalidate('parent module should accept this'); + } + }); +} +``` + +## hot.on(event, cb) +与Vite相同,参见 [Vite hot.on](https://vitejs.dev/guide/api-hmr.html#hot-on-event-cb) + +## hot.off(event, cb) +从事件监听器中删除回调 + +## hot.send(event, data) +从 HMR 客户端向开发服务器发送消息: + +```ts +import.meta.hot.send('event-name', { data: '123' }); +``` + +在开发服务器上接收消息: + +```ts +server.ws.on('event-name', (data) => {}); +``` \ No newline at end of file diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/api/javascript-api.mdx b/docs/i18n/zh/docusaurus-plugin-content-docs/current/api/javascript-api.mdx new file mode 100644 index 0000000000..6ea8647ed4 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/api/javascript-api.mdx @@ -0,0 +1,568 @@ +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; +import CodeBlock from "@theme/CodeBlock"; + +# JavaScript Api + +`Farm` 提供完整的开发服务器、编译器、监听器等 `JavaScript Api`, 开发者可以通过引入 `@farmfe/core` 包来使用这些 Api。 + +安装 `@farmfe/core` 包: + +<> + + + npm install @farmfe/core@latest + + + + yarn add @farmfe/core@latest + + + pnpm add @farmfe/core@latest + + + + + +## Start + +`Start` 方法用于快速启动开发服务器 + +调用 `start` 方法之后就可以在当前控制台看见可用的 `ip` 地址的日志信息, 默认会编译当前目录下的 `index.html` 文件 + +类型: + +```typescript +start(options: InlineConfig): Promise +``` + +基本示例: + +```javascript +import { start, logger } from "@farmfe/core"; +try { + await start(options); +} catch (error) { + logger.error(`Failed to start server:\n ${error.stack}`); + process.exit(1); +} +``` + + + +## Build + +`Build` 方法对生产环境进行构建 + +调用 `build` 方法之后默认构建浏览器产物, 并且会在当前目录下生成一个 `dist` 文件夹, 如若需要构建不同环境以及不同版本产物, 例如 `node`、`node-next`、`browser`、`browser-es2017` 等, 可以通过查看 [output targetEnv](/docs/config/compilation-options#output) 来进行配置. +类型: + +```typescript +build(options: InlineConfig): Promise +``` + +基本示例: + +```javascript +import { build, logger } from "@farmfe/core"; +try { + await build(options); +} catch (error) { + logger.error(`error during build:\n ${error.stack}`); + process.exit(1); +} +``` + +## Watch + +`Watch` 方法对当前项目的编译进行实时更新, 等同于 `npx farm build --watch`, 一般作用于 `node` 环境 + +类型: + +```typescript +watch(options: InlineConfig): Promise +``` + +基本示例: + +```javascript +import { watch, logger } from "@farmfe/core"; +try { + await watch(defaultOptions); +} catch (error) { + logger.error(`error during watch project:\n ${error.stack}`); + process.exit(1); +} +``` + +## Preview + +`Preview` 方法启动一个预览服务器, 对生产环境产物进行预览, 使用时需要确保已经通过 `build` 方法进行构建, 并且生成了正确的生产环境产物 + +类型: + +```typescript +preview(options: InlineConfig): Promise +``` + +基本示例: + +```javascript +import { preview, logger } from "@farmfe/core"; +try { + await preview(defaultOptions); +} catch (error) { + logger.error(`Failed to start preview server:\n ${error.stack}`); + process.exit(1); +} +``` + +## Clean + +`Clean` 方法清理 `farm` 增量构建所产生缓存, 如果您开启了增量构建功能, 那么这个方法可能对您有所帮助 + +:::warning +对于目前使用增量构建功能而导致某些不可预知或者未发现的问题所导致的程序崩溃, 可以尝试通过清理缓存来解决问题, 若并不能解决请在 github 上提交 issues +::: + +类型: + +```typescript +clean(options: InlineConfig): Promise +``` + +基本示例: + +```javascript +import { clean, logger } from "@farmfe/core"; +try { + await clean(defaultOptions); +} catch (error) { + logger.error(`Failed to clean cache:\n ${error.stack}`); + process.exit(1); +} +``` + +## loadEnv +从 .env 文件加载环境变量。 + +```ts +type LoadEnvFunc = ( + mode: string, + envDir: string, + prefixes: string | string[] = ['FARM_', 'VITE_'] +) => [env: Record, existsEnvFiles: string[]]; +``` + +* `mode` 是 `development`、`Production` 或任何字符串。 `loadEnv` 将尝试加载 `[``.env``, ``.env.local``, ``.env.${mode}``, ``.env.${mode}.local``] ` 为 `envDir`。 +* `envDir` 是 `.env` 文件所在的目录。 +* `prefixes` 是环境变量的前缀。 默认值为 `['FARM_', 'VITE_']` 。 带有这些前缀的环境变量将自动注入到`define`中。 + +```js +const [env, files] = loadEnv('development', '/path/to/project/env'); +// use env +``` + +### createDevServer + +`createDevServer` 方法用于启动本地开发服务器, 需要先实例化 `Server` 对象, 传递参数需要 `farm` 的 `compiler` + +类型: + +```typescript +createDevServer(options: DevServerOptions): Promise +``` + +基本示例: + +```javascript +import { Server } from "@farmfe/core"; +const server = new Server(); +await server.createDevServer(options); +server.listen() +``` + +### createPreviewServer + +创建一个 预览服务器,用于预览生产环境产物 + +类型: + +```typescript +createPreviewServer(options: DevServerOptions): Promise +``` + +基本示例: + +```javascript +import { Server } from "@farmfe/core"; +const server = new Server(); +await server.createPreviewServer(options); +``` + +### getCompiler + +获取当前开发服务器的编译器实例, 在实例化 `Server` 的时候需要传递一个 `compiler` 参数 + +类型: + +```typescript +getCompiler(): Compiler +``` + +基本示例: + +```javascript +import { Server, Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +const server = new Server({ + compiler +}); +const compiler = server.getCompiler(); +``` + +### close + +关闭当前由 `createDevServer` 开启的所有 `Server` 以及 `Webscoker` 服务 + +基本示例: + +```javascript +import { Server } from "@farmfe/core"; +const server = new Server(); +await server.createDevServer(options); +server.listen() +await server.close(); +``` + + +## Compiler + +`Compiler` 提供一系列编译器的 `Api`,可以通过实例化 `Compiler` 创建一个编译器实例。 + +基本示例 + +```javascript +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +await compiler.compile(); +``` + +### compile + +编译器异步启动编译过程。返回一个 `promise` + +:::note +如果设置了特定的环境变量 (procee.env.FARM_PROFILE) , 则执行同步编译。 +::: + +类型: + +```typescript +compile(): promise +``` + +基本示例: + +```javascript +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +await compiler.compile(); +``` + +### compileSync + +编译器同步启动编译过程。 + +类型: + +```typescript +compileSync(): void +``` + +基本示例: + +```javascript +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +compiler.compileSync(); +``` + +### traceDependencies + +追踪文件之间的依赖关系, 根据 `compiler` 传递的 `config` 参数中的 `input` 返回当前文件的所有依赖关系, 这对于根据文件依赖关系进行重启编译非常有用。 + +类型: + +```typescript +traceDependencies(): Array[string] +``` + +基本示例: + +```javascript +import { Compiler } from "@farmfe/core"; + +const config = { + input: "./farm.config.js" +} +const compiler = new Compiler(config); +const dependencies = compiler.traceDependencies(); +``` + +返回一个所有依赖关系的路径组成的数组 + +### update + +根据提供的路径来更新编译, 返回一个解析为 `JsUpdateResult` 的 `Promise`。如果编译已经在进行中, 它会等待处理并更新。如果设置了 `ignoreCompilingCheck` 为 `true`, 则不会检查编译状态。 + +类型: + +```typescript +update(paths: Array, sync: boolean, ignoreCompilingCheck: boolean): JsUpdateResult +``` + +基本示例: + +```javascript +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +const result = await compiler.update(paths, true, true); +``` + +### hasModule + +传递一个 `path` 判断当前 `path` 是否处于 `compiler` 所编译的模块中。 + +类型: + +```typescript +hasModule(path: string): boolean +``` + +基本示例: + +```javascript +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +const result = compiler.hasModule(path); +``` + +### getParentFiles + +检索由 模块导入名 (`id`) 或已解析路径标识(`resolvedPath`)的模块导入的当前文件。 + +类型: + +```typescript +getParentFiles(resolvedPath: string): Array +``` + +基本示例: + +```javascript +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +const result = compiler.getParentFiles(resolvedPath); +``` + +### resources + +返回所有经过 `compiler` 编译后的所有产物资源 + +类型: + +```typescript +type Resource = { + path: string + buffer: Buffer +} +resources(): Array +``` + +基本示例: + +```javascript +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +await compiler.compile() +const result = compiler.resources(); +``` + +### Resource + +根据传入的文件返回当前产物的 `buffer` + +类型: + +```typescript +resource(path: string): Buffer | null +``` + +基本示例: + +```javascript +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +await compiler.compile() +const result = compiler.resource(path); +``` + +### writeResourcesToDisk + +根据配置输出路径将资源写入磁盘 + +类型: + +```typescript +writeResourcesToDisk(): void +``` + +基本示例: + +```javascript +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +await compiler.compile() +compiler.writeResourcesToDisk(); +``` + +### removeOutputPathDir + +删除输出产物路径目录 + +类型: + +```typescript +removeOutputPathDir(): void +``` + +基本示例: + +```javascript +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +await compiler.compile() +compiler.removeOutputPathDir(); +``` + +### resolvedWatchPaths + +返回已解析的监视路径 + +类型: + +```typescript +resolvedWatchPaths(): Array +``` + +基本示例: + +```javascript +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +await compiler.compile() +const result = compiler.resolvedWatchPaths(); +``` + + +### resolvedModulePaths + +返回相对于提供的根路径已解析的模块路径。 + +类型: + +```typescript +resolvedModulePaths(rootPath: string): Array +``` + +基本示例: + +```javascript +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +await compiler.compile() +const result = compiler.resolvedModulePaths(rootPath); +``` + +### onUpdateFinish + +添加一个在更新过程完成后执行的回调。 + +类型: + +```typescript +onUpdateFinish(callback: (...args: any[]) => any): void +``` + +基本示例: + +```javascript +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +compiler.onUpdateFinish(callback); +``` + +### outputPath + +返回已解析的输出路径 + +类型: + +```typescript +outputPath(): string +``` + +基本示例: + +```javascript +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +const result = compiler.outputPath(); +``` + +### addExtraWatchFile + +为编译器添加额外的监视文件。 + +类型: + +```typescript +addExtraWatchFile(rootPath: string,. filePath: string[]): void +``` + +基本示例: + +```javascript +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +compiler.addExtraWatchFile(rootPath, filePath); +``` + +### modules + +返回文件模块解析后的对象数组 + +类型: + +```typescript +export interface Module { + id: string + moduleType: string + moduleGroups: Array + resourcePot?: string + sideEffects: boolean + sourceMapChain: Array + external: boolean + immutable: boolean +} +modules(): Array +``` + +基本示例: + +```javascript +import { Compiler } from "@farmfe/core"; +const compiler = new Compiler(config); +const result = compiler.modules(); +``` diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/api/js-plugin-api.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/api/js-plugin-api.md new file mode 100644 index 0000000000..a1d7c16f93 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/api/js-plugin-api.md @@ -0,0 +1,880 @@ +# Js Plugin Api +Farm Js Plugin 设计了类似 rollup 风格的设计插件系统,可以轻松地从 Rollup/Vite/Webpack 迁移您的插件/项目。 + + +## 配置 Js 插件 + +通过 `plugins` 选项添加 JS 插件: + +```ts title="farm.config.ts" {3,7} +import { defineConfig } from "@farmfe/core"; +// import a js plugin +import farmPluginFoo from "farm-plugin-foo"; + +export default defineConfig({ + // configuring it in plugins + plugins: [farmPluginFoo()], +}); +``` + +## 编写Js插件 +Farm Js 插件是一个普通的 javascript 对象,它公开了一组 `hook` 。 例如: + +```ts title="my-farm-plugin.ts" +// 创建一个插件文件,导出一个返回 `JsPlugin` 对象的插件函数: +import type { JsPlugin } from '@farmfe/core'; + +// 插件选项 +export interface PluginOptions { + test: boolean; +} +// 导出插件函数 +export default function MyPlugin(options: PluginOptions): JsPlugin { + // 读取插件 options + const { test } = options; + + // 返回一个暴露钩子的对象 + return { + name: 'my-farm-plugin', + // 使用load hook加载自定义模块 + load: { + filters: { + resolvedPaths: ['\\.test$'] // 过滤文件以提高性能 + }, + async executor({ resolvedPath }) { + if (test && resolvedPath.endsWith('.test')) { + return { + content: 'test file', + sourceMap: null + } + } + } + } + } +} +``` + +:::note +* Farm提供`create-farm-plugin`工具来帮助您快速创建和开发您的js插件。 有关编写 JS 插件的更多详细信息,请参阅[编写 JS 插件](/docs/plugins/writing-plugins/js-plugin) +::: + +## Plugin Hook Overview +Js 插件 Hook 与 Rust 插件相同,请参阅 [Rust 插件 Hook 概述](/docs/api/rust-plugin-api#plugin-hooks-overview)。 + +:::note +并非所有钩子都暴露给 Js 插件,只有本文档中列出的钩子可用。 +::: + +## hooks +### name +- **type: `string`** +- **required: `true`** + +该插件的名称,不能为空。 +```ts +export default function MyPlugin() { + return { + name: 'my-plugin', + // ... + } +} +``` + +### priority +- **type: `number`** +- **required: `false`** +- **default: `100`** + +该插件的优先级,默认为 `100` 。 `priority` 控制插件的执行顺序,值越大,插件越早执行。 + +```ts +export default function MyPlugin() { + return { + name: 'my-plugin', + priority: 1000, // // 使该插件先于所有其他插件执行 + // ... + } +} +``` +:::note +请注意,大多数 Farm 内部插件(如 `plugin-script` 、 `plugin-resolve` )的优先级是 `99` ,这意味着您的插件始终在内部插件之前执行。 如果您想让您的插件在农场内部插件之后执行,请将 `priority` 设置为小于 `99` 的值,例如: `98` 。 优先级值也可以为负数,您可以将其设置为 `-9999` 以确保它始终最后执行。 +::: + +### config +- **type: `config?: (config: UserConfig) => UserConfig | Promise;`** +- **hook type: `serial`** +- **required: `false`** + +在`config`钩子中修改[Farm config](/docs/config/configuring-farm),返回(部分)`修改后的配置`,返回的配置将深度合并到从cli和配置文件解析的配置中。 您也可以直接更改配置。 + +示例: +```ts +const resolveConfigPlugin = () => ({ + name: 'return-resolve-config-plugin', + config: (_config) => ({ + compilation: { + resolve: { + alias: { + foo: 'bar' + } + } + } + }) +}); +``` + +:::note +在解析所有 `用户插件` 后,会调用 `config` 钩子,因此在 config 钩子中将新插件添加到配置中无效。 +::: + + +### configResolved +- **type: `configResolved?: (config: ResolvedUserConfig) => void | Promise;`** +- **hook type: `serial`** +- **required: `false`** + +当配置解析时调用(在调用所有插件的 `config` 钩子之后)。 当您想要获得插件的最终解析配置时很有用。 + +示例: +```ts +const myPlugin = () => { + let farmConfig; + + return { + name: 'my-plugin', + configResolved(resolvedConfig) { + // get resolved config + resolvedConfig = farmConfig; + }, + transform: { + filters: { + moduleTypes: ['js'] + }, + async executor(param) { + if (farmConfig.xxx) { + // ... + } + } + } + } +} +``` + +### configureDevServer +- **type: `configureDevServer?: (server: Server) => void | Promise;`** +- **hook type: `serial`** +- **required: `false`** + +:::note +请注意,该钩子仅在开发模式下运行。 +::: + +当 `Dev Server` 准备就绪时调用,您可以获得开发服务器实例。 + +示例: +```ts +const myPlugin = () => { + let devServer; + + return { + name: 'my-plugin', + configureDevServer(server) { + devServer = server; + } + } +} +``` + +:::note +`js plugin` 的 `config` 和 `configResolved` 钩子都会在 `rust plugin` 的 `config` 钩子之前被调用。 +::: + +### configureCompiler +- **type: `configureCompiler?: (compiler: Compiler) => void | Promise;`** +- **hook type: `serial`** +- **required: `false`** + +当 `Rust Compiler` 准备好时调用,该钩子在开发和生产中运行。 您可以在此处获取 `Compiler` 实例 + +示例: +```ts +const myPlugin = () => { + let farmCompiler; + + return { + name: 'my-plugin', + configureCompiler(compiler) { + farmCompiler = compiler; + } + } +} +``` + +### buildStart +- **type: `buildStart?: { executor: Callback, void> };`** +- **hook type: `parallel`** +- **required: `false`** + +在编译开始之前调用。 你可以在这里做一些初始化工作。 + +Example: +```ts +const myPlugin = () => { + // 定义插件操作 + let myPluginContext = createMyPluginContext(); + + return { + name: 'my-plugin', + buildStart: { + async executor() { + // 在编译之前初始化插件上下文 + myPluginContext.setup(); + } + } + } +} +``` +:::note +`buildStart` 仅在第一次编译时调用一次。 后期编译如 `Lazy Compilation` 和 `HMR Update` 不会触发 `buildStart` 。 +::: + +### resolve +- **required: `false`** +- **hook type: `first`** +- **type:** +```ts +type ResolveHook = { + filters: { + importers: string[]; + sources: string[]; + }; + executor: Callback +}; + +type Callback = ( + param: P, + context?: CompilationContext, + hookContext?: { caller?: string; meta: Record } +) => Promise; + +/// resolve 钩子的参数 +export interface PluginResolveHookParam { + /// 解析 `source` 的起始位置,如果 resolve 入口或 resolve hmr 更新,则为 [None]。 + /// 值为父模块的id,例如:`src/index.ts` 或 `src/index.vue?vue&type=xxx` + importer: string | null; + /// 例如,[ResolveKind::Import] 用于静态导入 (`import a from './a'`) + kind: ResolveKind; + /// 导入来源。 例如在index.ts中(import App from "./App.vue") + /// 源应该是 './App.vue' + source: string; +} +/// resolve 钩子的解析结果 +export interface PluginResolveHookResult { + /// 解析路径,通常是绝对路径。 您还可以返回虚拟路径,并使用 [PluginLoadHookResult] 提供虚拟路径的内容 + resolvedPath: string; + /// 该模块是否应该被 external,如果为 true,则该模块不会出现在最终结果中 + external: boolean; + /// 该模块是否有副作用,影响tree shake + sideEffects: boolean; + /// 从说明符解析的查询,例如,如果说明符是`./a.png?inline`,查询应该是`{ inline: true }` + query: [string, string][] | null; + /// 模块的元数据,将传递给 [PluginLoadHookParam] 和 [PluginTransformHookParam] + meta: Record | null; +} +``` + +:::note +解析钩子的所有过滤器 `sources` 和 `importers` 都是 `正则字符串` 。 +::: + +从 `importer` 解析自定义 `source` ,例如从 `a.ts` resolve `./b` : +```ts title="a.ts" +import b from './b?raw'; +// ... +``` +那么 resolve 参数将是: +```ts +const param = { + source: "./b", + importer: { relative_path: "a.ts", query_string: "" }, + kind: 'import' +} +``` +默认的 resolve 结果为: +```rust +const resolve_result = { + resolved_path: "/root/b.ts", // 解析后的模块绝对路径 + external: false, // 该模块应该包含在最终编译的资源中,并且不应该被 external + side_effects: false, // 不包含副作用,可以被 tree shake + query: [["raw", ""]], // query 参数 + meta: {} +} +``` + +`HookContext` 用于在您可以递归挂钩时传递状态,例如,您的插件在 `resolve hook` 中调用 `context.resolve`: +```ts +const myPlugin = () => ({ + name: 'my-plugin', + resolve: { + filters: { + sources: ['^.+foo.+$'], + importers: ['^src/index.ts$'] + }, + executor: async (param, context, hookContext) => { + console.log(param); + if (hookContext.caller === 'my-plugin') { + return null; + } + // 替换原来的源并解析新的源 + const newSource = param.source.replace('foo', 'bar'); + return context.resolve({ + ...param, + source: newSource + }, { + caller: 'my-plugin', + meta: {} + }); + } + } +}); +``` + +在上面的例子中,我们调用 `context.resolve` 并传递 `caller` 作为参数,然后我们应该添加一个类似 `if (hookContext.caller === 'my-plugin') {` 的保护以避免无限循环。 + +注意: +* 默认情况下,您的`resolve hook`在Farm内部默认解析器**之后**执行,只有内部解析器无法解析的源才会传递给您的插件,这意味着如果您想覆盖默认解析器 ,您需要将**插件的优先级设置为大于**`101`。 +* 通常 `resolved_path` 是指向文件的真实绝对路径。 但是您仍然可以返回一个 `虚拟模块 id` ,例如 `virtual:my-module` ,但是对于虚拟模块,您需要实现 `load` 钩子来自定义如何加载虚拟模块。 在 Farm 中,`resolved_path + query = module_id`。 +* `ResolveKind` 表示 `import type`,示例值:`require`(由 commonjs require 导入)、`cssImport`(由 css 的 import 语句导入)等。 +* `meta` 可以在插件和钩子之间共享,您可以从任何插件中的 `load`、`transform` 和 `parse` 钩子的参数中获取 `meta`。 + +### load +- **required: `false`** +- **hook type: `first`** +- **type:** +```ts +type LoadHook = { + filters: { + importers: string[]; + sources: string[]; + }; + executor: Callback +}; + +type Callback = ( + param: P, + context?: CompilationContext, + hookContext?: { caller?: string; meta: Record } +) => Promise; + +export interface PluginLoadHookParam { + moduleId: string; + resolvedPath: string; + query: [string, string][]; + meta: Record | null; +} + +export interface PluginLoadHookResult { + /// 模块的内容 + content: string; + /// 模块的类型,例如[ModuleType::Js]代表普通的javascript文件, + /// 通常以 `.js` 扩展名结尾 + moduleType: ModuleType; + sourceMap?: string | null; +} +``` + +自定义如何从已解析的模块路径或模块 ID 加载模块。 例如加载一个虚拟模块: +```ts +const myPlugin = () => ({ + name: 'my-plugin', + load: { + filters: { + resolvedPaths: ['^virtual:my-plugin$'], + }, + executor: async (param, context, hookContext) => { + if (param.resolvedPath === 'virutal:my-plugin') { + return { + content: 'export default "foo"', + moduleType: 'js' + }; + } + } + } +}); +``` + +在 `load` 挂钩中加载模块时需要返回 `module_type` 和 `content` 。 `source_map` 是可选的,如果您在 `load` 钩子中进行转换(不推荐,我们建议在这种情况下使用 `transform` 钩子)或者从其他位置加载原始源地图,则可以返回源地图。 + + +`load hook` 的 `filters.resolvedPath` 为 `resolvedPath + query`,例如:`/root/src/index.vue?vue&type=style&lang=css`。 如果你想在过滤模块时忽略查询,可以使用 `$`: `src/index\\.vue$`; 如果你想通过查询来过滤模块,例如过滤 `lang=css`,可以使用`src/index.vue\\.+\\?vue&.+lang=css`。 + +### transform +- **required: `false`** +- **hook type: `serial`** +- **type:** +```ts +type TransformHook = { + filters: { + importers: string[]; + sources: string[]; + }; + executor: Callback +}; + +type Callback = ( + param: P, + context?: CompilationContext, + hookContext?: { caller?: string; meta: Record } +) => Promise; + +export interface PluginTransformHookParam { + moduleId: string; + /// 加载后的源内容或上一个插件转换后的结果 + content: string; + /// 加载后的模块类型 + moduleType: ModuleType; // Module Type is 'js' | 'jsx' | 'ts' | 'tsx' | 'css' | 'html'... + resolvedPath: string; + query: [string, string][]; + meta: Record | null; + sourceMapChain: string[]; +} + +export interface PluginTransformHookResult { + /// 转换后的源内容,将传递给下一个插件。 + content: string; + /// 您可以在转换后更改模块类型。 + moduleType?: ModuleType; + /// 转换后的源映射,所有插件转换后的源映射将存储为源映射链。 + sourceMap?: string | null; + // 忽略之前的 source map。 如果为 true,则source map链将被清除。 这个结果应该返回一个新的source map,它结合了所有以前的 source map。 + ignorePreviousSourceMap?: boolean; +} +``` + +根据**`模块内容`**和**`模块类型`**进行转换。 将 `sass` 转换为 `css` 的示例: + +```ts +export default function farmSassPlugin( + options: SassPluginOptions = {} +): JsPlugin { + return { + name: pluginName, + load: { + filters: { resolvedPaths: ['\\.(scss|sass)$'] }, + async executor(param) { + if (param.query.length === 0 && existsSync(param.resolvedPath)) { + const data = await readFile(param.resolvedPath); + return { + content: data, + moduleType: 'sass' + }; + } + + return null; + } + }, + transform: { + filters: { + moduleTypes: ['sass'] + }, + async executor(param, ctx) { + const { css: compiledCss, map } = compileSass(param.content); + return { + content: compiledCss, + moduleType: 'css' // transformed sass to css, + sourceMap: JSON.stringify(map) + ignorePreviousSourceMap: false, + } + } + } + } +} +``` + +编写 `transform hook` 的正常步骤: +1. 添加基于 `moduleType` 或 `resolvedPath` 或 `moduleId` 的 `if` 保护 +2. 对 `内容` 进行转换 +3.返回转换后的`content`、`sourceMap`和`moduleType` + +对于 `ignorePreviousSourceMap` ,如果您处理了 `param.sourceMapChain` 并折叠了 `transform hook` 中以前插件的源映射。 您应该将 `ignorePreviousSourceMap` 设置为 `true` 以确保源映射正确。 否则,您应该始终将此选项设置为 `false` 并让 Farm 处理源映射链。 + +对于 filters: +* 当同时指定 `resolvedPaths` 和 `moduleTypes` 时,取并集。 +* `filters.resolvedPaths` 是 `resolvedPath + query`,例如:`/root/src/index.vue?vue&type=style&lang=css`。 如果你想在过滤模块时忽略查询,可以使用 `$`: `src/index\\.vue$`; 如果你想通过查询来过滤模块,例如过滤 `lang=css`,可以使用`src/index.vue\\.+\\?vue&.+lang=css`。 +* `filters.moduleTypes` 不是 ** `regex`,它必须与 `ModuleType` 完全匹配,如 `css`、`js`、`tsx` 等。 + +:::note +`transform` 钩子是**内容到内容**。 有一个类似的钩子叫做 `process_module` , `process_module` 是**ast 到 ast**。 由于性能问题,Js 插件不支持 `process_module` 钩子,如果您想要 **ast 到 ast** 转换,请尝试使用 [`Rust Plugin`](/docs/plugins/writing-plugins/rust-plugin)。 +::: + +### buildEnd +- **type: `buildEnd?: { executor: Callback, void> };`** +- **hook type: `parallel`** +- **required: `false`** + +在 `ModuleGraph` 构建之后、资源渲染和生成开始之前调用。 您可以在此处进行一些状态更新或完成工作。 + +示例: +```ts +const myPlugin = () => { + // 定义插件上下文 + let myPluginContext = createMyPluginContext(); + + return { + name: 'my-plugin', + buildEnd: { + async executor() { + // 更新插件状态 + myPluginContext.updateStatus('module-graph-built'); + } + } + } +} +``` +:::note +`buildEnd` 仅在第一次编译时调用一次。 稍后编译如`Lazy Compilation`和`HMR Update`不会触发`buildEnd`。 +::: + +### renderStart +- **type: `renderStart?: { executor: Callback; };`** +- **hook type: `parallel`** +- **required: `false`** + +在资源渲染开始之前调用。 + +示例: +```ts +const myPlugin = () => { + // 定义插件上下文 + let myPluginContext = createMyPluginContext(); + + return { + name: 'my-plugin', + renderStart: { + async executor() { + // 更新插件状态 + myPluginContext.updateStatus('render-start'); + } + } + } +} +``` +:::note +`renderStart` 仅在第一次编译时调用一次。 稍后编译如 `Lazy Compilation` 和 `HMR Update` 将不会触发 `renderStart` 。 +::: + +### renderResourcePot +- **required: `false`** +- **hook type: `serial`** +- **type:** +```ts +type RenderResourcePotHook = JsPluginHook< + { + resourcePotTypes?: ResourcePotType[]; + moduleIds?: string[]; + }, + RenderResourcePotParams, + RenderResourcePotResult +>; + +type Callback = ( + param: P, + context?: CompilationContext, +) => Promise; +type JsPluginHook = { filters: F; executor: Callback }; + +export interface RenderResourcePotParams { + content: string; + sourceMapChain: string[]; + resourcePotInfo: { + id: string; + name: string; + resourcePotType: ResourcePotType; + map?: string; + modules: Record; + moduleIds: ModuleId[]; + data: JsResourcePotInfoData; + custom: Record; + }; +} +export interface RenderResourcePotResult { + content: string; + sourceMap?: string; +} +``` + +`Resource Pot` 是最终输出的打包后的文件的抽象表示,您可以返回转换后的 `resourcePot content` 来改变最终的包。 例如渲染CSS: + +```ts +const myPlugin = () => ({ + name: 'test-render-resource-pot', + renderResourcePot: { + filters: { + moduleIds: ['^index.ts\\?foo=bar$'], + resourcePotTypes: ['css'] + }, + executor: async (param) => { + return { + content: param.content.replace( + '<--layer-->', + cssCode + ), + sourceMap + }; + } + } +}) +``` +我们将 css 资源罐中的所有 `<--layer-->` 进行转换,并将其替换为真正的 `css 代码`。 + +:::note +当同时指定了 `filters.moduleIds` 和 `filters.resourcePotTypes` 时,取并集。 +::: + +### augmentResourceHash +- **required: `false`** +- **hook type: `serial`** +- **type:** +```ts +type AugmentResourceHash = JsPluginHook< + { + resourcePotTypes?: ResourcePotType[]; + moduleIds?: string[]; + }, + { + id: string; + name: string; + resourcePotType: ResourcePotType; + map?: string; + modules: Record; + moduleIds: ModuleId[]; + data: JsResourcePotInfoData; + custom: Record; + }, + string +>; + +type Callback = ( + param: P, + context?: CompilationContext, +) => Promise; +type JsPluginHook = { filters: F; executor: Callback }; +``` + +为给定资源罐附加资源哈希。 如果您想在生成资源哈希时添加附加条件,则非常有用。 + +```ts +const myPlugin = () => ({ + name: 'test-augment-resource-pot', + renderResourcePot: { + filters: { + moduleIds: ['^index.ts\\?foo=bar$'], + resourcePotTypes: ['css'] + }, + executor: async (param) => { + return 'my-hash-args'; + } + } +}) +``` + +:::note +当同时指定了 `filters.moduleIds` 和 `filters.resourcePotTypes` 时,取并集。 +::: + +### finalizeResources +- **required: `false`** +- **hook type: `serial`** +- **type:** +```ts +type FinalizeResourcesHook = { + executor: Callback< + FinalizeResourcesHookParams, + FinalizeResourcesHookParams['resourcesMap'] + >; +}; + +export type FinalizeResourcesHookParams = { + resourcesMap: Record; + config: Config['config']; +}; + +export interface Resource { + name: string; + bytes: number[]; + emitted: boolean; + resourceType: string; + origin: { type: 'ResourcePot' | 'Module'; value: string }; + info?: ResourcePotInfo; +} +``` + +对所有生成的资源进行一些转换,返回 `转换后的resourcesMap` 。 您可以在此钩子中 `添加` 、 `删除` 、 `修改` 最终生成的资源。 + +注意: +* `bytes` 是最终输出的二进制,对于 `js/css/html` 代码,可以使用 `Buffer.from(bytes).toString()` 来获取代码。 +* `name` 是最终的文件名。 +* `origin` 代表这个 `Resource` 的来源,`ResourcePot` 表示它是从 `ResourcePot` 生成的,而 `ResourcePot` 是一个模块包; `Module` 表示它来自 `Module` ,例如 `.png/.jpg` 等静态文件来自 `Module` 。 + +### transformHtml +- **required: `false`** +- **hook type: `serial`** +- **type:** +```ts +type TransformHtmlHook = { + order?: 0 | 1 | 2; + executor: Callback<{ htmlResource: Resource }, Resource>; +}; +``` + +`order` 控制 `transformHtml` 执行时机: +* `0`: 代表 `pre`, 在 parse 之前执行,在这里可以转换原始的 html。 +* `1` and `2`: 代表 `normal` and `post`, 在 parse 和 generate resources 之后执行. 在这个阶段, 所有的 ` + + +``` + +当加载动态脚本和CSS时,动态获取的资源url也将是:`https://cdn.com/` + +#### `output.assetsFileName` + +- **默认值**: `"[resourceName].[ext]"` + +静态资源输出的文件名配置,占位符和 `output.filename` 相同。 + +#### `output.targetEnv` + +- **默认**:`"browser-es2017"` + +配置产物的执行环境,可以是 `浏览器` 或 `节点` 。 Farm 会自动为您指定的 `targetEnv` 注入 `polyfill` 和降级语法(对于脚本和 css),支持的 `targetEnv` 如下: + +针对 `浏览器` : +* **`browser-es2017`**:将项目编译到原生支持 `async wait` 的浏览器。 +* **`browser-es2015`**:将项目编译到原生支持 `es6 features` 的浏览器。 +* **`browser-legacy`**:将项目编译为`ES5`,例如`IE9`。 请注意,这可能会引入大量的填充,从而使生产规模更大。 确保您确实需要支持 `IE9` 等旧版浏览器。 +* **`browser-esnext`**:将项目编译到最新的现代浏览器,不会注入任何polyfill。 +* **`浏览器`**:`browser-es2017`的别名 + +针对 `Node.js` : +* **`node16`**:将项目编译到`Node 16`。 +* **`node-legacy`**:将项目编译到 `Node 10` 。 +* **`node-next`**:将项目编译到最新的 Node 版本,不会注入任何 polyfill。 +* **`node`**:`node16`的别名 + +#### `output.format` + +- **默认值**: `"esm"` + +配置产物的格式,可以是 `"esm"` 或者 `"cjs"`. + +:::note +该选项只对 Js 产物有效 +::: + +### resolve + +- **type**: `ResolveOptions` + +```ts +interface ResolveOptions { + extensions?: string[]; + alias?: Record; + mainFields?: string[]; + conditions?: string[]; + symlinks?: boolean; + strictExports?: boolean; +} +``` + +#### `resolve.extensions` + +- **默认值**: `["tsx", "ts", "jsx", "js", "mjs", "json", "html", "css"]` + +配置解析依赖时的后缀,例如解析 `./index` 时,如果没有解析到,则会自动加上后缀解析,如尝试 `./index.tsx`, `./index.css` 等。 + +#### `resolve.alias` + +- **默认值**: `{}` + +配置解析别名,示例: + +```ts +export default defineConfig({ + compilation: { + resolve: { + alias: { + "/@": path.join(process.cwd(), "src"), + stream$: "readable-stream", + "$__farm_regex:^/(utils)$": path.join(process.cwd(), "src/$1"), + }, + }, + }, +}); +``` + +alias 为前缀替换,对于上述例子 `/@/pages` 将会被替换为,`/root/src/pages`。 + +如果希望精确匹配,可以加上 `$`,例如 `stream$` 只会替换 `stream`,而不会替换 `stream/xxx`。 + +当然也支持使用正则表达式,例如 `$__farm_regex:^/(utils)$`,将会匹配 `/utils`,并替换为 `/root/src/utils`。 + +#### `resolve.mainFields` + +- **默认值**: `["exports", "browser", "module", "main"]` + +解析 node_modules 下依赖时,从 package.json 中将会按照 `mainFields` 中配置的字段和顺序进行解析。对于 `package.json` + +```json +{ + "name": "package-a", + "module": "es/index.js", + "main": "lib/index.js" +} +``` + +将会优先使用 `es/index.js`(如果路径存在),不存在则会继续向后搜索。 + +#### `resolve.conditions` + +暂不支持配置。 + +#### `resolve.symlinks` + +- **默认值**: `true` + +解析文件时,是否追踪 symlink 对应的真实目录,并从真实目录开始解析下一个依赖。如果使用 pnpm 管理依赖,该选项必须配置为 true。 + +#### `resolve.strictExports` + +- **默认值**: `false` + +是否严格遵循 `package.json` 中 `exports` 中定义的导出。如果设置为 true,当 `package.json` 中定义了 `exports`,但是 `exports` 没有定义对应导出时,会直接报错。如果设置为 true,会按照 mainFields 继续尝试其他入口。 + +### define + +- **默认值**: `{}` + +全局变量注入,配置的变量名和值将会在编译时注入到产物中。Farm 默认注入 `process.env.NODE_ENV` 以及部分 Farm 自身使用的变量比如 `FARM_HMR_PORT` + +```ts +export default defineConfig({ + compilation: { + define: { + MY_VAR: 123, + }, + }, +}); +``` + +### external + +- **默认值**: `[]` +- **类型**: `(string | Record)[]` + +配置被 external 的导入,被 external 的导入不会出现在编译产物中。但是对应 import 语句不会删除,需要自定义 external 后如何处理,否则运行时会报错,对于 targetEnv 是 node 下的 external 模块,会自动尝试 require 该模块。 + +需要使用正则方式配置,例如: + +```ts +export default defineConfig({ + compilation: { + external: ["^stream$", { jquery: "Jquery" }], + }, +}); +``` + +### externalNodeBuiltins +- **默认**:`true` + +无论是否外部 `module.builtinModules`,默认情况下,所有内置模块(如 `fs`)都将是外部的。 您还可以将 `externalNodeBuiltins` 设置为 `array` 以手动将模块指定为外部: + +```ts +export default defineConfig({ + compilation: { + externalNodeBuiltins: ["^stream$"], + }, +}); +``` + +### mode + +- **默认值**: 对于 start、watch 命令是 `development`,对于 build 命令是 `production` + +配置编译模式,为了优化开发时性能,在没有手动配置生产优化相关选项(minify,tree shake 等)时,默认在 `development` 下会禁用生产环境优化比如压缩和 tree shake,在 `production` 模式下启用。 + +### root + +- **默认值**: `process.cwd()` + +配置项目编译的 root 目录,该选项会影响默认配置文件的查找路径,编译模块依赖的查找等。 + +### runtime + +配置 Farm 运行时能力。类型如下: + +```ts +interface FarmRuntimeOptions { + runtime?: { + path: string; + plugins?: string[]; + namespace?: string; + isolate?: boolean; + }; +} +``` + +#### `runtime.path` + +- **默认值**: Farm 内置 runtime 的路径 + +自定义一个 Runtime 替换 Farm 内置的 Runtime。 + +:::warning +正常情况下不建议配置该选项,因为一旦配置了该选项,指向的 runtime 需要所有实现 Farm Runtime 已有的能力,例如模块系统、HMR、动态资源加载等。 +::: + +#### `runtime.plugins` + +- **默认值**: Farm 内置 runtime-plugin-hmr 的路径 + +配置 Runtime 插件,通过 Runtime 插件,可以干预 Runtime 行为,如模块加载,资源加载等。具体可以参考:WIP。 + +#### `runtime.namespace` + +- **默认值**: 项目 package.json 的 name 字段 + +配置 Farm Runtime 的命名空间,保证在同一个 window 或者 global 下不同产物的执行能够相互隔离。默认使用项目 package.json 的 name 字段作为 namespace。 + + +#### `runtime.isolate` + +- **默认值**: `false` + +默认情况下,html 中的运行时文件是内联写入的。如果您想以单独文件的形式弹出,从而减小 html 文件的大小,那么可以将此属性设为 true。 +如果设置为 true,农场入口脚本将以单独文件的形式发布。 + +### assets + +#### `assets.include` + +- **默认值**: `[]` + +额外视为静态资源的文件后缀,例如下述示例,`txt` 将会被视为姿态资源,引入 txt 文件时当作静态资源处理: + +```ts +export default defineConfig({ + compilation: { + assets: { + include: ["txt"], + }, + }, +}); +``` + +### script + +#### `script.target` + +- **默认值**: `esnext`(根据 Farm 的迭代动态调整) + +配置 Farm 解析 `js/jsx/ts/tsx` 的 AST 以及生成代码时支持的 ES 语法版本。 可选值:`es5`, `es6`, `es2015` - `es2023`, `esnext` + +#### `script.parser` + +- **默认值**: 与 SWC 相同 + +配置 SWC 解析 AST 时的行为,配置项参考:https://swc.rs/docs/configuration/compilation#jscparser + +#### `script.plugins` + +- **默认值**: `[]` + +配置 swc 插件数组,数组每一项包含三个字段: + +- **name**:swc 插件的包名 +- **options**: 传给 swc 插件的配置项 +- **filters**: 对哪些模块执行该插件,必须配置,支持 `resolvedPaths` 和 `moduleTypes` 这两个过滤项,两者如果同时指定,取并集。 + +对于 Vue 项目支持 JSX 的配置示例如下: + +```ts +import jsPluginVue from "@farmfe/js-plugin-vue"; + +/** + * @type {import('@farmfe/core').UserConfig} + */ +export default { + compilation: { + script: { + plugins: [ + { + name: "swc-plugin-vue-jsx", + options: { + transformOn: true, + optimize: true, + }, + filters: { + // resolvedPaths: [".+"] + moduleTypes: ["tsx", "jsx"], + }, + }, + ], + }, + }, + plugins: [jsPluginVue()], +}; +``` + +#### `script.decorators` + +```ts +export interface DecoratorsConfig { + legacyDecorator: boolean; + decoratorMetadata: boolean; + /** + * 装饰器版本: 2021-12 或者 2022-03 + * @default 2021-12 + */ + decoratorVersion: "2021-12" | "2022-03" | null; + /** + * @default [] + */ + includes: string[]; + /** + * @default ["node_modules/"] + */ + excludes: string[]; +} +``` + +建议使用 Farm 默认的装饰器配置,除非你想提高性能,可以设置`includes`和`excludes`。 + +选项: + +- **legacyDecorator**:默认为`true`。使用遗留装饰器提案。 +- **decoratorMetadata**:默认为`false`。如果您想将`legacyDecorator`设置为`true`,则必须将其设置为`false`。 +- **decoratorVersion**:默认为`2021-12`,提案版本。该值为 2021-12 或 2022-03。 +- **包括**:默认为`[]`。如果要包含排除的模块,可以设置此选项。支持正则表达式。 +- **排除**:默认为`['node_modules/']`。变换装饰器时,这些路径下的模块将被忽略。支持正则表达式 + +### css + +#### `css.modules` + +配置 Farm CSS Modules。 + +```ts +interface FarmCssModulesConfig { + // 配置哪些路径会被处理为 css modules,使用正则字符串 + // 默认为 `.module.css` 或者 `.module.scss` 或者 `.module.less` + paths?: string[]; + // 配置生成的 css 类名,默认为 `[name]-[hash]` + indentName?: string; +} +``` + +##### `css.modules.paths` + +- **默认值**: `["\\.module\\.(css|scss|sass|less)"]` + +配置哪些路径对应的模块会被视为 CSS Modules。需要配置正则字符串。默认是以 `.module.(css|scss|sass|less)` 结尾的文件。 + +##### `css.modules.identName` + +- **默认值**: `[name]-[hash]` + +配置生成的 CSS Modules 类名,默认是 `[name]-[hash]`,`[name]`, `[hash]` 为占位符(也是目前支持的所有占位符)。`[name]` 表示原始类名,`[hash]` 表示改 css 文件 id 的 hash。 + +#### `css.prefixer` + +配置 CSS 的兼容性前缀,例如 `-webkit-`。 + +```ts +interface FarmCssPrefixer { + targets?: string[] | string | BrowserTargetsRecord; +} + +type BrowserTargetsRecord = Partial< + Record< + | "chrome" + | "opera" + | "edge" + | "firefox" + | "safari" + | "ie" + | "ios" + | "android" + | "node" + | "electron", + string + > +> & { [key: string]: string }; +``` + +##### `css.prefixer.targets` + +- **默认值**: `undefined` + +配置对于哪些目标浏览器或者浏览器版本开启,示例: + +```ts +import { defineConfig } from "@farmfe/core"; + +export default defineConfig({ + compilation: { + css: { + prefixer: { + targets: ["last 2 versions", "Firefox ESR", "> 1%", "ie >= 11"], + }, + }, + }, +}); +``` + +### html + +#### `html.base` + +- **默认值**: `undefined` + +所有的 HTML 入口会继承 `html.base`,详情参考 [指南 - HTML](/docs/features/html) + +### sourcemap + +- **默认值**: `true` + +配置是否启用 sourcemap,可选配置项及说明如下: + +- **`true`**:仅对非 `node_modules` 下的文件生成 sourcemap,并且生成单独的 sourcemap 文件 +- **`false`**: 关闭 sourcemap +- **`inline`**:仅对非 `node_modules` 下的文件生成 sourcemap,并且内联 sourcemap 到产物中,不生成单独的文件 +- **`all`**:对所有文件生成 sourcemap,并且生成单独的 sourcemap 文件 +- **`all-inline`**: 对所有的文件生成 sourcemap,并且内联 sourcemap 到产物中,不生成单独的文件 + +### partialBundling + +配置 Farm 局部打包的行为,详情可以参考 [局部打包](/docs/advanced/partial-bundling) + +```ts +export interface FarmPartialBundlingConfig { + targetConcurrentRequests?: number; + targetMinSize?: number; + targetMaxSize?: number; + groups?: { + name: string; + test: string[]; + groupType?: "mutable" | "immutable"; + resourceType?: "all" | "initial" | "async"; + }[]; + enforceResources?: { + name: string; + test: string[]; + }[]; + enforceTargetConcurrentRequests?: boolean; + enforceTargetMinSize?: boolean; + immutableModules?: string[]; +} +``` + +#### `partialBundling.targetConcurrentRequests` + +- **default**: `25` + +Farm 尝试生成尽可能接近此配置值的资源数量,控制初始资源加载或动态资源加载的并发请求数量。 + +#### `partialBundling.targetMinSize` + +- **default**: `20 * 1024` bytes, 20 KB + +minify 和 gzip 之前生成的资源的最小大小。 请注意,`targetMinSize` 并不一定保证满足,可以配置`enforceTargetMinSize`可用于强制限制最小的大小。 + +#### `partialBundling.targetMaxSize` + +- **default**: `1500 * 1024` bytes, 1500 KB + +minify 和 gzip 之前生成的资源的最大大小。 + +#### `partialBundling.groups` + +- **default**: `[]` + +一组应该放在一起的模块。 请注意,此组配置只是对编译器的打击,即这些模块应该放置在一起,它可能会产生多个资源,如果您想强制打包模块到同一个资源中,使用`enforceResources`。 + +数组每一项的配置选项如下: + +- **name**: 该组的名称。 +- **test**: 匹配该组中的模块路径的正则表达式数组。. +- **groupType**: `mutable` 或 `immutable`,限制该组仅适用于指定类型的模块。 +- **resourceType**: `all`、`initial` 或 `async`,限制该组仅适用于指定类型的资源。 + +```ts title="farm.config.ts" {4-9} +export default defineConfig({ + compilation: { + partialBundling: { + groups: [ + { + name: "vendor-react", + test: ["node_modules/"], + }, + ], + }, + }, +}); +``` + +#### `partialBundling.enforceResources` + +- **default**: `[]` + +Array to match the modules that should always be in the same output resource, ignore all other constraints. + +Options for each item: + +- **name**: Name of this resource. +- **test**: Regex array to match the modules which are in this resource. + +```ts title="farm.config.ts" {4-9} +export default defineConfig({ + compilation: { + partialBundling: { + enforceResources: [ + { + name: "index", + test: [".+"], + }, + ], + }, + }, +}); +``` + +:::warning +`enforceResources` will ignore all Farm's internal optimization, be careful when you use it. +::: + +#### `partialBundling.enforceTargetConcurrentRequests` + +- **default**: `false` + +对每个资源加载强制执行目标并发请求数量,当为 true 时,较小的资源将合并为较大的资源以满足目标并发请求。 这可能会导致 css 资源出现问题,请小心使用此选项 + +#### `partialBundling.enforceTargetMinSize` + +- **default**: `false` + +为每个资源强制执行目标最小大小限制,如果为真,较小的资源将合并为较大的资源以满足目标并发请求。 这可能会导致 css 资源出现问题,请小心使用此选项 + +#### `partialBundling.immutableModules` + +- **default**: `['node_modules']` + +匹配不可变模块的正则表达式数组 + +```ts title="farm.config.ts" +export default defineConfig({ + compilation: { + partialBundling: { + immutableModules: ["node_modules/", "/global-constants"], + }, + }, +}); +``` + +不可变模块会影响打包和持久缓存,如果要更改它,请小心。 + +#### `partialBundling.immutableModulesWeight` + +- **default**: `0.8` + +Default to `0.8`, immutable module will have 80% request numbers. For example, if `targetConcurrentRequest` is 25, then immutable resources will take `25 * 80% = 20` by default. This option is to make sure that mutable and immutable modules are isolate, if change your business code, code under node_modules won't be affected. + +### lazyCompilation + +- **默认值**: 在开发模式是 `true`,构建模式是 `false` + +是否启用懒编译,配置为 false 关闭。参考 [懒编译](/docs/features/lazy-compilation)。 + +### treeShaking + +- **默认值**: 在开发模式是 `false`,构建模式是 `true` + +是否启用 tree shake,配置为 false 关闭。参考 [Tree Shake](/docs/advanced/tree-shake)。 + +### minify + +- **默认值**: 在开发模式是 `false`,构建模式是 `true` +- **类型**: `bool | JsMinifyOptions` + +是否启用压缩,开启后将会对产物进行压缩和混淆。参考 [压缩](/docs/advanced/tree-shake)。 + +#### `minify.compress` + +- **默认值**: `{}` +- **类型**: [`TerserCompressOptions`](https://swc.rs/docs/configuration/minification#jscminifycompress) + +压缩参数 + +#### `minify.mangle` + +- **默认值**: `{}` +- **类型**: [`TerserMangleOptions`](https://swc.rs/docs/configuration/minification#jscminifymangle) + +压缩变量参数 + +#### `minify.include` + +- **默认值**: `[]` +- **类型**: `string[]` + +包含需要压缩的模块,默认全部,仅在 `minify.mode` 为 `minify-module` 生效 + +#### `minify.exclude` + +- **默认值**: `["*.min.(js|css|html)"]` +- **类型**: `string[]` + +排除不需要压缩模块,仅在 `minify.mode` 为 `minify-module` 生效 + +#### `minify.mode` + +- **默认值**: `'minify-module'` +- **类型**: `'minify-module' | 'minify-resource-pot'` + +`minify-module` 模块级别 `minify`,可以通过参数控制需要 minify 哪些模块,压缩的更为精细,效率更好 + +`minify-resource-pot` `ResourcePot` 级别 `minify`,无法通过参数控制具体的模块 + +### presetEnv + +- **默认值**: 在开发模式是 `false`,构建模式是 `true` + +```ts +type FarmPresetEnvConfig = + | boolean + | { + include?: string[]; + exclude?: string[]; + // TODO using swc's config + options?: any; + assumptions?: any; + }; +``` + +默认不会对 node_modules 下的模块注入 polyfill,如果需要,请使用 `include` 添加 polyfill。 + +#### `presetEnv.include` + +- **默认值**: `[]` + +额外包含哪些需要 polyfill 的模块,配置正则字符串,例如 `include: ['node_modules/(es6-package|my-package)/']` + +#### `presetEnv.exclude` + +- **默认值**: `['node_modules/']` + +配置哪些不需要 polyfill 的模块,配置正则字符串,例如 `exclude: ['custom-path/(es5-package|my-package)/']`。默认 node_modules 被排除,如果需要包含被排除的模块,建议使用 `include` + +#### `presetEnv.options` + +- **默认值**: `降级到 ES5` + +传递给 swc preset env 的选项,参考 https://swc.rs/docs/configuration/compilation#env。 + +### persistentCache + +- **default**: `true` + +[增量构建](/docs/advanced/persistent-cache) 的缓存配置选项. 配置成 `false` 来禁用缓存. + +```ts +export type PersistentCache = + | boolean + | { + namespace?: string; + cacheDir?: string; + buildDependencies?: string[]; + moduleCacheKeyStrategy?: { + timestamp?: boolean; + hash?: boolean; + }; + }; +``` + +#### `persistentCache.namespace` + +- **default**: `farm-cache` + +缓存的命名空间,不同空间下的缓存会相互隔离,不会复用。 + +#### `persistentCache.cacheDir` + +- **default**: `node_modules/.farm/cache` + +缓存文件的存放目录。 + +#### `persistentCache.buildDependencies` + +- **default**: `farm.config.ts and all its deep dependencies` + +所有配置文件、插件等构建依赖的路径,默认包含 `farm.config.ts/js/mjs` 的所有依赖以及配置的所有 rust 和 js 插件。如果任意一个构建依赖变更了,所有缓存将会失效。 + +配置项可以是一个路径或者一个包名, 例如: + +```ts +import { defineConfig } from "@farmfe/core"; +import path from "node:path"; + +export default defineConfig({ + persistentCache: { + buildDependencies: [ + // a file path + path.resolve(process.cwd(), "./plugins/my-plugin.js"), + // a package name, note that this package must expose package.json + "farm-plugin-custom-xxx", + ], + }, +}); +``` + +#### `persistentCache.moduleCacheKeyStrategy` + +- **default**: `{ timestamp: true, hash: true }` + +控制复用缓存时,如何生成缓存的键。如果 `timestamp` 被设置为 true,并且模块没有倍改过,那么该模块所有的构建步骤将会被跳过(如`load`, `transform` 等钩子),缓存的模块将会被复用。如果`hash`设置成 true,并且 timestamp 没有命中,那么会调用 `load` 以及 `transform` 钩子来获取模块的内容,如果模块内容没有变更,那么缓存将会被复用,剩余构建步骤会被跳过。 + +- `timestamp`: 是否检查模块的 timestamp,性能最优,但是如果某些插件依赖前一次的构建状态,可能存在问题,见[注意事项](/docs/features/persistent-cache#caveats-for-plugins). +- `hash`: 是否检查 load 和 transform 后的内容。 + +#### `persistentCache.envs` + +- **default**: [Farm Env](/docs/features/env) + +可能影响构建过程的环境变量,如果任意一个环境变化了,缓存将会过期。 + + + +### progress +- **default**: `true` + +是否启动进度条 + +### comments +- **default**: `license` + +配置如何处理注释: +* `true`: 保留所有注释 +* `false`: 删除所有注释 +* `license`: 保留所有 **LICENSE 注释**, 移除所有非 LICENSE 注释 diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/config/configuring-farm.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/config/configuring-farm.md new file mode 100644 index 0000000000..2300c0631a --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/config/configuring-farm.md @@ -0,0 +1,96 @@ +# 配置 Farm + +## 配置文件规范 +默认情况下,Farm 从项目根目录下的“farm.config.ts|js|mjs”文件中读取配置,示例配置文件: + +```ts title="farm.config.ts" {5-7} +import { defineConfig } from "@farmfe/core"; + +export default defineConfig({ + root: process.cwd(), // // 编译的根目录 + // 编译选项 + compilation: { + //... + }, + // 开发服务器选项 + server: { + hmr: true, + //... + }, + // 插件配置 + plugins: [], +}); +``` + +有关配置选项的详细信息,请参阅: +* [`编译器选项`](/docs/config/compilation-options): 配置编译器选项(`compilation`字段),如`input`、`output`、`css 编译`、`打包配置`等。 +* [`开发服务器选项`](/docs/config/dev-server): 配置开发服务器选项(`server`字段),如`port`、`host`、`protocol`等。 +* [`共享选项`](/docs/config/shared): 配置共享选项,如 `root`、`env` 等。 + +:::note +您还可以使用“farm start/build -c my-config.ts”将自定义文件用作配置文件。 +::: + +## 加载Ts配置文件 +Farm 支持开箱即用加载 ts 配置文件,如“farm.config.ts”。 Farm 将首先将“farm.config.ts”及其本地 ts 依赖项打包到“farm-config.xxx.mjs”文件中,然后从磁盘加载它。 由于 Farm 将 `farm.config.ts` 编译为 `mjs` 文件,因此您 **不能** 在 `farm.config.ts` 中使用 `__dirname` 或 `__filename`,请使用 `import.meta.url` 作为替代。 + +或者您可以使用“farm.config.mjs”或“farm.config.cjs”与“@type”来支持类型,避免打包“farm.config.ts”: + +```js title="farm.config.mjs" +/** + * @type {import('@farmfe/core').UserConfig} + */ +export default { + // ... +} +``` + +## 示例 +### 输入和输出 +```ts title="farm.config.ts" {5-7} +import { defineConfig } from "@farmfe/core"; + +export default defineConfig({ + // compile options + compilation: { + input: { + index: './src/index.html', + about: './src/about.html', + }, + output: { + path: 'build', + publicPath: process.env.NODE_ENV === 'production' ? 'https://my-cdn.com' : '/' + } + }, +}); +``` + +In above example, we configured `./src/index.html` and `./src/about.html` as input, then output the compiled resources to `build` dir. + +### 开发服务器端口 + +```ts title="farm.config.ts" {5-7} +import { defineConfig } from "@farmfe/core"; + +export default defineConfig({ + server: { + port: 9801 + } +}); +``` + +### 仅用默认优化策略 +```ts title="farm.config.ts" {5-7} +import { defineConfig } from "@farmfe/core"; + +export default defineConfig({ + // compile options + compilation: { + lazyCompilation: false, + persistentCache: false, + minify: false, + treeShake: false + }, +}); +``` + diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/config/dev-server.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/config/dev-server.md new file mode 100644 index 0000000000..82fb05ce71 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/config/dev-server.md @@ -0,0 +1,157 @@ +# DevServer 配置 - server + +配置 Farm Dev Server 的行为。示例: + +```ts +import type { UserConfig } from "@farmfe/core"; + +function defineConfig(config: UserConfig) { + return config; +} + +export default defineConfig({ + // 所有 dev server 选项都在 server 下面 + server: { + port: 9000, + // ... + }, +}); +``` + +类型: + +```ts +export interface UserServerConfig { + port?: number; + // https?: boolean; + protocol?: "http" | "https"; + hostname?: string; + // http2?: boolean; + hmr?: boolean | HmrOptions; + proxy?: Record; + strictPort?: boolean; + open?: boolean; + host?: string; + cors?: boolean | cors.Options; + // whether to serve static assets in spa mode, default to true + spa?: boolean; + plugins?: DevServerPlugin[]; + writeToDisk?: boolean; +} +``` + +### port + +- **默认值**: `9000` + +DevServer 监听的端口。 + + + +### hmr + +- **默认值**: 对于 start 命令是 `true`,其他命令是 false + +启用 HMR,开启后启用 HMR 能力,将会监听编译过程中涉及到的模块的变动,当模块变化时,自动触发重编译并将结果推送给 Farm Runtime 进行更新。也可以通过一个对象来配置 HMR,例如: + +```ts +import type { UserConfig } from '@farmfe/core'; + +function defineConfig(config: UserConfig) { + return config; +} + +export default defineConfig({ + // 所有 dev server 选项都在 server 下面 + server: { + hmr: { + // 配置 web socket 监听的端口 + port: 9802 + // 配置 web socket 监听的 host + host: 'localhost', + // 配置文件监听时,忽略的文件 + ignores: ['auto_generated/*'] + } + // ... + } +}); +``` + +#### `hmr.port` + +- **默认值**: `9801` + +Web Socket 服务器监听的端口 + +#### `hmr.host` + +- **默认值**: `localhost` + +Web Socket 服务器监听的 Host + +### proxy + +- **默认值**: `undefined` + +配置服务器代理。基于 [http-proxy](https://github.com/http-party/node-http-proxy?tab=readme-ov-file#options) 实现,具体选项参考其文档,示例: + +```ts +import type { UserConfig } from "@farmfe/core"; + +function defineConfig(config: UserConfig) { + return config; +} + +export default defineConfig({ + server: { + proxy: { + "/api": { + target: "https://music-erkelost.vercel.app/banner", + changeOrigin: true, + pathRewrite: (path: any) => path.replace(/^\/api/, ""), + }, + }, + }, +}); +``` + + + +### open + +- **默认值**: `false` + +编译完成后自动打开浏览器到对应的页面。 + +### host + +- **默认值**: `localhost` + +Dev Server 监听的 host。 + +### plugins + +- **默认值**: `[]` + +配置 Farm 的 Dev Server 插件,通过 Dev Server 插件可以扩展 DevServer 的上下文,添加 middleware 等。插件就是一个函数,插件示例如下: + +```ts +export function hmrPlugin(devServer: DevServer) { + const { config, logger } = devServer; + if (config.hmr) { + devServer.ws = new WebSocketServer({ + port: config.hmr.port, + host: config.hmr.host, + }); + devServer.app().use(hmr(devServer)); + devServer.hmrEngine = new HmrEngine( + devServer.getCompiler(), + devServer, + logger + ); + } +} +``` + +然后将该插件配置到 `server.plugins` 中。 diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/config/shared.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/config/shared.md new file mode 100644 index 0000000000..8efa974e43 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/config/shared.md @@ -0,0 +1,77 @@ +# 通用配置 + +为 Farm 的 DevServer 和编译器配置共享选项。 例如: + +```ts +import { defineConfig } from "@farmfe/core"; + +export default defineConfig({ + // All dev server options are under server + root: process.cwd(), +}); +``` + +类型: +```ts +export interface UserConfig { + /** 该项目的当前根目录,默认为当前工作目录 */ + root?: string; + envDir?: string; + envPrefix?: string | string[]; + /** 该目录下的文件将始终被视为静态资产。 在dev中提供它,并在构建时将其复制到output.path */ + publicDir?: string; + /** js 插件(这是一个 javascript 对象)和 rust 插件(这是引用 .farm 文件或包的字符串) */ + plugins?: (RustPlugin | JsPlugin | JsPlugin[])[]; + /** vite 插件 */ + vitePlugins?: (object | (() => { vitePlugin: any; filters: string[] }))[]; + // compilation?: Pick; + // server?: UserServerConfig; +} +``` +## root + +- **default**: `process.cwd()` + +配置项目编译的根目录。 所有相对路径在编译期间都是相对于 `root` 的。 + +## clearScreen +- **default**: `true` + +开始编译时是否清屏。 + +## envDir +- **default**: `` + +配置目录以加载 `.env`、`.env.development`、`.env.Production` 文件。 默认情况下它与 root 相同。 + +```ts +import { defineConfig } from '@farmfe/core'; +import { resolve } from 'path'; +export default defineConfig({ + envPrefix: ['FARM_', 'CUSTOM_PREFIX_', 'NEW_'], + envDir: resolve(process.cwd(), './env'), +}); +``` +在上面的示例中,将从 `/env` 目录加载 `.env`、`.env.development`、`.env.Production` 文件。 + +## envPrefix +- **default**: `['FARM_', 'VITE_']` + +以 `envPrefix` 开头的环境变量将自动注入 [`define`](/docs/config/compilation-options#define)。 + +## publicDir +- **default**: `public` + +`publicDir` 下的文件将始终被视为静态资源。 在 dev 时可以通过 dev server 直接访问,在构建时会将其复制到 [`output.path`](/docs/config/compilation-options#outputpath)。 + +例如,您可以将字体等静态资源添加到 `public` 目录,并将它们用作 `/xxx.ttf` 。 + +## plugins +- **default**: `[]` + +配置 Farm 插件。 参考[使用 Farm 插件](/docs/using-plugins#farm-compilation-plugins) + +## vitePlugins +- **default**: `[]` + +配置 Vite/Rollup/Unplugin 插件。 参见 [使用Vite插件](/docs/using-plugins#using-viterollupunplugin-plugins-in-farm) diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/contribution.mdx b/docs/i18n/zh/docusaurus-plugin-content-docs/current/contribution.mdx new file mode 100644 index 0000000000..7bc5fffe36 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/contribution.mdx @@ -0,0 +1,146 @@ +# 贡献指南 + +非常感谢您对 Farm 的贡献, 在您提交 Pull Request 之前, 请先阅读以下指南。 + +## 行为规范准则 + +所有贡献者都应该遵循 Rust [行为规范](https://www.rust-lang.org/policies/code-of-conduct)。 + +## 错误报告 + +目前 Farm 正在快速开发和迭代中, 正在积极开发 2.0 版本我们会增加许多新功能以及加大生态兼容性以及各种目前问题的优化与更新 在开发和使用中可能会遇到一些问题, 如果您遇到了一些我们不可预料的问题, 请提交 issues 用来报告错误问题, 通过新建一个 [issues](https://github.com/farm-fe/farm/issues/new/choose) 来报告您所遇到的问题。 + +## 创建新特性 + +如果要创建新的功能或者特性, 请在 issues 中添加 [feature request](https://github.com/farm-fe/farm/issues/new/choose)。 + +## 提交代码指南 + +- 编写代码的时候, 请遵循代码编写规范。 + +- 设置您的本地开发环境。 + +- 在您的本地从 `main` 分支切出一个新的功能特性分支。 + +- 使用 `cargo test` 确保所有测试均能通过。 + +- 如果您已经更改了一些包并准备更新版本,则您应该在根目录中输出`npx changeset` 用来发布新版本并且提交。 我们应该尽量保持发布 `patch` 版本, 如果没有重大更改的情况下,请选择 更新 `patch` 版本 + +- 当你完成你的工作后,请通过 `pnpm run ready` 来验证是否可以在本地正常运行 + +## 设置 + +- Fock 并且 clone 仓库到本地。 + +- 为你的 PR 创建一个新的分支。 `git checkout -b your-branch-name`。 + +- 保证您的 `main` 分支指向远程仓库, 并从分支上发出拉取请求, 请确保您的分支是基于 `main` 分支的, 并且运行: + + +- 添加了 Farm 的 upstream 远程仓库 +```bash + git remote add upstream https://github.com/farm-fe/farm.git +``` + +- 从 upstream 远程仓库获取所有分支和它们的提交 +```bash + git fetch upstream +``` + +- 建立了你本地 main 分支与 upstream 仓库 main 分支之间的跟踪关系 +```bash + git branch --set-upstream-to=upstream/main main +``` + +## 设置您的本地开发环境 + +### 依赖 + + + +- 安装 Rust 环境 [rustup](https://www.rust-lang.org/tools/install)。 + +- 确保您的 [Node.js](https://nodejs.org) 版本在 **16** 以上。 + +- 确保您的 [Pnpm](https://pnpm.io) 版本在 **8** 以上。 + +### IDE + +我们推荐使用 `vscode` 进行开发, 并且我们推荐两个必要的插件 + +- `rust-analyzer` 支持 `rust` 语言。 +- `biome` 使用 `biome` 进行格式化和检查代码。 + +你可以在扩展中安装它们 + +### 其他依赖 + +- 在构建 `sass-embedded` 需要用到 [protoc](https://grpc.io/docs/protoc-installation/) 所以您的本地开发环境还需要安装 [protoc](https://grpc.io/docs/protoc-installation/)。 + +**TIP:** 当您在初次开发时, 请确保您的本地环境已经安装了 `protoc`。如果您的本地环境没有安装 `protoc`,则在执行 `pnpm bootstrap` 时会触发脚本, 针对 `mac` `linux` 用户会自动安装 `protoc`, 针对 `windows` 用户不会自动安装, 但是可以根据提示自行下载安装。 + +## 运行项目 + +Farm 的开发启动非常简单, 您只需在根目录中执行 `pnpm bootstrap` 一条命令即可构建所有子包中需要构建的代码。 + +```bash +$ pnpm bootstrap # install the dependencies of the project with series of initialization operations. +``` + +- 使用`pnpm bootstrap`安装依赖项,并通过一系列初始化操作构建核心包。 + +- 使用示例(打开新终端):`cd examples/react && pnpm start`,如果示例不能正常启动,则上报问题。 + +- 如果`examples/react`正常运行,则表明开发环境配置成功。 + +- 如果您更改了`crates`中的 `Rust` 代码,请再次运行 `Packages/core` 下的 `npm run build:rs` 以获取最新的二进制代码。 + +当你在开发 node 侧代码时, 根目录执行 pnpm start 就可以实时调试代码了,当你在开发 rust 侧代码时, 根目录执行 pnpm start:rs 就可以实时调试代码了 + +```bash +// node side +pnpm start + +// rust side +pnpm start:rs +``` + +## 测试 + +我们还需要测试两个部分,一套 `Rust` 测试,一套 `Node` 测试,在您提交代码之前,请确保所有测试均能通过。 + +### Rust 测试 + +- 在根目录下输入 `cargo test` 将会运行所有的 `Rust` 代码测试用例。 + +```sh +# root path or crates path +cargo test +``` + +### Node 测试 + +- 在根目录下输入 `pnpm test` 基于 `vitest` 运行所有的 `Node` 代码测试用例。 + +```sh +# root path +pnpm test +``` + +## 通过脚手架快速创建插件 + +Farm 提供了一个脚手架来帮助您快速创建一个插件, 您可以通过以下命令来创建一个插件。 +您可以 `cd packages/cli` 目录下, 运行 `npm link` 或者全局安装 `@farmfe/cli` 来使用, +安装完成之后, 您可以通过 `farm plugin create` 来创建一个插件, 支持 `rust` 和 `js` 插件 + +```bash +$ farm plugin create # create a plugin support js or rust +``` + +## 小提示 + +Farm 整个项目分为两个部分, JavaScript 和 Rust。 + +- **JavaScript** 部分: 查看 packages 文件夹中的代码, 包含核心包(开发服务, 文件监听, 编译器包装), 脚手架, 运行时和运行时插件 (模块系统, HMR 热更新)。 + +- **Rust** 部分: 查看 crates 以及 rust-plugin 文件夹中的代码, 包含核心包 (编译上下文, 插件驱动等), 编译器 (编译进程、HMR 更新等), Rust 插件。 diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/features/_category_.json b/docs/i18n/zh/docusaurus-plugin-content-docs/current/features/_category_.json new file mode 100644 index 0000000000..828d95ac68 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/features/_category_.json @@ -0,0 +1,8 @@ +{ + "label": "编译能力", + "position": 3, + "link": { + "type": "generated-index", + "description": "Features supported by Farm" + } +} diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/features/css.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/features/css.md new file mode 100644 index 0000000000..4b4412e5d3 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/features/css.md @@ -0,0 +1,179 @@ +# Css/Sass/Less +Farm 支持开箱即用的 CSS 编译,例如: + +```tsx +import './index.css'; +``` + +然后 Farm 会自动为 css 模块启用 HMR,并自动打包 Css。 + +## CSS Modules +Farm 默认支持 css modules,以 `.module.css|less|scss|sass` 结尾的模块默认将被视为 `Css Modules`。 + +```tsx title="comp.tsx" +import styles from './index.module.css' + +export function Comp() { + return
Main
+} +``` +```css title="index.module.css" +.main { + color: red; +} +``` + +您可以通过[`css.modules`](/docs/config/farm-config#cssmodules)配置CSS模块。 例如,您可以将 `css.modules.paths` 设置为 `['.css|sass|less|scss']` 那么所有 css 文件将被视为 css 模块。 + +## CSS 预处理器 +Farm 官方提供了 sass、less、postcss 插件。 + +### Sass +Farm Sass 插件是一个 Rust 插件,使用 `sass-embeded`(后面我们可能会迁移到纯 Rust 编写的 [`grass`](https://github.com/connorskees/grass))。 + +在 Farm 中编译 `sass/scss` 模块的步骤如下: + +1. 安装依赖 +```sh +# npm 或者 yarn 或者 pnpm,使用任意你喜欢的包管理器 +npm install @farmfe/plugin-sass +``` + +2. 配置插件 +```ts +import type { UserConfig } from '@farmfe/core'; + +export default { + // ... + plugins: ['@farmfe/plugin-sass'] // 配置 Rust 插件的包名即可引入和使用该插件 + // 如果你希望配置 plugin-sass 的参数,可以使用如下形式的配置 + // plugins: [ + // ['@farmfe/plugin-sass', { sourceMap: false }] + // ] +}; +``` + +3. 导入sass模块 +```ts +import './index.scss'; +``` + +如果要将 `sass` 与 `css modules` 一起使用,请将文件名从 `index.scss` 更改为 `index.module.scss`,请参阅 [css modules](#css-modules)。 + +`@farmfe/plugin-sass` 支持很多选项,使用 plugins 的数组配置指定插件 sass 的选项: + +```ts +import type { UserConfig } from '@farmfe/core'; + +export default { + plugins: [ + // 通过数组语法指定插件以及配置 + [ + '@farmfe/plugin-sass', + // 所有支持的选项如下 + { + sourceMap: true // bool + sourceMapIncludeSources: true, // bool + alertAscii: true, // bool + alertColor: true, // bool + charset: true, // bool + quietDeps: true, // bool + verbose: false, // bool + style: 'expanded' | 'compressed' // output code style + } + ] + ] +}; +``` + +### Less +Farm less 插件是一个 Js 插件。 在 Farm 中编译 `less` 模块的步骤如下: + +1. 安装依赖 +```sh +# npm or yarn or pnpm, choose your favorite package manager +npm install @farmfe/js-plugin-less +``` + +2. 配置插件 +```ts +import type { UserConfig } from '@farmfe/core'; +import less from '@farmfe/js-plugin-less'; + +export default { + // ... + plugins: [less()] // pass argument to the less function like `less({ /* your options */ })` to specify less options +}; +``` + +3. 导入 Less 模块 +```ts +import './index.less'; +``` + +要将 `less` 与 `css modules` 一起使用,请将文件名从 `index.less` 更改为 `index.module.less`,参考 [css modules](#css-modules) + +### Postcss +Farm postcss 插件是一个 JS 插件,在 Farm 中引入 postcss 的步骤如下: + +1. 安装依赖 +```sh +# npm or yarn or pnpm, choose your favorite package manager +npm install @farmfe/js-plugin-postcss +``` + +2. 配置插件 +```ts +import type { UserConfig } from '@farmfe/core'; +import postcss from '@farmfe/js-plugin-postcss'; + +export default { + // ... + plugins: [postcss()] // pass argument to the less function like `less({ /* your options */ })` to specify less options +}; +``` + +3. 配置 `postcss.config.js`,引入需要的 postcss 插件 + +```js title=postcss.config.js +module.exports = { + plugins: [ + require('postcss-pxtorem')({ + rootValue: 16, + propList: ['*'], + }), + require('tailwindcss'), + ] +} +``` + +## Css Prefixer +Farm 支持开箱即用的 css prefixer,您可以使用`compilation.css.prefixer`对其进行配置。 + +```ts title="farm.config.ts" +import type { UserConfig } from '@farmfe/core'; + +function defineConfig(config: UserConfig) { + return config; +} + +export default defineConfig({ + compilation: { + css: { + prefix: { + targets: ['ie >= 10'] + } + }, + }, +}); +``` +对于输入代码 +```css +div { + display: flex; +} +``` +输出 +```css +div{display:-ms-flexbox;display:flex} +``` diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/features/dev-server.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/features/dev-server.md new file mode 100644 index 0000000000..381b00216a --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/features/dev-server.md @@ -0,0 +1,84 @@ +# DevServer 和 HMR +Farm默认在 `development` 环境中提供 `DevServer` 并启用了 `HMR` 。 + +## 配置 Dev Server +Farm提供了许多有用的选项来配置开发服务器。所有的DevServer选项都是通过[`server`](/zh/docs/config/dev-server)配置的。 + +```ts +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + server: { + port: 9801, + cors: true, + proxy: { + // ... + }, + open: true, + } +}) +``` + +:::note +如果你正在为Farm开发工具,请参考[Javascript API](/zh/docs/api/javascript-api)然后以编程方式创建开发服务器。 +::: + +## Dev Server 中间件 +你可以使用 [`middlewares`](/zh/docs/config/dev-server#middlewares) 来处理开发服务器的请求。例如: + +```ts title="farm.config.ts" +import { Middleware } from 'koa'; +import { Server, defineConfig } from '@farmfe/core'; + +export function headers(devSeverContext: Server): Middleware { + const { config } = devSeverContext; + if (!config.headers) return; + + return async (ctx, next) => { + if (config.headers) { + for (const name in config.headers) { + ctx.set(name, config.headers[name] as string | string[]); + } + } + await next(); + }; +} + +export default defineConfig({ + server: { + middlewares: [ + headers + ] + } +}) +``` + +在上述示例中,Farm中间件是一个暴露 `Koa Middleware` 的函数。常见的Koa中间件可以直接使用,例如: + +```ts {2,7} +import { defineConfig } from "@farmfe/core"; +import compression from 'koa-compress'; + +export default defineConfig({ + server: { + middlewares: [ + compression + ] + }, +}); +``` + +## Hot Module Replacement(HMR) +Farm提供了一个与 [兼容 Vite 的HMR API](/zh/docs/api/hmr-api)。如果你是框架作者,可以利用这个 API 来更新你的应用实例,而无需重新加载页面。 + +HMR API允许你在应用运行时接收模块的更新,并应用这些更新,而无需重新加载整个页面。这可以极大地提高开发效率,因为它允许你在不丢失应用状态的情况下看到代码更改的效果。 + +* 对于React,官方插件 [@farmfe/plugin-react](/docs/plugins/official-plugins/react)会自动启用 HMR。 +* 对于Vue、Solid等框架,它们的插件如 `@vitejs/plugin-vue` 、 `vite-plugin-solid` 等都支持HMR。 + +Farm提供了官方模板,这些模板已经设置好了所有这些能力,你可以通过create-farm创建应用,然后所有的HMR能力就可用了。 + +:::note +* 对于应用用户,HMR通常是开箱即用的,如果你需要自定义HMR行为,可以参考 **[兼容 Vite 的 HMR API](/zh/docs/api/hmr-api)**。 +* 如果你是框架作者,可以参考 [HMR选项](/zh/docs/config/dev-server#hmr) 来配置HMR。 +::: diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/features/env.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/features/env.md new file mode 100644 index 0000000000..f903805d25 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/features/env.md @@ -0,0 +1,65 @@ +# 环境变量和模式 + +`Farm` 通过 `process.env.NODE_ENV` 来区分 `development` 环境和 `production` 环境。 + +在不同的环境中,环境变量会被静态替换,因此使用静态常量来表示环境变量,而不是使用动态表达式。 + +## `.env` 文件 + +`Farm` 使用 `dotenv` 来加载你的额外环境变量,例如 `.env` 文件。默认情况下, `.env` 文件从 [`root`](/zh/docs/config/shared#root) 加载,你可以使用 [`envDir`](#envdir) 来自定义。 + +```js +// .env +FARM_APP_SECRET=secret +Farm_APP_PASSWORD=password +APP_VERSION=1.0.0 +``` + +`Farm` 通过dotenv加载 `.env` 文件,将其加载到 `process.env` 中,并最终将其注入到define中。 + +:::danger +为了确保客户端的安全,防止当前系统中的环境变量被暴露给客户端, `Farm` 只会识别以 `FARM_`、`VITE_` 开头的重要环境变量,以便更好地兼容vite及其生态系统。前缀可以通过 [`envPrefix`](#envprefix) 前缀配置 +::: + +`Farm` 通过dotenv-expand扩展环境变量。对于仅用于开发的环境变量,使用 `.env.development` 文件,对于仅用于生产的环境变量,使用 `.env.production` 文件,对于通过 `--mode ` 传递的自定义模式,从 `.env.` 文件加载。 + +* 如果你想自定义加载 `.env` 文件的目录,你可以配置 [`envDir`](#envdir)。 +* 如果你想自定义注入到 [`define`](/zh/docs/config/compilation-options#define) 的环境变量的前缀,你可以配置 [`envPrefix`](#envprefix)。 + + +## envPrefix + +- **默认值**: `FARM_`、`VITE_` + +通过配置 `envPrefix` 来自定义环境变量的前缀。以 `envPrefix` 开头的环境变量将自动注入到define中。例如,在 `.env` 文件中: + +```js +// .env +FARM_CUSTOM_VERSION=1.0.0 +APP_VERSION=0.1.0 +``` + +那么 `FARM_CUSTOM_VERSION` 将被注入到你的业务代码中,但 `APP_VERSION` 不会被注入。在你的业务代码中: + +```tsx +export function MyComp() { + const farmCustomVersion = FARM_CUSTOM_VERSION; + return
Farm Custom Version: {farmCustomVersion}
+} +``` +`FARM_CUSTOM_VERSION` 将自动被替换为 `'1.0.0'` 。 + + + +## envDir +- **默认值**: `` + +加载env文件的目录。默认情况下,Farm从根目录加载 [`env 文件`](#env-文件)。 + +```ts +export defineConfig({ + envDir: './env' +}) +``` + +对于上述配置示例,Farm将从 `/env` 目录加载`.env`、`.env.development`等环境变量文件。 diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/features/html.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/features/html.md new file mode 100644 index 0000000000..47f1962a5c --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/features/html.md @@ -0,0 +1,114 @@ +--- +sidebar_position: 1 +--- + +# Html + +## 基本用法 + +Farm 支持开箱即用地编译 Html,并且在构建 Web 项目时应该使用 Html 作为入口,例如: + +```ts title="farm.config.ts" +import type { UserConfig } from "@farmfe/core"; + +export default defineConfig({ + input: { + index: "./index.html", // using ./index.html as entry + }, +}); +``` + +:::note +如果未指定 `input`,则默认为 `{index: './index.html'}`。 +::: + +在`./index.html`中,应该使用` + + +``` + +你也可以使用``来引用你的全局 CSS。 + +Farm 在编译时会将这些 `script` 和 `link` 转化为最终的生产可用的产物。请注意,当您想引用本地模块时,必须使用 `相对路径`,例如 `` 将引用本地模块并编译它, 但 `` 或 `` 则不会。 + +:::note +`script` 和 `link` 可以引用 farm 支持的任何模块类型,例如,`js`、`jsx`、`ts`、`tsx` 或插件支持的其他模块类型。 您可以根据需要使用任意数量的 `script` 或 `link`。 +::: + +## 多页面应用程序 - MPA + +如果您正在构建多页面应用程序,只需配置多个 html,例如: + +```ts title="farm.config.ts" +import type { UserConfig } from '@farmfe/core'; + +export default defineConfig({ + input: { + home: './index.html', // Home Page + about: './about.html', // About Page + // ... more pages + } +}) +``` + +Farm 将并行编译这些页面。 + +## 继承 html 模板 + +Farm 支持通过使用 `html.base` 配置继承 html 模板,这在构建共享 html 的多页面应用程序时很有帮助。 + +```ts title="farm.config.ts" +import type { UserConfig } from "@farmfe/core"; + +export function defineConfig(config: UserConfig) { + return config; +} + +export default defineConfig({ + // ... + compilation: { + input: { + home: "./index.html", // Home Page + about: "./about.html", // About Page + // ... more pages + }, + html: { + base: "./base.html", + }, + }, +}); +``` + +然后添加一个`base.html`,占位符`{{children}}`将被替换为子 html 的内容。 + +```html title="./base.html" + + + + + + + Document + + +
+ + {{children}} + + +``` + +继承`./base.html`: + +```html title="./src/home.html" + + +``` diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/features/lazy-compilation.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/features/lazy-compilation.md new file mode 100644 index 0000000000..6fe0944140 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/features/lazy-compilation.md @@ -0,0 +1,58 @@ +# 懒编译 +当涉及到一个大项目时,您可能希望将它们分成小块并按需加载。 这可以通过动态导入来实现。 + +````js +const page = React.lazy(() => import('./page')); // 延迟加载页面 +```` + +默认情况下,Farm 会在开发时延迟编译这些动态导入,仅在模块真正执行时才编译它们。 延迟编译可以极大提速大型项目的编译。 + +:::note +对于生产构建,延迟编译始终被禁用。 +::: + +请注意,正确使用`动态导入`对于使`懒编译`更好地工作非常重要。 例如,如果你的一个页面有一个很大的依赖项,但是这个依赖项在这个页面渲染之前不会被使用,那么有必要确保这个大的依赖项是动态导入的,所以它不会被编译,直到页面执行。 + +## 配置延迟编译 +使用`compilation.lazyCompilation`来启用或禁用它: + +```ts title="farm.config.ts" +export default { + compilation: { + lazyCompilation: true, + }, +}; +``` + +## 懒编译如何工作 +当启用延迟编译时,Farm 将首先分析您的所有`动态导入`,例如: + +```js +const page = React.lazy(() => import('./page')); +``` +Farm 会将 `./page` 视为应该延迟编译的模块,并且不会编译它,相反,Farm 将为 `./page` 返回一个虚拟占位符模块,如下所示: + +```ts +// ... other actions +const compilingModules = FarmModuleSystem.compilingModules; +// 返回一个promise,这个promise将在延迟编译完成后 resolve。 +let promise = Promise.resolve(); + +// 模块已经在懒编译中 +if (compilingModules.has(modulePath)) { + promise = promise.then(() => compilingModules.get(modulePath)); +} else { + // 请求开发服务器进行延迟编译 + const url = '/__lazy_compile?paths=' + paths.join(',') + `&t=${Date.now()}`; + promise = import(url).then((module: any) => { + const result: LazyCompileResult = module.default; + // ... + }); + // ... more actions +} + +export const __farm_async = true; +export default promise; +``` + +上面的例子说明了虚拟占位符模块的基本结构。 当占位符执行时,它将请求开发服务器编译该模块及其依赖项。 从开发服务器获取延迟编译结果后,占位符模块会将这些更改修补到 Farm 的运行时模块系统。 \ No newline at end of file diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/features/optimization.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/features/optimization.md new file mode 100644 index 0000000000..aafccce55d --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/features/optimization.md @@ -0,0 +1 @@ +# Product Optimization \ No newline at end of file diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/features/script.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/features/script.md new file mode 100644 index 0000000000..1c666cfb6b --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/features/script.md @@ -0,0 +1,193 @@ +# TS/TSX + +Farm 支持开箱即用地编译`Js/Jsx/Ts/Tsx`,并默认将`Jsx/Tsx`编译为 React。 + +```tsx title="./button.tsx" +import Button from "./Button"; + +function ButtonGroup(props: ButtonProps) { + return ( +
+ {props.buttons.map((b) => ( + + ))} +
+ ); +} +``` + +Farm 使用 SWC 来编译脚本,Farm 为脚本编译设置了合理的默认配置。 另外,您可以使用`compilation.script`来配置如何编译脚本文件。 有关详细信息,请参阅 [compilation.script](/docs/config/farm-config#compilation-options)。 + +## 配置 Swc 解析器 + +您可以通过`compilation.script.parser`配置 SWC 解析器。 请参阅 https://swc.rs/docs/configuration/compilation#jscparser。 + +例如,如果你想启用装饰器,你可以设置`compilation.script.parser.esConfig.decorators`(如果模块是 TS,则设置 tsConfig.decorators): + +```ts title="farm.config.ts" +export default { + compilation: { + script: { + // for .js/.jsx files + esConfig: { + decorators: true, + }, + // for .ts/.tsx files + tsConfig: { + decorators: true, + }, + }, + }, +}; +``` + +默认情况下,Farm 为`.jsx|.tsx`文件设置`jsx: true`。 其他字段默认为 SWC 的默认值。 + +## 配置目标执行环境 + +运行项目时使用`compilation.script.target`配置目标环境,Farm 将其默认设置为`ESNext`。 + +此选项可以与`compilation.presetEnv`一起使用,以针对旧浏览器优雅地降级您的项目。 例如,您可以将 target 设置为 `ES5` 并启用 `presetEnv`,那么您的项目将完全降级到 ES5。 + +```ts title="farm.config.ts" +export default { + compilation: { + script: { + target: "ES5", + }, + presetEnv: true, + }, +}; +``` + +有关`presetEnv`的更多信息,请参阅 [Polyfill](/docs/features/polyfill)。 + +## 装饰器 + +装饰器默认不启用, 可以通过设置 `compilation.script.parser.tsConfig.decorators` 为 `true` 来启用装饰器。 + +```ts +import { defineConfig } from "@farmfe/core"; + +export default defineConfig({ + compilation: { + script: { + parser: { + tsConfig: { + // 启用装饰器 + decorators: true, + }, + }, + // 配置装饰器 + decorators: { + legacyDecorator: true, + decoratorMetadata: false, + decoratorVersion: '2021-12', + includes: ["src/broken.ts"], + excludes: ['node_modules/'], + } + }, + }, +}); +``` + +> Farm 提供了一个装饰器的示例,可以看 https://github.com/farm-fe/farm/tree/main/examples/decorators + +> 默认情况下, Farm 不会转译 `node_modules` 下的装饰器, 参考 [compilation.script.decorators.excludes](/docs/config/farm-config#scriptdecorators). + +## 使用 SWC 插件 + +SWC Plugins 可以直接在 Farm 中使用,例如我们在 Farm 中使用 swc-plugin-vue-jsx 来编译 vue jsx: + +```ts title="farm.config.ts" +import jsPluginVue from "@farmfe/js-plugin-vue"; + +/** + * @type {import('@farmfe/core').UserConfig} + */ +export default { + compilation: { + script: { + plugins: [ + { + name: "swc-plugin-vue-jsx", + options: { + transformOn: true, + optimize: true, + }, + filters: { + // resolvedPaths: [".+"] + moduleTypes: ["tsx", "jsx"], + }, + }, + ], + }, + }, + plugins: [jsPluginVue()], +}; +``` + +有关更多详细信息,请参阅[使用插件](/docs/using-plugins#using-swc-plugins)。 + +## Vite 风格的 `import.meta.glob` + +Farm 完整支持 Vite 风格的 `import.meta.glob`, 参考 [glob import](https://vitejs.dev/guide/features.html#glob-import). + +例如: + +```ts +const modules = import.meta.glob("./dir/*.js"); +``` + +将会被编译成以下结果 + +```ts +// code produced by Farm +const modules = { + "./dir/foo.js": () => import("./dir/foo.js"), + "./dir/bar.js": () => import("./dir/bar.js"), +}; +``` + +使用 `{ eager: true }` 后: + +```ts +const modules = import.meta.glob("./dir/*.js", { eager: true }); +``` + +将会被编译成以下结果: + +```ts +// code produced by Farm +import * as __glob__0_0 from "./dir/foo.js"; +import * as __glob__0_1 from "./dir/bar.js"; +const modules = { + "./dir/foo.js": __glob__0_0, + "./dir/bar.js": __glob__0_1, +}; +``` + +支持数组形式: + +```ts +const modules = import.meta.glob(["./dir/*.js", "./another/*.js"]); +``` + +支持通过 `!` 排除某些匹配: + +```ts +const modules = import.meta.glob(["./dir/*.js", "!**/bar.js"]); +``` + +```ts +// code produced by Farm +const modules = { + "./dir/foo.js": () => import("./dir/foo.js"), +}; +``` + +:::note + +- `import.meta.glob` 参数必须全部是字面量,不能使用表达式。 +- `import.meta.glob` 在编译时处理和转换,在运行时不存在。 + ::: diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/features/sourcemap.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/features/sourcemap.md new file mode 100644 index 0000000000..31a1baf50b --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/features/sourcemap.md @@ -0,0 +1,22 @@ +# Source Map +Farm 支持 Source Map,默认情况下自动启用。 可以通过选项启用或禁用 sourcemap。 + +:::note +Farm 默认不会为 node_modules 下的文件生成 sourcemap,如果你想为 node_modules 下的文件生成 sourcemap,请将 `compilation.sourcemap` 配置为`all`。 +::: + +使用`compilation.sourcemap`配置 sourcemap 生成: +```ts title="farm.config.ts" +export default { + compilation: { + sourcemap: 'all', // generate sourcemap for modules under node_modules + }, +}; +``` + +所有选项如下: +* **`true`**:只为不在`node_modules`下的文件生成 sourcemap,并生成单独的 sourcemap 文件 +* **`false`**:禁用源映射 +* **`inline`**:只为不在`node_modules`下的文件生成 sourcemap,并将 sourcemap 内联到产物中,不生成单独的文件 +* **`all`**:为所有文件生成 sourcemap,并生成单独的 sourcemap 文件 +* **`all-inline`**:为所有文件生成 sourcemap,并将 sourcemap 内联到产品中,不生成单独的文件 \ No newline at end of file diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/features/static.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/features/static.md new file mode 100644 index 0000000000..623adf126e --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/features/static.md @@ -0,0 +1,61 @@ +# 静态资源 +> v0.4 及以上支持 +Farm 支持三种资源加载方式: `url` , `inline` , `raw` 。 + +## 以 URL 形式使用 +导入图片: +```jsx +import rocketUrl from './assets/rocket.svg'; // return the url of this image + +export function Main() { + return // using the url +} +``` + +导入图片时默认以 URL 的形式。 当使用 URL 形式导入图像时,图像将直接复制到输出目录,并且图像模块本身将被编译为 js 模块,如下所示: + +```js +export default '/rocket..svg' +``` + +使用 `compilation.output.assetsFilename` 来配置你的资源名称。 + +## 内联 + +使用查询 `?inline` 告诉 Farm 你想要内联你的资源,然后资源将被转换为 `base64`,例如: + +```js +// importer +import logo from './assets/logo.png?inline'; // logo is a base 64 str + +// the image module will be compiled to: +export default 'data:image/png,base64,xxxxx=='; +``` + +## 原始字符串 +例如,使用查询`?raw`告诉 Farm 您要读取资产的原始字符串 + +```js +// import +import logo from './assets/license.txt?raw'; // return the content string of the assets + +// the txt file will be compiled to: +export default 'MIT xxxx'; +``` + +## 相关配置 +* 使用 `compilation.output.assetFileName` 来控制产物文件名 +* 使用 `compilation.assets.include` 将更多类型的文件视为静态资源。 + +```js +export default { + compilation: { + output: { + assetsFilename: 'assets/[resourceName].[hash].[ext]', // [] 里面的是 Farm 支持的全部占位符 + }, + assets: { + include: ['txt'] // 额外静态资源类型 + } + } +} +``` \ No newline at end of file diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/frameworks/electron.mdx b/docs/i18n/zh/docusaurus-plugin-content-docs/current/frameworks/electron.mdx new file mode 100644 index 0000000000..16656f3861 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/frameworks/electron.mdx @@ -0,0 +1,30 @@ +import { PackageManagerTabs } from "../../../../../src/theme/PackageManagerTabs"; + +# Electron + +基于 `Farm` 创建一个 `Electron` 项目。 + +`Farm` 提供两种方案来支持创建 `Electron` 项目: +- 使用 `create-farm` 脚手架创建脚手架项目 +- 你可以根据当前文档手动创建一个 `Electron` 项目 + +### 创建 Electron 项目 + + + + +在 `Select Framework` 中选择 `Electron` 模版 + +开发环境时运行 + + + +在生产环境下进行打包 + + + +预览生产环境打包之后构建的产物 + + + +如若想查看示例详情: [Electron 示例](https://github.com/farm-fe/farm/tree/main/examples/electron) diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/frameworks/lit.mdx b/docs/i18n/zh/docusaurus-plugin-content-docs/current/frameworks/lit.mdx new file mode 100644 index 0000000000..fab8eaf3d8 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/frameworks/lit.mdx @@ -0,0 +1,55 @@ +import { PackageManagerTabs } from "../../../../../src/theme/PackageManagerTabs"; + +# Lit + +基于 `Farm` 创建一个 `Lit` 项目。 + +`Farm` 提供两种方案来支持创建 `Lit` 项目: +- 使用 `create-farm` 脚手架创建脚手架项目 +- 你可以根据当前文档手动创建一个 `Lit` 项目 + +### 创建 Lit 项目 + + + + +在 `Select Framework` 中选择 `Lit` 模版 + +在使用 lit 的情况下我们需要配置`装饰器` + +```javascript title="farm.config.ts" +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + compilation: { + presetEnv: false, + script: { + plugins: [], + target: 'es2022', + parser: { + tsConfig: { + decorators: true, + dts: false, + noEarlyErrors: false, + tsx: false + } + } + } + } +}); + +``` + +开发环境时运行 + + + +在生产环境下进行打包 + + + +预览生产环境打包之后构建的产物 + + + +如若想查看示例详情: [Lit 示例](https://github.com/farm-fe/farm/tree/main/examples/Lit) diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/frameworks/nestjs.mdx b/docs/i18n/zh/docusaurus-plugin-content-docs/current/frameworks/nestjs.mdx new file mode 100644 index 0000000000..f2df620c7a --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/frameworks/nestjs.mdx @@ -0,0 +1,29 @@ +import { PackageManagerTabs } from "../../../../../src/theme/PackageManagerTabs"; + +# NestJs + +基于 `Farm` 创建一个 `NestJs` 项目。 + +`Farm` 提供两种方案来支持创建 `NestJs` 项目: +- 使用 `create-farm` 脚手架创建脚手架项目 +- 你可以根据当前文档手动创建一个 `NestJs` 项目 + +### 创建 NestJs 项目 + + + +在 `Select Framework` 中选择 `NestJs` 模版 + +开发环境时运行 + + + +在生产环境下进行打包 + + + +预览生产环境打包之后构建的产物 + + + +如若想查看示例详情: [Nestjs 示例](https://github.com/farm-fe/farm/tree/main/examples/nestjs) diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/frameworks/preact.mdx b/docs/i18n/zh/docusaurus-plugin-content-docs/current/frameworks/preact.mdx new file mode 100644 index 0000000000..4d31988287 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/frameworks/preact.mdx @@ -0,0 +1,43 @@ +import { PackageManagerTabs } from "../../../../../src/theme/PackageManagerTabs"; + +# Preact + + +基于 `Farm` 创建一个 `Preact` 项目。 + +`Farm` 提供两种方案来支持创建 `Preact` 项目: +- 使用 `create-farm` 脚手架创建脚手架项目 +- 你可以根据当前文档手动创建一个 `Preact` 项目 + +### 创建 Preact 项目 + + + +在 `Select Framework` 中选择 `Preact` 模版 + +:::warning Preact +对于 `Preact` 的支持, `Farm` 使用 `vite` 的 `preact` 插件 +::: + +```javascript title="farm.config.ts" +import { defineConfig } from '@farmfe/core'; +import Preact from "vite-plugin-preact"; + +export default defineConfig({ + plugins: [Preact()], +}); +``` + +开发环境时运行 + + + +在生产环境下进行打包 + + + +预览生产环境打包之后构建的产物 + + + +如若想查看示例详情: [Preact 示例](https://github.com/farm-fe/farm/tree/main/examples/preact) diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/frameworks/react.mdx b/docs/i18n/zh/docusaurus-plugin-content-docs/current/frameworks/react.mdx new file mode 100644 index 0000000000..0d446bdf60 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/frameworks/react.mdx @@ -0,0 +1,115 @@ +import { PackageManagerTabs } from "../../../../../src/theme/PackageManagerTabs"; + +# React + +基于 `Farm` 创建一个 `React` 项目。 + +`Farm` 提供两种方案来支持创建 `React` 项目: +- 使用 `create-farm` 脚手架创建脚手架项目 +- 你可以根据当前文档手动创建一个 `React` 项目 + +### 创建 React 项目 + + + +在 `Select Framework` 中选择 `React` 模版 + +`Farm` 需要通过注册 `@farmfe/plugin-react` 插件来对 `React` 项目进行支持。 + +```javascript title="farm.config.ts" +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + plugins: ['@farmfe/plugin-react'], +}); +``` +`@farmfe/plugin-react` 插件由 `Rust` 编写, 因此你不需要显式引入, 通过传递一个字符串包名即可注册。 + +### 集成 `emotion` + +你可以通过注册 `@swc/plugin-emotion` 插件来对 `emotion` 进行支持。 + +```javascript title="farm.config.ts" +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + compilation: { + script: { + plugins: [ + { + name: '@swc/plugin-emotion', + options: {}, + filters: { + moduleTypes: ['tsx'], + }, + }, + ], + }, + }, + plugins: [['@farmfe/plugin-react', { "runtime": "automatic", "importSource": "@emotion/react" }]], +}); + +``` + +```javascript title="src/index.tsx" +import { css } from '@emotion/react'; + +const color = 'white'; + +export function Main() { + return ( +
setCount((c) => c + 1)} + css={css` + padding: 32px; + background-color: hotpink; + font-size: 24px; + border-radius: 4px; + &:hover { + color: ${color}; + } + `} + > + {a}: {count} +
+ ); +} +``` + +### 集成 `svgr` + +SVGR 是一个用于将 SVG 转换为 React 组件的工具,Farm 提供了 Js 插件来支持 SVGR。 + +```javascript title="farm.config.ts" +import { defineConfig } from '@farmfe/core'; +import farmJsPluginSvgr from '@farmfe/js-plugin-svgr'; + +export default defineConfig(async (env) => { + return { + plugins: [ + [ + '@farmfe/plugin-react', + { + refresh: process.env.NODE_ENV === 'development', + development: process.env.NODE_ENV === 'development' + } + ], + farmJsPluginSvgr() + ] + }; +}); + +开发环境时运行 + + + +在生产环境下进行打包 + + + +预览生产环境打包之后构建的产物 + + + + +如若想查看示例详情: [React 示例](https://github.com/farm-fe/farm/tree/main/examples/react) diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/frameworks/solid.mdx b/docs/i18n/zh/docusaurus-plugin-content-docs/current/frameworks/solid.mdx new file mode 100644 index 0000000000..4c92811e86 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/frameworks/solid.mdx @@ -0,0 +1,42 @@ +import { PackageManagerTabs } from "../../../../../src/theme/PackageManagerTabs"; + +# Solid + +基于 `Farm` 创建一个 `Solid` 项目。 + +`Farm` 提供两种方案来支持创建 `Solid` 项目: +- 使用 `create-farm` 脚手架创建脚手架项目 +- 你可以根据当前文档手动创建一个 `Solid` 项目 + +### 创建 Solid 项目 + + + +在 `Select Framework` 中选择 `Solid` 模版 + +:::warning Solid +对于 `Solid` 的支持, `Farm` 推荐使用 `Vite` 插件。 +::: + +```javascript title="farm.config.ts" +import { defineConfig } from '@farmfe/core'; +import Solid from "vite-plugin-solid"; + +export default defineConfig({ + plugins: [Solid()], +}); +``` + +开发环境时运行 + + + +在生产环境下进行打包 + + + +预览生产环境打包之后构建的产物 + + + +如若想查看示例详情: [Solid 示例](https://github.com/farm-fe/farm/tree/main/examples/vite-adapter-solid) diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/frameworks/svelte.mdx b/docs/i18n/zh/docusaurus-plugin-content-docs/current/frameworks/svelte.mdx new file mode 100644 index 0000000000..55ab6383c9 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/frameworks/svelte.mdx @@ -0,0 +1,51 @@ +import { PackageManagerTabs } from "../../../../../src/theme/PackageManagerTabs"; + +# Svelte + +基于 `Farm` 创建一个 `Svelte` 项目。 + +`Farm` 提供两种方案来支持创建 `Svelte` 项目: +- 使用 `create-farm` 脚手架创建脚手架项目 +- 你可以根据当前文档手动创建一个 `Svelte` 项目 + +### 创建 Svelte 项目 + + + +在 `Select Framework` 中选择 `Svelte` 模版 + +:::warning Svelte +对于 `Svelte` 的支持, `Farm` 推荐使用 `Vite` 插件。 +::: + +```javascript title="farm.config.ts" +import { defineConfig } from '@farmfe/core' +import { svelte } from '@sveltejs/vite-plugin-svelte' + +export default defineConfig({ + vitePlugins: [svelte()], +}) + +``` + +```javascript title="svelte.config.ts" +import { vitePreprocess } from '@sveltejs/vite-plugin-svelte' + +export default { + preprocess: vitePreprocess(), +} +``` + +开发环境时运行 + + + +在生产环境下进行打包 + + + +预览生产环境打包之后构建的产物 + + + +如若想查看示例详情: [Svelte 示例](https://github.com/farm-fe/farm/tree/main/examples/vite-adapter-svelte) diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/frameworks/tauri.mdx b/docs/i18n/zh/docusaurus-plugin-content-docs/current/frameworks/tauri.mdx new file mode 100644 index 0000000000..75b511c83b --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/frameworks/tauri.mdx @@ -0,0 +1,31 @@ +import { PackageManagerTabs } from "../../../../../src/theme/PackageManagerTabs"; + +# Tauri + +基于 `Farm` 创建一个 `Tauri` 项目。 + +`Farm` 提供两种方案来支持创建 `Tauri` 项目: +- 使用 `create-farm` 脚手架创建脚手架项目 +- 你可以根据当前文档手动创建一个 `Tauri` 项目 + +### 创建 Tauri 项目 + + + + +在 `Select Framework` 中选择 `Tauri` 模版 + +开发环境时运行 + + + +在生产环境下进行打包 + + + +预览生产环境打包之后构建的产物 + + + + +如若想查看示例详情: [Tauri 示例](https://github.com/farm-fe/farm/tree/main/examples/Tauri) diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/frameworks/vanilla.mdx b/docs/i18n/zh/docusaurus-plugin-content-docs/current/frameworks/vanilla.mdx new file mode 100644 index 0000000000..758a254905 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/frameworks/vanilla.mdx @@ -0,0 +1,31 @@ +import { PackageManagerTabs } from "../../../../../src/theme/PackageManagerTabs"; + +# Vanilla + +基于 `Farm` 创建一个 `Vanilla` 项目。 + +`Farm` 提供两种方案来支持创建 `Vanilla` 项目: +- 使用 `create-farm` 脚手架创建脚手架项目 +- 你可以根据当前文档手动创建一个 `Vanilla` 项目 + +### 创建 Vanilla 项目 + + + +在 `Select Framework` 中选择 `Vanilla` 模版 + +运行 vanilla 模版项目不需要安装任何其他依赖,直接启动开发服务器即可 + +开发环境时运行 + + + +在生产环境下进行打包 + + + +预览生产环境打包之后构建的产物 + + + +如若想查看示例详情: [Vanilla 示例](https://github.com/farm-fe/farm/tree/main/crates/create-farm-rs/template/vanilla) diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/frameworks/vue.mdx b/docs/i18n/zh/docusaurus-plugin-content-docs/current/frameworks/vue.mdx new file mode 100644 index 0000000000..94ac2646e1 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/frameworks/vue.mdx @@ -0,0 +1,54 @@ +import { PackageManagerTabs } from "../../../../../src/theme/PackageManagerTabs"; + +# Vue + +基于 `Farm` 创建一个 `Vue` 项目。 + +`Farm` 提供两种方案来支持创建 `Vue` 项目: +- 使用 `create-farm` 脚手架创建脚手架项目 +- 你可以根据当前文档手动创建一个 `Vue` 项目 + +### 创建 Vue 项目 + + + +在 `Select Framework` 中选择 `Vue` 模版 + +:::warning Vue +目前 `Farm` 支持 `vue3`, `vue2`, `vue2.7` +对于 `Vue` 插件 `Farm` 推荐使用 `Vite` 插件, 支持的三种 vue 版本需要安装对应的 `vite` 插件, 目前也正在进行原生插件 [fervid](https://github.com/phoenix-ru/fervid)的开发。 +::: + +```javascript title="farm.config.ts" +import { defineConfig } from '@farmfe/core'; +import Vue from '@vite/plugin-vue' + +export default defineConfig({ + plugins: [Vue()], // vue3 plugin +}); +``` + +### 集成 jsx + +```javascript title="farm.config.ts" +import { defineConfig } from '@farmfe/core'; +import Vue from '@vite/plugin-vue-jsx' + +export default defineConfig({ + plugins: [Vue()], +}); +``` + +开发环境时运行 + + + +在生产环境下进行打包 + + + +预览生产环境打包之后构建的产物 + + + +如若想查看示例详情: [Vue 示例](https://github.com/farm-fe/farm/tree/main/examples/vite-adapter-vue) diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/migration/from-vite.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/migration/from-vite.md new file mode 100644 index 0000000000..dcfffb2238 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/migration/from-vite.md @@ -0,0 +1,17 @@ +# 从 Vite 迁移 + +:::note +Vite 插件如 `unocss` 与 `Vite` 深度集成,由于内部设计的差异,这些插件可能与 Farm 不兼容。您可以尝试其他方法,如 `unocss postcss` 插件。 +::: + +从 Vite 迁移非常简单,因为 Farm 与 Vite 兼容。您需要做的就是将 `vite.config.ts` 转换为 `farm.config.ts` + +- 参考[Configuring Farm](/zh/docs/config/configuring-farm) 将 farm 配置选项映射到 vite 配置 +- 对于 `Vite Plugins`,将 `vite.config.ts` 中的`plugins`移动到 `farm.config.ts` 中的 `vitePlugins` + +注意: + +- 一些 Vite 配置选项在 Farm 中是不需要的,例如 `optimizeDeps`,您可以在迁移到 Farm 时忽略这些选项 +- 对于 SSR,您需要将其重构为[Farm SSR](/zh/docs/advanced/ssr) + +我们已将 [Real Vite Admin Project](https://github.com/farm-fe/farm-soybean-admin) 迁移到 Farm。有关详细信息,请查看此迁移示例 diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/community-plugins.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/community-plugins.md new file mode 100644 index 0000000000..0a28413331 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/community-plugins.md @@ -0,0 +1,98 @@ +# 社区插件 + +## Farm Plugins + +- [farm-pulgin-strip](https://github.com/CCherry07/farm-pulgin-strip): 一个 Farm Rust 插件,用于从代码中删除 debugger 语句和函数,例如 assert.equal 和 console.log 。 + +## Vite/Rollup Plugins + +Farm支持 `Vite/Rollup` 插件开箱即用。所以`Vite/Rollup`或`unplugin`插件可以直接在Farm中使用。 + +:::tip +如果您开发了兼容 Farm 的插件并且想在此处列出,欢迎 PR。 +::: + +使用 `farm.config.ts` 中的 `vitePlugins` 来配置 `Vite/Rollup` 插件。 + +```ts +import { UserConfig } from '@farmfe/core'; +import vue from '@vitejs/plugin-vue'; +import vueJsx from '@vitejs/plugin-vue-jsx'; + +const config: UserConfig = { + vitePlugins: [ + vue(), + vueJsx(), + ] +} +``` + +- **[`@vitejs/plugin-vue`](https://github.com/vitejs/vite-plugin-vue/blob/main/packages/plugin-vue/README.md)**: Vue 支持. +- **[`@vitejs/plugin-vue-jsx`](https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue-jsx)**: Vue Jsx/Tsx 支持. +- **[`vite-plugin-solid`](https://www.npmjs.com/package/vite-plugin-solid)**: Solid 支持 +- **[`vite-plugin-mock`](https://www.npmjs.com/package/vite-plugin-solid)**: Mock 数据. +- ... + +## unplugin + +:::note +目前,您可以在 Farm 中使用“unplugin/vite”进行“unplugin/rollup”。 当[此 PR](https://github.com/unjs/unplugin/pull/341) 合并到 unplugin 时,`unplugin/farm` 将可用。 +::: + +```ts +import Icons from 'unplugin-icons/vite'; +import IconsResolver from 'unplugin-icons/resolver'; +import Components from 'unplugin-vue-components/rollup'; +import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'; +import { FileSystemIconLoader } from 'unplugin-icons/loaders'; + +const config: UserConfig = { + vitePlugins: [ + Icons({ + compiler: 'vue3', + customCollections: { + [collectionName]: FileSystemIconLoader(localIconPath, svg => + svg.replace(/^ + + npm install @farmfe/plugin-dsv + + + yarn add @farmfe/plugin-dsv + + + pnpm add @farmfe/plugin-dsv + + + +## 使用 + +创建一个`farm.config.js`[配置文件](https://www.farmfe.org/docs/config/configuring-farm)并导入插件: + +```js +import { defineConfig } from '@farmfe/core'; +import dsv from '@farmfe/plugin-dsv'; + +export default defineConfig({ + plugins: [ + [ + dsv() + ] + ], +}); +``` + +## 实际示例 + +假设你有一个包含一些关于美味水果信息的CSV(或TSV)文件: + +```csv +type,count +apples,7 +pears,4 +bananas,5 +``` + +并且假设你想在代码的某个部分将该CSV文件作为`Array`导入。添加插件之后(如上所示),你可以直接`import`(或`require`)CSV文件。导入将提供一个`Array`,包含代表CSV文件行的`Objects`: + +```js +import fruit from './fruit.csv'; + +console.log(fruit); +// [ +// { type: 'apples', count: '7' }, +// { type: 'pears', count: '4' }, +// { type: 'bananas', count: '5' } +// ] +``` diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/js-dts.mdx b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/js-dts.mdx new file mode 100644 index 0000000000..00405e15ac --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/js-dts.mdx @@ -0,0 +1,108 @@ +import CodeBlock from "@theme/CodeBlock"; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# @farmfe/js-plugin-dts +支持 `.d.ts` 文件。 该插件用于构建的工具库,为您的 ts 代码生成“.d.ts” + +## Installation + + + + npm install @farmfe/js-plugin-dts + + + yarn add @farmfe/js-plugin-dts + + + pnpm add @farmfe/js-plugin-dts + + + +## Usage +```ts {2,6} +import { UserConfig } from '@farmfe/core'; +import farmJsPluginDts from '@farmfe/js-plugin-dts'; + +const config: UserConfig = { + plugins: [ + farmJsPluginDts({ /* options */ }) + ] +} +``` + +## Options +```ts +import type { ts, Diagnostic } from 'ts-morph'; + +export interface DtsPluginOptions { + /** + * Depends on the root directory + */ + root?: string; + + /** + * Declaration files output directory + */ + outputDir?: string | string[]; + + /** + * set the root path of the entry files + */ + entryRoot?: string; + + /** + * Project init compilerOptions using by ts-morph + */ + compilerOptions?: ts.CompilerOptions | null; + + /** + * Project init tsconfig.json file path by ts-morph + */ + tsConfigPath?: string; + + /** + * set include glob + */ + include?: string | string[]; + + /** + * set exclude glob + */ + exclude?: string | string[]; + + /** + * Whether copy .d.ts source files into outputDir + * + * @default false + */ + copyDtsFiles?: boolean; + + /** + * Whether emit nothing when has any diagnostic + * + * @default false + */ + noEmitOnError?: boolean; + + /** + * Whether skip typescript diagnostics + * + * @default true + */ + skipDiagnostics?: boolean; + + /** + * Customize typescript lib folder path + * + * @default undefined + */ + libFolderPath?: string; + + /** + * According to the length to judge whether there is any type error + */ + afterDiagnostic?: (diagnostics: Diagnostic[]) => void | Promise; +} + +``` diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/js-less.mdx b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/js-less.mdx new file mode 100644 index 0000000000..20e3904c4c --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/js-less.mdx @@ -0,0 +1,157 @@ +import CodeBlock from "@theme/CodeBlock"; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# @farmfe/js-plugin-less +支持 `Less` 编译 + +## Installation + + + + npm install @farmfe/js-plugin-less less + + + yarn add @farmfe/js-plugin-less less + + + pnpm add @farmfe/js-plugin-less less + + + +## Usage +```ts {2,6} +import { UserConfig } from '@farmfe/core'; +import farmJsPluginLess from '@farmfe/js-plugin-less'; + +const config: UserConfig = { + plugins: [ + farmJsPluginLess({ /* options */ }) + ] +} +``` + +## Options +```ts +export type LessPluginOptions = { + lessOptions?: Less.Options; + implementation?: string; + filters?: { + resolvedPaths?: string[]; + moduleTypes?: string[]; + }; + additionalData?: + | string + | ((context?: string, resolvePath?: string) => string | Promise); +}; +``` + +### lessOptions +请参阅[Less 选项](https://lesscss.org/usage/#less-options)。 + +Example: +```ts +import path from 'node:path'; +import { UserConfig } from '@farmfe/core'; +import farmJsPluginLess from '@farmfe/js-plugin-less'; + +const config: UserConfig = { + plugins: [ + farmJsPluginLess({ + lessOptions: { + paths: [path.resolve(process.cwd(), 'styles')] + } + }) + ] +} + +export default config; +``` + +### filters +哪些文件应该由 `less` 处理。 默认为“ `{resolvedPaths: ['\\.less$'] }`”用于加载,“`{ moduleTypes: ['less'] }`”用于转换。 + +* `resolvedPaths`: 仅处理这些路径下的文件。 支持正则表达式。 +* `moduleTypes`:仅处理具有这些模块类型的文件。 + +`resolvedPaths` 和 `moduleTypes` 取并集。 + +Example: +```ts +import { UserConfig } from '@farmfe/core'; +import farmJsPluginLess from '@farmfe/js-plugin-less'; + +const config: UserConfig = { + plugins: [ + farmJsPluginLess({ + filters: { + // all files end with .custom-css will be processed + resolvedPaths: ['\\.custom-less$'], + moduleTypes: ['less'] + } + }) + ] +} + +export default config; +``` + +### implementation +`less` 的 `implementation` 包名称。 默认为 `less`。 + +### additionalData +```ts +type AdditionalDataOption = string | ((content?: string, resolvePath?: string) => string | Promise); +``` +要添加到每个 less 文件的附加数据。示例: +```ts +import { UserConfig } from '@farmfe/core'; +import farmJsPluginLess from '@farmfe/js-plugin-less'; + +const config: UserConfig = { + plugins: [ + farmJsPluginLess({ + // add variables.less to every less file + additionalData: ` + @import "./src/styles/variables.less"; + ` + }) + ] +} +``` +Less 文件: +```less title="index.less" +.foo { + color: @primary-color; +} +``` +`additionalData` 将会被添加到这个文件的头部: + +```less title="index.less" +@import "./src/styles/variables.less"; + +.foo { + color: @primary-color; +} +``` + +函数形式用法: +```ts +import { UserConfig } from '@farmfe/core'; +import farmJsPluginLess from '@farmfe/js-plugin-less'; + +const config: UserConfig = { + plugins: [ + farmJsPluginLess({ + // add variables.less to every less file + additionalData: (content, resolvePath) => { + if (resolvePath === '/path/to/index.less') { + return ` + @import "./src/styles/variables.less"; + `; + } + } + }) + ] +} +``` diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/js-postcss.mdx b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/js-postcss.mdx new file mode 100644 index 0000000000..499d8c7f38 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/js-postcss.mdx @@ -0,0 +1,107 @@ +import CodeBlock from "@theme/CodeBlock"; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# @farmfe/js-plugin-postcss +支持 `postcss` 的前置编译工作 + +## Installation + + + + npm install @farmfe/js-plugin-postcss postcss + + + yarn add @farmfe/js-plugin-postcss postcss + + + pnpm add @farmfe/js-plugin-postcss postcss + + + +## Usage +```ts {2,6} +import { UserConfig } from '@farmfe/core'; +import farmJsPluginPostcss from '@farmfe/js-plugin-postcss'; + +const config: UserConfig = { + plugins: [ + farmJsPluginPostcss({ /* options */ }) + ] +} +``` + +## Options +```ts +export type PostcssPluginOptions = { + /** + * @default undefined + * postcss-load-config options. path default to farm.config.js root. + */ + postcssLoadConfig?: { + ctx?: postcssLoadConfig.ConfigContext; + path?: string; + options?: Parameters[2]; + }; + filters?: { + resolvedPaths?: string[]; + moduleTypes?: string[]; + }; + implementation?: string; +}; + +``` + +### postcssLoadConfig +Farm 使用 `postcss-load-config` 来加载 `postcss` 配置,因此您可以使用 `postcss-load-config` 的选项。 参考[postcss-load-config](https://github.com/postcss/postcss-load-config)。 + +示例: +```ts +import path from 'node:path'; +import { UserConfig } from '@farmfe/core'; +import farmJsPluginPostcss from '@farmfe/js-plugin-postcss'; + +const config: UserConfig = { + plugins: [ + farmJsPluginPostcss({ + postcssLoadConfig: { + // load config from client/postcss.config.js + path: path.join(process.cwd(), 'client') + } + }) + ] +} + +export default config; +``` + +### filters +哪些文件应该由`postcss`处理。 默认为 `{ moduleTypes: ['css'] }`。 + +* `resolvedPaths`: 仅处理这些路径下的文件。 支持正则表达式。 +* `moduleTypes`:仅处理具有这些模块类型的文件。 请注意,less/sass 文件应首先由 `@farmfe/js-plugin-less`/`@farmfe/plugin-sass` 处理。 + +`resolvedPaths` 和 `moduleTypes` 取并集。 + +例子: +```ts +import { UserConfig } from '@farmfe/core'; +import farmJsPluginPostcss from '@farmfe/js-plugin-postcss'; + +const config: UserConfig = { + plugins: [ + farmJsPluginPostcss({ + filters: { + // all files end with .custom-css will be processed + resolvedPaths: ['\\.custom-css$'], + moduleTypes: ['css'] + } + }) + ] +} + +export default config; +``` + +### implementation +`postcss` 的 `implementation` 包名称。 默认为 `postcss`。 \ No newline at end of file diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/js-sass.mdx b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/js-sass.mdx new file mode 100644 index 0000000000..4345019407 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/js-sass.mdx @@ -0,0 +1,186 @@ +import CodeBlock from "@theme/CodeBlock"; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# @farmfe/js-plugin-sass +支持 `sass` 编译 + +## Installation + + + + npm install @farmfe/js-plugin-sass sass + + + yarn add @farmfe/js-plugin-sass sass + + + pnpm add @farmfe/js-plugin-sass sass + + + +## Usage +```ts {2,6} +import { UserConfig } from '@farmfe/core'; +import farmJsPluginSass from '@farmfe/js-plugin-sass'; + +const config: UserConfig = { + plugins: [ + farmJsPluginSass({ /* options */ }) + ] +} +``` + +## Options +```ts +export type SassPluginOptions = { + sassOptions?: StringOptions<'async'>; + filters?: { + resolvedPaths?: string[]; + moduleTypes?: string[]; + }; + + /** + * - relative or absolute path + * - globals file will be added to the top of the sass file + * - when file changed, the file can't be hot-reloaded + * + * relative to project root or cwd + */ + implementation?: string | undefined; + globals?: string[]; + additionalData?: + | string + | ((content?: string, resolvePath?: string) => string | Promise); +}; +``` + +### sassOptions +请参阅 [sass 选项](https://sass-lang.com/documentation/js-api/interfaces/options/)。 + +Example: +```ts +import path from 'node:path'; +import { UserConfig } from '@farmfe/core'; +import farmJsPluginSass from '@farmfe/js-plugin-sass'; + +const config: UserConfig = { + plugins: [ + farmJsPluginSass({ + sassOptions: { + loadPaths: [path.resolve(process.cwd(), 'styles')] + } + }) + ] +} + +export default config; +``` + +### filters +哪些文件应该由 `sass` 处理。 对于 load 钩子默认为 `{resolvedPaths: ['\\.(s[ac]ss)$'] }`, 对于 transform 钩子默认为 `{ moduleTypes: ['sass'] }`。 + +* `resolvedPaths`: 仅处理这些路径下的文件。 支持正则表达式。 +* `moduleTypes`:仅处理具有这些模块类型的文件。 + +`resolvedPaths` 和 `moduleTypes` 取并集。 + +示例: +```ts +import { UserConfig } from '@farmfe/core'; +import farmJsPluginSass from '@farmfe/js-plugin-sass'; + +const config: UserConfig = { + plugins: [ + farmJsPluginSass({ + filters: { + // all files end with .custom-css will be processed + resolvedPaths: ['\\.custom-sass$'], + moduleTypes: ['sass'] + } + }) + ] +} + +export default config; +``` + +### implementation +`sass` 的 `implementation` 包名称。 默认为 `sass`。 如果你想使用`sass-embedded`,可以将其设置为`sass-embedded`。 + +```ts +import { UserConfig } from '@farmfe/core'; +import farmJsPluginSass from '@farmfe/js-plugin-sass'; + +const config: UserConfig = { + plugins: [ + farmJsPluginSass({ + implementation: 'sass-embedded' + }) + ] +} +``` +:::note +您应该手动安装 `sass-embedded`。 +::: + +### additionalData +```ts +type AdditionalDataOption = string | ((content?: string, resolvePath?: string) => string | Promise); +``` +要添加到每个 sass 文件的附加数据。 例子: + +```ts +import { UserConfig } from '@farmfe/core'; +import farmJsPluginSass from '@farmfe/js-plugin-sass'; + +const config: UserConfig = { + plugins: [ + farmJsPluginSass({ + // add variables.sass to every sass file + additionalData: ` + @import "./src/styles/variables.scss"; + ` + }) + ] +} +``` +Sass 文件 +```sass title="index.scss" +.foo { + color: @primary-color; +} +``` +`additionalData` 将会被添加到这个文件的头部: +```sass title="index.scss" +@import "./src/styles/variables.scss"; + +.foo { + color: @primary-color; +} +``` + +函数形式用法: +```ts +import { UserConfig } from '@farmfe/core'; +import farmJsPluginSass from '@farmfe/js-plugin-sass'; + +const config: UserConfig = { + plugins: [ + farmJsPluginSass({ + // add variables.sass to every sass file + additionalData: (content, resolvePath) => { + if (resolvePath === '/path/to/index.sass') { + return ` + @import "./src/styles/variables.sass"; + `; + } + } + }) + ] +} +``` + +### globals +全局 sass 文件。 这些文件将添加到每个 sass 文件的顶部。 它与 `additionalData` 相同,但更方便。 + diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/js-svgr.mdx b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/js-svgr.mdx new file mode 100644 index 0000000000..54891343fb --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/js-svgr.mdx @@ -0,0 +1,88 @@ +import CodeBlock from "@theme/CodeBlock"; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# @farmfe/js-plugin-svgr +支持将 `SVG` 编译成 `React` 组建 + +## Installation + + + + npm install @farmfe/js-plugin-svgr + + + yarn add @farmfe/js-plugin-svgr + + + pnpm add @farmfe/js-plugin-svgr + + + +## Usage +```ts {2,6} +import { UserConfig } from '@farmfe/core'; +import farmJsPluginSvgr from '@farmfe/js-plugin-svgr'; + +const config: UserConfig = { + plugins: [ + farmJsPluginSvgr({ /* options */ }) + ] +} +``` + +## Options +```ts +export interface FarmSvgrPluginOptions { + svgrOptions?: SvgrOptions; + filters?: { + resolvedPaths?: string[]; + }; +} +``` + +### svgrOptions +请参阅 [svgr 选项](https://react-svgr.com/docs/options/)。 + +示例: +```ts +import path from 'node:path'; +import { UserConfig } from '@farmfe/core'; +import farmJsPluginSvgr from '@farmfe/js-plugin-svgr'; + +const config: UserConfig = { + plugins: [ + farmJsPluginSvgr({ + svgrOptions: { + loadPaths: [path.resolve(process.cwd(), 'styles')] + } + }) + ] +} + +export default config; +``` + +### filters +哪些文件应该由 `svgr` 处理。 默认为 `{resolvedPaths: ['\\.svg$'] }`。 + +* `resolvedPaths`: 仅处理这些路径下的文件。 支持正则表达式。 + +示例: +```ts +import { UserConfig } from '@farmfe/core'; +import farmJsPluginSvgr from '@farmfe/js-plugin-svgr'; + +const config: UserConfig = { + plugins: [ + farmJsPluginSvgr({ + filters: { + // all files end with .custom-svg will be processed + resolvedPaths: ['\\.custom-svg$'], + } + }) + ] +} + +export default config; +``` \ No newline at end of file diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/overview.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/overview.md new file mode 100644 index 0000000000..a730f6590a --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/overview.md @@ -0,0 +1,31 @@ +# 插件概览 + +Farm官方提供了很多有用的插件,包括Rust插件和JS插件。 Rust 插件比 Js 插件快得多,我们建议尽可能使用 Rust 插件。 + +:::tip +关于如何在 Farm 中使用插件,请参阅[使用插件](/docs/using-plugins)。 +::: + +## Rust 插件 + +* **[`@farmfe/plugin-react`](./react)**:支持 React `jsx` 和 `react-refresh`。 +* **[`@farmfe/plugin-sass`](./sass)**:支持编译`sass/scss`文件。 +* **[`@farmfe/plugin-strip`](./strip)**:一个Farm的Rust插件,用于从你的代码中移除`debugger`语句和类似`assert.equal`、`console.log`这样的函数。 +* **[`@farmfe/plugin-dsv`](./dsv)**:一个Farm插件,用于将`.csv`和`.tsv`文件转换为JavaScript模块。 +* **[`@farmfe/plugin-yaml`](./yaml)**:一个Farm插件,用于将YAML文件转换为ES6模块。 +* **[`@farmfe/plugin-virtual`](./virtual)**:一个方便在farm中使用虚拟模块的rust插件。 +* **[`@farmfe/plugin-react-components`](./react-components)**:用于React的按需组件自动导入。 + +## Js 插件 + +* **[`@farmfe/js-plugin-postcss`](./js-postcss)**:支持 React `jsx` 和 `react-refresh`。 +* **[`@farmfe/js-plugin-less`](./js-less)**:支持编译 `sass/scss` 文件。 +* **[`@farmfe/js-plugin-svgr`](./js-svgr)**:支持编译`sass/scss`文件。 +* **[`@farmfe/js-plugin-dts`](./js-dts)**:支持编译`sass/scss`文件。 +* **[`@farmfe/js-plugin-sass`](./js-sass)**:支持编译`sass/scss`文件。 + +## 社区插件 + +如果官方插件不能满足您的需求,您可以尝试[社区插件](../community-plugins)。 + +当然也可以前往查看 [awesome-farm](https://github.com/farm-fe/awesome-farm) - 您也可以提交 PR,在那里列出您的插件。 diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/react-components.mdx b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/react-components.mdx new file mode 100644 index 0000000000..1177404186 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/react-components.mdx @@ -0,0 +1,157 @@ +import CodeBlock from "@theme/CodeBlock"; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# @farmfe/plugin-react-components + +按需自动导入React组件。 + +## 安装 + + + + npm install @farmfe/plugin-react-components + + + yarn add @farmfe/plugin-react-components + + + pnpm add @farmfe/plugin-react-components + + + +## 使用 +`@farmfe/plugin-react-components` 是一个Rust插件,你只需要在 `farm.config.ts` 的 `plugins` 字段中配置其包名即可。 +```ts {4} +import { UserConfig } from '@farmfe/core'; + +const config: UserConfig = { + plugins: ['@farmfe/plugin-react-components', { /** 选项在此 */}] +} +``` + +## 功能 + +- 💚 支持React开箱即用。 +- ✨ 支持组件和指令。 +- 🏝 树摇(Tree-shaking),只注册你使用的组件。 +- 🪐 文件夹名称作为命名空间。 +- 🦾 完整的TypeScript支持。 +- 🌈 为流行的UI库提供[内置解析器](#从UI库中导入)。 + +## 使用 + +像往常一样在模板中使用组件,它将按需导入组件,不再需要`import`和`component registration`!如果你异步注册父组件(或懒加载路由),自动导入的组件会与其父组件一起进行代码拆分。 + +它会自动将这个 + +```tsx +export function Main() { + return +} +``` + +转换成这个 + +```tsx +import HelloWorld from './src/components/HelloWorld' + +export function Main() { + return +} +``` + +> **注意** +> 默认情况下,此插件会导入`src/components`路径中的组件。你可以使用`dirs`选项进行自定义。 + +## TypeScript + +为自动导入的组件获得TypeScript支持。 + +```ts +Components({ + dts: true, // 如果安装了`typescript`默认启用 +}) +``` + +完成设置后,将自动生成一个`components.d.ts`文件,并自动更新类型定义。你可以选择是否将其提交到git。 + +> **确保你也将`components.d.ts`添加到`tsconfig.json`的`include`中。** + +## 从UI库中导入 + +我们为几个流行的UI库(如**Ant Design**、**Arco Design**和**Material UI**)提供了几个内置解析器,你可以通过以下方式启用它们: + +支持的解析器: + +- [Ant Design](https://ant.design/) +- [Arco Design](https://arco.design/react/docs/start) +- [Material UI](https://mui.com/) + +```ts +// farm.config.js + +import { UserConfig } from '@farmfe/core'; + +const config: UserConfig = { + plugins: ['@farmfe/plugin-react-components', { + local: true, + resolvers:[ + { + module: "antd", + prefix: "Ant" + }, + { + module:"@arco-design/web-react", + prefix: "Arco", + import_style: true // style/index.js + } + ] + }] +} +``` + +## 配置 + +以下显示了配置的默认值 +component +```ts +{ + // 相对路径到搜索组件的目录。 + dirs: ['src/components'], + + // 自定义组件的解析器。 + resolvers: [], + + /** + * 组件以绝对或相对路径引入。 + * + * @default 绝对 + */ + import_mode: "Absolute" + + /** + * 是否对本地组件有效 + * + * @default true + */ + local: true, + + /** + * 导入样式`style/index.js`,也接受路径用于自定义路径(/**)与组件 + * + * @default false + */ + importStyle?: boolean | string + + // 生成全局声明的`components.d.ts`, + // 也接受自定义文件名的路径 + // 默认:如果安装了typescript包则为`true` + dts: true, + + // 转换目标(要插入自动导入的组件)的过滤器 + // 注意,这不是关于包含/排除注册组件 - 使用`Regex`来做那个 + include: ["src/components"], + exclude: ["node_modules"], +} +``` diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/react.mdx b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/react.mdx new file mode 100644 index 0000000000..30f1751511 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/react.mdx @@ -0,0 +1,21 @@ +import { PackageManagerTabs } from "../../../../../../src/theme/PackageManagerTabs"; + +# @farmfe/plugin-react +支持 `React Jsx` 和 `React Refresh` + +## Installation + + + +## Usage +`@farmfe/plugin-react` 是一个 Rust 插件,你只需要在 `farm.config.ts` 的 `plugins` 字段中配置它的包名。 +```ts {4} +import { UserConfig } from '@farmfe/core'; + +const config: UserConfig = { + plugins: ['@farmfe/plugin-react', { /** options here */}] +} +``` + +## Options +请参阅[SWC 转换 React 选项](https://swc.rs/docs/configuration/compilation#jsctransformreact)。 diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/sass.mdx b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/sass.mdx new file mode 100644 index 0000000000..6285f5a0da --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/sass.mdx @@ -0,0 +1,37 @@ +import CodeBlock from "@theme/CodeBlock"; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# @farmfe/plugin-sass + +支持 `sass` 编译 + +## Installation + + + + npm install @farmfe/plugin-sass + + + yarn add @farmfe/plugin-sass + + + pnpm add @farmfe/plugin-sass + + + +## Usage +`@farmfe/plugin-sass` 是一个 Rust 插件,你只需要在 `farm.config.ts` 的 `plugins` 字段中配置它的包名。 +```ts {4} +import { UserConfig } from '@farmfe/core'; + +const config: UserConfig = { + plugins: ['@farmfe/plugin-sass', { /** options here */}] +} +``` + +## Options +### additionalData +* **类型**: `string` + +在每个 `sass` 文件头部添加额外内容,例如 `@import '@/styles/variables.scss';` 语句。 \ No newline at end of file diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/strip.mdx b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/strip.mdx new file mode 100644 index 0000000000..ba97a33980 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/strip.mdx @@ -0,0 +1,102 @@ +import CodeBlock from "@theme/CodeBlock"; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# @farmfe/plugin-strip + +🍣 一个Farm Rust插件,用于从你的代码中移除`debugger`语句和如`assert.equal`、`console.log`这样的函数。 + +## 要求 + +这个插件需要一个[LTS](https://github.com/nodejs/Release) Node版本(v18.0.0+)和Farm v1.0.0+。 + +## 安装 + + + + npm install @farmfe/plugin-strip + + + yarn add @farmfe/plugin-strip + + + pnpm add @farmfe/plugin-strip + + + +## 使用 + +创建一个`farm.config.js`[配置文件](https://www.farmfe.org/docs/config/configuring-farm)并导入插件: + +```js +import { defineConfig } from '@farmfe/core'; +import strip from '@farmfe/plugin-strip'; + +export default defineConfig({ + // ... + plugins: [ + [ + strip({ + // 插件选项 + functions:[ 'console.*', 'assert.*' ], + labels: ['unittest'] + }) + ] + ], + // ... +}); +``` + +## 选项 + +### `include` + +类型: `String | RegExp | Array[...String|RegExp]`
+默认值: `['**/*.js']`
+示例: `include: '**/*.(mjs|js)',`
+ +指定插件应操作的构建中的文件的模式或模式数组。 + +### `exclude` + +类型: `String | RegExp | Array[...String|RegExp]`
+默认值: `[]`
+示例: `exlude: 'tests/**/*',`
+ +指定插件应_忽略_的构建中的文件的模式或模式数组。 + +### `debugger` + +类型: `Boolean`
+默认值: `true`
+示例: `debugger: false,`
+ +如果为`true`,指示插件移除debugger语句。 + +### `functions` + +类型: `Array[...String]`
+默认值: `[ 'console.*', 'assert.*' ]`
+示例: `functions: [ 'console.log', 'MyClass.Test' ],`
+ +指定插件将目标定位和移除的函数。 + +_注意:指定在链的开头使用的函数,如'a().b().c()',将导致'(void 0).b().c()',这在运行时会产生错误。_ + +### `labels` + +类型: `Array[...String]`
+默认值: `[]`
+示例: `labels: ['unittest'],`
+ +指定插件将目标定位和移除的[带标签的块或语句](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/label)。 + +_注意:'**:**'是隐含的,不应在配置中指定。_ + +### `sourceMap` + +类型: `Boolean`
+默认值: `true`
+示例: `sourceMap: false,`
+ +如果为`true`,指示插件在从捆绑包中移除配置的目标后相应地更新源映射。 diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/virtual.mdx b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/virtual.mdx new file mode 100644 index 0000000000..95aed57bb8 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/virtual.mdx @@ -0,0 +1,59 @@ +import CodeBlock from "@theme/CodeBlock"; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# @farmfe/plugin-virtual + +受 [@rollup/plugin-virtual](https://www.npmjs.com/package/@rollup/plugin-virtual) 启发 + +一个为farm打造的rust插件,用于轻松使用虚拟模块 + +## 安装 + + + + npm install @farmfe/plugin-virtual + + + yarn add @farmfe/plugin-virtual + + + pnpm add @farmfe/plugin-virtual + + + +## 使用 + +farm.config.ts + +```typescript +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + plugins: [ + [ + '@farmfe/plugin-virtual', + { + 'virtual-module': 'export const a = 1', + 'src/01.js': 'export const module01 = "virtual-module"', + }, + ], + ], +}); +``` + +index.js + +```javascript +import { a } from 'virtual-module'; +``` + +src/02.js + +```javascript +import { module01 } from './01.js'; +``` + +这个 `@farmfe/plugin-virtual` 插件允许你定义虚拟模块,这些模块并不对应任何实际的文件系统中的文件,但可以像普通模块一样被导入和使用。这在模拟第三方库、环境变量或任何不便于直接放在文件系统中的数据时特别有用。 + +通过在 `farm.config.ts` 配置文件中的 `plugins` 数组中注册插件并配置虚拟模块,你可以在项目中的任何地方通过指定的模块名来导入这些虚拟模块。在上面的例子中,定义了一个名为 `virtual-module` 的虚拟模块,它导出了一个常量 `a`,以及另一个名为 `src/01.js` 的虚拟模块,它导出了一个名为 `module01` 的变量。这些模块随后可以在项目中的任何地方被导入和使用,就像它们是实际存在于文件系统中的一样。 diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/yaml.mdx b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/yaml.mdx new file mode 100644 index 0000000000..01a091bb66 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/official-plugins/yaml.mdx @@ -0,0 +1,50 @@ +import CodeBlock from "@theme/CodeBlock"; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# @farmfe/plugin-yaml + +受 [@rollup/plugin-yaml](https://www.npmjs.com/package/@rollup/plugin-yaml) 启发 + +🍣 一个Farm插件,用于将YAML文件转换为ES6模块。 + +## 安装 + + + + npm install @farmfe/plugin-yaml + + + yarn add @farmfe/plugin-yaml + + + pnpm add @farmfe/plugin-yaml + + + +## 使用 + +farm.config.ts + +```typescript +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + plugins: [ + [ + '@farmfe/plugin-yaml', + { + documentMode: 'single' | 'multi', // 默认 single + include: Regex, // 默认 None + exclude: Regex, // 默认 None + }, + ], + ], +}); +``` + +注意: + +`include` 或 `exclude` 使用的是正则表达式而不是glob。例如 `**/01.yaml` 是不合法的。正确的表达方式类似于 `".*\\/01.yaml"`。 + +这个插件允许你在Farm项目中直接导入YAML文件,并将它们转换成ES6模块。`documentMode` 选项允许你指定处理单个文档的YAML文件(`single`)或包含多个文档的YAML文件(`multi`)。`include` 和 `exclude` 选项让你可以更细致地控制哪些YAML文件应该被插件处理,通过指定匹配特定格式的正则表达式。这种灵活性让你能够在Farm项目中轻松地处理和利用YAML数据。 diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/writing-plugins/_category_.json b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/writing-plugins/_category_.json new file mode 100644 index 0000000000..d4be49b8bb --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/writing-plugins/_category_.json @@ -0,0 +1,7 @@ +{ + "label": "编写插件", + "link": { + "type": "generated-index", + "description": "如何编写 Farm 插件" + } +} diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/writing-plugins/js-plugin.mdx b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/writing-plugins/js-plugin.mdx new file mode 100644 index 0000000000..0e33f658de --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/writing-plugins/js-plugin.mdx @@ -0,0 +1,198 @@ +import CodeBlock from "@theme/CodeBlock"; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# 编写 JavaScript 插件 + +一个 JavaScript 插件只是一个定义了一系列 hooks 的纯 JavaScript 对象: + +```js +// farm.config.ts +import { defineConfig } from "@farmfe/core"; + +export default defineConfig({ + // ... + plugins: [ + // 一个插件对象 + { + name: "my-resolve-plugin", + priority: 1000, // 插件的优先级越高越早执行 通常的优先级是 100 + resolve: { + filters: { + // 仅仅符合下面的条件才会执行 hook + sources: ["\\./index.ts"], // 正则表达式的数组 + importers: ["None"], + }, + executor: async (param) => { + // hook 执行器 + console.log(param); // 解析 param + // 返回最终的结果 + return { + resolvedPath: "virtual:my-module", + query: {}, + sideEffects: false, + external: false, + }; + }, + }, + }, + // Load、transform和 resolve 类似, 引用他们的类型 + ], +}); +``` + +如果你想向插件传递参数,可以使用闭包 + +```ts +// my-resolve-plugin.ts +export function myResolvePlugin(options: Options) { + const { xx } = options; + + return { + name: "my-resolve-plugin", + resolve: { + // ... + }, + }; +} + +// farm.config.ts +import { defineConfig } from "@farmfe/core"; +import { myResolvePlugin } from "./myResolvePlugin.ts"; + +export default defineConfig({ + // ... + plugins: [myResolvePlugin({ xx: "xx" })], +}); +``` +:::note +* 参考 [创建插件](#create-plugin),可以根据官方模版快速写一个新的插件 +* 本文档仅介绍如何创建、开发和发布一个 JavaScript 插件,有关插件 hook 的更多细节,请参阅[Javascript 插件 Hooks](/zh/docs/api/js-plugin-api) +::: + +## 约定 + +对于特定的 Farm JavaScript 插件 + +- 一个 Farm 的 JavaScript 插件应该有一个 `farm-plugin-` 前缀的名称并且语义清晰 +- package.json 里面有 `farm-plugin-` 关键字 + + +如果你的 JavaScript 插件仅仅适配特定框架,其名称应遵循以下前缀格式: + +- `farm-plugin-vue-`: 作为 Vue 插件前缀 +- `farm-plugin-react-`: 作为 React 插件前缀 +- `farm-plugin-svelte-`: 作为 Svelte 插件前缀 +- ... + +## 概念 +在开始编写 JavaScript 插件之前,你应该了解以下概念: + +* **filters**: 由于 JavaScript 插件运行要比 Rust 插件慢得多,你的 JavaScript 插件应该显式的设置 filter 来避免不必要的 hook 调用。 举个例子,你应该设置 `transform.filters.moduleTypes = ['js']` 来确保你的 JavaScript 插件 transform 钩子仅仅在 `.js/mjs/cjs` 文件执行 +* **module_type**:模块的类型,他可能是 `js`, `ts`, `css`, `sass`, `json` 等等。Farm 原生支持 `js/ts/jsx/tsx`, `css`, `html`, `json`, `static asserts(png, svg等等)`。`module_type` 会被 `load` 或者 `transform` 钩子返回 +* **resolved_path 和 module_id**:`resolved_path` 是一个模块的绝对路径,`module_id`是一个模块的唯一 id,通常是`模块对于项目根目录的相对路径` + `query`。例如 我们引用了一个模块 `import './a?query'` resolved_path 是 `/project/src/a.ts` module_id 是 `src/a.ts?query` +* **context**: 所有的插件都会接受一个 `context` 参数,它有 Farm 项目的整个编译上下文,你可以从里面拿到 ModuleGraph,Module,Resources等等 +* **Resource and Resource Pot**:`Resource` 是输出出来的最终打包产物,` Resource Pot`是资源的抽象表示,类似于其他打包器的 `Chunk`。在 Farm 项目中,我们首先从 `ModuleGraph` 生成 `Resource Pots`, 渲染 `Resource Pots`,最终从 `Resource Pots` 生成 `Resource` + + +### Filters + +由于 `JavaScript插件` 比 `Rust插件` 慢得多,Farm 使用 `filters` 来控制 JavaScript 插件钩子的执行。为了提高性能,只有匹配当前的 `filters` ,插件钩子才会执行。`filters` 对于一些常用的钩子是必需的,例如`resolve`, `load`, `transform`等。 +例如,如果你想转换 css 文件,你可以使用`transform.filters. moduletypes = ['css']`来确保 JavaScript 插件的 transform 钩子只对`.css`文件运行: + +```ts +const myCssPlugin = { + name: "my-css-plugin", + transform: { + filters: { + // Only execute the hook when following conditions satisfied + // resolvedPaths: ["\\./index.ts"], // a regex array to match the resolvedPaths + moduleTypes: ["css"], + }, + executor: async (param) => { + // transform css + }, + }, +}; +``` + +### Module Type +在 Farm 中,一切都被认为是“一等公民”,因此 Farm 设计 `module_type` 来标识模块类型,并在用不同的插件处理不同的模块类型 +`Module_type `由 `load` 钩子返回,并且可以由 `transform` 钩子转换。Farm 原生支持 `js/ts/jsx/tsx`、`css`、`html`、`json`、`static assets(png、svg等)`。对于这些模块类型,你可以直接在 `load` 或 `transform` hook 中返回。但是如果你想处理自定义模块类型,你需要实现其他钩子例如 `parse`, `render_resource_pot_modules`, `generate resources` 等来控制如何对自定义模块进行类型解析,渲染和生成资源。 + +## 创建插件 + +Farm 提供了官方模板来帮助你快速创建 JavaScript 插件: + + + pnpm create farm-plugin + + + npm create farm-plugin@latest + + + yarn create farm-plugin + + + + +然后按照提示创建插件 + +或者直接运行以下命令创建插件: + + + pnpm create farm-plugin my-farm-plugin --type js + + + npm create my-farm-plugin --type js + + + yarn create my-farm-plugin --type js + + + +上面的命令会在当前目录中创建一个名为 `my-farm-plugin` 的js插件。`——type` 可以是 `rust` 或者 `js` + +## 开发一个插件 + +创建插件后,就可以开始开发插件了。这个插件只是一个定义了一系列 hooks 的纯 JavaScript 对象: + +```ts +// import { readFileSync } from 'node:fs'; +import type { JsPlugin } from '@farmfe/core'; + +interface Options { + /* Your options here */ +} + +export default function farmPlugin(options: Options): JsPlugin { + return { + name: '', + /* Your plugin hooks here: */ + + // transform: { + // filters: { + // moduleTypes: ['js'] + // }, + // async executor(params) { + // const { content } = params; + // return { + // content, + // moduleType: 'js' + // }; + // } + // }, + // finish: { + // executor() {} + // } + }; +} +``` +:::tip +有关插件钩子的更多细节, 参阅[Javascript 插件 Hooks](/zh/docs/api/js-plugin-api). +::: + +运行 `npm Run dev` 来编译插件开启监听。运行 `npm Run build` 来构建插件 + +## 发布插件 +JavaScript 插件是一个普通的 npm 包,你可以通过运行 `npm publish` 将其发布到 npm registry。 \ No newline at end of file diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/writing-plugins/overview.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/writing-plugins/overview.md new file mode 100644 index 0000000000..f412f4988c --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/writing-plugins/overview.md @@ -0,0 +1,27 @@ + +# 概览 + +Farm 采用完全插件化的形式,提供了多种类型的插件来干预 Farm 的几乎所有行为,Farm 支持的主要插件类型分为以下几类: +* **编译插件**:干预、增强 Farm 的编译能力,支持使用 Rust(推荐)以及 Js 编写插件 +* **运行时插件**:干预、增强 Farm 的运行时能力,使用 Js 编写 +* **Dev Server 插件**:干预、增强 Farm 的 Dev Server,例如挂载更多变量,注册 middleware 等 + +To use a Rust plugin, configuring `plugins` in `farm.config.ts`. + +```ts +import { defineFarmConfig } from '@farmfe/core/dist/config'; + +defineFarmConfig({ + // ... + plugins: [ + { /*..*/ }, // Js plugin, a object with hook defined + '@farmfe/plugin-react', // rust plugin package name + ] +}) + +``` + +Farm support both rust plugins and js plugins: + +* [Rust Plugin](/docs/plugins/rust-plugin) +* [Js plugin](/docs/plugins/js-plugin) diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/writing-plugins/runtime-plugin.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/writing-plugins/runtime-plugin.md new file mode 100644 index 0000000000..678915017e --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/writing-plugins/runtime-plugin.md @@ -0,0 +1,166 @@ +# 编写 Runtime 插件 +Farm 运行时插件是一个纯 JavaScript 对象,它定义了一组钩子来增强 Farm 运行时。 例子: + +```ts +/** + * HMR 客户端作为 Farm 运行时插件 + */ +import type { Plugin } from '@farmfe/runtime'; +import { createHotContext } from './hot-module-state'; +import { HmrClient } from './hmr-client'; + +let hmrClient: HmrClient; +// 导出 Farm 运行时插件对象 +export default { + name: 'farm-runtime-hmr-client-plugin', + // 定义钩子 + bootstrap(moduleSystem) { + hmrClient = new HmrClient(moduleSystem); + hmrClient.connect(); + }, + moduleCreated(module) { + // 为每个模块创建一个 hot 上下文 + module.meta.hot = createHotContext(module.id, hmrClient); + } +}; +``` + +上面是一个支持 Farm 的 HMR 的运行时插件。 要点: +* 运行时插件入口文件应该 **`导出`** 定义一组钩子的默认对象。 例如 `导出默认 {/*...*/}` +* 需要`name`来标识插件,确保`name`是唯一的 +* `hook` 是在导出对象中定义的方法。 + +:::note +有关上述示例的完整实现,请参阅 [@farmfe/runtime-plugin-hmr](https://github.com/farm-fe/farm/tree/main/packages/runtime-plugin-hmr)。 +::: + +## 注意事项 +您应该使您的运行时插件尽可能**简单**。 你**不应该**: +* 使用node_modules中的**大依赖**,这会让你的 Farm 运行时插件非常大,可能会严重影响运行时性能。 +* 使用 `top level await` 等新功能,因为这些与运行时相关的功能很难针对低级别运行时进行 polyfill。 + +强烈建议确保您的运行时插件**尽可能小且简单**。 + +:::tip +`import.meta.xxx` 将被编译为 `module.meta.xxx`,您可以在运行时插件中向 `module.meta` 添加值来增强 `import.meta`。 例如, `module.meta.hot = createHotContext(module.id, hmrClient)` 使 `import.meta.hot` 可用。 +::: + +## 惯例 +Farm 运行时插件名称应以 `farm-runtime-plugin` 为前缀,例如 `farm-runtime-plugin-xxx` 。 + +:::note +`plugin.name` 和 `package name`(仅当您将插件发布为包时)都应该加上前缀。 +::: + + +## 使用 Runtime 插件 +使用 `compilation.runtime.plugins` 为您的项目配置运行时插件: + +```ts +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + compilation: { + runtime: { + plugins: [ + // relative path + './src/my-plugin1.ts', + // absolute path + '/root/project/src/my-plugin2.ts', + // package name + '@scope/plugin-package-from-node-modules' + ] + } + } +}); +``` + +您可以通过 3 种方式配置运行时插件项: +* **`相对路径`**:相对于`root`的路径,例如`./src/my-plugin1.ts`将尝试从`/src/my-plugin1.ts`加载插件。 +* **`绝对路径`**:例如`/root/project/src/my-plugin2.ts`。 (在 Windows 上绝对路径应为 `C:\project\src\my-plugin2.ts` )。 +* **`包名称`**:Farm将尝试从`node_modules`加载此包,例如`@scope/plugin-package-from-node-modules`。 + +## 编写 Runtime 插件 +:::tip +Farm支持直接加载`.ts`文件,因此您可以直接在`runtime.plugins`中配置一个`.ts`文件(或条目为`ts`文件的包)。 + +```ts +export default defineConfig({ + compilation: { + runtime: { + plugins: [ + // configuring ts file directly + './src/my-plugin.ts', + ] + } + } +}); +``` +::: + +### 创建插件 +正如我们上面提到的,Farm 运行时插件是一个纯 JavaScript 对象,它定义了一组钩子,您只需创建一个 ts 文件,例如: + +```ts title="./plugins/runtime.ts" +import type { Plugin } from '@farmfe/runtime'; + +export default { + name: 'my-plugin', + // ... +} +``` + +然后在导出的对象中定义您需要的[hooks](#runtime-plugin-hooks): + +```ts title="./plugins/runtime.ts" +import type { Plugin } from '@farmfe/runtime'; + +export default { + name: 'my-plugin', + moduleCreated(module) { + // ... + }, + readModuleCache(module) { + // ... + }, + loadResource(resource, targetEnv) { + // ... + }, + // ... more hooks as long as you need +} +``` + +### 定义插件 +配置您在 `runtime.plugins` 中创建的插件: + +```ts +export default defineConfig({ + compilation: { + runtime: { + plugins: [ + './plugins/runtime.ts', + ] + } + } +}); +``` +然后启动Farm项目,这个插件会在编译时注入输出资源的 runtime 中。 + +### 发布插件(可选) +您可以将运行时插件发布到 npm 注册表以共享您的 Farm 运行时插件。 只需创建一个 `package.json` ,例如: + +```json +{ + "name": "@farmfe/runtime-plugin-hmr", + "version": "3.4.2", + "description": "Runtime hmr plugin of Farm", + // c-highlight-start + "main": "src/index.ts", + // c-highlight-end + // ... ignore other fields +} +``` +You can just export `ts` file using `"main": "src/index.ts"`. + +## 运行时插件钩子 +请参阅[运行时插件 API](/docs/api/runtime-plugin-api) \ No newline at end of file diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/writing-plugins/rust-plugin.mdx b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/writing-plugins/rust-plugin.mdx new file mode 100644 index 0000000000..6e7c4830ff --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/plugins/writing-plugins/rust-plugin.mdx @@ -0,0 +1,545 @@ +import CodeBlock from "@theme/CodeBlock"; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + +# 编写 Rust 插件 + +用 Rust 写你的插件是一个推荐的方式,因为 Rust 插件比 JavaScript 插件**更快和富有表现力**。一个 Rust 插件应该是实现了 `farmfe_core::plugin::Plugin` trait 的 `struct`, 例如 + +```rust +#![deny(clippy::all)] + +use farmfe_core::{config::Config, plugin::Plugin}; + +use farmfe_macro_plugin::farm_plugin; + +// define your rust plugins +#[farm_plugin] +pub struct FarmPluginExample {} + +impl FarmPluginExample { + // 一个 Rust 插件必须导出一个名称是 new 的函数 并且初始化的时候接受两个参数 + fn new(config: &Config, options: String) -> Self { + Self {} + } +} +// 实现插件的 trait 来定义插件 hooks +impl Plugin for FarmPluginExample { + fn name(&self) -> &str { + "FarmPluginExample" + } + + // more hooks here +} +``` + +Rust 插件注意事项: +- `struct` 必须是 `pub` 并且需要有 `#[farm_plugin]` 属性 +- `struct` 必须实现 `Plugin` trait, 并且 `name` 方法必须要实现 +- `struct` 必须导出一个 `new` 的方法,在初始化的时候接受两个参数 第一个参数是 `&Config`, 第二个参数是 `String`。`new` 方法在插件加载的时候调用。 `Config` 是 farm 项目的配置 `String` 是插件的选项 + +我们同时提供了 Rust 插件示例代码仓库:[farm-rust-plugin-example](https://github.com/farm-fe/rust-plugin-example) + + +:::note +本文章仅仅涵盖如何创建,开发和发布一个 Rust 插件,更多的细节参考 [插件 Hooks](/zh//docs/api/rust-plugin-api) +::: + +## 约定 + +对于特定的 Farm 插件 + +- 一个 Farm 的 Rust 插件应该有一个 `farm-plugin-` 前缀的名称并且语义清晰 +- package.json 里面有 `farm-plugin-` 关键字 + + +如果你的插件仅仅适配特定框架,其名称应遵循以下前缀格式: + +- `farm-plugin-vue-`: 作为 Vue 插件前缀 +- `farm-plugin-react-`: 作为 React 插件前缀 +- `farm-plugin-svelte-`: 作为 Svelte 插件前缀 +- ... + + +## 概念 + +在开始编写 Rust 插件之前,你应该了解以下概念: + +* **module_type**:模块的类型,他可能是 `js`, `ts`, `css`, `sass`, `json` 等等。Farm 原生支持 `js/ts/jsx/tsx`, `css`, `html`, `json`, `static asserts(png, svg等等)`。`module_type` 会被 `load` 或者 `transform` 钩子返回 +* **resolved_path 和 module_id**:`resolved_path` 是一个模块的绝对路径,`module_id`是一个模块的唯一 id,通常是`模块对于项目根目录的相对路径` + `query`。例如 我们引用了一个模块 `import './a?query'` resolved_path 是 `/project/src/a.ts` module_id 是 `src/a.ts?query` +* **context**: 所有的插件都会接受一个 `context` 参数,它有 Farm 项目的整个编译上下文,你可以从里面拿到 ModuleGraph,Module,Resources等等 +* **Resource and Resource Pot**:`Resource` 是输出出来的最终打包产物,` Resource Pot`是资源的抽象表示,类似于其他打包器的 `Chunk`。在 Farm 项目中,我们首先从 `ModuleGraph` 生成 `Resource Pots`, 渲染 `Resource Pots`,最终从 `Resource Pots` 生成 `Resource + +### 模块类型 + +在 Farm 中,一切都被认为是“一等公民”,因此 Farm 设计 `module_type` 来标识模块类型,并在用不同的插件处理不同的模块类型 +`Module_type `由 `load` 钩子返回,并且可以由 `transform` 钩子转换。Farm 原生支持 `js/ts/jsx/tsx`、`css`、`html`、`json`、`static assets(png、svg等)`。对于这些模块类型,你可以直接在 `load` 或 `transform` hook 中返回。但是如果你想处理自定义模块类型,你需要实现其他钩子例如 `parse`, `render_resource_pot_modules`, `generate resources` 等来控制如何对自定义模块进行类型解析,渲染和生成资源。 + +## 创建插件 +Farm 提供了官方模板来帮助你快速创建 Rust 插件: + +<> + + + pnpm create farm-plugin + + + npm create farm-plugin@latest + + + + yarn create farm-plugin + + + + +然后按照提示创建插件 + +或者直接运行以下命令创建插件: + + + + pnpm create farm-plugin my-farm-plugin --type rust + + + npm create my-farm-plugin --type rust + + + + yarn create my-farm-plugin --type rust + + + +上面的命令会在当前目录中创建一个名为 `my-farm-plugin` 的js插件。`——type` 可以是 `rust` 或者 `js` + +## 插件项目结构 + +一个插件项目结构如下: + +```plaintext +my-farm-plugin +├── .github +│ └── workflows +| ├── release.yml +| ├── build.yml +│ └── ci.yml +├── Cargo.toml +|── .gitignore +├── npm +│ ├── darwin-x64 +│ ├── linux-x64-gnu +| ├── win32-x64-msvc +│ └── ... +├── package.json +├── src +│ └── lib.rs +└── rust-toolchain.toml +``` + +值得注意的文件和目录: + +- `src/lib.rs`: 插件的主要文件,你在这里定义你的插件 +- `Cargo.toml`: Rust 项目的清单 +- `package.json`: npm 项目清单 +- `npm`: 平台特定的二进制包所在的位置。在发布插件之前,这些包应该发布到 npm registry +- `.github/workflows`: 用于在 github actions 中交叉构建和发布插件 +- `rust-toolchain.toml`: rust 工具链文件,它不应该 **被手动修改**,它应该始终使用 **与 farm core相同的版本**。 + +Farm 提供了一个工具 (`@farmfe/plugin-tools`) 来帮助你构建和发布插件,参考 `package.json`: + +```json +{ + // ... + "scripts": { + // build your plugin for current platform + "build": "farm-plugin-tools build --platform --cargo-name my_farm_plugin -p my_farm_plugin --release", + // publish all platform packages under npm directory to npm registry + "prepublishOnly": "farm-plugin-tools prepublish" + }, + // ... +} +``` + +更多关于构建和发布的细节参考 [构建](#cross-build) 和 [发布](#publish)章节: + + +## 开发插件 + +为了在本地开发和测试你的插件 你首先依据你平台构建插件,运行: + +```bash +pnpm build +``` + +然后你可以使用你构建好的插件,在 `frame.config.ts` 的 `plugins`添加你的插件: + +```javascript +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + plugins: [ + 'my-farm-plugin' + ] +}); +``` + +在你的 farm 项目中运行 `pnpm i` 并且运行 `farm start` 来运行你的带有你插件的 farm 项目 +当对插件进行更改时,应该重新构建插件并重启 farm 项目以查看更改。例如,在你的插件中添加 `load` 钩子: + +```rust {8-18} title="src/lib.rs" +// ... ignore other code + +impl Plugin for FarmPluginExample { + fn name(&self) -> &str { + "FarmPluginExample" + } + + fn load( + &self, + param: &farmfe_core::plugin::PluginLoadHookParam, + _context: &std::sync::Arc, + _hook_context: &farmfe_core::plugin::PluginHookContext, + ) -> farmfe_core::error::Result> { + println!( + "load path: {:?}, id: {:?}", + param.resolved_path, param.module_id + ); + Ok(None) + } +} +``` + +然后用 `pnpm build` 重新构建你的插件,用 `farm start` 重新启动你的 farm 项目,你会看到 `load` 钩子在编译你的 farm 项目时被调用。 + +:::note +想了解更多关于插件 hooks , 参阅 [插件钩子](/zh/docs/api/rust-plugin-api). +::: + +### 处理 ModuleType +`module_type` 由 `load` hook 或 `transform` hook 返回。你在 `load` hook 中可以给 module 设置任意的 module type,该模块将由支持该模块类型的相应插件处理。 +对于原生支持的模块类型,你可以在 `load` 钩子中返回模块类型: + +```rust {8-18} title="src/lib.rs" +// ... ignore other code + +impl Plugin for FarmPluginExample { + fn name(&self) -> &str { + "FarmPluginExample" + } + + fn load( + &self, + param: &farmfe_core::plugin::PluginLoadHookParam, + _context: &std::sync::Arc, + _hook_context: &farmfe_core::plugin::PluginHookContext, + ) -> farmfe_core::error::Result> { + // handle virtual module + if param.module_id.starts_with("virtual:my-css:css") { + // return module type and content + Ok(Some(farmfe_core::plugin::PluginLoadHookResult { + module_type: "css".to_string(), + content: ".red { color: red; }".to_string(), + ..Default::default() + })) + } else { + Ok(None) + } + } +} +``` + +对于原生支持的模块类型,你应该使用 `transform` hook 将模块类型转换为原生支持的模块类型,否则你需要实现 `parse`、`renderResourcePot` hook 来处理你的自定义模块类型: + +```rust {8-18} title="src/lib.rs" +// ... ignore other code + +impl Plugin for FarmPluginExample { + fn name(&self) -> &str { + "FarmPluginExample" + } + + fn transform( + &self, + param: &farmfe_core::plugin::PluginTransformHookParam, + _context: &std::sync::Arc, + _hook_context: &farmfe_core::plugin::PluginHookContext, + ) -> farmfe_core::error::Result> { + // module type guard is required + if matches!(param.module_type, ModuleType::Custom("sass")) { + // compile sass and transform the module type from sass to css + Ok(Some(farmfe_core::plugin::PluginTransformHookResult { + module_type: "css".to_string(), + content: compileSass(param.content), + ..Default::default() + })) + } else { + Ok(None) + } + } +} +``` + +:::note +模块类型保护,如 `matches!(module_type, ModuleType::Custom("sass"))` `transform` 钩子是必需的,因为所有模块类型都会调用 `transform` 钩子,并且你应该只在 `transform` hook 中处理你的自定义模块类型。`parse`和其他 hook 也是如此。 +::: + +或者实现 `parse`,`render_resource_pot_modules` 钩子来处理你的自定义模块类型 参考 farm 如何原生处理 css 插件如何处理 `css` 模块类型的 [farm-plugin-css](https://github.com/farm-fe/farm/blob/main/crates/plugin_html/src/lib.rs#L159) + + +### 处理插件选项 +rust 插件选项可以在`farm.config.ts`中配置: + +```javascript +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + plugins: [ + ['my-farm-plugin', { + // plugin options + myOption: 'myOption' + }] + ] +}); +``` + +该选项将被 json 序列化并传递给插件的`new`方法,你可以在`new`方法中处理该选项: + +```rust title="src/lib.rs" +// ... ignore other code + +// define your rust plugin options +#[derive(serde::Deserialize)] +pub struct Options { + pub my_option: Option, +} + +impl FarmPluginExample { + fn new(config: &Config, options: String) -> Self { + // deserialize the options + let my_option: Options = serde_json::from_str(&options).unwrap(); + // handle the options... + Self {} + } +} +``` + +请注意,你应该将依赖 `serde` 和 `serde_json` 添加到你的`Cargo.toml`中。来支持反序列化: + +```toml +[dependencies] +# ... ignore other code +serde = { version = "1.0", features = ["derive"] } +serde_json = "1.0" +``` + +:::note +不能被 json 序列化选项不被支持。这意味着你只能使用字符串、数字、布尔值、数组、对象等类型。不支持`函数选项`。 +::: + +### 在插件里面使用 farm_core + +Farm 在 [`farmfe_core`](https://docs.rs/farmfe_core) crate 中暴露所有核心结构和工具函数。更多细节请参阅[`farmfe_core`](https://docs.rs/farmfe_core)文档。 + +:::note +如果你想在插件中使用 swc 中的 `Module`、`Program` 等结构,你应该使用由 farm_core 重新暴露的 `farmfe_core::swc_ast`。因为 farm_core 使用的 swc 版本可能与你在插件中使用的 swc 版本不同,并且 farm_core 使用的 swc 版本保证与 farm_core 兼容。 +::: + +### 警告 + +#### 在插件中使用 SWC + +请注意,你的 rust 插件不应该使用任何与 SWC 相关的包,如`swc_common`、`swc_transforms`等。SWC 在进程中存储全局状态,当你在插件中使用 SWC 时,它可能会导致**死锁**。 + +如果你想要修改你的 Farm 项目的AST,建议写[SWC Plugin](/zh/docs/using-plugins#using-swc plugins)。关于如何编写SWC插件,请参阅[编写SWC插件](https://swc.rs/docs/plugin/ecmascript/getting-started)。 + +#### 选择 Rust 工具链 + +因为 Farm 的 Rust 插件是一个动态链接库,你应该始终使用和 farm core 相同版本的 Rust 工具链。rust 工具链定义在` rust-toolchain.toml`中。它不应该**被手动修改**。 +并且应该始终使用 Rust 构建插件,因为Farm Core 不支持 FFI,也不承诺 ABI 稳定性以提供最佳性能。 + +### 插件的兼容性 + +Farm core 维护了一个向插件暴漏出来一个 API 版本。如果你遇到类似`Incompatible Rust Plugin: Current core's version…`,这意味着你的插件与当前 farm core版本不兼容。你应该更新你的插件到最新版本来解决这个问题。 + +对于插件作者来说,你应该重新用最新的 farm core 版本构建和发布插件,来让你的插件与最新的 farm core版本兼容。 + +:::note +Farm 承诺与相同主版本的 AP I兼容,例如,如果你的插件兼容 Farm core 1.0.0,那么它也应该兼容 Farm core 1.1.0、1.2.0等,这意味着你的插件将始终适用于相同的 Farm 主版本。 +::: + +## 交叉构建 +一个 Farm Rust 插件是一个**特定于平台的动态链接库**,你应该为你想要支持的所有平台构建插件。 +Farm 提供了一个使用 github actions 构建插件的示例,请参阅[.github/workflows/build.yml](https://github.com/farm-fe/rust-plugin-example/blob/main/.github/workflows/build.yaml) + +默认情况下,farm rust 插件应该针对以下平台构建: +- `linux-x64-gnu ` +- `linux-x64-musl` +- `darwin-x64` +- `win32-x64-msvc` +- `linux-arm64-musl` +- `linux-arm64-gnu` +- `darwin-arm64` +- `win32-ia32-msvc` +- `win32-arm64-msvc` + +对于公开发布到 npm registry 的插件,建议发布支持上面所有平台的插件。对于私有 rust 插件,你可以为任何你想支持的平台构建插件。 + +:::tip +因为 rust 插件是一个纯动态链接库,如果您有关于如何为特定平台构建插件的问题,只需谷歌如何在 rust 中为该平台构建动态链接库。 +::: + +## 发布 + +发布 Rust插件的有以下的步骤: +1. 交叉构建动态链接库的 Rust 插件,详情请参阅[交叉构建](#cross-build) +2. 将二进制文件复制到 npm 目录下,例如:复制到 `npm/linux-x64-gnu/index.farm` +3. 在 npm 目录下发布平台特定的包,你可以使用`farm-plugin-tool prepublish`在 npm 目录下发布包 +4. 发布包本身 + +参见示例[github actions publish workflow](https://github.com/farm-fe/rust-plugin-example/blob/main/.github/workflows/release.yml) + +## 例子 + +我们将使用 `@farmfe/plugin-sass` 作为一个真正的 Rust 插件示例。这个插件将支持在你的项目中编译`.scss` 和 `.sass` 文件 + + +### 定义一个插件 +导出一个名为 `FarmPluginSass` 的 Rust struct + +```rust title="src/lib.rs" +use farmfe_macro_plugin::farm_plugin; + +// 1. define a struct with #[farm_plugin] attribute +#[farm_plugin] +pub struct FarmPluginSass { + sass_options: String, + regex: Regex, +} + +impl FarmPluginSass { + // 2. define a new method with 2 arguments + pub fn new(_config: &Config, options: String) -> Self { + Self { + sass_options: options, + regex: Regex::new(r#"\.(sass|scss)$"#).unwrap(), + } + } +} +``` +- struct 必须是`pub`并且必须有 `#[farm_plugin]` 属性。 +- 结构体必须导出一个`new`方法,该方法接受两个参数作为初始化参数,第一个参数是`&Config`,第二个参数是`String`。 + +### 实现插件 Trait + +`Plugin` trait 用于定义可以挂接到 farm compiler 的 `hooks` + +```rust {21-30} +use farmfe_core::plugin::Plugin; +use farmfe_macro_plugin::farm_plugin; + +// 1. define a struct with #[farm_plugin] attribute +#[farm_plugin] +pub struct FarmPluginSass { + sass_options: String, + regex: Regex, +} + +impl FarmPluginSass { + // 2. define a new method with 2 arguments + pub fn new(_config: &Config, options: String) -> Self { + Self { + sass_options: options, + regex: Regex::new(r#"\.(sass|scss)$"#).unwrap(), + } + } +} +// Implement Plugin Trait +impl Plugin for FarmPluginSass { + fn name(&self) -> &str { + "FarmPluginSass" + } + + // this plugin should be executed before internal plugins + fn priority(&self) -> i32 { + 101 + } +} +``` +### 加载 `.scss` 文件 +实现 `load` 钩子以支持加载` .scss` 文件 + +```rust {14-32} +// ignore other code ... + +// Implement Plugin Trait +impl Plugin for FarmPluginSass { + fn name(&self) -> &str { + "FarmPluginSass" + } + + // this plugin should be executed before internal plugins + fn priority(&self) -> i32 { + 101 + } + + fn load( + &self, + param: &farmfe_core::plugin::PluginLoadHookParam, + _context: &std::sync::Arc, + _hook_context: &farmfe_core::plugin::PluginHookContext, + ) -> farmfe_core::error::Result> { + if param.query.is_empty() && self.regex.is_match(param.resolved_path) { + let content = fs::read_file_utf8(param.resolved_path); + + if let Ok(content) = content { + return Ok(Some(farmfe_core::plugin::PluginLoadHookResult { + content, + module_type: ModuleType::Custom(String::from("sass")), + })); + } + } + + Ok(None) + } +} +``` + +在 `load` 钩子中,我们只读取以`.scss` 或者 `.sass`结尾的文件,返回文件内容并将其 module_type 设置为`ModuleType::Custom(String::from("sass"))`。 + +### 转化 `sass` 文件 + +加载 `.scss` 文件之后,我们需要在 `transform` hook 中将其转换为 `css`,然后 Farm 将在接下来的过程中将其视为 css + + +```rust +// ignore other code ... +fn transform( + &self, + param: &farmfe_core::plugin::PluginTransformHookParam, + context: &std::sync::Arc, +) -> farmfe_core::error::Result> { + // module type guard is neccessary + if param.module_type == ModuleType::Custom(String::from("sass")) { + // ... ignore other code + + // parse options + const options = parse_options(&self.options, param.module_id); + // compile sass to css + let compile_result = compileSass(¶m.content, options); + + return Ok(Some(farmfe_core::plugin::PluginTransformHookResult { + content: compile_result.css, + source_map: compile_result.source_map, + // tell farm compiler that we have transformed this module to css + module_type: Some(farmfe_core::module::ModuleType::Css), + ignore_previous_source_map: false, + })); + } + + Ok(None) +} +``` + +:::tip +这个例子只介绍了如何实现转换器。有关 Farm 支持的更多能力,请参阅[插件钩子](/zh/docs/api/rust-plugin-api)。 +::: diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/quick-start.mdx b/docs/i18n/zh/docusaurus-plugin-content-docs/current/quick-start.mdx new file mode 100644 index 0000000000..d90a5d864f --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/quick-start.mdx @@ -0,0 +1,104 @@ +--- +sidebar_position: 1 +--- + +import { PackageManagerTabs } from "../../../../src/theme/PackageManagerTabs"; + +:::warning +如果您正在使用的是 2.0.0-nightly 版本。请注意以下几点: +- Farm 正在为 2.0 版本努力, 我们重构了整个 node 端和 新增了很多实用的功能, 后续请查看 RoadMap +- 此版本是一个夜间构建版本,可能包含未经过全面测试的新功能和修复。因此,可能会出现不稳定的行为或意外的错误。 +- 由于此版本处于开发阶段,功能和API可能会在未来的版本中发生变化。请定期查看更新日志以获取最新信息。 +- 建议不要在生产环境中使用此版本,除非您已做好应对潜在问题的准备。 + +如果遇到了问题, 可以提供 Issues 来向我们反馈, 您的反馈对我们改进 Farm 的功能以及稳定性至关重要。 +::: + +# 快速开始 + +:::note +Farm 需要 **Node 16.18.0 及更高版本**。 +::: + +## 在线体验 + +[![Edit Farm](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/p/github/ErKeLost/react/main) + + +## 1. 创建一个 Farm 项目 + + + +:::warning +如果使用的是nightly 版本则需要把 Farm 的依赖都安装成 nightly 版本, 所有核心包以及插件我们都已经提供nightly 版本 + +::: + + +:::note{title="然后按照提示操作!"} +您还可以通过附加命令行选项直接指定项目名称和要使用的模板: +::: + + + + +## 2.启动项目 + +选择您喜欢的包管理器,安装依赖项,然后启动项目。 + + + + +默认情况下,该项目将从`http://localhost:9000`启动。 + +## 3. 配置项目 + +该项目由项目根目录中的“farm.config.ts/js/mjs”文件进行配置。 + +```ts title="farm.config.ts" +import { defineConfig } from "@farmfe/core"; + +export default defineConfig({ + // 编译相关配置 + compilation: { + input: { + // 可以配置相对或者绝对路径 + index: "./index.html", + }, + output: { + path: "./build", + publicPath: "/", + }, + // ... + }, + // Dev Server 相关配置 + server: { + port: 9000, + // ... + }, + // 插件配置 + plugins: [], +}); +``` + +:::note +配置详情请参阅 **[配置 Farm](/docs/config/configuring-farm)**。 +::: + +## 4. 构建项目 +将 Farm 项目构建为生产环境可用的静态文件: + +```bash +npm run build +``` + +构建的产品默认降级为`ES2017`,并且产品将被压缩和Tree Shake。 如果您想在本地预览构建产品,可以执行`npm run Preview`或`npx farm Preview`。 + +## 下一步 + +- [为什么需要 Farm?](/docs/why-farm) +- [特性](/docs/features/dev-server) +- [配置参考](/docs/config/configuring-farm) +- [插件](/docs/plugins/official-plugins/overview) +--- + diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/tutorials/0-overview.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/tutorials/0-overview.md new file mode 100644 index 0000000000..51cde4a1c0 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/tutorials/0-overview.md @@ -0,0 +1,27 @@ +# 概述 +在本教程中,我们将从头开始创建一个 Farm React 项目,并介绍如何添加有用的组件库和 Farm 插件。 + +:::note +Vue项目也得到了Farm的全力支持。 Farm中可以直接使用`Vite`的`@vitejs/plugin-vue`。 Farm 与大多数 vite 插件兼容,并且可以开箱即用。 +::: + +你将学习: +* 如何从头开始构建一个生产就绪的 Farm React 项目。 我们将介绍配置常用插件、添加常见组件库等。 +* Farm的基本概念,如`input`、`output`、`dev-server`、`HMR`和`plugins` +* Farm的日常配置和常用插件。 + +我们的目标是通过本教程简化您使用 Farm 生态系统的开发体验。 如果您想从其他工具迁移到 Farm,它也会很有帮助。 + +:::note +本教程将 `从头开始构建 Farm React 项目`,如果您想快速启动一个新的 Farm 项目,请使用我们的官方模板和命令 `pnpm create farm`。 +::: + +跟着我们的教程,开启你的 Farm 极速开发之旅吧! + +* [1. 创建 Farm React 项目](/docs/tutorials/create) +* [2. 使用 Farm 开发项目](/docs/tutorials/start) +* [3. 使用 Farm 构建生产环境](/docs/tutorials/build) + +:::note +本教程的源代码在[Farm 教程仓库](https://github.com/farm-fe/tutorials) +::: \ No newline at end of file diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/tutorials/1-create.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/tutorials/1-create.md new file mode 100644 index 0000000000..6cc05e0865 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/tutorials/1-create.md @@ -0,0 +1,148 @@ +# 1. 创建一个项目 +在本章中,我们将从头开始创建一个新的 Farm React 项目,并以开发模式启动它。 + +:::note +在本教程中,我们使用 `pnpm` 作为默认包管理器。 本章将 `从头开始构建 Farm React 项目`,如果您想快速启动一个新的 Farm 项目,请使用我们的官方模板和命令 `pnpm create farm`。 +::: + +## 创建一个 Npm 包 +首先我们执行`pnpm init`来创建一个新包。 + +````bash +mkdir farm-react && cd farm-react && pnpm init +```` + +将自动生成`package.json`文件。 + +## 安装依赖项 +安装必要的依赖项(react 以及 react-dom:): + +```bash +pnpm add react react-dom && pnpm add react-refresh @types/react @types/react-dom -D +``` + +然后安装 Farm 相关依赖: +```bash +pnpm add -D @farmfe/cli @farmfe/core @farmfe/plugin-react +``` +React 项目需要 3 个包: +* **`@farmfe/cli`**:该包提供了`farm start`、`farm build`、`farm Preview`等命令,必须与`@farmfe/core`一起使用,不能单独使用。 +* **`@farmfe/core`**:该软件包提供`编译`和`Dev Server`,为本地开发和产品构建提供所有必要的组件。 它导出`Compiler`,`DevServer`和`Watcher`,用于`编译项目`,`以开发模式服务项目`和`监视项目的热模块替换`。 +* **`@farmfe/plugin-react`**:此包提供 React Jsx 编译和 React-refresh 支持。 + +## 创建 Farm 配置文件 +在项目根目录下创建一个`farm.config.ts`文件: +```text {2} +. +├── farm.config.ts +├── package.json +└── pnpm-lock.yaml +``` +并添加以下配置: +```ts +import { UserConfig } from '@farmfe/core'; + +function defineConfig(config: UserConfig): UserConfig { + return config; +} + +export default defineConfig({ + compilation: { + input: { + index: './src/index.html' + }, + output: { + path: 'build', + publicPath: '/', + targetEnv: 'browser' + } + }, + plugins: [ + '@farmfe/plugin-react', + ] +}); +``` +对于上面的配置文件,我们使用了`input`、`output`和`plugins`,这是Farm中最基本的配置。 +* **`input`**:配置入口点。 Farm 将根据条目编译并构建模块图。 +* **`输出`**:配置输出目录、文件名等。 有关完整选项,请参阅 [compilation.output](/docs/config/farm-config#output)。 +* **`plugins`**:配置farm插件,React、Vue SFC等所有扩展能力均由插件支持。 这里我们使用一个 Rust 插件(`@farmfe/plugin-react`)来支持编译 React jsx。 + +查阅[配置参考](/docs/config/farm-config)以获取更多选项。 + +:::note +在上面的例子中,我们将 input 配置为 `index: './src/index.html'`,如果我们不配置 `input`,则默认为 `index: './index.html'`。 并且我们可以在`input`中配置多个条目,详细信息请参见[多页面应用](/docs/features/html#multi-page-app) +::: + +## 创建一个入口Html和Js +在项目根目录下创建 2 个文件 `src/index.html` 和 `src/index.tsx`: +```text {5-7} +. +├── farm.config.ts +├── package.json +├── pnpm-lock.yaml +└── src + ├── index.html + └── index.tsx +``` +`src/index.html` 的内容是: +```html + + + + + + Document + + +
+ + + + +``` +:::note +请注意,我们必须添加至少一个` + + +``` + +当加载动态脚本和CSS时,动态获取的资源url也将是:`https://cdn.com/` + + +## 配置 Alias 以及 Externals +Alias 和 externals 是最常用的配置之一, 在 Farm 中,可以使用 `compilation.resolve.alias` 和 `compilation.externals` 配置项: + +```ts title="farm.config.ts" +// ... + +export default defineConfig({ + compilation: { + resolve: { + alias: { + '@/': path.join(process.cwd(), 'src') + }, + externals: [ + 'node:fs' + ] + } + } + // ... +}); +``` + +## 配置开发服务器 +您可以在[Farm Dev Server Config](/docs/config/farm-config#devserver-options---server)中找到服务器配置。 + +### 常用配置 +配置示例: +```ts +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + // 所有开发服务器选项都在 server 下 + server: { + open: true, + port: 9001, + hmr: { + // 配置Websocket的监听端口 + port: 9801 + host: 'localhost', + // 配置文件监听时要忽略的文件 + ignores: ['auto_generated/*'] + } + //... + } +}); +``` +对于上面的示例,我们使用了以下选项: +* **打开**:自动打开指定端口的浏览器 +* **端口**:将开发服务器端口设置为`9001` +* **hmr**:设置 hmr 端口和监视文件,我们忽略 `auto_generate` 目录下的文件更改。 + + +### Setup Proxy +配置服务器代理。基于 [http-proxy](https://github.com/http-party/node-http-proxy?tab=readme-ov-file#options) 实现,具体选项参考其文档,示例: + +```ts +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + server: { + proxy: { + '/api': { + target: 'https://music-erkelost.vercel.app/banner', + changeOrigin: true, + pathRewrite: (path: any) => path.replace(/^\/api/, ''), + }, + }, + }, +}); +``` + +## 配置 root 和 envDir +使用`root`和`envDir`指定项目根目录和加载环境变量的目录。 在`farm.config.ts`中添加以下选项: + +```ts title="farm.config.ts" +import path from 'node:path'; +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + root: path.join(process.cwd(), 'client'), + envDir: 'my-env-dir' +}); +``` + +:::note +有关 `envDir` 的详细信息,请参阅[环境变量和模式](/docs/features/env) +::: diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/tutorials/3-build.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/tutorials/3-build.md new file mode 100644 index 0000000000..ef44ebccb7 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/tutorials/3-build.md @@ -0,0 +1,130 @@ +# 3. 使用 Farm 构建生产项目 +默认情况下,Farm 已启用对生产版本的以下功能的支持: +* **`Tree Shake`**:裁剪和过滤不相关的模块和代码 +* **`压缩`**:压缩并混淆输出资源,有效减小产物体积。 +* **`自动注入Polyfill`**:默认情况下 Farm 降级到现代浏览器(ES7),如果需要旧版浏览器支持,请配置[`targetEnv`](/docs/config/compilation-options#output-targetenv) +* **`自动局部打包`**:根据依赖关系和大小,对项目进行局部打包。 对于每个资源请求,会生成大约25个资源,以保证并行加载性能,并尽可能提高缓存命中率。 + +## 配置输出目录 +在 `package.json` 中添加构建脚本: + +```json title="package.json" {7-8} +{ + "name": "1-create-a-project", + "version": "1.0.0", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "start": "farm start", + "build": "farm build", + "preview": "farm preview" + }, + // ...ignore other fields +} +``` + +然后执行`npm run build`,构建的资源将被生成到`build`目录 + +```text +build +├─ favicon.ico +├─ index.html +├─ index_02bc.bd68e90b.js +├─ index_02bc.bd68e90b.js.map +├─ index_1c74.4b50f73e.js +├─ index_7734.440d56a3.js +├─ index_880b.4631ecee.js +├─ index_8d49.63f7b906.css +├─ index_8d49.63f7b906.css.map +├─ index_9025.84e1f8e6.js +├─ index_ca37.f2c276ef.js +├─ index_ef2f.e25349d8.js +├─ index_f346.369a7312.js +``` + +如果您想自定义资源生成的路径,您可以使用: +* [`output.filename`](/docs/config/compilation-options#outputfilename) +* [`output.assetsFilename`](/docs/config/compilation-options#outputassetsfilename) + +```ts +import defineConfig from '@farmfe/core'; + +export default defineConfig({ + compilation: { + output: { + path: 'build', + filename: 'assets/[name].[hash].[ext]', + assetsFilename: 'static/[resourceName].[ext]' + } + } +}) +``` + +对于上面的示例,所有`js/css`将被发送到`build/assets/`(例如:`build/assets/index-ea54.abbe3e.js`)。 所有静态资源(例如图像)都将发送到`build/static`(例如:`build/static/background.png`) + +## 预览构建的资源 +资源构建完成后,您可以通过`npm run Preview`进行预览: + +```sh +$ npm run preview + +> 3-build@1.0.0 preview +> farm preview + +[ Farm ] Using config file at /root/tutorials/3-build-for-production/farm.config.ts +[ Farm ] preview server running at: + +[ Farm ] > Local: http://localhost:1911/ +[ Farm ] > Network: http://198.18.0.1:1911/ +[ Farm ] > Network: http://10.242.197.146:1911/ +[ Farm ] > Network: http://192.168.1.31:1911/ +``` + +打开`http://localhost:1911/`来预览项目。 + +## 浏览器兼容性 +默认情况下,Farm 将项目构建到本机支持`async/await`的现代浏览器: + +* Chrome >= 62 +* Firefox >= 63 +* Safari >= 13.1 +* Edge >= 79 + +可以使用 [output.targetEnv](/docs/config/compilation-options#output-targetenv) 来配置目标浏览器: + +```ts +import { defineConfig } from '@farmfe/core'; + +export default defineConfig({ + compilation: { + output: { + targetEnv: 'browser-legacy' + } + } +}) +``` + +在上面的例子中,Farm 会将语法降级为 `es5` 并自动注入 polyfill。 然后我们必须安装`core-js@3`来进行`polyfill`注入: + +```sh +pnpm add -D core-js@3 +``` + +:::note +* 如果您的目标是旧版浏览器,则需要手动安装 `core-js@3`。 +* 如果你想更精确地配置浏览器目标,请参阅[语法 Downgrade 和 Polyfill](/docs/advanced/polyfill) +::: + +## 配置 Tree Shake 和 Minify +出于性能原因,像`treeShake`和`minify`这样的生产优化在`development`中默认被`禁用`,而在`生产`中默认被`启用`。 但如果手动配置了`treeShake`或`minify`,则无论`development`或`productive`都将使用默认值。 + +有关 Tree Shake 和 Minify 的详细信息,请参阅: +* [Tree Shake](/docs/advanced/tree-shake) +* [Minification](/docs/advanced/minification) + + +## 配置局部打包策略 +:::note +详细信息参考[局部打包](/docs/advanced/partial-bundling)。 +::: + +Farm 已经启用了打包的最佳实践,请确保您确实需要手动配置打包策略,参考[局部打包](/docs/advanced/partial-bundling) 了解详情。 \ No newline at end of file diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/tutorials/_category_.json b/docs/i18n/zh/docusaurus-plugin-content-docs/current/tutorials/_category_.json new file mode 100644 index 0000000000..8fb5c68079 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/tutorials/_category_.json @@ -0,0 +1,8 @@ +{ + "label": "教程", + "position": 3, + "link": { + "type": "generated-index", + "description": "Features supported by Farm" + } +} diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/using-plugins.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/using-plugins.md new file mode 100644 index 0000000000..5062779d55 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/using-plugins.md @@ -0,0 +1,278 @@ +# 使用插件 +Farm支持4种插件: +* **`Farm 编译插件`**:支持 Rust 插件和 Js 插件,采用 rollup 风格的 hooks。 +* **`Vite/Rollup/Unplugin 插件`**:Farm 开箱即用支持 Vite/Rollup/Unplugin 插件 +* **`Farm 运行时插件`**:为 Farm 的运行时系统添加功能。 +* **`Swc 插件`**:Farm 开箱即用支持 Swc 插件。 + +:::tip +如何编写自己的插件,请参考[插件](/docs/plugins/writing-plugins/overview) +::: + +## Farm 编译插件 +首先,安装您需要的插件,例如: +```bash +pnpm add -D @farmfe/plugin-sass @farmfe/js-plugin-postcss +``` + +使用 `plugins` 配置 Farm 编译插件: +```ts title="farm.config.ts" +import farmPostcssPlugin from "@farmfe/js-plugin-postcss"; + +export default defineConfig({ + // ... + plugins: [ + // Rust插件,配置其包名 + "@farmfe/plugin-sass", + // JS插件,配置插件对象 + farmPostcssPlugin() + ], +}); +``` + +Farm编译插件有2种: +* **`Rust Plugins`**:用 Rust 编写,具有最佳性能。 +* **`Js Plugins`**:用JS/TS编写,用于兼容当前的JS生态系统 + +### 使用 Rust 插件 +使用 `package name` 来配置 Rust 插件,例如: +```ts title="farm.config.ts" +export default defineConfig({ + // ... + plugins: [ + "@farmfe/plugin-sass", + ], +}); +``` +对于上面的例子,Farm 将解析包 `@farmfe/plugin-sass` 并将其视为 Farm Rust 插件。 + +如果要为 Rust 插件配置选项,可以使用`数组语法`,如`[packageName, optionsObject]`,例如: +```ts title="farm.config.ts" +export default defineConfig({ + // ... + plugins: [ + // 使用数组语法来配置 Rust 插件 + [ + // Rust 插件的名称 + "@farmfe/plugin-sass", + // Rust 插件的选项 + { + additionalData: '@use "@/global-variables.scss";' + } + ], + ], +}); +``` +目前 Farm 官方支持 2 个 Rust 插件: +* **`@farmfe/plugin-react`**:Farm rust 插件,用于 React jsx 编译和 React-refresh 注入。 +* **`@farmfe/plugin-sass`**:用于 scss 文件编译的 Farm rust 插件,内部使用 `sass-embedded`。 + +:::tip +要了解有关 rust 插件的更多信息,请参阅 [Rust 插件](/docs/plugins/official-plugins/overview#rust-插件) +::: + +### 使用 Js 插件 +Farm JS 插件是一个以方法为钩子的 JS 对象,例如: +```ts title="farm.config.ts" +import farmPostcssPlugin from "@farmfe/js-plugin-postcss"; + +export default defineConfig({ + plugins: [ + farmPostcssPlugin({ + // ... 配置 postcss 选项 + }) + ], +}); +``` +`farmPostcssPlugin()`返回一个插件对象,您可以通过其参数传递任何 postcss 选项。 + +您可以使用`priority`来控制插件的顺序,例如: +```ts title="farm.config.ts" {10,11} +import farmPostcssPlugin from "@farmfe/js-plugin-postcss"; + +export default defineConfig({ + plugins: [ + { + ...farmPostcssPlugin({ + // ... configure postcss options + }), + // larger priority will be executed first, priority of internal plugin are 100. + priority: 1000, + } + ], +}); +``` +内部插件的优先级都是100,如果想让插件先执行,就设置大于100,否则设置小于100。 + +如果你想快速添加 Farm JS 插件,只需配置一个插件对象即可: +```ts title="farm.config.ts" +import readFileSync from 'fs'; + +export default defineConfig({ + plugins: [ + // 配置自定义插件 + { + // 插件名称,必填 + name: 'my-first-farm-plugin', + // 这个插件的优先级,值越大先执行,默认100。 + priority: 1000, + // 定义一个加载钩子来确定如何加载模块 + load: { + // 为了提高性能,如果模块与过滤器不匹配,将被跳过。 + filters: { + // 仅对 .png 文件执行。 + resolvedPaths: ['\\.txt$'] + }, + // 该钩子的执行回调 + executor: (params, context) => { + const { resolvedPath } = params; + const content = readFileSync(resolvedPath, 'utf-8'); + + return { + content: `export default '${content}'`, + moduleType: 'js' + } + } + } + } + ], +}); +``` +:::warning +Farm 中的 js 插件需要 `filters`。 因为Js Plugin实在是太慢了,我们应该尽量避免执行它。配置 filters 后,对于那些不符合过滤器的模块,Farm 根本不会为它们触发 js 插件钩子! 这意味着 Farm 只在 Rust 侧就能安全、并发地进行处理,以最大化提升编译性能。 +::: + +:::tip +了解更多关于 Farm Js 插件的信息,请参考 [JS 插件](/docs/plugins/official-plugins/overview#js-插件) +::: + +## 使用 Vite/Rollup/Unplugin 插件 +Farm 兼容 Vite 插件,Vite 插件可以直接在 Farm 中配置使用。 首先需要安装 vite 插件,例如: +```bash +pnpm add @vitejs/plugin-vue @vitejs/plugin-vue-jsx vite -D +``` + +然后就可以通过`farm.config.ts`中的`vitePlugins`直接使用vite插件了。 + +```ts title="farm.config.ts" +import vue from '@vitejs/plugin-vue', +import vueJsx from '@vitejs/plugin-vue-jsx'; + +export default defineConfig({ + // 配置vite插件 + vitePlugins: [ + vue(), + vueJsx() + ] +}); +``` +为了提高 vite 插件的性能,您可以使用返回`过滤器`的`函数语法`,例如: + +```ts title="farm.config.ts" +import vue from '@vitejs/plugin-vue', + +// // 使用Farm 中 Vite 插件的函数语法 +function configureVitePluginVue() { + // 返回插件及其过滤器 + return { + // 使用 vue 插件 + vitePlugin: vue(), + // 为其配置过滤器。 不匹配的模块路径将被跳过。 + filters: ['\\.vue$', '\\\\0.+'] + }; +} + +export default defineConfig({ + vitePlugins: [ + configureVitePluginVue + ] +}); +``` + +使用 unplugin: +```bash +pnpm add unplugin-auto-import unplugin-vue-components -D +``` +在 `vitePlugins` 中配置,通过 `unplugin/vite` 或者 `unplugin/rollup` 支持: +```ts title="farm.config.ts" +import vue from '@vitejs/plugin-vue', +import AutoImport from 'unplugin-auto-import/vite' +import Components from 'unplugin-vue-components/vite' +import { ElementPlusResolver } from 'unplugin-vue-components/resolvers' + +export default defineConfig({ + vitePlugins: [ + vue(), + // ... + AutoImport({ + resolvers: [ElementPlusResolver({ importStyle: 'sass' })], + }), + Components({ + resolvers: [ElementPlusResolver({ importStyle: 'sass' })], + }), + ] +}); +``` +:::note +目前,您可以在 Farm 中使用`unplugin/farm`、`unplugin/vite`和`unplugin/rollup`。如果您使用的是`unplugin/vite`或`unplugin/Rolup`,有些属性可能还没有完全适配,或者 Farm 团队认为该 `api` 不具备适配条件,可以提供[issues](https://github.com/farm-fe/farm/issues/new/choose) . +::: + +## Farm 运行时插件 +Farm有一个运行时模块系统来控制如何加载和执行模块。 配置 `compilation.runtime.plugins` 以添加更多运行时插件,例如: +```ts +export default defineConfig({ + compilation: { + // 配置 Farm 运行时模块系统 + runtime: { + plugins: [ + // 运行时插件包 + require.resolve('farm-plugin-runtime-mock'), + // 本地运行时插件 + path.join(process.cwd(), "build/runtime-plugin.ts") + ] + } + } +}); +``` +您必须配置指向运行时插件的路径。 推荐使用 **绝对路径** 以避免路径问题。 + +:::tip +要了解有关运行时插件的更多信息,请参阅 [运行时插件](/docs/plugins/writing-plugins/runtime-plugin) +::: + +## 使用 SWC 插件 +Swc Plugin 也可以直接在Farm中使用,配置`compilation.script.plugins`来添加SWC插件,例如: +```ts +import jsPluginVue from '@farmfe/js-plugin-vue'; + +export default defineConfig({ + compilation: { + script: { + plugins: [{ + //swc插件的包名 + name: 'swc-plugin-vue-jsx', + // 该swc插件的选项 + options: { + "transformOn": true, + "optimize": true + }, + // 当过滤器匹配时插件执行。 + filters: { + // resolvedPaths: [".+"] + moduleTypes: ['tsx', 'jsx'], + } + }] + } + }, + plugins: [jsPluginVue()], +}); +``` + +数组的每个插件项包含三个字段: +* **name**:swc插件的包名 +* **options**:传递给swc插件的配置项 +* **filters**:执行插件的哪些模块,必须配置,支持`resolvedPaths`和`moduleTypes`这两个过滤项,如果两者同时指定,则取并集。 + +:::note +`SWC 插件`可能与 Farm 使用的 `SWC 版本`(rust crate `swc_core v0.90`) 不兼容。 如果出现错误,请尝试升级插件。 +::: diff --git a/docs/i18n/zh/docusaurus-plugin-content-docs/current/why-farm.md b/docs/i18n/zh/docusaurus-plugin-content-docs/current/why-farm.md new file mode 100644 index 0000000000..eadab99b47 --- /dev/null +++ b/docs/i18n/zh/docusaurus-plugin-content-docs/current/why-farm.md @@ -0,0 +1,47 @@ +--- +sidebar_position: 2 +--- + +# 为什么需要 Farm? + +## Farm 是什么? + +Farm 是一个非常快的基于 Rust 的 Web 构建工具,类似 `webpack` 和 `vite`,但**更快**。 farm `resolve, load, transform` 所有 `asset(js/jsx/ts/tsx、css/sass/less、html、静态资源、json 等)`,并将它们打包成一系列`可部署文件`。 Farm 是一个速度极快的构建工具,可帮助您构建更快的 `web/nodejs` 应用程序。 + +## 为什么需要 Farm? + +随着 web 项目规模的扩大,构建性能已经成为主要瓶颈,对于一个庞大的项目,使用 webpack 编译可能需要 10min 甚至更多,一次 hmr 更新可能需要 10s 甚至更多,严重降低了研发效率。 + +因此我们急需极速的构建工具,解决项目编译性能问题。然后 vite/snowpack 这样的 unbundled 工具应运而生,此类工具主要有下面三个特性: + +1. 使用原生 ESM,在 dev server 启动时**不对**源文件进行编译和打包,源文件在入口模块执行时才会通过浏览器请求 dev server 编译,编译后的产物返回给浏览器 +2. HMR 时,只重新编译一个模块,这样 HMR 的时间约等于一个模块的编译时间 +3. 对外部依赖(如 node_modules 下的依赖)进行预打包 + +这使得 dev 服务器热启动和 HMR 非常快,但 vite 等工具使用的 Unbundled 模式并不完美,对于大型项目来说仍然存在很大的问题: + +- **大量的模块请求**:对于一个大型项目,使用上述策略 1、2,首次启动可能需要加载数千个模块,使用原生模块系统加载数千个模块会导致浏览器卡住甚至崩溃。虽然 Dev Server 的启动快了,但是请求时的模块的首次编译依然会耗费大量时间,会有数十秒起步的白屏,编译时间只是转移了,并没有消失。 +- **开发和生产之间的不一致**:出于兼容性和请求数量、请求层级的考虑,原生 ES 模块在大多数情况下无法在生产中使用。 因此 vite 选择在生产环境选择用 rollup 打包。 这就带来了不一致,当这种不一致导致生产错误时,调试起来非常困难且非常痛苦。 而 vite 在 dev 中使用 esbuild,在生产中使用 rollup,这更加就放大了不一致性。 +- **拆包优化困难**: 受限于 Rollup,拆包配置不够灵活、易用。 +- 而 Vite 在 dev 上之所以这么快,esbuild 功不可没,它是用 go 编写的。 Go 利用了原生平台的优势,远快于 Js。 + +事实上,我们真正需要的是一个快速、强大、一致的 Web 构建工具,可以在解决上述问题的基础上,提供更加极致的编译效率。因此我们设计并开发了 Farm。 + + + + + +不过 Farm 不仅仅是一个用 Rust 重写的打包工具,它还有很多强大且先进的设计: + +## Farm 设计理念 + +- **性能优先**:一切都会用 Rust 编写,只有少数不是性能瓶颈的部分会用 JS 编写 +- **一致性**:默认情况下确保开发和生产完全相同,您在开发中看到的将与您在生产中得到的相同。 +- **局部打包**:Farm 的打包目标不是将所有东西打包在一起,而是限制资源的请求数量。 Farm 会根据依赖关系和资源大小将您的项目捆绑成 20-30 个小资源,在不损失缓存粒度的情况下获得最佳的资源加载性能。 +- **所有资源视为一等公民**:Farm 不再需要将所有内容转换为 Javascript,它将任何内容视为一等公民,如 `html`、`js/jsx/ts/tsx`、`css/scss`、`png/svg/...`都是 Farm 支持的基础模块,更多类型的模块可以通过插件支持。 +- **兼容性**:Farm 将适用于旧版 (ES5) 和现代浏览器。 +- **Rollup 风格的插件系统**:轻松创建自己的插件,并轻松从 `rollup/vite/webpack` 迁移您的插件/项目。兼容 `Vite/Rollup/Unplugin` 插件 + +Farm 的目标是成为真正的下一代构建工具,快速、强大、一致,并为 Web 开发人员提供最佳的开发体验。 diff --git a/docs/i18n/zh/docusaurus-theme-classic/footer.json b/docs/i18n/zh/docusaurus-theme-classic/footer.json new file mode 100644 index 0000000000..2bdc8e81ab --- /dev/null +++ b/docs/i18n/zh/docusaurus-theme-classic/footer.json @@ -0,0 +1,62 @@ +{ + "link.title.Docs": { + "message": "Docs", + "description": "The title of the footer links column with title=Docs in the footer" + }, + "link.title.More": { + "message": "More", + "description": "The title of the footer links column with title=More in the footer" + }, + "link.item.label.Guilds": { + "message": "Guilds", + "description": "The label of footer link with label=Guilds linking to /docs/quick-start" + }, + "link.item.label.Blog": { + "message": "Blog", + "description": "The label of footer link with label=Blog linking to /quick-start" + }, + "link.item.label.GitHub": { + "message": "GitHub", + "description": "The label of footer link with label=GitHub linking to https://github.com/farm-fe/farm" + }, + "copyright": { + "message": "Copyright © 2023 Farm Team. Built with Docusaurus.", + "description": "The footer copyright" + }, + "link.title.Learn": { + "message": "Learn", + "description": "The title of the footer links column with title=Learn in the footer" + }, + "link.title.Community": { + "message": "Community", + "description": "The title of the footer links column with title=Community in the footer" + }, + "link.item.label.Introduction": { + "message": "Introduction", + "description": "The label of footer link with label=Introduction linking to /why-farm" + }, + "link.item.label.Installation": { + "message": "Installation", + "description": "The label of footer link with label=Installation linking to /quick-start" + }, + "link.item.label.WeChat Group": { + "message": "WeChat Group", + "description": "The label of footer link with label=WeChat Group linking to https://github.com/farm-fe/farm#chat-with-us" + }, + "link.item.label.Discord": { + "message": "Discord", + "description": "The label of footer link with label=Discord linking to https://discord.com/invite/mDErq9aFnF" + }, + "link.item.label.Changelog": { + "message": "Changelog", + "description": "The label of footer link with label=Changelog linking to /quick-start" + }, + "link.item.label.Twitter": { + "message": "Twitter", + "description": "The label of footer link with label=Twitter linking to https://twitter.com/@farm-fe" + }, + "logo.alt": { + "message": "Farm Logo", + "description": "The alt text of footer logo" + } +} diff --git a/docs/i18n/zh/docusaurus-theme-classic/navbar.json b/docs/i18n/zh/docusaurus-theme-classic/navbar.json new file mode 100644 index 0000000000..7f9114908d --- /dev/null +++ b/docs/i18n/zh/docusaurus-theme-classic/navbar.json @@ -0,0 +1,34 @@ +{ + "title": { + "message": "Farm", + "description": "The title in the navbar" + }, + "item.label.Guides": { + "message": "指南", + "description": "Navbar item with label Guides" + }, + "item.label.Config": { + "message": "配置", + "description": "Navbar item with label Config" + }, + "item.label.Plugins": { + "message": "插件", + "description": "Navbar item with label Plugins" + }, + "item.label.Community": { + "message": "社区", + "description": "Navbar item with label Community" + }, + "item.label.Team": { + "message": "团队", + "description": "Navbar item with label Community Team" + }, + "item.label.Blog": { + "message": "日志", + "description": "Navbar item with label Community Blog" + }, + "logo.alt": { + "message": "My Site Logo", + "description": "The alt text of navbar logo" + } +} diff --git a/docs/nyxbui.json b/docs/nyxbui.json new file mode 100644 index 0000000000..35c2caf049 --- /dev/null +++ b/docs/nyxbui.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://nyxbui.design/schema.json", + "style": "default", + "rsc": false, + "tsx": true, + "tailwind": { + "config": "tailwind.config.js", + "css": "src/css/custom.scss", + "baseColor": "rose", + "cssVariables": true, + "prefix": "" + }, + "aliases": { + "components": "~/components", + "utils": "~/lib/utils" + } +} \ No newline at end of file diff --git a/docs/package.json b/docs/package.json new file mode 100644 index 0000000000..45366dc92b --- /dev/null +++ b/docs/package.json @@ -0,0 +1,93 @@ +{ + "name": "farm-docs", + "version": "0.0.0", + "private": true, + "scripts": { + "docusaurus": "docusaurus", + "start": "docusaurus start --port 1911", + "dev": "docusaurus start --port 1911", + "dev:zh": "docusaurus start --port 1911 --locale zh", + "build": "docusaurus build", + "swizzle": "docusaurus swizzle", + "deploy": "docusaurus deploy", + "clear": "docusaurus clear", + "serve": "docusaurus serve --port 9000", + "write-translations": "docusaurus write-translations", + "write-heading-ids": "docusaurus write-heading-ids", + "crowdin-upload": "pnpm write-translations && crowdin upload sources --auto-update", + "crowdin-download": "crowdin download", + "crowdin-status": "crowdin status translation --no-colors --no-progress", + "crowdin:sync": "pnpm copy-docs && pnpm crowdin-upload && pnpm crowdin-download --verbose", + "update-progress": "ts-node ./scripts/translations.ts", + "crowdin": "crowdin", + "documate:upload": "documate upload" + }, + "dependencies": { + "@crowdin/cli": "3", + "@crowdin/crowdin-api-client": "^1.23.4", + "@docusaurus/core": "3.5.2", + "@docusaurus/plugin-ideal-image": "3.5.2", + "@docusaurus/preset-classic": "3.5.2", + "@docusaurus/theme-common": "3.5.2", + "@docusaurus/theme-search-algolia": "3.5.2", + "@mdx-js/react": "^3.0.0", + "@radix-ui/react-icons": "^1.3.0", + "@react-spring/web": "^9.7.3", + "@react-three/drei": "9.112.1", + "@react-three/fiber": "8.17.7", + "@shikijs/markdown-it": "^1.18.0", + "@shikijs/transformers": "^1.18.0", + "@tabler/icons-react": "^3.11.0", + "autoprefixer": "^10.4.14", + "class-variance-authority": "^0.7.0", + "docusaurus-plugin-sass": "0.2.5", + "docusaurus-preset-shiki-twoslash": "^1.1.41", + "leva": "^0.9.35", + "lucide-react": "^0.394.0", + "markdown-it": "^14.1.0", + "next-themes": "^0.3.0", + "postcss": "^8.4.24", + "postcss-preset-env": "^10.0.3", + "prism-react-renderer": "^2.1.0", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-icons": "^5.3.0", + "react-intersection-observer": "^9.5.1", + "react-use-measure": "^2.1.1", + "remark-gfm": "^4.0.0", + "sass": "^1.63.6", + "tailwindcss-animate": "^1.0.7", + "three": "0.168.0" + }, + "devDependencies": { + "@docusaurus/module-type-aliases": "3.5.2", + "@docusaurus/types": "3.5.2", + "@swc/core": "^1.3.99", + "babel-loader": "^9.1.3", + "clsx": "^1.2.1", + "framer-motion": "^11.2.10", + "shiki": "^1.7.0", + "shikiji": "0.9.10", + "swc-loader": "^0.2.3", + "tailwind-merge": "^2.3.0", + "tailwindcss": "^3.4.4", + "ts-node": "^10.9.1" + }, + "browserslist": { + "production": [ + ">0.5%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + }, + "engines": { + "node": ">=18.0", + "pnpm": ">=8" + }, + "packageManager": "pnpm@9.4.0+sha512.f549b8a52c9d2b8536762f99c0722205efc5af913e77835dbccc3b0b0b2ca9e7dc8022b78062c17291c48e88749c70ce88eb5a74f1fa8c4bf5e18bb46c8bd83a" +} \ No newline at end of file diff --git a/docs/scripts/progress_translate_lang.json b/docs/scripts/progress_translate_lang.json new file mode 100644 index 0000000000..2aa7f954c7 --- /dev/null +++ b/docs/scripts/progress_translate_lang.json @@ -0,0 +1,6 @@ +{ + "zh-CN": { + "translationProgress": 100, + "approvalProgress": 100 + } +} \ No newline at end of file diff --git a/docs/scripts/translations.ts b/docs/scripts/translations.ts new file mode 100644 index 0000000000..6f6f246423 --- /dev/null +++ b/docs/scripts/translations.ts @@ -0,0 +1,31 @@ +import path from 'path'; +import fs from 'fs/promises'; + +import crowdin, { + Credentials, + TranslationStatus +} from '@crowdin/crowdin-api-client'; + +const token = + 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJhdWQiOiJ3UUVxdmhVM3ZMT2EyWGljbVV5VCIsImp0aSI6IjYxZjI5YjkyYmU4YTUwMjk5MWEzMmM0ZWRmMDQ3ZTk1NjFhZDIyMzk2OGE1MmQ4MGFlNzM1YmY1YWVjNzZiMDVlODk5YjEzMWMzN2MxYWY2IiwiaWF0IjoxNjkwMjg5MTE2LjY2NDAxOCwibmJmIjoxNjkwMjg5MTE2LjY2NDAyMSwiZXhwIjoxNzIxODI1MTE2LjU1NjU4Miwic3ViIjoiMTU5MzQ5MDMiLCJzY29wZXMiOlsicHJvamVjdCJdLCJkb21haW4iOm51bGwsImFzc29jaWF0aW9ucyI6WyIqIl0sInNlc3Npb24iOjB9.rG2dtUOUI6y4YzlL4_AxfHSGhH8XsAQDBIPxb-hts56kOWnaACVHU9-Y2e7ABzaAmEsdxJ4Wl6kByFAF1DJ-n-ga02PVPW1EV8RulXZwram5lofZUjanq8OBuBMnOptJsxhmf962_t8G7lDvN0zYcOuddKg_sBcmEC1QS8ngF0OwDrQhOyzyAavciUIbwZERsLKoXyMj1EDWEtJ8UWePFcCiQUk5pffnOXR-lVgudO9JgK4breoKB6cTKp_J4mj8eFUmEOwgYhciNIxTYhmMrv43l9-sgPQA2NBct5p0ifHrPtktl5uEZYrjMQqwGhVDSVA5OakyYVdp2MsT2dTgBBqd9HY7Cuph9A5JDEL3ZwEW8Exw3qWcBDUKv7-IONcRSrbUIyTzw0ZYBSz5lE--33vsdWEOuZCDaU16pHOjCfudsiDjQI5RFVLYsMo05Qkf0zzse3WYNybxx2YrO2JiYRdjgGzN-inUoMek7phvjbFKq30XCI2CZDa3XrZjwgCF3RTAd-hoFIsi65u1vj-L554xvIU6NITHVklunZcIcZjoRFeDN1uw5pXcRMRcfchjBpSXNQRucdkRN-P2ay5dZS1M8tGlvygJtjc5pFgDGV51Zx_NFVGv75xrQ_UivKE8UIljwt5Aci_eHDE_f8keMANrATdSzMmXlyRUhh-8aWI'; + +(async () => { + const credentials: Credentials = { + token + }; + const { projectsGroupsApi } = new crowdin(credentials); + const t = await projectsGroupsApi.listProjects(); + const api: TranslationStatus = new TranslationStatus(credentials); + const progress = await api.getProjectProgress(603701, { limit: 100 }); + const final = progress.data.reduce((acc, item) => { + const { languageId, translationProgress, approvalProgress } = item.data; + // @ts-ignore + acc[languageId] = { translationProgress, approvalProgress }; + return acc; + }, {}); + + fs.writeFile( + path.join(__dirname, './progress_translate_lang.json'), + JSON.stringify(final, null, 4) + ); +})(); diff --git a/docs/sidebars.js b/docs/sidebars.js new file mode 100644 index 0000000000..e12657b6ae --- /dev/null +++ b/docs/sidebars.js @@ -0,0 +1,187 @@ +/** + * Creating a sidebar enables you to: + - create an ordered group of docs + - render a sidebar for each doc of that group + - provide next/previous navigation + + The sidebars can be generated from the filesystem, or explicitly defined here. + + Create as many sidebars as you want. + */ + +// @ts-check + +/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ +const sidebars = { + // By default, Docusaurus generates a sidebar from the docs folder structure + // tutorialSidebar: [{type: 'autogenerated', dirName: '.'}], + + // But you can create a sidebar manually + tutorialSidebar: [ + { + type: "category", + label: "Getting Started", + collapsed: false, + items: [ + "why-farm", + "quick-start", + "using-plugins", + { + type: "doc", + id: "contribution", + className: "sidebar-contribution-item", + }, + ], + }, + { + type: "category", + label: "Tutorial", + collapsed: false, + items: [ + "tutorials/overview", + "tutorials/create", + "tutorials/start", + "tutorials/build", + ], + }, + { + type: "category", + label: "Features", + collapsed: false, + items: [ + "features/dev-server", + "features/html", + "features/css", + "features/script", + "features/static", + "features/env", + "features/lazy-compilation", + "features/sourcemap", + ], + }, + { + type: "category", + label: "Frameworks", + collapsed: true, + items: [ + "frameworks/vanilla", + "frameworks/react", + "frameworks/vue", + "frameworks/solid", + "frameworks/svelte", + "frameworks/preact", + "frameworks/lit", + "frameworks/electron", + "frameworks/tauri", + "frameworks/nestjs", + ], + }, + { + type: "category", + label: "Advanced", + collapsed: true, + items: [ + "advanced/ssr", + "advanced/partial-bundling", + "advanced/tree-shake", + "advanced/minification", + "advanced/polyfill", + "advanced/persistent-cache", + ], + }, + { + type: "category", + label: "Migration", + collapsed: true, + items: ["migration/from-vite"], + }, + // "comparisons", + "benchmark", + ], + configSidebar: [ + { + type: "category", + label: "Configuration Reference", + collapsed: false, + items: [ + "config/configuring-farm", + "config/compilation-options", + "config/dev-server", + "config/shared", + // "config/plugins-options", + ], + }, + { + type: "category", + label: "CLI", + collapsed: false, + items: ["cli/cli-api"], + }, + // "config/farm-config", + // "config/cli", + ], + apiSidebar: [ + { + type: "category", + label: "Api Reference", + collapsed: false, + items: [ + "api/hmr-api", + "api/js-plugin-api", + "api/rust-plugin-api", + "api/runtime-plugin-api", + "api/javascript-api", + "api/rust-api", + ], + }, + ], + pluginSidebar: [ + { + type: "category", + label: "Official Plugins", + items: [ + "plugins/official-plugins/overview", + { + type: "category", + label: "Rust Plugins", + collapsed: false, + items: [ + "plugins/official-plugins/react", + "plugins/official-plugins/sass", + "plugins/official-plugins/strip", + "plugins/official-plugins/dsv", + "plugins/official-plugins/yaml", + "plugins/official-plugins/virtual", + "plugins/official-plugins/react-components", + ], + }, + { + type: "category", + label: "Js Plugins", + collapsed: false, + items: [ + "plugins/official-plugins/js-postcss", + "plugins/official-plugins/js-less", + "plugins/official-plugins/js-sass", + "plugins/official-plugins/js-svgr", + "plugins/official-plugins/js-dts", + ], + }, + ], + }, + "plugins/community-plugins", + { + type: "category", + label: "Writing Plugins", + collapsed: false, + items: [ + "plugins/writing-plugins/overview", + "plugins/writing-plugins/rust-plugin", + "plugins/writing-plugins/js-plugin", + "plugins/writing-plugins/runtime-plugin", + ], + }, + ], +}; + +module.exports = sidebars; diff --git a/docs/src/components/Benchmark/ProgressBar.tsx b/docs/src/components/Benchmark/ProgressBar.tsx new file mode 100644 index 0000000000..5557c6d0f6 --- /dev/null +++ b/docs/src/components/Benchmark/ProgressBar.tsx @@ -0,0 +1,51 @@ +import React, { useState, useEffect } from "react"; +import { useSpring, animated } from "@react-spring/web"; +import styles from "./index.module.css"; + +export function formatTime(time: number, totalTime: number) { + if (totalTime < 1000) { + return `${time.toFixed(0)}ms`; + } else { + return `${(time / 1000).toFixed(2)}s`; + } +} + +export function ProgressBar({ value, max }) { + const [elapsedTime, setElapsedTime] = useState(0); + const TOTAL_TIME = value * 1000; + const isMobile = window.innerWidth < 768; + const progressBarWidth = isMobile ? 80 : 18; + const formattedTime = formatTime(elapsedTime, TOTAL_TIME); + const props = useSpring({ + width: "100%", + from: { width: "0%" }, + config: { + duration: TOTAL_TIME, + }, + onChange(data) { + setElapsedTime((parseFloat(data.value.width) / 100) * TOTAL_TIME); + }, + }); + + return ( +
+
+ +
+
+ {formattedTime} +
+
+ ); +} diff --git a/docs/src/components/Benchmark/index.module.css b/docs/src/components/Benchmark/index.module.css new file mode 100644 index 0000000000..6b3ab26bc6 --- /dev/null +++ b/docs/src/components/Benchmark/index.module.css @@ -0,0 +1,84 @@ +.progress-bar-container { + width: 50vw; + height: 35px; + border-radius: 4px; + padding: 2px 6px; + box-sizing: content-box; + border: 1px solid var(--farm--border); +} + +.progress-bar-inner-container { + height: 25px; + background: #9f1a8f; + border-radius: 2px; +} + +.progress-bar { + height: 100%; + background: linear-gradient(to right, rgb(192 38 211), #d2269e); + border-radius: 2px; +} + +.font-mono { + font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, + Bitstream Vera Sans Mono, Courier New, monospace; +} + +:global(.dark) { + .progress-bar-inner-container { + background: #fba; + } +} + +@media (max-width: 768px) { + .progress-bar-container, + .progress-bar-inner-container { + height: 30px; + } +} + +.main { + position: relative; + width: 200px; + height: 50px; + cursor: pointer; + border-radius: 5px; + border: 2px solid #272727; + overflow: hidden; +} + +.fill { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: hotpink; +} + +.content { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + color: #272727; +} + +.container { + display: flex; + align-items: center; + height: 100%; + justify-content: center; +} + +.tabs { + display: flex; + justify-content: center; + flex-direction: column; + align-items: center; + width: 100%; +} diff --git a/docs/src/components/Benchmark/index.tsx b/docs/src/components/Benchmark/index.tsx new file mode 100644 index 0000000000..7919615e40 --- /dev/null +++ b/docs/src/components/Benchmark/index.tsx @@ -0,0 +1,221 @@ +import { ProgressBar } from "./ProgressBar"; +import farmCard from "../Card"; +import { useInView } from "react-intersection-observer"; +import styles from "./index.module.css"; +import Translate from "@docusaurus/Translate"; +import Link from "@docusaurus/Link"; +import React, { useState, useMemo } from "react"; +import clsx from "clsx"; +import ShinyTextEx from "../MagicUi/shiny-text"; +const BENCHMARK_DATA = { + ColdStart: [ + { + name: "farm", + time: 0.396, + }, + { + name: "rsbuild", + time: 0.468, + }, + { + name: "vite", + time: 1.700, + }, + { + name: "webpack", + time: 2.078, + }, + ], + HotStart: [ + { + name: "farm", + time: 0.273, + }, + { + name: "rsbuild", + time: 0.468, + }, + { + name: "vite", + time: 1.426, + }, + { + name: "webpack", + time: 0.945, + }, + ], + HmrRoot: [ + { + name: "farm", + time: 0.018, + }, + { + name: "rsbuild", + time: 0.087, + }, + { + name: "vite", + time: 0.022, + }, + { + name: "webpack", + time: 0.532, + }, + ], + HmrLeaf: [ + { + name: "farm", + time: 0.013, + }, + { + name: "rsbuild", + time: 0.074, + }, + { + name: "vite", + time: 0.011, + }, + { + name: "webpack", + time: 0.165, + }, + ], + ColdBuild: [ + { + name: "farm", + time: 0.313, + }, + { + name: "rsbuild", + time: 0.363, + }, + { + name: "vite", + time: 1.543, + }, + { + name: "webpack", + time: 4.128, + }, + ], + HotBuild: [ + { + name: "farm", + time: 0.16, + }, + { + name: "rsbuild", + time: 0.363, + }, + { + name: "vite", + time: 1.540, + }, + { + name: "webpack", + time: 0.527, + }, + ], +}; +export default function Benchmark() { + const SCENE = [ + { name: ColdStart, title: "ColdStart" }, + { name: HotStart, title: "HotStart" }, + { name: HmrRoot, title: "HmrRoot" }, + { name: HmrLeaf, title: "HmrLeaf" }, + { name: ColdBuild, title: "ColdBuild" }, + { name: HotBuild, title: "HotBuild" }, + ]; + const [activeScene, setActiveScene] = useState("ColdStart"); + const { ref, inView } = useInView({ + triggerOnce: true, + threshold: 0.1, + }); + const performanceInfoList = useMemo(() => BENCHMARK_DATA[activeScene], [activeScene]); + + const [visibleSection, setVisibleSection] = useState("ColdStart"); + + function Pill({ section }) { + return ( +
+
{ + setVisibleSection(section.title); + setActiveScene(section.title); + }} + > + {section.name} +
+
+ ); + } + + function PillTabs({ SCENE, children }) { + return ( +
+
+ {SCENE.map((item, index) => { + return ; + })} +
+
{children}
+
+ ); + } + return ( + <> +
+ <> +
+
+
+ + {performanceInfoList.map((info) => ( +
+ {inView && ( + <> +
+ {info.name} +
+ info.time) + )} + /> + + )} +
+ ))} +
+
+ + {/* See benchmark details */} + + +
+
+
+
+ +
+ + ); +} diff --git a/docs/src/components/HomepageFeatures/index.js b/docs/src/components/HomepageFeatures/index.js new file mode 100644 index 0000000000..26227f1b86 --- /dev/null +++ b/docs/src/components/HomepageFeatures/index.js @@ -0,0 +1,144 @@ +import Translate, { translate } from "@docusaurus/Translate"; +import Box from "@site/static/img/box.png"; +import Compatibility from "@site/static/img/compatible.png"; +import Consistency from "@site/static/img/consistency.png"; +import FeaturePng from "@site/static/img/feature.png"; +import Plug from "@site/static/img/plug.png"; +// import Image from "@theme/IdealImage"; +import Rocket from "@site/static/img/rocket.png"; +import clsx from "clsx"; +import React from "react"; +import styles from "./styles.module.css"; +const FeatureList = [ + { + title: Extremely Fast, + Img: Rocket, + description: ( + + Written in Rust, start a React / Vue project in milliseconds and perform + an HMR update within 10ms for most situations. + + ), + className: + "w-full rounded-lg sm:block sm:col-span-2 md:col-span-1 lg:row-start-2 lg:col-span-2", + }, + { + title: Incremental Building, + Img: Box, + description: ( + + Incremental Building: Support persistent cache, module level cache + enabled by default, any module won't be compiled twice until it's + changed! + + ), + className: + "w-full rounded-lg sm:block sm:col-span-2 md:col-span-1 lg:row-start-2 lg:col-span-2", + }, + { + title: Rich Features, + Img: FeaturePng, + description: ( + + Farm supports compiling HTML, CSS, CSS Modules, Js/Jsx/Ts/Tsx, JSON, + Static Assets out of the box, supports Sass, Less, PostCSS, Vue, React, + Solid by way of official plugins, supports lazy compiling, partial + bundling and more + + ), + className: + "w-full rounded-lg sm:block sm:col-span-2 md:col-span-1 lg:row-start-2 lg:col-span-2", + }, + { + title: Fully Pluggable and Vite Compatible, + Img: Plug, + description: ( + + Everything inside Farm is powered by plugins, Supports both Rust and + JavaScript plugins. Support Vite plugins out of box. + + ), + className: + " w-full flex h-52 rounded-lg md:block lg:row-start-2 lg:col-span-2 lg:h-auto", + }, + { + title: Partial Bundling, + Img: Box, + description: ( + + Partial Bundling: Bundle your project into a few reasonable bundles, + speeding up resource loading without losing caching granularity. + + ), + className: + "w-full rounded-lg sm:block sm:col-span-2 md:col-span-1 lg:row-start-2 lg:col-span-2", + }, + { + title: Consistency and Compatibility, + Img: Compatibility, + description: ( + + What you see in development will be the same as what you get in + production. Supports both legacy (ES5) and modern browsers. + + ), + className: + " w-full flex h-52 rounded-lg md:block lg:row-start-2 lg:col-span-2 lg:h-auto", + }, +]; + +function Feature({ Img, title, description, className }) { + return ( +
+
+
+ +
+ +
+

{title}

+

{description}

+
+
+
+ ); +} + +export default function FeatureSection() { + return ( +
+
+
+ {FeatureList.map((feature, index) => ( + + ))} +
+
+
+ ); +} diff --git a/docs/src/components/HomepageFeatures/styles.module.css b/docs/src/components/HomepageFeatures/styles.module.css new file mode 100644 index 0000000000..4095a9414c --- /dev/null +++ b/docs/src/components/HomepageFeatures/styles.module.css @@ -0,0 +1,111 @@ +.features { + display: flex; + align-items: center; + padding: 2rem 0; + width: 100%; +} + +.item { + width: 100%; + margin: 0 auto; +} + +.card { + /* border: 3px solid #252529; */ + border-radius: 10px; + padding: 0 0.5rem; + padding-top: 2rem; + position: relative; + /* background: var(--ifm-background) !important; */ + background: var(--ifm-f-white-soft); + z-index: 0; + width: 100%; + background-image: radial-gradient( + rgba(255, 255, 255, 0.2) 8%, + transparent 8% + ); + background-position: 0% 0%; + background-size: 5vmin 5vmin; + position: relative; + transition: background-position 350ms ease; + z-index: 2; + box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px; +} + +.backgroundImage { + background: linear-gradient(-45deg, #e67ac6 50%, #47caff 50%); + border-radius: 50%; + filter: blur(36px); +} + +/*test card */ +.card-container { + cursor: pointer; + justify-content: center; + position: relative; +} + +.card-container:hover::before { + content: ""; + background: linear-gradient( + 45deg, + #7a00ff, + #9f1a8f, + #7a00ff, + #ff00c8, + #9f1a8f, + #7a00ff, + #ff00c8 + ); + position: absolute; + top: -2px; + left: -2px; + background-size: 400%; + z-index: -1000; + filter: blur(5px); + width: calc(100% + 4px); + height: calc(100% + 4px); + animation: glowing 16s linear infinite; + opacity: 1; + transition: opacity 0.3s ease-in-out; + border-radius: 10px; +} + +.card-container:after { + z-index: -1; + content: ""; + position: absolute; + width: 100%; + height: 100%; + background: var(--ifm-f-white-soft); + background-image: radial-gradient( + rgba(255, 255, 255, 0.2) 8%, + transparent 8% + ); + background-position: 0% 0%; + background-size: 5vmin 5vmin; + /* position: relative; */ + transition: background-position 350ms ease; + z-index: 100; + box-shadow: rgba(0, 0, 0, 0.16) 0px 1px 4px; + left: 0; + top: 0; + border-radius: 10px; +} +.card-container-content { + position: relative; + transition: background-position 350ms ease; + z-index: 1000; +} + +@keyframes glowing { + 0% { + background-position: 0 0; + } + 50% { + background-position: 400% 0; + } + 100% { + background-position: 0 0; + } +} diff --git a/docs/src/components/MagicUi/animated-beam.tsx b/docs/src/components/MagicUi/animated-beam.tsx new file mode 100644 index 0000000000..fb8bf7c8e2 --- /dev/null +++ b/docs/src/components/MagicUi/animated-beam.tsx @@ -0,0 +1,188 @@ +"use client"; + +import { RefObject, useEffect, useId, useState } from "react"; +import { motion } from "framer-motion"; + +import { cn } from "../../lib/utils"; + +export interface AnimatedBeamProps { + className?: string; + containerRef: RefObject; // Container ref + fromRef: RefObject; + toRef: RefObject; + curvature?: number; + reverse?: boolean; + pathColor?: string; + pathWidth?: number; + pathOpacity?: number; + gradientStartColor?: string; + gradientStopColor?: string; + delay?: number; + duration?: number; + startXOffset?: number; + startYOffset?: number; + endXOffset?: number; + endYOffset?: number; +} + +export const AnimatedBeam: React.FC = ({ + className, + containerRef, + fromRef, + toRef, + curvature = 0, + reverse = false, // Include the reverse prop + duration = Math.random() * 3 + 4, + delay = 0, + pathColor = "gray", + pathWidth = 2, + pathOpacity = 0.2, + gradientStartColor = "#ffaa40", + gradientStopColor = "#9c40ff", + startXOffset = 0, + startYOffset = 0, + endXOffset = 0, + endYOffset = 0, +}) => { + const id = useId(); + const [pathD, setPathD] = useState(""); + const [svgDimensions, setSvgDimensions] = useState({ width: 0, height: 0 }); + + // Calculate the gradient coordinates based on the reverse prop + const gradientCoordinates = reverse + ? { + x1: ["90%", "-10%"], + x2: ["100%", "0%"], + y1: ["0%", "0%"], + y2: ["0%", "0%"], + } + : { + x1: ["10%", "110%"], + x2: ["0%", "100%"], + y1: ["0%", "0%"], + y2: ["0%", "0%"], + }; + + useEffect(() => { + const updatePath = () => { + if (containerRef.current && fromRef.current && toRef.current) { + const containerRect = containerRef.current.getBoundingClientRect(); + const rectA = fromRef.current.getBoundingClientRect(); + const rectB = toRef.current.getBoundingClientRect(); + + const svgWidth = containerRect.width; + const svgHeight = containerRect.height; + setSvgDimensions({ width: svgWidth, height: svgHeight }); + + const startX = + rectA.left - containerRect.left + rectA.width / 2 + startXOffset; + const startY = + rectA.top - containerRect.top + rectA.height / 2 + startYOffset; + const endX = + rectB.left - containerRect.left + rectB.width / 2 + endXOffset; + const endY = + rectB.top - containerRect.top + rectB.height / 2 + endYOffset; + + const controlY = startY - curvature; + const d = `M ${startX},${startY} Q ${ + (startX + endX) / 2 + },${controlY} ${endX},${endY}`; + setPathD(d); + } + }; + + // Initialize ResizeObserver + const resizeObserver = new ResizeObserver((entries) => { + // For all entries, recalculate the path + for (let entry of entries) { + updatePath(); + } + }); + + // Observe the container element + if (containerRef.current) { + resizeObserver.observe(containerRef.current); + } + + // Call the updatePath initially to set the initial path + updatePath(); + + // Clean up the observer on component unmount + return () => { + resizeObserver.disconnect(); + }; + }, [ + containerRef, + fromRef, + toRef, + curvature, + startXOffset, + startYOffset, + endXOffset, + endYOffset, + ]); + + return ( + + + + + + + + + + + + + ); +}; diff --git a/docs/src/components/MagicUi/animated-shiny-text.tsx b/docs/src/components/MagicUi/animated-shiny-text.tsx new file mode 100644 index 0000000000..9732075b65 --- /dev/null +++ b/docs/src/components/MagicUi/animated-shiny-text.tsx @@ -0,0 +1,49 @@ +import { cn } from "../../lib/utils"; +import { ReactNode } from "react"; +import React from "react"; +import { ChevronRight, Github } from "lucide-react"; + +export function AnimatedGradientText({ + children, + className, +}: { + children: ReactNode; + className?: string; +}) { + return ( +
+
+ + {children} +
+ ); +} + +export default function AnimatedGradientStarWithGithub() { + return ( +
window.open("https://github.com/farm-fe/farm")} + className="z-10 flex min-h-[2rem] items-center justify-center cursor-pointer" + > + + ⭐️
{" "} + + Give Star with Farm Github + + + +
+
+ ); +} diff --git a/docs/src/components/MagicUi/blur-fade.tsx b/docs/src/components/MagicUi/blur-fade.tsx new file mode 100644 index 0000000000..8204c7f076 --- /dev/null +++ b/docs/src/components/MagicUi/blur-fade.tsx @@ -0,0 +1,59 @@ +"use client"; + +import { useRef } from "react"; +import { AnimatePresence, motion, useInView, Variants } from "framer-motion"; + +interface BlurFadeProps { + children: React.ReactNode; + className?: string; + variant?: { + hidden: { y: number }; + visible: { y: number }; + }; + duration?: number; + delay?: number; + yOffset?: number; + inView?: boolean; + inViewMargin?: string; + blur?: string; +} + +export default function BlurFade({ + children, + className, + variant, + duration = 0.4, + delay = 0, + yOffset = 6, + inView = false, + inViewMargin = "-50px", + blur = "6px", +}: BlurFadeProps) { + const ref = useRef(null); + const inViewResult = useInView(ref, { once: true, margin: inViewMargin }); + const isInView = !inView || inViewResult; + const defaultVariants: Variants = { + hidden: { y: yOffset, opacity: 0, filter: `blur(${blur})` }, + visible: { y: -yOffset, opacity: 1, filter: `blur(0px)` }, + }; + const combinedVariants = variant || defaultVariants; + return ( + + + {children} + + + ); +} diff --git a/docs/src/components/MagicUi/card.tsx b/docs/src/components/MagicUi/card.tsx new file mode 100644 index 0000000000..e93d8bcccb --- /dev/null +++ b/docs/src/components/MagicUi/card.tsx @@ -0,0 +1,276 @@ +"use client"; +import { cn } from "../../lib/utils"; +import React from "react"; +import { BentoGrid, BentoGridItem } from "../ui/bento-grid"; +import Translate from "@docusaurus/Translate"; +import Rocket from "@site/static/img/rocket.png"; +import Plug from "@site/static/img/plug.png"; +import FeaturePng from "@site/static/img/feature.png"; +import Box from "@site/static/img/box.png"; +import Compatibility from "@site/static/img/compatible.png"; +import Consistency from "@site/static/img/consistency.png"; +import { + IconBoxAlignRightFilled, + IconClipboardCopy, + IconFileBroken, + IconSignature, + IconTableColumn, +} from "@tabler/icons-react"; +import { motion } from "framer-motion"; +import { AnimatedBeamPig } from "../ui/beam"; + +export default function BentoGridCard() { + return ( + + {items.map((item, i) => ( + p:text-lg]", item.className)} + icon={item.icon} + /> + ))} + + ); +} + +const SkeletonOne = () => { + const variants = { + initial: { + x: 0, + y: 0, + opacity: 1, + }, + animate: { + x: [0, 12], + transition: { + duration: .2, // + ease: "easeInOut", // + }, + }, + }; + + return ( + + + + + + ); +}; +const SkeletonTwo = () => { + const variants = { + initial: { + x: 0, + y: 0, + opacity: 1, + }, + animate: { + x: [0, 12], + transition: { + duration: .2, // + ease: "easeInOut", // + }, + }, + }; + + return ( + + + + + + ); +}; +const SkeletonThree = () => { + const variants = { + initial: { + x: 0, + y: 0, + opacity: 1, + }, + animate: { + x: [0, 12], + transition: { + duration: .2, // + ease: "easeInOut", // + }, + }, + }; + + return ( + + + + + + ); +}; +const SkeletonFour = () => { + const variants = { + initial: { + x: 0, + y: 0, + opacity: 1, + }, + animate: { + x: [0, 12], + transition: { + duration: .2, // + ease: "easeInOut", // + }, + }, + }; + + return ( + + + + ); +}; +const SkeletonFive = () => { + const variants = { + initial: { + x: 0, + y: 0, + opacity: 1, + }, + animate: { + x: [0, 12], + transition: { + duration: .2, // + ease: "easeInOut", // + }, + }, + }; + + return ( + + + + + + ); +}; +const items = [ + { + title: Extremely Fast, + description: ( + + + Written in Rust, start a React / Vue project in milliseconds and perform an HMR update within 10ms for most situations. + + + ), + header: , + className: "md:col-span-1", + icon: , + }, + { + title: Incremental Building, + description: ( + + + Incremental Building: Support persistent cache, module level cache + enabled by default, any module won't be compiled twice until it's + changed! + + + ), + header: , + className: "md:col-span-1", + icon: , + }, + { + title: Partial Bundling, + description: ( + + + Partial Bundling: Bundle your project into a few reasonable bundles, + speeding up resource loading without losing caching granularity. + + + ), + header: , + className: "md:col-span-1", + icon: , + }, + { + title: Rich Features and Fully Pluggable, + description: ( + + + Farm supports compiling HTML, CSS, CSS Modules, Js/Jsx/Ts/Tsx, JSON, Static Assets out of the box, supports Sass, Less, PostCSS, Vue, React, Solid by way of official plugins, supports lazy compiling, partial bundling and more. Everything inside Farm is powered by plugins, Supports both Rust and JavaScript plugins. Support Vite plugins out of box. + + + ), + header: , + className: "md:col-span-2", + icon: , + }, + + { + title: Consistency and Compatibility, + description: ( + + + What you see in development will be the same as what you get in + production. Supports both legacy (ES5) and modern browsers. + + + ), + header: , + className: "md:col-span-1", + icon: , + }, +]; diff --git a/docs/src/components/MagicUi/neon-gradient-card.tsx b/docs/src/components/MagicUi/neon-gradient-card.tsx new file mode 100644 index 0000000000..4f8cec0899 --- /dev/null +++ b/docs/src/components/MagicUi/neon-gradient-card.tsx @@ -0,0 +1,110 @@ +"use client"; + +import { cn } from "../../lib/utils"; +import React, { CSSProperties, ReactNode, useEffect, useRef, useState, useMemo } from "react"; + +interface NeonColorsProps { + firstColor: string; + secondColor: string; + thirdColor: string; +} + +interface NeonGradientCardProps { + className?: string; + children?: ReactNode; + borderSize?: number; + borderRadius?: number; + neonColors?: NeonColorsProps; + height?: string; + [key: string]: any; +} + +const DEFAULT_NEON_COLORS: NeonColorsProps = { + firstColor: "#ffaa40", + secondColor: "#9c40ff", + thirdColor: "#00FFF1", +}; + +const NeonGradientCard: React.FC = React.memo(({ + className, + children, + borderSize = 0, + borderRadius = 20, + height = '26rem', + neonColors = DEFAULT_NEON_COLORS, + ...props +}) => { + const containerRef = useRef(null); + const [dimensions, setDimensions] = useState({ width: 0, height: 0 }); + const childrenRef = useRef(children); + + const updateDimensions = () => { + if (containerRef.current) { + const { offsetWidth, offsetHeight } = containerRef.current; + setDimensions({ width: offsetWidth, height: offsetHeight }); + } + }; + + useEffect(() => { + updateDimensions(); + window.addEventListener("resize", updateDimensions); + return () => window.removeEventListener("resize", updateDimensions); + }, []); + + useEffect(() => { + if (childrenRef.current !== children) { + childrenRef.current = children; + updateDimensions(); + } + }, [children]); + + const cardStyle = useMemo(() => { + return { + "--border-size": `${borderSize}px`, + "--border-radius": `${borderRadius}px`, + "--neon-first-color": neonColors.firstColor, + "--neon-second-color": neonColors.secondColor, + "--neon-third-color": neonColors.thirdColor, + "--card-width": `${dimensions.width}px`, + "--card-height": `${dimensions.height}px`, + "--card-content-radius": `${borderRadius - borderSize}px`, + "--pseudo-element-background-image": `linear-gradient(0deg, ${neonColors.firstColor}, ${neonColors.secondColor}, ${neonColors.thirdColor})`, + "--pseudo-element-width": `${dimensions.width + borderSize * 2}px`, + "--pseudo-element-height": height, + "--after-blur": `${dimensions.width / 3}px`, + } as CSSProperties; + }, [borderSize, borderRadius, neonColors, dimensions, height]); + + return ( +
+
+ {children} +
+
+ ); +}); + +export default NeonGradientCard; diff --git a/docs/src/components/MagicUi/shiny-text.tsx b/docs/src/components/MagicUi/shiny-text.tsx new file mode 100644 index 0000000000..0c1d6f178b --- /dev/null +++ b/docs/src/components/MagicUi/shiny-text.tsx @@ -0,0 +1,56 @@ +import { ArrowRightIcon } from "lucide-react"; +import { cn } from "../../lib/utils"; +import { CSSProperties, FC, ReactNode } from "react"; + +interface AnimatedShinyTextProps { + children: ReactNode; + className?: string; + shimmerWidth?: number; +} + +const ShinyText: FC = ({ + children, + className, + shimmerWidth = 100, +}) => { + return ( +
+ {children} +
+ ); +}; + + +export default function ShinyTextEx() { + return ( +
+
+ + 📈 See Benchmark Details + + +
+
+ ); +} diff --git a/docs/src/components/StarrySky/index.css b/docs/src/components/StarrySky/index.css new file mode 100644 index 0000000000..6ca69f1230 --- /dev/null +++ b/docs/src/components/StarrySky/index.css @@ -0,0 +1,39 @@ +@import url("https://rsms.me/inter/inter.css"); + +canvas { + margin: 0; + padding: 0; + width: 100%; + height: 100%; +} + +h1 { + inherit: unset; +} + +.layer { + position: absolute; + bottom: 0; + left: 0; + width: 100%; + height: 100%; + /* background: linear-gradient( + 0deg, + rgba(63, 12, 88, 0.25) 0%, + transparent 100% + ); */ + pointer-events: none; +} + +span.header { + font-weight: 700; + position: absolute; + display: inline-block; + width: 500px; + transform: translate3d(0, -50%, 0); + font-size: 9em; + line-height: 0.9em; + pointer-events: none; + top: 350px; + left: 50px; +} diff --git a/docs/src/components/StarrySky/index.js b/docs/src/components/StarrySky/index.js new file mode 100644 index 0000000000..14f85ea475 --- /dev/null +++ b/docs/src/components/StarrySky/index.js @@ -0,0 +1,95 @@ +import { + Environment, + Loader, + OrbitControls, + PerspectiveCamera, + Stars, + useGLTF, +} from "@react-three/drei"; +import { Canvas, primitive, useLoader } from "@react-three/fiber"; +import React, { Suspense, useRef } from "react"; +import * as THREE from "three"; +import { GLTFLoader } from "three/examples/jsm/loaders/GLTFLoader"; + +import "./index.css"; + +function Model({ url }) { + const { nodes, materials } = useGLTF(url); + const model = useLoader(GLTFLoader, "/test.glb"); + + return ; +} + +export default function App() { + const starMaterial = new THREE.PointsMaterial({ + color: "rgb(255, 255, 0)", // 星星的颜色 + size: 0.1, // 星星的大小 + }); + + const particleCount = 100; + const particleGeometry = new THREE.BufferGeometry(); + const particleMaterial = new THREE.PointsMaterial({ + color: "white", + size: 0.1, + }); + const particlePositions = new Float32Array(particleCount * 3); + + for (let i = 0; i < particleCount; i++) { + const x = Math.random() * 100 - 50; + const y = Math.random() * 100 - 50; + const z = Math.random() * 100 - 50; + particlePositions[i * 3] = x; + particlePositions[i * 3 + 1] = y; + particlePositions[i * 3 + 2] = z; + } + + particleGeometry.setAttribute( + "position", + new THREE.BufferAttribute(particlePositions, 3) + ); + const particleSystem = useRef(); + return ( + <> + + + + + + + + {/* + + */} + + {/* */} + + +
+ + + ); +} diff --git a/docs/src/components/TeamMembers/index.module.css b/docs/src/components/TeamMembers/index.module.css new file mode 100644 index 0000000000..f0c6cc2d86 --- /dev/null +++ b/docs/src/components/TeamMembers/index.module.css @@ -0,0 +1,25 @@ +.teamMembers .container { + grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); +} + +@media (min-width: 375px) { + .teamMembers .container { + grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); + } +} + +.banner { + background: linear-gradient(45deg, rgb(113, 26, 95), #fda7df 70%); + background-clip: text; + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + color: transparent; +} + +.container { + width: 100%; + display: grid; + gap: 40px; + margin: 0 auto; + width: 100%; +} diff --git a/docs/src/components/TeamMembers/index.tsx b/docs/src/components/TeamMembers/index.tsx new file mode 100644 index 0000000000..7bf9963d17 --- /dev/null +++ b/docs/src/components/TeamMembers/index.tsx @@ -0,0 +1,35 @@ +import React from "react"; +import clsx from "clsx"; +import Link from "@docusaurus/Link"; +import Translate from "@docusaurus/Translate"; +import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; +import styles from "./index.module.css"; +import FarmCard from "../card"; +import TeamMembersItem from "../TeamMembersItem"; + +export function TeamMembers(props) { + const { members, size } = props; + const { siteConfig } = useDocusaurusContext(); + const classes = clsx(styles.teamMembers, "small my-10"); + return ( +
+
+ Get to know our team +
+
+ {members.map((member) => ( +
+ + + +
+ ))} +
+
+ ); +} diff --git a/docs/src/components/TeamMembersItem/index.module.css b/docs/src/components/TeamMembersItem/index.module.css new file mode 100644 index 0000000000..302b9ee171 --- /dev/null +++ b/docs/src/components/TeamMembersItem/index.module.css @@ -0,0 +1,130 @@ +.teamMembersItem { + display: flex; + flex-direction: column; + gap: 2px; + border-radius: 12px; + width: 100%; + height: 100%; + overflow: hidden; +} + +.teamMembersItem .profile { + padding: 10px; +} + +.teamMembersItem .avatar { + width: 64px; + height: 64px; + cursor: pointer; + transition: all 0.2s ease-in-out; +} + +.teamMembersItem .name { + line-height: 24px; + font-size: 16px; +} + +.teamMembersItem .org { + line-height: 24px; + font-size: 14px; +} + +.teamMembersItem .affiliation { + padding-top: 4px; + line-height: 20px; + font-size: 14px; +} + +.teamMembersItem .desc { + padding-top: 12px; + line-height: 20px; + font-size: 14px; +} + +.teamMembersItem .links { + margin: 0 -16px -20px; + padding: 10px 0 0; +} + +.profile { + flex-grow: 1; + display: flex; + flex-direction: column; + align-items: center; + gap: 20px; +} + +.data { + text-align: center; +} + +.avatar { + position: relative; + flex-shrink: 0; + margin: 0 auto; + border-radius: 50%; +} + +.avatar-img { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + border-radius: 50%; + object-fit: cover; +} + +.name { + margin: 0; + font-weight: 600; +} + +.affiliation { + margin: 0; + font-weight: 500; +} + +.org.link { + transition: color 0.25s; +} + +.desc { + margin: 0 auto; +} + +.desc :deep(a) { + font-weight: 500; + text-decoration-style: dotted; + transition: color 0.25s; +} + +.links { + display: flex; + justify-content: center; + height: 56px; +} + +.sp-link { + display: flex; + justify-content: center; + align-items: center; + text-align: center; + padding: 16px; + font-size: 14px; + font-weight: 500; + background-color: var(--ifm-f-white); + transition: color 0.25s, background-color 0.25s; +} + +.sp .sp-link.link:hover, +.sp .sp-link.link:focus { + outline: none; +} + +.sp-icon { + margin-right: 8px; + width: 16px; + height: 16px; + fill: currentColor; +} diff --git a/docs/src/components/TeamMembersItem/index.tsx b/docs/src/components/TeamMembersItem/index.tsx new file mode 100644 index 0000000000..64f24f8c95 --- /dev/null +++ b/docs/src/components/TeamMembersItem/index.tsx @@ -0,0 +1,29 @@ +import React from "react"; +import clsx from "clsx"; +import Link from "@docusaurus/Link"; +import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; +import styles from "./index.module.css"; + +export default function TeamMembersItem({ member }) { + return ( +
+
+
window.open(member.orgLink, "_blank")} + > + {member.name} +
+
+

{member.name}

+

{member.org}

+ {member.desc ?

{member.desc}

: null} +
+
+
+ ); +} diff --git a/docs/src/components/card/index.module.css b/docs/src/components/card/index.module.css new file mode 100644 index 0000000000..3e1b673cb7 --- /dev/null +++ b/docs/src/components/card/index.module.css @@ -0,0 +1,16 @@ +.card-main { + width: 100%; + height: 100%; + display: flex; + align-items: center; + justify-content: center; + overflow: hidden; +} + +.card { + /* width: 20ch; */ + /* height: 20ch; */ + border-radius: 8px; + transition: box-shadow 0.5s; + will-change: transform; +} diff --git a/docs/src/components/card/index.tsx b/docs/src/components/card/index.tsx new file mode 100644 index 0000000000..92a5b9ec5e --- /dev/null +++ b/docs/src/components/card/index.tsx @@ -0,0 +1,52 @@ +import React, { useRef, useState } from "react"; +import { useSpring, animated } from "@react-spring/web"; +import { useControls } from "leva"; +import styled from "./index.module.css"; + +export default function Card(props) { + const cardRef = useRef(null); + const config = useControls({ + // mass: 1, + // tension: 170, + // friction: 26, + // clamp: false, + // precision: 0.01, + // velocity: 0, + }); + + const [{ xys }, api] = useSpring(() => ({ xys: [0, 0, 1] }), [config]); + + const handleMouseLeave = () => + api.start({ + xys: [0, 0, 1], + }); + + const handleMouseMove = (e) => { + const rect = cardRef.current.getBoundingClientRect(); + api.start({ + xys: calc(e.clientX / 1.2, e.clientY / 1.2, rect), + }); + }; + + return ( +
+ + {props.children} + +
+ ); +} + +const calc = (x, y, rect) => [ + -(y - rect.top - rect.height / 40) / 8, + (x - rect.left - rect.width / 40) / 8, + 1.4, +]; + +const trans = (x, y, s) => + `perspective(600px) rotateX(${x}deg) rotateY(${y}deg) scale(${s})`; diff --git a/docs/src/components/ui/aurora-back.tsx b/docs/src/components/ui/aurora-back.tsx new file mode 100644 index 0000000000..40aad66a18 --- /dev/null +++ b/docs/src/components/ui/aurora-back.tsx @@ -0,0 +1,52 @@ +"use client"; +import { cn } from "../../lib/utils"; +import React, { ReactNode } from "react"; + +interface AuroraBackgroundProps extends React.HTMLProps { + showRadialGradient?: boolean; + className?: string; +} + +export const AuroraBackground = ({ + className, + showRadialGradient = true, + ...props +}: AuroraBackgroundProps) => { + return ( +
+
+
+
+
+
+
+ ); +}; diff --git a/docs/src/components/ui/beam.tsx b/docs/src/components/ui/beam.tsx new file mode 100644 index 0000000000..219e1058b5 --- /dev/null +++ b/docs/src/components/ui/beam.tsx @@ -0,0 +1,139 @@ +"use client"; + +import React, { forwardRef, useRef } from "react"; + +import { cn } from "../../lib/utils"; +import { AnimatedBeam } from "../MagicUi/animated-beam"; + +const Circle = forwardRef< + HTMLDivElement, + { className?: string; children?: React.ReactNode } +>(({ className, children }, ref) => { + return ( +
+ {children} +
+ ); +}); + +Circle.displayName = "Circle"; + +export function AnimatedBeamPig() { + const containerRef = useRef(null); + const div1Ref = useRef(null); + const div2Ref = useRef(null); + const div3Ref = useRef(null); + const div4Ref = useRef(null); + const div5Ref = useRef(null); + const div6Ref = useRef(null); + const div7Ref = useRef(null); + + return ( +
+
+
+ + + + + + +
+
+ + + + + + + + + +
+
+ + + + + + +
+
+ + + + + + + +
+ ); +} + +const Icons = { + notion: () => ( + + ), + openai: () => ( + + ), + googleDrive: () => ( + + ), + whatsapp: () => ( + + ), + googleDocs: () => ( + + ), + zapier: () => ( + + ), + messenger: () => ( + + ), +}; diff --git a/docs/src/components/ui/bento-grid.tsx b/docs/src/components/ui/bento-grid.tsx new file mode 100644 index 0000000000..7251f27e6f --- /dev/null +++ b/docs/src/components/ui/bento-grid.tsx @@ -0,0 +1,56 @@ +import { cn } from "../../lib/utils"; +import React from 'react' + +export const BentoGrid = ({ + className, + children, +}: { + className?: string; + children?: React.ReactNode; +}) => { + return ( +
+ {children} +
+ ); +}; + +export const BentoGridItem = ({ + className, + title, + description, + header, + icon, +}: { + className?: string; + title?: string | React.ReactNode; + description?: string | React.ReactNode; + header?: React.ReactNode; + icon?: React.ReactNode; +}) => { + return ( +
+ {header} +
+ {icon} +
+ {title} +
+
+ {description} +
+
+
+ ); +}; diff --git a/docs/src/components/ui/timeline.tsx b/docs/src/components/ui/timeline.tsx new file mode 100644 index 0000000000..55d7c4bcd1 --- /dev/null +++ b/docs/src/components/ui/timeline.tsx @@ -0,0 +1,81 @@ +"use client"; +import { + useMotionValueEvent, + useScroll, + useTransform, + motion, +} from "framer-motion"; +import React, { useEffect, useRef, useState } from "react"; + +interface TimelineEntry { + title: string; + content: React.ReactNode; +} + +export const Timeline = ({ data }: { data: TimelineEntry[] }) => { + const ref = useRef(null); + const containerRef = useRef(null); + const [height, setHeight] = useState(0); + + useEffect(() => { + if (ref.current) { + const rect = ref.current.getBoundingClientRect(); + setHeight(rect.height); + } + }, [ref]); + + const { scrollYProgress } = useScroll({ + target: containerRef, + offset: ["start 10%", "end 50%"], + }); + + const heightTransform = useTransform(scrollYProgress, [0, 1], [0, height]); + const opacityTransform = useTransform(scrollYProgress, [0, 0.1], [0, 1]); + + return ( +
+ +
+ {data.map((item, index) => ( +
+
+
+
+
+

+ {item.title} +

+
+ +
+

+ {item.title} +

+ {item.content}{" "} +
+
+ ))} +
+ +
+
+
+ ); +}; diff --git a/docs/src/css/_admonition.scss b/docs/src/css/_admonition.scss new file mode 100644 index 0000000000..511f9d7f95 --- /dev/null +++ b/docs/src/css/_admonition.scss @@ -0,0 +1,150 @@ +html[data-theme="light"] { + --admonition-color: #404040; + + --admonition-note-border-color: #60a5fa4d !important; + --admonition-note-c-bg: #bfdbfe66 !important; + + --admonition-tip-border-color: #4ade804d !important; + --admonition-tip-c-bg: #bbf7d066 !important; + + --admonition-warning-border-color: #fbbf244d !important; + --admonition-warning-c-bg: #fde68a4d !important; + + --admonition-important-border-color: #a78bfa4d !important; + --admonition-important-c-bg: #ddd6fe80 !important; + + --admonition-danger-border-color: #f871714d !important; + --admonition-danger-c-bg: #fecaca66 !important; + + --admonition-info-c-color: inherit; + --admonition-tip-c-color: inherit; + --admonition-warning-c-color: inherit; + --admonition-caution-c-color: inherit; + --admonition-danger-c-color: inherit; +} + +html[data-theme="dark"] { + --admonition-color: rgb(var(--color-gray-300) / var(--tw-text-opacity)); + + --admonition-note-border-color: #2563eb4d !important; + --admonition-note-c-bg: #1e40af66 !important; + + --admonition-tip-border-color: #16a34a4d !important; + --admonition-tip-c-bg: #16653466 !important; + + --admonition-warning-border-color: #92400e66 !important; + --admonition-warning-c-bg: #92400e66 !important; + + --admonition-important-border-color: #7c3aed4d !important; + --admonition-important-c-bg: #5b21b64d !important; + + --admonition-danger-border-color: #dc26264d !important; + --admonition-danger-c-bg: #991b1b66 !important; + + --admonition-note-c-color: #ff9ff3; + --admonition-info-c-color: var(--c-blue-50); + --admonition-tip-c-color: var(--c-green-50); + --admonition-warning-c-color: var(--c-yellow-50); + --admonition-caution-c-color: var(--c-orange-50); + --admonition-danger-c-color: var(--c-red-50); + + --ifm-alert-tip-background-color: var(--c-green-50-a); + --admonition-code-note-c-bg: #ff9ff350; + --admonition-code-warning-c-bg: var(--c-yellow-50-a); + --admonition-code-info-c-bg: #00163d; + --admonition-code-tip-c-bg: #003d11; + --admonition-code-caution-c-bg: #3d1200; + --admonition-code-danger-c-bg: #3d0003; + --ifm-alert-warning-background-color: var(--c-yellow-30-a); +} + +:root { + --admonition-bar-note-c-bg: var(--c-yellow-80); + --admonition-bar-info-c-bg: var(--c-blue-80); + --admonition-bar-tip-c-bg: var(--c-green-80); + --admonition-bar-caution-c-bg: var(--c-orange-80); + --admonition-bar-danger-c-bg: var(--c-red-60); + + --admonition-link-note-c: var(--c-brand); + --admonition-link-info-c: var(--c-teal-90); + --admonition-link-tip-c: var(--c-green-60); + --admonition-color-tip-c: var(--note-color); + --admonition-color-note-c: var(--note-color); + --admonition-link-caution-c: var(--c-orange-90); + --admonition-link-danger-c: var(--c-red-60); +} + +.theme-admonition { + position: relative; + border: none; + + --ifm-alert-color: var(--ifm-font-color-base); + --ifm-alert-padding-horizontal: 1.5rem; + --ifm-alert-padding-vertical: 1rem; + + [class^="admonitionHeading_"] { + text-transform: capitalize; + + font-size: 1rem; + line-height: 1.6; + + [class^="admonitionIcon_"] { + display: none; + } + } + + [class^="admonitionContent_"] { + p { + a { + color: var(--admonition-link-c); + text-decoration: underline; + } + + code { + background: var(--admonition-code-c-bg); + } + } + } + + &-note { + border: 1px solid var(--admonition-note-border-color); + background: var(--admonition-note-c-bg); + color: var(--admonition-color); + } + + &-tip { + border: 1px solid var(--admonition-tip-border-color); + background: var(--admonition-tip-c-bg); + color: var(--admonition-color); + } + + &-info { + border: 1px solid var(--admonition-note-border-color); + background: var(--admonition-note-c-bg); + color: var(--admonition-color); + } + + &-warning { + border: 1px solid var(--admonition-warning-border-color); + background: var(--admonition-warning-c-bg); + color: var(--admonition-color); + } + + &-caution { + border: 1px solid var(--admonition-important-border-color); + background: var(--admonition-important-c-bg); + color: var(--admonition-color); + } + + &-danger { + border: 1px solid var(--admonition-danger-border-color); + background: var(--admonition-danger-c-bg); + color: var(--admonition-color); + } + + &-important { + border: 1px solid var(--admonition-important-border-color); + background: var(--admonition-important-c-bg); + color: var(--admonition-color); + } +} diff --git a/docs/src/css/_doc.siderbar.scss b/docs/src/css/_doc.siderbar.scss new file mode 100644 index 0000000000..15c86b5cc6 --- /dev/null +++ b/docs/src/css/_doc.siderbar.scss @@ -0,0 +1,217 @@ +html[data-theme="light"] { + --sidebar-category-c: var(--c-gray-100); + --sidebar-border-c: var(--c-gray-0); + --ifm-menu-color-active: var(--ifm-color-primary-text); + --ifm-menu-color-background-active: #ff9ff330; + --ifm-menu-color: var(--c-indigo-80); +} + +html[data-theme="dark"] { + --sidebar-category-c: var(--c-gray-0); + --sidebar-border-c: var(--c-gray-90); + --ifm-menu-color-active: var(--ifm-color-primary-text); + --ifm-menu-color: var(--c-gray-20); +} + +:root { + --doc-sidebar-width: 17.5rem; + + --dropdown-icon-width: 0.625rem; + --dropdown-icon-height: 0.375rem; + --dropdown-icon-gap: 0.688rem; + + --ifm-menu-link-padding-vertical: 0.5rem; + + --sidebar-spacing-horizontal: 1.5rem; + + // The variable aims to style the collapsible menu items on the sidebar. + --ifm-menu-color-background-hover: transparent; +} + +@media screen and (min-width: 1140px) { + [class^="docRoot_"] { + width: 1440px !important; + } + + [class^="docsWrapper_"] { + display: flex; + justify-content: center; + } +} + +//overrides +#__docusaurus { + .theme-doc-sidebar-container { + background: var(--token-primary-bg-c); + + position: sticky; + top: 60px; + bottom: 0; + margin-block-start: 0; + will-change: initial; + + height: calc(100vh - 60px); + + border-inline-end: 1px solid var(--sidebar-border-c); + + [class^="sidebarViewport"] { + // Targets the logo + > a { + display: flex; + align-items: center; + height: var(--ifm-navbar-height); + + padding-inline-start: var(--sidebar-spacing-horizontal); + padding-inline-end: var(--sidebar-spacing-horizontal); + } + } + } + + [class^="sidebar_"] { + max-height: 100vh; + position: static; + + overflow-y: auto; + + padding-inline-start: var(--sidebar-spacing-horizontal); + padding-inline-end: var(--sidebar-spacing-horizontal); + padding-block-start: 1rem; + + > .menu { + overflow-x: initial; + padding-block-end: 2rem; + padding: 0; + } + } + + [class^="sidebarLogo"] { + display: none !important; + } + + .theme-doc-sidebar-item-category-level-1 > .menu__list { + /* removes indentation from first level categories */ + padding: 0; + } + + .menu__list { + // display: block !important; + transition: height 0.35s cubic-bezier(0.36, 0.66, 0.04, 1) 25ms !important; + will-change: initial !important; + + // margin-top: 10px; + + .menu__list { + .menu__link--sublist { + margin-inline-start: calc( + -1 * (var(--dropdown-icon-width) + var(--dropdown-icon-gap)) + ); + + &::after { + // The chevron icon will have less opacity when it's not on the first level. + opacity: 0.6; + } + } + } + + &-item { + &.theme-doc-sidebar-item-link-level-1 { + padding-inline-start: calc(var(--dropdown-icon-width)); + + & > .menu__link { + font-weight: 500; + font-size: 14px; + color: var(--sidebar-category-c); + } + } + &:not(:first-child) { + margin-block-start: 0; + } + .menu__list { + .menu__link { + padding-inline-start: calc( + var(--dropdown-icon-width) + var(--dropdown-icon-gap) + ); + } + } + &-collapsible { + // This allows the item to be clickable across the entire width of the sidebar. + display: block; + } + } + } + + .theme-doc-sidebar-item-category-level-1 + > .menu__list + > .menu__list-item:last-of-type { + padding-block-end: 0.5rem; + } + + .theme-doc-sidebar-item-category-level-1:last-of-type { + margin-block-end: 0.5rem; + } + + .menu__link { + font-weight: 500; + font-size: 0.85rem; + line-height: 16px; + /* identical to box height */ + + display: flex; + align-items: center; + letter-spacing: -0.01em; + + transition: opacity 0.2s ease-out; + + &:not(.menu__link--active:not(.menu__link--sublist)) { + background: initial; + } + + &:not(.menu__link--active):not(.menu__link--sublist) { + &:hover, + &:active, + &:focus { + opacity: 0.7; + } + } + } + + .menu__link--sublist { + padding-inline-start: 0; + padding-inline-end: 0; + + margin-block-end: 0; + + display: flex; + align-items: center; + flex-direction: row-reverse; + justify-content: flex-end; + + &::after { + background: var(--ifm-menu-link-sublist-icon) center / + var(--dropdown-icon-width) var(--dropdown-icon-height); + background-repeat: no-repeat; + + min-width: auto; + + width: var(--dropdown-icon-width); + height: var(--dropdown-icon-height); + + margin-inline-end: var(--dropdown-icon-gap); + margin-block-end: 0; + + margin-inline-start: unset; + } + } + + .theme-doc-sidebar-item-category-level-1 { + & > .menu__list-item-collapsible { + .menu__link { + color: var(--sidebar-category-c); + + font-weight: 600; + font-size: 0.938rem; + line-height: 100%; + } + } + } +} diff --git a/docs/src/css/custom.scss b/docs/src/css/custom.scss new file mode 100644 index 0000000000..f38cb4111e --- /dev/null +++ b/docs/src/css/custom.scss @@ -0,0 +1,390 @@ +@use "./doc.siderbar"; +@use "./admonition"; +@use "./token.css"; + +@tailwind components; +@tailwind base; +@tailwind utilities; +/** + * Any CSS included here will be global. The classic template + * bundles Infima by default. Infima is a CSS framework designed to + * work well for content-centric websites. + */ + +/* You can override the default Infima variables here. */ +:root { + --sans-serif: -apple-system, BlinkMacSystemFont, san-francisco, Avenir Next, + Segoe UI, Roboto, Noto Sans, Helvetica Neue; + --serif: Iowan Old Style, Apple Garamond, Baskerville, Times New Roman; + --monospaced: Menlo; + --border: rgb(3, 169, 244); + --code-block: #fff; + --g1: rgba(0, 0, 0, 0.2); + --g2: rgba(143, 26, 127, 0.2); + --g3: rgba(31, 31, 31, 0.2); + --ifm-color-primary: #8f1a7f; + --ifm-color-primary-dark: #6f1a5f; + --ifm-color-primary-text: #6f1a5f; + --ifm-color-primary-darker: #5f1a4f; + --ifm-color-primary-darkest: #4f1a3f; + --ifm-color-primary-light: #9f1a8f; + --ifm-color-primary-lighter: #af1a9f; + --ifm-color-primary-lightest: #bf1aaf; + --ifm-code-font-size: 95%; + --ifm-border-color: rgba(0, 0, 0, 0.05); + --ifm-background: rgba(0, 0, 0, 0.01); + --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1); + --ifm-announcementBar-height: 40px; + --ifm-primary-hue-saturation: 308 78%; + --ifm-primary-hue-saturation-light: 308 78%; + --accent: 113, 26, 95; + --accent-background-card-gradient: linear-gradient( + 45deg, + rgb(var(--accent)), + #fda7df 10%, + var(--ifm-f-white) 40% + ); + --ifm-footer-background-color: #181818; + --ifm-f-white: #ffffff; + --ifm-f-re-white: #181818; + --ifm-f-white-soft: #f8f8f8; + --ifm-f-white-soft2: #fff; + --ifm-f-white-mute: #f2f2f2; + --ifm-f-bg-soft: #f6f6f7; + --farm--border: rgba(86, 86, 86, 0.125); + --docsearch-searchbox-background: rgba(143, 26, 127, 0.7); + --max-layout-width: 1680px; + --ifm-navbar-link-hover-color: initial; + --ifm-navbar-padding-vertical: 0; + --ifm-navbar-item-padding-vertical: 0; + --ifm-color-soft: rgb(82 82 82 / var(--tw-text-opacity)); + + --ifm-font-family-base: -apple-system, BlinkMacSystemFont, Inter, Helvetica, + Arial, sans-serif, "Apple Color Emoji", "Segoe UI emoji"; + --ifm-font-family-monospace: "SFMono-Regular", "Roboto Mono", Consolas, + "Liberation Mono", Menlo, Courier, monospace; + + --ifm-menu-link-sublist-icon: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAiIGhlaWdodD0iNiIgdmlld0JveD0iMCAwIDEwIDYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxwYXRoIGQ9Ik04Ljk5OTg4IDVMNC45OTk4OCAxTDAuOTk5ODc4IDUiIHN0cm9rZT0iIzAzMDYwQiIgc3Ryb2tlLXdpZHRoPSIxLjUiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K"); + + --z-sidebar: 2000; + --z-backdrop: 1100; + --ifm-menu-color-background-active: #ff9ff330; + --ifm-menu-color-background: #ff9ff310; + --docusaurus-highlighted-code-line-bg: #ff9ff310; +} + +[date-theme="light"] { + --code-block: #fff; + --ui-background: #fff; + --background: rgb(var(--ui-background) / var(--tw-bg-opacity)); +} + +/* For readability concerns, you should choose a lighter palette in dark mode. */ +[data-theme="dark"] { + --code-border-color: #fff; + --code-block: rgb(25, 25, 25); + --ui-background: #181818; + --background: rgb(var(--ui-background) / var(--tw-bg-opacity)); + --ifm-color-soft: rgb(82 82 82 / var(--tw-text-opacity)); + --ifm-f-bg-soft: #252529; + --ifm-background-color: #000 !important; + --ifm-color-primary: #fff; + --ifm-color-primary-text: #fff; + --ifm-color-primary-dark: #21af90; + --ifm-color-primary-darker: #1fa588; + --ifm-color-primary-darkest: #1a8870; + --ifm-color-primary-light: #29d5b0; + --ifm-color-primary-lighter: #32d8b4; + --ifm-color-primary-lightest: #4fddbf; + --ifm-menu-color-background-active: #ff9ff330; + --ifm-menu-color-background: #ff9ff340; + --ifm-background: rgba(0, 0, 0, 0.3); + --ifm-f-white: #c74040; + --ifm-f-re-white: #ffffff; + --ifm-f-white-soft: #222222; + --ifm-f-white-soft2: #111; + --ifm-f-white-mute: #282828; + --ifm-footer-background-color: #181818; + --farm--border: #fafafa20; + --docusaurus-highlighted-code-line-bg: rgba(143, 26, 127, 0.7); + --docsearch-primary-color: var(--ifm-color-primary-dark) !important; + --docsearch-searchbox-background: #3a3a3a !important; +} + +.navbar__title { + color: #6f1a5f; + font-size: 1.5em; +} + +.navbar__title:hover { + color: #bf1aaf; +} + +.header-github-link:hover { + opacity: 0.6; +} + +.header-github-link::before { + content: ""; + width: 20px; + height: 20px; + display: flex; + background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E") + no-repeat; +} + +[data-theme="dark"] .header-github-link::before { + background: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='white' d='M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12'/%3E%3C/svg%3E") + no-repeat; +} +.bg { + background-color: var(--ifm-f-white-soft); +} + +.bg-re { + background-color: var(--ifm-f-re-white); +} + +.color { + color: var(--ifm-f-white); +} + +.token.color { + color: #c44cac; +} + +.color-re { + color: var(--ifm-f-re-white); +} + +.theme-back-to-top-button { + width: 50px !important; + height: 50px !important; +} + +[class^="backToTopButton_"]::after { + mask: var(--ifm-menu-link-sublist-icon) 50% / 1.5rem 1.5rem no-repeat !important; + mask-size: 3rem 3rem !important; + -webkit-mask-size: 3rem 3rem !important; +} +.clean-btn::after { + mask: var(--ifm-menu-link-sublist-icon) 50% / 1.5rem 1.5rem no-repeat !important; + mask-size: 1.5rem 1.5rem !important; + -webkit-mask-size: 1.5rem 1.5rem !important; +} + +div[class^="announcementBar_"] { + --site-announcement-bar-stripe-color1: hsl( + var(--ifm-primary-hue-saturation) 85% + ); + --site-announcement-bar-stripe-color2: hsl( + var(--ifm-primary-hue-saturation) 95% + ); + + background: linear-gradient( + 45deg, + #711a5f, + #c44cac 30%, + #9f1a8f 60%, + #fda7df 80% + ); + font-weight: bold; + color: var(--c-white); + height: var(--ifm-announcementBar-height); + + @media (max-width: 768px) { + height: calc(var(--ifm-announcementBar-height) + 12px); + } +} + +.navbar__items .documate-button { + @media (max-width: 768px) { + display: none !important; + } +} + +footer[class="footer"] { + background-color: var(--ifm-f-white-soft) !important; +} + +.footer__link-item { + line-height: 3; + display: flex; + align-items: center; + gap: 6px; +} + +.navbar__link { + display: flex; + align-items: center; + + @media (max-width: 768px) { + display: none !important; + } +} + +.code-block-highlight-line { + background-color: var(--docusaurus-highlighted-code-line-bg); + display: block; + margin: 0 calc(-1 * var(--ifm-pre-padding)); + padding: 0 var(--ifm-pre-padding); + border-left: 5px solid rgb(196, 76, 172); +} + +a { + color: rgb(196, 76, 172); +} + +@keyframes glowing { + 0% { + background-position: 0 0; + } + 50% { + background-position: 400% 0; + } + 100% { + background-position: 0 0; + } +} + +.DocSearch-Button { + width: 250px; + border-radius: 8px !important; +} + +.dropdown > .navbar__link:after { + top: 4px; +} + +.theme-admonition-warning { + color: var(--c-yellow-120); +} + +.theme-admonition-danger { + color: var(--c-red-60); +} + +.theme-doc-version-badge { + margin: 10px 0; +} + +.navbar--fixed-top { + box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08); +} + +@media screen and (min-width: 1140px) { + .navbar--fixed-top { + backdrop-filter: blur(8px); /* Apply the blur effect */ + -webkit-backdrop-filter: blur(8px); /* Safari support */ + background: transparent; + } +} + +.font-sans { + font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", + "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; +} + +figure { + margin: 12px 12px; +} + +body { + background: var(--background); +} + +.package-manager-tab { + cursor: pointer; +} + +.package-manager-name { + margin-left: 8px; + font-size: 14px; + font-weight: 500; +} + +.react-tabs__tab--selected .package-manager-tab { + background-color: rgba(0, 0, 0, 0.1); +} + +.codeBlock-tab { + margin: 0 !important; + border-radius: none; + pre { + margin: 0; + } +} + +.highlighted-line { + background-color: var(--ifm-menu-color-background-active); +} + +html[data-theme="light"] { + --code-block: #fff; + --code-block-border: 1px solid #eee; +} + +html[data-theme="dark"] { + --code-block: rgb(25, 25, 25); + --code-block-border: 1px solid #303030; + --code-block-select-color: #2e3440ff; +} + +.border-package { + border: var(--code-block-border); +} + +[data-theme="light"] .shiki.dark-plus { + display: none; +} + +[data-theme="dark"] .shiki.light-plus { + display: none; +} + +[class*="codeBlockContainer_"] { + margin-bottom: 0 !important; +} + +[class*="codeBlockTitle_"] { + display: none; +} + +[class*="codeBlock_"] { + background-color: var(--code-block) !important; +} + +.shiki { + margin: 0; + border-radius: 0; +} + +.file-icon { + width: 16px; + height: 16px; + display: flex; + align-items: center; +} + +.file-icon svg { + width: 100%; + height: 100%; +} + +.sidebar-contribution-item > .menu__link { + font-weight: bold; +} + +.sidebar-contribution-item > .menu__link::after { + content: "Welcome ✨"; + margin-left: 0.5rem; + display: inline-block; + padding: 2px 6px; + background-color: var(--admonition-tip-c-bg); + border: 1px solid var(--admonition-tip-border-color); + border-radius: 4px; + color: var(--ifm-menu-color-active); + font-size: 12px; + font-weight: normal; + vertical-align: middle; +} diff --git a/docs/src/css/token.css b/docs/src/css/token.css new file mode 100644 index 0000000000..d2ae68216d --- /dev/null +++ b/docs/src/css/token.css @@ -0,0 +1,312 @@ +:root { + --c-black: #000000; + --c-white: #ffffff; + --c-blue-0: #f0f6ff; + --c-blue-10: #e3edff; + --c-blue-20: #cddfff; + --c-blue-30: #b2ceff; + --c-blue-40: #97bdff; + --c-blue-50: #7cabff; + --c-blue-60: #639bff; + --c-blue-70: #4d8dff; + --c-blue-80: #3880ff; + --c-blue-90: #176bff; + --c-blue-100: #0054e9; + --c-blue-110: #004dd6; + --c-blue-120: #0046c1; + --c-blue-130: #003fae; + --c-blue-140: #00389b; + --c-blue-150: #002d7c; + --c-blue-160: #002669; + --c-blue-170: #001d52; + --c-blue-180: #001740; + --c-blue-190: #00112f; + --c-blue-200: #000b1f; + --c-gray-0: #f3f3f3; + --c-gray-10: #e4e4e4; + --c-gray-20: #c8c8c8; + --c-gray-30: #aeaeae; + --c-gray-40: #959595; + --c-gray-50: #818181; + --c-gray-60: #6d6d6d; + --c-gray-70: #5f5f5f; + --c-gray-80: #474747; + --c-gray-90: #2f2f2f; + --c-gray-100: #141414; + --c-carbon-0: #eef1f3; + --c-carbon-10: #d7dde2; + --c-carbon-20: #b4bcc6; + --c-carbon-30: #98a2ad; + --c-carbon-40: #7d8894; + --c-carbon-50: #677483; + --c-carbon-60: #556170; + --c-carbon-70: #434f5e; + --c-carbon-80: #35404e; + --c-carbon-90: #222d3a; + --c-carbon-100: #03060b; + --c-indigo-0: #fbfbfd; + --c-indigo-10: #f6f8fc; + --c-indigo-20: #e9edf3; + --c-indigo-30: #dee3ea; + --c-indigo-40: #ced6e0; + --c-indigo-50: #b2becd; + --c-indigo-60: #92a0b3; + --c-indigo-70: #73849a; + --c-indigo-80: #445b78; + --c-indigo-90: #2d4665; + --c-indigo-100: #001a3a; + --c-green-0: #f1fdf5; + --c-green-10: #deffe7; + --c-green-20: #c7fbd5; + --c-green-30: #a7f1bb; + --c-green-40: #80e89d; + --c-green-50: #62e085; + --c-green-50-a: #62e08560; + --c-green-60: #4ada71; + --c-green-70: #2dd55b; + --c-green-80: #17c948; + --c-green-90: #00ba33; + --c-green-100: #00a52d; + --c-green-110: #009b2b; + --c-green-120: #009128; + --c-green-130: #008725; + --c-green-140: #007d22; + --c-green-150: #00711f; + --c-green-160: #00661c; + --c-green-170: #00581a; + --c-green-180: #004314; + --c-green-190: #002f0e; + --c-green-200: #001807; + --c-lime-0: #f5fff0; + --c-lime-10: #ebfee3; + --c-lime-20: #ddfcd0; + --c-lime-30: #cffbbc; + --c-lime-40: #bbf9a2; + --c-lime-50: #a3f581; + --c-lime-60: #8bf35f; + --c-lime-70: #64ec44; + --c-lime-80: #4ddf2b; + --c-lime-90: #3ad515; + --c-lime-100: #27c100; + --c-lime-110: #25b400; + --c-lime-120: #22a400; + --c-lime-130: #1e9200; + --c-lime-140: #1a7e00; + --c-lime-150: #176d00; + --c-lime-160: #135a00; + --c-lime-170: #0f4900; + --c-lime-180: #0c3900; + --c-lime-190: #092c00; + --c-lime-200: #061d00; + --c-lavender-0: #f7f8ff; + --c-lavender-10: #e6ebff; + --c-lavender-20: #ced9ff; + --c-lavender-30: #b6c6ff; + --c-lavender-40: #9fb5ff; + --c-lavender-50: #8aa4ff; + --c-lavender-60: #7493ff; + --c-lavender-70: #597eff; + --c-lavender-80: #3c67ff; + --c-lavender-90: #194bfd; + --c-lavender-100: #0033e8; + --c-lavender-110: #002dcc; + --c-lavender-120: #0028b8; + --c-lavender-130: #0023a2; + --c-lavender-140: #002092; + --c-lavender-150: #001a79; + --c-lavender-160: #001560; + --c-lavender-170: #00114e; + --c-lavender-180: #000e41; + --c-lavender-190: #000a30; + --c-lavender-200: #000721; + --c-lavender-210: #8aa4ff50; + --c-lavender-220: #7493ff40; + --c-purple-0: #f4f4ff; + --c-purple-10: #e9eaff; + --c-purple-20: #d0d2ff; + --c-purple-30: #b6b9f9; + --c-purple-40: #9a99fc; + --c-purple-50: #8482fb; + --c-purple-60: #786df9; + --c-purple-70: #6e5afd; + --c-purple-80: #6030ff; + --c-purple-90: #4712fb; + --c-purple-100: #3400e6; + --c-purple-110: #3000d1; + --c-purple-120: #2b00bc; + --c-purple-130: #2600a6; + --c-purple-140: #20008e; + --c-purple-150: #1b0075; + --c-purple-160: #15005c; + --c-purple-170: #100048; + --c-purple-180: #0d0038; + --c-purple-190: #0b0030; + --c-purple-200: #080022; + --c-brand: #8f1a7f; + --c-brand-a: #8f1a7f60; + --c-pink-0: #ffeff5; + --c-pink-10: #ffe3ed; + --c-pink-20: #ffd8e5; + --c-pink-30: #ffc9db; + --c-pink-40: #ffb6d0; + --c-pink-50: #ff99bd; + --c-pink-60: #ff80ac; + --c-pink-70: #ff6098; + --c-pink-80: #fb4082; + --c-pink-90: #ec216a; + --c-pink-100: #da0d56; + --c-pink-110: #d0004a; + --c-pink-120: #c40046; + --c-pink-130: #b30040; + --c-pink-140: #a3003b; + --c-pink-150: #940035; + --c-pink-160: #850030; + --c-pink-170: #710029; + --c-pink-180: #5f0022; + --c-pink-190: #460019; + --c-pink-200: #20000b; + --c-red-0: #fff1f3; + --c-red-10: #ffe6e8; + --c-red-20: #ffcfd3; + --c-red-30: #feb7bc; + --c-red-40: #fc9aa2; + --c-red-50: #f9838c; + --c-red-50-a: #f9838c60; + --c-red-60: #f56570; + --c-red-70: #f24c58; + --c-red-80: #ef3442; + --c-red-90: #e21827; + --c-red-100: #d0000f; + --c-red-110: #c5000f; + --c-red-120: #b3000e; + --c-red-130: #9c000c; + --c-red-140: #89000b; + --c-red-150: #760009; + --c-red-160: #650008; + --c-red-170: #520006; + --c-red-180: #410005; + --c-red-190: #300004; + --c-red-200: #1d0002; + --c-red-210: #f24c5830; + --c-red-220: #ef344215; + --c-orange-0: #fff5f0; + --c-orange-10: #ffede6; + --c-orange-20: #ffdfd1; + --c-orange-30: #ffd0bc; + --c-orange-40: #ffc0a5; + --c-orange-50: #ffaf8c; + --c-orange-60: #ff9b70; + --c-orange-70: #ff8753; + --c-orange-80: #ff7336; + --c-orange-90: #ff5b13; + --c-orange-100: #eb4700; + --c-orange-110: #d94200; + --c-orange-120: #c93d00; + --c-orange-130: #b63700; + --c-orange-140: #a53200; + --c-orange-150: #8c2a00; + --c-orange-160: #772400; + --c-orange-170: #5e1c00; + --c-orange-180: #481600; + --c-orange-190: #341000; + --c-orange-200: #1d0900; + --c-yellow-0: #fffbef; + --c-yellow-10: #fff8e2; + --c-yellow-20: #fff4d1; + --c-yellow-30: #ffefbd; + --c-yellow-30-a: #fcd28550; + --c-yellow-40: #ffe9a3; + --c-yellow-50: #ffcb2d; + --c-yellow-50-a: #ffd75a60; + --c-yellow-60: #ffd75a; + --c-yellow-60-a: #ffd75a30; + --c-yellow-70: #ffce31; + --c-yellow-80: #ffc409; + --c-yellow-90: #f4b100; + --c-yellow-90-a: #f4b10060; + --c-yellow-100: #eaa100; + --c-yellow-110: #dd9800; + --c-yellow-120: #cc8d00; + --c-yellow-130: #be8300; + --c-yellow-140: #b17a00; + --c-yellow-150: #9c6c00; + --c-yellow-160: #8a6000; + --c-yellow-170: #755100; + --c-yellow-180: #5f4100; + --c-yellow-190: #452f00; + --c-yellow-200: #231800; + --c-yellow-210: #ffc40950; + --c-yellow-220: #ffce3140; + --c-aqua-0: #f0fff9; + --c-aqua-10: #e6fff6; + --c-aqua-20: #ceffed; + --c-aqua-30: #b7fce3; + --c-aqua-40: #93f9d5; + --c-aqua-50: #79f5c9; + --c-aqua-60: #59f0ba; + --c-aqua-70: #38e9aa; + --c-aqua-80: #1ae19a; + --c-aqua-90: #00d287; + --c-aqua-100: #00ba78; + --c-aqua-110: #00aa6d; + --c-aqua-120: #009b63; + --c-aqua-130: #00915c; + --c-aqua-140: #008152; + --c-aqua-150: #016e46; + --c-aqua-160: #015d3c; + --c-aqua-170: #014f32; + --c-aqua-180: #013e28; + --c-aqua-190: #012e1e; + --c-aqua-200: #011e13; + --c-teal-0: #eefeff; + --c-teal-10: #dffdff; + --c-teal-20: #d0fdff; + --c-teal-30: #bbfcff; + --c-teal-40: #a2fcff; + --c-teal-50: #8bfbff; + --c-teal-60: #73f6fb; + --c-teal-60-a: #73f6fb60; + --c-teal-70: #55ecf2; + --c-teal-80: #35e2e9; + --c-teal-90: #1bd2d9; + --c-teal-100: #00b9c0; + --c-teal-110: #01adb4; + --c-teal-120: #019fa5; + --c-teal-130: #018f94; + --c-teal-210: #3dc1d340; + --c-teal-220: #3dc1d325; + --c-teal-140: #017e83; + --c-teal-150: #016d71; + --c-teal-160: #015d61; + --c-teal-170: #014d4f; + --c-teal-180: #013c3e; + --c-teal-190: #012c2e; + --c-teal-200: #011c1d; + --c-cyan-0: #f3faff; + --c-cyan-10: #e8f5ff; + --c-cyan-20: #d3ecff; + --c-cyan-30: #bfe4ff; + --c-cyan-40: #a7daff; + --c-cyan-50: #8dcfff; + --c-cyan-60: #77c6ff; + --c-cyan-70: #62bdff; + --c-cyan-80: #46b1ff; + --c-cyan-90: #24a3ff; + --c-cyan-100: #0091fa; + --c-cyan-110: #0189ec; + --c-cyan-120: #017ed8; + --c-cyan-130: #0170c0; + --c-cyan-140: #0163aa; + --c-cyan-150: #015592; + --c-cyan-160: #01487b; + --c-cyan-170: #013a64; + --c-cyan-180: #012d4d; + --c-cyan-190: #011e33; + --c-cyan-200: #01121e; +} + +html[data-theme="dark"] { + --c-brand: #ff73ec90; + --c-yellow-50: #f9d76f; + --c-yellow-50-a: #ffd75a60; +} diff --git a/docs/src/lib/utils.ts b/docs/src/lib/utils.ts new file mode 100644 index 0000000000..e708a691db --- /dev/null +++ b/docs/src/lib/utils.ts @@ -0,0 +1,7 @@ +// lib/utils.ts +import clsx, { ClassValue } from 'clsx'; +import { twMerge } from 'tailwind-merge'; + +export function cn(...inputs: ClassValue[]) { + return twMerge(clsx(inputs)); +} diff --git a/docs/src/pages/data.js b/docs/src/pages/data.js new file mode 100644 index 0000000000..4107cf955d --- /dev/null +++ b/docs/src/pages/data.js @@ -0,0 +1,119 @@ +export const members = [ + { + avatar: "https://www.github.com/wre232114.png", + name: "brightwu", + org: "@bytedance", + desc: "Author/Lead Maintainer of @farm-fe. Rust && TS && Java..", + links: [ + { icon: "github", link: "https://github.com/wre232114" }, + { icon: "twitter", link: "https://twitter.com/wre232114" }, + ], + }, + { + avatar: "https://www.github.com/erkelost.png", + name: "Erkelost", + org: "", + desc: "Rust & Go & Node & Web development ❤️❤️", + links: [ + { icon: "github", link: "https://github.com/ErKeLost" }, + { icon: "twitter", link: "https://twitter.com/ErKeLost" }, + ], + }, + { + avatar: "https://www.github.com/shulandmimi.png", + name: "shulandmimi", + title: "", + desc: "Core team member of Farm.", + links: [ + { icon: "github", link: "https://github.com/shulandmimi" }, + { icon: "twitter", link: "https://twitter.com/shulandmimi" }, + ], + }, + { + avatar: "https://github.com/Nirvana-Jie.png", + name: "Nirvana-Jie", + org: "@bytedance", + desc: "There are too many things to learn, I can only keep moving forward.", + links: [ + { icon: "github", link: "https://github.com/Nirvana-Jie" }, + { icon: "twitter", link: "https://twitter.com/Nirvana-Jie" }, + ], + }, + { + avatar: "https://github.com/NidMo.png", + name: "NidMo", + orgLink: "https://github.com/NidMo", + desc: "Core team member of Farm.", + links: [ + { icon: "github", link: "https://github.com/NidMo" }, + { icon: "twitter", link: "https://twitter.com/NidMo" }, + ], + }, + { + avatar: "https://github.com/wjq990112.png", + name: "wjq990112", + title: "@bytedance", + orgLink: "https://github.com/wjq990112", + desc: "Member of @raxjs, @ice-lab and @farm-fe.", + links: [ + { icon: "github", link: "https://github.com/wjq990112" }, + { icon: "twitter", link: "https://twitter.com/wjq990112" }, + ], + }, + { + avatar: "https://github.com/callqh.png", + name: "callqh", + org: "", + desc: "Javascript & Rust.", + links: [ + { icon: "github", link: "https://github.com/callqh" }, + { icon: "twitter", link: "https://twitter.com/callqh" }, + ], + }, + { + avatar: "https://github.com/oblador.png", + name: "oblador", + title: "Open Source Developer", + orgLink: "https://github.com/oblador", + desc: "╥━━━━━━━━╭━━╮━━┳ ╢╭╮╭━━━━━┫┃▋▋━▅┣ ╢┃╰┫┈┈┈┈┈┃┃┈┈╰┫┣ ╢╰━┫┈┈┈┈┈╰╯╰┳━╯┣ ╢┊┊┃┏┳┳━━┓┏┳┫┊┊┣ ╨━━┗┛┗┛━━┗┛┗┛━━┻", + links: [ + { icon: "github", link: "https://github.com/oblador" }, + { icon: "twitter", link: "https://twitter.com/oblador" }, + ], + }, + { + avatar: "https://github.com/ysy945.png", + name: "ysy945", + title: "Open Source Developer", + orgLink: "https://github.com/ysy945", + desc: "Core team member of Farm.", + links: [ + { icon: "github", link: "https://github.com/ysy945" }, + { icon: "twitter", link: "https://twitter.com/ysy945" }, + ], + }, + { + avatar: "https://github.com/NaturelLee.png", + name: "NaturelLee", + title: "Open Source Developer", + orgLink: "https://github.com/NaturelLee", + desc: "Core team member of Farm.", + links: [ + { icon: "github", link: "https://github.com/NaturelLee" }, + { icon: "twitter", link: "https://twitter.com/NaturelLee" }, + ], + }, + { + avatar: "https://github.com/CCherry07.png", + name: "Cherry7", + org: "@bytedance", + title: "Open Source Developer", + orgLink: "https://github.com/CCherry07", + desc: "Core team member of Farm & Ant Design Vue.", + links: [ + { icon: "github", link: "https://github.com/CCherry07" }, + ], + } +]; + +export default function Empty() {} diff --git a/docs/src/pages/index.module.css b/docs/src/pages/index.module.css new file mode 100644 index 0000000000..b156c37cfc --- /dev/null +++ b/docs/src/pages/index.module.css @@ -0,0 +1,184 @@ +/** + * CSS files with the .module.css suffix will be treated as CSS modules + * and scoped locally. + */ + +.heroBanner { + padding: 3rem 0; + text-align: center; + position: relative; + overflow: hidden; +} + +.banner { + background: linear-gradient(45deg, rgb(113, 26, 95), #fda7df 70%); + background-clip: text; + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + color: transparent; +} + +@media screen and (max-width: 996px) { + .heroBanner { + padding: 2rem; + } +} + +.buttons { + display: flex; + align-items: center; + gap: 20px; + /* justify-content: center; */ +} + +.btn { + font-size: 1rem; + font-family: Open Sans; + font-weight: 600; + font-style: normal; + line-height: 1.5rem; + text-transform: none; + min-width: 130px; + border-radius: 8px; + border-width: 2px; + padding-left: 20px; + padding-right: 20px; + padding-top: 12px; + padding-bottom: 12px; +} + +.farmButton { + height: 50px; + border: none; + outline: none; + color: #fff; + background: #111; + cursor: pointer; + position: relative; + z-index: 0; + border-radius: 10px; +} + +.farmButton:before { + content: ""; + background: linear-gradient( + 45deg, + #7a00ff, + #9f1a8f, + #7a00ff, + #ff00c8, + #9f1a8f, + #7a00ff, + #ff00c8 + ); + position: absolute; + top: -2px; + left: -2px; + background-size: 400%; + z-index: -1; + filter: blur(5px); + width: calc(100% + 4px); + height: calc(100% + 4px); + opacity: 1; + transition: opacity 0.5s ease-in-out; + border-radius: 10px; + animation: glowing 120s linear infinite; +} + +.farmButton:after { + z-index: -1; + content: ""; + position: absolute; + width: 100%; + height: 100%; + background: #111; + left: 0; + top: 0; + border-radius: 10px; +} + +@keyframes glowing { + 0% { + background-position: 0 0; + } + 50% { + background-position: 400% 0; + } + 100% { + background-position: 0 0; + } +} + +.fKVWgc { + position: absolute; + inset: 0px; + mask-image: linear-gradient(black, transparent); +} + +.farmButton2 { + height: 50px; + border: none; + outline: none; + color: #fff; + background: rgb(23, 23, 23); + cursor: pointer; + position: relative; + z-index: 0; + border-radius: 10px; +} + +.farmButton2:before { + content: ""; + background: linear-gradient( + 45deg, + #ffaa40, + #9f1a8f, + #ffaa40, + #ff00c8, + #9f1a8f, + #7a00ff, + #ff00c8 + ); + position: absolute; + top: -2px; + left: -2px; + background-size: 400%; + z-index: -1; + filter: blur(5px); + width: calc(100% + 4px); + height: calc(100% + 4px); + opacity: 1; + transition: opacity 0.2s ease-in-out; + border-radius: 10px; + animation: glowing 100s linear infinite; +} + +.farmButton2:after { + z-index: -1; + content: ""; + position: absolute; + width: 100%; + height: 100%; + background: #111; + left: 0; + top: 0; + border-radius: 10px; +} + +@keyframes glowing { + 0% { + background-position: 0 0; + } + 30% { + background-position: 400% 0; + } + 100% { + background-position: 0 0; + } +} + +.gradientText { + background: linear-gradient(to bottom right, black, gray 40%, white); + -webkit-background-clip: text; + color: transparent; +} diff --git a/docs/src/pages/index.tsx b/docs/src/pages/index.tsx new file mode 100644 index 0000000000..a712676621 --- /dev/null +++ b/docs/src/pages/index.tsx @@ -0,0 +1,157 @@ +import Link from "@docusaurus/Link"; +import Translate from "@docusaurus/Translate"; +import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; +import Layout from "@theme/Layout"; +import clsx from "clsx"; +import React from "react"; +import Benchmark from "../components/Benchmark"; +import AnimatedGradientStarWithGithub from "../components/MagicUi/animated-shiny-text"; +import BlurFade from "../components/MagicUi/blur-fade"; +import BentoGridCard from "../components/MagicUi/card"; +import StarrySky from "../components/StarrySky"; +import { AuroraBackground } from "../components/ui/aurora-back"; +import { useColorMode } from "@docusaurus/theme-common"; +import NeonGradientCard from "../components/MagicUi/neon-gradient-card"; +import styles from "./index.module.css"; + +function HomepageHeader() { + return ( +
+
+ +
+
+ + Extremely + + + Fast + + + Web + +
+
+ + Build Tool + +
+
+ + Written in + + + Rust + +
+
+
+ + +
+
+ + Farm + + + + is a Rust-Based Web Building Engine to Facilitate Your Web + Program and JavaScript Library + + +
+
+
+
+ +
+ Quick Start +
+ + +
+ Why Farm? +
+ + +
+ Contribute +
+ +
+
+
+ ); +} + +const HomeBaseContent = () => { + const { colorMode } = useColorMode(); + + const mainContent = React.useMemo(() => { + return ( +
+ + + + + + +
+ ); + }, []); + + if (colorMode === "dark") { + return ( + <> + + {mainContent} + + ); + } else { + return ( + <> + + {mainContent} + + ); + } +}; + +export default function Home() { + const { siteConfig } = useDocusaurusContext(); + return ( + + + + ); +} diff --git a/docs/src/pages/markdown-page.md b/docs/src/pages/markdown-page.md new file mode 100644 index 0000000000..9756c5b668 --- /dev/null +++ b/docs/src/pages/markdown-page.md @@ -0,0 +1,7 @@ +--- +title: Markdown page example +--- + +# Markdown page example + +You don't need React to write simple standalone pages. diff --git a/docs/src/pages/roadmap.tsx b/docs/src/pages/roadmap.tsx new file mode 100644 index 0000000000..3559af945e --- /dev/null +++ b/docs/src/pages/roadmap.tsx @@ -0,0 +1,179 @@ +import React from 'react'; +import Layout from '@theme/Layout'; +import { Timeline } from "../components/ui/timeline"; + +export default function Roadmap() { + return ( + +
+
+

+ Farm RoadMap 🚜 +

+

+ We will plan for new features that will be released soon and future tasks that can be performed +

+

+ Farm has a detailed rfc design, click to view our rfc +

+
+ coming soon + {/* */} +
+
+ ); +} + + + +export function TimelineCpm() { + const data = [ + { + title: "2024", + content: ( +
+

+ Farm RoadMap +

+
+ startup template + startup template + startup template + startup template +
+
+ ), + }, + { + title: "Early 2023", + content: ( +
+

+ I usually run out of copy, but when I see content this big, I try to + integrate lorem ipsum. +

+

+ Lorem ipsum is for people who are too lazy to write copy. But we are + not. Here are some more example of beautiful designs I built. +

+
+ hero template + feature template + bento template + cards template +
+
+ ), + }, + { + title: "Changelog", + content: ( +
+

+ Deployed 5 new components on Aceternity today +

+
+
+ ✅ Card grid component +
+
+ ✅ Startup template Aceternity +
+
+ ✅ Random file upload lol +
+
+ ✅ Himesh Reshammiya Music CD +
+
+ ✅ Salman Bhai Fan Club registrations open +
+
+
+ hero template + feature template + bento template + cards template +
+
+ ), + }, + ]; + return ( +
+ +
+ ); +} diff --git a/docs/src/pages/team.module.css b/docs/src/pages/team.module.css new file mode 100644 index 0000000000..e91767055b --- /dev/null +++ b/docs/src/pages/team.module.css @@ -0,0 +1,7 @@ +.banner { + background: linear-gradient(45deg, rgb(113, 26, 95), #fda7df 70%); + background-clip: text; + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + color: transparent; +} diff --git a/docs/src/pages/team.tsx b/docs/src/pages/team.tsx new file mode 100644 index 0000000000..a87d74d078 --- /dev/null +++ b/docs/src/pages/team.tsx @@ -0,0 +1,19 @@ +import React from "react"; +import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; +import Layout from "@theme/Layout"; +import { TeamMembers } from "../components/TeamMembers"; +import { members } from "./data"; + +export default function Team() { + const { siteConfig } = useDocusaurusContext(); + return ( + +
+ +
+
+ ); +} diff --git a/docs/src/theme/CodeBlock/index.module.css b/docs/src/theme/CodeBlock/index.module.css new file mode 100644 index 0000000000..940496d201 --- /dev/null +++ b/docs/src/theme/CodeBlock/index.module.css @@ -0,0 +1,142 @@ +.shiki-wrapper { + margin: 1.5em 0; + border-radius: 8px; + overflow: hidden; + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); + transition: box-shadow 0.3s ease; +} + +.shiki-wrapper:hover { + box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15); +} + +.code-header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 0.3em 1em; + border-bottom: var(--code-block-border); + background-color: var(--code-block); +} + +.code-title { + font-weight: 600; + font-size: 0.9em; + display: flex; + align-items: center; + gap: 10px; + svg { + width: 22px; + } +} + +.copy-button { + display: flex; + align-items: center; + background-color: transparent; + border: 1px solid #ced4da; + border-radius: 4px; + font-size: 0.85em; + cursor: pointer; + transition: all 0.2s ease; +} + +.copy-button:hover { + background-color: #e9ecef; + border-color: #adb5bd; +} + +.copy-button span { + transition: opacity 0.2s ease; +} + +.copy-button:active span { + opacity: 0.6; +} + +@keyframes popIn { + 0% { + transform: scale(0.8); + opacity: 0; + } + 100% { + transform: scale(1); + opacity: 1; + } +} + +.copy-button svg { + animation: popIn 0.3s ease forwards; +} + +.copy-button { + display: flex; + align-items: center; + background-color: transparent; + border: none; + border-radius: 4px; + padding: 0.5em 0em 0.5em 0.5em; + font-size: 0.85em; + cursor: pointer; + transition: all 0.2s ease; + outline: none; +} + +.copy-button:hover { + background-color: var(--ifm-color-emphasis-200); + /* border-color: var(--ifm-color-emphasis-400); */ +} + +.copy-button:focus { + /* box-shadow: 0 0 0 2px var(--ifm-color-primary-lightest); */ +} + +.copy-icon { + width: 1.2em; + height: 1.2em; + margin-right: 0.5em; + fill: currentColor; + transition: transform 0.2s ease; +} + +.copy-button:hover .copy-icon { + transform: scale(1.1); +} + +.copy-button span { + transition: opacity 0.2s ease; +} + +.copy-button:active span { + opacity: 0.6; +} + +@keyframes popIn { + 0% { + transform: scale(0.8); + opacity: 0; + } + 100% { + transform: scale(1); + opacity: 1; + } +} + +.copy-button svg { + animation: popIn 0.3s ease forwards; +} + +.copy-success { + color: var(--ifm-color-success); +} + +.hover-button { + position: relative; + button { + position: absolute; + margin: 16px; + right: 0; + } +} + + diff --git a/docs/src/theme/CodeBlock/index.tsx b/docs/src/theme/CodeBlock/index.tsx new file mode 100644 index 0000000000..ffc1a9be40 --- /dev/null +++ b/docs/src/theme/CodeBlock/index.tsx @@ -0,0 +1,114 @@ +import type CodeBlockType from '@theme/CodeBlock'; +import type { WrapperProps } from '@docusaurus/types'; +import React, { useEffect, useState } from 'react'; +import styles from './index.module.css' +import { codeToHtml } from 'shiki'; +import { useColorMode } from '@docusaurus/theme-common'; +import { svgs } from './svg'; +type Props = WrapperProps; + +export default function CodeBlockWrapper(props: Props): JSX.Element { + const [highlightedCode, setHighlightedCode] = useState(''); + const [copied, setCopied] = useState(false); + const language = props.className ? props.className.replace(/language-/, '') : 'javascript'; + const title = props.metastring ? props.metastring.match(/title="([^"]+)"/) : null; + const fileName = title ? title[1] : null; + const highlightLines = props.metastring ? props.metastring.match(/{([\d,-]+)}/) : null; + const { colorMode } = useColorMode(); + const iconMap = { + ts: svgs.find(svg => svg.name === "ts")?.content, + tsx: svgs.find(svg => svg.name === "ts")?.content, + js: svgs.find(svg => svg.name === "js")?.content, + jsx: svgs.find(svg => svg.name === "js")?.content, + css: svgs.find(svg => svg.name === "css")?.content, + json: svgs.find(svg => svg.name === "json")?.content, + txt: svgs.find(svg => svg.name === "text")?.content, + vue: svgs.find(svg => svg.name === "vue")?.content, + }; + const getFileIcon = (fileName) => { + if (!fileName) return null; + const extension = fileName.split('.').pop().toLowerCase(); + const svgContent = iconMap[extension]; + return svgContent ? renderSvg(svgContent, styles['file-icon']) : null; + }; + const renderSvg = (content, className) => ( +
+ ); + useEffect(() => { + const highlight = async () => { + let lines = []; + if (highlightLines) { + lines = highlightLines[1].split(',').flatMap(range => { + const [start, end] = range.split('-').map(Number); + return end ? Array.from({ length: end - start + 1 }, (_, i) => start + i) : [start]; + }); + } + + const highlighted = await codeToHtml(props.children, { + lang: language, + theme: colorMode === 'dark' ? 'vitesse-dark' : 'vitesse-light', + transformers: [{ + name: 'line-highlight', + code(node) { + let lineIndex = 0; + node.children.forEach((child) => { + if (child.type === 'element' && child.tagName === 'span' && child.properties.class === 'line') { + lineIndex++; + if (lines.includes(lineIndex)) { + child.properties.class = 'line highlighted-line'; + } + } + }); + return node; + } + }] + }); + + setHighlightedCode(highlighted); + }; + + highlight(); + }, [props.children, colorMode, language, highlightLines]); + const copyCode = () => { + navigator.clipboard.writeText(props.children).then(() => { + setCopied(true); + setTimeout(() => setCopied(false), 2000); + }); + }; + const hiddenCopy = language === 'bash' || language === 'shell'; + return ( + <> +
+ {!hiddenCopy &&
+ {fileName ? ( +
+ {getFileIcon(fileName)} + + {fileName} + +
+ ) :
} + +
} +
+
+
+
+ + ); +} + diff --git a/docs/src/theme/CodeBlock/svg.ts b/docs/src/theme/CodeBlock/svg.ts new file mode 100644 index 0000000000..e7035bacdf --- /dev/null +++ b/docs/src/theme/CodeBlock/svg.ts @@ -0,0 +1,34 @@ +export const svgs = [ + { + name: 'ts', + content: `` + }, + { + name: 'tsx', + content: `` + }, + { + name: 'js', + content: `` + }, + { + name: 'jsx', + content: `` + }, + { + name: 'css', + content: `` + }, + { + name: 'json', + content: `` + }, + { + name: 'text', + content: `` + }, + { + name: 'vue', + content: `` + } +]; diff --git a/docs/src/theme/Footer/index.tsx b/docs/src/theme/Footer/index.tsx new file mode 100644 index 0000000000..2c8a3d676d --- /dev/null +++ b/docs/src/theme/Footer/index.tsx @@ -0,0 +1,79 @@ +import React from 'react'; +import type FooterType from '@theme/Footer'; +import { FaXTwitter } from "react-icons/fa6"; +import type { WrapperProps } from '@docusaurus/types'; +import { GitHubLogoIcon, DiscordLogoIcon } from '@radix-ui/react-icons'; + + +type Props = WrapperProps; + +export default function FooterWrapper(props: Props): JSX.Element { + return ( +
+
+
+
+ + Extremely Fast Web Build Tool Written in Rust +
+
+
+
+

Guide

+ +
+ +
+

Community

+ +
+ +
+

More

+ +
+
+
+
+ +
+ +
+ +

Copyright © 2024 Farm Community. Built with Docusaurus.

+
+
+
+ ); +} diff --git a/docs/src/theme/ManagerTabs/index.module.css b/docs/src/theme/ManagerTabs/index.module.css new file mode 100644 index 0000000000..547aa888e6 --- /dev/null +++ b/docs/src/theme/ManagerTabs/index.module.css @@ -0,0 +1,54 @@ +.container { + /* background-color: var(--rp-code-block-bg); */ + contain: content; + border-radius: 6px; + + :global(div[class*="language-"]) { + margin: 6px 0; + + code { + /* background-color: var(--rp-c-bg); */ + } + } +} + +.tab-list { + display: flex; + min-width: 100%; + overflow-x: scroll; + padding: 8px 0 8px 8px; +} + +.tab { + /* color: var(--rp-c-text-2); */ + border: 1px solid transparent; + box-sizing: border-box; + margin-right: 10px; + padding: 4px 6px; + margin-bottom: -1px; + user-select: none; + transition: all 0.2s ease-in-out; + cursor: pointer; +} + +.tab:last-child { + margin-right: 0; +} + +.selected { + border-color: rgb(244 244 245); + background-color: rgb(244 244 245); + border-radius: 0.55rem; + color: var(--code-block-select-color) +} + +.no-scrollbar::-webkit-scrollbar { + display: none; +} + +.no-scrollbar { + -ms-overflow-style: none; + scrollbar-width: none; +} + + diff --git a/docs/src/theme/ManagerTabs/index.tsx b/docs/src/theme/ManagerTabs/index.tsx new file mode 100644 index 0000000000..dedce37fc6 --- /dev/null +++ b/docs/src/theme/ManagerTabs/index.tsx @@ -0,0 +1,205 @@ + +/* +Use the rspress tabs component to rewrite tabs +https://rspress.dev/ +*/ +import React from 'react'; +import { + Children, + type ReactNode, + type ReactElement, + useMemo, + useState, + useEffect, + useContext, + forwardRef, + type ForwardedRef, + isValidElement, + type ComponentPropsWithRef, + type ForwardRefExoticComponent, +} from 'react'; +import { TabDataContext } from '../logic/TabDataContext'; +import { useStorageValue } from '../logic/useStorageValue'; +import styles from './index.module.css'; + +type TabItem = { + value?: string; + label?: string | ReactNode; + disabled?: boolean; +}; + +interface TabsProps { + values?: ReactNode[] | ReadonlyArray | TabItem[]; + defaultValue?: string; + onChange?: (index: number) => void; + children: ReactNode; + groupId?: string; + tabContainerClassName?: string; + tabPosition?: 'left' | 'center'; +} + +function isTabItem(item: unknown): item is TabItem { + if (item && typeof item === 'object' && 'label' in item) { + return true; + } + return false; +} + +const renderTab = (item: ReactNode | TabItem) => { + if (isTabItem(item)) { + return item.label || item.value; + } + return item; +}; + +export const groupIdPrefix = 'tabs.'; + +export const Tabs: ForwardRefExoticComponent = forwardRef( + (props: TabsProps, ref: ForwardedRef): ReactElement => { + const { + values, + defaultValue, + onChange, + children: rawChildren, + groupId, + tabPosition = 'left', + tabContainerClassName, + } = props; + // remove "\n" character when write JSX element in multiple lines, use Children.toArray for Tabs with no Tab element + const children = Children.toArray(rawChildren).filter( + child => !(typeof child === 'string' && child.trim() === ''), + ); + + + let tabValues = values || []; + + if (tabValues.length === 0) { + tabValues = Children.map(children, child => { + if (isValidElement(child)) { + return { + label: child.props?.label, + value: child.props?.value || child.props?.label, + }; + } + + return { + label: undefined, + value: undefined, + }; + }); + } + + const { tabData, setTabData } = useContext(TabDataContext); + const [activeIndex, setActiveIndex] = useState(() => { + if (defaultValue === undefined) { + return 0; + } + + return tabValues.findIndex(item => { + if (typeof item === 'string') { + return item === defaultValue; + } + if (item && typeof item === 'object' && 'value' in item) { + return item.value === defaultValue; + } + return false; + }); + }); + + const [storageIndex, setStorageIndex] = useStorageValue( + `${groupIdPrefix}${groupId}`, + activeIndex, + ); + + + const syncIndex = useMemo(() => { + if (groupId) { + if (tabData[groupId] !== undefined) { + return tabData[groupId]; + } + + return Number.parseInt(storageIndex); + } + + return activeIndex; + }, [tabData[groupId]]); + + // sync when other browser page trigger update + useEffect(() => { + if (groupId) { + const correctIndex = Number.parseInt(storageIndex); + + if (syncIndex !== correctIndex) { + setTabData({ ...tabData, [groupId]: correctIndex }); + } + } + }, [storageIndex]); + + // const currentIndex = groupId ? syncIndex : activeIndex; + useEffect(() => { + if (groupId) { + setCurrentIndex(syncIndex); + } else { + setCurrentIndex(activeIndex); + } + }, [groupId, syncIndex, activeIndex]); + + const [currentIndex, setCurrentIndex] = useState(groupId ? syncIndex : activeIndex); + + return ( +
+
+ {tabValues.length ? ( +
+ {tabValues.map((item, index) => { + return ( +
{ + const newIndex = index; + onChange?.(newIndex); + setCurrentIndex(newIndex); + + if (groupId) { + setTabData({ ...tabData, [groupId]: newIndex }); + setStorageIndex(newIndex); + } else { + setActiveIndex(newIndex); + } + }} + > + {renderTab(item)} +
+ ); + })} +
+ ) : null} +
+
{Children.toArray(children)[currentIndex]}
+
+ ); + }, +); + +export function Tab({ + children, + ...props +}: ComponentPropsWithRef<'div'> & + Pick): ReactElement { + return ( +
+ {children} +
+ ); +} diff --git a/docs/src/theme/NavbarItem/ComponentTypes.js b/docs/src/theme/NavbarItem/ComponentTypes.js new file mode 100644 index 0000000000..cffa717f6e --- /dev/null +++ b/docs/src/theme/NavbarItem/ComponentTypes.js @@ -0,0 +1,22 @@ +import DefaultNavbarItem from "@theme/NavbarItem/DefaultNavbarItem"; +import DocNavbarItem from "@theme/NavbarItem/DocNavbarItem"; +import DocSidebarNavbarItem from "@theme/NavbarItem/DocSidebarNavbarItem"; +import DocsVersionDropdownNavbarItem from "@theme/NavbarItem/DocsVersionDropdownNavbarItem"; +import DocsVersionNavbarItem from "@theme/NavbarItem/DocsVersionNavbarItem"; +import DropdownNavbarItem from "@theme/NavbarItem/DropdownNavbarItem"; +import HtmlNavbarItem from "@theme/NavbarItem/HtmlNavbarItem"; +import LocaleDropdownNavbarItem from "@theme/NavbarItem/LocaleDropdownNavbarItem"; +import SearchNavbarItem from "@theme/NavbarItem/SearchNavbarItem"; + +const ComponentTypes = { + default: DefaultNavbarItem, + localeDropdown: LocaleDropdownNavbarItem, + search: SearchNavbarItem, + dropdown: DropdownNavbarItem, + html: HtmlNavbarItem, + doc: DocNavbarItem, + docSidebar: DocSidebarNavbarItem, + docsVersion: DocsVersionNavbarItem, + docsVersionDropdown: DocsVersionDropdownNavbarItem, +}; +export default ComponentTypes; diff --git a/docs/src/theme/PackageManagerTabs/icons/Bun.tsx b/docs/src/theme/PackageManagerTabs/icons/Bun.tsx new file mode 100644 index 0000000000..fd9fdac1d4 --- /dev/null +++ b/docs/src/theme/PackageManagerTabs/icons/Bun.tsx @@ -0,0 +1,101 @@ +import type { ComponentProps } from 'react'; + +export function Bun(props: ComponentProps<'svg'>) { + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +} diff --git a/docs/src/theme/PackageManagerTabs/icons/Npm.tsx b/docs/src/theme/PackageManagerTabs/icons/Npm.tsx new file mode 100644 index 0000000000..6b69b2f3fe --- /dev/null +++ b/docs/src/theme/PackageManagerTabs/icons/Npm.tsx @@ -0,0 +1,16 @@ +import type { ComponentProps } from 'react'; + +export function Npm(props: ComponentProps<'svg'>) { + return ( + + + + + ); +} diff --git a/docs/src/theme/PackageManagerTabs/icons/Pnpm.tsx b/docs/src/theme/PackageManagerTabs/icons/Pnpm.tsx new file mode 100644 index 0000000000..391a8e2ee5 --- /dev/null +++ b/docs/src/theme/PackageManagerTabs/icons/Pnpm.tsx @@ -0,0 +1,22 @@ +import type { ComponentProps } from 'react'; + +export function Pnpm(props: ComponentProps<'svg'>) { + return ( + + + + + ); +} diff --git a/docs/src/theme/PackageManagerTabs/icons/Yarn.tsx b/docs/src/theme/PackageManagerTabs/icons/Yarn.tsx new file mode 100644 index 0000000000..ea865340a3 --- /dev/null +++ b/docs/src/theme/PackageManagerTabs/icons/Yarn.tsx @@ -0,0 +1,18 @@ +import type { ComponentProps } from 'react'; + +export function Yarn(props: ComponentProps<'svg'>) { + return ( + + + + + + + ); +} diff --git a/docs/src/theme/PackageManagerTabs/index.tsx b/docs/src/theme/PackageManagerTabs/index.tsx new file mode 100644 index 0000000000..1f5d329281 --- /dev/null +++ b/docs/src/theme/PackageManagerTabs/index.tsx @@ -0,0 +1,159 @@ +import { Tabs, Tab } from '../ManagerTabs'; +import React from 'react'; +import { Npm } from './icons/Npm'; +import { Yarn } from './icons/Yarn'; +import { Pnpm } from './icons/Pnpm'; +import { Bun } from './icons/Bun'; +import { codeToHtml } from 'shiki'; +import { useEffect, useState } from 'react'; +import useIsBrowser from '@docusaurus/useIsBrowser'; +import { useColorMode } from '@docusaurus/theme-common'; +export interface PackageManagerTabProps { + skip?: boolean; + command: + | string + | { + npm?: string; + yarn?: string; + pnpm?: string; + bun?: string; + }; + additionalTabs?: { + tool: string; + icon?: React.ReactNode; + }[]; +} + +function normalizeCommand(command: string): string { + if (!command?.includes('install')) { + return command; + } + // If command include `install` and package name, replace `install` with `add` + const pureCommand = command + .split(' ') + .filter(item => !item.startsWith('-') && !item.startsWith('--')) + .join(' '); + if (pureCommand === 'yarn install' || pureCommand === 'bun install') { + return command; + } + + return command.replace('install', 'add'); +} + + +function replaceTool(command, tool) { + const tools = ['npm', 'yarn', 'pnpm', 'bun']; + let newCommand = command; + + tools.forEach(t => { + const regex = new RegExp(`\\b${t}\\b`, 'g'); + newCommand = newCommand.replace(regex, tool); + }); + + return newCommand; +} + +export function PackageManagerTabs({ + command, + skip = true, + additionalTabs = [], +}: PackageManagerTabProps) { + let commandInfo: { + npm?: string; + yarn?: string; + pnpm?: string; + bun?: string; + [key: string]: string | undefined; + }; + + // Init Icons + const packageMangerToIcon = { + npm: , + yarn: , + pnpm: , + bun: , + }; + additionalTabs.forEach(tab => { + packageMangerToIcon[tab.tool] = tab.icon; + }); + + // Init Command + if (typeof command === 'string') { + commandInfo = { + npm: `npm ${command}`, + yarn: `yarn ${command}`, + pnpm: `pnpm ${command}`, + bun: `bun ${command}`, + }; + additionalTabs.forEach(tab => { + if (skip) { + commandInfo[tab.tool] = replaceTool(command, tab.tool); + } else { + commandInfo[tab.tool] = `${tab.tool} ${command}`; + } + }); + } else { + commandInfo = command; + } + + // Normalize yarn/bun command + commandInfo.yarn && (commandInfo.yarn = normalizeCommand(commandInfo.yarn)); + commandInfo.bun && (commandInfo.bun = normalizeCommand(commandInfo.bun)); + if (skip) { + const tools = ['npm', 'yarn', 'pnpm', 'bun']; + tools.forEach(tool => { + commandInfo[tool] = replaceTool(command, tool); + }); + } + const [highlightedCode, setHighlightedCode] = useState({}); + const { colorMode } = useColorMode(); + const isBrowser = useIsBrowser(); + useEffect(() => { + async function highlightCode() { + if (isBrowser) { + const { codeToHtml } = await import('shiki'); + const highlighted = {}; + for (const [key, value] of Object.entries(commandInfo)) { + highlighted[key] = await codeToHtml(value as string, { + lang: 'bash', + theme: colorMode === 'dark' ? 'vitesse-dark' : 'vitesse-light', + }); + } + setHighlightedCode(highlighted); + } + } + highlightCode(); + }, [command, colorMode, isBrowser]); + + return ( +
+ ( +
+ {packageMangerToIcon[key]} + {key} +
+ ))} + > + {Object.entries(commandInfo).map(([key, value]) => ( + +
+
+ ))} +
+
+ ); +} diff --git a/docs/src/theme/logic/TabDataContext.ts b/docs/src/theme/logic/TabDataContext.ts new file mode 100644 index 0000000000..1968568a3e --- /dev/null +++ b/docs/src/theme/logic/TabDataContext.ts @@ -0,0 +1,15 @@ +import React, { createContext } from 'react'; + +export interface TabData { + [key: string]: number | undefined; +} + +export interface ITabDataContext { + tabData: TabData; + setTabData: (data: TabData) => void; +} + +export const TabDataContext = createContext({ + tabData: {}, + setTabData: () => {} +}); diff --git a/docs/src/theme/logic/useStorageValue.ts b/docs/src/theme/logic/useStorageValue.ts new file mode 100644 index 0000000000..a46f39939e --- /dev/null +++ b/docs/src/theme/logic/useStorageValue.ts @@ -0,0 +1,42 @@ +import { useCallback, useEffect, useState } from 'react'; + +/** + * Read/update the value in localStorage, and keeping it in sync with other tabs. + */ +export const useStorageValue = (key: string, defaultValue = null) => { + const [value, setValueInternal] = useState(() => { + if (typeof window === 'undefined') { + return defaultValue; + } + return localStorage.getItem(key) ?? defaultValue; + }); + + const setValue = useCallback( + (value) => { + setValueInternal((prev) => { + const next = typeof value === 'function' ? value(prev) : value; + if (next == null) { + localStorage.removeItem(key); + } else { + localStorage.setItem(key, next); + } + return next; + }); + }, + [key] + ); + + useEffect(() => { + const listener = (e: StorageEvent) => { + if (e.key === key) { + setValueInternal(localStorage.getItem(key) ?? defaultValue); + } + }; + window.addEventListener('storage', listener); + return () => { + window.removeEventListener('storage', listener); + }; + }, [key, defaultValue]); + + return [value, setValue] as const; +}; diff --git a/docs/static/img/2023-10-10-21-34-33.png b/docs/static/img/2023-10-10-21-34-33.png new file mode 100644 index 0000000000..7ab9b8ae56 Binary files /dev/null and b/docs/static/img/2023-10-10-21-34-33.png differ diff --git a/docs/static/img/2023-10-10-21-41-45.png b/docs/static/img/2023-10-10-21-41-45.png new file mode 100644 index 0000000000..efd0e716c1 Binary files /dev/null and b/docs/static/img/2023-10-10-21-41-45.png differ diff --git a/docs/static/img/2023-10-12-22-16-48.png b/docs/static/img/2023-10-12-22-16-48.png new file mode 100644 index 0000000000..8c6c82dc33 Binary files /dev/null and b/docs/static/img/2023-10-12-22-16-48.png differ diff --git a/docs/static/img/2023-10-14-21-24-40.png b/docs/static/img/2023-10-14-21-24-40.png new file mode 100644 index 0000000000..90da9c1e5e Binary files /dev/null and b/docs/static/img/2023-10-14-21-24-40.png differ diff --git a/docs/static/img/2023-10-15-16-44-26.png b/docs/static/img/2023-10-15-16-44-26.png new file mode 100644 index 0000000000..1b9d49ac13 Binary files /dev/null and b/docs/static/img/2023-10-15-16-44-26.png differ diff --git a/docs/static/img/20231204223204.png b/docs/static/img/20231204223204.png new file mode 100644 index 0000000000..be5d55397d Binary files /dev/null and b/docs/static/img/20231204223204.png differ diff --git a/docs/static/img/benchmark.png b/docs/static/img/benchmark.png new file mode 100644 index 0000000000..e5feb96b29 Binary files /dev/null and b/docs/static/img/benchmark.png differ diff --git a/docs/static/img/box.png b/docs/static/img/box.png new file mode 100644 index 0000000000..316d4587ad Binary files /dev/null and b/docs/static/img/box.png differ diff --git a/docs/static/img/build-linux.png b/docs/static/img/build-linux.png new file mode 100644 index 0000000000..51b0e71ab9 Binary files /dev/null and b/docs/static/img/build-linux.png differ diff --git a/docs/static/img/compatible.png b/docs/static/img/compatible.png new file mode 100644 index 0000000000..830af4c506 Binary files /dev/null and b/docs/static/img/compatible.png differ diff --git a/docs/static/img/consistency.png b/docs/static/img/consistency.png new file mode 100644 index 0000000000..f277410ecc Binary files /dev/null and b/docs/static/img/consistency.png differ diff --git a/docs/static/img/farm-plugin-hooks.png b/docs/static/img/farm-plugin-hooks.png new file mode 100644 index 0000000000..f83f1b7e59 Binary files /dev/null and b/docs/static/img/farm-plugin-hooks.png differ diff --git a/docs/static/img/farm-social-card.png b/docs/static/img/farm-social-card.png new file mode 100644 index 0000000000..727ecfcae4 Binary files /dev/null and b/docs/static/img/farm-social-card.png differ diff --git a/docs/static/img/favicon.ico b/docs/static/img/favicon.ico new file mode 100644 index 0000000000..80465dedc0 Binary files /dev/null and b/docs/static/img/favicon.ico differ diff --git a/docs/static/img/feature.png b/docs/static/img/feature.png new file mode 100644 index 0000000000..4f3f569120 Binary files /dev/null and b/docs/static/img/feature.png differ diff --git a/docs/static/img/github-mark.svg b/docs/static/img/github-mark.svg new file mode 100644 index 0000000000..37fa923df3 --- /dev/null +++ b/docs/static/img/github-mark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/static/img/hmr-linux.png b/docs/static/img/hmr-linux.png new file mode 100644 index 0000000000..8a39eb0071 Binary files /dev/null and b/docs/static/img/hmr-linux.png differ diff --git a/docs/static/img/logo-farm.png b/docs/static/img/logo-farm.png new file mode 100644 index 0000000000..67112a5ca4 Binary files /dev/null and b/docs/static/img/logo-farm.png differ diff --git a/docs/static/img/logo.png b/docs/static/img/logo.png new file mode 100644 index 0000000000..0caeb43812 Binary files /dev/null and b/docs/static/img/logo.png differ diff --git a/docs/static/img/plug.png b/docs/static/img/plug.png new file mode 100644 index 0000000000..716131e153 Binary files /dev/null and b/docs/static/img/plug.png differ diff --git a/docs/static/img/plug.svg b/docs/static/img/plug.svg new file mode 100644 index 0000000000..929a811caa --- /dev/null +++ b/docs/static/img/plug.svg @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Openclipart + + + icon bus bar + 2007-04-18T02:48:48 + simple red circular icon with white simplified power cord + http://openclipart.org/detail/3987/icon-bus-bar-by-jportugall + + + JPortugall + + + + + clip art + clipart + event + icon + image + media + microphone + organization + public domain + svg + + + + + + + + + + + diff --git a/docs/static/img/rocket.png b/docs/static/img/rocket.png new file mode 100644 index 0000000000..56e71a4c99 Binary files /dev/null and b/docs/static/img/rocket.png differ diff --git a/docs/static/img/rocket.svg b/docs/static/img/rocket.svg new file mode 100644 index 0000000000..b46f58aed0 --- /dev/null +++ b/docs/static/img/rocket.svg @@ -0,0 +1,396 @@ + + + + + image/svg+xml + + image/svg+xml + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/static/img/startup-linux.png b/docs/static/img/startup-linux.png new file mode 100644 index 0000000000..43602db210 Binary files /dev/null and b/docs/static/img/startup-linux.png differ diff --git a/docs/static/img/toolbox.svg b/docs/static/img/toolbox.svg new file mode 100644 index 0000000000..83b3e7a5a3 --- /dev/null +++ b/docs/static/img/toolbox.svg @@ -0,0 +1,4272 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Openclipart + + + + + + + + + + + diff --git a/docs/tailwind.config.js b/docs/tailwind.config.js new file mode 100644 index 0000000000..11c513de66 --- /dev/null +++ b/docs/tailwind.config.js @@ -0,0 +1,169 @@ +const { + default: flattenColorPalette, +} = require("tailwindcss/lib/util/flattenColorPalette"); + +/** @type {import('tailwindcss').Config} */ +module.exports = { + corePlugins: { + preflight: false, + }, + darkMode: ["class"], + content: ["./src/**/*.{js,jsx,ts,tsx}"], + theme: { + extend: { + "brand-color": "#fea7df", + colors: { + soft: "var(--ifm-f-white-soft2)", + border: "hsl(var(--border))", + input: "hsl(var(--input))", + ring: "hsl(var(--ring))", + background: "hsl(var(--background))", + foreground: "hsl(var(--foreground))", + primary: { + DEFAULT: "hsl(var(--primary))", + foreground: "hsl(var(--primary-foreground))", + }, + secondary: { + DEFAULT: "hsl(var(--secondary))", + foreground: "hsl(var(--secondary-foreground))", + }, + destructive: { + DEFAULT: "hsl(var(--destructive))", + foreground: "hsl(var(--destructive-foreground))", + }, + muted: { + DEFAULT: "hsl(var(--muted))", + foreground: "hsl(var(--muted-foreground))", + }, + accent: { + DEFAULT: "hsl(var(--accent))", + foreground: "hsl(var(--accent-foreground))", + }, + popover: { + DEFAULT: "hsl(var(--popover))", + foreground: "hsl(var(--popover-foreground))", + }, + card: { + DEFAULT: "hsl(var(--card))", + foreground: "hsl(var(--card-foreground))", + }, + }, + }, + + animation: { + aurora: "aurora 60s linear infinite", + shimmer: "shimmer 8s infinite", + "border-beam": "border-beam calc(var(--duration)*1s) infinite linear", + marquee: "marquee var(--duration) linear infinite", + "marquee-vertical": "marquee-vertical var(--duration) linear infinite", + backgroundPositionSpin: + "background-position-spin 3000ms infinite alternate", + "accordion-down": "accordion-down 0.2s ease-out", + "accordion-up": "accordion-up 0.2s ease-out", + "border-beam": "border-beam calc(var(--duration)*1s) infinite linear", + "image-glow": "image-glow 4100ms 600ms ease-out forwards", + "fade-in": "fade-in 1000ms var(--animation-delay, 0ms) ease forwards", + "fade-up": "fade-up 1000ms var(--animation-delay, 0ms) ease forwards", + shimmer: "shimmer 8s infinite", + marquee: "marquee var(--duration) infinite linear", + "marquee-vertical": "marquee-vertical var(--duration) linear infinite", + }, + keyframes: { + aurora: { + from: { + backgroundPosition: "50% 50%, 50% 50%", + }, + to: { + backgroundPosition: "350% 50%, 350% 50%", + }, + }, + marquee: { + from: { transform: "translateX(0)" }, + to: { transform: "translateX(calc(-100% - var(--gap)))" }, + }, + "marquee-vertical": { + from: { transform: "translateY(0)" }, + to: { transform: "translateY(calc(-100% - var(--gap)))" }, + }, + "border-beam": { + "100%": { + "offset-distance": "100%", + }, + }, + shimmer: { + "0%, 90%, 100%": { + "background-position": "calc(-100% - var(--shimmer-width)) 0", + }, + "30%, 60%": { + "background-position": "calc(100% + var(--shimmer-width)) 0", + }, + }, + "background-position-spin": { + "0%": { backgroundPosition: "top center" }, + "100%": { backgroundPosition: "bottom center" }, + }, + "accordion-down": { + from: { height: "0" }, + to: { height: "var(--radix-accordion-content-height)" }, + }, + "accordion-up": { + from: { height: "var(--radix-accordion-content-height)" }, + to: { height: "0" }, + }, + "border-beam": { + "100%": { + "offset-distance": "100%", + }, + }, + "image-glow": { + "0%": { + opacity: "0", + "animation-timing-function": "cubic-bezier(0.74, 0.25, 0.76, 1)", + }, + "10%": { + opacity: "0.7", + "animation-timing-function": "cubic-bezier(0.12, 0.01, 0.08, 0.99)", + }, + "100%": { + opacity: "0.4", + }, + }, + "fade-in": { + from: { opacity: "0", transform: "translateY(-10px)" }, + to: { opacity: "1", transform: "none" }, + }, + "fade-up": { + from: { opacity: "0", transform: "translateY(20px)" }, + to: { opacity: "1", transform: "none" }, + }, + shimmer: { + "0%, 90%, 100%": { + "background-position": "calc(-100% - var(--shimmer-width)) 0", + }, + "30%, 60%": { + "background-position": "calc(100% + var(--shimmer-width)) 0", + }, + }, + marquee: { + from: { transform: "translateX(0)" }, + to: { transform: "translateX(calc(-100% - var(--gap)))" }, + }, + "marquee-vertical": { + from: { transform: "translateY(0)" }, + to: { transform: "translateY(calc(-100% - var(--gap)))" }, + }, + }, + }, + plugins: [addVariablesForColors, require("tailwindcss-animate")], +}; + +function addVariablesForColors({ addBase, theme }) { + let allColors = flattenColorPalette(theme("colors")); + let newVars = Object.fromEntries( + Object.entries(allColors).map(([key, val]) => [`--${key}`, val]), + ); + + addBase({ + ":root": newVars, + }); +} diff --git a/e2e/utils.ts b/e2e/utils.ts index 404dedbd45..9e044b5d62 100644 --- a/e2e/utils.ts +++ b/e2e/utils.ts @@ -57,7 +57,6 @@ export const concurrentify = Promise>(maxConcu if (queue.length > 0) { const { ctx, deferred, args } = queue.shift()!; try { - // eslint-disable-next-line no-use-before-define newFn.apply(ctx, args).then(deferred.resolve, deferred.reject); } catch (e) { deferred.reject(e); @@ -66,7 +65,6 @@ export const concurrentify = Promise>(maxConcu } function newFn(this: any) { - // eslint-disable-next-line @typescript-eslint/no-this-alias const ctx = this; const args = arguments as any; diff --git a/e2e/vitestGlobalSetup.ts b/e2e/vitestGlobalSetup.ts index 73744d0387..b66501a808 100644 --- a/e2e/vitestGlobalSetup.ts +++ b/e2e/vitestGlobalSetup.ts @@ -24,7 +24,6 @@ export async function setup({ provide }: GlobalSetupContext): Promise { client.listen(12306); - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore provide('wsEndpoint', browserServer.wsEndpoint()); } diff --git a/e2e/vitestSetup.ts b/e2e/vitestSetup.ts index 734358ff88..8c86bba5c8 100644 --- a/e2e/vitestSetup.ts +++ b/e2e/vitestSetup.ts @@ -20,7 +20,6 @@ const visitPage = async ( command: string ) => { if (!path) return; - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore const wsEndpoint = inject('wsEndpoint'); if (!wsEndpoint) { diff --git a/examples/arcgis/farm.config.ts b/examples/arcgis/farm.config.ts index b2cd554f18..efdeb06d72 100644 --- a/examples/arcgis/farm.config.ts +++ b/examples/arcgis/farm.config.ts @@ -3,6 +3,7 @@ import visualizer from "@farmfe/js-plugin-visualizer"; export default defineConfig((env) => ({ compilation: { + // lazyCompilation: false, // persistentCache: false, minify: env.mode === 'production' ? { exclude: [ @@ -27,4 +28,4 @@ export default defineConfig((env) => ({ plugins: [ process.env.FARM_VISUALIZER ? visualizer() : null ] -})) \ No newline at end of file +})) diff --git a/examples/arco-pro/e2e.spec.ts b/examples/arco-pro/e2e.spec.ts index d5555ed813..b6f4708096 100644 --- a/examples/arco-pro/e2e.spec.ts +++ b/examples/arco-pro/e2e.spec.ts @@ -38,16 +38,17 @@ describe(`e2e tests - ${name}`, async () => { // browser HMR should work if (command === 'start') { - const filePath = fileURLToPath( - path.join( - path.dirname(import.meta.url), - 'src', - 'pages', - 'dashboard', - 'workplace', - 'docs.tsx' - ) + const __filename = fileURLToPath(import.meta.url); + const __dirname = path.dirname(__filename); + const filePath = path.join( + __dirname, + 'src', + 'pages', + 'dashboard', + 'workplace', + 'docs.tsx' ); + const content = readFileSync(filePath, 'utf-8'); writeFileSync( filePath, @@ -74,11 +75,12 @@ describe(`e2e tests - ${name}`, async () => { command ); - test('exmaples arco-pro run start', async () => { - await runTest(); - }) + test('exmaples arco-pro run start', async () => { + await runTest(); + }) - test('exampels arco-pro run preview', async () => { - await runTest('preview'); - }) + // TODO uncomment this when new preview server is ready + // test('exampels arco-pro run preview', async () => { + // await runTest('preview'); + // }) }); diff --git a/examples/arco-pro/farm.config.ts b/examples/arco-pro/farm.config.ts index a5c2cff7c8..2201d30c32 100644 --- a/examples/arco-pro/farm.config.ts +++ b/examples/arco-pro/farm.config.ts @@ -1,36 +1,33 @@ import { resolve } from 'node:path'; import { defineConfig } from '@farmfe/core'; import farmJsPluginLess from '@farmfe/js-plugin-less'; -import farmJsPluginSvgr from '@farmfe/js-plugin-svgr'; +import svgr from '@farmfe/js-plugin-svgr'; export default defineConfig((env) => { return { compilation: { - resolve: { - alias: { - '@': resolve(process.cwd(), './src'), - } + input: { + index: './index.html' }, + sourcemap: true, + presetEnv: false, + concatenateModules: true, output: { - path: './build', - filename: 'assets/[resourceName].[contentHash].[ext]', - assetsFilename: 'static/[resourceName].[contentHash].[ext]' + // showFileSize: false, }, - partialBundling: { - targetMinSize: 1024 * 2 + persistentCache: false, + resolve: { + alias: { + "@": resolve(process.cwd(), "./src"), + }, + dedupe: ["react", "react-dom"], }, - progress: false }, plugins: [ - [ - '@farmfe/plugin-react', - { - refresh: env.mode === 'development', - development: env.mode === 'development' - } - ], - '@farmfe/plugin-svgr', + '@farmfe/plugin-react', + // '@farmfe/plugin-svgr', + svgr(), farmJsPluginLess(), - ] + ], }; }); diff --git a/examples/arco-pro/src/layout.tsx b/examples/arco-pro/src/layout.tsx index ba55003ba2..a5286ba05b 100644 --- a/examples/arco-pro/src/layout.tsx +++ b/examples/arco-pro/src/layout.tsx @@ -56,68 +56,22 @@ function getIconFromKey(key) { } function getFlattenRoutes(routes) { - const res = [] - // function travel(_routes) { - // _routes.forEach((route) => { - // if (route.key && !route.children) { - // route.component = lazyload(() => import(`./pages/${route.key}`)); - // res.push(route); - // } else if (isArray(route.children) && route.children.length) { - // travel(route.children); - // } - // }); - // } - // travel(routes); - - // You may be very surprised why it is written this way, so am I... + const res = []; + // @ts-ignore + const mod = import.meta.glob("./pages/**/*.tsx"); function travel(_routes) { _routes.forEach((route) => { if (route.key && !route.children) { - if (route.key.includes('dashboard/monitor')) { - route.component = lazyload(() => import('./pages/dashboard/monitor')) - } else if (route.key.includes('dashboard/workplace')) { - route.component = lazyload(() => import('./pages/dashboard/workplace')) - } else if (route.key.includes('exception/403')) { - route.component = lazyload(() => import('./pages/exception/403')) - } else if (route.key.includes('exception/404')) { - route.component = lazyload(() => import('./pages/exception/404')) - } else if (route.key.includes('exception/500')) { - route.component = lazyload(() => import('./pages/exception/500')) - } else if (route.key.includes('form/group')) { - route.component = lazyload(() => import('./pages/form/group')) - } else if (route.key.includes('form/step')) { - route.component = lazyload(() => import('./pages/form/step')) - } else if (route.key.includes('list/card')) { - route.component = lazyload(() => import('./pages/list/card')) - } else if (route.key.includes('list/search-table')) { - route.component = lazyload(() => import('./pages/list/search-table')) - } else if (route.key.includes('profile/basic')) { - route.component = lazyload(() => import('./pages/profile/basic')) - } else if (route.key.includes('result/error')) { - route.component = lazyload(() => import('./pages/result/error')) - } else if (route.key.includes('result/success')) { - route.component = lazyload(() => import('./pages/result/success')) - } else if (route.key.includes('user/info')) { - route.component = lazyload(() => import('./pages/user/info')) - } else if (route.key.includes('user/setting')) { - route.component = lazyload(() => import('./pages/user/setting')) - } else if (route.key.includes('visualization/data-analysis')) { - route.component = lazyload(() => import('./pages/visualization/data-analysis')) - } else if (route.key.includes('visualization/multi-dimension-data-analysis')) { - route.component = lazyload(() => import('./pages/visualization/multi-dimension-data-analysis')) - } else if (route.key.includes('welcome')) { - route.component = lazyload(() => import('./pages/welcome')) - } else if (route.key.includes('login')) { - route.component = lazyload(() => import('./pages/login')) - } - res.push(route) + route.component = lazyload(mod[`./pages/${route.key}/index.tsx`]); + res.push(route); } else if (isArray(route.children) && route.children.length) { - travel(route.children) + travel(route.children); } - }) + }); } - travel(routes) - return res + + travel(routes); + return res; } function PageLayout() { diff --git a/examples/arco-pro/src/pages/dashboard/monitor/mock/index.ts b/examples/arco-pro/src/pages/dashboard/monitor/mock/index.ts index 1113c672a3..af0fee885c 100644 --- a/examples/arco-pro/src/pages/dashboard/monitor/mock/index.ts +++ b/examples/arco-pro/src/pages/dashboard/monitor/mock/index.ts @@ -9,7 +9,7 @@ setupMock({ { "id|+1": 1, username: "用户7352772", - content: "马上就开始了,好激动!", + content: "马上就开始了,好激动!13213222", time: "13:09:12", "isCollect|2": true } diff --git a/examples/build-lib-external/package.json b/examples/build-lib-external/package.json index 158e4443e1..12b87d8276 100644 --- a/examples/build-lib-external/package.json +++ b/examples/build-lib-external/package.json @@ -1,5 +1,5 @@ { - "name": "@farm-exmaples/a-learn", + "name": "@farmfe-examples/a-learn", "version": "1.0.0", "description": "", "private": true, @@ -19,4 +19,4 @@ }, "author": "", "license": "ISC" -} \ No newline at end of file +} diff --git a/examples/decorators/farm.config.ts b/examples/decorators/farm.config.ts index 1c73ce4ae4..3e971faffd 100644 --- a/examples/decorators/farm.config.ts +++ b/examples/decorators/farm.config.ts @@ -13,6 +13,7 @@ export default defineConfig({ excludes: ['node_modules/'], } }, + mode: 'development', presetEnv: false, minify: false, persistentCache: false, @@ -20,9 +21,14 @@ export default defineConfig({ main: 'src/broken.ts', }, output: { - targetEnv: 'node', + targetEnv: 'library', entryFilename: '[entryName].mjs', filename: '[name].[hash].mjs', + format: 'esm' }, + treeShaking: false, + resolve: { + autoExternalFailedResolve: true, + } }, }); diff --git a/examples/decorators/package.json b/examples/decorators/package.json index d80dc26770..71eefcf75a 100644 --- a/examples/decorators/package.json +++ b/examples/decorators/package.json @@ -3,13 +3,14 @@ "version": "1.0.1", "private": true, "devDependencies": { - "@farmfe/cli": "^1.0.1", - "@farmfe/core": "^1.2.4" + "@farmfe/cli": "workspace:*", + "@farmfe/core": "workspace:*" }, "scripts": { "build": "farm build && node test.mjs" }, "dependencies": { + "@swc/helpers": "^0.5.0", "core-js": "^3.33.3", "reflect-metadata": "^0.1.13" } diff --git a/examples/external/package.json b/examples/external/package.json index c0d31de248..63b4eecd43 100644 --- a/examples/external/package.json +++ b/examples/external/package.json @@ -11,8 +11,8 @@ "clean": "farm clean" }, "devDependencies": { - "@farmfe/cli": "^1.0.1", - "@farmfe/core": "^1.1.1", + "@farmfe/cli": "workspace:*", + "@farmfe/core": "workspace:*", "@types/jquery": "^3.5.29", "jquery": "^3.7.1", "typescript": "^5.4.3" diff --git a/examples/import-meta/package.json b/examples/import-meta/package.json index a37d9efbc2..f4357f13a0 100644 --- a/examples/import-meta/package.json +++ b/examples/import-meta/package.json @@ -12,7 +12,7 @@ "author": "", "license": "ISC", "devDependencies": { - "@farmfe/cli": "^1.0.4", + "@farmfe/cli": "workspace:*", "@farmfe/core": "workspace:*" } } diff --git a/examples/invalid-css-issue-1557/package.json b/examples/invalid-css-issue-1557/package.json index 133ef446db..f46a0dd3a7 100644 --- a/examples/invalid-css-issue-1557/package.json +++ b/examples/invalid-css-issue-1557/package.json @@ -17,9 +17,9 @@ "react-highlight-words": "^0.20.0" }, "devDependencies": { - "@farmfe/cli": "^1.0.2", - "@farmfe/core": "^1.2.8", - "@farmfe/plugin-react": "^1.1.0", + "@farmfe/cli": "workspace:*", + "@farmfe/core": "workspace:*", + "@farmfe/plugin-react": "2.0.0-nightly-20241022124925", "@types/react": "18", "@types/react-dom": "18", "core-js": "^3.36.1", diff --git a/examples/lazy-compilation/farm.config.ts b/examples/lazy-compilation/farm.config.ts index 8bb2754261..86dda4c707 100644 --- a/examples/lazy-compilation/farm.config.ts +++ b/examples/lazy-compilation/farm.config.ts @@ -5,7 +5,6 @@ export default defineConfig({ persistentCache: false, progress: false }, - clearScreen: false, server: { host: '127.0.0.1' } diff --git a/examples/lib/farm.config.ts b/examples/lib/farm.config.ts new file mode 100644 index 0000000000..a0dcbe605a --- /dev/null +++ b/examples/lib/farm.config.ts @@ -0,0 +1,27 @@ +import { defineConfig } from '@farmfe/core'; +import farmDtsPlugin from '@farmfe/js-plugin-dts'; +import path from 'node:path'; +export default defineConfig({ + compilation: { + presetEnv: false, + progress: false, + input: { + index: "./index.ts" + }, + output: { + targetEnv: 'node' + }, + persistentCache: false, + resolve: { + alias: { + "@": path.resolve("./src") + } + } + }, + // plugins: [ + // farmDtsPlugin({ + // tsConfigPath: './tsconfig.json' + // }) + // ] + // plugins: ['@farmfe/plugin-dts'] +}); diff --git a/examples/lib/index.ts b/examples/lib/index.ts new file mode 100644 index 0000000000..c18dd4cc07 --- /dev/null +++ b/examples/lib/index.ts @@ -0,0 +1,10 @@ +import { name as names } from './test.ts'; +import type { base } from './test.ts'; +export const a: number = 1; +import type { UserInfo } from '@/test2.ts'; +// 我是奥特曼 +export function b(name: string, userInfo: UserInfo): T { + return name + names as T; +} + +console.log(b('123', { name: '123' })) diff --git a/examples/lib/package.json b/examples/lib/package.json new file mode 100644 index 0000000000..12d011e119 --- /dev/null +++ b/examples/lib/package.json @@ -0,0 +1,16 @@ +{ + "name": "lib", + "private": true, + "version": "1.0.0", + "type": "module", + "scripts": { + "build": "farm build", + "clean": "farm clean" + }, + "devDependencies": { + "@farmfe/cli": "workspace:*", + "typescript": "^5.4.3", + "@farmfe/js-plugin-dts": "workspace:*", + "@farmfe/plugin-dts": "workspace:*" + } +} diff --git a/examples/lib/src/test2.ts b/examples/lib/src/test2.ts new file mode 100644 index 0000000000..44cd66bc71 --- /dev/null +++ b/examples/lib/src/test2.ts @@ -0,0 +1,17 @@ +export interface UserInfo { + name: string; + age: number; + gender: string; +} + +export const userInfo: UserInfo = { + name: "John", + age: 20, + gender: "male" +} + +export const userInfo2 = { + name: "Jane", + age: 21, + gender: "female" +} diff --git a/examples/lib/test.ts b/examples/lib/test.ts new file mode 100644 index 0000000000..a10cce1886 --- /dev/null +++ b/examples/lib/test.ts @@ -0,0 +1,19 @@ +type Name = { + name: string; + age: number; + gender: string; + address: string; + phone: string; + email: string; +} + +export const name: Name = { + name: '123', + age: 18, + gender: 'male', + address: '123', + phone: '123', + email: '123', +} + +export type base = string; diff --git a/examples/lib/tsconfig.json b/examples/lib/tsconfig.json new file mode 100644 index 0000000000..75abdef265 --- /dev/null +++ b/examples/lib/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src"] +} diff --git a/examples/module-concatenation/app.tsx b/examples/module-concatenation/app.tsx new file mode 100644 index 0000000000..1a1173c2ee --- /dev/null +++ b/examples/module-concatenation/app.tsx @@ -0,0 +1,18 @@ +import React from './react'; +import util1 from './util1.cjs'; + +import commonInner from './common.mjs'; + +function common() { + return 'common-outer'; +} + +export function App() { + return ( +
+

{util1.util1() + util1.util2()}

+

{commonInner()}

+
+ ); +} + diff --git a/examples/module-concatenation/common.mjs b/examples/module-concatenation/common.mjs new file mode 100644 index 0000000000..51e8ba8897 --- /dev/null +++ b/examples/module-concatenation/common.mjs @@ -0,0 +1,11 @@ +export default function common() { + return 'common'; +} +common(); + +// -----> + +// function a() { +// return +// } +// a(); \ No newline at end of file diff --git a/examples/module-concatenation/expected-app1.tsx b/examples/module-concatenation/expected-app1.tsx new file mode 100644 index 0000000000..09d297165b --- /dev/null +++ b/examples/module-concatenation/expected-app1.tsx @@ -0,0 +1,38 @@ +// ----> +function (module, exports, farmRequire, farmDynamicRequire) { + var react = _interop_default_(farmRequire('./react')); + var util1 = _interop_default_(farmRequire('./util1.cjs')); + + // ---- content of common.mjs ---- + function common1() { + return 'common'; + } + common1(); + var commonInner = common1; + // ---- end of common.mjs ---- + + function common() { + return 'common-outer'; + } + + module.o(exports, 'App', function App() { + return ( + react.createElement( + 'div', + null, + [ + react.createElement( + 'h1', + null, + util1.util1() + util1.util2() + ), + react.createElement( + 'h1', + null, + commonInner() + ) + ] + ) + ); + }) +} diff --git a/examples/module-concatenation/farm.config.ts b/examples/module-concatenation/farm.config.ts new file mode 100644 index 0000000000..3fe69d9caa --- /dev/null +++ b/examples/module-concatenation/farm.config.ts @@ -0,0 +1,14 @@ +import { defineConfig } from "@farmfe/core"; +import react from '@farmfe/plugin-react'; + +export default defineConfig({ + compilation: { + concatenateModules: true, + persistentCache: false, + treeShaking: false, + }, + server: { + writeToDisk: true, + }, + plugins: [react()] +}) \ No newline at end of file diff --git a/examples/module-concatenation/index.html b/examples/module-concatenation/index.html new file mode 100644 index 0000000000..8de9b098b1 --- /dev/null +++ b/examples/module-concatenation/index.html @@ -0,0 +1,12 @@ + + + + + + Document + + + + + + \ No newline at end of file diff --git a/examples/module-concatenation/index.tsx b/examples/module-concatenation/index.tsx new file mode 100644 index 0000000000..133e131f8a --- /dev/null +++ b/examples/module-concatenation/index.tsx @@ -0,0 +1,44 @@ +import React from './react'; +import ReactDom from './react-dom'; + +import { App } from './app'; + +ReactDom.render( + , + document.getElementById('root') +); + +// // ----> +// const react = _interop_default_(farmRequire('./react')); +// const util1 = _interop_default_(farmRequire('./util1.cjs')); + +// function common1() { +// return 'common'; +// } +// common1(); +// var commonInner = common1; + +// function common() { +// return 'common-outer'; +// } + +// function App() { +// return ( +// react.createElement( +// 'div', +// null, +// [ +// react.createElement( +// 'h1', +// null, +// util1.util1() + util1.util2() +// ), +// react.createElement( +// 'h1', +// null, +// commonInner() +// ) +// ] +// ) +// ); +// } \ No newline at end of file diff --git a/examples/module-concatenation/package.json b/examples/module-concatenation/package.json new file mode 100644 index 0000000000..ce7e262e59 --- /dev/null +++ b/examples/module-concatenation/package.json @@ -0,0 +1,26 @@ +{ + "name": "@farmfe-examples/module-concatenation", + "version": "0.0.1", + "private": true, + "type": "module", + "dependencies": { + "core-js": "^3.30.1", + "react": "18", + "react-dom": "18" + }, + "devDependencies": { + "@farmfe/cli": "workspace:*", + "@farmfe/core": "workspace:*", + "@farmfe/plugin-react": "workspace:*", + "@types/react": "18", + "@types/react-dom": "18", + "react-refresh": "^0.14.0" + }, + "scripts": { + "start": "farm start", + "dev": "farm start", + "build": "farm build", + "preview": "farm preview", + "clean": "farm clean" + } +} diff --git a/examples/module-concatenation/react-dom.js b/examples/module-concatenation/react-dom.js new file mode 100644 index 0000000000..6d9496c44b --- /dev/null +++ b/examples/module-concatenation/react-dom.js @@ -0,0 +1,3 @@ +exports.render = function(element, container) { + container.appendChild(element) +} \ No newline at end of file diff --git a/examples/module-concatenation/react.js b/examples/module-concatenation/react.js new file mode 100644 index 0000000000..73fa860f9c --- /dev/null +++ b/examples/module-concatenation/react.js @@ -0,0 +1,5 @@ +module.exports = { + useState: function() { + return [] + } +} \ No newline at end of file diff --git a/examples/module-concatenation/util1.cjs b/examples/module-concatenation/util1.cjs new file mode 100644 index 0000000000..f1338e74bd --- /dev/null +++ b/examples/module-concatenation/util1.cjs @@ -0,0 +1,6 @@ +const { util2 } = require('./util2'); + +exports.util1 = () => { + console.log('util1'); +}; +exports.util2 = util2; \ No newline at end of file diff --git a/examples/module-concatenation/util2.cjs b/examples/module-concatenation/util2.cjs new file mode 100644 index 0000000000..6105f4ae05 --- /dev/null +++ b/examples/module-concatenation/util2.cjs @@ -0,0 +1,3 @@ +exports.util2 = () => { + console.log('util2'); +}; \ No newline at end of file diff --git a/examples/nestjs/package.json b/examples/nestjs/package.json index 0bcdfc2f3c..e4b0757d66 100644 --- a/examples/nestjs/package.json +++ b/examples/nestjs/package.json @@ -1,5 +1,5 @@ { - "name": "nest", + "name": "@farmfe-examples/nest", "version": "0.0.1", "description": "", "author": "", diff --git a/examples/node-lazy-compile/e2e.spec.ts b/examples/node-lazy-compile/e2e.spec.ts index 3abdc08edf..e4084c0567 100644 --- a/examples/node-lazy-compile/e2e.spec.ts +++ b/examples/node-lazy-compile/e2e.spec.ts @@ -1,4 +1,4 @@ -import { test } from 'vitest'; +import { test, expect, describe } from 'vitest'; import { watchProjectAndTest } from '../../e2e/vitestSetup.js'; import { basename, dirname } from 'path'; import { fileURLToPath } from 'url'; @@ -6,12 +6,13 @@ import { fileURLToPath } from 'url'; const name = basename(import.meta.url); const projectPath = dirname(fileURLToPath(import.meta.url)); -test(`e2e tests - ${name}`, async () => { +describe(`e2e tests - ${name}`, async () => { const runTest = (command?: 'watch' | 'preview') => watchProjectAndTest( projectPath, async (log, done) => { if (command === 'preview') { + console.log(log); if (log.includes('script start') && log.includes('111aaa')) { done(); } @@ -25,7 +26,11 @@ test(`e2e tests - ${name}`, async () => { ); // preview build - await runTest('preview'); - await runTest('watch'); - await runTest('preview'); + test('preview', async () => { + await runTest('preview'); + }); + + test('watch', async () => { + await runTest('watch'); + }); }); diff --git a/examples/public-dir/src/main.tsx b/examples/public-dir/src/main.tsx index 56357bee78..c7c53774a4 100644 --- a/examples/public-dir/src/main.tsx +++ b/examples/public-dir/src/main.tsx @@ -1,7 +1,8 @@ import React, { useState } from "react"; import "./main.css"; import reactLogo from "./assets/react.svg"; -// import FarmLogo from "../public/logo.png"; +import FarmLogo from "/new-logo.png"; +// import FarmLogo from "../newPublic/new-logo.png"; export function Main() { const [count, setCount] = useState(0); diff --git a/examples/qrcode/index.html b/examples/qrcode/index.html index fd9f1ccb1e..922f24fad7 100644 --- a/examples/qrcode/index.html +++ b/examples/qrcode/index.html @@ -6,7 +6,7 @@ Document -
+
diff --git a/examples/react-antd/farm.config.ts b/examples/react-antd/farm.config.ts index e7213bbe4e..b79621536a 100644 --- a/examples/react-antd/farm.config.ts +++ b/examples/react-antd/farm.config.ts @@ -19,3 +19,5 @@ export default defineConfig({ }, plugins: ['@farmfe/plugin-react', '@farmfe/plugin-sass'] }); + + diff --git a/examples/react-fast-refresh/package.json b/examples/react-fast-refresh/package.json index d993f6b072..ff5965fb28 100644 --- a/examples/react-fast-refresh/package.json +++ b/examples/react-fast-refresh/package.json @@ -1,6 +1,7 @@ { - "name": "react-fast-refresh", + "name": "@farmfe-examples/react-fast-refresh", "version": "1.0.0", + "private": true, "scripts": { "dev": "farm start", "start": "farm start", @@ -13,12 +14,12 @@ "react-dom": "18" }, "devDependencies": { - "@farmfe/cli": "workspace:", - "@farmfe/core": "workspace:", - "@farmfe/plugin-react": "workspace:", + "@farmfe/cli": "workspace:*", + "@farmfe/core": "workspace:*", + "@farmfe/plugin-react": "workspace:*", "@types/react": "18", "core-js": "^3.36.1", "@types/react-dom": "18", "react-refresh": "^0.14.0" } -} \ No newline at end of file +} diff --git a/examples/react/farm.config.js b/examples/react/farm.config.js index 153d91287e..f6671cc142 100644 --- a/examples/react/farm.config.js +++ b/examples/react/farm.config.js @@ -8,7 +8,11 @@ export default defineConfig((env) => { return { compilation: { sourcemap: true, - persistentCache: false, + // persistentCache: false, + persistentCache: { + // cacheDir: "node_modules/.farm/adny", + cacheDir: "node_modules/adny/cache", + }, presetEnv: false, minify: false, progress: false, diff --git a/examples/react/public/vite.svg b/examples/react/public/vite.svg new file mode 100644 index 0000000000..e7b8dfb1b2 --- /dev/null +++ b/examples/react/public/vite.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/react/src/vite.svg b/examples/react/src/vite.svg new file mode 100644 index 0000000000..e7b8dfb1b2 --- /dev/null +++ b/examples/react/src/vite.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/refactor-react/.env.staging b/examples/refactor-react/.env.staging new file mode 100644 index 0000000000..760b5afdd1 --- /dev/null +++ b/examples/refactor-react/.env.staging @@ -0,0 +1 @@ +FARM_BASE_AOV=2000000 diff --git a/examples/refactor-react/.gitignore b/examples/refactor-react/.gitignore new file mode 100644 index 0000000000..a4cf82d2cd --- /dev/null +++ b/examples/refactor-react/.gitignore @@ -0,0 +1,22 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.sln +*.sw? diff --git a/examples/refactor-react/README.md b/examples/refactor-react/README.md new file mode 100644 index 0000000000..5802e857f7 --- /dev/null +++ b/examples/refactor-react/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/examples/refactor-react/about.html b/examples/refactor-react/about.html new file mode 100644 index 0000000000..dab6f0c55f --- /dev/null +++ b/examples/refactor-react/about.html @@ -0,0 +1,14 @@ + + + + + + + + + Farm + React + TS + + +
dfgdfgfdgdfgdfgdfgdfg
+ + diff --git a/examples/refactor-react/base.html b/examples/refactor-react/base.html new file mode 100644 index 0000000000..a74f5cadaf --- /dev/null +++ b/examples/refactor-react/base.html @@ -0,0 +1,14 @@ + + + + + + + + + Farm + React + TS + + +
asdsadasdasdasd
+ + diff --git a/examples/refactor-react/farm.config.ts b/examples/refactor-react/farm.config.ts new file mode 100644 index 0000000000..2b59f275f5 --- /dev/null +++ b/examples/refactor-react/farm.config.ts @@ -0,0 +1,32 @@ +import { defineConfig, loadEnv } from "@farmfe/core"; +import path from 'node:path' +import react from "@farmfe/plugin-react"; + +export default defineConfig({ + plugins: [ + react(), + ], + compilation: { + input: { + index: path.resolve(__dirname, "index.html"), + base: path.resolve(__dirname, 'base.html'), + about: path.resolve(__dirname, 'about.html'), + }, + progress: false, + persistentCache: false, + sourcemap: false, + output: { + publicPath: "/aaa/", + filename: '[ext]/[name]-[hash].[ext]', + assetsFilename: 'assets/[name]-[hash].[ext]', + }, + partialBundling: { + groups: [ + { + name: "vendor-react", + test: ["node_modules/"], + }, + ], + }, + }, +}); diff --git a/examples/refactor-react/index.html b/examples/refactor-react/index.html new file mode 100644 index 0000000000..816b922910 --- /dev/null +++ b/examples/refactor-react/index.html @@ -0,0 +1,15 @@ + + + + + + + + + Farm + React + TS + + +
+ + + diff --git a/examples/refactor-react/package.json b/examples/refactor-react/package.json new file mode 100644 index 0000000000..0629ef955f --- /dev/null +++ b/examples/refactor-react/package.json @@ -0,0 +1,28 @@ +{ + "name": "@farmfe-examples/react-template", + "version": "1.0.0", + "type": "module", + "private": true, + "scripts": { + "dev": "farm", + "start": "farm start --debug", + "build": "farm build", + "preview": "farm preview", + "clean": "farm clean" + }, + "dependencies": { + "@ant-design/happy-work-theme": "^1.0.0", + "antd": "^5.4.2", + "react": "18", + "react-dom": "18" + }, + "devDependencies": { + "@farmfe/cli": "workspace:*", + "@farmfe/core": "workspace:*", + "@farmfe/plugin-react": "workspace:*", + "@types/react": "18", + "@types/react-dom": "18", + "core-js": "^3.36.1", + "react-refresh": "^0.14.0" + } +} diff --git a/examples/refactor-react/public/favicon.ico b/examples/refactor-react/public/favicon.ico new file mode 100644 index 0000000000..80465dedc0 Binary files /dev/null and b/examples/refactor-react/public/favicon.ico differ diff --git a/examples/refactor-react/public/react.svg b/examples/refactor-react/public/react.svg new file mode 100644 index 0000000000..6c87de9bb3 --- /dev/null +++ b/examples/refactor-react/public/react.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/refactor-react/public/test/react.svg b/examples/refactor-react/public/test/react.svg new file mode 100644 index 0000000000..6c87de9bb3 --- /dev/null +++ b/examples/refactor-react/public/test/react.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/refactor-react/src/assets/base/react.svg b/examples/refactor-react/src/assets/base/react.svg new file mode 100644 index 0000000000..6c87de9bb3 --- /dev/null +++ b/examples/refactor-react/src/assets/base/react.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/refactor-react/src/assets/logo.png b/examples/refactor-react/src/assets/logo.png new file mode 100644 index 0000000000..0caeb43812 Binary files /dev/null and b/examples/refactor-react/src/assets/logo.png differ diff --git a/examples/refactor-react/src/assets/react.svg b/examples/refactor-react/src/assets/react.svg new file mode 100644 index 0000000000..6c87de9bb3 --- /dev/null +++ b/examples/refactor-react/src/assets/react.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/refactor-react/src/index.css b/examples/refactor-react/src/index.css new file mode 100644 index 0000000000..6cc4daf982 --- /dev/null +++ b/examples/refactor-react/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/examples/refactor-react/src/index.tsx b/examples/refactor-react/src/index.tsx new file mode 100644 index 0000000000..d808fef795 --- /dev/null +++ b/examples/refactor-react/src/index.tsx @@ -0,0 +1,11 @@ +import React from 'react'; +import { createRoot } from 'react-dom/client'; +import { Main } from './main'; +import './index.css' + + +const container = document.querySelector('#root'); +// biome-ignore lint/style/noNonNullAssertion: +const root = createRoot(container!); + +root.render(
) diff --git a/examples/refactor-react/src/main.css b/examples/refactor-react/src/main.css new file mode 100644 index 0000000000..97420f8caf --- /dev/null +++ b/examples/refactor-react/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 #9761fbaa); +} + +@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/examples/refactor-react/src/main.tsx b/examples/refactor-react/src/main.tsx new file mode 100644 index 0000000000..d0aa29de7b --- /dev/null +++ b/examples/refactor-react/src/main.tsx @@ -0,0 +1,44 @@ +import { useState } from "react"; +import "./main.css"; +import reactLogo from "/react.svg"; +import FarmLogo from "./assets/logo.png"; +// import { a } from './a.js' +// import { Button } from 'antd' +// import { HappyProvider } from '@ant-design/happy-work-theme'; +console.log(import.meta.env); + +export function Main() { + const [count, setCount] = useState(0); + // console.log(a); + + return ( + <> + + {/* + + + + + */} +

Farm + react

+
+ +

+ Edit src/main.tsx and save to test HMR +

+
+

+ Click on the Farm and React logos to learn more +

+ + ); +} diff --git a/examples/refactor-react/src/typings.d.ts b/examples/refactor-react/src/typings.d.ts new file mode 100644 index 0000000000..fa0a2da548 --- /dev/null +++ b/examples/refactor-react/src/typings.d.ts @@ -0,0 +1,3 @@ +declare module '*.svg'; +declare module '*.png'; +declare module '*.css'; diff --git a/examples/refactor-react/tsconfig.json b/examples/refactor-react/tsconfig.json new file mode 100644 index 0000000000..7a7611e4a3 --- /dev/null +++ b/examples/refactor-react/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/examples/refactor-react/tsconfig.node.json b/examples/refactor-react/tsconfig.node.json new file mode 100644 index 0000000000..8d4232518e --- /dev/null +++ b/examples/refactor-react/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/examples/resolve-module-graph/package.json b/examples/resolve-module-graph/package.json index 6d55bb08d4..6c28905203 100644 --- a/examples/resolve-module-graph/package.json +++ b/examples/resolve-module-graph/package.json @@ -1,5 +1,5 @@ { - "name": "@farm-examples/resolve-module-graph", + "name": "@farmfe-examples/resolve-module-graph", "version": "1.0.0", "description": "", "private": true, @@ -16,4 +16,4 @@ "@farmfe/core": "workspace:*", "@farmfe/cli": "workspace:*" } -} \ No newline at end of file +} diff --git a/examples/script-entry/farm.config.cjs.ts b/examples/script-entry/farm.config.cjs.ts index 25c2bfd278..172270dbbe 100644 --- a/examples/script-entry/farm.config.cjs.ts +++ b/examples/script-entry/farm.config.cjs.ts @@ -10,7 +10,7 @@ const config: UserConfig = { output: { path: 'dist/cjs', entryFilename: '[entryName].cjs', - targetEnv: 'library-node', + targetEnv: 'node', format: 'cjs' }, lazyCompilation: false, diff --git a/examples/script-entry/farm.config.ts b/examples/script-entry/farm.config.ts index 09cd5a8536..ddc5b58b2a 100644 --- a/examples/script-entry/farm.config.ts +++ b/examples/script-entry/farm.config.ts @@ -6,13 +6,20 @@ import { builtinModules } from 'module'; */ export default defineConfig({ compilation: { + // multiple bundle recommend config + // treeShaking: false, + partialBundling: { + targetConcurrentRequests: Number.MAX_SAFE_INTEGER, + targetMinSize: 1, + }, + input: { index: './index.ts' }, output: { path: 'dist/esm', entryFilename: '[entryName].mjs', - targetEnv: 'library-node', + targetEnv: 'node', format: 'esm' }, presetEnv: false, @@ -28,15 +35,7 @@ export default defineConfig({ importNotUsedAsValues: 'remove', }, minify: false, - mode: 'development', - partialBundling: { - enforceResources: [ - { - name: 'xxx', - test: ['.+'] - } - ] - }, + // mode: 'development', persistentCache: false, lazyCompilation: false }, diff --git a/examples/server-proxy/package.json b/examples/server-proxy/package.json index 32044fdca6..b55d8bafc6 100644 --- a/examples/server-proxy/package.json +++ b/examples/server-proxy/package.json @@ -1,5 +1,5 @@ { - "name": "@farm-examples/server-proxy", + "name": "@farmfe-examples/server-proxy", "version": "1.0.0", "description": "", "main": "index.js", diff --git a/examples/tailwind-next/farm.config.ts b/examples/tailwind-next/farm.config.ts index ab8c3af0fd..6572ca6dcb 100644 --- a/examples/tailwind-next/farm.config.ts +++ b/examples/tailwind-next/farm.config.ts @@ -1,26 +1,12 @@ -import type { UserConfig } from "@farmfe/core"; -// import farmPostcssPlugin from '@farmfe/js-plugin-postcss'; +import { defineConfig } from "@farmfe/core"; import tailwind from "@farmfe/js-plugin-tailwindcss"; -function defineConfig(config: UserConfig) { - return config; -} - export default defineConfig({ compilation: { - input: { - index: "./index.html", - }, - output: { - path: "./build", - }, - sourcemap: false, - resolve: { - dedupe: ["tailwindcss"], - }, + persistentCache: false, }, server: { - hmr: true, + writeToDisk: true, }, plugins: [ "@farmfe/plugin-react", diff --git a/examples/tailwind-next/package.json b/examples/tailwind-next/package.json index eaa9f2de55..34d06442cd 100644 --- a/examples/tailwind-next/package.json +++ b/examples/tailwind-next/package.json @@ -6,8 +6,11 @@ "@farmfe/js-plugin-tailwindcss": "workspace:^", "clsx": "^1.2.1", "core-js": "^3.30.1", + "lucide-react": "^0.394.0", "react": "18", - "react-dom": "18" + "react-dom": "18", + "tailwind-merge": "^2.3.0", + "tailwindcss-animate": "^1.0.7" }, "devDependencies": { "@farmfe/cli": "workspace:*", @@ -21,7 +24,7 @@ "tailwindcss": "4.0.0-alpha.26" }, "scripts": { - "start": "farm start", + "dev": "farm start", "build": "farm build", "preview": "farm preview" } diff --git a/examples/tailwind-next/src/App.tsx b/examples/tailwind-next/src/App.tsx index b8dd5e832d..d92d89e10c 100644 --- a/examples/tailwind-next/src/App.tsx +++ b/examples/tailwind-next/src/App.tsx @@ -1,33 +1,124 @@ import React from 'react'; import logo from './logo.svg?url'; -import { useState } from 'react'; +import { ArrowRight, Heart, Menu, Moon, Sun } from 'lucide-react'; const App = () => { - const [count, setCount] = useState(0); - return ( -
-
- logo -

- Edit src/App.tsx and save to reload. -

- - Learn Tailwindcss - - -
+
+ +

Tailwind CSS Animation Demos

+
+ {/* 1. Pulse Effect */} +
+

1. Pulse Effect

+
+
+
+
+ + {/* 2. Bounce Effect */} +
+

2. Bounce Effect

+
+
+
+
+ + {/* 3. Spin Effect */} +
+

3. Spin Effect

+
+
+
+
+ + {/* 4. Scale on Hover */} +
+

4. Scale on Hover

+
+
+
+
+ + {/* 5. Rotate on Hover */} +
+

5. Rotate on Hover

+
+
+
+
+ + {/* 6. Fade In/Out */} +
+

6. Fade In/Out

+
+
+
+
+ + {/* 7. Shake Effect */} +
+

7. Shake Effect

+
+ +
+
+ + {/* 8. Heart Beat */} +
+

8. Heart Beat

+
+ +
+
+ + {/* 9. Slide In */} +
+

9. Slide In

+
+
+ Hover me + +
+
+
+ + {/* 10. Color Transition */} +
+

10. Color Transition

+
+
+
+
+ + {/* 11. Ping Effect */} +
+

11. Ping Effect

+
+ + + + +
+
+ + {/* 12. Theme Toggle */} +
+

12. Theme Toggle

+
+
+
+
+ + +
+
+
+
+
+
); }; diff --git a/examples/tailwind-next/src/index.css b/examples/tailwind-next/src/index.css index f173aa4cff..373cc5f838 100644 --- a/examples/tailwind-next/src/index.css +++ b/examples/tailwind-next/src/index.css @@ -1 +1,23 @@ -@import 'tailwindcss'; \ No newline at end of file +@import 'tailwindcss'; + +@keyframes fade { + 0%, 100% { opacity: 1; } + 50% { opacity: 0; } +} + +@keyframes shake { + 0%, 100% { transform: translateX(0); } + 25% { transform: translateX(-5px); } + 75% { transform: translateX(5px); } +} + +@keyframes heartbeat { + 0%, 100% { transform: scale(1); } + 50% { transform: scale(1.2); } +} + +body { + margin: 0; + min-width: 320px; + min-height: 100vh; +} diff --git a/examples/tailwind-next/tailwind.config.js b/examples/tailwind-next/tailwind.config.js index cf286cbd9e..9e6fe198b9 100644 --- a/examples/tailwind-next/tailwind.config.js +++ b/examples/tailwind-next/tailwind.config.js @@ -5,8 +5,78 @@ export default { "./src/**/*.{js,ts,jsx,tsx}", ], theme: { - extend: {}, + extend: { + borderRadius: { + lg: 'var(--radius)', + md: 'calc(var(--radius) - 2px)', + sm: 'calc(var(--radius) - 4px)', + }, + colors: { + background: 'hsl(var(--background))', + foreground: 'hsl(var(--foreground))', + card: { + DEFAULT: 'hsl(var(--card))', + foreground: 'hsl(var(--card-foreground))', + }, + popover: { + DEFAULT: 'hsl(var(--popover))', + foreground: 'hsl(var(--popover-foreground))', + }, + primary: { + DEFAULT: 'hsl(var(--primary))', + foreground: 'hsl(var(--primary-foreground))', + }, + secondary: { + DEFAULT: 'hsl(var(--secondary))', + foreground: 'hsl(var(--secondary-foreground))', + }, + muted: { + DEFAULT: 'hsl(var(--muted))', + foreground: 'hsl(var(--muted-foreground))', + }, + accent: { + DEFAULT: 'hsl(var(--accent))', + foreground: 'hsl(var(--accent-foreground))', + }, + destructive: { + DEFAULT: 'hsl(var(--destructive))', + foreground: 'hsl(var(--destructive-foreground))', + }, + border: 'hsl(var(--border))', + input: 'hsl(var(--input))', + ring: 'hsl(var(--ring))', + chart: { + 1: 'hsl(var(--chart-1))', + 2: 'hsl(var(--chart-2))', + 3: 'hsl(var(--chart-3))', + 4: 'hsl(var(--chart-4))', + 5: 'hsl(var(--chart-5))', + }, + }, + keyframes: { + 'accordion-down': { + from: { + height: '0', + }, + to: { + height: 'var(--radix-accordion-content-height)', + }, + }, + 'accordion-up': { + from: { + height: 'var(--radix-accordion-content-height)', + }, + to: { + height: '0', + }, + }, + }, + animation: { + 'accordion-down': 'accordion-down 0.2s ease-out', + 'accordion-up': 'accordion-up 0.2s ease-out', + }, + }, }, - plugins: [], + plugins: [require('tailwindcss-animate')], } diff --git a/examples/tailwind/src/App.tsx b/examples/tailwind/src/App.tsx index 754a94ec90..719fecc538 100644 --- a/examples/tailwind/src/App.tsx +++ b/examples/tailwind/src/App.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import logo from './logo.svg?url'; +import logo from './logo.svg'; import { useState } from 'react'; const App = () => { diff --git a/examples/visualizer/.gitignore b/examples/visualizer/.gitignore new file mode 100644 index 0000000000..a4cf82d2cd --- /dev/null +++ b/examples/visualizer/.gitignore @@ -0,0 +1,22 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.sln +*.sw? diff --git a/examples/visualizer/README.md b/examples/visualizer/README.md new file mode 100644 index 0000000000..5802e857f7 --- /dev/null +++ b/examples/visualizer/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/examples/visualizer/about.html b/examples/visualizer/about.html new file mode 100644 index 0000000000..5b65d32cf5 --- /dev/null +++ b/examples/visualizer/about.html @@ -0,0 +1,11 @@ + + + + + + Document + + + im about page + + diff --git a/examples/visualizer/farm.config.ts b/examples/visualizer/farm.config.ts new file mode 100644 index 0000000000..bed4d0ed6a --- /dev/null +++ b/examples/visualizer/farm.config.ts @@ -0,0 +1,26 @@ +import { defineConfig } from "@farmfe/core"; +// import viewer from "@farmfe/js-plugin-visualizer"; +import react from "@farmfe/plugin-react"; +import compression from "compression"; +const myPlugin = () => ({ + name: "configure-server", + configureServer(server) { + server.middlewares.use(compression()); + server.middlewares.use((req, res, next) => { + // 自定义请求处理... + next(); + }); + }, +}); + +export default defineConfig({ + plugins: [react(), myPlugin()], + compilation: { + output: { + // publicPath: "/aaa/", + }, + }, + server: { + // port: 3000, + }, +}); diff --git a/examples/visualizer/index.html b/examples/visualizer/index.html new file mode 100644 index 0000000000..816b922910 --- /dev/null +++ b/examples/visualizer/index.html @@ -0,0 +1,15 @@ + + + + + + + + + Farm + React + TS + + +
+ + + diff --git a/examples/visualizer/package.json b/examples/visualizer/package.json new file mode 100644 index 0000000000..4f3a751be5 --- /dev/null +++ b/examples/visualizer/package.json @@ -0,0 +1,28 @@ +{ + "name": "@farmfe-examples/visualizer", + "version": "1.0.0", + "type": "module", + "private": true, + "scripts": { + "dev": "farm", + "start": "farm start --debug", + "build": "farm build", + "preview": "farm preview", + "clean": "farm clean" + }, + "dependencies": { + "react": "18", + "react-dom": "18" + }, + "devDependencies": { + "@farmfe/cli": "workspace:*", + "@farmfe/core": "workspace:*", + "@farmfe/js-plugin-visualizer": "workspace:*", + "@farmfe/plugin-react": "workspace:*", + "@types/react": "18", + "@types/react-dom": "18", + "compression": "^1.7.4", + "core-js": "^3.36.1", + "react-refresh": "^0.14.0" + } +} diff --git a/examples/visualizer/public/favicon.ico b/examples/visualizer/public/favicon.ico new file mode 100644 index 0000000000..80465dedc0 Binary files /dev/null and b/examples/visualizer/public/favicon.ico differ diff --git a/examples/visualizer/public/react.svg b/examples/visualizer/public/react.svg new file mode 100644 index 0000000000..6c87de9bb3 --- /dev/null +++ b/examples/visualizer/public/react.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/visualizer/src/assets/base/react.svg b/examples/visualizer/src/assets/base/react.svg new file mode 100644 index 0000000000..6c87de9bb3 --- /dev/null +++ b/examples/visualizer/src/assets/base/react.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/visualizer/src/assets/logo.png b/examples/visualizer/src/assets/logo.png new file mode 100644 index 0000000000..0caeb43812 Binary files /dev/null and b/examples/visualizer/src/assets/logo.png differ diff --git a/examples/visualizer/src/assets/react.svg b/examples/visualizer/src/assets/react.svg new file mode 100644 index 0000000000..6c87de9bb3 --- /dev/null +++ b/examples/visualizer/src/assets/react.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/visualizer/src/index.css b/examples/visualizer/src/index.css new file mode 100644 index 0000000000..6cc4daf982 --- /dev/null +++ b/examples/visualizer/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/examples/visualizer/src/index.tsx b/examples/visualizer/src/index.tsx new file mode 100644 index 0000000000..39df64e842 --- /dev/null +++ b/examples/visualizer/src/index.tsx @@ -0,0 +1,11 @@ +import React from 'react'; +import { createRoot } from 'react-dom/client'; +import { Main } from './main'; +import './index.css' + + +const container = document.querySelector('#root'); +// biome-ignore lint/style/noNonNullAssertion: +const root = createRoot(container!); + +root.render(
); diff --git a/examples/visualizer/src/main.css b/examples/visualizer/src/main.css new file mode 100644 index 0000000000..97420f8caf --- /dev/null +++ b/examples/visualizer/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 #9761fbaa); +} + +@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/examples/visualizer/src/main.tsx b/examples/visualizer/src/main.tsx new file mode 100644 index 0000000000..92662eded0 --- /dev/null +++ b/examples/visualizer/src/main.tsx @@ -0,0 +1,31 @@ +import { useState } from "react"; +import "./main.css"; +import reactLogo from "/react.svg"; +import FarmLogo from "./assets/logo.png"; +export function Main() { + const [count, setCount] = useState(0); + return ( + <> + +

Farm + react

+
+ +

+ Edit src/main.tsx and save to test HMR +

+
+

+ Click on the Farm and React logos to learn more +

+ + ); +} diff --git a/examples/visualizer/src/typings.d.ts b/examples/visualizer/src/typings.d.ts new file mode 100644 index 0000000000..fa0a2da548 --- /dev/null +++ b/examples/visualizer/src/typings.d.ts @@ -0,0 +1,3 @@ +declare module '*.svg'; +declare module '*.png'; +declare module '*.css'; diff --git a/examples/visualizer/tsconfig.json b/examples/visualizer/tsconfig.json new file mode 100644 index 0000000000..7a7611e4a3 --- /dev/null +++ b/examples/visualizer/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/examples/visualizer/tsconfig.node.json b/examples/visualizer/tsconfig.node.json new file mode 100644 index 0000000000..8d4232518e --- /dev/null +++ b/examples/visualizer/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/examples/vite-adapter-react/src/pages/index.tsx b/examples/vite-adapter-react/src/pages/index.tsx index 8ea6ca5810..e9d779685b 100644 --- a/examples/vite-adapter-react/src/pages/index.tsx +++ b/examples/vite-adapter-react/src/pages/index.tsx @@ -4,7 +4,7 @@ import FarmLogo from '../assets/logo.png'; import reactLogo from '../assets/react.svg'; import './main.css'; - export default function () { +export default function () { const [count, setCount] = useState(0); const go = useNavigate(); @@ -17,7 +17,7 @@ import './main.css'; React logo -
+
12312123

Farm + React

diff --git a/examples/vite-adapter-solid/src/App.tsx b/examples/vite-adapter-solid/src/App.tsx index 91aa47cff9..4acae856fd 100644 --- a/examples/vite-adapter-solid/src/App.tsx +++ b/examples/vite-adapter-solid/src/App.tsx @@ -15,7 +15,7 @@ const App: Component = () => {
logo

- Editsrc/App.tsx and save to reload. + Editsrc/App.tsx1232131231231221312321 and save to reload.

- import svelteLogo from './assets/svelte.svg' - import farmLogo from '/logo.png' - import Counter from './lib/Counter.svelte' + import svelteLogo from "./assets/svelte.svg"; + import farmLogo from "/logo.png"; + import Counter from "./lib/Counter.svelte";
- + 1321321 @@ -23,9 +23,7 @@ Powered by Farm and svelet vite plugin

-

- Click on the Farm and Svelte logos to learn more -

+

Click on the Farm and Svelte logos to learn more

\ No newline at end of file + diff --git a/examples/vite-adapter-vue2.7/package.json b/examples/vite-adapter-vue2.7/package.json index 5d725ab879..2235492cad 100644 --- a/examples/vite-adapter-vue2.7/package.json +++ b/examples/vite-adapter-vue2.7/package.json @@ -17,8 +17,8 @@ "vue": "~2.7.16" }, "devDependencies": { - "@farmfe/cli": "workspace:^1.0.0", - "@farmfe/core": "workspace:^1.0.11", + "@farmfe/cli": "workspace:*", + "@farmfe/core": "workspace:*", "@vitejs/plugin-vue2": "^2.3.1", "core-js": "^3.30.1", "vue-template-compiler": "~2.7.16" diff --git a/examples/vite-adapter-vue2/package.json b/examples/vite-adapter-vue2/package.json index 447b95a59a..0df7216a73 100644 --- a/examples/vite-adapter-vue2/package.json +++ b/examples/vite-adapter-vue2/package.json @@ -17,8 +17,8 @@ "vue": "2.6.14" }, "devDependencies": { - "@farmfe/cli": "workspace:^1.0.0", - "@farmfe/core": "workspace:^1.0.11", + "@farmfe/cli": "workspace:*", + "@farmfe/core": "workspace:*", "axios": "^1.7.2", "core-js": "^3.30.1", "vite-plugin-vue2": "^2.0.3", diff --git a/examples/vite-adapter-vue2/src/App.vue b/examples/vite-adapter-vue2/src/App.vue index bf8d6a5a2b..491d6f998c 100644 --- a/examples/vite-adapter-vue2/src/App.vue +++ b/examples/vite-adapter-vue2/src/App.vue @@ -3,7 +3,7 @@ farm logo {{ res }} -

Welcome to use TDesign!

+

Welcome to use

diff --git a/examples/vue-antdv/farm.config.ts b/examples/vue-antdv/farm.config.ts index 9037062515..1416161491 100644 --- a/examples/vue-antdv/farm.config.ts +++ b/examples/vue-antdv/farm.config.ts @@ -11,7 +11,8 @@ export default defineConfig({ alias: { '/@': path.join(process.cwd(), 'src') } - } + }, + lazyCompilation: false, }, plugins: [farmJsPluginLess()], vitePlugins: [Vue()] diff --git a/examples/vue-antdv/src/home.vue b/examples/vue-antdv/src/home.vue index 3575aa7376..117c410ebd 100644 --- a/examples/vue-antdv/src/home.vue +++ b/examples/vue-antdv/src/home.vue @@ -1,7 +1,7 @@ + + + diff --git a/examples/vue3/package.json b/examples/vue3/package.json new file mode 100644 index 0000000000..d31c6865dd --- /dev/null +++ b/examples/vue3/package.json @@ -0,0 +1,30 @@ +{ + "name": "@farmfe-examples/vue3", + "version": "1.0.0", + "private": true, + "scripts": { + "dev": "farm start", + "start": "farm start", + "build": "farm build", + "preview": "farm preview", + "clean": "farm clean" + }, + "dependencies": { + "@module-federation/vite": "^1.1.1", + "unplugin-auto-import": "^0.16.7", + "unplugin-vue-router": "^0.7.0", + "vue": "^3.4.0", + "vue-router": "^4.4.3" + }, + "devDependencies": { + "@vitejs/plugin-vue": "5.1.4", + "compression": "^1.7.4", + "core-js": "^3.30.1", + "unocss": "^0.62.2", + "unplugin-vue-inspector": "^2.2.0", + "vite-plugin-compression": "^0.5.1", + "vite-plugin-html": "^3.2.2", + "vite-plugin-inspect": "^0.8.7", + "vite-plugin-mkcert": "^1.17.6" + } +} diff --git a/examples/vue3/public/aaa.jpg b/examples/vue3/public/aaa.jpg new file mode 100644 index 0000000000..0fc806ec2e Binary files /dev/null and b/examples/vue3/public/aaa.jpg differ diff --git a/examples/vue3/public/favicon.ico b/examples/vue3/public/favicon.ico new file mode 100644 index 0000000000..80465dedc0 Binary files /dev/null and b/examples/vue3/public/favicon.ico differ diff --git a/examples/vue3/src/App.vue b/examples/vue3/src/App.vue new file mode 100644 index 0000000000..dc4314f47f --- /dev/null +++ b/examples/vue3/src/App.vue @@ -0,0 +1,32 @@ + + + + + diff --git a/examples/vue3/src/assets/logo.png b/examples/vue3/src/assets/logo.png new file mode 100644 index 0000000000..0caeb43812 Binary files /dev/null and b/examples/vue3/src/assets/logo.png differ diff --git a/examples/vue3/src/assets/vue.svg b/examples/vue3/src/assets/vue.svg new file mode 100644 index 0000000000..770e9d333e --- /dev/null +++ b/examples/vue3/src/assets/vue.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/vue3/src/auto_import.d.ts b/examples/vue3/src/auto_import.d.ts new file mode 100644 index 0000000000..df54a15f16 --- /dev/null +++ b/examples/vue3/src/auto_import.d.ts @@ -0,0 +1,5 @@ +/* generated by farmfe_plugin_auto_import */ +export {} +declare global { + const farm.config: typeof import('./../farm.config.ts')['default'] +} diff --git a/examples/vue3/src/components/HelloWorld.vue b/examples/vue3/src/components/HelloWorld.vue new file mode 100644 index 0000000000..7135f2b544 --- /dev/null +++ b/examples/vue3/src/components/HelloWorld.vue @@ -0,0 +1,32 @@ + + + + + diff --git a/examples/vue3/src/env.d.ts b/examples/vue3/src/env.d.ts new file mode 100644 index 0000000000..4ae8e90af7 --- /dev/null +++ b/examples/vue3/src/env.d.ts @@ -0,0 +1,2 @@ +declare module '*.vue'; +declare module '*.svg'; diff --git a/examples/vue3/src/index.ts b/examples/vue3/src/index.ts new file mode 100644 index 0000000000..71ddbe6222 --- /dev/null +++ b/examples/vue3/src/index.ts @@ -0,0 +1,6 @@ +import { createApp } from 'vue' +// import 'virtual:uno.css' +import './style.css' +import App from './App.vue' + +createApp(App).mount('#app') diff --git a/examples/vue3/src/indexa.ts b/examples/vue3/src/indexa.ts new file mode 100644 index 0000000000..a5ce15f7c9 --- /dev/null +++ b/examples/vue3/src/indexa.ts @@ -0,0 +1,11 @@ +function aaa () { + // 写一个算法 返回一个值 + return 123 + 456 +} + +export function bbb () { + // 写一个算法 返回一个值 + console.log(); + + return 123 + aaa() +} diff --git a/examples/vue3/src/pages/Home.vue b/examples/vue3/src/pages/Home.vue new file mode 100644 index 0000000000..f4173a6ad6 --- /dev/null +++ b/examples/vue3/src/pages/Home.vue @@ -0,0 +1,52 @@ + diff --git a/examples/vue3/src/pages/about.vue b/examples/vue3/src/pages/about.vue new file mode 100644 index 0000000000..48f51ed287 --- /dev/null +++ b/examples/vue3/src/pages/about.vue @@ -0,0 +1,10 @@ + diff --git a/examples/vue3/src/pages/index.vue b/examples/vue3/src/pages/index.vue new file mode 100644 index 0000000000..f4173a6ad6 --- /dev/null +++ b/examples/vue3/src/pages/index.vue @@ -0,0 +1,52 @@ + diff --git a/examples/vue3/src/style.css b/examples/vue3/src/style.css new file mode 100644 index 0000000000..6efbecc027 --- /dev/null +++ b/examples/vue3/src/style.css @@ -0,0 +1,80 @@ +: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: #535bf2; +} + +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; +} + +.card { + padding: 2em; +} + +#app { + max-width: 1280px; + margin: 0 auto; + padding: 2rem; + text-align: center; +} + +@media (prefers-color-scheme: light) { + :root { + color: #213547; + background-color: #ffffff; + } + a:hover { + color: #9F1A8F; + } + button { + background-color: #f9f9f9; + } +} diff --git a/examples/vue3/test.js b/examples/vue3/test.js new file mode 100644 index 0000000000..6a566deee4 --- /dev/null +++ b/examples/vue3/test.js @@ -0,0 +1 @@ +export const aaa2222 = 121222222222222222223; diff --git a/examples/vue3/tsconfig.json b/examples/vue3/tsconfig.json new file mode 100644 index 0000000000..ee019e988f --- /dev/null +++ b/examples/vue3/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "preserve", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"], + "references": [{ "path": "./tsconfig.node.json" }] +} \ No newline at end of file diff --git a/examples/vue3/tsconfig.node.json b/examples/vue3/tsconfig.node.json new file mode 100644 index 0000000000..8d4232518e --- /dev/null +++ b/examples/vue3/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/examples/vue3/typed-router.d.ts b/examples/vue3/typed-router.d.ts new file mode 100644 index 0000000000..a82f215be6 --- /dev/null +++ b/examples/vue3/typed-router.d.ts @@ -0,0 +1,143 @@ +/* eslint-disable */ +/* prettier-ignore */ +// @ts-nocheck +// Generated by unplugin-vue-router. ‼️ DO NOT MODIFY THIS FILE ‼️ +// It's recommended to commit this file. +// Make sure to add this file to your tsconfig.json file as an "includes" or "files" entry. + +/// + +import type { + // type safe route locations + RouteLocationTypedList, + RouteLocationResolvedTypedList, + RouteLocationNormalizedTypedList, + RouteLocationNormalizedLoadedTypedList, + RouteLocationAsString, + RouteLocationAsRelativeTypedList, + RouteLocationAsPathTypedList, + + // helper types + // route definitions + RouteRecordInfo, + ParamValue, + ParamValueOneOrMore, + ParamValueZeroOrMore, + ParamValueZeroOrOne, + + // vue-router extensions + _RouterTyped, + RouterLinkTyped, + RouterLinkPropsTyped, + NavigationGuard, + UseLinkFnTyped, + + // data fetching + _DataLoader, + _DefineLoaderOptions, +} from 'unplugin-vue-router/types' + +declare module 'vue-router/auto/routes' { + export interface RouteNamedMap { + '/': RouteRecordInfo<'/', '/', Record, Record>, + '/about': RouteRecordInfo<'/about', '/about', Record, Record>, + '/Home': RouteRecordInfo<'/Home', '/Home', Record, Record>, + } +} + +declare module 'vue-router/auto' { + import type { RouteNamedMap } from 'vue-router/auto/routes' + + export type RouterTyped = _RouterTyped + + /** + * Type safe version of `RouteLocationNormalized` (the type of `to` and `from` in navigation guards). + * Allows passing the name of the route to be passed as a generic. + */ + export type RouteLocationNormalized = RouteLocationNormalizedTypedList[Name] + + /** + * Type safe version of `RouteLocationNormalizedLoaded` (the return type of `useRoute()`). + * Allows passing the name of the route to be passed as a generic. + */ + export type RouteLocationNormalizedLoaded = RouteLocationNormalizedLoadedTypedList[Name] + + /** + * Type safe version of `RouteLocationResolved` (the returned route of `router.resolve()`). + * Allows passing the name of the route to be passed as a generic. + */ + export type RouteLocationResolved = RouteLocationResolvedTypedList[Name] + + /** + * Type safe version of `RouteLocation` . Allows passing the name of the route to be passed as a generic. + */ + export type RouteLocation = RouteLocationTypedList[Name] + + /** + * Type safe version of `RouteLocationRaw` . Allows passing the name of the route to be passed as a generic. + */ + export type RouteLocationRaw = + | RouteLocationAsString + | RouteLocationAsRelativeTypedList[Name] + | RouteLocationAsPathTypedList[Name] + + /** + * Generate a type safe params for a route location. Requires the name of the route to be passed as a generic. + */ + export type RouteParams = RouteNamedMap[Name]['params'] + /** + * Generate a type safe raw params for a route location. Requires the name of the route to be passed as a generic. + */ + export type RouteParamsRaw = RouteNamedMap[Name]['paramsRaw'] + + export function useRouter(): RouterTyped + export function useRoute(name?: Name): RouteLocationNormalizedLoadedTypedList[Name] + + export const useLink: UseLinkFnTyped + + export function onBeforeRouteLeave(guard: NavigationGuard): void + export function onBeforeRouteUpdate(guard: NavigationGuard): void + + export const RouterLink: RouterLinkTyped + export const RouterLinkProps: RouterLinkPropsTyped + + // Experimental Data Fetching + + export function defineLoader< + P extends Promise, + Name extends keyof RouteNamedMap = keyof RouteNamedMap, + isLazy extends boolean = false, + >( + name: Name, + loader: (route: RouteLocationNormalizedLoaded) => P, + options?: _DefineLoaderOptions, + ): _DataLoader, isLazy> + export function defineLoader< + P extends Promise, + isLazy extends boolean = false, + >( + loader: (route: RouteLocationNormalizedLoaded) => P, + options?: _DefineLoaderOptions, + ): _DataLoader, isLazy> + + export { + _definePage as definePage, + _HasDataLoaderMeta as HasDataLoaderMeta, + _setupDataFetchingGuard as setupDataFetchingGuard, + _stopDataFetchingScope as stopDataFetchingScope, + } from 'unplugin-vue-router/runtime' +} + +declare module 'vue-router' { + import type { RouteNamedMap } from 'vue-router/auto/routes' + + export interface TypesConfig { + beforeRouteUpdate: NavigationGuard + beforeRouteLeave: NavigationGuard + + $route: RouteLocationNormalizedLoadedTypedList[keyof RouteNamedMap] + $router: _RouterTyped + + RouterLink: RouterLinkTyped + } +} diff --git a/examples/vue3/uno.config.ts b/examples/vue3/uno.config.ts new file mode 100644 index 0000000000..b17bf0a6b3 --- /dev/null +++ b/examples/vue3/uno.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'unocss' + +export default defineConfig({ + rules: [ + ['m-1', { margin: '1px' }], + ], +}) diff --git a/js-plugins/dts/package.json b/js-plugins/dts/package.json index a92aa28c09..e5f9f6ef97 100644 --- a/js-plugins/dts/package.json +++ b/js-plugins/dts/package.json @@ -32,8 +32,6 @@ "typescript": "^5.4.5" }, "devDependencies": { - "@farmfe/cli": "workspace:*", - "@farmfe/core": "workspace:*", "@types/fs-extra": "^11.0.1" }, "files": [ diff --git a/js-plugins/dts/src/context.ts b/js-plugins/dts/src/context.ts index 0fabba9ff7..c755d24b67 100644 --- a/js-plugins/dts/src/context.ts +++ b/js-plugins/dts/src/context.ts @@ -37,7 +37,7 @@ export default class Context { clearPureImport: true, insertTypesEntry: false, noEmitOnError: false, - skipDiagnostics: false, + skipDiagnostics: true, copyDtsFiles: false, afterDiagnostic: () => ({}) }; @@ -238,7 +238,7 @@ export default class Context { if (!this.options.skipDiagnostics) { const diagnostics = this.project.getPreEmitDiagnostics(); if (diagnostics?.length) { - this.logger.warn( + this.logger.error( this.project.formatDiagnosticsWithColorAndContext(diagnostics) ); } diff --git a/js-plugins/electron/.eslintrc.json b/js-plugins/electron/.eslintrc.json deleted file mode 100644 index 38d0613835..0000000000 --- a/js-plugins/electron/.eslintrc.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "root": true, - "extends": "../../.eslintrc.base.json", - "parserOptions": { - "project": ["./js-plugins/svgr/tsconfig.json"] - }, - "rules": {} -} diff --git a/js-plugins/electron/package.json b/js-plugins/electron/package.json index b7052aed30..5bfaf1d43c 100644 --- a/js-plugins/electron/package.json +++ b/js-plugins/electron/package.json @@ -39,8 +39,6 @@ "keywords": [], "license": "MIT", "devDependencies": { - "@farmfe/cli": "workspace:*", - "@farmfe/core": "workspace:*", "@farmfe/js-plugin-dts": "workspace:*", "cross-env": "^7.0.3", "electron": "^30.0.7" diff --git a/js-plugins/electron/src/index.ts b/js-plugins/electron/src/index.ts index ca53e1cc16..2896c466fd 100644 --- a/js-plugins/electron/src/index.ts +++ b/js-plugins/electron/src/index.ts @@ -3,7 +3,7 @@ import type { AddressInfo } from 'node:net'; import path from 'node:path'; // TODO: submit a PR to farm(export default farm) import { - type FarmCLIOptions, + type FarmCliOptions, type JsPlugin, type Server, type UserConfig, @@ -46,10 +46,10 @@ export default function farmElectronPlugin( // config.compilation.assets.publicDir ??= '' return config; }, - configureDevServer(server) { + configureServer(server) { isDev = true; - server.server?.once('listening', () => { + server.httpServer?.once('listening', () => { // Used in electron/main.ts for during dev process.env.FARM_DEV_SERVER_URL = resolveServerUrl(server); @@ -167,12 +167,12 @@ function resolveFarmConfig( } } - // TODO: submit a PR to farm(Omit & UserConfig) - return opts.farm as FarmCLIOptions; + // TODO: submit a PR to farm(Omit & UserConfig) + return opts.farm as FarmCliOptions; } function resolveServerUrl(server: Server) { - const addressInfo = server.server?.address(); + const addressInfo = server.httpServer?.address(); const isAddressInfo = (x: any): x is AddressInfo => x?.address; if (isAddressInfo(addressInfo)) { diff --git a/js-plugins/less/.eslintrc.json b/js-plugins/less/.eslintrc.json deleted file mode 100644 index d0610947ff..0000000000 --- a/js-plugins/less/.eslintrc.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "root": true, - "extends": "../../.eslintrc.base.json", - "parserOptions": { - "project": ["./js-plugins/less/tsconfig.json"] - }, - "rules": {} -} diff --git a/js-plugins/less/CHANGELOG.md b/js-plugins/less/CHANGELOG.md index a5ed6a7429..af7f0127a4 100644 --- a/js-plugins/less/CHANGELOG.md +++ b/js-plugins/less/CHANGELOG.md @@ -1,5 +1,73 @@ # @farmfe/js-plugin-less +## 2.0.0-nightly-20241029121500 + +### Patch Changes + +- Updated dependencies [b327dd1] + - @farmfe/core@2.0.0-nightly-20241029121500 + +## 2.0.0-nightly-20241029095811 + +### Patch Changes + +- Updated dependencies [b3a7caf] + - @farmfe/core@2.0.0-nightly-20241029095811 + +## 2.0.0-nightly-20241024090954 + +### Patch Changes + +- Updated dependencies [f460eb1] + - @farmfe/core@2.0.0-nightly-20241024090954 + +## 2.0.0-nightly-20241024075304 + +### Patch Changes + +- @farmfe/core@2.0.0-nightly-20241024075304 + +## 2.0.0-nightly-20241023101523 + +### Patch Changes + +- Updated dependencies [d7c5ffb] + - @farmfe/core@2.0.0-nightly-20241023101523 + +## 2.0.0-nightly-20241023020505 + +### Patch Changes + +- Updated dependencies [3651244] + - @farmfe/core@2.0.0-nightly-20241023020505 + +## 2.0.0-nightly-20241022143924 + +### Patch Changes + +- Updated dependencies [83838bd] + - @farmfe/core@2.0.0-nightly-20241022143924 + +## 2.0.0-nightly-20241022124925 + +### Patch Changes + +- @farmfe/core@2.0.0-nightly-20241022124925 + +## 2.0.0-nightly-20241022041556 + +### Patch Changes + +- Updated dependencies [24347c9] + - @farmfe/core@2.0.0-nightly-20241022041556 + +## 2.0.0-nightly-20241022014521 + +### Patch Changes + +- Updated dependencies [a82a5b2] + - @farmfe/core@2.0.0-nightly-20241022014521 + ## 1.12.0 ### Patch Changes @@ -20,11 +88,6 @@ ## 1.10.0 -### Patch Changes - -- Updated dependencies [7d86847c] - - @farmfe/core@1.4.0 - ## 1.9.0 ### Patch Changes diff --git a/js-plugins/less/package.json b/js-plugins/less/package.json index f64049d3f7..0acf711bf6 100644 --- a/js-plugins/less/package.json +++ b/js-plugins/less/package.json @@ -1,6 +1,6 @@ { "name": "@farmfe/js-plugin-less", - "version": "1.12.0", + "version": "2.0.0-nightly-20241029121500", "description": "support less compile for farm.", "main": "./build/cjs/index.cjs", "types": "./build/cjs/index.d.ts", @@ -40,13 +40,13 @@ "license": "MIT", "devDependencies": { "@farmfe/cli": "workspace:*", - "@farmfe/core": "workspace:^1.6.0", + "@farmfe/core": "workspace:*", "@farmfe/js-plugin-dts": "workspace:^", "@types/less": "^3.0.3", "less": "^4.1.3" }, "peerDependencies": { - "@farmfe/core": "workspace:^1.6.0", + "@farmfe/core": "workspace:*", "less": "^3.5.0 || ^4.0.0" } } diff --git a/js-plugins/less/src/index.ts b/js-plugins/less/src/index.ts index 9a041cc8cc..0e137fe74d 100644 --- a/js-plugins/less/src/index.ts +++ b/js-plugins/less/src/index.ts @@ -35,7 +35,6 @@ export default function farmLessPlugin( options?.implementation ); - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore TODO fix it const cwd = () => farmConfig.root ?? process.cwd(); @@ -63,9 +62,8 @@ export default function farmLessPlugin( ...preprocessorOptions }; }, - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore it will be removed in the future - configDevServer() { + configureServer() { console.warn( '[@farmfe/js-plugin-less] Your plugin version is not compatible with the current farm version, please update @farmfe/core to the latest version, otherwise the plugin may not work properly.' ); diff --git a/js-plugins/postcss/.eslintrc.json b/js-plugins/postcss/.eslintrc.json deleted file mode 100644 index 03dee8b683..0000000000 --- a/js-plugins/postcss/.eslintrc.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "root": true, - "extends": "../../.eslintrc.base.json", - "parserOptions": { - "project": ["./js-plugins/postcss/tsconfig.json"] - }, - "rules": {} -} diff --git a/js-plugins/postcss/CHANGELOG.md b/js-plugins/postcss/CHANGELOG.md index d6ce9a14cc..916fdf9f94 100644 --- a/js-plugins/postcss/CHANGELOG.md +++ b/js-plugins/postcss/CHANGELOG.md @@ -1,5 +1,72 @@ # @farmfe/js-plugin-postcss +## 2.0.0-nightly-20241029121500 + +### Patch Changes + +- Updated dependencies [b327dd1] + - @farmfe/core@2.0.0-nightly-20241029121500 + +## 2.0.0-nightly-20241029095811 + +### Patch Changes + +- Updated dependencies [b3a7caf] + - @farmfe/core@2.0.0-nightly-20241029095811 + +## 2.0.0-nightly-20241024090954 + +### Patch Changes + +- Updated dependencies [f460eb1] + - @farmfe/core@2.0.0-nightly-20241024090954 + +## 2.0.0-nightly-20241024075304 + +### Patch Changes + +- @farmfe/core@2.0.0-nightly-20241024075304 + +## 2.0.0-nightly-20241023101523 + +### Patch Changes + +- Updated dependencies [d7c5ffb] + - @farmfe/core@2.0.0-nightly-20241023101523 + +## 2.0.0-nightly-20241023020505 + +### Patch Changes + +- Updated dependencies [3651244] + - @farmfe/core@2.0.0-nightly-20241023020505 + +## 2.0.0-nightly-20241022143924 + +### Patch Changes + +- Updated dependencies [83838bd] + - @farmfe/core@2.0.0-nightly-20241022143924 + +## 2.0.0-nightly-20241022124925 + +### Patch Changes + +- @farmfe/core@2.0.0-nightly-20241022124925 + +## 2.0.0-nightly-20241022041556 + +### Patch Changes + +- Updated dependencies [24347c9] + - @farmfe/core@2.0.0-nightly-20241022041556 + +## 2.0.0-nightly-20241022014521 + +### Patch Changes + +- Updated dependencies [a82a5b2] + - @farmfe/core@2.0.0-nightly-20241022014521 ## 1.11.0 ### Patch Changes diff --git a/js-plugins/postcss/package.json b/js-plugins/postcss/package.json index 07b9c31c61..29dd992599 100644 --- a/js-plugins/postcss/package.json +++ b/js-plugins/postcss/package.json @@ -1,6 +1,6 @@ { "name": "@farmfe/js-plugin-postcss", - "version": "1.11.0", + "version": "2.0.0-nightly-20241029121500", "description": "support postcss for farm.", "main": "./build/cjs/index.cjs", "types": "./build/cjs/index.d.ts", @@ -40,7 +40,7 @@ "license": "MIT", "devDependencies": { "@farmfe/cli": "workspace:*", - "@farmfe/core": "workspace:^1.6.0", + "@farmfe/core": "workspace:*", "@farmfe/js-plugin-dts": "workspace:*", "@types/postcss-import": "^14.0.3", "@types/postcss-url": "^10.0.4", @@ -51,7 +51,7 @@ "postcss-url": "^10.1.3" }, "peerDependencies": { - "@farmfe/core": "workspace:^1.6.0", + "@farmfe/core": "workspace:*", "postcss": ">=8.0.0" } -} +} \ No newline at end of file diff --git a/js-plugins/sass/.eslintrc.json b/js-plugins/sass/.eslintrc.json deleted file mode 100644 index 18f74694f7..0000000000 --- a/js-plugins/sass/.eslintrc.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "root": true, - "extends": "../../.eslintrc.base.json", - "parserOptions": { - "project": ["./js-plugins/sass/tsconfig.json"] - }, - "rules": {} -} diff --git a/js-plugins/sass/CHANGELOG.md b/js-plugins/sass/CHANGELOG.md index f083059f83..b7ffca89e6 100644 --- a/js-plugins/sass/CHANGELOG.md +++ b/js-plugins/sass/CHANGELOG.md @@ -1,5 +1,72 @@ # @farmfe/js-plugin-sass +## 3.0.0-nightly-20241029121500 + +### Patch Changes + +- Updated dependencies [b327dd1] + - @farmfe/core@2.0.0-nightly-20241029121500 + +## 3.0.0-nightly-20241029095811 + +### Patch Changes + +- Updated dependencies [b3a7caf] + - @farmfe/core@2.0.0-nightly-20241029095811 + +## 3.0.0-nightly-20241024090954 + +### Patch Changes + +- Updated dependencies [f460eb1] + - @farmfe/core@2.0.0-nightly-20241024090954 + +## 3.0.0-nightly-20241024075304 + +### Patch Changes + +- @farmfe/core@2.0.0-nightly-20241024075304 + +## 3.0.0-nightly-20241023101523 + +### Patch Changes + +- Updated dependencies [d7c5ffb] + - @farmfe/core@2.0.0-nightly-20241023101523 + +## 3.0.0-nightly-20241023020505 + +### Patch Changes + +- Updated dependencies [3651244] + - @farmfe/core@2.0.0-nightly-20241023020505 + +## 3.0.0-nightly-20241022143924 + +### Patch Changes + +- Updated dependencies [83838bd] + - @farmfe/core@2.0.0-nightly-20241022143924 + +## 3.0.0-nightly-20241022124925 + +### Patch Changes + +- @farmfe/core@2.0.0-nightly-20241022124925 + +## 3.0.0-nightly-20241022041556 + +### Patch Changes + +- Updated dependencies [24347c9] + - @farmfe/core@2.0.0-nightly-20241022041556 + +## 3.0.0-nightly-20241022014521 + +### Patch Changes + +- Updated dependencies [a82a5b2] + - @farmfe/core@2.0.0-nightly-20241022014521 ## 2.12.0 ### Patch Changes diff --git a/js-plugins/sass/package.json b/js-plugins/sass/package.json index a0e43cfb9d..2382fc8ff4 100644 --- a/js-plugins/sass/package.json +++ b/js-plugins/sass/package.json @@ -1,6 +1,6 @@ { "name": "@farmfe/js-plugin-sass", - "version": "2.12.0", + "version": "3.0.0-nightly-20241029121500", "description": "support scss compile for farm.", "main": "./build/cjs/index.cjs", "types": "./build/cjs/index.d.ts", @@ -46,14 +46,14 @@ "license": "MIT", "devDependencies": { "@farmfe/cli": "workspace:*", - "@farmfe/core": "workspace:^1.6.0", + "@farmfe/core": "workspace:*", "@farmfe/js-plugin-dts": "workspace:*", "sass": "^1.74.1", "sass-embedded": "^1.74.1" }, "peerDependencies": { - "@farmfe/core": "workspace:^1.6.0", + "@farmfe/core": "workspace:*", "sass": "^1.3.0", "sass-embedded": "*" } -} +} \ No newline at end of file diff --git a/js-plugins/sass/src/index.ts b/js-plugins/sass/src/index.ts index 831b0308f9..a7512a94b2 100644 --- a/js-plugins/sass/src/index.ts +++ b/js-plugins/sass/src/index.ts @@ -48,7 +48,6 @@ export default function farmSassPlugin( let farmConfig!: UserConfig['compilation']; const implementation = getSassImplementation(options.implementation); - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore TODO fix it const cwd = () => farmConfig.root ?? process.cwd(); diff --git a/js-plugins/sass/src/utils.ts b/js-plugins/sass/src/utils.ts index e83c3afde6..cddb213739 100644 --- a/js-plugins/sass/src/utils.ts +++ b/js-plugins/sass/src/utils.ts @@ -26,7 +26,6 @@ async function getDefaultSassImplementation() { * @param implementation * @returns */ -// eslint-disable-next-line @typescript-eslint/no-explicit-any export function getSassImplementation(implementation?: string | any) { let resolvedImplementation = implementation; // if empty diff --git a/js-plugins/solid/.eslintrc.json b/js-plugins/solid/.eslintrc.json deleted file mode 100644 index 390bb9e673..0000000000 --- a/js-plugins/solid/.eslintrc.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "root": true, - "extends": "../../.eslintrc.base.json", - "parserOptions": { - "project": ["./js-plugins/solid/tsconfig.json"] - }, - "rules": {} -} diff --git a/js-plugins/solid/CHANGELOG.md b/js-plugins/solid/CHANGELOG.md index 2b2b2f03c4..cd9b7085a4 100644 --- a/js-plugins/solid/CHANGELOG.md +++ b/js-plugins/solid/CHANGELOG.md @@ -1,5 +1,72 @@ # @farmfe/js-plugin-solid +## 3.0.0-nightly-20241029121500 + +### Patch Changes + +- Updated dependencies [b327dd1] + - @farmfe/core@2.0.0-nightly-20241029121500 + +## 3.0.0-nightly-20241029095811 + +### Patch Changes + +- Updated dependencies [b3a7caf] + - @farmfe/core@2.0.0-nightly-20241029095811 + +## 3.0.0-nightly-20241024090954 + +### Patch Changes + +- Updated dependencies [f460eb1] + - @farmfe/core@2.0.0-nightly-20241024090954 + +## 3.0.0-nightly-20241024075304 + +### Patch Changes + +- @farmfe/core@2.0.0-nightly-20241024075304 + +## 3.0.0-nightly-20241023101523 + +### Patch Changes + +- Updated dependencies [d7c5ffb] + - @farmfe/core@2.0.0-nightly-20241023101523 + +## 3.0.0-nightly-20241023020505 + +### Patch Changes + +- Updated dependencies [3651244] + - @farmfe/core@2.0.0-nightly-20241023020505 + +## 3.0.0-nightly-20241022143924 + +### Patch Changes + +- Updated dependencies [83838bd] + - @farmfe/core@2.0.0-nightly-20241022143924 + +## 3.0.0-nightly-20241022124925 + +### Patch Changes + +- @farmfe/core@2.0.0-nightly-20241022124925 + +## 3.0.0-nightly-20241022041556 + +### Patch Changes + +- Updated dependencies [24347c9] + - @farmfe/core@2.0.0-nightly-20241022041556 + +## 3.0.0-nightly-20241022014521 + +### Patch Changes + +- Updated dependencies [a82a5b2] + - @farmfe/core@2.0.0-nightly-20241022014521 ## 2.11.0 ### Patch Changes diff --git a/js-plugins/solid/package.json b/js-plugins/solid/package.json index 360a12eb94..f7882eaef0 100644 --- a/js-plugins/solid/package.json +++ b/js-plugins/solid/package.json @@ -1,7 +1,8 @@ { "name": "@farmfe/js-plugin-solid", - "version": "2.11.0", + "version": "3.0.0-nightly-20241029121500", "description": "SolidJS support for Farm", + "private": true, "author": { "name": "J4ck W4n9", "email": "1163585385@qq.com" @@ -34,16 +35,14 @@ "solid-refresh": "^0.5.3" }, "devDependencies": { - "@farmfe/cli": "workspace:*", - "@farmfe/core": "workspace:*", "@farmfe/js-plugin-dts": "workspace:*", "@types/babel__core": "^7.20.1", "solid-js": "^1.7.8" }, "peerDependencies": { - "@farmfe/core": "workspace:^1.6.0" + "@farmfe/core": "workspace:*" }, "files": [ "build" ] -} +} \ No newline at end of file diff --git a/js-plugins/svgr/.eslintrc.json b/js-plugins/svgr/.eslintrc.json deleted file mode 100644 index 38d0613835..0000000000 --- a/js-plugins/svgr/.eslintrc.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "root": true, - "extends": "../../.eslintrc.base.json", - "parserOptions": { - "project": ["./js-plugins/svgr/tsconfig.json"] - }, - "rules": {} -} diff --git a/js-plugins/svgr/CHANGELOG.md b/js-plugins/svgr/CHANGELOG.md index fc4f2f2690..17aee3c75b 100644 --- a/js-plugins/svgr/CHANGELOG.md +++ b/js-plugins/svgr/CHANGELOG.md @@ -1,5 +1,72 @@ # @farmfe/js-plugin-svgr +## 2.0.0-nightly-20241029121500 + +### Patch Changes + +- Updated dependencies [b327dd1] + - @farmfe/core@2.0.0-nightly-20241029121500 + +## 2.0.0-nightly-20241029095811 + +### Patch Changes + +- Updated dependencies [b3a7caf] + - @farmfe/core@2.0.0-nightly-20241029095811 + +## 2.0.0-nightly-20241024090954 + +### Patch Changes + +- Updated dependencies [f460eb1] + - @farmfe/core@2.0.0-nightly-20241024090954 + +## 2.0.0-nightly-20241024075304 + +### Patch Changes + +- @farmfe/core@2.0.0-nightly-20241024075304 + +## 2.0.0-nightly-20241023101523 + +### Patch Changes + +- Updated dependencies [d7c5ffb] + - @farmfe/core@2.0.0-nightly-20241023101523 + +## 2.0.0-nightly-20241023020505 + +### Patch Changes + +- Updated dependencies [3651244] + - @farmfe/core@2.0.0-nightly-20241023020505 + +## 2.0.0-nightly-20241022143924 + +### Patch Changes + +- Updated dependencies [83838bd] + - @farmfe/core@2.0.0-nightly-20241022143924 + +## 2.0.0-nightly-20241022124925 + +### Patch Changes + +- @farmfe/core@2.0.0-nightly-20241022124925 + +## 2.0.0-nightly-20241022041556 + +### Patch Changes + +- Updated dependencies [24347c9] + - @farmfe/core@2.0.0-nightly-20241022041556 + +## 2.0.0-nightly-20241022014521 + +### Patch Changes + +- Updated dependencies [a82a5b2] + - @farmfe/core@2.0.0-nightly-20241022014521 ## 1.9.0 ### Patch Changes diff --git a/js-plugins/svgr/package.json b/js-plugins/svgr/package.json index 822a56e912..a04bf71200 100644 --- a/js-plugins/svgr/package.json +++ b/js-plugins/svgr/package.json @@ -1,6 +1,6 @@ { "name": "@farmfe/js-plugin-svgr", - "version": "1.9.0", + "version": "2.0.0-nightly-20241029121500", "description": "support svgr compile for farm.", "main": "./build/cjs/index.cjs", "types": "./build/cjs/index.d.ts", @@ -40,7 +40,7 @@ "license": "MIT", "devDependencies": { "@farmfe/cli": "workspace:*", - "@farmfe/core": "workspace:^1.6.0", + "@farmfe/core": "workspace:*", "@farmfe/js-plugin-dts": "workspace:^" }, "dependencies": { @@ -48,6 +48,6 @@ "@svgr/plugin-jsx": "^8.1.0" }, "peerDependencies": { - "@farmfe/core": "workspace:^1.6.0" + "@farmfe/core": "workspace:*" } } diff --git a/js-plugins/tailwindcss/farm.config.ts b/js-plugins/tailwindcss/farm.config.ts index badc65176c..9ae57028dd 100644 --- a/js-plugins/tailwindcss/farm.config.ts +++ b/js-plugins/tailwindcss/farm.config.ts @@ -18,7 +18,10 @@ export default defineConfig({ mode: 'development', minify: false, lazyCompilation: false, - treeShaking: false + treeShaking: false, + persistentCache: false, + progress: false }, + // plugins: ['@farmfe/plugin-dts'] plugins: [dts()] }); diff --git a/js-plugins/tailwindcss/package.json b/js-plugins/tailwindcss/package.json index aa24235e16..e7a4ad72bc 100644 --- a/js-plugins/tailwindcss/package.json +++ b/js-plugins/tailwindcss/package.json @@ -30,6 +30,7 @@ }, "devDependencies": { "@farmfe/js-plugin-dts": "workspace:^", + "@farmfe/plugin-dts": "workspace:^", "@types/postcss-import": "^14.0.3" } -} \ No newline at end of file +} diff --git a/js-plugins/tailwindcss/src/index.ts b/js-plugins/tailwindcss/src/index.ts index 8d48abbd98..d0ba43add9 100644 --- a/js-plugins/tailwindcss/src/index.ts +++ b/js-plugins/tailwindcss/src/index.ts @@ -101,7 +101,7 @@ export default function tailwindcss(): JsPlugin[] { // } }; }, - configureDevServer(server) { + configureServer(server) { servers.push(server); }, transformHtml: { diff --git a/js-plugins/visualizer/.eslintrc.json b/js-plugins/visualizer/.eslintrc.json deleted file mode 100644 index c5a96a660e..0000000000 --- a/js-plugins/visualizer/.eslintrc.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "root": true, - "extends": "../../.eslintrc.base.json", - "parserOptions": { - "project": ["./js-plugins/record-viewer/tsconfig.json"] - } -} diff --git a/js-plugins/visualizer/.gitignore b/js-plugins/visualizer/.gitignore index 30d7871152..e12282a880 100644 --- a/js-plugins/visualizer/.gitignore +++ b/js-plugins/visualizer/.gitignore @@ -54,9 +54,6 @@ typings/ # Optional npm cache directory .npm -# Optional eslint cache -.eslintcache - # Microbundle cache .rpt2_cache/ .rts2_cache_cjs/ diff --git a/js-plugins/visualizer/package.json b/js-plugins/visualizer/package.json index fdf42c6daf..d87dc6a1b6 100644 --- a/js-plugins/visualizer/package.json +++ b/js-plugins/visualizer/package.json @@ -27,8 +27,6 @@ "ws": "^8.14.2" }, "devDependencies": { - "@farmfe/cli": "workspace:*", - "@farmfe/core": "workspace:*", "@farmfe/js-plugin-dts": "workspace:*", "@farmfe/js-plugin-less": "workspace:*", "@farmfe/js-plugin-postcss": "workspace:*", diff --git a/js-plugins/visualizer/src/dev.ts b/js-plugins/visualizer/src/dev.ts index c0753d1a3f..352eb2a3e6 100644 --- a/js-plugins/visualizer/src/dev.ts +++ b/js-plugins/visualizer/src/dev.ts @@ -17,7 +17,7 @@ export default function farmRecorderPlugin(): JsPlugin { config.compilation = { ...config.compilation, record: true }; return config; }, - configureDevServer(server) { + configureServer(server) { const middlewares = [records] as DevServerMiddleware[]; server.applyMiddlewares(middlewares); } diff --git a/js-plugins/vue/.eslintrc.json b/js-plugins/vue/.eslintrc.json deleted file mode 100644 index 0043980314..0000000000 --- a/js-plugins/vue/.eslintrc.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "root": true, - "extends": "../../.eslintrc.base.json", - "parserOptions": { - "project": ["./js-plugins/vue/tsconfig.json"] - }, - "rules": {} -} diff --git a/js-plugins/vue/CHANGELOG.md b/js-plugins/vue/CHANGELOG.md index bc19d572a5..1d6267a960 100644 --- a/js-plugins/vue/CHANGELOG.md +++ b/js-plugins/vue/CHANGELOG.md @@ -1,5 +1,72 @@ # @farmfe/js-plugin-vue +## 4.0.0-nightly-20241029121500 + +### Patch Changes + +- Updated dependencies [b327dd1] + - @farmfe/core@2.0.0-nightly-20241029121500 + +## 4.0.0-nightly-20241029095811 + +### Patch Changes + +- Updated dependencies [b3a7caf] + - @farmfe/core@2.0.0-nightly-20241029095811 + +## 4.0.0-nightly-20241024090954 + +### Patch Changes + +- Updated dependencies [f460eb1] + - @farmfe/core@2.0.0-nightly-20241024090954 + +## 4.0.0-nightly-20241024075304 + +### Patch Changes + +- @farmfe/core@2.0.0-nightly-20241024075304 + +## 4.0.0-nightly-20241023101523 + +### Patch Changes + +- Updated dependencies [d7c5ffb] + - @farmfe/core@2.0.0-nightly-20241023101523 + +## 4.0.0-nightly-20241023020505 + +### Patch Changes + +- Updated dependencies [3651244] + - @farmfe/core@2.0.0-nightly-20241023020505 + +## 4.0.0-nightly-20241022143924 + +### Patch Changes + +- Updated dependencies [83838bd] + - @farmfe/core@2.0.0-nightly-20241022143924 + +## 4.0.0-nightly-20241022124925 + +### Patch Changes + +- @farmfe/core@2.0.0-nightly-20241022124925 + +## 4.0.0-nightly-20241022041556 + +### Patch Changes + +- Updated dependencies [24347c9] + - @farmfe/core@2.0.0-nightly-20241022041556 + +## 4.0.0-nightly-20241022014521 + +### Patch Changes + +- Updated dependencies [a82a5b2] + - @farmfe/core@2.0.0-nightly-20241022014521 ## 3.12.0 ### Patch Changes diff --git a/js-plugins/vue/package.json b/js-plugins/vue/package.json index 1696c767c3..fcd443086a 100644 --- a/js-plugins/vue/package.json +++ b/js-plugins/vue/package.json @@ -1,6 +1,7 @@ { "name": "@farmfe/js-plugin-vue", - "version": "3.12.0", + "version": "4.0.0-nightly-20241029121500", + "private": true, "description": "support vue sfc for farm.", "main": "./build/index.cjs", "module": "./dist/farm-vue-plugin.js", @@ -37,8 +38,6 @@ "author": "ysy945", "license": "MIT", "devDependencies": { - "@farmfe/cli": "workspace:^", - "@farmfe/core": "workspace:^", "@farmfe/js-plugin-dts": "workspace:^", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", @@ -52,7 +51,7 @@ "source-map": "^0.7.4" }, "peerDependencies": { - "@farmfe/core": "workspace:^1.6.0", + "@farmfe/core": "workspace:*", "less": "*", "sass": "*", "stylus": "*" diff --git a/js-plugins/vue/src/farm-vue-plugin.ts b/js-plugins/vue/src/farm-vue-plugin.ts index 7a0c1273a6..3ad6235196 100644 --- a/js-plugins/vue/src/farm-vue-plugin.ts +++ b/js-plugins/vue/src/farm-vue-plugin.ts @@ -239,7 +239,6 @@ async function preProcession( case 'scss': processor = await loadPreProcessor(PreProcessorsType.sass); return await compilePreProcessorCodeToCss(styleCode, processor, { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore indentedSyntax: moduleType === 'sass', includePaths: options.paths ?? [] diff --git a/package.json b/package.json index 2745c29595..76f299ccda 100644 --- a/package.json +++ b/package.json @@ -8,23 +8,28 @@ }, "scripts": { "preinstall": "npx only-allow pnpm", - "bootstrap": "pnpm install && node scripts/clean.mjs && node scripts/bootstrap.mjs && pnpm start", - "test": "cross-env NODE_OPTIONS=--trace-exit vitest run", + "bootstrap": "node scripts/bootstrap.mjs -v", "start:rs": "cargo watch -w crates -w rust-plugins -s 'scripts/watch.sh'", "start": "pnpm --filter @farmfe/cli start", + "build:cli": "pnpm --filter @farmfe/cli build", + "build:core": "pnpm --filter @farmfe/core build", + "doc": "pnpm --filter farm-docs dev", "release": "node scripts/release.mjs", + "release:nightly": "node scripts/release-nightly.mjs", "check": "biome check . --diagnostic-level=warn --apply", - "clean": "node scripts/clean.mjs && rimraf node_modules **/*/node_modules", "bump": "node scripts/bump.mjs", + "bump:nightly": "node scripts/bump-nightly.mjs", "bump:create-farm": "node scripts/bump-create-farm-version.mjs", - "test:rs:update": "cross-env FARM_UPDATE_SNAPSHOTS=1 cargo test -p farmfe_compiler", + "test:rs:update": "cross-env FARM_UPDATE_SNAPSHOTS=1 INSTA_UPDATE=always cargo test -p farmfe_compiler", "ready": "node scripts/ready.mjs", - "test-e2e": "vitest run -c vitest.config.e2e.ts", - "prepare": "husky" + "test-e2e": "vitest run -c vitest.config.e2e.ts arco-pro", + "prepare": "husky", + "clean": "node scripts/clean.mjs && rimraf node_modules **/*/node_modules", + "test": "echo 'fixme before merge to main'" }, "devDependencies": { - "@biomejs/biome": "1.8.3", - "@changesets/cli": "^2.26.0", + "@biomejs/biome": "1.9.4", + "@changesets/cli": "2.27.9", "@codspeed/vitest-plugin": "^3.1.1", "@commitlint/cli": "^17.0.3", "@commitlint/config-conventional": "^17.0.3", @@ -33,25 +38,23 @@ "@types/node": "^18.19.67", "@vitest/coverage-v8": "2.0.4", "cross-env": "^7.0.3", - "cspell": "^6.2.2", + "cspell": "8.14.2", "execa": "^7.1.1", "get-port": "^7.1.0", "husky": "^9.0.11", "lint-staged": "^13.0.3", "nanospinner": "^1.1.0", + "node-emoji": "^2.1.3", "playwright-chromium": "^1.42.1", - "rimraf": "^3.0.2", + "rimraf": "6.0.1", "rollup": "^3.29.4", - "typescript": "^4.9.4", + "typescript": "5.6.3", "vite": "^5.2.6", "vitest": "2.0.4" }, "lint-staged": { - "packages/**/*.ts": [ - "npx biome check --no-errors-on-unmatched --files-ignore-unknown=true --apply" - ], - "js-plugins/**/*.ts": [ - "npx biome check --no-errors-on-unmatched --files-ignore-unknown=true --apply" + "{packages,js-plugins,docs,scripts}/**/*.{ts,json,yaml,yml}": [ + "npx biome check --no-errors-on-unmatched --files-ignore-unknown=true --write" ] }, "pnpm": { diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index d4a5d93e4c..1ce377e489 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,39 @@ # @farmfe/cli +## 2.0.0-nightly-20241022101407 + +### Major Changes + +- 46883f3: bump nightly version + +## 2.0.0-nightly-20241022090550 + +### Major Changes + +- e7920ed: remove peerdep + +## 2.0.0-nightly-20241022041556 + +### Major Changes + +- 6667953: update nightly cli + +### Patch Changes + +- Updated dependencies [24347c9] + - @farmfe/core@2.0.0-nightly-20241022041556 + +## 2.0.0-nightly-20241022014521 + +### Major Changes + +- a82a5b2: bump nightly version + +### Patch Changes + +- Updated dependencies [a82a5b2] + - @farmfe/core@2.0.0-nightly-20241022014521 + ## 1.0.4 ### Patch Changes diff --git a/packages/cli/README.md b/packages/cli/README.md index 7c6c7bcb77..16546f99f1 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -8,20 +8,26 @@ pnpm add @farmfe/cli -D ``` -start your farm project: +start your farm project in development mode: ```sh -farm start +farm dev ``` -build: +build your farm project in production mode: ```sh farm build ``` -preview: +preview your farm project in production mode: ```sh farm preview ``` + +clean your farm persistent cache: + +```sh +farm clean +``` diff --git a/packages/cli/bin/farm.mjs b/packages/cli/bin/farm.mjs index 0277db3280..4f0099a18b 100755 --- a/packages/cli/bin/farm.mjs +++ b/packages/cli/bin/farm.mjs @@ -1,3 +1,6 @@ #!/usr/bin/env node +if (process.argv.includes('--debug')) { + process.env.DEBUG = 'farm:*'; +} -import '../dist/index.js'; +import('../dist/index.js') diff --git a/packages/cli/package.json b/packages/cli/package.json index 0ca7518078..566468a432 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@farmfe/cli", - "version": "1.0.4", + "version": "2.0.0-nightly-20241022101407", "description": "CLI of Farm", "type": "module", "author": { @@ -28,28 +28,17 @@ }, "files": [ "dist", - "bin", - "templates" + "bin" ], "scripts": { "start": "rimraf dist && tsc -b -w", "build": "tsc -b", - "type-check": "tsc --noEmit", "prepublishOnly": "npm run build" }, "engines": { "node": ">= 16" }, "dependencies": { - "cac": "^6.7.14", - "cross-spawn": "^7.0.3", - "inquirer": "9.2.12", - "walkdir": "^0.4.1" - }, - "devDependencies": { - "@farmfe/cli": "workspace:*", - "@farmfe/core": "workspace:*", - "@types/cross-spawn": "^6.0.2", - "@types/inquirer": "^9.0.3" + "cac": "^6.7.14" } } diff --git a/packages/cli/src/config.ts b/packages/cli/src/config.ts deleted file mode 100644 index 467019af8a..0000000000 --- a/packages/cli/src/config.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { FarmCLIOptions, UserConfig } from '@farmfe/core'; -import { FarmCLIBuildOptions, GlobalFarmCLIOptions } from './types.js'; - -export function getOptionFromBuildOption( - options: FarmCLIBuildOptions & GlobalFarmCLIOptions -): FarmCLIOptions & UserConfig { - const { - input, - outDir, - target, - format, - watch, - minify, - sourcemap, - treeShaking, - mode - } = options; - - const output: UserConfig['compilation']['output'] = { - ...(outDir && { path: outDir }), - ...(target && { targetEnv: target }), - ...(format && { format }) - }; - - const compilation: UserConfig['compilation'] = { - input: { ...(input && { index: input }) }, - output, - ...(watch && { watch }), - ...(minify && { minify }), - ...(sourcemap && { sourcemap }), - ...(treeShaking && { treeShaking }) - }; - - const defaultOptions: FarmCLIOptions & UserConfig = { - compilation, - ...(mode && { mode }) - }; - - return defaultOptions; -} diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index e8409c5c3d..6160cc6504 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -1,37 +1,43 @@ -import { readFileSync } from 'node:fs'; - +import { VERSION as CORE_VERSION } from '@farmfe/core'; import { cac } from 'cac'; -import { getOptionFromBuildOption } from './config.js'; + import { + VERSION, handleAsyncOperationErrors, - preventExperimentalWarning, resolveCliConfig, resolveCommandOptions, resolveCore } from './utils.js'; import type { - FarmCLIBuildOptions, - FarmCLIPreviewOptions, - FarmCLIServerOptions, - GlobalFarmCLIOptions, - ICleanOptions + CleanOptions, + CliBuildOptions, + CliPreviewOptions, + CliServerOptions, + GlobalCliOptions } from './types.js'; -const { version } = JSON.parse( - readFileSync(new URL('../package.json', import.meta.url)).toString() -); - const cli = cac('farm'); // common command cli - .option('-c, --config ', 'use specified config file') - .option('-m, --mode ', 'set env mode') - .option('--base ', 'public base path') - .option('--clearScreen', 'allow/disable clear screen when logging', { - default: true - }); + .option( + '-c, --config ', + '[string] use specified config file (default: farm.config.js / farm.config.ts / farm.config.mjs / farm.config.cjs / farm.config.mts / farm.config.cts)' + ) + .option( + '-m, --mode ', + '[string] set env mode, when use with development (default: /)' + ) + .option('--base ', '[string] public base path') + .option('-d, --debug [feat]', `[string | boolean] show debug logs`) + .option( + '--clearScreen', + '[boolean] allow/disable clear screen when logging (default: true)', + { + default: true + } + ); // dev command cli @@ -41,33 +47,55 @@ cli ) .alias('start') .alias('dev') - .option('-l, --lazy', 'lazyCompilation') - .option('--host ', 'specify host') - .option('--port ', 'specify port') - .option('--open', 'open browser on server start') - .option('--hmr', 'enable hot module replacement') - .option('--cors', 'enable cors') - .option('--strictPort', 'specified port is already in use, exit with error') + .option('-l, --lazy', '[boolean] lazyCompilation (default: true)') + .option('--host ', '[string] specify host') + .option('--port ', '[string] specify port') + .option('--open', '[boolean] open browser on server start') + .option('--hmr', '[boolean] enable hot module replacement') + .option('--cors', '[boolean] enable cors') + .option( + '--strictPort', + '[boolean] specified port is already in use, exit with error (default: true)' + ) + .option('--target ', '[string] transpile targetEnv node, browser') + .option('--format ', '[string] transpile format esm, commonjs') + .option('--sourcemap', '[boolean] output source maps for build') + .option( + '--treeShaking', + '[boolean] Eliminate useless code without side effects' + ) + .option('--minify', '[boolean] code compression at build time') .action( async ( - rootPath: string, - options: FarmCLIServerOptions & GlobalFarmCLIOptions + root: string, + options: CliServerOptions & CliBuildOptions & GlobalCliOptions ) => { - const { root, configPath } = resolveCliConfig(rootPath, options); const resolveOptions = resolveCommandOptions(options); const defaultOptions = { root, - compilation: { - lazyCompilation: options.lazy - }, server: resolveOptions, clearScreen: options.clearScreen, - configPath, - mode: options.mode + configFile: options.config, + mode: options.mode, + compilation: { + lazyCompilation: options.lazy, + output: { + path: options?.outDir, + targetEnv: options?.target, + format: options?.format + }, + input: { + index: options?.input + }, + sourcemap: options.sourcemap, + minify: options.minify, + treeShaking: options.treeShaking + } }; const { start } = await resolveCore(); + handleAsyncOperationErrors( start(defaultOptions), 'Failed to start server' @@ -78,83 +106,74 @@ cli // build command cli .command('build [root]', 'compile the project in production mode') - .option('-o, --outDir ', 'output directory') - .option('-i, --input ', 'input file path') - .option('-w, --watch', 'watch file change') - .option('--target ', 'transpile targetEnv node, browser') - .option('--format ', 'transpile format esm, commonjs') - .option('--sourcemap', 'output source maps for build') - .option('--treeShaking', 'Eliminate useless code without side effects') - .option('--minify', 'code compression at build time') - .action( - async ( - rootPath: string, - options: FarmCLIBuildOptions & GlobalFarmCLIOptions - ) => { - const { root, configPath } = resolveCliConfig(rootPath, options); - - const defaultOptions = { - root, - configPath, - ...getOptionFromBuildOption(options) - }; - - const { build } = await resolveCore(); - handleAsyncOperationErrors(build(defaultOptions), 'error during build'); - } - ); - -cli - .command('watch [root]', 'watch file change') - .option('-o, --outDir ', 'output directory') - .option('-i, --input ', 'input file path') - .option('--target ', 'transpile targetEnv node, browser') - .option('--format ', 'transpile format esm, commonjs') - .option('--sourcemap', 'output source maps for build') - .option('--treeShaking', 'Eliminate useless code without side effects') - .option('--minify', 'code compression at build time') - .action( - async ( - rootPath: string, - options: FarmCLIBuildOptions & GlobalFarmCLIOptions - ) => { - const { root, configPath } = resolveCliConfig(rootPath, options); - - const defaultOptions = { - root, - configPath, - ...getOptionFromBuildOption(options) - }; - - const { watch } = await resolveCore(); - handleAsyncOperationErrors( - watch(defaultOptions), - 'error during watch project' - ); - } - ); + .option('-o, --outDir ', '[string] output directory') + .option('-i, --input ', '[string] input file path') + .option('-w, --watch', '[boolean] watch file change and rebuild') + .option('--target ', '[string] transpile targetEnv node, browser') + .option('--format ', '[string] transpile format esm, commonjs') + .option('--sourcemap', '[boolean] output source maps for build') + .option( + '--treeShaking', + '[boolean] Eliminate useless code without side effects' + ) + .option('--minify', '[boolean] code compression at build time') + .action(async (root: string, options: CliBuildOptions & GlobalCliOptions) => { + const defaultOptions = { + root, + configFile: options.config, + mode: options.mode, + watch: options.watch, + compilation: { + output: { + path: options?.outDir, + targetEnv: options?.target, + format: options?.format + }, + input: { + index: options?.input + }, + sourcemap: options.sourcemap, + minify: options.minify, + treeShaking: options.treeShaking + } + }; + const { build } = await resolveCore(); + + handleAsyncOperationErrors(build(defaultOptions), 'error during build'); + }); cli .command('preview [root]', 'compile the project in watch mode') - .option('--port ', 'specify port') - .option('--open', 'open browser on server preview start') + .option('--host [host]', `[string] specify hostname`) + .option('--port ', `[number] specify port`) + .option('--open', '[boolean] open browser on server preview start') + .option('--outDir ', `[string] output directory (default: dist)`) + .option('--strictPort', `[boolean] exit if specified port is already in use`) .action( - async ( - rootPath: string, - options: FarmCLIPreviewOptions & GlobalFarmCLIOptions - ) => { - const { root, configPath } = resolveCliConfig(rootPath, options); - - const resolveOptions = resolveCommandOptions(options); + async (root: string, options: CliPreviewOptions & GlobalCliOptions) => { const defaultOptions = { root, mode: options.mode, - server: resolveOptions, - configPath, - port: options.port + server: { + preview: { + host: options.host, + port: options.port, + open: options.open, + strictPort: options.strictPort, + distDir: options.outDir + } + }, + configFile: options.config, + port: options.port, + compilation: { + output: { + path: options.outDir + } + } }; const { preview } = await resolveCore(); + handleAsyncOperationErrors( preview(defaultOptions), 'Failed to start preview server' @@ -168,37 +187,20 @@ cli '--recursive', 'Recursively search for node_modules directories and clean them' ) - .action(async (rootPath: string, options: ICleanOptions) => { + .action(async (rootPath: string, options: CleanOptions) => { const { root } = resolveCliConfig(rootPath, options); - const { clean } = await resolveCore(); - try { - await clean(root, options?.recursive); - } catch (e) { - const { Logger } = await import('@farmfe/core'); - const logger = new Logger(); - logger.error(`Failed to clean cache: \n ${e.stack}`); - process.exit(1); - } + const { clean } = await resolveCore(); + handleAsyncOperationErrors( + clean(root, options?.recursive), + 'Failed to clean cache' + ); }); -// Listening for unknown command -cli.on('command:*', async () => { - const { Logger } = await import('@farmfe/core'); - const logger = new Logger(); - logger.error( - 'Unknown command place Run "farm --help" to see available commands' - ); -}); - -// warning::: use mdn browser compatibility data with experimental warning in terminal so prevent experimental warning -// we don't use it in `@farmfe/core` package because -// we need to prevent it in cli package but we don't prevent it in core package -// We only keep the original code environment. -preventExperimentalWarning(); - cli.help(); -cli.version(version); +cli.version( + `@farmfe/cli ${VERSION ?? 'unknown'} @farmfe/core ${CORE_VERSION ?? 'unknown'}` +); cli.parse(); diff --git a/packages/cli/src/types.ts b/packages/cli/src/types.ts index afdd44364f..7b4cebf8e6 100644 --- a/packages/cli/src/types.ts +++ b/packages/cli/src/types.ts @@ -1,36 +1,38 @@ -export interface GlobalFarmCLIOptions { +export interface GlobalCliOptions { '--'?: string[]; c?: boolean | string; config?: string; - configPath?: string; - m?: string; base?: string; - mode?: 'development' | 'production'; - w?: boolean; - watch?: boolean; - watchPath?: string; - port?: number; - lazy?: boolean; - l?: boolean; + m?: string; + mode?: string; clearScreen?: boolean; } -export interface ICleanOptions { - path?: string; +interface BaseServerOptions { + host?: string; + port?: number; + open?: boolean; + cors?: boolean; + strictPort?: boolean; +} + +export interface CleanOptions { recursive?: boolean; } -export interface FarmCLIServerOptions { - port?: string; - open?: boolean; - https?: boolean; +export interface CliServerOptions extends BaseServerOptions { hmr?: boolean; - strictPort?: boolean; } -export interface FarmCLIBuildOptions { - input?: string; +export interface CliBuildOptions { + o?: string; outDir?: string; + i?: string; + input?: string; + w?: boolean; + watch?: boolean; + l?: boolean; + lazy?: boolean; sourcemap?: boolean; minify?: boolean; treeShaking?: boolean; @@ -44,10 +46,10 @@ export interface FarmCLIBuildOptions { | 'browser-legacy' | 'browser-es2015' | 'browser-es2017' - | 'browser-esnext'; + | 'browser-esnext' + | 'library'; } -export interface FarmCLIPreviewOptions { - open?: boolean; - port?: number; +export interface CliPreviewOptions extends BaseServerOptions { + outDir?: string; } diff --git a/packages/cli/src/utils.ts b/packages/cli/src/utils.ts index 18717f8cb8..9cea749d12 100644 --- a/packages/cli/src/utils.ts +++ b/packages/cli/src/utils.ts @@ -1,30 +1,31 @@ -import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'; -import path from 'node:path'; -import readline from 'node:readline'; -import { fileURLToPath } from 'node:url'; -import type { build, clean, preview, start, watch } from '@farmfe/core'; +import { readFileSync } from 'node:fs'; +import { isAbsolute, resolve } from 'node:path'; + import { Logger } from '@farmfe/core'; -import spawn from 'cross-spawn'; -import walkdir from 'walkdir'; -import type { GlobalFarmCLIOptions, ICleanOptions } from './types.js'; +import type { build, clean, preview, start } from '@farmfe/core'; +import type { + CleanOptions, + CliBuildOptions, + CliServerOptions, + GlobalCliOptions +} from './types.js'; const logger = new Logger(); -interface installProps { - cwd: string; - package: string; -} - -export const TEMPLATES_DIR = path.join( - path.dirname(fileURLToPath(import.meta.url)), - '..', - 'templates' -); +/** + * + * @returns {Promise<{ start: typeof start, build: typeof build, watch: typeof watch, preview: typeof preview, clean: typeof clean }>} + * A promise that resolves to an object containing the core functionalities: + * - `start`: Compile the project in dev mode and serve it with farm dev server'. + * - `build`: compile the project in production mode'. + * - `watch`: watch file change'. + * - `preview`: compile the project in watch mode'. + * - `clean`: Clean up the cache built incrementally'. + */ export async function resolveCore(): Promise<{ start: typeof start; build: typeof build; - watch: typeof watch; preview: typeof preview; clean: typeof clean; }> { @@ -32,75 +33,12 @@ export async function resolveCore(): Promise<{ return import('@farmfe/core'); } catch (err) { logger.error( - `Cannot find @farmfe/core module, Did you successfully install: \n${err.stack},` + `Cannot find @farmfe/core module, Did you successfully install: \n${err.stack},`, + { exit: true } ); - process.exit(1); } } -export function copyFiles( - source: string, - dest: string, - callback?: (content: string) => string -): void { - walkdir(source, { sync: true }, (p, stat) => { - if (stat.isFile()) { - const content = readFileSync(p).toString(); - const newContent = callback?.(content) ?? content; - - const relativePath = path.relative(source, p); - const destPath = path.join(dest, relativePath); - - if (!existsSync(path.dirname(destPath))) { - mkdirSync(path.dirname(destPath), { recursive: true }); - } - - writeFileSync(destPath, newContent); - } - }); - - if (!existsSync(path.join(dest, '.gitignore'))) { - writeFileSync( - path.join(dest, '.gitignore'), - ` -node_modules -*.farm` - ); - } -} - -export async function install(options: installProps): Promise { - const cwd = options.cwd; - return new Promise((resolve, reject) => { - const command = options.package; - const args = ['install']; - - const child = spawn(command, args, { - cwd, - stdio: 'inherit' - }); - - child.once('close', (code: number) => { - if (code !== 0) { - reject({ - command: `${command} ${args.join(' ')}` - }); - return; - } - resolve(); - }); - child.once('error', reject); - }); -} -/** - * 用于规范化目标路径 - * @param {string |undefined} targetDir - * @returns - */ -export function formatTargetDir(targetDir: string | undefined) { - return targetDir?.trim()?.replace(/\/+$/g, ''); -} - /** * filter duplicate item in options */ @@ -111,19 +49,13 @@ export function filterDuplicateOptions(options: T) { } } } - /** - * clear command screen + * @param options The cli passes parameters + * @returns Remove parameters that are not required */ -export function clearScreen() { - const repeatCount = process.stdout.rows - 2; - const blank = repeatCount > 0 ? '\n'.repeat(repeatCount) : ''; - console.log(blank); - readline.cursorTo(process.stdout, 0, 0); - readline.clearScreenDown(process.stdout); -} - -export function cleanOptions(options: GlobalFarmCLIOptions) { +export function cleanOptions( + options: GlobalCliOptions & CliServerOptions & CliBuildOptions +) { const resolveOptions = { ...options }; delete resolveOptions['--']; @@ -140,18 +72,34 @@ export function cleanOptions(options: GlobalFarmCLIOptions) { return resolveOptions; } +/** + * + * @param options cli parameters + * @returns resolve command options + */ export function resolveCommandOptions( - options: GlobalFarmCLIOptions -): GlobalFarmCLIOptions { + options: GlobalCliOptions & CliServerOptions +): GlobalCliOptions & CliServerOptions { const resolveOptions = { ...options }; filterDuplicateOptions(resolveOptions); return cleanOptions(resolveOptions); } +/** + * + * @param root root path + * @param configPath config path + * @returns config path absolute path + */ export function getConfigPath(root: string, configPath: string) { - return path.resolve(root, configPath ?? ''); + return resolve(root, configPath ?? ''); } +/** + * + * @param asyncOperation The asynchronous operation to be executed. + * @param errorMessage The error message to log if the operation fails. + */ export async function handleAsyncOperationErrors( asyncOperation: Promise, errorMessage: string @@ -159,31 +107,32 @@ export async function handleAsyncOperationErrors( try { await asyncOperation; } catch (error) { - logger.error(`${errorMessage}:\n${error.stack}`); - process.exit(1); + logger.error(`${errorMessage}:\n${error.stack}`, { exit: true }); } } -// prevent node experimental warning -export function preventExperimentalWarning() { - const defaultEmit = process.emit; - process.emit = function (...args: any[]) { - if (args[1].name === 'ExperimentalWarning') { - return undefined; - } - return defaultEmit.call(this, ...args); - }; -} - +/** + * + * @param rootPath root path + * @returns absolute path + */ export function resolveRootPath(rootPath = '') { - return rootPath && path.isAbsolute(rootPath) + return rootPath && isAbsolute(rootPath) ? rootPath - : path.resolve(process.cwd(), rootPath); + : resolve(process.cwd(), rootPath); } +/** + * + * @param root root path + * @param options cli parameters + * @returns + * - root root path + * - configPath + */ export function resolveCliConfig( root: string, - options: GlobalFarmCLIOptions & ICleanOptions + options: GlobalCliOptions & CleanOptions ) { root = resolveRootPath(root); const configPath = getConfigPath(root, options.config); @@ -192,3 +141,9 @@ export function resolveCliConfig( configPath }; } + +const { version } = JSON.parse( + readFileSync(new URL('../package.json', import.meta.url)).toString() +); + +export const VERSION = version; diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json index 47c0ed5773..a2daa35cf8 100644 --- a/packages/cli/tsconfig.json +++ b/packages/cli/tsconfig.json @@ -6,14 +6,9 @@ "declaration": false, "noUnusedLocals": false, "noUnusedParameters": false, - "module": "NodeNext" }, - "exclude": [ - "node_modules" - ], - "include": [ - "src/**/*" - ], + "exclude": ["node_modules"], + "include": ["src/**/*"], "references": [ { "path": "../core/tsconfig.build.json" diff --git a/packages/core/.gitignore b/packages/core/.gitignore index b1be4119fb..2e0564eeb3 100644 --- a/packages/core/.gitignore +++ b/packages/core/.gitignore @@ -54,9 +54,6 @@ typings/ # Optional npm cache directory .npm -# Optional eslint cache -.eslintcache - # Microbundle cache .rpt2_cache/ .rts2_cache_cjs/ diff --git a/packages/core/.npmignore b/packages/core/.npmignore index f96abe0b8c..c16e991490 100644 --- a/packages/core/.npmignore +++ b/packages/core/.npmignore @@ -3,7 +3,6 @@ Cargo.lock .cargo .github npm -.eslintrc .prettierignore rustfmt.toml yarn.lock diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 9ff275cb17..de6b2cb2e9 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,10 @@ # @farmfe/core +## 2.0.0-nightly-20241029121500 + +### Major Changes + +- b327dd1: collect htmlFallbackMiddleware ## 1.6.0 ### Minor Changes @@ -159,16 +164,63 @@ ### Patch Changes -- c078cd35: fix #1499 wrong defaults of side effects of vite plugin adapter hook resolveId -- c078cd35: Fix wrong esm introp helper order when using top level await +- b3a7caf: fix css url resolving issue +- Updated dependencies [669e2b8] + - @farmfe/runtime-plugin-hmr@4.0.0-nightly-20241029095811 + +## 2.0.0-nightly-20241024090954 + +### Major Changes + +- f460eb1: bump core version fix spa reload not 404 + +## 2.0.0-nightly-20241024075304 + +### Patch Changes + +- Updated dependencies [9a1b2b9] + - @farmfe/plugin-replace-dirname@1.0.0-nightly-20241024075304 + +## 2.0.0-nightly-20241023101523 -## 1.3.30 +### Major Changes + +- d7c5ffb: support node 16 + +## 2.0.0-nightly-20241023020505 ### Patch Changes -- 36512446: add assets mode for asset path generate -- 2b9b2e3f: Fix async module detection wrong with cyclic dependencies -- b3a7caf2: fix css url resolving issue +- 3651244: add assets mode for asset path generate +- Updated dependencies [cab79e8] + - @farmfe/runtime@1.0.0-nightly-20241023020505 + - @farmfe/runtime-plugin-hmr@4.0.0-nightly-20241023020505 + - @farmfe/runtime-plugin-import-meta@1.0.0-nightly-20241023020505 + +## 2.0.0-nightly-20241022143924 + +### Major Changes + +- 83838bd: remove lightCyan color utils + +## 2.0.0-nightly-20241022124925 + +### Patch Changes + +- Updated dependencies [6a1038c] + - @farmfe/utils@1.0.0-nightly-20241022124925 + +## 2.0.0-nightly-20241022041556 + +### Major Changes + +- 24347c9: update deps + +## 2.0.0-nightly-20241022014521 + +### Major Changes + +- a82a5b2: bump nightly version ## 1.3.29 diff --git a/packages/core/binding/binding.d.ts b/packages/core/binding/binding.d.ts index fe777018a3..6b8c067a79 100644 --- a/packages/core/binding/binding.d.ts +++ b/packages/core/binding/binding.d.ts @@ -3,17 +3,9 @@ /* auto-generated by NAPI-RS */ -export interface JsPluginAugmentResourceHashHookFilters { - resourcePotTypes: Array - moduleIds: Array -} export interface JsPluginLoadHookFilters { resolvedPaths: Array } -export interface JsPluginRenderResourcePotHookFilters { - resourcePotTypes: Array - moduleIds: Array -} /** Resolve hook filters, works as `||`. If any importers or sources matches any regex item in the Vec, we treat it as filtered. */ export interface JsPluginResolveHookFilters { importers: Array @@ -28,7 +20,7 @@ export const enum JsPluginTransformHtmlHookOrder { Normal = 1, Post = 2 } -export interface JsPluginProcessModuleHookFilters { +export interface JsModuleHookFilters { moduleTypes: Array resolvedPaths: Array } @@ -64,7 +56,7 @@ export declare class Compiler { traceDependencies(): object traceModuleGraph(): object /** async compile, return promise */ - compile(): object + compile(): Promise /** sync compile */ compileSync(): void /** TODO: usage example */ @@ -74,6 +66,7 @@ export declare class Compiler { getParentFiles(resolvedPath: string): Array resources(): Record resourcesMap(): Record + writeResourcesToDisk(): void watchModules(): Array relativeModulePaths(): Array resource(name: string): Buffer | null diff --git a/packages/core/client.d.ts b/packages/core/client.d.ts index d151ad6eb9..72a97fd2f0 100644 --- a/packages/core/client.d.ts +++ b/packages/core/client.d.ts @@ -5,7 +5,6 @@ * Copyright (c) 2019-present, Yuxi (Evan) You and Vite contributors */ -/* eslint-disable @typescript-eslint/triple-slash-reference */ /// // CSS modules diff --git a/packages/core/package.json b/packages/core/package.json index a5eefcc9e6..06864d9327 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@farmfe/core", - "version": "1.6.0", + "version": "2.0.0-nightly-20241029121500", "main": "dist/index.js", "types": "dist/index.d.ts", "type": "module", @@ -54,7 +54,8 @@ "hmr" ], "scripts": { - "artifacts": "napi artifacts", + "start": "tsc -w -p tsconfig.build.json", + "start:debug": "tsc -w -p tsconfig.build.json", "build:cjs": "node scripts/build-cjs.mjs", "build": "tsc -p tsconfig.build.json && npm run build:cjs", "build:rs": "npm run build:rs:debug -- --release", @@ -63,45 +64,54 @@ "build:rs:profile": "cross-env FARM_PROFILE=1 npm run build:rs -- --features profile", "prepublishOnly": "napi prepublish -t npm && FARM_PUBLISH=true npm run build:cjs", "clean": "rimraf dist tsconfig.build.tsbuildinfo", - "version": "napi version", - "start": "tsc -w -p tsconfig.build.json", + "napi:version": "napi version", + "artifacts": "napi artifacts", "type-check": "tsc -p tsconfig.build.json" }, "devDependencies": { "@napi-rs/cli": "^2.18.4", + "@types/compression": "^1.7.5", + "@types/connect": "^3.4.38", + "@types/cors": "^2.8.17", + "@types/debug": "^4.1.12", + "@types/escape-html": "^1.0.4", + "@types/etag": "^1.8.3", + "@types/figlet": "^1.5.5", "@types/fs-extra": "^11.0.1", - "@types/koa": "^2.13.5", - "@types/koa-compress": "^4.0.3", - "@types/koa-static": "^4.0.2", - "@types/koa__cors": "^5.0.0", - "@types/ws": "^8.5.4" + "@types/http-proxy": "^1.17.14", + "@types/mime-types": "^2.1.2", + "@types/ws": "^8.5.8", + "escape-html": "^1.0.3", + "react-refresh": "^0.14.0" }, "dependencies": { - "@farmfe/runtime": "workspace:0.12.10", - "@farmfe/runtime-plugin-hmr": "workspace:3.5.10", - "@farmfe/runtime-plugin-import-meta": "workspace:0.2.3", + "@farmfe/plugin-replace-dirname": "workspace:*", + "@farmfe/runtime": "workspace:1.0.0-nightly-20241023020505", + "@farmfe/runtime-plugin-hmr": "workspace:4.0.0-nightly-20241029095811", + "@farmfe/runtime-plugin-import-meta": "workspace:1.0.0-nightly-20241023020505", "@farmfe/utils": "workspace:*", - "@koa/cors": "^5.0.0", + "@polka/compression": "1.0.0-next.25", "@swc/helpers": "^0.5.0", "chokidar": "^3.5.3", + "connect": "^3.7.0", + "cors": "^2.8.5", + "debug": "^4.3.5", "deepmerge": "^4.3.1", "dotenv": "^16.4.5", "dotenv-expand": "^11.0.6", - "execa": "^7.1.1", - "farm-browserslist-generator": "1.0.5", - "farm-plugin-replace-dirname": "0.2.1", + "etag": "^1.8.1", + "execa": "8.0.0", + "farm-browserslist-generator": "^1.0.5", "fast-glob": "^3.3.2", "fs-extra": "^11.1.1", - "http-proxy-middleware": "^3.0.0", + "http-proxy": "^1.18.1", "is-plain-object": "^5.0.0", - "koa": "^2.13.4", - "koa-compress": "^5.1.1", - "koa-connect": "^2.1.0", - "koa-static": "^5.0.0", - "lodash.debounce": "^4.0.8", - "loglevel": "^1.8.1", - "open": "^9.1.0", - "ws": "^8.12.0", + "mime": "^4.0.4", + "mime-types": "^2.1.35", + "open": "10.1.0", + "sirv": "^3.0.0", + "slashes": "^3.0.12", + "ws": "^8.14.2", "zod": "^3.23.8", "zod-validation-error": "^1.3.0" }, diff --git a/packages/core/src/compiler/index.ts b/packages/core/src/compiler/index.ts index f5b930f58b..1cdeb3645a 100644 --- a/packages/core/src/compiler/index.ts +++ b/packages/core/src/compiler/index.ts @@ -1,13 +1,17 @@ -import { existsSync, mkdirSync, rmSync, writeFileSync } from 'node:fs'; +import { existsSync, rmSync } from 'node:fs'; import path from 'node:path'; + import { Compiler as BindingCompiler } from '../../binding/index.js'; -import type { Resource } from '../index.js'; -import type { Config, JsUpdateResult } from '../types/binding.js'; -import { type ILogger, Logger } from '../utils/logger.js'; +import type { + ResolvedCompilation, + ResolvedUserConfig, + Resource +} from '../index.js'; +import type { JsUpdateResult } from '../types/binding.js'; export const VIRTUAL_FARM_DYNAMIC_IMPORT_SUFFIX = - '.farm_dynamic_import_virtual_module'; + '.farm_dynamic_import_virtual_module' as const; /** * Cause the update process is async, we need to keep the update queue to make sure the update process is executed in order. @@ -36,12 +40,16 @@ export class Compiler { private _onUpdateFinishQueue: (() => void | Promise)[] = []; public compiling = false; - - constructor( - public config: Config, - private logger: ILogger = new Logger() - ) { - this._bindingCompiler = new BindingCompiler(this.config); + private _compileFinishPromise: Promise | null = null; + private _resolveCompileFinish: (() => void) | null = null; + _isInitialCompile = true; + + constructor(public config: ResolvedUserConfig) { + this._bindingCompiler = new BindingCompiler({ + config: config.compilation, + jsPlugins: config.jsPlugins, + rustPlugins: config.rustPlugins + }); } async traceDependencies() { @@ -53,30 +61,32 @@ export class Compiler { } async compile() { - if (this.compiling) { - this.logger.error('Already compiling', { - exit: true - }); - } - + this.checkCompiling(); + this._createCompileFinishPromise(); this.compiling = true; - if (process.env.FARM_PROFILE) { - this._bindingCompiler.compileSync(); - } else { - await this._bindingCompiler.compile(); + try { + if (process.env.FARM_PROFILE) { + this._bindingCompiler.compileSync(); + } else { + await this._bindingCompiler.compile(); + } + } finally { + this.compiling = false; + this._resolveCompileFinishPromise(); + this._isInitialCompile = false; } - this.compiling = false; } compileSync() { - if (this.compiling) { - this.logger.error('Already compiling', { - exit: true - }); - } + this.checkCompiling(); + this._createCompileFinishPromise(); this.compiling = true; this._bindingCompiler.compileSync(); this.compiling = false; + this._resolveCompileFinishPromise(); + if (this._isInitialCompile) { + this._isInitialCompile = false; + } } async update( @@ -92,11 +102,13 @@ export class Compiler { }); // if there is already a update process, we need to wait for it to finish - if (this.compiling && !ignoreCompilingCheck) { + if (this.isCompilingAndCheckIgnored(ignoreCompilingCheck)) { this._updateQueue.push({ paths, resolve }); return promise; } + this.compiling = true; + try { const res = await this._bindingCompiler.update( paths, @@ -132,6 +144,10 @@ export class Compiler { } } + private isCompilingAndCheckIgnored(ignoreCompilingCheck: boolean): boolean { + return this.compiling && !ignoreCompilingCheck; + } + hasModule(resolvedPath: string): boolean { return this._bindingCompiler.hasModule(resolvedPath); } @@ -152,37 +168,21 @@ export class Compiler { return this._bindingCompiler.resourcesMap() as Record; } + /** + * Writes the compiled resources to disk and calls the write resources hook. + */ writeResourcesToDisk(): void { - const resources = this.resources(); - const configOutputPath = this.config.config.output.path; - const outputPath = path.isAbsolute(configOutputPath) - ? configOutputPath - : path.join(this.config.config.root, configOutputPath); - - for (const [name, resource] of Object.entries(resources)) { - // remove query params and hash of name - const nameWithoutQuery = name.split('?')[0]; - const nameWithoutHash = nameWithoutQuery.split('#')[0]; - - let filePath = path.join(outputPath, nameWithoutHash); - if (!existsSync(path.dirname(filePath))) { - mkdirSync(path.dirname(filePath), { recursive: true }); - } - - writeFileSync(filePath, resource); - } - - this.callWriteResourcesHook(); + this._bindingCompiler.writeResourcesToDisk(); } callWriteResourcesHook() { - for (const jsPlugin of this.config.jsPlugins ?? []) { + for (const jsPlugin of this.config.jsPlugins) { jsPlugin.writeResources?.executor?.({ resourcesMap: this._bindingCompiler.resourcesMap() as Record< string, Resource >, - config: this.config.config + config: this.config.compilation }); } } @@ -209,15 +209,7 @@ export class Compiler { p = p.slice(0, -VIRTUAL_FARM_DYNAMIC_IMPORT_SUFFIX.length); } - if (path.isAbsolute(p)) { - return p; - } - - if (p.includes('?')) { - return path.join(root, p.split('?')[0]); - } - - return path.join(root, p); + return path.isAbsolute(p) ? p : path.join(root, p.split('?')[0]); } onUpdateFinish(cb: () => void) { @@ -225,12 +217,7 @@ export class Compiler { } outputPath() { - const { output, root } = this.config.config; - const configOutputPath = output.path; - const outputPath = path.isAbsolute(configOutputPath) - ? configOutputPath - : path.join(root, configOutputPath); - return outputPath; + return this.getOutputPath(); } addExtraWatchFile(root: string, paths: string[]) { @@ -241,7 +228,65 @@ export class Compiler { return this._bindingCompiler.stats(); } + // wait for the compiler to finish compiling + async waitForInitialCompileFinish() { + if (this._isInitialCompile) { + await this.waitForCompileFinish(); + } + } + + async waitForCompileFinish() { + if (this.compiling && this._compileFinishPromise) { + await this._compileFinishPromise; + } + } + + private _createCompileFinishPromise() { + this._compileFinishPromise = new Promise((resolve) => { + this._resolveCompileFinish = resolve; + }); + } + + private _resolveCompileFinishPromise() { + if (this._resolveCompileFinish) { + this._resolveCompileFinish(); + this._compileFinishPromise = null; + this._resolveCompileFinish = null; + } + } + + private checkCompiling() { + if (this.compiling) { + this.config.logger.error('Already compiling', { + exit: true + }); + } + } + + private getOutputPath(): string { + const { output, root } = this.config.compilation; + const configOutputPath = output.path; + const outputPath = path.isAbsolute(configOutputPath) + ? configOutputPath + : path.join(root, configOutputPath); + return outputPath; + } + invalidateModule(moduleId: string) { this._bindingCompiler.invalidateModule(moduleId); } } + +export function createCompiler(resolvedUserConfig: ResolvedUserConfig) { + return new Compiler(resolvedUserConfig); +} + +export function createInlineCompiler( + config: ResolvedUserConfig, + options: ResolvedCompilation = {} +) { + return new Compiler({ + ...config, + compilation: { ...config.compilation, ...options } + }); +} diff --git a/packages/core/src/config/_global.ts b/packages/core/src/config/_global.ts index 68d4d8747e..03c579d124 100644 --- a/packages/core/src/config/_global.ts +++ b/packages/core/src/config/_global.ts @@ -1,3 +1,4 @@ export const __FARM_GLOBAL__ = { - __FARM_RESTART_DEV_SERVER__: false + __FARM_RESTART_DEV_SERVER__: false, + __FARM_SHOW_DEV_SERVER_URL__: true }; diff --git a/packages/core/src/config/constants.ts b/packages/core/src/config/constants.ts index 08bbc34f36..682403595a 100644 --- a/packages/core/src/config/constants.ts +++ b/packages/core/src/config/constants.ts @@ -1,3 +1,5 @@ +import { readFileSync } from 'node:fs'; + export const DEFAULT_CONFIG_NAMES = [ 'farm.config.ts', 'farm.config.js', @@ -14,7 +16,17 @@ export const CUSTOM_KEYS = { runtime_isolate: 'runtime.isolate', resolve_dedupe: 'resolve.dedupe', css_locals_conversion: 'css.modules.locals_conversion', + partial_bundling_groups_enforce: 'partial_bundling.groups.enforce', assets_mode: 'assets.mode' }; export const FARM_RUST_PLUGIN_FUNCTION_ENTRY = 'func.js'; + +const { version } = JSON.parse( + readFileSync(new URL('../../package.json', import.meta.url)).toString() +); + +export const VERSION = version; + +export const ENV_PRODUCTION = 'production'; +export const ENV_DEVELOPMENT = 'development'; diff --git a/packages/core/src/config/env.ts b/packages/core/src/config/env.ts index d2e5d840a9..24706db6da 100644 --- a/packages/core/src/config/env.ts +++ b/packages/core/src/config/env.ts @@ -7,12 +7,12 @@ * https://github.com/vitejs/vite/blob/main/LICENSE * */ - import fs from 'node:fs'; import path from 'node:path'; import { parse } from 'dotenv'; import { type DotenvPopulateInput, expand } from 'dotenv-expand'; + import { arraify, normalizePath, tryStatSync } from '../utils/index.js'; export function loadEnv( @@ -29,6 +29,7 @@ export function loadEnv( prefixes = arraify(prefixes); const env: Record = {}; const envFiles = getEnvFilesForMode(mode, envDir); + const parsed = Object.fromEntries( envFiles.flatMap((filePath) => { if (!tryStatSync(filePath)?.isFile()) return []; diff --git a/packages/core/src/config/index.ts b/packages/core/src/config/index.ts index d774da467e..520098b58f 100644 --- a/packages/core/src/config/index.ts +++ b/packages/core/src/config/index.ts @@ -1,37 +1,31 @@ -import crypto from 'node:crypto'; -import fs from 'node:fs'; -import module from 'node:module'; -import path, { isAbsolute, join } from 'node:path'; +import { createHash } from 'node:crypto'; +import { createRequire } from 'node:module'; +import path from 'node:path'; import { pathToFileURL } from 'node:url'; -import { bindingPath } from '../../binding/index.js'; -import { OutputConfig } from '../types/binding.js'; +import fse from 'fs-extra'; +import { bindingPath } from '../../binding/index.js'; import { JsPlugin } from '../index.js'; import { + type RustPlugin, getSortedPlugins, - handleVitePlugins, resolveAsyncPlugins, resolveConfigHook, resolveConfigResolvedHook, - resolveFarmPlugins + resolveFarmPlugins, + resolveVitePlugins } from '../plugin/index.js'; -import { Server } from '../server/index.js'; + import { Logger, - bold, - clearScreen, colors, - getAliasEntries, - green, isArray, isEmptyObject, isNodeEnv, isObject, isWindows, - normalizeBasePath, - normalizePath, - transformAliasWithVite + normalizePath } from '../utils/index.js'; import { traceDependencies } from '../utils/trace-dependencies.js'; import { __FARM_GLOBAL__ } from './_global.js'; @@ -50,31 +44,43 @@ import { parseUserConfig } from './schema.js'; import { externalAdapter } from '../plugin/js/external-adapter.js'; import { convertErrorMessage } from '../utils/error.js'; +import { resolveHostname } from '../utils/http.js'; import merge from '../utils/merge.js'; import { CUSTOM_KEYS, DEFAULT_CONFIG_NAMES, + ENV_DEVELOPMENT, + ENV_PRODUCTION, FARM_DEFAULT_NAMESPACE } from './constants.js'; import { mergeConfig, mergeFarmCliConfig } from './mergeConfig.js'; -import { normalizeAsset } from './normalize-config/normalize-asset.js'; + import { normalizeCss } from './normalize-config/normalize-css.js'; import { normalizeExternal } from './normalize-config/normalize-external.js'; +import { normalizePartialBundling } from './normalize-config/normalize-partial-bundling.js'; import { normalizeResolve } from './normalize-config/normalize-resolve.js'; + +import { wrapPluginUpdateModules } from '../plugin/js/utils.js'; import type { - Alias, - FarmCLIOptions, + ConfigEnv, + ConfigResult, + DefaultOptionsType, + EnvResult, + FarmCliOptions, + Format, + HmrOptions, NormalizedServerConfig, ResolvedCompilation, ResolvedUserConfig, UserConfig, UserConfigExport, UserConfigFnObject, - UserHmrConfig, - UserServerConfig + commandType } from './types.js'; export * from './types.js'; +export * from './constants.js'; +export * from './env.js'; export function defineFarmConfig(config: UserConfig): UserConfig; export function defineFarmConfig( @@ -88,163 +94,174 @@ export function defineFarmConfig(config: UserConfigExport): UserConfigExport { return config; } -async function getDefaultConfig( - config: UserConfig, - inlineOptions: FarmCLIOptions, - mode?: CompilationMode, - logger?: Logger -) { - logger = logger ?? new Logger(); - const resolvedUserConfig = await resolveMergedUserConfig( - config, - undefined, - inlineOptions.mode ?? mode, - logger - ); - - resolvedUserConfig.server = normalizeDevServerConfig( - inlineOptions.server, - mode - ); - - resolvedUserConfig.compilation = await normalizeUserCompilationConfig( - resolvedUserConfig, - config, - logger, - mode, - true - ); - resolvedUserConfig.root = resolvedUserConfig.compilation.root; - resolvedUserConfig.jsPlugins = []; - resolvedUserConfig.rustPlugins = []; - - return resolvedUserConfig; -} - -async function handleServerPortConflict( - resolvedUserConfig: ResolvedUserConfig, - logger: Logger, - mode?: CompilationMode -) { - // check port availability: auto increment the port if a conflict occurs +type UserConfigPromise = Promise; - try { - mode !== 'production' && - (await Server.resolvePortConflict(resolvedUserConfig.server, logger)); - // eslint-disable-next-line no-empty - } catch {} -} +const COMMANDS = { + START: 'start', + BUILD: 'build', + WATCH: 'watch', + PREVIEW: 'preview', + CLEAN: 'clean' +} as const; /** * Resolve and load user config from the specified path * @param configPath */ export async function resolveConfig( - inlineOptions: FarmCLIOptions & UserConfig = {}, - mode?: CompilationMode, - logger?: Logger, - isHandleServerPortConflict = true + inlineOptions: FarmCliOptions & UserConfig, + command: commandType, + defaultMode: CompilationMode = 'development', + defaultNodeEnv: CompilationMode = 'development', + isPreview = false ): Promise { - // Clear the console according to the cli command - - checkClearScreen(inlineOptions); - logger = logger ?? new Logger(); - inlineOptions.mode = inlineOptions.mode ?? mode; - // configPath may be file or directory - let { configPath } = inlineOptions; - let rawConfig: UserConfig = mergeFarmCliConfig(inlineOptions, {}); - - // if the config file can not found, just merge cli options and return default - if (configPath) { - if (!path.isAbsolute(configPath)) { - throw new Error('configPath must be an absolute path'); - } - const loadedUserConfig = await loadConfigFile( - configPath, - inlineOptions, - mode, - logger - ); + const mode = inlineOptions.mode || defaultMode; + const isNodeEnvSet = !!process.env.NODE_ENV; + inlineOptions.mode = mode; - if (loadedUserConfig) { - configPath = loadedUserConfig.configFilePath; - rawConfig = mergeConfig(rawConfig, loadedUserConfig.config); - } - rawConfig.compilation.mode = - loadedUserConfig?.config?.compilation?.mode ?? mode; - } else { - mergeConfig( - rawConfig, - await getDefaultConfig(rawConfig, inlineOptions, mode, logger) - ); + if (!isNodeEnvSet) { + setProcessEnv(defaultNodeEnv); } - const { config: userConfig, configFilePath } = { - configFilePath: configPath, - config: rawConfig + const configEnv: ConfigEnv = { + mode, + command, + isPreview }; - const { jsPlugins, vitePlugins, rustPlugins, vitePluginAdapters } = - await resolvePlugins(userConfig, logger, mode); + let configFilePath; + + const loadedUserConfig = await loadConfigFile( + inlineOptions, + configEnv, + defaultNodeEnv + ); + + let userConfig: UserConfig = mergeFarmCliConfig( + inlineOptions, + {}, + defaultMode + ); + const transformInlineConfig = userConfig; + + if (loadedUserConfig) { + configFilePath = loadedUserConfig.configFilePath; + userConfig = mergeConfig(userConfig, loadedUserConfig.config); + } + + const { jsPlugins, vitePluginAdapters } = await resolvePlugins( + userConfig, + defaultMode + ); const sortFarmJsPlugins = getSortedPlugins([ ...jsPlugins, - ...vitePluginAdapters, - externalAdapter() + ...vitePluginAdapters ]); - const config = await resolveConfigHook(userConfig, sortFarmJsPlugins); + const config = await resolveConfigHook( + userConfig, + configEnv, + sortFarmJsPlugins + ); - const mergedUserConfig = mergeFarmCliConfig(inlineOptions, config); + // may be user push plugin when config hooks + const allPlugins = await resolvePlugins(config, defaultMode); + const farmJsPlugins = getSortedPlugins([ + ...allPlugins.jsPlugins, + ...vitePluginAdapters, + externalAdapter() + ]); - const resolvedUserConfig = await resolveMergedUserConfig( - mergedUserConfig, + const resolvedUserConfig = await handleResolveConfig( configFilePath, - inlineOptions.mode ?? mode, - logger + loadedUserConfig, + config, + farmJsPlugins, + allPlugins.rustPlugins, + transformInlineConfig, + command ); - // normalize server config first cause it may be used in normalizeUserCompilationConfig - resolvedUserConfig.server = normalizeDevServerConfig( - resolvedUserConfig.server, - mode - ); + await resolveConfigResolvedHook(resolvedUserConfig, sortFarmJsPlugins); // Fix: Await the Promise and pass the resolved value to the function. - if (isHandleServerPortConflict) { - await handleServerPortConflict(resolvedUserConfig, logger, mode); - } + return resolvedUserConfig; +} - resolvedUserConfig.compilation = await normalizeUserCompilationConfig( +async function handleResolveConfig( + configFilePath: string, + loadedUserConfig: + | { + config: UserConfig; + configFilePath: string; + } + | undefined, + config: UserConfig, + sortFarmJsPlugins: JsPlugin[], + rustPlugins: RustPlugin[], + transformInlineConfig: UserConfig, + command: commandType +): Promise { + // define logger when resolvedConfigHook + const logger = new Logger({ + customLogger: loadedUserConfig.config?.customLogger, + allowClearScreen: loadedUserConfig.config?.clearScreen + }); + + const resolvedUserConfig = await resolveUserConfig(config, configFilePath); + + resolvedUserConfig.logger = logger; + + // farm handles server attributes in resolveConfig. + // On the one hand, farm can be used in node and server needs + // to be enabled. Lazy loading mode is enabled in node environment. + resolvedUserConfig.server = normalizeDevServerConfig(resolvedUserConfig); + + resolvedUserConfig.compilation = + await normalizeUserCompilationConfig(resolvedUserConfig); + + Object.assign(resolvedUserConfig, { + root: resolvedUserConfig.compilation.root, + jsPlugins: sortFarmJsPlugins, + rustPlugins: rustPlugins, + command, + isProduction: resolvedUserConfig.compilation.mode === ENV_PRODUCTION, + transformInlineConfig + }); + + await handleLazyCompilation( resolvedUserConfig, - mergedUserConfig, - logger, - mode - ); - - // normalize root path - resolvedUserConfig.root = normalizeBasePath( - resolvedUserConfig.compilation.root + command as keyof typeof COMMANDS ); - resolvedUserConfig.jsPlugins = sortFarmJsPlugins; - resolvedUserConfig.rustPlugins = rustPlugins; - // Temporarily dealing with alias objects and arrays in js will be unified in rust in the future.] - if (vitePlugins.length) { - resolvedUserConfig.compilation.resolve.alias = getAliasEntries( - resolvedUserConfig.compilation.resolve.alias - ); - } + return resolvedUserConfig; +} - await resolveConfigResolvedHook(resolvedUserConfig, sortFarmJsPlugins); // Fix: Await the Promise and pass the resolved value to the function. +async function handleLazyCompilation( + config: ResolvedUserConfig, + command: keyof typeof COMMANDS +) { + const commandHandlers = { + [COMMANDS.START]: async (config: ResolvedUserConfig) => { + if ( + config.compilation.lazyCompilation && + typeof config.server?.host === 'string' + ) { + await setLazyCompilationDefine(config); + } + }, + // TODO 这个watch 方法需要在讨论 现在设计里没有 watch 这个方法了 build 的话也可以做 判断 config 里的 watch + [COMMANDS.WATCH]: async (config: ResolvedUserConfig) => { + if (config.compilation?.lazyCompilation) { + await setLazyCompilationDefine(config); + } + } + }; - // TODO Temporarily solve the problem of alias adaptation to vite - if (resolvedUserConfig.compilation?.resolve?.alias && vitePlugins.length) { - resolvedUserConfig.compilation.resolve.alias = transformAliasWithVite( - resolvedUserConfig.compilation.resolve.alias as unknown as Array - ); + const handler = commandHandlers[command as keyof typeof commandHandlers]; + if (handler) { + await handler(config); } - - return resolvedUserConfig; } /** @@ -262,26 +279,17 @@ export async function resolveConfig( */ export async function normalizeUserCompilationConfig( resolvedUserConfig: ResolvedUserConfig, - userConfig: UserConfig, - logger: Logger, - mode: CompilationMode = 'development', - isDefault = false + mode: CompilationMode = 'development' ): Promise { - const { compilation, root = process.cwd(), clearScreen } = resolvedUserConfig; + const { compilation, root } = resolvedUserConfig; // resolve root path const resolvedRootPath = normalizePath(root); resolvedUserConfig.root = resolvedRootPath; - if (!userConfig.compilation) { - userConfig.compilation = {}; - } - // if normalize default config, skip check input option - const inputIndexConfig = !isDefault - ? checkCompilationInputValue(userConfig, logger) - : {}; + const inputIndexConfig = await checkCompilationInputValue(resolvedUserConfig); const resolvedCompilation: ResolvedCompilation = merge( {}, @@ -290,40 +298,32 @@ export async function normalizeUserCompilationConfig( input: inputIndexConfig, root: resolvedRootPath }, - { - clearScreen - }, compilation ); - const isProduction = mode === 'production'; - const isDevelopment = mode === 'development'; + const isProduction = mode === ENV_PRODUCTION; + const isDevelopment = mode === ENV_DEVELOPMENT; resolvedCompilation.mode = resolvedCompilation.mode ?? mode; resolvedCompilation.coreLibPath = bindingPath; - normalizeOutput(resolvedCompilation, isProduction, logger); - normalizeExternal(userConfig, resolvedCompilation); + normalizeOutput(resolvedCompilation, isProduction, resolvedUserConfig.logger); + normalizeExternal(resolvedUserConfig, resolvedCompilation); - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore do not check type for this internal option if (!resolvedCompilation.assets?.publicDir) { - if (!resolvedCompilation.assets) { - resolvedCompilation.assets = {}; - } + resolvedCompilation.assets ??= {}; const userPublicDir = resolvedUserConfig.publicDir ? resolvedUserConfig.publicDir - : join(resolvedCompilation.root, 'public'); + : path.join(resolvedCompilation.root, 'public'); - if (isAbsolute(userPublicDir)) { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment + if (path.isAbsolute(userPublicDir)) { // @ts-ignore do not check type for this internal option resolvedCompilation.assets.publicDir = userPublicDir; } else { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore do not check type for this internal option - resolvedCompilation.assets.publicDir = join( + resolvedCompilation.assets.publicDir = path.join( resolvedCompilation.root, userPublicDir ); @@ -333,96 +333,70 @@ export async function normalizeUserCompilationConfig( resolvedCompilation.define = Object.assign( { // skip self define - ['FARM' + '_PROCESS_ENV']: resolvedUserConfig.env, - FARM_RUNTIME_TARGET_ENV: JSON.stringify( - resolvedCompilation.output?.targetEnv - ) + ['FARM' + '_PROCESS_ENV']: resolvedUserConfig.env + // FARM_RUNTIME_TARGET_ENV: JSON.stringify( + // resolvedCompilation.output?.targetEnv + // ) }, resolvedCompilation?.define, // for node target, we should not define process.env.NODE_ENV resolvedCompilation.output?.targetEnv === 'node' ? {} - : Object.keys(resolvedUserConfig.env || {}).reduce((env: any, key) => { - env[`$__farm_regex:(global(This)?\\.)?process\\.env\\.${key}`] = - JSON.stringify(resolvedUserConfig.env[key]); - return env; - }, {}) + : Object.keys(resolvedUserConfig.env || {}).reduce( + (env, key) => { + env[`$__farm_regex:(global(This)?\\.)?process\\.env\\.${key}`] = + JSON.stringify(resolvedUserConfig.env[key]); + return env; + }, + {} as EnvResult + ) ); - const require = module.createRequire(import.meta.url); + const require = createRequire(import.meta.url); const hmrClientPluginPath = require.resolve('@farmfe/runtime-plugin-hmr'); - const ImportMetaPluginPath = require.resolve( + const importMetaPluginPath = require.resolve( '@farmfe/runtime-plugin-import-meta' ); - if (!resolvedCompilation.runtime) { - resolvedCompilation.runtime = { - path: require.resolve('@farmfe/runtime'), - plugins: [] - }; - } - - if (!resolvedCompilation.runtime.path) { - resolvedCompilation.runtime.path = require.resolve('@farmfe/runtime'); - } - - if (!resolvedCompilation.runtime.swcHelpersPath) { - resolvedCompilation.runtime.swcHelpersPath = path.dirname( - require.resolve('@swc/helpers/package.json') - ); - } + resolvedCompilation.runtime = { + path: + resolvedCompilation.runtime?.path ?? + path.dirname(require.resolve('@farmfe/runtime/package.json')), + swcHelpersPath: + resolvedCompilation.runtime?.swcHelpersPath ?? + path.dirname(require.resolve('@swc/helpers/package.json')), + plugins: resolvedCompilation.runtime?.plugins ?? [], + namespace: resolvedCompilation.runtime?.namespace + }; - if (!resolvedCompilation.runtime.plugins) { - resolvedCompilation.runtime.plugins = []; - } else { - // make sure all plugin paths are absolute - resolvedCompilation.runtime.plugins = - resolvedCompilation.runtime.plugins.map((plugin) => { - if (!path.isAbsolute(plugin)) { - if (!plugin.startsWith('.')) { - // resolve plugin from node_modules - return require.resolve(plugin); - } else { - return path.resolve(resolvedRootPath, plugin); - } - } + resolvedCompilation.runtime.plugins = resolvedCompilation.runtime.plugins.map( + (plugin) => { + if (path.isAbsolute(plugin)) return plugin; + return plugin.startsWith('.') + ? path.resolve(resolvedRootPath, plugin) + : require.resolve(plugin); + } + ); - return plugin; - }); - } - // set namespace to package.json name field's hash if (!resolvedCompilation.runtime.namespace) { - // read package.json name field - const packageJsonPath = path.resolve(resolvedRootPath, 'package.json'); - const packageJsonExists = fs.existsSync(packageJsonPath); - const namespaceName = packageJsonExists - ? JSON.parse(fs.readFileSync(packageJsonPath, { encoding: 'utf-8' })) - ?.name ?? FARM_DEFAULT_NAMESPACE - : FARM_DEFAULT_NAMESPACE; - - resolvedCompilation.runtime.namespace = crypto - .createHash('md5') - .update(namespaceName) + resolvedCompilation.runtime.namespace = createHash('md5') + .update(getNamespaceName(resolvedRootPath)) .digest('hex'); } if (isProduction) { resolvedCompilation.lazyCompilation = false; } else if (resolvedCompilation.lazyCompilation === undefined) { - if (isDevelopment) { - resolvedCompilation.lazyCompilation = true; - } else { - resolvedCompilation.lazyCompilation = false; - } + resolvedCompilation.lazyCompilation ??= isDevelopment; } - if (resolvedCompilation.mode === undefined) { - resolvedCompilation.mode = mode; - } + resolvedCompilation.mode ??= mode; + setProcessEnv(resolvedCompilation.mode); - // TODO add targetEnv `lib-browser` and `lib-node` support + const isNode = isNodeEnv(resolvedCompilation.output.targetEnv); if ( - resolvedCompilation.output.targetEnv !== 'node' && + !isProduction && + !isNode && isArray(resolvedCompilation.runtime.plugins) && resolvedUserConfig.server?.hmr && !resolvedCompilation.runtime.plugins.includes(hmrClientPluginPath) @@ -431,7 +405,7 @@ export async function normalizeUserCompilationConfig( resolvedCompilation.output.publicPath ); const serverOptions = resolvedUserConfig.server; - const defineHmrPath = normalizeBasePath( + const defineHmrPath = normalizePath( path.join(publicPath, resolvedUserConfig.server.hmr.path) ); @@ -453,9 +427,9 @@ export async function normalizeUserCompilationConfig( if ( isArray(resolvedCompilation.runtime.plugins) && - !resolvedCompilation.runtime.plugins.includes(ImportMetaPluginPath) + !resolvedCompilation.runtime.plugins.includes(importMetaPluginPath) ) { - resolvedCompilation.runtime.plugins.push(ImportMetaPluginPath); + resolvedCompilation.runtime.plugins.push(importMetaPluginPath); } // we should not deep merge compilation.input @@ -476,20 +450,25 @@ export async function normalizeUserCompilationConfig( } if (resolvedCompilation.treeShaking === undefined) { - if (isProduction) { - resolvedCompilation.treeShaking = true; - } else { - resolvedCompilation.treeShaking = false; - } + resolvedCompilation.treeShaking ??= isProduction; + } + + if (resolvedCompilation.concatenateModules === undefined) { + resolvedCompilation.concatenateModules ??= isProduction; + } + + if (resolvedCompilation.concatenateModules && !isProduction) { + resolvedUserConfig.logger.warn( + 'concatenateModules option is not supported with development mode, concatenateModules will be disabled' + ); + resolvedCompilation.concatenateModules = false; } if (resolvedCompilation.script?.plugins?.length) { - logger.info( + resolvedUserConfig.logger.info( `Swc plugins are configured, note that Farm uses ${colors.yellow( 'swc_core v0.96' - )}, please make sure the plugin is ${colors.green( - 'compatible' - )} with swc_core ${colors.yellow( + )}, please make sure the plugin is ${colors.green('compatible')} with swc_core ${colors.yellow( 'swc_core v0.96' )}. Otherwise, it may exit unexpectedly.` ); @@ -499,26 +478,18 @@ export async function normalizeUserCompilationConfig( // so, it only happens in development mode // https://github.com/farm-fe/farm/issues/962 if (resolvedCompilation.treeShaking && resolvedCompilation.lazyCompilation) { - logger.error( + resolvedUserConfig.logger.error( 'treeShaking option is not supported in lazyCompilation mode, lazyCompilation will be disabled.' ); resolvedCompilation.lazyCompilation = false; } if (resolvedCompilation.minify === undefined) { - if (isProduction) { - resolvedCompilation.minify = true; - } else { - resolvedCompilation.minify = false; - } + resolvedCompilation.minify ??= isProduction; } if (resolvedCompilation.presetEnv === undefined) { - if (isProduction) { - resolvedCompilation.presetEnv = true; - } else { - resolvedCompilation.presetEnv = false; - } + resolvedCompilation.presetEnv ??= isProduction; } // setting the custom configuration @@ -547,36 +518,28 @@ export async function normalizeUserCompilationConfig( }; if (resolvedCompilation.script.parser.tsConfig !== undefined) resolvedCompilation.script.parser.tsConfig.decorators = true; - else - userConfig.compilation.script.parser.tsConfig = { - decorators: true - }; } // normalize persistent cache at last - await normalizePersistentCache( - resolvedCompilation, - resolvedUserConfig, - logger - ); - - normalizeResolve(userConfig, resolvedCompilation); - normalizeCss(userConfig, resolvedCompilation); - normalizeAsset(userConfig, resolvedCompilation); - + await normalizePersistentCache(resolvedCompilation, resolvedUserConfig); + normalizeResolve(resolvedUserConfig, resolvedCompilation); + normalizeCss(resolvedUserConfig, resolvedCompilation); + normalizePartialBundling(resolvedCompilation); return resolvedCompilation; } -export const DEFAULT_HMR_OPTIONS: Required = { - host: true, +export const DEFAULT_HMR_OPTIONS: Required = { + host: 'localhost', port: (process.env.FARM_DEFAULT_HMR_PORT && Number(process.env.FARM_DEFAULT_HMR_PORT)) ?? undefined, path: '/__hmr', overlay: true, - protocol: '', - watchOptions: {} + clientPort: 9000, + timeout: 0, + server: null, + protocol: '' }; export const DEFAULT_DEV_SERVER_OPTIONS: NormalizedServerConfig = { @@ -587,16 +550,32 @@ export const DEFAULT_DEV_SERVER_OPTIONS: NormalizedServerConfig = { 9000, https: undefined, protocol: 'http', - hostname: { name: 'localhost', host: undefined }, - host: true, - proxy: {}, + hostname: { + name: 'localhost', + host: undefined + }, + host: 'localhost', + proxy: undefined, hmr: DEFAULT_HMR_OPTIONS, + middlewareMode: false, open: false, strictPort: false, cors: false, - spa: true, middlewares: [], - writeToDisk: false + appType: 'spa', + writeToDisk: false, + origin: '', + preview: { + host: 'localhost', + headers: {}, + port: 1911, + strictPort: false, + https: undefined, + distDir: 'dist', + open: false, + cors: false, + proxy: undefined + } }; export const DEFAULT_COMPILATION_OPTIONS: Partial = { @@ -623,23 +602,28 @@ export const DEFAULT_COMPILATION_OPTIONS: Partial = { } }; -// eslint-disable-next-line @typescript-eslint/no-explicit-any -function tryAsFileRead(value?: any): string | Buffer { - if (typeof value === 'string' && fs.existsSync(value)) { - return fs.readFileSync(path.resolve(value.toString())); +function tryHttpsAsFileRead(value: unknown): string | Buffer | unknown { + if (typeof value === 'string') { + try { + const resolvedPath = path.resolve(value); + const stats = fse.statSync(resolvedPath); + + if (stats.isFile()) { + return fse.readFileSync(resolvedPath); + } + } catch {} } - return value; + return Buffer.isBuffer(value) ? value : value; } export function normalizeDevServerConfig( - options: UserServerConfig | undefined, - mode: string + userConfig: UserConfig | undefined ): NormalizedServerConfig { - const { host, port, hmr: hmrConfig, https } = options || {}; - const isProductionMode = mode === 'production'; + const serverOptions = userConfig?.server; + const { host, port, hmr: hmrConfig, https } = serverOptions || {}; const hmr = - isProductionMode || hmrConfig === false + hmrConfig === false ? false : merge( {}, @@ -651,21 +635,20 @@ export function normalizeDevServerConfig( hmrConfig === true ? {} : hmrConfig ); - return merge({}, DEFAULT_DEV_SERVER_OPTIONS, options, { + return merge({}, DEFAULT_DEV_SERVER_OPTIONS, serverOptions, { hmr, https: https ? { ...https, - ca: tryAsFileRead(options.https.ca), - cert: tryAsFileRead(options.https.cert), - key: tryAsFileRead(options.https.key), - pfx: tryAsFileRead(options.https.pfx) + ca: tryHttpsAsFileRead(serverOptions.https.ca), + cert: tryHttpsAsFileRead(serverOptions.https.cert), + key: tryHttpsAsFileRead(serverOptions.https.key), + pfx: tryHttpsAsFileRead(serverOptions.https.pfx) } : undefined }) as NormalizedServerConfig; } -type Format = Exclude; const formatFromExt: Record = { cjs: 'cjs', mjs: 'esm', @@ -679,103 +662,55 @@ const formatToExt: Record = { esm: 'mjs' }; -async function readConfigFile( - inlineOptions: FarmCLIOptions, +export async function readConfigFile( + inlineOptions: FarmCliOptions, configFilePath: string, - logger: Logger, + configEnv: ConfigEnv, mode: CompilationMode = 'development' -): Promise { - if (fs.existsSync(configFilePath)) { - !__FARM_GLOBAL__.__FARM_RESTART_DEV_SERVER__ && - logger.info(`Using config file at ${bold(green(configFilePath))}`); - const format: Format = process.env.FARM_CONFIG_FORMAT - ? process.env.FARM_CONFIG_FORMAT === 'cjs' - ? 'cjs' - : 'esm' - : formatFromExt[path.extname(configFilePath).slice(1)] ?? 'esm'; - // we need transform all type farm.config with __dirname and __filename - const Compiler = (await import('../compiler/index.js')).Compiler; - const outputPath = path.join( - path.dirname(configFilePath), - 'node_modules', - '.farm' - ); +): UserConfigPromise { + if (!fse.existsSync(configFilePath)) return; - const fileName = `farm.config.bundle-${Date.now()}-${Math.random() - .toString(16) - .split('.') - .join('')}.${formatToExt[format]}`; + const format = getFormat(configFilePath); - const tsDefaultUserConfig: UserConfig = { - root: inlineOptions.root, - compilation: { - input: { - [fileName]: configFilePath - }, - output: { - entryFilename: '[entryName]', - path: outputPath, - format, - targetEnv: 'library-node' - }, - external: [ - ...(process.env.FARM_CONFIG_FULL_BUNDLE - ? [] - : ['!^(\\./|\\.\\./|[A-Za-z]:\\\\|/).*']), - '^@farmfe/core$' - ], - partialBundling: { - enforceResources: [ - { - name: fileName, - test: ['.+'] - } - ] - }, - watch: false, - sourcemap: false, - treeShaking: false, - minify: false, - presetEnv: false, - lazyCompilation: false, - persistentCache: false, - progress: false - } - }; - - const tsDefaultResolvedUserConfig: ResolvedUserConfig = - await resolveMergedUserConfig( - tsDefaultUserConfig, - undefined, - mode, - logger - ); + const Compiler = (await import('../compiler/index.js')).Compiler; - const normalizedConfig = await normalizeUserCompilationConfig( - tsDefaultResolvedUserConfig, - tsDefaultUserConfig, - logger, - mode - ); + const outputPath = path.join( + path.dirname(configFilePath), + 'node_modules', + '.farm' + ); - const replaceDirnamePlugin = await import( - 'farm-plugin-replace-dirname' - ).then((mod) => mod.default); + const fileName = `farm.config.bundle-${Date.now()}-${Math.random() + .toString(16) + .split('.') + .join('')}.${formatToExt[format]}`; - const compiler = new Compiler( - { - config: normalizedConfig, - jsPlugins: [], - rustPlugins: [[replaceDirnamePlugin, '{}']] - }, - logger - ); + const normalizedConfig = await resolveDefaultUserConfig({ + inlineOptions, + configFilePath, + format, + outputPath, + fileName, + mode + }); + + const replaceDirnamePlugin = await import( + '@farmfe/plugin-replace-dirname' + ).then((mod) => mod.default); + + const compiler = new Compiler({ + compilation: normalizedConfig, + jsPlugins: [], + rustPlugins: [[replaceDirnamePlugin, '{}']] + }); + + const FARM_PROFILE = process.env.FARM_PROFILE; + // disable FARM_PROFILE in farm_config + if (FARM_PROFILE) { + process.env.FARM_PROFILE = ''; + } - const FARM_PROFILE = process.env.FARM_PROFILE; - // disable FARM_PROFILE in farm_config - if (FARM_PROFILE) { - process.env.FARM_PROFILE = ''; - } + try { await compiler.compile(); if (FARM_PROFILE) { @@ -784,111 +719,43 @@ async function readConfigFile( compiler.writeResourcesToDisk(); - const filePath = isWindows - ? pathToFileURL(path.join(outputPath, fileName)) - : path.join(outputPath, fileName); + const filePath = getFilePath(outputPath, fileName); // Change to vm.module of node or loaders as far as it is stable const userConfig = (await import(filePath as string)).default; try { - fs.unlink(filePath, () => void 0); + // await fse.unlink(filePath); // remove parent dir if empty - const isEmpty = fs.readdirSync(outputPath).length === 0; + const isEmpty = (await fse.readdir(outputPath)).length === 0; if (isEmpty) { - fs.rmSync(outputPath); + fse.rmSync(outputPath); } } catch { /** do nothing */ } - const configEnv = { mode: inlineOptions.mode ?? process.env.NODE_ENV }; const config = await (typeof userConfig === 'function' ? userConfig(configEnv) : userConfig); - if (!config.root) { - config.root = inlineOptions.root; - } - if (!isObject(config)) { throw new Error(`config must export or return an object.`); } + + config.root ??= inlineOptions.root; + return config; + } finally { + // await fse.unlink(getFilePath(outputPath, fileName)).catch(() => {}); } } -export function normalizePublicDir(root: string, userPublicDir?: string) { - const publicDir = userPublicDir ?? 'public'; +export function normalizePublicDir(root: string, publicDir = 'public') { const absPublicDirPath = path.isAbsolute(publicDir) ? publicDir - : path.join(root, publicDir); - return absPublicDirPath; -} - -export function checkClearScreen( - inlineConfig: FarmCLIOptions | ResolvedUserConfig -) { - if ( - inlineConfig?.clearScreen && - !__FARM_GLOBAL__.__FARM_RESTART_DEV_SERVER__ - ) { - clearScreen(); - } -} - -export async function resolveMergedUserConfig( - mergedUserConfig: UserConfig, - configFilePath: string | undefined, - mode: 'development' | 'production' | string, - logger: Logger = new Logger() -): Promise { - const resolvedUserConfig = { - ...mergedUserConfig, - compilation: { - ...mergedUserConfig.compilation, - external: [] - } - } as ResolvedUserConfig; - - // set internal config - resolvedUserConfig.envMode = mode; - - if (configFilePath) { - const dependencies = await traceDependencies(configFilePath, logger); - dependencies.sort(); - resolvedUserConfig.configFileDependencies = dependencies; - resolvedUserConfig.configFilePath = configFilePath; - } - - const resolvedRootPath = resolvedUserConfig.root ?? process.cwd(); - const resolvedEnvPath = resolvedUserConfig.envDir - ? resolvedUserConfig.envDir - : resolvedRootPath; - - const userEnv = loadEnv( - resolvedUserConfig.envMode ?? mode, - resolvedEnvPath, - resolvedUserConfig.envPrefix - ); - const existsEnvFiles = getExistsEnvFiles( - resolvedUserConfig.envMode ?? mode, - resolvedEnvPath - ); - - resolvedUserConfig.envFiles = [ - ...(Array.isArray(resolvedUserConfig.envFiles) - ? resolvedUserConfig.envFiles - : []), - ...existsEnvFiles - ]; - - resolvedUserConfig.env = { - ...userEnv, - NODE_ENV: mergedUserConfig.compilation.mode ?? mode, - mode: mode - }; + : path.resolve(root, publicDir); - return resolvedUserConfig; + return absPublicDirPath; } /** @@ -898,28 +765,30 @@ export async function resolveMergedUserConfig( * @returns loaded config and config file path */ export async function loadConfigFile( - configPath: string, - inlineOptions: FarmCLIOptions, - mode: CompilationMode = 'development', - logger: Logger = new Logger() -): Promise<{ config: UserConfig; configFilePath: string } | undefined> { - // if configPath points to a directory, try to find a config file in it using default config + inlineOptions: FarmCliOptions & UserConfig, + configEnv: ConfigEnv, + mode: CompilationMode = 'development' +): Promise { + const { root = '.', configFile } = inlineOptions; + const configRootPath = path.resolve(root); + let resolvedConfigFilePath: string | undefined; try { - const configFilePath = await getConfigFilePath(configPath); - - if (configFilePath) { - const config = await readConfigFile( - inlineOptions, - configFilePath, - logger, - mode - ); + resolvedConfigFilePath = await resolveConfigFilePath( + configFile, + root, + configRootPath + ); - return { - config: config && parseUserConfig(config), - configFilePath: configFilePath - }; - } + const config = await readConfigFile( + inlineOptions, + resolvedConfigFilePath, + configEnv, + mode + ); + return { + config: config && parseUserConfig(config), + configFilePath: resolvedConfigFilePath + }; } catch (error) { // In this place, the original use of throw caused emit to the outermost catch // callback, causing the code not to execute. If the internal catch compiler's own @@ -928,45 +797,52 @@ export async function loadConfigFile( const errorMessage = convertErrorMessage(error); const stackTrace = error.code === 'GenericFailure' ? '' : `\n${error.stack}`; - - if (inlineOptions.mode === 'production') { - logger.error( - `Failed to load config file: ${errorMessage} \n${stackTrace}`, - { - exit: true - } + if (inlineOptions.mode === ENV_PRODUCTION) { + throw new Error( + `Failed to load farm config file: ${errorMessage} \n${stackTrace}` ); } - const potentialSolution = 'Potential solutions: \n1. Try set `FARM_CONFIG_FORMAT=cjs`(default to esm)\n2. Try set `FARM_CONFIG_FULL_BUNDLE=1`'; - throw new Error( `Failed to load farm config file: ${errorMessage}. \n ${potentialSolution} \n ${error.stack}` ); + // throw new Error( + // `Failed to load farm config file: ${errorMessage}. \n ${potentialSolution}` + // // `Failed to load farm config file: ${errorMessage}.`, + // ); } } -function checkCompilationInputValue(userConfig: UserConfig, logger: Logger) { +export async function checkCompilationInputValue( + userConfig: ResolvedUserConfig +) { const { compilation } = userConfig; const targetEnv = compilation?.output?.targetEnv; + const inputValue = Object.values(compilation?.input).filter(Boolean); const isTargetNode = isNodeEnv(targetEnv); const defaultHtmlPath = './index.html'; - let inputIndexConfig: { index?: string } = { index: '' }; + let inputIndexConfig: { + index?: string; + } = { index: '' }; let errorMessage = ''; // Check if input is specified - if (!isEmptyObject(compilation?.input)) { + if (!isEmptyObject(compilation?.input) && inputValue.length) { inputIndexConfig = compilation?.input; } else { + const rootPath = userConfig?.root ?? '.'; if (isTargetNode) { // If input is not specified, try to find index.js or index.ts const entryFiles = ['./index.js', './index.ts']; for (const entryFile of entryFiles) { try { - if (fs.statSync(path.resolve(userConfig?.root, entryFile))) { - inputIndexConfig = { index: entryFile }; + const resolvedPath = path.resolve(rootPath, entryFile); + if (await checkFileExists(resolvedPath)) { + inputIndexConfig = { + index: entryFile + }; break; } } catch (error) { @@ -975,8 +851,11 @@ function checkCompilationInputValue(userConfig: UserConfig, logger: Logger) { } } else { try { - if (fs.statSync(path.resolve(userConfig?.root, defaultHtmlPath))) { - inputIndexConfig = { index: defaultHtmlPath }; + const resolvedHtmlPath = path.resolve(rootPath, defaultHtmlPath); + if (await checkFileExists(resolvedHtmlPath)) { + inputIndexConfig = { + index: defaultHtmlPath + }; } } catch (error) { errorMessage = error.stack; @@ -985,11 +864,10 @@ function checkCompilationInputValue(userConfig: UserConfig, logger: Logger) { // If no index file is found, throw an error if (!inputIndexConfig.index) { - logger.error( + userConfig.logger.error( `Build failed due to errors: Can not resolve ${ isTargetNode ? 'index.js or index.ts' : 'index.html' - } from ${userConfig.root}. \n${errorMessage}`, - { exit: true } + } from ${userConfig.root}. \n${errorMessage}` ); } } @@ -998,20 +876,21 @@ function checkCompilationInputValue(userConfig: UserConfig, logger: Logger) { } export async function getConfigFilePath( - configPath: string + configRootPath: string ): Promise { - if (fs.statSync(configPath).isDirectory()) { - for (const name of DEFAULT_CONFIG_NAMES) { - const resolvedPath = path.join(configPath, name); - const isFile = - fs.existsSync(resolvedPath) && fs.statSync(resolvedPath).isFile(); + const stat = await fse.stat(configRootPath); + if (!stat.isDirectory()) { + return undefined; + } - if (isFile) { + for (const name of DEFAULT_CONFIG_NAMES) { + const resolvedPath = path.join(configRootPath, name); + try { + const fileStat = await fse.stat(resolvedPath); + if (fileStat.isFile()) { return resolvedPath; } - } - } else if (fs.statSync(configPath).isFile()) { - return configPath; + } catch {} } return undefined; @@ -1019,30 +898,200 @@ export async function getConfigFilePath( export async function resolvePlugins( userConfig: UserConfig, - logger: Logger, mode: CompilationMode ) { - const { jsPlugins, rustPlugins } = await resolveFarmPlugins(userConfig); - const rawJsPlugins = (await resolveAsyncPlugins(jsPlugins || [])).filter( - Boolean + const [farmPlugins, vitePluginAdapters] = await Promise.all([ + resolveFarmPlugins(userConfig), + resolveVitePlugins(userConfig, mode) + ]); + + const resolvePluginsResult = { + jsPlugins: farmPlugins.jsPlugins.map(wrapPluginUpdateModules), + vitePlugins: (userConfig?.vitePlugins ?? []).filter(Boolean), + rustPlugins: farmPlugins.rustPlugins, + vitePluginAdapters + }; + + return resolvePluginsResult; +} + +export async function resolveDefaultUserConfig(options: DefaultOptionsType) { + const defaultConfig: UserConfig = createDefaultConfig(options); + + const resolvedUserConfig: ResolvedUserConfig = await resolveUserConfig( + defaultConfig, + undefined ); - let vitePluginAdapters: JsPlugin[] = []; - const vitePlugins = (userConfig?.vitePlugins ?? []).filter(Boolean); + const normalizedConfig = await normalizeUserCompilationConfig( + resolvedUserConfig, + options.mode + ); - if (vitePlugins.length) { - vitePluginAdapters = await handleVitePlugins( - vitePlugins, - userConfig, - logger, - mode - ); + return normalizedConfig; +} + +export async function resolveUserConfig( + userConfig: UserConfig, + configFilePath?: string | undefined +): Promise { + const resolvedUserConfig = { + ...userConfig, + envMode: userConfig.mode + } as ResolvedUserConfig; + + // set internal config + if (configFilePath) { + const dependencies = await traceDependencies(configFilePath); + resolvedUserConfig.configFileDependencies = dependencies.sort(); + resolvedUserConfig.configFilePath = configFilePath; } + const resolvedRootPath = resolvedUserConfig.root; + const resolvedEnvPath = resolvedUserConfig.envDir ?? resolvedRootPath; + + const userEnv = loadEnv( + resolvedUserConfig.envMode, + resolvedEnvPath, + resolvedUserConfig.envPrefix + ); + const existsEnvFiles = getExistsEnvFiles( + resolvedUserConfig.envMode, + resolvedEnvPath + ); + + resolvedUserConfig.envFiles = [ + ...(Array.isArray(resolvedUserConfig.envFiles) + ? resolvedUserConfig.envFiles + : []), + ...existsEnvFiles + ]; + + resolvedUserConfig.env = { + ...userEnv, + NODE_ENV: userConfig.compilation.mode, + BASE_URL: userConfig.compilation.output.publicPath ?? '/', + mode: userConfig.mode, + DEV: userConfig.compilation.mode === ENV_DEVELOPMENT, + PROD: userConfig.compilation.mode === ENV_PRODUCTION + }; + + resolvedUserConfig.publicDir = normalizePublicDir( + resolvedRootPath, + userConfig.publicDir + ); + + return resolvedUserConfig; +} + +export function createDefaultConfig(options: DefaultOptionsType): UserConfig { + const { + inlineOptions, + mode, + format, + outputPath, + showFileSize = false, + fileName, + configFilePath + } = options; + return { - jsPlugins: rawJsPlugins, - vitePlugins, - rustPlugins, - vitePluginAdapters + root: path.resolve(inlineOptions.root ?? '.'), + compilation: { + input: { + [fileName]: configFilePath + }, + output: { + entryFilename: '[entryName]', + path: outputPath, + format, + targetEnv: 'node', + showFileSize + }, + mode, + external: [ + ...(process.env.FARM_CONFIG_FULL_BUNDLE + ? [] + : ['!^(\\./|\\.\\./|[A-Za-z]:\\\\|/).*']), + '^@farmfe/core$' + ], + partialBundling: { + enforceResources: [ + { + name: fileName, + test: ['.+'] + } + ] + }, + sourcemap: false, + treeShaking: false, + minify: false, + presetEnv: false, + lazyCompilation: false, + persistentCache: false, + progress: false + } + }; +} + +export async function resolveAndFilterAsyncPlugins( + plugins: JsPlugin[] = [] +): Promise { + return (await resolveAsyncPlugins(plugins)).filter(Boolean); +} + +export async function checkFileExists(filePath: string): Promise { + try { + await fse.stat(filePath); + return true; + } catch { + return false; + } +} + +export async function resolveConfigFilePath( + configFile: string | undefined, + root: string, + configRootPath: string +): Promise { + if (configFile) { + return path.resolve(root, configFile); + } else { + return await getConfigFilePath(configRootPath); + } +} + +export function getFormat(configFilePath: string): Format { + return process.env.FARM_CONFIG_FORMAT === 'cjs' + ? 'cjs' + : process.env.FARM_CONFIG_FORMAT === 'esm' + ? 'esm' + : (formatFromExt[path.extname(configFilePath).slice(1)] ?? 'esm'); +} + +export function getFilePath(outputPath: string, fileName: string): string { + return isWindows + ? pathToFileURL(path.join(outputPath, fileName)).toString() + : path.join(outputPath, fileName); +} + +async function setLazyCompilationDefine( + resolvedUserConfig: ResolvedUserConfig +) { + const hostname = await resolveHostname(resolvedUserConfig.server.host); + resolvedUserConfig.compilation.define = { + ...(resolvedUserConfig.compilation.define ?? {}), + FARM_LAZY_COMPILE_SERVER_URL: `${ + resolvedUserConfig.server.protocol || 'http' + }://${hostname.host || 'localhost'}:${resolvedUserConfig.server.port}` }; } + +function getNamespaceName(rootPath: string) { + const packageJsonPath = path.resolve(rootPath, 'package.json'); + if (fse.existsSync(packageJsonPath)) { + const { name } = JSON.parse(fse.readFileSync(packageJsonPath, 'utf-8')); + return name || FARM_DEFAULT_NAMESPACE; + } + return FARM_DEFAULT_NAMESPACE; +} diff --git a/packages/core/src/config/mergeConfig.ts b/packages/core/src/config/mergeConfig.ts index f58578b625..74697d783f 100644 --- a/packages/core/src/config/mergeConfig.ts +++ b/packages/core/src/config/mergeConfig.ts @@ -1,14 +1,13 @@ import path, { isAbsolute } from 'node:path'; -import { isString } from '../plugin/js/utils.js'; -import { isArray, isObject } from '../utils/share.js'; -import { FarmCLIOptions, UserConfig } from './types.js'; -// eslint-disable-next-line @typescript-eslint/no-explicit-any +import { isArray, isObject, isString } from '../utils/share.js'; +import { CompilationMode } from './env.js'; +import { FarmCliOptions, UserConfig } from './types.js'; + export function mergeConfig>( userConfig: T, target: T ): T { - // eslint-disable-next-line @typescript-eslint/no-explicit-any const result: Record = { ...userConfig }; for (const key of Object.keys(target)) { const left = result[key]; @@ -46,26 +45,30 @@ export function mergeConfig>( } export function mergeFarmCliConfig( - cliOption: FarmCLIOptions & UserConfig, - target: UserConfig + cliOption: FarmCliOptions & UserConfig, + target: UserConfig, + mode: CompilationMode ): UserConfig { let left: UserConfig = {}; + const options = initialCliOptions(cliOption); ( [ 'clearScreen', + 'mode', 'compilation', 'envDir', 'envPrefix', + 'watch', 'plugins', 'publicDir', 'server', 'vitePlugins' ] satisfies (keyof UserConfig)[] - ).forEach((key) => { - const value = cliOption[key]; + ).forEach((key: keyof (FarmCliOptions & UserConfig)) => { + const value = options[key]; if (value || typeof value === 'boolean') { - left = mergeConfig(left, { [key]: cliOption[key] }); + left = mergeConfig(left, { [key]: options[key] }); } }); @@ -77,12 +80,12 @@ export function mergeFarmCliConfig( const cliRoot = cliOption.root; if (!isAbsolute(cliRoot)) { - target.root = path.resolve(process.cwd(), cliRoot); + target.root = path.resolve(cliRoot); } else { target.root = cliRoot; } } else { - target.root = process.cwd(); + target.root = path.resolve('.'); } if (configRootPath) { @@ -90,60 +93,98 @@ export function mergeFarmCliConfig( } if (target.root && !isAbsolute(target.root)) { - const resolvedRoot = path.resolve(cliOption.configPath, target.root); + const resolvedRoot = path.resolve(cliOption.configFile, target.root); target.root = resolvedRoot; } } - if (isString(cliOption.host) || typeof cliOption.host === 'boolean') { - left = mergeConfig(left, { server: { host: cliOption.host } }); + if ( + isString(options.server?.host) || + typeof options.server?.host === 'boolean' + ) { + left = mergeConfig(left, { server: { host: options.host } }); } - if (typeof cliOption.minify === 'boolean') { - left = mergeConfig(left, { compilation: { minify: cliOption.minify } }); + if (typeof options.compilation.minify === 'boolean') { + left = mergeConfig(left, { compilation: { minify: options.minify } }); } - if (cliOption.outDir) { + if (options.compilation.output.path) { left = mergeConfig(left, { - compilation: { output: { path: cliOption.outDir } } + compilation: { output: { path: options.outDir } } }); } - if (cliOption.port) { + if (options.mode) { left = mergeConfig(left, { - server: { - port: cliOption.port + compilation: { + mode: mode ?? (options.mode as UserConfig['compilation']['mode']) } }); } - if (cliOption.mode) { + if (options.server?.port) { left = mergeConfig(left, { - compilation: { - mode: cliOption.mode as UserConfig['compilation']['mode'] + server: { + port: options.port } }); } - if (cliOption.https) { + if (options.server?.https) { left = mergeConfig(left, { server: { - https: cliOption.https + https: options.https } }); } - if (cliOption.sourcemap) { + if (options.compilation?.sourcemap) { left = mergeConfig(left, { - compilation: { sourcemap: cliOption.sourcemap } + compilation: { sourcemap: options.sourcemap } }); } return mergeConfig(left, target); } -export function initialCliOptions(options: FarmCLIOptions): FarmCLIOptions { - return { - ...options +export function initialCliOptions( + options: FarmCliOptions & UserConfig +): FarmCliOptions & UserConfig { + const { mode, watch } = options; + + const compilationOptions = options.compilation || {}; + const { minify, sourcemap, treeShaking } = compilationOptions; + const { path, targetEnv, format } = compilationOptions.output || {}; + + const input = compilationOptions.input + ? Object.values(compilationOptions.input).filter(Boolean) + : []; + const hasInput = input.length > 0; + + const output: UserConfig['compilation']['output'] = { + ...(path && { path }), + ...(targetEnv && { targetEnv }), + ...(format && { format }) + }; + + const compilation: UserConfig['compilation'] = { + input: hasInput ? { ...compilationOptions.input } : {}, + output, + ...(minify && { minify }), + ...(sourcemap && { sourcemap }), + ...(treeShaking && { treeShaking }) }; + + const defaultOptions = { + compilation, + watch: !!watch, + root: options.root, + server: options.server, + clearScreen: !!options.clearScreen, + configFile: options.configFile, + ...(mode && { mode }) + }; + + return defaultOptions; } diff --git a/packages/core/src/config/normalize-config/normalize-asset.ts b/packages/core/src/config/normalize-config/normalize-asset.ts index c894762d68..98995f7fe8 100644 --- a/packages/core/src/config/normalize-config/normalize-asset.ts +++ b/packages/core/src/config/normalize-config/normalize-asset.ts @@ -1,5 +1,6 @@ import { CUSTOM_KEYS } from '../constants.js'; -import { ResolvedCompilation, UserConfig } from '../types.js'; + +import type { ResolvedCompilation, UserConfig } from '../types.js'; export function normalizeAsset( config: UserConfig, diff --git a/packages/core/src/config/normalize-config/normalize-css.ts b/packages/core/src/config/normalize-config/normalize-css.ts index 5b28827bbb..59dfb559dd 100644 --- a/packages/core/src/config/normalize-config/normalize-css.ts +++ b/packages/core/src/config/normalize-config/normalize-css.ts @@ -1,6 +1,6 @@ import { CUSTOM_KEYS } from '../constants.js'; -import { ResolvedCompilation, UserConfig } from '../types.js'; +import type { ResolvedCompilation, UserConfig } from '../types.js'; export function normalizeCss( config: UserConfig, resolvedCompilation: ResolvedCompilation @@ -9,7 +9,6 @@ export function normalizeCss( normalizeCssModules(config, resolvedCompilation); } } - function normalizeCssModules( config: UserConfig, resolvedCompilation: ResolvedCompilation diff --git a/packages/core/src/config/normalize-config/normalize-external.ts b/packages/core/src/config/normalize-config/normalize-external.ts index e950fc119b..6bce5900ee 100644 --- a/packages/core/src/config/normalize-config/normalize-external.ts +++ b/packages/core/src/config/normalize-config/normalize-external.ts @@ -1,11 +1,11 @@ -import module from 'node:module'; - import { existsSync, readFileSync } from 'node:fs'; +import module from 'node:module'; import path from 'node:path'; + import { Config } from '../../types/binding.js'; -import { safeJsonParse } from '../../utils/json.js'; -import { isObject } from '../../utils/share.js'; +import { isObject, safeJsonParse } from '../../utils/index.js'; import { CUSTOM_KEYS } from '../constants.js'; + import type { ResolvedCompilation, UserConfig } from '../types.js'; type PartialExternal = [string[], Record]; @@ -62,6 +62,7 @@ export function normalizeExternal( defaultExternals.push( ...[...module.builtinModules].filter( (m) => + //@ts-ignore !resolvedCompilation.resolve?.alias?.[m] && !packageJson?.devDependencies?.[m] && !packageJson?.dependencies?.[m] diff --git a/packages/core/src/config/normalize-config/normalize-output.ts b/packages/core/src/config/normalize-config/normalize-output.ts index 386d1fb115..06c0b0c2a2 100644 --- a/packages/core/src/config/normalize-config/normalize-output.ts +++ b/packages/core/src/config/normalize-config/normalize-output.ts @@ -1,13 +1,14 @@ +import path, { isAbsolute } from 'node:path'; + import { browsersWithSupportForFeatures } from 'farm-browserslist-generator'; -import path, { isAbsolute } from 'node:path'; import { Config } from '../../types/binding.js'; import { urlRegex } from '../../utils/http.js'; import { Logger } from '../../utils/logger.js'; import { FARM_TARGET_BROWSER_ENVS, mapTargetEnvValue, - normalizeBasePath + normalizePath } from '../../utils/share.js'; import { ResolvedCompilation } from '../types.js'; @@ -95,9 +96,7 @@ const targetsMap: TargetsMap = { scriptGenTarget: 'es2017' }, 'browser-esnext': null, - library: null, - 'library-browser': null, - 'library-node': null + library: null }; /** @@ -266,7 +265,7 @@ export function getValidPublicPath(publicPath = '/'): string { if (publicPath.startsWith('/')) { validPublicPath = publicPath; } else if (publicPath.startsWith('.')) { - validPublicPath = normalizeBasePath(path.join('/', publicPath)); + validPublicPath = normalizePath(path.join('/', publicPath)); } return validPublicPath; diff --git a/packages/core/src/config/normalize-config/normalize-partial-bundling.ts b/packages/core/src/config/normalize-config/normalize-partial-bundling.ts new file mode 100644 index 0000000000..bcffa2041c --- /dev/null +++ b/packages/core/src/config/normalize-config/normalize-partial-bundling.ts @@ -0,0 +1,19 @@ +import { CUSTOM_KEYS } from '../constants.js'; + +import type { ResolvedCompilation } from '../types.js'; + +export function normalizePartialBundling( + resolvedCompilation: ResolvedCompilation +) { + const partialBundlingItemEnforceMap: Record = {}; + const partialBundleGroups = resolvedCompilation.partialBundling?.groups ?? []; + + for (const group of partialBundleGroups) { + if (group.enforce) { + partialBundlingItemEnforceMap[group.name] = true; + } + } + + resolvedCompilation.custom[CUSTOM_KEYS.partial_bundling_groups_enforce] = + JSON.stringify(partialBundlingItemEnforceMap); +} diff --git a/packages/core/src/config/normalize-config/normalize-persistent-cache.ts b/packages/core/src/config/normalize-config/normalize-persistent-cache.ts index b493a2023b..c218852355 100644 --- a/packages/core/src/config/normalize-config/normalize-persistent-cache.ts +++ b/packages/core/src/config/normalize-config/normalize-persistent-cache.ts @@ -3,13 +3,14 @@ import { createRequire } from 'node:module'; import path from 'node:path'; import { RustPlugin } from '../../plugin/index.js'; -import { Config } from '../../types/binding.js'; -import { Logger } from '../../utils/logger.js'; +import { Config, GlobalBuiltinCacheKeyStrategy } from '../../types/binding.js'; import { traceDependencies } from '../../utils/trace-dependencies.js'; import { isDisableCache } from '../env.js'; import { ResolvedUserConfig } from '../index.js'; -const defaultGlobalBuiltinCacheKeyStrategy = { +const DEFAULT_CACHE_DIR = 'node_modules/.farm/cache'; +const DEFAULT_PACKAGE_JSON = 'package.json'; +const defaultGlobalBuiltinCacheKeyStrategy: GlobalBuiltinCacheKeyStrategy = { define: true, buildDependencies: true, lockfile: true, @@ -19,8 +20,7 @@ const defaultGlobalBuiltinCacheKeyStrategy = { export async function normalizePersistentCache( config: Config['config'], - resolvedUserConfig: ResolvedUserConfig, - logger: Logger + resolvedUserConfig: ResolvedUserConfig ) { if (isDisableCache()) { config.persistentCache = false; @@ -37,16 +37,17 @@ export async function normalizePersistentCache( envs: {} }; } + + config.persistentCache.cacheDir = path.resolve( + config.root, + config.persistentCache.cacheDir || DEFAULT_CACHE_DIR + ); // globalCacheKeyStrategy should not be passed to rust - let { globalBuiltinCacheKeyStrategy } = config.persistentCache; - delete config.persistentCache.globalBuiltinCacheKeyStrategy; - if (!globalBuiltinCacheKeyStrategy) { - globalBuiltinCacheKeyStrategy = {}; - } - globalBuiltinCacheKeyStrategy = { + const globalBuiltinCacheKeyStrategy = { ...defaultGlobalBuiltinCacheKeyStrategy, - ...globalBuiltinCacheKeyStrategy + ...(config.persistentCache?.globalBuiltinCacheKeyStrategy ?? {}) }; + delete config.persistentCache.globalBuiltinCacheKeyStrategy; if (globalBuiltinCacheKeyStrategy.env) { config.persistentCache.envs = { @@ -76,10 +77,7 @@ export async function normalizePersistentCache( } // add type of package.json to envs - const packageJsonPath = path.join( - config.root ?? process.cwd(), - 'package.json' - ); + const packageJsonPath = path.join(config.root, DEFAULT_PACKAGE_JSON); if (globalBuiltinCacheKeyStrategy.packageJson) { if (existsSync(packageJsonPath)) { @@ -134,7 +132,7 @@ export async function normalizePersistentCache( ) { const files = resolvedUserConfig?.configFileDependencies?.length ? resolvedUserConfig.configFileDependencies - : await traceDependencies(resolvedUserConfig.configFilePath, logger); + : await traceDependencies(resolvedUserConfig.configFilePath); const packages = []; diff --git a/packages/core/src/config/normalize-config/normalize-resolve.ts b/packages/core/src/config/normalize-config/normalize-resolve.ts index b68c0031fd..5bcf08d7b6 100644 --- a/packages/core/src/config/normalize-config/normalize-resolve.ts +++ b/packages/core/src/config/normalize-config/normalize-resolve.ts @@ -1,5 +1,6 @@ import { CUSTOM_KEYS } from '../constants.js'; -import { ResolvedCompilation, UserConfig } from '../types.js'; + +import type { ResolvedCompilation, UserConfig } from '../types.js'; export function normalizeResolve( config: UserConfig, @@ -16,4 +17,64 @@ export function normalizeResolve( resolvedCompilation.custom[CUSTOM_KEYS.resolve_dedupe] = JSON.stringify(dedupe); + + const alias = normalizeResolveAlias(config); + + if (alias.length) { + resolvedCompilation.resolve.alias = alias; + } +} + +export function normalizeResolveAlias( + config: any +): Array<{ find: string | RegExp; replacement: string }> { + const alias = config.compilation.resolve?.alias; + const logger = config.logger; + + const normalizeItem = (find: string | RegExp, replacement: string) => { + if (typeof find === 'string' || find instanceof RegExp) { + if (typeof replacement === 'string') { + return { find, replacement }; + } + logger.warn(`Invalid replacement for '${find}': must be a string`); + } else { + logger.warn(`Invalid alias key: '${find}' must be a string or RegExp`); + } + return null; + }; + + const normalizeArray = (arr: any) => + arr + .map((item: any, _index: any) => + typeof item === 'object' && item !== null + ? normalizeItem(item.find, item.replacement) + : normalizeItem(item, item) + ) + .filter(Boolean); + + const normalizeObject = (obj: any) => { + return Object.entries(obj as Record) + .map(([find, replacement]) => { + const result = normalizeItem(find, replacement); + return result; + }) + .filter(Boolean); + }; + + let result: Array<{ find: string | RegExp; replacement: string }>; + switch (true) { + case alias === null || alias === undefined: + result = []; + break; + case Array.isArray(alias): + result = normalizeArray(alias); + break; + case typeof alias === 'object': + result = normalizeObject(alias); + break; + default: + logger.warn('Alias configuration must be an object or an array'); + result = []; + } + return result; } diff --git a/packages/core/src/config/schema.ts b/packages/core/src/config/schema.ts index 7a2646086c..fb66af4e0d 100644 --- a/packages/core/src/config/schema.ts +++ b/packages/core/src/config/schema.ts @@ -1,15 +1,48 @@ -import http from 'http'; -import { SecureServerOptions } from 'node:http2'; +import http from 'node:http'; + import { z } from 'zod'; import { fromZodError } from 'zod-validation-error'; +import { Logger } from '../utils/logger.js'; + +import type { OutgoingHttpHeaders, SecureServerOptions } from 'node:http2'; import type { UserConfig } from './types.js'; -const stringRewriteSchema = z.record(z.string(), z.string()); +enum TargetEnv { + BROWSER = 'browser', + NODE = 'node', + NODE_LEGACY = 'node-legacy', + NODE_NEXT = 'node-next', + NODE16 = 'node16', + BROWSER_LEGACY = 'browser-legacy', + BROWSER_ESNEXT = 'browser-esnext', + BROWSER_ES2015 = 'browser-es2015', + BROWSER_ES2017 = 'browser-es2017', + LIBRARY = 'library' + // LIBRARY_BROWSER = 'library-browser', + // LIBRARY_NODE = 'library-node' +} + +enum ECMAVersion { + ES3 = 'es3', + ES5 = 'es5', + ES2015 = 'es2015', + ES2016 = 'es2016', + ES2017 = 'es2017', + ES2018 = 'es2018', + ES2019 = 'es2019', + ES2020 = 'es2020', + ES2021 = 'es2021', + ES2022 = 'es2022', + ESNext = 'esnext' +} -const functionRewriteSchema = z.union([ - z.function().args(z.string(), z.any()).returns(z.string()), - z.function().args(z.string(), z.any()).returns(z.promise(z.string())) +const baseRewriteSchema = z.union([ + z.record(z.string(), z.string()), + z + .function() + .args(z.string(), z.any()) + .returns(z.union([z.string(), z.promise(z.string())])) ]); const pathFilterSchema = z.union([ @@ -21,44 +54,166 @@ const pathFilterSchema = z.union([ .returns(z.boolean()) ]); -const pathRewriteSchema = z.union([stringRewriteSchema, functionRewriteSchema]); +const outputSchema = z + .object({ + entryFilename: z.string().optional(), + filename: z.string().optional(), + path: z.string().optional(), + publicPath: z.string().optional(), + assetsFilename: z.string().optional(), + targetEnv: z.nativeEnum(TargetEnv).optional(), + format: z.enum(['cjs', 'esm']).optional(), + showFileSize: z.boolean().optional() + }) + .strict() + .optional(); + +const proxySchema = z + .record( + z + .object({ + target: z.string(), + changeOrigin: z.boolean().optional(), + agent: z.any().optional(), + secure: z.boolean().optional(), + logs: z.any().optional(), + pathRewrite: baseRewriteSchema.optional(), + pathFilter: pathFilterSchema.optional(), + headers: z.record(z.string()).optional(), + on: z + .object({ + proxyReq: z + .function() + .args(z.any(), z.any(), z.any()) + .returns(z.void()) + .optional(), + proxyRes: z + .function() + .args(z.any(), z.any(), z.any()) + .returns(z.void()) + .optional(), + error: z + .function() + .args(z.instanceof(Error), z.any(), z.any()) + .returns(z.void()) + .optional() + }) + .optional() + }) + .passthrough() + ) + .optional(); + +const previewServerSchema = z + .object({ + headers: z.union([z.custom(), z.boolean()]).optional(), + host: z + .union([ + z.string().regex(/^\d{1,3}\.\d{1,3}$/), + z.literal('localhost'), + z.boolean() + ]) + .optional(), + port: z.number().positive().int().optional(), + strictPort: z.boolean().optional(), + https: z.custom(), + distDir: z.string().optional(), + open: z.boolean().optional(), + proxy: proxySchema, + cors: z.union([z.boolean(), z.any()]).optional() + }) + .strict(); + +const WatchOptionsSchema = z.object({ + persistent: z.boolean().optional(), + ignored: z + .union([ + z.string(), + z.array(z.string()), + z.instanceof(RegExp), + z.array(z.instanceof(RegExp)), + z.function(z.tuple([z.string()]), z.boolean()) + ]) + .optional(), + ignoreInitial: z.boolean().optional(), + followSymlinks: z.boolean().optional(), + cwd: z.string().optional(), + useFsEvents: z.boolean().optional(), + disableGlobbing: z.boolean().optional(), + usePolling: z.boolean().optional(), + interval: z.number().positive().int().optional(), + binaryInterval: z.number().positive().int().optional(), + alwaysStat: z.boolean().optional(), + depth: z.number().positive().int().optional(), + awaitWriteFinish: z + .object({ + stabilityThreshold: z.number().positive().int().optional(), + pollInterval: z.number().positive().int().optional() + }) + .optional(), + atomic: z.union([z.boolean(), z.number().positive().int()]).optional(), + ignorePermissionErrors: z.boolean().optional() +}); + +const serverSchema = z + .object({ + headers: z.record(z.string()).optional(), + port: z.number().positive().int().optional(), + https: z.custom(), + origin: z.string().optional(), + hmr: z + .union([ + z.boolean(), + z + .object({ + protocol: z.string().optional(), + host: z.union([z.string().min(1), z.boolean()]).optional(), + port: z.number().positive().int().optional(), + path: z.string().optional(), + overlay: z.boolean().optional() + }) + .strict() + ]) + .optional(), + proxy: proxySchema, + strictPort: z.boolean().optional(), + open: z.boolean().optional(), + host: z + .union([ + z.string().regex(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/), + z.literal('localhost'), + z.boolean() + ]) + .optional(), + cors: z.boolean().optional(), + appType: z.enum(['spa', 'mpa', 'custom']).optional(), + middlewares: z.array(z.any()).optional(), + middlewareMode: z.boolean().optional(), + writeToDisk: z.boolean().optional(), + preview: previewServerSchema.optional() + }) + .strict(); + +const aliasItemSchema = z.object({ + find: z.union([z.string(), z.instanceof(RegExp)]), + replacement: z.string(), + // TODO add customResolver schema + customResolver: z + .union([z.function(), z.object({ resolve: z.function() })]) + .optional() +}); + +const aliasSchema = z.union([z.record(z.string()), z.array(aliasItemSchema)]); const compilationConfigSchema = z .object({ root: z.string().optional(), input: z.record(z.string()).optional(), - output: z - .object({ - entryFilename: z.string().optional(), - filename: z.string().optional(), - path: z.string().optional(), - publicPath: z.string().optional(), - assetsFilename: z.string().optional(), - targetEnv: z - .enum([ - 'browser', - 'node', - 'node-legacy', - 'node-next', - 'node16', - 'browser-legacy', - 'browser-esnext', - 'browser-es2015', - 'browser-es2017', - 'library', - 'library-browser', - 'library-node' - ]) - .optional(), - format: z.enum(['cjs', 'esm']).optional(), - clean: z.boolean().optional() - }) - .strict() - .optional(), + output: outputSchema, resolve: z .object({ extensions: z.array(z.string()).optional(), - alias: z.record(z.string()).optional(), + alias: aliasSchema.optional(), mainFields: z.array(z.string()).optional(), conditions: z.array(z.string()).optional(), symlinks: z.boolean().optional(), @@ -76,20 +231,7 @@ const compilationConfigSchema = z .union([z.boolean(), z.array(z.string())]) .optional(), mode: z.string().optional(), - watch: z - .union([ - z.boolean(), - z.object({ - // TODO watcher config schema - ignored: z.array(z.string()).optional(), - watchOptions: z - .object({ - awaitWriteFinish: z.number().positive().int().optional() - }) - .optional() - }) - ]) - .optional(), + coreLibPath: z.string().optional(), runtime: z .object({ @@ -110,21 +252,7 @@ const compilationConfigSchema = z .optional(), script: z .object({ - target: z - .enum([ - 'es3', - 'es5', - 'es2015', - 'es2016', - 'es2017', - 'es2018', - 'es2019', - 'es2020', - 'es2021', - 'es2022', - 'esnext' - ]) - .optional(), + target: z.nativeEnum(ECMAVersion).optional(), parser: z .object({ esConfig: z @@ -196,7 +324,8 @@ const compilationConfigSchema = z name: z.string(), test: z.array(z.string()), groupType: z.enum(['mutable', 'immutable']).optional(), - resourceType: z.enum(['all', 'initial', 'async']).optional() + resourceType: z.enum(['all', 'initial', 'async']).optional(), + enforce: z.boolean().optional() }) ) .optional(), @@ -213,7 +342,8 @@ const compilationConfigSchema = z enforceTargetConcurrentRequests: z.boolean().optional(), enforceTargetMinSize: z.boolean().optional(), immutableModules: z.array(z.string()).optional(), - immutableModulesWeight: z.number().optional() + immutableModulesWeight: z.number().optional(), + enforce: z.boolean().optional() }) .strict() .optional(), @@ -232,8 +362,7 @@ const compilationConfigSchema = z z.literal('minify-module'), z.literal('minify-resource-pot') ]) - .optional(), - moduleDecls: z.boolean().optional() + .optional() }) ]) .optional(), @@ -305,109 +434,26 @@ const compilationConfigSchema = z .optional() ]), comments: z.union([z.boolean(), z.literal('license')]).optional(), - custom: z.record(z.string(), z.string()).optional() + custom: z.record(z.string(), z.string()).optional(), + concatenateModules: z.boolean().optional() }) .strict(); const FarmConfigSchema = z .object({ root: z.string().optional(), - clearScreen: z.boolean().optional(), + mode: z.string().optional(), configPath: z.string().optional(), + clearScreen: z.boolean().optional(), + customLogger: z.instanceof(Logger).optional(), envDir: z.string().optional(), envPrefix: z.union([z.string(), z.array(z.string())]).optional(), publicDir: z.string().optional(), - plugins: z.array(z.any()).optional(), - vitePlugins: z.array(z.any()).optional(), + watch: z.union([z.boolean(), WatchOptionsSchema]).optional(), compilation: compilationConfigSchema.optional(), - mode: z.string().optional(), - server: z - .object({ - headers: z.record(z.string()).optional(), - port: z.number().positive().int().optional(), - host: z - .union([ - z.string().regex(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/), - z.literal('localhost'), - z.boolean() - ]) - .optional(), - open: z.boolean().optional(), - https: z.custom(), - cors: z.boolean().optional(), - spa: z.boolean().optional(), - proxy: z - .record( - z - .object({ - target: z.string(), - changeOrigin: z.boolean().optional(), - agent: z.any().optional(), - secure: z.boolean().optional(), - logs: z.any().optional(), - pathRewrite: pathRewriteSchema.optional(), - pathFilter: pathFilterSchema.optional(), - headers: z.record(z.string()).optional(), - on: z - .object({ - proxyReq: z - .function() - .args( - z.instanceof(Object), - z.instanceof(Object), - z.instanceof(Object) - ) - .returns(z.void()) - .optional(), - proxyRes: z - .function() - .args( - z.instanceof(Object), - z.instanceof(Object), - z.instanceof(Object) - ) - .returns(z.void()) - .optional(), - error: z - .function() - .args( - z.instanceof(Error), - z.instanceof(Object), - z.instanceof(Object) - ) - .returns(z.void()) - .optional() - }) - .optional() - }) - .passthrough() - ) - .optional(), - strictPort: z.boolean().optional(), - hmr: z - .union([ - z.boolean(), - z - .object({ - protocol: z.string().optional(), - host: z.union([z.string().min(1), z.boolean()]).optional(), - port: z.number().positive().int().optional(), - path: z.string().optional(), - watchOptions: z - .object({ - awaitWriteFinish: z.number().positive().int().optional() - }) - .optional(), - overlay: z.boolean().optional() - }) - .strict() - ]) - .optional(), - middlewares: z.array(z.any()).optional(), - writeToDisk: z.boolean().optional() - }) - .strict() - .optional() + server: serverSchema.optional(), + plugins: z.array(z.any()).optional(), + vitePlugins: z.array(z.any()).optional() }) .strict(); @@ -415,10 +461,8 @@ export function parseUserConfig(config: UserConfig): UserConfig { try { const parsed = FarmConfigSchema.parse(config); return parsed as UserConfig; - // return config as UserConfig; } catch (err) { const validationError = fromZodError(err); - // the error now is readable by the user throw new Error( `${validationError.toString()}. \n Please check your configuration file or command line configuration.` ); diff --git a/packages/core/src/config/types.ts b/packages/core/src/config/types.ts index 4f72214f1f..ef99eacfe0 100644 --- a/packages/core/src/config/types.ts +++ b/packages/core/src/config/types.ts @@ -1,21 +1,78 @@ import { SecureServerOptions } from 'node:http2'; -import { Server } from '../index.js'; + +import { CompilationMode, Server } from '../index.js'; import type { OutgoingHttpHeaders } from 'http'; -import type cors from '@koa/cors'; -import { WatchOptions } from 'chokidar'; -import type { Options } from 'http-proxy-middleware'; -import { Middleware } from 'koa'; +import type { ServerOptions as HttpsServerOptions } from 'node:https'; +import type { WatchOptions } from 'chokidar'; import type { RustPlugin } from '../plugin/rust/index.js'; import type { JsPlugin } from '../plugin/type.js'; -import type { Config, CssConfig } from '../types/binding.js'; +import type { Config, CssConfig, OutputConfig } from '../types/binding.js'; import type { Logger } from '../utils/index.js'; +/** + * Interface for Hot Module Reload (HMR) configuration options. + * HMR allows for updating parts of an application without a full reload, + * improving development efficiency. + */ +export interface HmrOptions { + /** + * The protocol to use for the HMR connection. + * + * @default '' + */ + protocol?: string; + /** + * The host address for the HMR server. + * + * @default 'localhost' + */ + host?: string; + /** + * The port number for the HMR server. + * + * @default undefined + */ + port?: number; + /** + * The port number for the HMR client. + * + * @default 9000 + */ + clientPort?: number; + /** + * The path for the HMR endpoint. + * + * @default '/__hmr' + */ + path?: string; + /** + * The timeout in milliseconds for the HMR connection. + * + * @default 0 + */ + timeout?: number; + /** + * Whether to show an overlay for HMR errors in the browser. + * + * @default true + */ + overlay?: boolean; + /** + * The server instance to attach the HMR middleware to. + * + * @default null + */ + server?: Server; +} + export interface ConfigEnv { mode: string; + command: commandType; + isPreview: boolean; } -export type ProxyOptions = Options; +export type commandType = 'dev' | 'build' | 'watch' | 'preview'; export type UserConfigFnPromise = (env: ConfigEnv) => Promise; export type UserConfigFn = (env: ConfigEnv) => UserConfig | Promise; @@ -28,37 +85,184 @@ export type UserConfigExport = | UserConfigFnPromise | UserConfigFn; +/** + * Interface for user server configuration, defining various + * configuration options for the server. + */ export interface UserServerConfig { + /** + * HTTP headers to be sent with every response. + * + * @default {} + */ headers?: OutgoingHttpHeaders | undefined; + /** + * The port number the server will listen on. + * + * @default 9000 + */ port?: number; - https?: SecureServerOptions; - protocol?: 'http' | 'https'; - hostname?: { name: string; host: string | undefined }; + /** + * Configuration options for the HTTPS server. + * + * @default undefined + */ + https?: HttpsServerOptions; + /** + * The origin address of the server. + * + * @default '' + */ + origin?: string; // http2?: boolean; - hmr?: boolean | UserHmrConfig; - proxy?: Record; + /** + * Configuration options for Hot Module Replacement (HMR), + * which can be a boolean or a detailed configuration object. + */ + hmr?: boolean | HmrOptions; + /** + * Proxy configuration for the server, in key-value pair format. + * + * @default undefined + */ + proxy?: Record; + /** + * Whether to strictly use the specified port. If the port is + * occupied, an exception will be thrown when this option is set + * to `true`. + * + * @default false + */ strictPort?: boolean; + /** + * Whether to automatically open the server in the default browser. + * + * @default false + */ open?: boolean; + /** + * The host address the server listens on. + * + * @default 'localhost' + */ host?: string | boolean; - cors?: boolean | cors.Options; - // whether to serve static assets in spa mode, default to true - spa?: boolean; + /** + * Whether to enable CORS (Cross-Origin Resource Sharing), + * which can be a boolean or detailed configuration. + * + * @default false + */ + cors?: boolean | any; + /** + * Application type, with optional values of 'spa' + * (Single Page Application), 'mpa' (Multi-Page Application), + * or 'custom' (Custom). + * + * @default 'spa' + */ + appType?: 'spa' | 'mpa' | 'custom'; + /** + * Array of middleware for the development server. + * + * @default [] + */ middlewares?: DevServerMiddleware[]; + /** + * Whether to run the server in middleware mode. + * + * @default false + */ + middlewareMode?: boolean; + /** + * Whether to write files to disk. + * + * @default false + */ writeToDisk?: boolean; + /** + * Configuration options for the preview server. + */ + preview?: UserPreviewServerConfig; } +/** Preview server configs */ export interface UserPreviewServerConfig { - // write static output file - output?: { path?: string; publicPath?: string }; - distDir?: string; - https?: SecureServerOptions; - port?: number; + /** + * HTTP headers to be sent with every response. + * Set to `false` to disable preview server headers. + * + * @default server.headers + */ + headers?: OutgoingHttpHeaders | false | undefined; + /** + * Host to run the preview server on. + * + * @default 'localhost' + */ host?: string | boolean; + /** + * Port to run the preview server on. + * + * **NOTE**: If the port is already in use, the preview + * server will automatically try the next available port. + * If you want to use a specific port strictly, please + * set `strictPort` to `true`. + * + * @default 1911 + */ + port?: number; + /** + * Use the specified port strictly. + * + * If the enabled, the preview server will throw an exception + * if failed to binding on specified port. + * + * @default false + */ + strictPort?: boolean; + /** + * Secure server options. + * + * Set to `false` to disable https options. + * + * @default server.https + */ + https?: SecureServerOptions; + /** + * Specify where the dist directory is located. + * If not specified, farm will try to resolve + * the dist directory from `compilation.output.path`. + * If the path is relative, this will be relative to `root`. + * + * @default 'dist' + */ + distDir?: string; + /** + * Open the preview server in the default browser automatically. + * + * @default false + */ + open?: boolean | string; + /** + * Enable CORS for preview server. + * + * @default false + */ + cors?: boolean | any; + /** + * Proxy options for preview server. + * Set to `false` to disable proxy. + * + * @default server.proxy + */ + proxy?: Record; } export type NormalizedServerConfig = Required< Omit & { - hmr?: Required; + hmr?: HmrOptions; + protocol?: 'http' | 'https'; + hostname?: { name: string; host: string | undefined }; } >; @@ -67,15 +271,6 @@ export interface NormalizedConfig { serverConfig?: NormalizedServerConfig; } -export interface UserHmrConfig { - host?: string | boolean; - port?: number; - path?: string; - overlay?: boolean; - protocol?: string; - watchOptions?: WatchOptions; -} - type InternalConfig = Config['config'] extends undefined ? object : Required['config']; @@ -85,27 +280,79 @@ type AvailableUserConfigKeys = Exclude< 'configFilePath' | 'env' | 'coreLibPath' | 'root' >; +/** + * Interface for user configuration, defining various configuration options for the project. + */ export interface UserConfig { - /** current root of this project, default to current working directory */ + /** + * The root directory of the current project, defaulting to the current working directory. + * + * @default cwd + */ root?: string; + /** + * Whether to clear the screen when starting. + * + * @default false + */ clearScreen?: boolean; + /** + * The mode of the project, such as 'development' or 'production'. + */ + mode?: string; + /** + * The directory where the environment variable files are located. + */ envDir?: string; + /** + * Whether to enable file watching, or the configuration options for watching. + */ + watch?: boolean | WatchOptions; + /** + * The prefix for environment variables, which can be a single string or an array of strings. + * + * @default 'FARM_' + */ envPrefix?: string | string[]; + /** + * The public directory, where files under this dir will always be treated as static assets. + * Static assets will be served in development server, directly copied to the output directory. + * + * @default 'public' + */ publicDir?: string; - /** js plugin(which is a javascript object) and rust plugin(which is string refer to a .farm file or a package) */ + /** + * List of farm plugins, supporting JavaScript plugins, Rust plugins, or arrays of plugins. + * You can pass null, undefined, or false to disable plugins. + */ plugins?: (RustPlugin | JsPlugin | JsPlugin[] | undefined | null | false)[]; - /** vite plugins */ + /** + * List of Vite compatible plugins. + */ vitePlugins?: ( | null | undefined | object | (() => { vitePlugin: any; filters: string[] }) )[]; - /** config related to compilation */ + /** + * Configuration related to compilation. + */ compilation?: Pick; - /** config related to dev server */ + /** + * Configuration related to the server. + */ server?: UserServerConfig; - /** Files under this dir will always be treated as static assets. serve it in dev, and copy it to output.path when build */ + /** + * Custom logger instance. + */ + customLogger?: Logger; +} + +interface ResolvedCss extends CssConfig { + modules?: CssConfig['modules'] & { + localsConversion?: never; + }; } interface ResolvedCss extends CssConfig { @@ -114,7 +361,6 @@ interface ResolvedCss extends CssConfig { }; } -// eslint-disable-next-line @typescript-eslint/no-empty-interface export interface ResolvedCompilation extends Exclude { external?: string[]; @@ -126,6 +372,9 @@ export interface ResolvedCompilation } export interface ResolvedUserConfig extends UserConfig { + root?: string; + mode?: string; + command?: commandType; env?: Record; envDir?: string; envFiles?: string[]; @@ -137,14 +386,18 @@ export interface ResolvedUserConfig extends UserConfig { server?: NormalizedServerConfig; jsPlugins?: JsPlugin[]; rustPlugins?: [string, string][]; + inlineConfig?: FarmCliOptions; + logger?: Logger; + customLogger?: Logger; + watch?: boolean | WatchOptions; } -export interface GlobalFarmCLIOptions { +export interface GlobalCliOptions { '--'?: string[]; c?: boolean | string; config?: string; m?: string; - mode?: 'development' | 'production'; + mode?: string; } export interface FarmCLIServerOptions { @@ -169,12 +422,11 @@ export interface FarmCLIPreviewOptions { host?: string | boolean; } -export interface FarmCLIOptions +export interface FarmCliOptions extends FarmCLIBuildOptions, FarmCLIPreviewOptions { - logger?: Logger; config?: string; - configPath?: string; + configFile?: string; compilation?: Config['config']; mode?: string; root?: string; @@ -182,10 +434,49 @@ export interface FarmCLIOptions clearScreen?: boolean; } -export type DevServerMiddleware = (context: Server) => Middleware | undefined; +export type DevServerMiddleware = (context: Server) => any | undefined; export interface Alias { - // TODO support RegExp find: string; replacement: string; } +export type Format = Exclude; + +export type DefaultOptionsType = { + inlineOptions?: FarmCliOptions; + configFilePath?: string; + format?: Format; + outputPath?: string; + fileName?: string; + mode?: CompilationMode; + showFileSize?: boolean; +}; + +export type EnvResult = Record< + `$__farm_regex:(global(This)?\\.)?process\\.env\\.${string}`, + string +>; + +export interface ModuleNode { + url: string; + /** + * Resolved file system path + query + */ + id: string | null; + file: string | null; + type: 'js' | 'css'; +} + +export interface ModuleContext { + file: string; + timestamp: number; + type: string; + modules: ModuleNode[]; + paths: string[]; + read: (file: string) => string | Promise; +} + +export interface ConfigResult { + config: UserConfig; + configFilePath: string; +} diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 70dc69d1c9..67e67c7aa3 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -2,262 +2,153 @@ export * from './compiler/index.js'; export * from './config/index.js'; export * from './server/index.js'; export * from './plugin/type.js'; +export * from './plugin/index.js'; export * from './utils/index.js'; -export type { - ModuleType, - ResolveKind, - PluginLoadHookParam, - PluginLoadHookResult, - PluginResolveHookParam, - PluginResolveHookResult, - OutputConfig, - ResolveConfig, - RuntimeConfig, - ScriptConfig, - CssConfig, - PersistentCacheConfig, - PartialBundlingConfig, - PresetEnvConfig, - Config, - PluginTransformHookParam, - PluginTransformHookResult -} from './types/binding.js'; -import { statSync } from 'node:fs'; -import fs from 'node:fs/promises'; -import path from 'node:path'; -import fse from 'fs-extra'; +export { defineFarmConfig as defineConfig } from './config/index.js'; -import { Compiler } from './compiler/index.js'; -import { loadEnv, setProcessEnv } from './config/env.js'; -import { - UserConfig, - checkClearScreen, - getConfigFilePath, - normalizePublicDir, - resolveConfig -} from './config/index.js'; -import { Server } from './server/index.js'; -import { compilerHandler } from './utils/build.js'; -import { colors } from './utils/color.js'; -import { Logger } from './utils/logger.js'; -import { FileWatcher } from './watcher/index.js'; +import fs from 'node:fs/promises'; +import { createCompiler } from './compiler/index.js'; import { __FARM_GLOBAL__ } from './config/_global.js'; -import type { - FarmCLIOptions, - ResolvedUserConfig, - UserPreviewServerConfig -} from './config/types.js'; -import { logError } from './server/error.js'; -import { lazyCompilation } from './server/middlewares/lazy-compilation.js'; -import { ConfigWatcher } from './watcher/config-watcher.js'; - -import type { JsPlugin } from './plugin/type.js'; -import { resolveHostname } from './utils/http.js'; +import { UserConfig, resolveConfig } from './config/index.js'; +import { getPluginHooks } from './plugin/index.js'; +import { PreviewServer, Server } from './server/index.js'; +import { + PersistentCacheBrand, + bold, + colors, + copyPublicDirectory, + findNodeModulesRecursively, + getShortName, + green +} from './utils/index.js'; +import { handlerWatcher } from './watcher/index.js'; + +import type { FarmCliOptions } from './config/types.js'; +export type { Compiler as BindingCompiler } from './types/binding.js'; +import type { PersistentCacheConfig } from './types/binding.js'; export async function start( - inlineConfig?: FarmCLIOptions & UserConfig + inlineConfig?: FarmCliOptions & UserConfig ): Promise { inlineConfig = inlineConfig ?? {}; - const logger = inlineConfig.logger ?? new Logger(); - setProcessEnv('development'); - + const server = new Server(inlineConfig); try { - const resolvedUserConfig = await resolveConfig( - inlineConfig, - 'development', - logger - ); - - if ( - resolvedUserConfig.compilation.lazyCompilation && - typeof resolvedUserConfig.server?.host === 'string' - ) { - await setLazyCompilationDefine(resolvedUserConfig); - } - - const compiler = await createCompiler(resolvedUserConfig, logger); - - const devServer = await createDevServer( - compiler, - resolvedUserConfig, - logger - ); - - await devServer.listen(); + await server.createServer(); + await server.listen(); + server.printUrls(); } catch (error) { - logger.error('Failed to start the server', { exit: true, error }); + server.logger.error('Failed to start the server', { exit: false, error }); } } -export async function build( - inlineConfig?: FarmCLIOptions & UserConfig +export async function preview( + inlineConfig: FarmCliOptions & UserConfig = {} ): Promise { - inlineConfig = inlineConfig ?? {}; - const logger = inlineConfig.logger ?? new Logger(); - setProcessEnv('production'); - - const resolvedUserConfig = await resolveConfig( - inlineConfig, - 'production', - logger, - false - ); - - try { - await createBundleHandler(resolvedUserConfig, logger); - // copy resources under publicDir to output.path - await copyPublicDirectory(resolvedUserConfig, logger); - } catch (err) { - logger.error(`Failed to build: ${err}`, { exit: true }); - } -} - -export async function preview(inlineConfig?: FarmCLIOptions): Promise { - inlineConfig = inlineConfig ?? {}; - const logger = inlineConfig.logger ?? new Logger(); - const resolvedUserConfig = await resolveConfig( - inlineConfig, - 'production', - logger - ); - - const { root, output } = resolvedUserConfig.compilation; - const distDir = path.resolve(root, output.path); - + const previewServer = new PreviewServer(inlineConfig); try { - statSync(distDir); - } catch (err) { - if (err.code === 'ENOENT') { - throw new Error( - `The directory "${distDir}" does not exist. Did you build your project?` - ); - } + await previewServer.createPreviewServer(); + previewServer.listen(); + } catch (error) { + previewServer.logger.error('Failed to start the preview server', { + exit: false, + error + }); } - - // reusing port conflict check from DevServer - const serverConfig = { - ...resolvedUserConfig.server, - host: inlineConfig.host ?? true, - port: - inlineConfig.port ?? - (Number(process.env.FARM_DEFAULT_SERVER_PORT) || 1911) - }; - await Server.resolvePortConflict(serverConfig, logger); - const port = serverConfig.port; - const host = serverConfig.host; - const previewOptions: UserPreviewServerConfig = { - ...serverConfig, - distDir, - output: { path: output.path, publicPath: output.publicPath }, - port, - host - }; - - const server = new Server({ logger }); - server.createPreviewServer(previewOptions); } -export async function watch( - inlineConfig?: FarmCLIOptions & UserConfig +export async function build( + inlineConfig: FarmCliOptions & UserConfig = {} ): Promise { - inlineConfig = inlineConfig ?? {}; - const logger = inlineConfig.logger ?? new Logger(); - setProcessEnv('development'); - - inlineConfig.server ??= {}; - inlineConfig.server.hmr ??= false; - const resolvedUserConfig = await resolveConfig( inlineConfig, - 'development', - logger, - false + 'build', + 'production', + 'production' ); - - const lazyEnabled = resolvedUserConfig.compilation?.lazyCompilation; - - if (lazyEnabled) { - await setLazyCompilationDefine(resolvedUserConfig); - } - - const compilerFileWatcher = await createBundleHandler( - resolvedUserConfig, + const { + compilation: { persistentCache, output }, + configFilePath, + root, logger, - true - ); - - let devServer: Server | undefined; - // create dev server for lazy compilation - if (lazyEnabled) { - devServer = new Server({ - logger, - compiler: compilerFileWatcher.serverOrCompiler as Compiler - }); - await devServer.createServer(resolvedUserConfig.server); - devServer.applyMiddlewares([lazyCompilation]); - await devServer.startServer(resolvedUserConfig.server); - } - - async function handleFileChange(files: string[]) { - logFileChanges(files, resolvedUserConfig.root, logger); - - try { - farmWatcher.close(); - - if (lazyEnabled && devServer) { - devServer.close(); - } + jsPlugins, + watch + } = resolvedUserConfig; - __FARM_GLOBAL__.__FARM_RESTART_DEV_SERVER__ = true; + try { + const shortFile = getShortName(configFilePath, root); + logger.info(`Using config file at ${bold(green(shortFile))}`); - compilerFileWatcher?.close(); + const compiler = createCompiler(resolvedUserConfig); + for (const hook of getPluginHooks(jsPlugins, 'configureCompiler')) { + await hook?.(compiler); + } - await watch(inlineConfig); - } catch (error) { - logger.error(`Error restarting the watcher: ${error.message}`); + // TODO move to rust + if (output?.clean) { + compiler.removeOutputPathDir(); + } + const startTime = performance.now(); + await compiler.compile(); + const elapsedTime = Math.floor(performance.now() - startTime); + const persistentCacheText = persistentCache + ? bold(PersistentCacheBrand) + : ''; + + logger.info( + `Build completed in ${bold( + green(`${logger.formatTime(elapsedTime)}`) + )} ${persistentCacheText} Resources emitted to ${bold( + green(output.path) + )}.` + ); + compiler.writeResourcesToDisk(); + if (watch) { + handlerWatcher(resolvedUserConfig, compiler); } + } catch (err) { + logger.error(`Failed to build: ${err}`, { exit: true }); } - - const farmWatcher = new ConfigWatcher(resolvedUserConfig).watch( - handleFileChange - ); } export async function clean( rootPath: string, - recursive?: boolean | undefined + recursive = false ): Promise { - // TODO After optimizing the reading of config, put the clean method into compiler - const logger = new Logger(); + const resolvedUserConfig = await resolveConfig( + {}, + 'build', + 'production', + 'production' + ); + const cachePath = ( + resolvedUserConfig.compilation.persistentCache as PersistentCacheConfig + ).cacheDir; const nodeModulesFolders = recursive ? await findNodeModulesRecursively(rootPath) - : [path.join(rootPath, 'node_modules')]; + : [cachePath]; await Promise.all( nodeModulesFolders.map(async (nodeModulesPath) => { - // TODO Bug .farm cacheDir folder not right - const farmFolderPath = path.join(nodeModulesPath, '.farm'); try { - const stats = await fs.stat(farmFolderPath); - if (stats.isDirectory()) { - await fs.rm(farmFolderPath, { recursive: true, force: true }); - // TODO optimize nodeModulePath path e.g: /Users/xxx/node_modules/.farm/cache - logger.info( - `Cache cleaned at ${colors.bold(colors.green(nodeModulesPath))}` + const farmFolderStats = await fs.stat(cachePath); + if (farmFolderStats.isDirectory()) { + await fs.rm(cachePath, { recursive: true, force: true }); + resolvedUserConfig.logger.info( + `✨ ✨ Cache cleaned at ${colors.bold(colors.green(cachePath))}` ); } } catch (error) { - if (error.code === 'ENOENT') { - logger.warn( + if (error?.code === 'ENOENT') { + resolvedUserConfig.logger.warn( `No cached files found in ${colors.bold( colors.green(nodeModulesPath) )}` ); } else { - logger.error( + resolvedUserConfig.logger.error( `Error cleaning cache in ${colors.bold( colors.green(nodeModulesPath) )}: ${error.message}` @@ -267,203 +158,3 @@ export async function clean( }) ); } - -async function findNodeModulesRecursively(rootPath: string): Promise { - const result: string[] = []; - - async function traverse(currentPath: string) { - const items = await fs.readdir(currentPath); - for (const item of items) { - const fullPath = path.join(currentPath, item); - const stats = await fs.stat(fullPath); - - if (stats.isDirectory()) { - if (item === 'node_modules') { - result.push(fullPath); - } else { - await traverse(fullPath); - } - } - } - } - - await traverse(rootPath); - return result; -} - -export async function createBundleHandler( - resolvedUserConfig: ResolvedUserConfig, - logger: Logger, - watchMode = false -) { - const compiler = await createCompiler(resolvedUserConfig, logger); - - await compilerHandler( - async () => { - if (resolvedUserConfig.compilation?.output?.clean) { - compiler.removeOutputPathDir(); - } - try { - await compiler.compile(); - } catch (err) { - throw new Error(logError(err) as unknown as string); - } - compiler.writeResourcesToDisk(); - }, - resolvedUserConfig, - logger - ); - - if (resolvedUserConfig.compilation?.watch || watchMode) { - const watcher = new FileWatcher(compiler, resolvedUserConfig, logger); - await watcher.watch(); - return watcher; - } -} - -export async function createCompiler( - resolvedUserConfig: ResolvedUserConfig, - logger: Logger -) { - const { - jsPlugins, - rustPlugins, - compilation: compilationConfig - } = resolvedUserConfig; - - const compiler = new Compiler( - { - config: compilationConfig, - jsPlugins, - rustPlugins - }, - logger - ); - - for (const plugin of jsPlugins) { - await plugin.configureCompiler?.(compiler); - } - - return compiler; -} - -async function copyPublicDirectory( - resolvedUserConfig: ResolvedUserConfig, - logger: Logger -): Promise { - const absPublicDirPath = normalizePublicDir( - resolvedUserConfig.root, - resolvedUserConfig.publicDir - ); - - try { - if (await fse.pathExists(absPublicDirPath)) { - const files = await fse.readdir(absPublicDirPath); - const outputPath = resolvedUserConfig.compilation.output.path; - for (const file of files) { - const publicFile = path.join(absPublicDirPath, file); - const destFile = path.join(outputPath, file); - - if (await fse.pathExists(destFile)) { - continue; - } - await fse.copy(publicFile, destFile); - } - - logger.info( - `Public directory resources copied ${colors.bold( - colors.green('successfully') - )}.` - ); - } - } catch (error) { - logger.error(`Error copying public directory: ${error.message}`); - } -} - -export async function createDevServer( - compiler: Compiler, - resolvedUserConfig: ResolvedUserConfig, - logger: Logger -) { - const server = new Server({ compiler, logger }); - await server.createDevServer(resolvedUserConfig.server); - await createFileWatcher(server, resolvedUserConfig, logger); - // call configureDevServer hook after both server and watcher are ready - resolvedUserConfig.jsPlugins.forEach((plugin: JsPlugin) => - plugin.configureDevServer?.(server) - ); - - return server; -} - -export async function createFileWatcher( - devServer: Server, - resolvedUserConfig: ResolvedUserConfig, - logger: Logger = new Logger() -) { - if ( - devServer.config.hmr && - resolvedUserConfig.compilation.mode === 'production' - ) { - logger.error('HMR cannot be enabled in production mode.'); - return; - } - - if (!devServer.config.hmr) { - return; - } - - if (devServer.watcher) { - return; - } - - const fileWatcher = new FileWatcher(devServer, resolvedUserConfig, logger); - devServer.watcher = fileWatcher; - await fileWatcher.watch(); - - const configFilePath = await getConfigFilePath(resolvedUserConfig.root); - const farmWatcher = new ConfigWatcher({ - ...resolvedUserConfig, - configFilePath - }); - farmWatcher.watch(async (files: string[]) => { - checkClearScreen(resolvedUserConfig); - - devServer.restart(async () => { - logFileChanges(files, resolvedUserConfig.root, logger); - farmWatcher?.close(); - - await devServer.close(); - __FARM_GLOBAL__.__FARM_RESTART_DEV_SERVER__ = true; - // TODO: resolvedUserConfig params type check - await start(resolvedUserConfig as unknown as FarmCLIOptions & UserConfig); - }); - }); - return fileWatcher; -} - -export function logFileChanges(files: string[], root: string, logger: Logger) { - const changedFiles = files - .map((file) => path.relative(root, file)) - .join(', '); - logger.info( - colors.bold(colors.green(`${changedFiles} changed, server will restart.`)) - ); -} - -async function setLazyCompilationDefine( - resolvedUserConfig: ResolvedUserConfig -) { - const hostname = await resolveHostname(resolvedUserConfig.server.host); - resolvedUserConfig.compilation.define = { - ...(resolvedUserConfig.compilation.define ?? {}), - FARM_LAZY_COMPILE_SERVER_URL: `${ - resolvedUserConfig.server.protocol || 'http' - }://${hostname.host || 'localhost'}:${resolvedUserConfig.server.port}` - }; -} - -export { defineFarmConfig as defineConfig } from './config/index.js'; - -export { loadEnv }; diff --git a/packages/core/src/plugin/index.ts b/packages/core/src/plugin/index.ts index 73c010f6e9..9e569dda1a 100644 --- a/packages/core/src/plugin/index.ts +++ b/packages/core/src/plugin/index.ts @@ -1,13 +1,29 @@ +export * from './js/index.js'; +export * from './rust/index.js'; + +import { + CompilationMode, + ConfigEnv, + ResolvedUserConfig, + type UserConfig, + commandType +} from '../config/index.js'; import { isArray, isObject } from '../utils/index.js'; -import { convertPlugin } from './js/index.js'; +import merge from '../utils/merge.js'; +import { convertPlugin, handleVitePlugins } from './js/index.js'; import { rustPluginResolver } from './rust/index.js'; -import { ResolvedUserConfig, type UserConfig } from '../config/index.js'; -import merge from '../utils/merge.js'; import type { JsPlugin } from './type.js'; -export * from './js/index.js'; -export * from './rust/index.js'; +export async function resolveVitePlugins( + config: UserConfig, + mode: CompilationMode +) { + const plugins = config?.vitePlugins?.filter(Boolean) ?? []; + if (!plugins.length) return []; + + return handleVitePlugins(plugins, config, mode); +} export async function resolveFarmPlugins(config: UserConfig) { const plugins = config.plugins ?? []; @@ -23,7 +39,7 @@ export async function resolveFarmPlugins(config: UserConfig) { const jsPlugins: JsPlugin[] = []; - for (const plugin of plugins) { + for (let plugin of plugins) { if (!plugin) { continue; } @@ -36,11 +52,13 @@ export async function resolveFarmPlugins(config: UserConfig) { await rustPluginResolver(plugin as string, config.root ?? process.cwd()) ); } else if (isObject(plugin)) { - convertPlugin(plugin as unknown as JsPlugin); + // @ts-ignore + plugin = convertPlugin(plugin as unknown as JsPlugin); jsPlugins.push(plugin as unknown as JsPlugin); } else if (isArray(plugin)) { - for (const pluginNestItem of plugin as JsPlugin[]) { - convertPlugin(pluginNestItem as JsPlugin); + for (let pluginNestItem of plugin as JsPlugin[]) { + // @ts-ignore + pluginNestItem = convertPlugin(pluginNestItem as JsPlugin); jsPlugins.push(pluginNestItem as JsPlugin); } } else { @@ -75,6 +93,7 @@ export async function resolveAsyncPlugins(arr: T[]): Promise { export async function resolveConfigHook( config: UserConfig, + configEnv: ConfigEnv, plugins: JsPlugin[] ): Promise { let conf = config; @@ -91,7 +110,7 @@ export async function resolveConfigHook( for (const p of uniqueVitePlugins.values()) { if (p.config) { - const res = await p.config(conf); + const res = await p.config(conf, configEnv); if (res) { conf = merge(conf, res); @@ -141,9 +160,29 @@ export function getSortedPlugins(plugins: readonly JsPlugin[]): JsPlugin[] { return [...prePlugins, ...normalPlugins, ...postPlugins]; } +export function getPluginHooks( + plugins: JsPlugin[], + hookName: keyof JsPlugin +): any { + return plugins.map((p: JsPlugin) => p[hookName]).filter(Boolean); +} + export function getSortedPluginHooks( plugins: JsPlugin[], hookName: keyof JsPlugin ): any { + plugins = getSortedPlugins(plugins); return plugins.map((p: JsPlugin) => p[hookName]).filter(Boolean); } + +export function getSortedPluginHooksBindThis( + plugins: JsPlugin[], + hookName: keyof JsPlugin +) { + plugins = getSortedPlugins(plugins); + return plugins + .map((p: JsPlugin) => + typeof p[hookName] === 'function' ? p[hookName].bind(p) : p[hookName] + ) + .filter(Boolean); +} diff --git a/packages/core/src/plugin/js/adapter-plugins/default-load.ts b/packages/core/src/plugin/js/adapter-plugins/default-load.ts index 81d4d4f334..fee2ea1f0d 100644 --- a/packages/core/src/plugin/js/adapter-plugins/default-load.ts +++ b/packages/core/src/plugin/js/adapter-plugins/default-load.ts @@ -12,10 +12,10 @@ import { VitePluginAdapter } from '../vite-plugin-adapter.js'; export function defaultLoadPlugin(options: { filtersUnion: Set; - logger: Logger; userConfig: UserConfig; }): JsPlugin { - const { filtersUnion, logger, userConfig } = options; + const logger = new Logger(); + const { filtersUnion, userConfig } = options; const resolvedPaths = Array.from(filtersUnion).map(normalizeFilterPath); return { diff --git a/packages/core/src/plugin/js/constants.ts b/packages/core/src/plugin/js/constants.ts index b21f1d6385..3c19054c7c 100644 --- a/packages/core/src/plugin/js/constants.ts +++ b/packages/core/src/plugin/js/constants.ts @@ -36,6 +36,7 @@ export const VITE_DEFAULT_ASSETS: string[] = [ 'pdf', 'txt' ]; + // the name of the virtual module internal the adapter export const VITE_ADAPTER_VIRTUAL_MODULE: string = 'vite-adapter-virtual:'; diff --git a/packages/core/src/plugin/js/farm-to-vite-config.ts b/packages/core/src/plugin/js/farm-to-vite-config.ts index 812eab2877..64dc5f597e 100644 --- a/packages/core/src/plugin/js/farm-to-vite-config.ts +++ b/packages/core/src/plugin/js/farm-to-vite-config.ts @@ -1,3 +1,4 @@ +import { WatchOptions } from 'chokidar'; import type { UserConfig as ViteUserConfig } from 'vite'; import type { UserConfig } from '../../config/types.js'; import { Logger } from '../../index.js'; @@ -29,8 +30,6 @@ export function farmUserConfigToViteConfig(config: UserConfig): ViteUserConfig { publicDir: config.publicDir ?? 'public', mode: config.compilation?.mode, define: config.compilation?.define, - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore ignore this error command: config.compilation?.mode === 'production' ? 'build' : 'serve', resolve: { alias: config.compilation?.resolve?.alias, @@ -42,7 +41,6 @@ export function farmUserConfigToViteConfig(config: UserConfig): ViteUserConfig { }, plugins: vitePlugins, server: { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore ignore error hmr: config.server?.hmr, port: config.server?.port, @@ -51,13 +49,9 @@ export function farmUserConfigToViteConfig(config: UserConfig): ViteUserConfig { https: config.server?.https, proxy: config.server?.proxy as any, open: config.server?.open, - watch: - typeof config.server?.hmr === 'object' - ? config.server.hmr?.watchOptions ?? {} - : {} + watch: typeof config.watch === 'object' ? config.watch : {} // other options are not supported in farm }, - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore ignore this error isProduction: config.compilation?.mode === 'production', css: config.compilation?.css?._viteCssOptions ?? {}, @@ -85,6 +79,8 @@ export function farmUserConfigToViteConfig(config: UserConfig): ViteUserConfig { // TODO make it configurable cacheDir: 'node_modules/.farm/cache', envDir: config.envDir, + // @ts-ignore + env: config.env, assetsInclude: [ ...VITE_DEFAULT_ASSETS, ...(config.compilation?.assets?.include ?? []) @@ -233,6 +229,7 @@ export function proxyViteConfig( 'css', 'build', 'logger', + 'env', 'cacheDir', 'envDir', 'assetsInclude', @@ -350,19 +347,19 @@ export function viteConfigToFarmConfig( >; } else { if (!farmConfig.compilation.resolve.alias) { - farmConfig.compilation.resolve.alias = {}; + farmConfig.compilation.resolve.alias = []; } const farmRegexPrefix = '$__farm_regex:'; - for (const { find, replacement } of config.resolve.alias) { - if (find instanceof RegExp) { - const key = farmRegexPrefix + find.source; - farmConfig.compilation.resolve.alias[key] = replacement; - } else { - farmConfig.compilation.resolve.alias[find] = replacement; - } - } + // for (const { find, replacement } of config.resolve.alias) { + // if (find instanceof RegExp) { + // const key = farmRegexPrefix + find.source; + // farmConfig.compilation.resolve.alias[key] = replacement; + // } else { + // farmConfig.compilation.resolve.alias[find] = replacement; + // } + // } } } @@ -375,6 +372,7 @@ export function viteConfigToFarmConfig( if (config.server) { farmConfig.server ??= {}; + // @ts-ignore farmConfig.server.hmr = config.server.hmr; farmConfig.server.port = config.server.port; @@ -386,10 +384,13 @@ export function viteConfigToFarmConfig( farmConfig.server.hmr = { ...(typeof origFarmConfig?.server?.hmr === 'object' ? origFarmConfig.server.hmr - : {}), - watchOptions: config.server.watch + : {}) }; } + // TODO think about vite has two watch options `server.watch` | `build.watch` + if (config.mode === 'development') { + farmConfig.watch = config.server.watch; + } } if (typeof config.server.host === 'string') { @@ -406,6 +407,9 @@ export function viteConfigToFarmConfig( } if (config.build) { + if (config.mode === 'production') { + farmConfig.watch = config.build.watch as WatchOptions; + } farmConfig.compilation.output ??= {}; farmConfig.compilation.output.path = config.build.outDir; @@ -428,7 +432,6 @@ export function viteConfigToFarmConfig( const keys = ['assetFileNames', 'entryFilename', 'filename']; for (const k of keys) { - /* eslint-disable @typescript-eslint/ban-ts-comment */ // @ts-ignore type is correct farmConfig.compilation.output[k] = // @ts-ignore type is correct diff --git a/packages/core/src/plugin/js/farm-to-vite-context.ts b/packages/core/src/plugin/js/farm-to-vite-context.ts index 7edf7a77e0..0ab11ffb46 100644 --- a/packages/core/src/plugin/js/farm-to-vite-context.ts +++ b/packages/core/src/plugin/js/farm-to-vite-context.ts @@ -1,8 +1,10 @@ +import { Logger } from '../../utils/logger.js'; + import type { PluginContext } from 'rollup'; import type { UserConfig } from '../../config/types.js'; -import { Logger } from '../../utils/logger.js'; +import { normalizePath } from '../../utils/share.js'; import type { CompilationContext } from '../type.js'; -import { normalizePath, revertNormalizePath } from './utils.js'; +import { revertNormalizePath } from './utils.js'; const contextCache = new Map(); @@ -186,7 +188,6 @@ export function farmContextToViteContext( has: cacheError }, moduleIds: new Set()[Symbol.iterator](), - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore Vite specific property getCombinedSourcemap() { logger.warn( diff --git a/packages/core/src/plugin/js/index.ts b/packages/core/src/plugin/js/index.ts index dacbee298a..6f960a4697 100644 --- a/packages/core/src/plugin/js/index.ts +++ b/packages/core/src/plugin/js/index.ts @@ -1,19 +1,49 @@ +import { z } from 'zod'; + +import { fromZodError } from 'zod-validation-error'; import { CompilationMode } from '../../config/env.js'; import { type JsPlugin, - Logger, type UserConfig, normalizeDevServerConfig } from '../../index.js'; import merge from '../../utils/merge.js'; import { resolveAsyncPlugins } from '../index.js'; + import { cssPluginUnwrap, cssPluginWrap } from './adapter-plugins/css.js'; import { defaultLoadPlugin } from './adapter-plugins/default-load.js'; +import { + PluginSchemaRegistry, + createAugmentResourceHashSchema, + createBuildEndSchema, + createBuildStartSchema, + createConfigResolvedSchema, + createConfigSchema, + createConfigureCompilerSchema, + createConfigureServerSchema, + createFinalizeResourcesSchema, + createFinishSchema, + createLoadSchema, + createNameSchema, + createPluginCacheLoadedSchema, + createPrioritySchema, + createRenderResourcePotSchema, + createRenderStartSchema, + createResolveSchema, + createTransformHtmlSchema, + createTransformSchema, + createUpdateFinishedSchema, + createUpdateModulesSchema, + createWritePluginCacheSchema, + createWriteResourcesSchema +} from './js-plugin-schema.js'; + import { DEFAULT_FILTERS, normalizeFilterPath } from './utils.js'; import { VitePluginAdapter } from './vite-plugin-adapter.js'; -// export * from './jsPluginAdapter.js'; export { VitePluginAdapter } from './vite-plugin-adapter.js'; +export * from './js-plugin-schema.js'; +export * from './utils.js'; type VitePluginType = object | (() => { vitePlugin: any; filters: string[] }); type VitePluginsType = VitePluginType[]; @@ -21,7 +51,6 @@ type VitePluginsType = VitePluginType[]; export async function handleVitePlugins( vitePlugins: VitePluginsType, userConfig: UserConfig, - logger: Logger, mode: CompilationMode ): Promise { const jsPlugins: JsPlugin[] = []; @@ -30,10 +59,7 @@ export async function handleVitePlugins( if (vitePlugins.length) { userConfig = merge({}, userConfig, { compilation: userConfig.compilation, - server: normalizeDevServerConfig( - userConfig.server, - userConfig.compilation?.mode ?? mode - ) + server: normalizeDevServerConfig(userConfig) }); } const flatVitePlugins = await resolveAsyncPlugins(vitePlugins); @@ -48,7 +74,7 @@ export async function handleVitePlugins( filters = f; } filters?.forEach((filter) => filtersUnion.add(filter)); - processVitePlugin(vitePlugin, userConfig, filters, jsPlugins, logger, mode); + processVitePlugin(vitePlugin, userConfig, filters, jsPlugins, mode); } // if vitePlugins is not empty, append a load plugin to load file @@ -57,7 +83,6 @@ export async function handleVitePlugins( jsPlugins.push( defaultLoadPlugin({ filtersUnion, - logger, userConfig }) ); @@ -73,7 +98,6 @@ export function processVitePlugin( userConfig: UserConfig, filters: string[], jsPlugins: JsPlugin[], - logger: Logger, mode: CompilationMode ) { const processPlugin = (plugin: any) => { @@ -81,10 +105,10 @@ export function processVitePlugin( plugin as any, userConfig, filters, - logger, mode ); - convertPlugin(vitePluginAdapter); + // @ts-ignore + convertPluginVite(vitePluginAdapter); jsPlugins.push(vitePluginAdapter); }; @@ -95,7 +119,49 @@ export function processVitePlugin( } } -export function convertPlugin(plugin: JsPlugin): void { +const schemaRegistry = new PluginSchemaRegistry(); + +schemaRegistry + .register('name', createNameSchema) + .register('priority', createPrioritySchema) + .register('configureServer', createConfigureServerSchema) + .register('configureCompiler', createConfigureCompilerSchema) + .register('config', createConfigSchema) + .register('configResolved', createConfigResolvedSchema) + .register('buildStart', createBuildStartSchema) + .register('resolve', createResolveSchema) + .register('load', createLoadSchema) + .register('transform', createTransformSchema) + .register('buildEnd', createBuildEndSchema) + .register('renderStart', createRenderStartSchema) + .register('renderResourcePot', createRenderResourcePotSchema) + .register('augmentResourceHash', createAugmentResourceHashSchema) + .register('finalizeResources', createFinalizeResourcesSchema) + .register('transformHtml', createTransformHtmlSchema) + .register('writeResources', createWriteResourcesSchema) + .register('pluginCacheLoaded', createPluginCacheLoadedSchema) + .register('writePluginCache', createWritePluginCacheSchema) + .register('finish', createFinishSchema) + .register('updateFinished', createUpdateFinishedSchema) + .register('updateModules', createUpdateModulesSchema); + +export function convertPlugin(plugin: JsPlugin) { + try { + // TODO process module hook and freeze module hook schema + const pluginSchema = schemaRegistry.createPluginSchema(plugin?.name); + return pluginSchema.parse(plugin); + } catch (err) { + const validationError = fromZodError(err, { + prefix: 'Failed to verify js plugin schema' + }); + const pluginName = plugin?.name || 'undefined'; + throw new Error( + `${validationError.toString()}. \n Please check '${pluginName}' plugin passes these attributes correctly.` + ); + } +} + +export function convertPluginVite(plugin: JsPlugin): void { if ( plugin.transform && !plugin.transform.filters?.moduleTypes && diff --git a/packages/core/src/plugin/js/js-plugin-schema.ts b/packages/core/src/plugin/js/js-plugin-schema.ts new file mode 100644 index 0000000000..23f84f1cce --- /dev/null +++ b/packages/core/src/plugin/js/js-plugin-schema.ts @@ -0,0 +1,523 @@ +// ✨ farm js plugin schema all in zod +import { z } from 'zod'; + +import { normalizeFilterPath } from './utils.js'; + +const EmptyRecordSchema = z.any(); + +const CallbackSchema = z + .function() + .args(EmptyRecordSchema) + .returns(z.union([z.void(), z.promise(z.void())])); + +const CallbackSchemaNotArgs = z + .function() + .returns(z.union([z.void(), z.promise(z.void())])); + +const updateModulesCallbackSchema = z + .function() + .returns( + z.union([ + z.array(z.any()).optional(), + z.promise(z.array(z.any()).optional()), + z.void(), + z.promise(z.void()) + ]) + ) + .optional(); + +// name schema +export const nameSchema = z.string().min(1); + +// priority schema +export const prioritySchema = z.number().int().default(100).optional(); + +// config schema +export const configSchema = z + .function() + .args(z.record(z.string(), z.any())) + .returns( + z.union([ + z.record(z.string(), z.any()), + z.promise(z.record(z.string(), z.any())) + ]) + ) + .optional(); + +// configResolved schema +export const configResolvedSchema = z + .function() + .args(z.record(z.string(), z.any())) + .returns(z.union([z.void(), z.promise(z.void())])) + .optional(); + +export const configureServerSchema = z + .function() + .args(z.any()) + .returns(z.union([z.void(), z.promise(z.void())])) + .optional(); + +export const configureCompilerSchema = z + .function() + .args(z.any()) + .returns(z.union([z.void(), z.promise(z.void())])) + .optional(); + +export const loadFilterSchema = z + .object({ + resolvedPaths: z.array(z.string()).optional().default([]) + }) + .transform((data) => ({ + resolvedPaths: data.resolvedPaths ?? [] + })); + +export const resolveFilterSchema = z + .object({ + importers: z.array(z.string()).optional().default([]), + sources: z.array(z.string()).optional().default([]) + }) + .transform((data) => ({ + importers: data.importers ?? [], + sources: data.sources ?? [] + })); + +export const transformFilterSchema = z + .object({ + moduleTypes: z.array(z.string()).optional().default([]), + resolvedPaths: z.array(z.string()).optional().default([]) + }) + .transform((data) => ({ + moduleTypes: data.moduleTypes ?? [], + resolvedPaths: data.resolvedPaths ?? [] + })); + +export const renderResourcePotSchema = z + .object({ + resourcePotTypes: z.array(z.string()).optional().default([]), + moduleIds: z.array(z.string()).optional().default([]) + }) + .transform((data) => ({ + resourcePotTypes: data.resourcePotTypes ?? [], + moduleIds: data.moduleIds ?? [] + })); + +export const augmentResourceHashSchema = z + .object({ + resourcePotTypes: z.array(z.string()).optional().default([]), + moduleIds: z.array(z.string()).optional().default([]) + }) + .transform((data) => ({ + resourcePotTypes: data.resourcePotTypes ?? [], + moduleIds: data.moduleIds ?? [] + })); + +export const createNameSchema = (name: string) => { + return z + .string() + .min(1) + .refine( + (data) => { + return !!data; + }, + { + message: `\n 'name' of plugin '${name}' is required` + } + ); +}; + +export const createPrioritySchema = (name: string) => { + return prioritySchema.refine( + () => { + return true; + }, + { + message: `\n 'priority' of plugin '${name}' must be greater type of number` + } + ); +}; + +export const createConfigSchema = (name: string) => { + return configSchema.superRefine((data, ctx) => { + if (typeof data !== 'function') { + ctx.addIssue({ + code: z.ZodIssueCode.invalid_type, + expected: 'function', + received: typeof data, + message: `\n plugin '${name}' config hook must be a function: + - Function signature: (config: UserConfig) => UserConfig | Promise + - Purpose: Modify or extend configuration + - Parameter: Receives current user configuration + - Returns: Modified configuration or its Promise` + }); + } + }); +}; + +export const createConfigResolvedSchema = (name: string) => { + return configResolvedSchema.superRefine((data, ctx) => { + if (typeof data !== 'function') { + ctx.addIssue({ + code: z.ZodIssueCode.invalid_type, + expected: 'function', + received: typeof data, + message: `\n plugin '${name}' configResolved hook: + - Function signature: (config: ResolvedUserConfig) => void | Promise + - Purpose: Handle the resolved configuration + - Parameter: Final resolved configuration object + - Returns: void or Promise + - Note: This hook is called after all config hooks have been applied` + }); + } + }); +}; + +export const createConfigureServerSchema = (name: string) => { + return configureServerSchema.superRefine((data, ctx) => { + if (typeof data !== 'function') { + ctx.addIssue({ + code: z.ZodIssueCode.invalid_type, + expected: 'function', + received: typeof data, + message: `\n plugin '${name}' configureServer hook: + - Function signature: (server: Server) => void | Promise + - Purpose: Configure the server + - Parameter: Server instance + - Returns: void or Promise` + }); + } + }); +}; + +export const createConfigureCompilerSchema = (name: string) => { + return configureCompilerSchema.superRefine((data, ctx) => { + if (typeof data !== 'function') { + ctx.addIssue({ + code: z.ZodIssueCode.invalid_type, + expected: 'function', + received: typeof data, + message: `\n plugin '${name}' configureCompiler hook: + - Function signature: (compiler: Compiler) => void | Promise + - Purpose: Configure the compiler + - Parameter: Compiler instance + - Returns: void or Promise` + }); + } + }); +}; + +export const createBuildStartSchema = (name: string) => { + return z + .object({ + executor: CallbackSchema + }) + .refine( + (data) => { + return !!data.executor; + }, + { + message: `\n 'buildStart' hook of plugin '${name}' must have an executor function` + } + ) + .optional(); +}; + +export const createBuildEndSchema = (name: string) => { + return z + .object({ + executor: CallbackSchema + }) + .refine( + (data) => { + return !!data.executor; + }, + { + message: `\n 'buildEnd' hook of plugin '${name}' must have an executor function` + } + ) + .optional(); +}; + +export const createLoadSchema = (name: string) => { + return z.object({ + filters: loadFilterSchema + .refine( + (data) => { + return data.resolvedPaths.length > 0; + }, + { + message: `\n 'load' hook of plugin '${name}' must have at least one filter(like resolvedPaths)` + } + ) + .default({ + resolvedPaths: [] + }), + executor: z.function() + }); +}; + +export const createResolveSchema = (name: string) => { + return z.object({ + filters: resolveFilterSchema + .refine( + (data) => { + return data.importers.length > 0 || data.sources.length > 0; + }, + { + message: `\n 'resolve' hook of plugin '${name}' must have at least one filter(like importers or sources)` + } + ) + .default({ + importers: [], + sources: [] + }), + executor: z.function() + }); +}; + +export const createTransformSchema = (name: string) => { + return z + .object({ + filters: transformFilterSchema + .refine( + (data) => { + return data.moduleTypes.length > 0 || data.resolvedPaths.length > 0; + }, + { + message: `\n transform hook of plugin '${name}' must have at least one filter(like moduleTypes or resolvedPaths)` + } + ) + .default({ + moduleTypes: [], + resolvedPaths: [] + }), + executor: z.function() + }) + .transform((transform) => { + const { filters } = transform; + if (filters.resolvedPaths && filters.resolvedPaths.length > 0) { + filters.resolvedPaths = filters.resolvedPaths.map(normalizeFilterPath); + } + return { ...transform, filters }; + }); +}; + +export const createRenderStartSchema = (name: string) => { + return z + .object({ + executor: CallbackSchema + }) + .refine( + (data) => { + return !!data.executor; + }, + { + message: `\n 'renderStart' hook of plugin '${name}' must have an executor function` + } + ) + .optional(); +}; + +export const createRenderResourcePotSchema = (name: string) => { + return z + .object({ + filters: renderResourcePotSchema + .refine( + (data) => { + return ( + data.resourcePotTypes.length > 0 || data.moduleIds.length > 0 + ); + }, + { + message: `\n 'renderResourcePot' hook of plugin '${name}' must have at least one filter(like moduleIds or resourcePotTypes)` + } + ) + .default({ + resourcePotTypes: [], + moduleIds: [] + }), + executor: z.function() + }) + .transform((renderResourcePot) => { + const { filters } = renderResourcePot; + if (filters.moduleIds && filters.moduleIds.length > 0) { + filters.moduleIds = filters.moduleIds.map(normalizeFilterPath); + } + return { ...renderResourcePot, filters }; + }); +}; + +export const createAugmentResourceHashSchema = (name: string) => { + return z.object({ + filters: augmentResourceHashSchema + .refine( + (data) => { + return data.resourcePotTypes.length > 0 || data.moduleIds.length > 0; + }, + { + message: `\n 'augmentResourceHash' hook of plugin '${name}' must have at least one filter(like moduleIds or resourcePotTypes)` + } + ) + .default({ + resourcePotTypes: [], + moduleIds: [] + }), + executor: z.function() + }); +}; + +export const createFinalizeResourcesSchema = (name: string) => { + return z + .object({ + executor: z.function() + }) + .refine( + (data) => { + return !!data.executor; + }, + { + message: `\n 'finalizeResources' hook of plugin '${name}' must have an executor function` + } + ) + .optional(); +}; + +export const createTransformHtmlSchema = (name: string) => { + return z + .object({ + order: z.number().int().optional(), + executor: CallbackSchema + }) + .refine( + (data) => { + return !!data.executor; + }, + { + message: `\n 'transformHtml' hook of plugin '${name}' must have an executor function` + } + ) + .optional(); +}; + +export const createWriteResourcesSchema = (name: string) => { + return z + .object({ + executor: z.function() + }) + .refine( + (data) => { + return !!data.executor; + }, + { + message: `\n 'writeResources' hook of plugin '${name}' must have an executor function` + } + ) + .optional(); +}; + +export const createPluginCacheLoadedSchema = (name: string) => { + return z + .object({ + executor: CallbackSchema + }) + .refine( + (data) => { + return !!data.executor; + }, + { + message: `\n 'pluginCacheLoaded' hook of plugin '${name}' must have an executor function` + } + ) + .optional(); +}; + +export const createWritePluginCacheSchema = (name: string) => { + return z + .object({ + executor: CallbackSchema + }) + .refine( + (data) => { + return !!data.executor; + }, + { + message: `\n 'writePluginCache' hook of plugin '${name}' must have an executor function` + } + ) + .optional(); +}; + +export const createFinishSchema = (name: string) => { + return z + .object({ + executor: CallbackSchemaNotArgs + }) + .refine( + (data) => { + return !!data.executor; + }, + { + message: `\n 'finish' hook of plugin '${name}' must have an executor function` + } + ) + .optional(); +}; + +export const createUpdateFinishedSchema = (name: string) => { + return z + .object({ + executor: CallbackSchemaNotArgs + }) + .refine( + (data) => { + return !!data.executor; + }, + { + message: `\n 'updateFinished' hook of plugin '${name}' must have an executor function` + } + ) + .optional(); +}; + +export const createUpdateModulesSchema = (name: string) => { + return z + .object({ + executor: updateModulesCallbackSchema + }) + .refine( + (data) => { + return !!data.executor; + }, + { + message: `\n 'updateModules' hook of plugin '${name}' must have an executor function` + } + ) + .optional(); +}; + +export class PluginSchemaRegistry { + private schemas: Map z.ZodSchema> = new Map(); + + register( + hookName: string, + schemaFactory: (pluginName: string) => z.ZodSchema + ) { + this.schemas.set(hookName, schemaFactory); + return this; + } + + createPluginSchema(pluginName: string | undefined) { + const schemaShape = Object.fromEntries( + Array.from(this.schemas.entries()).map(([hookName, factory]) => [ + hookName, + hookName === 'name' + ? factory(pluginName) + : factory(pluginName).optional() + ]) + ); + return z + .object({ + ...schemaShape + }) + .strict(); + } +} diff --git a/packages/core/src/plugin/js/utils.ts b/packages/core/src/plugin/js/utils.ts index 4d7dafc3ad..c451e8fea9 100644 --- a/packages/core/src/plugin/js/utils.ts +++ b/packages/core/src/plugin/js/utils.ts @@ -1,5 +1,3 @@ -import path from 'node:path'; -// import path from 'node:path'; import * as querystring from 'node:querystring'; import fse from 'fs-extra'; import type { @@ -11,10 +9,21 @@ import type { RenderedChunk, RenderedModule } from 'rollup'; -import { Config } from '../../types/binding.js'; -import { JsResourcePotInfoData, Resource, ResourcePotInfo } from '../type.js'; + import { VITE_ADAPTER_VIRTUAL_MODULE } from './constants.js'; +import { readFile } from 'node:fs/promises'; +import { ModuleContext, ModuleNode } from '../../config/types.js'; +import type { Config } from '../../types/binding.js'; +import { normalizePath } from '../../utils/share.js'; +import type { + JsPlugin, + JsResourcePotInfoData, + Resource, + ResourcePotInfo +} from '../type.js'; +import { createModuleGraph } from './vite-server-adapter.js'; + export type WatchChangeEvents = 'create' | 'update' | 'delete'; export function convertEnforceToPriority(value: 'pre' | 'post' | undefined) { @@ -45,14 +54,6 @@ export function getContentValue(content: any): string { return encodeStr(typeof content === 'string' ? content : content!.code); } -export function isString(variable: unknown): variable is string { - return typeof variable === 'string'; -} - -export function isObject(variable: unknown): variable is object { - return typeof variable === 'object' && variable !== null; -} - export function customParseQueryString(url: string | null) { if (!url) { return []; @@ -143,13 +144,6 @@ export function normalizeAdapterVirtualModule(id: string) { return id; } -// normalize path for windows the same as Vite -export function normalizePath(p: string): string { - return path.posix.normalize( - process.platform === 'win32' ? p.replace(/\\/g, '/') : p - ); -} - export const removeQuery = (path: string) => { const queryIndex = path.indexOf('?'); if (queryIndex !== -1) { @@ -341,13 +335,11 @@ export function transformRollupResource2FarmResource( } } -// eslint-disable-next-line @typescript-eslint/no-explicit-any const notSupport: (method: string) => (...args: any[]) => any = (method) => () => { console.warn(`${method} not support`); }; -// eslint-disable-next-line @typescript-eslint/no-explicit-any const noop: (...args: any) => any = () => void 0; function transformFarmFormatToRollupFormat( @@ -474,6 +466,46 @@ export function normalizeFilterPath(path: string): string { return path; } -function compatibleWin32Path(path: string): string { +export function compatibleWin32Path(path: string): string { return path.replaceAll('/', '\\\\'); } + +export function wrapPluginUpdateModules(plugin: JsPlugin): JsPlugin { + if (!plugin.updateModules?.executor) { + return plugin; + } + const originalExecutor = plugin.updateModules.executor; + const moduleGraph = createModuleGraph(plugin.name); + + plugin.updateModules.executor = async ({ paths }, ctx) => { + moduleGraph.context = ctx; + // TODO order with sort by updateModules hooks priority + for (const [file, type] of paths) { + const mods = moduleGraph.getModulesByFile( + file + ) as unknown as ModuleNode[]; + + const filename = normalizePath(file); + const moduleContext: ModuleContext = { + file: filename, + timestamp: Date.now(), + type, + paths, + modules: (mods ?? []).map( + (m) => + ({ + ...m, + id: normalizePath(m.id), + file: normalizePath(m.file) + }) as ModuleNode + ), + read: function (): string | Promise { + return readFile(file, 'utf-8'); + } + }; + + return originalExecutor.call(plugin, moduleContext); + } + }; + return plugin; +} diff --git a/packages/core/src/plugin/js/vite-plugin-adapter.ts b/packages/core/src/plugin/js/vite-plugin-adapter.ts index 72edfd90ff..9fb8d89d50 100644 --- a/packages/core/src/plugin/js/vite-plugin-adapter.ts +++ b/packages/core/src/plugin/js/vite-plugin-adapter.ts @@ -1,5 +1,4 @@ import type { ResolvedUserConfig, UserConfig } from '../../config/types.js'; -import type { Server } from '../../server/index.js'; import { CompilationContext, CompilationContextEmitFileParams, @@ -20,11 +19,8 @@ import { formatLoadModuleType, formatTransformModuleType, getContentValue, - isObject, isStartsWithSlash, - isString, normalizeAdapterVirtualModule, - normalizePath, removeQuery, revertNormalizePath, transformFarmConfigToRollupNormalizedOutputOptions, @@ -53,7 +49,13 @@ import type { } from 'rollup'; import { VIRTUAL_FARM_DYNAMIC_IMPORT_SUFFIX } from '../../compiler/index.js'; import { CompilationMode } from '../../config/env.js'; -import { Logger } from '../../index.js'; +import { + Logger, + Server, + isObject, + isString, + normalizePath +} from '../../index.js'; import { Config, PluginLoadHookParam, @@ -124,7 +126,6 @@ export class VitePluginAdapter implements JsPlugin { rawPlugin: Plugin, farmConfig: UserConfig, filters: string[], - logger: Logger, mode: CompilationMode ) { this.name = rawPlugin.name || `vite-plugin-adapted-${Date.now()}`; @@ -138,7 +139,8 @@ export class VitePluginAdapter implements JsPlugin { this._rawPlugin = rawPlugin; this._farmConfig = farmConfig; this._viteConfig = farmUserConfigToViteConfig(farmConfig); - this._logger = logger; + + this._logger = new Logger(); this.filters = filters; @@ -149,7 +151,6 @@ export class VitePluginAdapter implements JsPlugin { load: () => (this.load = this.viteLoadToFarmLoad()), transform: () => (this.transform = this.viteTransformToFarmTransform()), buildEnd: () => (this.buildEnd = this.viteBuildEndToFarmBuildEnd()), - // closeBundle: () => (this.finish = this.viteCloseBundleToFarmFinish()), handleHotUpdate: () => (this.updateModules = this.viteHandleHotUpdateToFarmUpdateModules()), renderChunk: () => @@ -270,7 +271,7 @@ export class VitePluginAdapter implements JsPlugin { } } - async configureDevServer(devServer: Server) { + async configureServer(server: Server) { const hook = this.wrapRawPluginHook( 'configureServer', this._rawPlugin.configureServer @@ -279,24 +280,11 @@ export class VitePluginAdapter implements JsPlugin { this._viteDevServer = createViteDevServerAdapter( this.name, this._viteConfig, - devServer + server ); if (hook) { - await hook(this._viteDevServer); - this._viteDevServer.middlewareCallbacks.forEach((cb) => { - devServer.app().use((ctx, koaNext) => { - return new Promise((resolve, reject) => { - // koaNext is async, but vite's next is sync, we need a adapter here - const next = (err: Error) => { - if (err) reject(err); - koaNext().then(resolve); - }; - - return cb(ctx.req, ctx.res, next); - }); - }); - }); + return await hook(this._viteDevServer); } } @@ -445,7 +433,7 @@ export class VitePluginAdapter implements JsPlugin { }; } else if (isObject(resolveIdResult)) { const resolveId = normalizeAdapterVirtualModule( - resolveIdResult?.id + resolveIdResult?.id as any ); return { resolvedPath: removeQuery(encodeStr(resolveId)), @@ -453,7 +441,7 @@ export class VitePluginAdapter implements JsPlugin { sideEffects: Boolean(resolveIdResult?.moduleSideEffects), // TODO support relative and absolute external external: Boolean(resolveIdResult?.external), - meta: resolveIdResult.meta ?? {} + meta: resolveIdResult.meta ?? ({} as any) }; } @@ -639,6 +627,7 @@ export class VitePluginAdapter implements JsPlugin { const mods = moduleGraph.getModulesByFile( file ) as unknown as ModuleNode[]; + const filename = normalizePath(file); const ctx: HmrContext = { file: filename, @@ -656,6 +645,7 @@ export class VitePluginAdapter implements JsPlugin { }, server: this._viteDevServer as unknown as ViteDevServer }; + const updateMods: ModuleNode[] = await hook?.(ctx); if (updateMods) { @@ -836,7 +826,6 @@ export class VitePluginAdapter implements JsPlugin { const { htmlResource } = params; const hook = this.wrapRawPluginHook( 'transformIndexHtml', - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore ignore type error this._rawPlugin.transformIndexHtml, context diff --git a/packages/core/src/plugin/js/vite-server-adapter.ts b/packages/core/src/plugin/js/vite-server-adapter.ts index 1e7c0a1fae..8de8f24591 100644 --- a/packages/core/src/plugin/js/vite-server-adapter.ts +++ b/packages/core/src/plugin/js/vite-server-adapter.ts @@ -1,67 +1,42 @@ -// import { watch } from 'chokidar'; -import { FSWatcher } from 'chokidar'; -import { Server } from '../../index.js'; -import { Server as httpServer } from '../../server/type.js'; -import WsServer from '../../server/ws.js'; import { CompilationContext, ViteModule } from '../type.js'; import { throwIncompatibleError } from './utils.js'; +// TODO type error refactor vite adaptor export class ViteDevServerAdapter { - moduleGraph: ViteModuleGraphAdapter; - config: any; - pluginName: string; - watcher: FSWatcher; - middlewares: any; - middlewareCallbacks: any[]; - ws: WsServer; - httpServer: httpServer; - - constructor(pluginName: string, config: any, server: Server) { - this.moduleGraph = createViteModuleGraphAdapter(pluginName); - this.config = config; - this.pluginName = pluginName; - // watcher is not used in Farm vite plugin for now - // it's only for compatibility - // this.watcher = watch(config.root); - this.watcher = server.watcher.getInternalWatcher(); - this.middlewareCallbacks = []; - this.middlewares = new Proxy( - { - use: (...args: any[]) => { - if ( - args.length === 2 && - typeof args[0] === 'string' && - typeof args[1] === 'function' - ) { - this.middlewareCallbacks.push((req: any, res: any, next: any) => { - const [url, cb] = args; - if (req.url.startsWith(url)) { - cb(req, res, next); - } - }); - } else if (args.length === 1 && typeof args[0] === 'function') { - this.middlewareCallbacks.push(args[0]); + private _server: any; + private _config: any; + private _moduleGraphAdapter: any; + [key: string]: any; + [key: symbol]: any; + constructor(pluginName: string, config: any, server: any) { + this._server = server; + this._config = config; + this._moduleGraphAdapter = createViteModuleGraphAdapter(pluginName); + + return new Proxy(this, { + get: (_target, prop) => { + switch (prop) { + case 'moduleGraph': + return this._moduleGraphAdapter; + case 'watcher': + return this._server.watcher.getInternalWatcher(); + case 'middlewares': + return this._server.middlewares; + case 'config': + return this._config; + default: { + const value = this._server[prop]; + return typeof value === 'function' + ? value.bind(this._server) + : value; } } }, - { - get(target, key) { - if (key === 'use') { - return target[key as keyof typeof target]; - } - - throwIncompatibleError( - pluginName, - 'viteDevServer.middlewares', - ['use'], - key - ); - } + set: (_target, prop, value) => { + this._server[prop] = value; + return true; } - ); - - this.ws = server.ws; - this.httpServer = server.server; + }); } } @@ -107,7 +82,11 @@ export class ViteModuleGraphAdapter { } } -function proxyViteModuleNode( +export function createModuleGraph(pluginName: string) { + return new ViteModuleGraphAdapter(pluginName); +} + +export function proxyViteModuleNode( node: ViteModule, pluginName: string, context: CompilationContext @@ -134,7 +113,7 @@ function proxyViteModuleNode( export function createViteDevServerAdapter( pluginName: string, config: any, - server: Server + server: any ) { const proxy = new Proxy( new ViteDevServerAdapter(pluginName, config, server), @@ -146,6 +125,9 @@ export function createViteDevServerAdapter( 'prototype' ]; const allowedKeys = [ + 'serverOptions', + 'resolvedUrls', + 'printUrls', 'moduleGraph', 'config', 'watcher', diff --git a/packages/core/src/plugin/rust/rustPluginResolver.ts b/packages/core/src/plugin/rust/rustPluginResolver.ts index 3e6124ffe2..c81fc18c9c 100644 --- a/packages/core/src/plugin/rust/rustPluginResolver.ts +++ b/packages/core/src/plugin/rust/rustPluginResolver.ts @@ -47,7 +47,6 @@ export async function rustPluginResolver( } else { pluginPath = await import(pluginPath).then((m) => m.default); } - // console.log(pluginPath); // Calling the plugin as a function if (typeof pluginPath === 'function') { diff --git a/packages/core/src/plugin/type.ts b/packages/core/src/plugin/type.ts index ad1c619266..ca20c2889d 100644 --- a/packages/core/src/plugin/type.ts +++ b/packages/core/src/plugin/type.ts @@ -1,4 +1,12 @@ -import { Compiler, ResolvedUserConfig, Server, UserConfig } from '../index.js'; +import { + Compiler, + ConfigEnv, + ModuleContext, + ResolvedUserConfig, + Server, + UserConfig +} from '../index.js'; + import { Config, ModuleType, @@ -11,7 +19,6 @@ import { } from '../types/binding.js'; // https://stackoverflow.com/questions/61047551/typescript-union-of-string-and-string-literals -// eslint-disable-next-line @typescript-eslint/ban-types export type LiteralUnion = T | (string & {}); type ResourcePotType = LiteralUnion< @@ -137,6 +144,7 @@ export interface PluginProcessModuleParams { export interface PluginProcessModuleResult { content: string; + sourceMap?: string; } type NormalizeFilterParams = { @@ -148,7 +156,10 @@ export interface JsPlugin { name: string; priority?: number; - config?: (config: UserConfig) => UserConfig | Promise; + config?: ( + config: UserConfig, + configEnv: ConfigEnv + ) => UserConfig | Promise; configResolved?: (config: ResolvedUserConfig) => void | Promise; @@ -157,7 +168,7 @@ export interface JsPlugin { * @param server * @returns */ - configureDevServer?: (server: Server) => void | Promise; + configureServer?: (server: Server) => void | Promise; /** * @param compiler * @returns @@ -248,10 +259,7 @@ export interface JsPlugin { updateFinished?: { executor: Callback, void> }; updateModules?: { - executor: Callback< - { paths: [string, string][] }, - string[] | undefined | null | void - >; + executor: Callback; }; } diff --git a/packages/core/src/server/error.ts b/packages/core/src/server/error.ts index 467f338eca..c3350415f4 100644 --- a/packages/core/src/server/error.ts +++ b/packages/core/src/server/error.ts @@ -1,7 +1,6 @@ import type { RollupError } from 'rollup'; import { colors } from '../utils/color.js'; import { pad } from '../utils/share.js'; -// import { DevServer } from './index.js'; export function prepareError(err: Error & { potentialSolution?: string }) { return { @@ -17,7 +16,6 @@ export function prepareError(err: Error & { potentialSolution?: string }) { } export function stripAnsi(str: string) { - // eslint-disable-next-line no-control-regex return str.replace(/\x1b\[[0-9;]*m/g, ''); } @@ -85,11 +83,3 @@ export function logError(err: Error, throwErrorFlag = true) { } return errorMessage; } - -// TODO server logger e.g: DevServer.logger.error(msg); - -// server.ws.send({ -// type: 'error', -// err: prepareError(err) -// }); -// } diff --git a/packages/core/src/server/hmr-engine.ts b/packages/core/src/server/hmr-engine.ts index 7234a32ced..616c94a767 100644 --- a/packages/core/src/server/hmr-engine.ts +++ b/packages/core/src/server/hmr-engine.ts @@ -1,41 +1,22 @@ import fse from 'fs-extra'; -// queue all updates and compile them one by one import { stat } from 'node:fs/promises'; import { isAbsolute, relative } from 'node:path'; -import { Compiler } from '../compiler/index.js'; -import { checkClearScreen } from '../config/index.js'; +import type { Resource } from '@farmfe/runtime'; +import { HmrOptions } from '../config/index.js'; import type { JsUpdateResult } from '../types/binding.js'; -import { - Logger, - bold, - cyan, - getDynamicResources, - green -} from '../utils/index.js'; -import { logError } from './error.js'; -import { Server } from './index.js'; +import { convertErrorMessage } from '../utils/error.js'; +import { bold, cyan, green } from '../utils/index.js'; import { WebSocketClient } from './ws.js'; export class HmrEngine { private _updateQueue: string[] = []; - // private _updateResults: Map = - private _compiler: Compiler; - private _devServer: Server; private _onUpdates: ((result: JsUpdateResult) => void)[]; private _lastModifiedTimestamp: Map; - - constructor( - compiler: Compiler, - devServer: Server, - private _logger: Logger - ) { - this._compiler = compiler; - this._devServer = devServer; - // this._lastAttemptWasError = false; + constructor(private readonly app: any) { this._lastModifiedTimestamp = new Map(); } @@ -56,17 +37,17 @@ export class HmrEngine { if (queue.length === 0) { return; } - + const logger = this.app.logger; let updatedFilesStr = queue .map((item) => { if (isAbsolute(item)) { - return relative(this._compiler.config.config.root, item); + return relative(this.app.compiler.config.root, item); } else { - const resolvedPath = this._compiler.transformModulePath( - this._compiler.config.config.root, + const resolvedPath = this.app.compiler.transformModulePath( + this.app.compiler.config.root, item ); - return relative(this._compiler.config.config.root, resolvedPath); + return relative(this.app.compiler.config.root, resolvedPath); } }) .join(', '); @@ -75,75 +56,89 @@ export class HmrEngine { updatedFilesStr.slice(0, 100) + `...(${queue.length} files)`; } - try { - // we must add callback before update - this._compiler.onUpdateFinish(async () => { - // if there are more updates, recompile again - if (this._updateQueue.length > 0) { - await this.recompileAndSendResult(); - } - if (this._devServer?.config?.writeToDisk) { - this._compiler.writeResourcesToDisk(); + // try { + // we must add callback before update + this.app.compiler.onUpdateFinish(async () => { + // if there are more updates, recompile again + if (this._updateQueue.length > 0) { + await this.recompileAndSendResult(); + } + if (this.app.config?.server.writeToDisk) { + this.app.compiler.writeResourcesToDisk(); + } + }); + + const start = performance.now(); + + const result = await this.app.compiler.update(queue); + + logger.info( + `${bold(cyan(updatedFilesStr))} updated in ${bold(green(logger.formatTime(performance.now() - start)))}` + ); + + // clear update queue after update finished + this._updateQueue = this._updateQueue.filter( + (item) => !queue.includes(item) + ); + + let dynamicResourcesMap: Record = null; + + if (result.dynamicResourcesMap) { + for (const [key, value] of Object.entries(result.dynamicResourcesMap)) { + if (!dynamicResourcesMap) { + dynamicResourcesMap = {} as Record; } - }); - - checkClearScreen(this._compiler.config.config); - const start = Date.now(); - const result = await this._compiler.update(queue); - this._logger.info( - `${bold(cyan(updatedFilesStr))} updated in ${bold( - green(`${Date.now() - start}ms`) - )}` - ); - - // clear update queue after update finished - this._updateQueue = this._updateQueue.filter( - (item) => !queue.includes(item) - ); - - const { dynamicResources, dynamicModuleResourcesMap } = - getDynamicResources(result.dynamicResourcesMap); - - const { - added, - changed, - removed, - immutableModules, - mutableModules, - boundaries - } = result; - const resultStr = `{ + + // @ts-ignore + dynamicResourcesMap[key] = value.map((r) => ({ + path: r[0], + type: r[1] as 'script' | 'link' + })); + } + } + const { + added, + changed, + removed, + immutableModules, + mutableModules, + boundaries + } = result; + const resultStr = `{ added: [${formatHmrResult(added)}], changed: [${formatHmrResult(changed)}], removed: [${formatHmrResult(removed)}], immutableModules: ${JSON.stringify(immutableModules.trim())}, mutableModules: ${JSON.stringify(mutableModules.trim())}, boundaries: ${JSON.stringify(boundaries)}, - dynamicResources: ${JSON.stringify(dynamicResources)}, - dynamicModuleResourcesMap: ${JSON.stringify(dynamicModuleResourcesMap)} + dynamicResourcesMap: ${JSON.stringify(dynamicResourcesMap)} }`; - this.callUpdates(result); + this.callUpdates(result); - this._devServer.ws.clients.forEach((client: WebSocketClient) => { - client.rawSend(` + this.app.ws.wss.clients.forEach((client: WebSocketClient) => { + client.send(` { type: 'farm-update', result: ${resultStr} } `); - }); - } catch (err) { - checkClearScreen(this._compiler.config.config); - throw new Error(logError(err) as unknown as string); - } + }); + // TODO optimize this part + // } catch (err) { + // checkClearScreen(this.app.compiler.config.config); + // this.app.logger.error(convertErrorMessage(err)); + + // } }; async hmrUpdate(absPath: string | string[], force = false) { const paths = Array.isArray(absPath) ? absPath : [absPath]; - for (const path of paths) { - if (this._compiler.hasModule(path) && !this._updateQueue.includes(path)) { + if ( + this.app.compiler.hasModule(path) && + !this._updateQueue.includes(path) + ) { if (fse.existsSync(path)) { const lastModifiedTimestamp = this._lastModifiedTimestamp.get(path); const currentTimestamp = (await stat(path)).mtime.toISOString(); @@ -158,25 +153,29 @@ export class HmrEngine { } } - if (!this._compiler.compiling && this._updateQueue.length > 0) { + if (!this.app.compiler.compiling && this._updateQueue.length > 0) { try { await this.recompileAndSendResult(); } catch (e) { - // eslint-disable-next-line no-control-regex const serialization = e.message.replace(/\x1b\[[0-9;]*m/g, ''); const errorStr = `${JSON.stringify({ message: serialization })}`; - this._devServer.ws.clients.forEach((client: WebSocketClient) => { - client.rawSend(` + + this.app.ws.wss.clients.forEach((client: WebSocketClient) => { + // @ts-ignore + // client.rawSend(` + client.send(` { type: 'error', err: ${errorStr}, - overlay: ${this._devServer.config.hmr.overlay} + overlay: ${(this.app.config.server.hmr as HmrOptions).overlay} } `); }); - this._logger.error(e); + + this.app.logger.error(convertErrorMessage(e), true); + // throw new Error(`hmr update failed: ${e.stack}`); } } } diff --git a/packages/core/src/server/http.ts b/packages/core/src/server/http.ts new file mode 100644 index 0000000000..0ae5de31d3 --- /dev/null +++ b/packages/core/src/server/http.ts @@ -0,0 +1,151 @@ +/** + * The following is modified based on source found in + * https://github.com/vitejs/vite/blob/main/packages/vite/src/node/env.ts + * + * MIT License + * Copyright (c) 2019-present, Yuxi (Evan) + * https://github.com/vitejs/vite/blob/main/LICENSE + * + * Farm draws on the code of part of the vite server in order to better achieve the compatibility + * progress of the vite ecosystem and the integrity of vite's ecological development, + * which can reduce many unknown or known problems. + */ + +import type { OutgoingHttpHeaders as HttpServerHeaders } from 'node:http'; +import type { ServerOptions as HttpsServerOptions } from 'node:https'; +import connect from 'connect'; +import { readFileIfExists } from '../utils/fsUtils.js'; +import { Logger } from '../utils/logger.js'; +import { HttpServer } from './index.js'; +import { ProxyOptions } from './middlewares/proxy.js'; + +export interface CommonServerOptions { + port?: number; + strictPort?: boolean; + host?: string | boolean; + https?: HttpsServerOptions; + open?: boolean | string; + proxy?: Record; + cors?: CorsOptions | boolean; + headers?: HttpServerHeaders; +} + +export type CorsOrigin = boolean | string | RegExp | (string | RegExp)[]; + +export interface CorsOptions { + origin?: + | CorsOrigin + | ((origin: string, cb: (err: Error, origins: CorsOrigin) => void) => void); + methods?: string | string[]; + allowedHeaders?: string | string[]; + exposedHeaders?: string | string[]; + credentials?: boolean; + maxAge?: number; + preflightContinue?: boolean; + optionsSuccessStatus?: number; +} + +export interface ResolvedServerUrls { + local: string[]; + network: string[]; +} + +// For the unencrypted tls protocol, we use http service. +// In other cases, https / http2 is used. +export class httpServer { + public logger: Logger; + protected httpServer: HttpServer | null = null; + protected resolvedUrls: ResolvedServerUrls | null = null; + constructor() {} + + protected async resolveHttpServer( + { proxy }: CommonServerOptions, + app: connect.Server, + httpsOptions?: HttpsServerOptions + ): Promise { + if (!httpsOptions) { + const { createServer } = await import('node:http'); + return createServer(app); + } + + // EXISTING PROBLEM: + // https://github.com/http-party/node-http-proxy/issues/1237 + + // MAYBE SOLUTION: + // https://github.com/nxtedition/node-http2-proxy + // https://github.com/fastify/fastify-http-proxy + + if (proxy) { + const { createServer } = await import('node:https'); + return createServer(httpsOptions, app); + } else { + const { createSecureServer } = await import('node:http2'); + return createSecureServer( + { + maxSessionMemory: 1000, + ...httpsOptions, + allowHTTP1: true + }, + // @ts-ignore + app + ); + } + } + + protected async resolveHttpsConfig( + https: HttpsServerOptions | undefined + ): Promise { + if (!https) return undefined; + + const [ca, cert, key, pfx] = await Promise.all([ + readFileIfExists(https.ca), + readFileIfExists(https.cert), + readFileIfExists(https.key), + readFileIfExists(https.pfx) + ]); + return { ...https, ca, cert, key, pfx }; + } + + /** + * Starts the HTTP server. + * @protected + * @param {Object} serverOptions - The server options. + * @returns {Promise} The port the server is listening on. + * @throws {Error} If the server fails to start. + */ + protected async httpServerStart(serverOptions: { + port: number; + strictPort: boolean | undefined; + host: string | undefined; + }): Promise { + if (!this.httpServer) { + throw new Error('httpServer is not initialized'); + } + + let { port, strictPort, host } = serverOptions; + + return new Promise((resolve, reject) => { + const onError = (e: Error & { code?: string }) => { + if (e.code === 'EADDRINUSE') { + if (strictPort) { + this.httpServer.removeListener('error', onError); + reject(new Error(`Port ${port} is already in use`)); + } else { + this.logger.warn(`Port ${port} is in use, trying another one...`); + this.httpServer.listen(++port, host); + } + } else { + this.httpServer.removeListener('error', onError); + reject(e); + } + }; + + this.httpServer.on('error', onError); + + this.httpServer.listen(port, host, () => { + this.httpServer.removeListener('error', onError); + resolve(port); + }); + }); + } +} diff --git a/packages/core/src/server/index.ts b/packages/core/src/server/index.ts index 0a2a1d3604..2461f18bc1 100644 --- a/packages/core/src/server/index.ts +++ b/packages/core/src/server/index.ts @@ -1,436 +1,743 @@ -import http from 'node:http'; -import http2 from 'node:http2'; -import * as httpsServer from 'node:https'; -import Koa from 'koa'; -import compression from 'koa-compress'; - -import path from 'node:path'; -import { promisify } from 'node:util'; +export * from './preview.js'; + +import fs, { PathLike } from 'node:fs'; +import connect from 'connect'; +import corsMiddleware from 'cors'; + import { Compiler } from '../compiler/index.js'; +import { bold, colors, getShortName, green, resolveConfig } from '../index.js'; +import Watcher from '../watcher/index.js'; +import { HmrEngine } from './hmr-engine.js'; +import { httpServer } from './http.js'; +import { openBrowser } from './open.js'; +import { WsServer } from './ws.js'; + import { __FARM_GLOBAL__ } from '../config/_global.js'; import { - DEFAULT_HMR_OPTIONS, - DevServerMiddleware, - NormalizedServerConfig, - UserPreviewServerConfig, - UserServerConfig, - normalizePublicDir -} from '../config/index.js'; -import { - getValidPublicPath, - normalizePublicPath -} from '../config/normalize-config/normalize-output.js'; -import { resolveHostname, resolveServerUrls } from '../utils/http.js'; + getPluginHooks, + getSortedPluginHooksBindThis +} from '../plugin/index.js'; +import { isCacheDirExists } from '../utils/cacheDir.js'; +import { createDebugger } from '../utils/debug.js'; import { - Logger, - bootstrap, - clearScreen, - normalizeBasePath, - printServerUrls -} from '../utils/index.js'; -import { FileWatcher } from '../watcher/index.js'; -import { logError } from './error.js'; -import { HmrEngine } from './hmr-engine.js'; -import { hmrPing } from './middlewares/hmrPing.js'; + resolveServerUrls, + setupSIGTERMListener, + teardownSIGTERMListener +} from '../utils/http.js'; +import { Logger, bootstrap, printServerUrls } from '../utils/logger.js'; +import { initPublicFiles } from '../utils/publicDir.js'; +import { arrayEqual, isObject, normalizePath } from '../utils/share.js'; + import { - cors, - headers, - lazyCompilation, - proxy, - resources, + hmrPingMiddleware, + htmlFallbackMiddleware, + lazyCompilationMiddleware, + notFoundMiddleware, + outputFilesMiddleware, + proxyMiddleware, + publicMiddleware, + publicPathMiddleware, + resourceDiskMiddleware, + resourceMiddleware, staticMiddleware } from './middlewares/index.js'; -import { openBrowser } from './open.js'; -import { Server as httpServer } from './type.js'; -import WsServer from './ws.js'; -/** - * Farm Dev Server, responsible for: - * * parse and normalize dev server options - * * launch http server based on options - * * compile the project in dev mode and serve the production - * * HMR middleware and websocket supported - */ -interface ServerUrls { - local: string[]; - network: string[]; -} +import type * as http from 'node:http'; +import type { + Server as HttpBaseServer, + ServerOptions as HttpsServerOptions +} from 'node:http'; +import type { Http2SecureServer } from 'node:http2'; +import type * as net from 'node:net'; + +import { createCompiler } from '../compiler/index.js'; +import type { + FarmCliOptions, + HmrOptions, + NormalizedServerConfig, + ResolvedUserConfig, + UserConfig +} from '../config/types.js'; +import type { + JsUpdateResult, + PersistentCacheConfig +} from '../types/binding.js'; +import { convertErrorMessage } from '../utils/error.js'; +import type { CommonServerOptions, ResolvedServerUrls } from './http.js'; -type ErrorMap = { - EACCES: string; - EADDRNOTAVAIL: string; -}; - -interface ImplDevServer { - createServer(options: UserServerConfig): void; - createDevServer(options: UserServerConfig): void; - createPreviewServer(options: UserServerConfig): void; - listen(): Promise; - close(): Promise; - getCompiler(): Compiler; +export type HttpServer = HttpBaseServer | Http2SecureServer; + +type CompilerType = Compiler | undefined; + +export interface ServerOptions extends CommonServerOptions { + /** + * Configure HMR-specific options (port, host, path & protocol) + */ + hmr?: HmrOptions | boolean; + /** + * Do not start the websocket connection. + */ + ws?: false; + /** + * Create dev server to be used as a middleware in an existing server + * @default false + */ + middlewareMode?: + | boolean + | { + /** + * Parent server instance to attach to + * + * This is needed to proxy WebSocket connections to the parent server. + */ + server: http.Server; + }; + appType?: 'spa' | 'mpa' | 'custom'; + /** + * Origin for the generated asset URLs. + */ + origin?: string; } -export class Server implements ImplDevServer { - private _app: Koa; - private restart_promise: Promise | null = null; - private compiler: Compiler | null; - public logger: Logger; +type ServerConfig = CommonServerOptions & NormalizedServerConfig; + +export const debugServer = createDebugger('farm:server'); + +export function noop() { + // noop +} +/** + * Represents a Farm development server. + * @class + */ +export class Server extends httpServer { ws: WsServer; - config: NormalizedServerConfig & UserPreviewServerConfig; - hmrEngine?: HmrEngine; - server?: httpServer; - publicDir?: string; + serverOptions: ServerConfig; + httpsOptions: HttpsServerOptions; + publicDir: string | undefined; publicPath?: string; - resolvedUrls?: ServerUrls; - watcher: FileWatcher; - - constructor({ - compiler = null, - logger - }: { - compiler?: Compiler | null; - logger: Logger; - }) { - this.compiler = compiler; - this.logger = logger ?? new Logger(); + publicFiles?: Set; + httpServer: HttpServer; + watcher: Watcher; + hmrEngine?: HmrEngine; + middlewares: connect.Server; + compiler: CompilerType; + root: string; + config: ResolvedUserConfig; + closeHttpServerFn: () => Promise; + terminateServerFn: (_: unknown, exitCode?: number) => Promise; + postConfigureServerHooks: ((() => void) | void)[] = []; + logger: Logger; - this.initializeKoaServer(); + /** + * Creates an instance of Server. + * @param {FarmCliOptions & UserConfig} inlineConfig - The inline configuration options. + */ + constructor(readonly inlineConfig: FarmCliOptions & UserConfig) { + super(); + this.logger = new Logger(); + } - if (!compiler) return; + /** + * Creates and initializes the server. + * + * This method performs the following operations: + * Resolves HTTPS configuration + * Handles public files + * Creates middleware + * Creates HTTP server (if not in middleware mode) + * Initializes HMR engine + * Creates WebSocket server + * Sets up Vite invalidation handler + * Initializes middlewares + * + * @returns {Promise} A promise that resolves when the server creation process is complete + * @throws {Error} If an error occurs during the server creation process + */ + async createServer(): Promise { + try { + this.config = await resolveConfig( + this.inlineConfig, + 'dev', + 'development', + 'development' + ); - this.publicDir = normalizePublicDir(compiler?.config.config.root); + this.logger = this.config.logger; - this.publicPath = - normalizePublicPath( - compiler.config.config.output.targetEnv, - compiler.config.config.output.publicPath, - logger, - false - ) || '/'; - } + this.#resolveOptions(); - getCompiler(): Compiler { - return this.compiler; - } + this.compiler = createCompiler(this.config); - app(): Koa { - return this._app; - } + for (const hook of getPluginHooks( + this.config.jsPlugins, + 'configureCompiler' + )) { + await hook?.(this.compiler); + } - async listen(): Promise { - if (!this.server) { - this.logger.error('HTTP server is not created yet'); - return; + const [httpsOptions, publicFiles] = await Promise.all([ + this.resolveHttpsConfig(this.serverOptions.https), + this.#handlePublicFiles() + ]); + this.httpsOptions = httpsOptions; + this.publicFiles = publicFiles; + this.middlewares = connect() as connect.Server; + this.httpServer = this.serverOptions.middlewareMode + ? null + : await this.resolveHttpServer( + this.serverOptions as CommonServerOptions, + this.middlewares, + this.httpsOptions + ); + + // close server function prepare promise + this.closeHttpServerFn = this.closeServer(); + + // init hmr engine When actually updating, we need to get the clients of ws for broadcast, 、 + // so we can instantiate hmrEngine by default at the beginning. + this.createHmrEngine(); + + // init websocket server + this.createWebSocketServer(); + + // invalidate vite handler + this.#invalidateVite(); + + // init watcher + await this.#createWatcher(); + + await this.handleConfigureServer(); + + // init middlewares + this.#initializeMiddlewares(); + + this.terminateServerFn = async (_: unknown, exitCode?: number) => { + try { + await this.close(); + } finally { + process.exitCode ??= exitCode ? 128 + exitCode : undefined; + process.exit(); + } + }; + + if (!this.serverOptions.middlewareMode) { + setupSIGTERMListener(this.terminateServerFn); + } + + if (!this.serverOptions.middlewareMode && this.httpServer) { + this.httpServer.once('listening', () => { + // update actual port since this may be different from initial value + this.serverOptions.port = ( + this.httpServer.address() as net.AddressInfo + ).port; + }); + } + } catch (error) { + // this.logger.error( + // `Failed to create farm server: ${error}` + // ); + throw error; } - const { port, open, protocol, hostname } = this.config; + } - const start = Date.now(); - // compile the project and start the dev server - await this.compile(); + /** + * create watcher + */ + async #createWatcher() { + this.watcher = new Watcher(this.config); - // watch extra files after compile - this.watcher?.watchExtraFiles?.(); + await this.watcher.createWatcher(); - bootstrap(Date.now() - start, this.compiler.config); + this.watcher.on('add', async (file: string) => { + // TODO pluginContainer hooks + }); - await this.startServer(this.config); + this.watcher.on('unlink', async (file: string) => { + // Fix #2035, skip if the file is irrelevant + if (!this.compiler.hasModule(file)) return; - !__FARM_GLOBAL__.__FARM_RESTART_DEV_SERVER__ && - (await this.displayServerUrls()); + const parentFiles = this.compiler.getParentFiles(file); + const normalizeParentFiles = parentFiles.map((file) => + normalizePath(file) + ); + this.hmrEngine.hmrUpdate(normalizeParentFiles, true); + }); - if (open) { - let publicPath = getValidPublicPath(this.publicPath) || '/'; + this.watcher.on('change', async (file: string) => { + file = normalizePath(file); + const shortFile = getShortName(file, this.config.root); + const isConfigFile = this.config.configFilePath === file; + const isConfigDependencyFile = this.config.configFileDependencies.some( + (name) => file === name + ); + const isEnvFile = this.config.envFiles.some((name) => file === name); + if (isConfigFile || isConfigDependencyFile || isEnvFile) { + __FARM_GLOBAL__.__FARM_RESTART_DEV_SERVER__ = true; + this.logger.info( + `${bold(green(shortFile))} changed, Server is being restarted`, + true + ); + debugServer?.(`[config change] ${colors.dim(file)}`); + try { + await this.restartServer(); + } catch (e) { + this.config.logger.error(`restart server error ${e}`); + } + } + try { + this.hmrEngine.hmrUpdate(file); + } catch (error) { + this.config.logger.error(`Farm Hmr Update Error: ${error}`); + } + }); + const handleUpdateFinish = (updateResult: JsUpdateResult) => { + const added = [ + ...updateResult.added, + ...updateResult.extraWatchResult.add + ].map((addedModule) => { + const resolvedPath = this.compiler.transformModulePath( + this.root, + addedModule + ); + return resolvedPath; + }); + const filteredAdded = added.filter((file) => + this.watcher.filterWatchFile(file, this.root) + ); - const serverUrl = `${protocol}://${hostname.name}:${port}${publicPath}`; - openBrowser(serverUrl); - } + if (filteredAdded.length > 0) { + this.watcher.add(filteredAdded); + } + }; + + this.hmrEngine?.onUpdateFinish(handleUpdateFinish); } - private async compile(): Promise { - try { - await this.compiler.compile(); - } catch (err) { - throw new Error(logError(err) as unknown as string); + /** + * Restarts the server. + * @returns {Promise} + */ + async restartServer(): Promise { + if (this.serverOptions.middlewareMode) { + await this.restart(); + return; } - - if (this.config.writeToDisk) { - this.compiler.writeResourcesToDisk(); + const { port: prevPort, host: prevHost } = this.serverOptions; + const prevUrls = this.resolvedUrls; + + const newServer = await this.restart(); + const { + serverOptions: { port, host }, + resolvedUrls + } = newServer; + + if ( + port !== prevPort || + host !== prevHost || + this.hasUrlsChanged(prevUrls, resolvedUrls) + ) { + __FARM_GLOBAL__.__FARM_SHOW_DEV_SERVER_URL__ = true; } else { - this.compiler.callWriteResourcesHook(); + __FARM_GLOBAL__.__FARM_SHOW_DEV_SERVER_URL__ = false; } + + newServer.printUrls(); + } + + /** + * Checks if the server URLs have changed. + * @param {ResolvedServerUrls} oldUrls - The old server URLs. + * @param {ResolvedServerUrls} newUrls - The new server URLs. + * @returns {boolean} True if the URLs have changed, false otherwise. + */ + hasUrlsChanged(oldUrls: ResolvedServerUrls, newUrls: ResolvedServerUrls) { + return !( + oldUrls === newUrls || + (oldUrls && + newUrls && + arrayEqual(oldUrls.local, newUrls.local) && + arrayEqual(oldUrls.network, newUrls.network)) + ); } - async startServer(serverOptions: UserServerConfig) { - const { port, hostname } = serverOptions; - const listen = promisify(this.server.listen).bind(this.server); + /** + * Restarts the server. + */ + async restart() { + let newServer: Server = null; try { - await listen(port, hostname.host); + await this.close(); + newServer = new Server(this.inlineConfig); + await newServer.createServer(); } catch (error) { - this.handleServerError(error, port, hostname.host); + this.logger.error(`Failed to restart server :\n ${error}`); + return; } + await this.watcher.close(); + await newServer.listen(); + return newServer; } - handleServerError( - error: Error & { code?: string }, - port: number, - host: string | undefined - ) { - const errorMap: ErrorMap = { - EACCES: `Permission denied to use port ${port} `, - EADDRNOTAVAIL: `The IP address host: ${host} is not available on this machine.` - }; + /** + * Creates and initializes the WebSocket server. + * @throws {Error} If the HTTP server is not created. + */ + async createWebSocketServer() { + if (!this.httpServer) { + throw new Error( + 'Websocket requires a http server. please check the server is be created' + ); + } - const errorMessage = - errorMap[error.code as keyof ErrorMap] || - `An error occurred: ${error.stack} `; - this.logger.error(errorMessage); + this.ws = new WsServer(this); } - async close() { - if (!this.server) { - this.logger.error('HTTP server is not created yet'); + /** + * Creates and initializes the Hot Module Replacement (HMR) engine. + * @throws {Error} If the HTTP server is not created. + */ + createHmrEngine() { + if (!this.httpServer) { + throw new Error( + 'HmrEngine requires a http server. please check the server is be created' + ); } - // the server is already closed - if (!this.server.listening) { + + this.hmrEngine = new HmrEngine(this); + } + + /** + * Starts the server and begins listening for connections. + * @returns {Promise} + * @throws {Error} If there's an error starting the server. + */ + async listen(): Promise { + if (!this.httpServer) { + this.logger.warn('HTTP server is not created yet'); return; } - const promises = []; - if (this.ws) { - promises.push(this.ws.close()); - } + const { port, hostname, open, strictPort } = this.serverOptions; - if (this.server) { - promises.push(new Promise((resolve) => this.server.close(resolve))); - } + try { + const serverPort = await this.httpServerStart({ + port, + strictPort: strictPort, + host: hostname.host + }); - await Promise.all(promises); - } + this.config.compilation.define.FARM_HMR_PORT = serverPort.toString(); + + this.resolvedUrls = await resolveServerUrls(this.httpServer, this.config); - async restart(promise: () => Promise) { - if (!this.restart_promise) { - this.restart_promise = promise(); + // compile the project and start the dev server + await this.#startCompile(); + + // watch extra files after compile + this.watcher?.watchExtraFiles?.(); + + if (open) { + this.#openServerBrowser(); + } + } catch (error) { + this.config.logger.error( + `Start DevServer Error: ${error} \n ${error.stack}` + ); + // throw error; } - return this.restart_promise; } - private initializeKoaServer() { - this._app = new Koa(); + /** + * Get current compiler instance in the server + * @returns { CompilerType } return current compiler, may be compiler or undefined + */ + getCompiler(): CompilerType { + return this.compiler; } - public async createServer( - options: NormalizedServerConfig & UserPreviewServerConfig - ) { - const { https, host } = options; - const protocol = https ? 'https' : 'http'; - const hostname = await resolveHostname(host); - const publicPath = getValidPublicPath( - this.compiler?.config.config.output?.publicPath ?? - options?.output.publicPath - ); - // TODO refactor previewServer If it's preview server, then you can't use create server. we need to create a new one because hmr is false when you preview. - const hmrPath = normalizeBasePath( - path.join(publicPath, options.hmr.path ?? DEFAULT_HMR_OPTIONS.path) - ); + /** + * Set current compiler instance in the server + * @param { Compiler } compiler - choose a new compiler instance + */ + setCompiler(compiler: Compiler) { + this.compiler = compiler; + } - this.config = { - ...options, - port: Number(process.env.FARM_DEV_SERVER_PORT || options.port), - hmr: { - ...options.hmr, - path: hmrPath - }, - protocol, - hostname - }; + /** + * Adds additional files to be watched by the compiler. + * @param {string} root - The root directory. + * @param {string[]} deps - Array of file paths to be watched. + */ + addWatchFile(root: string, deps: string[]): void { + this.getCompiler().addExtraWatchFile(root, deps); + } - const isProxy = Object.keys(options.proxy).length; - if (https) { - if (isProxy) { - this.server = httpsServer.createServer(https, this._app.callback()); - } else { - this.server = http2.createSecureServer( - { - maxSessionMemory: 1000, - ...https, - allowHTTP1: true - }, - this._app.callback() - ); + /** + * Handles the configureServer hook. + */ + async handleConfigureServer() { + const reflexServer = new Proxy(this, { + get: (_, property: keyof Server) => + this[property as keyof this] ?? undefined, + set: (_, property: keyof Server, value: unknown) => { + this[property as keyof this] = value as this[keyof this]; + return true; } - } else { - this.server = http.createServer(this._app.callback()); - } - } + }); + const { jsPlugins } = this.config; - public createWebSocket() { - if (!this.server) { - throw new Error('Websocket requires a server.'); + for (const hook of getSortedPluginHooksBindThis( + jsPlugins, + 'configureServer' + )) { + this.postConfigureServerHooks.push(await hook(reflexServer)); } - this.ws = new WsServer(this.server, this.config, this.hmrEngine); } - private invalidateVite() { - // Note: path should be Farm's id, which is a relative path in dev mode, - // but in vite, it's a url path like /xxx/xxx.js - this.ws.on('vite:invalidate', ({ path, message }) => { - // find hmr boundary starting from the parent of the file - this.logger.info(`HMR invalidate: ${path}. ${message ?? ''} `); - const parentFiles = this.compiler.getParentFiles(path); - this.hmrEngine.hmrUpdate(parentFiles, true); - }); + /** + * resolve and setting server options + * + * this method extracts compilation and server options from resolvedUserConfig + * and set the publicPath and publicDir, and then resolve server options + * @private + * @returns { void } + */ + #resolveOptions(): void { + const { + compilation: { + output: { publicPath }, + assets: { publicDir } + }, + root, + server + } = this.config; + this.publicPath = publicPath; + this.publicDir = publicDir; + if (server.origin?.endsWith('/')) { + server.origin = server.origin.slice(0, -1); + this.config.logger.warn( + `${colors.bold('(!)')} server.origin should not end with "/". Using "${ + server.origin + }" instead.` + ); + } + this.serverOptions = server as CommonServerOptions & NormalizedServerConfig; + this.root = root; } - public async createPreviewServer(options: UserPreviewServerConfig) { - await this.createServer(options as NormalizedServerConfig); + /** + * Initializes and configures the middleware stack for the server. + * @private + */ + #initializeMiddlewares() { + this.middlewares.use(hmrPingMiddleware()); - this.applyPreviewServerMiddlewares(this.config.middlewares); + const { proxy, middlewareMode, cors, appType } = this.serverOptions; - await this.startServer(this.config); + if (cors) { + this.middlewares.use( + corsMiddleware(typeof cors === 'boolean' ? {} : cors) + ); + } - await this.displayServerUrls(true); - } + if (proxy) { + const middlewareServer = + (isObject(middlewareMode) && 'server' in middlewareMode + ? middlewareMode.server + : null) || this.httpServer; - public async createDevServer(options: NormalizedServerConfig) { - if (!this.compiler) { - throw new Error('DevServer requires a compiler for development mode.'); + this.middlewares.use( + proxyMiddleware(this, middlewareServer as HttpServer, proxy) + ); } - await this.createServer(options); - - this.hmrEngine = new HmrEngine(this.compiler, this, this.logger); + if (this.publicPath !== '/') { + this.middlewares.use( + publicPathMiddleware(this, this.serverOptions.middlewareMode) + ); + } - this.createWebSocket(); + if (fs.existsSync(this.publicDir as PathLike)) { + this.middlewares.use(publicMiddleware(this)); + } - this.invalidateVite(); + if (this.config.compilation.lazyCompilation) { + this.middlewares.use(lazyCompilationMiddleware(this)); + } - this.applyServerMiddlewares(options.middlewares); - } + this.middlewares.use(staticMiddleware(this)); - static async resolvePortConflict( - normalizedDevConfig: NormalizedServerConfig, - logger: Logger - ): Promise { - let devPort = normalizedDevConfig.port; - let hmrPort = normalizedDevConfig.hmr.port; - - const { strictPort, host } = normalizedDevConfig; - const httpServer = http.createServer(); - const isPortAvailable = (portToCheck: number) => { - return new Promise((resolve, reject) => { - const onError = async (error: { code: string }) => { - if (error.code === 'EADDRINUSE') { - clearScreen(); - if (strictPort) { - httpServer.removeListener('error', onError); - reject(new Error(`Port ${devPort} is already in use`)); - } else { - logger.warn(`Port ${devPort} is in use, trying another one...`); - httpServer.removeListener('error', onError); - resolve(false); - } - } else { - logger.error(`Error in httpServer: ${error} `); - reject(true); - } - }; - httpServer.on('error', onError); - httpServer.on('listening', () => { - httpServer.close(); - resolve(true); - }); - httpServer.listen(portToCheck, host as string); - }); - }; + // Check dev resource tree in `_output_files` url + this.middlewares.use(outputFilesMiddleware(this)); - let isPortAvailableResult = await isPortAvailable(devPort); + if (this.config.server.writeToDisk) { + this.middlewares.use(resourceDiskMiddleware(this)); + } else { + this.middlewares.use(resourceMiddleware(this)); + } - while (isPortAvailableResult === false) { - if (typeof normalizedDevConfig.hmr === 'object') { - normalizedDevConfig.hmr.port = ++hmrPort; - } + this.postConfigureServerHooks.reduce((_, fn) => { + if (typeof fn === 'function') fn(); + }, null); - normalizedDevConfig.port = ++devPort; - isPortAvailableResult = await isPortAvailable(devPort); + if (appType === 'spa' || appType === 'mpa') { + this.middlewares.use(htmlFallbackMiddleware(this)); + this.middlewares.use(notFoundMiddleware()); } } /** - * Add listening files for root manually - * - * > listening file with root must as file. - * - * @param root - * @param deps + * Compiles the project. + * @private + * @returns {Promise} + * @throws {Error} If compilation fails. */ + async #compile(): Promise { + try { + await this.compiler.compile(); + // TODO need callWriteResourcesHook ?? + await (this.config.server.writeToDisk + ? this.compiler.writeResourcesToDisk() + : this.compiler.callWriteResourcesHook()); + } catch (err) { + this.config.logger.error( + `Compilation failed: ${convertErrorMessage(err)}` + ); + // throw err; + } + } - addWatchFile(root: string, deps: string[]): void { - this.getCompiler().addExtraWatchFile(root, deps); + /** + * Opens the server URL in the default browser. + * @private + */ + async #openServerBrowser() { + const url = + this.resolvedUrls?.local?.[0] ?? this.resolvedUrls?.network?.[0] ?? ''; + openBrowser(url); } - applyMiddlewares(internalMiddlewares?: DevServerMiddleware[]) { - internalMiddlewares.forEach((middleware) => { - const middlewareImpl = middleware(this); + /** + * Starts the compilation process. + * @private + */ + async #startCompile() { + // check if cache dir exists + const { persistentCache } = this.compiler.config.compilation; + const hasCacheDir = await isCacheDirExists( + (persistentCache as PersistentCacheConfig).cacheDir + ); + const start = performance.now(); + await this.#compile(); - if (middlewareImpl) { - if (Array.isArray(middlewareImpl)) { - middlewareImpl.forEach((m) => { - this._app.use(m); - }); - } else { - this._app.use(middlewareImpl); - } - } - }); + const duration = performance.now() - start; + bootstrap(duration, this.compiler.config, hasCacheDir); } - setCompiler(compiler: Compiler) { - this.compiler = compiler; + /** + * Handles the initialization of public files. + * @private + * @returns {Promise>} A promise that resolves to a set of public file paths. + */ + async #handlePublicFiles(): Promise> { + const initPublicFilesPromise = initPublicFiles(this.config); + return await initPublicFilesPromise; } - private applyPreviewServerMiddlewares( - middlewares?: DevServerMiddleware[] - ): void { - const internalMiddlewares = [ - ...(middlewares || []), - compression, - proxy, - staticMiddleware - ]; - this.applyMiddlewares(internalMiddlewares as DevServerMiddleware[]); + /** + * Sets up the Vite invalidation handler. + * @private + */ + #invalidateVite(): void { + // Note: path should be Farm's id, which is a relative path in dev mode, + // but in vite, it's a url path like /xxx/xxx.js + + this.ws.wss.on('vite:invalidate', ({ path, message }: any) => { + // find hmr boundary starting from the parent of the file + this.config.logger.info(`HMR invalidate: ${path}. ${message ?? ''} `); + const parentFiles = this.compiler.getParentFiles(path); + const normalizeParentFiles = parentFiles.map((file) => + normalizePath(file) + ); + this.hmrEngine.hmrUpdate(normalizeParentFiles, true); + }); } - private applyServerMiddlewares(middlewares?: DevServerMiddleware[]): void { - const internalMiddlewares = [ - ...(middlewares || []), - hmrPing, - headers, - lazyCompilation, - cors, - resources, - proxy - ]; - - this.applyMiddlewares(internalMiddlewares as DevServerMiddleware[]); + /** + * Closes the server and sockets. + * @returns {() => Promise} + */ + closeServer(): () => Promise { + if (!this.httpServer) { + return () => Promise.resolve(); + } + debugServer?.(`prepare close dev server`); + + let hasListened = false; + const openSockets = new Set(); + + this.httpServer.on('connection', (socket) => { + openSockets.add(socket); + debugServer?.(`has open server socket ${openSockets}`); + + socket.on('close', () => { + debugServer?.('close all server socket'); + openSockets.delete(socket); + }); + }); + + this.httpServer.once('listening', () => { + hasListened = true; + }); + + return () => + new Promise((resolve, reject) => { + openSockets.forEach((s) => s.destroy()); + + if (hasListened) { + this.httpServer.close((err) => { + if (err) { + reject(err); + } else { + resolve(); + } + }); + } else { + resolve(); + } + }); } - private async displayServerUrls(showPreviewFlag = false) { - let publicPath = getValidPublicPath( - this.compiler - ? this.compiler.config.config.output?.publicPath - : this.config.output.publicPath - ); + async close() { + if (!this.serverOptions.middlewareMode) { + teardownSIGTERMListener(this.terminateServerFn); + } - this.resolvedUrls = await resolveServerUrls( - this.server, - this.config, - publicPath - ); + await Promise.allSettled([ + this.watcher.close(), + this.ws.wss.close(), + this.closeHttpServerFn() + ]); + this.resolvedUrls = null; + } + printUrls() { + if (!__FARM_GLOBAL__.__FARM_SHOW_DEV_SERVER_URL__) { + return; + } if (this.resolvedUrls) { - printServerUrls(this.resolvedUrls, this.logger, showPreviewFlag); + printServerUrls( + this.resolvedUrls, + this.serverOptions.host, + this.config.logger + ); + } else if (this.serverOptions.middlewareMode) { + throw new Error('cannot print server URLs in middleware mode.'); } else { - throw new Error('cannot print server URLs with Server Error.'); + throw new Error( + 'cannot print server URLs before server.listen is called.' + ); } } } diff --git a/packages/core/src/server/middlewares/cors.ts b/packages/core/src/server/middlewares/cors.ts deleted file mode 100644 index d3c26bf2c9..0000000000 --- a/packages/core/src/server/middlewares/cors.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { default as koaCors } from '@koa/cors'; -import { Middleware } from 'koa'; -import { Server } from '../index.js'; - -export function cors(devSeverContext: Server): Middleware { - const { config } = devSeverContext; - if (!config.cors) return; - return koaCors(typeof config.cors === 'boolean' ? {} : config.cors); -} diff --git a/packages/core/src/server/middlewares/headers.ts b/packages/core/src/server/middlewares/headers.ts deleted file mode 100644 index 16b65ba359..0000000000 --- a/packages/core/src/server/middlewares/headers.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { Middleware } from 'koa'; -import { Server } from '../index.js'; - -export function headers(devSeverContext: Server): Middleware { - const { config } = devSeverContext; - if (!config.headers) return; - - return async (ctx, next) => { - if (config.headers) { - for (const name in config.headers) { - ctx.set(name, config.headers[name] as string | string[]); - } - } - await next(); - }; -} diff --git a/packages/core/src/server/middlewares/hmrPing.ts b/packages/core/src/server/middlewares/hmrPing.ts index f9226e5cfb..b6a957695c 100644 --- a/packages/core/src/server/middlewares/hmrPing.ts +++ b/packages/core/src/server/middlewares/hmrPing.ts @@ -1,10 +1,11 @@ -import { Context, Next } from 'koa'; -export function hmrPing() { - return async (ctx: Context, next: Next) => { - if (ctx.get('accept') === 'text/x-farm-ping') { - ctx.status = 204; +import type Connect from 'connect'; + +export function hmrPingMiddleware(): Connect.NextHandleFunction { + return function handleHMRPingMiddleware(req, res, next) { + if (req.headers['accept'] === 'text/x-farm-ping') { + res.writeHead(204).end(); } else { - await next(); + next(); } }; } diff --git a/packages/core/src/server/middlewares/htmlFallback.ts b/packages/core/src/server/middlewares/htmlFallback.ts new file mode 100644 index 0000000000..51c829fb04 --- /dev/null +++ b/packages/core/src/server/middlewares/htmlFallback.ts @@ -0,0 +1,56 @@ +import { cleanUrl, removeSlash } from '../../utils/index.js'; + +import type Connect from 'connect'; +import type { Server } from '../index.js'; +import { send } from '../send.js'; + +export function htmlFallbackMiddleware( + app: Server +): Connect.NextHandleFunction { + return async function htmlFallbackMiddleware(req, res, next) { + if ( + // Only accept GET or HEAD + (req.method !== 'GET' && req.method !== 'HEAD') || + // Exclude default favicon requests + req.url === '/favicon.ico' || + // Require Accept: text/html or */* + !( + req.headers.accept === undefined || // equivalent to `Accept: */*` + req.headers.accept === '' || // equivalent to `Accept: */*` + req.headers.accept.includes('text/html') || + req.headers.accept.includes('*/*') + ) + ) { + return next(); + } + const url = cleanUrl(req.url); + const pathname = removeSlash(decodeURIComponent(url)); + const headers = app.config.server.headers; + + if (pathname.endsWith('.html')) { + const html = app.compiler.resource(pathname); + if (html) { + send(req, res, html, pathname, { headers }); + return next(); + } + } else if (pathname === '') { + const html = app.compiler.resource('index.html'); + if (html) { + send(req, res, html, pathname, { headers }); + return next(); + } + } else { + const html = app.compiler.resource(pathname + '.html'); + if (html) { + send(req, res, html, pathname, { headers }); + return next(); + } + } + if (app.serverOptions.appType === 'spa') { + const html = app.compiler.resource('index.html'); + send(req, res, html, pathname, { headers }); + } + + next(); + }; +} diff --git a/packages/core/src/server/middlewares/index.ts b/packages/core/src/server/middlewares/index.ts index 1f6d27e22e..54f8629b7a 100644 --- a/packages/core/src/server/middlewares/index.ts +++ b/packages/core/src/server/middlewares/index.ts @@ -1,6 +1,8 @@ -export * from './cors.js'; -export * from './headers.js'; -export * from './lazy-compilation.js'; +export * from './htmlFallback.js'; +export * from './lazyCompilation.js'; +export * from './notFound.js'; export * from './proxy.js'; -export * from './resources.js'; +export * from './resource.js'; +export * from './publicPath.js'; +export * from './hmrPing.js'; export * from './static.js'; diff --git a/packages/core/src/server/middlewares/lazy-compilation.ts b/packages/core/src/server/middlewares/lazy-compilation.ts deleted file mode 100644 index 4fb4fbd37e..0000000000 --- a/packages/core/src/server/middlewares/lazy-compilation.ts +++ /dev/null @@ -1,101 +0,0 @@ -/** - * Lazy compilation middleware. Using the same logic as HMR middleware - */ - -import { relative } from 'node:path'; -import { Context, Middleware, Next } from 'koa'; - -import { - VIRTUAL_FARM_DYNAMIC_IMPORT_SUFFIX, - bold, - checkClearScreen, - cyan, - getDynamicResources, - green -} from '../../index.js'; -import { Server } from '../index.js'; - -import { existsSync } from 'node:fs'; -import { logError } from '../error.js'; - -export function lazyCompilation(devSeverContext: Server): Middleware { - const compiler = devSeverContext.getCompiler(); - - if (!compiler.config.config?.lazyCompilation) { - return; - } - - return async (ctx: Context, next: Next) => { - if (ctx.path === '/__lazy_compile') { - const paths = (ctx.query.paths as string).split(','); - const pathsStr = paths - .map((p) => { - if ( - p.startsWith('/') && - !p.endsWith(VIRTUAL_FARM_DYNAMIC_IMPORT_SUFFIX) && - !existsSync(p) - ) { - return p; - } - const resolvedPath = compiler.transformModulePath( - compiler.config.config.root, - p - ); - return relative(compiler.config.config.root, resolvedPath); - }) - .join(', '); - checkClearScreen(compiler.config.config); - devSeverContext.logger.info(`Lazy compiling ${bold(cyan(pathsStr))}`); - const start = Date.now(); - // sync update when node is true - let result; - try { - // sync regenerate resources - result = await compiler.update(paths, true, false, false); - } catch (e) { - logError(e); - } - - if (!result) { - return; - } - - if (ctx.query.node || devSeverContext.config.writeToDisk) { - compiler.writeResourcesToDisk(); - } - - devSeverContext.logger.info( - `${bold(green(`✓`))} Lazy compilation done(${bold( - cyan(pathsStr) - )}) in ${bold(green(`${Date.now() - start}ms`))}.` - ); - - if (result) { - const { dynamicResources, dynamicModuleResourcesMap } = - getDynamicResources(result.dynamicResourcesMap); - - const returnObj = `{ - "dynamicResources": ${JSON.stringify(dynamicResources)}, - "dynamicModuleResourcesMap": ${JSON.stringify( - dynamicModuleResourcesMap - )} - }`; - const code = !ctx.query.node - ? `export default ${returnObj}` - : returnObj; - ctx.type = !ctx.query.node - ? 'application/javascript' - : 'application/json'; - ctx.body = code; - // enable cors - ctx.set('Access-Control-Allow-Origin', '*'); - ctx.set('Access-Control-Allow-Methods', '*'); - ctx.set('Access-Control-Allow-Headers', '*'); - } else { - throw new Error(`Lazy compilation result not found for paths ${paths}`); - } - } else { - await next(); - } - }; -} diff --git a/packages/core/src/server/middlewares/lazyCompilation.ts b/packages/core/src/server/middlewares/lazyCompilation.ts new file mode 100644 index 0000000000..e24b9cf410 --- /dev/null +++ b/packages/core/src/server/middlewares/lazyCompilation.ts @@ -0,0 +1,106 @@ +import { existsSync } from 'node:fs'; +import { relative } from 'node:path'; +import { parse as parseUrl } from 'node:url'; + +import { + Server, + VIRTUAL_FARM_DYNAMIC_IMPORT_SUFFIX, + bold, + cyan, + getDynamicResources, + green +} from '../../index.js'; +import { send } from '../send.js'; + +import type Connect from 'connect'; + +const DEFAULT_LAZY_COMPILATION_PATH = '/__lazy_compile'; + +export function lazyCompilationMiddleware( + app: Server +): Connect.NextHandleFunction { + return async function handleLazyCompilationMiddleware(req, res, next) { + const { config, compiler } = app; + + if (!req.url.startsWith(DEFAULT_LAZY_COMPILATION_PATH)) { + return await next(); + } + const parsedUrl = parseUrl(req.url, true); + const paths = (parsedUrl.query.paths as string).split(','); + + const isNodeEnvironment = parsedUrl.query.node; + const root = compiler.config.root; + const pathsStr = paths + .map((p) => { + if ( + p.startsWith('/') && + !p.endsWith(VIRTUAL_FARM_DYNAMIC_IMPORT_SUFFIX) && + !existsSync(p) + ) { + return p; + } + const resolvedPath = compiler.transformModulePath(root, p); + return relative(root, resolvedPath); + }) + .join(', '); + + config.logger.info( + `${bold(green('✨Lazy compiling'))} ${bold(cyan(pathsStr))}`, + true + ); + const start = performance.now(); + + let result; + try { + // sync regenerate resources + result = await compiler.update(paths, true, false, false); + } catch (e) { + throw new Error(`Lazy compilation update failed: ${e.message}`); + } + + if (!result) { + return next(); + } + + if (isNodeEnvironment || config.server.writeToDisk) { + compiler.writeResourcesToDisk(); + } + + config.logger.info( + `${bold(green(`✓ Lazy compilation done`))} ${bold( + cyan(pathsStr) + )} in ${bold( + green(config.logger.formatTime(performance.now() - start)) + )}.` + ); + + if (result) { + const { dynamicResources, dynamicModuleResourcesMap } = + getDynamicResources(result.dynamicResourcesMap); + + const responseData = { + dynamicResources, + dynamicModuleResourcesMap + }; + + const lazyCompilationContent = !isNodeEnvironment + ? `export default ${JSON.stringify(responseData)}` + : JSON.stringify(responseData); + + const contentType = !isNodeEnvironment + ? 'application/javascript' + : 'application/json'; + + send(req, res, lazyCompilationContent, req.url, { + headers: { + 'Content-Type': contentType, + 'Access-Control-Allow-Origin': '*', + 'Access-Control-Allow-Methods': '*', + 'Access-Control-Allow-Headers': '*' + } + }); + } else { + throw new Error(`Lazy compilation result not found for paths ${paths}`); + } + }; +} diff --git a/packages/core/src/server/middlewares/notFound.ts b/packages/core/src/server/middlewares/notFound.ts new file mode 100644 index 0000000000..da50737363 --- /dev/null +++ b/packages/core/src/server/middlewares/notFound.ts @@ -0,0 +1,8 @@ +import type { NextHandleFunction } from 'connect'; + +export function notFoundMiddleware(): NextHandleFunction { + return function handle404Middleware(_, res) { + res.statusCode = 404; + res.end(); + }; +} diff --git a/packages/core/src/server/middlewares/proxy.ts b/packages/core/src/server/middlewares/proxy.ts index 2815a63743..dee3c6f0af 100644 --- a/packages/core/src/server/middlewares/proxy.ts +++ b/packages/core/src/server/middlewares/proxy.ts @@ -1,98 +1,193 @@ -import { Options, createProxyMiddleware } from 'http-proxy-middleware'; -import { Context, Middleware, Next } from 'koa'; +import httpProxy from 'http-proxy'; -import { UserConfig, UserHmrConfig } from '../../config/types.js'; -import { Logger } from '../../utils/logger.js'; -import type { Server } from '../index.js'; +import { ResolvedUserConfig } from '../../config/types.js'; -export function useProxy( - options: UserConfig['server'], - devSeverContext: Server, - logger: Logger -) { - const proxyOption = options['proxy']; - for (const path of Object.keys(proxyOption)) { - let opts = proxyOption[path] as Options; +import type * as http from 'node:http'; +import type * as net from 'node:net'; +import type Server from 'http-proxy'; + +import type Connect from 'connect'; +import { CommonServerOptions } from '../http.js'; +import type { Server as DevServer, HttpServer } from '../index.js'; +import { PreviewServer } from '../preview.js'; + +export interface ProxyOptions extends httpProxy.ServerOptions { + rewrite?: (path: string) => string; + configure?: (proxy: httpProxy, options: ProxyOptions) => void; + bypass?: ( + req: http.IncomingMessage, + res: http.ServerResponse, + options: ProxyOptions + ) => void | null | undefined | false | string; + rewriteWsOrigin?: boolean | undefined; +} + +export function proxyMiddleware( + app: DevServer | PreviewServer, + middlewareServer: HttpServer, + config: NonNullable +): Connect.NextHandleFunction { + const { config: resolvedUserConfig } = app; + const proxies: Record = {}; + Object.keys(config).forEach((context) => { + let opts = config[context]; + if (!opts) { + return; + } if (typeof opts === 'string') { - opts = { target: opts, changeOrigin: true }; + opts = { target: opts, changeOrigin: true } as ProxyOptions; + } + const proxy = httpProxy.createProxyServer(opts) as Server; + + if (opts.configure) { + opts.configure(proxy, opts); } - const proxyMiddleware = createProxyMiddleware(opts); - const server = devSeverContext.server; - const hmrOptions = options.hmr as UserHmrConfig; - if (server) { - server.on('upgrade', (req, socket: any, head) => { - if (req.url === hmrOptions.path) return; - for (const path in options.proxy) { - const opts = proxyOption[path] as Options; + proxy.on('error', (err, _req, originalRes) => { + // When it is ws proxy, res is net.Socket + // originalRes can be falsy if the proxy itself errored + const res = originalRes as http.ServerResponse | net.Socket | undefined; + if (!res) { + resolvedUserConfig.logger.error( + `http proxy error: ${err.message} \n ${err.stack}` + ); + } else if ('req' in res) { + resolvedUserConfig.logger.error( + // @ts-ignore + `http proxy error: ${originalRes.req.url}\n${err.stack}` + ); + + if (!res.headersSent && !res.writableEnded) { + res + .writeHead(500, { + 'Content-Type': 'text/plain' + }) + .end(); + } + } else { + resolvedUserConfig.logger.error(`ws proxy error:\n ${err.stack}`); + res.end(); + } + }); + + proxy.on('proxyReqWs', (proxyReq, _req, socket, options, _head) => { + rewriteOriginHeader(proxyReq, options, resolvedUserConfig); + + socket.on('error', (err) => { + resolvedUserConfig.logger.error( + `ws proxy socket error: \n ${err.stack}` + ); + }); + }); + + // https://github.com/http-party/node-http-proxy/issues/1520#issue-877626125 + // https://github.com/chimurai/http-proxy-middleware/blob/cd58f962aec22c925b7df5140502978da8f87d5f/src/plugins/default/debug-proxy-errors-plugin.ts#L25-L37 + proxy.on('proxyRes', (proxyRes, _req, res) => { + res.on('close', () => { + if (!res.writableEnded) { + proxyRes.destroy(); + } + }); + }); + + // clone before saving because http-proxy mutates the options + proxies[context] = [proxy, { ...opts }]; + }); + + if (middlewareServer) { + middlewareServer.on('upgrade', (req, socket: any, head) => { + const url = req.url; + for (const context in proxies) { + if (doesProxyContextMatchUrl(context, url)) { + const [proxy, opts] = proxies[context]; if ( opts.ws || opts.target?.toString().startsWith('ws:') || opts.target?.toString().startsWith('wss:') ) { - const proxy = createProxyMiddleware(opts); - if (opts.pathRewrite) { - const fromPath = Object.keys(opts.pathRewrite)[0]; - const toPath: string = ( - opts.pathRewrite as { [regexp: string]: string } - )[fromPath]; - req.url = rewritePath(req.url, fromPath, toPath); + if (opts.bypass) { + const bypassResult = opts.bypass(req, undefined, opts); + if (typeof bypassResult === 'string') { + req.url = bypassResult; + return; + } else if (bypassResult === false) { + socket.end('HTTP/1.1 404 Not Found\r\n\r\n', ''); + return; + } + } + if (opts.rewrite) { + req.url = opts.rewrite(url); } - proxy.upgrade(req, socket, head); + proxy.ws(req, socket, head); return; } } - }); - } - - const errorHandlerMiddleware = async (ctx: Context, next: Next) => { - try { - await new Promise((resolve, reject) => { - proxyMiddleware(ctx.req, ctx.res, (err) => { - if (err) { - reject(err); - } else { - resolve(); - } - }); - }); - await next(); - } catch (err) { - logger.error(`Error in proxy for path ${path}: \n ${err.stack}`); } - }; - - try { - if (path.length > 0) { - const pathRegex = new RegExp(path); - const app = devSeverContext.app(); - app.use((ctx, next) => { - if (pathRegex.test(ctx.path)) { - return errorHandlerMiddleware(ctx, next); + }); + } + return function handleProxyMiddleware(req, res, next) { + const url = req.url; + for (const context in proxies) { + if (doesProxyContextMatchUrl(context, url)) { + const [proxy, opts] = proxies[context]; + const options: httpProxy.ServerOptions = {}; + + if (opts.bypass) { + const bypassResult = opts.bypass(req, res, opts); + if (typeof bypassResult === 'string') { + req.url = bypassResult; + return next(); + } else if (bypassResult === false) { + res.statusCode = 404; + return res.end(); } - return next(); - }); + } + + if (opts.rewrite) { + req.url = opts.rewrite(req.url!); + } + proxy.web(req, res, options); + return; } - } catch (err) { - logger.error(`Error setting proxy for path ${path}: \n ${err.stack}`); } - } + next(); + }; } -export function proxy(devSeverContext: Server): Middleware { - const { config, logger } = devSeverContext; - if (!config.proxy) { +function rewriteOriginHeader( + proxyReq: http.ClientRequest, + options: ProxyOptions, + config: ResolvedUserConfig +) { + // Browsers may send Origin headers even with same-origin + // requests. It is common for WebSocket servers to check the Origin + // header, so if rewriteWsOrigin is true we change the Origin to match + // the target URL. + if (!options.rewriteWsOrigin) return; + + const { target } = options; + + if (proxyReq.headersSent) { + config.logger.warn( + 'Unable to rewrite Origin header as headers are already sent.' + ); return; } - useProxy(config, devSeverContext, logger); -} + if (proxyReq.getHeader('origin') && target) { + const changedOrigin = + typeof target === 'object' + ? `${target.protocol}//${target.host}` + : target; -function rewritePath(path: string, fromPath: RegExp | string, toPath: string) { - if (fromPath instanceof RegExp) { - return path.replace(fromPath, toPath); - } else { - return path.replace(new RegExp(fromPath), toPath); + proxyReq.setHeader('origin', changedOrigin); } } + +function doesProxyContextMatchUrl(context: string, url: string): boolean { + return ( + (context[0] === '^' && new RegExp(context).test(url)) || + url.startsWith(context) + ); +} diff --git a/packages/core/src/server/middlewares/publicPath.ts b/packages/core/src/server/middlewares/publicPath.ts new file mode 100644 index 0000000000..4548d7a703 --- /dev/null +++ b/packages/core/src/server/middlewares/publicPath.ts @@ -0,0 +1,82 @@ +import { cleanUrl, withTrailingSlash } from '../../utils/index.js'; + +import type Connect from 'connect'; +import { Server as DevServer } from '../index.js'; +import type { PreviewServer } from '../preview.js'; + +export function publicPathMiddleware( + app: DevServer | PreviewServer, + middlewareMode: boolean +): Connect.NextHandleFunction { + const publicPath = app.publicPath; + + return function handlePublicPathMiddleware(req, res, next) { + // auto redirect to public path + const url = cleanUrl(req.url); + + if (url.startsWith(publicPath)) { + req.url = stripBase(url, publicPath); + return next(); + } + + if (middlewareMode) { + return next(); + } + + if (url === '/' || url === '/index.html') { + // redirect root visit to based url with search and hash + res.writeHead(302, { + Location: `${publicPath}${url.slice(url.length)}` + }); + res.end(); + return; + } + + const redirectPath = + withTrailingSlash(url) !== publicPath + ? joinUrlSegments(publicPath, url) + : publicPath; + + if (req.headers.accept?.includes('text/html')) { + res.writeHead(404, { + 'Content-Type': 'text/html' + }); + res.end( + `The server is configured with a public base URL of ${publicPath} - ` + + `did you mean to visit ${redirectPath} instead?` + ); + return; + } else { + // not found for resources + res.writeHead(404, { + 'Content-Type': 'text/plain' + }); + res.end( + `The server is configured with a public base URL of ${publicPath} - ` + + `did you mean to visit ${redirectPath} instead?` + ); + return; + } + }; +} + +export function stripBase(path: string, base: string): string { + if (path === base) { + return '/'; + } + const devBase = withTrailingSlash(base); + return path.startsWith(devBase) ? path.slice(devBase.length - 1) : path; +} + +export function joinUrlSegments(a: string, b: string): string { + if (!a || !b) { + return a || b || ''; + } + if (a[a.length - 1] === '/') { + a = a.substring(0, a.length - 1); + } + if (b[0] !== '/') { + b = '/' + b; + } + return a + b; +} diff --git a/packages/core/src/server/middlewares/resource.ts b/packages/core/src/server/middlewares/resource.ts new file mode 100644 index 0000000000..228ce33504 --- /dev/null +++ b/packages/core/src/server/middlewares/resource.ts @@ -0,0 +1,160 @@ +import path from 'node:path/posix'; + +import mime from 'mime'; +import sirv from 'sirv'; + +import { Compiler } from '../../compiler/index.js'; +import { + cleanUrl, + generateFileTree, + generateFileTreeHtml +} from '../../utils/index.js'; +import { normalizePathByPublicPath } from '../publicDir.js'; +import { send } from '../send.js'; +import { sirvOptions } from './static.js'; + +import type { IncomingMessage, ServerResponse } from 'http'; +import type Connect from 'connect'; +import type { Server } from '../index.js'; + +type RealResourcePath = { + resourcePath: string; + rawPath: string; + resource: Buffer; +}; + +export function resourceMiddleware(app: Server): Connect.NextHandleFunction { + return async function generateResourceMiddleware(req, res, next) { + if (res.writableEnded) { + return next(); + } + const url = cleanUrl(req.url); + const { compiler, config, publicPath } = app; + + if (compiler._isInitialCompile) { + await compiler.waitForInitialCompileFinish(); + } else { + if (compiler.compiling) { + await new Promise((resolve) => + compiler.onUpdateFinish(() => resolve()) + ); + } + } + + const resourceResult = findResource(req, compiler, publicPath); + + if (resourceResult === true) { + return next(); + } + + if (resourceResult) { + // need judge if resource is a deps node_modules set cache-control to 1 year + const headers = config.server.headers; + send(req, res, resourceResult.resource, url, { headers }); + return; + } + + // publicPath + const { resourceWithoutPublicPath } = normalizePathByPublicPath( + publicPath, + url + ); + + const extension = path.extname(resourceWithoutPublicPath).toLowerCase(); + const mimeType = mime.getType(extension) || 'application/octet-stream'; + + const isHtmlRequest = + mimeType === 'text/html' || + (!extension && req.headers.accept?.includes('text/html')); + + if (!isHtmlRequest) { + const rootResource = compiler.resource( + path.basename(resourceWithoutPublicPath) + ); + if (rootResource) { + send(req, res, rootResource, url, { + headers: config.server.headers + }); + return; + } + res.statusCode = 404; + res.end('Not found'); + return; + } + + next(); + }; +} + +export function resourceDiskMiddleware( + app: Server +): Connect.NextHandleFunction { + return async function generateResourceDiskMiddleware(req, res, next) { + if (res.writableEnded) { + return next(); + } + const { config, compiler } = app; + const root = path.resolve( + compiler.config.root, + config.compilation.output.path + ); + + const serve = sirv( + root, + sirvOptions({ + getHeaders: () => config.server.headers + }) + ); + serve(req, res, next); + }; +} + +export function findResource( + req: IncomingMessage, + compiler: Compiler, + publicPath: string +): true | undefined | RealResourcePath { + const { resourceWithoutPublicPath } = normalizePathByPublicPath( + publicPath, + req.url + ); + + const resource = compiler.resource(resourceWithoutPublicPath); + + if (resource) { + return { + resource, + resourcePath: resourceWithoutPublicPath, + rawPath: req.url + }; + } +} + +export function outputFilesMiddleware(app: Server): Connect.NextHandleFunction { + const { compiler } = app; + + return function handleOutputFiles(req, res, next) { + if (res.writableEnded) { + return next(); + } + + if (req.url !== '/_output_files') { + return next(); + } + + try { + const files = Object.keys(compiler.resources()).sort(); + + const fileTree = generateFileTree(files); + + res.setHeader('Content-Type', 'text/html'); + const html = generateFileTreeHtml(fileTree); + res.write(html); + res.end(); + } catch (error) { + if (!res.writableEnded) { + next(error); + } + } + }; +} diff --git a/packages/core/src/server/middlewares/resources.ts b/packages/core/src/server/middlewares/resources.ts deleted file mode 100644 index 175a42db4f..0000000000 --- a/packages/core/src/server/middlewares/resources.ts +++ /dev/null @@ -1,207 +0,0 @@ -/** - * Serve resources that stored in memory. This middleware will be enabled when server.writeToDisk is false. - */ - -import { ReadStream, existsSync, readFileSync, statSync } from 'node:fs'; -import path, { extname } from 'node:path'; -import { Context, Middleware, Next } from 'koa'; -import koaStatic from 'koa-static'; -import { Compiler } from '../../compiler/index.js'; -import { - generateFileTree, - generateFileTreeHtml, - stripQueryAndHash -} from '../../utils/index.js'; -import { Server } from '../index.js'; - -interface RealResourcePath { - resourcePath: string; - rawPath: string; - resource: Buffer; -} - -function normalizePathByPublicPath(publicPath: string, resourcePath: string) { - const base = publicPath.match(/^https?:\/\//) ? '' : publicPath; - let resourceWithoutPublicPath = resourcePath; - - if (base && resourcePath.startsWith(base)) { - resourcePath = resourcePath.replace(new RegExp(`([^/]+)${base}`), '$1/'); - resourceWithoutPublicPath = resourcePath.slice(base.length); - } - - return { resourceWithoutPublicPath, fullPath: resourcePath }; -} - -function outputFilesMiddleware(compiler: Compiler): Middleware { - return async (ctx: Context, next: Next) => { - if (ctx.path === '/_output_files') { - const files = Object.keys(compiler.resources()).sort(); - const fileTree = generateFileTree(files); - ctx.type = '.html'; - ctx.body = generateFileTreeHtml(fileTree); - } else { - await next(); - } - }; -} - -function findResource( - paths: string[], - compiler: Compiler, - publicPath: string -): true | undefined | RealResourcePath { - for (const resourcePath of new Set(paths)) { - const { resourceWithoutPublicPath } = normalizePathByPublicPath( - publicPath, - resourcePath - ); - - const resource = compiler.resource(resourceWithoutPublicPath); - - if (resource) { - return { - resource, - resourcePath: resourceWithoutPublicPath, - rawPath: resourcePath - }; - } - } -} - -export function resourcesMiddleware(compiler: Compiler, serverContext: Server) { - return async (ctx: Context, next: Next) => { - await next(); - if (ctx.method !== 'HEAD' && ctx.method !== 'GET') return; - const hasHtmlPathWithPublicDir = path.resolve( - serverContext.publicDir, - 'index.html' - ); - - let isSkipPublicHtml; - if (ctx.body instanceof ReadStream) { - const readStream = ctx.body; - isSkipPublicHtml = readStream.path === hasHtmlPathWithPublicDir; - } - - // the response is already handled - if ((ctx.body || ctx.status !== 404) && !isSkipPublicHtml) return; - - const { config, publicPath } = serverContext; - // if compiler is compiling, wait for it to finish - if (compiler.compiling) { - await new Promise((resolve) => { - compiler.onUpdateFinish(() => resolve(undefined)); - }); - } - // Fallback to index.html if the resource is not found - const url = ctx.url?.slice(1) || 'index.html'; // remove leading slash - - let stripQueryAndHashUrl = stripQueryAndHash(url); - const resourceResult = findResource( - [url, stripQueryAndHashUrl], - compiler, - publicPath - ); - - if (resourceResult === true) { - return; - } - - if (resourceResult) { - ctx.type = extname(ctx?.path?.slice?.(1) || 'index.html'); - ctx.body = resourceResult.resource; - return; - } - - const { fullPath, resourceWithoutPublicPath } = normalizePathByPublicPath( - publicPath, - stripQueryAndHashUrl - ); - - // if resource is image or font, try it in local file system to be compatible with vue - { - // try local file system - const absPath = path.join( - compiler.config.config.root, - resourceWithoutPublicPath - ); - // const mimeStr = mime.lookup(absPath); - - if ( - existsSync(absPath) && - statSync(absPath).isFile() - // mimeStr && - // (mimeStr.startsWith('image') || mimeStr.startsWith('font')) - ) { - ctx.type = extname(fullPath); - ctx.body = readFileSync(absPath); - return; - } - - // try local file system with publicDir - const absPathPublicDir = path.resolve( - compiler.config.config.root, - compiler.config.config.assets.publicDir, - resourceWithoutPublicPath - ); - - if (existsSync(absPathPublicDir) && statSync(absPathPublicDir).isFile()) { - ctx.type = extname(fullPath); - ctx.body = readFileSync(absPathPublicDir); - return; - } - } - - // if resource is not found and spa is not disabled, find the closest index.html from resourcePath - { - // if request mime is not html, return 404 - if (!ctx.accepts('html')) { - ctx.status = 404; - } else if (config.spa !== false) { - const pathComps = resourceWithoutPublicPath.split('/'); - - while (pathComps.length > 0) { - const pathStr = pathComps.join('/') + '.html'; - const resource = compiler.resources()[pathStr]; - - if (resource) { - ctx.type = '.html'; - ctx.body = resource; - return; - } - - pathComps.pop(); - } - - const indexHtml = compiler.resources()['index.html']; - - if (indexHtml) { - ctx.type = '.html'; - ctx.body = indexHtml; - return; - } - } else { - // cannot find index.html, return 404 - ctx.status = 404; - } - } - }; -} - -export function resources(devSeverContext: Server): Middleware | Middleware[] { - const middlewares = [outputFilesMiddleware(devSeverContext.getCompiler())]; - if (!devSeverContext.config.writeToDisk) { - middlewares.push( - resourcesMiddleware(devSeverContext.getCompiler(), devSeverContext) - ); - } else { - middlewares.push( - koaStatic(devSeverContext.getCompiler().config.config.output.path, { - extensions: ['html'] - }) - ); - } - - middlewares.push(koaStatic(devSeverContext.publicDir)); - return middlewares; -} diff --git a/packages/core/src/server/middlewares/static.ts b/packages/core/src/server/middlewares/static.ts index 4c36bc501f..1276d08648 100644 --- a/packages/core/src/server/middlewares/static.ts +++ b/packages/core/src/server/middlewares/static.ts @@ -1,60 +1,124 @@ -import fs from 'fs'; -import path, { relative } from 'path'; -import { Context, Middleware, Next } from 'koa'; -import serve from 'koa-static'; -import { Server } from '../index.js'; - -export function staticMiddleware(devServerContext: Server): Middleware { - const { config } = devServerContext; - - const staticMiddleware = serve(config.distDir, { - // multiple page maybe receive "about", should auto try extension - extensions: ['html'] - }); - - // Fallback - const fallbackMiddleware: Middleware = async (ctx: Context, next: Next) => { - await next(); - - // If staticMiddleware doesn't find the file, try to serve index.html - if (ctx.status === 404 && !ctx.body) { - ctx.type = 'html'; - ctx.body = fs.createReadStream(path.join(config.distDir, 'index.html')); +/** + * when use vite-plugin-vue some assets resource not compiled in dev mode + * so we need to invalidate vite handler to recompile + * and automatically res.body to resolve this asset resource e.g: img + * if resource is image or font, try it in local file system to be compatible with vue + */ + +import { existsSync, statSync } from 'node:fs'; +import path from 'node:path'; + +import { + cleanUrl, + fsPathFromUrl, + isImportRequest, + normalizePath, + removeLeadingSlash +} from '../../utils/index.js'; +import { stripQueryAndHash, withTrailingSlash } from '../../utils/path.js'; + +import { OutgoingHttpHeaders } from 'node:http'; +import type Connect from 'connect'; +import sirv, { Options } from 'sirv'; +import type { Server } from '../index.js'; + +export function staticMiddleware(app: Server): Connect.NextHandleFunction { + const { config, compiler } = app; + const root = compiler.config.root; + const serve = sirv( + root, + sirvOptions({ + getHeaders: () => config.server.headers + }) + ); + return function handleStaticMiddleware(req, res, next) { + let stripQueryAndHashUrl = stripQueryAndHash(req.url); + + if ( + stripQueryAndHashUrl[stripQueryAndHashUrl.length - 1] === '/' || + path.extname(stripQueryAndHashUrl) === '.html' + ) { + return next(); } - }; - return async (ctx: Context, next: Next) => { - if (ctx.status !== 404 || ctx.body) { - await next(); - return; + // try local file system + let fileUrl = path.resolve(root, removeLeadingSlash(stripQueryAndHashUrl)); + if ( + stripQueryAndHashUrl[stripQueryAndHashUrl.length - 1] === '/' && + fileUrl[fileUrl.length - 1] !== '/' + ) { + fileUrl = withTrailingSlash(fileUrl); } + const filePath = fsPathFromUrl(fileUrl); - const requestPath = ctx.request?.path; - let modifiedPath = requestPath; - - if (requestPath) { - if (config.output.publicPath.startsWith('/')) { - modifiedPath = requestPath.substring(config.output.publicPath.length); - } else { - const publicPath = relative( - path.join(config.distDir, config.output.publicPath), - config.distDir - ); - modifiedPath = requestPath.substring(publicPath.length + 1); - } + // TODO FS.allow FS.deny server.fs.allow server.fs.deny + if (existsSync(filePath) && statSync(filePath).isFile()) { + serve(req, res, next); + } else { + next(); + } + }; +} + +export function publicMiddleware(app: Server): Connect.NextHandleFunction { + const { config: config, publicDir, publicFiles } = app; + const serve = sirv( + publicDir, + sirvOptions({ + getHeaders: () => config.server.headers + }) + ); + const toFilePath = (url: string) => { + let filePath = cleanUrl(url); + if (filePath.indexOf('%') !== -1) { + try { + filePath = decodeURI(filePath); + } catch {} } + return normalizePath(filePath); + }; - ctx.request.path = `/${modifiedPath}`; - - try { - // Serve middleware for static files - await staticMiddleware(ctx, async () => { - // If staticMiddleware doesn't find the file or refresh current page router, execute fallbackMiddleware - await fallbackMiddleware(ctx, next); - }); - } catch (error) { - devServerContext.logger.error('Static file handling error:', error); - ctx.status = 500; + return async function farmHandlerPublicMiddleware( + req, + res, + next: () => void + ) { + if ( + (publicFiles && !publicFiles.has(toFilePath(req.url!))) || + isImportRequest(req.url!) + ) { + return next(); } + serve(req, res, next); }; } + +const knownJavascriptExtensionRE = /\.[tj]sx?$/; + +export const sirvOptions = ({ + getHeaders +}: { + getHeaders: () => OutgoingHttpHeaders | undefined; +}): Options => { + return { + dev: true, + etag: true, + extensions: [], + setHeaders(res, pathname) { + // Matches js, jsx, ts, tsx. + // The reason this is done, is that the .ts file extension is reserved + // for the MIME type video/mp2t. In almost all cases, we can expect + // these files to be TypeScript files, and for Vite to serve them with + // this Content-Type. + if (knownJavascriptExtensionRE.test(pathname)) { + res.setHeader('Content-Type', 'text/javascript'); + } + const headers = getHeaders(); + if (headers) { + for (const name in headers) { + res.setHeader(name, headers[name]!); + } + } + } + }; +}; diff --git a/packages/core/src/server/preview.ts b/packages/core/src/server/preview.ts new file mode 100644 index 0000000000..13c000ddbb --- /dev/null +++ b/packages/core/src/server/preview.ts @@ -0,0 +1,307 @@ +import { existsSync } from 'node:fs'; +import { OutgoingHttpHeaders, SecureServerOptions } from 'node:http2'; +import type * as net from 'node:net'; +import path from 'node:path'; +import compression from '@polka/compression'; +import connect from 'connect'; +import corsMiddleware from 'cors'; +import sirv, { RequestHandler } from 'sirv'; +import { resolveConfig } from '../config/index.js'; +import { + FarmCliOptions, + ResolvedUserConfig, + UserConfig +} from '../config/types.js'; +import { bold, brandColor, green } from '../utils/color.js'; +import { + resolveServerUrls, + setupSIGTERMListener, + teardownSIGTERMListener +} from '../utils/http.js'; +import { printServerUrls } from '../utils/logger.js'; +import { getShortName } from '../utils/path.js'; +import { isObject, version } from '../utils/share.js'; +import { knownJavascriptExtensionRE } from '../utils/url.js'; +import { + type CommonServerOptions, + type CorsOptions, + httpServer +} from './http.js'; +import type { HttpServer } from './index.js'; +import { notFoundMiddleware } from './middlewares/notFound.js'; +import { type ProxyOptions, proxyMiddleware } from './middlewares/proxy.js'; +import { publicPathMiddleware } from './middlewares/publicPath.js'; +import { openBrowser } from './open.js'; + +export interface PreviewServerOptions extends CommonServerOptions { + headers: OutgoingHttpHeaders; + host: string; + port: number; + strictPort: boolean; + https: SecureServerOptions; + distDir: string; + open: boolean | string; + cors: boolean | CorsOptions; + proxy: Record; +} + +/** + * Represents a Farm preview server. + * @class + */ +export class PreviewServer extends httpServer { + config: ResolvedUserConfig; + previewServerOptions: PreviewServerOptions; + httpsOptions: SecureServerOptions; + + publicPath: string; + httpServer: HttpServer; + + app: connect.Server; + serve: RequestHandler; + closeHttpServerFn: () => Promise; + terminateServerFn: () => Promise; + + /** + * Creates an instance of PreviewServer. + * @param {FarmCliOptions & UserConfig} inlineConfig - The inline configuration options. + */ + constructor(readonly inlineConfig: FarmCliOptions & UserConfig) { + super(); + } + + /** + * Creates and initializes the preview server. + * + * @returns {Promise} A promise that resolves when the server is ready. + * @throws {Error} If the server cannot be started. + */ + async createPreviewServer(): Promise { + this.config = await resolveConfig( + this.inlineConfig, + 'preview', + 'production', + 'production', + true + ); + + this.logger = this.config.logger; + + await this.#resolveOptions(); + + this.app = connect(); + this.httpServer = await this.resolveHttpServer( + this.previewServerOptions, + this.app, + this.httpsOptions + ); + + this.#initializeMiddlewares(); + + this.closeHttpServerFn = this.closeHttpServer(); + this.terminateServerFn = async () => { + try { + await this.closeHttpServerFn(); + } finally { + process.exit(0); + } + }; + setupSIGTERMListener(this.terminateServerFn); + } + + /** + * Initialize middlewares for the preview server. + * @private + */ + #initializeMiddlewares() { + const { cors, proxy } = this.previewServerOptions; + const { appType, middlewareMode } = this.config.server; + + if (cors !== false) { + this.app.use(corsMiddleware(typeof cors === 'boolean' ? {} : cors)); + } + + if (proxy) { + const middlewareServer = + isObject(middlewareMode) && 'server' in middlewareMode + ? middlewareMode.server + : this.httpServer; + this.app.use( + proxyMiddleware(this, middlewareServer as HttpServer, proxy) + ); + } + + this.app.use(compression()); + + if (this.publicPath !== '/') { + this.app.use(publicPathMiddleware(this, false)); + } + + this.app.use(this.serve); + + if (appType === 'spa' || appType === 'mpa') { + this.app.use(notFoundMiddleware()); + } + } + + /** + * Resolve preview server options + * + * @private + * @returns {Promise} + */ + async #resolveOptions(): Promise { + const { + server, + compilation: { root, output } + } = this.config; + + this.publicPath = output.publicPath ?? '/'; + const preview = server?.preview; + + const distPath = preview?.distDir || output?.path || 'dist'; + const distDir = path.isAbsolute(distPath) + ? distPath + : path.resolve(root, distPath); + + if (!existsSync(distDir)) { + throw new Error( + `Dist directory "${distDir}" does not exist. Do you mean "farm build"?` + ); + } + + const headers = (preview?.headers ?? server?.headers) || {}; + this.serve = sirv(distDir, { + etag: true, + dev: true, + single: this.config.server.appType === 'spa', + ignores: false, + setHeaders: (res, pathname) => { + if (knownJavascriptExtensionRE.test(pathname)) { + res.setHeader('Content-Type', 'text/javascript'); + } + if (headers) { + for (const name in headers) { + res.setHeader(name, headers[name]); + } + } + } + }); + + this.httpsOptions = await this.resolveHttpsConfig( + preview?.https ?? server?.https + ); + + this.previewServerOptions = { + headers, + host: typeof preview.host === 'string' ? preview.host : 'localhost', + port: preview?.port ?? 1911, + strictPort: preview?.strictPort ?? false, + https: this.httpsOptions, + distDir, + open: preview?.open ?? false, + cors: preview?.cors ?? false, + proxy: preview?.proxy ?? server?.proxy + }; + } + + /** + * Start the preview server. + * + * @returns {Promise} + * @throws {Error} If there's an error starting the server. + */ + async listen(): Promise { + if (!this.httpServer) { + this.logger.error( + 'HTTP server is not created yet, this is most likely a farm internal error.' + ); + return; + } + + try { + await this.httpServerStart(this.previewServerOptions); + + this.resolvedUrls = await resolveServerUrls( + this.httpServer, + this.config, + 'preview' + ); + + const shortFile = getShortName( + this.config.configFilePath, + this.config.root + ); + this.logger.info(`Using config file at ${bold(green(shortFile))}`); + + console.log('\n', bold(brandColor(`${'ϟ'} Farm v${version}`)), '\n'); + + printServerUrls( + this.resolvedUrls, + this.previewServerOptions.host, + this.logger + ); + + if (this.previewServerOptions.open) { + const url = + this.resolvedUrls?.local?.[0] ?? + this.resolvedUrls?.network?.[0] ?? + ''; + openBrowser(url); + } + } catch (error) { + throw error; + } + } + + /** + * Close the HTTP server gracefully. + * + * @returns {() => Promise} A function that can be called to close the server. + */ + closeHttpServer(): () => Promise { + if (!this.httpServer) { + return () => Promise.resolve(); + } + + let hasListened = false; + const openSockets = new Set(); + + this.httpServer.on('connection', (socket) => { + openSockets.add(socket); + socket.on('close', () => { + openSockets.delete(socket); + }); + }); + + this.httpServer.once('listening', () => { + hasListened = true; + }); + + return () => + new Promise((resolve, reject) => { + openSockets.forEach((s) => s.destroy()); + if (hasListened) { + this.httpServer.close((err) => { + if (err) { + reject(err); + } else { + resolve(); + } + }); + } else { + resolve(); + } + }); + } + + /** + * Close the preview server. + * + * @returns {Promise} + */ + async close(): Promise { + teardownSIGTERMListener(this.terminateServerFn); + await this.closeHttpServerFn(); + } +} diff --git a/packages/core/src/server/publicDir.ts b/packages/core/src/server/publicDir.ts new file mode 100644 index 0000000000..6880c6df4d --- /dev/null +++ b/packages/core/src/server/publicDir.ts @@ -0,0 +1,49 @@ +import { ResolvedUserConfig } from '../config/types.js'; +import { recursiveReaddir } from '../utils/index.js'; + +export const ERR_SYMLINK_IN_RECURSIVE_READDIR = + 'ERR_SYMLINK_IN_RECURSIVE_READDIR'; + +const publicFilesMap = new WeakMap>(); + +export async function initPublicFiles( + config: ResolvedUserConfig +): Promise | undefined> { + let fileNames: string[]; + const publicDir: string = config.publicDir; + + try { + fileNames = await recursiveReaddir(publicDir); + } catch (e) { + if (e.code === ERR_SYMLINK_IN_RECURSIVE_READDIR) { + return; + } + throw e; + } + const publicFiles = new Set( + fileNames.map((fileName) => fileName.slice(publicDir.length)) + ); + publicFilesMap.set(config, publicFiles); + return publicFiles; +} + +export function getPublicFiles( + config: ResolvedUserConfig +): Set | undefined { + return publicFilesMap.get(config); +} + +export function normalizePathByPublicPath( + publicPath: string, + resourcePath: string +) { + const base = publicPath.match(/^https?:\/\//) ? '' : publicPath; + let resourceWithoutPublicPath = resourcePath; + + if (base && resourcePath.startsWith(base)) { + resourcePath = resourcePath.replace(new RegExp(`([^/]+)${base}`), '$1/'); + resourceWithoutPublicPath = resourcePath.slice(base.length); + } + + return { resourceWithoutPublicPath, fullPath: resourcePath }; +} diff --git a/packages/core/src/server/send.ts b/packages/core/src/server/send.ts new file mode 100644 index 0000000000..32d26731e1 --- /dev/null +++ b/packages/core/src/server/send.ts @@ -0,0 +1,48 @@ +import { IncomingMessage, OutgoingHttpHeaders, ServerResponse } from 'http'; +import getEtag from 'etag'; +import mime from 'mime'; +import { extname } from 'path/posix'; + +export interface SendOptions { + etag?: string; + cacheControl?: string; + headers?: OutgoingHttpHeaders; +} + +export function send( + req: IncomingMessage, + res: ServerResponse, + content: string | Buffer, + url: string, + options: SendOptions +): void { + const { + etag = getEtag(content, { weak: true }), + cacheControl = 'no-cache', + headers + } = options; + + if (res.writableEnded) { + return; + } + + if (req.headers['if-none-match'] === etag) { + res.statusCode = 304; + res.end(); + return; + } + + res.setHeader('Content-Type', mime.getType(extname(url))); + res.setHeader('Cache-Control', cacheControl); + res.setHeader('Etag', etag); + + if (headers) { + for (const name in headers) { + res.setHeader(name, headers[name]); + } + } + + res.statusCode = 200; + res.end(content); + return; +} diff --git a/packages/core/src/server/type.ts b/packages/core/src/server/type.ts index 6e6a93f64f..b8f0391368 100644 --- a/packages/core/src/server/type.ts +++ b/packages/core/src/server/type.ts @@ -1,4 +1,99 @@ -import http from 'node:http'; -import http2 from 'node:http2'; +export type HMRPayload = + | ConnectedPayload + | UpdatePayload + | FullReloadPayload + | CustomPayload + | ErrorPayload + | PrunePayload; -export type Server = http.Server | http2.Http2SecureServer; +export interface ConnectedPayload { + type: 'connected'; +} + +export interface UpdatePayload { + type: 'update'; + updates: Update[]; +} + +export interface Update { + type: 'js-update' | 'css-update'; + path: string; + acceptedPath: string; + timestamp: number; + /** @internal */ + explicitImportRequired?: boolean; + /** @internal */ + isWithinCircularImport?: boolean; + /** @internal */ + ssrInvalidates?: string[]; +} + +export interface PrunePayload { + type: 'prune'; + paths: string[]; +} + +export interface FullReloadPayload { + type: 'full-reload'; + path?: string; + /** @internal */ + triggeredBy?: string; +} + +export interface CustomPayload { + type: 'custom'; + event: string; + data?: any; +} + +export interface ErrorPayload { + type: 'error'; + err: { + [name: string]: any; + message: string; + stack: string; + id?: string; + frame?: string; + plugin?: string; + pluginCode?: string; + loc?: { + file?: string; + line: number; + column: number; + }; + }; +} + +export interface CustomEventMap { + 'vite:beforeUpdate': UpdatePayload; + 'vite:afterUpdate': UpdatePayload; + 'vite:beforePrune': PrunePayload; + 'vite:beforeFullReload': FullReloadPayload; + 'vite:error': ErrorPayload; + 'vite:invalidate': InvalidatePayload; + 'vite:ws:connect': WebSocketConnectionPayload; + 'vite:ws:disconnect': WebSocketConnectionPayload; +} + +export interface WebSocketConnectionPayload { + webSocket: WebSocket; +} + +export interface InvalidatePayload { + path: string; + message: string | undefined; +} + +export type InferCustomEventPayload = + T extends keyof CustomEventMap ? CustomEventMap[T] : any; + +export interface HMRBroadcasterClient { + /** + * Send event to the client + */ + send(payload: HMRPayload): void; + /** + * Send custom event + */ + send(event: string, payload?: CustomPayload['data']): void; +} diff --git a/packages/core/src/server/ws.ts b/packages/core/src/server/ws.ts index 1281974c44..56678e9b2e 100644 --- a/packages/core/src/server/ws.ts +++ b/packages/core/src/server/ws.ts @@ -1,24 +1,72 @@ -import type { IncomingMessage } from 'node:http'; -import type { Duplex } from 'node:stream'; -import type { WebSocket as WebSocketRawType } from 'ws'; +import { STATUS_CODES, createServer as createHttpServer } from 'node:http'; +import { createServer as createHttpsServer } from 'node:https'; +import path from 'node:path'; +import { WebSocketServer as WebSocketServerRaw_ } from 'ws'; -import { WebSocket, WebSocketServer as WebSocketServerRaw } from 'ws'; -import { Logger, NormalizedServerConfig, red } from '../index.js'; -import { HmrEngine } from './hmr-engine.js'; -import { Server } from './type.js'; +import { ILogger, Logger } from '../utils/logger.js'; +import { isObject } from '../utils/share.js'; +import { ServerOptions } from './index.js'; -import type { ILogger } from '../index.js'; +import type { IncomingMessage, Server } from 'node:http'; +import type { Socket } from 'node:net'; +import type { Duplex } from 'node:stream'; +import type { WebSocket as WebSocketRaw } from 'ws'; +import type { WebSocket as WebSocketTypes } from '../types/ws.js'; -const HMR_HEADER = 'farm_hmr'; +import { + CustomPayload, + ErrorPayload, + HMRPayload, + InferCustomEventPayload +} from './type.js'; -export interface IWebSocketServer { - clients: Set; +const WS_CONNECTED_MESSAGE = JSON.stringify({ type: 'connected' }); +const WS_CUSTOM_EVENT_TYPE = 'custom'; + +export interface WebSocketServer { + /** + * Listen on port and host + */ listen(): void; - send(payload: any): void; - send(event: T, payload?: any): void; + /** + * Get all connected clients. + */ + clients: Set; + /** + * Disconnect all clients and terminate the server. + */ close(): Promise; - on(event: string, listener: any): void; - off(event: string, listener: any): void; + /** + * Handle custom event emitted by `import.meta.hot.send` + */ + on: WebSocketTypes.Server['on'] & { + ( + event: T, + listener: WebSocketCustomListener> + ): void; + }; + /** + * Unregister event listener. + */ + off: WebSocketTypes.Server['off'] & { + (event: string, listener: Function): void; + }; +} + +export interface WebSocketClient { + /** + * Send event to the client + */ + send(payload: HMRPayload): void; + /** + * Send custom event + */ + send(event: string, payload?: CustomPayload['data']): void; + /** + * The raw WebSocket instance + * @advanced + */ + socket: WebSocketTypes; } const wsServerEvents = [ @@ -28,138 +76,138 @@ const wsServerEvents = [ 'listening', 'message' ]; + +function noop() { + // noop +} + +const HMR_HEADER = 'farm_hmr'; + export type WebSocketCustomListener = ( data: T, client: WebSocketClient ) => void; -export interface WebSocketClient { - send(payload: any): void; - send(event: string, payload?: any['data']): void; - rawSend(str: string): void; - socket: WebSocketRawType; -} -export default class WsServer implements IWebSocketServer { - public wss: WebSocketServerRaw; +const WebSocketServerRaw = process.versions.bun + ? // @ts-expect-error: Bun defines `import.meta.require` + import.meta.require('ws').WebSocketServer + : WebSocketServerRaw_; + +export class WsServer { + public wss: WebSocketServerRaw_; public customListeners = new Map>>(); - public clientsMap = new WeakMap(); - public bufferedError: any = null; + public clientsMap = new WeakMap(); + public bufferedError: ErrorPayload | null = null; public logger: ILogger; - constructor( - private httpServer: Server, - private config: NormalizedServerConfig, - private hmrEngine: HmrEngine, - logger?: ILogger - ) { - this.logger = logger ?? new Logger(); - this.createWebSocketServer(); - } - - private createWebSocketServer() { - try { - const WebSocketServer = process.versions.bun - ? // @ts-expect-error: Bun defines `import.meta.require` - import.meta.require('ws').WebSocketServer - : WebSocketServerRaw; - this.wss = new WebSocketServer({ noServer: true }); - this.connection(); - // TODO IF not have httpServer - this.httpServer.on('upgrade', this.upgradeWsServer.bind(this)); - } catch (err) { - this.handleSocketError(err); - } - } - - private upgradeWsServer( - request: IncomingMessage, + public wsServer: any; + wsHttpServer: Server | undefined; + private serverConfig: ServerOptions; + private port: number; + private host: string | undefined; + private hmrServerWsListener: ( + req: InstanceType, socket: Duplex, head: Buffer - ) { - if (this.isHMRRequest(request)) { - this.handleHMRUpgrade(request, socket, head); - } + ) => void; + /** + * Creates a new WebSocket server instance. + * @param {any} app - The application instance containing configuration and logger. + */ + constructor(private readonly app: any) { + this.logger = app.logger ?? new Logger(); + this.serverConfig = app.config.server as ServerOptions; + this.createWebSocketServer(); } - listen() { - // TODO alone with use httpServer we need start this function - // Start listening for WebSocket connections + /** + * Gets the server name. + * @returns {string} Returns "ws". + */ + get name(): string { + return 'ws'; } - // Farm uses the `sendMessage` method in hmr and - // the send method is reserved for migration vite - send(...args: any[]) { - let payload: any; - if (typeof args[0] === 'string') { - payload = { - type: 'custom', - event: args[0], - data: args[1] + /** + * Creates the WebSocket server. + */ + createWebSocketServer() { + if (this.serverConfig.ws === false) { + return { + name: 'ws', + get clients() { + return new Set(); + }, + async close() { + // noop + }, + on: noop as any as WebSocketServer['on'], + off: noop as any as WebSocketServer['off'], + listen: noop, + send: noop }; - } else { - payload = args[0]; } - if (payload.type === 'error' && !this.wss.clients.size) { - this.bufferedError = payload; - return; - } + const hmr = isObject(this.serverConfig.hmr) + ? this.serverConfig.hmr + : undefined; + const hmrServer = hmr?.server; + const hmrPort = hmr?.port; + const portsAreCompatible = !hmrPort || hmrPort === this.serverConfig.port; + this.wsServer = hmrServer || (portsAreCompatible && this.app.httpServer); - const stringified = JSON.stringify(payload); - this.wss.clients.forEach((client) => { - // readyState 1 means the connection is open - if (client.readyState === 1) { - client.send(stringified); - } - }); - } - - private isHMRRequest(request: IncomingMessage): boolean { - return ( - request.url === this.config.hmr.path && - request.headers['sec-websocket-protocol'] === HMR_HEADER - ); - } - - private handleHMRUpgrade( - request: IncomingMessage, - socket: Duplex, - head: Buffer - ) { - this.wss.handleUpgrade(request, socket, head, (ws: WebSocketRawType) => { - this.wss.emit('connection', ws, request); - }); - } + this.port = (hmrPort as number) || 9000; + this.host = ((hmr && hmr.host) as string) || undefined; - get clients(): Set { - return new Set( - Array.from(this.wss.clients).map(this.getSocketClient.bind(this)) - ); - } + if (this.wsServer) { + let hmrBase = this.app.publicPath; - // a custom method defined by farm to send custom events - public sendCustomEvent(event: T, payload?: any) { - // Send a custom event to all clients - this.send({ type: 'custom', event, data: payload }); - } + const hmrPath = hmr?.path; + if (hmrPath) { + hmrBase = path.posix.join(hmrBase, hmrPath as string); + } - public on(event: string, listener: (...args: any[]) => void) { - if (wsServerEvents.includes(event)) { - this.wss.on(event, listener); + this.wss = new WebSocketServerRaw({ noServer: true }); + this.hmrServerWsListener = (req, socket, head) => { + // TODO 这里需要处理一下 normalizePublicPath 的问题 hmrBase 路径匹配不到 req.url 的问题 + if ( + req.headers['sec-websocket-protocol'] === HMR_HEADER && + req.url === hmrBase + ) { + this.wss.handleUpgrade(req, socket as Socket, head, (ws) => { + this.wss.emit('connection', ws, req); + }); + } + }; + this.wsServer.on('upgrade', this.hmrServerWsListener); } else { - this.addCustomEventListener(event, listener); - } - } + // http server request handler keeps the same with + // https://github.com/websockets/ws/blob/45e17acea791d865df6b255a55182e9c42e5877a/lib/websocket-server.js#L88-L96 + const route = ((_, res) => { + const statusCode = 426; + const body = STATUS_CODES[statusCode]; + if (!body) + throw new Error( + `No body text found for the ${statusCode} status code` + ); - public off(event: string, listener: () => void) { - if (wsServerEvents.includes(event)) { - this.wss.off(event, listener); - } else { - this.removeCustomEventListener(event, listener); + res.writeHead(statusCode, { + 'Content-Length': body.length, + 'Content-Type': 'text/plain' + }); + res.end(body); + }) as Parameters[1]; + + if (this.app.httpsOptions) { + this.wsHttpServer = createHttpsServer(this.app.httpsOptions, route); + } else { + this.wsHttpServer = createHttpServer(route); + } + // vite dev server in middleware mode + // need to call ws listen manually + this.wss = new WebSocketServerRaw({ server: this.wsHttpServer }); } - } - connection() { - this.wss.on('connection', (socket: WebSocketRawType) => { + this.wss.on('connection', (socket) => { socket.on('message', (raw) => { if (!this.customListeners.size) return; let parsed: any; @@ -170,115 +218,170 @@ export default class WsServer implements IWebSocketServer { } // transform vite js-update to farm update if (parsed?.type === 'js-update' && parsed?.path) { - this.hmrEngine.hmrUpdate(parsed.path, true); + this.app.hmrEngine.hmrUpdate(parsed.path, true); return; } - - if (!parsed || parsed.type !== 'custom' || !parsed.event) return; + if (!parsed || parsed.type !== WS_CUSTOM_EVENT_TYPE || !parsed.event) + return; const listeners = this.customListeners.get(parsed.event); if (!listeners?.size) return; - const client = this.getSocketClient(socket); + const client = this.#getSocketClient(socket); listeners.forEach((listener) => listener(parsed.data, client)); }); - - socket.on('error', (err: Error & { code: string }) => { - return this.handleSocketError(err); + socket.on('error', (err) => { + throw new Error(`WebSocket error: \n${err.stack}`); }); - socket.send(JSON.stringify({ type: 'connected' })); + socket.send(WS_CONNECTED_MESSAGE); if (this.bufferedError) { socket.send(JSON.stringify(this.bufferedError)); this.bufferedError = null; } }); + + this.wss.on('error', (e: Error & { code: string }) => { + if (e.code === 'EADDRINUSE') { + throw new Error('WebSocket server error: Port is already in use'); + } else { + throw new Error(`WebSocket server error ${e.stack || e.message}`); + } + }); + } + + /** + * Starts listening for WebSocket connections. + */ + listen() { + this.wsHttpServer?.listen(this.port, this.host); } - public async close() { - if (this.upgradeWsServer && this.httpServer) { - this.httpServer.off('upgrade', this.upgradeWsServer); + /** + * Adds a listener for the specified event. + * @param {string} event - The name of the event. + * @param {Function} fn - The listener function. + */ + on(event: string, fn: () => void) { + if (wsServerEvents.includes(event)) { + this.wss.on(event, fn); + } else { + if (!this.customListeners.has(event)) { + this.customListeners.set(event, new Set()); + } + this.customListeners.get(event).add(fn); } - await this.terminateAllClients(); - await this.closeWebSocketServer(); - // TODO if not have httpServer we need close httpServer } - private terminateAllClients() { - const terminatePromises = Array.from(this.wss.clients).map((client) => { - return new Promise((resolve) => { - if (client.readyState === WebSocket.OPEN) { - client.send(JSON.stringify({ type: 'closing' })); - client.close(1000, 'Server shutdown'); - } - // Temporarily remove the direct shutdown of ws - // client.terminate(); - client.once('close', () => resolve(true)); - }); - }); - return Promise.all(terminatePromises); + /** + * Removes a listener for the specified event. + * @param {string} event - The name of the event. + * @param {Function} fn - The listener function to remove. + */ + off(event: string, fn: () => void) { + if (wsServerEvents.includes(event)) { + this.wss.off(event, fn); + } else { + this.customListeners.get(event)?.delete(fn); + } } - private closeWebSocketServer() { - return new Promise((resolve, reject) => { - this.wss.close((err) => { - if (err) { - reject(err); - } else { - // TODO if not have httpServer - resolve(true); - } - }); - }); + /** + * Gets all connected clients. + * @returns {Set} A set of connected clients. + */ + get clients() { + return new Set( + Array.from(this.wss.clients).map((socket: any) => + this.#getSocketClient(socket) + ) + ); } - private addCustomEventListener(event: string, listener: () => void) { - if (!this.customListeners.has(event)) { - this.customListeners.set(event, new Set()); + /** + * Sends a message to all connected clients. + * @param {...any} args - The message arguments to send. + */ + send(...args: any[]) { + const payload: HMRPayload = this.#createPayload(...args); + if (payload.type === 'error' && !this.wss.clients.size) { + this.bufferedError = payload; + return; } - this.customListeners.get(event).add(listener); - } - private removeCustomEventListener(event: string, listener: () => void) { - this.customListeners.get(event)?.delete(listener); + const stringified = JSON.stringify(payload); + this.wss.clients.forEach((client: any) => { + // readyState 1 means the connection is open + if (client.readyState === 1) { + client.send(stringified); + } + }); } - private getSocketClient(socket: WebSocketRawType) { - if (!this.clientsMap.has(socket)) { - this.clientsMap.set(socket, { - send: (...args) => this.sendMessage(socket, ...args), - socket, - rawSend: (str) => socket.send(str) + /** + * Closes the WebSocket server. + * @returns {Promise} A promise that resolves when the server is closed. + */ + async close() { + // should remove listener if hmr.server is set + // otherwise the old listener swallows all WebSocket connections + if (this.hmrServerWsListener && this.wsServer) { + this.wsServer.off('upgrade', this.hmrServerWsListener); + } + try { + this.wss.clients.forEach((client: any) => { + client.terminate(); + }); + await new Promise((resolve, reject) => { + this.wss.close((err: any) => (err ? reject(err) : resolve())); }); + if (this.wsHttpServer) { + await new Promise((resolve, reject) => { + this.wsHttpServer.close((err: any) => + err ? reject(err) : resolve() + ); + }); + } + } catch (err) { + throw new Error(`Failed to close WebSocket server: ${err}`); } - return this.clientsMap.get(socket); } - private sendMessage(socket: WebSocketRawType, ...args: any[]) { - let payload: any; + /** + * Creates an HMR payload. + * @private + * @param {...any} args - The payload arguments. + * @returns {HMRPayload} The HMR payload object. + */ + #createPayload(...args: any[]): HMRPayload { if (typeof args[0] === 'string') { - payload = { + return { type: 'custom', event: args[0], data: args[1] }; } else { - payload = args[0]; + return args[0]; } - socket.send(JSON.stringify(payload)); } - private handleSocketError(err: Error & { code: string }) { - if (err.code === 'EADDRINUSE') { - this.logger.error(red(`WebSocket server error: Port is already in use`), { - error: err + /** + * Gets the client object associated with a WebSocket. + * @private + * @param {WebSocketRaw} socket - The raw WebSocket object. + * @returns {WebSocketClient} The client object. + */ + #getSocketClient(socket: WebSocketRaw) { + if (!this.clientsMap.has(socket)) { + this.clientsMap.set(socket, { + send: (...args) => { + const payload: HMRPayload = this.#createPayload(...args); + socket.send(JSON.stringify(payload)); + }, + // @ts-ignore + rawSend: (str: string) => socket.send(str), + socket }); - } else { - this.logger.error( - red(`WebSocket server error:\n${err.stack || err.message}`), - { - error: err - } - ); } + return this.clientsMap.get(socket); } } diff --git a/packages/core/src/types/binding.ts b/packages/core/src/types/binding.ts index fffad30a19..70dc318e31 100644 --- a/packages/core/src/types/binding.ts +++ b/packages/core/src/types/binding.ts @@ -149,9 +149,7 @@ export interface OutputConfig { | 'browser-es2015' | 'browser-es2017' | 'browser-esnext' - | 'library' - | 'library-browser' - | 'library-node'; + | 'library'; /** * output module format */ @@ -160,6 +158,10 @@ export interface OutputConfig { * clean output.path automatically or not */ clean?: boolean; + /** + * Whether to show print file size of final output files. + */ + showFileSize?: boolean; } export interface ResolveConfig { @@ -171,7 +173,10 @@ export interface ResolveConfig { /** * Configure parsing alias. Alias is prefix replacement, for example /@/pages/index will be replaced by /root/src/pages/index. If you want an exact match, you can add $, for example stream$ will only replace stream, but not stream/xxx. */ - alias?: Record; + // TODO customResolver?: ResolverFunction | ResolverObject + alias?: + | Record + | Array<{ find: string | RegExp; replacement: string }>; /** * When parsing dependencies under node_modules, the fields and order configured in mainFields will be parsed from package.json. For package.json * @default ["exports", "browser", "module", "main"] @@ -324,6 +329,19 @@ export interface CssConfig { _viteCssOptions?: any; } +export interface GlobalBuiltinCacheKeyStrategy { + /** @default true */ + define?: boolean; + /** @default true */ + buildDependencies?: boolean; + /** @default true */ + lockfile?: boolean; + /** @default true */ + packageJson?: boolean; + /** @default true */ + env?: boolean; +} + export interface PersistentCacheConfig { namespace?: string; cacheDir?: string; @@ -342,18 +360,7 @@ export interface PersistentCacheConfig { * lockfile: false * } */ - globalBuiltinCacheKeyStrategy?: { - /** @default true */ - define?: boolean; - /** @default true */ - buildDependencies?: boolean; - /** @default true */ - lockfile?: boolean; - /** @default true */ - packageJson?: boolean; - /** @default true */ - env?: boolean; - }; + globalBuiltinCacheKeyStrategy?: GlobalBuiltinCacheKeyStrategy; } export interface PartialBundlingConfig { @@ -380,6 +387,7 @@ export interface PartialBundlingConfig { test: string[]; groupType?: 'mutable' | 'immutable'; resourceType?: 'all' | 'initial' | 'async'; + enforce?: boolean; }[]; /** * Array to match the modules that should always be in the same bundles, ignore all other constraints. @@ -415,7 +423,6 @@ export interface PresetEnvConfig { export interface Config { config?: { - clearScreen?: boolean; coreLibPath?: string; /** * Compilation entries @@ -479,6 +486,7 @@ export interface Config { persistentCache?: boolean | PersistentCacheConfig; comments?: boolean | 'license'; custom?: Record; + concatenateModules?: boolean; }; jsPlugins?: JsPlugin[]; // [rustPluginFilePath, jsonStringifiedOptions] diff --git a/packages/core/src/types/ws.ts b/packages/core/src/types/ws.ts new file mode 100644 index 0000000000..f03298cd9b --- /dev/null +++ b/packages/core/src/types/ws.ts @@ -0,0 +1,559 @@ +// Modified and inlined to avoid extra dependency +// Source: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/ws/index.d.ts + +// Type definitions for ws 8.5 +// Project: https://github.com/websockets/ws +// Definitions by: Paul Loyd +// Margus Lamp +// Philippe D'Alva +// reduckted +// teidesu +// Bartosz Wojtkowiak +// Kyle Hensel +// Samuel Skeen +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +import { EventEmitter } from 'node:events'; +import type { + Agent, + ClientRequest, + ClientRequestArgs, + Server as HTTPServer, + IncomingMessage, + OutgoingHttpHeaders +} from 'node:http'; +import type { Server as HTTPSServer } from 'node:https'; +import type { Duplex, DuplexOptions } from 'node:stream'; +import type { SecureContextOptions } from 'node:tls'; +import type { URL } from 'node:url'; +import type { ZlibOptions } from 'node:zlib'; + +// WebSocket socket. +declare class WebSocket extends EventEmitter { + /** The connection is not yet open. */ + static readonly CONNECTING: 0; + /** The connection is open and ready to communicate. */ + static readonly OPEN: 1; + /** The connection is in the process of closing. */ + static readonly CLOSING: 2; + /** The connection is closed. */ + static readonly CLOSED: 3; + + binaryType: 'nodebuffer' | 'arraybuffer' | 'fragments'; + readonly bufferedAmount: number; + readonly extensions: string; + /** Indicates whether the websocket is paused */ + readonly isPaused: boolean; + readonly protocol: string; + /** The current state of the connection */ + readonly readyState: + | typeof WebSocket.CONNECTING + | typeof WebSocket.OPEN + | typeof WebSocket.CLOSING + | typeof WebSocket.CLOSED; + readonly url: string; + + /** The connection is not yet open. */ + readonly CONNECTING: 0; + /** The connection is open and ready to communicate. */ + readonly OPEN: 1; + /** The connection is in the process of closing. */ + readonly CLOSING: 2; + /** The connection is closed. */ + readonly CLOSED: 3; + + onopen: ((event: WebSocket.Event) => void) | null; + onerror: ((event: WebSocket.ErrorEvent) => void) | null; + onclose: ((event: WebSocket.CloseEvent) => void) | null; + onmessage: ((event: WebSocket.MessageEvent) => void) | null; + + constructor(address: null); + constructor( + address: string | URL, + options?: WebSocket.ClientOptions | ClientRequestArgs + ); + constructor( + address: string | URL, + protocols?: string | string[], + options?: WebSocket.ClientOptions | ClientRequestArgs + ); + + close(code?: number, data?: string | Buffer): void; + ping(data?: any, mask?: boolean, cb?: (err: Error) => void): void; + pong(data?: any, mask?: boolean, cb?: (err: Error) => void): void; + send(data: any, cb?: (err?: Error) => void): void; + send( + data: any, + options: { + mask?: boolean | undefined; + binary?: boolean | undefined; + compress?: boolean | undefined; + fin?: boolean | undefined; + }, + cb?: (err?: Error) => void + ): void; + terminate(): void; + + /** + * Pause the websocket causing it to stop emitting events. Some events can still be + * emitted after this is called, until all buffered data is consumed. This method + * is a noop if the ready state is `CONNECTING` or `CLOSED`. + */ + pause(): void; + /** + * Make a paused socket resume emitting events. This method is a noop if the ready + * state is `CONNECTING` or `CLOSED`. + */ + resume(): void; + + // HTML5 WebSocket events + addEventListener( + method: 'message', + cb: (event: WebSocket.MessageEvent) => void, + options?: WebSocket.EventListenerOptions + ): void; + addEventListener( + method: 'close', + cb: (event: WebSocket.CloseEvent) => void, + options?: WebSocket.EventListenerOptions + ): void; + addEventListener( + method: 'error', + cb: (event: WebSocket.ErrorEvent) => void, + options?: WebSocket.EventListenerOptions + ): void; + addEventListener( + method: 'open', + cb: (event: WebSocket.Event) => void, + options?: WebSocket.EventListenerOptions + ): void; + + removeEventListener( + method: 'message', + cb: (event: WebSocket.MessageEvent) => void + ): void; + removeEventListener( + method: 'close', + cb: (event: WebSocket.CloseEvent) => void + ): void; + removeEventListener( + method: 'error', + cb: (event: WebSocket.ErrorEvent) => void + ): void; + removeEventListener( + method: 'open', + cb: (event: WebSocket.Event) => void + ): void; + + // Events + on( + event: 'close', + listener: (this: WebSocket, code: number, reason: Buffer) => void + ): this; + on(event: 'error', listener: (this: WebSocket, err: Error) => void): this; + on( + event: 'upgrade', + listener: (this: WebSocket, request: IncomingMessage) => void + ): this; + on( + event: 'message', + listener: ( + this: WebSocket, + data: WebSocket.RawData, + isBinary: boolean + ) => void + ): this; + on(event: 'open', listener: (this: WebSocket) => void): this; + on( + event: 'ping' | 'pong', + listener: (this: WebSocket, data: Buffer) => void + ): this; + on( + event: 'unexpected-response', + listener: ( + this: WebSocket, + request: ClientRequest, + response: IncomingMessage + ) => void + ): this; + on( + event: string | symbol, + listener: (this: WebSocket, ...args: any[]) => void + ): this; + + once( + event: 'close', + listener: (this: WebSocket, code: number, reason: Buffer) => void + ): this; + once(event: 'error', listener: (this: WebSocket, err: Error) => void): this; + once( + event: 'upgrade', + listener: (this: WebSocket, request: IncomingMessage) => void + ): this; + once( + event: 'message', + listener: ( + this: WebSocket, + data: WebSocket.RawData, + isBinary: boolean + ) => void + ): this; + once(event: 'open', listener: (this: WebSocket) => void): this; + once( + event: 'ping' | 'pong', + listener: (this: WebSocket, data: Buffer) => void + ): this; + once( + event: 'unexpected-response', + listener: ( + this: WebSocket, + request: ClientRequest, + response: IncomingMessage + ) => void + ): this; + once( + event: string | symbol, + listener: (this: WebSocket, ...args: any[]) => void + ): this; + + off( + event: 'close', + listener: (this: WebSocket, code: number, reason: Buffer) => void + ): this; + off(event: 'error', listener: (this: WebSocket, err: Error) => void): this; + off( + event: 'upgrade', + listener: (this: WebSocket, request: IncomingMessage) => void + ): this; + off( + event: 'message', + listener: ( + this: WebSocket, + data: WebSocket.RawData, + isBinary: boolean + ) => void + ): this; + off(event: 'open', listener: (this: WebSocket) => void): this; + off( + event: 'ping' | 'pong', + listener: (this: WebSocket, data: Buffer) => void + ): this; + off( + event: 'unexpected-response', + listener: ( + this: WebSocket, + request: ClientRequest, + response: IncomingMessage + ) => void + ): this; + off( + event: string | symbol, + listener: (this: WebSocket, ...args: any[]) => void + ): this; + + addListener( + event: 'close', + listener: (code: number, reason: Buffer) => void + ): this; + addListener(event: 'error', listener: (err: Error) => void): this; + addListener( + event: 'upgrade', + listener: (request: IncomingMessage) => void + ): this; + addListener( + event: 'message', + listener: (data: WebSocket.RawData, isBinary: boolean) => void + ): this; + addListener(event: 'open', listener: () => void): this; + addListener(event: 'ping' | 'pong', listener: (data: Buffer) => void): this; + addListener( + event: 'unexpected-response', + listener: (request: ClientRequest, response: IncomingMessage) => void + ): this; + addListener(event: string | symbol, listener: (...args: any[]) => void): this; + + removeListener( + event: 'close', + listener: (code: number, reason: Buffer) => void + ): this; + removeListener(event: 'error', listener: (err: Error) => void): this; + removeListener( + event: 'upgrade', + listener: (request: IncomingMessage) => void + ): this; + removeListener( + event: 'message', + listener: (data: WebSocket.RawData, isBinary: boolean) => void + ): this; + removeListener(event: 'open', listener: () => void): this; + removeListener( + event: 'ping' | 'pong', + listener: (data: Buffer) => void + ): this; + removeListener( + event: 'unexpected-response', + listener: (request: ClientRequest, response: IncomingMessage) => void + ): this; + removeListener( + event: string | symbol, + listener: (...args: any[]) => void + ): this; +} + +declare const WebSocketAlias: typeof WebSocket; +// @ts-ignore +interface WebSocketAlias extends WebSocket {} // tslint:disable-line no-empty-interface + +// @ts-ignore +// biome-ignore lint/style/noNamespace: +declare namespace WebSocket { + /** + * Data represents the raw message payload received over the WebSocket. + */ + type RawData = Buffer | ArrayBuffer | Buffer[]; + + /** + * Data represents the message payload received over the WebSocket. + */ + type Data = string | Buffer | ArrayBuffer | Buffer[]; + + /** + * CertMeta represents the accepted types for certificate & key data. + */ + type CertMeta = string | string[] | Buffer | Buffer[]; + + /** + * VerifyClientCallbackSync is a synchronous callback used to inspect the + * incoming message. The return value (boolean) of the function determines + * whether or not to accept the handshake. + */ + type VerifyClientCallbackSync = (info: { + origin: string; + secure: boolean; + req: IncomingMessage; + }) => boolean; + + /** + * VerifyClientCallbackAsync is an asynchronous callback used to inspect the + * incoming message. The return value (boolean) of the function determines + * whether or not to accept the handshake. + */ + type VerifyClientCallbackAsync = ( + info: { origin: string; secure: boolean; req: IncomingMessage }, + callback: ( + res: boolean, + code?: number, + message?: string, + headers?: OutgoingHttpHeaders + ) => void + ) => void; + + interface ClientOptions extends SecureContextOptions { + protocol?: string | undefined; + followRedirects?: boolean | undefined; + generateMask?(mask: Buffer): void; + handshakeTimeout?: number | undefined; + maxRedirects?: number | undefined; + perMessageDeflate?: boolean | PerMessageDeflateOptions | undefined; + localAddress?: string | undefined; + protocolVersion?: number | undefined; + headers?: { [key: string]: string } | undefined; + origin?: string | undefined; + agent?: Agent | undefined; + host?: string | undefined; + family?: number | undefined; + checkServerIdentity?(servername: string, cert: CertMeta): boolean; + rejectUnauthorized?: boolean | undefined; + maxPayload?: number | undefined; + skipUTF8Validation?: boolean | undefined; + } + + interface PerMessageDeflateOptions { + serverNoContextTakeover?: boolean | undefined; + clientNoContextTakeover?: boolean | undefined; + serverMaxWindowBits?: number | undefined; + clientMaxWindowBits?: number | undefined; + zlibDeflateOptions?: + | { + flush?: number | undefined; + finishFlush?: number | undefined; + chunkSize?: number | undefined; + windowBits?: number | undefined; + level?: number | undefined; + memLevel?: number | undefined; + strategy?: number | undefined; + dictionary?: Buffer | Buffer[] | DataView | undefined; + info?: boolean | undefined; + } + | undefined; + zlibInflateOptions?: ZlibOptions | undefined; + threshold?: number | undefined; + concurrencyLimit?: number | undefined; + } + + interface Event { + type: string; + target: WebSocket; + } + + interface ErrorEvent { + error: any; + message: string; + type: string; + target: WebSocket; + } + + interface CloseEvent { + wasClean: boolean; + code: number; + reason: string; + type: string; + target: WebSocket; + } + + interface MessageEvent { + data: Data; + type: string; + target: WebSocket; + } + + interface EventListenerOptions { + once?: boolean | undefined; + } + + interface ServerOptions { + host?: string | undefined; + port?: number | undefined; + backlog?: number | undefined; + server?: HTTPServer | HTTPSServer | undefined; + verifyClient?: + | VerifyClientCallbackAsync + | VerifyClientCallbackSync + | undefined; + handleProtocols?: ( + protocols: Set, + request: IncomingMessage + ) => string | false; + path?: string | undefined; + noServer?: boolean | undefined; + clientTracking?: boolean | undefined; + perMessageDeflate?: boolean | PerMessageDeflateOptions | undefined; + maxPayload?: number | undefined; + skipUTF8Validation?: boolean | undefined; + WebSocket?: typeof WebSocket.WebSocket | undefined; + } + + interface AddressInfo { + address: string; + family: string; + port: number; + } + + // WebSocket Server + class Server extends EventEmitter { + options: ServerOptions; + path: string; + clients: Set; + + constructor(options?: ServerOptions, callback?: () => void); + + address(): AddressInfo | string; + close(cb?: (err?: Error) => void): void; + handleUpgrade( + request: IncomingMessage, + socket: Duplex, + upgradeHead: Buffer, + callback: (client: T, request: IncomingMessage) => void + ): void; + shouldHandle(request: IncomingMessage): boolean | Promise; + + // Events + on( + event: 'connection', + cb: (this: Server, socket: T, request: IncomingMessage) => void + ): this; + on(event: 'error', cb: (this: Server, error: Error) => void): this; + on( + event: 'headers', + cb: (this: Server, headers: string[], request: IncomingMessage) => void + ): this; + on(event: 'close' | 'listening', cb: (this: Server) => void): this; + on( + event: string | symbol, + listener: (this: Server, ...args: any[]) => void + ): this; + + once( + event: 'connection', + cb: (this: Server, socket: T, request: IncomingMessage) => void + ): this; + once(event: 'error', cb: (this: Server, error: Error) => void): this; + once( + event: 'headers', + cb: (this: Server, headers: string[], request: IncomingMessage) => void + ): this; + once(event: 'close' | 'listening', cb: (this: Server) => void): this; + once( + event: string | symbol, + listener: (this: Server, ...args: any[]) => void + ): this; + + off( + event: 'connection', + cb: (this: Server, socket: T, request: IncomingMessage) => void + ): this; + off(event: 'error', cb: (this: Server, error: Error) => void): this; + off( + event: 'headers', + cb: (this: Server, headers: string[], request: IncomingMessage) => void + ): this; + off(event: 'close' | 'listening', cb: (this: Server) => void): this; + off( + event: string | symbol, + listener: (this: Server, ...args: any[]) => void + ): this; + + addListener( + event: 'connection', + cb: (client: T, request: IncomingMessage) => void + ): this; + addListener(event: 'error', cb: (err: Error) => void): this; + addListener( + event: 'headers', + cb: (headers: string[], request: IncomingMessage) => void + ): this; + addListener(event: 'close' | 'listening', cb: () => void): this; + addListener( + event: string | symbol, + listener: (...args: any[]) => void + ): this; + + removeListener(event: 'connection', cb: (client: T) => void): this; + removeListener(event: 'error', cb: (err: Error) => void): this; + removeListener( + event: 'headers', + cb: (headers: string[], request: IncomingMessage) => void + ): this; + removeListener(event: 'close' | 'listening', cb: () => void): this; + removeListener( + event: string | symbol, + listener: (...args: any[]) => void + ): this; + } + + const WebSocketServer: typeof Server; + interface WebSocketServer extends Server {} // tslint:disable-line no-empty-interface + const WebSocket: typeof WebSocketAlias; + interface WebSocket extends WebSocketAlias {} // tslint:disable-line no-empty-interface + + // WebSocket stream + function createWebSocketStream( + websocket: WebSocket, + options?: DuplexOptions + ): Duplex; +} + +// export = WebSocket +export { WebSocket, WebSocketAlias }; diff --git a/packages/core/src/utils/build.ts b/packages/core/src/utils/build.ts deleted file mode 100644 index b7ee1530bd..0000000000 --- a/packages/core/src/utils/build.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { performance } from 'node:perf_hooks'; -import { Logger } from './logger.js'; - -import { - FARM_TARGET_NODE_ENVS, - ResolvedUserConfig, - clearScreen -} from '../index.js'; -import { logError } from '../server/error.js'; -import { PersistentCacheBrand, bold, green } from './color.js'; - -interface CompilerHandlerOptions { - clear?: boolean; -} - -export async function compilerHandler( - callback: () => Promise, - config: ResolvedUserConfig, - logger: Logger, - options?: CompilerHandlerOptions -) { - const IS_TARGET_NODE = FARM_TARGET_NODE_ENVS.includes( - config.compilation.output.targetEnv - ); - IS_TARGET_NODE && options?.clear && clearScreen(); - const { persistentCache, output } = config.compilation; - const startTime = performance.now(); - - try { - await callback(); - } catch (error) { - logger.error(`Compiler ${logError(error, false)}`); - return; - } - - const elapsedTime = Math.floor(performance.now() - startTime); - const persistentCacheText = persistentCache ? bold(PersistentCacheBrand) : ''; - logger.info( - `Build completed in ${bold( - green(`${elapsedTime}ms`) - )} ${persistentCacheText} Resources emitted to ${bold(green(output.path))}.` - ); -} diff --git a/packages/core/src/utils/cacheDir.ts b/packages/core/src/utils/cacheDir.ts new file mode 100644 index 0000000000..18b4b1692e --- /dev/null +++ b/packages/core/src/utils/cacheDir.ts @@ -0,0 +1,11 @@ +import fs from 'node:fs'; + +export async function isCacheDirExists(dir: string): Promise { + try { + const hasCacheDir = fs.readdirSync(dir, { withFileTypes: true }); + + return !!(hasCacheDir && hasCacheDir.length); + } catch (_) { + return false; + } +} diff --git a/packages/core/src/utils/debug.ts b/packages/core/src/utils/debug.ts new file mode 100644 index 0000000000..18fdf4af7d --- /dev/null +++ b/packages/core/src/utils/debug.ts @@ -0,0 +1,32 @@ +import debug from 'debug'; + +const DEBUG = process.env.DEBUG; + +interface DebuggerOptions { + onlyWhenFocused?: boolean | string; +} + +export type FarmDebugScope = `farm:${string}`; + +export function createDebugger( + namespace: FarmDebugScope, + options: DebuggerOptions = {} +): debug.Debugger['log'] | undefined { + const log = debug(namespace); + const { onlyWhenFocused } = options; + + let enabled = log.enabled; + + if (enabled && onlyWhenFocused) { + const ns = + typeof onlyWhenFocused === 'string' ? onlyWhenFocused : namespace; + + enabled = !!DEBUG?.includes(ns); + } + + if (enabled) { + return (...args: [string, ...any[]]) => { + log(...args); + }; + } +} diff --git a/packages/core/src/utils/dynamic-resources.ts b/packages/core/src/utils/dynamic-resources.ts index a98f503ec7..72699f0aa0 100644 --- a/packages/core/src/utils/dynamic-resources.ts +++ b/packages/core/src/utils/dynamic-resources.ts @@ -1,4 +1,4 @@ -import type { Resource } from '@farmfe/runtime/src/resource-loader.js'; +import type { Resource } from '@farmfe/runtime'; export function getDynamicResources( dynamicResourcesMap: Record | null diff --git a/packages/core/src/utils/error.ts b/packages/core/src/utils/error.ts index 514563b31b..b73eb804f3 100644 --- a/packages/core/src/utils/error.ts +++ b/packages/core/src/utils/error.ts @@ -1,10 +1,31 @@ export function convertErrorMessage(error: Error) { - let errorMessage = ''; + let errorMessages = []; try { - errorMessage = JSON.parse(error.message).join('\n'); + const parsedErrors = JSON.parse(error.message); + + if (Array.isArray(parsedErrors)) { + errorMessages = parsedErrors.map(parseErrorItem); + } else { + errorMessages = [parseErrorItem(parsedErrors)]; + } + } catch { + errorMessages = [error.message]; + } + + return errorMessages.join('\n'); +} + +function parseErrorItem(item: any): string { + try { + const parsedItem = typeof item === 'string' ? JSON.parse(item) : item; + + if (typeof parsedItem === 'object' && parsedItem !== null) { + return parsedItem.message || JSON.stringify(parsedItem); + } else { + return String(parsedItem); + } } catch { - errorMessage = error.message; + return String(item); } - return errorMessage; } diff --git a/packages/core/src/utils/fsUtils.ts b/packages/core/src/utils/fsUtils.ts new file mode 100644 index 0000000000..214e1ed0d8 --- /dev/null +++ b/packages/core/src/utils/fsUtils.ts @@ -0,0 +1,192 @@ +import { exec } from 'node:child_process'; +import fs from 'node:fs'; +import path from 'node:path'; +import fse from 'fs-extra'; +import { ResolvedUserConfig, normalizePublicDir } from '../config/index.js'; +import { colors } from './color.js'; +import { isWindows, normalizePath, tryStatSync } from './share.js'; + +function isDirectory(path: string): boolean { + const stat = tryStatSync(path); + return stat?.isDirectory() ?? false; +} + +function tryResolveRealFile( + file: string, + preserveSymlinks?: boolean +): string | undefined { + const stat = tryStatSync(file); + if (stat?.isFile()) return getRealPath(file, preserveSymlinks); +} + +function tryResolveRealFileWithExtensions( + filePath: string, + extensions: string[], + preserveSymlinks?: boolean +): string | undefined { + for (const ext of extensions) { + const res = tryResolveRealFile(filePath + ext, preserveSymlinks); + if (res) return res; + } +} + +function tryResolveRealFileOrType( + file: string, + preserveSymlinks?: boolean +): { path?: string; type: 'directory' | 'file' } | undefined { + const fileStat = tryStatSync(file); + if (fileStat?.isFile()) { + return { path: getRealPath(file, preserveSymlinks), type: 'file' }; + } + if (fileStat?.isDirectory()) { + return { type: 'directory' }; + } + return; +} +const windowsNetworkMap = new Map(); + +function windowsMappedRealpathSync(path: string) { + const realPath = fs.realpathSync.native(path); + if (realPath.startsWith('\\\\')) { + for (const [network, volume] of windowsNetworkMap) { + if (realPath.startsWith(network)) + return realPath.replace(network, volume); + } + } + return realPath; +} +function optimizeSafeRealPathSync() { + // Skip if using Node <18.10 due to MAX_PATH issue: https://github.com/vitejs/vite/issues/12931 + const nodeVersion = process.versions.node.split('.').map(Number); + if (nodeVersion[0] < 18 || (nodeVersion[0] === 18 && nodeVersion[1] < 10)) { + safeRealpathSync = fs.realpathSync; + return; + } + // Check the availability `fs.realpathSync.native` + // in Windows virtual and RAM disks that bypass the Volume Mount Manager, in programs such as imDisk + // get the error EISDIR: illegal operation on a directory + try { + fs.realpathSync.native(path.resolve('./')); + } catch (error) { + if (error.message.includes('EISDIR: illegal operation on a directory')) { + safeRealpathSync = fs.realpathSync; + return; + } + } + exec('net use', (error, stdout) => { + if (error) return; + const lines = stdout.split('\n'); + // OK Y: \\NETWORK\Foo Microsoft Windows Network + // OK Z: \\NETWORK\Bar Microsoft Windows Network + for (const line of lines) { + const m = line.match(parseNetUseRE); + if (m) windowsNetworkMap.set(m[3], m[2]); + } + if (windowsNetworkMap.size === 0) { + safeRealpathSync = fs.realpathSync.native; + } else { + safeRealpathSync = windowsMappedRealpathSync; + } + }); +} + +const parseNetUseRE = /^(\w+)? +(\w:) +([^ ]+)\s/; +let firstSafeRealPathSyncRun = false; + +function windowsSafeRealPathSync(path: string): string { + if (!firstSafeRealPathSyncRun) { + optimizeSafeRealPathSync(); + firstSafeRealPathSyncRun = true; + } + return fs.realpathSync(path); +} + +// `fs.realpathSync.native` resolves differently in Windows network drive, +// causing file read errors. skip for now. +// https://github.com/nodejs/node/issues/37737 +export let safeRealpathSync = isWindows + ? windowsSafeRealPathSync + : fs.realpathSync.native; + +function getRealPath(resolved: string, preserveSymlinks?: boolean): string { + if (!preserveSymlinks) { + resolved = safeRealpathSync(resolved); + } + return normalizePath(resolved); +} + +export const commonFsUtils = { + existsSync: fs.existsSync, + isDirectory, + + tryResolveRealFile, + tryResolveRealFileWithExtensions, + tryResolveRealFileOrType +}; + +export async function readFileIfExists(value?: string | Buffer | any[]) { + if (typeof value === 'string') { + return fse.readFile(path.resolve(value)).catch(() => value); + } + return value; +} + +export async function findNodeModulesRecursively( + rootPath: string +): Promise { + const result: string[] = []; + + async function traverse(currentPath: string) { + const items = await fse.readdir(currentPath); + for (const item of items) { + const fullPath = path.join(currentPath, item); + const stats = await fse.stat(fullPath); + + if (stats.isDirectory()) { + if (item === 'node_modules') { + result.push(fullPath); + } else { + await traverse(fullPath); + } + } + } + } + + await traverse(rootPath); + return result; +} + +export async function copyPublicDirectory( + resolvedUserConfig: ResolvedUserConfig +): Promise { + const absPublicDirPath = normalizePublicDir( + resolvedUserConfig.root, + resolvedUserConfig.publicDir + ); + + try { + if (await fse.pathExists(absPublicDirPath)) { + const files = await fse.readdir(absPublicDirPath); + const outputPath = resolvedUserConfig.compilation.output.path; + for (const file of files) { + const publicFile = path.join(absPublicDirPath, file); + const destFile = path.join(outputPath, file); + + if (await fse.pathExists(destFile)) { + continue; + } + await fse.copy(publicFile, destFile); + } + + // resolvedUserConfig.logger.info( + // `Public directory resources copied ${colors.bold( + // colors.green('successfully') + // )}.` + // ); + } + } catch (error) { + resolvedUserConfig.logger.error( + `Error copying public directory: ${error.message}` + ); + } +} diff --git a/packages/core/src/utils/http.ts b/packages/core/src/utils/http.ts index c78a7ce6ec..d3ea56b53c 100644 --- a/packages/core/src/utils/http.ts +++ b/packages/core/src/utils/http.ts @@ -7,9 +7,10 @@ * https://github.com/vitejs/vite/blob/main/LICENSE */ +import { promises as dns } from 'node:dns'; import type { AddressInfo, Server } from 'node:net'; import os from 'node:os'; -import { UserServerConfig } from '../index.js'; +import { ResolvedUserConfig } from '../config/types.js'; export interface ResolvedServerUrls { local: string[]; @@ -38,8 +39,8 @@ export const wildcardHosts = new Set([ export async function resolveServerUrls( server: Server, - options: UserServerConfig, - publicPath?: string + config: ResolvedUserConfig, + type: 'dev' | 'preview' = 'dev' ): Promise { const address = server.address(); const isAddressInfo = (x: any): x is AddressInfo => x?.address; @@ -47,44 +48,38 @@ export async function resolveServerUrls( if (!isAddressInfo(address)) { return { local: [], network: [] }; } - + const serverOptions = type == 'dev' ? config.server : config.server.preview; const local: string[] = []; const network: string[] = []; - const hostname = await resolveHostname(options.host); - const protocol = options.https ? 'https' : 'http'; - const { port } = getAddressHostnamePort(address); - const base = publicPath || ''; - - if (hostname.host !== undefined && !wildcardHosts.has(hostname.host)) { - const url = createServerUrl(protocol, hostname.name, port, base); - if (loopbackHosts.has(hostname.host)) { - local.push(url); - } else { - network.push(url); - } - } else { - const networkInterfaces = Object.values(os.networkInterfaces()).flatMap( - (nInterface) => nInterface || [] - ); - networkInterfaces - .filter( - (detail) => - detail && - detail.address && - (detail.family === 'IPv4' || - // @ts-expect-error Node 18.0 - 18.3 returns number - detail.family === 4) - ) - .forEach((detail) => { - let host = detail.address.replace('127.0.0.1', hostname.name); - host = host.includes(':') ? `[${host}]` : host; - const url = createServerUrl(protocol, host, port, base); - detail.address.includes('127.0.0.1') - ? local.push(url) - : network.push(url); - }); - } - + const hostname = await resolveHostname(serverOptions.host); + const protocol = serverOptions.https ? 'https' : 'http'; + const port = address.port; + const base = config.compilation.output.publicPath; + + // print all network interfaces networkInterfaces() by default + Object.values(os.networkInterfaces()) + .flatMap((nInterface) => nInterface ?? []) + .filter( + (detail) => + detail && + detail.address && + (detail.family === 'IPv4' || + // @ts-expect-error Node 18.0 - 18.3 returns number + detail.family === 4) + ) + .forEach((detail) => { + let host = detail.address.replace('127.0.0.1', hostname.name); + // ipv6 host + if (host.includes(':')) { + host = `[${host}]`; + } + const url = `${protocol}://${host}:${port}${base}`; + if (detail.address.includes('127.0.0.1')) { + local.push(url); + } else { + network.push(url); + } + }); return { local, network }; } @@ -93,34 +88,76 @@ export async function resolveHostname( ): Promise { let host: string | undefined; if (optionsHost === undefined || optionsHost === false) { + // Use a secure default host = 'localhost'; } else if (optionsHost === true) { - host = undefined; + // If passed --host in the CLI without arguments + host = undefined; // undefined typically means 0.0.0.0 or :: (listen on all IPs) } else { host = optionsHost; } - const name = - host === undefined || wildcardHosts.has(host) ? 'localhost' : host; + // Set host name to localhost when possible + let name = host === undefined || wildcardHosts.has(host) ? 'localhost' : host; + + if (host === 'localhost') { + const localhostAddr = await getLocalhostAddressIfDiffersFromDNS(); + if (localhostAddr) { + name = localhostAddr; + } + } return { host, name }; } -function getAddressHostnamePort(server: AddressInfo): { - host: string; - port: number; -} { - const hostname = server.address || 'localhost'; - const port = server.port; - return { host: hostname, port }; -} +/** + * Setup a listener for SIGTERM and SIGINT signals, and call the given callback + * function when either signal is received. + * + * @param callback - callback function to be called when SIGTERM is received + * @returns {void} + */ +export const setupSIGTERMListener = ( + callback: (signal?: 'SIGTERM', exitCode?: number) => Promise +): void => { + process.on('SIGTERM', callback); + process.on('SIGINT', callback); // Handle user interrupt (Ctrl+C) + if (process.env.CI !== 'true') { + process.stdin.on('end', callback); + } +}; + +/** + * Remove a listener for SIGTERM and SIGINT signals. + * + * @param callback - callback function to be removed when SIGTERM is received + */ +export const teardownSIGTERMListener = ( + callback: Parameters[0] +): void => { + process.off('SIGTERM', callback); + process.off('SIGINT', callback); + if (process.env.CI !== 'true') { + process.stdin.off('end', callback); + } +}; -function createServerUrl( - protocol: string, - hostname: string, - port: number, - publicPath: string -): string { - const hostnameName = hostname.includes(':') ? `[${hostname}]` : hostname; - return `${protocol}://${hostnameName}:${port}${publicPath}`; +/** + * Returns resolved localhost address when `dns.lookup` result differs from DNS + * + * `dns.lookup` result is same when defaultResultOrder is `verbatim`. + * Even if defaultResultOrder is `ipv4first`, `dns.lookup` result maybe same. + * For example, when IPv6 is not supported on that machine/network. + */ +export async function getLocalhostAddressIfDiffersFromDNS(): Promise< + string | undefined +> { + const [nodeResult, dnsResult] = await Promise.all([ + dns.lookup('localhost'), + dns.lookup('localhost', { verbatim: true }) + ]); + const isSame = + nodeResult.family === dnsResult.family && + nodeResult.address === dnsResult.address; + return isSame ? undefined : nodeResult.address; } diff --git a/packages/core/src/utils/index.ts b/packages/core/src/utils/index.ts index fcabd962ed..5275536040 100644 --- a/packages/core/src/utils/index.ts +++ b/packages/core/src/utils/index.ts @@ -1,6 +1,5 @@ export * from './share.js'; export * from './logger.js'; -export * from './build.js'; export * from './file.js'; export * from './color.js'; export * from './url.js'; @@ -8,4 +7,7 @@ export * from './path.js'; export * from './publicDir.js'; export * from './rebase-url.js'; export * from './plugin-utils.js'; +export * from './cacheDir.js'; export * from './dynamic-resources.js'; +export * from './utils.js'; +export * from './fsUtils.js'; diff --git a/packages/core/src/utils/json.ts b/packages/core/src/utils/json.ts deleted file mode 100644 index 7353993656..0000000000 --- a/packages/core/src/utils/json.ts +++ /dev/null @@ -1,7 +0,0 @@ -export function safeJsonParse(v: string, defaultValue?: T): T { - try { - return JSON.parse(v); - } catch (error) { - return defaultValue; - } -} diff --git a/packages/core/src/utils/logger.ts b/packages/core/src/utils/logger.ts index 734f87179d..48a4725faa 100644 --- a/packages/core/src/utils/logger.ts +++ b/packages/core/src/utils/logger.ts @@ -1,26 +1,30 @@ -import { Config } from '../types/binding.js'; -import { ColorFunction, PersistentCacheBrand, colors } from './color.js'; -/* eslint-disable @typescript-eslint/no-explicit-any */ -import { pad, version } from './share.js'; +import { __FARM_GLOBAL__ } from '../config/_global.js'; +import { ResolvedUserConfig } from '../config/types.js'; +import { + ColorFunction, + PersistentCacheBrand, + bold, + colors, + green +} from './color.js'; +import { ResolvedServerUrls } from './http.js'; +import { getShortName } from './path.js'; +import { clearScreen, pad, version } from './share.js'; type LogLevelNames = 'trace' | 'debug' | 'info' | 'warn' | 'error'; -enum LogLevel { - Trace = 'trace', - Debug = 'debug', - Info = 'info', - Warn = 'warn', - Error = 'error' -} - export interface ILogger { - trace(message: string): void; - debug(message: string): void; - info(message: string): void; - warn(message: string): void; - warnOnce(message: string): void; - errorOnce(message: string | Error): void; - error(message: string | Error, options?: ErrorOptions): void; + trace(message: string, clearScreen?: Boolean): void; + debug(message: string, clearScreen?: Boolean): void; + info(message: string, clearScreen?: Boolean): void; + warn(message: string, clearScreen?: Boolean): void; + warnOnce(message: string, clearScreen?: Boolean): void; + errorOnce(message: string | Error, clearScreen?: Boolean): void; + error( + message: string | Error, + options?: ErrorOptions, + clearScreen?: Boolean + ): void; } export interface ErrorOptions { @@ -29,9 +33,12 @@ export interface ErrorOptions { error?: Error; } interface LoggerOptions { - name?: string; + prefix?: string; + customLogger?: Logger; + allowClearScreen?: boolean; brandColor?: ColorFunction; exit?: boolean; + timeUnit?: 's' | 'ms'; } const LOGGER_METHOD = { @@ -45,82 +52,133 @@ const infoOnceMessages = new Set(); const errorOnceMessages = new Set(); export class Logger implements ILogger { + prefix: string; + canClearScreen: boolean; + colorMap: { + trace: (input: string) => string; + debug: (input: string) => string; + info: (input: string) => string; + warn: (input: string) => string; + error: (input: string) => string; + }; + + private clear: () => void = () => {}; + private customLogger?: Logger; + private timeUnit: 's' | 'ms'; + constructor( - public options?: LoggerOptions, + { + prefix = 'Farm', + allowClearScreen = true, + customLogger, + timeUnit = 'ms', + brandColor + }: LoggerOptions = {}, private levelValues: Record = { trace: 0, debug: 1, info: 2, warn: 3, error: 4 - }, - private prefix?: string + } ) { - if (!this.options) this.options = {}; + this.canClearScreen = + allowClearScreen && process.stdout.isTTY && !process.env.CI; + this.clear = this.canClearScreen ? clearScreen : () => {}; + this.colorMap = { + trace: colors.green, + debug: colors.debugColor, + info: brandColor ?? colors.brandColor, + warn: colors.yellow, + error: colors.red + }; + this.prefix = prefix; + this.customLogger = customLogger; + this.timeUnit = timeUnit; this.brandPrefix(); } private brandPrefix(color?: (s: string | string[]) => string): void { - const { name = 'Farm' } = this.options; - const formattedName = colors.bold(name); + const formattedName = colors.bold(this.prefix); const formattedPrefix = colors.bold(`[ ${formattedName} ]`); this.prefix = color ? color(formattedPrefix) : formattedPrefix; } + formatTime(duration: number): string { + if (this.timeUnit === 's') { + return `${(duration / 1000).toFixed(3)}s`; + } else { + return `${Math.floor(duration)}ms`; + } + } + private logMessage( level: LogLevelNames, message: string | Error, color?: (s: string | string[]) => string, + clearScreen = false, showBanner = true ): void { - const loggerMethod = - level in LOGGER_METHOD - ? LOGGER_METHOD[level as keyof typeof LOGGER_METHOD] - : 'log'; - if (this.levelValues[level] <= this.levelValues[level]) { - const prefix = showBanner ? this.prefix + ' ' : ''; - const loggerMessage = color ? color(prefix + message) : prefix + message; - console[loggerMethod](loggerMessage); + if (this.customLogger) { + this.customLogger.logMessage(level, message, color, clearScreen); + return; + } + + const minLevel = process.env.LOG_LEVEL || 'info'; + if ( + this.levelValues[level] >= this.levelValues[minLevel as LogLevelNames] + ) { + if (this.canClearScreen && clearScreen) { + this.clear(); + } + const prefix = showBanner ? `${this.prefix} ` : ''; + const prefixColored = this.colorMap[level](prefix); + let loggerMessage: string; + + if (typeof message === 'string') { + const timeRegex = new RegExp(`\\{time:(\\d+(\\.\\d+)?)\\}`, 'g'); + loggerMessage = message.replace(timeRegex, (_, durationStr) => { + const duration = parseFloat(durationStr); + + return this.formatTime(duration); + }); + } else { + loggerMessage = message.message; + } + loggerMessage = color ? color(loggerMessage) : loggerMessage; + + console.log(prefixColored + loggerMessage); } } setPrefix(options: LoggerOptions): void { - if (options.name) { - this.options.name = options.name; + if (options.prefix) { + this.prefix = options.prefix; this.brandPrefix(options.brandColor); } } - trace(message: string): void { - this.brandPrefix(colors.green); - this.logMessage(LogLevel.Trace, message, colors.magenta); + trace(message: string, clearScreen = false): void { + this.logMessage('trace', message, colors.magenta, clearScreen); } - debug(message: string): void { - this.brandPrefix(colors.debugColor); - this.logMessage(LogLevel.Debug, message, colors.blue); + debug(message: string, clearScreen = false): void { + this.logMessage('debug', message, colors.blue, clearScreen); } - info(message: string, iOptions?: LoggerOptions): void { - const options: LoggerOptions | undefined = iOptions; - if (options) { - this.setPrefix(options); - } - if (!options || !options.brandColor) { - this.brandPrefix(colors.brandColor); - } - this.logMessage(LogLevel.Info, message, null); + info(message: string, clearScreen = false): void { + this.logMessage('info', message, null, clearScreen); } - warn(message: string): void { - this.brandPrefix(colors.yellow); - this.logMessage(LogLevel.Warn, message, colors.yellow); + warn(message: string, clearScreen = false): void { + this.logMessage('warn', message, colors.yellow, clearScreen); } - error(message: string | Error, errorOptions?: ErrorOptions): void { - this.brandPrefix(colors.red); - - const effectiveOptions = { ...this.options, ...errorOptions }; + error( + message: string | Error, + errorOptions?: ErrorOptions, + clearScreen = false + ): void { const causeError = errorOptions?.e || errorOptions?.error; let error; @@ -136,30 +194,30 @@ export class Logger implements ILogger { error.message += `\nCaused by: ${causeError.stack ?? causeError}`; } - this.logMessage(LogLevel.Error, error, colors.red); - - if (effectiveOptions.exit) { - process.exit(1); - } + this.logMessage('error', error, colors.red, clearScreen); } - infoOnce(message: string) { + + infoOnce(message: string, clearScreen = false): void { if (!infoOnceMessages.has(message)) { infoOnceMessages.add(message); - this.info(message); + this.info(message, clearScreen); } } - warnOnce(message: string) { + + warnOnce(message: string, clearScreen = false): void { if (!warnOnceMessages.has(message)) { warnOnceMessages.add(message); - this.warn(message); + this.warn(message, clearScreen); } } - errorOnce(message: string | Error) { + + errorOnce(message: string | Error, clearScreen = false): void { if (!errorOnceMessages.has(message)) { errorOnceMessages.add(message); - this.error(message); + this.error(message, undefined, clearScreen); } } + hasErrorLogged(message: string | Error) { return errorOnceMessages.has(message); } @@ -174,7 +232,7 @@ export class NoopLogger extends Logger { setPrefix(_options: LoggerOptions): void {} trace(_message: string): void {} debug(_message: string): void {} - info(_message: string, _iOptions?: LoggerOptions): void {} + info(_message: string): void {} warn(_message: string): void {} error(_message: string | Error, _errorOptions?: ErrorOptions): void { if (_errorOptions.exit) { @@ -197,34 +255,21 @@ export class NoopLogger extends Logger { } } -export function printServerUrls( - urls: any, - logger: Logger, - previewFlag = false -): void { - if (previewFlag) - logger.info(colors.bold(colors.magenta('preview server running at: \n'))); - const colorUrl = (url: string) => - colors.cyan(url.replace(/:(\d+)\//, (_, port) => `:${colors.bold(port)}/`)); - - const logUrl = (url: string, type: string) => - logger.info( - `${colors.bold(colors.magenta('>'))} ${colors.bold(type)}${colors.bold( - colorUrl(url) - )}` - ); - - urls.local.map((url: string) => logUrl(url, 'Local: ')); - urls.network.map((url: string) => logUrl(url, 'Network: ')); -} - export function bootstrapLogger(options?: LoggerOptions): Logger { return new Logger(options); } -export function bootstrap(times: number, config: Config) { - const usePersistentCache = config.config.persistentCache; - const persistentCacheFlag = usePersistentCache +export function bootstrap( + time: number, + config: ResolvedUserConfig, + hasCacheDir: boolean +): void { + if (!__FARM_GLOBAL__.__FARM_RESTART_DEV_SERVER__) { + const shortFile = getShortName(config.configFilePath, config.root); + config.logger.info(`Using config file at ${bold(green(shortFile))}`, true); + } + const hasPersistentCache = config.compilation.persistentCache && hasCacheDir; + const persistentCacheFlag = hasPersistentCache ? colors.bold(PersistentCacheBrand) : ''; @@ -232,10 +277,13 @@ export function bootstrap(times: number, config: Config) { '\n', colors.bold(colors.brandColor(`${'ϟ'} Farm v${version}`)) ); + console.log( `${colors.bold(colors.green(` ✓`))} ${colors.bold( - 'Ready in' - )} ${colors.bold(colors.green(`${times}ms`))} ${persistentCacheFlag}`, + 'Compile in' + )} ${colors.bold( + colors.green(config.logger.formatTime(time)) + )} ${persistentCacheFlag}`, '\n' ); } @@ -261,3 +309,33 @@ function cleanStack(stack: string) { .filter((l) => /^\s*at/.test(l)) .join('\n'); } + +export function printServerUrls( + urls: ResolvedServerUrls, + optionsHost: string | boolean | undefined, + logger: ILogger +): void { + const colorUrl = (url: string) => + colors.cyan(url.replace(/:(\d+)\//, (_, port) => `:${colors.bold(port)}/`)); + for (const url of urls.local) { + logger.info( + `${colors.bold(colors.green('➜ '))} ${colors.bold( + 'Local' + )}: ${colors.bold(colorUrl(url))}` + ); + } + for (const url of urls.network) { + logger.info( + `${colors.bold(colors.green('➜ '))} ${colors.bold( + 'Network' + )}: ${colors.bold(colorUrl(url))}` + ); + } + if (urls.network.length === 0 && optionsHost === undefined) { + logger.info( + colors.dim(` ${colors.green('➜ ')} ${colors.bold('Network')}: use `) + + colors.bold('--host') + + colors.dim(' to expose') + ); + } +} diff --git a/packages/core/src/utils/merge.ts b/packages/core/src/utils/merge.ts index 520431675a..886a3a34b9 100644 --- a/packages/core/src/utils/merge.ts +++ b/packages/core/src/utils/merge.ts @@ -1,5 +1,4 @@ import deepmerge, { Options } from 'deepmerge'; -// eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore ignore type check import { isPlainObject } from 'is-plain-object'; import { isArray } from './share.js'; diff --git a/packages/core/src/utils/path.ts b/packages/core/src/utils/path.ts index 7a8519f3fc..a451eb516d 100644 --- a/packages/core/src/utils/path.ts +++ b/packages/core/src/utils/path.ts @@ -1,3 +1,5 @@ +import path from 'node:path'; + const windowsSlashRE = /\\/g; export function slash(p: string): string { return p.replace(windowsSlashRE, '/'); @@ -14,3 +16,15 @@ const postfixRE = /[?#].*$/; export function stripQueryAndHash(path: string): string { return path.replace(postfixRE, ''); } + +export function removeHashFromPath(path: string): string { + const hashRE = /([_-][a-f0-9]{4,12})(\.[^./]+(\.[^./]+)*)$/; + return path.replace(hashRE, '$2'); +} + +export function getShortName(file: string, root: string): string { + const result = file.startsWith(withTrailingSlash(root)) + ? path.relative(root, file) + : file; + return result; +} diff --git a/packages/core/src/utils/plugin-utils.ts b/packages/core/src/utils/plugin-utils.ts index 9c4fa83935..ac9af23dd5 100644 --- a/packages/core/src/utils/plugin-utils.ts +++ b/packages/core/src/utils/plugin-utils.ts @@ -83,3 +83,8 @@ export function transformAliasWithVite( return acc; }, {}); } + +export function removeSlash(path: string) { + if (!path) return ''; + return path.replace(/^[/\\]+/, ''); +} diff --git a/packages/core/src/utils/publicDir.ts b/packages/core/src/utils/publicDir.ts index 443896bbe6..637675efbc 100644 --- a/packages/core/src/utils/publicDir.ts +++ b/packages/core/src/utils/publicDir.ts @@ -48,6 +48,7 @@ export async function initPublicFiles( fileNames.map((fileName) => fileName.slice(config.publicDir.length)) ); publicFilesMap.set(config, publicFiles); + return publicFiles; } diff --git a/packages/core/src/utils/rebase-url.ts b/packages/core/src/utils/rebase-url.ts index 9061dbeca0..d8a1dbf275 100644 --- a/packages/core/src/utils/rebase-url.ts +++ b/packages/core/src/utils/rebase-url.ts @@ -26,7 +26,7 @@ SOFTWARE. import path from 'node:path'; import fse from 'fs-extra'; -import { normalizeBasePath } from './share.js'; +import { normalizePath } from './share.js'; const nonEscapedDoubleQuoteRe = /(? { return Object.prototype.toString.call(value) === '[object Object]'; } @@ -76,14 +74,23 @@ export const version = JSON.parse( fs.readFileSync(path.resolve(__dirname, '../../package.json')).toString() ).version; +export const VOLUME_RE = /^[A-Z]:/i; + +export const FS_PREFIX = `/@fs/`; + export function normalizePath(id: string): string { - return path.posix.normalize(id); + return path.posix.normalize(isWindows ? id.replace(/\\/g, '/') : id); } -export function normalizeBasePath(basePath: string): string { - return path.posix.normalize( - isWindows ? basePath.replace(/\\/g, '/') : basePath +export function fsPathFromId(id: string): string { + const fsPath = normalizePath( + id.startsWith(FS_PREFIX) ? id.slice(FS_PREFIX.length) : id ); + return fsPath[0] === '/' || VOLUME_RE.test(fsPath) ? fsPath : `/${fsPath}`; +} + +export function fsPathFromUrl(url: string): string { + return fsPathFromId(cleanUrl(url)); } export function arraify(target: T | T[]): T[] { @@ -168,7 +175,7 @@ export function mapTargetEnvValue(config: Config['config']) { return; } - config.output.targetEnv = 'library-browser'; + config.output.targetEnv = 'library'; } } @@ -178,6 +185,25 @@ export function tryStatSync(file: string): fs.Stats | undefined { } catch {} } +export function formatTime(time: number, format: 'ms' | 's' = 'ms'): string { + switch (format) { + case 's': + return `${Math.floor(time) / 1000}s`; + case 'ms': + default: + return `${Math.floor(time)}ms`; + } +} + +export function arrayEqual(a: any[], b: any[]): boolean { + if (a === b) return true; + if (a.length !== b.length) return false; + for (let i = 0; i < a.length; i++) { + if (a[i] !== b[i]) return false; + } + return true; +} + export function isNodeEnv(env: OutputConfig['targetEnv']): boolean { return /^(node|library)(?!-browser)/.test(env); } diff --git a/packages/core/src/utils/trace-dependencies.ts b/packages/core/src/utils/trace-dependencies.ts index 181b5cf803..1ffd52d0f3 100644 --- a/packages/core/src/utils/trace-dependencies.ts +++ b/packages/core/src/utils/trace-dependencies.ts @@ -1,19 +1,17 @@ -import { Compiler } from '../compiler/index.js'; import { convertErrorMessage } from './error.js'; -import { Logger } from './logger.js'; import * as fs from 'node:fs'; -import type { Config } from '../types/binding.js'; +import { createInlineCompiler } from '../compiler/index.js'; +import { ResolvedUserConfig } from '../config/types.js'; -function createTraceDepCompiler(entry: string, logger: Logger) { +function createTraceDepCompiler(entry: string) { const config = getDefaultTraceDepCompilerConfig(entry); - config.config.progress = false; - return new Compiler(config, logger); + + return createInlineCompiler(config); } export async function traceDependencies( - configFilePath: string, - logger: Logger + configFilePath: string ): Promise { try { // maybe not find config from local @@ -23,7 +21,7 @@ export async function traceDependencies( return []; } - const compiler = createTraceDepCompiler(configFilePath, logger); + const compiler = createTraceDepCompiler(configFilePath); const files = (await compiler.traceDependencies()) as string[]; return files; } catch (error) { @@ -32,12 +30,15 @@ export async function traceDependencies( } } -function getDefaultTraceDepCompilerConfig(entry: string): Config { +function getDefaultTraceDepCompilerConfig(entry: string): ResolvedUserConfig { return { - config: { + compilation: { input: { index: entry }, + output: { + targetEnv: 'library' + }, resolve: { autoExternalFailedResolve: true }, @@ -46,6 +47,7 @@ function getDefaultTraceDepCompilerConfig(entry: string): Config { presetEnv: false, persistentCache: false, minify: false, + progress: false, lazyCompilation: false }, jsPlugins: [ diff --git a/packages/core/src/utils/url.ts b/packages/core/src/utils/url.ts index edb507354c..f51b181d1f 100644 --- a/packages/core/src/utils/url.ts +++ b/packages/core/src/utils/url.ts @@ -2,3 +2,20 @@ const postfixRE = /[?#].*$/; export function cleanUrl(url: string): string { return url.replace(postfixRE, ''); } + +const importQueryRE = /(\?|&)import=?(?:&|$)/; +export const isImportRequest = (url: string): boolean => + importQueryRE.test(url); + +const trailingSeparatorRE = /[?&]$/; +export function removeImportQuery(url: string): string { + return url.replace(importQueryRE, '$1').replace(trailingSeparatorRE, ''); +} + +export const knownJavascriptExtensionRE = /\.[tj]sx?$/; + +export const urlRE = /(\?|&)url(?:&|$)/; + +export function removeLeadingSlash(str: string): string { + return str[0] === '/' ? str.slice(1) : str; +} diff --git a/packages/core/src/utils/utils.ts b/packages/core/src/utils/utils.ts new file mode 100644 index 0000000000..32aa994dae --- /dev/null +++ b/packages/core/src/utils/utils.ts @@ -0,0 +1,13 @@ +import { Server as DevServer } from '../server/index.js'; +import type { PreviewServer } from '../server/preview.js'; + +export function safeJsonParse(v: string, defaultValue?: T): T { + try { + return JSON.parse(v); + } catch (error) { + return defaultValue; + } +} + +export const isDevServer = (app: DevServer | PreviewServer): app is DevServer => + app instanceof DevServer; diff --git a/packages/core/src/watcher/config-watcher.ts b/packages/core/src/watcher/config-watcher.ts deleted file mode 100644 index de1cd661e2..0000000000 --- a/packages/core/src/watcher/config-watcher.ts +++ /dev/null @@ -1,62 +0,0 @@ -import { existsSync } from 'fs'; -import { FSWatcher } from 'chokidar'; -import { ResolvedUserConfig } from '../config/index.js'; -import { createWatcher } from './create-watcher.js'; - -export class ConfigWatcher { - private watcher: FSWatcher; - private _close = false; - - constructor(private resolvedUserConfig: ResolvedUserConfig) { - if (!resolvedUserConfig) { - throw new Error( - 'Invalid resolvedUserConfig provided to Farm JsConfigWatcher' - ); - } - } - - watch(callback: (file: string[]) => void) { - async function handle(file: string[]) { - callback(file); - } - - const watchedFilesSet = new Set([ - ...(this.resolvedUserConfig.envFiles ?? []), - ...(this.resolvedUserConfig.configFileDependencies ?? []), - ...(this.resolvedUserConfig.configFilePath - ? [this.resolvedUserConfig.configFilePath] - : []) - ]); - - const watchedFiles = Array.from(watchedFilesSet).filter( - (file) => file && existsSync(file) - ); - const chokidarOptions = { - awaitWriteFinish: - process.platform === 'linux' - ? undefined - : { - stabilityThreshold: 10, - pollInterval: 80 - } - }; - this.watcher = createWatcher( - this.resolvedUserConfig, - watchedFiles, - chokidarOptions - ); - - this.watcher.on('change', (path) => { - if (this._close) return; - if (watchedFiles.includes(path)) { - handle([path]); - } - }); - return this; - } - - close() { - this._close = true; - this.watcher = null; - } -} diff --git a/packages/core/src/watcher/create-watcher.ts b/packages/core/src/watcher/create-watcher.ts deleted file mode 100644 index 4877aae249..0000000000 --- a/packages/core/src/watcher/create-watcher.ts +++ /dev/null @@ -1,63 +0,0 @@ -import path from 'node:path'; - -import chokidar, { FSWatcher, WatchOptions } from 'chokidar'; -import glob from 'fast-glob'; - -import { ResolvedUserConfig } from '../index.js'; - -function resolveChokidarOptions( - config: ResolvedUserConfig, - insideChokidarOptions: WatchOptions -) { - const { ignored = [], ...userChokidarOptions } = - config.server?.hmr?.watchOptions ?? {}; - let cacheDir = path.resolve(config.root, 'node_modules', '.farm', 'cache'); - - if ( - typeof config.compilation?.persistentCache === 'object' && - config.compilation.persistentCache.cacheDir - ) { - cacheDir = config.compilation.persistentCache.cacheDir; - - if (!path.isAbsolute(cacheDir)) { - cacheDir = path.resolve(config.root, cacheDir); - } - } - - const options: WatchOptions = { - ignored: [ - '**/.git/**', - '**/node_modules/**', - '**/test-results/**', // Playwright - glob.escapePath(cacheDir) + '/**', - glob.escapePath( - path.resolve(config.root, config.compilation.output.path) - ) + '/**', - ...(Array.isArray(ignored) ? ignored : [ignored]) - ], - ignoreInitial: true, - ignorePermissionErrors: true, - // for windows and macos, we need to wait for the file to be written - awaitWriteFinish: - process.platform === 'linux' - ? undefined - : { - stabilityThreshold: 10, - pollInterval: 10 - }, - ...userChokidarOptions, - ...insideChokidarOptions - }; - - return options; -} - -export function createWatcher( - config: ResolvedUserConfig, - files: string[], - chokidarOptions?: WatchOptions -): FSWatcher { - const options = resolveChokidarOptions(config, chokidarOptions); - - return chokidar.watch(files, options); -} diff --git a/packages/core/src/watcher/index.ts b/packages/core/src/watcher/index.ts index f277289426..99168a42e0 100644 --- a/packages/core/src/watcher/index.ts +++ b/packages/core/src/watcher/index.ts @@ -1,32 +1,68 @@ -import { createRequire } from 'node:module'; +import EventEmitter from 'node:events'; +import { existsSync } from 'node:fs'; +import path from 'node:path'; -import { FSWatcher } from 'chokidar'; +import chokidar from 'chokidar'; +import type { FSWatcher, WatchOptions } from 'chokidar'; +import glob from 'fast-glob'; import { Compiler } from '../compiler/index.js'; -import { Server } from '../server/index.js'; -import { Logger, compilerHandler } from '../utils/index.js'; +import { createInlineCompiler } from '../compiler/index.js'; +import { createDebugger } from '../utils/debug.js'; +import { convertErrorMessage } from '../utils/error.js'; +import { arraify, bold, green, normalizePath } from '../utils/index.js'; -import { existsSync } from 'node:fs'; import type { ResolvedUserConfig } from '../config/index.js'; -import type { JsUpdateResult } from '../types/binding.js'; -import { createWatcher } from './create-watcher.js'; - -interface ImplFileWatcher { - watch(): Promise; +import type { + JsUpdateResult, + PersistentCacheConfig +} from '../types/binding.js'; + +export const debugWatcher = createDebugger('farm:watcher'); + +interface IWatcher { + resolvedWatchOptions: WatchOptions; + extraWatchedFiles: string[]; + getInternalWatcher(): FSWatcher; + filterWatchFile(file: string, root: string): boolean; + getExtraWatchedFiles(compiler?: Compiler | null): string[]; + watchExtraFiles(): void; + createWatcher(): Promise; + resolveChokidarOptions(): void; + close(): Promise; } -export class FileWatcher implements ImplFileWatcher { - private _root: string; +export default class Watcher extends EventEmitter implements IWatcher { + private watchedFiles = new Set(); + public resolvedWatchOptions: WatchOptions; + public extraWatchedFiles: string[] = []; private _watcher: FSWatcher; - private _close = false; - private _watchedFiles = new Set(); - constructor( - public serverOrCompiler: Server | Compiler, - public options: ResolvedUserConfig, - private _logger: Logger - ) { - this._root = options.root; + constructor(public config: ResolvedUserConfig) { + super(); + this.resolveChokidarOptions(); + } + + on( + event: 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir', + listener: (path: string) => void + ): this { + this._watcher.on(event, listener); + return this; + } + + add(paths: string | ReadonlyArray): this { + this._watcher.add(paths); + return this; + } + + unwatch(paths: string | ReadonlyArray): this { + this._watcher.unwatch(paths); + return this; + } + + getWatched(): { [directory: string]: string[] } { + return this._watcher.getWatched(); } getInternalWatcher() { @@ -34,126 +70,176 @@ export class FileWatcher implements ImplFileWatcher { } filterWatchFile(file: string, root: string): boolean { - const suffix = process.platform === 'win32' ? '\\' : '/'; - + const separator = process.platform === 'win32' ? '\\' : '/'; return ( - !file.startsWith(`${root}${suffix}`) && - !file.includes(`node_modules${suffix}`) && + !file.startsWith(`${root}${separator}`) && !file.includes('\0') && existsSync(file) ); } - getExtraWatchedFiles() { - const compiler = this.getCompilerFromServerOrCompiler( - this.serverOrCompiler - ); - - return [ - ...compiler.resolvedModulePaths(this._root), + getExtraWatchedFiles(compiler?: Compiler | null) { + this.extraWatchedFiles = [ + ...compiler.resolvedModulePaths(this.config.root), ...compiler.resolvedWatchPaths() - ].filter((file) => this.filterWatchFile(file, this._root)); + ].filter((file) => this.filterWatchFile(file, this.config.root)); + return this.extraWatchedFiles; } watchExtraFiles() { - const files = this.getExtraWatchedFiles(); - - for (const file of files) { - if (!this._watchedFiles.has(file)) { + this.extraWatchedFiles.forEach((file) => { + if (!this.watchedFiles.has(file)) { this._watcher.add(file); - this._watchedFiles.add(file); + this.watchedFiles.add(file); } - } + }); } - async watch() { - // Determine how to compile the project - const compiler = this.getCompilerFromServerOrCompiler( - this.serverOrCompiler - ); + async createWatcher() { + const compiler = await createInlineCompiler(this.config, { + progress: false + }); + const enabledWatcher = this.config.watch !== null; + const files = [this.config.root, ...this.getExtraWatchedFiles(compiler)]; - const handlePathChange = async (path: string): Promise => { - if (this._close) { - return; - } + this._watcher = enabledWatcher + ? (chokidar.watch(files, this.resolvedWatchOptions) as FSWatcher) + : new NoopWatcher(this.resolvedWatchOptions); + } - try { - if (this.serverOrCompiler instanceof Server) { - await this.serverOrCompiler.hmrEngine.hmrUpdate(path); - } - - if ( - this.serverOrCompiler instanceof Compiler && - this.serverOrCompiler.hasModule(path) - ) { - compilerHandler( - async () => { - const result = await compiler.update([path], true); - handleUpdateFinish(result); - compiler.writeResourcesToDisk(); + resolveChokidarOptions() { + const userWatchOptions = this.config.watch; + const { ignored: ignoredList, ...otherOptions } = + typeof userWatchOptions === 'object' ? userWatchOptions : {}; + const cacheDir = ( + this.config.compilation.persistentCache as PersistentCacheConfig + ).cacheDir; + const ignored: WatchOptions['ignored'] = [ + '**/.git/**', + '**/node_modules/**', + '**/test-results/**', // Playwright + glob.escapePath( + path.resolve(this.config.root, this.config.compilation.output.path) + ) + '/**', + cacheDir ? glob.escapePath(cacheDir) + '/**' : undefined, + ...arraify(ignoredList || []) + ].filter(Boolean); + + this.resolvedWatchOptions = { + ignored, + ignoreInitial: true, + ignorePermissionErrors: true, + awaitWriteFinish: + process.platform === 'linux' + ? undefined + : { + stabilityThreshold: 10, + pollInterval: 10 }, - this.options, - this._logger, - { clear: true } - ); - } - } catch (error) { - this._logger.error(error); - } + ...otherOptions }; + } + + async close() { + if (this._watcher) { + debugWatcher?.('close watcher'); + await this._watcher.close(); + this._watcher = null; + } + } +} - const watchedFiles = this.getExtraWatchedFiles(); +class NoopWatcher extends EventEmitter implements FSWatcher { + constructor(public options: WatchOptions) { + super(); + } - const files = [this.options.root, ...watchedFiles]; - this._watchedFiles = new Set(files); - this._watcher = createWatcher(this.options, files); + add() { + return this; + } - this._watcher.on('change', (path) => { - if (this._close) return; - handlePathChange(path); - }); + unwatch() { + return this; + } + getWatched() { + return {}; + } + + ref() { + return this; + } + + unref() { + return this; + } + + async close() { + // noop + } +} + +export async function handlerWatcher( + resolvedUserConfig: ResolvedUserConfig, + compiler: Compiler +) { + const logger = resolvedUserConfig.logger; + const watcher = new Watcher(resolvedUserConfig); + await watcher.createWatcher(); + watcher.on('change', async (file: string | string[] | any) => { + file = normalizePath(file); + // TODO restart with node side v2.0 we may be think about this feature + // const shortFile = getShortName(file, resolvedUserConfig.root); + // const isConfigFile = resolvedUserConfig.configFilePath === file; + // const isConfigDependencyFile = + // resolvedUserConfig.configFileDependencies.some((name) => file === name); + // const isEnvFile = resolvedUserConfig.envFiles.some((name) => file === name); + // if (isConfigFile || isConfigDependencyFile || isEnvFile) { + // __FARM_GLOBAL__.__FARM_RESTART_DEV_SERVER__ = true; + // resolvedUserConfig.logger.info( + // `${bold(green(shortFile))} changed, Bundler Config is being reloaded`, + // true + // ); + // TODO then rebuild node side + // } const handleUpdateFinish = (updateResult: JsUpdateResult) => { const added = [ ...updateResult.added, ...updateResult.extraWatchResult.add ].map((addedModule) => { const resolvedPath = compiler.transformModulePath( - this._root, + resolvedUserConfig.root, addedModule ); return resolvedPath; }); + const filteredAdded = added.filter((file) => - this.filterWatchFile(file, this._root) + watcher.filterWatchFile(file, resolvedUserConfig.root) ); if (filteredAdded.length > 0) { - this._watcher.add(filteredAdded); + watcher.add(filteredAdded); } }; - if (this.serverOrCompiler instanceof Server) { - this.serverOrCompiler.hmrEngine?.onUpdateFinish(handleUpdateFinish); + try { + const start = performance.now(); + const result = await compiler.update([file], true); + const elapsedTime = Math.floor(performance.now() - start); + logger.info( + `update completed in ${bold( + green(`${logger.formatTime(elapsedTime)}`) + )} Resources emitted to ${bold( + green(resolvedUserConfig.compilation.output.path) + )}.` + ); + handleUpdateFinish(result); + compiler.writeResourcesToDisk(); + } catch (error) { + resolvedUserConfig.logger.error( + `Farm Update Error: ${convertErrorMessage(error)}` + ); } - } - - private getCompilerFromServerOrCompiler( - serverOrCompiler: Server | Compiler - ): Compiler { - return serverOrCompiler instanceof Server - ? serverOrCompiler.getCompiler() - : serverOrCompiler; - } - - close() { - this._close = true; - this._watcher = null; - this.serverOrCompiler = null; - } -} - -export function clearModuleCache(modulePath: string) { - const _require = createRequire(import.meta.url); - delete _require.cache[_require.resolve(modulePath)]; + }); } diff --git a/packages/core/tests/common.ts b/packages/core/tests/common.ts index ef997a5a74..72346e06c0 100644 --- a/packages/core/tests/common.ts +++ b/packages/core/tests/common.ts @@ -49,9 +49,8 @@ export async function getCompiler( const compilationConfig = await normalizeUserCompilationConfig( resolvedUserConfig, - userConfig, - new Logger(), - 'production' + 'production', + new Logger() ); return new Compiler({ diff --git a/packages/core/tests/config/index.spec.ts b/packages/core/tests/config/index.spec.ts index cd92fbef9d..ca29a97d1e 100644 --- a/packages/core/tests/config/index.spec.ts +++ b/packages/core/tests/config/index.spec.ts @@ -48,11 +48,8 @@ describe('mergeFarmCliConfig', () => { describe('normalizeUserCompilationConfig', () => { test('with default', async () => { let config = await normalizeUserCompilationConfig( - {}, - {}, - new NoopLogger(), - 'development', - true + { logger: new NoopLogger() }, + 'development' ); expect(config.input).toEqual({}); @@ -60,31 +57,43 @@ describe('mergeFarmCliConfig', () => { test('normalizeUserCompilationConfig without default and userConfig.compilation.input', async () => { expect(async () => { - await normalizeUserCompilationConfig( - {}, - {}, - new NoopLogger(), - 'development', - false - ); + await normalizeUserCompilationConfig({}, 'development'); }).rejects.toThrowError(); let config = await normalizeUserCompilationConfig( - {}, { + logger: new NoopLogger(), compilation: { input: { index: 'index.ts' } } }, - new NoopLogger(), - 'development', - false + 'development' ); expect(config.input).toEqual({ index: 'index.ts' }); }); + + test('concatenateModule should conflict by mode', async () => { + let config = await normalizeUserCompilationConfig( + { + compilation: { concatenateModules: true } + }, + 'development' + ); + + expect(config.concatenateModules).toBeFalsy(); + + config = await normalizeUserCompilationConfig( + { + compilation: { concatenateModules: true } + }, + 'production' + ); + + expect(config.concatenateModules).toBeTruthy(); + }); }); }); diff --git a/packages/core/tests/fixtures/json/index.ts b/packages/core/tests/fixtures/json/index.ts index 3e30c9fd38..ffecd07447 100644 --- a/packages/core/tests/fixtures/json/index.ts +++ b/packages/core/tests/fixtures/json/index.ts @@ -1,6 +1,5 @@ import json1 from './json1.json'; -// eslint-disable-next-line @typescript-eslint/no-var-requires const json2 = require('./json2.json'); const json1Name = json1.name; diff --git a/packages/core/tests/js-plugin-hooks/__snapshots__/augment-resource-hash-generate-resources.spec.ts.snap b/packages/core/tests/js-plugin-hooks/__snapshots__/augment-resource-hash-generate-resources.spec.ts.snap index ff85ee35de..3bfb451f00 100644 --- a/packages/core/tests/js-plugin-hooks/__snapshots__/augment-resource-hash-generate-resources.spec.ts.snap +++ b/packages/core/tests/js-plugin-hooks/__snapshots__/augment-resource-hash-generate-resources.spec.ts.snap @@ -3,7 +3,7 @@ exports[`Js Plugin Execution - augmentResourceHash 1`] = ` [ "FARM_RUNTIME_runtime", - "index.36ffa29d.js", + "index.d4c2c502.js", ] `; @@ -19,7 +19,7 @@ exports[`Js Plugin Execution - augmentResourceHash 2`] = ` "isEntry": true, "isImplicitEntry": false, }, - "id": "index_eab4_js", + "id": "index_eab4", "map": null, "moduleIds": [ "index.ts?foo=bar", @@ -33,7 +33,7 @@ exports[`Js Plugin Execution - augmentResourceHash 2`] = ` "renderedMap": null, }, }, - "name": "index_eab4", + "name": "index", "resourcePotType": "js", } `; @@ -41,6 +41,6 @@ exports[`Js Plugin Execution - augmentResourceHash 2`] = ` exports[`Js Plugin Execution - augmentResourceHash 3`] = ` [ "FARM_RUNTIME_runtime", - "index.df4c9e8c.js", + "index.cbe2c1dd.js", ] `; diff --git a/packages/core/tests/js-plugin-hooks/__snapshots__/render-resource-pot.spec.ts.snap b/packages/core/tests/js-plugin-hooks/__snapshots__/render-resource-pot.spec.ts.snap index 32ff794708..d3086cb0f4 100644 --- a/packages/core/tests/js-plugin-hooks/__snapshots__/render-resource-pot.spec.ts.snap +++ b/packages/core/tests/js-plugin-hooks/__snapshots__/render-resource-pot.spec.ts.snap @@ -12,7 +12,7 @@ exports[`Js Plugin Execution - renderResourcePot 1`] = ` "isEntry": true, "isImplicitEntry": false, }, - "id": "index_eab4_js", + "id": "index_eab4", "map": null, "moduleIds": [ "index.ts?foo=bar", @@ -26,7 +26,7 @@ exports[`Js Plugin Execution - renderResourcePot 1`] = ` "renderedMap": null, }, }, - "name": "index_eab4", + "name": "index", "resourcePotType": "js", } `; diff --git a/packages/core/tsconfig.build.json b/packages/core/tsconfig.build.json index fb6a068b7b..03d4b31f83 100644 --- a/packages/core/tsconfig.build.json +++ b/packages/core/tsconfig.build.json @@ -3,7 +3,9 @@ "compilerOptions": { "rootDir": "src", "outDir": "dist", - "composite": true + "composite": true, + "noUnusedLocals": false, + "noUnusedParameters": false }, "include": ["src/**/*.ts", "binding/**/*.d.ts"], "exclude": ["src/**/*.spec.ts"], diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index d3ba2eab23..19af35376e 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -1,4 +1,7 @@ { "extends": "../../tsconfig.base.json", - "exclude": ["node_modules"] + "exclude": ["node_modules"], + "compilerOptions": { + "outDir": "dist" + } } diff --git a/packages/create-farm-plugin/bin/create-farm-plugin.mjs b/packages/create-farm-plugin/bin/create-farm-plugin.mjs old mode 100644 new mode 100755 diff --git a/packages/create-farm-plugin/package.json b/packages/create-farm-plugin/package.json index b92a4fd62b..528e5f36dd 100644 --- a/packages/create-farm-plugin/package.json +++ b/packages/create-farm-plugin/package.json @@ -38,8 +38,6 @@ "url": "https://github.com/farm-fe/farm" }, "devDependencies": { - "@farmfe/cli": "workspace:*", - "@farmfe/core": "workspace:*", "@farmfe/utils": "workspace:*", "@types/minimist": "^1.2.2", "@types/prompts": "^2.4.4", diff --git a/packages/create-farm-plugin/templates/js/gitignore b/packages/create-farm-plugin/templates/js/gitignore index d9c2bd2a3e..ca90619c22 100644 --- a/packages/create-farm-plugin/templates/js/gitignore +++ b/packages/create-farm-plugin/templates/js/gitignore @@ -54,9 +54,6 @@ typings/ # Optional npm cache directory .npm -# Optional eslint cache -.eslintcache - # Microbundle cache .rpt2_cache/ .rts2_cache_cjs/ diff --git a/packages/create-farm-plugin/templates/rust/Cargo.toml b/packages/create-farm-plugin/templates/rust/Cargo.toml index 9708f64603..93bb8a096b 100644 --- a/packages/create-farm-plugin/templates/rust/Cargo.toml +++ b/packages/create-farm-plugin/templates/rust/Cargo.toml @@ -8,5 +8,4 @@ crate-type = ["cdylib", "rlib"] [dependencies] farmfe_core = { version = "*" } -farmfe_toolkit_plugin_types = { version = "*" } farmfe_macro_plugin = { version = "*" } diff --git a/packages/create-farm-plugin/templates/rust/gitignore b/packages/create-farm-plugin/templates/rust/gitignore index 50e4f22feb..56b935e15d 100644 --- a/packages/create-farm-plugin/templates/rust/gitignore +++ b/packages/create-farm-plugin/templates/rust/gitignore @@ -54,9 +54,6 @@ typings/ # Optional npm cache directory .npm -# Optional eslint cache -.eslintcache - # Microbundle cache .rpt2_cache/ .rts2_cache_cjs/ diff --git a/packages/create-farm-plugin/templates/rust/rust-toolchain.toml b/packages/create-farm-plugin/templates/rust/rust-toolchain.toml index 0eb96b51af..4e5de48e8f 100644 --- a/packages/create-farm-plugin/templates/rust/rust-toolchain.toml +++ b/packages/create-farm-plugin/templates/rust/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2024-04-16" +channel = "nightly-2024-10-07" components = ["clippy", "rustfmt", "rust-src", "rustc-dev"] diff --git a/packages/create-farm/.gitignore b/packages/create-farm/.gitignore index 5e2577b357..0612261e4b 100644 --- a/packages/create-farm/.gitignore +++ b/packages/create-farm/.gitignore @@ -54,9 +54,6 @@ typings/ # Optional npm cache directory .npm -# Optional eslint cache -.eslintcache - # Microbundle cache .rpt2_cache/ .rts2_cache_cjs/ diff --git a/packages/create-farm/build.rs b/packages/create-farm/build.rs index 9fc2367889..1f866b6a3c 100644 --- a/packages/create-farm/build.rs +++ b/packages/create-farm/build.rs @@ -1,5 +1,5 @@ extern crate napi_build; fn main() { - napi_build::setup(); + napi_build::setup(); } diff --git a/packages/create-farm/create-farm.js b/packages/create-farm/create-farm.js old mode 100644 new mode 100755 diff --git a/packages/create-farm/index.d.ts b/packages/create-farm/index.d.ts index bb8ba2579e..887208414d 100644 --- a/packages/create-farm/index.d.ts +++ b/packages/create-farm/index.d.ts @@ -1,5 +1,4 @@ /* tslint:disable */ -/* eslint-disable */ /* auto-generated by NAPI-RS */ diff --git a/packages/create-farm/index.js b/packages/create-farm/index.js index 18b7e75c45..e476e3e752 100644 --- a/packages/create-farm/index.js +++ b/packages/create-farm/index.js @@ -1,5 +1,4 @@ /* tslint:disable */ -/* eslint-disable */ /* prettier-ignore */ /* auto-generated by NAPI-RS */ diff --git a/packages/create-farm/src/lib.rs b/packages/create-farm/src/lib.rs index 4f10954195..7d22679220 100644 --- a/packages/create-farm/src/lib.rs +++ b/packages/create-farm/src/lib.rs @@ -1,5 +1,5 @@ #[allow(unused)] #[napi_derive::napi] fn run(args: Vec, bin_name: Option, pkg_manager: Option) { - create_farm::run(args, bin_name, pkg_manager); + create_farm::run(args, bin_name, pkg_manager); } diff --git a/packages/plugin-tools/CHANGELOG.md b/packages/plugin-tools/CHANGELOG.md index 2244d65892..5317a87093 100644 --- a/packages/plugin-tools/CHANGELOG.md +++ b/packages/plugin-tools/CHANGELOG.md @@ -1,5 +1,12 @@ # @farmfe/plugin-tools +## 0.1.2-nightly-20241022124925 + +### Patch Changes + +- Updated dependencies [6a1038c] + - @farmfe/utils@1.0.0-nightly-20241022124925 + ## 0.1.1 ### Patch Changes diff --git a/packages/plugin-tools/package.json b/packages/plugin-tools/package.json index c21ba98f0c..2dcb221f5d 100644 --- a/packages/plugin-tools/package.json +++ b/packages/plugin-tools/package.json @@ -1,6 +1,6 @@ { "name": "@farmfe/plugin-tools", - "version": "0.1.1", + "version": "0.1.2-nightly-20241022124925", "description": "farmfe plugin tools to help build farmfe plugin", "exports": { ".": "./bin/farm-plugin-tools.mjs" @@ -28,7 +28,9 @@ "build tool", "bundler" ], - "files": ["dist"], + "files": [ + "dist" + ], "repository": { "type": "git", "url": "https://github.com/farm-fe/farm" diff --git a/packages/runtime-plugin-hmr/CHANGELOG.md b/packages/runtime-plugin-hmr/CHANGELOG.md index 1bf548f6d4..29d49385c3 100644 --- a/packages/runtime-plugin-hmr/CHANGELOG.md +++ b/packages/runtime-plugin-hmr/CHANGELOG.md @@ -1,5 +1,17 @@ # @farmfe/runtime-plugin-hmr +## 4.0.0-nightly-20241029095811 + +### Major Changes + +- 669e2b8: use prismjs instead of highlightjs improve performance + +## 4.0.0-nightly-20241023020505 + +### Major Changes + +- cab79e8: bump major version with runtime + ## 3.5.10 ### Patch Changes diff --git a/packages/runtime-plugin-hmr/package.json b/packages/runtime-plugin-hmr/package.json index 4d04c92941..9db45f6a7e 100644 --- a/packages/runtime-plugin-hmr/package.json +++ b/packages/runtime-plugin-hmr/package.json @@ -1,6 +1,6 @@ { "name": "@farmfe/runtime-plugin-hmr", - "version": "3.5.10", + "version": "4.0.0-nightly-20241029095811", "description": "Runtime hmr plugin of Farm", "author": { "name": "bright wu", @@ -27,12 +27,11 @@ "type-check": "tsc -p tsconfig.json --noEmit" }, "devDependencies": { - "@farmfe/runtime": "workspace:*" + "@farmfe/runtime": "workspace:1.0.0-nightly-20241023020505", + "@types/prismjs": "^1.26.5" }, "dependencies": { - "core-js": "^3.30.1" - }, - "files": [ - "dist" - ] + "core-js": "^3.30.1", + "prismjs": "^1.29.0" + } } diff --git a/packages/runtime-plugin-hmr/src/hmr-client.ts b/packages/runtime-plugin-hmr/src/hmr-client.ts index 0c5a955c7e..64b12dbe60 100644 --- a/packages/runtime-plugin-hmr/src/hmr-client.ts +++ b/packages/runtime-plugin-hmr/src/hmr-client.ts @@ -33,11 +33,13 @@ export class HmrClient { `${socketProtocol}://${socketHostUrl}`, 'farm_hmr' ); + this.socket = socket; // listen for the message from the server // when the user save the file, the server will recompile the file(and its dependencies as long as its dependencies are changed) // after the file is recompiled, the server will generated a update resource and send its id to the client // the client will apply the update + socket.addEventListener('message', (event) => { const result: HMRPayload = new Function(`return (${event.data})`)(); if (result?.type === 'closing') { @@ -63,7 +65,10 @@ export class HmrClient { this.notifyListeners('vite:ws:disconnect', { webSocket: socket }); this.notifyListeners('farm:ws:disconnect', { webSocket: socket }); - logger.debug('disconnected from the server, please reload the page.'); + logger.debug( + 'disconnected from the server, Please refresh the page manually. If you still encounter errors, this may be a farm bug. Please submit an issue. https://github.com/farm-fe/farm/issues' + ); + await waitForSuccessfulPing(socketProtocol, `${socketHostUrl}`); location.reload(); }); @@ -93,17 +98,15 @@ export class HmrClient { await prune(hotContext.data); } - moduleSystem.delete(id); + moduleSystem.d(id); this.registeredHotModulesMap.delete(id); } for (const id of result.added) { - moduleSystem.register(id, result.modules[id]); + moduleSystem.a(id); } for (const id of result.changed) { - moduleSystem.update(id, result.modules[id]); - if (!result.boundaries[id]) { // do not found boundary module, reload the window location.reload(); @@ -111,7 +114,7 @@ export class HmrClient { } if (result.dynamicResources && result) { - moduleSystem.setDynamicModuleResourcesMap( + moduleSystem.sd( result.dynamicResources, result.dynamicModuleResourcesMap ); @@ -121,7 +124,7 @@ export class HmrClient { for (const chain of chains) { // clear the cache of the boundary module and its dependencies for (const id of chain) { - moduleSystem.clearCache(id); + moduleSystem.a(id); } try { @@ -159,7 +162,7 @@ export class HmrClient { const disposer = this.disposeMap.get(acceptedId); if (disposer) await disposer(acceptHotContext.data); - const acceptedExports = moduleSystem.require(acceptedId); + const acceptedExports = moduleSystem.r(acceptedId); for (const { deps, fn } of acceptedCallbacks) { fn( @@ -175,7 +178,7 @@ export class HmrClient { } catch (err) { // The boundary module's dependencies may not present in current module system for a multi-page application. We should reload the window in this case. // See https://github.com/farm-fe/farm/issues/383 - logger.error(err); + logger.error(`Error occurred while applying hot updates: ${err}`); location.reload(); } } @@ -243,18 +246,17 @@ export class HmrClient { handleFarmUpdate(result: RawHmrUpdateResult) { hasErrorOverlay() && clearOverlay(); - const immutableModules = new Function( - `return ${result.immutableModules}` - )(); - const mutableModules = new Function(`return ${result.mutableModules}`)(); - const modules = { ...immutableModules, ...mutableModules }; + + new Function(`${result.immutableModules}`)(); + new Function(`${result.mutableModules}`)(); + this.applyHotUpdates( { added: result.added, changed: result.changed, removed: result.removed, boundaries: result.boundaries, - modules, + // modules, dynamicResources: result.dynamicResources, dynamicModuleResourcesMap: result.dynamicModuleResourcesMap }, @@ -320,7 +322,6 @@ async function waitForSuccessfulPing( } await wait(ms); - // eslint-disable-next-line no-constant-condition while (true) { if (document.visibilityState === 'visible') { if (await ping()) { diff --git a/packages/runtime-plugin-hmr/src/index.ts b/packages/runtime-plugin-hmr/src/index.ts index a1ea9c007f..eaa7b89349 100644 --- a/packages/runtime-plugin-hmr/src/index.ts +++ b/packages/runtime-plugin-hmr/src/index.ts @@ -1,20 +1,19 @@ /** * HMR client as a Farm Runtime Plugin */ -import type { Plugin } from '@farmfe/runtime'; import { HmrClient } from './hmr-client.js'; import { createHotContext } from './hot-module-state.js'; let hmrClient: HmrClient; -export default ({ +export default { name: 'farm-runtime-hmr-client-plugin', - bootstrap(moduleSystem) { + bootstrap(moduleSystem: any) { hmrClient = new HmrClient(moduleSystem); hmrClient.connect(); }, - moduleCreated(module) { + moduleCreated(module: any) { // create a hot context for each module module.meta.hot = createHotContext(module.id, hmrClient); } -}); +}; diff --git a/packages/runtime-plugin-hmr/src/overlay.ts b/packages/runtime-plugin-hmr/src/overlay.ts index 39ff716cf9..79e7b7dda9 100644 --- a/packages/runtime-plugin-hmr/src/overlay.ts +++ b/packages/runtime-plugin-hmr/src/overlay.ts @@ -1,6 +1,12 @@ -const base = '/'; +// import Prism from 'prismjs'; // all runtime code should use pure esm +import 'prismjs'; -const brandSvg = ``; +import { + extractErrorMessage, + parseIfJSON, + splitErrorMessage, + stripAnsi +} from './utils.js'; // set :host styles to make playwright detect the element as visible const template = /*html*/ ` @@ -14,10 +20,10 @@ const template = /*html*/ ` z-index: 99999; --monospace: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; - --red: #ff5555; + --red: #cf1322; --brand-color: #9f1a8f; --window-background: #ffffff; - --window-color: #d8d8d8; + --window-color: #ccc; --brand-color-o: rgba(248, 44, 224, 0.3); } @@ -36,7 +42,7 @@ const template = /*html*/ ` .window { font-family: var(--monospace); line-height: 1.5; - width: 800px; + width: 1000px; color: var(--window-color); margin: 60px auto; position: relative; @@ -77,13 +83,24 @@ pre.frame { } .message { - max-height: 400px; - padding: 25px 30px; + max-height: 500px; + font-size: 14px; line-height: 1.3; font-weight: 600; white-space: pre-wrap; + overflow-y: auto; +} + +.message { + scrollbar-width: none; /* Firefox */ + -ms-overflow-style: none; /* IE and Edge */ } +.message::-webkit-scrollbar { + display: none; /* Chrome, Safari, and Opera */ +} + + .message-body { color: var(--red); } @@ -112,8 +129,7 @@ code { kbd { line-height: 1.5; - font-family: ui-monospace, Menlo, Monaco, Consolas, 'Liberation Mono', - 'Courier New', monospace; + font-family: ui-monospace, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace; font-size: 0.75rem; font-weight: 700; background-color: rgb(38, 40, 44); @@ -123,39 +139,433 @@ kbd { border-width: 0.0625rem 0.0625rem 0.1875rem; border-style: solid; border-color: rgb(54, 57, 64); - border-image: initial; } -kbd { +.message-container { + padding: 10px 10px; +} + + +.code-block { + background-color: #f8f8f8; + border-radius: 3px; + padding: 10px; + margin: 10px 0; +} + +.code-block-wrapper { + background-color: #282c34; /* Atom One Dark 背景色 */ + border-radius: 6px; + padding: 16px; + margin: 10px; + box-shadow: 0 2px 4px rgba(0,0,0,0.1); +} + +.code-block-wrapper pre { + margin: 0; +} + +.code-block-wrapper code { + font-family: 'Consolas', 'Monaco', 'Andale Mono', 'Ubuntu Mono', monospace; + font-size: 14px; line-height: 1.5; - font-family: ui-monospace, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; - font-size: 0.75rem; - font-weight: 700; - background-color: rgb(38, 40, 44); - color: rgb(166, 167, 171); - padding: 0.15rem 0.3rem; - border-radius: 0.25rem; - border-width: 0.0625rem 0.0625rem 0.1875rem; - border-style: solid; - border-color: rgb(54, 57, 64); - border-image: initial; } +.alert { + box-sizing: border-box; + margin: 8px 0; + padding: 0; + color: rgba(0, 0, 0, 0.85); + font-size: 14px; + font-variant: tabular-nums; + line-height: 1.5715; + list-style: none; + font-feature-settings: 'tnum'; + position: relative; + display: flex; + align-items: flex-start; + padding: 8px 15px; + word-wrap: break-word; + border-radius: 4px; +} + +.alert-error { + background-color: #fff2f0; + border: 1px solid #ffccc7; +} + +.alert-icon { + margin-right: 14px; + font-size: 14px; + margin-top: 2px; +} + +.alert-error .alert-icon { + color: #ff4d4f; +} + +.alert-content { + flex: 1; + min-width: 0; +} + +.alert-message { + color: rgba(0, 0, 0, 0.85); + font-size: 14px; +} + +.alert-description { + font-size: 14px; + line-height: 22px; +} + +.alert-error .alert-message { + color: #cf1322; +} + +.alert-error .alert-description { + color: rgba(0, 0, 0, 0.75); +} + +.alert-warn { + background-color: #fffbe6; + border: 1px solid #ffe58f; +} + +.alert-warn .alert-icon { + color: #faad14; +} + +.alert-warn .alert-message { + color: #d46b08; +} + +.alert-warn .alert-description { + color: rgba(0, 0, 0, 0.75); +} + +.terminal-block { + background-color: #1e1e1e; + border-radius: 6px; + overflow: hidden; + margin: 4px 0; +} + +.file-info { + height: 28px; + display: flex; + align-items: center; + justify-content: space-between; + background-color: #2d2d2d; + color: #d4d4d4; + padding: 8px 12px; + font-family: 'Consolas', 'Monaco', 'Andale Mono', 'Ubuntu Mono', monospace; + font-size: 12px; +} + +.file-info-left { + display: flex; + align-items: center; +} + +.file-info-left svg { + margin-right: 8px; +} + +code[class*="language-"], +pre[class*="language-"] { + background: #282c34; + color: #abb2bf; + font-family: "Fira Code", Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; + direction: ltr; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + line-height: 1.5; + -moz-tab-size: 4; + -o-tab-size: 4; + tab-size: 4; + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +/* 选择区域样式 */ +pre[class*="language-"]::-moz-selection, +pre[class*="language-"] ::-moz-selection, +code[class*="language-"]::-moz-selection, +code[class*="language-"] ::-moz-selection { + background: #3e4451; + color: inherit; +} + +pre[class*="language-"]::selection, +pre[class*="language-"] ::selection, +code[class*="language-"]::selection, +code[class*="language-"] ::selection { + background: #3e4451; + color: inherit; +} + +/* Code blocks */ +pre[class*="language-"] { + padding: 1em; + margin: 0.5em 0; + overflow: auto; + border-radius: 0.3em; +} + +/* Inline code */ +:not(pre) > code[class*="language-"] { + padding: 0.2em 0.3em; + border-radius: 0.3em; + white-space: normal; +} + +/* Token colors */ +.token.comment, +.token.prolog, +.token.cdata { + color: #5c6370; + font-style: italic; +} + +.token.doctype, +.token.punctuation { + color: #abb2bf; +} + +.token.selector, +.token.tag { + color: #e06c75; +} + +.token.property, +.token.boolean, +.token.number, +.token.constant, +.token.symbol, +.token.attr-name, +.token.deleted { + color: #d19a66; +} + +.token.string, +.token.char, +.token.attr-value, +.token.builtin, +.token.inserted { + color: #98c379; +} + +.token.operator, +.token.entity, +.token.url, +.language-css .token.string, +.style .token.string { + color: #56b6c2; +} + +.token.atrule, +.token.keyword { + color: #c678dd; +} + +.token.function { + color: #61afef; +} + +.token.regex, +.token.important, +.token.variable { + color: #c678dd; +} + +.token.important, +.token.bold { + font-weight: bold; +} + +.token.italic { + font-style: italic; +} + +.token.entity { + cursor: help; +} + +/* Language specific */ +.language-json .token.property { + color: #e06c75; +} + +.language-markdown .token.title, +.language-markdown .token.title .token.punctuation { + color: #61afef; + font-weight: bold; +} + +.language-markdown .token.blockquote.punctuation { + color: #5c6370; +} + +.language-markdown .token.code { + color: #98c379; +} + +.language-markdown .token.hr.punctuation { + color: #56b6c2; +} + +.language-markdown .token.url > .token.content { + color: #98c379; +} + +.language-markdown .token.url-link { + color: #d19a66; +} + +.language-markdown .token.list.punctuation { + color: #e06c75; +} + +.language-markdown .token.table-header { + color: #abb2bf; +} + +/* JSX */ +.language-jsx .token.jsx-tag { + color: #e06c75; +} + +.language-jsx .token.jsx-expression { + color: #61afef; +} + +/* TypeScript */ +.language-typescript .token.class-name { + color: #e5c07b; +} + +.language-typescript .token.keyword { + color: #c678dd; +} + +.code-block-wrapper { + position: relative; + padding: 1rem; + margin: 0 0 1rem; + background: #282c34; + border-radius: 0.5rem; + box-shadow: 0 2px 8px rgba(0,0,0,0.15); + overflow: hidden; +} + +.code-block-header { + display: flex; + align-items: center; + justify-content: space-between; + padding: 0.5rem 1rem; + background: #21252b; + border-bottom: 1px solid #181a1f; + font-family: system-ui, -apple-system, sans-serif; + font-size: 0.9em; + color: #9da5b4; +} + +.line-number::before { + display: inline-block; + width: 1.2em; + text-align: right; + margin-right: 1em; + color: #4b5263; + content: attr(line); + user-select: none; +} + +pre::-webkit-scrollbar { + width: 6px; + height: 6px; +} + +pre::-webkit-scrollbar-track { + background: #282c34; + border-radius: 3px; +} + +pre::-webkit-scrollbar-thumb { + background: #4b5263; + border-radius: 3px; +} + +pre::-webkit-scrollbar-thumb:hover { + background: #5c6370; +} + +::selection { + background: #3e4451; +} + +.highlight-line { + background-color: #2c313a; + display: block; + margin: 0 -1em; + padding: 0 1em; +} + +.error-line { + background-color: rgba(224, 108, 117, 0.1); + display: block; + margin: 0 -1em; + padding: 0 1em; +} + +.warning-line { + background-color: rgba(209, 154, 102, 0.1); + display: block; + margin: 0 -1em; + padding: 0 1em; +} +
-
+
+
`; -const fileRE = /(?:[a-zA-Z]:\\|\/).*?:\d+:\d+/g; -const codeframeRE = /^(?:>?\s*\d+\s+\|.*|\s+\|\s*\^.*)\r?\n/gm; +const errorAlert = (message: string, description: string) => /*html*/ ` +
+ + + +
+
${message}
+
Failed to compile: ${description}
+
+
+`; + +const warnAlert = (description: string) => /*html*/ ` +
+ + ${getAlertIcon('warn')} + +
+
${description.replace(/\n/g, '
')}
+
+
+`; // Allow `ErrorOverlay` to extend `HTMLElement` even in environments where // `HTMLElement` was not originally defined. @@ -169,27 +579,9 @@ export class ErrorOverlay extends HTMLElement { this.root = this.attachShadow({ mode: 'open' }); this.root.innerHTML = template; - codeframeRE.lastIndex = 0; - const hasFrame = err.frame && codeframeRE.test(err.frame); - const message = hasFrame - ? err.message.replace(codeframeRE, '') - : err.message; - if (err.plugin) { - this.text('.plugin', `[plugin:${err.plugin}] `); - } - this.text('.message-body', message); - - const [file] = (err.loc?.file || err.id || 'unknown file').split(`?`); - if (err.loc) { - this.text('.file', `${file}:${err.loc.line}:${err.loc.column}`, links); - } else if (err.id) { - this.text('.file', file); - } + const messages = parseIfJSON(err.message); - if (hasFrame) { - this.text('.frame', err.frame?.trim()); - } - this.text('.stack', err.stack, links); + this.renderMessages(messages, links); this.root.querySelector('.window')?.addEventListener('click', (e) => { e.stopPropagation(); @@ -208,45 +600,230 @@ export class ErrorOverlay extends HTMLElement { document.addEventListener('keydown', this.closeOnEsc); } - text(selector: string, text: string, linkFiles = false): void { - const el = this.root.querySelector(selector)!; - if (!linkFiles) { - el.textContent = text; - } else { - let curIndex = 0; - let match: RegExpExecArray | null; - fileRE.lastIndex = 0; - while ((match = fileRE.exec(text))) { - const { 0: file, index } = match; - if (index != null) { - const frag = text.slice(curIndex, index); - el.appendChild(document.createTextNode(frag)); - const link = document.createElement('a'); - link.textContent = file; - link.className = 'file-link'; - link.onclick = () => { - fetch( - new URL( - `${base}__open-in-editor?file=${encodeURIComponent(file)}`, - // import.meta.url - window.location.href - ) - ); - }; - el.appendChild(link); - curIndex += frag.length + file.length; - } - } + highlightCode(code: string, language = 'javascript') { + return window.Prism.highlight( + code, + window.Prism.languages[language], + language + ); + } + + renderMessages(messages: any[], _link: any) { + const messageContainer = this.root.querySelector('.message-container')!; + messageContainer.innerHTML = ''; + if (typeof messages === 'string') { + const messageElement = document.createElement('div'); + const messageBody = document.createElement('div'); + messageBody.className = 'message'; + const terminalBlock = document.createElement('div'); + const highlightedCode = this.highlightCode(extractErrorMessage(messages)); + terminalBlock.className = 'terminal-block'; + + const fileInfo = document.createElement('div'); + fileInfo.className = 'file-info'; + + const fileInfoRight = document.createElement('div'); + const fileInfoLeft = document.createElement('div'); + fileInfoRight.className = 'file-info-right'; + fileInfoRight.innerHTML = ` + + + + + + `; + + fileInfoLeft.className = 'file-info-left'; + fileInfoLeft.textContent = ''; + + fileInfo.appendChild(fileInfoLeft); + fileInfo.appendChild(fileInfoRight); + + const codeBlockWrapper = document.createElement('div'); + codeBlockWrapper.className = 'code-block-wrapper'; + codeBlockWrapper.innerHTML = highlightedCode; + + terminalBlock.appendChild(fileInfo); + terminalBlock.appendChild(codeBlockWrapper); + messageBody.appendChild(terminalBlock); + messageElement.appendChild(messageBody); + messageContainer.appendChild(messageElement); + return; } + + messages.forEach((msg) => { + const messageElement = document.createElement('div'); + messageElement.className = 'error-message'; + msg = parseIfJSON(msg); + + if (msg.type) { + const typeError = document.createElement('span'); + typeError.className = 'type-error'; + typeError.textContent = msg.type; + const TypeCodeError = document.createElement('div'); + TypeCodeError.innerHTML = errorAlert(msg.type, msg.id); + messageElement.appendChild(TypeCodeError); + } + + const messageBody = document.createElement('div'); + + messageBody.className = 'message'; + + const splitMessage = splitErrorMessage(msg); + + console.error(splitMessage.errorInfo); + + if (splitMessage.codeBlocks && splitMessage.codeBlocks.length > 0) { + splitMessage.codeBlocks.forEach((codeBlock, blockIndex) => { + const terminalBlock = document.createElement('div'); + const highlightedCode = this.highlightCode(codeBlock); + + terminalBlock.className = 'terminal-block'; + + const fileInfo = document.createElement('div'); + fileInfo.className = 'file-info'; + + const fileInfoRight = document.createElement('div'); + const fileInfoLeft = document.createElement('div'); + fileInfoRight.className = 'file-info-right'; + fileInfoRight.innerHTML = ` + + + + + + `; + + fileInfoLeft.className = 'file-info-left'; + fileInfoLeft.textContent = splitMessage.idCodeLines[blockIndex]; + + fileInfo.appendChild(fileInfoLeft); + fileInfo.appendChild(fileInfoRight); + + const codeBlockWrapper = document.createElement('div'); + codeBlockWrapper.className = 'code-block-wrapper'; + codeBlockWrapper.innerHTML = highlightedCode; + + terminalBlock.appendChild(fileInfo); + terminalBlock.appendChild(codeBlockWrapper); + messageBody.appendChild(terminalBlock); + }); + } else if (splitMessage.errorInfo) { + const terminalBlock = document.createElement('div'); + + const highlightedCode = this.highlightCode( + extractErrorMessage(splitMessage.frame) + ); + + terminalBlock.className = 'terminal-block'; + + const fileInfo = document.createElement('div'); + fileInfo.className = 'file-info'; + + const fileInfoRight = document.createElement('div'); + const fileInfoLeft = document.createElement('div'); + fileInfoRight.className = 'file-info-right'; + fileInfoRight.innerHTML = ` + + + + + + `; + + fileInfoLeft.className = 'file-info-left'; + fileInfoLeft.textContent = `Error Info ${ + msg.plugin ? `[plugin: ${msg.plugin}]` : '' + }`; + + fileInfo.appendChild(fileInfoLeft); + fileInfo.appendChild(fileInfoRight); + + const codeBlockWrapper = document.createElement('div'); + codeBlockWrapper.className = 'code-block-wrapper'; + codeBlockWrapper.innerHTML = highlightedCode; + + terminalBlock.appendChild(fileInfo); + terminalBlock.appendChild(codeBlockWrapper); + messageBody.appendChild(terminalBlock); + } + + messageElement.appendChild(messageBody); + + if (msg.frame) { + const messageElement = document.createElement('div'); + const messageBody = document.createElement('div'); + messageBody.className = 'message'; + const terminalBlock = document.createElement('div'); + const highlightedCode = this.highlightCode( + extractErrorMessage(stripAnsi(msg.frame)) + ); + terminalBlock.className = 'terminal-block'; + + const fileInfo = document.createElement('div'); + fileInfo.className = 'file-info'; + + const fileInfoRight = document.createElement('div'); + const fileInfoLeft = document.createElement('div'); + fileInfoRight.className = 'file-info-right'; + fileInfoRight.innerHTML = ` + + + + + + `; + + fileInfoLeft.className = 'file-info-left'; + fileInfoLeft.textContent = ''; + + fileInfo.appendChild(fileInfoLeft); + fileInfo.appendChild(fileInfoRight); + + const codeBlockWrapper = document.createElement('div'); + codeBlockWrapper.className = 'code-block-wrapper'; + codeBlockWrapper.innerHTML = highlightedCode; + + terminalBlock.appendChild(fileInfo); + terminalBlock.appendChild(codeBlockWrapper); + messageBody.appendChild(terminalBlock); + messageElement.appendChild(messageBody); + messageContainer.appendChild(messageElement); + } + + if (msg.cause) { + const causeElement = document.createElement('div'); + causeElement.innerHTML = warnAlert(msg.cause); + messageElement.appendChild(causeElement); + } + + messageContainer.appendChild(messageElement); + }); } + close(): void { this.parentNode?.removeChild(this); document.removeEventListener('keydown', this.closeOnEsc); } } -export const overlayId = 'vite-error-overlay'; +export const overlayId = 'farm-error-overlay'; const { customElements } = globalThis; // Ensure `customElements` is defined before the next line. if (customElements && !customElements.get(overlayId)) { customElements.define(overlayId, ErrorOverlay); } + +function getAlertIcon(type: string) { + switch (type) { + case 'error': + return ``; + case 'warn': + return ``; + default: + return ''; + } +} diff --git a/packages/runtime-plugin-hmr/src/types.ts b/packages/runtime-plugin-hmr/src/types.ts index c68f87aa97..509d56ad94 100644 --- a/packages/runtime-plugin-hmr/src/types.ts +++ b/packages/runtime-plugin-hmr/src/types.ts @@ -3,15 +3,15 @@ import type { Resource } from '@farmfe/runtime'; // export interface HmrUpdatePacket { // id: string; // } -type ModuleMap = Record< - string, - ( - module: any, - exports: any, - require: (id: string) => any, - dynamicRequire: (id: string) => Promise - ) => void ->; +// type ModuleMap = Record< +// string, +// ( +// module: any, +// exports: any, +// require: (id: string) => any, +// dynamicRequire: (id: string) => Promise +// ) => void +// >; export interface HmrUpdateResult { added: string[]; changed: string[]; @@ -19,8 +19,8 @@ export interface HmrUpdateResult { // closest boundary modules which are related to added or changed boundaries: Record; - // modules which are added or changed - modules: ModuleMap; + // // modules which are added or changed + // modules: ModuleMap; dynamicResources: Resource[] | null; dynamicModuleResourcesMap: Record | null; } diff --git a/packages/runtime-plugin-hmr/src/utils.ts b/packages/runtime-plugin-hmr/src/utils.ts index e2758f24f7..19e45a7ad8 100644 --- a/packages/runtime-plugin-hmr/src/utils.ts +++ b/packages/runtime-plugin-hmr/src/utils.ts @@ -10,5 +10,116 @@ export function handleErrorSync( } } -// eslint-disable-next-line @typescript-eslint/no-empty-function function noop() {} + +export function parseIfJSON(str: string): any { + if (typeof str !== 'string') { + return str; + } + + try { + const parsed = JSON.parse(str); + if (Object(parsed) !== parsed) { + return str; + } + return parsed; + } catch (e) { + return str; + } +} + +// remove rollup deps use any type +export function prepareError(err: Error & { potentialSolution?: string }) { + return { + message: stripAnsi(err.message), + stack: stripAnsi(cleanStack(err.stack || '')), + id: (err as any).id, + frame: stripAnsi((err as any).frame || ''), + plugin: (err as any).plugin, + pluginCode: (err as any).pluginCode?.toString(), + loc: (err as any).loc, + potential: err.potentialSolution || '' + }; +} + +export function stripAnsi(str: string) { + return str.replace(/\x1b\[[0-9;]*m/g, ''); +} + +export function cleanStack(stack: string) { + return stack + .split(/\n/g) + .filter((l) => /^\s*at/.test(l)) + .join('\n'); +} + +export function splitErrorMessage(errorMsg: any) { + // @ts-ignore + const potentialCauses = errorMsg.cause; + const stripErrorFrame = stripAnsi(errorMsg.errorFrame ?? ''); + const { codeBlocks, idCodeLines } = extractSwcCodeBlocks(stripErrorFrame); + return { + errorInfo: stripAnsi(errorMsg.message), + codeBlocks, + potentialCauses, + idCodeLines, + frame: stripErrorFrame, + errorBrowser: `${stripAnsi(errorMsg.message)}\n\n${potentialCauses}\n\n` + }; +} + +export function extractSwcCodeBlocks(errorMsg: string) { + const lines = errorMsg.split('\n'); + let codeBlocks = []; + let idCodeLines = []; + let currentBlock: any = []; + let inCodeBlock = false; + let errorLine = ''; + let currentIdCodeLine = ''; + + for (const line of lines) { + if (line.trim().startsWith('×')) { + if (inCodeBlock) { + codeBlocks.push(currentBlock.join('\n')); + idCodeLines.push(currentIdCodeLine); + currentBlock = []; + currentIdCodeLine = ''; + } + errorLine = line; + inCodeBlock = false; + } else if (line.includes('╭─[')) { + inCodeBlock = true; + currentBlock = errorLine ? [errorLine, line] : [line]; + errorLine = ''; + const match = line.match(/\s*╭─(.*?)$$/); + + if (match) { + currentIdCodeLine = match[1]; + } + } else if (inCodeBlock) { + currentBlock.push(line); + if (line.includes('╰────')) { + codeBlocks.push(currentBlock.join('\n')); + idCodeLines.push(currentIdCodeLine); + currentBlock = []; + currentIdCodeLine = ''; + inCodeBlock = false; + } + } + } + + if (currentBlock.length > 0) { + codeBlocks.push(currentBlock.join('\n')); + idCodeLines.push(currentIdCodeLine); + } + + return { codeBlocks, idCodeLines }; +} + +export function extractErrorMessage(errorString: string) { + const regex = /^([\s\S]*?)(?=\s+at constructor)/; + + const match = errorString.match(regex); + + return match ? match[1].trim() : errorString; +} diff --git a/packages/runtime-plugin-import-meta/CHANGELOG.md b/packages/runtime-plugin-import-meta/CHANGELOG.md index d395ddba6b..cdc9908bf7 100644 --- a/packages/runtime-plugin-import-meta/CHANGELOG.md +++ b/packages/runtime-plugin-import-meta/CHANGELOG.md @@ -1,5 +1,11 @@ # @farmfe/runtime-plugin-import-meta +## 1.0.0-nightly-20241023020505 + +### Major Changes + +- cab79e8: bump major version with runtime + ## 0.2.3 ### Patch Changes diff --git a/packages/runtime-plugin-import-meta/package.json b/packages/runtime-plugin-import-meta/package.json index e98663f58b..12d4ce0bf7 100644 --- a/packages/runtime-plugin-import-meta/package.json +++ b/packages/runtime-plugin-import-meta/package.json @@ -1,6 +1,6 @@ { "name": "@farmfe/runtime-plugin-import-meta", - "version": "0.2.3", + "version": "1.0.0-nightly-20241023020505", "description": "Runtime Import Meta plugin of Farm", "author": { "name": "Ming07", @@ -26,7 +26,7 @@ "type-check": "tsc -p tsconfig.json --noEmit" }, "devDependencies": { - "@farmfe/runtime": "workspace:*" + "@farmfe/runtime": "workspace:1.0.0-nightly-20241023020505" }, "dependencies": { "core-js": "^3.30.1" @@ -34,4 +34,4 @@ "files": [ "dist" ] -} +} \ No newline at end of file diff --git a/packages/runtime-plugin-import-meta/src/index.ts b/packages/runtime-plugin-import-meta/src/index.ts index 68576f872f..c7779557f6 100644 --- a/packages/runtime-plugin-import-meta/src/index.ts +++ b/packages/runtime-plugin-import-meta/src/index.ts @@ -1,8 +1,8 @@ -import type { ModuleSystem, Plugin } from '@farmfe/runtime'; +import type { ModuleSystem } from '@farmfe/runtime'; const __global_this__ = typeof globalThis !== 'undefined' ? globalThis : window; -export default ({ +export default { name: 'farm-runtime-import-meta', _moduleSystem: {} as ModuleSystem, bootstrap(system: ModuleSystem) { @@ -43,4 +43,4 @@ export default ({ : module.resource_pot; module.meta.url = url; } -}); +}; diff --git a/packages/runtime/CHANGELOG.md b/packages/runtime/CHANGELOG.md index 09eda0e997..8ef8673699 100644 --- a/packages/runtime/CHANGELOG.md +++ b/packages/runtime/CHANGELOG.md @@ -1,5 +1,11 @@ # @farmfe/runtime +## 1.0.0-nightly-20241023020505 + +### Major Changes + +- cab79e8: bump major version with runtime + ## 0.12.10 ### Patch Changes diff --git a/packages/runtime/package.json b/packages/runtime/package.json index 24b1df8cba..8f10773190 100644 --- a/packages/runtime/package.json +++ b/packages/runtime/package.json @@ -1,6 +1,6 @@ { "name": "@farmfe/runtime", - "version": "0.12.10", + "version": "1.0.0-nightly-20241023020505", "description": "Runtime of Farm", "author": { "name": "bright wu", @@ -26,8 +26,8 @@ "type-check": "tsc -p tsconfig.json --noEmit" }, "devDependencies": { - "@types/node": "^18.19.67", - "typescript": "^4.7.4" + "typescript": "5.5.4", + "@types/node": "^18.19.67" }, "dependencies": { "core-js": "^3.30.1" diff --git a/packages/runtime/src/global.d.ts b/packages/runtime/src/global.d.ts deleted file mode 100644 index 2c5f615897..0000000000 --- a/packages/runtime/src/global.d.ts +++ /dev/null @@ -1,8 +0,0 @@ - -// inject by crates/plugin_runtime -// eslint-disable-next-line @typescript-eslint/no-explicit-any -declare function _interop_require_default(obj: any): any; -// eslint-disable-next-line @typescript-eslint/no-explicit-any -declare function _interop_require_wildcard(obj: any, nodeInterop?: boolean): any; -// eslint-disable-next-line @typescript-eslint/no-explicit-any -declare function _export_star(from: any, to: any): any; \ No newline at end of file diff --git a/packages/runtime/src/index.ts b/packages/runtime/src/index.ts index 7cb8b8de2d..d1b8e3280b 100644 --- a/packages/runtime/src/index.ts +++ b/packages/runtime/src/index.ts @@ -1,15 +1,6 @@ -import { ModuleSystem } from './module-system.js'; -import { FarmRuntimePlugin } from './plugin.js'; -import { __farm_global_this__ } from './resource-loader.js'; - -__farm_global_this__.__farm_module_system__ = (function () { - const moduleSystem = new ModuleSystem(); - - return function () { - return moduleSystem; - }; -})()(); - -export * from './resource-loader.js' - -export { ModuleSystem, FarmRuntimePlugin as Plugin }; +/** + * This module only exports runtime types and does not export any runtime code. + * The runtime code is injected in need during compile time. See crates/plugin_runtime and crates/plugin_library + */ +export type { Module, ModuleSystem } from './module-system.js'; +export type { Resource } from './modules/dynamic-import.js'; \ No newline at end of file diff --git a/packages/runtime/src/module-system.ts b/packages/runtime/src/module-system.ts index 3fc4aeaf3f..cf16cfd8d2 100644 --- a/packages/runtime/src/module-system.ts +++ b/packages/runtime/src/module-system.ts @@ -1,16 +1,24 @@ -import { Module } from "./module.js"; -import { type FarmRuntimePlugin, FarmRuntimePluginContainer } from "./plugin.js"; -import { - type Resource, - ResourceLoader, - __global_this__, - isBrowser, - targetEnv, -} from "./resource-loader.js"; - -declare const nodeRequire: (id: string) => any; +import type { Resource } from "./modules/dynamic-import.js"; +import type { FarmRuntimePluginContainer } from "./modules/plugin.js"; + +// Injected during compile time +declare const __FARM_RUNTIME_TARGET_ENV__: 'browser' | 'node' | 'library'; +declare const __FARM_ENABLE_RUNTIME_PLUGIN__: boolean; +declare const __FARM_ENABLE_TOP_LEVEL_AWAIT__: boolean; +declare const __FARM_ENABLE_EXTERNAL_MODULES__: boolean; // always true if target env is not library + +declare let $__farm_global_this__$: any; + +export interface Module { + id: string; + exports?: any; + // initialize promise if this module is a async module + initializer?: Promise | undefined; + resource_pot?: string; + meta?: Record; + require?: (id: string) => any; +} -/* eslint-disable @typescript-eslint/no-explicit-any */ type ModuleInitializationFunction = ( module: Module, exports: any, @@ -18,299 +26,195 @@ type ModuleInitializationFunction = ( __farm_dynamic_require__: (moduleId: string) => any, ) => void | Promise; -/* eslint-disable @typescript-eslint/no-explicit-any */ -export type ModuleInitialization = ModuleInitializationFunction & { - __farm_resource_pot__?: string; -}; +export type ModuleInitialization = ModuleInitializationFunction; + +export interface ModuleSystem { + // reRegisterModules + _rg: boolean; + // pluginContainer + p: FarmRuntimePluginContainer; + // externalModules + em: Record; + // require + r(id: string): any; + // register + g(id: string, module: ModuleInitialization): () => any + // dynamicImport + d(id: string): Promise, + // getModules + m(): Record, + // getCache + c(): Record, + // updateModule + u(moduleId: string, init: ModuleInitialization): void + // deleteModule + e(moduleId: string): boolean + // clearCache + a(moduleId: string): boolean + // loadDynamicResourcesOnly + l(moduleId: string, force?: boolean): Promise + // setExternalModules + se(externalModules: Record): void + // setInitialLoadedResources + si(resources: string[]): void + // setDynamicModuleResourcesMap + // These two methods are used to support dynamic module loading, the dynamic module info is collected by the compiler and injected during compile time + // This method can also be called during runtime to add new dynamic modules + sd(dynamicResources: Resource[], dynamicModuleResourcesMap: Record): void + // setPublicPaths + // The public paths are injected during compile time + sp(publicPaths: string[]): void + // bootstrap + // bootstrap should be called after all three methods above are called, and the bootstrap call is also injected during compile time + // This method should only be called once + b(): void +} + +// init `window['xxxx] = {}` +const __farm_global_this__: any = $__farm_global_this__$ = {}; + +// It will be removed if __FARM_RUNTIME_TARGET_ENV__ is not browser when building runtime +if (__FARM_RUNTIME_TARGET_ENV__ === 'browser') { + // polyfill require when running in browser + const __global_this__: any = typeof window !== 'undefined' ? window : {}; + __global_this__.require ||= farmRequire; +} +if (__FARM_RUNTIME_TARGET_ENV__ === 'node') { + const __global_this__: any = typeof global !== 'undefined' ? global : {}; + __global_this__.require ||= farmRequire; +} -export class ModuleSystem { - // all modules registered - private modules: Record; - // module cache after module initialized - private cache: Record; - // external modules injected during compile - private externalModules: Record; - private reRegisterModules: boolean; - // available public paths, when loading resources, we will try each publicPath until it is available, this is so called `resource loading retry` - publicPaths: string[]; - dynamicResources: Resource[] = []; - // dynamic module entry and resources map - dynamicModuleResourcesMap: Record; - // resources loader - resourceLoader: ResourceLoader; - // runtime plugin container - pluginContainer: FarmRuntimePluginContainer; - targetEnv: "browser" | "node"; +// all modules registered +const modules: Record = {}; +// module cache after module initialized +const cache: Record = {}; + +export const moduleSystem = { + r: farmRequire, + g: farmRegister, + m: () => modules, + c: () => cache, +} as ModuleSystem; + +if (__FARM_ENABLE_EXTERNAL_MODULES__) { + // externalModules + moduleSystem.em = {} + // The external modules are injected during compile time. + moduleSystem.se = function setExternalModules(externalModules: Record): void { + for (const key in externalModules) { + let em = externalModules[key]; + // add a __esModule flag to the module if the module has default export + if (em && em.default && !em.__esModule) { + em = Object.assign({}, em, { __esModule: true }); + } - constructor() { - this.modules = {}; - this.cache = {}; - this.publicPaths = []; - this.dynamicModuleResourcesMap = {}; - this.resourceLoader = new ResourceLoader(this, this.publicPaths); - this.pluginContainer = new FarmRuntimePluginContainer([]); - this.targetEnv = targetEnv; - this.externalModules = {}; - this.reRegisterModules = false; + moduleSystem.em[key]= em; + } } + __farm_global_this__.m = moduleSystem; +} - require(moduleId: string, isCJS = false): any { - // return the cached exports if cache exists - // console.log(`[Farm] require module "${moduleId}" from cache`); - if (this.cache[moduleId]) { - const shouldSkip = this.pluginContainer.hookBail( +export function farmRequire(id: string): any { + if (cache[id]) { + const cachedModuleResult = cache[id].initializer || cache[id].exports; + // will be removed as dead code if no plugin enabled when minify enabled + if (__FARM_ENABLE_RUNTIME_PLUGIN__) { + const shouldSkip = moduleSystem.p.b( "readModuleCache", - this.cache[moduleId], + cache[id], ); - + // console.log(`[Farm] shouldSkip: ${shouldSkip} ${moduleId}`); if (!shouldSkip) { - const cachedModule = this.cache[moduleId]; - return cachedModule.initializer || cachedModule.exports; + return cachedModuleResult; } - } - - const initializer = this.modules[moduleId]; - - if (!initializer) { - if (this.externalModules[moduleId]) { - const exports = this.externalModules[moduleId]; - - // fix `const assert = require('assert');` when assert is external. This leads to `assert is not a function` error caused by default export different from esm and cjs - if (isCJS) { - return exports.default || exports; - } - - return exports; - } - // try node require if target Env is node - if ((this.targetEnv === "node" || !isBrowser) && nodeRequire) { - const externalModule = nodeRequire(moduleId); - return externalModule; - } - this.pluginContainer.hookSerial("moduleNotFound", moduleId); - // return a empty module if the module is not registered - console.debug(`[Farm] Module "${moduleId}" is not registered`); - return {}; - // throw new Error(`Module "${moduleId}" is not registered`); - } - - // create a full new module instance and store it in cache to avoid cyclic initializing - const module = new Module(moduleId, this.require.bind(this)); - module.resource_pot = initializer.__farm_resource_pot__!; - // call the module created hook - this.pluginContainer.hookSerial("moduleCreated", module); - - this.cache[moduleId] = module; - - if (!__global_this__.require) { - __global_this__.require = - this.require.bind(this); - } - // initialize the new module - const result = initializer( - module, - module.exports, - this.require.bind(this), - this.farmDynamicRequire.bind(this), - ); - - // it's a async module, return the promise - if (result && result instanceof Promise) { - module.initializer = result.then(() => { - // call the module initialized hook - this.pluginContainer.hookSerial("moduleInitialized", module); - module.initializer = undefined; - // return the exports of the module - return module.exports; - }); - return module.initializer; } else { - // call the module initialized hook - this.pluginContainer.hookSerial("moduleInitialized", module); - // return the exports of the module - return module.exports; + return cachedModuleResult; } } - farmDynamicRequire(moduleId: string): Promise { - if (this.modules[moduleId]) { - const exports = this.require(moduleId); + const initializer = modules[id]; - if (exports.__farm_async) { - return exports.default; - } else { - return Promise.resolve(exports); + if (!initializer) { + if (__FARM_ENABLE_EXTERNAL_MODULES__) { + // externalModules + if (moduleSystem.em[id]) { + return moduleSystem.em[id]; } } - return this.loadDynamicResources(moduleId); - } + if (__FARM_ENABLE_RUNTIME_PLUGIN__) { + const res = moduleSystem.p.b("moduleNotFound", id); - loadDynamicResourcesOnly(moduleId: string, force = false): Promise { - const resources = this.dynamicModuleResourcesMap[moduleId].map((index) => this.dynamicResources[index]); - - if (!resources || resources.length === 0) { - throw new Error( - `Dynamic imported module "${moduleId}" does not belong to any resource`, - ); - } - // force reload resources - if (force) { - this.clearCache(moduleId); + if (res) { + return res + } } - // loading all required resources, and return the exports of the entry module - return Promise.all( - resources.map((resource) => { - if (force) { - const resourceLoaded = this.resourceLoader.isResourceLoaded(resource.path); - this.resourceLoader.setLoadedResource(resource.path, false); - - if (resourceLoaded) { - return this.resourceLoader.load({ - ...resource, - // force reload the resource - path: `${resource.path}?t=${Date.now()}` - }); - } - } - return this.resourceLoader.load(resource); - }), - ) - } - - loadDynamicResources(moduleId: string, force = false): Promise { - const resources = this.dynamicModuleResourcesMap[moduleId].map((index) => this.dynamicResources[index]); - - return this.loadDynamicResourcesOnly(moduleId, force) - .then(() => { - // Do not require the module if all the resources are not js resources - if (resources.every(resource => resource.type !== 0)) { - return; - } - - if (!this.modules[moduleId]) { - throw new Error( - `Dynamic imported module "${moduleId}" is not registered.`, - ); - } - const result = this.require(moduleId); - // if the module is async, return the default export, the default export should be a promise - if (result.__farm_async) { - return result.default; - } else { - return result; - } - }) - .catch((err) => { - console.error(`[Farm] Error loading dynamic module "${moduleId}"`, err); - throw err; - }); - } - register(moduleId: string, initializer: ModuleInitialization): void { - // console.log(`[Farm] register module "${moduleId}"`, console.trace()); - if (this.modules[moduleId] && !this.reRegisterModules) { - // throw new Error( - // `Module "${moduleId}" has registered! It should not be registered twice` - // ); - console.warn( - `Module "${moduleId}" has registered! It should not be registered twice`, - ); - return; - } + console.debug(`[Farm] Module "${id}" is not registered`); - this.modules[moduleId] = initializer; + // return a empty module if the module is not registered + return {}; } - update(moduleId: string, init: ModuleInitialization): void { - this.modules[moduleId] = init; - this.clearCache(moduleId); - } + // create a full new module instance and store it in cache to avoid cyclic initializing + const module = cache[id] = { + id, + meta: { + env: {} + }, + exports: {}, + require: (moduleId: string) => farmRequire(moduleId) + } as Module; - delete(moduleId: string): boolean { - if (this.modules[moduleId]) { - this.clearCache(moduleId); - delete this.modules[moduleId]; - return true; - } else { - return false; - } + if (__FARM_ENABLE_RUNTIME_PLUGIN__) { + // call the module created hook + moduleSystem.p.s("moduleCreated", module); } - getModuleUrl(moduleId: string): string { - const publicPath = this.publicPaths[0] ?? ""; - - if (isBrowser) { - const url = `${window.location.protocol}//${window.location.host}${ - publicPath.endsWith("/") ? publicPath.slice(0, -1) : publicPath - }/${this.modules[moduleId].__farm_resource_pot__}`; - return url; - } else { - return this.modules[moduleId].__farm_resource_pot__!; - } - } + cache[id] = module; - getCache(moduleId: string): Module | undefined { - return this.cache[moduleId]; - } + // initialize the new module + const result = initializer( + module, + module.exports, + farmRequire, + moduleSystem.d, + ); - clearCache(moduleId: string): boolean { - if (this.cache[moduleId]) { - delete this.cache[moduleId]; - return true; - } else { - return false; - } - } + if (__FARM_ENABLE_TOP_LEVEL_AWAIT__) { + // it's a async module, return the promise + if (result && result instanceof Promise) { + module.initializer = result.then(() => { + if (__FARM_ENABLE_RUNTIME_PLUGIN__) { + // call the module initialized hook + moduleSystem.p.s("moduleInitialized", module); + } + module.initializer = undefined; + // return the exports of the module + return module.exports; + }); - setInitialLoadedResources(resources: string[]) { - for (const resource of resources) { - this.resourceLoader.setLoadedResource(resource); + return module.initializer; } } - // These two methods are used to support dynamic module loading, the dynamic module info is collected by the compiler and injected during compile time - // This method can also be called during runtime to add new dynamic modules - setDynamicModuleResourcesMap( - dynamicResources: Resource[], - dynamicModuleResourcesMap: Record, - ): void { - this.dynamicResources = dynamicResources; - this.dynamicModuleResourcesMap = dynamicModuleResourcesMap; - } - - // The public paths are injected during compile time - setPublicPaths(publicPaths: string[]): void { - this.publicPaths = publicPaths; - this.resourceLoader.publicPaths = this.publicPaths; + if (__FARM_ENABLE_RUNTIME_PLUGIN__) { + // call the module initialized hook + moduleSystem.p.s("moduleInitialized", module); } + // return the exports of the module + return module.exports; +} - // The plugins are injected during compile time. - setPlugins(plugins: FarmRuntimePlugin[]): void { - this.pluginContainer.plugins = plugins; - } - // This method can be called during runtime to add new plugins - addPlugin(plugin: FarmRuntimePlugin): void { - if (this.pluginContainer.plugins.every((p) => p.name !== plugin.name)) { - this.pluginContainer.plugins.push(plugin); - } - } - // This method can be called during runtime to remove plugins - removePlugin(pluginName: string): void { - this.pluginContainer.plugins = this.pluginContainer.plugins.filter( - (p) => p.name !== pluginName, +export function farmRegister(id: string, module: ModuleInitialization): () => any { + if (modules[id] && !moduleSystem._rg) { + console.warn( + `Module "${id}" has registered! It should not be registered twice`, ); + return; } - // The external modules are injected during compile time. - setExternalModules(externalModules: Record): void { - Object.assign(this.externalModules, externalModules || {}); - } - - // bootstrap should be called after all three methods above are called, and the bootstrap call is also injected during compile time - // This method should only be called once - bootstrap(): void { - this.pluginContainer.hookSerial("bootstrap", this); - } + modules[id] = module; + return () => farmRequire(id); } diff --git a/packages/runtime/src/module.ts b/packages/runtime/src/module.ts deleted file mode 100644 index 0003706ef3..0000000000 --- a/packages/runtime/src/module.ts +++ /dev/null @@ -1,118 +0,0 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -export class Module { - id: string; - exports: any; - // initialize promise if this module is a async module - initializer: Promise | undefined; - resource_pot: string = ""; - meta: Record; - require: (id: string) => any; - - constructor(id: string, require: (id: string) => any) { - this.id = id; - this.exports = {}; - this.meta = { - env: {} - }; - this.require = require; - } - - o(to: any, to_k: string, get: () => any) { - Object.defineProperty(to, to_k, { - enumerable: true, - get - }); - } - - // exports.xx = xx - d(to: any, to_k: string, val: any) { - this.o(to, to_k, function () { - return val; - }); - } - - // exports.__esModule - _m(to: any) { - const key = '__esModule'; - if (to[key]) return; - Object.defineProperty(to, key, { value: true }); - } - - // `export * from` helper - _e(to: any, from: any) { - Object.keys(from).forEach(function (k) { - if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { - Object.defineProperty(to, k, { value: from[k], enumerable: true, configurable: true }); - } - }); - - return from; - } - - // `import xxx from` helper - i(obj: any) { - return obj && obj.__esModule ? obj : { default: obj }; - } - // `import * as xx` helper, copied from @swc/helper - _g(nodeInterop: any) { - if (typeof WeakMap !== "function") return null; - - var cacheBabelInterop = new WeakMap(); - var cacheNodeInterop = new WeakMap(); - - return (this._g = function (nodeInterop) { - return nodeInterop ? cacheNodeInterop : cacheBabelInterop; - })(nodeInterop); - } - // `import * as xx` helper, copied from @swc/helper - w(obj: any, nodeInterop: any) { - if (!nodeInterop && obj && obj.__esModule) return obj; - if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { default: obj }; - - var cache = this._g(nodeInterop); - - if (cache && cache.has(obj)) return cache.get(obj); - - var newObj: any = { __proto__: null }; - var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; - - for (var key in obj) { - if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { - var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; - if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); - else newObj[key] = obj[key]; - } - } - - newObj.default = obj; - - if (cache) cache.set(obj, newObj); - - return newObj; -} - - // `export { xx } from` helper - _(to: any, to_k: string, from: any, from_k: string) { - this.d(to, to_k, from[from_k || to_k]); - } - - // revert imports/exports minify helper - p(to: Record, val: any) { - for (const key of Object.keys(val)) { - const newKey = to[key]; - if (newKey && !Object.prototype.hasOwnProperty.call(val, newKey)) { - this.d(val, newKey, val[key]); - } - } - } - - // minify x.default - f(v: any) { - if(typeof v.default !== 'undefined') { - return v.default; - } - - // compatible `import default from "module"` - return v; - } -} diff --git a/packages/runtime/src/modules/dynamic-import.ts b/packages/runtime/src/modules/dynamic-import.ts new file mode 100644 index 0000000000..017e5a2ee7 --- /dev/null +++ b/packages/runtime/src/modules/dynamic-import.ts @@ -0,0 +1,285 @@ +/** + * Define dynamic import polyfill of ModuleSystem, including: + * 1. moduleSystem.dynamicImport + * 2. ResourceLoader + */ +// using native ability to load resources if target env is node. + +import type { ModuleSystem } from '../module-system.js'; +import type { ResourceLoadResult } from './plugin.js'; + +export interface Resource { + path: string; + // 0: script, 1: link + type: 0 | 1; +} + +// Injected during compile time +declare const __FARM_RUNTIME_TARGET_ENV__: 'browser' | 'node'; +declare const __FARM_ENABLE_RUNTIME_PLUGIN__: boolean; + +let dynamicResources: Resource[] = []; +// dynamic module entry and resources map +let dynamicModuleResourcesMap: Record = {}; +const loadedResources: Record = {}; +const loadingResources: Record | null> = {}; +// available public paths, when loading resources, we will try each publicPath until it is available, this is so called `resource loading retry` +const publicPaths: string[] = []; + +let moduleSystem: ModuleSystem; + +// append properties in module system +export function initModuleSystem(ms: ModuleSystem) { + moduleSystem = ms; + moduleSystem.d = dynamicImport; + moduleSystem.sp = setPublicPaths; + moduleSystem.si = setInitialLoadedResources; + moduleSystem.sd = setDynamicModuleResourcesMap; + moduleSystem.l = loadDynamicResourcesOnly; +} + +function dynamicImport(id: string): Promise { + if (moduleSystem.m()[id]) { + const exports = moduleSystem.r(id); + + if (exports.__farm_async) { + return exports.default; + } else { + return Promise.resolve(exports); + } + } + + return loadDynamicResources(id); +} + +function loadDynamicResources(id: string, force = false): Promise { + const resources = dynamicModuleResourcesMap[id].map((index) => dynamicResources[index]); + + return loadDynamicResourcesOnly(id, force) + .then(() => { + // Do not require the module if all the resources are not js resources + if (resources.every(resource => resource.type !== 0)) { + return; + } + + if (!moduleSystem.m()[id]) { + throw new Error( + `Dynamic imported module "${id}" is not registered.`, + ); + } + const result = moduleSystem.r(id); + // if the module is async, return the default export, the default export should be a promise + if (result.__farm_async) { + return result.default; + } else { + return result; + } + }) + .catch((err) => { + console.error(`[Farm] Error loading dynamic module "${id}"`, err); + throw err; + }); +} + + +function loadDynamicResourcesOnly(id: string, force = false): Promise { + const resources = dynamicModuleResourcesMap[id].map((index) => dynamicResources[index]); + + if (!resources || resources.length === 0) { + throw new Error( + `Dynamic imported module "${id}" does not belong to any resource`, + ); + } + // force reload resources + if (force) { + moduleSystem.a(id); + } + // loading all required resources, and return the exports of the entry module + return Promise.all( + resources.map((resource) => { + if (force) { + const resourceLoaded = isResourceLoaded(resource.path); + setLoadedResource(resource.path, false); + + if (resourceLoaded) { + return load({ + ...resource, + // force reload the resource + path: `${resource.path}?t=${Date.now()}` + }); + } + } + return load(resource); + }), + ) +} + +function load(resource: Resource): Promise { + if (__FARM_RUNTIME_TARGET_ENV__ === 'node') { + return loadResourceNode(resource); + } else { + if (loadedResources[resource.path]) { + // Skip inject Promise polyfill for runtime + return Promise.resolve(); + } else if (loadingResources[resource.path]) { + return loadingResources[resource.path]; + } + + if (__FARM_ENABLE_RUNTIME_PLUGIN__) { + const result = moduleSystem.p.b( + 'loadResource', + resource + ); + + if (result) { + return result.then((res: ResourceLoadResult) => { + if (res.success) { + setLoadedResource(resource.path); + } else if (res.retryWithDefaultResourceLoader) { + return loadResource(resource, 0); + } else { + throw new Error( + `[Farm] Failed to load resource: "${resource.path}, type: ${resource.type}". Original Error: ${res.err}` + ); + } + }); + } + } + + return loadResource(resource, 0); + } +} + +function loadResourceNode(resource: Resource) { + if (__FARM_ENABLE_RUNTIME_PLUGIN__) { + const result = moduleSystem.p.b( + 'loadResource', + resource + ); + + if (result) { + return result.then((res: ResourceLoadResult) => { + if (!res.success && res.retryWithDefaultResourceLoader) { + if (resource.type === 0) { + return import(`./${resource.path}`); + } else if (resource.type === 1) { + return Promise.resolve(); + } + } else if (!res.success) { + throw new Error( + `[Farm] Failed to load resource: "${resource.path}, type: ${resource.type}". Original Error: ${res.err}` + ); + } + }); + } + } + + if (resource.type === 0) { + return import(`./${resource.path}`); + } else if (resource.type === 1) { + return Promise.resolve(); + } + +} + +function loadResource(resource: Resource, index: number): Promise { + const publicPath = publicPaths[index]; + const url = `${ + publicPath.endsWith('/') ? publicPath.slice(0, -1) : publicPath + }/${resource.path}`; + + let promise = Promise.resolve(); + + if (resource.type === 0) { + promise = loadScript(url); + } else if (resource.type === 1) { + promise = loadLink(url); + } + + loadingResources[resource.path] = promise; + + promise + .then(() => { + loadedResources[resource.path] = true; + loadingResources[resource.path] = null; + }) + .catch((e) => { + console.warn( + `[Farm] Failed to load resource "${url}" using publicPath: ${publicPaths[index]}` + ); + index++; + + if (index < publicPaths.length) { + return loadResource(resource, index); + } else { + loadingResources[resource.path] = null; + throw new Error( + `[Farm] Failed to load resource: "${resource.path}, type: ${resource.type}". ${e}` + ); + } + }); + + return promise; +} + +function loadScript(path: string): Promise { + return new Promise((resolve, reject) => { + const script = document.createElement('script'); + script.src = path; + document.body.appendChild(script); + + script.onload = () => { + resolve(); + }; + script.onerror = (e) => { + reject(e); + }; + }); +} + +function loadLink(path: string): Promise { + return new Promise((resolve, reject) => { + const link = document.createElement('link'); + link.rel = 'stylesheet'; + link.href = path; + document.head.appendChild(link); + + link.onload = () => { + resolve(); + }; + link.onerror = (e) => { + reject(e); + }; + }); +} + +function setLoadedResource(path: string, loaded = true) { + loadedResources[path] = loaded; +} + +function isResourceLoaded(path: string) { + return loadedResources[path]; +} + +// The public paths are injected during compile time +function setPublicPaths(p: string[]): void { + for (const key in p) { + publicPaths[key] = p[key] + } +} + +function setInitialLoadedResources(resources: string[]) { + for (const resource of resources) { + setLoadedResource(resource); + } +} + + // These two methods are used to support dynamic module loading, the dynamic module info is collected by the compiler and injected during compile time + // This method can also be called during runtime to add new dynamic modules +function setDynamicModuleResourcesMap( + dr: Resource[], + dmp: Record, + ): void { + dynamicResources = dr; + dynamicModuleResourcesMap = dmp; + } \ No newline at end of file diff --git a/packages/runtime/src/modules/module-helper.ts b/packages/runtime/src/modules/module-helper.ts new file mode 100644 index 0000000000..e93f315446 --- /dev/null +++ b/packages/runtime/src/modules/module-helper.ts @@ -0,0 +1,138 @@ +import type { ModuleSystem } from "../module-system.js"; + +declare const __FARM_ENABLE_EXPORT_HELPER__: boolean; +declare const __FARM_ENABLE_EXPORT_ALL_HELPER__: boolean; +declare const __FARM_ENABLE_IMPORT_ALL_HELPER__: boolean; +declare const __FARM_IMPORT_EXPORT_FROM_HELPER__: boolean; +declare const __FARM_ENABLE_IMPORT_DEFAULT_HELPER__: boolean; + +export function initModuleSystem(ms: ModuleSystem) { + const farmRequire: any = ms.r; + + // These guards will be removed when the condition if false during compile time + if (__FARM_ENABLE_EXPORT_HELPER__) { + farmRequire.o = exportByDefineProperty; + // exports.xx = xx + farmRequire.d = defineExport; + // exports.__esModule + farmRequire._m = defineExportEsModule; + } + + if (__FARM_ENABLE_EXPORT_ALL_HELPER__) { + // `export * from` helper + farmRequire._e = defineExportStar; + } + + if (__FARM_ENABLE_IMPORT_DEFAULT_HELPER__) { + // `import xxx from` helper + farmRequire.i = interopRequireDefault; + } + + if (__FARM_ENABLE_IMPORT_ALL_HELPER__) { + // `import * as xx` helper, copied from @swc/helper + farmRequire._g = getRequireWildcardCache; + // `import * as xx` helper, copied from @swc/helper + farmRequire.w = interopRequireWildcard; + } + + if (__FARM_IMPORT_EXPORT_FROM_HELPER__) { + farmRequire._ = defineExportFrom; + } + + if (__FARM_ENABLE_IMPORT_DEFAULT_HELPER__) { + farmRequire.f = importDefault; + } +} + +function exportByDefineProperty(to: any, to_k: string, get: () => any) { + if (Object.prototype.hasOwnProperty.call(to, to_k)) { + return; + } + Object.defineProperty(to, to_k, { + enumerable: true, + get + }); +} + +function defineExport(to: any, to_k: string, val: any) { + exportByDefineProperty(to, to_k, function () { + return val; + }); +} + +// exports.__esModule +export function defineExportEsModule(to: any) { + const key = '__esModule'; + if (to[key]) return; + Object.defineProperty(to, key, { value: true }); +} + +// `export * from` helper +export function defineExportStar(to: any, from: any) { + Object.keys(from).forEach(function (k) { + if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) { + Object.defineProperty(to, k, { value: from[k], enumerable: true, configurable: true }); + } + }); + + return from; +} + +// `import xxx from` helper +export function interopRequireDefault(obj: any) { + return obj && obj.__esModule ? obj : { default: obj }; +} + +function getRequireWildcardCache(nodeInterop: any) { + if (typeof WeakMap !== "function") return null; + + var cacheBabelInterop = new WeakMap(); + var cacheNodeInterop = new WeakMap(); + + // @ts-ignore ignore type check + return (getRequireWildcardCache = function (nodeInterop: any) { + return nodeInterop ? cacheNodeInterop : cacheBabelInterop; + })(nodeInterop); +} + +// `import * as xx` helper, copied from @swc/helper +export function interopRequireWildcard(obj: any, nodeInterop: any) { + if (!nodeInterop && obj && obj.__esModule) return obj; + if (obj === null || typeof obj !== "object" && typeof obj !== "function") return { default: obj }; + + var cache = getRequireWildcardCache(nodeInterop); + + if (cache && cache.has(obj)) return cache.get(obj); + + var newObj: any = { __proto__: null }; + var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; + + for (var key in obj) { + if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { + var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; + if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc); + else newObj[key] = obj[key]; + } + } + + newObj.default = obj; + + if (cache) cache.set(obj, newObj); + + return newObj; +} + +// `export { xx } from` helper +function defineExportFrom(to: any, to_k: string, from: any, from_k: string) { + defineExport(to, to_k, from[from_k || to_k]); +} + +// minify x.default +function importDefault(v: any) { + if(typeof v.default !== 'undefined') { + return v.default; + } + + // compatible with `import default from "module"` + return v; +} diff --git a/packages/runtime/src/modules/module-system-helper.ts b/packages/runtime/src/modules/module-system-helper.ts new file mode 100644 index 0000000000..c283c37a40 --- /dev/null +++ b/packages/runtime/src/modules/module-system-helper.ts @@ -0,0 +1,37 @@ +import type { ModuleInitialization, ModuleSystem } from "../module-system.js"; + +let moduleSystem: ModuleSystem; + +export function initModuleSystem(ms: ModuleSystem) { + moduleSystem = ms; + moduleSystem.u = updateModule; + moduleSystem.e = deleteModule; + moduleSystem.a = clearCache; +} + +function updateModule(moduleId: string, init: ModuleInitialization): void { + const modules = moduleSystem.m(); + modules[moduleId] = init; + clearCache(moduleId); +} + +function deleteModule(moduleId: string): boolean { + const modules = moduleSystem.m(); + if (modules[moduleId]) { + clearCache(moduleId); + delete modules[moduleId]; + return true; + } else { + return false; + } +} + +function clearCache(moduleId: string): boolean { + const cache = moduleSystem.c(); + if (cache[moduleId]) { + delete cache[moduleId]; + return true; + } else { + return false; + } +} \ No newline at end of file diff --git a/packages/runtime/src/modules/plugin.ts b/packages/runtime/src/modules/plugin.ts new file mode 100644 index 0000000000..7560982c87 --- /dev/null +++ b/packages/runtime/src/modules/plugin.ts @@ -0,0 +1,97 @@ +import type { ModuleSystem, Module } from '../module-system.js'; +import type { Resource } from './dynamic-import.js'; + +export interface ResourceLoadResult { + success: boolean; + retryWithDefaultResourceLoader?: boolean; + err?: Error; +} + +export interface FarmRuntimePlugin { + // plugin name + name: string; + // invoked when the module system is bootstrapped + bootstrap?: (moduleSystem: ModuleSystem) => void | Promise; + // invoked after new module instances are created + moduleCreated?: (module: Module) => void | Promise; + // invoked after module initialization functions are called + moduleInitialized?: (module: Module) => void | Promise; + // invoked after module caches are read, return true to skip cache reading + readModuleCache?: (module: Module) => boolean | Promise; + // called when module is not found + moduleNotFound?: (moduleId: string) => void | Promise; + // called when loading resources, custom your resource loading in this hook. + // return { success: true } to indicate that this resources have been loaded successfully. + // return { success: false, retryWithDefaultResourceLoader: true } to indicate that this resources have not been loaded successfully and should be retried with the default resource loader. + loadResource?: ( + resource: Resource, + targetEnv: 'browser' | 'node' + ) => Promise; +} + +export interface FarmRuntimePluginContainer { + // setPlugins + p(plugins: FarmRuntimePlugin[]): void; + // hookSerial + s(hookName: Exclude, ...args: any[]): void + // hookBail + b(hookName: Exclude, ...args: any[]): T | undefined +} + +let RUNTIME_PLUGINS: FarmRuntimePlugin[] = []; + +function hookPluginsSerial( + hookName: Exclude, + ...args: any[] +): // ): Promise { +void { + for (const plugin of RUNTIME_PLUGINS) { + const hook = plugin[hookName]; + + if (hook) { + // await hook.apply(plugin, args); + hook.apply(plugin, args); + } + } +} + +function hookPluginsBail( + hookName: Exclude, + ...args: any[] +): // ): Promise { +T | undefined { + for (const plugin of RUNTIME_PLUGINS) { + const hook = plugin[hookName]; + + if (hook) { + // const result = await hook.apply(plugin, args); + const result = hook.apply(plugin, args); + + if (result) { + return result as T; + } + } + } + return undefined; +} + +function setPlugins(plugins: FarmRuntimePlugin[]) { + RUNTIME_PLUGINS = plugins; +} + +const pluginContainer: FarmRuntimePluginContainer = { + p: setPlugins, + s: hookPluginsSerial, + b: hookPluginsBail +} + + +function bootstrap(): void { + pluginContainer.s("bootstrap", this); +} + + +export function initModuleSystem(moduleSystem: ModuleSystem) { + moduleSystem.p = pluginContainer; + moduleSystem.b = bootstrap; +} diff --git a/packages/runtime/src/plugin.ts b/packages/runtime/src/plugin.ts deleted file mode 100644 index c98fb8478b..0000000000 --- a/packages/runtime/src/plugin.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { Module } from './module.js'; -import type { ModuleSystem } from './module-system.js'; -import type { Resource } from './resource-loader.js'; - -export interface ResourceLoadResult { - success: boolean; - retryWithDefaultResourceLoader?: boolean; - err?: Error; -} - -export interface FarmRuntimePlugin { - // plugin name - name: string; - // invoked when the module system is bootstrapped - bootstrap?: (moduleSystem: ModuleSystem) => void | Promise; - // invoked after new module instances are created - moduleCreated?: (module: Module) => void | Promise; - // invoked after module initialization functions are called - moduleInitialized?: (module: Module) => void | Promise; - // invoked after module caches are read, return true to skip cache reading - readModuleCache?: (module: Module) => boolean | Promise; - // called when module is not found - moduleNotFound?: (moduleId: string) => void | Promise; - // called when loading resources, custom your resource loading in this hook. - // return { success: true } to indicate that this resources have been loaded successfully. - // return { success: false, retryWithDefaultResourceLoader: true } to indicate that this resources have not been loaded successfully and should be retried with the default resource loader. - loadResource?: ( - resource: Resource, - targetEnv: 'browser' | 'node' - ) => Promise; -} - -/* eslint-disable @typescript-eslint/no-explicit-any */ -export class FarmRuntimePluginContainer { - plugins: FarmRuntimePlugin[] = []; - - constructor(plugins: FarmRuntimePlugin[]) { - this.plugins = plugins; - } - - // TODO support async later - // async hookSerial( - hookSerial( - hookName: Exclude, - ...args: any[] - ): // ): Promise { - void { - for (const plugin of this.plugins) { - const hook = plugin[hookName]; - - if (hook) { - // await hook.apply(plugin, args); - hook.apply(plugin, args); - } - } - } - - // TODO support async later - // async hookBail( - hookBail( - hookName: Exclude, - ...args: any[] - ): // ): Promise { - T | undefined { - for (const plugin of this.plugins) { - const hook = plugin[hookName]; - - if (hook) { - // const result = await hook.apply(plugin, args); - const result = hook.apply(plugin, args); - - if (result) { - return result as T; - } - } - } - return undefined; - } -} diff --git a/packages/runtime/src/resource-loader.ts b/packages/runtime/src/resource-loader.ts deleted file mode 100644 index 737ed0931a..0000000000 --- a/packages/runtime/src/resource-loader.ts +++ /dev/null @@ -1,184 +0,0 @@ -// using native ability to load resources if target env is node. - -import type { ModuleSystem } from './module-system.js'; -import type { ResourceLoadResult } from './plugin.js'; - -export interface Resource { - path: string; - type: 0 | 1; // 0: script, 1: link -} - -// Injected during build -export const __farm_global_this__: any = '<@__farm_global_this__@>'; -export const __global_this__: any = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : {}; - -export const targetEnv = __farm_global_this__.__FARM_TARGET_ENV__ || 'node'; -export const isBrowser = - targetEnv === 'browser' && __global_this__.document; - -/** - * Loading resources according to their type and target env. - */ -export class ResourceLoader { - private _loadedResources: Record = {}; - private _loadingResources: Record> = {}; - - publicPaths: string[]; - - constructor(private moduleSystem: ModuleSystem, publicPaths: string[]) { - this.publicPaths = publicPaths; - } - - load(resource: Resource, index = 0): Promise { - // it's not running in browser - if (!isBrowser) { - const result = this.moduleSystem.pluginContainer.hookBail( - 'loadResource', - resource - ); - - if (result) { - return result.then((res: ResourceLoadResult) => { - if (!res.success && res.retryWithDefaultResourceLoader) { - if (resource.type === 0) { - return this._loadScript(`./${resource.path}`); - } else if (resource.type === 1) { - return this._loadLink(`./${resource.path}`); - } - } else if (!res.success) { - throw new Error( - `[Farm] Failed to load resource: "${resource.path}, type: ${resource.type}". Original Error: ${res.err}` - ); - } - }); - } else { - if (resource.type === 0) { - return this._loadScript(`./${resource.path}`); - } else if (resource.type === 1) { - return this._loadLink(`./${resource.path}`); - } - } - } - - const publicPath = this.publicPaths[index]; - const url = `${ - publicPath.endsWith('/') ? publicPath.slice(0, -1) : publicPath - }/${resource.path}`; - - if (this._loadedResources[resource.path]) { - return Promise.resolve(); - // @ts-ignore - } else if (this._loadingResources[resource.path]) { - // @ts-ignore - return this._loadingResources[resource.path]; - } - - const result = this.moduleSystem.pluginContainer.hookBail( - 'loadResource', - resource - ); - - if (result) { - return result.then((res: ResourceLoadResult) => { - if (res.success) { - this.setLoadedResource(resource.path); - } else if (res.retryWithDefaultResourceLoader) { - return this._load(url, resource, index); - } else { - throw new Error( - `[Farm] Failed to load resource: "${resource.path}, type: ${resource.type}". Original Error: ${res.err}` - ); - } - }); - } else { - return this._load(url, resource, index); - } - } - - setLoadedResource(path: string, loaded = true) { - this._loadedResources[path] = loaded; - } - - isResourceLoaded(path: string) { - return this._loadedResources[path]; - } - - private _load(url: string, resource: Resource, index: number): Promise { - let promise = Promise.resolve(); - - if (resource.type === 0) { - promise = this._loadScript(url); - } else if (resource.type === 1) { - promise = this._loadLink(url); - } - - this._loadingResources[resource.path] = promise; - - promise - .then(() => { - this._loadedResources[resource.path] = true; - // @ts-ignore - this._loadingResources[resource.path] = null; - }) - .catch((e) => { - console.warn( - `[Farm] Failed to load resource "${url}" using publicPath: ${this.publicPaths[index]}` - ); - index++; - - if (index < this.publicPaths.length) { - return this._load(url, resource, index); - } else { - // @ts-ignore - this._loadingResources[resource.path] = null; - throw new Error( - `[Farm] Failed to load resource: "${resource.path}, type: ${resource.type}". ${e}` - ); - } - }); - return promise; - } - - private _loadScript(path: string): Promise { - // @ts-ignore - if (FARM_RUNTIME_TARGET_ENV !== 'browser') { - return import(path); - } else { - return new Promise((resolve, reject) => { - const script = document.createElement('script'); - script.src = path; - document.body.appendChild(script); - - script.onload = () => { - resolve(); - }; - script.onerror = (e) => { - reject(e); - }; - }); - } - } - - private _loadLink(path: string): Promise { - // @ts-ignore - if (FARM_RUNTIME_TARGET_ENV !== 'browser') { - // return Promise.reject(new Error('Not support loading css in SSR')); - // ignore css loading in SSR - return Promise.resolve(); - } else { - return new Promise((resolve, reject) => { - const link = document.createElement('link'); - link.rel = 'stylesheet'; - link.href = path; - document.head.appendChild(link); - - link.onload = () => { - resolve(); - }; - link.onerror = (e) => { - reject(e); - }; - }); - } - } -} diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index eb323a6152..2c15c3ce77 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,5 +1,11 @@ # @farmfe/utils +## 1.0.0-nightly-20241022124925 + +### Major Changes + +- 6a1038c: update nightly tag + ## 0.1.0 ### Minor Changes diff --git a/packages/utils/package.json b/packages/utils/package.json index 2cf3123305..2acd31decd 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@farmfe/utils", - "version": "0.1.0", + "version": "1.0.0-nightly-20241022124925", "description": "farmfe utils", "main": "dist/index.js", "type": "module", @@ -36,5 +36,7 @@ "dev-server", "hmr" ], - "files": ["dist"] + "files": [ + "dist" + ] } diff --git a/packages/utils/src/color.ts b/packages/utils/src/color.ts index a144f2bf40..e565063cd6 100644 --- a/packages/utils/src/color.ts +++ b/packages/utils/src/color.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ // ISC License // Copyright (c) 2021 Alexey Raspopov, Kostiantyn Denysov, Anton Verinov @@ -27,6 +26,8 @@ const gradientPurpleColor = [176, 106, 179]; const gradientPinkColor = [198, 66, 110]; const brandGradientColors = [255, 182, 193]; const brandGradientColors2 = [128, 0, 128]; +const gradientOrangeColor = [255, 165, 0]; +const gradientGoldColor = [255, 215, 0]; const argv = process.argv || [], env = process.env; @@ -116,12 +117,16 @@ export const purple = enabled export const orange = enabled ? createFormatter('\x1b[38;2;255;137;54m', '\x1b[39m') : String; +export const lightCyan = enabled + ? createFormatter('\x1b[38;2;180;240;240m', '\x1b[39m') + : String; export const cyan = enabled ? createFormatter('\x1b[36m', '\x1b[39m') : String; export const white = enabled ? createFormatter('\x1b[37m', '\x1b[39m') : String; export const bgBlack = enabled ? createFormatter('\x1b[40m', '\x1b[49m') : String; + export const bgRed = enabled ? createFormatter('\x1b[41m', '\x1b[49m') : String; export const bgGreen = enabled ? createFormatter('\x1b[42m', '\x1b[49m') @@ -176,16 +181,16 @@ export const PersistentCacheBrand = brandColor('⚡️') + gradientString(`FULL EXTREME!`, [ gradientPurpleColor, - interpolateColor(gradientPurpleColor, gradientPinkColor, 0.1), interpolateColor(gradientPurpleColor, gradientPinkColor, 0.2), - interpolateColor(gradientPurpleColor, gradientPinkColor, 0.3), interpolateColor(gradientPurpleColor, gradientPinkColor, 0.4), - interpolateColor(gradientPurpleColor, gradientPinkColor, 0.5), interpolateColor(gradientPurpleColor, gradientPinkColor, 0.6), - interpolateColor(gradientPurpleColor, gradientPinkColor, 0.7), interpolateColor(gradientPurpleColor, gradientPinkColor, 0.8), - interpolateColor(gradientPurpleColor, gradientPinkColor, 0.9), - gradientPinkColor + gradientPinkColor, + interpolateColor(gradientPinkColor, gradientOrangeColor, 0.3), + interpolateColor(gradientPinkColor, gradientOrangeColor, 0.6), + gradientOrangeColor, + interpolateColor(gradientOrangeColor, gradientGoldColor, 0.5), + gradientGoldColor ]); export function handleBrandText(text: string) { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 818f6a8b9d..6ce5ae89ac 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,17 +14,17 @@ importers: .: devDependencies: '@biomejs/biome': - specifier: 1.8.3 - version: 1.8.3 + specifier: 1.9.4 + version: 1.9.4 '@changesets/cli': - specifier: ^2.26.0 - version: 2.26.2 + specifier: 2.27.9 + version: 2.27.9 '@codspeed/vitest-plugin': specifier: ^3.1.1 - version: 3.1.1(vite@5.2.8(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1))(vitest@2.0.4(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1)) + version: 3.1.1(vite@5.2.8(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))(vitest@2.0.4(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)) '@commitlint/cli': specifier: ^17.0.3 - version: 17.8.1 + version: 17.8.1(@swc/core@1.7.26(@swc/helpers@0.5.3)) '@commitlint/config-conventional': specifier: ^17.0.3 version: 17.8.1 @@ -39,13 +39,13 @@ importers: version: 18.19.67 '@vitest/coverage-v8': specifier: 2.0.4 - version: 2.0.4(vitest@2.0.4(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1)) + version: 2.0.4(vitest@2.0.4(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)) cross-env: specifier: ^7.0.3 version: 7.0.3 cspell: - specifier: ^6.2.2 - version: 6.31.3(encoding@0.1.13) + specifier: 8.14.2 + version: 8.14.2 execa: specifier: ^7.1.1 version: 7.2.0 @@ -61,24 +61,27 @@ importers: nanospinner: specifier: ^1.1.0 version: 1.1.0 + node-emoji: + specifier: ^2.1.3 + version: 2.1.3 playwright-chromium: specifier: ^1.42.1 version: 1.42.1 rimraf: - specifier: ^3.0.2 - version: 3.0.2 + specifier: 6.0.1 + version: 6.0.1 rollup: specifier: ^3.29.4 version: 3.29.4 typescript: - specifier: ^4.9.4 - version: 4.9.5 + specifier: 5.6.3 + version: 5.6.3 vite: specifier: ^5.2.6 - version: 5.2.8(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1) + version: 5.2.8(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) vitest: specifier: 2.0.4 - version: 2.0.4(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1) + version: 2.0.4(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) bench: dependencies: @@ -86,6 +89,151 @@ importers: specifier: workspace:* version: link:../packages/core + docs: + dependencies: + '@crowdin/cli': + specifier: '3' + version: 3.19.4(encoding@0.1.13) + '@crowdin/crowdin-api-client': + specifier: ^1.23.4 + version: 1.36.0 + '@docusaurus/core': + specifier: 3.5.2 + version: 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@docusaurus/plugin-ideal-image': + specifier: 3.5.2 + version: 3.5.2(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(prop-types@15.8.1)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@docusaurus/preset-classic': + specifier: 3.5.2 + version: 3.5.2(@algolia/client-search@4.24.0)(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/react@18.2.35)(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@docusaurus/theme-common': + specifier: 3.5.2 + version: 3.5.2(@docusaurus/plugin-content-docs@3.5.2(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))))(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3) + '@docusaurus/theme-search-algolia': + specifier: 3.5.2 + version: 3.5.2(@algolia/client-search@4.24.0)(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/react@18.2.35)(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@mdx-js/react': + specifier: ^3.0.0 + version: 3.0.1(@types/react@18.2.35)(react@18.2.0) + '@radix-ui/react-icons': + specifier: ^1.3.0 + version: 1.3.0(react@18.2.0) + '@react-spring/web': + specifier: ^9.7.3 + version: 9.7.5(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@react-three/drei': + specifier: 9.112.1 + version: 9.112.1(@react-three/fiber@8.17.7(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(three@0.168.0))(@types/react@18.2.35)(@types/three@0.163.0)(immer@10.0.3)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(three@0.168.0) + '@react-three/fiber': + specifier: 8.17.7 + version: 8.17.7(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(three@0.168.0) + '@shikijs/markdown-it': + specifier: ^1.18.0 + version: 1.22.0 + '@shikijs/transformers': + specifier: ^1.18.0 + version: 1.22.0 + '@tabler/icons-react': + specifier: ^3.11.0 + version: 3.19.0(react@18.2.0) + autoprefixer: + specifier: ^10.4.14 + version: 10.4.16(postcss@8.4.47) + class-variance-authority: + specifier: ^0.7.0 + version: 0.7.0 + docusaurus-plugin-sass: + specifier: 0.2.5 + version: 0.2.5(@docusaurus/core@3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))))(sass@1.74.1)(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))) + docusaurus-preset-shiki-twoslash: + specifier: ^1.1.41 + version: 1.1.41 + leva: + specifier: ^0.9.35 + version: 0.9.35(@types/react-dom@18.2.14)(@types/react@18.2.35)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + lucide-react: + specifier: ^0.394.0 + version: 0.394.0(react@18.2.0) + markdown-it: + specifier: ^14.1.0 + version: 14.1.0 + next-themes: + specifier: ^0.3.0 + version: 0.3.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + postcss: + specifier: ^8.4.24 + version: 8.4.47 + postcss-preset-env: + specifier: ^10.0.3 + version: 10.0.6(postcss@8.4.47) + prism-react-renderer: + specifier: ^2.1.0 + version: 2.4.0(react@18.2.0) + react: + specifier: ^18.2.0 + version: 18.2.0 + react-dom: + specifier: ^18.2.0 + version: 18.2.0(react@18.2.0) + react-icons: + specifier: ^5.3.0 + version: 5.3.0(react@18.2.0) + react-intersection-observer: + specifier: ^9.5.1 + version: 9.13.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + react-use-measure: + specifier: ^2.1.1 + version: 2.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + remark-gfm: + specifier: ^4.0.0 + version: 4.0.0 + sass: + specifier: ^1.63.6 + version: 1.74.1 + tailwindcss-animate: + specifier: ^1.0.7 + version: 1.0.7(tailwindcss@3.4.13(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@20.14.12)(typescript@5.6.3))) + three: + specifier: 0.168.0 + version: 0.168.0 + devDependencies: + '@docusaurus/module-type-aliases': + specifier: 3.5.2 + version: 3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@docusaurus/types': + specifier: 3.5.2 + version: 3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@swc/core': + specifier: ^1.3.99 + version: 1.7.26(@swc/helpers@0.5.3) + babel-loader: + specifier: ^9.1.3 + version: 9.2.1(@babel/core@7.25.2)(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))) + clsx: + specifier: ^1.2.1 + version: 1.2.1 + framer-motion: + specifier: ^11.2.10 + version: 11.11.1(@emotion/is-prop-valid@1.3.1)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + shiki: + specifier: ^1.7.0 + version: 1.22.0 + shikiji: + specifier: 0.9.10 + version: 0.9.10 + swc-loader: + specifier: ^0.2.3 + version: 0.2.6(@swc/core@1.7.26(@swc/helpers@0.5.3))(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))) + tailwind-merge: + specifier: ^2.3.0 + version: 2.5.5 + tailwindcss: + specifier: ^3.4.4 + version: 3.4.13(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@20.14.12)(typescript@5.6.3)) + ts-node: + specifier: ^10.9.1 + version: 10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@20.14.12)(typescript@5.6.3) + examples/arcgis: dependencies: '@arcgis/core': @@ -93,7 +241,7 @@ importers: version: 4.30.9(@floating-ui/utils@0.2.8) '@arcgis/map-components': specifier: ^4.30.7 - version: 4.30.7(@arcgis/core@4.30.9(@floating-ui/utils@0.2.8))(@esri/calcite-components@2.12.2(@floating-ui/utils@0.2.8)) + version: 4.30.7(@arcgis/core@4.30.9(@floating-ui/utils@0.2.8))(@esri/calcite-components@2.13.0(@floating-ui/utils@0.2.8)) core-js: specifier: ^3.34.0 version: 3.37.1 @@ -324,6 +472,9 @@ importers: examples/decorators: dependencies: + '@swc/helpers': + specifier: ^0.5.0 + version: 0.5.3 core-js: specifier: ^3.33.3 version: 3.33.3 @@ -332,7 +483,7 @@ importers: version: 0.1.13 devDependencies: '@farmfe/cli': - specifier: ^1.0.1 + specifier: workspace:* version: link:../../packages/cli '@farmfe/core': specifier: workspace:* @@ -432,7 +583,7 @@ importers: examples/external: devDependencies: '@farmfe/cli': - specifier: ^1.0.1 + specifier: workspace:* version: link:../../packages/cli '@farmfe/core': specifier: workspace:* @@ -478,7 +629,7 @@ importers: examples/import-meta: devDependencies: '@farmfe/cli': - specifier: ^1.0.4 + specifier: workspace:* version: link:../../packages/cli '@farmfe/core': specifier: workspace:* @@ -503,13 +654,13 @@ importers: version: 0.20.0(react@17.0.2) devDependencies: '@farmfe/cli': - specifier: ^1.0.2 + specifier: workspace:* version: link:../../packages/cli '@farmfe/core': specifier: workspace:* version: link:../../packages/core '@farmfe/plugin-react': - specifier: ^1.1.0 + specifier: 2.0.0-nightly-20241022124925 version: link:../../rust-plugins/react '@types/react': specifier: '18' @@ -605,6 +756,21 @@ importers: specifier: ^0.14.0 version: 0.14.0 + examples/lib: + devDependencies: + '@farmfe/cli': + specifier: workspace:* + version: link:../../packages/cli + '@farmfe/js-plugin-dts': + specifier: workspace:* + version: link:../../js-plugins/dts + '@farmfe/plugin-dts': + specifier: workspace:* + version: link:../../rust-plugins/dts + typescript: + specifier: ^5.4.3 + version: 5.6.3 + examples/lib-for-browser: dependencies: react-refresh: @@ -636,6 +802,37 @@ importers: specifier: workspace:* version: link:../../packages/core + examples/module-concatenation: + dependencies: + core-js: + specifier: ^3.30.1 + version: 3.37.1 + react: + specifier: '18' + version: 18.2.0 + react-dom: + specifier: '18' + version: 18.2.0(react@18.2.0) + devDependencies: + '@farmfe/cli': + specifier: workspace:* + version: link:../../packages/cli + '@farmfe/core': + specifier: workspace:* + version: link:../../packages/core + '@farmfe/plugin-react': + specifier: workspace:* + version: link:../../rust-plugins/react + '@types/react': + specifier: '18' + version: 18.2.35 + '@types/react-dom': + specifier: '18' + version: 18.2.14 + react-refresh: + specifier: ^0.14.0 + version: 0.14.2 + examples/multi-page-app: dependencies: clsx: @@ -699,7 +896,7 @@ importers: version: link:../../packages/core '@nestjs/cli': specifier: ^10.0.0 - version: 10.4.2 + version: 10.4.2(@swc/core@1.7.26(@swc/helpers@0.5.3)) '@nestjs/schematics': specifier: ^10.0.0 version: 10.1.2(chokidar@3.6.0)(typescript@5.4.5) @@ -738,7 +935,7 @@ importers: version: 0.1.5 jest: specifier: ^29.5.0 - version: 29.7.0(@types/node@18.19.67)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@types/node@18.19.67)(typescript@5.4.5)) + version: 29.7.0(@types/node@18.19.67)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@18.19.67)(typescript@5.4.5)) prettier: specifier: ^3.0.0 version: 3.3.2 @@ -750,13 +947,13 @@ importers: version: 6.3.4 ts-jest: specifier: ^29.1.0 - version: 29.1.5(@babel/core@7.25.2)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.2))(jest@29.7.0(@types/node@18.19.67)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@types/node@18.19.67)(typescript@5.4.5)))(typescript@5.4.5) + version: 29.1.5(@babel/core@7.25.2)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.2))(jest@29.7.0(@types/node@18.19.67)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@18.19.67)(typescript@5.4.5)))(typescript@5.4.5) ts-loader: specifier: ^9.4.3 - version: 9.5.1(typescript@5.4.5)(webpack@5.92.1) + version: 9.5.1(typescript@5.4.5)(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))) ts-node: specifier: ^10.9.1 - version: 10.9.1(@types/node@18.19.67)(typescript@5.4.5) + version: 10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@18.19.67)(typescript@5.4.5) tsconfig-paths: specifier: ^4.2.0 version: 4.2.0 @@ -819,7 +1016,7 @@ importers: version: link:../../rust-plugins/react '@pandacss/dev': specifier: ^0.42.0 - version: 0.42.0(typescript@5.4.5) + version: 0.42.0(typescript@5.6.3) '@types/react': specifier: '18' version: 18.2.35 @@ -862,7 +1059,7 @@ importers: version: 6.0.0(postcss@8.4.31) tailwindcss: specifier: ^3.3.2 - version: 3.3.5(ts-node@10.9.1(@types/node@20.14.12)(typescript@5.4.5)) + version: 3.3.5(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@20.14.12)(typescript@5.6.3)) examples/public-dir: dependencies: @@ -958,7 +1155,7 @@ importers: version: 2.2.1(react-redux@7.2.9(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react@18.2.0) '@sentry/react': specifier: ^8.33.1 - version: 8.33.1(react@18.2.0) + version: 8.34.0(react@18.2.0) clsx: specifier: ^1.2.1 version: 1.2.1 @@ -1077,13 +1274,13 @@ importers: version: 18.2.0(react@18.2.0) devDependencies: '@farmfe/cli': - specifier: 'workspace:' + specifier: workspace:* version: link:../../packages/cli '@farmfe/core': specifier: workspace:* version: link:../../packages/core '@farmfe/plugin-react': - specifier: 'workspace:' + specifier: workspace:* version: link:../../rust-plugins/react '@types/react': specifier: '18' @@ -1142,7 +1339,7 @@ importers: version: 0.14.0 vite-plugin-pages: specifier: ^0.32.0 - version: 0.32.0(@vue/compiler-sfc@3.4.35)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1)) + version: 0.32.0(@vue/compiler-sfc@3.4.35)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)) examples/react-sass-js: dependencies: @@ -1227,6 +1424,43 @@ importers: specifier: ^0.14.0 version: 0.14.0 + examples/refactor-react: + dependencies: + '@ant-design/happy-work-theme': + specifier: ^1.0.0 + version: 1.0.0(antd@5.11.0(date-fns@2.30.0)(luxon@3.4.4)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + antd: + specifier: ^5.4.2 + version: 5.11.0(date-fns@2.30.0)(luxon@3.4.4)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + react: + specifier: '18' + version: 18.2.0 + react-dom: + specifier: '18' + version: 18.2.0(react@18.2.0) + devDependencies: + '@farmfe/cli': + specifier: workspace:* + version: link:../../packages/cli + '@farmfe/core': + specifier: workspace:* + version: link:../../packages/core + '@farmfe/plugin-react': + specifier: workspace:* + version: link:../../rust-plugins/react + '@types/react': + specifier: '18' + version: 18.2.35 + '@types/react-dom': + specifier: '18' + version: 18.2.14 + core-js: + specifier: ^3.36.1 + version: 3.37.1 + react-refresh: + specifier: ^0.14.0 + version: 0.14.2 + examples/resolve-module-graph: devDependencies: '@farmfe/cli': @@ -1429,7 +1663,7 @@ importers: version: 0.5.3(solid-js@1.8.5) vite-plugin-solid: specifier: ^2.7.0 - version: 2.7.2(solid-js@1.8.5)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1)) + version: 2.7.2(solid-js@1.8.5)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)) examples/static-assets: dependencies: @@ -1491,7 +1725,7 @@ importers: version: 0.14.0 tailwindcss: specifier: ^3.3.2 - version: 3.3.5(ts-node@10.9.1(@types/node@20.14.12)(typescript@5.4.5)) + version: 3.3.5(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@20.14.12)(typescript@5.6.3)) examples/tailwind-next: dependencies: @@ -1504,12 +1738,21 @@ importers: core-js: specifier: ^3.30.1 version: 3.37.1 + lucide-react: + specifier: ^0.394.0 + version: 0.394.0(react@18.2.0) react: specifier: '18' version: 18.2.0 react-dom: specifier: '18' version: 18.2.0(react@18.2.0) + tailwind-merge: + specifier: ^2.3.0 + version: 2.5.5 + tailwindcss-animate: + specifier: ^1.0.7 + version: 1.0.7(tailwindcss@4.0.0-alpha.26) devDependencies: '@farmfe/cli': specifier: workspace:* @@ -1531,7 +1774,7 @@ importers: version: 18.2.14 autoprefixer: specifier: ^10.4.14 - version: 10.4.16(postcss@8.4.47) + version: 10.4.20(postcss@8.4.47) react-refresh: specifier: ^0.14.0 version: 0.14.2 @@ -1627,7 +1870,7 @@ importers: version: 1.15.3(babel-plugin-macros@3.1.0) '@vanilla-extract/vite-plugin': specifier: ^4.0.13 - version: 4.0.13(@types/node@20.14.12)(babel-plugin-macros@3.1.0)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1)) + version: 4.0.13(@types/node@20.14.12)(babel-plugin-macros@3.1.0)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)) devDependencies: '@farmfe/cli': specifier: workspace:* @@ -1640,7 +1883,44 @@ importers: version: 5.4.5 vite: specifier: ^5.2.6 - version: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1) + version: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) + + examples/visualizer: + dependencies: + react: + specifier: '18' + version: 18.2.0 + react-dom: + specifier: '18' + version: 18.2.0(react@18.2.0) + devDependencies: + '@farmfe/cli': + specifier: workspace:* + version: link:../../packages/cli + '@farmfe/core': + specifier: workspace:* + version: link:../../packages/core + '@farmfe/js-plugin-visualizer': + specifier: workspace:* + version: link:../../js-plugins/visualizer + '@farmfe/plugin-react': + specifier: workspace:* + version: link:../../rust-plugins/react + '@types/react': + specifier: '18' + version: 18.2.35 + '@types/react-dom': + specifier: '18' + version: 18.2.14 + compression: + specifier: ^1.7.4 + version: 1.7.4 + core-js: + specifier: ^3.36.1 + version: 3.37.1 + react-refresh: + specifier: ^0.14.0 + version: 0.14.2 examples/vite-adapter-react: dependencies: @@ -1683,7 +1963,7 @@ importers: version: 0.14.0 vite-plugin-pages: specifier: ^0.32.0 - version: 0.32.0(@vue/compiler-sfc@3.4.35)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1)) + version: 0.32.0(@vue/compiler-sfc@3.4.35)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)) examples/vite-adapter-solid: dependencies: @@ -1708,19 +1988,19 @@ importers: version: 5.2.2 vite-plugin-solid: specifier: ^2.7.0 - version: 2.7.2(solid-js@1.8.5)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1)) + version: 2.7.2(solid-js@1.8.5)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)) examples/vite-adapter-svelte: devDependencies: '@farmfe/cli': - specifier: ^1.0.4 + specifier: workspace:* version: link:../../packages/cli '@farmfe/core': specifier: workspace:* version: link:../../packages/core '@sveltejs/vite-plugin-svelte': specifier: ^4 - version: 4.0.3(svelte@5.2.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1)) + version: 4.0.1(svelte@5.2.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)) '@tsconfig/svelte': specifier: ^5.0.2 version: 5.0.2 @@ -1729,7 +2009,7 @@ importers: version: 5.2.1 svelte-check: specifier: ^4 - version: 4.1.1(picomatch@4.0.2)(svelte@5.2.1)(typescript@5.2.2) + version: 4.0.8(picomatch@4.0.2)(svelte@5.2.1)(typescript@5.2.2) tslib: specifier: ^2.6.2 version: 2.6.2 @@ -1741,7 +2021,7 @@ importers: dependencies: vite-tsconfig-paths: specifier: ^4.3.1 - version: 4.3.1(typescript@5.4.5)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1)) + version: 4.3.1(typescript@5.6.3)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)) devDependencies: '@farmfe/cli': specifier: workspace:* @@ -1766,7 +2046,7 @@ importers: version: 0.32.33 ant-design-vue: specifier: '3' - version: 3.2.20(vue@3.3.7(typescript@5.4.5)) + version: 3.2.20(vue@3.3.7(typescript@5.6.3)) axios: specifier: ^1.4.0 version: 1.6.0 @@ -1781,23 +2061,17 @@ importers: version: 3.33.2 element-plus: specifier: ^2.4.1 - version: 2.4.2(@vue/composition-api@1.7.2(vue@3.3.7(typescript@5.4.5)))(vue@3.3.7(typescript@5.4.5)) + version: 2.4.2(@vue/composition-api@1.7.2(vue@3.3.7(typescript@5.6.3)))(vue@3.3.7(typescript@5.6.3)) prettier: specifier: ^3.3.2 version: 3.3.2 vue: specifier: ^3.2.45 - version: 3.3.7(typescript@5.4.5) + version: 3.3.7(typescript@5.6.3) vue-router: specifier: ^4.2.1 - version: 4.2.5(vue@3.3.7(typescript@5.4.5)) + version: 4.2.5(vue@3.3.7(typescript@5.6.3)) devDependencies: - '@farmfe/cli': - specifier: workspace:* - version: link:../../packages/cli - '@farmfe/core': - specifier: workspace:* - version: link:../../packages/core '@farmfe/js-plugin-less': specifier: workspace:^ version: link:../../js-plugins/less @@ -1824,10 +2098,10 @@ importers: version: 0.62.2(postcss@8.4.32) '@vitejs/plugin-vue': specifier: 5.1.4 - version: 5.1.4(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.69.5)(terser@5.31.1))(vue@3.3.7(typescript@5.4.5)) + version: 5.1.4(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.69.5)(terser@5.31.1))(vue@3.3.7(typescript@5.6.3)) '@vitejs/plugin-vue-jsx': specifier: ^3.1.0 - version: 3.1.0(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.69.5)(terser@5.31.1))(vue@3.3.7(typescript@5.4.5)) + version: 3.1.0(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.69.5)(terser@5.31.1))(vue@3.3.7(typescript@5.6.3)) postcss: specifier: ^8.4.32 version: 8.4.32 @@ -1839,34 +2113,34 @@ importers: version: 1.69.5 unocss: specifier: ^0.62.2 - version: 0.62.2(postcss@8.4.32)(rollup@4.14.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.69.5)(terser@5.31.1)) + version: 0.62.2(postcss@8.4.32)(rollup@4.14.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.69.5)(terser@5.31.1)) unplugin-auto-import: specifier: ^0.16.7 - version: 0.16.7(@vueuse/core@9.13.0(@vue/composition-api@1.7.2(vue@3.3.7(typescript@5.4.5)))(vue@3.3.7(typescript@5.4.5)))(rollup@4.14.1) + version: 0.16.7(@vueuse/core@9.13.0(@vue/composition-api@1.7.2(vue@3.3.7(typescript@5.6.3)))(vue@3.3.7(typescript@5.6.3)))(rollup@4.14.1) unplugin-svg-component: specifier: ^0.8.0 version: 0.8.0(@vue/compiler-sfc@3.4.35) unplugin-vue-components: specifier: ^0.25.2 - version: 0.25.2(@babel/parser@7.25.3)(rollup@4.14.1)(vue@3.3.7(typescript@5.4.5)) + version: 0.25.2(@babel/parser@7.26.3)(rollup@4.14.1)(vue@3.3.7(typescript@5.6.3)) unplugin-vue-router: specifier: ^0.7.0 - version: 0.7.0(rollup@4.14.1)(vue-router@4.2.5(vue@3.3.7(typescript@5.4.5)))(vue@3.3.7(typescript@5.4.5)) + version: 0.7.0(rollup@4.14.1)(vue-router@4.2.5(vue@3.3.7(typescript@5.6.3)))(vue@3.3.7(typescript@5.6.3)) vite-svg-loader: specifier: ^5.1.0 - version: 5.1.0(vue@3.3.7(typescript@5.4.5)) + version: 5.1.0(vue@3.3.7(typescript@5.6.3)) examples/vite-adapter-vue-css: dependencies: vue: specifier: ^3.4.27 - version: 3.4.27(typescript@5.4.5) + version: 3.4.27(typescript@5.6.3) vue-router: specifier: ^4.3.2 - version: 4.3.2(vue@3.4.27(typescript@5.4.5)) + version: 4.3.2(vue@3.4.27(typescript@5.6.3)) devDependencies: '@farmfe/cli': - specifier: ^1.0.2 + specifier: workspace:* version: link:../../packages/cli '@farmfe/core': specifier: workspace:* @@ -1876,10 +2150,10 @@ importers: version: link:../../rust-plugins/sass '@vitejs/plugin-vue': specifier: ^5.0.4 - version: 5.0.4(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1))(vue@3.4.27(typescript@5.4.5)) + version: 5.0.4(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))(vue@3.4.27(typescript@5.6.3)) '@vitejs/plugin-vue-jsx': specifier: ^3.1.0 - version: 3.1.0(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1))(vue@3.4.27(typescript@5.4.5)) + version: 3.1.0(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))(vue@3.4.27(typescript@5.6.3)) prettier: specifier: ^3.2.5 version: 3.2.5 @@ -1888,17 +2162,17 @@ importers: dependencies: vue: specifier: ^3.4.15 - version: 3.4.15(typescript@5.4.5) + version: 3.4.15(typescript@5.6.3) devDependencies: '@farmfe/cli': - specifier: workspace:^1.0.0 + specifier: workspace:* version: link:../../packages/cli '@farmfe/core': specifier: workspace:* version: link:../../packages/core '@vitejs/plugin-vue': specifier: ^5.0.3 - version: 5.0.3(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1))(vue@3.4.15(typescript@5.4.5)) + version: 5.0.3(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))(vue@3.4.15(typescript@5.6.3)) core-js: specifier: ^3.35.1 version: 3.35.1 @@ -1919,7 +2193,7 @@ importers: version: 2.6.14 devDependencies: '@farmfe/cli': - specifier: workspace:^1.0.0 + specifier: workspace:* version: link:../../packages/cli '@farmfe/core': specifier: workspace:* @@ -1932,7 +2206,7 @@ importers: version: 3.36.1 vite-plugin-vue2: specifier: ^2.0.3 - version: 2.0.3(ejs@3.1.10)(lodash@4.17.21)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1))(vue-template-compiler@2.6.14(vue@2.6.14))(vue@2.6.14) + version: 2.0.3(ejs@3.1.10)(lodash@4.17.21)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))(vue-template-compiler@2.6.14(vue@2.6.14))(vue@2.6.14) vue-template-compiler: specifier: 2.6.14 version: 2.6.14(vue@2.6.14) @@ -1953,14 +2227,14 @@ importers: version: 2.7.16 devDependencies: '@farmfe/cli': - specifier: workspace:^1.0.0 + specifier: workspace:* version: link:../../packages/cli '@farmfe/core': specifier: workspace:* version: link:../../packages/core '@vitejs/plugin-vue2': specifier: ^2.3.1 - version: 2.3.1(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1))(vue@2.7.16) + version: 2.3.1(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))(vue@2.7.16) core-js: specifier: ^3.30.1 version: 3.36.1 @@ -1978,10 +2252,10 @@ importers: version: 3.33.2 element-plus: specifier: ^2.4.1 - version: 2.4.2(@vue/composition-api@1.7.2(vue@3.3.7(typescript@5.4.5)))(vue@3.3.7(typescript@5.4.5)) + version: 2.4.2(@vue/composition-api@1.7.2(vue@3.3.7(typescript@5.6.3)))(vue@3.3.7(typescript@5.6.3)) vue: specifier: ^3.3.0 - version: 3.3.7(typescript@5.4.5) + version: 3.3.7(typescript@5.6.3) devDependencies: '@farmfe/cli': specifier: workspace:* @@ -2006,19 +2280,19 @@ importers: dependencies: '@ant-design/icons-vue': specifier: ^6.1.0 - version: 6.1.0(vue@3.3.7(typescript@5.4.5)) + version: 6.1.0(vue@3.3.7(typescript@5.6.3)) ant-design-vue: specifier: ^4.0.3 - version: 4.0.6(vue@3.3.7(typescript@5.4.5)) + version: 4.0.6(vue@3.3.7(typescript@5.6.3)) core-js: specifier: ^3.30.1 version: 3.33.2 vue: specifier: ^3.3.0 - version: 3.3.7(typescript@5.4.5) + version: 3.3.7(typescript@5.6.3) vue-router: specifier: ^4.2.1 - version: 4.2.5(vue@3.3.7(typescript@5.4.5)) + version: 4.2.5(vue@3.3.7(typescript@5.6.3)) xlsx: specifier: ^0.18.5 version: 0.18.5 @@ -2034,7 +2308,7 @@ importers: version: link:../../js-plugins/less '@vitejs/plugin-vue': specifier: ^5.0.4 - version: 5.0.4(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1))(vue@3.3.7(typescript@5.4.5)) + version: 5.0.4(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))(vue@3.3.7(typescript@5.6.3)) xlsx-js-style: specifier: ^1.2.0 version: 1.2.0 @@ -2043,7 +2317,7 @@ importers: dependencies: vue: specifier: ^3.3.0 - version: 3.3.7(typescript@5.4.5) + version: 3.3.7(typescript@5.6.3) devDependencies: '@farmfe/cli': specifier: workspace:* @@ -2053,16 +2327,16 @@ importers: version: link:../../packages/core '@vitejs/plugin-vue': specifier: ^5.0.4 - version: 5.0.4(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1))(vue@3.3.7(typescript@5.4.5)) + version: 5.0.4(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))(vue@3.3.7(typescript@5.6.3)) '@vitejs/plugin-vue-jsx': specifier: ^3.1.0 - version: 3.1.0(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1))(vue@3.3.7(typescript@5.4.5)) + version: 3.1.0(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))(vue@3.3.7(typescript@5.6.3)) examples/vue-nativeui: dependencies: vue: specifier: ^3.4.34 - version: 3.4.35(typescript@5.4.5) + version: 3.4.35(typescript@5.6.3) devDependencies: '@farmfe/cli': specifier: workspace:* @@ -2072,13 +2346,16 @@ importers: version: link:../../packages/core '@vitejs/plugin-vue': specifier: ^5.1.1 - version: 5.1.2(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1))(vue@3.4.35(typescript@5.4.5)) + version: 5.1.2(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))(vue@3.4.35(typescript@5.6.3)) + compression: + specifier: ^1.7.4 + version: 1.7.4 core-js: specifier: ^3.37.1 version: 3.37.1 naive-ui: specifier: ^2.39.0 - version: 2.39.0(vue@3.4.35(typescript@5.4.5)) + version: 2.39.0(vue@3.4.35(typescript@5.6.3)) examples/vue-ssr: dependencies: @@ -2093,13 +2370,13 @@ importers: version: 4.18.2 primevue: specifier: '3' - version: 3.52.0(vue@3.3.12(typescript@5.4.5)) + version: 3.52.0(vue@3.3.12(typescript@5.6.3)) vue: specifier: ^3.3.12 - version: 3.3.12(typescript@5.4.5) + version: 3.3.12(typescript@5.6.3) vue-router: specifier: ^4.2.1 - version: 4.2.5(vue@3.3.12(typescript@5.4.5)) + version: 4.2.5(vue@3.3.12(typescript@5.6.3)) devDependencies: '@farmfe/cli': specifier: workspace:* @@ -2109,7 +2386,53 @@ importers: version: link:../../packages/core '@vitejs/plugin-vue': specifier: ^4.4.0 - version: 4.4.0(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1))(vue@3.3.12(typescript@5.4.5)) + version: 4.4.0(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))(vue@3.3.12(typescript@5.6.3)) + + examples/vue3: + dependencies: + '@module-federation/vite': + specifier: ^1.1.1 + version: 1.1.1(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(rollup@4.14.1)(sass@1.74.1)(terser@5.31.1) + unplugin-auto-import: + specifier: ^0.16.7 + version: 0.16.7(@vueuse/core@9.13.0(@vue/composition-api@1.7.2(vue@3.4.35(typescript@5.6.3)))(vue@3.4.35(typescript@5.6.3)))(rollup@4.14.1) + unplugin-vue-router: + specifier: ^0.7.0 + version: 0.7.0(rollup@4.14.1)(vue-router@4.4.5(vue@3.4.35(typescript@5.6.3)))(vue@3.4.35(typescript@5.6.3)) + vue: + specifier: ^3.4.0 + version: 3.4.35(typescript@5.6.3) + vue-router: + specifier: ^4.4.3 + version: 4.4.5(vue@3.4.35(typescript@5.6.3)) + devDependencies: + '@vitejs/plugin-vue': + specifier: 5.1.4 + version: 5.1.4(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))(vue@3.4.35(typescript@5.6.3)) + compression: + specifier: ^1.7.4 + version: 1.7.4 + core-js: + specifier: ^3.30.1 + version: 3.37.1 + unocss: + specifier: ^0.62.2 + version: 0.62.2(postcss@8.4.47)(rollup@4.14.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)) + unplugin-vue-inspector: + specifier: ^2.2.0 + version: 2.2.0(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)) + vite-plugin-compression: + specifier: ^0.5.1 + version: 0.5.1(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)) + vite-plugin-html: + specifier: ^3.2.2 + version: 3.2.2(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)) + vite-plugin-inspect: + specifier: ^0.8.7 + version: 0.8.7(rollup@4.14.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)) + vite-plugin-mkcert: + specifier: ^1.17.6 + version: 1.17.6(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)) examples/x-data-spreadsheet: dependencies: @@ -2148,24 +2471,12 @@ importers: specifier: ^5.4.5 version: 5.4.5 devDependencies: - '@farmfe/cli': - specifier: workspace:* - version: link:../../packages/cli - '@farmfe/core': - specifier: workspace:* - version: link:../../packages/core '@types/fs-extra': specifier: ^11.0.1 version: 11.0.3 js-plugins/electron: devDependencies: - '@farmfe/cli': - specifier: workspace:* - version: link:../../packages/cli - '@farmfe/core': - specifier: workspace:* - version: link:../../packages/core '@farmfe/js-plugin-dts': specifier: workspace:* version: link:../dts @@ -2222,7 +2533,7 @@ importers: version: 16.0.1(postcss@8.4.31) postcss-load-config: specifier: ^4.0.1 - version: 4.0.1(postcss@8.4.31)(ts-node@10.9.1(@types/node@20.14.12)(typescript@5.4.5)) + version: 4.0.1(postcss@8.4.31)(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@20.14.12)(typescript@5.6.3)) postcss-url: specifier: ^10.1.3 version: 10.1.3(postcss@8.4.31) @@ -2266,12 +2577,6 @@ importers: specifier: ^0.5.3 version: 0.5.3(solid-js@1.8.5) devDependencies: - '@farmfe/cli': - specifier: workspace:* - version: link:../../packages/cli - '@farmfe/core': - specifier: workspace:* - version: link:../../packages/core '@farmfe/js-plugin-dts': specifier: workspace:* version: link:../dts @@ -2286,10 +2591,10 @@ importers: dependencies: '@svgr/core': specifier: ^8.1.0 - version: 8.1.0(typescript@5.4.5) + version: 8.1.0(typescript@5.6.3) '@svgr/plugin-jsx': specifier: ^8.1.0 - version: 8.1.0(@svgr/core@8.1.0(typescript@5.4.5)) + version: 8.1.0(@svgr/core@8.1.0(typescript@5.6.3)) devDependencies: '@farmfe/cli': specifier: workspace:* @@ -2314,7 +2619,7 @@ importers: version: 4.0.0-beta.8 lightningcss: specifier: ^1.27.0 - version: 1.27.0 + version: 1.28.2 postcss: specifier: ^8.4.47 version: 8.4.47 @@ -2328,6 +2633,9 @@ importers: '@farmfe/js-plugin-dts': specifier: workspace:^ version: link:../dts + '@farmfe/plugin-dts': + specifier: workspace:^ + version: link:../../rust-plugins/dts '@types/postcss-import': specifier: ^14.0.3 version: 14.0.3 @@ -2336,10 +2644,10 @@ importers: dependencies: '@ant-design/icons-vue': specifier: ^7.0.1 - version: 7.0.1(vue@3.4.15(typescript@5.4.5)) + version: 7.0.1(vue@3.4.35(typescript@5.6.3)) '@guolao/vue-monaco-editor': specifier: ^1.5.1 - version: 1.5.1(@vue/composition-api@1.7.2(vue@3.4.15(typescript@5.4.5)))(vue@3.4.15(typescript@5.4.5)) + version: 1.5.1(@vue/composition-api@1.7.2(vue@3.4.35(typescript@5.6.3)))(vue@3.4.35(typescript@5.6.3)) '@types/ws': specifier: ^8.5.4 version: 8.5.8 @@ -2365,12 +2673,6 @@ importers: specifier: ^8.14.2 version: 8.14.2(bufferutil@4.0.8)(utf-8-validate@6.0.3) devDependencies: - '@farmfe/cli': - specifier: workspace:* - version: link:../../packages/cli - '@farmfe/core': - specifier: workspace:* - version: link:../../packages/core '@farmfe/js-plugin-dts': specifier: workspace:* version: link:../dts @@ -2391,10 +2693,10 @@ importers: version: 2.13.10 '@vitejs/plugin-vue': specifier: ^4.4.0 - version: 4.6.2(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1))(vue@3.4.15(typescript@5.4.5)) + version: 4.6.2(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))(vue@3.4.35(typescript@5.6.3)) ant-design-vue: specifier: ^4.1.2 - version: 4.1.2(vue@3.4.15(typescript@5.4.5)) + version: 4.1.2(vue@3.4.35(typescript@5.6.3)) autoprefixer: specifier: ^10.4.14 version: 10.4.16(postcss@8.4.35) @@ -2403,28 +2705,22 @@ importers: version: 2.14.2 pinia: specifier: ^2.1.7 - version: 2.1.7(@vue/composition-api@1.7.2(vue@3.4.15(typescript@5.4.5)))(typescript@5.4.5)(vue@3.4.15(typescript@5.4.5)) + version: 2.1.7(@vue/composition-api@1.7.2(vue@3.4.35(typescript@5.6.3)))(typescript@5.6.3)(vue@3.4.35(typescript@5.6.3)) postcss: specifier: ^8.4.31 version: 8.4.35 tailwindcss: specifier: ^3.3.2 - version: 3.3.5(ts-node@10.9.1(@types/node@20.14.12)(typescript@5.4.5)) + version: 3.4.13(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@20.14.12)(typescript@5.6.3)) vue: specifier: ^3.3.4 - version: 3.4.15(typescript@5.4.5) + version: 3.4.35(typescript@5.6.3) vue-router: specifier: ^4.2.1 - version: 4.2.5(vue@3.4.15(typescript@5.4.5)) + version: 4.4.5(vue@3.4.35(typescript@5.6.3)) js-plugins/vue: devDependencies: - '@farmfe/cli': - specifier: workspace:^ - version: link:../../packages/cli - '@farmfe/core': - specifier: workspace:* - version: link:../../packages/core '@farmfe/js-plugin-dts': specifier: workspace:^ version: link:../dts @@ -2464,52 +2760,42 @@ importers: cac: specifier: ^6.7.14 version: 6.7.14 - cross-spawn: - specifier: ^7.0.3 - version: 7.0.3 - inquirer: - specifier: 9.2.12 - version: 9.2.12 - walkdir: - specifier: ^0.4.1 - version: 0.4.1 - devDependencies: - '@farmfe/cli': - specifier: workspace:* - version: 'link:' - '@farmfe/core': - specifier: workspace:* - version: link:../core - '@types/cross-spawn': - specifier: ^6.0.2 - version: 6.0.4 - '@types/inquirer': - specifier: ^9.0.3 - version: 9.0.6 packages/core: dependencies: + '@farmfe/plugin-replace-dirname': + specifier: workspace:* + version: link:../../rust-plugins/replace-dirname '@farmfe/runtime': - specifier: workspace:0.12.10 + specifier: workspace:1.0.0-nightly-20241023020505 version: link:../runtime '@farmfe/runtime-plugin-hmr': - specifier: workspace:3.5.10 + specifier: workspace:4.0.0-nightly-20241029095811 version: link:../runtime-plugin-hmr '@farmfe/runtime-plugin-import-meta': - specifier: workspace:0.2.3 + specifier: workspace:1.0.0-nightly-20241023020505 version: link:../runtime-plugin-import-meta '@farmfe/utils': specifier: workspace:* version: link:../utils - '@koa/cors': - specifier: ^5.0.0 - version: 5.0.0 + '@polka/compression': + specifier: 1.0.0-next.25 + version: 1.0.0-next.25 '@swc/helpers': specifier: ^0.5.0 version: 0.5.3 chokidar: specifier: ^3.5.3 version: 3.5.3 + connect: + specifier: ^3.7.0 + version: 3.7.0 + cors: + specifier: ^2.8.5 + version: 2.8.5 + debug: + specifier: ^4.3.5 + version: 4.3.7 deepmerge: specifier: ^4.3.1 version: 4.3.1 @@ -2519,50 +2805,44 @@ importers: dotenv-expand: specifier: ^11.0.6 version: 11.0.6 + etag: + specifier: ^1.8.1 + version: 1.8.1 execa: - specifier: ^7.1.1 - version: 7.2.0 + specifier: 8.0.0 + version: 8.0.0 farm-browserslist-generator: - specifier: 1.0.5 + specifier: ^1.0.5 version: 1.0.5 - farm-plugin-replace-dirname: - specifier: 0.2.1 - version: 0.2.1 fast-glob: specifier: ^3.3.2 version: 3.3.2 fs-extra: specifier: ^11.1.1 version: 11.1.1 - http-proxy-middleware: - specifier: ^3.0.0 - version: 3.0.0 + http-proxy: + specifier: ^1.18.1 + version: 1.18.1(debug@4.3.7) is-plain-object: specifier: ^5.0.0 version: 5.0.0 - koa: - specifier: ^2.13.4 - version: 2.14.2 - koa-compress: - specifier: ^5.1.1 - version: 5.1.1 - koa-connect: - specifier: ^2.1.0 - version: 2.1.0 - koa-static: - specifier: ^5.0.0 - version: 5.0.0 - lodash.debounce: - specifier: ^4.0.8 - version: 4.0.8 - loglevel: - specifier: ^1.8.1 - version: 1.8.1 + mime: + specifier: ^4.0.4 + version: 4.0.4 + mime-types: + specifier: ^2.1.35 + version: 2.1.35 open: - specifier: ^9.1.0 - version: 9.1.0 + specifier: 10.1.0 + version: 10.1.0 + sirv: + specifier: ^3.0.0 + version: 3.0.0 + slashes: + specifier: ^3.0.12 + version: 3.0.12 ws: - specifier: ^8.12.0 + specifier: ^8.14.2 version: 8.14.2(bufferutil@4.0.8)(utf-8-validate@6.0.3) zod: specifier: ^3.23.8 @@ -2574,24 +2854,45 @@ importers: '@napi-rs/cli': specifier: ^2.18.4 version: 2.18.4 + '@types/compression': + specifier: ^1.7.5 + version: 1.7.5 + '@types/connect': + specifier: ^3.4.38 + version: 3.4.38 + '@types/cors': + specifier: ^2.8.17 + version: 2.8.17 + '@types/debug': + specifier: ^4.1.12 + version: 4.1.12 + '@types/escape-html': + specifier: ^1.0.4 + version: 1.0.4 + '@types/etag': + specifier: ^1.8.3 + version: 1.8.3 + '@types/figlet': + specifier: ^1.5.5 + version: 1.7.0 '@types/fs-extra': specifier: ^11.0.1 version: 11.0.3 - '@types/koa': - specifier: ^2.13.5 - version: 2.13.10 - '@types/koa-compress': - specifier: ^4.0.3 - version: 4.0.5 - '@types/koa-static': - specifier: ^4.0.2 - version: 4.0.3 - '@types/koa__cors': - specifier: ^5.0.0 - version: 5.0.0 + '@types/http-proxy': + specifier: ^1.17.14 + version: 1.17.14 + '@types/mime-types': + specifier: ^2.1.2 + version: 2.1.4 '@types/ws': - specifier: ^8.5.4 + specifier: ^8.5.8 version: 8.5.8 + escape-html: + specifier: ^1.0.3 + version: 1.0.3 + react-refresh: + specifier: ^0.14.0 + version: 0.14.2 packages/create-farm: devDependencies: @@ -2601,12 +2902,6 @@ importers: packages/create-farm-plugin: devDependencies: - '@farmfe/cli': - specifier: workspace:* - version: link:../cli - '@farmfe/core': - specifier: workspace:* - version: link:../core '@farmfe/utils': specifier: workspace:* version: link:../utils @@ -2648,18 +2943,24 @@ importers: specifier: ^18.19.67 version: 18.19.67 typescript: - specifier: ^4.7.4 - version: 4.9.5 + specifier: 5.5.4 + version: 5.5.4 packages/runtime-plugin-hmr: dependencies: core-js: specifier: ^3.30.1 version: 3.33.2 + prismjs: + specifier: ^1.29.0 + version: 1.29.0 devDependencies: '@farmfe/runtime': - specifier: workspace:* + specifier: workspace:1.0.0-nightly-20241023020505 version: link:../runtime + '@types/prismjs': + specifier: ^1.26.5 + version: 1.26.5 packages/runtime-plugin-import-meta: dependencies: @@ -2668,17 +2969,29 @@ importers: version: 3.30.1 devDependencies: '@farmfe/runtime': - specifier: workspace:* + specifier: workspace:1.0.0-nightly-20241023020505 version: link:../runtime packages/utils: {} + rust-plugins/dts: + devDependencies: + '@farmfe/plugin-tools': + specifier: workspace:* + version: link:../../packages/plugin-tools + rust-plugins/react: devDependencies: '@farmfe/plugin-tools': specifier: workspace:* version: link:../../packages/plugin-tools + rust-plugins/replace-dirname: + devDependencies: + '@farmfe/plugin-tools': + specifier: workspace:* + version: link:../../packages/plugin-tools + rust-plugins/sass: optionalDependencies: sass-embedded-darwin-arm64: @@ -2715,6 +3028,74 @@ packages: '@adobe/css-tools@4.4.0': resolution: {integrity: sha512-Ff9+ksdQQB3rMncgqDK78uLznstjyfIf2Arnh22pW8kBpLs6rpKDwgnZT46hin5Hl1WzazzK64DOrhSwYpS7bQ==} + '@algolia/autocomplete-core@1.9.3': + resolution: {integrity: sha512-009HdfugtGCdC4JdXUbVJClA0q0zh24yyePn+KUGk3rP7j8FEe/m5Yo/z65gn6nP/cM39PxpzqKrL7A6fP6PPw==} + + '@algolia/autocomplete-plugin-algolia-insights@1.9.3': + resolution: {integrity: sha512-a/yTUkcO/Vyy+JffmAnTWbr4/90cLzw+CC3bRbhnULr/EM0fGNvM13oQQ14f2moLMcVDyAx/leczLlAOovhSZg==} + peerDependencies: + search-insights: '>= 1 < 3' + + '@algolia/autocomplete-preset-algolia@1.9.3': + resolution: {integrity: sha512-d4qlt6YmrLMYy95n5TB52wtNDr6EgAIPH81dvvvW8UmuWRgxEtY0NJiPwl/h95JtG2vmRM804M0DSwMCNZlzRA==} + peerDependencies: + '@algolia/client-search': '>= 4.9.1 < 6' + algoliasearch: '>= 4.9.1 < 6' + + '@algolia/autocomplete-shared@1.9.3': + resolution: {integrity: sha512-Wnm9E4Ye6Rl6sTTqjoymD+l8DjSTHsHboVRYrKgEt8Q7UHm9nYbqhN/i0fhUYA3OAEH7WA8x3jfpnmJm3rKvaQ==} + peerDependencies: + '@algolia/client-search': '>= 4.9.1 < 6' + algoliasearch: '>= 4.9.1 < 6' + + '@algolia/cache-browser-local-storage@4.24.0': + resolution: {integrity: sha512-t63W9BnoXVrGy9iYHBgObNXqYXM3tYXCjDSHeNwnsc324r4o5UiVKUiAB4THQ5z9U5hTj6qUvwg/Ez43ZD85ww==} + + '@algolia/cache-common@4.24.0': + resolution: {integrity: sha512-emi+v+DmVLpMGhp0V9q9h5CdkURsNmFC+cOS6uK9ndeJm9J4TiqSvPYVu+THUP8P/S08rxf5x2P+p3CfID0Y4g==} + + '@algolia/cache-in-memory@4.24.0': + resolution: {integrity: sha512-gDrt2so19jW26jY3/MkFg5mEypFIPbPoXsQGQWAi6TrCPsNOSEYepBMPlucqWigsmEy/prp5ug2jy/N3PVG/8w==} + + '@algolia/client-account@4.24.0': + resolution: {integrity: sha512-adcvyJ3KjPZFDybxlqnf+5KgxJtBjwTPTeyG2aOyoJvx0Y8dUQAEOEVOJ/GBxX0WWNbmaSrhDURMhc+QeevDsA==} + + '@algolia/client-analytics@4.24.0': + resolution: {integrity: sha512-y8jOZt1OjwWU4N2qr8G4AxXAzaa8DBvyHTWlHzX/7Me1LX8OayfgHexqrsL4vSBcoMmVw2XnVW9MhL+Y2ZDJXg==} + + '@algolia/client-common@4.24.0': + resolution: {integrity: sha512-bc2ROsNL6w6rqpl5jj/UywlIYC21TwSSoFHKl01lYirGMW+9Eek6r02Tocg4gZ8HAw3iBvu6XQiM3BEbmEMoiA==} + + '@algolia/client-personalization@4.24.0': + resolution: {integrity: sha512-l5FRFm/yngztweU0HdUzz1rC4yoWCFo3IF+dVIVTfEPg906eZg5BOd1k0K6rZx5JzyyoP4LdmOikfkfGsKVE9w==} + + '@algolia/client-search@4.24.0': + resolution: {integrity: sha512-uRW6EpNapmLAD0mW47OXqTP8eiIx5F6qN9/x/7HHO6owL3N1IXqydGwW5nhDFBrV+ldouro2W1VX3XlcUXEFCA==} + + '@algolia/events@4.0.1': + resolution: {integrity: sha512-FQzvOCgoFXAbf5Y6mYozw2aj5KCJoA3m4heImceldzPSMbdyS4atVjJzXKMsfX3wnZTFYwkkt8/z8UesLHlSBQ==} + + '@algolia/logger-common@4.24.0': + resolution: {integrity: sha512-LLUNjkahj9KtKYrQhFKCzMx0BY3RnNP4FEtO+sBybCjJ73E8jNdaKJ/Dd8A/VA4imVHP5tADZ8pn5B8Ga/wTMA==} + + '@algolia/logger-console@4.24.0': + resolution: {integrity: sha512-X4C8IoHgHfiUROfoRCV+lzSy+LHMgkoEEU1BbKcsfnV0i0S20zyy0NLww9dwVHUWNfPPxdMU+/wKmLGYf96yTg==} + + '@algolia/recommend@4.24.0': + resolution: {integrity: sha512-P9kcgerfVBpfYHDfVZDvvdJv0lEoCvzNlOy2nykyt5bK8TyieYyiD0lguIJdRZZYGre03WIAFf14pgE+V+IBlw==} + + '@algolia/requester-browser-xhr@4.24.0': + resolution: {integrity: sha512-Z2NxZMb6+nVXSjF13YpjYTdvV3032YTBSGm2vnYvYPA6mMxzM3v5rsCiSspndn9rzIW4Qp1lPHBvuoKJV6jnAA==} + + '@algolia/requester-common@4.24.0': + resolution: {integrity: sha512-k3CXJ2OVnvgE3HMwcojpvY6d9kgKMPRxs/kVohrwF5WMr2fnqojnycZkxPoEg+bXm8fi5BBfFmOqgYztRtHsQA==} + + '@algolia/requester-node-http@4.24.0': + resolution: {integrity: sha512-JF18yTjNOVYvU/L3UosRcvbPMGT9B+/GQWNWnenIImglzNVGpyzChkXLnrSf6uxwVNO6ESGu6oN8MqcGQcjQJw==} + + '@algolia/transporter@4.24.0': + resolution: {integrity: sha512-86nI7w6NzWxd1Zp9q3413dRshDqAzSbsQjhcDhPIatEFiZrL1/TjnHL8S7jVKFePlIMzDsZWXAXwXzcok9c5oA==} + '@alloc/quick-lru@5.2.0': resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==} engines: {node: '>=10'} @@ -2763,6 +3144,14 @@ packages: react: '>=16.0.0' react-dom: '>=16.0.0' + '@ant-design/happy-work-theme@1.0.0': + resolution: {integrity: sha512-BKuz5PZkGZwXqzDwTE9fiHYlpKdDyoGnApEih2MG1GF79/a/YekxBc4tdqocykDtWzt3z1wwmHv8AiB7EUTWsQ==} + engines: {node: '>=8.x'} + peerDependencies: + antd: '>= 5.8.2' + react: '>=16.9.0' + react-dom: '>=16.9.0' + '@ant-design/icons-svg@4.3.1': resolution: {integrity: sha512-4QBZg8ccyC6LPIRii7A0bZUk3+lEDCLnhB+FVsflGdcWPPmV+j3fire4AwwoqHV/BibgvBmR9ZIo4s867smv+g==} @@ -2931,6 +3320,14 @@ packages: resolution: {integrity: sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==} engines: {node: '>=6.9.0'} + '@babel/code-frame@7.25.7': + resolution: {integrity: sha512-0xZJFNE5XMpENsgfHYTw8FbX4kv53mFLn2i3XPoq69LyhYSCBJtitaHx9QnsVTrsogI4Z3+HtEfZ2/GFPOtf5g==} + engines: {node: '>=6.9.0'} + + '@babel/code-frame@7.26.2': + resolution: {integrity: sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==} + engines: {node: '>=6.9.0'} + '@babel/compat-data@7.24.1': resolution: {integrity: sha512-Pc65opHDliVpRHuKfzI+gSA4zcgr65O4cl64fFJIWEEh8JoHIHh0Oez1Eo8Arz8zq/JhgKodQaxEwUPRtZylVA==} engines: {node: '>=6.9.0'} @@ -2939,6 +3336,10 @@ packages: resolution: {integrity: sha512-bYcppcpKBvX4znYaPEeFau03bp89ShqNMLs+rmdptMw+heSZh9+z84d2YG+K7cYLbWwzdjtDoW/uqZmPjulClQ==} engines: {node: '>=6.9.0'} + '@babel/compat-data@7.25.7': + resolution: {integrity: sha512-9ickoLz+hcXCeh7jrcin+/SLWm+GkxE2kTvoYyp38p4WkdFXfQJxDFGWp/YHjiKLPx06z2A7W8XKuqbReXDzsw==} + engines: {node: '>=6.9.0'} + '@babel/core@7.23.2': resolution: {integrity: sha512-n7s51eWdaWZ3vGT2tD4T7J6eJs3QoBXydv7vkUM06Bf1cbVD2Kc2UrkzhiQwobfV7NwOnQXYL7UBJ5VPU+RGoQ==} engines: {node: '>=6.9.0'} @@ -2963,6 +3364,14 @@ packages: resolution: {integrity: sha512-3LEEcj3PVW8pW2R1SR1M89g/qrYk/m/mB/tLqn7dn4sbBUQyTqnlod+II2U4dqiGtUmkcnAmkMDralTFZttRiw==} engines: {node: '>=6.9.0'} + '@babel/generator@7.25.7': + resolution: {integrity: sha512-5Dqpl5fyV9pIAD62yK9P7fcA768uVPUyrQmqpqstHWgMma4feF1x/oFysBCVZLY5wJ2GkMUCdsNDnGZrPoR6rA==} + engines: {node: '>=6.9.0'} + + '@babel/generator@7.26.3': + resolution: {integrity: sha512-6FF/urZvD0sTeO7k6/B15pMLC4CHUv1426lzr3N01aHJTl046uCAh9LXW/fzeXXjPNCJ6iABW5XaWOsIZB93aQ==} + engines: {node: '>=6.9.0'} + '@babel/helper-annotate-as-pure@7.22.5': resolution: {integrity: sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==} engines: {node: '>=6.9.0'} @@ -2971,6 +3380,14 @@ packages: resolution: {integrity: sha512-BaDeOonYvhdKw+JoMVkAixAAJzG2jVPIwWoKBPdYuY9b452e2rPuI9QPYh3KpofZ3pW2akOmwZLOiOsHMiqRAg==} engines: {node: '>=6.9.0'} + '@babel/helper-annotate-as-pure@7.25.7': + resolution: {integrity: sha512-4xwU8StnqnlIhhioZf1tqnVWeQ9pvH/ujS8hRfw/WOza+/a+1qv69BWNy+oY231maTCWgKWhfBU7kDpsds6zAA==} + engines: {node: '>=6.9.0'} + + '@babel/helper-builder-binary-assignment-operator-visitor@7.25.7': + resolution: {integrity: sha512-12xfNeKNH7jubQNm7PAkzlLwEmCs1tfuX3UjIw6vP6QXi+leKh6+LyC/+Ed4EIQermwd58wsyh070yjDHFlNGg==} + engines: {node: '>=6.9.0'} + '@babel/helper-compilation-targets@7.22.15': resolution: {integrity: sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw==} engines: {node: '>=6.9.0'} @@ -2983,6 +3400,10 @@ packages: resolution: {integrity: sha512-U2U5LsSaZ7TAt3cfaymQ8WHh0pxvdHoEk6HVpaexxixjyEquMh0L0YNJNM6CTGKMXV1iksi0iZkGw4AcFkPaaw==} engines: {node: '>=6.9.0'} + '@babel/helper-compilation-targets@7.25.7': + resolution: {integrity: sha512-DniTEax0sv6isaw6qSQSfV4gVRNtw2rte8HHM45t9ZR0xILaufBRNkpMifCRiAPyvL4ACD6v0gfCwCmtOQaV4A==} + engines: {node: '>=6.9.0'} + '@babel/helper-create-class-features-plugin@7.24.1': resolution: {integrity: sha512-1yJa9dX9g//V6fDebXoEfEsxkZHk3Hcbm+zLhyu6qVgYFLvmTALTeV+jNU9e5RnYtioBrGEOdoI2joMSNQ/+aA==} engines: {node: '>=6.9.0'} @@ -2995,11 +3416,28 @@ packages: peerDependencies: '@babel/core': ^7.0.0 + '@babel/helper-create-class-features-plugin@7.25.7': + resolution: {integrity: sha512-bD4WQhbkx80mAyj/WCm4ZHcF4rDxkoLFO6ph8/5/mQ3z4vAzltQXAmbc7GvVJx5H+lk5Mi5EmbTeox5nMGCsbw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/helper-create-regexp-features-plugin@7.25.7': + resolution: {integrity: sha512-byHhumTj/X47wJ6C6eLpK7wW/WBEcnUeb7D0FNc/jFQnQVw7DOso3Zz5u9x/zLrFVkHa89ZGDbkAa1D54NdrCQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + '@babel/helper-define-polyfill-provider@0.4.3': resolution: {integrity: sha512-WBrLmuPP47n7PNwsZ57pqam6G/RGo1vw/87b0Blc53tZNGZ4x7YvZ6HgQe2vo1W/FR20OgjeZuGXzudPiXHFug==} peerDependencies: '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + '@babel/helper-define-polyfill-provider@0.6.3': + resolution: {integrity: sha512-HK7Bi+Hj6H+VTHA3ZvBis7V/6hu9QuTrnMXNybfUf2iiuU/N97I8VjB+KbhFF8Rld/Lx5MzoCwPCpPjfK+n8Cg==} + peerDependencies: + '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + '@babel/helper-environment-visitor@7.22.20': resolution: {integrity: sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==} engines: {node: '>=6.9.0'} @@ -3020,6 +3458,10 @@ packages: resolution: {integrity: sha512-LABppdt+Lp/RlBxqrh4qgf1oEH/WxdzQNDJIu5gC/W1GyvPVrOBiItmmM8wan2fm4oYqFuFfkXmlGpLQhPY8CA==} engines: {node: '>=6.9.0'} + '@babel/helper-member-expression-to-functions@7.25.7': + resolution: {integrity: sha512-O31Ssjd5K6lPbTX9AAYpSKrZmLeagt9uwschJd+Ixo6QiRyfpvgtVQp8qrDR9UNFjZ8+DO34ZkdrN+BnPXemeA==} + engines: {node: '>=6.9.0'} + '@babel/helper-module-imports@7.18.6': resolution: {integrity: sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==} engines: {node: '>=6.9.0'} @@ -3028,8 +3470,12 @@ packages: resolution: {integrity: sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==} engines: {node: '>=6.9.0'} - '@babel/helper-module-imports@7.24.7': - resolution: {integrity: sha512-8AyH3C+74cgCVVXow/myrynrAGv+nTVg5vKu2nZph9x7RcRwzmh0VFallJuFTZ9mx6u4eSdXZfcOzSqTUm0HCA==} + '@babel/helper-module-imports@7.25.7': + resolution: {integrity: sha512-o0xCgpNmRohmnoWKQ0Ij8IdddjyBFE4T2kagL/x6M3+4zUgc+4qTOUBoNe4XxDskt1HPKO007ZPiMgLDq2s7Kw==} + engines: {node: '>=6.9.0'} + + '@babel/helper-module-imports@7.25.9': + resolution: {integrity: sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==} engines: {node: '>=6.9.0'} '@babel/helper-module-transforms@7.23.0': @@ -3050,6 +3496,12 @@ packages: peerDependencies: '@babel/core': ^7.0.0 + '@babel/helper-module-transforms@7.25.7': + resolution: {integrity: sha512-k/6f8dKG3yDz/qCwSM+RKovjMix563SLxQFo0UhRNo239SP6n9u5/eLtKD6EAjwta2JHJ49CsD8pms2HdNiMMQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + '@babel/helper-optimise-call-expression@7.22.5': resolution: {integrity: sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==} engines: {node: '>=6.9.0'} @@ -3058,6 +3510,10 @@ packages: resolution: {integrity: sha512-jKiTsW2xmWwxT1ixIdfXUZp+P5yURx2suzLZr5Hi64rURpDYdMW0pv+Uf17EYk2Rd428Lx4tLsnjGJzYKDM/6A==} engines: {node: '>=6.9.0'} + '@babel/helper-optimise-call-expression@7.25.7': + resolution: {integrity: sha512-VAwcwuYhv/AT+Vfr28c9y6SHzTan1ryqrydSTFGjU0uDJHw3uZ+PduI8plCLkRsDnqK2DMEDmwrOQRsK/Ykjng==} + engines: {node: '>=6.9.0'} + '@babel/helper-plugin-utils@7.22.5': resolution: {integrity: sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==} engines: {node: '>=6.9.0'} @@ -3070,6 +3526,16 @@ packages: resolution: {integrity: sha512-FFWx5142D8h2Mgr/iPVGH5G7w6jDn4jUSpZTyDnQO0Yn7Ks2Kuz6Pci8H6MPCoUJegd/UZQ3tAvfLCxQSnWWwg==} engines: {node: '>=6.9.0'} + '@babel/helper-plugin-utils@7.25.7': + resolution: {integrity: sha512-eaPZai0PiqCi09pPs3pAFfl/zYgGaE6IdXtYvmf0qlcDTd3WCtO7JWCcRd64e0EQrcYgiHibEZnOGsSY4QSgaw==} + engines: {node: '>=6.9.0'} + + '@babel/helper-remap-async-to-generator@7.25.7': + resolution: {integrity: sha512-kRGE89hLnPfcz6fTrlNU+uhgcwv0mBE4Gv3P9Ke9kLVJYpi4AMVVEElXvB5CabrPZW4nCM8P8UyyjrzCM0O2sw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + '@babel/helper-replace-supers@7.24.1': resolution: {integrity: sha512-QCR1UqC9BzG5vZl8BMicmZ28RuUBnHhAMddD8yHFHDRH9lLTZ9uUPehX8ctVPT8l0TKblJidqcgUUKGVrePleQ==} engines: {node: '>=6.9.0'} @@ -3082,6 +3548,12 @@ packages: peerDependencies: '@babel/core': ^7.0.0 + '@babel/helper-replace-supers@7.25.7': + resolution: {integrity: sha512-iy8JhqlUW9PtZkd4pHM96v6BdJ66Ba9yWSE4z0W4TvSZwLBPkyDsiIU3ENe4SmrzRBs76F7rQXTy1lYC49n6Lw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + '@babel/helper-simple-access@7.22.5': resolution: {integrity: sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==} engines: {node: '>=6.9.0'} @@ -3090,6 +3562,10 @@ packages: resolution: {integrity: sha512-zBAIvbCMh5Ts+b86r/CjU+4XGYIs+R1j951gxI3KmmxBMhCg4oQMsv6ZXQ64XOm/cvzfU1FmoCyt6+owc5QMYg==} engines: {node: '>=6.9.0'} + '@babel/helper-simple-access@7.25.7': + resolution: {integrity: sha512-FPGAkJmyoChQeM+ruBGIDyrT2tKfZJO8NcxdC+CWNJi7N8/rZpSxK7yvBJ5O/nF1gfu5KzN7VKG3YVSLFfRSxQ==} + engines: {node: '>=6.9.0'} + '@babel/helper-skip-transparent-expression-wrappers@7.22.5': resolution: {integrity: sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==} engines: {node: '>=6.9.0'} @@ -3098,6 +3574,10 @@ packages: resolution: {integrity: sha512-IO+DLT3LQUElMbpzlatRASEyQtfhSE0+m465v++3jyyXeBTBUjtVZg28/gHeV5mrTJqvEKhKroBGAvhW+qPHiQ==} engines: {node: '>=6.9.0'} + '@babel/helper-skip-transparent-expression-wrappers@7.25.7': + resolution: {integrity: sha512-pPbNbchZBkPMD50K0p3JGcFMNLVUCuU/ABybm/PGNj4JiHrpmNyqqCphBk4i19xXtNV0JhldQJJtbSW5aUvbyA==} + engines: {node: '>=6.9.0'} + '@babel/helper-split-export-declaration@7.22.6': resolution: {integrity: sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==} engines: {node: '>=6.9.0'} @@ -3110,6 +3590,14 @@ packages: resolution: {integrity: sha512-pO9KhhRcuUyGnJWwyEgnRJTSIZHiT+vMD0kPeD+so0l7mxkMT19g3pjY9GTnHySck/hDzq+dtW/4VgnMkippsQ==} engines: {node: '>=6.9.0'} + '@babel/helper-string-parser@7.25.7': + resolution: {integrity: sha512-CbkjYdsJNHFk8uqpEkpCvRs3YRp9tY6FmFY7wLMSYuGYkrdUi7r2lc4/wqsvlHoMznX3WJ9IP8giGPq68T/Y6g==} + engines: {node: '>=6.9.0'} + + '@babel/helper-string-parser@7.25.9': + resolution: {integrity: sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==} + engines: {node: '>=6.9.0'} + '@babel/helper-validator-identifier@7.22.20': resolution: {integrity: sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==} engines: {node: '>=6.9.0'} @@ -3118,6 +3606,14 @@ packages: resolution: {integrity: sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==} engines: {node: '>=6.9.0'} + '@babel/helper-validator-identifier@7.25.7': + resolution: {integrity: sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-identifier@7.25.9': + resolution: {integrity: sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==} + engines: {node: '>=6.9.0'} + '@babel/helper-validator-option@7.22.15': resolution: {integrity: sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==} engines: {node: '>=6.9.0'} @@ -3130,6 +3626,14 @@ packages: resolution: {integrity: sha512-xb8t9tD1MHLungh/AIoWYN+gVHaB9kwlu8gffXGSt3FFEIT7RjS+xWbc2vUD1UTZdIpKj/ab3rdqJ7ufngyi2Q==} engines: {node: '>=6.9.0'} + '@babel/helper-validator-option@7.25.7': + resolution: {integrity: sha512-ytbPLsm+GjArDYXJ8Ydr1c/KJuutjF2besPNbIZnZ6MKUxi/uTA22t2ymmA4WFjZFpjiAMO0xuuJPqK2nvDVfQ==} + engines: {node: '>=6.9.0'} + + '@babel/helper-wrap-function@7.25.7': + resolution: {integrity: sha512-MA0roW3JF2bD1ptAaJnvcabsVlNQShUaThyJbCDD4bCp8NEgiFvpoqRI2YS22hHlc2thjO/fTg2ShLMC3jygAg==} + engines: {node: '>=6.9.0'} + '@babel/helpers@7.23.2': resolution: {integrity: sha512-lzchcp8SjTSVe/fPmLwtWVBFC7+Tbn8LGHDVfDp9JGxpAY5opSaEFgt8UQvrnECWOTdji2mOWMz1rOhkHscmGQ==} engines: {node: '>=6.9.0'} @@ -3150,6 +3654,10 @@ packages: resolution: {integrity: sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==} engines: {node: '>=6.9.0'} + '@babel/highlight@7.25.7': + resolution: {integrity: sha512-iYyACpW3iW8Fw+ZybQK+drQre+ns/tKpXbNESfrhNnPLIklLbXr7MYJ6gPEd0iETGLOK+SxMjVvKb/ffmk+FEw==} + engines: {node: '>=6.9.0'} + '@babel/parser@7.23.0': resolution: {integrity: sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==} engines: {node: '>=6.0.0'} @@ -3170,6 +3678,46 @@ packages: engines: {node: '>=6.0.0'} hasBin: true + '@babel/parser@7.25.7': + resolution: {integrity: sha512-aZn7ETtQsjjGG5HruveUK06cU3Hljuhd9Iojm4M8WWv3wLE6OkE5PWbDUkItmMgegmccaITudyuW5RPYrYlgWw==} + engines: {node: '>=6.0.0'} + hasBin: true + + '@babel/parser@7.26.3': + resolution: {integrity: sha512-WJ/CvmY8Mea8iDXo6a7RK2wbmJITT5fN3BEkRuFlxVyNx8jOKIIhmC4fSkTcPcf8JyavbBwIe6OpiCOBXt/IcA==} + engines: {node: '>=6.0.0'} + hasBin: true + + '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.25.7': + resolution: {integrity: sha512-UV9Lg53zyebzD1DwQoT9mzkEKa922LNUp5YkTJ6Uta0RbyXaQNUgcvSt7qIu1PpPzVb6rd10OVNTzkyBGeVmxQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/plugin-bugfix-safari-class-field-initializer-scope@7.25.7': + resolution: {integrity: sha512-GDDWeVLNxRIkQTnJn2pDOM1pkCgYdSqPeT1a9vh9yIqu2uzzgw1zcqEb+IJOhy+dTBMlNdThrDIksr2o09qrrQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.25.7': + resolution: {integrity: sha512-wxyWg2RYaSUYgmd9MR0FyRGyeOMQE/Uzr1wzd/g5cf5bwi9A4v6HFdDm7y1MgDtod/fLOSTZY6jDgV0xU9d5bA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.25.7': + resolution: {integrity: sha512-Xwg6tZpLxc4iQjorYsyGMyfJE7nP5MV8t/Ka58BgiA7Jw0fRqQNcANlLfdJ/yvBt9z9LD2We+BEkT7vLqZRWng==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.13.0 + + '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.25.7': + resolution: {integrity: sha512-UVATLMidXrnH+GMUIuxq55nejlj02HP7F5ETyBONzP6G87fPBogG4CH6kxrSrdIuAjdwNO9VzyaYsrZPscWUrw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + '@babel/plugin-proposal-class-properties@7.18.6': resolution: {integrity: sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==} engines: {node: '>=6.9.0'} @@ -3204,6 +3752,12 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2': + resolution: {integrity: sha512-SOSkfJDddaM7mak6cPEpswyTRnuRltl429hMraQEglW+OkovnCzsiszTmsrlY//qLFjCpQDFRvjdm2wA5pPm9w==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-async-generators@7.8.4': resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} peerDependencies: @@ -3219,12 +3773,40 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-class-static-block@7.14.5': + resolution: {integrity: sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-decorators@7.24.1': resolution: {integrity: sha512-05RJdO/cCrtVWuAaSn1tS3bH8jbsJa/Y1uD186u6J4C/1mnHFxseeuWpsqr9anvo7TUulev7tm7GDwRV+VuhDw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-dynamic-import@7.8.3': + resolution: {integrity: sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-export-namespace-from@7.8.3': + resolution: {integrity: sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-import-assertions@7.25.7': + resolution: {integrity: sha512-ZvZQRmME0zfJnDQnVBKYzHxXT7lYBB3Revz1GuS7oLXWMgqUPX4G+DDbT30ICClht9WKV34QVrZhSw6WdklwZQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-import-attributes@7.25.7': + resolution: {integrity: sha512-AqVo+dguCgmpi/3mYBdu9lkngOBlQ2w2vnNpa6gfiCxQZLzV4ZbhsXitJ2Yblkoe1VQwtHSaNmIaGll/26YWRw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-import-meta@7.10.4': resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} peerDependencies: @@ -3253,6 +3835,12 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-jsx@7.25.7': + resolution: {integrity: sha512-ruZOnKO+ajVL/MVx+PwNBPOkrnXTXoWMtte1MBpegfCArhqOe3Bj52avVj1huLLxNKYKXYaSxZ2F+woK1ekXfw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-logical-assignment-operators@7.10.4': resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} peerDependencies: @@ -3283,6 +3871,12 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-private-property-in-object@7.14.5': + resolution: {integrity: sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-top-level-await@7.14.5': resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} engines: {node: '>=6.9.0'} @@ -3307,30 +3901,174 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-syntax-unicode-sets-regex@7.18.6': + resolution: {integrity: sha512-727YkEAPwSIQTv5im8QHz3upqp92JTWhidIC81Tdx4VJYIte/VndKf1qKrfnnhPLiPghStWfvC/iFaMCQu7Nqg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + '@babel/plugin-transform-arrow-functions@7.24.1': resolution: {integrity: sha512-ngT/3NkRhsaep9ck9uj2Xhv9+xB1zShY3tM3g6om4xxCELwCDN4g4Aq5dRn48+0hasAql7s2hdBOysCfNpr4fw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-transform-arrow-functions@7.25.7': + resolution: {integrity: sha512-EJN2mKxDwfOUCPxMO6MUI58RN3ganiRAG/MS/S3HfB6QFNjroAMelQo/gybyYq97WerCBAZoyrAoW8Tzdq2jWg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-async-generator-functions@7.25.7': + resolution: {integrity: sha512-4B6OhTrwYKHYYgcwErvZjbmH9X5TxQBsaBHdzEIB4l71gR5jh/tuHGlb9in47udL2+wVUcOz5XXhhfhVJwEpEg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-async-to-generator@7.25.7': + resolution: {integrity: sha512-ZUCjAavsh5CESCmi/xCpX1qcCaAglzs/7tmuvoFnJgA1dM7gQplsguljoTg+Ru8WENpX89cQyAtWoaE0I3X3Pg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-block-scoped-functions@7.25.7': + resolution: {integrity: sha512-xHttvIM9fvqW+0a3tZlYcZYSBpSWzGBFIt/sYG3tcdSzBB8ZeVgz2gBP7Df+sM0N1850jrviYSSeUuc+135dmQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-transform-block-scoping@7.24.4': resolution: {integrity: sha512-nIFUZIpGKDf9O9ttyRXpHFpKC+X3Y5mtshZONuEUYBomAKoM4y029Jr+uB1bHGPhNmK8YXHevDtKDOLmtRrp6g==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-transform-block-scoping@7.25.7': + resolution: {integrity: sha512-ZEPJSkVZaeTFG/m2PARwLZQ+OG0vFIhPlKHK/JdIMy8DbRJ/htz6LRrTFtdzxi9EHmcwbNPAKDnadpNSIW+Aow==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-class-properties@7.25.7': + resolution: {integrity: sha512-mhyfEW4gufjIqYFo9krXHJ3ElbFLIze5IDp+wQTxoPd+mwFb1NxatNAwmv8Q8Iuxv7Zc+q8EkiMQwc9IhyGf4g==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-class-static-block@7.25.7': + resolution: {integrity: sha512-rvUUtoVlkDWtDWxGAiiQj0aNktTPn3eFynBcMC2IhsXweehwgdI9ODe+XjWw515kEmv22sSOTp/rxIRuTiB7zg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.12.0 + + '@babel/plugin-transform-classes@7.25.7': + resolution: {integrity: sha512-9j9rnl+YCQY0IGoeipXvnk3niWicIB6kCsWRGLwX241qSXpbA4MKxtp/EdvFxsc4zI5vqfLxzOd0twIJ7I99zg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-transform-computed-properties@7.24.1': resolution: {integrity: sha512-5pJGVIUfJpOS+pAqBQd+QMaTD2vCL/HcePooON6pDpHgRp4gNRmzyHTPIkXntwKsq3ayUFVfJaIKPw2pOkOcTw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-transform-computed-properties@7.25.7': + resolution: {integrity: sha512-QIv+imtM+EtNxg/XBKL3hiWjgdLjMOmZ+XzQwSgmBfKbfxUjBzGgVPklUuE55eq5/uVoh8gg3dqlrwR/jw3ZeA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-transform-destructuring@7.24.1': resolution: {integrity: sha512-ow8jciWqNxR3RYbSNVuF4U2Jx130nwnBnhRw6N6h1bOejNkABmcI5X5oz29K4alWX7vf1C+o6gtKXikzRKkVdw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-transform-destructuring@7.25.7': + resolution: {integrity: sha512-xKcfLTlJYUczdaM1+epcdh1UGewJqr9zATgrNHcLBcV2QmfvPPEixo/sK/syql9cEmbr7ulu5HMFG5vbbt/sEA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-dotall-regex@7.25.7': + resolution: {integrity: sha512-kXzXMMRzAtJdDEgQBLF4oaiT6ZCU3oWHgpARnTKDAqPkDJ+bs3NrZb310YYevR5QlRo3Kn7dzzIdHbZm1VzJdQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-duplicate-keys@7.25.7': + resolution: {integrity: sha512-by+v2CjoL3aMnWDOyCIg+yxU9KXSRa9tN6MbqggH5xvymmr9p4AMjYkNlQy4brMceBnUyHZ9G8RnpvT8wP7Cfg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-duplicate-named-capturing-groups-regex@7.25.7': + resolution: {integrity: sha512-HvS6JF66xSS5rNKXLqkk7L9c/jZ/cdIVIcoPVrnl8IsVpLggTjXs8OWekbLHs/VtYDDh5WXnQyeE3PPUGm22MA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/plugin-transform-dynamic-import@7.25.7': + resolution: {integrity: sha512-UvcLuual4h7/GfylKm2IAA3aph9rwvAM2XBA0uPKU3lca+Maai4jBjjEVUS568ld6kJcgbouuumCBhMd/Yz17w==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-exponentiation-operator@7.25.7': + resolution: {integrity: sha512-yjqtpstPfZ0h/y40fAXRv2snciYr0OAoMXY/0ClC7tm4C/nG5NJKmIItlaYlLbIVAWNfrYuy9dq1bE0SbX0PEg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-export-namespace-from@7.25.7': + resolution: {integrity: sha512-h3MDAP5l34NQkkNulsTNyjdaR+OiB0Im67VU//sFupouP8Q6m9Spy7l66DcaAQxtmCqGdanPByLsnwFttxKISQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-for-of@7.25.7': + resolution: {integrity: sha512-n/TaiBGJxYFWvpJDfsxSj9lEEE44BFM1EPGz4KEiTipTgkoFVVcCmzAL3qA7fdQU96dpo4gGf5HBx/KnDvqiHw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-function-name@7.25.7': + resolution: {integrity: sha512-5MCTNcjCMxQ63Tdu9rxyN6cAWurqfrDZ76qvVPrGYdBxIj+EawuuxTu/+dgJlhK5eRz3v1gLwp6XwS8XaX2NiQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-json-strings@7.25.7': + resolution: {integrity: sha512-Ot43PrL9TEAiCe8C/2erAjXMeVSnE/BLEx6eyrKLNFCCw5jvhTHKyHxdI1pA0kz5njZRYAnMO2KObGqOCRDYSA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-literals@7.25.7': + resolution: {integrity: sha512-fwzkLrSu2fESR/cm4t6vqd7ebNIopz2QHGtjoU+dswQo/P6lwAG04Q98lliE3jkz/XqnbGFLnUcE0q0CVUf92w==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-logical-assignment-operators@7.25.7': + resolution: {integrity: sha512-iImzbA55BjiovLyG2bggWS+V+OLkaBorNvc/yJoeeDQGztknRnDdYfp2d/UPmunZYEnZi6Lg8QcTmNMHOB0lGA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-member-expression-literals@7.25.7': + resolution: {integrity: sha512-Std3kXwpXfRV0QtQy5JJcRpkqP8/wG4XL7hSKZmGlxPlDqmpXtEPRmhF7ztnlTCtUN3eXRUJp+sBEZjaIBVYaw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-modules-amd@7.25.7': + resolution: {integrity: sha512-CgselSGCGzjQvKzghCvDTxKHP3iooenLpJDO842ehn5D2G5fJB222ptnDwQho0WjEvg7zyoxb9P+wiYxiJX5yA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-transform-modules-commonjs@7.23.0': resolution: {integrity: sha512-32Xzss14/UVc7k9g775yMIvkVK8xwKE0DPdP5JTapr3+Z9w4tzeOuLNY6BXDQR6BdnzIlXnCGAzsk/ICHBLVWQ==} engines: {node: '>=6.9.0'} @@ -3343,24 +4081,186 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-transform-modules-commonjs@7.25.7': + resolution: {integrity: sha512-L9Gcahi0kKFYXvweO6n0wc3ZG1ChpSFdgG+eV1WYZ3/dGbJK7vvk91FgGgak8YwRgrCuihF8tE/Xg07EkL5COg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-modules-systemjs@7.25.7': + resolution: {integrity: sha512-t9jZIvBmOXJsiuyOwhrIGs8dVcD6jDyg2icw1VL4A/g+FnWyJKwUfSSU2nwJuMV2Zqui856El9u+ElB+j9fV1g==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-modules-umd@7.25.7': + resolution: {integrity: sha512-p88Jg6QqsaPh+EB7I9GJrIqi1Zt4ZBHUQtjw3z1bzEXcLh6GfPqzZJ6G+G1HBGKUNukT58MnKG7EN7zXQBCODw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-named-capturing-groups-regex@7.25.7': + resolution: {integrity: sha512-BtAT9LzCISKG3Dsdw5uso4oV1+v2NlVXIIomKJgQybotJY3OwCwJmkongjHgwGKoZXd0qG5UZ12JUlDQ07W6Ow==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/plugin-transform-new-target@7.25.7': + resolution: {integrity: sha512-CfCS2jDsbcZaVYxRFo2qtavW8SpdzmBXC2LOI4oO0rP+JSRDxxF3inF4GcPsLgfb5FjkhXG5/yR/lxuRs2pySA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-nullish-coalescing-operator@7.25.7': + resolution: {integrity: sha512-FbuJ63/4LEL32mIxrxwYaqjJxpbzxPVQj5a+Ebrc8JICV6YX8nE53jY+K0RZT3um56GoNWgkS2BQ/uLGTjtwfw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-numeric-separator@7.25.7': + resolution: {integrity: sha512-8CbutzSSh4hmD+jJHIA8vdTNk15kAzOnFLVVgBSMGr28rt85ouT01/rezMecks9pkU939wDInImwCKv4ahU4IA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-object-rest-spread@7.25.7': + resolution: {integrity: sha512-1JdVKPhD7Y5PvgfFy0Mv2brdrolzpzSoUq2pr6xsR+m+3viGGeHEokFKsCgOkbeFOQxfB1Vt2F0cPJLRpFI4Zg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-object-super@7.25.7': + resolution: {integrity: sha512-pWT6UXCEW3u1t2tcAGtE15ornCBvopHj9Bps9D2DsH15APgNVOTwwczGckX+WkAvBmuoYKRCFa4DK+jM8vh5AA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-optional-catch-binding@7.25.7': + resolution: {integrity: sha512-m9obYBA39mDPN7lJzD5WkGGb0GO54PPLXsbcnj1Hyeu8mSRz7Gb4b1A6zxNX32ZuUySDK4G6it8SDFWD1nCnqg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-optional-chaining@7.25.7': + resolution: {integrity: sha512-h39agClImgPWg4H8mYVAbD1qP9vClFbEjqoJmt87Zen8pjqK8FTPUwrOXAvqu5soytwxrLMd2fx2KSCp2CHcNg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-transform-parameters@7.24.1': resolution: {integrity: sha512-8Jl6V24g+Uw5OGPeWNKrKqXPDw2YDjLc53ojwfMcKwlEoETKU9rU0mHUtcg9JntWI/QYzGAXNWEcVHZ+fR+XXg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-transform-parameters@7.25.7': + resolution: {integrity: sha512-FYiTvku63me9+1Nz7TOx4YMtW3tWXzfANZtrzHhUZrz4d47EEtMQhzFoZWESfXuAMMT5mwzD4+y1N8ONAX6lMQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-private-methods@7.25.7': + resolution: {integrity: sha512-KY0hh2FluNxMLwOCHbxVOKfdB5sjWG4M183885FmaqWWiGMhRZq4DQRKH6mHdEucbJnyDyYiZNwNG424RymJjA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-private-property-in-object@7.25.7': + resolution: {integrity: sha512-LzA5ESzBy7tqj00Yjey9yWfs3FKy4EmJyKOSWld144OxkTji81WWnUT8nkLUn+imN/zHL8ZQlOu/MTUAhHaX3g==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-property-literals@7.25.7': + resolution: {integrity: sha512-lQEeetGKfFi0wHbt8ClQrUSUMfEeI3MMm74Z73T9/kuz990yYVtfofjf3NuA42Jy3auFOpbjDyCSiIkTs1VIYw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-react-constant-elements@7.25.7': + resolution: {integrity: sha512-/qXt69Em8HgsjCLu7G3zdIQn7A2QwmYND7Wa0LTp09Na+Zn8L5d0A7wSXrKi18TJRc/Q5S1i1De/SU1LzVkSvA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-react-display-name@7.25.7': + resolution: {integrity: sha512-r0QY7NVU8OnrwE+w2IWiRom0wwsTbjx4+xH2RTd7AVdof3uurXOF+/mXHQDRk+2jIvWgSaCHKMgggfvM4dyUGA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-react-jsx-development@7.25.7': + resolution: {integrity: sha512-5yd3lH1PWxzW6IZj+p+Y4OLQzz0/LzlOG8vGqonHfVR3euf1vyzyMUJk9Ac+m97BH46mFc/98t9PmYLyvgL3qg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-react-jsx@7.25.7': + resolution: {integrity: sha512-vILAg5nwGlR9EXE8JIOX4NHXd49lrYbN8hnjffDtoULwpL9hUx/N55nqh2qd0q6FyNDfjl9V79ecKGvFbcSA0Q==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-react-pure-annotations@7.25.7': + resolution: {integrity: sha512-6YTHJ7yjjgYqGc8S+CbEXhLICODk0Tn92j+vNJo07HFk9t3bjFgAKxPLFhHwF2NjmQVSI1zBRfBWUeVBa2osfA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-regenerator@7.25.7': + resolution: {integrity: sha512-mgDoQCRjrY3XK95UuV60tZlFCQGXEtMg8H+IsW72ldw1ih1jZhzYXbJvghmAEpg5UVhhnCeia1CkGttUvCkiMQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-reserved-words@7.25.7': + resolution: {integrity: sha512-3OfyfRRqiGeOvIWSagcwUTVk2hXBsr/ww7bLn6TRTuXnexA+Udov2icFOxFX9abaj4l96ooYkcNN1qi2Zvqwng==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-transform-runtime@7.23.2': resolution: {integrity: sha512-XOntj6icgzMS58jPVtQpiuF6ZFWxQiJavISGx5KGjRj+3gqZr8+N6Kx+N9BApWzgS+DOjIZfXXj0ZesenOWDyA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-transform-shorthand-properties@7.25.7': + resolution: {integrity: sha512-uBbxNwimHi5Bv3hUccmOFlUy3ATO6WagTApenHz9KzoIdn0XeACdB12ZJ4cjhuB2WSi80Ez2FWzJnarccriJeA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-transform-spread@7.24.1': resolution: {integrity: sha512-KjmcIM+fxgY+KxPVbjelJC6hrH1CgtPmTvdXAfn3/a9CnWGSTY7nH4zm5+cjmWJybdcPSsD0++QssDsjcpe47g==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-transform-spread@7.25.7': + resolution: {integrity: sha512-Mm6aeymI0PBh44xNIv/qvo8nmbkpZze1KvR8MkEqbIREDxoiWTi18Zr2jryfRMwDfVZF9foKh060fWgni44luw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-sticky-regex@7.25.7': + resolution: {integrity: sha512-ZFAeNkpGuLnAQ/NCsXJ6xik7Id+tHuS+NT+ue/2+rn/31zcdnupCdmunOizEaP0JsUmTFSTOPoQY7PkK2pttXw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-template-literals@7.25.7': + resolution: {integrity: sha512-SI274k0nUsFFmyQupiO7+wKATAmMFf8iFgq2O+vVFXZ0SV9lNfT1NGzBEhjquFmD8I9sqHLguH+gZVN3vww2AA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-typeof-symbol@7.25.7': + resolution: {integrity: sha512-OmWmQtTHnO8RSUbL0NTdtpbZHeNTnm68Gj5pA4Y2blFNh+V4iZR68V1qL9cI37J21ZN7AaCnkfdHtLExQPf2uA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/plugin-transform-typescript@7.22.15': resolution: {integrity: sha512-1uirS0TnijxvQLnlv5wQBwOX3E1wCFX7ITv+9pBV2wKEk4K+M5tqDaoNXnTH8tjEIYHLO98MwiTWO04Ggz4XuA==} engines: {node: '>=6.9.0'} @@ -3379,6 +4279,47 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/plugin-transform-unicode-escapes@7.25.7': + resolution: {integrity: sha512-BN87D7KpbdiABA+t3HbVqHzKWUDN3dymLaTnPFAMyc8lV+KN3+YzNhVRNdinaCPA4AUqx7ubXbQ9shRjYBl3SQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-unicode-property-regex@7.25.7': + resolution: {integrity: sha512-IWfR89zcEPQGB/iB408uGtSPlQd3Jpq11Im86vUgcmSTcoWAiQMCTOa2K2yNNqFJEBVICKhayctee65Ka8OB0w==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-unicode-regex@7.25.7': + resolution: {integrity: sha512-8JKfg/hiuA3qXnlLx8qtv5HWRbgyFx2hMMtpDDuU2rTckpKkGu4ycK5yYHwuEa16/quXfoxHBIApEsNyMWnt0g==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-unicode-sets-regex@7.25.7': + resolution: {integrity: sha512-YRW8o9vzImwmh4Q3Rffd09bH5/hvY0pxg+1H1i0f7APoUeg12G7+HhLj9ZFNIrYkgBXhIijPJ+IXypN0hLTIbw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/preset-env@7.25.7': + resolution: {integrity: sha512-Gibz4OUdyNqqLj+7OAvBZxOD7CklCtMA5/j0JgUEwOnaRULsPDXmic2iKxL2DX2vQduPR5wH2hjZas/Vr/Oc0g==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/preset-modules@0.1.6-no-external-plugins': + resolution: {integrity: sha512-HrcgcIESLm9aIR842yhJ5RWan/gebQUJ6E/E5+rf0y9o6oj7w0Br+sWuL6kEQ/o/AdfvR1Je9jG18/gnpwjEyA==} + peerDependencies: + '@babel/core': ^7.0.0-0 || ^8.0.0-0 <8.0.0 + + '@babel/preset-react@7.25.7': + resolution: {integrity: sha512-GjV0/mUEEXpi1U5ZgDprMRRgajGMRW3G5FjMr5KLKD8nT2fTG8+h/klV3+6Dm5739QE+K5+2e91qFKAYI3pmRg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + '@babel/preset-typescript@7.23.2': resolution: {integrity: sha512-u4UJc1XsS1GhIGteM8rnGiIvf9rJpiVgMEeCnwlLA7WJPC+jcXWJAGxYmeqs5hOZD8BbAfnV5ezBOxQbb4OUxA==} engines: {node: '>=6.9.0'} @@ -3391,6 +4332,10 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 + '@babel/runtime-corejs3@7.25.7': + resolution: {integrity: sha512-gMmIEhg35sXk9Te5qbGp3W9YKrvLt3HV658/d3odWrHSqT0JeG5OzsJWFHRLiOohRyjRsJc/x03DhJm3i8VJxg==} + engines: {node: '>=6.9.0'} + '@babel/runtime@7.23.2': resolution: {integrity: sha512-mM8eg4yl5D6i3lu2QKPuPH4FArvJ8KhTofbE7jwMUv9KX5mBvwPAqnV3MlyBNqdp9RyRKP6Yck8TrfYrPvX3bg==} engines: {node: '>=6.9.0'} @@ -3411,6 +4356,14 @@ packages: resolution: {integrity: sha512-aOOgh1/5XzKvg1jvVz7AVrx2piJ2XBi227DHmbY6y+bM9H2FlN+IfecYu4Xl0cNiiVejlsCri89LUsbj8vJD9Q==} engines: {node: '>=6.9.0'} + '@babel/template@7.25.7': + resolution: {integrity: sha512-wRwtAgI3bAS+JGU2upWNL9lSlDcRCqD05BZ1n3X2ONLH1WilFP6O1otQjeMK/1g0pvYcXC7b/qVUB1keofjtZA==} + engines: {node: '>=6.9.0'} + + '@babel/template@7.25.9': + resolution: {integrity: sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==} + engines: {node: '>=6.9.0'} + '@babel/traverse@7.23.2': resolution: {integrity: sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==} engines: {node: '>=6.9.0'} @@ -3423,6 +4376,14 @@ packages: resolution: {integrity: sha512-HefgyP1x754oGCsKmV5reSmtV7IXj/kpaE1XYY+D9G5PvKKoFfSbiS4M77MdjuwlZKDIKFCffq9rPU+H/s3ZdQ==} engines: {node: '>=6.9.0'} + '@babel/traverse@7.25.7': + resolution: {integrity: sha512-jatJPT1Zjqvh/1FyJs6qAHL+Dzb7sTb+xr7Q+gM1b+1oBsMsQQ4FkVKb6dFlJvLlVssqkRzV05Jzervt9yhnzg==} + engines: {node: '>=6.9.0'} + + '@babel/traverse@7.26.4': + resolution: {integrity: sha512-fH+b7Y4p3yqvApJALCPJcwb0/XaOSgtK4pzV6WVjPR5GLFQBRI7pfoX2V2iM48NXvX07NUxxm1Vw98YjqTcU5w==} + engines: {node: '>=6.9.0'} + '@babel/types@7.23.0': resolution: {integrity: sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==} engines: {node: '>=6.9.0'} @@ -3439,6 +4400,14 @@ packages: resolution: {integrity: sha512-YTnYtra7W9e6/oAZEHj0bJehPRUlLH9/fbpT5LfB0NhQXyALCRkRs3zH9v07IYhkgpqX6Z78FnuccZr/l4Fs4Q==} engines: {node: '>=6.9.0'} + '@babel/types@7.25.7': + resolution: {integrity: sha512-vwIVdXG+j+FOpkwqHRcBgHLYNL7XMkufrlaFvL9o6Ai9sJn9+PdyIL5qa0XzTZw084c+u9LOls53eoZWP/W5WQ==} + engines: {node: '>=6.9.0'} + + '@babel/types@7.26.3': + resolution: {integrity: sha512-vN5p+1kl59GVKMvTHt55NzzmYVxprfJD+ql7U9NFIfKCBkYE55LYtS+WtPlaYOyzydrKI8Nezd+aZextrd+FMA==} + engines: {node: '>=6.9.0'} + '@bcoe/v8-coverage@0.2.3': resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} @@ -3451,55 +4420,55 @@ packages: '@better-scroll/wheel@2.5.0': resolution: {integrity: sha512-+cru8CtMtgGGMv3yOxn33ApbtatOZBVUCa7+X3UqVVyaxi6FbCrcSZCBlXhXpsFhJo1R282O6nQyik6KUidvoA==} - '@biomejs/biome@1.8.3': - resolution: {integrity: sha512-/uUV3MV+vyAczO+vKrPdOW0Iaet7UnJMU4bNMinggGJTAnBPjCoLEYcyYtYHNnUNYlv4xZMH6hVIQCAozq8d5w==} + '@biomejs/biome@1.9.4': + resolution: {integrity: sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog==} engines: {node: '>=14.21.3'} hasBin: true - '@biomejs/cli-darwin-arm64@1.8.3': - resolution: {integrity: sha512-9DYOjclFpKrH/m1Oz75SSExR8VKvNSSsLnVIqdnKexj6NwmiMlKk94Wa1kZEdv6MCOHGHgyyoV57Cw8WzL5n3A==} + '@biomejs/cli-darwin-arm64@1.9.4': + resolution: {integrity: sha512-bFBsPWrNvkdKrNCYeAp+xo2HecOGPAy9WyNyB/jKnnedgzl4W4Hb9ZMzYNbf8dMCGmUdSavlYHiR01QaYR58cw==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [darwin] - '@biomejs/cli-darwin-x64@1.8.3': - resolution: {integrity: sha512-UeW44L/AtbmOF7KXLCoM+9PSgPo0IDcyEUfIoOXYeANaNXXf9mLUwV1GeF2OWjyic5zj6CnAJ9uzk2LT3v/wAw==} + '@biomejs/cli-darwin-x64@1.9.4': + resolution: {integrity: sha512-ngYBh/+bEedqkSevPVhLP4QfVPCpb+4BBe2p7Xs32dBgs7rh9nY2AIYUL6BgLw1JVXV8GlpKmb/hNiuIxfPfZg==} engines: {node: '>=14.21.3'} cpu: [x64] os: [darwin] - '@biomejs/cli-linux-arm64-musl@1.8.3': - resolution: {integrity: sha512-9yjUfOFN7wrYsXt/T/gEWfvVxKlnh3yBpnScw98IF+oOeCYb5/b/+K7YNqKROV2i1DlMjg9g/EcN9wvj+NkMuQ==} + '@biomejs/cli-linux-arm64-musl@1.9.4': + resolution: {integrity: sha512-v665Ct9WCRjGa8+kTr0CzApU0+XXtRgwmzIf1SeKSGAv+2scAlW6JR5PMFo6FzqqZ64Po79cKODKf3/AAmECqA==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] - '@biomejs/cli-linux-arm64@1.8.3': - resolution: {integrity: sha512-fed2ji8s+I/m8upWpTJGanqiJ0rnlHOK3DdxsyVLZQ8ClY6qLuPc9uehCREBifRJLl/iJyQpHIRufLDeotsPtw==} + '@biomejs/cli-linux-arm64@1.9.4': + resolution: {integrity: sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] - '@biomejs/cli-linux-x64-musl@1.8.3': - resolution: {integrity: sha512-UHrGJX7PrKMKzPGoEsooKC9jXJMa28TUSMjcIlbDnIO4EAavCoVmNQaIuUSH0Ls2mpGMwUIf+aZJv657zfWWjA==} + '@biomejs/cli-linux-x64-musl@1.9.4': + resolution: {integrity: sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] - '@biomejs/cli-linux-x64@1.8.3': - resolution: {integrity: sha512-I8G2QmuE1teISyT8ie1HXsjFRz9L1m5n83U1O6m30Kw+kPMPSKjag6QGUn+sXT8V+XWIZxFFBoTDEDZW2KPDDw==} + '@biomejs/cli-linux-x64@1.9.4': + resolution: {integrity: sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] - '@biomejs/cli-win32-arm64@1.8.3': - resolution: {integrity: sha512-J+Hu9WvrBevfy06eU1Na0lpc7uR9tibm9maHynLIoAjLZpQU3IW+OKHUtyL8p6/3pT2Ju5t5emReeIS2SAxhkQ==} + '@biomejs/cli-win32-arm64@1.9.4': + resolution: {integrity: sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [win32] - '@biomejs/cli-win32-x64@1.8.3': - resolution: {integrity: sha512-/PJ59vA1pnQeKahemaQf4Nyj7IKUvGQSc3Ze1uIGi+Wvr1xF7rGobSrAAG01T/gUDG21vkDsZYM03NAmPiVkqg==} + '@biomejs/cli-win32-x64@1.9.4': + resolution: {integrity: sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA==} engines: {node: '>=14.21.3'} cpu: [x64] os: [win32] @@ -3507,107 +4476,95 @@ packages: '@bufbuild/protobuf@1.4.1': resolution: {integrity: sha512-4dthhwBGD9nlpY35ic8dMQC5R0dsND2b2xyeVO3qf+hBk8m7Y9dUs+SmMh6rqO2pGLUTKHefGXLDW+z19hBPdQ==} - '@changesets/apply-release-plan@6.1.4': - resolution: {integrity: sha512-FMpKF1fRlJyCZVYHr3CbinpZZ+6MwvOtWUuO8uo+svcATEoc1zRDcj23pAurJ2TZ/uVz1wFHH6K3NlACy0PLew==} - '@changesets/apply-release-plan@7.0.1': resolution: {integrity: sha512-aPdSq/R++HOyfEeBGjEe6LNG8gs0KMSyRETD/J2092OkNq8mOioAxyKjMbvVUdzgr/HTawzMOz7lfw339KnsCA==} - '@changesets/assemble-release-plan@5.2.4': - resolution: {integrity: sha512-xJkWX+1/CUaOUWTguXEbCDTyWJFECEhmdtbkjhn5GVBGxdP/JwaHBIU9sW3FR6gD07UwZ7ovpiPclQZs+j+mvg==} + '@changesets/apply-release-plan@7.0.5': + resolution: {integrity: sha512-1cWCk+ZshEkSVEZrm2fSj1Gz8sYvxgUL4Q78+1ZZqeqfuevPTPk033/yUZ3df8BKMohkqqHfzj0HOOrG0KtXTw==} '@changesets/assemble-release-plan@6.0.0': resolution: {integrity: sha512-4QG7NuisAjisbW4hkLCmGW2lRYdPrKzro+fCtZaILX+3zdUELSvYjpL4GTv0E4aM9Mef3PuIQp89VmHJ4y2bfw==} - '@changesets/changelog-git@0.1.14': - resolution: {integrity: sha512-+vRfnKtXVWsDDxGctOfzJsPhaCdXRYoe+KyWYoq5X/GqoISREiat0l3L8B0a453B2B4dfHGcZaGyowHbp9BSaA==} + '@changesets/assemble-release-plan@6.0.4': + resolution: {integrity: sha512-nqICnvmrwWj4w2x0fOhVj2QEGdlUuwVAwESrUo5HLzWMI1rE5SWfsr9ln+rDqWB6RQ2ZyaMZHUcU7/IRaUJS+Q==} '@changesets/changelog-git@0.2.0': resolution: {integrity: sha512-bHOx97iFI4OClIT35Lok3sJAwM31VbUM++gnMBV16fdbtBhgYu4dxsphBF/0AZZsyAHMrnM0yFcj5gZM1py6uQ==} - '@changesets/cli@2.26.2': - resolution: {integrity: sha512-dnWrJTmRR8bCHikJHl9b9HW3gXACCehz4OasrXpMp7sx97ECuBGGNjJhjPhdZNCvMy9mn4BWdplI323IbqsRig==} - hasBin: true - '@changesets/cli@2.27.2': resolution: {integrity: sha512-6/kADjKMOrlLwNr/Y5HAq7T9oGOA2Lq5A59AGtwQCCiXuSGp4EgszzdJFeBiF8pdz7Wn1HaLzSUBhAaNToEJqg==} hasBin: true - '@changesets/config@2.3.1': - resolution: {integrity: sha512-PQXaJl82CfIXddUOppj4zWu+987GCw2M+eQcOepxN5s+kvnsZOwjEJO3DH9eVy+OP6Pg/KFEWdsECFEYTtbg6w==} + '@changesets/cli@2.27.9': + resolution: {integrity: sha512-q42a/ZbDnxPpCb5Wkm6tMVIxgeI9C/bexntzTeCFBrQEdpisQqk8kCHllYZMDjYtEc1ZzumbMJAG8H0Z4rdvjg==} + hasBin: true '@changesets/config@3.0.0': resolution: {integrity: sha512-o/rwLNnAo/+j9Yvw9mkBQOZySDYyOr/q+wptRLcAVGlU6djOeP9v1nlalbL9MFsobuBVQbZCTp+dIzdq+CLQUA==} - '@changesets/errors@0.1.4': - resolution: {integrity: sha512-HAcqPF7snsUJ/QzkWoKfRfXushHTu+K5KZLJWPb34s4eCZShIf8BFO3fwq6KU8+G7L5KdtN2BzQAXOSXEyiY9Q==} + '@changesets/config@3.0.3': + resolution: {integrity: sha512-vqgQZMyIcuIpw9nqFIpTSNyc/wgm/Lu1zKN5vECy74u95Qx/Wa9g27HdgO4NkVAaq+BGA8wUc/qvbvVNs93n6A==} '@changesets/errors@0.2.0': resolution: {integrity: sha512-6BLOQUscTpZeGljvyQXlWOItQyU71kCdGz7Pi8H8zdw6BI0g3m43iL4xKUVPWtG+qrrL9DTjpdn8eYuCQSRpow==} - '@changesets/get-dependents-graph@1.3.6': - resolution: {integrity: sha512-Q/sLgBANmkvUm09GgRsAvEtY3p1/5OCzgBE5vX3vgb5CvW0j7CEljocx5oPXeQSNph6FXulJlXV3Re/v3K3P3Q==} - '@changesets/get-dependents-graph@2.0.0': resolution: {integrity: sha512-cafUXponivK4vBgZ3yLu944mTvam06XEn2IZGjjKc0antpenkYANXiiE6GExV/yKdsCnE8dXVZ25yGqLYZmScA==} - '@changesets/get-release-plan@3.0.17': - resolution: {integrity: sha512-6IwKTubNEgoOZwDontYc2x2cWXfr6IKxP3IhKeK+WjyD6y3M4Gl/jdQvBw+m/5zWILSOCAaGLu2ZF6Q+WiPniw==} + '@changesets/get-dependents-graph@2.1.2': + resolution: {integrity: sha512-sgcHRkiBY9i4zWYBwlVyAjEM9sAzs4wYVwJUdnbDLnVG3QwAaia1Mk5P8M7kraTOZN+vBET7n8KyB0YXCbFRLQ==} '@changesets/get-release-plan@4.0.0': resolution: {integrity: sha512-9L9xCUeD/Tb6L/oKmpm8nyzsOzhdNBBbt/ZNcjynbHC07WW4E1eX8NMGC5g5SbM5z/V+MOrYsJ4lRW41GCbg3w==} - '@changesets/get-version-range-type@0.3.2': - resolution: {integrity: sha512-SVqwYs5pULYjYT4op21F2pVbcrca4qA/bAA3FmFXKMN7Y+HcO8sbZUTx3TAy2VXulP2FACd1aC7f2nTuqSPbqg==} + '@changesets/get-release-plan@4.0.4': + resolution: {integrity: sha512-SicG/S67JmPTrdcc9Vpu0wSQt7IiuN0dc8iR5VScnnTVPfIaLvKmEGRvIaF0kcn8u5ZqLbormZNTO77bCEvyWw==} '@changesets/get-version-range-type@0.4.0': resolution: {integrity: sha512-hwawtob9DryoGTpixy1D3ZXbGgJu1Rhr+ySH2PvTLHvkZuQ7sRT4oQwMh0hbqZH1weAooedEjRsbrWcGLCeyVQ==} - '@changesets/git@2.0.0': - resolution: {integrity: sha512-enUVEWbiqUTxqSnmesyJGWfzd51PY4H7mH9yUw0hPVpZBJ6tQZFMU3F3mT/t9OJ/GjyiM4770i+sehAn6ymx6A==} - '@changesets/git@3.0.0': resolution: {integrity: sha512-vvhnZDHe2eiBNRFHEgMiGd2CT+164dfYyrJDhwwxTVD/OW0FUD6G7+4DIx1dNwkwjHyzisxGAU96q0sVNBns0w==} - '@changesets/logger@0.0.5': - resolution: {integrity: sha512-gJyZHomu8nASHpaANzc6bkQMO9gU/ib20lqew1rVx753FOxffnCrJlGIeQVxNWCqM+o6OOleCo/ivL8UAO5iFw==} + '@changesets/git@3.0.1': + resolution: {integrity: sha512-pdgHcYBLCPcLd82aRcuO0kxCDbw/yISlOtkmwmE8Odo1L6hSiZrBOsRl84eYG7DRCab/iHnOkWqExqc4wxk2LQ==} '@changesets/logger@0.1.0': resolution: {integrity: sha512-pBrJm4CQm9VqFVwWnSqKEfsS2ESnwqwH+xR7jETxIErZcfd1u2zBSqrHbRHR7xjhSgep9x2PSKFKY//FAshA3g==} - '@changesets/parse@0.3.16': - resolution: {integrity: sha512-127JKNd167ayAuBjUggZBkmDS5fIKsthnr9jr6bdnuUljroiERW7FBTDNnNVyJ4l69PzR57pk6mXQdtJyBCJKg==} + '@changesets/logger@0.1.1': + resolution: {integrity: sha512-OQtR36ZlnuTxKqoW4Sv6x5YIhOmClRd5pWsjZsddYxpWs517R0HkyiefQPIytCVh4ZcC5x9XaG8KTdd5iRQUfg==} '@changesets/parse@0.4.0': resolution: {integrity: sha512-TS/9KG2CdGXS27S+QxbZXgr8uPsP4yNJYb4BC2/NeFUj80Rni3TeD2qwWmabymxmrLo7JEsytXH1FbpKTbvivw==} - '@changesets/pre@1.0.14': - resolution: {integrity: sha512-dTsHmxQWEQekHYHbg+M1mDVYFvegDh9j/kySNuDKdylwfMEevTeDouR7IfHNyVodxZXu17sXoJuf2D0vi55FHQ==} - '@changesets/pre@2.0.0': resolution: {integrity: sha512-HLTNYX/A4jZxc+Sq8D1AMBsv+1qD6rmmJtjsCJa/9MSRybdxh0mjbTvE6JYZQ/ZiQ0mMlDOlGPXTm9KLTU3jyw==} - '@changesets/read@0.5.9': - resolution: {integrity: sha512-T8BJ6JS6j1gfO1HFq50kU3qawYxa4NTbI/ASNVVCBTsKquy2HYwM9r7ZnzkiMe8IEObAJtUVGSrePCOxAK2haQ==} + '@changesets/pre@2.0.1': + resolution: {integrity: sha512-vvBJ/If4jKM4tPz9JdY2kGOgWmCowUYOi5Ycv8dyLnEE8FgpYYUo1mgJZxcdtGGP3aG8rAQulGLyyXGSLkIMTQ==} '@changesets/read@0.6.0': resolution: {integrity: sha512-ZypqX8+/im1Fm98K4YcZtmLKgjs1kDQ5zHpc2U1qdtNBmZZfo/IBiG162RoP0CUF05tvp2y4IspH11PLnPxuuw==} + '@changesets/read@0.6.1': + resolution: {integrity: sha512-jYMbyXQk3nwP25nRzQQGa1nKLY0KfoOV7VLgwucI0bUO8t8ZLCr6LZmgjXsiKuRDc+5A6doKPr9w2d+FEJ55zQ==} + + '@changesets/should-skip-package@0.1.1': + resolution: {integrity: sha512-H9LjLbF6mMHLtJIc/eHR9Na+MifJ3VxtgP/Y+XLn4BF7tDTEN1HNYtH6QMcjP1uxp9sjaFYmW8xqloaCi/ckTg==} + '@changesets/types@4.1.0': resolution: {integrity: sha512-LDQvVDv5Kb50ny2s25Fhm3d9QSZimsoUGBsUioj6MC3qbMUCuC8GPIvk/M6IvXx3lYhAs0lwWUQLb+VIEUCECw==} - '@changesets/types@5.2.1': - resolution: {integrity: sha512-myLfHbVOqaq9UtUKqR/nZA/OY7xFjQMdfgfqeZIBK4d0hA6pgxArvdv8M+6NUzzBsjWLOtvApv8YHr4qM+Kpfg==} - '@changesets/types@6.0.0': resolution: {integrity: sha512-b1UkfNulgKoWfqyHtzKS5fOZYSJO+77adgL7DLRDr+/7jhChN+QcHnbjiQVOz/U+Ts3PGNySq7diAItzDgugfQ==} - '@changesets/write@0.2.3': - resolution: {integrity: sha512-Dbamr7AIMvslKnNYsLFafaVORx4H0pvCA2MHqgtNCySMe1blImEyAEOzDmcgKAkgz4+uwoLz7demIrX+JBr/Xw==} - '@changesets/write@0.3.1': resolution: {integrity: sha512-SyGtMXzH3qFqlHKcvFY2eX+6b0NGiFcNav8AFsYwy5l8hejOeoeTDemu5Yjmke2V5jpzY+pBvM0vCCQ3gdZpfw==} + '@changesets/write@0.3.2': + resolution: {integrity: sha512-kDxDrPNpUgsjDbWBvUo27PzKX4gqeKOlhibaOXDJA6kuBisGqNHv/HwGJrAu8U/dSf8ZEFIeHIPtvSlZI1kULw==} + '@clack/core@0.3.3': resolution: {integrity: sha512-5ZGyb75BUBjlll6eOa1m/IZBxwk91dooBWhPSL67sWcLS0zt9SnswRL0l26TVdBhb0wnWORRxUn//uH6n4z7+A==} @@ -3698,55 +4655,67 @@ packages: resolution: {integrity: sha512-PXDQXkAmiMEG162Bqdh9ChML/GJZo6vU+7F03ALKDK8zYc6SuAr47LjG7hGYRqUOz+WK0dU7bQ0xzuqFMdxzeQ==} engines: {node: '>=v14'} - '@cspell/cspell-bundled-dicts@6.31.3': - resolution: {integrity: sha512-KXy3qKWYzXOGYwqOGMCXHem3fV39iEmoKLiNhoWWry/SFdvAafmeY+LIDcQTXAcOQLkMDCwP2/rY/NadcWnrjg==} - engines: {node: '>=14'} + '@crowdin/cli@3.19.4': + resolution: {integrity: sha512-j0SiRGKOH/Pa/TdBeIxBBRrByHPqmVqWVo/LSjnri1lLPGywjcu9kB+pib7P4wmI00jgcVu+80yGdun5zRcDNQ==} + hasBin: true - '@cspell/cspell-json-reporter@6.31.3': - resolution: {integrity: sha512-ZJwj2vT4lxncYxduXcxy0dCvjjMvXIfphbLSCN5CXvufrtupB4KlcjZUnOofCi4pfpp8qocCSn1lf2DU9xgUXA==} - engines: {node: '>=14'} + '@crowdin/crowdin-api-client@1.36.0': + resolution: {integrity: sha512-fVHIG8DcSUQe5D1lggNScc1yUc2zcSFpaBJq7F15v1dQoiBvdRTWcrVdwU7mXcbzpEUqykI87svWxwomG1BLlg==} + engines: {node: '>=12.9.0'} - '@cspell/cspell-pipe@6.31.3': - resolution: {integrity: sha512-Lv/y4Ya/TJyU1pf66yl1te7LneFZd3lZg1bN5oe1cPrKSmfWdiX48v7plTRecWd/OWyLGd0yN807v79A+/0W7A==} - engines: {node: '>=14'} + '@cspell/cspell-bundled-dicts@8.14.2': + resolution: {integrity: sha512-Kv2Utj/RTSxfufGXkkoTZ/3ErCsYWpCijtDFr/FwSsM7mC0PzLpdlcD9xjtgrJO5Kwp7T47iTG21U4Mwddyi8Q==} + engines: {node: '>=18'} - '@cspell/cspell-service-bus@6.31.3': - resolution: {integrity: sha512-x5j8j3n39KN8EXOAlv75CpircdpF5WEMCC5pcO916o6GBmJBy8SrdzdsBGJhVcYGGilqy6pf8R9RCZ3yAmG8gQ==} - engines: {node: '>=14'} + '@cspell/cspell-json-reporter@8.14.2': + resolution: {integrity: sha512-TZavcnNIZKX1xC/GNj80RgFVKHCT4pHT0qm9jCsQFH2QJfyCrUlkEvotKGSQ04lAyCwWg6Enq95qhouF8YbKUQ==} + engines: {node: '>=18'} - '@cspell/cspell-types@6.31.3': - resolution: {integrity: sha512-wZ+t+lUsQJB65M31btZM4fH3K1CkRgE8pSeTiCwxYcnCL19pi4TMcEEMKdO8yFZMdocW4B7VRwzxNoQMw2ewBg==} - engines: {node: '>=14'} + '@cspell/cspell-pipe@8.14.2': + resolution: {integrity: sha512-aWMoXZAXEre0/M9AYWOW33YyOJZ06i4vvsEpWBDWpHpWQEmsR/7cMMgld8Pp3wlEjIUclUAKTYmrZ61PFWU/og==} + engines: {node: '>=18'} + + '@cspell/cspell-resolver@8.14.2': + resolution: {integrity: sha512-pSyBsAvslaN0dx0pHdvECJEuFDDBJGAD6G8U4BVbIyj2OPk0Ox0HrZIj6csYxxoJERAgNO/q7yCPwa4j9NNFXg==} + engines: {node: '>=18'} + + '@cspell/cspell-service-bus@8.14.2': + resolution: {integrity: sha512-WUF7xf3YgXYIqjmBwLcVugYIrYL4WfXchgSo9rmbbnOcAArzsK+HKfzb4AniZAJ1unxcIQ0JnVlRmnCAKPjjLg==} + engines: {node: '>=18'} + + '@cspell/cspell-types@8.14.2': + resolution: {integrity: sha512-MRY8MjBNOKGMDSkxAKueYAgVL43miO+lDcLCBBP+7cNXqHiUFMIZteONcGp3kJT0dWS04dN6lKAXvaNF0aWcng==} + engines: {node: '>=18'} '@cspell/dict-ada@4.0.2': resolution: {integrity: sha512-0kENOWQeHjUlfyId/aCM/mKXtkEgV0Zu2RhUXCBr4hHo9F9vph+Uu8Ww2b0i5a4ZixoIkudGA+eJvyxrG1jUpA==} - '@cspell/dict-aws@3.0.0': - resolution: {integrity: sha512-O1W6nd5y3Z00AMXQMzfiYrIJ1sTd9fB1oLr+xf/UD7b3xeHeMeYE2OtcWbt9uyeHim4tk+vkSTcmYEBKJgS5bQ==} + '@cspell/dict-aws@4.0.4': + resolution: {integrity: sha512-6AWI/Kkf+RcX/J81VX8+GKLeTgHWEr/OMhGk3dHQzWK66RaqDJCGDqi7494ghZKcBB7dGa3U5jcKw2FZHL/u3w==} - '@cspell/dict-bash@4.1.2': - resolution: {integrity: sha512-AEBWjbaMaJEyAjOHW0F15P2izBjli2cNerG3NjuVH7xX/HUUeNoTj8FF1nwpMufKwGQCvuyO2hCmkVxhJ0y55Q==} + '@cspell/dict-bash@4.1.5': + resolution: {integrity: sha512-YGim/h7E2U5HCCb2ckNufT6/yyWygt9nSZ5C7qw6oOD3bygbObqD1+rlPor1JW+YyO+3GwTIHE70uKEEU6VZYw==} - '@cspell/dict-companies@3.0.27': - resolution: {integrity: sha512-gaPR/luf+4oKGyxvW4GbxGGPdHiC5kj/QefnmQqrLFrLiCSXMZg5/NL+Lr4E5lcHsd35meX61svITQAvsT7lyQ==} + '@cspell/dict-companies@3.1.4': + resolution: {integrity: sha512-y9e0amzEK36EiiKx3VAA+SHQJPpf2Qv5cCt5eTUSggpTkiFkCh6gRKQ97rVlrKh5GJrqinDwYIJtTsxuh2vy2Q==} - '@cspell/dict-cpp@5.0.9': - resolution: {integrity: sha512-ql9WPNp8c+fhdpVpjpZEUWmxBHJXs9CJuiVVfW/iwv5AX7VuMHyEwid+9/6nA8qnCxkUQ5pW83Ums1lLjn8ScA==} + '@cspell/dict-cpp@5.1.19': + resolution: {integrity: sha512-i/odUPNFLdqWisOktu6c4qjUR4k+P9Al2RCri3Wso9EFblp53xt/5jIUdGMdDDVQGqX7s/KLtdqNxNKqP3/d+w==} - '@cspell/dict-cryptocurrencies@3.0.1': - resolution: {integrity: sha512-Tdlr0Ahpp5yxtwM0ukC13V6+uYCI0p9fCRGMGZt36rWv8JQZHIuHfehNl7FB/Qc09NCF7p5ep0GXbL+sVTd/+w==} + '@cspell/dict-cryptocurrencies@5.0.0': + resolution: {integrity: sha512-Z4ARIw5+bvmShL+4ZrhDzGhnc9znaAGHOEMaB/GURdS/jdoreEDY34wdN0NtdLHDO5KO7GduZnZyqGdRoiSmYA==} '@cspell/dict-csharp@4.0.2': resolution: {integrity: sha512-1JMofhLK+4p4KairF75D3A924m5ERMgd1GvzhwK2geuYgd2ZKuGW72gvXpIV7aGf52E3Uu1kDXxxGAiZ5uVG7g==} - '@cspell/dict-css@4.0.12': - resolution: {integrity: sha512-vGBgPM92MkHQF5/2jsWcnaahOZ+C6OE/fPvd5ScBP72oFY9tn5GLuomcyO0z8vWCr2e0nUSX1OGimPtcQAlvSw==} + '@cspell/dict-css@4.0.13': + resolution: {integrity: sha512-WfOQkqlAJTo8eIQeztaH0N0P+iF5hsJVKFuhy4jmARPISy8Efcv8QXk2/IVbmjJH0/ZV7dKRdnY5JFVXuVz37g==} '@cspell/dict-dart@2.0.3': resolution: {integrity: sha512-cLkwo1KT5CJY5N5RJVHks2genFkNCl/WLfj+0fFjqNR+tk3tBI1LY7ldr9piCtSFSm4x9pO1x6IV3kRUY1lLiw==} - '@cspell/dict-data-science@1.0.11': - resolution: {integrity: sha512-TaHAZRVe0Zlcc3C23StZqqbzC0NrodRwoSAc8dis+5qLeLLnOCtagYQeROQvDlcDg3X/VVEO9Whh4W/z4PAmYQ==} + '@cspell/dict-data-science@2.0.2': + resolution: {integrity: sha512-VwAck6OZQVqrscKyOrvllixIugIPF+Q6YoFNvXZCPhHGtNyOAVraD3S7kOgPYBdUjgno4QbdMWm92BUPqL1QjQ==} '@cspell/dict-django@4.1.0': resolution: {integrity: sha512-bKJ4gPyrf+1c78Z0Oc4trEB9MuhcB+Yg+uTTWsvhY6O2ncFYbB/LbEZfqhfmmuK/XJJixXfI1laF2zicyf+l0w==} @@ -3754,38 +4723,44 @@ packages: '@cspell/dict-docker@1.1.7': resolution: {integrity: sha512-XlXHAr822euV36GGsl2J1CkBIVg3fZ6879ZOg5dxTIssuhUOCiV2BuzKZmt6aIFmcdPmR14+9i9Xq+3zuxeX0A==} - '@cspell/dict-dotnet@5.0.0': - resolution: {integrity: sha512-EOwGd533v47aP5QYV8GlSSKkmM9Eq8P3G/eBzSpH3Nl2+IneDOYOBLEUraHuiCtnOkNsz0xtZHArYhAB2bHWAw==} + '@cspell/dict-dotnet@5.0.5': + resolution: {integrity: sha512-gjg0L97ee146wX47dnA698cHm85e7EOpf9mVrJD8DmEaqoo/k1oPy2g7c7LgKxK9XnqwoXxhLNnngPrwXOoEtQ==} '@cspell/dict-elixir@4.0.3': resolution: {integrity: sha512-g+uKLWvOp9IEZvrIvBPTr/oaO6619uH/wyqypqvwpmnmpjcfi8+/hqZH8YNKt15oviK8k4CkINIqNhyndG9d9Q==} - '@cspell/dict-en-common-misspellings@1.0.2': - resolution: {integrity: sha512-jg7ZQZpZH7+aAxNBlcAG4tGhYF6Ksy+QS5Df73Oo+XyckBjC9QS+PrRwLTeYoFIgXy5j3ICParK5r3MSSoL4gw==} + '@cspell/dict-en-common-misspellings@2.0.4': + resolution: {integrity: sha512-lvOiRjV/FG4pAGZL3PN2GCVHSTCE92cwhfLGGkOsQtxSmef6WCHfHwp9auafkBlX0yFQSKDfq6/TlpQbjbJBtQ==} '@cspell/dict-en-gb@1.1.33': resolution: {integrity: sha512-tKSSUf9BJEV+GJQAYGw5e+ouhEe2ZXE620S7BLKe3ZmpnjlNG9JqlnaBhkIMxKnNFkLY2BP/EARzw31AZnOv4g==} - '@cspell/dict-en_us@4.3.11': - resolution: {integrity: sha512-GhdavZFlS2YbUNcRtPbgJ9j6aUyq116LmDQ2/Q5SpQxJ5/6vVs8Yj5WxV1JD+Zh/Zim1NJDcneTOuLsUGi+Czw==} + '@cspell/dict-en_us@4.3.23': + resolution: {integrity: sha512-l0SoEQBsi3zDSl3OuL4/apBkxjuj4hLIg/oy6+gZ7LWh03rKdF6VNtSZNXWAmMY+pmb1cGA3ouleTiJIglbsIg==} + + '@cspell/dict-filetypes@3.0.4': + resolution: {integrity: sha512-IBi8eIVdykoGgIv5wQhOURi5lmCNJq0we6DvqKoPQJHthXbgsuO1qrHSiUVydMiQl/XvcnUWTMeAlVUlUClnVg==} - '@cspell/dict-filetypes@3.0.2': - resolution: {integrity: sha512-StoC0wPmFNav6F6P8/FYFN1BpZfPgOmktb8gQ9wTauelWofPeBW+A0t5ncZt9hXHtnbGDA98v4ukacV+ucbnUg==} + '@cspell/dict-fonts@4.0.0': + resolution: {integrity: sha512-t9V4GeN/m517UZn63kZPUYP3OQg5f0OBLSd3Md5CU3eH1IFogSvTzHHnz4Wqqbv8NNRiBZ3HfdY/pqREZ6br3Q==} - '@cspell/dict-fonts@3.0.2': - resolution: {integrity: sha512-Z5QdbgEI7DV+KPXrAeDA6dDm/vTzyaW53SGlKqz6PI5VhkOjgkBXv3YtZjnxMZ4dY2ZIqq+RUK6qa9Pi8rQdGQ==} + '@cspell/dict-fsharp@1.0.1': + resolution: {integrity: sha512-23xyPcD+j+NnqOjRHgW3IU7Li912SX9wmeefcY0QxukbAxJ/vAN4rBpjSwwYZeQPAn3fxdfdNZs03fg+UM+4yQ==} - '@cspell/dict-fullstack@3.1.5': - resolution: {integrity: sha512-6ppvo1dkXUZ3fbYn/wwzERxCa76RtDDl5Afzv2lijLoijGGUw5yYdLBKJnx8PJBGNLh829X352ftE7BElG4leA==} + '@cspell/dict-fullstack@3.2.0': + resolution: {integrity: sha512-sIGQwU6G3rLTo+nx0GKyirR5dQSFeTIzFTOrURw51ISf+jKG9a3OmvsVtc2OANfvEAOLOC9Wfd8WYhmsO8KRDQ==} - '@cspell/dict-gaming-terms@1.0.4': - resolution: {integrity: sha512-hbDduNXlk4AOY0wFxcDMWBPpm34rpqJBeqaySeoUH70eKxpxm+dvjpoRLJgyu0TmymEICCQSl6lAHTHSDiWKZg==} + '@cspell/dict-gaming-terms@1.0.5': + resolution: {integrity: sha512-C3riccZDD3d9caJQQs1+MPfrUrQ+0KHdlj9iUR1QD92FgTOF6UxoBpvHUUZ9YSezslcmpFQK4xQQ5FUGS7uWfw==} - '@cspell/dict-git@2.0.0': - resolution: {integrity: sha512-n1AxyX5Kgxij/sZFkxFJlzn3K9y/sCcgVPg/vz4WNJ4K9YeTsUmyGLA2OQI7d10GJeiuAo2AP1iZf2A8j9aj2w==} + '@cspell/dict-git@3.0.0': + resolution: {integrity: sha512-simGS/lIiXbEaqJu9E2VPoYW1OTC2xrwPPXNXFMa2uo/50av56qOuaxDrZ5eH1LidFXwoc8HROCHYeKoNrDLSw==} - '@cspell/dict-golang@6.0.4': - resolution: {integrity: sha512-jOfewPEyN6U9Q80okE3b1PTYBfqZgHh7w4o271GSuAX+VKJ1lUDhdR4bPKRxSDdO5jHArw2u5C8nH2CWGuygbQ==} + '@cspell/dict-golang@6.0.13': + resolution: {integrity: sha512-uBUWi+AjFpluB6qF0rsC1gGyooqXeKPUdWHSmSXW/DCnS5PBSjRW6VWWp8efc1Fanob0QJxiZiYlc4U7oxuG6Q==} + + '@cspell/dict-google@1.0.1': + resolution: {integrity: sha512-dQr4M3n95uOhtloNSgB9tYYGXGGEGEykkFyRtfcp5pFuEecYUa0BSgtlGKx9RXVtJtKgR+yFT/a5uQSlt8WjqQ==} '@cspell/dict-haskell@4.0.1': resolution: {integrity: sha512-uRrl65mGrOmwT7NxspB4xKXFUenNC7IikmpRZW8Uzqbqcu7ZRCUfstuVH7T1rmjRgRkjcIjE4PC11luDou4wEQ==} @@ -3796,56 +4771,65 @@ packages: '@cspell/dict-html@4.0.5': resolution: {integrity: sha512-p0brEnRybzSSWi8sGbuVEf7jSTDmXPx7XhQUb5bgG6b54uj+Z0Qf0V2n8b/LWwIPJNd1GygaO9l8k3HTCy1h4w==} - '@cspell/dict-java@5.0.6': - resolution: {integrity: sha512-kdE4AHHHrixyZ5p6zyms1SLoYpaJarPxrz8Tveo6gddszBVVwIUZ+JkQE1bWNLK740GWzIXdkznpUfw1hP9nXw==} + '@cspell/dict-java@5.0.7': + resolution: {integrity: sha512-ejQ9iJXYIq7R09BScU2y5OUGrSqwcD+J5mHFOKbduuQ5s/Eh/duz45KOzykeMLI6KHPVxhBKpUPBWIsfewECpQ==} + + '@cspell/dict-julia@1.0.1': + resolution: {integrity: sha512-4JsCLCRhhLMLiaHpmR7zHFjj1qOauzDI5ZzCNQS31TUMfsOo26jAKDfo0jljFAKgw5M2fEG7sKr8IlPpQAYrmQ==} - '@cspell/dict-k8s@1.0.2': - resolution: {integrity: sha512-tLT7gZpNPnGa+IIFvK9SP1LrSpPpJ94a/DulzAPOb1Q2UBFwdpFd82UWhio0RNShduvKG/WiMZf/wGl98pn+VQ==} + '@cspell/dict-k8s@1.0.6': + resolution: {integrity: sha512-srhVDtwrd799uxMpsPOQqeDJY+gEocgZpoK06EFrb4GRYGhv7lXo9Fb+xQMyQytzOW9dw4DNOEck++nacDuymg==} '@cspell/dict-latex@4.0.0': resolution: {integrity: sha512-LPY4y6D5oI7D3d+5JMJHK/wxYTQa2lJMSNxps2JtuF8hbAnBQb3igoWEjEbIbRRH1XBM0X8dQqemnjQNCiAtxQ==} - '@cspell/dict-lorem-ipsum@3.0.0': - resolution: {integrity: sha512-msEV24qEpzWZs2kcEicqYlhyBpR0amfDkJOs+iffC07si9ftqtQ+yP3lf1VFLpgqw3SQh1M1vtU7RD4sPrNlcQ==} + '@cspell/dict-lorem-ipsum@4.0.0': + resolution: {integrity: sha512-1l3yjfNvMzZPibW8A7mQU4kTozwVZVw0AvFEdy+NcqtbxH+TvbSkNMqROOFWrkD2PjnKG0+Ea0tHI2Pi6Gchnw==} + + '@cspell/dict-lua@4.0.3': + resolution: {integrity: sha512-lDHKjsrrbqPaea13+G9s0rtXjMO06gPXPYRjRYawbNmo4E/e3XFfVzeci3OQDQNDmf2cPOwt9Ef5lu2lDmwfJg==} - '@cspell/dict-lua@4.0.2': - resolution: {integrity: sha512-eeC20Q+UnHcTVBK6pgwhSjGIVugO2XqU7hv4ZfXp2F9DxGx1RME0+1sKX4qAGhdFGwOBsEzb2fwUsAEP6Mibpg==} + '@cspell/dict-makefile@1.0.0': + resolution: {integrity: sha512-3W9tHPcSbJa6s0bcqWo6VisEDTSN5zOtDbnPabF7rbyjRpNo0uHXHRJQF8gAbFzoTzBBhgkTmrfSiuyQm7vBUQ==} - '@cspell/dict-node@4.0.3': - resolution: {integrity: sha512-sFlUNI5kOogy49KtPg8SMQYirDGIAoKBO3+cDLIwD4MLdsWy1q0upc7pzGht3mrjuyMiPRUV14Bb0rkVLrxOhg==} + '@cspell/dict-monkeyc@1.0.6': + resolution: {integrity: sha512-oO8ZDu/FtZ55aq9Mb67HtaCnsLn59xvhO/t2mLLTHAp667hJFxpp7bCtr2zOrR1NELzFXmKln/2lw/PvxMSvrA==} - '@cspell/dict-npm@5.0.12': - resolution: {integrity: sha512-T/+WeQmtbxo7ad6hrdI8URptYstKJP+kXyWJZfuVJJGWJQ7yubxrI5Z5AfM+Dh/ff4xHmdzapxD9adaEQ727uw==} + '@cspell/dict-node@5.0.1': + resolution: {integrity: sha512-lax/jGz9h3Dv83v8LHa5G0bf6wm8YVRMzbjJPG/9rp7cAGPtdrga+XANFq+B7bY5+jiSA3zvj10LUFCFjnnCCg==} - '@cspell/dict-php@4.0.4': - resolution: {integrity: sha512-fRlLV730fJbulDsLIouZxXoxHt3KIH6hcLFwxaupHL+iTXDg0lo7neRpbqD5MScr/J3idEr7i9G8XWzIikKFug==} + '@cspell/dict-npm@5.1.5': + resolution: {integrity: sha512-oAOGWuJYU3DlO+cAsStKMWN8YEkBue25cRC9EwdiL5Z84nchU20UIoYrLfIQejMlZca+1GyrNeyxRAgn4KiivA==} - '@cspell/dict-powershell@5.0.2': - resolution: {integrity: sha512-IHfWLme3FXE7vnOmMncSBxOsMTdNWd1Vcyhag03WS8oANSgX8IZ+4lMI00mF0ptlgchf16/OU8WsV4pZfikEFw==} + '@cspell/dict-php@4.0.10': + resolution: {integrity: sha512-NfTZdp6kcZDF1PvgQ6cY0zE4FUO5rSwNmBH/iwCBuaLfJAFQ97rgjxo+D2bic4CFwNjyHutnHPtjJBRANO5XQw==} - '@cspell/dict-public-licenses@2.0.5': - resolution: {integrity: sha512-91HK4dSRri/HqzAypHgduRMarJAleOX5NugoI8SjDLPzWYkwZ1ftuCXSk+fy8DLc3wK7iOaFcZAvbjmnLhVs4A==} + '@cspell/dict-powershell@5.0.10': + resolution: {integrity: sha512-U4H0zm94sNK+YP7jSFb7xb160XLf2dKIPVt5sOYctKlEyR9M16sP8FHbyWV2Yp1YtxXugoNdeCm2vwGEDAd8sg==} - '@cspell/dict-python@4.1.10': - resolution: {integrity: sha512-ErF/Ohcu6Xk4QVNzFgo8p7CxkxvAKAmFszvso41qOOhu8CVpB35ikBRpGVDw9gsCUtZzi15Yl0izi4do6WcLkA==} + '@cspell/dict-public-licenses@2.0.8': + resolution: {integrity: sha512-Sup+tFS7cDV0fgpoKtUqEZ6+fA/H+XUgBiqQ/Fbs6vUE3WCjJHOIVsP+udHuyMH7iBfJ4UFYOYeORcY4EaKdMg==} + + '@cspell/dict-python@4.2.8': + resolution: {integrity: sha512-4y5dynLiajvowhB3PqlcwJ2C4okK1y2Hombec1+TGcV9sUBfo8FYNw6VRFUUrpsxO+Ut/3ncIifdZS5/zAWi5w==} '@cspell/dict-r@2.0.1': resolution: {integrity: sha512-KCmKaeYMLm2Ip79mlYPc8p+B2uzwBp4KMkzeLd5E6jUlCL93Y5Nvq68wV5fRLDRTf7N1LvofkVFWfDcednFOgA==} - '@cspell/dict-ruby@5.0.1': - resolution: {integrity: sha512-rruTm7Emhty/BSYavSm8ZxRuVw0OBqzJkwIFXcV0cX7To8D1qbmS9HFHRuRg8IL11+/nJvtdDz+lMFBSmPUagQ==} + '@cspell/dict-ruby@5.0.4': + resolution: {integrity: sha512-URw0jScj5pv8sKCVLNnde11qVCQR442rUpSd12u46Swl+5qBaSdnOUoCWQk419kd9/dpC6bB/3l4kOSY2fdYHw==} - '@cspell/dict-rust@4.0.1': - resolution: {integrity: sha512-xJSSzHDK2z6lSVaOmMxl3PTOtfoffaxMo7fTcbZUF+SCJzfKbO6vnN9TCGX2sx1RHFDz66Js6goz6SAZQdOwaw==} + '@cspell/dict-rust@4.0.6': + resolution: {integrity: sha512-Buzy9PfLbdRPibSth8CV1D8ZsYqybo26yNIlAN+8ehU0pSBss0Jv4aleL4vKQ3FjouXeAC27rtEsLd7yaMZTog==} - '@cspell/dict-scala@5.0.0': - resolution: {integrity: sha512-ph0twaRoV+ylui022clEO1dZ35QbeEQaKTaV2sPOsdwIokABPIiK09oWwGK9qg7jRGQwVaRPEq0Vp+IG1GpqSQ==} + '@cspell/dict-scala@5.0.3': + resolution: {integrity: sha512-4yGb4AInT99rqprxVNT9TYb1YSpq58Owzq7zi3ZS5T0u899Y4VsxsBiOgHnQ/4W+ygi+sp+oqef8w8nABR2lkg==} - '@cspell/dict-software-terms@3.3.9': - resolution: {integrity: sha512-/O3EWe0SIznx18S7J3GAXPDe7sexn3uTsf4IlnGYK9WY6ZRuEywkXCB+5/USLTGf4+QC05pkHofphdvVSifDyA==} + '@cspell/dict-software-terms@4.1.7': + resolution: {integrity: sha512-+fFTALseXszDN8/khonF1DpTcYzwyNqYxhATLakr7CUPtUCO1fCH4lidMtBN4UtPVpE6tbjc5D8tj51PJxEOcw==} - '@cspell/dict-sql@2.1.2': - resolution: {integrity: sha512-Pi0hAcvsSGtZZeyyAN1VfGtQJbrXos5x2QjJU0niAQKhmITSOrXU/1II1Gogk+FYDjWyV9wP2De0U2f7EWs6oQ==} + '@cspell/dict-sql@2.1.5': + resolution: {integrity: sha512-FmxanytHXss7GAWAXmgaxl3icTCW7YxlimyOSPNfm+njqeUDjw3kEv4mFNDDObBJv8Ec5AWCbUDkWIpkE3IpKg==} '@cspell/dict-svelte@1.0.2': resolution: {integrity: sha512-rPJmnn/GsDs0btNvrRBciOhngKV98yZ9SHmg8qI6HLS8hZKvcXc0LMsf9LLuMK1TmS2+WQFAan6qeqg6bBxL2Q==} @@ -3853,19 +4837,30 @@ packages: '@cspell/dict-swift@2.0.1': resolution: {integrity: sha512-gxrCMUOndOk7xZFmXNtkCEeroZRnS2VbeaIPiymGRHj5H+qfTAzAKxtv7jJbVA3YYvEzWcVE2oKDP4wcbhIERw==} - '@cspell/dict-typescript@3.1.2': - resolution: {integrity: sha512-lcNOYWjLUvDZdLa0UMNd/LwfVdxhE9rKA+agZBGjL3lTA3uNvH7IUqSJM/IXhJoBpLLMVEOk8v1N9xi+vDuCdA==} + '@cspell/dict-terraform@1.0.2': + resolution: {integrity: sha512-UZdJwWIpib2Rx02w6vtXTU3z+M/VMZU0F1dhSL3Ab9otQsFntT8U1CX7wBSqQCLg8bJiCfnUyVvMK3UBm3SR8A==} + + '@cspell/dict-typescript@3.1.6': + resolution: {integrity: sha512-1beC6O4P/j23VuxX+i0+F7XqPVc3hhiAzGJHEKqnWf5cWAXQtg0xz3xQJ5MvYx2a7iLaSa+lu7+05vG9UHyu9Q==} '@cspell/dict-vue@3.0.0': resolution: {integrity: sha512-niiEMPWPV9IeRBRzZ0TBZmNnkK3olkOPYxC1Ny2AX4TGlYRajcW0WUtoSHmvvjZNfWLSg2L6ruiBeuPSbjnG6A==} - '@cspell/dynamic-import@6.31.3': - resolution: {integrity: sha512-A6sT00+6UNGFksQ5SxW2ohNl6vUutai8F4jwJMHTjZL/9vivQpU7y5V4PpsfoPZtx3WZcbrzuTvJ+tLfdbWc4A==} - engines: {node: '>=14'} + '@cspell/dynamic-import@8.14.2': + resolution: {integrity: sha512-5MbqtIligU7yPwHWU/5yFCgMvur4i1bRAF1Cy8y2dDtHsa204S/w/SaXs+51EFLp2eNbCiBisCBrwJFT7R1RxA==} + engines: {node: '>=18.0'} + + '@cspell/filetypes@8.14.2': + resolution: {integrity: sha512-ZevArA0mWeVTTqHicxCPZIAeCibpY3NwWK/x6d1Lgu7RPk/daoGAM546Q2SLChFu+r10tIH7pRG212A6Q9ihPA==} + engines: {node: '>=18'} + + '@cspell/strong-weak-map@8.14.2': + resolution: {integrity: sha512-7sRzJc392CQYNNrtdPEfOHJdRqsqf6nASCtbS5A9hL2UrdWQ4uN7r/D+Y1HpuizwY9eOkZvarcFfsYt5wE0Pug==} + engines: {node: '>=18'} - '@cspell/strong-weak-map@6.31.3': - resolution: {integrity: sha512-znwc9IlgGUPioHGshP/zyM8HsuYg1OY5S7HSiVXARh5H8RqcyBsnyn8abc0PPhqPrfDy9Fh5xHsAEPZ55dl1vQ==} - engines: {node: '>=14.6'} + '@cspell/url@8.14.2': + resolution: {integrity: sha512-YmWW+B/2XQcCynLpiAQF77Bitm5Cynw3/BICZkbdveKjJkUzEmXB+U2qWuwXOyU8xUYuwkP63YM8McnI567rUA==} + engines: {node: '>=18.0'} '@cspotcode/source-map-support@0.8.1': resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} @@ -3881,18 +4876,282 @@ packages: peerDependencies: vue: ^3.0.11 + '@csstools/cascade-layer-name-parser@2.0.1': + resolution: {integrity: sha512-G9ZYN5+yr/E6xYSiy1BwOEFP5p88ZtWo8sL4NztKBkRRAwRkzVGa70M+D+fYHugMID5jkLeNt5X9jYd5EaVuyg==} + engines: {node: '>=18'} + peerDependencies: + '@csstools/css-parser-algorithms': ^3.0.1 + '@csstools/css-tokenizer': ^3.0.1 + + '@csstools/color-helpers@5.0.1': + resolution: {integrity: sha512-MKtmkA0BX87PKaO1NFRTFH+UnkgnmySQOvNxJubsadusqPEC2aJ9MOQiMceZJJ6oitUl/i0L6u0M1IrmAOmgBA==} + engines: {node: '>=18'} + + '@csstools/css-calc@2.0.1': + resolution: {integrity: sha512-e59V+sNp6e5m+9WnTUydA1DQO70WuKUdseflRpWmXxocF/h5wWGIxUjxfvLtajcmwstH0vm6l0reKMzcyI757Q==} + engines: {node: '>=18'} + peerDependencies: + '@csstools/css-parser-algorithms': ^3.0.1 + '@csstools/css-tokenizer': ^3.0.1 + + '@csstools/css-calc@2.1.0': + resolution: {integrity: sha512-X69PmFOrjTZfN5ijxtI8hZ9kRADFSLrmmQ6hgDJ272Il049WGKpDY64KhrFm/7rbWve0z81QepawzjkKlqkNGw==} + engines: {node: '>=18'} + peerDependencies: + '@csstools/css-parser-algorithms': ^3.0.4 + '@csstools/css-tokenizer': ^3.0.3 + + '@csstools/css-color-parser@3.0.2': + resolution: {integrity: sha512-mNg7A6HnNjlm0we/pDS9dUafOuBxcanN0TBhEGeIk6zZincuk0+mAbnBqfVs29NlvWHZ8diwTG6g5FeU8246sA==} + engines: {node: '>=18'} + peerDependencies: + '@csstools/css-parser-algorithms': ^3.0.1 + '@csstools/css-tokenizer': ^3.0.1 + + '@csstools/css-color-parser@3.0.6': + resolution: {integrity: sha512-S/IjXqTHdpI4EtzGoNCHfqraXF37x12ZZHA1Lk7zoT5pm2lMjFuqhX/89L7dqX4CcMacKK+6ZCs5TmEGb/+wKw==} + engines: {node: '>=18'} + peerDependencies: + '@csstools/css-parser-algorithms': ^3.0.4 + '@csstools/css-tokenizer': ^3.0.3 + + '@csstools/css-parser-algorithms@3.0.1': + resolution: {integrity: sha512-lSquqZCHxDfuTg/Sk2hiS0mcSFCEBuj49JfzPHJogDBT0mGCyY5A1AQzBWngitrp7i1/HAZpIgzF/VjhOEIJIg==} + engines: {node: '>=18'} + peerDependencies: + '@csstools/css-tokenizer': ^3.0.1 + + '@csstools/css-parser-algorithms@3.0.4': + resolution: {integrity: sha512-Up7rBoV77rv29d3uKHUIVubz1BTcgyUK72IvCQAbfbMv584xHcGKCKbWh7i8hPrRJ7qU4Y8IO3IY9m+iTB7P3A==} + engines: {node: '>=18'} + peerDependencies: + '@csstools/css-tokenizer': ^3.0.3 + + '@csstools/css-tokenizer@3.0.1': + resolution: {integrity: sha512-UBqaiu7kU0lfvaP982/o3khfXccVlHPWp0/vwwiIgDF0GmqqqxoiXC/6FCjlS9u92f7CoEz6nXKQnrn1kIAkOw==} + engines: {node: '>=18'} + + '@csstools/css-tokenizer@3.0.3': + resolution: {integrity: sha512-UJnjoFsmxfKUdNYdWgOB0mWUypuLvAfQPH1+pyvRJs6euowbFkFC6P13w1l8mJyi3vxYMxc9kld5jZEGRQs6bw==} + engines: {node: '>=18'} + + '@csstools/media-query-list-parser@3.0.1': + resolution: {integrity: sha512-HNo8gGD02kHmcbX6PvCoUuOQvn4szyB9ca63vZHKX5A81QytgDG4oxG4IaEfHTlEZSZ6MjPEMWIVU+zF2PZcgw==} + engines: {node: '>=18'} + peerDependencies: + '@csstools/css-parser-algorithms': ^3.0.1 + '@csstools/css-tokenizer': ^3.0.1 + '@csstools/postcss-cascade-layers@4.0.6': resolution: {integrity: sha512-Xt00qGAQyqAODFiFEJNkTpSUz5VfYqnDLECdlA/Vv17nl/OIV5QfTRHGAXrBGG5YcJyHpJ+GF9gF/RZvOQz4oA==} engines: {node: ^14 || ^16 || >=18} peerDependencies: postcss: ^8.4 + '@csstools/postcss-cascade-layers@5.0.0': + resolution: {integrity: sha512-h+VunB3KXaoWTWEPBcdVk8Kz1eZ/CtDD+HXgKw5JLdbsViLEQdKUtFYH73VIQigdodng8s5DCrrwNQY7pnuWBA==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + '@csstools/postcss-color-function@4.0.2': + resolution: {integrity: sha512-q/W3RXh66SM7WqxW3/KU6koL8nOgqyB/wrcU3+ThXnNtXY2+k8UgdE301ISJpMt6PDyYgC7eMaIBo535RvFIgw==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + '@csstools/postcss-color-mix-function@3.0.2': + resolution: {integrity: sha512-zG9PHNzZVCRk6eprm+T/ybrnuiwLdO+RR7+GCtNut+NZJGtPJj6bfPOEX23aOlMslLcRAlN6QOpxH3tovn+WpA==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + '@csstools/postcss-content-alt-text@2.0.1': + resolution: {integrity: sha512-TWjjewVZqdkjavsi8a2THuXgkhUum1k/m4QJpZpzOv72q6WnaoQZGSj5t5uCs7ymJr0H3qj6JcXMwMApSWUOGQ==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + '@csstools/postcss-exponential-functions@2.0.1': + resolution: {integrity: sha512-A/MG8es3ylFzZ30oYIQUyJcMOfTfCs0dqqBMzeuzaPRlx4q/72WG+BbKe/pL9BUNIWsM0Q8jn3e3la8enjHJJA==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + '@csstools/postcss-font-format-keywords@4.0.0': + resolution: {integrity: sha512-usBzw9aCRDvchpok6C+4TXC57btc4bJtmKQWOHQxOVKen1ZfVqBUuCZ/wuqdX5GHsD0NRSr9XTP+5ID1ZZQBXw==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + '@csstools/postcss-gamut-mapping@2.0.2': + resolution: {integrity: sha512-/1ur3ca9RWg/KnbLlxaDswyjLSGoaHNDruAzrVhkn5axgd7LOH6JHCBRhrKDafdMw9bf4MQrYFoaLfHAPekLFg==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + '@csstools/postcss-gradients-interpolation-method@5.0.2': + resolution: {integrity: sha512-qRpvA4sduAfiV9yZG4OM7q/h2Qhr3lg+GrHe9NZwuzWnfSDLGh+Dh4Ea6fQ+1++jdKXW/Cb4/vHRp0ssQYra4w==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + '@csstools/postcss-hwb-function@4.0.2': + resolution: {integrity: sha512-RUBVCyJE1hTsf9vGp3zrALeMollkAlHRFKm+T36y67nLfOOf+6GNQsdTGFAyLrY65skcm8ddC26Jp1n9ZIauEA==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + '@csstools/postcss-ic-unit@4.0.0': + resolution: {integrity: sha512-9QT5TDGgx7wD3EEMN3BSUG6ckb6Eh5gSPT5kZoVtUuAonfPmLDJyPhqR4ntPpMYhUKAMVKAg3I/AgzqHMSeLhA==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + '@csstools/postcss-initial@2.0.0': + resolution: {integrity: sha512-dv2lNUKR+JV+OOhZm9paWzYBXOCi+rJPqJ2cJuhh9xd8USVrd0cBEPczla81HNOyThMQWeCcdln3gZkQV2kYxA==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + '@csstools/postcss-is-pseudo-class@5.0.0': + resolution: {integrity: sha512-E/CjrT03BL06WmrjupnrT0VUBTvxJdoW1hRVeXFa9qatWtvcLLw0j8hP372G4A9PpSGEMXi3/AoHzPf7DNryCQ==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + '@csstools/postcss-light-dark-function@2.0.4': + resolution: {integrity: sha512-yHUt5DZ61Irvp72notmAl3Zt4Me50EWToWNocazyIFTVYFwwo/EucmV3hWi9zJehu3rOSvMclL7DzvRDfbak/A==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + '@csstools/postcss-logical-float-and-clear@3.0.0': + resolution: {integrity: sha512-SEmaHMszwakI2rqKRJgE+8rpotFfne1ZS6bZqBoQIicFyV+xT1UF42eORPxJkVJVrH9C0ctUgwMSn3BLOIZldQ==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + '@csstools/postcss-logical-overflow@2.0.0': + resolution: {integrity: sha512-spzR1MInxPuXKEX2csMamshR4LRaSZ3UXVaRGjeQxl70ySxOhMpP2252RAFsg8QyyBXBzuVOOdx1+bVO5bPIzA==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + '@csstools/postcss-logical-overscroll-behavior@2.0.0': + resolution: {integrity: sha512-e/webMjoGOSYfqLunyzByZj5KKe5oyVg/YSbie99VEaSDE2kimFm0q1f6t/6Jo+VVCQ/jbe2Xy+uX+C4xzWs4w==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + '@csstools/postcss-logical-resize@3.0.0': + resolution: {integrity: sha512-DFbHQOFW/+I+MY4Ycd/QN6Dg4Hcbb50elIJCfnwkRTCX05G11SwViI5BbBlg9iHRl4ytB7pmY5ieAFk3ws7yyg==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + '@csstools/postcss-logical-viewport-units@3.0.1': + resolution: {integrity: sha512-JsfaoTiBqIuRE+CYL4ZpYKOqJ965GyiMH4b8UrY0Z7i5GfMiHZrK7xtTB29piuyKQzrW+Z8w3PAExhwND9cuAQ==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + '@csstools/postcss-media-minmax@2.0.1': + resolution: {integrity: sha512-EMa3IgUip+F/MwH4r2KfIA9ym9hQkT2PpR9MOukdomfGGCFuw9V3n/iIOBKziN1qfeddsYoOvtYOKQcHU2yIjg==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + '@csstools/postcss-media-queries-aspect-ratio-number-values@3.0.1': + resolution: {integrity: sha512-JTzMQz//INahTALkvXnC5lC2fJKzwb5PY443T2zaM9hAzM7nzHMLIlEfFgdtBahVIBtBSalMefdxNr99LGW1lQ==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + '@csstools/postcss-nested-calc@4.0.0': + resolution: {integrity: sha512-jMYDdqrQQxE7k9+KjstC3NbsmC063n1FTPLCgCRS2/qHUbHM0mNy9pIn4QIiQGs9I/Bg98vMqw7mJXBxa0N88A==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + '@csstools/postcss-normalize-display-values@4.0.0': + resolution: {integrity: sha512-HlEoG0IDRoHXzXnkV4in47dzsxdsjdz6+j7MLjaACABX2NfvjFS6XVAnpaDyGesz9gK2SC7MbNwdCHusObKJ9Q==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + '@csstools/postcss-oklab-function@4.0.2': + resolution: {integrity: sha512-2iSK/T77PHMeorakBAk/WLxSodfIJ/lmi6nxEkuruXfhGH7fByZim4Fw6ZJf4B73SVieRSH2ep8zvYkA2ZfRtA==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + '@csstools/postcss-progressive-custom-properties@4.0.0': + resolution: {integrity: sha512-XQPtROaQjomnvLUSy/bALTR5VCtTVUFwYs1SblvYgLSeTo2a/bMNwUwo2piXw5rTv/FEYiy5yPSXBqg9OKUx7Q==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + '@csstools/postcss-relative-color-syntax@3.0.2': + resolution: {integrity: sha512-aBpuUdpJBswNGfw6lOkhown2cZ0YXrMjASye56nkoRpgRe9yDF4BM1fvEuakrCDiaeoUzVaI4SF6+344BflXfQ==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + '@csstools/postcss-scope-pseudo-class@4.0.0': + resolution: {integrity: sha512-+ZUOBtVMDcmHZcZqsP/jcNRriEILfWQflTI3tCTA+/RheXAg57VkFGyPDAilpQSqlCpxWLWG8VUFKFtZJPwuOg==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + '@csstools/postcss-stepped-value-functions@4.0.1': + resolution: {integrity: sha512-dk3KqVcIEYzy9Mvx8amoBbk123BWgd5DfjXDiPrEqxGma37PG7m/MoMmHQhuVHIjvPDHoJwyIZi2yy7j0RA5fw==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + '@csstools/postcss-text-decoration-shorthand@4.0.1': + resolution: {integrity: sha512-xPZIikbx6jyzWvhms27uugIc0I4ykH4keRvoa3rxX5K7lEhkbd54rjj/dv60qOCTisoS+3bmwJTeyV1VNBrXaw==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + '@csstools/postcss-trigonometric-functions@4.0.1': + resolution: {integrity: sha512-QHOYuN3bzS/rcpAygFhJxJUtD8GuJEWF6f9Zm518Tq/cSMlcTgU+v0geyi5EqbmYxKMig2oKCKUSGqOj9gehkg==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + '@csstools/postcss-unset-value@4.0.0': + resolution: {integrity: sha512-cBz3tOCI5Fw6NIFEwU3RiwK6mn3nKegjpJuzCndoGq3BZPkUjnsq7uQmIeMNeMbMk7YD2MfKcgCpZwX5jyXqCA==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + '@csstools/selector-resolve-nested@2.0.0': + resolution: {integrity: sha512-oklSrRvOxNeeOW1yARd4WNCs/D09cQjunGZUgSq6vM8GpzFswN+8rBZyJA29YFZhOTQ6GFzxgLDNtVbt9wPZMA==} + engines: {node: '>=18'} + peerDependencies: + postcss-selector-parser: ^6.1.0 + '@csstools/selector-specificity@3.1.1': resolution: {integrity: sha512-a7cxGcJ2wIlMFLlh8z2ONm+715QkPHiyJcxwQlKOz/03GPw1COpfhcmC9wm4xlZfp//jWHNNMwzjtqHXVWU9KA==} engines: {node: ^14 || ^16 || >=18} peerDependencies: postcss-selector-parser: ^6.0.13 + '@csstools/selector-specificity@4.0.0': + resolution: {integrity: sha512-189nelqtPd8++phaHNwYovKZI0FOzH1vQEE3QhHHkNIGrg5fSs9CbYP3RvfEH5geztnIA9Jwq91wyOIwAW5JIQ==} + engines: {node: '>=18'} + peerDependencies: + postcss-selector-parser: ^6.1.0 + + '@csstools/utilities@2.0.0': + resolution: {integrity: sha512-5VdOr0Z71u+Yp3ozOx8T11N703wIFGVRgOWbOZMKgglPJsWA54MRIoMNVMa7shUToIhx5J8vX4sOZgD2XiihiQ==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + '@ctrl/tinycolor@3.6.1': resolution: {integrity: sha512-SITSV6aIXsuVNV3f3O0f2n/cgyEDWoSqtZMYiAmcsYHydcKrOz3gUxB/iXd/Qf08+IZX4KpgNbvUdMBmWz+kcA==} engines: {node: '>=10'} @@ -3901,13 +5160,17 @@ packages: resolution: {integrity: sha512-0cp4PsWQ/9avqTVMCtZ+GirikIA36ikvjtHweU4/j8yLtgObI0+JUPhYFScgwlteveGB1rt3Cm8UhN04XayDig==} engines: {node: '>= 8.9.0'} - '@dnd-kit/accessibility@3.1.0': - resolution: {integrity: sha512-ea7IkhKvlJUv9iSHJOnxinBcoOI3ppGnnL+VDJ75O45Nss6HtZd8IdN8touXPDtASfeI2T2LImb8VOZcL47wjQ==} + '@discoveryjs/json-ext@0.5.7': + resolution: {integrity: sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==} + engines: {node: '>=10.0.0'} + + '@dnd-kit/accessibility@3.1.1': + resolution: {integrity: sha512-2P+YgaXF+gRsIihwwY1gCsQSYnu9Zyj2py8kY5fFvUM1qm2WA2u639R6YNVfU4GWr+ZM5mqEsfHZZLoRONbemw==} peerDependencies: react: '>=16.8.0' - '@dnd-kit/core@6.1.0': - resolution: {integrity: sha512-J3cQBClB4TVxwGo3KEjssGEXNJqGVWx17aRTZ1ob0FliR5IjYgTxl5YJbKTzA6IzrtelotH19v6y7uoIRUZPSg==} + '@dnd-kit/core@6.3.1': + resolution: {integrity: sha512-xkGBRQQab4RLwgXxoqETICr6S5JlogafbhNsidmrkVv2YRs5MLwpjoF2qpiGjQt8S9AoxtIV603s0GIUpY5eYQ==} peerDependencies: react: '>=16.8.0' react-dom: '>=16.8.0' @@ -3929,6 +5192,206 @@ packages: peerDependencies: react: '>=16.8.0' + '@docsearch/css@3.6.2': + resolution: {integrity: sha512-vKNZepO2j7MrYBTZIGXvlUOIR+v9KRf70FApRgovWrj3GTs1EITz/Xb0AOlm1xsQBp16clVZj1SY/qaOJbQtZw==} + + '@docsearch/react@3.6.2': + resolution: {integrity: sha512-rtZce46OOkVflCQH71IdbXSFK+S8iJZlUF56XBW5rIgx/eG5qoomC7Ag3anZson1bBac/JFQn7XOBfved/IMRA==} + peerDependencies: + '@types/react': '>= 16.8.0 < 19.0.0' + react: '>= 16.8.0 < 19.0.0' + react-dom: '>= 16.8.0 < 19.0.0' + search-insights: '>= 1 < 3' + peerDependenciesMeta: + '@types/react': + optional: true + react: + optional: true + react-dom: + optional: true + search-insights: + optional: true + + '@docusaurus/core@3.5.2': + resolution: {integrity: sha512-4Z1WkhCSkX4KO0Fw5m/Vuc7Q3NxBG53NE5u59Rs96fWkMPZVSrzEPP16/Nk6cWb/shK7xXPndTmalJtw7twL/w==} + engines: {node: '>=18.0'} + hasBin: true + peerDependencies: + '@mdx-js/react': ^3.0.0 + react: ^18.0.0 + react-dom: ^18.0.0 + + '@docusaurus/cssnano-preset@3.5.2': + resolution: {integrity: sha512-D3KiQXOMA8+O0tqORBrTOEQyQxNIfPm9jEaJoALjjSjc2M/ZAWcUfPQEnwr2JB2TadHw2gqWgpZckQmrVWkytA==} + engines: {node: '>=18.0'} + + '@docusaurus/logger@3.5.2': + resolution: {integrity: sha512-LHC540SGkeLfyT3RHK3gAMK6aS5TRqOD4R72BEU/DE2M/TY8WwEUAMY576UUc/oNJXv8pGhBmQB6N9p3pt8LQw==} + engines: {node: '>=18.0'} + + '@docusaurus/lqip-loader@3.5.2': + resolution: {integrity: sha512-yUD90PgwbGciCHHiQTWXZvpLv9nVTpXrX8Ilz5Sl6oJ1bwnLgGsbl7h+EseVbwBnKhVCoujW/EKRU6+3HqeeXQ==} + engines: {node: '>=18.0'} + + '@docusaurus/mdx-loader@3.5.2': + resolution: {integrity: sha512-ku3xO9vZdwpiMIVd8BzWV0DCqGEbCP5zs1iHfKX50vw6jX8vQo0ylYo1YJMZyz6e+JFJ17HYHT5FzVidz2IflA==} + engines: {node: '>=18.0'} + peerDependencies: + react: ^18.0.0 + react-dom: ^18.0.0 + + '@docusaurus/module-type-aliases@3.5.2': + resolution: {integrity: sha512-Z+Xu3+2rvKef/YKTMxZHsEXp1y92ac0ngjDiExRdqGTmEKtCUpkbNYH8v5eXo5Ls+dnW88n6WTa+Q54kLOkwPg==} + peerDependencies: + react: '*' + react-dom: '*' + + '@docusaurus/plugin-content-blog@3.5.2': + resolution: {integrity: sha512-R7ghWnMvjSf+aeNDH0K4fjyQnt5L0KzUEnUhmf1e3jZrv3wogeytZNN6n7X8yHcMsuZHPOrctQhXWnmxu+IRRg==} + engines: {node: '>=18.0'} + peerDependencies: + '@docusaurus/plugin-content-docs': '*' + react: ^18.0.0 + react-dom: ^18.0.0 + + '@docusaurus/plugin-content-docs@3.5.2': + resolution: {integrity: sha512-Bt+OXn/CPtVqM3Di44vHjE7rPCEsRCB/DMo2qoOuozB9f7+lsdrHvD0QCHdBs0uhz6deYJDppAr2VgqybKPlVQ==} + engines: {node: '>=18.0'} + peerDependencies: + react: ^18.0.0 + react-dom: ^18.0.0 + + '@docusaurus/plugin-content-pages@3.5.2': + resolution: {integrity: sha512-WzhHjNpoQAUz/ueO10cnundRz+VUtkjFhhaQ9jApyv1a46FPURO4cef89pyNIOMny1fjDz/NUN2z6Yi+5WUrCw==} + engines: {node: '>=18.0'} + peerDependencies: + react: ^18.0.0 + react-dom: ^18.0.0 + + '@docusaurus/plugin-debug@3.5.2': + resolution: {integrity: sha512-kBK6GlN0itCkrmHuCS6aX1wmoWc5wpd5KJlqQ1FyrF0cLDnvsYSnh7+ftdwzt7G6lGBho8lrVwkkL9/iQvaSOA==} + engines: {node: '>=18.0'} + peerDependencies: + react: ^18.0.0 + react-dom: ^18.0.0 + + '@docusaurus/plugin-google-analytics@3.5.2': + resolution: {integrity: sha512-rjEkJH/tJ8OXRE9bwhV2mb/WP93V441rD6XnM6MIluu7rk8qg38iSxS43ga2V2Q/2ib53PcqbDEJDG/yWQRJhQ==} + engines: {node: '>=18.0'} + peerDependencies: + react: ^18.0.0 + react-dom: ^18.0.0 + + '@docusaurus/plugin-google-gtag@3.5.2': + resolution: {integrity: sha512-lm8XL3xLkTPHFKKjLjEEAHUrW0SZBSHBE1I+i/tmYMBsjCcUB5UJ52geS5PSiOCFVR74tbPGcPHEV/gaaxFeSA==} + engines: {node: '>=18.0'} + peerDependencies: + react: ^18.0.0 + react-dom: ^18.0.0 + + '@docusaurus/plugin-google-tag-manager@3.5.2': + resolution: {integrity: sha512-QkpX68PMOMu10Mvgvr5CfZAzZQFx8WLlOiUQ/Qmmcl6mjGK6H21WLT5x7xDmcpCoKA/3CegsqIqBR+nA137lQg==} + engines: {node: '>=18.0'} + peerDependencies: + react: ^18.0.0 + react-dom: ^18.0.0 + + '@docusaurus/plugin-ideal-image@3.5.2': + resolution: {integrity: sha512-FnHi3a5DjYRvjN1XbXRe1Cmiqfc+tAI2VmThN1Mr9teLB0ibuRi++P98q6+KyamBWKrJmuskWLMdr71acwHM8Q==} + engines: {node: '>=18.0'} + peerDependencies: + jimp: '*' + react: ^18.0.0 + react-dom: ^18.0.0 + peerDependenciesMeta: + jimp: + optional: true + + '@docusaurus/plugin-sitemap@3.5.2': + resolution: {integrity: sha512-DnlqYyRAdQ4NHY28TfHuVk414ft2uruP4QWCH//jzpHjqvKyXjj2fmDtI8RPUBh9K8iZKFMHRnLtzJKySPWvFA==} + engines: {node: '>=18.0'} + peerDependencies: + react: ^18.0.0 + react-dom: ^18.0.0 + + '@docusaurus/preset-classic@3.5.2': + resolution: {integrity: sha512-3ihfXQ95aOHiLB5uCu+9PRy2gZCeSZoDcqpnDvf3B+sTrMvMTr8qRUzBvWkoIqc82yG5prCboRjk1SVILKx6sg==} + engines: {node: '>=18.0'} + peerDependencies: + react: ^18.0.0 + react-dom: ^18.0.0 + + '@docusaurus/react-loadable@6.0.0': + resolution: {integrity: sha512-YMMxTUQV/QFSnbgrP3tjDzLHRg7vsbMn8e9HAa8o/1iXoiomo48b7sk/kkmWEuWNDPJVlKSJRB6Y2fHqdJk+SQ==} + peerDependencies: + react: '*' + + '@docusaurus/responsive-loader@1.7.0': + resolution: {integrity: sha512-N0cWuVqTRXRvkBxeMQcy/OF2l7GN8rmni5EzR3HpwR+iU2ckYPnziceojcxvvxQ5NqZg1QfEW0tycQgHp+e+Nw==} + engines: {node: '>=12'} + peerDependencies: + jimp: '*' + sharp: '*' + peerDependenciesMeta: + jimp: + optional: true + sharp: + optional: true + + '@docusaurus/theme-classic@3.5.2': + resolution: {integrity: sha512-XRpinSix3NBv95Rk7xeMF9k4safMkwnpSgThn0UNQNumKvmcIYjfkwfh2BhwYh/BxMXQHJ/PdmNh22TQFpIaYg==} + engines: {node: '>=18.0'} + peerDependencies: + react: ^18.0.0 + react-dom: ^18.0.0 + + '@docusaurus/theme-common@3.5.2': + resolution: {integrity: sha512-QXqlm9S6x9Ibwjs7I2yEDgsCocp708DrCrgHgKwg2n2AY0YQ6IjU0gAK35lHRLOvAoJUfCKpQAwUykB0R7+Eew==} + engines: {node: '>=18.0'} + peerDependencies: + '@docusaurus/plugin-content-docs': '*' + react: ^18.0.0 + react-dom: ^18.0.0 + + '@docusaurus/theme-search-algolia@3.5.2': + resolution: {integrity: sha512-qW53kp3VzMnEqZGjakaV90sst3iN1o32PH+nawv1uepROO8aEGxptcq2R5rsv7aBShSRbZwIobdvSYKsZ5pqvA==} + engines: {node: '>=18.0'} + peerDependencies: + react: ^18.0.0 + react-dom: ^18.0.0 + + '@docusaurus/theme-translations@3.5.2': + resolution: {integrity: sha512-GPZLcu4aT1EmqSTmbdpVrDENGR2yObFEX8ssEFYTCiAIVc0EihNSdOIBTazUvgNqwvnoU1A8vIs1xyzc3LITTw==} + engines: {node: '>=18.0'} + + '@docusaurus/types@3.5.2': + resolution: {integrity: sha512-N6GntLXoLVUwkZw7zCxwy9QiuEXIcTVzA9AkmNw16oc0AP3SXLrMmDMMBIfgqwuKWa6Ox6epHol9kMtJqekACw==} + peerDependencies: + react: ^18.0.0 + react-dom: ^18.0.0 + + '@docusaurus/utils-common@3.5.2': + resolution: {integrity: sha512-i0AZjHiRgJU6d7faQngIhuHKNrszpL/SHQPgF1zH4H+Ij6E9NBYGy6pkcGWToIv7IVPbs+pQLh1P3whn0gWXVg==} + engines: {node: '>=18.0'} + peerDependencies: + '@docusaurus/types': '*' + peerDependenciesMeta: + '@docusaurus/types': + optional: true + + '@docusaurus/utils-validation@3.5.2': + resolution: {integrity: sha512-m+Foq7augzXqB6HufdS139PFxDC5d5q2QKZy8q0qYYvGdI6nnlNsGH4cIGsgBnV7smz+mopl3g4asbSDvMV0jA==} + engines: {node: '>=18.0'} + + '@docusaurus/utils@3.5.2': + resolution: {integrity: sha512-33QvcNFh+Gv+C2dP9Y9xWEzMgf3JzrpL2nW9PopidiohS1nDcyknKRx2DWaFvyVTTYIkkABVSr073VTj/NITNA==} + engines: {node: '>=18.0'} + peerDependencies: + '@docusaurus/types': '*' + peerDependenciesMeta: + '@docusaurus/types': + optional: true + '@electron-forge/cli@7.4.0': resolution: {integrity: sha512-a+zZv3ja/IxkJzNyx4sOHSZv6DPV85S0PEVF6pcRjUpbDL5r+DxjRFsNc0Nq4UIWyFm1nw7RWoPdd9uDst4Tvg==} engines: {node: '>= 16.4.0'} @@ -4063,6 +5526,9 @@ packages: '@emotion/babel-plugin@11.12.0': resolution: {integrity: sha512-y2WQb+oP8Jqvvclh8Q55gLUyb7UFvgv7eJfsj7td5TToBrIUtPay2kMrZi4xjq9qw2vD0ZR5fSho0yqoFgX7Rw==} + '@emotion/babel-plugin@11.13.5': + resolution: {integrity: sha512-pxHCpT2ex+0q+HH91/zsdHkw/lXd468DIN2zvfvLtPKLLMo6gQj7oLObq8PhkrxOZb/gGCq03S3Z7PDhS8pduQ==} + '@emotion/cache@11.11.0': resolution: {integrity: sha512-P34z9ssTCBi3e9EI1ZsWpNHcfY1r09ZO0rZbRO2ob3ZQMnFI35jB536qoXbkdesr5EUhYi22anuEJuyxifaqAQ==} @@ -4081,8 +5547,8 @@ packages: '@emotion/hash@0.9.2': resolution: {integrity: sha512-MyqliTZGuOm3+5ZRSaaBGP3USLw6+EGykkwZns2EPC5g8jJ4z9OrdZY9apkl3+UP9+sdz76YYkwCKP5gh8iY3g==} - '@emotion/is-prop-valid@1.3.0': - resolution: {integrity: sha512-SHetuSLvJDzuNbOdtPVbq6yMMMlLoW5Q94uDqJZqy50gcmAjxFkVqmzqSGEFq9gT2iMuIeKV1PXVWmvUhuZLlQ==} + '@emotion/is-prop-valid@1.3.1': + resolution: {integrity: sha512-/ACwoqx7XQi9knQs/G0qKvv5teDMhD7bXYns9N/wM8ah8iNb8jZ2uNO0YOgiq2o2poIvVtJS2YALasQuMSQ7Kw==} '@emotion/memoize@0.8.1': resolution: {integrity: sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==} @@ -4114,6 +5580,9 @@ packages: '@emotion/serialize@1.3.0': resolution: {integrity: sha512-jACuBa9SlYajnpIVXB+XOXnfJHyckDfe6fOpORIM6yhBDlqGuExvDdZYHDQGoDf3bZXGv7tNr+LpLjJqiEQ6EA==} + '@emotion/serialize@1.3.3': + resolution: {integrity: sha512-EISGqt7sSNWHGI76hC7x1CksiXPahbxEOrC5RjmFRJTqLyEK9/9hZvBbiYn70dw4wuwMKiEMCUlR6ZXTSWQqxA==} + '@emotion/server@11.11.0': resolution: {integrity: sha512-6q89fj2z8VBTx9w93kJ5n51hsmtYuFPtZgnc1L8VzRx9ti4EU6EyvF6Nn1H1x3vcCQCF7u2dB2lY4AYJwUW4PA==} peerDependencies: @@ -4128,8 +5597,8 @@ packages: '@emotion/sheet@1.4.0': resolution: {integrity: sha512-fTBW9/8r2w3dXWYM4HCB1Rdp8NLibOw2+XELH5m5+AkWiL/KqYX6dc0kKYlaYyKjrQ6ds33MCdMPEwgs2z1rqg==} - '@emotion/styled@11.13.0': - resolution: {integrity: sha512-tkzkY7nQhW/zC4hztlwucpT8QEZ6eUzpXDRhww/Eej4tFfO0FxQYWRyg/c5CCXa4d/f174kqeXYjuQRnhzf6dA==} + '@emotion/styled@11.14.0': + resolution: {integrity: sha512-XxfOnXFffatap2IyCeJyNov3kiDQWoR08gPUQxvbL7fxKryGBKUZUkG6Hz48DZwVrJSVh9sJboyV1Ds4OW6SgA==} peerDependencies: '@emotion/react': ^11.0.0-rc.0 '@types/react': '*' @@ -4138,6 +5607,9 @@ packages: '@types/react': optional: true + '@emotion/unitless@0.10.0': + resolution: {integrity: sha512-dFoMUuQA20zvtVTuxZww6OHoJYgrzfKM1t52mVySDJnMSEa08ruEvdYQbhvyu6soU+NeLVd3yKfTfT0NeV6qGg==} + '@emotion/unitless@0.7.5': resolution: {integrity: sha512-OWORNpfjMsSSUBVrRBVGECkhWcULOAJz9ZW8uK9qgxD+87M7jHRcvh/A96XXNhXTLmKcoYSQtBEX7lHMO7YRwg==} @@ -4157,12 +5629,20 @@ packages: peerDependencies: react: '>=16.8.0' + '@emotion/use-insertion-effect-with-fallbacks@1.2.0': + resolution: {integrity: sha512-yJMtVdH59sxi/aVJBpk9FQq+OR8ll5GT8oWd57UpeaKEVGab41JWaCFA7FRLoMLloOZF/c/wsPoe+bfGmRKgDg==} + peerDependencies: + react: '>=16.8.0' + '@emotion/utils@1.2.1': resolution: {integrity: sha512-Y2tGf3I+XVnajdItskUCn6LX+VUDmP6lTL4fcqsXAv43dnlbZiuW4MWQW38rW/BVWSE7Q/7+XQocmpnRYILUmg==} '@emotion/utils@1.4.0': resolution: {integrity: sha512-spEnrA1b6hDR/C68lC2M7m6ALPUHZC0lIY7jAS/B/9DuuO1ZP04eov8SMv/6fwRd8pzmsn2AuJEznRREWlQrlQ==} + '@emotion/utils@1.4.2': + resolution: {integrity: sha512-3vLclRofFziIa3J2wDh9jjbkUz9qk5Vi3IZ/FSTKViB0k+ef0fPV7dYrUIugbgupYDx7v9ud/SjrtEP8Y4xLoA==} + '@emotion/weak-memoize@0.3.1': resolution: {integrity: sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww==} @@ -4476,11 +5956,11 @@ packages: '@esri/calcite-colors@6.1.0': resolution: {integrity: sha512-wHQYWFtDa6c328EraXEVZvgOiaQyYr0yuaaZ0G3cB4C3lSkWefW34L/e5TLAhtuG3zJ/wR6pl5X1YYNfBc0/4Q==} - '@esri/calcite-components@2.12.2': - resolution: {integrity: sha512-Fmm7WpG+B7il0mpf7grL0ZsFJ06y6g04fGgcnpjLCjhmqy+kKiv8NFeMX529kVr5uyb43dcVOcbd/bv5RniJxg==} + '@esri/calcite-components@2.13.0': + resolution: {integrity: sha512-szlPLr4RjxegU9Bvxwf4/U2ciI2zJdoDpW7/A7353nz5x+bJJa3GvwEYyuye533faC9p2KoGpEXcB/8susISIg==} - '@esri/calcite-ui-icons@3.31.0': - resolution: {integrity: sha512-Ca3xVXU0LoxljEebuM9r3ss4tyXBfHROcxlFmbNwa2kDTVNSjUKCBgthgXnMD7akgguwwcL7zGnAp645SkJpow==} + '@esri/calcite-ui-icons@3.32.0': + resolution: {integrity: sha512-2UEddEeSnpXVWp/uNrgym3mrb8lZ5+vXFbtmvXv5NiE32nQGw2MFZD52L5Z+FsxqHJ9vVrtl/X6pTIgkd0c8jA==} hasBin: true '@farmfe/plugin-svgr-darwin-arm64@0.0.1': @@ -4552,8 +6032,11 @@ packages: '@floating-ui/dom@1.5.3': resolution: {integrity: sha512-ClAbQnEqJAKCJOEbbLo5IUlZHkNszqhuxS4fHAVxRPXPya6Ysf2G8KypnYcOTpx6I8xcgF9bbHb6g/2KpbV8qA==} - '@floating-ui/dom@1.6.10': - resolution: {integrity: sha512-fskgCFv8J8OamCmyun8MfjB1Olfn+uZKjOKZ0vhYF3gRmEUXcGOjxWL8bBr7i4kIuPZ2KD2S3EUIOxnjC8kl2A==} + '@floating-ui/dom@1.6.11': + resolution: {integrity: sha512-qkMCxSR24v2vGkhYDo/UzxfJN3D4syqSjyuTFz6C7XcpU1pASPRieNI0Kj5VP3/503mOfYiGY891ugBX1GlABQ==} + + '@floating-ui/dom@1.6.12': + resolution: {integrity: sha512-NP83c0HjokcGVEMeoStg317VD9W7eDlGK7457dMBANbKA6GJZdc7rjujdgqzTaz93jkGgc5P/jeWbaCHnMNc+w==} '@floating-ui/react-dom@2.1.1': resolution: {integrity: sha512-4h84MJt3CHrtG18mGsXuLCHMrug49d7DFkU0RMIyshRveBeyV2hmV/pDaF2Uxtu8kgq5r46llp5E5FQiR0K2Yg==} @@ -4561,6 +6044,12 @@ packages: react: '>=16.8.0' react-dom: '>=16.8.0' + '@floating-ui/react-dom@2.1.2': + resolution: {integrity: sha512-06okr5cgPzMNBy+Ycse2A6udMi4bqwW/zgBF/rwjcNqWkyr82Mcg8b0vjX8OJpZFy/FKjJmw6wV7t44kK6kW7A==} + peerDependencies: + react: '>=16.8.0' + react-dom: '>=16.8.0' + '@floating-ui/react@0.24.8': resolution: {integrity: sha512-AuYeDoaR8jtUlUXtZ1IJ/6jtBkGnSpJXbGNzokBL87VDJ8opMq1Bgrc0szhK482ReQY6KZsMoZCVSb4xwalkBA==} peerDependencies: @@ -4586,6 +6075,12 @@ packages: '@vue/composition-api': optional: true + '@hapi/hoek@9.3.0': + resolution: {integrity: sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==} + + '@hapi/topo@5.1.0': + resolution: {integrity: sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==} + '@humanwhocodes/config-array@0.11.14': resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} engines: {node: '>=10.10.0'} @@ -4732,9 +6227,8 @@ packages: '@juggle/resize-observer@3.4.0': resolution: {integrity: sha512-dfLbk+PwWvFzSxwk3n5ySL0hfBog779o8h68wK/7/APo/7cgyWp5jcXockbxdk5kFRkbeXWm4Fbi9FrdN381sA==} - '@koa/cors@5.0.0': - resolution: {integrity: sha512-x/iUDjcS90W69PryLDIMgFyV21YLTnG9zOpPXS7Bkt2b8AsY3zZsIpOLBkYr9fBcF3HbkKaER5hOBZLfpLgYNw==} - engines: {node: '>= 14.0.0'} + '@leichtgewicht/ip-codec@2.0.5': + resolution: {integrity: sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw==} '@lit-labs/ssr-dom-shim@1.2.1': resolution: {integrity: sha512-wx4aBmgeGvFmOKucFKY+8VFJSYZxs9poN3SDNQFF6lT6NrQUnHiPB2PWz2sc4ieEcAaYYzN+1uWahEeTq2aRIQ==} @@ -4785,11 +6279,37 @@ packages: '@mdn/browser-compat-data@5.5.7': resolution: {integrity: sha512-DoHTZ/TjtNfUu9eiqJd+x3IcCQrhS+yOYU436TKUnlE36jZwNbK535D1CmTsSYdi/UcdCWNm5KRQZ9g1tlZCPw==} + '@mdx-js/mdx@3.0.1': + resolution: {integrity: sha512-eIQ4QTrOWyL3LWEe/bu6Taqzq2HQvHcyTMaOrI95P2/LmJE7AsfPfgJGuFLPVqBUE1BC1rik3VIhU+s9u72arA==} + + '@mdx-js/react@3.0.1': + resolution: {integrity: sha512-9ZrPIU4MGf6et1m1ov3zKf+q9+deetI51zprKB1D/z3NOb+rUxxtEl3mCjW5wTGh6VhRdwPueh1oRzi6ezkA8A==} + peerDependencies: + '@types/react': '>=16' + react: '>=16' + + '@mediapipe/tasks-vision@0.10.8': + resolution: {integrity: sha512-Rp7ll8BHrKB3wXaRFKhrltwZl1CiXGdibPxuWXvqGnKTnv8fqa/nvftYNuSbf+pbJWKYCXdBtYTITdAUTGGh0Q==} + + '@module-federation/runtime@0.6.9': + resolution: {integrity: sha512-G1x+6jyW5sW1X+TtWaKigGhwqiHE8MESvi3ntE9ICxwELAGBonmsqDqnLSrdEy6poBKslvPANPJr0Nn9pvW9lg==} + + '@module-federation/sdk@0.6.9': + resolution: {integrity: sha512-xmTxb9LgncxPGsBrN6AT/+aHnFGv8swbeNl0PcSeVbXTGLu3Gp7j+5J+AhJoWNB++SLguRwBd8LjB1d8mNKLDg==} + + '@module-federation/vite@1.1.1': + resolution: {integrity: sha512-LHYtrQ5ysUQoJQzhq/NIbiAET/2ONGmd2y9kKETAhsaXlLJEmjGOw6TkmSVKUtlz9EqtCfSbFTPQ23DcmE+mjA==} + '@monaco-editor/loader@1.4.0': resolution: {integrity: sha512-00ioBig0x642hytVspPl7DbQyaSWRaolYie/UFNjoTdvoKPzo6xrXLhTk9ixgIKcLH5b5vDOjVNiGyY+uDCUlg==} peerDependencies: monaco-editor: '>= 0.21.0 < 1' + '@monogrid/gainmap-js@3.0.6': + resolution: {integrity: sha512-ireqJg7cw0tUn/JePDG8rAL7RyXgUKSDbjYdiygkrnye1WuKGLAWDBwF/ICwCwJ9iZBAF5caU8gSu+c34HLGdQ==} + peerDependencies: + three: '>= 0.159.0' + '@napi-rs/cli@2.18.4': resolution: {integrity: sha512-SgJeA4df9DE2iAEpr3M2H0OKl/yjtg1BnRI5/JyowS71tUWhrfSu2LT0V3vlHET+g1hBVlrO60PmEXwUEKp8Mg==} engines: {node: '>= 10'} @@ -4888,6 +6408,58 @@ packages: engines: {node: '>=8.0.0', npm: '>=5.0.0'} hasBin: true + '@octokit/auth-token@4.0.0': + resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==} + engines: {node: '>= 18'} + + '@octokit/core@5.2.0': + resolution: {integrity: sha512-1LFfa/qnMQvEOAdzlQymH0ulepxbxnCYAKJZfMci/5XJyIHWgEYnDmgnKakbTh7CH2tFQ5O60oYDvns4i9RAIg==} + engines: {node: '>= 18'} + + '@octokit/endpoint@9.0.5': + resolution: {integrity: sha512-ekqR4/+PCLkEBF6qgj8WqJfvDq65RH85OAgrtnVp1mSxaXF03u2xW/hUdweGS5654IlC0wkNYC18Z50tSYTAFw==} + engines: {node: '>= 18'} + + '@octokit/graphql@7.1.0': + resolution: {integrity: sha512-r+oZUH7aMFui1ypZnAvZmn0KSqAUgE1/tUXIWaqUCa1758ts/Jio84GZuzsvUkme98kv0WFY8//n0J1Z+vsIsQ==} + engines: {node: '>= 18'} + + '@octokit/openapi-types@22.2.0': + resolution: {integrity: sha512-QBhVjcUa9W7Wwhm6DBFu6ZZ+1/t/oYxqc2tp81Pi41YNuJinbFRx8B133qVOrAaBbF7D/m0Et6f9/pZt9Rc+tg==} + + '@octokit/plugin-paginate-rest@11.3.1': + resolution: {integrity: sha512-ryqobs26cLtM1kQxqeZui4v8FeznirUsksiA+RYemMPJ7Micju0WSkv50dBksTuZks9O5cg4wp+t8fZ/cLY56g==} + engines: {node: '>= 18'} + peerDependencies: + '@octokit/core': '5' + + '@octokit/plugin-request-log@4.0.1': + resolution: {integrity: sha512-GihNqNpGHorUrO7Qa9JbAl0dbLnqJVrV8OXe2Zm5/Y4wFkZQDfTreBzVmiRfJVfE4mClXdihHnbpyyO9FSX4HA==} + engines: {node: '>= 18'} + peerDependencies: + '@octokit/core': '5' + + '@octokit/plugin-rest-endpoint-methods@13.2.2': + resolution: {integrity: sha512-EI7kXWidkt3Xlok5uN43suK99VWqc8OaIMktY9d9+RNKl69juoTyxmLoWPIZgJYzi41qj/9zU7G/ljnNOJ5AFA==} + engines: {node: '>= 18'} + peerDependencies: + '@octokit/core': ^5 + + '@octokit/request-error@5.1.0': + resolution: {integrity: sha512-GETXfE05J0+7H2STzekpKObFe765O5dlAKUTLNGeH+x47z7JjXHfsHKo5z21D/o/IOZTUEI6nyWyR+bZVP/n5Q==} + engines: {node: '>= 18'} + + '@octokit/request@8.4.0': + resolution: {integrity: sha512-9Bb014e+m2TgBeEJGEbdplMVWwPmL1FPtggHQRkV+WVsMggPtEkLKPlcVYm/o8xKLkpJ7B+6N8WfQMtDLX2Dpw==} + engines: {node: '>= 18'} + + '@octokit/rest@20.1.1': + resolution: {integrity: sha512-MB4AYDsM5jhIHro/dq4ix1iWTLGToIGk6cWF5L6vanFaMble5jTX/UBQyiv05HsWnwUtY8JrfHy2LWfKwihqMw==} + engines: {node: '>= 18'} + + '@octokit/types@13.6.1': + resolution: {integrity: sha512-PHZE9Z+kWXb23Ndik8MKPirBPziOc0D2/3KH1P+6jK5nGWe96kadZuE4jev2/Jq7FvIfTlT2Ltg8Fv2x1v0a5g==} + '@open-wc/dedupe-mixin@1.4.0': resolution: {integrity: sha512-Sj7gKl1TLcDbF7B6KUhtvr+1UCxdhMbNY5KxdU5IfMFWqL8oy1ZeAcCANjoB1TL0AJTcPmcCFsCbHf8X2jGDUA==} @@ -5665,6 +7237,22 @@ packages: resolution: {integrity: sha512-cq8o4cWH0ibXh9VGi5P20Tu9XF/0fFXl9EUinr9QfTM7a7p0oTA4iJRCQWppXR1Pg8dSM0UCItCkPwsk9qWWYA==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} + '@pnpm/config.env-replace@1.1.0': + resolution: {integrity: sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==} + engines: {node: '>=12.22.0'} + + '@pnpm/network.ca-file@1.0.2': + resolution: {integrity: sha512-YcPQ8a0jwYU9bTdJDpXjMi7Brhkr1mXsXrUJvjqM2mQDgkRiz8jFaQGOdaLxgjtUfQgZhKy/O3cG/YwmgKaxLA==} + engines: {node: '>=12.22.0'} + + '@pnpm/npm-conf@2.3.1': + resolution: {integrity: sha512-c83qWb22rNRuB0UaVCI0uRPNRr8Z0FWnEIvT47jiHAmOIUHbBOg5XvV7pM5x+rKn9HRpjxquDbXYSXr3fAKFcw==} + engines: {node: '>=12'} + + '@polka/compression@1.0.0-next.25': + resolution: {integrity: sha512-UlVkoSGRig87riHSn8QOxd2DzGhadRpNSj5Ukqj+Bt7WTE4Es+sE3ju3OYbe8SiV2OwA+8tDcSuHWUh5S3jCBQ==} + engines: {node: '>=6'} + '@polka/url@1.0.0-next.23': resolution: {integrity: sha512-C16M+IYz0rgRhWZdCmK+h58JMv8vijAA61gmz2rspCSwKwzBebpdcsiUmwrtJRdphuY30i6BSLEOP8ppbNLyLg==} @@ -5677,6 +7265,220 @@ packages: '@popperjs/core@2.11.8': resolution: {integrity: sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==} + '@radix-ui/primitive@1.1.0': + resolution: {integrity: sha512-4Z8dn6Upk0qk4P74xBhZ6Hd/w0mPEzOOLxy4xiPXOXqjF7jZS0VAKk7/x/H6FyY2zCkYJqePf1G5KmkmNJ4RBA==} + + '@radix-ui/react-arrow@1.1.0': + resolution: {integrity: sha512-FmlW1rCg7hBpEBwFbjHwCW6AmWLQM6g/v0Sn8XbP9NvmSZ2San1FpQeyPtufzOMSIx7Y4dzjlHoifhp+7NkZhw==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@radix-ui/react-compose-refs@1.1.0': + resolution: {integrity: sha512-b4inOtiaOnYf9KWyO3jAeeCG6FeyfY6ldiEPanbUjWd+xIk5wZeHa8yVwmrJ2vderhu/BQvzCrJI0lHd+wIiqw==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/react-context@1.1.0': + resolution: {integrity: sha512-OKrckBy+sMEgYM/sMmqmErVn0kZqrHPJze+Ql3DzYsDDp0hl0L62nx/2122/Bvps1qz645jlcu2tD9lrRSdf8A==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/react-context@1.1.1': + resolution: {integrity: sha512-UASk9zi+crv9WteK/NU4PLvOoL3OuE6BWVKNF6hPRBtYBDXQ2u5iu3O59zUlJiTVvkyuycnqrztsHVJwcK9K+Q==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/react-dismissable-layer@1.1.1': + resolution: {integrity: sha512-QSxg29lfr/xcev6kSz7MAlmDnzbP1eI/Dwn3Tp1ip0KT5CUELsxkekFEMVBEoykI3oV39hKT4TKZzBNMbcTZYQ==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@radix-ui/react-icons@1.3.0': + resolution: {integrity: sha512-jQxj/0LKgp+j9BiTXz3O3sgs26RNet2iLWmsPyRz2SIcR4q/4SbazXfnYwbAr+vLYKSfc7qxzyGQA1HLlYiuNw==} + peerDependencies: + react: ^16.x || ^17.x || ^18.x + + '@radix-ui/react-id@1.1.0': + resolution: {integrity: sha512-EJUrI8yYh7WOjNOqpoJaf1jlFIH2LvtgAl+YcFqNCa+4hj64ZXmPkAKOFs/ukjz3byN6bdb/AVUqHkI8/uWWMA==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/react-popper@1.2.0': + resolution: {integrity: sha512-ZnRMshKF43aBxVWPWvbj21+7TQCvhuULWJ4gNIKYpRlQt5xGRhLx66tMp8pya2UkGHTSlhpXwmjqltDYHhw7Vg==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@radix-ui/react-portal@1.1.2': + resolution: {integrity: sha512-WeDYLGPxJb/5EGBoedyJbT0MpoULmwnIPMJMSldkuiMsBAv7N1cRdsTWZWht9vpPOiN3qyiGAtbK2is47/uMFg==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@radix-ui/react-presence@1.1.1': + resolution: {integrity: sha512-IeFXVi4YS1K0wVZzXNrbaaUvIJ3qdY+/Ih4eHFhWA9SwGR9UDX7Ck8abvL57C4cv3wwMvUE0OG69Qc3NCcTe/A==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@radix-ui/react-primitive@2.0.0': + resolution: {integrity: sha512-ZSpFm0/uHa8zTvKBDjLFWLo8dkr4MBsiDLz0g3gMUwqgLHz9rTaRRGYDgvZPtBJgYCBKXkS9fzmoySgr8CO6Cw==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@radix-ui/react-slot@1.1.0': + resolution: {integrity: sha512-FUCf5XMfmW4dtYl69pdS4DbxKy8nj4M7SafBgPllysxmdachynNflAdp/gCsnYWNDnge6tI9onzMp5ARYc1KNw==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/react-tooltip@1.1.3': + resolution: {integrity: sha512-Z4w1FIS0BqVFI2c1jZvb/uDVJijJjJ2ZMuPV81oVgTZ7g3BZxobplnMVvXtFWgtozdvYJ+MFWtwkM5S2HnAong==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@radix-ui/react-use-callback-ref@1.1.0': + resolution: {integrity: sha512-CasTfvsy+frcFkbXtSJ2Zu9JHpN8TYKxkgJGWbjiZhFivxaeW7rMeZt7QELGVLaYVfFMsKHjb7Ak0nMEe+2Vfw==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/react-use-controllable-state@1.1.0': + resolution: {integrity: sha512-MtfMVJiSr2NjzS0Aa90NPTnvTSg6C/JLCV7ma0W6+OMV78vd8OyRpID+Ng9LxzsPbLeuBnWBA1Nq30AtBIDChw==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/react-use-escape-keydown@1.1.0': + resolution: {integrity: sha512-L7vwWlR1kTTQ3oh7g1O0CBF3YCyyTj8NmhLR+phShpyA50HCfBFKVJTpshm9PzLiKmehsrQzTYTpX9HvmC9rhw==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/react-use-layout-effect@1.1.0': + resolution: {integrity: sha512-+FPE0rOdziWSrH9athwI1R0HDVbWlEhd+FR+aSDk4uWGmSJ9Z54sdZVDQPZAinJhJXwfT+qnj969mCsT2gfm5w==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/react-use-rect@1.1.0': + resolution: {integrity: sha512-0Fmkebhr6PiseyZlYAOtLS+nb7jLmpqTrJyv61Pe68MKYW6OWdRE2kI70TaYY27u7H0lajqM3hSMMLFq18Z7nQ==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/react-use-size@1.1.0': + resolution: {integrity: sha512-XW3/vWuIXHa+2Uwcc2ABSfcCledmXhhQPlGbfcRXbiUQI5Icjcg19BGCZVKKInYbvUCut/ufbbLLPFC5cbb1hw==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + + '@radix-ui/react-visually-hidden@1.1.0': + resolution: {integrity: sha512-N8MDZqtgCgG5S3aV60INAB475osJousYpZ4cTJ2cFbMpdHS5Y6loLTH8LPtkj2QN0x93J30HT/M3qJXM0+lyeQ==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + + '@radix-ui/rect@1.1.0': + resolution: {integrity: sha512-A9+lCBZoaMJlVKcRBz2YByCG+Cp2t6nAnMnNba+XiWxnj6r4JUFqfsgwocMBZU9LPtdxC6wB56ySYpc7LQIoJg==} + '@rc-component/color-picker@1.4.1': resolution: {integrity: sha512-vh5EWqnsayZa/JwUznqDaPJz39jznx/YDbyBuVJntv735tKXKwEUZZb2jYEldOg+NKWZwtALjGMrNeGBmqFoEw==} peerDependencies: @@ -5721,6 +7523,97 @@ packages: react: '>=16.9.0' react-dom: '>=16.9.0' + '@react-spring/animated@9.6.1': + resolution: {integrity: sha512-ls/rJBrAqiAYozjLo5EPPLLOb1LM0lNVQcXODTC1SMtS6DbuBCPaKco5svFUQFMP2dso3O+qcC4k9FsKc0KxMQ==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + + '@react-spring/animated@9.7.5': + resolution: {integrity: sha512-Tqrwz7pIlsSDITzxoLS3n/v/YCUHQdOIKtOJf4yL6kYVSDTSmVK1LI1Q3M/uu2Sx4X3pIWF3xLUhlsA6SPNTNg==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + + '@react-spring/core@9.6.1': + resolution: {integrity: sha512-3HAAinAyCPessyQNNXe5W0OHzRfa8Yo5P748paPcmMowZ/4sMfaZ2ZB6e5x5khQI8NusOHj8nquoutd6FRY5WQ==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + + '@react-spring/core@9.7.5': + resolution: {integrity: sha512-rmEqcxRcu7dWh7MnCcMXLvrf6/SDlSokLaLTxiPlAYi11nN3B5oiCUAblO72o+9z/87j2uzxa2Inm8UbLjXA+w==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + + '@react-spring/rafz@9.6.1': + resolution: {integrity: sha512-v6qbgNRpztJFFfSE3e2W1Uz+g8KnIBs6SmzCzcVVF61GdGfGOuBrbjIcp+nUz301awVmREKi4eMQb2Ab2gGgyQ==} + + '@react-spring/rafz@9.7.5': + resolution: {integrity: sha512-5ZenDQMC48wjUzPAm1EtwQ5Ot3bLIAwwqP2w2owG5KoNdNHpEJV263nGhCeKKmuA3vG2zLLOdu3or6kuDjA6Aw==} + + '@react-spring/shared@9.6.1': + resolution: {integrity: sha512-PBFBXabxFEuF8enNLkVqMC9h5uLRBo6GQhRMQT/nRTnemVENimgRd+0ZT4yFnAQ0AxWNiJfX3qux+bW2LbG6Bw==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + + '@react-spring/shared@9.7.5': + resolution: {integrity: sha512-wdtoJrhUeeyD/PP/zo+np2s1Z820Ohr/BbuVYv+3dVLW7WctoiN7std8rISoYoHpUXtbkpesSKuPIw/6U1w1Pw==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + + '@react-spring/three@9.6.1': + resolution: {integrity: sha512-Tyw2YhZPKJAX3t2FcqvpLRb71CyTe1GvT3V+i+xJzfALgpk10uPGdGaQQ5Xrzmok1340DAeg2pR/MCfaW7b8AA==} + peerDependencies: + '@react-three/fiber': '>=6.0' + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + three: '>=0.126' + + '@react-spring/types@9.6.1': + resolution: {integrity: sha512-POu8Mk0hIU3lRXB3bGIGe4VHIwwDsQyoD1F394OK7STTiX9w4dG3cTLljjYswkQN+hDSHRrj4O36kuVa7KPU8Q==} + + '@react-spring/types@9.7.5': + resolution: {integrity: sha512-HVj7LrZ4ReHWBimBvu2SKND3cDVUPWKLqRTmWe/fNY6o1owGOX0cAHbdPDTMelgBlVbrTKrre6lFkhqGZErK/g==} + + '@react-spring/web@9.7.5': + resolution: {integrity: sha512-lmvqGwpe+CSttsWNZVr+Dg62adtKhauGwLyGE/RRyZ8AAMLgb9x3NDMA5RMElXo+IMyTkPp7nxTB8ZQlmhb6JQ==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + + '@react-three/drei@9.112.1': + resolution: {integrity: sha512-2DFR7ChdgQTwDacJDmq7Oi4j7szkhHSd3h9Mu1NbJ06YYfBYzyxA/EDgCCWPgAdiV1b8SbrFeXXpJHoD65vC0Q==} + peerDependencies: + '@react-three/fiber': '>=8.0' + react: '>=18.0' + react-dom: '>=18.0' + three: '>=0.137' + peerDependenciesMeta: + react-dom: + optional: true + + '@react-three/fiber@8.17.7': + resolution: {integrity: sha512-52/TZ0pGdEtjs1bSCePrJe8+5hzYzC8/O4bwx0NXc3GZ3uRCr5Eu+CVsr7BUn2uxd825Zjbup0OXKSDRQ70qiQ==} + peerDependencies: + expo: '>=43.0' + expo-asset: '>=8.4' + expo-file-system: '>=11.0' + expo-gl: '>=11.0' + react: '>=18.0' + react-dom: '>=18.0' + react-native: '>=0.64' + three: '>=0.133' + peerDependenciesMeta: + expo: + optional: true + expo-asset: + optional: true + expo-file-system: + optional: true + expo-gl: + optional: true + react-dom: + optional: true + react-native: + optional: true + '@reactflow/background@11.3.14': resolution: {integrity: sha512-Gewd7blEVT5Lh6jqrvOgd4G6Qk17eGKQfsDXgyRSqM+CTwDqRldG2LsWN4sNeno6sbqVIC2fZ+rAUBFA9ZEUDA==} peerDependencies: @@ -5873,46 +7766,85 @@ packages: cpu: [x64] os: [win32] - '@sentry-internal/browser-utils@8.33.1': - resolution: {integrity: sha512-TW6/r+Gl5jiXv54iK1xZ3mlVgTS/jaBp4vcQ0xGMdgiQ3WchEPcFSeYovL+YHT3tSud0GZqVtDQCz+5i76puqA==} + '@sentry-internal/browser-utils@8.34.0': + resolution: {integrity: sha512-4AcYOzPzD1tL5eSRQ/GpKv5enquZf4dMVUez99/Bh3va8qiJrNP55AcM7UzZ7WZLTqKygIYruJTU5Zu2SpEAPQ==} engines: {node: '>=14.18'} - '@sentry-internal/feedback@8.33.1': - resolution: {integrity: sha512-qauMRTm3qDaLqZ3ibI03cj4gLF40y0ij65nj+cns6iWxGCtPrO8tjvXFWuQsE7Aye9dGMnBgmv7uN+NTUtC3RA==} + '@sentry-internal/feedback@8.34.0': + resolution: {integrity: sha512-aYSM2KPUs0FLPxxbJCFSwCYG70VMzlT04xepD1Y/tTlPPOja/02tSv2tyOdZbv8Uw7xslZs3/8Lhj74oYcTBxw==} engines: {node: '>=14.18'} - '@sentry-internal/replay-canvas@8.33.1': - resolution: {integrity: sha512-nsxTFTPCT10Ty/v6+AiST3+yotGP1sUb8xqfKB9fPnS1hZHFryp0NnEls7xFjBsBbZPU1GpFkzrk/E6JFzixDQ==} + '@sentry-internal/replay-canvas@8.34.0': + resolution: {integrity: sha512-x8KhZcCDpbKHqFOykYXiamX6x0LRxv6N1OJHoH+XCrMtiDBZr4Yo30d/MaS6rjmKGMtSRij30v+Uq+YWIgxUrg==} engines: {node: '>=14.18'} - '@sentry-internal/replay@8.33.1': - resolution: {integrity: sha512-fm4coIOjmanU29NOVN9MyaP4fUCOYytbtFqVSKRFNZQ/xAgNeySiBIbUd6IjujMmnOk9bY0WEUMcdm3Uotjdog==} + '@sentry-internal/replay@8.34.0': + resolution: {integrity: sha512-EoMh9NYljNewZK1quY23YILgtNdGgrkzJ9TPsj6jXUG0LZ0Q7N7eFWd0xOEDBvFxrmI3cSXF1i4d1sBb+eyKRw==} engines: {node: '>=14.18'} - '@sentry/browser@8.33.1': - resolution: {integrity: sha512-c6zI/igexkLwZuGk+u8Rj26ChjxGgkhe6ZbKFsXCYaKAp5ep5X7HQRkkqgbxApiqlC0LduHdd/ymzh139JLg8w==} + '@sentry/browser@8.34.0': + resolution: {integrity: sha512-3HHG2NXxzHq1lVmDy2uRjYjGNf9NsJsTPlOC70vbQdOb+S49EdH/XMPy+J3ruIoyv6Cu0LwvA6bMOM6rHZOgNQ==} engines: {node: '>=14.18'} - '@sentry/core@8.33.1': - resolution: {integrity: sha512-3SS41suXLFzxL3OQvTMZ6q92ZapELVq2l2SoWlZopcamWhog2Ru0dp2vkunq97kFHb2TzKRTlFH4+4gbT8SJug==} + '@sentry/core@8.34.0': + resolution: {integrity: sha512-adrXCTK/zsg5pJ67lgtZqdqHvyx6etMjQW3P82NgWdj83c8fb+zH+K79Z47pD4zQjX0ou2Ws5nwwi4wJbz4bfA==} engines: {node: '>=14.18'} - '@sentry/react@8.33.1': - resolution: {integrity: sha512-SsEX05xfcfOvo7/pK1UyeyTAYWH8iSIsXXlsjvnSRsbuJkjb0c+q6yiZpj3A2PRdbcx43nTVE1n0lSpgaqj2HA==} + '@sentry/react@8.34.0': + resolution: {integrity: sha512-gIgzhj7h67C+Sdq2ul4fOSK142Gf0uV99bqHRdtIiUlXw9yjzZQY5TKTtzbOaevn7qBJ0xrRKtIRUbOBMl0clw==} engines: {node: '>=14.18'} peerDependencies: react: ^16.14.0 || 17.x || 18.x || 19.x - '@sentry/types@8.33.1': - resolution: {integrity: sha512-GjoAMvwtpIemoF/IiwZ7A60g4nQv3qwzR21GvJqDVUoKD0e8pv9OLX+HyXoUat4wEDGSuDUcUyUKD2G+od73QA==} + '@sentry/types@8.34.0': + resolution: {integrity: sha512-zLRc60CzohGCo6zNsNeQ9JF3SiEeRE4aDCP9fDDdIVCOKovS+mn1rtSip0qd0Vp2fidOu0+2yY0ALCz1A3PJSQ==} engines: {node: '>=14.18'} - '@sentry/utils@8.33.1': - resolution: {integrity: sha512-uzuYpiiJuFY3N4WNHMBWUQX5oNv2t/TbG0OHRp3Rr7yeu+HSfD542TIp9/gMZ+G0Cxd8AmVO3wkKIFbk0TL4Qg==} + '@sentry/utils@8.34.0': + resolution: {integrity: sha512-W1KoRlFUjprlh3t86DZPFxLfM6mzjRzshVfMY7vRlJFymBelJsnJ3A1lPeBZM9nCraOSiw6GtOWu6k5BAkiGIg==} engines: {node: '>=14.18'} - '@shikijs/core@1.14.1': - resolution: {integrity: sha512-KyHIIpKNaT20FtFPFjCQB5WVSTpLR/n+jQXhWHWVUMm9MaOaG9BGOG0MSyt7yA4+Lm+4c9rTc03tt3nYzeYSfw==} + '@shikijs/core@1.22.0': + resolution: {integrity: sha512-S8sMe4q71TJAW+qG93s5VaiihujRK6rqDFqBnxqvga/3LvqHEnxqBIOPkt//IdXVtHkQWKu4nOQNk0uBGicU7Q==} + + '@shikijs/core@1.24.2': + resolution: {integrity: sha512-BpbNUSKIwbKrRRA+BQj0BEWSw+8kOPKDJevWeSE/xIqGX7K0xrCZQ9kK0nnEQyrzsUoka1l81ZtJ2mGaCA32HQ==} + + '@shikijs/engine-javascript@1.22.0': + resolution: {integrity: sha512-AeEtF4Gcck2dwBqCFUKYfsCq0s+eEbCEbkUuFou53NZ0sTGnJnJ/05KHQFZxpii5HMXbocV9URYVowOP2wH5kw==} + + '@shikijs/engine-javascript@1.24.2': + resolution: {integrity: sha512-EqsmYBJdLEwEiO4H+oExz34a5GhhnVp+jH9Q/XjPjmBPc6TE/x4/gD0X3i0EbkKKNqXYHHJTJUpOLRQNkEzS9Q==} + + '@shikijs/engine-oniguruma@1.22.0': + resolution: {integrity: sha512-5iBVjhu/DYs1HB0BKsRRFipRrD7rqjxlWTj4F2Pf+nQSPqc3kcyqFFeZXnBMzDf0HdqaFVvhDRAGiYNvyLP+Mw==} + + '@shikijs/engine-oniguruma@1.24.2': + resolution: {integrity: sha512-ZN6k//aDNWRJs1uKB12pturKHh7GejKugowOFGAuG7TxDRLod1Bd5JhpOikOiFqPmKjKEPtEA6mRCf7q3ulDyQ==} + + '@shikijs/markdown-it@1.22.0': + resolution: {integrity: sha512-IAWi2pbzYndiuXOWnV5Ll4ULQJeWl45WUACl1Xc2KSiBl0JtQmqKvPOGKN7YSZbyIzkB6bWUItRrv5ucO35U+g==} + + '@shikijs/transformers@1.22.0': + resolution: {integrity: sha512-k7iMOYuGQA62KwAuJOQBgH2IQb5vP8uiB3lMvAMGUgAMMurePOx3Z7oNqJdcpxqZP6I9cc7nc4DNqSKduCxmdg==} + + '@shikijs/types@1.22.0': + resolution: {integrity: sha512-Fw/Nr7FGFhlQqHfxzZY8Cwtwk5E9nKDUgeLjZgt3UuhcM3yJR9xj3ZGNravZZok8XmEZMiYkSMTPlPkULB8nww==} + + '@shikijs/types@1.24.2': + resolution: {integrity: sha512-bdeWZiDtajGLG9BudI0AHet0b6e7FbR0EsE4jpGaI0YwHm/XJunI9+3uZnzFtX65gsyJ6ngCIWUfA4NWRPnBkQ==} + + '@shikijs/vscode-textmate@9.3.0': + resolution: {integrity: sha512-jn7/7ky30idSkd/O5yDBfAnVt+JJpepofP/POZ1iMOxK59cOfqIgg/Dj0eFsjOTMw+4ycJN0uhZH/Eb0bs/EUA==} + + '@sideway/address@4.1.5': + resolution: {integrity: sha512-IqO/DUQHUkPeixNQ8n0JA6102hT9CmaljNTPmQ1u8MEhBo/R4Q8eKLN/vGZxuebwOroDB4cbpjheD4+/sKFK4Q==} + + '@sideway/formula@3.0.1': + resolution: {integrity: sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==} + + '@sideway/pinpoint@2.0.0': + resolution: {integrity: sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==} '@simonwep/pickr@1.8.2': resolution: {integrity: sha512-/l5w8BIkrpP6n1xsetx9MWPWlU6OblN5YgZZphxan0Tq4BByTCETL6lyIeY8lagalS2Nbt4F2W034KHLIiunKA==} @@ -5927,12 +7859,27 @@ packages: resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} engines: {node: '>=10'} + '@sindresorhus/is@5.6.0': + resolution: {integrity: sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g==} + engines: {node: '>=14.16'} + '@sinonjs/commons@3.0.1': resolution: {integrity: sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==} '@sinonjs/fake-timers@10.3.0': resolution: {integrity: sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==} + '@slorber/react-ideal-image@0.0.12': + resolution: {integrity: sha512-u8KiDTEkMA7/KAeA5ywg/P7YG4zuKhWtswfVZDH8R8HXgQsFcHIYU2WaQnGuK/Du7Wdj90I+SdFmajSGFRvoKA==} + engines: {node: '>= 8.9.0', npm: '> 3'} + peerDependencies: + prop-types: '>=15' + react: '>=0.14.x' + react-waypoint: '>=9.0.2' + + '@slorber/remark-comment@1.0.0': + resolution: {integrity: sha512-RCE24n7jsOj1M0UPvIQCHTe7fI0sFL4S2nwKVWwHyVr/wI/H8GosgsJGyhnsZoGFnD/P2hLf1mSbrrgSLN93NA==} + '@solidjs/router@0.10.3': resolution: {integrity: sha512-UZyUcGbMzeJWCJZthWfveFbv9FyMLi62+BHpXyVwAYpowHaUkkV3WVKoYxYF9m47fVG23UfUo2S6GbuyPAyCjw==} peerDependencies: @@ -5948,6 +7895,11 @@ packages: engines: {node: '>=16.0.0', npm: '>=7.10.0'} hasBin: true + '@stitches/react@1.2.8': + resolution: {integrity: sha512-9g9dWI4gsSVe8bNLlb+lMkBYsnIKCZTmvqvDG+Avnn69XfmHZKiaMrx7cgTaddq7aTPPmXiTsbFcUy0xgI4+wA==} + peerDependencies: + react: '>= 16.3.0' + '@sveltejs/vite-plugin-svelte-inspector@3.0.1': resolution: {integrity: sha512-2CKypmj1sM4GE7HjllT7UKmo4Q6L5xFRd7VMGEWhYnZ+wc6AUVU01IBd7yUi6WnFndEwWoMNOd6e8UjoN0nbvQ==} engines: {node: ^18.0.0 || ^20.0.0 || >=22} @@ -5956,8 +7908,8 @@ packages: svelte: ^5.0.0-next.96 || ^5.0.0 vite: ^5.0.0 - '@sveltejs/vite-plugin-svelte@4.0.3': - resolution: {integrity: sha512-J7nC5gT5qpmvyD2pmzPUntLUgoinyEaNy9sTpGGE6N7pblggO0A1NyneJJvR2ELlzK6ti28aF2SLXG1yJdnJeA==} + '@sveltejs/vite-plugin-svelte@4.0.1': + resolution: {integrity: sha512-prXoAE/GleD2C4pKgHa9vkdjpzdYwCSw/kmjw6adIyu0vk5YKCfqIztkLg10m+kOYnzZu3bb0NaPTxlWre2a9Q==} engines: {node: ^18.0.0 || ^20.0.0 || >=22} peerDependencies: svelte: ^5.0.0-next.96 || ^5.0.0 @@ -6031,6 +7983,85 @@ packages: peerDependencies: '@svgr/core': '*' + '@svgr/plugin-svgo@8.1.0': + resolution: {integrity: sha512-Ywtl837OGO9pTLIN/onoWLmDQ4zFUycI1g76vuKGEz6evR/ZTJlJuz3G/fIkb6OVBJ2g0o6CGJzaEjfmEo3AHA==} + engines: {node: '>=14'} + peerDependencies: + '@svgr/core': '*' + + '@svgr/webpack@8.1.0': + resolution: {integrity: sha512-LnhVjMWyMQV9ZmeEy26maJk+8HTIbd59cH4F2MJ439k9DqejRisfFNGAPvRYlKETuh9LrImlS8aKsBgKjMA8WA==} + engines: {node: '>=14'} + + '@swc/core-darwin-arm64@1.7.26': + resolution: {integrity: sha512-FF3CRYTg6a7ZVW4yT9mesxoVVZTrcSWtmZhxKCYJX9brH4CS/7PRPjAKNk6kzWgWuRoglP7hkjQcd6EpMcZEAw==} + engines: {node: '>=10'} + cpu: [arm64] + os: [darwin] + + '@swc/core-darwin-x64@1.7.26': + resolution: {integrity: sha512-az3cibZdsay2HNKmc4bjf62QVukuiMRh5sfM5kHR/JMTrLyS6vSw7Ihs3UTkZjUxkLTT8ro54LI6sV6sUQUbLQ==} + engines: {node: '>=10'} + cpu: [x64] + os: [darwin] + + '@swc/core-linux-arm-gnueabihf@1.7.26': + resolution: {integrity: sha512-VYPFVJDO5zT5U3RpCdHE5v1gz4mmR8BfHecUZTmD2v1JeFY6fv9KArJUpjrHEEsjK/ucXkQFmJ0jaiWXmpOV9Q==} + engines: {node: '>=10'} + cpu: [arm] + os: [linux] + + '@swc/core-linux-arm64-gnu@1.7.26': + resolution: {integrity: sha512-YKevOV7abpjcAzXrhsl+W48Z9mZvgoVs2eP5nY+uoMAdP2b3GxC0Df1Co0I90o2lkzO4jYBpTMcZlmUXLdXn+Q==} + engines: {node: '>=10'} + cpu: [arm64] + os: [linux] + + '@swc/core-linux-arm64-musl@1.7.26': + resolution: {integrity: sha512-3w8iZICMkQQON0uIcvz7+Q1MPOW6hJ4O5ETjA0LSP/tuKqx30hIniCGOgPDnv3UTMruLUnQbtBwVCZTBKR3Rkg==} + engines: {node: '>=10'} + cpu: [arm64] + os: [linux] + + '@swc/core-linux-x64-gnu@1.7.26': + resolution: {integrity: sha512-c+pp9Zkk2lqb06bNGkR2Looxrs7FtGDMA4/aHjZcCqATgp348hOKH5WPvNLBl+yPrISuWjbKDVn3NgAvfvpH4w==} + engines: {node: '>=10'} + cpu: [x64] + os: [linux] + + '@swc/core-linux-x64-musl@1.7.26': + resolution: {integrity: sha512-PgtyfHBF6xG87dUSSdTJHwZ3/8vWZfNIXQV2GlwEpslrOkGqy+WaiiyE7Of7z9AvDILfBBBcJvJ/r8u980wAfQ==} + engines: {node: '>=10'} + cpu: [x64] + os: [linux] + + '@swc/core-win32-arm64-msvc@1.7.26': + resolution: {integrity: sha512-9TNXPIJqFynlAOrRD6tUQjMq7KApSklK3R/tXgIxc7Qx+lWu8hlDQ/kVPLpU7PWvMMwC/3hKBW+p5f+Tms1hmA==} + engines: {node: '>=10'} + cpu: [arm64] + os: [win32] + + '@swc/core-win32-ia32-msvc@1.7.26': + resolution: {integrity: sha512-9YngxNcG3177GYdsTum4V98Re+TlCeJEP4kEwEg9EagT5s3YejYdKwVAkAsJszzkXuyRDdnHUpYbTrPG6FiXrQ==} + engines: {node: '>=10'} + cpu: [ia32] + os: [win32] + + '@swc/core-win32-x64-msvc@1.7.26': + resolution: {integrity: sha512-VR+hzg9XqucgLjXxA13MtV5O3C0bK0ywtLIBw/+a+O+Oc6mxFWHtdUeXDbIi5AiPbn0fjgVJMqYnyjGyyX8u0w==} + engines: {node: '>=10'} + cpu: [x64] + os: [win32] + + '@swc/core@1.7.26': + resolution: {integrity: sha512-f5uYFf+TmMQyYIoxkn/evWhNGuUzC730dFwAKGwBVHHVoPyak1/GvJUm6i1SKl+2Hrj9oN0i3WSoWWZ4pgI8lw==} + engines: {node: '>=10'} + peerDependencies: + '@swc/helpers': '*' + peerDependenciesMeta: + '@swc/helpers': + optional: true + '@swc/counter@0.1.3': resolution: {integrity: sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==} @@ -6040,6 +8071,9 @@ packages: '@swc/plugin-emotion@3.0.9': resolution: {integrity: sha512-kPvC306/1FBZ4yiOhjm3EDErI4eWJQrNa8bFCDzmHvFW1zokoyRQazzYVterVPsweepmEdftrPRLoB3pQHfo1A==} + '@swc/types@0.1.12': + resolution: {integrity: sha512-wBJA+SdtkbFhHjTMYH+dEH1y4VpfGdAc2Kw/LK09i9bXd/K6j6PkDcFCEzb6iVfZMkPRrl/q0e3toqTAJdkIVA==} + '@sxzz/popperjs-es@2.11.7': resolution: {integrity: sha512-Ccy0NlLkzr0Ex2FKvh2X+OyERHXJ88XJ1MXtsI9y9fGexlaXaVTPzBCRBwIxFkORuOb+uBqeu+RqnpgYTEZRUQ==} @@ -6047,6 +8081,18 @@ packages: resolution: {integrity: sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==} engines: {node: '>=10'} + '@szmarczak/http-timer@5.0.1': + resolution: {integrity: sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw==} + engines: {node: '>=14.16'} + + '@tabler/icons-react@3.19.0': + resolution: {integrity: sha512-AqEWGI0tQWgqo6ZjMO5yJ9sYT8oXLuAM/up0hN9iENS6IdtNZryKrkNSiMgpwweNTpl8wFFG/dAZ959S91A/uQ==} + peerDependencies: + react: '>= 16' + + '@tabler/icons@3.19.0': + resolution: {integrity: sha512-A4WEWqpdbTfnpFEtwXqwAe9qf9sp1yRPvzppqAuwcoF0q5YInqB+JkJtSFToCyBpPVeLxJUxxkapLvt2qQgnag==} + '@tailwindcss/node@4.0.0-beta.8': resolution: {integrity: sha512-ZbicJgFxo83IIH5eBm7CU3K1olsfud7/zg3+yG7P6+fZiufhh8FllM5QOJVxUEJ5zeB1V94Y+hTq5UOfu8ZloA==} @@ -6494,9 +8540,15 @@ packages: '@turf/voronoi@6.5.0': resolution: {integrity: sha512-C/xUsywYX+7h1UyNqnydHXiun4UPjK88VDghtoRypR9cLlb7qozkiLRphQxxsCM0KxyxpVPHBVQXdAL3+Yurow==} + '@tweenjs/tween.js@23.1.3': + resolution: {integrity: sha512-vJmvvwFxYuGnF2axRtPYocag6Clbb5YS7kLL+SO/TeVFzHqDIWrNKYtcsPMibjDx9O+bu+psAy9NKfWklassUA==} + '@types/accepts@1.3.6': resolution: {integrity: sha512-6+qlUg57yfE9OO63wnsJXLeq9cG3gSHBBIxNMOjNrbDRlDnm/NaR7RctfYcVCPq+j7d+MwOxqVEludH5+FKrlg==} + '@types/acorn@4.0.6': + resolution: {integrity: sha512-veQTnWP+1D/xbxVrPC3zHnCZRjSrKfhbMUlEA43iMZLu7EsnTtkJklIuwrCPbOi8YkvDQAiW05VQQFvvz9oieQ==} + '@types/babel__core@7.20.3': resolution: {integrity: sha512-54fjTSeSHwfan8AyHWrKbfBWiEUrNTZsUwPTDSNaaP1QDQIZbeNUg3a59E9D+375MzUw/x1vx2/0F5LBz+AeYA==} @@ -6515,6 +8567,9 @@ packages: '@types/body-parser@1.19.4': resolution: {integrity: sha512-N7UDG0/xiPQa2D/XrVJXjkWbpqHCd2sBaB32ggRF2l83RhPfamgKGF8gwwqyksS95qUS5ZYF9aF+lLPRlwI2UA==} + '@types/bonjour@3.5.13': + resolution: {integrity: sha512-z9fJ5Im06zvUL548KvYNecEVlA7cVDkGUi6kZusb04mpyEFKCIZJvloCcmpmLaIahDpOQGHaHmG6imtPMmPXGQ==} + '@types/cacheable-request@6.0.3': resolution: {integrity: sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==} @@ -6531,8 +8586,14 @@ packages: '@types/color@3.0.6': resolution: {integrity: sha512-NMiNcZFRUAiUUCCf7zkAelY8eV3aKqfbzyFQlXpPIEeoNDbsEHGpb854V3gzTsGKYj830I5zPuOwU/TP5/cW6A==} - '@types/connect@3.4.37': - resolution: {integrity: sha512-zBUSRqkfZ59OcwXon4HVxhx5oWCJmc0OtBTK05M+p0dYjgN6iTwIL2T/WbsQZrEsdnwaF9cWQ+azOnpPvIqY3Q==} + '@types/compression@1.7.5': + resolution: {integrity: sha512-AAQvK5pxMpaT+nDvhHrsBhLSYG5yQdtkaJE1WYieSNY2mVFKAgmU4ks65rkZD5oqnGCFLyQpUr1CqI4DmUMyDg==} + + '@types/connect-history-api-fallback@1.5.4': + resolution: {integrity: sha512-n6Cr2xS1h4uAulPRdlw6Jl6s1oG8KrVilPN2yUITEs+K48EzMJJ3W1xy8K5eWuFvjp3R74AOIGSmp2UfBJ8HFw==} + + '@types/connect@3.4.38': + resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==} '@types/content-disposition@0.5.7': resolution: {integrity: sha512-V9/5u21RHFR1zfdm3rQ6pJUKV+zSSVQt+yq16i1YhdivVzWgPEoKedc3GdT8aFjsqQbakdxuy3FnEdePUQOamQ==} @@ -6543,8 +8604,8 @@ packages: '@types/cookies@0.7.9': resolution: {integrity: sha512-SrGYvhKohd/WSOII0WpflC73RgdJhQoqpwq9q+n/qugNGiDSGYXfHy3QvB4+X+J/gYe27j2fSRnK4B+1A3nvsw==} - '@types/cross-spawn@6.0.4': - resolution: {integrity: sha512-GGLpeThc2Bu8FBGmVn76ZU3lix17qZensEI4/MPty0aZpm2CHfgEMis31pf5X5EiudYKcPAsWciAsCALoPo5dw==} + '@types/cors@2.8.17': + resolution: {integrity: sha512-8CGDvrBj1zgo2qE+oS3pOCyYNqCPryMWY2bGfwA0dcfopWGgxs+78df0Rs3rc9THP4JkOhLsAa+15VdpAqkcUA==} '@types/d3-array@3.2.1': resolution: {integrity: sha512-Y2Jn2idRrLzUfAKV2LyRImR+y4oa2AntrgID95SHJxuMUrkNXmanDSed71sRNZysveJVt1hLLemQZIady0FpEg==} @@ -6609,14 +8670,14 @@ packages: '@types/d3-random@3.0.3': resolution: {integrity: sha512-Imagg1vJ3y76Y2ea0871wpabqp613+8/r0mCLEBfdtqC7xMSfj9idOnmBYyMoULfHePJyxMAw3nWhJxzc+LFwQ==} - '@types/d3-scale-chromatic@3.0.3': - resolution: {integrity: sha512-laXM4+1o5ImZv3RpFAsTRn3TEkzqkytiOY0Dz0sq5cnd1dtNlk6sHLon4OvqaiJb28T0S/TdsBI3Sjsy+keJrw==} + '@types/d3-scale-chromatic@3.1.0': + resolution: {integrity: sha512-iWMJgwkK7yTRmWqRB5plb1kadXyQ5Sj8V/zYlFGMUBbIPKQScw+Dku9cAAMgJG+z5GYDoMjWGLVOvjghDEFnKQ==} '@types/d3-scale@4.0.8': resolution: {integrity: sha512-gkK1VVTr5iNiYJ7vWDI+yUFFlszhNMtVeneJ6lUTKPjprsvLLI9/tgEGiXJOnlINJA8FyA88gfnQsHbybVZrYQ==} - '@types/d3-selection@3.0.10': - resolution: {integrity: sha512-cuHoUgS/V3hLdjJOLTT691+G2QoqAjCVLmr4kJXR4ha56w1Zdu8UUQ5TxLRqudgNjwXeQxKMq4j+lyf9sWuslg==} + '@types/d3-selection@3.0.11': + resolution: {integrity: sha512-bhAXu23DJWsrI45xafYpkQ4NtcKMwWnAC/vKrd2l+nxMFuvOT3XMYTIj2opv8vq8AO5Yh7Qac/nSeP/3zjTK0w==} '@types/d3-shape@3.1.6': resolution: {integrity: sha512-5KKk5aKGu2I+O6SONMYSNflgiP0WfZIQvVUMan50wHsLG1G94JlxEVnCpQARfTtzytuY0p/9PXXZb3I7giofIA==} @@ -6624,14 +8685,17 @@ packages: '@types/d3-time-format@4.0.3': resolution: {integrity: sha512-5xg9rC+wWL8kdDj153qZcsJ0FWiFt0J5RB6LYUNZjwSnesfblqrI/bJ1wBdJ8OQfncgbJG5+2F+qfqnqyzYxyg==} - '@types/d3-time@3.0.3': - resolution: {integrity: sha512-2p6olUZ4w3s+07q3Tm2dbiMZy5pCDfYwtLXXHUnVzXgQlZ/OyPtUz6OL382BkOuGlLXqfT+wqv8Fw2v8/0geBw==} + '@types/d3-time@3.0.4': + resolution: {integrity: sha512-yuzZug1nkAAaBlBBikKZTgzCeA+k1uy4ZFwWANOfKw5z5LRhV0gNA7gNkKm7HoK+HRN0wX3EkxGk0fpbWhmB7g==} '@types/d3-timer@2.0.2': resolution: {integrity: sha512-Dz39VLKZhWWeqSqbgYKF5BDJDUiPITo9M2cev/+HQBvXs+biES2d3LndnopuJ5YwaKK1h56CPWqDB+ghUXhm9A==} - '@types/d3-transition@3.0.8': - resolution: {integrity: sha512-ew63aJfQ/ms7QQ4X7pk5NxQ9fZH/z+i24ZfJ6tJSfqxJMrYLiK01EAs2/Rtw/JreGUsS3pLPNV644qXFGnoZNQ==} + '@types/d3-timer@3.0.2': + resolution: {integrity: sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw==} + + '@types/d3-transition@3.0.9': + resolution: {integrity: sha512-uZS5shfxzO3rGlu0cC3bjmMFKsXv+SmZZcgp0KD22ts4uGXp5EVYGzu/0YdwZeKmddhcAccYtREJKkPfXkZuCg==} '@types/d3-zoom@3.0.8': resolution: {integrity: sha512-iqMC4/YlFCSlO8+2Ii1GGGliCAY4XdeG748w5vQUbevlbDu0zSjH/+jojorQVBK/se0j6DUFNPBGSqD3YWYnDw==} @@ -6639,18 +8703,30 @@ packages: '@types/d3@7.4.3': resolution: {integrity: sha512-lZXZ9ckh5R8uiFVt8ogUNf+pIrK4EsWrx2Np75WvF/eTpJ0FMHNhjXk8CKEx/+gpHbNQyJWehbFaTvqmHWB3ww==} + '@types/debounce@1.2.4': + resolution: {integrity: sha512-jBqiORIzKDOToaF63Fm//haOCHuwQuLa2202RK4MozpA6lh93eCBc+/8+wZn5OzjJt3ySdc+74SXWXB55Ewtyw==} + '@types/debug@4.1.12': resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==} + '@types/draco3d@1.4.10': + resolution: {integrity: sha512-AX22jp8Y7wwaBgAixaSvkoG4M/+PlAcm3Qs4OW8yT9DM4xUpWKeFhLueTAyZF39pviAdcDdeJoACapiAceqNcw==} + '@types/envinfo@7.8.3': resolution: {integrity: sha512-qzV1XMjmzgmndci6L5HlzExf4w9A5jQPNpW/t4sSljErKbS8y6231ToHO9ir2Xjf+2zG1C540+Wmh0zpUsGu0A==} + '@types/escape-html@1.0.4': + resolution: {integrity: sha512-qZ72SFTgUAZ5a7Tj6kf2SHLetiH5S6f8G5frB2SPQ3EyF02kxdyBFf4Tz4banE3xCgGnKgWLt//a6VuYHKYJTg==} + '@types/eslint-scope@3.7.7': resolution: {integrity: sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==} '@types/eslint@8.56.10': resolution: {integrity: sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==} + '@types/estree-jsx@1.0.5': + resolution: {integrity: sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==} + '@types/estree@1.0.4': resolution: {integrity: sha512-2JwWnHK9H+wUZNorf2Zr6ves96WHoWDJIftkcxPKsS7Djta6Zu519LarhRNljPXkpsZR2ZMwNCPeW7omW07BJw==} @@ -6660,18 +8736,27 @@ packages: '@types/estree@1.0.6': resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} + '@types/etag@1.8.3': + resolution: {integrity: sha512-QYHv9Yeh1ZYSMPQOoxY4XC4F1r+xRUiAriB303F4G6uBsT3KKX60DjiogvVv+2VISVDuJhcIzMdbjT+Bm938QQ==} + '@types/express-serve-static-core@4.17.39': resolution: {integrity: sha512-BiEUfAiGCOllomsRAZOiMFP7LAnrifHpt56pc4Z7l9K6ACyN06Ns1JLMBxwkfLOjJRlSf06NwWsT7yzfpaVpyQ==} '@types/express@4.17.21': resolution: {integrity: sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==} + '@types/figlet@1.7.0': + resolution: {integrity: sha512-KwrT7p/8Eo3Op/HBSIwGXOsTZKYiM9NpWRBJ5sVjWP/SmlS+oxxRvJht/FNAtliJvja44N3ul1yATgohnVBV0Q==} + '@types/fs-extra@11.0.3': resolution: {integrity: sha512-sF59BlXtUdzEAL1u0MSvuzWd7PdZvZEtnaVkzX5mjpdWTJ8brG0jUqve3jPCzSzvAKKMHTG8F8o/WMQLtleZdQ==} '@types/fs-extra@9.0.13': resolution: {integrity: sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==} + '@types/geojson@7946.0.15': + resolution: {integrity: sha512-9oSxFzDCT2Rj6DfcHF8G++jxBKS7mBqXl5xrRW+Kbvjry6Uduya2iiwqHPhVXpasAVMBYKkEPGgKhd3+/HZ6xA==} + '@types/geojson@7946.0.8': resolution: {integrity: sha512-1rkryxURpr6aWP7R786/UQOkJ3PcpQiWkAXBmdWc7ryFWqN6a4xfK7BtjXvFBKO9LjQ+MWQSWxYeZX1OApnArA==} @@ -6681,15 +8766,24 @@ packages: '@types/graceful-fs@4.1.9': resolution: {integrity: sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==} + '@types/gtag.js@0.0.12': + resolution: {integrity: sha512-YQV9bUsemkzG81Ea295/nF/5GijnD2Af7QhEofh7xu+kvCN6RdodgNwwGWXB5GMI3NoyvQo0odNctoH/qLMIpg==} + '@types/hast@2.3.10': resolution: {integrity: sha512-McWspRw8xx8J9HurkVBfYj0xKoE25tOFlHGdx4MJ5xORQrMGZNqJhVQWaIbm6Oyla5kYOXtDiopzKRJzEOkwJw==} '@types/hast@3.0.4': resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==} + '@types/history@4.7.11': + resolution: {integrity: sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA==} + '@types/hoist-non-react-statics@3.3.4': resolution: {integrity: sha512-ZchYkbieA+7tnxwX/SCBySx9WwvWR8TaP5tb2jRAzwvLb/rWchGw3v0w3pqUbUvj0GCwW2Xz/AVPSk6kUGctXQ==} + '@types/html-minifier-terser@6.1.0': + resolution: {integrity: sha512-oh/6byDPnL1zeNXFrDXFLyZjkr1MsBG667IM792caf1L2UPOOMf65NFzjUH/ltyfwjAGfs1rsX1eftK0jC/KIg==} + '@types/http-assert@1.5.4': resolution: {integrity: sha512-/6M9aaVk+avzCsrv1lt39AlFw4faCNI6aGll91Rxj38ZE5JI8AxApyQIRy+i1McjiJiuQ0sfuoMLxqq374ZIbA==} @@ -6702,12 +8796,6 @@ packages: '@types/http-proxy@1.17.14': resolution: {integrity: sha512-SSrD0c1OQzlFX7pGu1eXxSEjemej64aaNPRhhVYUGqXh0BtldAAx37MG8btcumvpgKyZp1F5Gn3JkktdxiFv6w==} - '@types/inquirer@9.0.6': - resolution: {integrity: sha512-1Go1AAP/yOy3Pth5Xf1DC3nfZ03cJLCPx6E2YnSN/5I3w1jHBVH4170DkZ+JxfmA7c9kL9+bf9z3FRGa4kNAqg==} - - '@types/is-ci@3.0.3': - resolution: {integrity: sha512-FdHbjLiN2e8fk9QYQyVYZrK8svUDJpxSaSWLUga8EZS1RGAvvrqM9zbVARBtQuYPeLgnJxM2xloOswPwj1o2cQ==} - '@types/istanbul-lib-coverage@2.0.5': resolution: {integrity: sha512-zONci81DZYCZjiLe0r6equvZut0b+dBRPBN5kBDjsONnutYNtJMoWQ9uR2RkL1gLG9NMTzvf+29e5RFfPbeKhQ==} @@ -6747,21 +8835,9 @@ packages: '@types/koa-compose@3.2.7': resolution: {integrity: sha512-smtvSL/oLICPuenxy73OmxKGh42VVfn2o2eutReH1yjij0LmxADBpGcAJbp4N+yJjPapPN7jAX9p7Ue0JMQ/Ag==} - '@types/koa-compress@4.0.5': - resolution: {integrity: sha512-RmBhY5nFRd4R/d/beyQskeL0Gt/N8epJIAKie6nYpRumLXM0bS8J/35TJ5bYAPiwxLCN+xNzlfS2aED3+ifQZg==} - - '@types/koa-send@4.1.5': - resolution: {integrity: sha512-O2qnxAKr7MoAxHHUitJejMWw45b9QtgTra0pnVDl/XoNdYTdZOgwj8wSVDon0qXg/lrcYHye4LFbAaSfSWwnrg==} - - '@types/koa-static@4.0.3': - resolution: {integrity: sha512-4U9uZwXqYAudDLDVkw1prJM5avn9/lHLVEwoyyI/ITZluWkBdmirkj8EsOLG6kLr0XFZdViR0ZBtQ3oetSsr3g==} - '@types/koa@2.13.10': resolution: {integrity: sha512-weKc5IBeORLDGwD1FMgPjaZIg0/mtP7KxXAXEzPRCN78k274D9U2acmccDNPL1MwyV40Jj+hQQ5N2eaV6O0z8g==} - '@types/koa__cors@5.0.0': - resolution: {integrity: sha512-LCk/n25Obq5qlernGOK/2LUwa/2YJb2lxHUkkvYFDOpLXlVI6tKcdfCHRBQnOY4LwH6el5WOLs6PD/a8Uzau6g==} - '@types/less@3.0.5': resolution: {integrity: sha512-OdhItUN0/Cx9+sWumdb3dxASoA0yStnZahvKcaSQmSR5qd7hZ6zhSriSQGUU3F8GkzFpIILKzut4xn9/GvhusA==} @@ -6777,9 +8853,18 @@ packages: '@types/mdast@3.0.15': resolution: {integrity: sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ==} + '@types/mdast@4.0.4': + resolution: {integrity: sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==} + + '@types/mdx@2.0.13': + resolution: {integrity: sha512-+OWZQfAYyio6YkJb3HLxDrvnx6SWWDbC0zVPfBRzUk0/nqoDyf6dNxQi3eArPe8rJ473nobTMQ/8Zk+LxJ+Yuw==} + '@types/methods@1.1.4': resolution: {integrity: sha512-ymXWVrDiCxTBE3+RIrrP533E70eA+9qu7zdWoHuOmGujkYtzf4HQF96b8nwHLqhuf4ykX61IGRIB38CC6/sImQ==} + '@types/mime-types@2.1.4': + resolution: {integrity: sha512-lfU4b34HOri+kAY5UheuFMWPDOI+OPceBSHZKp69gEyTL/mmJ4cnU6Y/rlme3UL3GyOn6Y42hyIEw0/q8sWx5w==} + '@types/mime@1.3.4': resolution: {integrity: sha512-1Gjee59G25MrQGk8bsNvC6fxNiRgUlGn2wlhGf95a59DrprnnHk80FIMMFG9XHMdrfsuA119ht06QPDXA1Z7tw==} @@ -6795,6 +8880,9 @@ packages: '@types/ms@0.7.34': resolution: {integrity: sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==} + '@types/node-forge@1.3.11': + resolution: {integrity: sha512-FQx220y22OKNTqaByeBGqHWYz4cl94tpcxeFdvBo3wjG6XPBuZ0BNgNZRV5J5TFmmcsJ4IzsLkmGRiQbnYsBEQ==} + '@types/node@12.20.55': resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} @@ -6816,6 +8904,9 @@ packages: '@types/object-path@0.11.4': resolution: {integrity: sha512-4tgJ1Z3elF/tOMpA8JLVuR9spt9Ynsf7+JjqsQ2IqtiPJtcLoHoXcT6qU4E10cPFqyXX5HDm9QwIzZhBSkLxsw==} + '@types/offscreencanvas@2019.7.3': + resolution: {integrity: sha512-ieXiYmgSRXUDeOntE1InxjWyvEelZGP63M+cGuquuRLuIKKT1osnkXjxev9B7d1nXSug5vpunx+gNlbVxMlC9A==} + '@types/parse-json@4.0.1': resolution: {integrity: sha512-3YmXzzPAdOTVljVMkTMBdBEvlOLg2cDQaDhnnhT3nT9uDbnJzjWhKlzb+desT12Y7tGqaN6d+AbozcKzyL36Ng==} @@ -6828,6 +8919,9 @@ packages: '@types/postcss-url@10.0.4': resolution: {integrity: sha512-5QIO9NgbWmAkle65haRqkdgYPCOXheNsaFdbTJJQjT302yK3H49ql4t9a4y0NfpuPtU/UBo15VcV64WCSIMJKg==} + '@types/prismjs@1.26.5': + resolution: {integrity: sha512-AUZTa7hQ2KY5L7AmtSiqxlhWxb4ina0yd8hNbl4TWuqnv/pFP0nDMb3YrfSBf4hJVGLh2YEIBfKaBW/9UEl6IQ==} + '@types/prompts@2.4.7': resolution: {integrity: sha512-5zTamE+QQM4nR6Ab3yHK+ovWuhLJXaa2ZLt3mT1en8U3ubWtjVT1vXDaVFC2+cL89uVn7Y+gIq5B3IcVvBl5xQ==} @@ -6846,18 +8940,39 @@ packages: '@types/react-dom@18.2.14': resolution: {integrity: sha512-V835xgdSVmyQmI1KLV2BEIUgqEuinxp9O4G6g3FqO/SqLac049E53aysv0oEFD2kHfejeKU+ZqL2bcFWj9gLAQ==} + '@types/react-reconciler@0.26.7': + resolution: {integrity: sha512-mBDYl8x+oyPX/VBb3E638N0B7xG+SPk/EAMcVPeexqus/5aTpTphQi0curhhshOqRrc9t6OPoJfEUkbymse/lQ==} + + '@types/react-reconciler@0.28.8': + resolution: {integrity: sha512-SN9c4kxXZonFhbX4hJrZy37yw9e7EIxcpHCxQv5JUS18wDE5ovkQKlqQEkufdJCCMfuI9BnjUJvhYeJ9x5Ra7g==} + '@types/react-redux@7.1.33': resolution: {integrity: sha512-NF8m5AjWCkert+fosDsN3hAlHzpjSiXlVy9EgQEmLoBhaNXbmyeGs/aj5dQzKuF+/q+S7JQagorGDW8pJ28Hmg==} + '@types/react-router-config@5.0.11': + resolution: {integrity: sha512-WmSAg7WgqW7m4x8Mt4N6ZyKz0BubSj/2tVUMsAHp+Yd2AMwcSbeFq9WympT19p5heCFmF97R9eD5uUR/t4HEqw==} + + '@types/react-router-dom@5.3.3': + resolution: {integrity: sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw==} + + '@types/react-router@5.1.20': + resolution: {integrity: sha512-jGjmu/ZqS7FjSH6owMcD5qpq19+1RS9DeVRqfl1FeBMxTDQAGwlMWOcs52NDoXaNKyG3d1cYQFMs9rCrb88o9Q==} + '@types/react@18.2.35': resolution: {integrity: sha512-LG3xpFZ++rTndV+/XFyX5vUP7NI9yxyk+MQvBDq+CVs8I9DLSc3Ymwb1Vmw5YDoeNeHN4PDZa3HylMKJYT9PNQ==} '@types/responselike@1.0.3': resolution: {integrity: sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==} + '@types/retry@0.12.0': + resolution: {integrity: sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==} + '@types/sass@1.43.1': resolution: {integrity: sha512-BPdoIt1lfJ6B7rw35ncdwBZrAssjcwzI5LByIrYs+tpXlj/CAkuVdRsgZDdP4lq5EjyWzwxZCqAoFyHKFwp32g==} + '@types/sax@1.2.7': + resolution: {integrity: sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==} + '@types/scheduler@0.16.5': resolution: {integrity: sha512-s/FPdYRmZR8SjLWGMCuax7r3qCWQw9QKHzXVukAuuIJkXkDRwp+Pu5LMIVFi0Fxbav35WURicYr8u1QsoybnQw==} @@ -6867,14 +8982,17 @@ packages: '@types/send@0.17.3': resolution: {integrity: sha512-/7fKxvKUoETxjFUsuFlPB9YndePpxxRAOfGC/yJdc9kTjTeP5kRCTzfnE8kPUKCeyiyIZu0YQ76s50hCedI1ug==} + '@types/serve-index@1.9.4': + resolution: {integrity: sha512-qLpGZ/c2fhSs5gnYsQxtDEq3Oy8SXPClIXkW5ghvAvsNuVSA8k+gCONcUCS/UjLEYvYps+e8uBtfgXgvhwfNug==} + '@types/serve-static@1.15.4': resolution: {integrity: sha512-aqqNfs1XTF0HDrFdlY//+SGUxmdSUbjeRXb5iaZc3x0/vMbYmdw9qvOgHWOyyLFxSSRnUuP5+724zBgfw8/WAw==} '@types/sizzle@2.3.8': resolution: {integrity: sha512-0vWLNK2D5MT9dg0iOo8GlKguPAU02QjmZitPEsXRuJXU/OGIOt9vT9Fc26wtYuavLxtO45v9PGleoL9Z0k1LHg==} - '@types/sortablejs@1.15.7': - resolution: {integrity: sha512-PvgWCx1Lbgm88FdQ6S7OGvLIjWS66mudKPlfdrWil0TjsO5zmoZmzoKiiwRShs1dwPgrlkr0N4ewuy0/+QUXYQ==} + '@types/sockjs@0.3.36': + resolution: {integrity: sha512-MK9V6NzAS1+Ud7JV9lJLFqW85VbC9dq3LmwZCuBe4wBDgKC0Kj/jd8Xl+nSviU+Qc3+m7umHHyHg//2KSa0a0Q==} '@types/sortablejs@1.15.8': resolution: {integrity: sha512-b79830lW+RZfwaztgs1aVPgbasJ8e7AXtZYHTELNXZPsERt4ymJdjV4OccDbHQAvHrCcFpbF78jkm0R6h/pZVg==} @@ -6882,6 +9000,9 @@ packages: '@types/stack-utils@2.0.3': resolution: {integrity: sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==} + '@types/stats.js@0.17.3': + resolution: {integrity: sha512-pXNfAD3KHOdif9EQXZ9deK82HVNaXP5ZIF5RP2QG6OQFNTaY2YIetfrE9t528vEreGQvEPRDDc8muaoYeK0SxQ==} + '@types/stylus@0.48.41': resolution: {integrity: sha512-u0BzfnIgn/0I1YpAJGhkj9lUTLeiuiDXYOagXwe2aAsX8OKDFEWP6vqMMPxy4leQeX45LNDdCEjDJkuRxPCv7A==} @@ -6891,8 +9012,8 @@ packages: '@types/supertest@6.0.2': resolution: {integrity: sha512-137ypx2lk/wTQbW6An6safu9hXmajAifU/s7szAHLN/FeIm5w7yR0Wkl9fdJMRSHwOn4HLAI0DaB2TOORuhPDg==} - '@types/through@0.0.32': - resolution: {integrity: sha512-7XsfXIsjdfJM2wFDRAtEWp3zb2aVPk5QeyZxGlVK57q4u26DczMHhJmlhr0Jqv0THwxam/L8REXkj8M2I/lcvw==} + '@types/three@0.163.0': + resolution: {integrity: sha512-uIdDhsXRpQiBUkflBS/i1l3JX14fW6Ot9csed60nfbZNXHDTRsnV2xnTVwXcgbvTiboAR4IW+t+lTL5f1rqIqA==} '@types/tinycolor2@1.4.5': resolution: {integrity: sha512-uLJijDHN5E6j5n1qefF9oaeplgszXglWXWTviMoFr/YxgvbyrkFil20yDT7ljhCiTQ/BfCYtxfJS81LdTro5DQ==} @@ -6918,6 +9039,9 @@ packages: '@types/web-bluetooth@0.0.16': resolution: {integrity: sha512-oh8q2Zc32S6gd/j50GowEjKLoOVOwHP/bWVjKJInBwQqdOYMdPrf1oVlelTlyfFK3CKxL1uahMDAr+vy8T7yMQ==} + '@types/webxr@0.5.20': + resolution: {integrity: sha512-JGpU6qiIJQKUuVSKx1GtQnHJGxRjtfGIhzO2ilq43VZZS//f1h1Sgexbdk+Lq+7569a6EYhOWrUpIruR/1Enmg==} + '@types/ws@8.5.8': resolution: {integrity: sha512-flUksGIQCnJd6sZ1l5dqCEG/ksaoAg/eUwiLAGTJQcfgvZJKF++Ta4bJA6A5aPSJmsr+xlseHn4KLgVlNnvPTg==} @@ -6988,6 +9112,15 @@ packages: resolution: {integrity: sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==} engines: {node: ^16.0.0 || >=18.0.0} + '@typescript/twoslash@3.1.0': + resolution: {integrity: sha512-kTwMUQ8xtAZaC4wb2XuLkPqFVBj2dNBueMQ89NWEuw87k2nLBbuafeG5cob/QEr6YduxIdTVUjix0MtC7mPlmg==} + + '@typescript/vfs@1.3.4': + resolution: {integrity: sha512-RbyJiaAGQPIcAGWFa3jAXSuAexU4BFiDRF1g3hy7LmRqfNpYlTQWGXjcrOaVZjJ8YkkpuwG0FcsYvtWQpd9igQ==} + + '@typescript/vfs@1.3.5': + resolution: {integrity: sha512-pI8Saqjupf9MfLw7w2+og+fmb0fZS0J6vsKXXrp4/PDXEFvntgzXmChCXC/KefZZS0YGS6AT8e0hGAJcTsdJlg==} + '@ungap/structured-clone@1.2.0': resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} @@ -7077,6 +9210,14 @@ packages: peerDependencies: vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0 + '@use-gesture/core@10.3.1': + resolution: {integrity: sha512-WcINiDt8WjqBdUXye25anHiNxPc0VOrlT8F6LLkU6cycrOGUDyY/yyFmsg3k8i5OLvv25llc0QC45GhR/C8llw==} + + '@use-gesture/react@10.3.1': + resolution: {integrity: sha512-Yy19y6O2GJq8f7CHf7L0nxL8bf4PZCPaVOCgJrusOeFHY1LvHgYXnmnXg6N5iwAnbgbZCDjo60SiM6IPJi9C5g==} + peerDependencies: + react: '>= 16.8.0' + '@vaadin/a11y-base@24.3.22': resolution: {integrity: sha512-QrVsB7R+WGHlwEzVyvhwL6HvAGErF6CHTDBEyvKyt3jmjIqRDiCBGjvq6g/SHYUUNQNH1u892ANXGHLAQGGqLQ==} @@ -7201,21 +9342,50 @@ packages: '@vitest/expect@2.0.4': resolution: {integrity: sha512-39jr5EguIoanChvBqe34I8m1hJFI4+jxvdOpD7gslZrVQBKhh8H9eD7J/LJX4zakrw23W+dITQTDqdt43xVcJw==} + '@vitest/expect@2.1.2': + resolution: {integrity: sha512-FEgtlN8mIUSEAAnlvn7mP8vzaWhEaAEvhSXCqrsijM7K6QqjB11qoRZYEd4AKSCDz8p0/+yH5LzhZ47qt+EyPg==} + + '@vitest/mocker@2.1.2': + resolution: {integrity: sha512-ExElkCGMS13JAJy+812fw1aCv2QO/LBK6CyO4WOPAzLTmve50gydOlWhgdBJPx2ztbADUq3JVI0C5U+bShaeEA==} + peerDependencies: + msw: ^2.3.5 + vite: ^5.0.0 + peerDependenciesMeta: + msw: + optional: true + vite: + optional: true + '@vitest/pretty-format@2.0.4': resolution: {integrity: sha512-RYZl31STbNGqf4l2eQM1nvKPXE0NhC6Eq0suTTePc4mtMQ1Fn8qZmjV4emZdEdG2NOWGKSCrHZjmTqDCDoeFBw==} + '@vitest/pretty-format@2.1.2': + resolution: {integrity: sha512-FIoglbHrSUlOJPDGIrh2bjX1sNars5HbxlcsFKCtKzu4+5lpsRhOCVcuzp0fEhAGHkPZRIXVNzPcpSlkoZ3LuA==} + '@vitest/runner@2.0.4': resolution: {integrity: sha512-Gk+9Su/2H2zNfNdeJR124gZckd5st4YoSuhF1Rebi37qTXKnqYyFCd9KP4vl2cQHbtuVKjfEKrNJxHHCW8thbQ==} + '@vitest/runner@2.1.2': + resolution: {integrity: sha512-UCsPtvluHO3u7jdoONGjOSil+uON5SSvU9buQh3lP7GgUXHp78guN1wRmZDX4wGK6J10f9NUtP6pO+SFquoMlw==} + '@vitest/snapshot@2.0.4': resolution: {integrity: sha512-or6Mzoz/pD7xTvuJMFYEtso1vJo1S5u6zBTinfl+7smGUhqybn6VjzCDMhmTyVOFWwkCMuNjmNNxnyXPgKDoPw==} + '@vitest/snapshot@2.1.2': + resolution: {integrity: sha512-xtAeNsZ++aRIYIUsek7VHzry/9AcxeULlegBvsdLncLmNCR6tR8SRjn8BbDP4naxtccvzTqZ+L1ltZlRCfBZFA==} + '@vitest/spy@2.0.4': resolution: {integrity: sha512-uTXU56TNoYrTohb+6CseP8IqNwlNdtPwEO0AWl+5j7NelS6x0xZZtP0bDWaLvOfUbaYwhhWp1guzXUxkC7mW7Q==} + '@vitest/spy@2.1.2': + resolution: {integrity: sha512-GSUi5zoy+abNRJwmFhBDC0yRuVUn8WMlQscvnbbXdKLXX9dE59YbfwXxuJ/mth6eeqIzofU8BB5XDo/Ns/qK2A==} + '@vitest/utils@2.0.4': resolution: {integrity: sha512-Zc75QuuoJhOBnlo99ZVUkJIuq4Oj0zAkrQ2VzCqNCx6wAwViHEh5Fnp4fiJTE9rA+sAoXRf00Z9xGgfEzV6fzQ==} + '@vitest/utils@2.1.2': + resolution: {integrity: sha512-zMO2KdYy6mx56btx9JvAqAZ6EyS3g49krMPPrgOp1yxGZiA93HumGk+bZ5jIZtOg5/VBYl5eBmGRQHqq4FG6uQ==} + '@vue-macros/common@1.10.0': resolution: {integrity: sha512-4DZsPeQA/nBQDw2RkYAmH7KrFjJVrMdAhJhO1JCl1bbbFXCGeoGjXfkg9wHPppj47s2HpAB3GrqNwqVGbi12NQ==} engines: {node: '>=16.14.0'} @@ -7374,6 +9544,9 @@ packages: '@vue/devtools-api@6.5.1': resolution: {integrity: sha512-+KpckaAQyfbvshdDW5xQylLni1asvNSGme1JFs8I1+/H5pHEhqUKMEQD/qn3Nx5+/nycBq11qAEi8lk+LXI2dA==} + '@vue/devtools-api@6.6.4': + resolution: {integrity: sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==} + '@vue/reactivity-transform@3.3.12': resolution: {integrity: sha512-g5TijmML7FyKkLt6QnpqNmA4KD7K/T5SbXa88Bhq+hydNQEkzA8veVXWAQuNqg9rjaFYD0rPf0a9NofKA0ENgg==} @@ -7575,11 +9748,6 @@ packages: resolution: {integrity: sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==} engines: {node: '>=0.4.0'} - acorn@8.11.2: - resolution: {integrity: sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w==} - engines: {node: '>=0.4.0'} - hasBin: true - acorn@8.12.0: resolution: {integrity: sha512-RTvkC4w+KNXrM39/lWCUaG0IbRkWdCv7W/IOW9oU6SawyxulvkQy5HQPVTKxEjczcUvapcrw3cFx/60VN/NRNw==} engines: {node: '>=0.4.0'} @@ -7590,6 +9758,10 @@ packages: engines: {node: '>=0.4.0'} hasBin: true + address@1.2.2: + resolution: {integrity: sha512-4B/qKCfeE/ODUaAUpSwfzazo5x29WD4r3vXiWsB7I2mSDAihwEqKO+g8GELZUQSSAo5e1XTYh3ZVfLyxBc12nA==} + engines: {node: '>= 10.0.0'} + adler-32@1.2.0: resolution: {integrity: sha512-/vUqU/UY4MVeFsg+SsK6c+/05RZXIHZMGJA+PX5JyWI0ZRcBpupnRuPLU/NXXoFwMYCPCoxIfElM2eS+DUXCqQ==} engines: {node: '>=0.8'} @@ -7628,6 +9800,11 @@ packages: peerDependencies: ajv: ^6.9.1 + ajv-keywords@5.1.0: + resolution: {integrity: sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==} + peerDependencies: + ajv: ^8.8.2 + ajv@6.12.6: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} @@ -7637,6 +9814,14 @@ packages: ajv@8.12.0: resolution: {integrity: sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==} + algoliasearch-helper@3.22.5: + resolution: {integrity: sha512-lWvhdnc+aKOKx8jyA3bsdEgHzm/sglC4cYdMG4xSQyRiPLJVJtH/IVYZG3Hp6PkTEhQqhyVYkeP9z2IlcHJsWw==} + peerDependencies: + algoliasearch: '>= 3.1 < 6' + + algoliasearch@4.24.0: + resolution: {integrity: sha512-bf0QV/9jVejssFBmz2HQLxUadxk574t4iwjCKp5E7NBzwKkrDEhKPISIIjAU/p6K5qDx3qoeh4+26zWN1jmw3g==} + align-text@0.1.4: resolution: {integrity: sha512-GrTZLRpmp6wIC2ztrWW9MjjTgSKccffgFagbNDOX95/dcjEcYZibYTeaOntySQLcdw1ztBoFkviiUvTMbb9MYg==} engines: {node: '>=0.10.0'} @@ -7664,6 +9849,11 @@ packages: resolution: {integrity: sha512-5GFMVX8HqE/TB+FuBJGuO5XG0WrsA6ptUqoODaT/n9mmUaZFkqnBueB4leqGBCmrUHnCnC4PCZTCd0E7QQ83bA==} engines: {node: '>=12'} + ansi-html-community@0.0.8: + resolution: {integrity: sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw==} + engines: {'0': node >= 0.8.0} + hasBin: true + ansi-regex@2.1.1: resolution: {integrity: sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==} engines: {node: '>=0.10.0'} @@ -7780,9 +9970,6 @@ packages: resolution: {integrity: sha512-y+CcFFwelSXpLZk/7fMB2mUbGtX9lKycf1MWJ7CaTIERyitVlyQx6C+sxcROU2BAJ24OiZyK+8wj2i8AlBoS3A==} engines: {node: '>=10'} - aria-query@5.3.0: - resolution: {integrity: sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==} - aria-query@5.3.2: resolution: {integrity: sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==} engines: {node: '>= 0.4'} @@ -7871,6 +10058,10 @@ packages: resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} engines: {node: '>=8'} + astring@1.9.0: + resolution: {integrity: sha512-LElXdjswlqjWrPpJFg1Fx4wpkOCxj1TDHlSV4PlaRxHGWko024xICaa97ZkMfs6DRKlCguiAI+rbXv5GWwXIkg==} + hasBin: true + async-exit-hook@2.0.1: resolution: {integrity: sha512-NW2cX8m1Q7KPA7a5M2ULQeZ2wR5qI5PAbw5L0UOMxdioVk9PMZ0h1TmyZEkPYrCvYjDlFICusOu1dlEKAAeXBw==} engines: {node: '>=0.12.0'} @@ -7893,6 +10084,10 @@ packages: engines: {node: '>= 4.5.0'} hasBin: true + attr-accept@2.2.2: + resolution: {integrity: sha512-7prDjvt9HmqiZ0cl5CRjtS84sEyhsHP2coDkaZKRKVfCDo9s7iw7ChVmar78Gu9pC4SoR/28wFu/G5JJhTnqEg==} + engines: {node: '>=4'} + author-regex@1.0.0: resolution: {integrity: sha512-KbWgR8wOYRAPekEmMXrYYdc7BRyhn2Ftk7KWfMUnQ43hFdojWEFRxhhRUm3/OFEdPa1r0KAvTTg9YQK57xTe0g==} engines: {node: '>=0.8'} @@ -7904,6 +10099,13 @@ packages: peerDependencies: postcss: ^8.1.0 + autoprefixer@10.4.20: + resolution: {integrity: sha512-XY25y5xSv/wEoqzDyXXME4AFfkZI0P23z6Fs3YgymDnKJkCGOnkL0iTxCa85UTqaSgfcqyf3UA6+c7wUvx/16g==} + engines: {node: ^10 || ^12 || >=14} + hasBin: true + peerDependencies: + postcss: ^8.1.0 + available-typed-arrays@1.0.5: resolution: {integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==} engines: {node: '>= 0.4'} @@ -7920,6 +10122,9 @@ packages: axios@1.7.2: resolution: {integrity: sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==} + axios@1.7.7: + resolution: {integrity: sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==} + axobject-query@4.1.0: resolution: {integrity: sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==} engines: {node: '>= 0.4'} @@ -7930,12 +10135,25 @@ packages: b-validate@1.5.3: resolution: {integrity: sha512-iCvCkGFskbaYtfQ0a3GmcQCHl/Sv1GufXFGuUQ+FE+WJa7A/espLOuFIn09B944V8/ImPj71T4+rTASxO2PAuA==} + b4a@1.6.7: + resolution: {integrity: sha512-OnAYlL5b7LEkALw87fUVafQw5rVR9RjwGd4KUwNQ6DrrNmaVaUCgLipfVlzrPQ4tWOR9P0IXGNOx50jYCCdSJg==} + babel-jest@29.7.0: resolution: {integrity: sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@babel/core': ^7.8.0 + babel-loader@9.2.1: + resolution: {integrity: sha512-fqe8naHt46e0yIdkjUZYqddSXfej3AHajX+CSO5X7oy0EmPc6o5Xh+RClNoHjnieWz9AW4kZxW9yyFMhVB1QLA==} + engines: {node: '>= 14.15.0'} + peerDependencies: + '@babel/core': ^7.12.0 + webpack: '>=5' + + babel-plugin-dynamic-import-node@2.3.3: + resolution: {integrity: sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==} + babel-plugin-istanbul@6.1.1: resolution: {integrity: sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==} engines: {node: '>=8'} @@ -7953,11 +10171,21 @@ packages: resolution: {integrity: sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg==} engines: {node: '>=10', npm: '>=6'} + babel-plugin-polyfill-corejs2@0.4.11: + resolution: {integrity: sha512-sMEJ27L0gRHShOh5G54uAAPaiCOygY/5ratXuiyb2G46FmlSpc9eFCzYVyDiPxfNbwzA7mYahmjQc5q+CZQ09Q==} + peerDependencies: + '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + babel-plugin-polyfill-corejs2@0.4.6: resolution: {integrity: sha512-jhHiWVZIlnPbEUKSSNb9YoWcQGdlTLq7z1GHL4AjFxaoOUMuuEVJ+Y4pAaQUGOGk93YsVCKPbqbfw3m0SM6H8Q==} peerDependencies: '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + babel-plugin-polyfill-corejs3@0.10.6: + resolution: {integrity: sha512-b37+KR2i/khY5sKmWNVQAnitvquQbNdWy6lJdsr0kmquCKEEUgMKK4SboVM3HtfnZilfjr4MMQ7vY58FVWDtIA==} + peerDependencies: + '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + babel-plugin-polyfill-corejs3@0.8.6: resolution: {integrity: sha512-leDIc4l4tUgU7str5BWLS2h8q2N4Nf6lGZP6UrNDxdtfF2g69eJ5L0H7S8A5Ln/arfFAfHor5InAdZuIOwZdgQ==} peerDependencies: @@ -7968,6 +10196,11 @@ packages: peerDependencies: '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + babel-plugin-polyfill-regenerator@0.6.2: + resolution: {integrity: sha512-2R25rQZWP63nGwaAswvDazbPXfrM3HwVoBXK6HcqeKrSrL/JqcC/rDcf95l4r7LXLyxDXc8uQDa064GubtCABg==} + peerDependencies: + '@babel/core': ^7.4.0 || ^8.0.0-0 <8.0.0 + babel-plugin-transform-replace-object-assign@2.0.0: resolution: {integrity: sha512-PMT+dRz6JAHbXIsJB4XjcIstmKK9SFj9MYZGcEWW/1jISiemGz9w6TVLrj4hgpR89X0J9mFuHq61zPvP8lgZZQ==} peerDependencies: @@ -8001,6 +10234,21 @@ packages: balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + bare-events@2.5.0: + resolution: {integrity: sha512-/E8dDe9dsbLyh2qrZ64PEPadOQ0F4gbl1sUJOrmph7xOiIxfY8vwab/4bFLh4Y88/Hk/ujKcrQKc+ps0mv873A==} + + bare-fs@2.3.5: + resolution: {integrity: sha512-SlE9eTxifPDJrT6YgemQ1WGFleevzwY+XAP1Xqgl56HtcrisC2CHCZ2tq6dBpcH2TnNxwUEUGhweo+lrQtYuiw==} + + bare-os@2.4.4: + resolution: {integrity: sha512-z3UiI2yi1mK0sXeRdc4O1Kk8aOa/e+FNWZcTiPB/dfTWyLypuE99LibgRaQki914Jq//yAWylcAt+mknKdixRQ==} + + bare-path@2.1.3: + resolution: {integrity: sha512-lh/eITfU8hrj9Ru5quUp0Io1kJWIk1bTjzo7JH1P5dWmQ2EL4hFUlfI8FonAhSlgIfhn63p84CDY/x+PisgcXA==} + + bare-stream@2.3.0: + resolution: {integrity: sha512-pVRWciewGUeCyKEuRxwv06M079r+fRjAQjBEK2P6OYGrO43O+Z0LrPZZEjlc4mB6C2RpZ9AxJ1s7NLEtOHO6eA==} + base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} @@ -8008,16 +10256,21 @@ packages: resolution: {integrity: sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==} engines: {node: '>=0.10.0'} + batch@0.6.1: + resolution: {integrity: sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==} + bcryptjs@2.4.3: resolution: {integrity: sha512-V/Hy/X9Vt7f3BbPJEi8BdVFMByHi+jNXrYkW3huaybV/kQ0KJg0Y6PkEMbn+zeT+i+SiKZ/HMqJGIIt4LZDqNQ==} + before-after-hook@2.2.3: + resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==} + better-path-resolve@1.0.0: resolution: {integrity: sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g==} engines: {node: '>=4'} - big-integer@1.6.51: - resolution: {integrity: sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==} - engines: {node: '>=0.6'} + bidi-js@1.0.3: + resolution: {integrity: sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw==} big.js@5.2.2: resolution: {integrity: sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==} @@ -8046,6 +10299,9 @@ packages: resolution: {integrity: sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==} engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + bonjour-service@1.2.1: + resolution: {integrity: sha512-oSzCS2zV14bh2kji6vNe7vrpJYCHGvcZnlffFQ1MEoX/WOeQ/teD8SYWKR942OI3INjq8OMNJlbPK5LLLUxFDw==} + boolbase@1.0.0: resolution: {integrity: sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==} @@ -8058,14 +10314,14 @@ packages: peerDependencies: '@popperjs/core': ^2.11.8 + boxen@6.2.1: + resolution: {integrity: sha512-H4PEsJXfFI/Pt8sjDWbHlQPx4zL/bvSQjcilJmaulGt5mLDorHOHpmdXAJcBcmru7PhYSp/cDMWRko4ZUMFkSw==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + boxen@7.0.0: resolution: {integrity: sha512-j//dBVuyacJbvW+tvZ9HuH03fZ46QcaKvvhZickZqtB271DxJ7SNRSNxrV/dZX0085m7hISRZWbzWlJvx/rHSg==} engines: {node: '>=14.16'} - bplist-parser@0.2.0: - resolution: {integrity: sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==} - engines: {node: '>= 5.10.0'} - brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} @@ -8080,21 +10336,20 @@ packages: resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} engines: {node: '>=8'} + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + breakword@1.0.6: resolution: {integrity: sha512-yjxDAYyK/pBvws9H4xKYpLDpYKEH6CzrBPAuXq3x18I+c/2MkVtT3qAr7Oloi6Dss9qNhPVueAAVU1CSeNDIXw==} - browserslist@4.22.1: - resolution: {integrity: sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==} - engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} - hasBin: true - - browserslist@4.23.0: - resolution: {integrity: sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==} + browserslist@4.23.1: + resolution: {integrity: sha512-TUfofFo/KsK/bWZ9TWQ5O26tsWW4Uhmt8IYklbnUa70udB6P2wA7w7o4PY4muaEPBQaAX+CEnmmIA41NVHtPVw==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true - browserslist@4.23.1: - resolution: {integrity: sha512-TUfofFo/KsK/bWZ9TWQ5O26tsWW4Uhmt8IYklbnUa70udB6P2wA7w7o4PY4muaEPBQaAX+CEnmmIA41NVHtPVw==} + browserslist@4.24.0: + resolution: {integrity: sha512-Rmb62sR1Zpjql25eSanFGEhAxcFwfA1K0GuQcLoaJBAcENegrQut3hYdhXFF1obQfiDyqIW/cLM5HSJ/9k884A==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true @@ -8124,6 +10379,9 @@ packages: buffer@5.7.1: resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} + buffer@6.0.3: + resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} + bufferutil@4.0.8: resolution: {integrity: sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw==} engines: {node: '>=6.14.2'} @@ -8138,9 +10396,9 @@ packages: bundle-n-require@1.1.1: resolution: {integrity: sha512-EB2wFjXF106LQLe/CYnKCMCdLeTW47AtcEtUfiqAOgr2a08k0+YgRklur2aLfEYHlhz6baMskZ8L2U92Hh0vyA==} - bundle-name@3.0.0: - resolution: {integrity: sha512-PKA4BeSvBpQKQ8iPOGCSiell+N8P+Tf1DlwqmYhpe2gAhKPHn8EYOxVT+ShuGmhg8lN8XiSlS80yiExKXrURlw==} - engines: {node: '>=12'} + bundle-name@4.1.0: + resolution: {integrity: sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==} + engines: {node: '>=18'} bundle-require@5.0.0: resolution: {integrity: sha512-GuziW3fSSmopcx4KRymQEJVbZUfqlCqcq7dvs6TYwKRZiegK/2buMxQTPs6MGlNv50wms1699qYO54R8XfRX4w==} @@ -8180,6 +10438,14 @@ packages: resolution: {integrity: sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==} engines: {node: '>=10.6.0'} + cacheable-lookup@7.0.0: + resolution: {integrity: sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==} + engines: {node: '>=14.16'} + + cacheable-request@10.2.14: + resolution: {integrity: sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ==} + engines: {node: '>=14.16'} + cacheable-request@7.0.4: resolution: {integrity: sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==} engines: {node: '>=8'} @@ -8192,6 +10458,9 @@ packages: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} + camel-case@4.1.2: + resolution: {integrity: sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==} + camelcase-css@2.0.1: resolution: {integrity: sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==} engines: {node: '>= 6'} @@ -8216,12 +10485,14 @@ packages: resolution: {integrity: sha512-xlx1yCK2Oc1APsPXDL2LdlNP6+uu8OCDdhOBSVT279M/S+y75O30C2VuD8T2ogdePBBl7PfPF4504tnLgX3zfw==} engines: {node: '>=14.16'} + camera-controls@2.9.0: + resolution: {integrity: sha512-TpCujnP0vqPppTXXJRYpvIy0xq9Tro6jQf2iYUxlDpPCNxkvE/XGaTuwIxnhINOkVP/ob2CRYXtY3iVYXeMEzA==} + peerDependencies: + three: '>=0.126.1' + caniuse-api@3.0.0: resolution: {integrity: sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==} - caniuse-lite@1.0.30001561: - resolution: {integrity: sha512-NTt0DNoKe958Q0BE0j0c1V9jbUzhBxHIEJy7asmGrpE0yG63KTV7PLHPnK2E1O9RsQrQ081I3NLuXGS6zht3cw==} - caniuse-lite@1.0.30001633: resolution: {integrity: sha512-6sT0yf/z5jqf8tISAgpJDrmwOpLsrpnyCdD/lOZKvKkkJK4Dn0X5i7KF7THEZhOq+30bmhwBlNEaqPUiHiKtZg==} @@ -8247,6 +10518,10 @@ packages: resolution: {integrity: sha512-/ghrgmhfY8RaSdeo43hNXxpoHAtxdbskUHjPpfqUWGttFgycUhYPGx3YZBCnUCvOa7Doivn1IZec3DEGFoMgLg==} engines: {node: '>=12'} + chalk-template@1.1.0: + resolution: {integrity: sha512-T2VJbcDuZQ0Tb2EWwSotMPJjgpy1/tGee1BTpUNsGZ/qgNjV2t7Mvu+d4600U564nbLesN1x2dPL+xii174Ekg==} + engines: {node: '>=14.16'} + chalk@1.1.3: resolution: {integrity: sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A==} engines: {node: '>=0.10.0'} @@ -8275,9 +10550,18 @@ packages: resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} engines: {node: '>=10'} + character-entities-html4@2.1.0: + resolution: {integrity: sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==} + + character-entities-legacy@3.0.0: + resolution: {integrity: sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==} + character-entities@2.0.2: resolution: {integrity: sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==} + character-reference-invalid@2.0.1: + resolution: {integrity: sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==} + chardet@0.4.2: resolution: {integrity: sha512-j/Toj7f1z98Hh2cYo2BVr85EpIRWqUi7rtRSGxh/cqUjqrnJe9l9UE7IUGd2vQ2p+kSHLkSzObQPZPLUC6TQwg==} @@ -8288,6 +10572,13 @@ packages: resolution: {integrity: sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==} engines: {node: '>= 16'} + cheerio-select@2.1.0: + resolution: {integrity: sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==} + + cheerio@1.0.0-rc.12: + resolution: {integrity: sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q==} + engines: {node: '>= 6'} + chokidar@3.5.3: resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} engines: {node: '>= 8.10.0'} @@ -8300,6 +10591,9 @@ packages: resolution: {integrity: sha512-n8enUVCED/KVRQlab1hr3MVpcVMvxtZjmEa956u+4YijlmQED223XMSYj2tLuKvr4jcCTzNNMpQDUer72MMmzA==} engines: {node: '>= 14.16.0'} + chownr@1.1.4: + resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==} + chownr@2.0.0: resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} engines: {node: '>=10'} @@ -8322,6 +10616,9 @@ packages: resolution: {integrity: sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==} engines: {node: '>=0.10.0'} + class-variance-authority@0.7.0: + resolution: {integrity: sha512-jFI8IQw4hczaL4ALINxqLEXQbWcNjoSkloa4IaufXCJr6QawJyw7tuRysRsrE8w2p/4gGaxKIt/hX3qz/IbD1A==} + classcat@5.0.5: resolution: {integrity: sha512-JhZUT7JFcQy/EzW605k/ktHtncoo9vnyW/2GspNYwFlN1C/WmjuV/xtS04e9SOkL2sTdw0VAZ2UGCcQ9lR6p6w==} @@ -8331,6 +10628,10 @@ packages: classnames@2.5.1: resolution: {integrity: sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==} + clean-css@5.3.3: + resolution: {integrity: sha512-D5J+kHaVb/wKSFcyyV75uCn8fiY4sV38XJoe4CUyGQ+mOU/fMVYUdH1hJC+CJQ5uY3EnW27SbJYS4X8BiLrAFg==} + engines: {node: '>= 10.0'} + clean-stack@2.2.0: resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} engines: {node: '>=6'} @@ -8402,6 +10703,10 @@ packages: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} + clone-deep@4.0.1: + resolution: {integrity: sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==} + engines: {node: '>=6'} + clone-response@1.0.3: resolution: {integrity: sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==} @@ -8417,6 +10722,14 @@ packages: resolution: {integrity: sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==} engines: {node: '>=6'} + clsx@2.0.0: + resolution: {integrity: sha512-rQ1+kcj+ttHG0MKVGBUXwayCCF1oh39BF5COIpRzuCEv8Mwjv0XucrI2ExNTOn9IlLifGClWQcU9BrZORvtw6Q==} + engines: {node: '>=6'} + + clsx@2.1.1: + resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==} + engines: {node: '>=6'} + co@4.6.0: resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} @@ -8436,6 +10749,9 @@ packages: resolution: {integrity: sha512-3g6NUTPd/YtuuGrhMnOMRjFc+LJw/bnMp3+0r/Wcz3IXUuCosKRJvMphm5+Q+bvTVGcJJuRvVLuYba+WojaFaA==} engines: {node: '>=0.8'} + collapse-white-space@2.1.0: + resolution: {integrity: sha512-loKTxY1zCOuG4j9f6EPnuyyYkf58RnhhWTvRoZEokgB+WbdXehfjFviyOVYkqzEWz1Q5kRiZdBYS5SwxbQYwzw==} + collect-v8-coverage@1.0.2: resolution: {integrity: sha512-lHl4d5/ONEbLlJvaJNtsF/Lz+WvB07u2ycqTYbdrq7UypDXailES4valYb2eWiJFxZlVmpGekfqoxQhzyFdT4Q==} @@ -8470,9 +10786,16 @@ packages: resolution: {integrity: sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==} engines: {node: '>=12.5.0'} + colord@2.9.3: + resolution: {integrity: sha512-jeC1axXpnb0/2nn/Y1LPuLdgXBLH7aDcHu4KEKfqw3CUhX7ZpfBSlPKyqXE6btIgEzfWtrX3/tyBCaCvXvMkOw==} + colorette@2.0.20: resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} + combine-promises@1.2.0: + resolution: {integrity: sha512-VcQB1ziGD0NXrhKxiwyNbCDmRzs/OShMs2GqW2DlU2A/Sd0nQxE1oWDAE5O0ygSx5mgQOn9eIFh7yKPgFRVkPQ==} + engines: {node: '>=10'} + combined-stream@1.0.8: resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} engines: {node: '>= 0.8'} @@ -8480,6 +10803,10 @@ packages: comma-separated-tokens@2.0.3: resolution: {integrity: sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==} + command-exists-promise@2.0.2: + resolution: {integrity: sha512-T6PB6vdFrwnHXg/I0kivM3DqaCGZLjjYSOe0a5WgFKcz1sOnmOeIjnhQPXVXX3QjVbLyTJ85lJkX6lUpukTzaA==} + engines: {node: '>=6'} + commander@10.0.1: resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} engines: {node: '>=14'} @@ -8492,6 +10819,10 @@ packages: resolution: {integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==} engines: {node: '>=16'} + commander@12.1.0: + resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==} + engines: {node: '>=18'} + commander@2.14.1: resolution: {integrity: sha512-+YR16o3rK53SmWHU3rEM3tPAh2rwb1yPcQX5irVn7mb0gXbwuCCrnkbV5+PBfETdfg1vui07nM6PCG1zndcjQw==} @@ -8525,6 +10856,13 @@ packages: resolution: {integrity: sha512-SsxdiOf064DWoZLH799Ata6u7iV658A11PlWtZATDlXPpKGJnbJZ5Z24ybixAi+LUUqJ/GKowAejtC5GFUG7Tw==} engines: {node: '>= 6'} + comment-json@4.2.5: + resolution: {integrity: sha512-bKw/r35jR3HGt5PEPm1ljsQQGyCrR8sFGNiN5L+ykDHdpO8Smxkrkla9Yi6NkQyUrb8V54PGhfMs6NrIwtxtdw==} + engines: {node: '>= 6'} + + common-path-prefix@3.0.0: + resolution: {integrity: sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==} + compare-func@2.0.0: resolution: {integrity: sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==} @@ -8579,12 +10917,27 @@ packages: confbox@0.1.7: resolution: {integrity: sha512-uJcB/FKZtBMCJpK8MQji6bJHgu1tixKPxRLeGkNzBoOZzpnZUJm0jm2/sBDWcuBx1dYgxV4JU+g5hmNxCyAmdA==} + config-chain@1.1.13: + resolution: {integrity: sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==} + config-file-ts@0.2.6: resolution: {integrity: sha512-6boGVaglwblBgJqGyxm4+xCmEGcWgnWHSWHY5jad58awQhB6gftq0G8HbzU39YqCIYHMLAiL1yjwiZ36m/CL8w==} - configstore@5.0.1: - resolution: {integrity: sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==} - engines: {node: '>=8'} + configstore@6.0.0: + resolution: {integrity: sha512-cD31W1v3GqUlQvbBCGcXmd2Nj9SvLDOP1oQ0YFuLETufzSPaKp11rYBsSOm7rCsW3OnIRAFM3OxRhceaXNYHkA==} + engines: {node: '>=12'} + + connect-history-api-fallback@1.6.0: + resolution: {integrity: sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg==} + engines: {node: '>=0.8'} + + connect-history-api-fallback@2.0.0: + resolution: {integrity: sha512-U73+6lQFmfiNPrYbXqr6kZ1i1wiRqXnp2nhMsINseWXO8lDau0LGEffJ8kQi4EjLZympVgRdvqjAgiZ1tgzDDA==} + engines: {node: '>=0.8'} + + connect@3.7.0: + resolution: {integrity: sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==} + engines: {node: '>= 0.10.0'} consola@2.15.3: resolution: {integrity: sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==} @@ -8928,6 +11281,9 @@ packages: whiskers: optional: true + consolidated-events@2.0.2: + resolution: {integrity: sha512-2/uRVMdRypf5z/TW/ncD/66l75P5hH2vM/GR8Jf8HLc2xnfJtmina6F6du8+v4Z2vTrMo7jC+W1tmEEuuELgkQ==} + content-disposition@0.5.2: resolution: {integrity: sha512-kRGRZw3bLlFISDBgwTSA1TMBFN6J6GWDeubmDE3AF+3+yXL8hTWv8r5rkLbqYXY4RjPk/EzHnClI3zQf1cFmHA==} engines: {node: '>= 0.6'} @@ -8987,12 +11343,28 @@ packages: resolution: {integrity: sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw==} engines: {node: '>=0.10.0'} + copy-text-to-clipboard@3.2.0: + resolution: {integrity: sha512-RnJFp1XR/LOBDckxTib5Qjr/PMfkatD0MUCQgdpqS8MdKiNUzBjAQBEN6oUy+jW7LI93BBG3DtMB2KOOKpGs2Q==} + engines: {node: '>=12'} + copy-to-clipboard@3.3.3: resolution: {integrity: sha512-2KV8NhB5JqC3ky0r9PMCAZKbUHSwtEo4CwCs0KXgruG43gX5PMqDEBbVU4OUzw2MuAWUfsuFmWvEKG5QRfSnJA==} + copy-webpack-plugin@11.0.0: + resolution: {integrity: sha512-fX2MWpamkW0hZxMEg0+mYnA40LTosOSa5TqZ9GYIBzyJa9C3QUaMPSE2xAi/buNr8u89SfD9wHSQVBzrRa/SOQ==} + engines: {node: '>= 14.15.0'} + peerDependencies: + webpack: ^5.1.0 + core-js-compat@3.33.2: resolution: {integrity: sha512-axfo+wxFVxnqf8RvxTzoAlzW4gRoacrHeoFlc9n0x50+7BEyZL/Rt3hicaED1/CEd7I6tPCPVUYcJwCMO5XUYw==} + core-js-compat@3.38.1: + resolution: {integrity: sha512-JRH6gfXxGmrzF3tZ57lFx97YARxCXPaMzPo6jELZhv88pBH5VXpQ+y0znKGlFnzuaihqhLbefxSJxWJMPtfDzw==} + + core-js-pure@3.38.1: + resolution: {integrity: sha512-BY8Etc1FZqdw1glX0XNOq2FDwfrg/VGqoZOZCdaL+UmdaqDwQwYXkMJT4t6In+zfEfOJDcM9T0KdbBeJg8KKCQ==} + core-js@2.6.12: resolution: {integrity: sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==} deprecated: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js. @@ -9037,14 +11409,14 @@ packages: ts-node: '>=10' typescript: '>=4' + cosmiconfig@6.0.0: + resolution: {integrity: sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==} + engines: {node: '>=8'} + cosmiconfig@7.1.0: resolution: {integrity: sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==} engines: {node: '>=10'} - cosmiconfig@8.0.0: - resolution: {integrity: sha512-da1EafcpH6b/TD8vDRaWV7xFINlHlF6zKsGwS1TsuVJTZRkquaS5HTMq7uq6h31619QjbsYl21gVDOm32KM1vQ==} - engines: {node: '>=14'} - cosmiconfig@8.3.6: resolution: {integrity: sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==} engines: {node: '>=14'} @@ -9103,48 +11475,116 @@ packages: crypto-js@4.2.0: resolution: {integrity: sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==} - crypto-random-string@2.0.0: - resolution: {integrity: sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==} - engines: {node: '>=8'} + crypto-random-string@4.0.0: + resolution: {integrity: sha512-x8dy3RnvYdlUcPOjkEHqozhiwzKNSq7GcPuXFbnyMOCHxX8V3OgIg/pYuabl2sbUPfIJaeAQB7PMOK8DFIdoRA==} + engines: {node: '>=12'} - cspell-dictionary@6.31.3: - resolution: {integrity: sha512-3w5P3Md/tbHLVGPKVL0ePl1ObmNwhdDiEuZ2TXfm2oAIwg4aqeIrw42A2qmhaKLcuAIywpqGZsrGg8TviNNhig==} - engines: {node: '>=14'} + cspell-config-lib@8.14.2: + resolution: {integrity: sha512-yHP1BdcH5dbjb8qiZr6+bxEnJ+rxTULQ00wBz3eBPWCghJywEAYYvMWoYuxVtPpndlkKYC1wJAHsyNkweQyepA==} + engines: {node: '>=18'} - cspell-gitignore@6.31.3: - resolution: {integrity: sha512-vCfVG4ZrdwJnsZHl/cdp8AY+YNPL3Ga+0KR9XJsaz69EkQpgI6porEqehuwle7hiXw5e3L7xFwNEbpCBlxgLRA==} - engines: {node: '>=14'} + cspell-dictionary@8.14.2: + resolution: {integrity: sha512-gWuAvf6queGGUvGbfAxxUq55cZ0OevWPbjnCrSB0PpJ4tqdFd8dLcvVrIKzoE2sBXKPw2NDkmoEngs6iGavC0w==} + engines: {node: '>=18'} + + cspell-gitignore@8.14.2: + resolution: {integrity: sha512-lrO/49NaKBpkR7vFxv4OOY+oHmsG5+gNQejrBBWD9Nv9vvjJtz/G36X/rcN6M6tFcQQMWwa01kf04nxz8Ejuhg==} + engines: {node: '>=18'} hasBin: true - cspell-glob@6.31.3: - resolution: {integrity: sha512-+koUJPSCOittQwhR0T1mj4xXT3N+ZnY2qQ53W6Gz9HY3hVfEEy0NpbwE/Uy7sIvFMbc426fK0tGXjXyIj72uhQ==} - engines: {node: '>=14'} + cspell-glob@8.14.2: + resolution: {integrity: sha512-9Q1Kgoo1ev3fKTpp9y5n8M4RLxd8B0f5o4y5FQe4dBU0j/bt+/YDrLZNWDm77JViV606XQ6fimG1FTTq6pT9/g==} + engines: {node: '>=18'} - cspell-grammar@6.31.3: - resolution: {integrity: sha512-TZYaOLIGAumyHlm4w7HYKKKcR1ZgEMKt7WNjCFqq7yGVW7U+qyjQqR8jqnLiUTZl7c2Tque4mca7n0CFsjVv5A==} - engines: {node: '>=14'} + cspell-grammar@8.14.2: + resolution: {integrity: sha512-eYwceVP80FGYVJenE42ALnvEKOXaXjq4yVbb1Ni1umO/9qamLWNCQ1RP6rRACy5e/cXviAbhrQ5Mtw6n+pyPEQ==} + engines: {node: '>=18'} hasBin: true - cspell-io@6.31.3: - resolution: {integrity: sha512-yCnnQ5bTbngUuIAaT5yNSdI1P0Kc38uvC8aynNi7tfrCYOQbDu1F9/DcTpbdhrsCv+xUn2TB1YjuCmm0STfJlA==} - engines: {node: '>=14'} + cspell-io@8.14.2: + resolution: {integrity: sha512-uaKpHiY3DAgfdzgKMQml6U8F8o9udMuYxGqYa5FVfN7D5Ap7B2edQzSLTUYwxrFEn4skSfp6XY73+nzJvxzH4Q==} + engines: {node: '>=18'} - cspell-lib@6.31.3: - resolution: {integrity: sha512-Dv55aecaMvT/5VbNryKo0Zos8dtHon7e1K0z8DR4/kGZdQVT0bOFWeotSLhuaIqoNFdEt8ypfKbrIHIdbgt1Hg==} - engines: {node: '>=14.6'} + cspell-lib@8.14.2: + resolution: {integrity: sha512-d2oiIXHXnADmnhIuFLOdNE63L7OUfzgpLbYaqAWbkImCUDkevfGrOgnX8TJ03fUgZID4nvQ+3kgu/n2j4eLZjQ==} + engines: {node: '>=18'} - cspell-trie-lib@6.31.3: - resolution: {integrity: sha512-HNUcLWOZAvtM3E34U+7/mSSpO0F6nLd/kFlRIcvSvPb9taqKe8bnSa0Yyb3dsdMq9rMxUmuDQtF+J6arZK343g==} - engines: {node: '>=14'} + cspell-trie-lib@8.14.2: + resolution: {integrity: sha512-rZMbaEBGoyy4/zxKECaMyVyGLbuUxYmZ5jlEgiA3xPtEdWwJ4iWRTo5G6dWbQsXoxPYdAXXZ0/q0GQ2y6Jt0kw==} + engines: {node: '>=18'} - cspell@6.31.3: - resolution: {integrity: sha512-VeeShDLWVM6YPiU/imeGy0lmg6ki63tbLEa6hz20BExhzzpmINOP5nSTYtpY0H9zX9TrF/dLbI38TuuYnyG3Uw==} - engines: {node: '>=14'} + cspell@8.14.2: + resolution: {integrity: sha512-ii/W7fwO4chNQVYl1C/8k7RW8EXzLb69rvg08p8mSJx8B2UasVJ9tuJpTH2Spo1jX6N3H0dKPWUbd1fAmdAhPg==} + engines: {node: '>=18'} hasBin: true + css-blank-pseudo@7.0.0: + resolution: {integrity: sha512-v9xXYGdm6LIn4iHEfu3egk/PM1g/yJr8uwTIj6E44kurv5dE/4y3QW7WdVmZ0PVnqfTuK+C0ClZcEEiaKWBL9Q==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + css-declaration-sorter@7.2.0: + resolution: {integrity: sha512-h70rUM+3PNFuaBDTLe8wF/cdWu+dOZmb7pJt8Z2sedYbAcQVQV/tEchueg3GWxwqS0cxtbxmaHEdkNACqcvsow==} + engines: {node: ^14 || ^16 || >=18} + peerDependencies: + postcss: ^8.0.9 + + css-has-pseudo@7.0.0: + resolution: {integrity: sha512-vO6k9bBt4/eEZ2PeHmS2VXjJga5SBy6O1ESyaOkse5/lvp6piFqg8Sh5KTU7X33M7Uh/oqo+M3EeMktQrZoTCQ==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + css-loader@6.11.0: + resolution: {integrity: sha512-CTJ+AEQJjq5NzLga5pE39qdiSV56F8ywCIsqNIRF0r7BDgWsN25aazToqAFg7ZrtA/U016xudB3ffgweORxX7g==} + engines: {node: '>= 12.13.0'} + peerDependencies: + '@rspack/core': 0.x || 1.x + webpack: ^5.0.0 + peerDependenciesMeta: + '@rspack/core': + optional: true + webpack: + optional: true + + css-minimizer-webpack-plugin@5.0.1: + resolution: {integrity: sha512-3caImjKFQkS+ws1TGcFn0V1HyDJFq1Euy589JlD6/3rV2kj+w7r5G9WDMgSHvpvXHNZ2calVypZWuEDQd9wfLg==} + engines: {node: '>= 14.15.0'} + peerDependencies: + '@parcel/css': '*' + '@swc/css': '*' + clean-css: '*' + csso: '*' + esbuild: '*' + lightningcss: '*' + webpack: ^5.0.0 + peerDependenciesMeta: + '@parcel/css': + optional: true + '@swc/css': + optional: true + clean-css: + optional: true + csso: + optional: true + esbuild: + optional: true + lightningcss: + optional: true + + css-prefers-color-scheme@10.0.0: + resolution: {integrity: sha512-VCtXZAWivRglTZditUfB4StnsWr6YVZ2PRtuxQLKTNRdtAf8tpzaVPE9zXIF3VaSc7O70iK/j1+NXxyQCqdPjQ==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + css-render@0.15.14: resolution: {integrity: sha512-9nF4PdUle+5ta4W5SyZdLCCmFd37uVimSjg1evcTqKJCyvCEEj12WKzOSBNak6r4im4J4iYXKH1OWpUV5LBYFg==} + css-select@4.3.0: + resolution: {integrity: sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==} + css-select@5.1.0: resolution: {integrity: sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==} @@ -9163,6 +11603,9 @@ packages: css.escape@1.5.1: resolution: {integrity: sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==} + cssdb@8.1.1: + resolution: {integrity: sha512-kRbSRgZoxtZNl5snb3nOzBkFOt5AwnephcUTIEFc2DebKG9PN50/cHarlwOooTxYQ/gxsnKs3BxykhNLmfvyLg==} + cssesc@3.0.0: resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==} engines: {node: '>=4'} @@ -9171,12 +11614,36 @@ packages: cssfilter@0.0.10: resolution: {integrity: sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw==} + cssnano-preset-advanced@6.1.2: + resolution: {integrity: sha512-Nhao7eD8ph2DoHolEzQs5CfRpiEP0xa1HBdnFZ82kvqdmbwVBUr2r1QuQ4t1pi+D1ZpqpcO4T+wy/7RxzJ/WPQ==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + + cssnano-preset-default@6.1.2: + resolution: {integrity: sha512-1C0C+eNaeN8OcHQa193aRgYexyJtU8XwbdieEjClw+J9d94E41LwT6ivKH0WT+fYwYWB0Zp3I3IZ7tI/BbUbrg==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + + cssnano-utils@4.0.2: + resolution: {integrity: sha512-ZR1jHg+wZ8o4c3zqf1SIUSTIvm/9mU343FMR6Obe/unskbvpGhZOo1J6d/r8D1pzkRQYuwbcH3hToOuoA2G7oQ==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + cssnano-utils@5.0.0: resolution: {integrity: sha512-Uij0Xdxc24L6SirFr25MlwC2rCFX6scyUmuKpzI+JQ7cyqDEwD42fJ0xfB3yLfOnRDU5LKGgjQ9FA6LYh76GWQ==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: postcss: ^8.4.31 + cssnano@6.1.2: + resolution: {integrity: sha512-rYk5UeX7VAM/u0lNqewCdasdtPK81CgX8wJFLEIXHbV2oldWRgJAsZrdhRXkV1NJzA2g850KiFm9mMU2HxNxMA==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + csso@5.0.5: resolution: {integrity: sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==} engines: {node: ^10 || ^12.20.0 || ^14.13.0 || >=15.0.0, npm: '>=7.0.0'} @@ -9237,6 +11704,10 @@ packages: d3-ease@1.0.7: resolution: {integrity: sha512-lx14ZPYkhNx0s/2HX5sLFUI3mbasHjSSpwO/KaaNACweVwxUruKyWVcb293wMv1RqTPZyZ8kSZ2NogUZNcLOFQ==} + d3-ease@3.0.1: + resolution: {integrity: sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w==} + engines: {node: '>=12'} + d3-geo-projection@2.1.2: resolution: {integrity: sha512-zft6RRvPaB1qplTodBVcSH5Ftvmvvg0qoDiqpt+fyNthGr/qr+DD30cizNDluXjW7jmo7EKUTjvFCAHofv08Ow==} hasBin: true @@ -9285,6 +11756,10 @@ packages: d3-timer@1.0.10: resolution: {integrity: sha512-B1JDm0XDaQC+uvo4DT79H0XmBskgS3l6Ve+1SBCfxgmtIb1AVrPIoqd+nPSv+loMX8szQ0sVUhGngL7D5QPiXw==} + d3-timer@3.0.1: + resolution: {integrity: sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA==} + engines: {node: '>=12'} + d3-transition@3.0.1: resolution: {integrity: sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w==} engines: {node: '>=12'} @@ -9320,12 +11795,15 @@ packages: dayjs@1.11.10: resolution: {integrity: sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==} - dayjs@1.11.12: - resolution: {integrity: sha512-Rt2g+nTbLlDWZTwwrIXjy9MeiZmSDI375FvZs72ngxx8PDC6YXOeR3q5LAuPzjZQxhiWdRKac7RKV+YyQYfYIg==} + dayjs@1.11.13: + resolution: {integrity: sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==} de-indent@1.0.2: resolution: {integrity: sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==} + debounce@1.2.1: + resolution: {integrity: sha512-XRRe6Glud4rd/ZGQfiV1ruXSfbvfJedlV9Y6zOlP+2K04vBYiJEte6stfFkCP03aMnY5tsipamumUjL14fofug==} + debug@2.6.9: resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} peerDependencies: @@ -9351,8 +11829,8 @@ packages: supports-color: optional: true - debug@4.3.5: - resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} + debug@4.3.7: + resolution: {integrity: sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==} engines: {node: '>=6.0'} peerDependencies: supports-color: '*' @@ -9360,8 +11838,8 @@ packages: supports-color: optional: true - debug@4.3.7: - resolution: {integrity: sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==} + debug@4.4.0: + resolution: {integrity: sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==} engines: {node: '>=6.0'} peerDependencies: supports-color: '*' @@ -9424,13 +11902,17 @@ packages: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} - default-browser-id@3.0.0: - resolution: {integrity: sha512-OZ1y3y0SqSICtE8DE4S8YOE9UZOJ8wO16fKWVP5J1Qz42kV9jcnMVFrEE/noXb/ss3Q4pZIH79kxofzyNNtUNA==} - engines: {node: '>=12'} + default-browser-id@5.0.0: + resolution: {integrity: sha512-A6p/pu/6fyBcA1TRz/GqWYPViplrftcW2gZC9q79ngNCKAeR/X3gcEdXQHl4KNXV+3wgIJ1CPkJQ3IHM6lcsyA==} + engines: {node: '>=18'} - default-browser@4.0.0: - resolution: {integrity: sha512-wX5pXO1+BrhMkSbROFsyxUm0i/cJEScyNhA4PPxc41ICuv05ZZB/MX28s8aZx6xjmatvebIapF6hLEKEcpneUA==} - engines: {node: '>=14.16'} + default-browser@5.2.1: + resolution: {integrity: sha512-WY/3TUME0x3KPYdRRxEJJvXRHV4PyPoUsxtZa78lwItwRQRHhd2U9xOscaT/YTf8uCXIAjeJOFBVEh/7FtD8Xg==} + engines: {node: '>=18'} + + default-gateway@6.0.3: + resolution: {integrity: sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg==} + engines: {node: '>= 10'} defaults@1.0.4: resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} @@ -9443,6 +11925,10 @@ packages: resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} engines: {node: '>= 0.4'} + define-lazy-prop@2.0.0: + resolution: {integrity: sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==} + engines: {node: '>=8'} + define-lazy-prop@3.0.0: resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==} engines: {node: '>=12'} @@ -9469,6 +11955,10 @@ packages: defu@6.1.4: resolution: {integrity: sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==} + del@6.1.1: + resolution: {integrity: sha512-ua8BhapfP0JUJKC/zV9yHHDW/rDoDxP4Zhn3AkA6/xT6gY7jYXJiaeyBZznYVujhZZET+UgcbZiQ7sN3WqcImg==} + engines: {node: '>=10'} + delayed-stream@1.0.0: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} engines: {node: '>=0.4.0'} @@ -9490,6 +11980,9 @@ packages: resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} engines: {node: '>= 0.8'} + deprecation@2.3.1: + resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==} + dequal@2.0.3: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} engines: {node: '>=6'} @@ -9504,6 +11997,9 @@ packages: detect-browser@5.3.0: resolution: {integrity: sha512-53rsFbGdwMwlF7qvCt0ypLM5V5/Mbl0szB7GPN8y9NCcbknYOeVVXdrXEq+90IwAfrrzt6Hd+u2E2ntakICU8w==} + detect-gpu@5.0.51: + resolution: {integrity: sha512-7P+5KDthVGXXWS06EuqBIq7YBijxfaNfm+BSFNTRAkZP26J97ASssh5KoR53diWNcBNOEb1ILfdsz2pzesSgYw==} + detect-indent@6.1.0: resolution: {integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==} engines: {node: '>=8'} @@ -9527,6 +12023,19 @@ packages: detect-node@2.1.0: resolution: {integrity: sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==} + detect-port-alt@1.1.6: + resolution: {integrity: sha512-5tQykt+LqfJFBEYaDITx7S7cR7mJ/zQmLXZ2qt5w04ainYZw6tBf9dBunMjVeVOdYVRUzUOE4HkY5J7+uttb5Q==} + engines: {node: '>= 4.2.1'} + hasBin: true + + detect-port@1.6.1: + resolution: {integrity: sha512-CmnVc+Hek2egPx1PeTFVta2W78xy2K/9Rkf6cC4T59S50tVnzKj+tnx5mmx5lwvCkujZ4uRrpRSuV+IVs3f90Q==} + engines: {node: '>= 4.0.0'} + hasBin: true + + devlop@1.1.0: + resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==} + dezalgo@1.0.4: resolution: {integrity: sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==} @@ -9573,16 +12082,32 @@ packages: os: [darwin] hasBin: true + dns-packet@5.6.1: + resolution: {integrity: sha512-l4gcSouhcgIKRvyy99RNVOgxXiicE+2jZoNmaNmZ6JXiGajBOJAesk1OBlJuM5k2c+eudGdLxDqXuPCKIj6kpw==} + engines: {node: '>=6'} + doctrine@3.0.0: resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} engines: {node: '>=6.0.0'} + docusaurus-plugin-sass@0.2.5: + resolution: {integrity: sha512-Z+D0fLFUKcFpM+bqSUmqKIU+vO+YF1xoEQh5hoFreg2eMf722+siwXDD+sqtwU8E4MvVpuvsQfaHwODNlxJAEg==} + peerDependencies: + '@docusaurus/core': ^2.0.0-beta || ^3.0.0-alpha + sass: ^1.30.0 + + docusaurus-preset-shiki-twoslash@1.1.41: + resolution: {integrity: sha512-Ny5Ot+r7dMnfkcD+YcdtSmM4LVWoLRGWe/A6AqzcN4h6mqE82EU6KMA53wVI50YqgTOIIrNNI6QJr70rPWebcw==} + dom-accessibility-api@0.6.3: resolution: {integrity: sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==} dom-align@1.12.4: resolution: {integrity: sha512-R8LUSEay/68zE5c8/3BDxiTEvgb4xZTF0RKmAHfiEVN3klfIpXfi2/QCoiWPccVQ0J/ZGdz9OjzL4uJEP/MRAw==} + dom-converter@0.2.0: + resolution: {integrity: sha512-gd3ypIPfOMr9h5jIKq8E3sHOTCjeirnl0WK5ZdS1AW0Odt0b1PaWaHdJ4Qk4klv+YB9aJBS7mESXjFoDQPu6DA==} + dom-helpers@5.2.1: resolution: {integrity: sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA==} @@ -9592,6 +12117,9 @@ packages: dom-serializer@0.2.2: resolution: {integrity: sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g==} + dom-serializer@1.4.1: + resolution: {integrity: sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==} + dom-serializer@2.0.0: resolution: {integrity: sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==} @@ -9604,16 +12132,23 @@ packages: domhandler@2.4.2: resolution: {integrity: sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA==} + domhandler@4.3.1: + resolution: {integrity: sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==} + engines: {node: '>= 4'} + domhandler@5.0.3: resolution: {integrity: sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==} engines: {node: '>= 4'} - dompurify@3.1.6: - resolution: {integrity: sha512-cTOAhc36AalkjtBpfG6O8JimdTMWNXjiePT2xQH/ppBGi/4uIpmj8eKyIkMJErXWARyINV/sB38yf8JCLF5pbQ==} + dompurify@3.2.3: + resolution: {integrity: sha512-U1U5Hzc2MO0oW3DF+G9qYN0aT7atAou4AgI0XjWz061nyBPbdxkfdhfy5uMgGn6+oLFCfn44ZGbdDqCzVmlOWA==} domutils@1.7.0: resolution: {integrity: sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==} + domutils@2.8.0: + resolution: {integrity: sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==} + domutils@3.1.0: resolution: {integrity: sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==} @@ -9624,6 +12159,10 @@ packages: resolution: {integrity: sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==} engines: {node: '>=8'} + dot-prop@6.0.1: + resolution: {integrity: sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==} + engines: {node: '>=10'} + dotenv-expand@11.0.6: resolution: {integrity: sha512-8NHi73otpWsZGBSZwwknTXS5pqMOrk9+Ssrna8xCaxkzEpU9OTf9R5ArQGVw03//Zmk9MOwLPng9WwndvpAJ5g==} engines: {node: '>=12'} @@ -9631,6 +12170,10 @@ packages: dotenv-expand@5.1.0: resolution: {integrity: sha512-YXQl1DSa4/PQyRfgrv6aoNjhasp/p4qs9FjJ4q4cQk+8m4r6k4ZSiEyytKG8f8W9gi8WsQtIObNmKd+tMzNTmA==} + dotenv-expand@8.0.3: + resolution: {integrity: sha512-SErOMvge0ZUyWd5B0NXMQlDkN+8r+HhVUsxgOO7IoPDOdDRD2JjExpN6y3KnFR66jsJMwSn1pqIivhU5rcJiNg==} + engines: {node: '>=12'} + dotenv@16.4.5: resolution: {integrity: sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==} engines: {node: '>=12'} @@ -9643,6 +12186,9 @@ packages: resolution: {integrity: sha512-UGGGWfSauusaVJC+8fgV+NVvBXkCTmVv7sk6nojDZZvuOUNGUy0Zk4UpHQD6EDjS0jpBwcACvH4eofvyzBcRDw==} hasBin: true + draco3d@1.5.7: + resolution: {integrity: sha512-m6WCKt/erDXcw+70IJXnG7M3awwQPAsZvJGX5zY7beBqpELw6RDGkYVU0W43AFxye4pDZ5i2Lbyc/NNGqwjUVQ==} + duplexer2@0.1.4: resolution: {integrity: sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==} @@ -9703,12 +12249,12 @@ packages: electron-publish@24.13.1: resolution: {integrity: sha512-2ZgdEqJ8e9D17Hwp5LEq5mLQPjqU3lv/IALvgp+4W8VeNhryfGhYEQC/PgDPMrnWUp+l60Ou5SJLsu+k4mhQ8A==} - electron-to-chromium@1.4.576: - resolution: {integrity: sha512-yXsZyXJfAqzWk1WKryr0Wl0MN2D47xodPvEEwlVePBnhU5E7raevLQR+E6b9JAD3GfL/7MbAL9ZtWQQPcLx7wA==} - electron-to-chromium@1.4.832: resolution: {integrity: sha512-cTen3SB0H2SGU7x467NRe1eVcQgcuS6jckKfWJHia2eo0cHIGOqHoAxevIYZD4eRHcWjkvFzo93bi3vJ9W+1lA==} + electron-to-chromium@1.5.33: + resolution: {integrity: sha512-+cYTcFB1QqD4j4LegwLfpCNxifb6dDFUAwk6RsLusCwIaZI6or2f+q8rs5tTB2YC53HhOlIbEaqHMAAC8IOIwA==} + electron-winstaller@5.3.1: resolution: {integrity: sha512-oM8BW3a8NEqG0XW+Vx3xywhk0DyDV4T0jT0zZfWt0IczNT3jHAAvQWBorF8osQDplSsCyXXyxrsrQ8cY0Slb/A==} engines: {node: '>=8.0.0'} @@ -9727,6 +12273,9 @@ packages: resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} engines: {node: '>=12'} + emoji-regex-xs@1.0.0: + resolution: {integrity: sha512-LRlerrMYoIDrT6jgpeZ2YYl/L8EulRTt5hQcYjy5AInh7HWXKimpqx68aknBFpGL2+/IcogTcaydJEgaTmOpDg==} + emoji-regex@10.3.0: resolution: {integrity: sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==} @@ -9736,10 +12285,16 @@ packages: emoji-regex@9.2.2: resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} + emojilib@2.4.0: + resolution: {integrity: sha512-5U0rVMU5Y2n2+ykNLQqMoqklN9ICBT/KsvC1Gz6vqHbz2AXXGkG+Pm5rMWk/8Vjrr/mY9985Hi8DYzn1F09Nyw==} + emojis-list@3.0.0: resolution: {integrity: sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==} engines: {node: '>= 4'} + emoticon@4.1.0: + resolution: {integrity: sha512-VWZfnxqwNcc51hIy/sbOdEem6D+cVtpPzEEtVAFdaas30+1dgkyaOQ4sQ6Bp0tOMqWO1v+HQfYaoodOkdhK6SQ==} + encode-utf8@1.0.3: resolution: {integrity: sha512-ucAnuBEhUK4boH2HjVYG5Q2mQyPorvv0u/ocS+zhdw0S8AlHYY+GOFhP1Gio5z4icpP2ivFSvhtFjQi8+T9ppw==} @@ -9779,6 +12334,10 @@ packages: resolution: {integrity: sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==} engines: {node: '>=6'} + env-paths@3.0.0: + resolution: {integrity: sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + envinfo@7.11.1: resolution: {integrity: sha512-8PiZgZNIB4q/Lw4AhOvAfB/ityHAd2bli3lESSWmWSzSsl5dKpy5N1d1Rfkd2teq/g9xN90lc6o98DOjMeYHpg==} engines: {node: '>=4'} @@ -9794,6 +12353,9 @@ packages: error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} + error-stack-parser-es@0.1.5: + resolution: {integrity: sha512-xHku1X40RO+fO8yJ8Wh2f2rZWVjqyhb1zgq1yZ8aZRQkv6OOKhKWRUaht3eSCUbAOBaKIgM+ykwFLE+QUxgGeg==} + es-abstract@1.22.3: resolution: {integrity: sha512-eiiY8HQeYfYH2Con2berK+To6GrK2RxbPawDkGq4UiCQQfZHb6wX9qQqkbpPqaxQFcl8d9QzZqo0tGE0VcrdwA==} engines: {node: '>= 0.4'} @@ -9840,6 +12402,10 @@ packages: resolution: {integrity: sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==} engines: {node: '>=6'} + escape-goat@4.0.0: + resolution: {integrity: sha512-2Sd4ShcWxbx6OY1IHyla/CVNwvg7XwZVoXZHcSu9w9SReNP1EzzD5T8NWKIR38fIqEns9kDWKUQTXXAmlDrdPg==} + engines: {node: '>=12'} + escape-html@1.0.3: resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} @@ -9932,6 +12498,24 @@ packages: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} + estree-util-attach-comments@3.0.0: + resolution: {integrity: sha512-cKUwm/HUcTDsYh/9FgnuFqpfquUbwIqwKM26BVCGDPVgvaCl/nDCCjUfiLlx6lsEZ3Z4RFxNbOQ60pkaEwFxGw==} + + estree-util-build-jsx@3.0.1: + resolution: {integrity: sha512-8U5eiL6BTrPxp/CHbs2yMgP8ftMhR5ww1eIKoWRMlqvltHF8fZn5LRDvTKuxD3DUn+shRbLGqXemcP51oFCsGQ==} + + estree-util-is-identifier-name@3.0.0: + resolution: {integrity: sha512-hFtqIDZTIUZ9BXLb8y4pYGyk6+wekIivNVTcmvk8NoOh+VeRn5y6cEHzbURrWbfp1fIqdVipilzj+lfaadNZmg==} + + estree-util-to-js@2.0.0: + resolution: {integrity: sha512-WDF+xj5rRWmD5tj6bIqRi6CkLIXbbNQUcxQHzGysQzvHmdYG2G7p/Tf0J0gpxGgkeMZNTIjT/AoSvC9Xehcgdg==} + + estree-util-value-to-estree@3.1.2: + resolution: {integrity: sha512-S0gW2+XZkmsx00tU2uJ4L9hUT7IFabbml9pHh2WQqFmAbxit++YGZne0sKJbNwkj9Wvg9E4uqWl4nCIFQMmfag==} + + estree-util-visit@2.0.0: + resolution: {integrity: sha512-m5KgiH85xAhhW8Wta0vShLcUvOsh3LLPI2YVwcbio1l7E09NTLL1EyMZFM1OyWowoH0skScNbhOPl4kcBgzTww==} + estree-walker@2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} @@ -9942,6 +12526,10 @@ packages: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} + eta@2.2.0: + resolution: {integrity: sha512-UVQ72Rqjy/ZKQalzV5dCCJP80GrmPrMxh6NlNf+erV6ObL0ZFkhCstWRawS85z3smdr3d2wXPsZEY7rDPfGd2g==} + engines: {node: '>=6.0.0'} + etag@1.8.1: resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} engines: {node: '>= 0.6'} @@ -9975,6 +12563,10 @@ packages: resolution: {integrity: sha512-UduyVP7TLB5IcAQl+OzLyLcS/l32W/GLg+AhHJ+ow40FOk2U3SAllPwR44v4vmdFwIWqpdwxxpQbF1n5ta9seA==} engines: {node: ^14.18.0 || ^16.14.0 || >=18.0.0} + execa@8.0.0: + resolution: {integrity: sha512-CTNS0BcKBcoOsawKBlpcKNmK4Kjuyz5jVLhf+PUsHGMqiKMVTa4cN3U7r7bRY8KTpfOGpXMo27fdy0dYVg2pqA==} + engines: {node: '>=16.17'} + execa@8.0.1: resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==} engines: {node: '>=16.17'} @@ -9991,6 +12583,10 @@ packages: resolution: {integrity: sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA==} engines: {node: '>=0.10.0'} + expand-template@2.0.3: + resolution: {integrity: sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==} + engines: {node: '>=6'} + expand-tilde@2.0.2: resolution: {integrity: sha512-A5EmesHW6rfnZ9ysHQjPdJRni0SRar0tjtG5MNtm9n5TUvsYU8oozprtRD4AqHxcZWWlVuAmQo2nWKfN9oyjTw==} engines: {node: '>=0.10.0'} @@ -10110,69 +12706,12 @@ packages: farm-plugin-remove-console@0.1.8: resolution: {integrity: sha512-t/QH2N97w2/VM4tj/hmnceU/95yYeORR5BnlWP91PherULRFhTVctECcC0JI33Psvyk06uSW4BuKgBPtktM5+w==} - farm-plugin-replace-dirname-darwin-arm64@0.2.1: - resolution: {integrity: sha512-9FThv/qoFuj3cJjv9P6YnXbBwPQ5TwGjnr50ejXdZn13Ehz0+7w7EscbRsZHNvT7p24p6i0Y9NUSallcWc2syw==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [darwin] - - farm-plugin-replace-dirname-darwin-x64@0.2.1: - resolution: {integrity: sha512-Msqrh8mAPBbEpANpa0z9uQBr1/MO+PaHgBxym/aNs1vpxB4KAs6JQWYKtO+Ob7JzFyV6d9lIRhpnpxzxTqSIfA==} - engines: {node: '>= 10'} - cpu: [x64] - os: [darwin] - - farm-plugin-replace-dirname-linux-arm64-gnu@0.2.1: - resolution: {integrity: sha512-ZKuxGu9G01CW521uTQHh+IP8pcT/NolGQfcQuEmBpD8epJ8per8Ps52fS05u5TGniaOg+ySZpt7HxbX+++k1YQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - farm-plugin-replace-dirname-linux-arm64-musl@0.2.1: - resolution: {integrity: sha512-m3gH8ggczbRYTHZSNp3LjIQIcqhvDO4O78bxXc8O1ozKD8M47/YfQLyQV06M7H4rZ8s6XV3Bb1kAcRAASp3M5A==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [linux] - - farm-plugin-replace-dirname-linux-x64-gnu@0.2.1: - resolution: {integrity: sha512-MehKkoM2RFw3sCnEu9nCbXKjxtC3hfTad0h/dC+Z8iEBcLEReVLoNzHWWUa6BxkxqDtB82/BWO/ObSUj/VUnwQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - farm-plugin-replace-dirname-linux-x64-musl@0.2.1: - resolution: {integrity: sha512-o1qPZi16N/sHOteZYJVv6UmZFK3QKpVQrywk/4spJI0mPH9A9Y+G6iBE2Tqjb3d+1Hb6phr++EBJHZ2x1ajtGQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [linux] - - farm-plugin-replace-dirname-win32-arm64-msvc@0.2.1: - resolution: {integrity: sha512-Xn/wYFkgb7SsTlSaefFtvxNbXEVdvZB854b/rBZu47+MRQpSnBIPwnTGcqo8eNTMjtnY4beGGtcd78iqMVAHFQ==} - engines: {node: '>= 10'} - cpu: [arm64] - os: [win32] - - farm-plugin-replace-dirname-win32-ia32-msvc@0.2.1: - resolution: {integrity: sha512-YtIu5CS/BSgbQZb1qjaBg0cEKvB4vCIbBxNn64H468zwliPbE93SAIyiwu6cL3la59cjBP4sEbz4ZAWyY9GoMQ==} - engines: {node: '>= 10'} - cpu: [ia32] - os: [win32] - - farm-plugin-replace-dirname-win32-x64-msvc@0.2.1: - resolution: {integrity: sha512-KUAf4rcv3Nz+CpGs4zr+ZRu4hWRp7SHQBgpX+mb0hhMjRvn+LoWm2qCL2q9Gp3jsTDVmzjPbyZxp/9UJKx13lQ==} - engines: {node: '>= 10'} - cpu: [x64] - os: [win32] - - farm-plugin-replace-dirname@0.2.1: - resolution: {integrity: sha512-aJ4euQzxoq0sVu4AwXrNQflHJrSZdrdApGEyVRtN6KiCop3CHXnTg9ydlyCNXN2unQB283aNjojvCd5E/32KgA==} - farmup@0.1.5: resolution: {integrity: sha512-LiO7ejtsD8GfRL6OXVSx9Y9h8wFp1nEw/RWydQe+zLN9W7xmPXWngi5TjzndYuqADBQi/93qD0aaZ4TYkoabiA==} hasBin: true - fast-check@3.23.2: - resolution: {integrity: sha512-h5+1OzzfCC3Ef7VbtKdcv7zsstUQwUDlYpUTvjeUsJAssPgLn7QzbboPtL5ro04Mq0rPOsMzl7q5hIbRs2wD1A==} + fast-check@3.23.1: + resolution: {integrity: sha512-u/MudsoQEgBUZgR5N1v87vEgybeVYus9VnDVaIkxkkGP2jt54naghQ3PCQHJiogS8U/GavZCUPFfx3Xkp+NaHw==} engines: {node: '>=8.0.0'} fast-deep-equal@3.1.3: @@ -10181,8 +12720,12 @@ packages: fast-diff@1.3.0: resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - fast-equals@4.0.3: - resolution: {integrity: sha512-G3BSX9cfKttjr+2o1O22tYMLq0DPluZnYtq1rXumE1SpL/F/SLIfHx08WYQoWSIpeMYf8sRbJ8++71+v6Pnxfg==} + fast-equals@5.0.1: + resolution: {integrity: sha512-WF1Wi8PwwSY7/6Kx0vKXtw8RwuSGoM1bvDaJbu7MxDlR1vovZjIAKrnzyrThgAjm6JDTu0fVgWXDlMGspodfoQ==} + engines: {node: '>=6.0.0'} + + fast-fifo@1.3.2: + resolution: {integrity: sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==} fast-glob@3.3.1: resolution: {integrity: sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==} @@ -10207,6 +12750,13 @@ packages: fastq@1.15.0: resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==} + fault@2.0.1: + resolution: {integrity: sha512-WtySTkS4OKev5JtpHXnib4Gxiurzh5NCGvWrFaZ34m6JehfTUhKZvn9njTfw48t6JumVQOmrKqpmGcdwxnhqBQ==} + + faye-websocket@0.11.4: + resolution: {integrity: sha512-CzbClwlXAuiRQAlUyfqPgvPoNKTckTPGfwZV4ZdAhVcP2lh9KUxJg2b5GkE7XbjKQ3YJnQ9z6D9ntLAlB+tP8g==} + engines: {node: '>=0.8.0'} + fb-watchman@2.0.2: resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} @@ -10224,9 +12774,23 @@ packages: fecha@4.2.3: resolution: {integrity: sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==} + feed@4.2.2: + resolution: {integrity: sha512-u5/sxGfiMfZNtJ3OvQpXcvotFpYkL0n9u9mM2vkui2nGo8b4wvDkJ8gAkYqbA8QpGyFCv3RK0Z+Iv+9veCS9bQ==} + engines: {node: '>=0.4.0'} + + fenceparser@1.1.1: + resolution: {integrity: sha512-VdkTsK7GWLT0VWMK5S5WTAPn61wJ98WPFwJiRHumhg4ESNUO/tnkU8bzzzc62o6Uk1SVhuZFLnakmDA4SGV7wA==} + engines: {node: '>=12'} + fflate@0.3.11: resolution: {integrity: sha512-Rr5QlUeGN1mbOHlaqcSYMKVpPbgLy0AWT/W0EHxA6NGI12yO1jpoui2zBBvU2G824ltM6Ut8BFgfHSBGfkmS0A==} + fflate@0.6.10: + resolution: {integrity: sha512-IQrh3lEPM93wVCEczc9SaAOvkmcoQn/G8Bo1e8ZPlY3X3bnAxWaBdvTdvM1hP62iZp0BXWDy4vTAy4fF0+Dlpg==} + + fflate@0.8.2: + resolution: {integrity: sha512-cPJU47OaAoCbg0pBvzsgpTPhmhqI5eJjh/JIu8tPj5q+T7iLvW/JAYUqmE7KOB4R1ZyEhzBaIQpQpardBF5z8A==} + figures@2.0.0: resolution: {integrity: sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==} engines: {node: '>=4'} @@ -10235,14 +12799,24 @@ packages: resolution: {integrity: sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==} engines: {node: '>=8'} - figures@5.0.0: - resolution: {integrity: sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==} - engines: {node: '>=14'} - file-entry-cache@6.0.1: resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} engines: {node: ^10.12.0 || >=12.0.0} + file-entry-cache@9.1.0: + resolution: {integrity: sha512-/pqPFG+FdxWQj+/WSuzXSDaNzxgTLr/OrR1QuqfEZzDakpdYE70PwUxL7BPUa8hpjbvY1+qvCl8k+8Tq34xJgg==} + engines: {node: '>=18'} + + file-loader@6.2.0: + resolution: {integrity: sha512-qo3glqyTa61Ytg4u73GultjHGjdRyig3tG6lPtyX/jOEJvHif9uB0/OCI2Kif6ctF3caQTW2G5gym21oAsI4pw==} + engines: {node: '>= 10.13.0'} + peerDependencies: + webpack: ^4.0.0 || ^5.0.0 + + file-selector@0.5.0: + resolution: {integrity: sha512-s8KNnmIDTBoD0p9uJ9uD0XY38SCeBOtj0UMXyQSLg1Ypfrfj8+dAvwsLjYQkQ2GjhVtp2HrnF5cJzMhBjfD8HA==} + engines: {node: '>= 10'} + file-size@1.0.0: resolution: {integrity: sha512-tLIdonWTpABkU6Axg2yGChYdrOsy4V8xcm0IcyAP8fSsu6jiXLm5pgs083e4sq5fzNRZuAYolUbZyYmPvCKfwQ==} @@ -10261,6 +12835,10 @@ packages: resolution: {integrity: sha512-Dx770ai81ohflojxhU+oG+Z2QGvKdYxgEr9OSA8UVrqhwNHjfH9A8f5NKfg83fEH8ZFA5N5llJo5T3PIoZ4CRA==} engines: {node: '>= 10.4.0'} + filesize@8.0.7: + resolution: {integrity: sha512-pjmC+bkIF8XI7fWaH8KxHcZL3DPybs1roSKP4rKDvy20tAWwIObE4+JIseG2byfGKhud5ZnM4YSGKBz7Sh0ndQ==} + engines: {node: '>= 0.4.0'} + fill-range@4.0.0: resolution: {integrity: sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ==} engines: {node: '>=0.10.0'} @@ -10269,21 +12847,41 @@ packages: resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} engines: {node: '>=8'} + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + filter-obj@1.1.0: resolution: {integrity: sha512-8rXg1ZnX7xzy2NGDVkBVaAy+lSlPNwad13BtgSlLuxfIslyt5Vg64U7tFcCt4WS1R0hvtnQybT/IyCkGZ3DpXQ==} engines: {node: '>=0.10.0'} + finalhandler@1.1.2: + resolution: {integrity: sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==} + engines: {node: '>= 0.8'} + finalhandler@1.2.0: resolution: {integrity: sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==} engines: {node: '>= 0.8'} + find-cache-dir@4.0.0: + resolution: {integrity: sha512-9ZonPT4ZAK4a+1pUPVPZJapbi7O5qbbJPdYw/NOQWZZbVLdDTYM3A4R9z/DpAM08IDaFGsvPgiGZ82WEwUDWjg==} + engines: {node: '>=14.16'} + find-root@1.1.0: resolution: {integrity: sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==} + find-up-simple@1.0.0: + resolution: {integrity: sha512-q7Us7kcjj2VMePAa02hDAF6d+MzsdsAWEwYyOpwUtlerRBkOEPBCRZrAV4XfcSN8fHAgaD0hP7miwoay6DCprw==} + engines: {node: '>=18'} + find-up@2.1.0: resolution: {integrity: sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==} engines: {node: '>=4'} + find-up@3.0.0: + resolution: {integrity: sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==} + engines: {node: '>=6'} + find-up@4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} engines: {node: '>=8'} @@ -10303,9 +12901,20 @@ packages: resolution: {integrity: sha512-/qM2b3LUIaIgviBQovTLvijfyOQXPtSRnRK26ksj2J7rzPIecePUIpJsZ4T02Qg+xiAEKIs5K8dsHEd+VaKa/Q==} engines: {node: '>=12.0.0'} + flat-cache@5.0.0: + resolution: {integrity: sha512-JrqFmyUl2PnPi1OvLyTVHnQvwQ0S+e6lGSwu8OkAZlSaNIZciTY2H/cOOROxsBA1m/LZNHDsqAgDZt6akWcjsQ==} + engines: {node: '>=18'} + + flat@5.0.2: + resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} + hasBin: true + flatted@3.2.9: resolution: {integrity: sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==} + flatted@3.3.1: + resolution: {integrity: sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==} + flora-colossus@2.0.0: resolution: {integrity: sha512-dz4HxH6pOvbUzZpZ/yXhafjbR2I8cenK5xL0KtBFb7U2ADsR+OwXifnxZjij/pZWF775uSCMzWVd+jDik2H2IA==} engines: {node: '>= 12'} @@ -10317,8 +12926,8 @@ packages: resolution: {integrity: sha512-a8Ge6cdKh9za/GZR/qtigTAk7SrGore56EFcoMshClsh7FLk1zwszc/ltuMfKhx56qeuyL/jWQ4J4axou0iJ9w==} engines: {node: '>=10'} - focus-trap@7.5.4: - resolution: {integrity: sha512-N7kHdlgsO/v+iD/dMoJKtsSqs5Dz/dXZVebRgJw23LDk+jMi/974zyiOYDziY2JPp8xivq9BmUGwIJMiuSBi7w==} + focus-trap@7.6.0: + resolution: {integrity: sha512-1td0l3pMkWJLFipobUcGaf+5DTY4PLDDrcqoSaKP8ediO/CoWCCYk/fT/Y2A4e6TNB+Sh6clRJCjOPPnKoNHnQ==} follow-redirects@1.15.3: resolution: {integrity: sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q==} @@ -10362,6 +12971,20 @@ packages: resolution: {integrity: sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==} engines: {node: '>=14'} + fork-ts-checker-webpack-plugin@6.5.3: + resolution: {integrity: sha512-SbH/l9ikmMWycd5puHJKTkZJKddF4iRLyW3DeZ08HTI7NGyLS38MXd/KGgeWumQO7YNQbW2u/NtPT2YowbPaGQ==} + engines: {node: '>=10', yarn: '>=1.0.0'} + peerDependencies: + eslint: '>= 6' + typescript: '>= 2.7' + vue-template-compiler: '*' + webpack: '>= 4' + peerDependenciesMeta: + eslint: + optional: true + vue-template-compiler: + optional: true + fork-ts-checker-webpack-plugin@9.0.2: resolution: {integrity: sha512-Uochze2R8peoN1XqlSi/rGUkDQpRogtLFocP9+PGu68zk1BDAKXfdeCdyVZpgTk8V8WFVQXdEz426VKjXLO1Gg==} engines: {node: '>=12.13.0', yarn: '>=1.0.0'} @@ -10369,10 +12992,18 @@ packages: typescript: '>3.6.0' webpack: ^5.11.0 + form-data-encoder@2.1.4: + resolution: {integrity: sha512-yDYSgNMraqvnxiEXO4hi88+YZxaHC6QKzb5N84iRCTDeRO7ZALpir/lVmf/uXUhnwUr2O4HU8s/n6x+yNjQkHw==} + engines: {node: '>= 14.17'} + form-data@4.0.0: resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} engines: {node: '>= 6'} + format@0.2.2: + resolution: {integrity: sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww==} + engines: {node: '>=0.4.x'} + formidable@2.1.2: resolution: {integrity: sha512-CM3GuJ57US06mlpQ47YcunuUZ9jpm8Vx+P2CGt2j7HpgkKZO/DJYQ0Bobim8G6PFQmK5lOqOOdUXboU+h73A4g==} @@ -10391,10 +13022,27 @@ packages: resolution: {integrity: sha512-GMBAbW9antB8iZRHLoGw0b3HANt57diZYFO/HL1JGIC1MjKrdmhxvrJbupnVvpys0zsz7yBApXdQyfepKly2kA==} engines: {node: '>=0.10.0'} + framer-motion@11.11.1: + resolution: {integrity: sha512-Ucr9eHSrk0d+l6vyl9fvq6omh/PAWHjS+PlczpsoUdhJo1TuF3ULWJNuAMnpWQ1dGyPOyoUVuYlUKjE/s8dyCA==} + peerDependencies: + '@emotion/is-prop-valid': '*' + react: ^18.0.0 + react-dom: ^18.0.0 + peerDependenciesMeta: + '@emotion/is-prop-valid': + optional: true + react: + optional: true + react-dom: + optional: true + fresh@0.5.2: resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} engines: {node: '>= 0.6'} + fs-constants@1.0.0: + resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==} + fs-extra@10.1.0: resolution: {integrity: sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==} engines: {node: '>=12'} @@ -10457,9 +13105,9 @@ packages: engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} deprecated: This package is no longer supported. - gensequence@5.0.2: - resolution: {integrity: sha512-JlKEZnFc6neaeSVlkzBGGgkIoIaSxMgvdamRoPN8r3ozm2r9dusqxeKqYQ7lhzmj2UhFQP8nkyfCaiLQxiLrDA==} - engines: {node: '>=14'} + gensequence@7.0.0: + resolution: {integrity: sha512-47Frx13aZh01afHJTB3zTtKIlFI6vWY+MYCN9Qpew6i52rfKjnhCF/l1YlC8UmEMvvntZZ6z4PiCcmyuedR2aQ==} + engines: {node: '>=18'} gensync@1.0.0-beta.2: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} @@ -10489,6 +13137,9 @@ packages: resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} engines: {node: '>= 0.4'} + get-own-enumerable-property-symbols@3.0.2: + resolution: {integrity: sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==} + get-package-info@1.0.0: resolution: {integrity: sha512-SCbprXGAPdIhKAXiG+Mk6yeoFH61JlYunqdFQFHDtLjJlDjFf6x07dsS8acO+xWt52jpdVo49AlVDnUVK1sDNw==} engines: {node: '>= 4.0'} @@ -10501,9 +13152,9 @@ packages: resolution: {integrity: sha512-QB9NKEeDg3xxVwCCwJQ9+xycaz6pBB6iQ76wiWMl1927n0Kir6alPiP+yuiICLLU4jpMe08dXfpebuQppFA2zw==} engines: {node: '>=16'} - get-stdin@8.0.0: - resolution: {integrity: sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==} - engines: {node: '>=10'} + get-stdin@9.0.0: + resolution: {integrity: sha512-dVKBjfWisLAicarI2Sf+JuBE/DghV4UzNAVe9yhEJuzeREd3JhOTE9cUaJTeSa77fsbQUK3pcOpJfM59+VKZaA==} + engines: {node: '>=12'} get-stream@4.1.0: resolution: {integrity: sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==} @@ -10537,6 +13188,12 @@ packages: engines: {node: '>=10'} hasBin: true + github-from-package@0.0.0: + resolution: {integrity: sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==} + + github-slugger@1.5.0: + resolution: {integrity: sha512-wIh+gKBI9Nshz2o46B0B3f5k/W+WI9ZAv6y5Dn5WJ5SK1t0TnDimB4WE5rmTD05ZAIn8HALCZVmCsvj0w0v0lw==} + gl-matrix@3.4.3: resolution: {integrity: sha512-wcCp8vu8FT22BnvKVPjXa/ICBWRq/zjFfdofZy1WSpQZpphblv12/bOQLBC1rMM7SGOFS9ltVmKOHil5+Ml7gA==} @@ -10561,6 +13218,11 @@ packages: engines: {node: '>=16 || 14 >=14.18'} hasBin: true + glob@11.0.0: + resolution: {integrity: sha512-9UiX/Bl6J2yaBbxKoEBRm4Cipxgok8kQYcOPEhScPwebu2I0HoQOuYdIO6S3hLuWoZgpDpwQZMzTFxgpkyT76g==} + engines: {node: 20 || >=22} + hasBin: true + glob@7.1.6: resolution: {integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==} deprecated: Glob versions prior to v9 are no longer supported @@ -10578,18 +13240,34 @@ packages: resolution: {integrity: sha512-PT6XReJ+D07JvGoxQMkT6qji/jVNfX/h364XHZOWeRzy64sSFr+xJ5OX7LI3b4MPQzdL4H8Y8M0xzPpsVMwA8Q==} engines: {node: '>=10.0'} + global-directory@4.0.1: + resolution: {integrity: sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==} + engines: {node: '>=18'} + global-dirs@0.1.1: resolution: {integrity: sha512-NknMLn7F2J7aflwFOlGdNIuCDpN3VGoSoB+aap3KABFWbHVn1TCgFC+np23J8W2BiZbjfEw3BFBycSMv1AFblg==} engines: {node: '>=4'} + global-dirs@3.0.1: + resolution: {integrity: sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA==} + engines: {node: '>=10'} + global-modules@1.0.0: resolution: {integrity: sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==} engines: {node: '>=0.10.0'} + global-modules@2.0.0: + resolution: {integrity: sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==} + engines: {node: '>=6'} + global-prefix@1.0.2: resolution: {integrity: sha512-5lsx1NUDHtSjfg0eHlmYvZKv8/nVqX4ckFbM+FrGcQ+04KWcWFo9P5MxPZYSzUvyzmdTbI7Eix8Q4IbELDqzKg==} engines: {node: '>=0.10.0'} + global-prefix@3.0.0: + resolution: {integrity: sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==} + engines: {node: '>=6'} + globals@11.12.0: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} @@ -10606,9 +13284,16 @@ packages: resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} engines: {node: '>=10'} + globby@13.2.2: + resolution: {integrity: sha512-Y1zNGV+pzQdh7H39l9zgB4PJqjRNqydvdYCDG4HFXM4XuvSaQQlEc91IU1yALL8gUTDomgBAfz3XJdmUS+oo0w==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + globrex@0.1.2: resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==} + glsl-noise@0.0.0: + resolution: {integrity: sha512-b/ZCF6amfAUb7dJM/MxRs7AetQEahYzJ8PtgfrmEdtw6uyGOr+ZSGtgjFm6mfsBkxJ4d2W7kg+Nlqzqvn3Bc0w==} + good-listener@1.2.2: resolution: {integrity: sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==} @@ -10619,6 +13304,13 @@ packages: resolution: {integrity: sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==} engines: {node: '>=10.19.0'} + got@12.6.1: + resolution: {integrity: sha512-mThBblvlAF1d4O5oqyvN+ZxLAYwIJK7bpMxgYqPD9okW0C3qm5FFn7k811QrcuEBwaogR3ngOFoCfs6mRv7teQ==} + engines: {node: '>=14.16'} + + graceful-fs@4.2.10: + resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} + graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} @@ -10635,10 +13327,17 @@ packages: graphlib@2.1.8: resolution: {integrity: sha512-jcLLfkpoVGmH7/InMC/1hIvOPSUh38oJtGhvrOFGzioE1DZ+0YW16RgmOJhHiuWTvGiJQ9Z1Ik43JvkRPRvE+A==} + gray-matter@4.0.3: + resolution: {integrity: sha512-5v6yZd4JK3eMI3FqqCouswVqwugaA9r4dNZB1wwcmrD02QkV5H0y7XBQW8QwQqEaZY1pM9aqORSORhJRdNK44Q==} + engines: {node: '>=6.0'} + gzip-size@6.0.0: resolution: {integrity: sha512-ax7ZYomf6jqPTQ4+XCpUGyXKHk5WweS+e05MBO4/y3WJ5RkmPXNKvX+bx1behVILVwr6JSQvZAku021CHPXG3Q==} engines: {node: '>=10'} + handle-thing@2.0.1: + resolution: {integrity: sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg==} + hard-rejection@2.1.0: resolution: {integrity: sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==} engines: {node: '>=6'} @@ -10700,6 +13399,10 @@ packages: resolution: {integrity: sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ==} engines: {node: '>=0.10.0'} + has-yarn@3.0.0: + resolution: {integrity: sha512-IrsVwUHhEULx3R8f/aA8AHuEzAorplsab/v8HBzEiIukwq5i/EC+xmOW+HfP1OaDP+2JkgT1yILHN2O3UFIbcA==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + has@1.0.4: resolution: {integrity: sha512-qdSAmqLF6209RFj4VVItywPMbm3vWylknmB3nvNiUIs72xAimcM8nVYxYr7ncvZq5qzk9MKIZR8ijqD/1QuYjQ==} engines: {node: '>= 0.4.0'} @@ -10726,21 +13429,48 @@ packages: hast-util-from-parse5@7.1.2: resolution: {integrity: sha512-Nz7FfPBuljzsN3tCQ4kCBKqdNhQE2l0Tn+X1ubgKBPRoiDIu1mL08Cfw4k7q71+Duyaw7DXDN+VTAp4Vh3oCOw==} + hast-util-from-parse5@8.0.1: + resolution: {integrity: sha512-Er/Iixbc7IEa7r/XLtuG52zoqn/b3Xng/w6aZQ0xGVxzhw5xUFxcRqdPzP6yFi/4HBYRaifaI5fQ1RH8n0ZeOQ==} + hast-util-is-element@2.1.3: resolution: {integrity: sha512-O1bKah6mhgEq2WtVMk+Ta5K7pPMqsBBlmzysLdcwKVrqzZQ0CHqUPiIVspNhAG1rvxpvJjtGee17XfauZYKqVA==} hast-util-parse-selector@3.1.1: resolution: {integrity: sha512-jdlwBjEexy1oGz0aJ2f4GKMaVKkA9jwjr4MjAAI22E5fM/TXVZHuS5OpONtdeIkRKqAaryQ2E9xNQxijoThSZA==} + hast-util-parse-selector@4.0.0: + resolution: {integrity: sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A==} + + hast-util-raw@9.0.4: + resolution: {integrity: sha512-LHE65TD2YiNsHD3YuXcKPHXPLuYh/gjp12mOfU8jxSrm1f/yJpsb0F/KKljS6U9LJoP0Ux+tCe8iJ2AsPzTdgA==} + + hast-util-to-estree@3.1.0: + resolution: {integrity: sha512-lfX5g6hqVh9kjS/B9E2gSkvHH4SZNiQFiqWS0x9fENzEl+8W12RqdRxX6d/Cwxi30tPQs3bIO+aolQJNp1bIyw==} + + hast-util-to-html@9.0.3: + resolution: {integrity: sha512-M17uBDzMJ9RPCqLMO92gNNUDuBSq10a25SDBI08iCCxmorf4Yy6sYHK57n9WAbRAAaU+DuR4W6GN9K4DFZesYg==} + + hast-util-to-jsx-runtime@2.3.0: + resolution: {integrity: sha512-H/y0+IWPdsLLS738P8tDnrQ8Z+dj12zQQ6WC11TIM21C8WFVoIxcqWXf2H3hiTVZjF1AWqoimGwrTWecWrnmRQ==} + + hast-util-to-parse5@8.0.0: + resolution: {integrity: sha512-3KKrV5ZVI8if87DVSi1vDeByYrkGzg4mEfeu4alwgmmIeARiBLKCZS2uw5Gb6nU9x9Yufyj3iudm6i7nl52PFw==} + hast-util-to-text@3.1.2: resolution: {integrity: sha512-tcllLfp23dJJ+ju5wCCZHVpzsQQ43+moJbqVX3jNWPB7z/KFC4FyZD6R7y94cHL6MQ33YtMZL8Z0aIXXI4XFTw==} hast-util-whitespace@2.0.1: resolution: {integrity: sha512-nAxA0v8+vXSBDt3AnRUNjyRIQ0rD+ntpbAp4LnPkumc5M9yUbSMa4XDU9Q6etY4f1Wp4bNgvc1yjiZtsTTrSng==} + hast-util-whitespace@3.0.0: + resolution: {integrity: sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==} + hastscript@7.2.0: resolution: {integrity: sha512-TtYPq24IldU8iKoJQqvZOuhi5CyCQRAbvDOX0x1eW6rsHSxa/1i2CCiptNTotGHJ3VoHRGmqiv6/D3q113ikkw==} + hastscript@8.0.0: + resolution: {integrity: sha512-dMOtzCEd3ABUeSIISmrETiKuyydk1w0pa+gE/uormcTpSYuaNJPbX1NU3JLyscSLjwAQM8bWMhhIlnCqnRvDTw==} + he@1.2.0: resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} hasBin: true @@ -10762,6 +13492,9 @@ packages: history@4.10.1: resolution: {integrity: sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==} + hls.js@1.3.5: + resolution: {integrity: sha512-uybAvKS6uDe0MnWNEPnO0krWVr+8m2R0hJ/viql8H3MVK+itq8gGQuIYoFHL3rECkIpNH98Lw8YuuWMKZxp3Ew==} + hoist-non-react-statics@3.3.2: resolution: {integrity: sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==} @@ -10779,12 +13512,25 @@ packages: resolution: {integrity: sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA==} engines: {node: '>=10'} + hpack.js@2.1.6: + resolution: {integrity: sha512-zJxVehUdMGIKsRaNt7apO2Gqp0BdqW5yaiGHXXmbpvxgBYVZnAql+BJb4RO5ad2MgpbZKn5G6nMnegrH1FcNYQ==} + html-entities@2.3.3: resolution: {integrity: sha512-DV5Ln36z34NNTDgnz0EWGBLZENelNAtkiFA4kyNOG2tDI6Mz1uSWiq1wAKdyjnJwyDiDO7Fa2SO1CTxPXL8VxA==} html-escaper@2.0.2: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} + html-minifier-terser@6.1.0: + resolution: {integrity: sha512-YXxSlJBZTP7RS3tWnQw74ooKa6L9b9i9QYXY21eUEvhZ3u9XLfv6OnFsQq6RxkhHygsaUMvYsZRV5rU/OVNZxw==} + engines: {node: '>=12'} + hasBin: true + + html-minifier-terser@7.2.0: + resolution: {integrity: sha512-tXgn3QfqPIpGl9o+K5tpcj3/MN4SfLtsx2GWwBC3SSd0tXQGyF3gsSqad8loJgKZGM3ZxbYDd5yhiBIdWpmvLA==} + engines: {node: ^14.13.1 || >=16.0.0} + hasBin: true + html-tags@2.0.0: resolution: {integrity: sha512-+Il6N8cCo2wB/Vd3gqy/8TZhTD3QvcVeQLCnZiGkGCH3JP28IgGAY41giccp2W4R3jfyJPAP318FQTa1yU7K7g==} engines: {node: '>=4'} @@ -10797,9 +13543,30 @@ packages: resolution: {integrity: sha512-QY6S+hZ0f5m1WT8WffYN+Hg+xm/w5I8XeUcAq/ZYP5wVC8xbKi4Whhru3FtrAebD5EhBW8rmFzkDI6eCAuFe2w==} hasBin: true + html-void-elements@3.0.0: + resolution: {integrity: sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==} + + html-webpack-plugin@5.6.0: + resolution: {integrity: sha512-iwaY4wzbe48AfKLZ/Cc8k0L+FKG6oSNRaZ8x5A/T/IVDGyXcbHncM9TdDa93wn0FsSm82FhTKW7f3vS61thXAw==} + engines: {node: '>=10.13.0'} + peerDependencies: + '@rspack/core': 0.x || 1.x + webpack: ^5.20.0 + peerDependenciesMeta: + '@rspack/core': + optional: true + webpack: + optional: true + htmlparser2@3.10.1: resolution: {integrity: sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ==} + htmlparser2@6.1.0: + resolution: {integrity: sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A==} + + htmlparser2@8.0.2: + resolution: {integrity: sha512-GYdjWKDkbRLkZ5geuHs5NY1puJ+PXwP7+fHPRz06Eirsb9ugf6d8kkXav6ADhcODhFFPMIXyxkxSuMf3D6NCFA==} + http-assert@1.5.0: resolution: {integrity: sha512-uPpH7OKX4H25hBmU6G1jWNaqJGpTXxey+YOUizJUAgu0AjLUeC8D73hTrhvDS5D+GJN1DN1+hhc/eF/wpxtp0w==} engines: {node: '>= 0.8'} @@ -10807,6 +13574,9 @@ packages: http-cache-semantics@4.1.1: resolution: {integrity: sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==} + http-deceiver@1.2.7: + resolution: {integrity: sha512-LmpOGxTfbpgtGVxJrj5k7asXHCgNZp5nLfp+hWc8QQRqtb7fUy6kRY3BO1h9ddF6yIPYUARgxGOwB42DnxIaNw==} + http-errors@1.6.3: resolution: {integrity: sha512-lks+lVC8dgGyh97jxvxeYTWQFvh4uw4yC12gVl63Cg30sjPX4wuGcdkICVXDAESr6OJGjqGA8Iz5mkeN6zlD7A==} engines: {node: '>= 0.6'} @@ -10819,13 +13589,21 @@ packages: resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==} engines: {node: '>= 0.8'} + http-parser-js@0.5.8: + resolution: {integrity: sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q==} + http-proxy-agent@5.0.0: resolution: {integrity: sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==} engines: {node: '>= 6'} - http-proxy-middleware@3.0.0: - resolution: {integrity: sha512-36AV1fIaI2cWRzHo+rbcxhe3M3jUDCNzc4D5zRl57sEWRAxdXYtw7FSQKYY6PDKssiAKjLYypbssHk+xs/kMXw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + http-proxy-middleware@2.0.7: + resolution: {integrity: sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA==} + engines: {node: '>=12.0.0'} + peerDependencies: + '@types/express': ^4.17.13 + peerDependenciesMeta: + '@types/express': + optional: true http-proxy@1.18.1: resolution: {integrity: sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==} @@ -10835,6 +13613,10 @@ packages: resolution: {integrity: sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==} engines: {node: '>=10.19.0'} + http2-wrapper@2.2.1: + resolution: {integrity: sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ==} + engines: {node: '>=10.19.0'} + https-proxy-agent@5.0.1: resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} engines: {node: '>= 6'} @@ -10875,6 +13657,12 @@ packages: resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} engines: {node: '>=0.10.0'} + icss-utils@5.1.0: + resolution: {integrity: sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==} + engines: {node: ^10 || ^12 || >= 14} + peerDependencies: + postcss: ^8.1.0 + ieee754@1.2.1: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} @@ -10887,6 +13675,11 @@ packages: engines: {node: '>=0.10.0'} hasBin: true + image-size@1.1.1: + resolution: {integrity: sha512-541xKlUw6jr/6gGuk92F+mYM5zaFAc5ahphvkqvNe2bQ6gVBkd6bfrmVJ2t4KDAfikAYZyIqTnktX3i6/aQDrQ==} + engines: {node: '>=16.x'} + hasBin: true + immediate@3.0.6: resolution: {integrity: sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==} @@ -10903,13 +13696,17 @@ packages: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} engines: {node: '>=6'} + import-lazy@4.0.0: + resolution: {integrity: sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==} + engines: {node: '>=8'} + import-local@3.1.0: resolution: {integrity: sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==} engines: {node: '>=8'} hasBin: true - import-meta-resolve@2.2.2: - resolution: {integrity: sha512-f8KcQ1D80V7RnqVm+/lirO9zkOxjGxhaTC1IPrBGd3MEfNgmNG67tSUO9gTi2F3Blr2Az6g1vocaxzkVnWl9MA==} + import-meta-resolve@4.1.0: + resolution: {integrity: sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==} importx@0.4.3: resolution: {integrity: sha512-x6E6OxmWq/SUaj7wDeDeSjyHP+rMUbEaqJ5fw0uEtC/FTX9ocxNMFJ+ONnpJIsRpFz3ya6qJAK4orwSKqw0BSQ==} @@ -10925,6 +13722,10 @@ packages: infer-owner@1.0.4: resolution: {integrity: sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==} + infima@0.2.0-alpha.44: + resolution: {integrity: sha512-tuRkUSO/lB3rEhLJk25atwAjgLuzq070+pOW8XcvpHky/YbENnRRdPd85IBkyeTgttmOy5ah+yHYsK1HhUd4lQ==} + engines: {node: '>=12'} + inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. @@ -10938,9 +13739,20 @@ packages: ini@1.3.8: resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} + ini@2.0.0: + resolution: {integrity: sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==} + engines: {node: '>=10'} + + ini@4.1.1: + resolution: {integrity: sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + inline-style-parser@0.1.1: resolution: {integrity: sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q==} + inline-style-parser@0.2.4: + resolution: {integrity: sha512-0aO8FkhNZlj/ZIbNi7Lxxr12obT7cL1moPfE4tg1LkX7LlLfC6DeX4l2ZEud1ukP9jNQyNnfzQVqwbwmAATY4Q==} + inquirer@3.0.6: resolution: {integrity: sha512-thluxTGBXUGb8DuQcvH9/CM/CrcGyB5xUpWc9x6Slqcq1z/hRr2a6KxUpX4ddRfmbe0hg3E4jTvo5833aWz3BA==} @@ -10948,10 +13760,6 @@ packages: resolution: {integrity: sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg==} engines: {node: '>=12.0.0'} - inquirer@9.2.12: - resolution: {integrity: sha512-mg3Fh9g2zfuVWJn6lhST0O7x4n03k7G8Tx5nvikJkbq8/CK47WDVm+UznF0G6s5Zi0KcyUisr6DU8T67N5U+1Q==} - engines: {node: '>=14.18.0'} - inquirer@9.2.15: resolution: {integrity: sha512-vI2w4zl/mDluHt9YEQ/543VTCwPKWiHzKtm9dM2V0NdFcqEexDAjUHzO1oA60HRNaVifGXXM1tRRNluLVHa0Kg==} engines: {node: '>=18'} @@ -10966,6 +13774,10 @@ packages: internmap@1.0.1: resolution: {integrity: sha512-lDB5YccMydFBtasVtxnZ3MRBHuaoE8GKsppq+EchKL2U4nK/DmEpPHNH8MZe5HkMtpSiTSOZwfN0tzYjO/lJEw==} + interpret@1.4.0: + resolution: {integrity: sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==} + engines: {node: '>= 0.10'} + interpret@3.1.1: resolution: {integrity: sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==} engines: {node: '>=10.13.0'} @@ -10973,6 +13785,9 @@ packages: intersection-observer@0.12.2: resolution: {integrity: sha512-7m1vEcPCxXYI8HqnL8CKI6siDyD+eIWSwgB3DZA+ZTogxk9I4CDnj4wilt9x/+/QbHI4YG5YZNmC6458/e9Ktg==} + invariant@2.2.4: + resolution: {integrity: sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==} + ip-address@9.0.5: resolution: {integrity: sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==} engines: {node: '>= 12'} @@ -10981,10 +13796,20 @@ packages: resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} engines: {node: '>= 0.10'} + ipaddr.js@2.2.0: + resolution: {integrity: sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==} + engines: {node: '>= 10'} + is-accessor-descriptor@1.0.1: resolution: {integrity: sha512-YBUanLI8Yoihw923YeFUS5fs0fF2f5TSFTNiYAAzhhDscDa3lEqYuz1pDOEP5KvX94I9ey3vsqjJcLVFVU+3QA==} engines: {node: '>= 0.10'} + is-alphabetical@2.0.1: + resolution: {integrity: sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==} + + is-alphanumerical@2.0.1: + resolution: {integrity: sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==} + is-arguments@1.1.1: resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==} engines: {node: '>= 0.4'} @@ -11035,6 +13860,9 @@ packages: resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} engines: {node: '>= 0.4'} + is-decimal@2.0.1: + resolution: {integrity: sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==} + is-descriptor@0.1.7: resolution: {integrity: sha512-C3grZTvObeN1xud4cRWl366OMXZTj0+HGyk4hvfpx4ZHt1Pb60ANSXqCK7pdOTeUQpRzECBSTphqvD7U+l22Eg==} engines: {node: '>= 0.4'} @@ -11089,11 +13917,18 @@ packages: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} + is-hexadecimal@2.0.1: + resolution: {integrity: sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==} + is-inside-container@1.0.0: resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} engines: {node: '>=14.16'} hasBin: true + is-installed-globally@0.4.0: + resolution: {integrity: sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==} + engines: {node: '>=10'} + is-interactive@1.0.0: resolution: {integrity: sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==} engines: {node: '>=8'} @@ -11109,6 +13944,10 @@ packages: resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} engines: {node: '>= 0.4'} + is-npm@6.0.0: + resolution: {integrity: sha512-JEjxbSmtPSt1c8XTkVrlujcXdKV1/tvuQ7GwKcAlyiVLeYFQ2VHat8xfrDJsIkhCdF/tZ7CiIR3sy141c6+gPQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + is-number-object@1.0.7: resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==} engines: {node: '>= 0.4'} @@ -11121,10 +13960,18 @@ packages: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} + is-obj@1.0.1: + resolution: {integrity: sha512-l4RyHgRqGN4Y3+9JHVrNqO+tN0rV5My76uW5/nuO4K1b6vw5G8d/cmFjP9tRfEsdhZNt0IFdZuK/c2Vr4Nb+Qg==} + engines: {node: '>=0.10.0'} + is-obj@2.0.0: resolution: {integrity: sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==} engines: {node: '>=8'} + is-path-cwd@2.2.0: + resolution: {integrity: sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==} + engines: {node: '>=6'} + is-path-inside@3.0.3: resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} engines: {node: '>=8'} @@ -11157,6 +14004,9 @@ packages: resolution: {integrity: sha512-9UoipoxYmSk6Xy7QFgRv2HDyaysmgSG75TFQs6S+3pDM7ZhKTF/bskZV+0UlABHzKjNVhPjYCLfeZUEg1wXxig==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + is-promise@2.2.2: + resolution: {integrity: sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==} + is-reference@3.0.3: resolution: {integrity: sha512-ixkJoqQvAP88E6wLydLGGqCJsrFUnqoH6HnaczB8XmDH1oaWU+xxdptvikTgaEhtZ53Ky6YXiBuUI2WXLMCwjw==} @@ -11164,6 +14014,14 @@ packages: resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} engines: {node: '>= 0.4'} + is-regexp@1.0.0: + resolution: {integrity: sha512-7zjFAPO4/gwyQAAgRRmqeEeyIICSdmCqa3tsVHMdBzaXXRiqopZL4Cyghg/XulGWrtABTpbnYYzzIRffLkP4oA==} + engines: {node: '>=0.10.0'} + + is-root@2.1.0: + resolution: {integrity: sha512-AGOriNp96vNBd3HtU+RzFEc75FfR5ymiYv8E553I71SCeXBiMsVDUtdio1OEFvrPyLIQ9tVR5RxXIFe5PUFjMg==} + engines: {node: '>=6'} + is-set@2.0.3: resolution: {integrity: sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg==} engines: {node: '>= 0.4'} @@ -11210,10 +14068,6 @@ packages: resolution: {integrity: sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==} engines: {node: '>=10'} - is-unicode-supported@1.3.0: - resolution: {integrity: sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==} - engines: {node: '>=12'} - is-weakmap@2.0.2: resolution: {integrity: sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w==} engines: {node: '>= 0.4'} @@ -11240,6 +14094,14 @@ packages: resolution: {integrity: sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==} engines: {node: '>=8'} + is-wsl@3.1.0: + resolution: {integrity: sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==} + engines: {node: '>=16'} + + is-yarn-global@0.4.1: + resolution: {integrity: sha512-/kppl+R+LO5VmhYSEWARUFjodS25D68gvj8W7z0I7OWhUla5xWu8KL6CtB2V0R6yqhnRgbcaREMr4EEM6htLPQ==} + engines: {node: '>=12'} + isarray@0.0.1: resolution: {integrity: sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==} @@ -11315,10 +14177,19 @@ packages: resolution: {integrity: sha512-RKYVTCjAnRthyJes037NX/IiqeidgN1xc3j1RjFfECFp28A1GVwK9nA+i0rJPaHqSZwygLzRnFlzUuHFoWWy+Q==} engines: {node: '>=6'} + its-fine@1.2.5: + resolution: {integrity: sha512-fXtDA0X0t0eBYAGLVM5YsgJGsJ5jEmqZEPrGbzdf5awjv0xE7nqv3TVnvtUF060Tkes15DbDAKW/I48vsb6SyA==} + peerDependencies: + react: '>=18.0' + jackspeak@3.1.2: resolution: {integrity: sha512-kWmLKn2tRtfYMF/BakihVVRzBKOxz4gJMiL2Rj91WnAB5TPZumSH99R/Yf1qE1u4uRimvCSJfm6hnxohXeEXjQ==} engines: {node: '>=14'} + jackspeak@4.0.2: + resolution: {integrity: sha512-bZsjR/iRjl1Nk1UkjGpAzLNfQtzuijhn2g+pbZb98HQ1Gk8vM9hfbxeMBP+M2/UUdwj0RqGG3mlvk2MsAqwvEw==} + engines: {node: 20 || >=22} + jake@10.9.1: resolution: {integrity: sha512-61btcOHNnLnsOdtLgA5efqQWjnSi/vow5HbI7HMdKKWqvrKR1bLK3BPlJn9gcSaP2ewuamUSMB5XEy76KUIS2w==} engines: {node: '>=10'} @@ -11464,6 +14335,10 @@ packages: resolution: {integrity: sha512-gFqAIbuKyyso/3G2qhiO2OM6shY6EPP/R0+mkDbyspxKazh8BXDC5FiFsUjlczgdNz/vfra0da2y+aHrusLG/Q==} hasBin: true + jiti@1.21.6: + resolution: {integrity: sha512-2yTgeWTWzMWkHu6Jp9NKgePDaYHbntiwvYuuJLbbN9vl7DC9DvXKOB2BC3ZZ92D3cvV/aflH0osDfwpHepQ53w==} + hasBin: true + jiti@2.0.0-beta.2: resolution: {integrity: sha512-c+PHQZakiQuMKbnhvrjZUvrK6E/AfmTOf4P+E3Y4FNVHcNMX9e/XrnbEvO+m4wS6ZjsvhHh/POQTlfy8uXFc0A==} hasBin: true @@ -11472,6 +14347,9 @@ packages: resolution: {integrity: sha512-rg9zJN+G4n2nfJl5MW3BMygZX56zKPNVEYYqq7adpmMh4Jn2QNEwhvQlFy6jPVdcod7txZtKHWnyZiA3a0zP7A==} hasBin: true + joi@17.13.3: + resolution: {integrity: sha512-otDA4ldcIx+ZXsKHWmp0YizCweVRZG96J10b0FevjfuncLO1oX59THoAmHkNubYJ+9gWsYsp5k8v4ib6oDv1fA==} + jquery@3.7.1: resolution: {integrity: sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==} @@ -11500,6 +14378,11 @@ packages: engines: {node: '>=4'} hasBin: true + jsesc@3.0.2: + resolution: {integrity: sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g==} + engines: {node: '>=6'} + hasBin: true + json-buffer@3.0.1: resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} @@ -11560,8 +14443,8 @@ packages: resolution: {integrity: sha512-pBxcB3LFc8QVgdggvZWyeys+hnrNWg4OcZIU/1X59k5jQdLBlCsYGRQaz234SqoRLTCgMH00fY0xRJH+F9METQ==} engines: {node: '>=8'} - katex@0.16.11: - resolution: {integrity: sha512-RQrI8rlHY92OLf3rho/Ts8i/XvjgguEjOkO1BEXcU3N8BqPpSzBNwV/G0Ukr+P/l3ivvJUE/Fa/CwbS6HesGNQ==} + katex@0.16.15: + resolution: {integrity: sha512-yE9YJIEAk2aZ+FL/G8r+UGw0CTUzEA8ZFy6E+8tc3spHUKq3qBnzCkI1CQwGoI9atJhVyFPEypQsTY7mJ1Pi9w==} hasBin: true keygrip@1.1.0: @@ -11595,31 +14478,17 @@ packages: resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==} engines: {node: '>=6'} + klona@2.0.6: + resolution: {integrity: sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA==} + engines: {node: '>= 8'} + koa-compose@4.1.0: resolution: {integrity: sha512-8ODW8TrDuMYvXRwra/Kh7/rJo9BtOfPc6qO8eAfC80CnCvSjSl0bkRM24X6/XBBEyj0v1nRUQ1LyOy3dbqOWXw==} - koa-compress@5.1.1: - resolution: {integrity: sha512-UgMIN7ZoEP2DuoSQmD6CYvFSLt0NReGlc2qSY4bO4Oq0L56OiD9pDG41Kj/zFmVY/A3Wvmn4BqKcfq5H30LGIg==} - engines: {node: '>= 12'} - - koa-connect@2.1.0: - resolution: {integrity: sha512-O9pcFafHk0oQsBevlbTBlB9co+2RUQJ4zCzu3qJPmGlGoeEZkne+7gWDkecqDPSbCtED6LmhlQladxs6NjOnMQ==} - koa-convert@2.0.0: resolution: {integrity: sha512-asOvN6bFlSnxewce2e/DK3p4tltyfC4VM7ZwuTuepI7dEQVcvpyFuBcEARu1+Hxg8DIwytce2n7jrZtRlPrARA==} engines: {node: '>= 10'} - koa-is-json@1.0.0: - resolution: {integrity: sha512-+97CtHAlWDx0ndt0J8y3P12EWLwTLMXIfMnYDev3wOTwH/RpBGMlfn4bDXlMEg1u73K6XRE9BbUp+5ZAYoRYWw==} - - koa-send@5.0.1: - resolution: {integrity: sha512-tmcyQ/wXXuxpDxyNXv5yNNkdAMdFRqwtegBXUaowiQzUKqJehttS0x2j0eOZDQAyloAth5w6wwBImnFzkUz3pQ==} - engines: {node: '>= 8'} - - koa-static@5.0.0: - resolution: {integrity: sha512-UqyYyH5YEXaJrf9S8E23GoJFQZXkBVJ9zYYMPGz919MSX1KuvAcycIuS0ci150HCoPf4XQVhQ84Qf8xRPWxFaQ==} - engines: {node: '>= 7.6.0'} - koa@2.14.2: resolution: {integrity: sha512-VFI2bpJaodz6P7x2uyLiX6RLYpZmOJqNmoCst/Yyd7hQlszyPwG/I9CQJ63nOtKSxpt5M7NH67V6nJL2BwCl7g==} engines: {node: ^4.8.4 || ^6.10.1 || ^7.10.1 || >= 8.1.4} @@ -11627,6 +14496,13 @@ packages: kolorist@1.8.0: resolution: {integrity: sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==} + latest-version@7.0.0: + resolution: {integrity: sha512-KvNT4XqAMzdcL6ka6Tl3i2lYeFDgXNCuIX+xNx6ZMVR1dFq+idXd9FLKNMOIx0t9mJ9/HudyX4oZWXZQ0UJHeg==} + engines: {node: '>=14.16'} + + launch-editor@2.9.1: + resolution: {integrity: sha512-Gcnl4Bd+hRO9P9icCP/RVVT2o8SFlPXofuCxvA2SaZuH45whSvf5p8x5oih5ftLiVhEI4sp5xDY+R+b3zJBh5w==} + lazy-cache@1.0.4: resolution: {integrity: sha512-RE2g0b5VGZsOCFOCgP7omTRYFqydmZkBwl5oNnQ1lDYC57uyO9KqNnNVxT7COSHTxrRCWVcAVOcbjk+tvh/rgQ==} engines: {node: '>=0.10.0'} @@ -11639,6 +14515,12 @@ packages: engines: {node: '>=6'} hasBin: true + leva@0.9.35: + resolution: {integrity: sha512-sp/ZbHGrrzM+eq+wIAc9X7C5qFagNERYkwaulKI/xy0XrDPV67jLUSSqTCFSoSc0Uk96j3oephYoO/6I8mZNuw==} + peerDependencies: + react: '>=16.8.0' + react-dom: '>=16.8.0' + leven@3.1.0: resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} engines: {node: '>=6'} @@ -11647,8 +14529,8 @@ packages: resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} engines: {node: '>= 0.8.0'} - lib0@0.2.97: - resolution: {integrity: sha512-Q4d1ekgvufi9FiHkkL46AhecfNjznSL9MRNoJRQ76gBHS9OqU2ArfQK0FvBpuxgWeJeNI0LVgAYMIpsGeX4gYg==} + lib0@0.2.99: + resolution: {integrity: sha512-vwztYuUf1uf/1zQxfzRfO5yzfNKhTtgOByCruuiQQxWQXnPb8Itaube5ylofcV0oM0aKal9Mv+S1s1Ky0UYP1w==} engines: {node: '>=16'} hasBin: true @@ -11661,8 +14543,8 @@ packages: cpu: [arm64] os: [darwin] - lightningcss-darwin-arm64@1.27.0: - resolution: {integrity: sha512-Gl/lqIXY+d+ySmMbgDf0pgaWSqrWYxVHoc88q+Vhf2YNzZ8DwoRzGt5NZDVqqIW5ScpSnmmjcgXP87Dn2ylSSQ==} + lightningcss-darwin-arm64@1.28.2: + resolution: {integrity: sha512-/8cPSqZiusHSS+WQz0W4NuaqFjquys1x+NsdN/XOHb+idGHJSoJ7SoQTVl3DZuAgtPZwFZgRfb/vd1oi8uX6+g==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [darwin] @@ -11673,8 +14555,8 @@ packages: cpu: [x64] os: [darwin] - lightningcss-darwin-x64@1.27.0: - resolution: {integrity: sha512-0+mZa54IlcNAoQS9E0+niovhyjjQWEMrwW0p2sSdLRhLDc8LMQ/b67z7+B5q4VmjYCMSfnFi3djAAQFIDuj/Tg==} + lightningcss-darwin-x64@1.28.2: + resolution: {integrity: sha512-R7sFrXlgKjvoEG8umpVt/yutjxOL0z8KWf0bfPT3cYMOW4470xu5qSHpFdIOpRWwl3FKNMUdbKtMUjYt0h2j4g==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [darwin] @@ -11685,8 +14567,8 @@ packages: cpu: [x64] os: [freebsd] - lightningcss-freebsd-x64@1.27.0: - resolution: {integrity: sha512-n1sEf85fePoU2aDN2PzYjoI8gbBqnmLGEhKq7q0DKLj0UTVmOTwDC7PtLcy/zFxzASTSBlVQYJUhwIStQMIpRA==} + lightningcss-freebsd-x64@1.28.2: + resolution: {integrity: sha512-l2qrCT+x7crAY+lMIxtgvV10R8VurzHAoUZJaVFSlHrN8kRLTvEg9ObojIDIexqWJQvJcVVV3vfzsEynpiuvgA==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [freebsd] @@ -11697,8 +14579,8 @@ packages: cpu: [arm] os: [linux] - lightningcss-linux-arm-gnueabihf@1.27.0: - resolution: {integrity: sha512-MUMRmtdRkOkd5z3h986HOuNBD1c2lq2BSQA1Jg88d9I7bmPGx08bwGcnB75dvr17CwxjxD6XPi3Qh8ArmKFqCA==} + lightningcss-linux-arm-gnueabihf@1.28.2: + resolution: {integrity: sha512-DKMzpICBEKnL53X14rF7hFDu8KKALUJtcKdFUCW5YOlGSiwRSgVoRjM97wUm/E0NMPkzrTi/rxfvt7ruNK8meg==} engines: {node: '>= 12.0.0'} cpu: [arm] os: [linux] @@ -11709,8 +14591,8 @@ packages: cpu: [arm64] os: [linux] - lightningcss-linux-arm64-gnu@1.27.0: - resolution: {integrity: sha512-cPsxo1QEWq2sfKkSq2Bq5feQDHdUEwgtA9KaB27J5AX22+l4l0ptgjMZZtYtUnteBofjee+0oW1wQ1guv04a7A==} + lightningcss-linux-arm64-gnu@1.28.2: + resolution: {integrity: sha512-nhfjYkfymWZSxdtTNMWyhFk2ImUm0X7NAgJWFwnsYPOfmtWQEapzG/DXZTfEfMjSzERNUNJoQjPAbdqgB+sjiw==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] @@ -11721,8 +14603,8 @@ packages: cpu: [arm64] os: [linux] - lightningcss-linux-arm64-musl@1.27.0: - resolution: {integrity: sha512-rCGBm2ax7kQ9pBSeITfCW9XSVF69VX+fm5DIpvDZQl4NnQoMQyRwhZQm9pd59m8leZ1IesRqWk2v/DntMo26lg==} + lightningcss-linux-arm64-musl@1.28.2: + resolution: {integrity: sha512-1SPG1ZTNnphWvAv8RVOymlZ8BDtAg69Hbo7n4QxARvkFVCJAt0cgjAw1Fox0WEhf4PwnyoOBaVH0Z5YNgzt4dA==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [linux] @@ -11733,8 +14615,8 @@ packages: cpu: [x64] os: [linux] - lightningcss-linux-x64-gnu@1.27.0: - resolution: {integrity: sha512-Dk/jovSI7qqhJDiUibvaikNKI2x6kWPN79AQiD/E/KeQWMjdGe9kw51RAgoWFDi0coP4jinaH14Nrt/J8z3U4A==} + lightningcss-linux-x64-gnu@1.28.2: + resolution: {integrity: sha512-ZhQy0FcO//INWUdo/iEdbefntTdpPVQ0XJwwtdbBuMQe+uxqZoytm9M+iqR9O5noWFaxK+nbS2iR/I80Q2Ofpg==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] @@ -11745,14 +14627,14 @@ packages: cpu: [x64] os: [linux] - lightningcss-linux-x64-musl@1.27.0: - resolution: {integrity: sha512-QKjTxXm8A9s6v9Tg3Fk0gscCQA1t/HMoF7Woy1u68wCk5kS4fR+q3vXa1p3++REW784cRAtkYKrPy6JKibrEZA==} + lightningcss-linux-x64-musl@1.28.2: + resolution: {integrity: sha512-alb/j1NMrgQmSFyzTbN1/pvMPM+gdDw7YBuQ5VSgcFDypN3Ah0BzC2dTZbzwzaMdUVDszX6zH5MzjfVN1oGuww==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [linux] - lightningcss-win32-arm64-msvc@1.27.0: - resolution: {integrity: sha512-/wXegPS1hnhkeG4OXQKEMQeJd48RDC3qdh+OA8pCuOPCyvnm/yEayrJdJVqzBsqpy1aJklRCVxscpFur80o6iQ==} + lightningcss-win32-arm64-msvc@1.28.2: + resolution: {integrity: sha512-WnwcjcBeAt0jGdjlgbT9ANf30pF0C/QMb1XnLnH272DQU8QXh+kmpi24R55wmWBwaTtNAETZ+m35ohyeMiNt+g==} engines: {node: '>= 12.0.0'} cpu: [arm64] os: [win32] @@ -11763,8 +14645,8 @@ packages: cpu: [x64] os: [win32] - lightningcss-win32-x64-msvc@1.27.0: - resolution: {integrity: sha512-/OJLj94Zm/waZShL8nB5jsNj3CfNATLCTyFxZyouilfTmSoLDX7VlVAmhPHoZWVFp4vdmoiEbPEYC8HID3m6yw==} + lightningcss-win32-x64-msvc@1.28.2: + resolution: {integrity: sha512-3piBifyT3avz22o6mDKywQC/OisH2yDK+caHWkiMsF82i3m5wDBadyCjlCQ5VNgzYkxrWZgiaxHDdd5uxsi0/A==} engines: {node: '>= 12.0.0'} cpu: [x64] os: [win32] @@ -11773,17 +14655,24 @@ packages: resolution: {integrity: sha512-V0RMVZzK1+rCHpymRv4URK2lNhIRyO8g7U7zOFwVAhJuat74HtkjIQpQRKNCwFEYkRGpafOpmXXLoaoBcyVtBg==} engines: {node: '>= 12.0.0'} - lightningcss@1.27.0: - resolution: {integrity: sha512-8f7aNmS1+etYSLHht0fQApPc2kNO8qGRutifN5rVIc6Xo6ABsEbqOr758UwI7ALVbTt4x1fllKt0PYgzD9S3yQ==} + lightningcss@1.28.2: + resolution: {integrity: sha512-ePLRrbt3fgjXI5VFZOLbvkLD5ZRuxGKm+wJ3ujCqBtL3NanDHPo/5zicR5uEKAPiIjBYF99BM4K4okvMznjkVA==} engines: {node: '>= 12.0.0'} lilconfig@2.1.0: resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} engines: {node: '>=10'} + lilconfig@3.1.2: + resolution: {integrity: sha512-eop+wDAvpItUys0FWkHIKeC9ybYrTGbU41U5K7+bttZZeohvnY7M9dZ5kB21GNWiFT2q1OoPTvncPCgSOVO5ow==} + engines: {node: '>=14'} + lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + linkify-it@5.0.0: + resolution: {integrity: sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==} + lint-staged@13.3.0: resolution: {integrity: sha512-mPRtrYnipYYv1FEE134ufbWpeggNTo+O/UPzngoaKzbzHAthvR55am+8GfHTnqNRQVRRrYQLGW9ZyUoD7DsBHQ==} engines: {node: ^16.14.0 || >=18.0.0} @@ -11831,6 +14720,14 @@ packages: resolution: {integrity: sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==} engines: {node: '>=4.0.0'} + loader-utils@2.0.4: + resolution: {integrity: sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==} + engines: {node: '>=8.9.0'} + + loader-utils@3.3.1: + resolution: {integrity: sha512-FMJTLMXfCLMLfJxcX9PFqX5qD88Z5MRGaZCVzfuqeZSPsyiBzs+pahDQjbIWz2QIzPZz0NX9Zy4FX3lmK6YHIg==} + engines: {node: '>= 12.13.0'} + local-pkg@0.4.3: resolution: {integrity: sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==} engines: {node: '>=14'} @@ -11846,6 +14743,10 @@ packages: resolution: {integrity: sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==} engines: {node: '>=4'} + locate-path@3.0.0: + resolution: {integrity: sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==} + engines: {node: '>=6'} + locate-path@5.0.0: resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} engines: {node: '>=8'} @@ -11885,12 +14786,14 @@ packages: lodash.get@4.4.2: resolution: {integrity: sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==} + deprecated: This package is deprecated. Use the optional chaining (?.) operator instead. lodash.isempty@4.4.0: resolution: {integrity: sha512-oKMuF3xEeqDltrGMfDxAPGIVMSSRv8tbRSODbrs4KGsRRLEhrW8N8Rd4DRgB2+621hY8A8XwwrTVhXWpxFvMzg==} lodash.isequal@4.5.0: resolution: {integrity: sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==} + deprecated: This package is deprecated. Use require('node:util').isDeepStrictEqual instead. lodash.isfunction@3.0.9: resolution: {integrity: sha512-AirXNj15uRIMMPihnkInB4i3NHeb4iBtNg9WRWuK2o31S+ePwwNmDPaTL3o7dTJ+VXNZim7rFs4rxN4YU1oUJw==} @@ -11927,6 +14830,7 @@ packages: lodash.template@4.5.0: resolution: {integrity: sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==} + deprecated: This package is deprecated. Use https://socket.dev/npm/package/eta instead. lodash.templatesettings@4.2.0: resolution: {integrity: sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==} @@ -11954,10 +14858,6 @@ packages: resolution: {integrity: sha512-5UtUDQ/6edw4ofyljDNcOVJQ4c7OjDro4h3y8e1GQL5iYElYclVHJ3zeWchylvMaKnDbDilC8irOVyexnA/Slw==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - loglevel@1.8.1: - resolution: {integrity: sha512-tCRIJM51SHjAayKwC+QAg8hT8vg6z7GSgLJKGvzuPb1Wc+hLzqtuVLxp6/HzSPOozuK+8ErAhy7U/sVzw8Dgfg==} - engines: {node: '>= 0.6.0'} - longest-streak@3.1.0: resolution: {integrity: sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==} @@ -11982,10 +14882,18 @@ packages: resolution: {integrity: sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==} engines: {node: '>=8'} + lowercase-keys@3.0.0: + resolution: {integrity: sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + lru-cache@10.2.2: resolution: {integrity: sha512-9hp3Vp2/hFQUiIwKo8XCeFVnrg8Pk3TYNPIR7tJADKi5YfcF7vEaK7avFHTlSy3kOKYaJQaalfEo6YuXdceBOQ==} engines: {node: 14 || >=16.14} + lru-cache@11.0.1: + resolution: {integrity: sha512-CgeuL5uom6j/ZVrg7G/+1IXqRY8JXX4Hghfy5YE0EhoYQWvndP1kufu58cmZLNIDKnRhZrXfdS9urVWx98AipQ==} + engines: {node: 20 || >=22} + lru-cache@4.1.5: resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==} @@ -12005,10 +14913,25 @@ packages: peerDependencies: react: ^16.5.1 || ^17.0.0 || ^18.0.0 + lucide-react@0.394.0: + resolution: {integrity: sha512-PzTbJ0bsyXRhH59k5qe7MpTd5MxlpYZUcM9kGSwvPGAfnn0J6FElDwu2EX6Vuh//F7y60rcVJiFQ7EK9DCMgfw==} + peerDependencies: + react: ^16.5.1 || ^17.0.0 || ^18.0.0 + luxon@3.4.4: resolution: {integrity: sha512-zobTr7akeGHnv7eBOXcRgMeCP6+uyYsczwmeRCauvpvaAltgNyTbLH/+VaEAPUeWBT+1GuNmz4wC/6jtQzbbVA==} engines: {node: '>=12'} + lz-string@1.5.0: + resolution: {integrity: sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==} + hasBin: true + + maath@0.10.8: + resolution: {integrity: sha512-tRvbDF0Pgqz+9XUa4jjfgAQ8/aPKmQdWXilFu2tMy4GWj4NOsx99HlULO4IeREfbO3a0sA145DZYyvXPkybm0g==} + peerDependencies: + '@types/three': '>=0.134.0' + three: '>=0.134.0' + magic-string-ast@0.3.0: resolution: {integrity: sha512-0shqecEPgdFpnI3AP90epXyxZy9g6CRZ+SZ7BcqFwYmtFEnZ1jpevcV5HoyVnlDS9gCnc1UIg3Rsvp3Ci7r8OA==} engines: {node: '>=16.14.0'} @@ -12079,9 +15002,20 @@ packages: resolution: {integrity: sha512-4y7uGv8bd2WdM9vpQsiQNo41Ln1NvhvDRuVt0k2JZQ+ezN2uaQes7lZeZ+QQUHOLQAtDaBJ+7wCbi+ab/KFs+w==} engines: {node: '>=0.10.0'} + markdown-extensions@2.0.0: + resolution: {integrity: sha512-o5vL7aDWatOTX8LzaS1WMoaoxIiLRQJuIKKe2wAw6IeULDHaqbiqiggmx+pKvZDb1Sj+pE46Sn1T7lCqfFtg1Q==} + engines: {node: '>=16'} + + markdown-it@14.1.0: + resolution: {integrity: sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==} + hasBin: true + markdown-table@3.0.3: resolution: {integrity: sha512-Z1NL3Tb1M9wH4XESsCDEksWoKTdlUafKc4pt0GRwjUyXaCFZ+dc3g2erqB6zm3szA2IUSi7VnPI+o/9jnxh9hw==} + markdown-table@3.0.4: + resolution: {integrity: sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw==} + marked@12.0.2: resolution: {integrity: sha512-qXUm7e/YKFoqFPYPa3Ukg9xlI5cyAtGmyEIzMfW//m6kXwCy2Ps9DYf5ioijFKQ8qyuscrHoY04iJGctu2Kg0Q==} engines: {node: '>= 18'} @@ -12097,51 +15031,108 @@ packages: mdast-util-definitions@5.1.2: resolution: {integrity: sha512-8SVPMuHqlPME/z3gqVwWY4zVXn8lqKv/pAhC57FuJ40ImXyBpmO5ukh98zB2v7Blql2FiHjHv9LVztSIqjY+MA==} + mdast-util-directive@3.0.0: + resolution: {integrity: sha512-JUpYOqKI4mM3sZcNxmF/ox04XYFFkNwr0CFlrQIkCwbvH0xzMCqkMqAde9wRd80VAhaUrwFwKm2nxretdT1h7Q==} + mdast-util-find-and-replace@2.2.2: resolution: {integrity: sha512-MTtdFRz/eMDHXzeK6W3dO7mXUlF82Gom4y0oOgvHhh/HXZAGvIQDUvQ0SuUx+j2tv44b8xTHOm8K/9OoRFnXKw==} + mdast-util-find-and-replace@3.0.1: + resolution: {integrity: sha512-SG21kZHGC3XRTSUhtofZkBzZTJNM5ecCi0SK2IMKmSXR8vO3peL+kb1O0z7Zl83jKtutG4k5Wv/W7V3/YHvzPA==} + mdast-util-from-markdown@1.3.1: resolution: {integrity: sha512-4xTO/M8c82qBcnQc1tgpNtubGUW/Y1tBQ1B0i5CtSoelOLKFYlElIr3bvgREYYO5iRqbMY1YuqZng0GVOI8Qww==} + mdast-util-from-markdown@2.0.1: + resolution: {integrity: sha512-aJEUyzZ6TzlsX2s5B4Of7lN7EQtAxvtradMMglCQDyaTFgse6CmtmdJ15ElnVRlCg1vpNyVtbem0PWzlNieZsA==} + + mdast-util-frontmatter@2.0.1: + resolution: {integrity: sha512-LRqI9+wdgC25P0URIJY9vwocIzCcksduHQ9OF2joxQoyTNVduwLAFUzjoopuRJbJAReaKrNQKAZKL3uCMugWJA==} + mdast-util-gfm-autolink-literal@1.0.3: resolution: {integrity: sha512-My8KJ57FYEy2W2LyNom4n3E7hKTuQk/0SES0u16tjA9Z3oFkF4RrC/hPAPgjlSpezsOvI8ObcXcElo92wn5IGA==} + mdast-util-gfm-autolink-literal@2.0.1: + resolution: {integrity: sha512-5HVP2MKaP6L+G6YaxPNjuL0BPrq9orG3TsrZ9YXbA3vDw/ACI4MEsnoDpn6ZNm7GnZgtAcONJyPhOP8tNJQavQ==} + mdast-util-gfm-footnote@1.0.2: resolution: {integrity: sha512-56D19KOGbE00uKVj3sgIykpwKL179QsVFwx/DCW0u/0+URsryacI4MAdNJl0dh+u2PSsD9FtxPFbHCzJ78qJFQ==} + mdast-util-gfm-footnote@2.0.0: + resolution: {integrity: sha512-5jOT2boTSVkMnQ7LTrd6n/18kqwjmuYqo7JUPe+tRCY6O7dAuTFMtTPauYYrMPpox9hlN0uOx/FL8XvEfG9/mQ==} + mdast-util-gfm-strikethrough@1.0.3: resolution: {integrity: sha512-DAPhYzTYrRcXdMjUtUjKvW9z/FNAMTdU0ORyMcbmkwYNbKocDpdk+PX1L1dQgOID/+vVs1uBQ7ElrBQfZ0cuiQ==} + mdast-util-gfm-strikethrough@2.0.0: + resolution: {integrity: sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg==} + mdast-util-gfm-table@1.0.7: resolution: {integrity: sha512-jjcpmNnQvrmN5Vx7y7lEc2iIOEytYv7rTvu+MeyAsSHTASGCCRA79Igg2uKssgOs1i1po8s3plW0sTu1wkkLGg==} + mdast-util-gfm-table@2.0.0: + resolution: {integrity: sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg==} + mdast-util-gfm-task-list-item@1.0.2: resolution: {integrity: sha512-PFTA1gzfp1B1UaiJVyhJZA1rm0+Tzn690frc/L8vNX1Jop4STZgOE6bxUhnzdVSB+vm2GU1tIsuQcA9bxTQpMQ==} + mdast-util-gfm-task-list-item@2.0.0: + resolution: {integrity: sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ==} + mdast-util-gfm@2.0.2: resolution: {integrity: sha512-qvZ608nBppZ4icQlhQQIAdc6S3Ffj9RGmzwUKUWuEICFnd1LVkN3EktF7ZHAgfcEdvZB5owU9tQgt99e2TlLjg==} + mdast-util-gfm@3.0.0: + resolution: {integrity: sha512-dgQEX5Amaq+DuUqf26jJqSK9qgixgd6rYDHAv4aTBuA92cTknZlKpPfa86Z/s8Dj8xsAQpFfBmPUHWJBWqS4Bw==} + mdast-util-math@2.0.2: resolution: {integrity: sha512-8gmkKVp9v6+Tgjtq6SYx9kGPpTf6FVYRa53/DLh479aldR9AyP48qeVOgNZ5X7QUK7nOy4yw7vg6mbiGcs9jWQ==} + mdast-util-mdx-expression@2.0.1: + resolution: {integrity: sha512-J6f+9hUp+ldTZqKRSg7Vw5V6MqjATc+3E4gf3CFNcuZNWD8XdyI6zQ8GqH7f8169MM6P7hMBRDVGnn7oHB9kXQ==} + + mdast-util-mdx-jsx@3.1.3: + resolution: {integrity: sha512-bfOjvNt+1AcbPLTFMFWY149nJz0OjmewJs3LQQ5pIyVGxP4CdOqNVJL6kTaM5c68p8q82Xv3nCyFfUnuEcH3UQ==} + + mdast-util-mdx@3.0.0: + resolution: {integrity: sha512-JfbYLAW7XnYTTbUsmpu0kdBUVe+yKVJZBItEjwyYJiDJuZ9w4eeaqks4HQO+R7objWgS2ymV60GYpI14Ug554w==} + + mdast-util-mdxjs-esm@2.0.1: + resolution: {integrity: sha512-EcmOpxsZ96CvlP03NghtH1EsLtr0n9Tm4lPUJUBccV9RwUOneqSycg19n5HGzCf+10LozMRSObtVr3ee1WoHtg==} + mdast-util-phrasing@3.0.1: resolution: {integrity: sha512-WmI1gTXUBJo4/ZmSk79Wcb2HcjPJBzM1nlI/OUWA8yk2X9ik3ffNbBGsU+09BFmXaL1IBb9fiuvq6/KMiNycSg==} + mdast-util-phrasing@4.1.0: + resolution: {integrity: sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==} + mdast-util-to-hast@12.3.0: resolution: {integrity: sha512-pits93r8PhnIoU4Vy9bjW39M2jJ6/tdHyja9rrot9uujkN7UTU9SDnE6WNJz/IGyQk3XHX6yNNtrBH6cQzm8Hw==} + mdast-util-to-hast@13.2.0: + resolution: {integrity: sha512-QGYKEuUsYT9ykKBCMOEDLsU5JRObWQusAolFMeko/tYPufNkRffBAQjIE+99jbA87xv6FgmjLtwjh9wBWajwAA==} + mdast-util-to-markdown@1.5.0: resolution: {integrity: sha512-bbv7TPv/WC49thZPg3jXuqzuvI45IL2EVAr/KxF0BSdHsU0ceFHOmwQn6evxAh1GaoK/6GQ1wp4R4oW2+LFL/A==} + mdast-util-to-markdown@2.1.0: + resolution: {integrity: sha512-SR2VnIEdVNCJbP6y7kVTJgPLifdr8WEU440fQec7qHoHOUz/oJ2jmNRqdDQ3rbiStOXb2mCDGTuwsK5OPUgYlQ==} + mdast-util-to-string@3.2.0: resolution: {integrity: sha512-V4Zn/ncyN1QNSqSBxTrMOLpjr+IKdHl2v3KVLoWmDPscP4r9GcCi71gjgvUV1SFSKh92AjAG4peFuBl2/YgCJg==} + mdast-util-to-string@4.0.0: + resolution: {integrity: sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==} + mdn-data@2.0.28: resolution: {integrity: sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==} mdn-data@2.0.30: resolution: {integrity: sha512-GaqWWShW4kv/G9IEucWScBx9G1/vsFZZJUO+tD26M8J8z3Kw5RDQjaoZe03YAClgeS/SWPOcb4nkFBTEi5DUEA==} + mdurl@2.0.0: + resolution: {integrity: sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==} + media-query-parser@2.0.2: resolution: {integrity: sha512-1N4qp+jE0pL5Xv4uEcwVUhIkwdUO3S/9gML90nqKA7v7FcOS5vUtatfzok9S9U1EJU8dHWlcv95WLnKmmxZI9w==} @@ -12191,10 +15182,22 @@ packages: merge-stream@2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} + merge-value@1.0.0: + resolution: {integrity: sha512-fJMmvat4NeKz63Uv9iHWcPDjCWcCkoiRoajRTEO8hlhUC6rwaHg0QCF9hBOTjZmm4JuglPckPSTtcuJL5kp0TQ==} + engines: {node: '>=0.10.0'} + merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} + meshline@3.3.1: + resolution: {integrity: sha512-/TQj+JdZkeSUOl5Mk2J7eLcYTLiQm2IDzmlSvYm7ov15anEcDJ92GHqqazxTSreeNgfnYu24kiEvvv0WlbCdFQ==} + peerDependencies: + three: '>=0.137' + + meshoptimizer@0.18.1: + resolution: {integrity: sha512-ZhoIoL7TNV4s5B6+rx5mC//fw8/POGyNxS/DZyCJeiZ12ScLfVwRE/GfsxwiTkMYYD5DmK2/JXnEVXqL4rF+Sw==} + methods@1.1.2: resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==} engines: {node: '>= 0.6'} @@ -12205,81 +15208,183 @@ packages: micromark-core-commonmark@1.1.0: resolution: {integrity: sha512-BgHO1aRbolh2hcrzL2d1La37V0Aoz73ymF8rAcKnohLy93titmv62E0gP8Hrx9PKcKrqCZ1BbLGbP3bEhoXYlw==} + micromark-core-commonmark@2.0.1: + resolution: {integrity: sha512-CUQyKr1e///ZODyD1U3xit6zXwy1a8q2a1S1HKtIlmgvurrEpaw/Y9y6KSIbF8P59cn/NjzHyO+Q2fAyYLQrAA==} + + micromark-extension-directive@3.0.2: + resolution: {integrity: sha512-wjcXHgk+PPdmvR58Le9d7zQYWy+vKEU9Se44p2CrCDPiLr2FMyiT4Fyb5UFKFC66wGB3kPlgD7q3TnoqPS7SZA==} + + micromark-extension-frontmatter@2.0.0: + resolution: {integrity: sha512-C4AkuM3dA58cgZha7zVnuVxBhDsbttIMiytjgsM2XbHAB2faRVaHRle40558FBN+DJcrLNCoqG5mlrpdU4cRtg==} + micromark-extension-gfm-autolink-literal@1.0.5: resolution: {integrity: sha512-z3wJSLrDf8kRDOh2qBtoTRD53vJ+CWIyo7uyZuxf/JAbNJjiHsOpG1y5wxk8drtv3ETAHutCu6N3thkOOgueWg==} + micromark-extension-gfm-autolink-literal@2.1.0: + resolution: {integrity: sha512-oOg7knzhicgQ3t4QCjCWgTmfNhvQbDDnJeVu9v81r7NltNCVmhPy1fJRX27pISafdjL+SVc4d3l48Gb6pbRypw==} + micromark-extension-gfm-footnote@1.1.2: resolution: {integrity: sha512-Yxn7z7SxgyGWRNa4wzf8AhYYWNrwl5q1Z8ii+CSTTIqVkmGZF1CElX2JI8g5yGoM3GAman9/PVCUFUSJ0kB/8Q==} + micromark-extension-gfm-footnote@2.1.0: + resolution: {integrity: sha512-/yPhxI1ntnDNsiHtzLKYnE3vf9JZ6cAisqVDauhp4CEHxlb4uoOTxOCJ+9s51bIB8U1N1FJ1RXOKTIlD5B/gqw==} + micromark-extension-gfm-strikethrough@1.0.7: resolution: {integrity: sha512-sX0FawVE1o3abGk3vRjOH50L5TTLr3b5XMqnP9YDRb34M0v5OoZhG+OHFz1OffZ9dlwgpTBKaT4XW/AsUVnSDw==} + micromark-extension-gfm-strikethrough@2.1.0: + resolution: {integrity: sha512-ADVjpOOkjz1hhkZLlBiYA9cR2Anf8F4HqZUO6e5eDcPQd0Txw5fxLzzxnEkSkfnD0wziSGiv7sYhk/ktvbf1uw==} + micromark-extension-gfm-table@1.0.7: resolution: {integrity: sha512-3ZORTHtcSnMQEKtAOsBQ9/oHp9096pI/UvdPtN7ehKvrmZZ2+bbWhi0ln+I9drmwXMt5boocn6OlwQzNXeVeqw==} + micromark-extension-gfm-table@2.1.0: + resolution: {integrity: sha512-Ub2ncQv+fwD70/l4ou27b4YzfNaCJOvyX4HxXU15m7mpYY+rjuWzsLIPZHJL253Z643RpbcP1oeIJlQ/SKW67g==} + micromark-extension-gfm-tagfilter@1.0.2: resolution: {integrity: sha512-5XWB9GbAUSHTn8VPU8/1DBXMuKYT5uOgEjJb8gN3mW0PNW5OPHpSdojoqf+iq1xo7vWzw/P8bAHY0n6ijpXF7g==} + micromark-extension-gfm-tagfilter@2.0.0: + resolution: {integrity: sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg==} + micromark-extension-gfm-task-list-item@1.0.5: resolution: {integrity: sha512-RMFXl2uQ0pNQy6Lun2YBYT9g9INXtWJULgbt01D/x8/6yJ2qpKyzdZD3pi6UIkzF++Da49xAelVKUeUMqd5eIQ==} + micromark-extension-gfm-task-list-item@2.1.0: + resolution: {integrity: sha512-qIBZhqxqI6fjLDYFTBIa4eivDMnP+OZqsNwmQ3xNLE4Cxwc+zfQEfbs6tzAo2Hjq+bh6q5F+Z8/cksrLFYWQQw==} + micromark-extension-gfm@2.0.3: resolution: {integrity: sha512-vb9OoHqrhCmbRidQv/2+Bc6pkP0FrtlhurxZofvOEy5o8RtuuvTq+RQ1Vw5ZDNrVraQZu3HixESqbG+0iKk/MQ==} + micromark-extension-gfm@3.0.0: + resolution: {integrity: sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w==} + micromark-extension-math@2.1.2: resolution: {integrity: sha512-es0CcOV89VNS9wFmyn+wyFTKweXGW4CEvdaAca6SWRWPyYCbBisnjaHLjWO4Nszuiud84jCpkHsqAJoa768Pvg==} + micromark-extension-mdx-expression@3.0.0: + resolution: {integrity: sha512-sI0nwhUDz97xyzqJAbHQhp5TfaxEvZZZ2JDqUo+7NvyIYG6BZ5CPPqj2ogUoPJlmXHBnyZUzISg9+oUmU6tUjQ==} + + micromark-extension-mdx-jsx@3.0.1: + resolution: {integrity: sha512-vNuFb9czP8QCtAQcEJn0UJQJZA8Dk6DXKBqx+bg/w0WGuSxDxNr7hErW89tHUY31dUW4NqEOWwmEUNhjTFmHkg==} + + micromark-extension-mdx-md@2.0.0: + resolution: {integrity: sha512-EpAiszsB3blw4Rpba7xTOUptcFeBFi+6PY8VnJ2hhimH+vCQDirWgsMpz7w1XcZE7LVrSAUGb9VJpG9ghlYvYQ==} + + micromark-extension-mdxjs-esm@3.0.0: + resolution: {integrity: sha512-DJFl4ZqkErRpq/dAPyeWp15tGrcrrJho1hKK5uBS70BCtfrIFg81sqcTVu3Ta+KD1Tk5vAtBNElWxtAa+m8K9A==} + + micromark-extension-mdxjs@3.0.0: + resolution: {integrity: sha512-A873fJfhnJ2siZyUrJ31l34Uqwy4xIFmvPY1oj+Ean5PHcPBYzEsvqvWGaWcfEIr11O5Dlw3p2y0tZWpKHDejQ==} + micromark-factory-destination@1.1.0: resolution: {integrity: sha512-XaNDROBgx9SgSChd69pjiGKbV+nfHGDPVYFs5dOoDd7ZnMAE+Cuu91BCpsY8RT2NP9vo/B8pds2VQNCLiu0zhg==} + micromark-factory-destination@2.0.0: + resolution: {integrity: sha512-j9DGrQLm/Uhl2tCzcbLhy5kXsgkHUrjJHg4fFAeoMRwJmJerT9aw4FEhIbZStWN8A3qMwOp1uzHr4UL8AInxtA==} + micromark-factory-label@1.1.0: resolution: {integrity: sha512-OLtyez4vZo/1NjxGhcpDSbHQ+m0IIGnT8BoPamh+7jVlzLJBH98zzuCoUeMxvM6WsNeh8wx8cKvqLiPHEACn0w==} + micromark-factory-label@2.0.0: + resolution: {integrity: sha512-RR3i96ohZGde//4WSe/dJsxOX6vxIg9TimLAS3i4EhBAFx8Sm5SmqVfR8E87DPSR31nEAjZfbt91OMZWcNgdZw==} + + micromark-factory-mdx-expression@2.0.2: + resolution: {integrity: sha512-5E5I2pFzJyg2CtemqAbcyCktpHXuJbABnsb32wX2U8IQKhhVFBqkcZR5LRm1WVoFqa4kTueZK4abep7wdo9nrw==} + micromark-factory-space@1.1.0: resolution: {integrity: sha512-cRzEj7c0OL4Mw2v6nwzttyOZe8XY/Z8G0rzmWQZTBi/jjwyw/U4uqKtUORXQrR5bAZZnbTI/feRV/R7hc4jQYQ==} + micromark-factory-space@2.0.0: + resolution: {integrity: sha512-TKr+LIDX2pkBJXFLzpyPyljzYK3MtmllMUMODTQJIUfDGncESaqB90db9IAUcz4AZAJFdd8U9zOp9ty1458rxg==} + micromark-factory-title@1.1.0: resolution: {integrity: sha512-J7n9R3vMmgjDOCY8NPw55jiyaQnH5kBdV2/UXCtZIpnHH3P6nHUKaH7XXEYuWwx/xUJcawa8plLBEjMPU24HzQ==} + micromark-factory-title@2.0.0: + resolution: {integrity: sha512-jY8CSxmpWLOxS+t8W+FG3Xigc0RDQA9bKMY/EwILvsesiRniiVMejYTE4wumNc2f4UbAa4WsHqe3J1QS1sli+A==} + micromark-factory-whitespace@1.1.0: resolution: {integrity: sha512-v2WlmiymVSp5oMg+1Q0N1Lxmt6pMhIHD457whWM7/GUlEks1hI9xj5w3zbc4uuMKXGisksZk8DzP2UyGbGqNsQ==} + micromark-factory-whitespace@2.0.0: + resolution: {integrity: sha512-28kbwaBjc5yAI1XadbdPYHX/eDnqaUFVikLwrO7FDnKG7lpgxnvk/XGRhX/PN0mOZ+dBSZ+LgunHS+6tYQAzhA==} + micromark-util-character@1.2.0: resolution: {integrity: sha512-lXraTwcX3yH/vMDaFWCQJP1uIszLVebzUa3ZHdrgxr7KEU/9mL4mVgCpGbyhvNLNlauROiNUq7WN5u7ndbY6xg==} + micromark-util-character@2.1.0: + resolution: {integrity: sha512-KvOVV+X1yLBfs9dCBSopq/+G1PcgT3lAK07mC4BzXi5E7ahzMAF8oIupDDJ6mievI6F+lAATkbQQlQixJfT3aQ==} + micromark-util-chunked@1.1.0: resolution: {integrity: sha512-Ye01HXpkZPNcV6FiyoW2fGZDUw4Yc7vT0E9Sad83+bEDiCJ1uXu0S3mr8WLpsz3HaG3x2q0HM6CTuPdcZcluFQ==} + micromark-util-chunked@2.0.0: + resolution: {integrity: sha512-anK8SWmNphkXdaKgz5hJvGa7l00qmcaUQoMYsBwDlSKFKjc6gjGXPDw3FNL3Nbwq5L8gE+RCbGqTw49FK5Qyvg==} + micromark-util-classify-character@1.1.0: resolution: {integrity: sha512-SL0wLxtKSnklKSUplok1WQFoGhUdWYKggKUiqhX+Swala+BtptGCu5iPRc+xvzJ4PXE/hwM3FNXsfEVgoZsWbw==} + micromark-util-classify-character@2.0.0: + resolution: {integrity: sha512-S0ze2R9GH+fu41FA7pbSqNWObo/kzwf8rN/+IGlW/4tC6oACOs8B++bh+i9bVyNnwCcuksbFwsBme5OCKXCwIw==} + micromark-util-combine-extensions@1.1.0: resolution: {integrity: sha512-Q20sp4mfNf9yEqDL50WwuWZHUrCO4fEyeDCnMGmG5Pr0Cz15Uo7KBs6jq+dq0EgX4DPwwrh9m0X+zPV1ypFvUA==} + micromark-util-combine-extensions@2.0.0: + resolution: {integrity: sha512-vZZio48k7ON0fVS3CUgFatWHoKbbLTK/rT7pzpJ4Bjp5JjkZeasRfrS9wsBdDJK2cJLHMckXZdzPSSr1B8a4oQ==} + micromark-util-decode-numeric-character-reference@1.1.0: resolution: {integrity: sha512-m9V0ExGv0jB1OT21mrWcuf4QhP46pH1KkfWy9ZEezqHKAxkj4mPCy3nIH1rkbdMlChLHX531eOrymlwyZIf2iw==} + micromark-util-decode-numeric-character-reference@2.0.1: + resolution: {integrity: sha512-bmkNc7z8Wn6kgjZmVHOX3SowGmVdhYS7yBpMnuMnPzDq/6xwVA604DuOXMZTO1lvq01g+Adfa0pE2UKGlxL1XQ==} + micromark-util-decode-string@1.1.0: resolution: {integrity: sha512-YphLGCK8gM1tG1bd54azwyrQRjCFcmgj2S2GoJDNnh4vYtnL38JS8M4gpxzOPNyHdNEpheyWXCTnnTDY3N+NVQ==} + micromark-util-decode-string@2.0.0: + resolution: {integrity: sha512-r4Sc6leeUTn3P6gk20aFMj2ntPwn6qpDZqWvYmAG6NgvFTIlj4WtrAudLi65qYoaGdXYViXYw2pkmn7QnIFasA==} + micromark-util-encode@1.1.0: resolution: {integrity: sha512-EuEzTWSTAj9PA5GOAs992GzNh2dGQO52UvAbtSOMvXTxv3Criqb6IOzJUBCmEqrrXSblJIJBbFFv6zPxpreiJw==} + micromark-util-encode@2.0.0: + resolution: {integrity: sha512-pS+ROfCXAGLWCOc8egcBvT0kf27GoWMqtdarNfDcjb6YLuV5cM3ioG45Ys2qOVqeqSbjaKg72vU+Wby3eddPsA==} + + micromark-util-events-to-acorn@2.0.2: + resolution: {integrity: sha512-Fk+xmBrOv9QZnEDguL9OI9/NQQp6Hz4FuQ4YmCb/5V7+9eAh1s6AYSvL20kHkD67YIg7EpE54TiSlcsf3vyZgA==} + micromark-util-html-tag-name@1.2.0: resolution: {integrity: sha512-VTQzcuQgFUD7yYztuQFKXT49KghjtETQ+Wv/zUjGSGBioZnkA4P1XXZPT1FHeJA6RwRXSF47yvJ1tsJdoxwO+Q==} + micromark-util-html-tag-name@2.0.0: + resolution: {integrity: sha512-xNn4Pqkj2puRhKdKTm8t1YHC/BAjx6CEwRFXntTaRf/x16aqka6ouVoutm+QdkISTlT7e2zU7U4ZdlDLJd2Mcw==} + micromark-util-normalize-identifier@1.1.0: resolution: {integrity: sha512-N+w5vhqrBihhjdpM8+5Xsxy71QWqGn7HYNUvch71iV2PM7+E3uWGox1Qp90loa1ephtCxG2ftRV/Conitc6P2Q==} + micromark-util-normalize-identifier@2.0.0: + resolution: {integrity: sha512-2xhYT0sfo85FMrUPtHcPo2rrp1lwbDEEzpx7jiH2xXJLqBuy4H0GgXk5ToU8IEwoROtXuL8ND0ttVa4rNqYK3w==} + micromark-util-resolve-all@1.1.0: resolution: {integrity: sha512-b/G6BTMSg+bX+xVCshPTPyAu2tmA0E4X98NSR7eIbeC6ycCqCeE7wjfDIgzEbkzdEVJXRtOG4FbEm/uGbCRouA==} + micromark-util-resolve-all@2.0.0: + resolution: {integrity: sha512-6KU6qO7DZ7GJkaCgwBNtplXCvGkJToU86ybBAUdavvgsCiG8lSSvYxr9MhwmQ+udpzywHsl4RpGJsYWG1pDOcA==} + micromark-util-sanitize-uri@1.2.0: resolution: {integrity: sha512-QO4GXv0XZfWey4pYFndLUKEAktKkG5kZTdUNaTAkzbuJxn2tNBOr+QtxR2XpWaMhbImT2dPzyLrPXLlPhph34A==} + micromark-util-sanitize-uri@2.0.0: + resolution: {integrity: sha512-WhYv5UEcZrbAtlsnPuChHUAsu/iBPOVaEVsntLBIdpibO0ddy8OzavZz3iL2xVvBZOpolujSliP65Kq0/7KIYw==} + micromark-util-subtokenize@1.1.0: resolution: {integrity: sha512-kUQHyzRoxvZO2PuLzMt2P/dwVsTiivCK8icYTeR+3WgbuPqfHgPPy7nFKbeqRivBvn/3N3GBiNC+JRTMSxEC7A==} + micromark-util-subtokenize@2.0.1: + resolution: {integrity: sha512-jZNtiFl/1aY73yS3UGQkutD0UbhTt68qnRpw2Pifmz5wV9h8gOVsN70v+Lq/f1rKaU/W8pxRe8y8Q9FX1AOe1Q==} + micromark-util-symbol@1.1.0: resolution: {integrity: sha512-uEjpEYY6KMs1g7QfJ2eX1SQEV+ZT4rUD3UcF6l57acZvLNK7PBZL+ty82Z1qhK1/yXIY4bdx04FKMgR0g4IAag==} @@ -12289,9 +15394,15 @@ packages: micromark-util-types@1.1.0: resolution: {integrity: sha512-ukRBgie8TIAcacscVHSiddHjO4k/q3pnedmzMQ4iwDcK0FtFCohKOlFbaOL/mPgfnPsL3C1ZyxJa4sbWrBl3jg==} + micromark-util-types@2.0.0: + resolution: {integrity: sha512-oNh6S2WMHWRZrmutsRmDDfkzKtxF+bc2VxLC9dvtrDIRFln627VsFP6fLMgTryGDljgLPjkrzQSDcPrjPyDJ5w==} + micromark@3.2.0: resolution: {integrity: sha512-uD66tJj54JLYq0De10AhWycZWGQNUvDI55xPgk2sQM5kn1JYlhbCMTtEeT27+vAhW2FBQxLlOmS3pmA7/2z4aA==} + micromark@4.0.0: + resolution: {integrity: sha512-o/sd0nMof8kYff+TqcDx3VSrgBTcZpSvYcAHIfHhv5VAuNmisCxjhx6YmxS8PFEpb9z5WKWKPdzf0jM23ro3RQ==} + micromatch@3.1.0: resolution: {integrity: sha512-3StSelAE+hnRvMs8IdVW7Uhk8CVed5tp+kLLGlBP6WiRAXS21GPGu/Nat4WNPXj2Eoc24B02SaeoyozPMfj0/g==} engines: {node: '>=0.10.0'} @@ -12300,6 +15411,10 @@ packages: resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} engines: {node: '>=8.6'} + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} + mime-db@1.33.0: resolution: {integrity: sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==} engines: {node: '>= 0.6'} @@ -12331,6 +15446,11 @@ packages: engines: {node: '>=4.0.0'} hasBin: true + mime@4.0.4: + resolution: {integrity: sha512-v8yqInVjhXyqP6+Kw4fV3ZzeMRqEW6FotRsKXjRS5VMTNIuXsdRoAvklpoRgSqXm6o9VNH4/C0mgedko9DdLsQ==} + engines: {node: '>=16'} + hasBin: true + mimic-fn@1.2.0: resolution: {integrity: sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==} engines: {node: '>=4'} @@ -12351,6 +15471,10 @@ packages: resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} engines: {node: '>=10'} + mimic-response@4.0.0: + resolution: {integrity: sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + min-indent@1.0.1: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} @@ -12358,6 +15482,19 @@ packages: mind-elixir@3.3.2: resolution: {integrity: sha512-SHHospQXT7ARaNMMnaZLFzBsOela9tc8rgSYHPhAPrV8Jxh6MCo1X8qQxJAvuqIVvN8uSGnXf+Po4nhzzSmWWQ==} + mini-css-extract-plugin@2.9.1: + resolution: {integrity: sha512-+Vyi+GCCOHnrJ2VPS+6aPoXN2k2jgUzDRhTFLjjTBn23qyXJXkjUWQgTL+mXpF5/A8ixLdCc6kWsoeOjKGejKQ==} + engines: {node: '>= 12.13.0'} + peerDependencies: + webpack: ^5.0.0 + + minimalistic-assert@1.0.1: + resolution: {integrity: sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==} + + minimatch@10.0.1: + resolution: {integrity: sha512-ethXTt3SGGR+95gudmqJ1eNhRO7eGEGIgYA9vnPatK4/etz2MEVDno5GMCibdMTuBMyElzIlgxMna3K94XDIDQ==} + engines: {node: 20 || >=22} + minimatch@3.0.8: resolution: {integrity: sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q==} @@ -12418,10 +15555,6 @@ packages: resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} engines: {node: '>=8'} - minipass@7.1.1: - resolution: {integrity: sha512-UZ7eQ+h8ywIRAW1hIEl2AqdwzJucU/Kp59+8kkZeSvafXhZjul247BvIJjEVFVeON6d7lM46XX1HXCduKAS8VA==} - engines: {node: '>=16 || 14 >=14.17'} - minipass@7.1.2: resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} engines: {node: '>=16 || 14 >=14.17'} @@ -12441,6 +15574,9 @@ packages: resolution: {integrity: sha512-VC5fg6ySUscaWUpI4gxCBTQMH2RdUpNrk+MsbpCYtIvf9SBJdiUey4qE7BXviJsJR4nDQxCZ+3yaYNW3guz/Pw==} engines: {node: '>= 8.0.0'} + mkdirp-classic@0.5.3: + resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==} + mkdirp@0.5.6: resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} hasBin: true @@ -12502,6 +15638,10 @@ packages: resolution: {integrity: sha512-WeSGziVj6+Z2/MwQo3GvqzgR+9Uc+qt8SwHKh3gvNPiISKfsMfG4SvCOFYlxxgkXt7yIV2i1yczehm0EOKIxIg==} engines: {node: '>= 6.0.0'} + multicast-dns@7.2.5: + resolution: {integrity: sha512-2eznPJP8z2BFLX50tf0LuODrpINqP1RVIm/CObbTcBRITQgmC/TjcREF1NeTBzIcR5XO/ukWo+YHOjBbFwIupg==} + hasBin: true + multipipe@1.0.2: resolution: {integrity: sha512-6uiC9OvY71vzSGX8lZvSqscE7ft9nPupJ8fMjrCNRAUy2LREUW42UL+V/NTrogr6rFgRydUrCX4ZitfpSNkSCQ==} @@ -12548,6 +15688,9 @@ packages: nanospinner@1.1.0: resolution: {integrity: sha512-yFvNYMig4AthKYfHFl1sLj7B2nkHL4lzdig4osvl9/LdGbXwrdFRoqBS98gsEsOakr0yH+r5NZ/1Y9gdVB8trA==} + napi-build-utils@1.0.2: + resolution: {integrity: sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==} + natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} @@ -12563,6 +15706,12 @@ packages: neo-async@2.6.2: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} + next-themes@0.3.0: + resolution: {integrity: sha512-/QHIrsYpd6Kfk7xakK4svpDI5mmXP0gfvCoJdGpZQ2TOrQZmsW0QxjaiLn8wbIKjtm4BTSqLoix4lxYYOnLJ/w==} + peerDependencies: + react: ^16.8 || ^17 || ^18 + react-dom: ^16.8 || ^17 || ^18 + nice-try@1.0.5: resolution: {integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==} @@ -12579,12 +15728,19 @@ packages: node-addon-api@1.7.2: resolution: {integrity: sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg==} + node-addon-api@6.1.0: + resolution: {integrity: sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA==} + node-api-version@0.2.0: resolution: {integrity: sha512-fthTTsi8CxaBXMaBAD7ST2uylwvsnYxh2PfaScwpMhos6KlSFajXQPcM4ogNE1q2s3Lbz9GCGqeIHC+C6OZnKg==} node-emoji@1.11.0: resolution: {integrity: sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A==} + node-emoji@2.1.3: + resolution: {integrity: sha512-E2WEOVsgs7O16zsURJ/eH8BqhF029wGpEOnv7Urwdo2wmQanOACwJQh0devF9D9RhoZru0+9JXIS0dBXIAz+lA==} + engines: {node: '>=18'} + node-eval@2.0.0: resolution: {integrity: sha512-Ap+L9HznXAVeJj3TJ1op6M6bg5xtTq8L5CU/PJxtkhea/DrIxdTknGKIECKd/v/Lgql95iuMAYvIzBNd0pmcMg==} engines: {node: '>= 4'} @@ -12604,6 +15760,10 @@ packages: encoding: optional: true + node-forge@1.3.1: + resolution: {integrity: sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==} + engines: {node: '>= 6.13.0'} + node-gyp-build@4.7.1: resolution: {integrity: sha512-wTSrZ+8lsRRa3I3H8Xr65dLWSgCvY2l4AOnaeKdPA9TB/WYMPaTcrzf3rXvFoVvjKNVnu0CcWSx54qq9GKRUYg==} hasBin: true @@ -12613,15 +15773,18 @@ packages: engines: {node: ^12.13 || ^14.13 || >=16} hasBin: true + node-html-parser@5.4.2: + resolution: {integrity: sha512-RaBPP3+51hPne/OolXxcz89iYvQvKOydaqoePpOgXcrOKZhjVIzmpKZz+Hd/RBO2/zN2q6CNJhQzucVz+u3Jyw==} + node-int64@0.4.0: resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} - node-releases@2.0.13: - resolution: {integrity: sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==} - node-releases@2.0.14: resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==} + node-releases@2.0.18: + resolution: {integrity: sha512-d9VeXT4SJ7ZeOqGX6R5EM022wpL+eWPooLI+5UpWn2jCT1aosUQEhQP214x33Wkwx3JQMvIm+tIoVOdodFS40g==} + nopt@6.0.0: resolution: {integrity: sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} @@ -12646,6 +15809,10 @@ packages: resolution: {integrity: sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==} engines: {node: '>=10'} + normalize-url@8.0.1: + resolution: {integrity: sha512-IO9QvjUMWxPQQhs60oOu10CRkWCiZzSUkzbXGGV9pviYl1fXYcvkzQ5jV9z8Y6un8ARoVRl4EtC6v6jNqbaJ/w==} + engines: {node: '>=14.16'} + normalize-wheel-es@1.2.0: resolution: {integrity: sha512-Wj7+EJQ8mSuXr2iWfnujrimU35R2W4FAErEyTmJoJ7ucwTn2hOUSsRehMb5RSYkxXGTM7Y9QpvPmp++w5ftoJw==} @@ -12660,8 +15827,8 @@ packages: resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} engines: {node: '>=8'} - npm-run-path@5.1.0: - resolution: {integrity: sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==} + npm-run-path@5.3.0: + resolution: {integrity: sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} npmlog@6.0.2: @@ -12723,9 +15890,16 @@ packages: resolution: {integrity: sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ==} engines: {node: '>=0.10.0'} + obuf@1.1.2: + resolution: {integrity: sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==} + ofetch@1.3.4: resolution: {integrity: sha512-KLIET85ik3vhEfS+3fDlc/BAZiAp+43QEC/yCo5zkNoY2YaKvNkOaFr/6wCFgFH1kuYQM5pMNi0Tg8koiIemtw==} + on-finished@2.3.0: + resolution: {integrity: sha512-ikqdkGAAyf/X/gPhXGvfgAytDZtDbr+bkNUJ0N9h5MI/dmdgCs3l6hoHrcUv41sRKew3jIwrp4qQDXiK99Utww==} + engines: {node: '>= 0.8'} + on-finished@2.4.1: resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} engines: {node: '>= 0.8'} @@ -12749,12 +15923,22 @@ packages: resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} engines: {node: '>=12'} + oniguruma-to-es@0.7.0: + resolution: {integrity: sha512-HRaRh09cE0gRS3+wi2zxekB+I5L8C/gN60S+vb11eADHUaB/q4u8wGGOX3GvwvitG8ixaeycZfeoyruKQzUgNg==} + + oniguruma-to-js@0.4.3: + resolution: {integrity: sha512-X0jWUcAlxORhOqqBREgPMgnshB7ZGYszBNspP+tS9hPD3l13CdaXcHbgImoHUHlrvGx/7AvFEkTRhAGYh+jzjQ==} + only@0.0.2: resolution: {integrity: sha512-Fvw+Jemq5fjjyWz6CpKx6w9s7xxqo3+JCyM0WXWeCSOboZ8ABkyvP8ID4CZuChA/wxSx+XSJmdOm8rGVyJ1hdQ==} - open@9.1.0: - resolution: {integrity: sha512-OS+QTnw1/4vrf+9hh1jc1jnYjzSG4ttTBB8UxOwAnInG3Uo4ssetzC1ihqaIHjLJnA5GGlRl6QlZXOTQhRBUvg==} - engines: {node: '>=14.16'} + open@10.1.0: + resolution: {integrity: sha512-mnkeQ1qP5Ue2wd+aivTD3NHd/lZ96Lu0jgf0pwktLPtx6cTZiH7tyeGRRHs0zX0rbrahXPnXlUnbeXyaBBuIaw==} + engines: {node: '>=18'} + + open@8.4.2: + resolution: {integrity: sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ==} + engines: {node: '>=12'} opencollective-postinstall@2.0.3: resolution: {integrity: sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==} @@ -12764,6 +15948,10 @@ packages: resolution: {integrity: sha512-YBRI0Qa8+Ui0/STV1qYuPrJm889PT3oCPHMVoL+8Y3nwCffj7PSrB2NlGgrhgBKDujxTjxknHWJ/FiqOsYcIDw==} hasBin: true + opener@1.5.2: + resolution: {integrity: sha512-ur5UIdyw5Y7yEj9wLzhqXiy6GZ3Mwx0yGI+5sMn2r0N0v3cKJvUmFH5yPP+WXh9e0xfyzyJX95D8l088DNFj7A==} + hasBin: true + opn@4.0.2: resolution: {integrity: sha512-iPBWbPP4OEOzR1xfhpGLDh+ypKBOygunZhM9jBtA7FS5sKjEiMZw0EFb82hnDOmTZX90ZWLoZKUza4cVt8MexA==} engines: {node: '>=0.10.0'} @@ -12790,6 +15978,10 @@ packages: resolution: {integrity: sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==} engines: {node: '>=8'} + p-cancelable@3.0.0: + resolution: {integrity: sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw==} + engines: {node: '>=12.20'} + p-defer@1.0.0: resolution: {integrity: sha512-wB3wfAxZpk2AzOfUMJNL+d36xothRSyj8EXOa4f6GMqYDN9BJaaSISbsk+wS9abmnebVw95C2Kb5t85UmpCxuw==} engines: {node: '>=4'} @@ -12826,6 +16018,10 @@ packages: resolution: {integrity: sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==} engines: {node: '>=4'} + p-locate@3.0.0: + resolution: {integrity: sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==} + engines: {node: '>=6'} + p-locate@4.1.0: resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} engines: {node: '>=8'} @@ -12846,6 +16042,10 @@ packages: resolution: {integrity: sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==} engines: {node: '>=10'} + p-retry@4.6.2: + resolution: {integrity: sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ==} + engines: {node: '>=8'} + p-try@1.0.0: resolution: {integrity: sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==} engines: {node: '>=4'} @@ -12857,12 +16057,22 @@ packages: package-json-from-dist@1.0.0: resolution: {integrity: sha512-dATvCeZN/8wQsGywez1mzHtTlP22H8OEfPrVMLNr4/eGa+ijtLn/6M5f0dY8UKNrC2O9UCU6SSoG3qRKnt7STw==} + package-json@8.1.1: + resolution: {integrity: sha512-cbH9IAIJHNj9uXi196JVsRlt7cHKak6u/e6AkL/bkRelZ7rlL3X1YKxsZwa36xipOEKAsdtmaG6aAJoM1fx2zA==} + engines: {node: '>=14.16'} + package-manager-detector@0.1.2: resolution: {integrity: sha512-iePyefLTOm2gEzbaZKSW+eBMjg+UYsQvUKxmvGXAQ987K16efBg10MxIjZs08iyX+DY2/owKY9DIdu193kX33w==} + package-manager-detector@0.2.2: + resolution: {integrity: sha512-VgXbyrSNsml4eHWIvxxG/nTL4wgybMTXCV2Un/+yEc3aDKKU6nQBZjbeP3Pl3qm9Qg92X/1ng4ffvCeD/zwHgg==} + pako@1.0.11: resolution: {integrity: sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==} + param-case@3.0.4: + resolution: {integrity: sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==} + parchment@3.0.0: resolution: {integrity: sha512-HUrJFQ/StvgmXRcQ1ftY6VEZUq3jA2t9ncFN4F84J/vN0/FPpQF+8FKXb3l6fLces6q0uOHj6NJn+2xvZnxO6A==} @@ -12882,6 +16092,9 @@ packages: resolution: {integrity: sha512-OZQaqKaQnR21iqhlnPfVisFjBWjhnMl5J9MgbP8xC+EwoVqbXrq78lp+9Zb3ahmLzrIX5Us/qbvBnaS3hkH6OA==} engines: {node: '>=6'} + parse-entities@4.0.1: + resolution: {integrity: sha512-SWzvYcSJh4d/SGLIOQfZ/CoNv6BTlI6YEQ7Nj82oDVnRpwe/Z/F1EMx42x3JAOwGBlCjeCH0BRJQbQ/opHL17w==} + parse-json@2.2.0: resolution: {integrity: sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==} engines: {node: '>=0.10.0'} @@ -12894,6 +16107,9 @@ packages: resolution: {integrity: sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==} engines: {node: '>= 0.10'} + parse-numeric-range@1.3.0: + resolution: {integrity: sha512-twN+njEipszzlMJd4ONUYgSfZPDxgHhT9Ahed5uTigpQn90FggW4SA/AIPq/6a149fTbE9qBEcSwE3FAEp6wQQ==} + parse-passwd@1.0.0: resolution: {integrity: sha512-1Y1A//QUXEZK7YKz+rD9WydcE1+EuPr6ZBgKecAB8tmoW6UFv0NREVJe1p+jRxtThkcbbKkfwIbWJe/IeE6m2Q==} engines: {node: '>=0.10.0'} @@ -12901,13 +16117,22 @@ packages: parse-svg-path@0.1.2: resolution: {integrity: sha512-JyPSBnkTJ0AI8GGJLfMXvKq42cj5c006fnLz6fXy6zfoVjJizi8BNTpu8on8ziI1cKy9d9DGNuY17Ce7wuejpQ==} + parse5-htmlparser2-tree-adapter@7.0.0: + resolution: {integrity: sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==} + parse5@7.1.2: resolution: {integrity: sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==} + parse5@7.2.1: + resolution: {integrity: sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ==} + parseurl@1.3.3: resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} engines: {node: '>= 0.8'} + pascal-case@3.1.2: + resolution: {integrity: sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==} + pascalcase@0.1.1: resolution: {integrity: sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw==} engines: {node: '>=0.10.0'} @@ -12953,6 +16178,10 @@ packages: resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} engines: {node: '>=16 || 14 >=14.18'} + path-scurry@2.0.0: + resolution: {integrity: sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg==} + engines: {node: 20 || >=22} + path-to-regexp@0.1.7: resolution: {integrity: sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==} @@ -12973,6 +16202,9 @@ packages: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} + pathe@0.2.0: + resolution: {integrity: sha512-sTitTPYnn23esFR3RlqYBWn4c45WGeLcsKzQiUpXJAyfcWkolvlYpV8FLo7JishK946oQwMFUCHXQ9AjGPKExw==} + pathe@1.1.1: resolution: {integrity: sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==} @@ -12999,6 +16231,9 @@ packages: performance-now@2.1.0: resolution: {integrity: sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==} + periscopic@3.1.0: + resolution: {integrity: sha512-vKiQ8RRtkl9P+r/+oefh25C3fhybptkHKCZSPlcXiJux2tJF55GnEj3BVn4A5gKfq9NWWXXrxkHBwVPUfH0opw==} + picocolors@0.2.1: resolution: {integrity: sha512-cMlDqaLEqfSaW8Z7N5Jw+lyIW869EzT73/F5lhtY9cLGoVxSXznfgfXMO0Z5K0o0Q2TkTXq+0KFsdnSe3jDViA==} @@ -13011,6 +16246,9 @@ packages: picocolors@1.1.0: resolution: {integrity: sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==} + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} @@ -13064,12 +16302,20 @@ packages: resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} engines: {node: '>=8'} + pkg-dir@7.0.0: + resolution: {integrity: sha512-Ie9z/WINcxxLp27BKOCHGde4ITq9UklYKDzVo1nhk5sqGEXU3FpkwP5GM2voTGJkGd9B3Otl+Q4uwSOeSUtOBA==} + engines: {node: '>=14.16'} + pkg-types@1.0.3: resolution: {integrity: sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==} pkg-types@1.1.3: resolution: {integrity: sha512-+JrgthZG6m3ckicaOB74TwQ+tBWsFl3qVQg7mN8ulwSOElJ7gBhKzj2VkCPnZ4NlF6kEquYU+RIYNVAvzd54UA==} + pkg-up@3.1.0: + resolution: {integrity: sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA==} + engines: {node: '>=8'} + playwright-chromium@1.42.1: resolution: {integrity: sha512-VelpmKJ+3G3QlAFfA9JIuEYyU8b8vQrlIPY3tIaGv+adn7mem56SP04e+zMudcxisfOT3suQOSTD1qs6YErdDg==} engines: {node: '>=16'} @@ -13109,18 +16355,155 @@ packages: resolution: {integrity: sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg==} engines: {node: '>=0.10.0'} + postcss-attribute-case-insensitive@7.0.0: + resolution: {integrity: sha512-ETMUHIw67Kyv9Q81nden/NuJbRh+4/S963giXpfSLd5eaKK8kd1UdAHMVRV/NG/w/N6Cq8B0qZIZbZZWU/67+A==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + postcss-calc@9.0.1: + resolution: {integrity: sha512-TipgjGyzP5QzEhsOZUaIkeO5mKeMFpebWzRogWG/ysonUlnHcq5aJe0jOjpfzUU8PeSaBQnrE8ehR0QA5vs8PQ==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.2.2 + + postcss-clamp@4.1.0: + resolution: {integrity: sha512-ry4b1Llo/9zz+PKC+030KUnPITTJAHeOwjfAyyB60eT0AorGLdzp52s31OsPRHRf8NchkgFoG2y6fCfn1IV1Ow==} + engines: {node: '>=7.6.0'} + peerDependencies: + postcss: ^8.4.6 + + postcss-color-functional-notation@7.0.2: + resolution: {integrity: sha512-c2WkR0MS73s+P5SgY1KBaSEE61Rj+miW095rkWDnMQxbTCQkp6y/jft8U0QMxEsI4k1Pd4PdV+TP9/1zIDR6XQ==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + postcss-color-hex-alpha@10.0.0: + resolution: {integrity: sha512-1kervM2cnlgPs2a8Vt/Qbe5cQ++N7rkYo/2rz2BkqJZIHQwaVuJgQH38REHrAi4uM0b1fqxMkWYmese94iMp3w==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + postcss-color-rebeccapurple@10.0.0: + resolution: {integrity: sha512-JFta737jSP+hdAIEhk1Vs0q0YF5P8fFcj+09pweS8ktuGuZ8pPlykHsk6mPxZ8awDl4TrcxUqJo9l1IhVr/OjQ==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + postcss-colormin@6.1.0: + resolution: {integrity: sha512-x9yX7DOxeMAR+BgGVnNSAxmAj98NX/YxEMNFP+SDCEeNLb2r3i6Hh1ksMsnW8Ub5SLCpbescQqn9YEbE9554Sw==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-convert-values@6.1.0: + resolution: {integrity: sha512-zx8IwP/ts9WvUM6NkVSkiU902QZL1bwPhaVaLynPtCsOTqp+ZKbNi+s6XJg3rfqpKGA/oc7Oxk5t8pOQJcwl/w==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-custom-media@11.0.2: + resolution: {integrity: sha512-IDtxB1VgPayRLjNBMjuf827sn1j2m9EGnhIxpx2coVerbWJF+twt590+PKvdDc4K8QNFqFJh+W/SOiHpasVXsg==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + postcss-custom-properties@14.0.1: + resolution: {integrity: sha512-SB4GjuZjIq5GQFNbxFrirQPbkdbJooyNy8bh+fcJ8ZG0oasJTflTTtR4geb56h+FBVDIb9Hx4v/NiG2caOj8nQ==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + postcss-custom-selectors@8.0.1: + resolution: {integrity: sha512-2McIpyhAeKhUzVqrP4ZyMBpK5FuD+Y9tpQwhcof49652s7gez8057cSaOg/epYcKlztSYxb0GHfi7W5h3JoGUg==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + postcss-dir-pseudo-class@9.0.0: + resolution: {integrity: sha512-T59BG9lURiXmhcJMyKbyjNAK3KCyEQYEhaz9GAETHXfIy9XbGQeyz+H0zIwRJlrP4KKRPJolNYe3QjQPemMjBA==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + postcss-discard-comments@6.0.2: + resolution: {integrity: sha512-65w/uIqhSBBfQmYnG92FO1mWZjJ4GL5b8atm5Yw2UgrwD7HiNiSSNwJor1eCFGzUgYnN/iIknhNRVqjrrpuglw==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-discard-duplicates@6.0.3: + resolution: {integrity: sha512-+JA0DCvc5XvFAxwx6f/e68gQu/7Z9ud584VLmcgto28eB8FqSFZwtrLwB5Kcp70eIoWP/HXqz4wpo8rD8gpsTw==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + postcss-discard-duplicates@7.0.0: resolution: {integrity: sha512-bAnSuBop5LpAIUmmOSsuvtKAAKREB6BBIYStWUTGq8oG5q9fClDMMuY8i4UPI/cEcDx2TN+7PMnXYIId20UVDw==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: postcss: ^8.4.31 + postcss-discard-empty@6.0.3: + resolution: {integrity: sha512-znyno9cHKQsK6PtxL5D19Fj9uwSzC2mB74cpT66fhgOadEUPyXFkbgwm5tvc3bt3NAy8ltE5MrghxovZRVnOjQ==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + postcss-discard-empty@7.0.0: resolution: {integrity: sha512-e+QzoReTZ8IAwhnSdp/++7gBZ/F+nBq9y6PomfwORfP7q9nBpK5AMP64kOt0bA+lShBFbBDcgpJ3X4etHg4lzA==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: postcss: ^8.4.31 + postcss-discard-overridden@6.0.2: + resolution: {integrity: sha512-j87xzI4LUggC5zND7KdjsI25APtyMuynXZSujByMaav2roV6OZX+8AaCUcZSWqckZpjAjRyFDdpqybgjFO0HJQ==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-discard-unused@6.0.5: + resolution: {integrity: sha512-wHalBlRHkaNnNwfC8z+ppX57VhvS+HWgjW508esjdaEYr3Mx7Gnn2xA4R/CKf5+Z9S5qsqC+Uzh4ueENWwCVUA==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-double-position-gradients@6.0.0: + resolution: {integrity: sha512-JkIGah3RVbdSEIrcobqj4Gzq0h53GG4uqDPsho88SgY84WnpkTpI0k50MFK/sX7XqVisZ6OqUfFnoUO6m1WWdg==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + postcss-focus-visible@10.0.0: + resolution: {integrity: sha512-GJjzvTj7JY+zN7wVBQ4osdKX53QLUdr6r2rSEkBUqrEMDKu3fHMHKOY9rirdirbHCx3IETnK25EtpPARR2KWNw==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + postcss-focus-within@9.0.0: + resolution: {integrity: sha512-QwflAWUToNZvQLGbc4qJhrQO8yZ5617L6hSNzNWDoqRX4FoIh9fbJbEjy0nvFPciaaOoCaeqcxBwYPbFU0HvBw==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + postcss-font-variant@5.0.0: + resolution: {integrity: sha512-1fmkBaCALD72CK2a9i468mA/+tr9/1cBxRRMXOUaZqO43oWPR5imcyPjXwuv7PXbCid4ndlP5zWhidQVVa3hmA==} + peerDependencies: + postcss: ^8.1.0 + + postcss-gap-properties@6.0.0: + resolution: {integrity: sha512-Om0WPjEwiM9Ru+VhfEDPZJAKWUd0mV1HmNXqp2C29z80aQ2uP9UVhLc7e3aYMIor/S5cVhoPgYQ7RtfeZpYTRw==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + postcss-image-set-function@7.0.0: + resolution: {integrity: sha512-QL7W7QNlZuzOwBTeXEmbVckNt1FSmhQtbMRvGGqqU4Nf4xk6KUEQhAoWuMzwbSv5jxiRiSZ5Tv7eiDB9U87znA==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + postcss-import@15.1.0: resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==} engines: {node: '>=14.0.0'} @@ -13139,6 +16522,12 @@ packages: peerDependencies: postcss: ^8.4.21 + postcss-lab-function@7.0.6: + resolution: {integrity: sha512-HPwvsoK7C949vBZ+eMyvH2cQeMr3UREoHvbtra76/UhDuiViZH6pir+z71UaJQohd7VDSVUdR6TkWYKExEc9aQ==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + postcss-load-config@4.0.1: resolution: {integrity: sha512-vEJIc8RdiBRu3oRAI0ymerOn+7rPuMvRXslTvZUKZonDHFIczxztIyJ1urxM1x9JXEikvpWWTUUqal5j/8QgvA==} engines: {node: '>= 14'} @@ -13151,40 +16540,249 @@ packages: ts-node: optional: true + postcss-loader@7.3.4: + resolution: {integrity: sha512-iW5WTTBSC5BfsBJ9daFMPVrLT36MrNiC6fqOZTTaHjBNX6Pfd5p+hSBqe/fEeNd7pc13QiAyGt7VdGMw4eRC4A==} + engines: {node: '>= 14.15.0'} + peerDependencies: + postcss: ^7.0.0 || ^8.0.1 + webpack: ^5.0.0 + + postcss-logical@8.0.0: + resolution: {integrity: sha512-HpIdsdieClTjXLOyYdUPAX/XQASNIwdKt5hoZW08ZOAiI+tbV0ta1oclkpVkW5ANU+xJvk3KkA0FejkjGLXUkg==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + postcss-merge-idents@6.0.3: + resolution: {integrity: sha512-1oIoAsODUs6IHQZkLQGO15uGEbK3EAl5wi9SS8hs45VgsxQfMnxvt+L+zIr7ifZFIH14cfAeVe2uCTa+SPRa3g==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-merge-longhand@6.0.5: + resolution: {integrity: sha512-5LOiordeTfi64QhICp07nzzuTDjNSO8g5Ksdibt44d+uvIIAE1oZdRn8y/W5ZtYgRH/lnLDlvi9F8btZcVzu3w==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-merge-rules@6.1.1: + resolution: {integrity: sha512-KOdWF0gju31AQPZiD+2Ar9Qjowz1LTChSjFFbS+e2sFgc4uHOp3ZvVX4sNeTlk0w2O31ecFGgrFzhO0RSWbWwQ==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + postcss-merge-rules@7.0.2: resolution: {integrity: sha512-VAR47UNvRsdrTHLe7TV1CeEtF9SJYR5ukIB9U4GZyZOptgtsS20xSxy+k5wMrI3udST6O1XuIn7cjQkg7sDAAw==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: postcss: ^8.4.31 + postcss-minify-font-values@6.1.0: + resolution: {integrity: sha512-gklfI/n+9rTh8nYaSJXlCo3nOKqMNkxuGpTn/Qm0gstL3ywTr9/WRKznE+oy6fvfolH6dF+QM4nCo8yPLdvGJg==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-minify-gradients@6.0.3: + resolution: {integrity: sha512-4KXAHrYlzF0Rr7uc4VrfwDJ2ajrtNEpNEuLxFgwkhFZ56/7gaE4Nr49nLsQDZyUe+ds+kEhf+YAUolJiYXF8+Q==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-minify-params@6.1.0: + resolution: {integrity: sha512-bmSKnDtyyE8ujHQK0RQJDIKhQ20Jq1LYiez54WiaOoBtcSuflfK3Nm596LvbtlFcpipMjgClQGyGr7GAs+H1uA==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-minify-selectors@6.0.4: + resolution: {integrity: sha512-L8dZSwNLgK7pjTto9PzWRoMbnLq5vsZSTu8+j1P/2GB8qdtGQfn+K1uSvFgYvgh83cbyxT5m43ZZhUMTJDSClQ==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + postcss-minify-selectors@7.0.2: resolution: {integrity: sha512-dCzm04wqW1uqLmDZ41XYNBJfjgps3ZugDpogAmJXoCb5oCiTzIX4oPXXKxDpTvWOnKxQKR4EbV4ZawJBLcdXXA==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: postcss: ^8.4.31 + postcss-modules-extract-imports@3.1.0: + resolution: {integrity: sha512-k3kNe0aNFQDAZGbin48pL2VNidTF0w4/eASDsxlyspobzU3wZQLOGj7L9gfRe0Jo9/4uud09DsjFNH7winGv8Q==} + engines: {node: ^10 || ^12 || >= 14} + peerDependencies: + postcss: ^8.1.0 + + postcss-modules-local-by-default@4.0.5: + resolution: {integrity: sha512-6MieY7sIfTK0hYfafw1OMEG+2bg8Q1ocHCpoWLqOKj3JXlKu4G7btkmM/B7lFubYkYWmRSPLZi5chid63ZaZYw==} + engines: {node: ^10 || ^12 || >= 14} + peerDependencies: + postcss: ^8.1.0 + + postcss-modules-scope@3.2.0: + resolution: {integrity: sha512-oq+g1ssrsZOsx9M96c5w8laRmvEu9C3adDSjI8oTcbfkrTE8hx/zfyobUoWIxaKPO8bt6S62kxpw5GqypEw1QQ==} + engines: {node: ^10 || ^12 || >= 14} + peerDependencies: + postcss: ^8.1.0 + + postcss-modules-values@4.0.0: + resolution: {integrity: sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==} + engines: {node: ^10 || ^12 || >= 14} + peerDependencies: + postcss: ^8.1.0 + postcss-nested@6.0.1: resolution: {integrity: sha512-mEp4xPMi5bSWiMbsgoPfcP74lsWLHkQbZc3sY+jWYd65CUwXrUaTp0fmNpa01ZcETKlIgUdFN/MpS2xZtqL9dQ==} engines: {node: '>=12.0'} peerDependencies: postcss: ^8.2.14 + postcss-nesting@13.0.0: + resolution: {integrity: sha512-TCGQOizyqvEkdeTPM+t6NYwJ3EJszYE/8t8ILxw/YoeUvz2rz7aM8XTAmBWh9/DJjfaaabL88fWrsVHSPF2zgA==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + postcss-normalize-charset@6.0.2: + resolution: {integrity: sha512-a8N9czmdnrjPHa3DeFlwqst5eaL5W8jYu3EBbTTkI5FHkfMhFZh1EGbku6jhHhIzTA6tquI2P42NtZ59M/H/kQ==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-normalize-display-values@6.0.2: + resolution: {integrity: sha512-8H04Mxsb82ON/aAkPeq8kcBbAtI5Q2a64X/mnRRfPXBq7XeogoQvReqxEfc0B4WPq1KimjezNC8flUtC3Qz6jg==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-normalize-positions@6.0.2: + resolution: {integrity: sha512-/JFzI441OAB9O7VnLA+RtSNZvQ0NCFZDOtp6QPFo1iIyawyXg0YI3CYM9HBy1WvwCRHnPep/BvI1+dGPKoXx/Q==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-normalize-repeat-style@6.0.2: + resolution: {integrity: sha512-YdCgsfHkJ2jEXwR4RR3Tm/iOxSfdRt7jplS6XRh9Js9PyCR/aka/FCb6TuHT2U8gQubbm/mPmF6L7FY9d79VwQ==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-normalize-string@6.0.2: + resolution: {integrity: sha512-vQZIivlxlfqqMp4L9PZsFE4YUkWniziKjQWUtsxUiVsSSPelQydwS8Wwcuw0+83ZjPWNTl02oxlIvXsmmG+CiQ==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-normalize-timing-functions@6.0.2: + resolution: {integrity: sha512-a+YrtMox4TBtId/AEwbA03VcJgtyW4dGBizPl7e88cTFULYsprgHWTbfyjSLyHeBcK/Q9JhXkt2ZXiwaVHoMzA==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-normalize-unicode@6.1.0: + resolution: {integrity: sha512-QVC5TQHsVj33otj8/JD869Ndr5Xcc/+fwRh4HAsFsAeygQQXm+0PySrKbr/8tkDKzW+EVT3QkqZMfFrGiossDg==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-normalize-url@6.0.2: + resolution: {integrity: sha512-kVNcWhCeKAzZ8B4pv/DnrU1wNh458zBNp8dh4y5hhxih5RZQ12QWMuQrDgPRw3LRl8mN9vOVfHl7uhvHYMoXsQ==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-normalize-whitespace@6.0.2: + resolution: {integrity: sha512-sXZ2Nj1icbJOKmdjXVT9pnyHQKiSAyuNQHSgRCUgThn2388Y9cGVDR+E9J9iAYbSbLHI+UUwLVl1Wzco/zgv0Q==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + postcss-normalize-whitespace@7.0.0: resolution: {integrity: sha512-37/toN4wwZErqohedXYqWgvcHUGlT8O/m2jVkAfAe9Bd4MzRqlBmXrJRePH0e9Wgnz2X7KymTgTOaaFizQe3AQ==} engines: {node: ^18.12.0 || ^20.9.0 || >=22.0} peerDependencies: postcss: ^8.4.31 + postcss-opacity-percentage@3.0.0: + resolution: {integrity: sha512-K6HGVzyxUxd/VgZdX04DCtdwWJ4NGLG212US4/LA1TLAbHgmAsTWVR86o+gGIbFtnTkfOpb9sCRBx8K7HO66qQ==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + postcss-ordered-values@6.0.2: + resolution: {integrity: sha512-VRZSOB+JU32RsEAQrO94QPkClGPKJEL/Z9PCBImXMhIeK5KAYo6slP/hBYlLgrCjFxyqvn5VC81tycFEDBLG1Q==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-overflow-shorthand@6.0.0: + resolution: {integrity: sha512-BdDl/AbVkDjoTofzDQnwDdm/Ym6oS9KgmO7Gr+LHYjNWJ6ExORe4+3pcLQsLA9gIROMkiGVjjwZNoL/mpXHd5Q==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + postcss-page-break@3.0.4: + resolution: {integrity: sha512-1JGu8oCjVXLa9q9rFTo4MbeeA5FMe00/9C7lN4va606Rdb+HkxXtXsmEDrIraQ11fGz/WvKWa8gMuCKkrXpTsQ==} + peerDependencies: + postcss: ^8 + + postcss-place@10.0.0: + resolution: {integrity: sha512-5EBrMzat2pPAxQNWYavwAfoKfYcTADJ8AXGVPcUZ2UkNloUTWzJQExgrzrDkh3EKzmAx1evfTAzF9I8NGcc+qw==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + postcss-prefix-selector@1.16.0: resolution: {integrity: sha512-rdVMIi7Q4B0XbXqNUEI+Z4E+pueiu/CS5E6vRCQommzdQ/sgsS4dK42U7GX8oJR+TJOtT+Qv3GkNo6iijUMp3Q==} peerDependencies: postcss: '>4 <9' + postcss-preset-env@10.0.6: + resolution: {integrity: sha512-qixfM2wbvKJhUjJELLB8lV2UCsyrMdSXqiXHiNKMgAbNturstc80j/8MsthJeOpxYEekrCrFzcaoOJm8JRSdBg==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + + postcss-pseudo-class-any-link@10.0.0: + resolution: {integrity: sha512-bde8VE08Gq3ekKDq2BQ0ESOjNX54lrFDK3U9zABPINaqHblbZL/4Wfo5Y2vk6U64yVd/sjDwTzuiisFBpGNNIQ==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + postcss-pxtorem@6.0.0: resolution: {integrity: sha512-ZRXrD7MLLjLk2RNGV6UA4f5Y7gy+a/j1EqjAfp9NdcNYVjUMvg5HTYduTjSkKBkRkfqbg/iKrjMO70V4g1LZeg==} peerDependencies: postcss: ^8.0.0 + postcss-reduce-idents@6.0.3: + resolution: {integrity: sha512-G3yCqZDpsNPoQgbDUy3T0E6hqOQ5xigUtBQyrmq3tn2GxlyiL0yyl7H+T8ulQR6kOcHJ9t7/9H4/R2tv8tJbMA==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-reduce-initial@6.1.0: + resolution: {integrity: sha512-RarLgBK/CrL1qZags04oKbVbrrVK2wcxhvta3GCxrZO4zveibqbRPmm2VI8sSgCXwoUHEliRSbOfpR0b/VIoiw==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-reduce-transforms@6.0.2: + resolution: {integrity: sha512-sB+Ya++3Xj1WaT9+5LOOdirAxP7dJZms3GRcYheSPi1PiTMigsxHAdkrbItHxwYHr4kt1zL7mmcHstgMYT+aiA==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + + postcss-replace-overflow-wrap@4.0.0: + resolution: {integrity: sha512-KmF7SBPphT4gPPcKZc7aDkweHiKEEO8cla/GjcBK+ckKxiZslIu3C4GCRW3DNfL0o7yW7kMQu9xlZ1kXRXLXtw==} + peerDependencies: + postcss: ^8.0.3 + + postcss-selector-not@8.0.0: + resolution: {integrity: sha512-g/juh7A83GWc3+kWL8BiS3YUIJb3XNqIVKz1kGvgN3OhoGCsPncy1qo/+q61tjy5r87OxBhSY1+hcH3yOhEW+g==} + engines: {node: '>=18'} + peerDependencies: + postcss: ^8.4 + postcss-selector-parser@6.0.13: resolution: {integrity: sha512-EaV1Gl4mUEV4ddhDnv/xtj7sxwrwxdetHdWUGnT4VJQf+4d05v6lHYZr8N573k5Z0BViss7BDhfWtKS3+sfAqQ==} engines: {node: '>=4'} @@ -13193,6 +16791,24 @@ packages: resolution: {integrity: sha512-UMz42UD0UY0EApS0ZL9o1XnLhSTtvvvLe5Dc2H2O56fvRZi+KulDyf5ctDhhtYJBGKStV2FL1fy6253cmLgqVQ==} engines: {node: '>=4'} + postcss-sort-media-queries@5.2.0: + resolution: {integrity: sha512-AZ5fDMLD8SldlAYlvi8NIqo0+Z8xnXU2ia0jxmuhxAU+Lqt9K+AlmLNJ/zWEnE9x+Zx3qL3+1K20ATgNOr3fAA==} + engines: {node: '>=14.0.0'} + peerDependencies: + postcss: ^8.4.23 + + postcss-svgo@6.0.3: + resolution: {integrity: sha512-dlrahRmxP22bX6iKEjOM+c8/1p+81asjKT+V5lrgOH944ryx/OHpclnIbGsKVd3uWOXFLYJwCVf0eEkJGvO96g==} + engines: {node: ^14 || ^16 || >= 18} + peerDependencies: + postcss: ^8.4.31 + + postcss-unique-selectors@6.0.4: + resolution: {integrity: sha512-K38OCaIrO8+PzpArzkLKB42dSARtC2tmG6PvD4b1o1Q2E9Os8jzfWFfSy/rixsHwohtsDdFtAWGjFVFUdwYaMg==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + postcss-url@10.1.3: resolution: {integrity: sha512-FUzyxfI5l2tKmXdYc6VTu3TWZsInayEKPbiyW+P6vmmIrrb4I6CGX0BFoewgYHLK+oIL5FECEK02REYRpBvUCw==} engines: {node: '>=10'} @@ -13202,6 +16818,12 @@ packages: postcss-value-parser@4.2.0: resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} + postcss-zindex@6.0.2: + resolution: {integrity: sha512-5BxW9l1evPB/4ZIc+2GobEBoKC+h8gPGCMi+jxsYvd2x0mjq7wazk6DrP71pStqxE9Foxh5TVnonbWpFZzXaYg==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + postcss@5.2.18: resolution: {integrity: sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg==} engines: {node: '>=0.12'} @@ -13256,6 +16878,14 @@ packages: engines: {node: '>=14.0.0'} hasBin: true + potpack@1.0.2: + resolution: {integrity: sha512-choctRBIV9EMT9WGAZHn3V7t0Z2pMQyl0EZE6pFc/6ml3ssw7Dlf/oAOvFwjm1HVsqfQN8GfeFyJ+d8tRzqueQ==} + + prebuild-install@7.1.2: + resolution: {integrity: sha512-UnNke3IQb6sgarcZIDU3gbMeTp/9SSU1DAIkil7PrqG1vZlBtY5msYccSKSHDqa3hNg436IXK+SNImReuA1wEQ==} + engines: {node: '>=10'} + hasBin: true + preferred-pm@3.1.2: resolution: {integrity: sha512-nk7dKrcW8hfCZ4H6klWcdRknBOXWzNQByJ0oJyX97BOupsYD+FzLS4hflgEu/uPUEHZCuRfMxzCBsuWd7OzT8Q==} engines: {node: '>=10'} @@ -13283,10 +16913,17 @@ packages: engines: {node: '>=14'} hasBin: true + pretty-error@4.0.0: + resolution: {integrity: sha512-AoJ5YMAcXKYxKhuJGdcvse+Voc6v1RgnsR3nWcYU7q4t6z0Q6T86sv5Zq8VIRbOWWFpvdGE83LtdSMNd+6Y0xw==} + pretty-format@29.7.0: resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + pretty-time@1.1.0: + resolution: {integrity: sha512-28iF6xPQrP8Oa6uxE6a1biz+lWeTOAPKggvjB8HAs6nVMKZwf5bG++632Dx614hIWgUPkgivRfG+a8uAXGTIbA==} + engines: {node: '>=4'} + primevue@3.52.0: resolution: {integrity: sha512-HLOVP5YI0ArFKUhIyfZsWmTNMaBYNCBWC/3DYvdd/Po4LY5/WXf7yIYvArE2q/3OuwSXJXvjlR8UNQeJYRSQog==} peerDependencies: @@ -13297,6 +16934,15 @@ packages: engines: {node: '>=0.8'} hasBin: true + prism-react-renderer@2.4.0: + resolution: {integrity: sha512-327BsVCD/unU4CNLZTWVHyUHKnsqcvj2qbPlQ8MiBE2eq2rgctjigPA1Gp9HLF83kZ20zNN6jgizHJeEsyFYOw==} + peerDependencies: + react: '>=16.0.0' + + prismjs@1.29.0: + resolution: {integrity: sha512-Kx/1w86q/epKcmte75LNrEoT+lX8pBpavuAbvJWRXar7Hz8jrtF+e3vY751p0R8H9HdArwaCTNDDzHg/ScJK1Q==} + engines: {node: '>=6'} + process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} @@ -13316,6 +16962,9 @@ packages: resolution: {integrity: sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==} engines: {node: '>=10'} + promise-worker-transferable@1.0.4: + resolution: {integrity: sha512-bN+0ehEnrXfxV2ZQvU2PetO0n4gqBD4ulq3MI1WOPLgr7/Mg9yRQkX5+0v1vagr74ZTsl7XtzlaYDo2EuCeYJw==} + prompts@2.4.2: resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} engines: {node: '>= 6'} @@ -13326,6 +16975,9 @@ packages: property-information@6.5.0: resolution: {integrity: sha512-PgTgs/BlvHxOu8QuEN7wi5A0OmXaBcHpmCSTehcs6Uuu9IkDIEo13Hy7n898RHfrQ49vKCoGeWZSaAK01nwVig==} + proto-list@1.2.4: + resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==} + proxy-addr@2.0.7: resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} engines: {node: '>= 0.10'} @@ -13342,6 +16994,10 @@ packages: pump@3.0.0: resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==} + punycode.js@2.3.1: + resolution: {integrity: sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==} + engines: {node: '>=6'} + punycode@1.4.1: resolution: {integrity: sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==} @@ -13349,6 +17005,10 @@ packages: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} + pupa@3.1.0: + resolution: {integrity: sha512-FLpr4flz5xZTSJxSeaheeMKN/EDzMdK7b8PTOC6a5PYFKTucWbdqjgqaEyH0shFiSJrVB1+Qqi4Tk19ccU6Aug==} + engines: {node: '>=12.20'} + pure-rand@6.1.0: resolution: {integrity: sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==} @@ -13387,6 +17047,12 @@ packages: queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + queue-tick@1.0.1: + resolution: {integrity: sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==} + + queue@6.0.2: + resolution: {integrity: sha512-iHZWu+q3IdFZFX36ro/lKBkSvfkztY5Y7HMiPlOUjhupPcG2JMfst2KKEpu5XndviX/3UhFbRngUPNKtgvtZiA==} + quick-lru@4.0.1: resolution: {integrity: sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==} engines: {node: '>=8'} @@ -13675,12 +17341,18 @@ packages: resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} hasBin: true - re-resizable@6.9.17: - resolution: {integrity: sha512-OBqd1BwVXpEJJn/yYROG+CbeqIDBWIp6wathlpB0kzZWWZIY1gPTsgK2yJEui5hOvkCdC2mcexF2V3DZVfLq2g==} + re-resizable@6.10.0: + resolution: {integrity: sha512-hysSK0xmA5nz24HBVztlk4yCqCLCvS32E6ZpWxVKop9x3tqCa4yAj1++facrmkOf62JsJHjmjABdKxXofYioCw==} peerDependencies: react: ^16.13.1 || ^17.0.0 || ^18.0.0 react-dom: ^16.13.1 || ^17.0.0 || ^18.0.0 + re-resizable@6.10.3: + resolution: {integrity: sha512-zvWb7X3RJMA4cuSrqoxgs3KR+D+pEXnGrD2FAD6BMYAULnZsSF4b7AOVyG6pC3VVNVOtlagGDCDmZSwWLjjBBw==} + peerDependencies: + react: ^16.13.1 || ^17.0.0 || ^18.0.0 || ^19.0.0 + react-dom: ^16.13.1 || ^17.0.0 || ^18.0.0 || ^19.0.0 + react-clientside-effect@1.2.6: resolution: {integrity: sha512-XGGGRQAKY+q25Lz9a/4EPqom7WRjz3z9R2k4jhVKA/puQFH/5Nt27vFZYql4m4NVNdUvX8PS3O7r/Zzm7cjUlg==} peerDependencies: @@ -13691,11 +17363,32 @@ packages: peerDependencies: react: '*' + react-colorful@5.6.1: + resolution: {integrity: sha512-1exovf0uGTGyq5mXQT0zgQ80uvj2PCwvF8zY1RN9/vbJVSjSo3fsB/4L3ObbF7u70NduSiK4xu4Y6q1MHoUGEw==} + peerDependencies: + react: '>=16.8.0' + react-dom: '>=16.8.0' + + react-composer@5.0.3: + resolution: {integrity: sha512-1uWd07EME6XZvMfapwZmc7NgCZqDemcvicRi3wMJzXsQLvZ3L7fTHVyPy1bZdnWXM4iPjYuNE+uJ41MLKeTtnA==} + peerDependencies: + react: ^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 + react-copy-to-clipboard@5.1.0: resolution: {integrity: sha512-k61RsNgAayIJNoy9yDsYzDe/yAZAzEbEgcz3DZMhF686LEyukcE1hzurxe85JandPUG+yTfGVFzuEw3xt8WP/A==} peerDependencies: react: ^15.3.0 || 16 || 17 || 18 + react-dev-utils@12.0.1: + resolution: {integrity: sha512-84Ivxmr17KjUupyqzFode6xKhjwuEJDROWKJy/BthkL7Wn6NJ8h4WE6k/exAv6ImS+0oZLRRW5j/aINMHyeGeQ==} + engines: {node: '>=14'} + peerDependencies: + typescript: '>=2.7' + webpack: '>=4' + peerDependenciesMeta: + typescript: + optional: true + react-dom@17.0.2: resolution: {integrity: sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==} peerDependencies: @@ -13712,12 +17405,24 @@ packages: react: '>= 16.3.0' react-dom: '>= 16.3.0' + react-dropzone@12.1.0: + resolution: {integrity: sha512-iBYHA1rbopIvtzokEX4QubO6qk5IF/x3BtKGu74rF2JkQDXnwC4uO/lHKpaw4PJIV6iIAYOlwLv2FpiGyqHNog==} + engines: {node: '>= 10.13'} + peerDependencies: + react: '>= 16.8' + react-error-boundary@3.0.2: resolution: {integrity: sha512-KVzCusRTFpUYG0OFJbzbdRuxNQOBiGXVCqyNpBXM9z5NFsFLzMjUXMjx8gTja6M6WH+D2PvP3yKz4d8gD1PRaA==} engines: {node: '>=10', npm: '>=6'} peerDependencies: react: '>=16.13.1' + react-error-overlay@6.0.11: + resolution: {integrity: sha512-/6UZ2qgEyH2aqzYZgQPxEnz33NJ2gNsnHA2o5+o4wW9bLM/JYQitNP9xPhsXwC08hMMovfGe/8retsdDsczPRg==} + + react-fast-compare@3.2.2: + resolution: {integrity: sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ==} + react-focus-lock@2.9.6: resolution: {integrity: sha512-B7gYnCjHNrNYwY2juS71dHbf0+UpXXojt02svxybj8N5bxceAkzPChKEncHuratjUHkIFNCn06k2qj1DRlzTug==} peerDependencies: @@ -13727,6 +17432,17 @@ packages: '@types/react': optional: true + react-helmet-async@1.3.0: + resolution: {integrity: sha512-9jZ57/dAn9t3q6hneQS0wukqC2ENOBgMNVEhb/ZG9ZSxUetzVIw4iAmEU38IaVg3QGYauQPhSeUTuIUtFglWpg==} + peerDependencies: + react: ^16.6.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.6.0 || ^17.0.0 || ^18.0.0 + + react-helmet-async@2.0.5: + resolution: {integrity: sha512-rYUYHeus+i27MvFE+Jaa4WsyBKGkL6qVgbJvSBoX8mbsWoABJXdEO0bZyi0F6i+4f0NuIb8AvqPMj3iXFHkMwg==} + peerDependencies: + react: ^16.6.0 || ^17.0.0 || ^18.0.0 + react-highlight-words@0.20.0: resolution: {integrity: sha512-asCxy+jCehDVhusNmCBoxDf2mm1AJ//D+EzDx1m5K7EqsMBIHdZ5G4LdwbSEXqZq1Ros0G0UySWmAtntSph7XA==} peerDependencies: @@ -13735,12 +17451,17 @@ packages: react-highlight@0.15.0: resolution: {integrity: sha512-5uV/b/N4Z421GSVVe05fz+OfTsJtFzx/fJBdafZyw4LS70XjIZwgEx3Lrkfc01W/RzZ2Dtfb0DApoaJFAIKBtA==} - react-hotkeys-hook@4.5.0: - resolution: {integrity: sha512-Samb85GSgAWFQNvVt3PS90LPPGSf9mkH/r4au81ZP1yOIFayLC3QAvqTgGtJ8YEDMXtPmaVBs6NgipHO6h4Mug==} + react-hotkeys-hook@4.6.1: + resolution: {integrity: sha512-XlZpbKUj9tkfgPgT9gA+1p7Ey6vFIZHttUjPqpTdyT5nqQ8mHL7elxvSbaC+dpSiHUSmr21Ya1mDxBZG3aje4Q==} peerDependencies: react: '>=16.8.1' react-dom: '>=16.8.1' + react-icons@5.3.0: + resolution: {integrity: sha512-DnUk8aFbTyQPSkCfF8dbX6kQjXA9DktMeJqfjrg6cK9vwQVMxmcA3BfP4QoiztVmEHtwlTgLFsPuH2NskKT6eg==} + peerDependencies: + react: '*' + react-intersection-observer@9.13.0: resolution: {integrity: sha512-y0UvBfjDiXqC8h0EWccyaj4dVBWMxgEx0t5RGNzQsvkfvZwugnKwxpu70StY4ivzYuMajavwUDjH4LJyIki9Lw==} peerDependencies: @@ -13759,11 +17480,24 @@ packages: react-is@18.2.0: resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} + react-json-view-lite@1.5.0: + resolution: {integrity: sha512-nWqA1E4jKPklL2jvHWs6s+7Na0qNgw9HCP6xehdQJeg6nPBTFZgGwyko9Q0oj+jQWKTTVRS30u0toM5wiuL3iw==} + engines: {node: '>=14'} + peerDependencies: + react: ^16.13.1 || ^17.0.0 || ^18.0.0 + react-layout-kit@1.9.0: resolution: {integrity: sha512-YjFXGaWTemwagfdmqz1VxTATXCpQmDfW/giHOSQDrGsddyBC6MEFdj+kNHYY9WpRamQDjyzAIkOQaJ1KxmcC2g==} peerDependencies: react: '>=18' + react-loadable-ssr-addon-v5-slorber@1.0.1: + resolution: {integrity: sha512-lq3Lyw1lGku8zUEJPDxsNm1AfYHBrO9Y1+olAYwpUJ2IGFBskM0DMKok97A6LWUpHm+o7IvQBOWu9MLenp9Z+A==} + engines: {node: '>=10.13.0'} + peerDependencies: + react-loadable: '*' + webpack: '>=4.41.1 || 5.x' + react-markdown@8.0.7: resolution: {integrity: sha512-bvWbzG4MtOU62XqBx3Xx+zB2raaFFsq4mYiAzfjXJMEz2sixgeAfraA3tvzULF02ZdOMUOKTBFFaZJDDrq+BJQ==} peerDependencies: @@ -13776,6 +17510,12 @@ packages: peerDependencies: react: ^16.13.1 + react-reconciler@0.27.0: + resolution: {integrity: sha512-HmMDKciQjYmBRGuuhIaKA1ba/7a+UsM5FzOZsMO2JYHt9Jh8reCb7j1eDC95NOyUlKM9KRyvdx0flBuDvYSBoA==} + engines: {node: '>=0.10.0'} + peerDependencies: + react: ^18.0.0 + react-redux@7.2.9: resolution: {integrity: sha512-Gx4L3uM182jEEayZfRbI/G11ZpYdNAnBs70lFVMNdHJI76XYtR+7m0MN+eAs7UHBPhWXcnFPaS+9owSCJQHNpQ==} peerDependencies: @@ -13796,12 +17536,18 @@ packages: resolution: {integrity: sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==} engines: {node: '>=0.10.0'} - react-rnd@10.4.12: - resolution: {integrity: sha512-EZ0ddi+R9JQVqk6jtPzvy11z5kjdw3aZbtiRmA9KP09UNx3LZT8WFrWO3QXbH7dHo1DKO3Rh8usCCwaJgu6Ahg==} + react-rnd@10.4.13: + resolution: {integrity: sha512-Vgbf0iihspcQ6nkaFhpOGWfmnuVbhkhoB0hBbYl8aRDA4horsQHESc4E1z7O/P27kFFjK2aqM0u5CGzfr9gEZA==} peerDependencies: react: '>=16.3.0' react-dom: '>=16.3.0' + react-router-config@5.1.1: + resolution: {integrity: sha512-DuanZjaD8mQp1ppHjgnnUnyOlqYXZVjnov/JzFhjLEwd3Z4dYjMSnqrEzzGThH47vpCOqPPwJM2FtthLeJ8Pbg==} + peerDependencies: + react: '>=15' + react-router: '>=5' + react-router-dom@5.3.4: resolution: {integrity: sha512-m4EqFMHv/Ih4kpcBCONHbkT68KoAeHN4p3lAGoNryfHi0dMy0kCzEZakiKRsvg5wHZ/JLrLW8o8KomWiz/qbYQ==} peerDependencies: @@ -13844,6 +17590,17 @@ packages: react: '>=16.6.0' react-dom: '>=16.6.0' + react-use-measure@2.1.1: + resolution: {integrity: sha512-nocZhN26cproIiIduswYpV5y5lQpSQS1y/4KuvUCjSKmw7ZWIS/+g3aFnX3WdBkyuGUtTLif3UTqnLLhbDoQig==} + peerDependencies: + react: '>=16.13' + react-dom: '>=16.13' + + react-waypoint@10.3.0: + resolution: {integrity: sha512-iF1y2c1BsoXuEGz08NoahaLFIGI9gTUAAOKip96HUmylRT6DUtpgoBPjk/Y8dfcFVmfVDvUzWjNXpZyKTOV0SQ==} + peerDependencies: + react: ^15.3.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 + react-window@1.8.10: resolution: {integrity: sha512-Y0Cx+dnU6NLa5/EvoHukUD0BklJ8qITCtVEPY1C/nL8wwoZ0b5aEw8Ff1dOVHw7fCzMt55XfJDd8S8W8LCaUCg==} engines: {node: '>8.0.0'} @@ -13919,10 +17676,21 @@ packages: resolution: {integrity: sha512-yDMz9g+VaZkqBYS/ozoBJwaBhTbZo3UNYQHNRw1D3UFQB8oHB4uS/tAODO+ZLjGWmUbKnIlOWO+aaIiAxrUWHA==} engines: {node: '>= 14.16.0'} + reading-time@1.5.0: + resolution: {integrity: sha512-onYyVhBNr4CmAxFsKS7bz+uTLRakypIe4R+5A824vBSkQy/hB3fZepoVEf8OVAxzLvK+H/jm9TzpI3ETSm64Kg==} + + rechoir@0.6.2: + resolution: {integrity: sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==} + engines: {node: '>= 0.10'} + rechoir@0.8.0: resolution: {integrity: sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==} engines: {node: '>= 10.13.0'} + recursive-readdir@2.2.3: + resolution: {integrity: sha512-8HrF5ZsXk5FAH9dgsx3BlUer73nIhuj+9OrQwEbLTPOBzGkL1lsFCR01am+v+0m2Cmbs1nP12hLDl5FA7EszKA==} + engines: {node: '>=6.0.0'} + redent@3.0.0: resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} engines: {node: '>=8'} @@ -13944,6 +17712,13 @@ packages: reflect-metadata@0.2.2: resolution: {integrity: sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==} + regenerate-unicode-properties@10.2.0: + resolution: {integrity: sha512-DqHn3DwbmmPVzeKj9woBadqmXxLvQoQIwu7nopMc72ztvxVmVk2SBhSnx67zuye5TP+lJsb/TBQsjLKhnDf3MA==} + engines: {node: '>=4'} + + regenerate@1.4.2: + resolution: {integrity: sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==} + regenerator-runtime@0.10.5: resolution: {integrity: sha512-02YopEIhAgiBHWeoTiA8aitHDt8z6w+rQqNuIftlM+ZtvSl/brTouaU7DW6GO/cHtvxJvS4Hwv2ibKdxIRi24w==} @@ -13956,39 +17731,113 @@ packages: regenerator-runtime@0.14.0: resolution: {integrity: sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==} + regenerator-transform@0.15.2: + resolution: {integrity: sha512-hfMp2BoF0qOk3uc5V20ALGDS2ddjQaLrdl7xrGXvAIow7qeWRM2VA2HuCHkUKk9slq3VwEwLNK3DFBqDfPGYtg==} + regex-not@1.0.2: resolution: {integrity: sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==} engines: {node: '>=0.10.0'} + regex-recursion@4.3.0: + resolution: {integrity: sha512-5LcLnizwjcQ2ALfOj95MjcatxyqF5RPySx9yT+PaXu3Gox2vyAtLDjHB8NTJLtMGkvyau6nI3CfpwFCjPUIs/A==} + + regex-utilities@2.3.0: + resolution: {integrity: sha512-8VhliFJAWRaUiVvREIiW2NXXTmHs4vMNnSzuJVhscgmGav3g9VDxLrQndI3dZZVVdp0ZO/5v0xmX516/7M9cng==} + + regex@4.3.3: + resolution: {integrity: sha512-r/AadFO7owAq1QJVeZ/nq9jNS1vyZt+6t1p/E59B56Rn2GCya+gr1KSyOzNL/er+r+B7phv5jG2xU2Nz1YkmJg==} + + regex@5.0.2: + resolution: {integrity: sha512-/pczGbKIQgfTMRV0XjABvc5RzLqQmwqxLHdQao2RTXPk+pmTXB2P0IaUHYdYyk412YLwUIkaeMd5T+RzVgTqnQ==} + regexp.prototype.flags@1.5.1: resolution: {integrity: sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==} engines: {node: '>= 0.4'} + regexpu-core@6.1.1: + resolution: {integrity: sha512-k67Nb9jvwJcJmVpw0jPttR1/zVfnKf8Km0IPatrU/zJ5XeG3+Slx0xLXs9HByJSzXzrlz5EDvN6yLNMDc2qdnw==} + engines: {node: '>=4'} + registry-auth-token@3.3.2: resolution: {integrity: sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ==} + registry-auth-token@5.0.2: + resolution: {integrity: sha512-o/3ikDxtXaA59BmZuZrJZDJv8NMDGSj+6j6XaeBmHw8eY1i1qd9+6H+LjVvQXx3HN6aRCGa1cUdJ9RaJZUugnQ==} + engines: {node: '>=14'} + registry-url@3.1.0: resolution: {integrity: sha512-ZbgR5aZEdf4UKZVBPYIgaglBmSF2Hi94s2PcIHhRGFjKYu+chjJdYfHn4rt3hB6eCKLJ8giVIIfgMa1ehDfZKA==} engines: {node: '>=0.10.0'} + registry-url@6.0.1: + resolution: {integrity: sha512-+crtS5QjFRqFCoQmvGduwYWEBng99ZvmFvF+cUJkGYF1L1BfU8C6Zp9T7f5vPAwyLkUExpvK+ANVZmGU49qi4Q==} + engines: {node: '>=12'} + + regjsgen@0.8.0: + resolution: {integrity: sha512-RvwtGe3d7LvWiDQXeQw8p5asZUmfU1G/l6WbUXeHta7Y2PEIvBTwH6E2EfmYUK8pxcxEdEmaomqyp0vZZ7C+3Q==} + + regjsparser@0.11.1: + resolution: {integrity: sha512-1DHODs4B8p/mQHU9kr+jv8+wIC9mtG4eBHxWxIq5mhjE3D5oORhCc6deRKzTjs9DcfRFmj9BHSDguZklqCGFWQ==} + hasBin: true + regression@2.0.1: resolution: {integrity: sha512-A4XYsc37dsBaNOgEjkJKzfJlE394IMmUPlI/p3TTI9u3T+2a+eox5Pr/CPUqF0eszeWZJPAc6QkroAhuUpWDJQ==} rehype-katex@6.0.3: resolution: {integrity: sha512-ByZlRwRUcWegNbF70CVRm2h/7xy7jQ3R9LaY4VVSvjnoVWwWVhNL60DiZsBpC5tSzYQOCvDbzncIpIjPZWodZA==} + rehype-raw@7.0.0: + resolution: {integrity: sha512-/aE8hCfKlQeA8LmyeyQvQF3eBiLRGNlfBJEvWH7ivp9sBqs7TNqBL5X3v157rM4IFETqDnIOO+z5M/biZbo9Ww==} + + relateurl@0.2.7: + resolution: {integrity: sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==} + engines: {node: '>= 0.10'} + + remark-directive@3.0.0: + resolution: {integrity: sha512-l1UyWJ6Eg1VPU7Hm/9tt0zKtReJQNOA4+iDMAxTyZNWnJnFlbS/7zhiel/rogTLQ2vMYwDzSJa4BiVNqGlqIMA==} + + remark-emoji@4.0.1: + resolution: {integrity: sha512-fHdvsTR1dHkWKev9eNyhTo4EFwbUvJ8ka9SgeWkMPYFX4WoI7ViVBms3PjlQYgw5TLvNQso3GUB/b/8t3yo+dg==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + + remark-frontmatter@5.0.0: + resolution: {integrity: sha512-XTFYvNASMe5iPN0719nPrdItC9aU0ssC4v14mH1BCi1u0n1gAocqcujWUrByftZTbLhRtiKRyjYTSIOcr69UVQ==} + remark-gfm@3.0.1: resolution: {integrity: sha512-lEFDoi2PICJyNrACFOfDD3JlLkuSbOa5Wd8EPt06HUdptv8Gn0bxYTdbU/XXQ3swAPkEaGxxPN9cbnMHvVu1Ig==} + remark-gfm@4.0.0: + resolution: {integrity: sha512-U92vJgBPkbw4Zfu/IiW2oTZLSL3Zpv+uI7My2eq8JxKgqraFdU8YUGicEJCEgSbeaG+QDFqIcwwfMTOEelPxuA==} + remark-math@5.1.1: resolution: {integrity: sha512-cE5T2R/xLVtfFI4cCePtiRn+e6jKMtFDR3P8V3qpv8wpKjwvHoBA4eJzvX+nVrnlNy0911bdGmuspCSwetfYHw==} + remark-mdx@3.0.1: + resolution: {integrity: sha512-3Pz3yPQ5Rht2pM5R+0J2MrGoBSrzf+tJG94N+t/ilfdh8YLyyKYtidAYwTveB20BoHAcwIopOUqhcmh2F7hGYA==} + remark-parse@10.0.2: resolution: {integrity: sha512-3ydxgHa/ZQzG8LvC7jTXccARYDcRld3VfcgIIFs7bI6vbRSxJJmzgLEIIoYKyrfhaY+ujuWaf/PJiMZXoiCXgw==} + remark-parse@11.0.0: + resolution: {integrity: sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==} + remark-rehype@10.1.0: resolution: {integrity: sha512-EFmR5zppdBp0WQeDVZ/b66CWJipB2q2VLNFMabzDSGR66Z2fQii83G5gTBbgGEnEEA0QRussvrFHxk1HWGJskw==} + remark-rehype@11.1.1: + resolution: {integrity: sha512-g/osARvjkBXb6Wo0XvAeXQohVta8i84ACbenPpoSsxTOQH/Ae0/RGP4WZgnMH5pMLpsj4FG7OHmcIcXxpza8eQ==} + + remark-shiki-twoslash@3.1.3: + resolution: {integrity: sha512-4e8OH3ySOCw5wUbDcPszokOKjKuebOqlP2WlySvC7ITBOq27BiGsFlq+FNWhxppZ+JzhTWah4gQrnMjX3KDbAQ==} + peerDependencies: + typescript: '>3' + + remark-stringify@11.0.0: + resolution: {integrity: sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw==} + + renderkid@3.0.0: + resolution: {integrity: sha512-q/7VIQA8lmM1hF+jn+sFSPWGlMkSAeNYcPLmDQx2zzuiDfaLrOmumR8iaUKlenFgh0XRPIUeSPlH3A+AW3Z5pg==} + repeat-element@1.1.4: resolution: {integrity: sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==} engines: {node: '>=0.10.0'} @@ -14051,10 +17900,6 @@ packages: resolution: {integrity: sha512-rzB7NnQpOkPHBWFPP3prUMqOP6yg3HkRGgcvR+lDyvyHoY3fZLFLYDkPXh78SPVBAE6VTCk/V+j8we4djg6o4g==} engines: {node: '>=4', npm: '>=2'} - resolve-path@1.4.0: - resolution: {integrity: sha512-i1xevIst/Qa+nA9olDxLWnLk8YZbi8R/7JPbCMcgyWaFR6bKWaexgJgEB5oc2PKMjYdrHynyz0NY+if+H98t1w==} - engines: {node: '>= 0.8'} - resolve-pathname@3.0.0: resolution: {integrity: sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng==} @@ -14076,6 +17921,10 @@ packages: responselike@2.0.1: resolution: {integrity: sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==} + responselike@3.0.0: + resolution: {integrity: sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg==} + engines: {node: '>=14.16'} + restore-cursor@2.0.0: resolution: {integrity: sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==} engines: {node: '>=4'} @@ -14096,6 +17945,10 @@ packages: resolution: {integrity: sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==} engines: {node: '>= 4'} + retry@0.13.1: + resolution: {integrity: sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==} + engines: {node: '>= 4'} + reusify@1.0.4: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} @@ -14117,6 +17970,11 @@ packages: deprecated: Rimraf versions prior to v4 are no longer supported hasBin: true + rimraf@6.0.1: + resolution: {integrity: sha512-9dkvaxAsk/xNXSJzMgFqqMCuFgt2+KsOFek3TMLfo8NCPfWpBmqwyNn5Y+NX56QUYfCtsyhF3ayiboEoUmJk/A==} + engines: {node: 20 || >=22} + hasBin: true + roarr@2.15.4: resolution: {integrity: sha512-CHhPh+UNHD2GTXNYhPWLnU8ONHdI+5DI+4EYIAOaiD63rHeYlZvyh8P+in5999TTSFgUYuKUAjzRI4mdh/p+2A==} engines: {node: '>=8.0'} @@ -14143,9 +18001,17 @@ packages: engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true - run-applescript@5.0.0: - resolution: {integrity: sha512-XcT5rBksx1QdIhlFOCtgZkB99ZEouFZ1E2Kc2LHqNW13U3/74YGdkQRmThTwxy4QIyookibDKYZOPqX//6BlAg==} - engines: {node: '>=12'} + rtl-detect@1.1.2: + resolution: {integrity: sha512-PGMBq03+TTG/p/cRB7HCLKJ1MgDIi07+QU1faSjiYRfmY5UsAttV9Hs08jDAHVwcOwmVLcSJkpwyfXszVjWfIQ==} + + rtlcss@4.3.0: + resolution: {integrity: sha512-FI+pHEn7Wc4NqKXMXFM+VAYKEj/mRIcW4h24YVwVtyjI+EqGrLc2Hx/Ny0lrZ21cBWU2goLy36eqMcNj3AQJig==} + engines: {node: '>=12.0.0'} + hasBin: true + + run-applescript@7.0.0: + resolution: {integrity: sha512-9by4Ij99JUr/MCFBUkDKLWK3G9HVXmabKz9U5MlIAIuvuzkiOicRYs8XJLxX+xahD+mLiiCYDqF9dKAgtzKP1A==} + engines: {node: '>=18'} run-async@2.4.1: resolution: {integrity: sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==} @@ -14354,6 +18220,22 @@ packages: resolution: {integrity: sha512-VnrsLUfLVuLNq8Zrz6oaYmJ+hK5saaOhuwRC58yAcXYM+CRbS+6us3ab2+PE2a94H2V+cPU4XFvqibfz3C/XSw==} engines: {node: '>=16.0.0'} + sass-loader@10.5.2: + resolution: {integrity: sha512-vMUoSNOUKJILHpcNCCyD23X34gve1TS7Rjd9uXHeKqhvBG39x6XbswFDtpbTElj6XdMFezoWhkh5vtKudf2cgQ==} + engines: {node: '>= 10.13.0'} + peerDependencies: + fibers: '>= 3.1.0' + node-sass: ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 + sass: ^1.3.0 + webpack: ^4.36.0 || ^5.0.0 + peerDependenciesMeta: + fibers: + optional: true + node-sass: + optional: true + sass: + optional: true + sass@1.69.5: resolution: {integrity: sha512-qg2+UCJibLr2LCVOt3OlPhr/dqVHWOa9XtZf2OjbLs/T4VPSJ00udtgJxH3neXZm+QqX8B+3cU7RaLqp1iVfcQ==} engines: {node: '>=14.0.0'} @@ -14373,13 +18255,24 @@ packages: scheduler@0.20.2: resolution: {integrity: sha512-2eWfGgAqqWFGqtdMmcL5zCMK1U8KlXv8SQFGglL3CEtd0aDVDWgeF/YoCmvln55m5zSk3J/20hTaSBeSObsQDQ==} + scheduler@0.21.0: + resolution: {integrity: sha512-1r87x5fz9MXqswA2ERLo0EbOAU74DpIUO090gIasYTqlVoJeMcl+Z1Rg7WHz+qtPujhS/hGIt9kxZOYBV3faRQ==} + scheduler@0.23.0: resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} + schema-utils@2.7.0: + resolution: {integrity: sha512-0ilKFI6QQF5nxDZLFn2dMjvc4hjg/Wkg7rHd3jK6/A4a1Hl9VFdQWvgB1UMGoU94pad1P/8N7fMcEnLnSiju8A==} + engines: {node: '>= 8.9.0'} + schema-utils@3.3.0: resolution: {integrity: sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==} engines: {node: '>= 10.13.0'} + schema-utils@4.2.0: + resolution: {integrity: sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==} + engines: {node: '>= 12.13.0'} + screenfull@5.2.0: resolution: {integrity: sha512-9BakfsO2aUQN2K9Fdbj87RJIEZ82Q9IGim7FqM5OsebfoFC6ZHXgDq/KvniuLTPdeM8wY2o6Dj3WQ7KeQCj3cA==} engines: {node: '>=0.10.0'} @@ -14396,15 +18289,30 @@ packages: scule@1.0.0: resolution: {integrity: sha512-4AsO/FrViE/iDNEPaAQlb77tf0csuq27EsVpy6ett584EcRTp6pTDLoGWVxCD77y5iU5FauOvhsI4o1APwPoSQ==} + section-matter@1.0.0: + resolution: {integrity: sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA==} + engines: {node: '>=4'} + seemly@0.3.8: resolution: {integrity: sha512-MW8Qs6vbzo0pHmDpFSYPna+lwpZ6Zk1ancbajw/7E8TKtHdV+1DfZZD+kKJEhG/cAoB/i+LiT+5msZOqj0DwRA==} + select-hose@2.0.0: + resolution: {integrity: sha512-mEugaLK+YfkijB4fx0e6kImuJdCIt2LxCRcbEYPqRGCs4F2ogyfZU5IAZRdjCP8JPq2AtdNoC/Dux63d9Kiryg==} + select@1.1.2: resolution: {integrity: sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA==} + selfsigned@2.4.1: + resolution: {integrity: sha512-th5B4L2U+eGLq1TVh7zNRGBapioSORUeymIydxgFpwww9d2qyKvtuPU2jJuHvYAwwqi2Y596QBL3eEqcPEYL8Q==} + engines: {node: '>=10'} + semver-compare@1.0.0: resolution: {integrity: sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==} + semver-diff@4.0.0: + resolution: {integrity: sha512-0Ju4+6A8iOnpL/Thra7dZsSlOHYAHIeMxfhWQRI1/VLcT3WDBZKKtQt/QkBOsiIN9ZpuvHE6cGZ0x4glCMmfiA==} + engines: {node: '>=12'} + semver@5.7.2: resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} hasBin: true @@ -14418,6 +18326,11 @@ packages: engines: {node: '>=10'} hasBin: true + semver@7.6.3: + resolution: {integrity: sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==} + engines: {node: '>=10'} + hasBin: true + send@0.18.0: resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==} engines: {node: '>= 0.8.0'} @@ -14436,6 +18349,10 @@ packages: serve-handler@6.1.5: resolution: {integrity: sha512-ijPFle6Hwe8zfmBxJdE+5fta53fdIY0lHISJvuikXB3VYFafRjMRpOffSPvCYsbKyBA7pvy9oYr/BT1O3EArlg==} + serve-index@1.9.1: + resolution: {integrity: sha512-pXHfKNP4qujrtteMrSBb0rc8HJ9Ms/GrXwcUtUtD5s4ewDJI8bT3Cz2zTVRMKtri49pLx2e0Ya8ziP5Ya2pZZw==} + engines: {node: '>= 0.8.0'} + serve-static@1.15.0: resolution: {integrity: sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==} engines: {node: '>= 0.8.0'} @@ -14469,12 +18386,20 @@ packages: setprototypeof@1.2.0: resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} + shallow-clone@3.0.1: + resolution: {integrity: sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==} + engines: {node: '>=8'} + shallow-equal@1.2.1: resolution: {integrity: sha512-S4vJDjHHMBaiZuT9NPb616CSmLf618jawtv3sufLl6ivK8WocjAo58cXwbRV1cgqxH0Qbv+iUt6m05eqEa2IRA==} shallowequal@1.1.0: resolution: {integrity: sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==} + sharp@0.32.6: + resolution: {integrity: sha512-KyLTWwgcR9Oe4d9HwCwNM2l7+J0dUQwn/yf7S0EnTtb0eVS4RxO0eUSvxPtzT4F3SY+C4K6fqdv/DO27sJ/v/w==} + engines: {node: '>=14.15.0'} + shebang-command@1.2.0: resolution: {integrity: sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==} engines: {node: '>=0.10.0'} @@ -14491,12 +18416,39 @@ packages: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} + shell-quote@1.8.1: + resolution: {integrity: sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==} + + shelljs@0.8.5: + resolution: {integrity: sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==} + engines: {node: '>=4'} + hasBin: true + shepherd.js@11.1.1: resolution: {integrity: sha512-7nVEgLTZUu5qQCKTlzQeKL1AQd2rG9Y9iqzZUgGvCFwMUZZhfwtZ6eEyMWMYw0zl8qKjSrjgzxFOe+SpfO43aA==} engines: {node: 16.* || >= 18} - shiki@1.14.1: - resolution: {integrity: sha512-FujAN40NEejeXdzPt+3sZ3F2dx1U24BY2XTY01+MG8mbxCiA2XukXdcbyMyLAHJ/1AUUnQd1tZlvIjefWWEJeA==} + shiki-twoslash@3.1.2: + resolution: {integrity: sha512-JBcRIIizi+exIA/OUhYkV6jtyeZco0ykCkIRd5sgwIt1Pm4pz+maoaRZpm6SkhPwvif4fCA7xOtJOykhpIV64Q==} + peerDependencies: + typescript: '>3' + + shiki@0.10.1: + resolution: {integrity: sha512-VsY7QJVzU51j5o1+DguUd+6vmCmZ5v/6gYu4vyYAhzjuNQU6P/vmSy4uQaOhvje031qQMiW0d2BwgMH52vqMng==} + + shiki@1.22.0: + resolution: {integrity: sha512-/t5LlhNs+UOKQCYBtl5ZsH/Vclz73GIqT2yQsCBygr8L/ppTdmpL4w3kPLoZJbMKVWtoG77Ue1feOjZfDxvMkw==} + + shiki@1.24.2: + resolution: {integrity: sha512-TR1fi6mkRrzW+SKT5G6uKuc32Dj2EEa7Kj0k8kGqiBINb+C1TiflVOiT9ta6GqOJtC4fraxO5SLUaKBcSY38Fg==} + + shikiji-core@0.9.10: + resolution: {integrity: sha512-s+aC66Fh343wpm7VyQTg+htdHM/tUb8R+yxdAdUpCtKkRWbSBIpqQ3xTSNjbCTnGv10xsT164SW0r1VV1N6ToA==} + deprecated: Shikiji is merged back to Shiki v1.0, please migrate over to get the latest updates + + shikiji@0.9.10: + resolution: {integrity: sha512-tqnoSWWb7NailWJ/72Bgi8Z5O+ul71SJ5EhXbfHprZg67RGwck5eVyv5Uv4pso06ZuzNpUabRTyyFKHN/Ea9Mw==} + deprecated: Shikiji is merged back to Shiki v1.0, please migrate over to get the latest updates side-channel@1.0.4: resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} @@ -14511,6 +18463,12 @@ packages: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} + simple-concat@1.0.1: + resolution: {integrity: sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==} + + simple-get@4.0.1: + resolution: {integrity: sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==} + simple-statistics@6.1.1: resolution: {integrity: sha512-zGwn0DDRa9Zel4H4n2pjTFIyGoAGpnpjrGIctreCxj5XWrcx9v7Xy7270FkC967WMmcvuc8ZU7m0ZG+hGN7gAA==} @@ -14529,12 +18487,25 @@ packages: resolution: {integrity: sha512-94Bdh3cC2PKrbgSOUqTiGPWVZeSiXfKOVZNJniWoqrWrRkB1CJzBU3NEbiTsPcYy1lDsANA/THzS+9WBiy5nfQ==} engines: {node: '>= 10'} + sirv@3.0.0: + resolution: {integrity: sha512-BPwJGUeDaDCHihkORDchNyyTvWFhcusy1XMmhEVTQTwGeybFbp8YEmB+njbPnth1FibULBSBVwCQni25XlCUDg==} + engines: {node: '>=18'} + sisteransi@1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} + sitemap@7.1.2: + resolution: {integrity: sha512-ARCqzHJ0p4gWt+j7NlU5eDlIO9+Rkr/JhPFZKKQ1l5GCus7rJH4UdrlVAh0xC/gDS/Qir2UMxqYNHtsKr2rpCw==} + engines: {node: '>=12.0.0', npm: '>=5.6.0'} + hasBin: true + size-sensor@1.0.2: resolution: {integrity: sha512-2NCmWxY7A9pYKGXNBfteo4hy14gWu47rg5692peVMst6lQLPKrVjhY+UTEsPI5ceFRJSl3gVgMYaUi/hKuaiKw==} + skin-tone@2.0.0: + resolution: {integrity: sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==} + engines: {node: '>=8'} + skmeans@0.9.7: resolution: {integrity: sha512-hNj1/oZ7ygsfmPZ7ZfN5MUBRoGg1gtpnImuJBgLO0ljQ67DtJuiQaiYdS4lUA6s0KCwnPhGivtC/WRwIZLkHyg==} @@ -14542,6 +18513,13 @@ packages: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} + slash@4.0.0: + resolution: {integrity: sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==} + engines: {node: '>=12'} + + slashes@3.0.12: + resolution: {integrity: sha512-Q9VME8WyGkc7pJf6QEkj3wE+2CnvZMI+XJhwdTPR8Z/kWQRXi7boAWLDibRPyHRTUTPx5FaU7MsyrjI3yLB4HA==} + slice-ansi@3.0.0: resolution: {integrity: sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==} engines: {node: '>=8'} @@ -14574,6 +18552,9 @@ packages: resolution: {integrity: sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==} engines: {node: '>=0.10.0'} + sockjs@0.3.24: + resolution: {integrity: sha512-GJgLTZ7vYb/JtPSSZ10hsOYIvEYsjbNU+zPdIHcUaWVNUEPivzxku31865sSSud0Da0W4lEeOPlmw93zLQchuQ==} + socks-proxy-agent@7.0.0: resolution: {integrity: sha512-Fgl0YPZ902wEsAyiQ+idGd1A7rSFx/ayC1CQVMw5P+EQx2V0SgpGtf6OKFhVjPflPUl9YMmEOnmfjCdMUsygww==} engines: {node: '>= 10'} @@ -14595,12 +18576,16 @@ packages: peerDependencies: solid-js: ^1.3 - sortablejs@1.15.1: - resolution: {integrity: sha512-P5Cjvb0UG1ZVNiDPj/n4V+DinttXG6K8n7vM/HQf0C25K3YKQTQY6fsr/sEGsJGpQ9exmPxluHxKBc0mLKU1lQ==} + sort-css-media-queries@2.2.0: + resolution: {integrity: sha512-0xtkGhWCC9MGt/EzgnvbbbKhqWjl1+/rncmhTh5qCpbYguXh6S/qwePfv/JQ8jePXXmqingylxoC49pCkSPIbA==} + engines: {node: '>= 6.3.0'} sortablejs@1.15.2: resolution: {integrity: sha512-FJF5jgdfvoKn1MAKSdGs33bIqLi3LmsgVTliuX6iITj834F+JRQZN90Z93yql8h0K2t0RwDPBmxwlbZfDcxNZA==} + sortablejs@1.15.3: + resolution: {integrity: sha512-zdK3/kwwAK1cJgy1rwl1YtNTbRmc8qW/+vgXf75A7NHag5of4pyI6uK86ktmQETyWRH7IGaE73uZOOBcGxgqZg==} + source-map-js@1.0.2: resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} engines: {node: '>=0.10.0'} @@ -14668,6 +18653,13 @@ packages: spdx-license-ids@3.0.16: resolution: {integrity: sha512-eWN+LnM3GR6gPu35WxNgbGl8rmY1AEmoMDvL/QD6zYmPWgywxWqJWNdLGT+ke8dKNWrcYgYjPpG5gbTfghP8rw==} + spdy-transport@3.0.0: + resolution: {integrity: sha512-hsLVFE5SjA6TCisWeJXFKniGGOpBgMLmerfO2aCyCU5s7nJ/rpAepqmFifv/GCbSbueEeAJJnmSQ2rKC/g8Fcw==} + + spdy@4.0.2: + resolution: {integrity: sha512-r46gZQZQV+Kl9oItvl1JZZqJKGr+oEkB08A6BzkiR7593/7IbtuncXHd2YoYeTsG4157ZssMu9KYvUHLcjcDoA==} + engines: {node: '>=6.0.0'} + splaytree@3.1.2: resolution: {integrity: sha512-4OM2BJgC5UzrhVnnJA4BkHKGtjXNzzUfpQjCO8I05xYPsfS/VuQDwjCGGMi8rYQilHEV4j8NBqTFbls/PZEE7A==} @@ -14688,6 +18680,10 @@ packages: sprintf-js@1.1.3: resolution: {integrity: sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==} + srcset@4.0.0: + resolution: {integrity: sha512-wvLeHgcVHKO8Sc/H/5lkGreJQVeYMm9rlmt8PuR1xE31rIuXhuzznUUqAt8MqLhB3MqJdFzlNAfpcWnxiFUcPw==} + engines: {node: '>=12'} + ssf@0.11.2: resolution: {integrity: sha512-+idbmIXoYET47hH+d7dfm2epdOMUDjqcB4648sTZ+t2JwoyBFL/insLfB/racrDmsKB3diwsDA696pZMieAC5g==} engines: {node: '>=0.8'} @@ -14714,6 +18710,12 @@ packages: resolution: {integrity: sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g==} engines: {node: '>=0.10.0'} + stats-gl@2.2.8: + resolution: {integrity: sha512-94G5nZvduDmzxBS7K0lYnynYwreZpkknD8g5dZmU6mpwIhy3caCrjAm11Qm1cbyx7mqix7Fp00RkbsonzKWnoQ==} + + stats.js@0.17.0: + resolution: {integrity: sha512-hNKz8phvYLPEcRkeG1rsGmV5ChMjKDAWU7/OJJdDErPBNChQXxCo3WZurGpnWc6gZhAzEPFad1aVgyOANH1sMw==} + statuses@1.5.0: resolution: {integrity: sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==} engines: {node: '>= 0.6'} @@ -14739,6 +18741,9 @@ packages: resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} engines: {node: '>=10.0.0'} + streamx@2.20.1: + resolution: {integrity: sha512-uTa0mU6WUC65iUvzKH4X9hEdvSW7rbPxPtwfWiLMSj3qTdQbAiUboZTxauKfpFuGIGa1C2BYijZ7wgdUXICJhA==} + strict-uri-encode@1.1.0: resolution: {integrity: sha512-R3f198pcvnB+5IpnBlRkphuE9n46WyVl8I39W/ZUTZLz4nqSP/oLYUrcnJrw462Ds8he4YKMov2efsTIw1BDGQ==} engines: {node: '>=0.10.0'} @@ -14789,6 +18794,13 @@ packages: string_decoder@1.3.0: resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} + stringify-entities@4.0.4: + resolution: {integrity: sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==} + + stringify-object@3.3.0: + resolution: {integrity: sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==} + engines: {node: '>=4'} + strip-ansi@3.0.1: resolution: {integrity: sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==} engines: {node: '>=0.10.0'} @@ -14805,6 +18817,10 @@ packages: resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} engines: {node: '>=12'} + strip-bom-string@1.0.0: + resolution: {integrity: sha512-uCC2VHvQRYu+lMh4My/sFNmF2klFymLX1wHJeXnbEJERpV/ZsVuonzerjfrGpIGF7LBVa1O7i9kjiWvJiFck8g==} + engines: {node: '>=0.10.0'} + strip-bom@3.0.0: resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} engines: {node: '>=4'} @@ -14847,6 +18863,15 @@ packages: style-to-object@0.4.4: resolution: {integrity: sha512-HYNoHZa2GorYNyqiCaBgsxvcJIn7OHq6inEga+E6Ke3m5JkoqpQbnFssk4jwe+K7AhGa2fcha4wSOf1Kn01dMg==} + style-to-object@1.0.8: + resolution: {integrity: sha512-xT47I/Eo0rwJmaXC4oilDGDWLohVhR6o/xAQcPQN8q6QBuZVL8qMYL85kLmST5cPjAorwvqIA4qXTRQoYHaL6g==} + + stylehacks@6.1.1: + resolution: {integrity: sha512-gSTTEQ670cJNoaeIp9KX6lZmm8LJ3jPB5yJmX8Zq/wQxOsAFXV3qjWzHas3YYk1qesuVIyYWWUpZ0vSE/dTSGg==} + engines: {node: ^14 || ^16 || >=18.0} + peerDependencies: + postcss: ^8.4.31 + stylis@4.2.0: resolution: {integrity: sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==} @@ -14899,8 +18924,13 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - svelte-check@4.1.1: - resolution: {integrity: sha512-NfaX+6Qtc8W/CyVGS/F7/XdiSSyXz+WGYA9ZWV3z8tso14V2vzjfXviKaTFEzB7g8TqfgO2FOzP6XT4ApSTUTw==} + suspend-react@0.1.3: + resolution: {integrity: sha512-aqldKgX9aZqpoDp3e8/BZ8Dm7x1pJl+qI3ZKxDN0i/IQTWUwBx/ManmlVJ3wowqbno6c2bmiIfs+Um6LbsjJyQ==} + peerDependencies: + react: '>=17.0' + + svelte-check@4.0.8: + resolution: {integrity: sha512-nYxbPa0GJySVLhrplvpdGGdwst/7r/H9N991PVYk3BtSIuWBw5ihItHCDJu7hE1S0bPSRJ6IJ2yTCQeDUk0ZDg==} engines: {node: '>= 18.0.0'} hasBin: true peerDependencies: @@ -14925,6 +18955,12 @@ packages: engines: {node: '>=14.0.0'} hasBin: true + swc-loader@0.2.6: + resolution: {integrity: sha512-9Zi9UP2YmDpgmQVbyOPJClY0dwf58JDyDMQ7uRc4krmc72twNI2fvlBWHLqVekBpPc7h5NJkGVT1zNDxFrqhvg==} + peerDependencies: + '@swc/core': ^1.2.147 + webpack: '>=2' + symbol-observable@4.0.0: resolution: {integrity: sha512-b19dMThMV4HVFynSAM1++gBHAbk2Tc/osgLIBZMKsyqh34jb2e8Os7T6ZW/Bt3pJFdBTd2JwAnAAEQV7rSNvcQ==} engines: {node: '>=0.10'} @@ -14939,17 +18975,34 @@ packages: tailwind-merge@1.14.0: resolution: {integrity: sha512-3mFKyCo/MBcgyOTlrY8T7odzZFx+w+qKSMAmdFzRvqBfLlSigU6TZnlFHK0lkMwj9Bj8OYU+9yW9lmGuS0QEnQ==} + tailwind-merge@2.5.5: + resolution: {integrity: sha512-0LXunzzAZzo0tEPxV3I297ffKZPlKDrjj7NXphC8V5ak9yHC5zRmxnOe2m/Rd/7ivsOMJe3JZ2JVocoDdQTRBA==} + + tailwindcss-animate@1.0.7: + resolution: {integrity: sha512-bl6mpH3T7I3UFxuvDEXLxy/VuFxBk5bbzplh7tXI68mwMokNYd1t9qPBHlnyTwfa4JGC4zP516I1hYYtQ/vspA==} + peerDependencies: + tailwindcss: '>=3.0.0 || insiders' + tailwindcss@3.3.5: resolution: {integrity: sha512-5SEZU4J7pxZgSkv7FP1zY8i2TIAOooNZ1e/OGtxIEv6GltpoiXUqWvLy89+a10qYTB1N5Ifkuw9lqQkN9sscvA==} engines: {node: '>=14.0.0'} hasBin: true + tailwindcss@3.4.13: + resolution: {integrity: sha512-KqjHOJKogOUt5Bs752ykCeiwvi0fKVkr5oqsFNt/8px/tA8scFPIlkygsf6jXrfCqGHz7VflA6+yytWuM+XhFw==} + engines: {node: '>=14.0.0'} + hasBin: true + tailwindcss@4.0.0-alpha.26: resolution: {integrity: sha512-jHLs/18tHTLWkuaWMrTFdeF8qM0ZqCtZHo/YvtZOuhZGA9wW1TVpIvPkAHECXRSp4JiTKBkCzUPdv505kMkgow==} tailwindcss@4.0.0-beta.8: resolution: {integrity: sha512-21HmdRq9tHDLJZavb2cRBGJxBvRODpwb0/t3tRbMOl65hJE6zG6K6lD6lLS3IOC35u4SOjKjdZiJJi9AuWCf+Q==} + tapable@1.1.3: + resolution: {integrity: sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==} + engines: {node: '>=6'} + tapable@2.2.1: resolution: {integrity: sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==} engines: {node: '>=6'} @@ -14958,6 +19011,19 @@ packages: resolution: {integrity: sha512-KCuXjYxCZ3ru40dmND+oCLsXyuA8hoseu2SS404Px5ouyS0A99v8X/mdiLqsR5MTAyamMBN7PRwt2Dv3+xGIxw==} hasBin: true + tar-fs@2.1.1: + resolution: {integrity: sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==} + + tar-fs@3.0.6: + resolution: {integrity: sha512-iokBDQQkUyeXhgPYaZxmczGPhnhXZ0CmrqI+MOb/WFGS9DW5wnfrLgtjUJBvz50vQ3qfRwJ62QVoCFu8mPVu5w==} + + tar-stream@2.2.0: + resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==} + engines: {node: '>=6'} + + tar-stream@3.1.7: + resolution: {integrity: sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==} + tar@6.2.1: resolution: {integrity: sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==} engines: {node: '>=10'} @@ -15012,6 +19078,9 @@ packages: resolution: {integrity: sha512-pFYqmTw68LXVjeWJMST4+borgQP2AyMNbg1BpZh9LbyhUeNkeaPF9gzfPGUAnSMV3qPYdWUwDIjjCLiSDOl7vg==} engines: {node: '>=18'} + text-decoder@1.2.0: + resolution: {integrity: sha512-n1yg1mOj9DNpk3NeZOx7T6jchTbyJS3i3cucbNN6FcdPriMZx7NsgrGpWWdWZZGxD7ES1XB+3uoqHMgOKaN+fg==} + text-extensions@1.9.0: resolution: {integrity: sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ==} engines: {node: '>=0.10'} @@ -15026,6 +19095,19 @@ packages: thenify@3.3.1: resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} + three-mesh-bvh@0.7.6: + resolution: {integrity: sha512-rCjsnxEqR9r1/C/lCqzGLS67NDty/S/eT6rAJfDvsanrIctTWdNoR4ZOGWewCB13h1QkVo2BpmC0wakj1+0m8A==} + peerDependencies: + three: '>= 0.151.0' + + three-stdlib@2.33.0: + resolution: {integrity: sha512-V/uycBuqQOP/3Z+FBtpMdj2Ds5PyfJ3VDfMzktEmG4niOIzv7q1y5uMSbMcng0+057m1l0N147FQxsodQo9zBg==} + peerDependencies: + three: '>=0.128.0' + + three@0.168.0: + resolution: {integrity: sha512-6m6jXtDwMJEK/GGMbAOTSAmxNdzKvvBzgd7q8bE/7Tr6m7PaBh5kKLrN7faWtlglXbzj7sVba48Idwx+NRsZXw==} + throttle-debounce@5.0.0: resolution: {integrity: sha512-2iQTSgkkc1Zyk0MeVrt/3BvuOXYPl/R8Z0U2xxo9rjwNciaHDG3R+Lm6dh4EeUci49DanvBnuqI6jshoQQRGEg==} engines: {node: '>=12.22'} @@ -15039,8 +19121,11 @@ packages: through@2.3.8: resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==} - timezone-groups@0.9.1: - resolution: {integrity: sha512-1+GERLQpmebtCpkroy+AAfN/PZu8drrp4VAX/KSFBWvoaAT+5ANZIMTSn8CDW2uwfrpo1SaxIJ6MqdlACYbq/g==} + thunky@1.1.0: + resolution: {integrity: sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==} + + timezone-groups@0.10.2: + resolution: {integrity: sha512-01G9JdlIybA9Njp0wJcGenXKWAw+woWbv6W/oMexWyPs7Nr/S2p2n1NRrMHbHaFzdf+PNNStQp1WILdnAGjYXQ==} engines: {node: '>=18.12.0'} tiny-each-async@2.0.3: @@ -15055,8 +19140,8 @@ packages: tiny-warning@1.0.3: resolution: {integrity: sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==} - tinybench@2.8.0: - resolution: {integrity: sha512-1/eK7zUnIklz4JUUlL+658n58XO2hHLQfSk1Zf2LKieUjxidN16eKFEoDEfjHc3ohofSSqK3X5yO6VGb6iW8Lw==} + tinybench@2.9.0: + resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} tinycolor2@1.6.0: resolution: {integrity: sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw==} @@ -15064,6 +19149,9 @@ packages: tinyexec@0.2.0: resolution: {integrity: sha512-au8dwv4xKSDR+Fw52csDo3wcDztPdne2oM1o/7LFro4h6bdFmvyUAeAfX40pwDtzHgRFqz1XWaUqgKS2G83/ig==} + tinyexec@0.3.0: + resolution: {integrity: sha512-tVGE0mVJPGb0chKhqmsoosjsS+qUnJVGJpZgsHYQcGoPlG3B51R3PouqTgEGH2Dc9jjFyOqOpix6ZHNMXp1FZg==} + tinyglobby@0.2.2: resolution: {integrity: sha512-mZ2sDMaySvi1PkTp4lTo1In2zjU+cY8OvZsfwrDrx3YGRbXPX1/cbPwCR9zkm3O/Fz9Jo0F1HNgIQ1b8BepqyQ==} engines: {node: '>=12.0.0'} @@ -15086,10 +19174,6 @@ packages: resolution: {integrity: sha512-q5nmENpTHgiPVd1cJDDc9cVoYN5x4vCvwT3FMilvKPKneCBZAxn2YWQjDF0UMcE9k0Cay1gBiDfTMU0g+mPMQA==} engines: {node: '>=14.0.0'} - titleize@3.0.0: - resolution: {integrity: sha512-KxVu8EYHDPBdUYdKZdKtU2aj2XfEx9AfjXxE/Aj0vT06w2icA09Vus1rh6eSu1y01akYg6BjIK/hxyLJINoMLQ==} - engines: {node: '>=12'} - tmp-promise@3.0.3: resolution: {integrity: sha512-RwM7MoPojPxsOBYnyd2hy0bxtIlVrihNs9pj5SUvY8Zz1sQcQG2tG1hSr8PDxfgEB8RNKDhqbIlroIarSNDNsQ==} @@ -15168,6 +19252,19 @@ packages: resolution: {integrity: sha512-pkonvlKk8/ZuR0D5tLW8ljt5I8kmxp2XKymhepUeOdCEfKpZaktSArkLHZt76OB1ZvO9bssUsDty4SWhLvZpLg==} engines: {node: '>=0.10.0'} + troika-three-text@0.49.1: + resolution: {integrity: sha512-lXGWxgjJP9kw4i4Wh+0k0Q/7cRfS6iOME4knKht/KozPu9GcFA9NnNpRvehIhrUawq9B0ZRw+0oiFHgRO+4Wig==} + peerDependencies: + three: '>=0.125.0' + + troika-three-utils@0.49.0: + resolution: {integrity: sha512-umitFL4cT+Fm/uONmaQEq4oZlyRHWwVClaS6ZrdcueRvwc2w+cpNQ47LlJKJswpqtMFWbEhOLy0TekmcPZOdYA==} + peerDependencies: + three: '>=0.125.0' + + troika-worker-utils@0.49.0: + resolution: {integrity: sha512-1xZHoJrG0HFfCvT/iyN41DvI/nRykiBtHqFkGaGgJwq5iXfIZFBiPPEHFpPpgyKM3Oo5ITHXP5wM2TNQszYdVg==} + trough@2.2.0: resolution: {integrity: sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==} @@ -15281,6 +19378,9 @@ packages: tslib@1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} + tslib@2.1.0: + resolution: {integrity: sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==} + tslib@2.3.0: resolution: {integrity: sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==} @@ -15290,6 +19390,9 @@ packages: tslib@2.6.3: resolution: {integrity: sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==} + tslib@2.8.1: + resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} + tsscmp@1.0.6: resolution: {integrity: sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==} engines: {node: '>=0.6.x'} @@ -15304,6 +19407,12 @@ packages: engines: {node: '>=8.0.0'} hasBin: true + tunnel-agent@0.6.0: + resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} + + tunnel-rat@0.1.2: + resolution: {integrity: sha512-lR5VHmkPhzdhrM092lI2nACsLO4QubF0/yoOhzX7c+wIpbN1GjHNzCc91QlpxBi+cnx8vVJ+Ur6vL5cEoQPFpQ==} + turf-jsts@1.2.3: resolution: {integrity: sha512-Ja03QIJlPuHt4IQ2FfGex4F4JAr8m3jpaHbFbQrgwr7s7L6U8ocrHiF3J1+wf9jzhGKxvDeaCAnGDot8OjGFyA==} @@ -15380,11 +19489,6 @@ packages: typedarray@0.0.6: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} - typescript@4.9.5: - resolution: {integrity: sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==} - engines: {node: '>=4.2.0'} - hasBin: true - typescript@5.2.2: resolution: {integrity: sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==} engines: {node: '>=14.17'} @@ -15400,9 +19504,22 @@ packages: engines: {node: '>=14.17'} hasBin: true + typescript@5.5.4: + resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} + engines: {node: '>=14.17'} + hasBin: true + + typescript@5.6.3: + resolution: {integrity: sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==} + engines: {node: '>=14.17'} + hasBin: true + ua-parser-js@1.0.37: resolution: {integrity: sha512-bhTyI94tZofjo+Dn8SN6Zv8nBDvyXTymAdM3LDI/0IboIUwTu1rEhW7v2TfiVsoYWgkQ4kOVqnI8APUFbIQIFQ==} + uc.micro@2.1.0: + resolution: {integrity: sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==} + ufo@1.3.1: resolution: {integrity: sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw==} @@ -15430,9 +19547,32 @@ packages: undici-types@5.26.5: resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + unicode-canonical-property-names-ecmascript@2.0.1: + resolution: {integrity: sha512-dA8WbNeb2a6oQzAQ55YlT5vQAWGV9WXOsi3SskE3bcCdM0P4SDd+24zS/OCacdRq5BkdsRj9q3Pg6YyQoxIGqg==} + engines: {node: '>=4'} + + unicode-emoji-modifier-base@1.0.0: + resolution: {integrity: sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==} + engines: {node: '>=4'} + + unicode-match-property-ecmascript@2.0.0: + resolution: {integrity: sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==} + engines: {node: '>=4'} + + unicode-match-property-value-ecmascript@2.2.0: + resolution: {integrity: sha512-4IehN3V/+kkr5YeSSDDQG8QLqO26XpL2XP3GQtqwlT/QYSECAwFztxVHjlbh0+gjJ3XmNLS0zDsbgs9jWKExLg==} + engines: {node: '>=4'} + + unicode-property-aliases-ecmascript@2.1.0: + resolution: {integrity: sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w==} + engines: {node: '>=4'} + unified@10.1.2: resolution: {integrity: sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q==} + unified@11.0.5: + resolution: {integrity: sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==} + unimport@3.4.0: resolution: {integrity: sha512-M/lfFEgufIT156QAr/jWHLUn55kEmxBBiQsMxvRSIbquwmeJEyQYgshHDEvQDWlSJrVOOTAgnJ3FvlsrpGkanA==} @@ -15448,9 +19588,9 @@ packages: resolution: {integrity: sha512-8EyMynh679x/0gqE9fT9oilG+qEt+ibFyqjuVTsZn1+CMxH+XLlpvr2UZx4nVcCwTpx81nICr2JQFkM+HPLq4w==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} - unique-string@2.0.0: - resolution: {integrity: sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==} - engines: {node: '>=8'} + unique-string@3.0.0: + resolution: {integrity: sha512-VGXBUVwxKMBUznyffQweQABPRRW1vHZAbadFZud4pLFAqRGvv/96vafgjWFqzourzr8YonlQiPgH0YCJfawoGQ==} + engines: {node: '>=12'} unist-util-find-after@4.0.1: resolution: {integrity: sha512-QO/PuPMm2ERxC6vFXEPtmAutOopy5PknD+Oq64gGwxKtk4xwo9Z97t9Av1obPmGU0IyTa6EKYUfTrK2QJS3Ozw==} @@ -15458,12 +19598,24 @@ packages: unist-util-generated@2.0.1: resolution: {integrity: sha512-qF72kLmPxAw0oN2fwpWIqbXAVyEqUzDHMsbtPvOudIlUzXYFIeQIuxXQCRCFh22B7cixvU0MG7m3MW8FTq/S+A==} + unist-util-is@4.1.0: + resolution: {integrity: sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg==} + unist-util-is@5.2.1: resolution: {integrity: sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw==} + unist-util-is@6.0.0: + resolution: {integrity: sha512-2qCTHimwdxLfz+YzdGfkqNlH0tLi9xjTnHddPmJwtIG9MGsdbutfTc4P+haPD7l7Cjxf/WZj+we5qfVPvvxfYw==} + + unist-util-position-from-estree@2.0.0: + resolution: {integrity: sha512-KaFVRjoqLyF6YXCbVLNad/eS4+OfPQQn2yOd7zF/h5T/CSL2v8NpN6a5TPvtbXthAGw5nG+PuTtq+DdIZr+cRQ==} + unist-util-position@4.0.4: resolution: {integrity: sha512-kUBE91efOWfIVBo8xzh/uZQ7p9ffYRtUbMRZBNFYwf0RK8koUMx6dGUfwylLOKmaT2cs4wSW96QoYUSXAyEtpg==} + unist-util-position@5.0.0: + resolution: {integrity: sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==} + unist-util-remove-position@4.0.2: resolution: {integrity: sha512-TkBb0HABNmxzAcfLf4qsIbFbaPDvMO6wa3b3j4VcEzFVaw1LBKwnW4/sRJ/atSLSzoIg41JWEdnE7N6DIhGDGQ==} @@ -15473,12 +19625,27 @@ packages: unist-util-stringify-position@4.0.0: resolution: {integrity: sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==} + unist-util-visit-parents@3.1.1: + resolution: {integrity: sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==} + unist-util-visit-parents@5.1.3: resolution: {integrity: sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg==} + unist-util-visit-parents@6.0.1: + resolution: {integrity: sha512-L/PqWzfTP9lzzEa6CKs0k2nARxTdZduw3zyh8d2NVBnsyvHjSX4TWse388YrrQKbvI8w20fGjGlhgT96WwKykw==} + + unist-util-visit@2.0.3: + resolution: {integrity: sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==} + unist-util-visit@4.1.2: resolution: {integrity: sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg==} + unist-util-visit@5.0.0: + resolution: {integrity: sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==} + + universal-user-agent@6.0.1: + resolution: {integrity: sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==} + universalify@0.1.2: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} engines: {node: '>= 4.0.0'} @@ -15533,6 +19700,9 @@ packages: '@nuxt/kit': optional: true + unplugin-vue-inspector@2.2.0: + resolution: {integrity: sha512-ZJIAHaN6kHBboWU7d0Dmpk1xqabBGx4QUrS8JHB8K1h/i5smp4QyDBAwUAWQXdNdEmaNQzKUMHyCGsI0fWU4Pg==} + unplugin-vue-router@0.7.0: resolution: {integrity: sha512-ddRreGq0t5vlSB7OMy4e4cfU1w2AwBQCwmvW3oP/0IHQiokzbx4hd3TpwBu3eIAFVuhX2cwNQwp1U32UybTVCw==} peerDependencies: @@ -15555,16 +19725,6 @@ packages: resolution: {integrity: sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ==} engines: {node: '>=0.10.0'} - untildify@4.0.0: - resolution: {integrity: sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==} - engines: {node: '>=8'} - - update-browserslist-db@1.0.13: - resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==} - hasBin: true - peerDependencies: - browserslist: '>= 4.21.0' - update-browserslist-db@1.1.0: resolution: {integrity: sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ==} hasBin: true @@ -15574,6 +19734,10 @@ packages: update-check@1.5.4: resolution: {integrity: sha512-5YHsflzHP4t1G+8WGPlvKbJEbAJGCgw+Em+dGR1KmBUbr1J36SJBqlHLjR7oob7sco5hWHGQVcr9B2poIVDDTQ==} + update-notifier@6.0.2: + resolution: {integrity: sha512-EDxhTEVPZZRLWYcJ4ZXjGFN0oP7qYvbXWzEgRm/Yql4dHX5wDbvh89YHP6PK1lzZJYrMtXUuZZz8XGK+U6U1og==} + engines: {node: '>=14.16'} + uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} @@ -15581,6 +19745,16 @@ packages: resolution: {integrity: sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg==} deprecated: Please see https://github.com/lydell/urix#deprecated + url-loader@4.1.1: + resolution: {integrity: sha512-3BTV812+AVHHOJQO8O5MkWgZ5aosP7GnROJwvzLS9hWDj00lZ6Z0wNak423Lp9PBZN05N+Jk/N5Si8jRAlGyWA==} + engines: {node: '>= 10.13.0'} + peerDependencies: + file-loader: '*' + webpack: ^4.0.0 || ^5.0.0 + peerDependenciesMeta: + file-loader: + optional: true + use-callback-ref@1.3.0: resolution: {integrity: sha512-3FT9PRuRdbB9HfXhEq35u4oZkvpJ5kuYbpqhCfmiZyReuRgpnhDlbr2ZEnnuS0RrJAPn6l23xjFg9kpDM+Ms7w==} engines: {node: '>=10'} @@ -15629,10 +19803,25 @@ packages: util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + utila@0.4.0: + resolution: {integrity: sha512-Z0DbgELS9/L/75wZbro8xAnT50pBVFQZ+hUEueGDU5FN51YSCYM+jdxsfCiHjwNP/4LCDD0i/graKpeBnOXKRA==} + + utility-types@3.11.0: + resolution: {integrity: sha512-6Z7Ma2aVEWisaL6TvBCy7P8rm2LQoPv6dJ7ecIaIixHcwfbJ0x7mWdbcwlIM5IGQxPZSFYeqRCqlOOeKoJYMkw==} + engines: {node: '>= 4'} + utils-merge@1.0.1: resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} engines: {node: '>= 0.4.0'} + uuid@8.3.2: + resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==} + hasBin: true + + uuid@9.0.1: + resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} + hasBin: true + uvu@0.5.6: resolution: {integrity: sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA==} engines: {node: '>=8'} @@ -15645,6 +19834,9 @@ packages: resolution: {integrity: sha512-9lDD+EVI2fjFsMWXc6dy5JJzBsVTcQ2fVkfBvncZ6xJWG9wtBhOldG+mHkSL0+V1K/xgZz0JDO5UT5hFwHUghg==} engines: {node: '>=10.12.0'} + v8n@1.5.1: + resolution: {integrity: sha512-LdabyT4OffkyXFCe9UT+uMkxNBs5rcTVuZClvxQr08D5TUgo1OFKkoT65qYRCsiKBl/usHjpXvP4hHMzzDRj3A==} + validate-html-nesting@1.2.2: resolution: {integrity: sha512-hGdgQozCsQJMyfK5urgFcWEqsSSrK63Awe0t/IMR0bZ0QMtnuaiHzThW81guu3qx9abLi99NEuiaN6P9gVYsNg==} @@ -15677,12 +19869,21 @@ packages: vfile-location@4.1.0: resolution: {integrity: sha512-YF23YMyASIIJXpktBa4vIGLJ5Gs88UB/XePgqPmTa7cDA+JeO3yclbpheQYCHjVHBn/yePzrXuygIL+xbvRYHw==} + vfile-location@5.0.3: + resolution: {integrity: sha512-5yXvWDEgqeiYiBe1lbxYF7UMAIm/IcopxMHrMQDq3nvKcjPKIhZklUKL+AE7J7uApI4kwe2snsK+eI6UTj9EHg==} + vfile-message@3.1.4: resolution: {integrity: sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw==} + vfile-message@4.0.2: + resolution: {integrity: sha512-jRDZ1IMLttGj41KcZvlrYAaI3CfqpLpfpf+Mfig13viT6NKvRzWZ+lXz0Y5D60w6uJIBAOGq9mSHf0gktF0duw==} + vfile@5.3.7: resolution: {integrity: sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g==} + vfile@6.0.3: + resolution: {integrity: sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==} + vite-node@1.4.0: resolution: {integrity: sha512-VZDAseqjrHgNd4Kh8icYHWzTKSCZMhia7GyHfhtzLW33fZlG9SwsB6CEhgyVOWkJfJ2pFLrp/Gj1FSfAiqH9Lw==} engines: {node: ^18.0.0 || >=20.0.0} @@ -15693,6 +19894,37 @@ packages: engines: {node: ^18.0.0 || >=20.0.0} hasBin: true + vite-node@2.1.2: + resolution: {integrity: sha512-HPcGNN5g/7I2OtPjLqgOtCRu/qhVvBxTUD3qzitmL0SrG1cWFzxzhMDWussxSbrRYWqnKf8P2jiNhPMSN+ymsQ==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + + vite-plugin-compression@0.5.1: + resolution: {integrity: sha512-5QJKBDc+gNYVqL/skgFAP81Yuzo9R+EAf19d+EtsMF/i8kFUpNi3J/H01QD3Oo8zBQn+NzoCIFkpPLynoOzaJg==} + peerDependencies: + vite: '>=2.0.0' + + vite-plugin-html@3.2.2: + resolution: {integrity: sha512-vb9C9kcdzcIo/Oc3CLZVS03dL5pDlOFuhGlZYDCJ840BhWl/0nGeZWf3Qy7NlOayscY4Cm/QRgULCQkEZige5Q==} + peerDependencies: + vite: '>=2.0.0' + + vite-plugin-inspect@0.8.7: + resolution: {integrity: sha512-/XXou3MVc13A5O9/2Nd6xczjrUwt7ZyI9h8pTnUMkr5SshLcb0PJUOVq2V+XVkdeU4njsqAtmK87THZuO2coGA==} + engines: {node: '>=14'} + peerDependencies: + '@nuxt/kit': '*' + vite: ^3.1.0 || ^4.0.0 || ^5.0.0-0 + peerDependenciesMeta: + '@nuxt/kit': + optional: true + + vite-plugin-mkcert@1.17.6: + resolution: {integrity: sha512-4JR1RN0HEg/w17eRQJ/Ve2pSa6KCVQcQO6yKtIaKQCFDyd63zGfXHWpygBkvvRSpqa0GcqNKf0fjUJ0HiJQXVQ==} + engines: {node: '>=v16.7.0'} + peerDependencies: + vite: '>=3' + vite-plugin-pages@0.32.0: resolution: {integrity: sha512-OxS3n0zUo5wsfgNCAuw2FiG/KD1ipgQV+2Flst4RyeI2iPv+m0YueVq+nx41k5NOWJj/zhqEas6I0b7HXveXjA==} peerDependencies: @@ -15708,6 +19940,11 @@ packages: solid-js: ^1.7.2 vite: ^3.0.0 || ^4.0.0 + vite-plugin-vue-inspector@5.2.0: + resolution: {integrity: sha512-wWxyb9XAtaIvV/Lr7cqB1HIzmHZFVUJsTNm3yAxkS87dgh/Ky4qr2wDEWNxF23fdhVa3jQ8MZREpr4XyiuaRqA==} + peerDependencies: + vite: ^3.0.0-0 || ^4.0.0-0 || ^5.0.0-0 + vite-plugin-vue2-svg@0.4.0: resolution: {integrity: sha512-Z9NT9PTGwEKMSfxruPeBeAgMWAgMz5DiE6u8ZNtkYXODGWceUi6Dhp/f0NFO02sEoDiDxkokzr8u4qK4+9rXJQ==} peerDependencies: @@ -15768,10 +20005,10 @@ packages: vite: optional: true - vitefu@1.0.4: - resolution: {integrity: sha512-y6zEE3PQf6uu/Mt6DTJ9ih+kyJLr4XcSgHR2zUkM8SWDhuixEJxfJ6CZGMHh1Ec3vPLoEA0IHU5oWzVqw8ulow==} + vitefu@1.0.3: + resolution: {integrity: sha512-iKKfOMBHob2WxEJbqbJjHAkmYgvFDPhuqrO82om83S8RLk+17FtyMBfcyeH8GqD0ihShtkMW/zzJgiA51hCNCQ==} peerDependencies: - vite: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 + vite: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0-beta.0 peerDependenciesMeta: vite: optional: true @@ -15801,13 +20038,44 @@ packages: jsdom: optional: true + vitest@2.1.2: + resolution: {integrity: sha512-veNjLizOMkRrJ6xxb+pvxN6/QAWg95mzcRjtmkepXdN87FNfxAss9RKe2far/G9cQpipfgP2taqg0KiWsquj8A==} + engines: {node: ^18.0.0 || >=20.0.0} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@types/node': ^18.0.0 || >=20.0.0 + '@vitest/browser': 2.1.2 + '@vitest/ui': 2.1.2 + happy-dom: '*' + jsdom: '*' + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@types/node': + optional: true + '@vitest/browser': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + vooks@0.2.12: resolution: {integrity: sha512-iox0I3RZzxtKlcgYaStQYKEzWWGAduMmq+jS7OrNdQo1FgGfPMubGL3uGHOU9n97NIvfFDBGnpSvkWyb/NSn/Q==} peerDependencies: vue: ^3.0.0 - vscode-languageserver-textdocument@1.0.11: - resolution: {integrity: sha512-X+8T3GoiwTVlJbicx/sIAF+yuJAqz8VvwJyoMVhwEMoEKE/fkDmrqUgDMyBECcM2A2frVZIUj5HI/ErRXCfOeA==} + vscode-languageserver-textdocument@1.0.12: + resolution: {integrity: sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==} + + vscode-oniguruma@1.7.0: + resolution: {integrity: sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==} + + vscode-textmate@5.2.0: + resolution: {integrity: sha512-Uw5ooOQxRASHgu6C7GVvUxisKXfSgW4oFlO+aa+PAkgmH89O3CXxEEzNRNtHSqtXFTl0nAC1uYj0GMSH27uwtQ==} vscode-uri@3.0.8: resolution: {integrity: sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==} @@ -15823,17 +20091,6 @@ packages: '@vue/composition-api': optional: true - vue-demi@0.14.7: - resolution: {integrity: sha512-EOG8KXDQNwkJILkx/gPcoL/7vH+hORoBaKgGe+6W7VFMvCYJfmF2dGbvgDroVnI8LU7/kTu8mbjRZGBU1z9NTA==} - engines: {node: '>=12'} - hasBin: true - peerDependencies: - '@vue/composition-api': ^1.0.0-rc.1 - vue: ^3.0.0-0 || ^2.6.0 - peerDependenciesMeta: - '@vue/composition-api': - optional: true - vue-router@4.2.5: resolution: {integrity: sha512-DIUpKcyg4+PTQKfFPX88UWhlagBEBEfJ5A8XDXRJLUnZOvcpMF8o/dnL90vpVkGaPbjvXazV/rC1qBKrZlFugw==} peerDependencies: @@ -15844,6 +20101,11 @@ packages: peerDependencies: vue: ^3.2.0 + vue-router@4.4.5: + resolution: {integrity: sha512-4fKZygS8cH1yCyuabAXGUAsyi1b2/o/OKgu/RUb+znIYOxPRxdkytJEx+0wGcpBE1pX6vUgh5jwWOKRGvuA/7Q==} + peerDependencies: + vue: ^3.2.0 + vue-template-babel-compiler@1.2.0: resolution: {integrity: sha512-CScBSX1/wCdmmZ/Lvj/63p2CCVTS0FMj0F69VRBo73CuJrjvPAPGmeNJ7D/cwt/VS2PduowRWbO8N4Zh4Z3b0g==} engines: {node: '>=12.0.0'} @@ -15922,10 +20184,6 @@ packages: peerDependencies: vue: ^3.0.11 - walkdir@0.4.1: - resolution: {integrity: sha512-3eBwRyEln6E1MSzcxcVpQIhRG8Q1jLvEqRmCZqS3dsfXEDR/AhOF4d+jHg1qvDCpYaVRZjENPQyrVxAkQqxPgQ==} - engines: {node: '>=6.0.0'} - walker@1.0.8: resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==} @@ -15936,15 +20194,52 @@ packages: resolution: {integrity: sha512-8wrBCMtVhqcXP2Sup1ctSkga6uc2Bx0IIvKyT7yTFier5AXHooSI+QyQQAtTb7+E0IUCCKyTFmXqdqgum2XWGg==} engines: {node: '>=10.13.0'} + wbuf@1.7.3: + resolution: {integrity: sha512-O84QOnr0icsbFGLS0O3bI5FswxzRr8/gHwWkDlQFskhSPryQXvrTMxjxGP4+iWYoauLoBvfDpkrOauZ+0iZpDA==} + wcwidth@1.0.1: resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} web-namespaces@2.0.1: resolution: {integrity: sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==} + webgl-constants@1.1.1: + resolution: {integrity: sha512-LkBXKjU5r9vAW7Gcu3T5u+5cvSvh5WwINdr0C+9jpzVB41cjQAP5ePArDtk/WHYdVj0GefCgM73BA7FlIiNtdg==} + + webgl-sdf-generator@1.1.1: + resolution: {integrity: sha512-9Z0JcMTFxeE+b2x1LJTdnaT8rT8aEp7MVxkNwoycNmJWwPdzoXzMh0BjJSh/AEFP+KPYZUli814h8bJZFIZ2jA==} + webidl-conversions@3.0.1: resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} + webpack-bundle-analyzer@4.10.2: + resolution: {integrity: sha512-vJptkMm9pk5si4Bv922ZbKLV8UTT4zib4FPgXMhgzUny0bfDDkLXAVQs3ly3fS4/TN9ROFtb0NFrm04UXFE/Vw==} + engines: {node: '>= 10.13.0'} + hasBin: true + + webpack-dev-middleware@5.3.4: + resolution: {integrity: sha512-BVdTqhhs+0IfoeAf7EoH5WE+exCmqGerHfDM0IL096Px60Tq2Mn9MAbnaGUe6HiMa41KMCYF19gyzZmBcq/o4Q==} + engines: {node: '>= 12.13.0'} + peerDependencies: + webpack: ^4.0.0 || ^5.0.0 + + webpack-dev-server@4.15.2: + resolution: {integrity: sha512-0XavAZbNJ5sDrCbkpWL8mia0o5WPOd2YGtxrEiZkBK9FjLppIUK2TgxK6qGD2P3hUXTJNNPVibrerKcx5WkR1g==} + engines: {node: '>= 12.13.0'} + hasBin: true + peerDependencies: + webpack: ^4.37.0 || ^5.0.0 + webpack-cli: '*' + peerDependenciesMeta: + webpack: + optional: true + webpack-cli: + optional: true + + webpack-merge@5.10.0: + resolution: {integrity: sha512-+4zXKdx7UnO+1jaN4l2lHVD+mFvnlZQP/6ljaJVb4SZiwIKeUnrT5l0gkT8z+n4hKpC+jpOv6O9R+gLtag7pSA==} + engines: {node: '>=10.0.0'} + webpack-node-externals@3.0.0: resolution: {integrity: sha512-LnL6Z3GGDPht/AigwRh2dvL9PQPFQ8skEpVrWZXLWBYmqcaojHNN0onvHzie6rq7EWKrrBfPYqNEzTJgiwEQDQ==} engines: {node: '>=6'} @@ -15972,6 +20267,20 @@ packages: webpack-cli: optional: true + webpackbar@5.0.2: + resolution: {integrity: sha512-BmFJo7veBDgQzfWXl/wwYXr/VFus0614qZ8i9znqcl9fnEdiVkdbi0TedLQ6xAK92HZHDJ0QmyQ0fmuZPAgCYQ==} + engines: {node: '>=12'} + peerDependencies: + webpack: 3 || 4 || 5 + + websocket-driver@0.7.4: + resolution: {integrity: sha512-b17KeDIQVjvb0ssuSDF2cYXSg2iztliJ4B9WdsuB6J952qCPKmnVq4DyW5motImXHDC1cBT/1UezrJVsKw5zjg==} + engines: {node: '>=0.8.0'} + + websocket-extensions@0.1.4: + resolution: {integrity: sha512-OqedPIGOfsDlo31UNwYbCFMSaO9m9G/0faIHj5/dZFDMFqPTcx6UwqyOy3COEaEOg/9VsGIpdqn62W5KhoKSpg==} + engines: {node: '>=0.8.0'} + whatwg-url@5.0.0: resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} @@ -16014,6 +20323,9 @@ packages: resolution: {integrity: sha512-o0cyEG0e8GPzT4iGHphIOh0cJOV8fivsXxddQasHPHfoZf1ZexrfeA21w2NaEN1RHE+fXlfISmOE8R9N3u3Qig==} engines: {node: '>=12'} + wildcard@2.0.1: + resolution: {integrity: sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==} + window-size@0.1.0: resolution: {integrity: sha512-1pTPQDKTdd61ozlKGNCjhNRd+KPmgLSGa3mZTHoOliaGcESD8G1PXhh7c1fgiPjVbNVfgy2Faw4BI8/m0cC8Mg==} engines: {node: '>= 0.8.0'} @@ -16059,6 +20371,18 @@ packages: resolution: {integrity: sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + ws@7.5.10: + resolution: {integrity: sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==} + engines: {node: '>=8.3.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + ws@8.14.2: resolution: {integrity: sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==} engines: {node: '>=10.0.0'} @@ -16074,9 +20398,9 @@ packages: x-data-spreadsheet@1.1.9: resolution: {integrity: sha512-wk7knDBYdHjtWiHUVQryZMy00dsGNCF+6wMb5ykwEFcAtBYkYZakJCOCHpEo8onC0Lb/q2gIynWpbQxA4qakyg==} - xdg-basedir@4.0.0: - resolution: {integrity: sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==} - engines: {node: '>=8'} + xdg-basedir@5.1.0: + resolution: {integrity: sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ==} + engines: {node: '>=12'} xlsx-js-style@1.2.0: resolution: {integrity: sha512-DDT4FXFSWfT4DXMSok/m3TvmP1gvO3dn0Eu/c+eXHW5Kzmp7IczNkxg/iEPnImbG9X0Vb8QhROda5eatSR/97Q==} @@ -16088,6 +20412,10 @@ packages: engines: {node: '>=0.8'} hasBin: true + xml-js@1.6.11: + resolution: {integrity: sha512-7rVi2KMfwfWFl+GpPg6m80IVMWXLRjO+PxTq7V2CDhoGak0wzYzFgUY2m4XJ47OGdXd8eLE8EmwfAmdjw7lC1g==} + hasBin: true + xmlbuilder@15.1.1: resolution: {integrity: sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==} engines: {node: '>=8.0'} @@ -16141,6 +20469,11 @@ packages: resolution: {integrity: sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==} engines: {node: '>= 14'} + yaml@2.5.1: + resolution: {integrity: sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==} + engines: {node: '>= 14'} + hasBin: true + yargs-parser@18.1.3: resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} engines: {node: '>=6'} @@ -16176,8 +20509,12 @@ packages: yauzl@2.10.0: resolution: {integrity: sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==} - yjs@13.6.18: - resolution: {integrity: sha512-GBTjO4QCmv2HFKFkYIJl7U77hIB1o22vSCSQD1Ge8ZxWbIbn8AltI4gyXbtL+g5/GJep67HCMq3Y5AmNwDSyEg==} + yauzl@3.1.3: + resolution: {integrity: sha512-JCCdmlJJWv7L0q/KylOekyRaUrdEoUxWkWVcgorosTROCFWiS9p2NNPE9Yb91ak7b1N5SxAZEliWpspbZccivw==} + engines: {node: '>=12'} + + yjs@13.6.20: + resolution: {integrity: sha512-Z2YZI+SYqK7XdWlloI3lhMiKnCdFCVC4PchpdO+mCYwtiTwncjUbnRK9R1JmkNfdmHyDXuWN3ibJAt0wsqTbLQ==} engines: {node: '>=16.0.0', npm: '>=8.0.0'} ylru@1.3.2: @@ -16220,6 +20557,15 @@ packages: react: '>=16.8' zustand: '>=4.4.1' + zustand@3.7.2: + resolution: {integrity: sha512-PIJDIZKtokhof+9+60cpockVOq05sJzHCriyvaLBmEJixseQ1a5Kdov6fWZfWOu5SK9c+FhH1jU0tntLxRJYMA==} + engines: {node: '>=12.7.0'} + peerDependencies: + react: '>=16.8' + peerDependenciesMeta: + react: + optional: true + zustand@4.5.5: resolution: {integrity: sha512-+0PALYNJNgK6hldkgDq2vLrw5f6g/jCInz52n9RTpropGgeAf/ioFUCdtsjCqu4gNhW9D01rUQBROoRjdzyn2Q==} engines: {node: '>=12.7.0'} @@ -16244,6 +20590,111 @@ snapshots: '@adobe/css-tools@4.4.0': {} + '@algolia/autocomplete-core@1.9.3(@algolia/client-search@4.24.0)(algoliasearch@4.24.0)': + dependencies: + '@algolia/autocomplete-plugin-algolia-insights': 1.9.3(@algolia/client-search@4.24.0)(algoliasearch@4.24.0) + '@algolia/autocomplete-shared': 1.9.3(@algolia/client-search@4.24.0)(algoliasearch@4.24.0) + transitivePeerDependencies: + - '@algolia/client-search' + - algoliasearch + - search-insights + + '@algolia/autocomplete-plugin-algolia-insights@1.9.3(@algolia/client-search@4.24.0)(algoliasearch@4.24.0)': + dependencies: + '@algolia/autocomplete-shared': 1.9.3(@algolia/client-search@4.24.0)(algoliasearch@4.24.0) + transitivePeerDependencies: + - '@algolia/client-search' + - algoliasearch + + '@algolia/autocomplete-preset-algolia@1.9.3(@algolia/client-search@4.24.0)(algoliasearch@4.24.0)': + dependencies: + '@algolia/autocomplete-shared': 1.9.3(@algolia/client-search@4.24.0)(algoliasearch@4.24.0) + '@algolia/client-search': 4.24.0 + algoliasearch: 4.24.0 + + '@algolia/autocomplete-shared@1.9.3(@algolia/client-search@4.24.0)(algoliasearch@4.24.0)': + dependencies: + '@algolia/client-search': 4.24.0 + algoliasearch: 4.24.0 + + '@algolia/cache-browser-local-storage@4.24.0': + dependencies: + '@algolia/cache-common': 4.24.0 + + '@algolia/cache-common@4.24.0': {} + + '@algolia/cache-in-memory@4.24.0': + dependencies: + '@algolia/cache-common': 4.24.0 + + '@algolia/client-account@4.24.0': + dependencies: + '@algolia/client-common': 4.24.0 + '@algolia/client-search': 4.24.0 + '@algolia/transporter': 4.24.0 + + '@algolia/client-analytics@4.24.0': + dependencies: + '@algolia/client-common': 4.24.0 + '@algolia/client-search': 4.24.0 + '@algolia/requester-common': 4.24.0 + '@algolia/transporter': 4.24.0 + + '@algolia/client-common@4.24.0': + dependencies: + '@algolia/requester-common': 4.24.0 + '@algolia/transporter': 4.24.0 + + '@algolia/client-personalization@4.24.0': + dependencies: + '@algolia/client-common': 4.24.0 + '@algolia/requester-common': 4.24.0 + '@algolia/transporter': 4.24.0 + + '@algolia/client-search@4.24.0': + dependencies: + '@algolia/client-common': 4.24.0 + '@algolia/requester-common': 4.24.0 + '@algolia/transporter': 4.24.0 + + '@algolia/events@4.0.1': {} + + '@algolia/logger-common@4.24.0': {} + + '@algolia/logger-console@4.24.0': + dependencies: + '@algolia/logger-common': 4.24.0 + + '@algolia/recommend@4.24.0': + dependencies: + '@algolia/cache-browser-local-storage': 4.24.0 + '@algolia/cache-common': 4.24.0 + '@algolia/cache-in-memory': 4.24.0 + '@algolia/client-common': 4.24.0 + '@algolia/client-search': 4.24.0 + '@algolia/logger-common': 4.24.0 + '@algolia/logger-console': 4.24.0 + '@algolia/requester-browser-xhr': 4.24.0 + '@algolia/requester-common': 4.24.0 + '@algolia/requester-node-http': 4.24.0 + '@algolia/transporter': 4.24.0 + + '@algolia/requester-browser-xhr@4.24.0': + dependencies: + '@algolia/requester-common': 4.24.0 + + '@algolia/requester-common@4.24.0': {} + + '@algolia/requester-node-http@4.24.0': + dependencies: + '@algolia/requester-common': 4.24.0 + + '@algolia/transporter@4.24.0': + dependencies: + '@algolia/cache-common': 4.24.0 + '@algolia/logger-common': 4.24.0 + '@algolia/requester-common': 4.24.0 + '@alloc/quick-lru@5.2.0': {} '@ampproject/remapping@2.2.1': @@ -16320,27 +20771,39 @@ snapshots: react-dom: 18.2.0(react@18.2.0) stylis: 4.3.0 + '@ant-design/happy-work-theme@1.0.0(antd@5.11.0(date-fns@2.30.0)(luxon@3.4.4)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': + dependencies: + '@ant-design/cssinjs': 1.21.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@babel/runtime': 7.25.0 + '@ctrl/tinycolor': 3.6.1 + antd: 5.11.0(date-fns@2.30.0)(luxon@3.4.4)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + classnames: 2.5.1 + rc-motion: 2.9.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + rc-util: 5.43.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + '@ant-design/icons-svg@4.3.1': {} '@ant-design/icons-svg@4.4.2': {} - '@ant-design/icons-vue@6.1.0(vue@3.3.7(typescript@5.4.5))': + '@ant-design/icons-vue@6.1.0(vue@3.3.7(typescript@5.6.3))': dependencies: '@ant-design/colors': 6.0.0 '@ant-design/icons-svg': 4.3.1 - vue: 3.3.7(typescript@5.4.5) + vue: 3.3.7(typescript@5.6.3) - '@ant-design/icons-vue@7.0.1(vue@3.3.7(typescript@5.4.5))': + '@ant-design/icons-vue@7.0.1(vue@3.3.7(typescript@5.6.3))': dependencies: '@ant-design/colors': 6.0.0 '@ant-design/icons-svg': 4.3.1 - vue: 3.3.7(typescript@5.4.5) + vue: 3.3.7(typescript@5.6.3) - '@ant-design/icons-vue@7.0.1(vue@3.4.15(typescript@5.4.5))': + '@ant-design/icons-vue@7.0.1(vue@3.4.35(typescript@5.6.3))': dependencies: '@ant-design/colors': 6.0.0 '@ant-design/icons-svg': 4.3.1 - vue: 3.4.15(typescript@5.4.5) + vue: 3.4.35(typescript@5.6.3) '@ant-design/icons@5.2.6(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': dependencies: @@ -16357,7 +20820,7 @@ snapshots: '@ant-design/colors': 7.0.0 '@ant-design/icons-svg': 4.4.2 '@babel/runtime': 7.25.0 - classnames: 2.3.2 + classnames: 2.5.1 rc-util: 5.43.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -16397,11 +20860,11 @@ snapshots: dependencies: '@ant-design/icons': 5.4.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) '@babel/runtime': 7.25.0 - '@dnd-kit/core': 6.1.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - '@dnd-kit/modifiers': 6.0.1(@dnd-kit/core@6.1.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react@18.2.0) - '@dnd-kit/sortable': 7.0.2(@dnd-kit/core@6.1.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react@18.2.0) + '@dnd-kit/core': 6.3.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@dnd-kit/modifiers': 6.0.1(@dnd-kit/core@6.3.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react@18.2.0) + '@dnd-kit/sortable': 7.0.2(@dnd-kit/core@6.3.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react@18.2.0) '@dnd-kit/utilities': 3.2.2(react@18.2.0) - '@emotion/styled': 11.13.0(@emotion/react@11.13.0(@types/react@18.2.35)(react@18.2.0))(@types/react@18.2.35)(react@18.2.0) + '@emotion/styled': 11.14.0(@emotion/react@11.13.0(@types/react@18.2.35)(react@18.2.0))(@types/react@18.2.35)(react@18.2.0) '@floating-ui/react': 0.24.8(react-dom@18.2.0(react@18.2.0))(react@18.2.0) ahooks: 3.7.8(react@18.2.0) antd: 5.11.0(date-fns@2.30.0)(luxon@3.4.4)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) @@ -16410,7 +20873,7 @@ snapshots: color: 4.2.3 copy-to-clipboard: 3.3.3 diff: 5.2.0 - dompurify: 3.1.6 + dompurify: 3.2.3 fast-deep-equal: 3.1.3 immer: 9.0.21 lodash.flatten: 4.4.0 @@ -16428,24 +20891,24 @@ snapshots: nanoid: 5.0.7 polished: 4.3.1 rc-util: 5.43.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - re-resizable: 6.9.17(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + re-resizable: 6.10.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0) react: 18.2.0 react-copy-to-clipboard: 5.1.0(react@18.2.0) react-dom: 18.2.0(react@18.2.0) - react-hotkeys-hook: 4.5.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + react-hotkeys-hook: 4.6.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0) react-layout-kit: 1.9.0(react@18.2.0) react-markdown: 8.0.7(@types/react@18.2.35)(react@18.2.0) - react-rnd: 10.4.12(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + react-rnd: 10.4.13(react-dom@18.2.0(react@18.2.0))(react@18.2.0) react-window: 1.8.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0) reactflow: 11.11.4(@types/react@18.2.35)(immer@9.0.21)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) rehype-katex: 6.0.3 remark-gfm: 3.0.1 remark-math: 5.1.1 rxjs: 7.8.1 - shiki: 1.14.1 + shiki: 1.24.2 type-fest: 3.13.1 use-merge-value: 1.2.0(react@18.2.0) - yjs: 13.6.18 + yjs: 13.6.20 zustand: 4.5.5(@types/react@18.2.35)(immer@9.0.21)(react@18.2.0) zustand-middleware-yjs: 1.3.1(@types/react@18.2.35)(immer@9.0.21)(react@18.2.0) zustand-utils: 1.3.2(react@18.2.0)(zustand@4.5.5(@types/react@18.2.35)(immer@10.0.3)(react@18.2.0)) @@ -16499,7 +20962,7 @@ snapshots: '@antv/scale': 0.3.18 '@antv/util': 2.0.17 fecha: 4.2.3 - tslib: 2.6.2 + tslib: 2.6.3 '@antv/coord@0.3.1': dependencies: @@ -16585,7 +21048,7 @@ snapshots: '@antv/path-util': 2.0.15 '@antv/scale': 0.3.18 '@antv/util': 2.0.17 - tslib: 2.6.2 + tslib: 2.6.3 '@antv/g2plot@2.3.39': dependencies: @@ -16596,7 +21059,7 @@ snapshots: fmin: 0.0.2 pdfast: 0.2.0 size-sensor: 1.0.2 - tslib: 2.6.2 + tslib: 2.6.3 '@antv/hierarchy@0.6.11': dependencies: @@ -16606,7 +21069,7 @@ snapshots: dependencies: '@antv/util': 2.0.17 gl-matrix: 3.4.3 - tslib: 2.6.3 + tslib: 2.8.1 '@antv/matrix-util@3.1.0-beta.3': dependencies: @@ -16645,7 +21108,7 @@ snapshots: dependencies: '@esri/arcgis-html-sanitizer': 4.0.3 '@esri/calcite-colors': 6.1.0 - '@esri/calcite-components': 2.12.2(@floating-ui/utils@0.2.8) + '@esri/calcite-components': 2.13.0(@floating-ui/utils@0.2.8) '@vaadin/grid': 24.3.22 '@zip.js/zip.js': 2.7.52 luxon: 3.4.4 @@ -16654,12 +21117,12 @@ snapshots: transitivePeerDependencies: - '@floating-ui/utils' - '@arcgis/map-components@4.30.7(@arcgis/core@4.30.9(@floating-ui/utils@0.2.8))(@esri/calcite-components@2.12.2(@floating-ui/utils@0.2.8))': + '@arcgis/map-components@4.30.7(@arcgis/core@4.30.9(@floating-ui/utils@0.2.8))(@esri/calcite-components@2.13.0(@floating-ui/utils@0.2.8))': dependencies: '@arcgis/components-controllers': 4.30.7(@arcgis/core@4.30.9(@floating-ui/utils@0.2.8)) '@arcgis/components-utils': 4.30.7 '@arcgis/core': 4.30.9(@floating-ui/utils@0.2.8) - '@esri/calcite-components': 2.12.2(@floating-ui/utils@0.2.8) + '@esri/calcite-components': 2.13.0(@floating-ui/utils@0.2.8) '@stencil/core': 4.17.1 transitivePeerDependencies: - '@arcgis/core-adapter' @@ -16700,17 +21163,30 @@ snapshots: '@babel/code-frame@7.24.2': dependencies: '@babel/highlight': 7.24.2 - picocolors: 1.0.1 + picocolors: 1.1.1 '@babel/code-frame@7.24.7': dependencies: '@babel/highlight': 7.24.7 - picocolors: 1.0.1 + picocolors: 1.1.1 + + '@babel/code-frame@7.25.7': + dependencies: + '@babel/highlight': 7.25.7 + picocolors: 1.1.1 + + '@babel/code-frame@7.26.2': + dependencies: + '@babel/helper-validator-identifier': 7.25.9 + js-tokens: 4.0.0 + picocolors: 1.1.1 '@babel/compat-data@7.24.1': {} '@babel/compat-data@7.25.2': {} + '@babel/compat-data@7.25.7': {} + '@babel/core@7.23.2': dependencies: '@ampproject/remapping': 2.2.1 @@ -16733,7 +21209,7 @@ snapshots: '@babel/core@7.24.3': dependencies: - '@ampproject/remapping': 2.2.1 + '@ampproject/remapping': 2.3.0 '@babel/code-frame': 7.24.2 '@babel/generator': 7.24.1 '@babel/helper-compilation-targets': 7.23.6 @@ -16744,7 +21220,7 @@ snapshots: '@babel/traverse': 7.24.1 '@babel/types': 7.24.0 convert-source-map: 2.0.0 - debug: 4.3.4 + debug: 4.3.7 gensync: 1.0.0-beta.2 json5: 2.2.3 semver: 6.3.1 @@ -16780,7 +21256,7 @@ snapshots: '@babel/generator@7.24.1': dependencies: - '@babel/types': 7.25.2 + '@babel/types': 7.25.7 '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 jsesc: 2.5.2 @@ -16792,19 +21268,45 @@ snapshots: '@jridgewell/trace-mapping': 0.3.25 jsesc: 2.5.2 + '@babel/generator@7.25.7': + dependencies: + '@babel/types': 7.25.7 + '@jridgewell/gen-mapping': 0.3.5 + '@jridgewell/trace-mapping': 0.3.25 + jsesc: 3.0.2 + + '@babel/generator@7.26.3': + dependencies: + '@babel/parser': 7.26.3 + '@babel/types': 7.26.3 + '@jridgewell/gen-mapping': 0.3.5 + '@jridgewell/trace-mapping': 0.3.25 + jsesc: 3.0.2 + '@babel/helper-annotate-as-pure@7.22.5': dependencies: - '@babel/types': 7.25.2 + '@babel/types': 7.25.7 '@babel/helper-annotate-as-pure@7.24.7': dependencies: - '@babel/types': 7.25.2 + '@babel/types': 7.25.7 + + '@babel/helper-annotate-as-pure@7.25.7': + dependencies: + '@babel/types': 7.25.7 + + '@babel/helper-builder-binary-assignment-operator-visitor@7.25.7': + dependencies: + '@babel/traverse': 7.25.7 + '@babel/types': 7.25.7 + transitivePeerDependencies: + - supports-color '@babel/helper-compilation-targets@7.22.15': dependencies: '@babel/compat-data': 7.24.1 '@babel/helper-validator-option': 7.23.5 - browserslist: 4.23.1 + browserslist: 4.24.0 lru-cache: 5.1.1 semver: 6.3.1 @@ -16812,7 +21314,7 @@ snapshots: dependencies: '@babel/compat-data': 7.24.1 '@babel/helper-validator-option': 7.23.5 - browserslist: 4.23.1 + browserslist: 4.24.0 lru-cache: 5.1.1 semver: 6.3.1 @@ -16820,7 +21322,15 @@ snapshots: dependencies: '@babel/compat-data': 7.25.2 '@babel/helper-validator-option': 7.24.8 - browserslist: 4.23.1 + browserslist: 4.24.0 + lru-cache: 5.1.1 + semver: 6.3.1 + + '@babel/helper-compilation-targets@7.25.7': + dependencies: + '@babel/compat-data': 7.25.7 + '@babel/helper-validator-option': 7.25.7 + browserslist: 4.24.0 lru-cache: 5.1.1 semver: 6.3.1 @@ -16850,6 +21360,19 @@ snapshots: '@babel/helper-split-export-declaration': 7.22.6 semver: 6.3.1 + '@babel/helper-create-class-features-plugin@7.24.1(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-annotate-as-pure': 7.22.5 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-function-name': 7.23.0 + '@babel/helper-member-expression-to-functions': 7.23.0 + '@babel/helper-optimise-call-expression': 7.22.5 + '@babel/helper-replace-supers': 7.24.1(@babel/core@7.25.2) + '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 + '@babel/helper-split-export-declaration': 7.22.6 + semver: 6.3.1 + '@babel/helper-create-class-features-plugin@7.25.0(@babel/core@7.25.2)': dependencies: '@babel/core': 7.25.2 @@ -16858,11 +21381,31 @@ snapshots: '@babel/helper-optimise-call-expression': 7.24.7 '@babel/helper-replace-supers': 7.25.0(@babel/core@7.25.2) '@babel/helper-skip-transparent-expression-wrappers': 7.24.7 - '@babel/traverse': 7.25.3 + '@babel/traverse': 7.25.7 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + + '@babel/helper-create-class-features-plugin@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-annotate-as-pure': 7.25.7 + '@babel/helper-member-expression-to-functions': 7.25.7 + '@babel/helper-optimise-call-expression': 7.25.7 + '@babel/helper-replace-supers': 7.25.7(@babel/core@7.25.2) + '@babel/helper-skip-transparent-expression-wrappers': 7.25.7 + '@babel/traverse': 7.25.7 semver: 6.3.1 transitivePeerDependencies: - supports-color + '@babel/helper-create-regexp-features-plugin@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-annotate-as-pure': 7.25.7 + regexpu-core: 6.1.1 + semver: 6.3.1 + '@babel/helper-define-polyfill-provider@0.4.3(@babel/core@7.25.2)': dependencies: '@babel/core': 7.25.2 @@ -16874,40 +21417,65 @@ snapshots: transitivePeerDependencies: - supports-color + '@babel/helper-define-polyfill-provider@0.6.3(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-compilation-targets': 7.25.7 + '@babel/helper-plugin-utils': 7.25.7 + debug: 4.3.7 + lodash.debounce: 4.0.8 + resolve: 1.22.8 + transitivePeerDependencies: + - supports-color + '@babel/helper-environment-visitor@7.22.20': {} '@babel/helper-function-name@7.23.0': dependencies: - '@babel/template': 7.25.0 - '@babel/types': 7.25.2 + '@babel/template': 7.25.7 + '@babel/types': 7.25.7 '@babel/helper-hoist-variables@7.22.5': dependencies: - '@babel/types': 7.25.2 + '@babel/types': 7.25.7 '@babel/helper-member-expression-to-functions@7.23.0': dependencies: - '@babel/types': 7.25.2 + '@babel/types': 7.25.7 '@babel/helper-member-expression-to-functions@7.24.8': dependencies: - '@babel/traverse': 7.25.3 - '@babel/types': 7.25.2 + '@babel/traverse': 7.25.7 + '@babel/types': 7.25.7 + transitivePeerDependencies: + - supports-color + + '@babel/helper-member-expression-to-functions@7.25.7': + dependencies: + '@babel/traverse': 7.25.7 + '@babel/types': 7.25.7 transitivePeerDependencies: - supports-color '@babel/helper-module-imports@7.18.6': dependencies: - '@babel/types': 7.25.2 + '@babel/types': 7.25.7 '@babel/helper-module-imports@7.22.15': dependencies: '@babel/types': 7.23.6 - '@babel/helper-module-imports@7.24.7': + '@babel/helper-module-imports@7.25.7': dependencies: - '@babel/traverse': 7.25.3 - '@babel/types': 7.25.2 + '@babel/traverse': 7.25.7 + '@babel/types': 7.25.7 + transitivePeerDependencies: + - supports-color + + '@babel/helper-module-imports@7.25.9': + dependencies: + '@babel/traverse': 7.26.4 + '@babel/types': 7.26.3 transitivePeerDependencies: - supports-color @@ -16933,7 +21501,7 @@ snapshots: dependencies: '@babel/core': 7.24.3 '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-module-imports': 7.24.7 + '@babel/helper-module-imports': 7.25.7 '@babel/helper-simple-access': 7.22.5 '@babel/helper-split-export-declaration': 7.22.6 '@babel/helper-validator-identifier': 7.24.7 @@ -16943,20 +21511,34 @@ snapshots: '@babel/helper-module-transforms@7.25.2(@babel/core@7.25.2)': dependencies: '@babel/core': 7.25.2 - '@babel/helper-module-imports': 7.24.7 + '@babel/helper-module-imports': 7.25.7 '@babel/helper-simple-access': 7.24.7 '@babel/helper-validator-identifier': 7.24.7 '@babel/traverse': 7.25.3 transitivePeerDependencies: - supports-color + '@babel/helper-module-transforms@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-module-imports': 7.25.7 + '@babel/helper-simple-access': 7.25.7 + '@babel/helper-validator-identifier': 7.25.7 + '@babel/traverse': 7.25.7 + transitivePeerDependencies: + - supports-color + '@babel/helper-optimise-call-expression@7.22.5': dependencies: - '@babel/types': 7.25.2 + '@babel/types': 7.25.7 '@babel/helper-optimise-call-expression@7.24.7': dependencies: - '@babel/types': 7.25.2 + '@babel/types': 7.25.7 + + '@babel/helper-optimise-call-expression@7.25.7': + dependencies: + '@babel/types': 7.25.7 '@babel/helper-plugin-utils@7.22.5': {} @@ -16964,6 +21546,17 @@ snapshots: '@babel/helper-plugin-utils@7.24.8': {} + '@babel/helper-plugin-utils@7.25.7': {} + + '@babel/helper-remap-async-to-generator@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-annotate-as-pure': 7.25.7 + '@babel/helper-wrap-function': 7.25.7 + '@babel/traverse': 7.25.7 + transitivePeerDependencies: + - supports-color + '@babel/helper-replace-supers@7.24.1(@babel/core@7.23.2)': dependencies: '@babel/core': 7.23.2 @@ -16978,55 +21571,103 @@ snapshots: '@babel/helper-member-expression-to-functions': 7.23.0 '@babel/helper-optimise-call-expression': 7.22.5 + '@babel/helper-replace-supers@7.24.1(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-environment-visitor': 7.22.20 + '@babel/helper-member-expression-to-functions': 7.23.0 + '@babel/helper-optimise-call-expression': 7.22.5 + '@babel/helper-replace-supers@7.25.0(@babel/core@7.25.2)': dependencies: '@babel/core': 7.25.2 '@babel/helper-member-expression-to-functions': 7.24.8 '@babel/helper-optimise-call-expression': 7.24.7 - '@babel/traverse': 7.25.3 + '@babel/traverse': 7.25.7 + transitivePeerDependencies: + - supports-color + + '@babel/helper-replace-supers@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-member-expression-to-functions': 7.25.7 + '@babel/helper-optimise-call-expression': 7.25.7 + '@babel/traverse': 7.25.7 transitivePeerDependencies: - supports-color '@babel/helper-simple-access@7.22.5': dependencies: - '@babel/types': 7.24.0 + '@babel/types': 7.25.7 '@babel/helper-simple-access@7.24.7': dependencies: - '@babel/traverse': 7.25.3 - '@babel/types': 7.25.2 + '@babel/traverse': 7.25.7 + '@babel/types': 7.25.7 + transitivePeerDependencies: + - supports-color + + '@babel/helper-simple-access@7.25.7': + dependencies: + '@babel/traverse': 7.25.7 + '@babel/types': 7.25.7 transitivePeerDependencies: - supports-color '@babel/helper-skip-transparent-expression-wrappers@7.22.5': dependencies: - '@babel/types': 7.25.2 + '@babel/types': 7.25.7 '@babel/helper-skip-transparent-expression-wrappers@7.24.7': dependencies: - '@babel/traverse': 7.25.3 - '@babel/types': 7.25.2 + '@babel/traverse': 7.25.7 + '@babel/types': 7.25.7 + transitivePeerDependencies: + - supports-color + + '@babel/helper-skip-transparent-expression-wrappers@7.25.7': + dependencies: + '@babel/traverse': 7.25.7 + '@babel/types': 7.25.7 transitivePeerDependencies: - supports-color '@babel/helper-split-export-declaration@7.22.6': dependencies: - '@babel/types': 7.25.2 + '@babel/types': 7.25.7 '@babel/helper-string-parser@7.22.5': {} '@babel/helper-string-parser@7.24.8': {} + '@babel/helper-string-parser@7.25.7': {} + + '@babel/helper-string-parser@7.25.9': {} + '@babel/helper-validator-identifier@7.22.20': {} '@babel/helper-validator-identifier@7.24.7': {} + '@babel/helper-validator-identifier@7.25.7': {} + + '@babel/helper-validator-identifier@7.25.9': {} + '@babel/helper-validator-option@7.22.15': {} '@babel/helper-validator-option@7.23.5': {} '@babel/helper-validator-option@7.24.8': {} + '@babel/helper-validator-option@7.25.7': {} + + '@babel/helper-wrap-function@7.25.7': + dependencies: + '@babel/template': 7.25.7 + '@babel/traverse': 7.25.7 + '@babel/types': 7.25.7 + transitivePeerDependencies: + - supports-color + '@babel/helpers@7.23.2': dependencies: '@babel/template': 7.24.0 @@ -17050,17 +21691,24 @@ snapshots: '@babel/highlight@7.24.2': dependencies: - '@babel/helper-validator-identifier': 7.24.7 + '@babel/helper-validator-identifier': 7.25.7 chalk: 2.4.2 js-tokens: 4.0.0 - picocolors: 1.0.1 + picocolors: 1.1.1 '@babel/highlight@7.24.7': dependencies: - '@babel/helper-validator-identifier': 7.24.7 + '@babel/helper-validator-identifier': 7.25.7 chalk: 2.4.2 js-tokens: 4.0.0 - picocolors: 1.0.1 + picocolors: 1.1.1 + + '@babel/highlight@7.25.7': + dependencies: + '@babel/helper-validator-identifier': 7.25.7 + chalk: 2.4.2 + js-tokens: 4.0.0 + picocolors: 1.1.1 '@babel/parser@7.23.0': dependencies: @@ -17072,12 +21720,55 @@ snapshots: '@babel/parser@7.24.5': dependencies: - '@babel/types': 7.25.2 + '@babel/types': 7.25.7 '@babel/parser@7.25.3': dependencies: '@babel/types': 7.25.2 + '@babel/parser@7.25.7': + dependencies: + '@babel/types': 7.25.7 + + '@babel/parser@7.26.3': + dependencies: + '@babel/types': 7.26.3 + + '@babel/plugin-bugfix-firefox-class-in-computed-class-key@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/traverse': 7.25.7 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-bugfix-safari-class-field-initializer-scope@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + + '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + + '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/helper-skip-transparent-expression-wrappers': 7.25.7 + '@babel/plugin-transform-optional-chaining': 7.25.7(@babel/core@7.25.2) + transitivePeerDependencies: + - supports-color + + '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/traverse': 7.25.7 + transitivePeerDependencies: + - supports-color + '@babel/plugin-proposal-class-properties@7.18.6(@babel/core@7.24.3)': dependencies: '@babel/core': 7.24.3 @@ -17091,6 +21782,13 @@ snapshots: '@babel/helper-plugin-utils': 7.24.0 '@babel/plugin-syntax-decorators': 7.24.1(@babel/core@7.24.3) + '@babel/plugin-proposal-decorators@7.24.1(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-create-class-features-plugin': 7.24.1(@babel/core@7.25.2) + '@babel/helper-plugin-utils': 7.24.0 + '@babel/plugin-syntax-decorators': 7.24.1(@babel/core@7.25.2) + '@babel/plugin-proposal-nullish-coalescing-operator@7.18.6(@babel/core@7.24.3)': dependencies: '@babel/core': 7.24.3 @@ -17113,65 +21811,94 @@ snapshots: '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.24.3) + '@babel/plugin-proposal-private-property-in-object@7.21.0-placeholder-for-preset-env.2(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.24.3)': dependencies: '@babel/core': 7.24.3 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.25.2)': dependencies: '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.0 - optional: true + '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.24.3)': dependencies: '@babel/core': 7.24.3 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.25.2)': dependencies: '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.0 - optional: true + '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.24.3)': dependencies: '@babel/core': 7.24.3 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.25.2)': dependencies: '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.0 - optional: true + '@babel/helper-plugin-utils': 7.25.7 + + '@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-syntax-decorators@7.24.1(@babel/core@7.24.3)': dependencies: '@babel/core': 7.24.3 '@babel/helper-plugin-utils': 7.24.0 + '@babel/plugin-syntax-decorators@7.24.1(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.24.0 + + '@babel/plugin-syntax-dynamic-import@7.8.3(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.24.8 + + '@babel/plugin-syntax-export-namespace-from@7.8.3(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + + '@babel/plugin-syntax-import-assertions@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + + '@babel/plugin-syntax-import-attributes@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.24.3)': dependencies: '@babel/core': 7.24.3 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.25.2)': dependencies: '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.0 - optional: true + '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.24.3)': dependencies: '@babel/core': 7.24.3 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.25.2)': dependencies: '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.0 - optional: true + '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-syntax-jsx@7.22.5(@babel/core@7.23.2)': dependencies: @@ -17188,21 +21915,35 @@ snapshots: '@babel/core': 7.24.3 '@babel/helper-plugin-utils': 7.24.0 + '@babel/plugin-syntax-jsx@7.24.1(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.24.0 + '@babel/plugin-syntax-jsx@7.24.7(@babel/core@7.25.2)': dependencies: '@babel/core': 7.25.2 '@babel/helper-plugin-utils': 7.24.8 + '@babel/plugin-syntax-jsx@7.25.7(@babel/core@7.24.3)': + dependencies: + '@babel/core': 7.24.3 + '@babel/helper-plugin-utils': 7.25.7 + + '@babel/plugin-syntax-jsx@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.24.3)': dependencies: '@babel/core': 7.24.3 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.25.2)': dependencies: '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.0 - optional: true + '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.24.3)': dependencies: @@ -17213,18 +21954,16 @@ snapshots: dependencies: '@babel/core': 7.25.2 '@babel/helper-plugin-utils': 7.24.0 - optional: true '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.24.3)': dependencies: '@babel/core': 7.24.3 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.25.2)': dependencies: '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.0 - optional: true + '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.24.3)': dependencies: @@ -17235,18 +21974,16 @@ snapshots: dependencies: '@babel/core': 7.25.2 '@babel/helper-plugin-utils': 7.24.0 - optional: true '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.24.3)': dependencies: '@babel/core': 7.24.3 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.25.2)': dependencies: '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.0 - optional: true + '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.24.3)': dependencies: @@ -17257,18 +21994,21 @@ snapshots: dependencies: '@babel/core': 7.25.2 '@babel/helper-plugin-utils': 7.24.0 - optional: true + + '@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.24.3)': dependencies: '@babel/core': 7.24.3 - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.25.2)': dependencies: '@babel/core': 7.25.2 - '@babel/helper-plugin-utils': 7.24.0 - optional: true + '@babel/helper-plugin-utils': 7.25.7 '@babel/plugin-syntax-typescript@7.22.5(@babel/core@7.23.2)': dependencies: @@ -17285,27 +22025,191 @@ snapshots: '@babel/core': 7.25.2 '@babel/helper-plugin-utils': 7.24.8 + '@babel/plugin-syntax-unicode-sets-regex@7.18.6(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-create-regexp-features-plugin': 7.25.7(@babel/core@7.25.2) + '@babel/helper-plugin-utils': 7.25.7 + '@babel/plugin-transform-arrow-functions@7.24.1(@babel/core@7.24.3)': dependencies: '@babel/core': 7.24.3 '@babel/helper-plugin-utils': 7.24.0 + '@babel/plugin-transform-arrow-functions@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + + '@babel/plugin-transform-async-generator-functions@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/helper-remap-async-to-generator': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.25.2) + '@babel/traverse': 7.25.7 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-async-to-generator@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-module-imports': 7.25.7 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/helper-remap-async-to-generator': 7.25.7(@babel/core@7.25.2) + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-block-scoped-functions@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/plugin-transform-block-scoping@7.24.4(@babel/core@7.24.3)': dependencies: '@babel/core': 7.24.3 '@babel/helper-plugin-utils': 7.24.0 + '@babel/plugin-transform-block-scoping@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + + '@babel/plugin-transform-class-properties@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-create-class-features-plugin': 7.25.7(@babel/core@7.25.2) + '@babel/helper-plugin-utils': 7.25.7 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-class-static-block@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-create-class-features-plugin': 7.25.7(@babel/core@7.25.2) + '@babel/helper-plugin-utils': 7.25.7 + '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.25.2) + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-classes@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-annotate-as-pure': 7.25.7 + '@babel/helper-compilation-targets': 7.25.7 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/helper-replace-supers': 7.25.7(@babel/core@7.25.2) + '@babel/traverse': 7.25.7 + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + '@babel/plugin-transform-computed-properties@7.24.1(@babel/core@7.24.3)': dependencies: '@babel/core': 7.24.3 '@babel/helper-plugin-utils': 7.24.0 '@babel/template': 7.24.0 + '@babel/plugin-transform-computed-properties@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/template': 7.25.7 + '@babel/plugin-transform-destructuring@7.24.1(@babel/core@7.24.3)': dependencies: '@babel/core': 7.24.3 '@babel/helper-plugin-utils': 7.24.0 + '@babel/plugin-transform-destructuring@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + + '@babel/plugin-transform-dotall-regex@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-create-regexp-features-plugin': 7.25.7(@babel/core@7.25.2) + '@babel/helper-plugin-utils': 7.25.7 + + '@babel/plugin-transform-duplicate-keys@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + + '@babel/plugin-transform-duplicate-named-capturing-groups-regex@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-create-regexp-features-plugin': 7.25.7(@babel/core@7.25.2) + '@babel/helper-plugin-utils': 7.25.7 + + '@babel/plugin-transform-dynamic-import@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.25.2) + + '@babel/plugin-transform-exponentiation-operator@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-builder-binary-assignment-operator-visitor': 7.25.7 + '@babel/helper-plugin-utils': 7.25.7 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-export-namespace-from@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.25.2) + + '@babel/plugin-transform-for-of@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/helper-skip-transparent-expression-wrappers': 7.25.7 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-function-name@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-compilation-targets': 7.25.7 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/traverse': 7.25.7 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-json-strings@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.25.2) + + '@babel/plugin-transform-literals@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + + '@babel/plugin-transform-logical-assignment-operators@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.25.2) + + '@babel/plugin-transform-member-expression-literals@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + + '@babel/plugin-transform-modules-amd@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-module-transforms': 7.25.7(@babel/core@7.25.2) + '@babel/helper-plugin-utils': 7.25.7 + transitivePeerDependencies: + - supports-color + '@babel/plugin-transform-modules-commonjs@7.23.0(@babel/core@7.23.2)': dependencies: '@babel/core': 7.23.2 @@ -17329,11 +22233,165 @@ snapshots: transitivePeerDependencies: - supports-color + '@babel/plugin-transform-modules-commonjs@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-module-transforms': 7.25.7(@babel/core@7.25.2) + '@babel/helper-plugin-utils': 7.25.7 + '@babel/helper-simple-access': 7.25.7 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-modules-systemjs@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-module-transforms': 7.25.7(@babel/core@7.25.2) + '@babel/helper-plugin-utils': 7.25.7 + '@babel/helper-validator-identifier': 7.25.7 + '@babel/traverse': 7.25.7 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-modules-umd@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-module-transforms': 7.25.7(@babel/core@7.25.2) + '@babel/helper-plugin-utils': 7.25.7 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-named-capturing-groups-regex@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-create-regexp-features-plugin': 7.25.7(@babel/core@7.25.2) + '@babel/helper-plugin-utils': 7.25.7 + + '@babel/plugin-transform-new-target@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + + '@babel/plugin-transform-nullish-coalescing-operator@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.25.2) + + '@babel/plugin-transform-numeric-separator@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.25.2) + + '@babel/plugin-transform-object-rest-spread@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-compilation-targets': 7.25.7 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.25.2) + '@babel/plugin-transform-parameters': 7.25.7(@babel/core@7.25.2) + + '@babel/plugin-transform-object-super@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/helper-replace-supers': 7.25.7(@babel/core@7.25.2) + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-optional-catch-binding@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.25.2) + + '@babel/plugin-transform-optional-chaining@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/helper-skip-transparent-expression-wrappers': 7.25.7 + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.25.2) + transitivePeerDependencies: + - supports-color + '@babel/plugin-transform-parameters@7.24.1(@babel/core@7.24.3)': dependencies: '@babel/core': 7.24.3 '@babel/helper-plugin-utils': 7.24.0 + '@babel/plugin-transform-parameters@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + + '@babel/plugin-transform-private-methods@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-create-class-features-plugin': 7.25.7(@babel/core@7.25.2) + '@babel/helper-plugin-utils': 7.25.7 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-private-property-in-object@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-annotate-as-pure': 7.25.7 + '@babel/helper-create-class-features-plugin': 7.25.7(@babel/core@7.25.2) + '@babel/helper-plugin-utils': 7.25.7 + '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.25.2) + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-property-literals@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + + '@babel/plugin-transform-react-constant-elements@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + + '@babel/plugin-transform-react-display-name@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + + '@babel/plugin-transform-react-jsx-development@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/plugin-transform-react-jsx': 7.25.7(@babel/core@7.25.2) + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-react-jsx@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-annotate-as-pure': 7.25.7 + '@babel/helper-module-imports': 7.25.7 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/plugin-syntax-jsx': 7.25.7(@babel/core@7.25.2) + '@babel/types': 7.25.7 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-react-pure-annotations@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-annotate-as-pure': 7.25.7 + '@babel/helper-plugin-utils': 7.25.7 + + '@babel/plugin-transform-regenerator@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + regenerator-transform: 0.15.2 + + '@babel/plugin-transform-reserved-words@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/plugin-transform-runtime@7.23.2(@babel/core@7.25.2)': dependencies: '@babel/core': 7.25.2 @@ -17346,12 +22404,40 @@ snapshots: transitivePeerDependencies: - supports-color + '@babel/plugin-transform-shorthand-properties@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/plugin-transform-spread@7.24.1(@babel/core@7.24.3)': dependencies: '@babel/core': 7.24.3 '@babel/helper-plugin-utils': 7.24.0 '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 + '@babel/plugin-transform-spread@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/helper-skip-transparent-expression-wrappers': 7.25.7 + transitivePeerDependencies: + - supports-color + + '@babel/plugin-transform-sticky-regex@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + + '@babel/plugin-transform-template-literals@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + + '@babel/plugin-transform-typeof-symbol@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/plugin-transform-typescript@7.22.15(@babel/core@7.23.2)': dependencies: '@babel/core': 7.23.2 @@ -17379,6 +22465,137 @@ snapshots: transitivePeerDependencies: - supports-color + '@babel/plugin-transform-unicode-escapes@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + + '@babel/plugin-transform-unicode-property-regex@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-create-regexp-features-plugin': 7.25.7(@babel/core@7.25.2) + '@babel/helper-plugin-utils': 7.25.7 + + '@babel/plugin-transform-unicode-regex@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-create-regexp-features-plugin': 7.25.7(@babel/core@7.25.2) + '@babel/helper-plugin-utils': 7.25.7 + + '@babel/plugin-transform-unicode-sets-regex@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-create-regexp-features-plugin': 7.25.7(@babel/core@7.25.2) + '@babel/helper-plugin-utils': 7.25.7 + + '@babel/preset-env@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/compat-data': 7.25.7 + '@babel/core': 7.25.2 + '@babel/helper-compilation-targets': 7.25.7 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/helper-validator-option': 7.25.7 + '@babel/plugin-bugfix-firefox-class-in-computed-class-key': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-bugfix-safari-class-field-initializer-scope': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-proposal-private-property-in-object': 7.21.0-placeholder-for-preset-env.2(@babel/core@7.25.2) + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.25.2) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.25.2) + '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@7.25.2) + '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.25.2) + '@babel/plugin-syntax-export-namespace-from': 7.8.3(@babel/core@7.25.2) + '@babel/plugin-syntax-import-assertions': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-syntax-import-attributes': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.25.2) + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.25.2) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.25.2) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.25.2) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.25.2) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.25.2) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.25.2) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.25.2) + '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@7.25.2) + '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.25.2) + '@babel/plugin-syntax-unicode-sets-regex': 7.18.6(@babel/core@7.25.2) + '@babel/plugin-transform-arrow-functions': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-async-generator-functions': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-async-to-generator': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-block-scoped-functions': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-block-scoping': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-class-properties': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-class-static-block': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-classes': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-computed-properties': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-destructuring': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-dotall-regex': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-duplicate-keys': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-duplicate-named-capturing-groups-regex': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-dynamic-import': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-exponentiation-operator': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-export-namespace-from': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-for-of': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-function-name': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-json-strings': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-literals': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-logical-assignment-operators': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-member-expression-literals': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-modules-amd': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-modules-commonjs': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-modules-systemjs': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-modules-umd': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-named-capturing-groups-regex': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-new-target': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-nullish-coalescing-operator': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-numeric-separator': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-object-rest-spread': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-object-super': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-optional-catch-binding': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-optional-chaining': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-parameters': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-private-methods': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-private-property-in-object': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-property-literals': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-regenerator': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-reserved-words': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-shorthand-properties': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-spread': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-sticky-regex': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-template-literals': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-typeof-symbol': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-unicode-escapes': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-unicode-property-regex': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-unicode-regex': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-unicode-sets-regex': 7.25.7(@babel/core@7.25.2) + '@babel/preset-modules': 0.1.6-no-external-plugins(@babel/core@7.25.2) + babel-plugin-polyfill-corejs2: 0.4.11(@babel/core@7.25.2) + babel-plugin-polyfill-corejs3: 0.10.6(@babel/core@7.25.2) + babel-plugin-polyfill-regenerator: 0.6.2(@babel/core@7.25.2) + core-js-compat: 3.38.1 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + + '@babel/preset-modules@0.1.6-no-external-plugins(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/types': 7.25.7 + esutils: 2.0.3 + + '@babel/preset-react@7.25.7(@babel/core@7.25.2)': + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-plugin-utils': 7.25.7 + '@babel/helper-validator-option': 7.25.7 + '@babel/plugin-transform-react-display-name': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-react-jsx': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-react-jsx-development': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-transform-react-pure-annotations': 7.25.7(@babel/core@7.25.2) + transitivePeerDependencies: + - supports-color + '@babel/preset-typescript@7.23.2(@babel/core@7.23.2)': dependencies: '@babel/core': 7.23.2 @@ -17399,6 +22616,11 @@ snapshots: transitivePeerDependencies: - supports-color + '@babel/runtime-corejs3@7.25.7': + dependencies: + core-js-pure: 3.38.1 + regenerator-runtime: 0.14.0 + '@babel/runtime@7.23.2': dependencies: regenerator-runtime: 0.14.0 @@ -17425,6 +22647,18 @@ snapshots: '@babel/parser': 7.25.3 '@babel/types': 7.25.2 + '@babel/template@7.25.7': + dependencies: + '@babel/code-frame': 7.25.7 + '@babel/parser': 7.25.7 + '@babel/types': 7.25.7 + + '@babel/template@7.25.9': + dependencies: + '@babel/code-frame': 7.26.2 + '@babel/parser': 7.26.3 + '@babel/types': 7.26.3 + '@babel/traverse@7.23.2': dependencies: '@babel/code-frame': 7.24.2 @@ -17435,7 +22669,7 @@ snapshots: '@babel/helper-split-export-declaration': 7.22.6 '@babel/parser': 7.24.1 '@babel/types': 7.24.0 - debug: 4.3.4 + debug: 4.3.7 globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -17467,6 +22701,30 @@ snapshots: transitivePeerDependencies: - supports-color + '@babel/traverse@7.25.7': + dependencies: + '@babel/code-frame': 7.25.7 + '@babel/generator': 7.25.7 + '@babel/parser': 7.25.7 + '@babel/template': 7.25.7 + '@babel/types': 7.25.7 + debug: 4.3.7 + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + + '@babel/traverse@7.26.4': + dependencies: + '@babel/code-frame': 7.26.2 + '@babel/generator': 7.26.3 + '@babel/parser': 7.26.3 + '@babel/template': 7.25.9 + '@babel/types': 7.26.3 + debug: 4.4.0 + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + '@babel/types@7.23.0': dependencies: '@babel/helper-string-parser': 7.22.5 @@ -17491,6 +22749,17 @@ snapshots: '@babel/helper-validator-identifier': 7.24.7 to-fast-properties: 2.0.0 + '@babel/types@7.25.7': + dependencies: + '@babel/helper-string-parser': 7.25.7 + '@babel/helper-validator-identifier': 7.25.7 + to-fast-properties: 2.0.0 + + '@babel/types@7.26.3': + dependencies: + '@babel/helper-string-parser': 7.25.9 + '@babel/helper-validator-identifier': 7.25.9 + '@bcoe/v8-coverage@0.2.3': {} '@better-scroll/core@2.5.0': @@ -17503,50 +22772,50 @@ snapshots: dependencies: '@better-scroll/core': 2.5.0 - '@biomejs/biome@1.8.3': + '@biomejs/biome@1.9.4': optionalDependencies: - '@biomejs/cli-darwin-arm64': 1.8.3 - '@biomejs/cli-darwin-x64': 1.8.3 - '@biomejs/cli-linux-arm64': 1.8.3 - '@biomejs/cli-linux-arm64-musl': 1.8.3 - '@biomejs/cli-linux-x64': 1.8.3 - '@biomejs/cli-linux-x64-musl': 1.8.3 - '@biomejs/cli-win32-arm64': 1.8.3 - '@biomejs/cli-win32-x64': 1.8.3 - - '@biomejs/cli-darwin-arm64@1.8.3': + '@biomejs/cli-darwin-arm64': 1.9.4 + '@biomejs/cli-darwin-x64': 1.9.4 + '@biomejs/cli-linux-arm64': 1.9.4 + '@biomejs/cli-linux-arm64-musl': 1.9.4 + '@biomejs/cli-linux-x64': 1.9.4 + '@biomejs/cli-linux-x64-musl': 1.9.4 + '@biomejs/cli-win32-arm64': 1.9.4 + '@biomejs/cli-win32-x64': 1.9.4 + + '@biomejs/cli-darwin-arm64@1.9.4': optional: true - '@biomejs/cli-darwin-x64@1.8.3': + '@biomejs/cli-darwin-x64@1.9.4': optional: true - '@biomejs/cli-linux-arm64-musl@1.8.3': + '@biomejs/cli-linux-arm64-musl@1.9.4': optional: true - '@biomejs/cli-linux-arm64@1.8.3': + '@biomejs/cli-linux-arm64@1.9.4': optional: true - '@biomejs/cli-linux-x64-musl@1.8.3': + '@biomejs/cli-linux-x64-musl@1.9.4': optional: true - '@biomejs/cli-linux-x64@1.8.3': + '@biomejs/cli-linux-x64@1.9.4': optional: true - '@biomejs/cli-win32-arm64@1.8.3': + '@biomejs/cli-win32-arm64@1.9.4': optional: true - '@biomejs/cli-win32-x64@1.8.3': + '@biomejs/cli-win32-x64@1.9.4': optional: true '@bufbuild/protobuf@1.4.1': {} - '@changesets/apply-release-plan@6.1.4': + '@changesets/apply-release-plan@7.0.1': dependencies: '@babel/runtime': 7.25.0 - '@changesets/config': 2.3.1 - '@changesets/get-version-range-type': 0.3.2 - '@changesets/git': 2.0.0 - '@changesets/types': 5.2.1 + '@changesets/config': 3.0.0 + '@changesets/get-version-range-type': 0.4.0 + '@changesets/git': 3.0.0 + '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 detect-indent: 6.1.0 fs-extra: 7.0.1 @@ -17554,14 +22823,14 @@ snapshots: outdent: 0.5.0 prettier: 2.8.8 resolve-from: 5.0.0 - semver: 7.5.4 + semver: 7.6.3 - '@changesets/apply-release-plan@7.0.1': + '@changesets/apply-release-plan@7.0.5': dependencies: - '@babel/runtime': 7.25.0 - '@changesets/config': 3.0.0 + '@changesets/config': 3.0.3 '@changesets/get-version-range-type': 0.4.0 - '@changesets/git': 3.0.0 + '@changesets/git': 3.0.1 + '@changesets/should-skip-package': 0.1.1 '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 detect-indent: 6.1.0 @@ -17570,16 +22839,7 @@ snapshots: outdent: 0.5.0 prettier: 2.8.8 resolve-from: 5.0.0 - semver: 7.5.4 - - '@changesets/assemble-release-plan@5.2.4': - dependencies: - '@babel/runtime': 7.25.0 - '@changesets/errors': 0.1.4 - '@changesets/get-dependents-graph': 1.3.6 - '@changesets/types': 5.2.1 - '@manypkg/get-packages': 1.1.3 - semver: 7.5.4 + semver: 7.6.3 '@changesets/assemble-release-plan@6.0.0': dependencies: @@ -17588,55 +22848,24 @@ snapshots: '@changesets/get-dependents-graph': 2.0.0 '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 - semver: 7.5.4 + semver: 7.6.3 - '@changesets/changelog-git@0.1.14': + '@changesets/assemble-release-plan@6.0.4': dependencies: - '@changesets/types': 5.2.1 + '@changesets/errors': 0.2.0 + '@changesets/get-dependents-graph': 2.1.2 + '@changesets/should-skip-package': 0.1.1 + '@changesets/types': 6.0.0 + '@manypkg/get-packages': 1.1.3 + semver: 7.6.3 '@changesets/changelog-git@0.2.0': dependencies: '@changesets/types': 6.0.0 - '@changesets/cli@2.26.2': - dependencies: - '@babel/runtime': 7.23.2 - '@changesets/apply-release-plan': 6.1.4 - '@changesets/assemble-release-plan': 5.2.4 - '@changesets/changelog-git': 0.1.14 - '@changesets/config': 2.3.1 - '@changesets/errors': 0.1.4 - '@changesets/get-dependents-graph': 1.3.6 - '@changesets/get-release-plan': 3.0.17 - '@changesets/git': 2.0.0 - '@changesets/logger': 0.0.5 - '@changesets/pre': 1.0.14 - '@changesets/read': 0.5.9 - '@changesets/types': 5.2.1 - '@changesets/write': 0.2.3 - '@manypkg/get-packages': 1.1.3 - '@types/is-ci': 3.0.3 - '@types/semver': 7.5.4 - ansi-colors: 4.1.3 - chalk: 2.4.2 - enquirer: 2.4.1 - external-editor: 3.1.0 - fs-extra: 7.0.1 - human-id: 1.0.2 - is-ci: 3.0.1 - meow: 6.1.1 - outdent: 0.5.0 - p-limit: 2.3.0 - preferred-pm: 3.1.2 - resolve-from: 5.0.0 - semver: 7.5.4 - spawndamnit: 2.0.0 - term-size: 2.2.1 - tty-table: 4.2.3 - '@changesets/cli@2.27.2': dependencies: - '@babel/runtime': 7.23.2 + '@babel/runtime': 7.25.0 '@changesets/apply-release-plan': 7.0.1 '@changesets/assemble-release-plan': 6.0.0 '@changesets/changelog-git': 0.2.0 @@ -17669,15 +22898,36 @@ snapshots: term-size: 2.2.1 tty-table: 4.2.3 - '@changesets/config@2.3.1': + '@changesets/cli@2.27.9': dependencies: - '@changesets/errors': 0.1.4 - '@changesets/get-dependents-graph': 1.3.6 - '@changesets/logger': 0.0.5 - '@changesets/types': 5.2.1 + '@changesets/apply-release-plan': 7.0.5 + '@changesets/assemble-release-plan': 6.0.4 + '@changesets/changelog-git': 0.2.0 + '@changesets/config': 3.0.3 + '@changesets/errors': 0.2.0 + '@changesets/get-dependents-graph': 2.1.2 + '@changesets/get-release-plan': 4.0.4 + '@changesets/git': 3.0.1 + '@changesets/logger': 0.1.1 + '@changesets/pre': 2.0.1 + '@changesets/read': 0.6.1 + '@changesets/should-skip-package': 0.1.1 + '@changesets/types': 6.0.0 + '@changesets/write': 0.3.2 '@manypkg/get-packages': 1.1.3 + ansi-colors: 4.1.3 + ci-info: 3.9.0 + enquirer: 2.4.1 + external-editor: 3.1.0 fs-extra: 7.0.1 - micromatch: 4.0.5 + mri: 1.2.0 + p-limit: 2.3.0 + package-manager-detector: 0.2.2 + picocolors: 1.1.0 + resolve-from: 5.0.0 + semver: 7.6.3 + spawndamnit: 2.0.0 + term-size: 2.2.1 '@changesets/config@3.0.0': dependencies: @@ -17687,41 +22937,36 @@ snapshots: '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 fs-extra: 7.0.1 - micromatch: 4.0.5 + micromatch: 4.0.8 - '@changesets/errors@0.1.4': + '@changesets/config@3.0.3': dependencies: - extendable-error: 0.1.7 + '@changesets/errors': 0.2.0 + '@changesets/get-dependents-graph': 2.1.2 + '@changesets/logger': 0.1.1 + '@changesets/types': 6.0.0 + '@manypkg/get-packages': 1.1.3 + fs-extra: 7.0.1 + micromatch: 4.0.8 '@changesets/errors@0.2.0': dependencies: extendable-error: 0.1.7 - '@changesets/get-dependents-graph@1.3.6': - dependencies: - '@changesets/types': 5.2.1 - '@manypkg/get-packages': 1.1.3 - chalk: 2.4.2 - fs-extra: 7.0.1 - semver: 7.5.4 - '@changesets/get-dependents-graph@2.0.0': dependencies: '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 chalk: 2.4.2 fs-extra: 7.0.1 - semver: 7.5.4 + semver: 7.6.3 - '@changesets/get-release-plan@3.0.17': + '@changesets/get-dependents-graph@2.1.2': dependencies: - '@babel/runtime': 7.25.0 - '@changesets/assemble-release-plan': 5.2.4 - '@changesets/config': 2.3.1 - '@changesets/pre': 1.0.14 - '@changesets/read': 0.5.9 - '@changesets/types': 5.2.1 + '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 + picocolors: 1.1.1 + semver: 7.6.3 '@changesets/get-release-plan@4.0.0': dependencies: @@ -17733,103 +22978,103 @@ snapshots: '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 - '@changesets/get-version-range-type@0.3.2': {} + '@changesets/get-release-plan@4.0.4': + dependencies: + '@changesets/assemble-release-plan': 6.0.4 + '@changesets/config': 3.0.3 + '@changesets/pre': 2.0.1 + '@changesets/read': 0.6.1 + '@changesets/types': 6.0.0 + '@manypkg/get-packages': 1.1.3 '@changesets/get-version-range-type@0.4.0': {} - '@changesets/git@2.0.0': + '@changesets/git@3.0.0': dependencies: '@babel/runtime': 7.25.0 - '@changesets/errors': 0.1.4 - '@changesets/types': 5.2.1 + '@changesets/errors': 0.2.0 + '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 is-subdir: 1.2.0 - micromatch: 4.0.5 + micromatch: 4.0.8 spawndamnit: 2.0.0 - '@changesets/git@3.0.0': + '@changesets/git@3.0.1': dependencies: - '@babel/runtime': 7.25.0 '@changesets/errors': 0.2.0 - '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 is-subdir: 1.2.0 - micromatch: 4.0.5 + micromatch: 4.0.8 spawndamnit: 2.0.0 - '@changesets/logger@0.0.5': - dependencies: - chalk: 2.4.2 - '@changesets/logger@0.1.0': dependencies: chalk: 2.4.2 - '@changesets/parse@0.3.16': + '@changesets/logger@0.1.1': dependencies: - '@changesets/types': 5.2.1 - js-yaml: 3.14.1 + picocolors: 1.1.1 '@changesets/parse@0.4.0': dependencies: '@changesets/types': 6.0.0 js-yaml: 3.14.1 - '@changesets/pre@1.0.14': + '@changesets/pre@2.0.0': dependencies: '@babel/runtime': 7.25.0 - '@changesets/errors': 0.1.4 - '@changesets/types': 5.2.1 + '@changesets/errors': 0.2.0 + '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 fs-extra: 7.0.1 - '@changesets/pre@2.0.0': + '@changesets/pre@2.0.1': dependencies: - '@babel/runtime': 7.25.0 '@changesets/errors': 0.2.0 '@changesets/types': 6.0.0 '@manypkg/get-packages': 1.1.3 fs-extra: 7.0.1 - '@changesets/read@0.5.9': + '@changesets/read@0.6.0': dependencies: '@babel/runtime': 7.25.0 - '@changesets/git': 2.0.0 - '@changesets/logger': 0.0.5 - '@changesets/parse': 0.3.16 - '@changesets/types': 5.2.1 + '@changesets/git': 3.0.0 + '@changesets/logger': 0.1.0 + '@changesets/parse': 0.4.0 + '@changesets/types': 6.0.0 chalk: 2.4.2 fs-extra: 7.0.1 p-filter: 2.1.0 - '@changesets/read@0.6.0': + '@changesets/read@0.6.1': dependencies: - '@babel/runtime': 7.25.0 - '@changesets/git': 3.0.0 - '@changesets/logger': 0.1.0 + '@changesets/git': 3.0.1 + '@changesets/logger': 0.1.1 '@changesets/parse': 0.4.0 '@changesets/types': 6.0.0 - chalk: 2.4.2 fs-extra: 7.0.1 p-filter: 2.1.0 + picocolors: 1.1.1 - '@changesets/types@4.1.0': {} + '@changesets/should-skip-package@0.1.1': + dependencies: + '@changesets/types': 6.0.0 + '@manypkg/get-packages': 1.1.3 - '@changesets/types@5.2.1': {} + '@changesets/types@4.1.0': {} '@changesets/types@6.0.0': {} - '@changesets/write@0.2.3': + '@changesets/write@0.3.1': dependencies: '@babel/runtime': 7.25.0 - '@changesets/types': 5.2.1 + '@changesets/types': 6.0.0 fs-extra: 7.0.1 human-id: 1.0.2 prettier: 2.8.8 - '@changesets/write@0.3.1': + '@changesets/write@0.3.2': dependencies: - '@babel/runtime': 7.25.0 '@changesets/types': 6.0.0 fs-extra: 7.0.1 human-id: 1.0.2 @@ -17837,7 +23082,7 @@ snapshots: '@clack/core@0.3.3': dependencies: - picocolors: 1.0.1 + picocolors: 1.1.1 sisteransi: 1.0.5 '@clack/prompts@0.7.0': @@ -17848,29 +23093,29 @@ snapshots: '@codspeed/core@3.1.1': dependencies: - axios: 1.7.2 + axios: 1.7.7(debug@4.3.7) find-up: 6.3.0 form-data: 4.0.0 node-gyp-build: 4.7.1 transitivePeerDependencies: - debug - '@codspeed/vitest-plugin@3.1.1(vite@5.2.8(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1))(vitest@2.0.4(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1))': + '@codspeed/vitest-plugin@3.1.1(vite@5.2.8(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))(vitest@2.0.4(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))': dependencies: '@codspeed/core': 3.1.1 - vite: 5.2.8(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1) - vitest: 2.0.4(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1) + vite: 5.2.8(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) + vitest: 2.0.4(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) transitivePeerDependencies: - debug '@colors/colors@1.5.0': optional: true - '@commitlint/cli@17.8.1': + '@commitlint/cli@17.8.1(@swc/core@1.7.26(@swc/helpers@0.5.3))': dependencies: '@commitlint/format': 17.8.1 '@commitlint/lint': 17.8.1 - '@commitlint/load': 17.8.1 + '@commitlint/load': 17.8.1(@swc/core@1.7.26(@swc/helpers@0.5.3)) '@commitlint/read': 17.8.1 '@commitlint/types': 17.8.1 execa: 5.1.1 @@ -17919,7 +23164,7 @@ snapshots: '@commitlint/rules': 17.8.1 '@commitlint/types': 17.8.1 - '@commitlint/load@17.8.1': + '@commitlint/load@17.8.1(@swc/core@1.7.26(@swc/helpers@0.5.3))': dependencies: '@commitlint/config-validator': 17.8.1 '@commitlint/execute-rule': 17.8.1 @@ -17927,14 +23172,14 @@ snapshots: '@commitlint/types': 17.8.1 '@types/node': 20.5.1 chalk: 4.1.2 - cosmiconfig: 8.3.6(typescript@5.4.5) - cosmiconfig-typescript-loader: 4.4.0(@types/node@20.5.1)(cosmiconfig@8.3.6(typescript@5.4.5))(ts-node@10.9.1(@types/node@20.5.1)(typescript@5.4.5))(typescript@5.4.5) + cosmiconfig: 8.3.6(typescript@5.6.3) + cosmiconfig-typescript-loader: 4.4.0(@types/node@20.5.1)(cosmiconfig@8.3.6(typescript@5.6.3))(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@20.5.1)(typescript@5.6.3))(typescript@5.6.3) lodash.isplainobject: 4.0.6 lodash.merge: 4.6.2 lodash.uniq: 4.5.0 resolve-from: 5.0.0 - ts-node: 10.9.1(@types/node@20.5.1)(typescript@5.4.5) - typescript: 5.4.5 + ts-node: 10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@20.5.1)(typescript@5.6.3) + typescript: 5.6.3 transitivePeerDependencies: - '@swc/core' - '@swc/wasm' @@ -17982,227 +23227,1251 @@ snapshots: dependencies: chalk: 4.1.2 - '@cspell/cspell-bundled-dicts@6.31.3': + '@crowdin/cli@3.19.4(encoding@0.1.13)': + dependencies: + command-exists-promise: 2.0.2 + node-fetch: 2.7.0(encoding@0.1.13) + shelljs: 0.8.5 + tar: 6.2.1 + yauzl: 3.1.3 + transitivePeerDependencies: + - encoding + + '@crowdin/crowdin-api-client@1.36.0': + dependencies: + axios: 1.7.2 + transitivePeerDependencies: + - debug + + '@cspell/cspell-bundled-dicts@8.14.2': dependencies: '@cspell/dict-ada': 4.0.2 - '@cspell/dict-aws': 3.0.0 - '@cspell/dict-bash': 4.1.2 - '@cspell/dict-companies': 3.0.27 - '@cspell/dict-cpp': 5.0.9 - '@cspell/dict-cryptocurrencies': 3.0.1 + '@cspell/dict-aws': 4.0.4 + '@cspell/dict-bash': 4.1.5 + '@cspell/dict-companies': 3.1.4 + '@cspell/dict-cpp': 5.1.19 + '@cspell/dict-cryptocurrencies': 5.0.0 '@cspell/dict-csharp': 4.0.2 - '@cspell/dict-css': 4.0.12 + '@cspell/dict-css': 4.0.13 '@cspell/dict-dart': 2.0.3 '@cspell/dict-django': 4.1.0 '@cspell/dict-docker': 1.1.7 - '@cspell/dict-dotnet': 5.0.0 + '@cspell/dict-dotnet': 5.0.5 '@cspell/dict-elixir': 4.0.3 - '@cspell/dict-en-common-misspellings': 1.0.2 + '@cspell/dict-en-common-misspellings': 2.0.4 '@cspell/dict-en-gb': 1.1.33 - '@cspell/dict-en_us': 4.3.11 - '@cspell/dict-filetypes': 3.0.2 - '@cspell/dict-fonts': 3.0.2 - '@cspell/dict-fullstack': 3.1.5 - '@cspell/dict-gaming-terms': 1.0.4 - '@cspell/dict-git': 2.0.0 - '@cspell/dict-golang': 6.0.4 + '@cspell/dict-en_us': 4.3.23 + '@cspell/dict-filetypes': 3.0.4 + '@cspell/dict-fonts': 4.0.0 + '@cspell/dict-fsharp': 1.0.1 + '@cspell/dict-fullstack': 3.2.0 + '@cspell/dict-gaming-terms': 1.0.5 + '@cspell/dict-git': 3.0.0 + '@cspell/dict-golang': 6.0.13 + '@cspell/dict-google': 1.0.1 '@cspell/dict-haskell': 4.0.1 '@cspell/dict-html': 4.0.5 '@cspell/dict-html-symbol-entities': 4.0.0 - '@cspell/dict-java': 5.0.6 - '@cspell/dict-k8s': 1.0.2 + '@cspell/dict-java': 5.0.7 + '@cspell/dict-julia': 1.0.1 + '@cspell/dict-k8s': 1.0.6 '@cspell/dict-latex': 4.0.0 - '@cspell/dict-lorem-ipsum': 3.0.0 - '@cspell/dict-lua': 4.0.2 - '@cspell/dict-node': 4.0.3 - '@cspell/dict-npm': 5.0.12 - '@cspell/dict-php': 4.0.4 - '@cspell/dict-powershell': 5.0.2 - '@cspell/dict-public-licenses': 2.0.5 - '@cspell/dict-python': 4.1.10 + '@cspell/dict-lorem-ipsum': 4.0.0 + '@cspell/dict-lua': 4.0.3 + '@cspell/dict-makefile': 1.0.0 + '@cspell/dict-monkeyc': 1.0.6 + '@cspell/dict-node': 5.0.1 + '@cspell/dict-npm': 5.1.5 + '@cspell/dict-php': 4.0.10 + '@cspell/dict-powershell': 5.0.10 + '@cspell/dict-public-licenses': 2.0.8 + '@cspell/dict-python': 4.2.8 '@cspell/dict-r': 2.0.1 - '@cspell/dict-ruby': 5.0.1 - '@cspell/dict-rust': 4.0.1 - '@cspell/dict-scala': 5.0.0 - '@cspell/dict-software-terms': 3.3.9 - '@cspell/dict-sql': 2.1.2 + '@cspell/dict-ruby': 5.0.4 + '@cspell/dict-rust': 4.0.6 + '@cspell/dict-scala': 5.0.3 + '@cspell/dict-software-terms': 4.1.7 + '@cspell/dict-sql': 2.1.5 '@cspell/dict-svelte': 1.0.2 '@cspell/dict-swift': 2.0.1 - '@cspell/dict-typescript': 3.1.2 + '@cspell/dict-terraform': 1.0.2 + '@cspell/dict-typescript': 3.1.6 '@cspell/dict-vue': 3.0.0 - '@cspell/cspell-json-reporter@6.31.3': + '@cspell/cspell-json-reporter@8.14.2': dependencies: - '@cspell/cspell-types': 6.31.3 + '@cspell/cspell-types': 8.14.2 + + '@cspell/cspell-pipe@8.14.2': {} - '@cspell/cspell-pipe@6.31.3': {} + '@cspell/cspell-resolver@8.14.2': + dependencies: + global-directory: 4.0.1 - '@cspell/cspell-service-bus@6.31.3': {} + '@cspell/cspell-service-bus@8.14.2': {} - '@cspell/cspell-types@6.31.3': {} + '@cspell/cspell-types@8.14.2': {} '@cspell/dict-ada@4.0.2': {} - '@cspell/dict-aws@3.0.0': {} + '@cspell/dict-aws@4.0.4': {} - '@cspell/dict-bash@4.1.2': {} + '@cspell/dict-bash@4.1.5': {} - '@cspell/dict-companies@3.0.27': {} + '@cspell/dict-companies@3.1.4': {} - '@cspell/dict-cpp@5.0.9': {} + '@cspell/dict-cpp@5.1.19': {} - '@cspell/dict-cryptocurrencies@3.0.1': {} + '@cspell/dict-cryptocurrencies@5.0.0': {} '@cspell/dict-csharp@4.0.2': {} - '@cspell/dict-css@4.0.12': {} + '@cspell/dict-css@4.0.13': {} '@cspell/dict-dart@2.0.3': {} - '@cspell/dict-data-science@1.0.11': {} + '@cspell/dict-data-science@2.0.2': {} + + '@cspell/dict-django@4.1.0': {} + + '@cspell/dict-docker@1.1.7': {} + + '@cspell/dict-dotnet@5.0.5': {} + + '@cspell/dict-elixir@4.0.3': {} + + '@cspell/dict-en-common-misspellings@2.0.4': {} + + '@cspell/dict-en-gb@1.1.33': {} + + '@cspell/dict-en_us@4.3.23': {} + + '@cspell/dict-filetypes@3.0.4': {} + + '@cspell/dict-fonts@4.0.0': {} + + '@cspell/dict-fsharp@1.0.1': {} + + '@cspell/dict-fullstack@3.2.0': {} + + '@cspell/dict-gaming-terms@1.0.5': {} + + '@cspell/dict-git@3.0.0': {} + + '@cspell/dict-golang@6.0.13': {} + + '@cspell/dict-google@1.0.1': {} + + '@cspell/dict-haskell@4.0.1': {} + + '@cspell/dict-html-symbol-entities@4.0.0': {} + + '@cspell/dict-html@4.0.5': {} + + '@cspell/dict-java@5.0.7': {} + + '@cspell/dict-julia@1.0.1': {} + + '@cspell/dict-k8s@1.0.6': {} + + '@cspell/dict-latex@4.0.0': {} + + '@cspell/dict-lorem-ipsum@4.0.0': {} + + '@cspell/dict-lua@4.0.3': {} + + '@cspell/dict-makefile@1.0.0': {} + + '@cspell/dict-monkeyc@1.0.6': {} + + '@cspell/dict-node@5.0.1': {} + + '@cspell/dict-npm@5.1.5': {} + + '@cspell/dict-php@4.0.10': {} + + '@cspell/dict-powershell@5.0.10': {} + + '@cspell/dict-public-licenses@2.0.8': {} + + '@cspell/dict-python@4.2.8': + dependencies: + '@cspell/dict-data-science': 2.0.2 + + '@cspell/dict-r@2.0.1': {} + + '@cspell/dict-ruby@5.0.4': {} + + '@cspell/dict-rust@4.0.6': {} + + '@cspell/dict-scala@5.0.3': {} + + '@cspell/dict-software-terms@4.1.7': {} + + '@cspell/dict-sql@2.1.5': {} + + '@cspell/dict-svelte@1.0.2': {} + + '@cspell/dict-swift@2.0.1': {} + + '@cspell/dict-terraform@1.0.2': {} + + '@cspell/dict-typescript@3.1.6': {} + + '@cspell/dict-vue@3.0.0': {} + + '@cspell/dynamic-import@8.14.2': + dependencies: + import-meta-resolve: 4.1.0 + + '@cspell/filetypes@8.14.2': {} + + '@cspell/strong-weak-map@8.14.2': {} + + '@cspell/url@8.14.2': {} + + '@cspotcode/source-map-support@0.8.1': + dependencies: + '@jridgewell/trace-mapping': 0.3.9 + + '@css-render/plugin-bem@0.15.14(css-render@0.15.14)': + dependencies: + css-render: 0.15.14 + + '@css-render/vue3-ssr@0.15.14(vue@3.4.35(typescript@5.6.3))': + dependencies: + vue: 3.4.35(typescript@5.6.3) + + '@csstools/cascade-layer-name-parser@2.0.1(@csstools/css-parser-algorithms@3.0.1(@csstools/css-tokenizer@3.0.1))(@csstools/css-tokenizer@3.0.1)': + dependencies: + '@csstools/css-parser-algorithms': 3.0.1(@csstools/css-tokenizer@3.0.1) + '@csstools/css-tokenizer': 3.0.1 + + '@csstools/color-helpers@5.0.1': {} + + '@csstools/css-calc@2.0.1(@csstools/css-parser-algorithms@3.0.1(@csstools/css-tokenizer@3.0.1))(@csstools/css-tokenizer@3.0.1)': + dependencies: + '@csstools/css-parser-algorithms': 3.0.1(@csstools/css-tokenizer@3.0.1) + '@csstools/css-tokenizer': 3.0.1 + + '@csstools/css-calc@2.1.0(@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3))(@csstools/css-tokenizer@3.0.3)': + dependencies: + '@csstools/css-parser-algorithms': 3.0.4(@csstools/css-tokenizer@3.0.3) + '@csstools/css-tokenizer': 3.0.3 + + '@csstools/css-color-parser@3.0.2(@csstools/css-parser-algorithms@3.0.1(@csstools/css-tokenizer@3.0.1))(@csstools/css-tokenizer@3.0.1)': + dependencies: + '@csstools/color-helpers': 5.0.1 + '@csstools/css-calc': 2.0.1(@csstools/css-parser-algorithms@3.0.1(@csstools/css-tokenizer@3.0.1))(@csstools/css-tokenizer@3.0.1) + '@csstools/css-parser-algorithms': 3.0.1(@csstools/css-tokenizer@3.0.1) + '@csstools/css-tokenizer': 3.0.1 + + '@csstools/css-color-parser@3.0.6(@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3))(@csstools/css-tokenizer@3.0.3)': + dependencies: + '@csstools/color-helpers': 5.0.1 + '@csstools/css-calc': 2.1.0(@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3))(@csstools/css-tokenizer@3.0.3) + '@csstools/css-parser-algorithms': 3.0.4(@csstools/css-tokenizer@3.0.3) + '@csstools/css-tokenizer': 3.0.3 + + '@csstools/css-parser-algorithms@3.0.1(@csstools/css-tokenizer@3.0.1)': + dependencies: + '@csstools/css-tokenizer': 3.0.1 + + '@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3)': + dependencies: + '@csstools/css-tokenizer': 3.0.3 + + '@csstools/css-tokenizer@3.0.1': {} + + '@csstools/css-tokenizer@3.0.3': {} + + '@csstools/media-query-list-parser@3.0.1(@csstools/css-parser-algorithms@3.0.1(@csstools/css-tokenizer@3.0.1))(@csstools/css-tokenizer@3.0.1)': + dependencies: + '@csstools/css-parser-algorithms': 3.0.1(@csstools/css-tokenizer@3.0.1) + '@csstools/css-tokenizer': 3.0.1 + + '@csstools/postcss-cascade-layers@4.0.6(postcss@8.4.39)': + dependencies: + '@csstools/selector-specificity': 3.1.1(postcss-selector-parser@6.1.0) + postcss: 8.4.39 + postcss-selector-parser: 6.1.0 + + '@csstools/postcss-cascade-layers@5.0.0(postcss@8.4.47)': + dependencies: + '@csstools/selector-specificity': 4.0.0(postcss-selector-parser@6.1.0) + postcss: 8.4.47 + postcss-selector-parser: 6.1.0 + + '@csstools/postcss-color-function@4.0.2(postcss@8.4.47)': + dependencies: + '@csstools/css-color-parser': 3.0.2(@csstools/css-parser-algorithms@3.0.1(@csstools/css-tokenizer@3.0.1))(@csstools/css-tokenizer@3.0.1) + '@csstools/css-parser-algorithms': 3.0.1(@csstools/css-tokenizer@3.0.1) + '@csstools/css-tokenizer': 3.0.1 + '@csstools/postcss-progressive-custom-properties': 4.0.0(postcss@8.4.47) + '@csstools/utilities': 2.0.0(postcss@8.4.47) + postcss: 8.4.47 + + '@csstools/postcss-color-mix-function@3.0.2(postcss@8.4.47)': + dependencies: + '@csstools/css-color-parser': 3.0.2(@csstools/css-parser-algorithms@3.0.1(@csstools/css-tokenizer@3.0.1))(@csstools/css-tokenizer@3.0.1) + '@csstools/css-parser-algorithms': 3.0.1(@csstools/css-tokenizer@3.0.1) + '@csstools/css-tokenizer': 3.0.1 + '@csstools/postcss-progressive-custom-properties': 4.0.0(postcss@8.4.47) + '@csstools/utilities': 2.0.0(postcss@8.4.47) + postcss: 8.4.47 + + '@csstools/postcss-content-alt-text@2.0.1(postcss@8.4.47)': + dependencies: + '@csstools/css-parser-algorithms': 3.0.1(@csstools/css-tokenizer@3.0.1) + '@csstools/css-tokenizer': 3.0.1 + '@csstools/postcss-progressive-custom-properties': 4.0.0(postcss@8.4.47) + '@csstools/utilities': 2.0.0(postcss@8.4.47) + postcss: 8.4.47 + + '@csstools/postcss-exponential-functions@2.0.1(postcss@8.4.47)': + dependencies: + '@csstools/css-calc': 2.0.1(@csstools/css-parser-algorithms@3.0.1(@csstools/css-tokenizer@3.0.1))(@csstools/css-tokenizer@3.0.1) + '@csstools/css-parser-algorithms': 3.0.1(@csstools/css-tokenizer@3.0.1) + '@csstools/css-tokenizer': 3.0.1 + postcss: 8.4.47 + + '@csstools/postcss-font-format-keywords@4.0.0(postcss@8.4.47)': + dependencies: + '@csstools/utilities': 2.0.0(postcss@8.4.47) + postcss: 8.4.47 + postcss-value-parser: 4.2.0 + + '@csstools/postcss-gamut-mapping@2.0.2(postcss@8.4.47)': + dependencies: + '@csstools/css-color-parser': 3.0.2(@csstools/css-parser-algorithms@3.0.1(@csstools/css-tokenizer@3.0.1))(@csstools/css-tokenizer@3.0.1) + '@csstools/css-parser-algorithms': 3.0.1(@csstools/css-tokenizer@3.0.1) + '@csstools/css-tokenizer': 3.0.1 + postcss: 8.4.47 + + '@csstools/postcss-gradients-interpolation-method@5.0.2(postcss@8.4.47)': + dependencies: + '@csstools/css-color-parser': 3.0.2(@csstools/css-parser-algorithms@3.0.1(@csstools/css-tokenizer@3.0.1))(@csstools/css-tokenizer@3.0.1) + '@csstools/css-parser-algorithms': 3.0.1(@csstools/css-tokenizer@3.0.1) + '@csstools/css-tokenizer': 3.0.1 + '@csstools/postcss-progressive-custom-properties': 4.0.0(postcss@8.4.47) + '@csstools/utilities': 2.0.0(postcss@8.4.47) + postcss: 8.4.47 + + '@csstools/postcss-hwb-function@4.0.2(postcss@8.4.47)': + dependencies: + '@csstools/css-color-parser': 3.0.2(@csstools/css-parser-algorithms@3.0.1(@csstools/css-tokenizer@3.0.1))(@csstools/css-tokenizer@3.0.1) + '@csstools/css-parser-algorithms': 3.0.1(@csstools/css-tokenizer@3.0.1) + '@csstools/css-tokenizer': 3.0.1 + '@csstools/postcss-progressive-custom-properties': 4.0.0(postcss@8.4.47) + '@csstools/utilities': 2.0.0(postcss@8.4.47) + postcss: 8.4.47 + + '@csstools/postcss-ic-unit@4.0.0(postcss@8.4.47)': + dependencies: + '@csstools/postcss-progressive-custom-properties': 4.0.0(postcss@8.4.47) + '@csstools/utilities': 2.0.0(postcss@8.4.47) + postcss: 8.4.47 + postcss-value-parser: 4.2.0 + + '@csstools/postcss-initial@2.0.0(postcss@8.4.47)': + dependencies: + postcss: 8.4.47 + + '@csstools/postcss-is-pseudo-class@5.0.0(postcss@8.4.47)': + dependencies: + '@csstools/selector-specificity': 4.0.0(postcss-selector-parser@6.1.0) + postcss: 8.4.47 + postcss-selector-parser: 6.1.0 + + '@csstools/postcss-light-dark-function@2.0.4(postcss@8.4.47)': + dependencies: + '@csstools/css-parser-algorithms': 3.0.1(@csstools/css-tokenizer@3.0.1) + '@csstools/css-tokenizer': 3.0.1 + '@csstools/postcss-progressive-custom-properties': 4.0.0(postcss@8.4.47) + '@csstools/utilities': 2.0.0(postcss@8.4.47) + postcss: 8.4.47 + + '@csstools/postcss-logical-float-and-clear@3.0.0(postcss@8.4.47)': + dependencies: + postcss: 8.4.47 + + '@csstools/postcss-logical-overflow@2.0.0(postcss@8.4.47)': + dependencies: + postcss: 8.4.47 - '@cspell/dict-django@4.1.0': {} + '@csstools/postcss-logical-overscroll-behavior@2.0.0(postcss@8.4.47)': + dependencies: + postcss: 8.4.47 - '@cspell/dict-docker@1.1.7': {} + '@csstools/postcss-logical-resize@3.0.0(postcss@8.4.47)': + dependencies: + postcss: 8.4.47 + postcss-value-parser: 4.2.0 - '@cspell/dict-dotnet@5.0.0': {} + '@csstools/postcss-logical-viewport-units@3.0.1(postcss@8.4.47)': + dependencies: + '@csstools/css-tokenizer': 3.0.1 + '@csstools/utilities': 2.0.0(postcss@8.4.47) + postcss: 8.4.47 - '@cspell/dict-elixir@4.0.3': {} + '@csstools/postcss-media-minmax@2.0.1(postcss@8.4.47)': + dependencies: + '@csstools/css-calc': 2.0.1(@csstools/css-parser-algorithms@3.0.1(@csstools/css-tokenizer@3.0.1))(@csstools/css-tokenizer@3.0.1) + '@csstools/css-parser-algorithms': 3.0.1(@csstools/css-tokenizer@3.0.1) + '@csstools/css-tokenizer': 3.0.1 + '@csstools/media-query-list-parser': 3.0.1(@csstools/css-parser-algorithms@3.0.1(@csstools/css-tokenizer@3.0.1))(@csstools/css-tokenizer@3.0.1) + postcss: 8.4.47 - '@cspell/dict-en-common-misspellings@1.0.2': {} + '@csstools/postcss-media-queries-aspect-ratio-number-values@3.0.1(postcss@8.4.47)': + dependencies: + '@csstools/css-parser-algorithms': 3.0.1(@csstools/css-tokenizer@3.0.1) + '@csstools/css-tokenizer': 3.0.1 + '@csstools/media-query-list-parser': 3.0.1(@csstools/css-parser-algorithms@3.0.1(@csstools/css-tokenizer@3.0.1))(@csstools/css-tokenizer@3.0.1) + postcss: 8.4.47 - '@cspell/dict-en-gb@1.1.33': {} + '@csstools/postcss-nested-calc@4.0.0(postcss@8.4.47)': + dependencies: + '@csstools/utilities': 2.0.0(postcss@8.4.47) + postcss: 8.4.47 + postcss-value-parser: 4.2.0 - '@cspell/dict-en_us@4.3.11': {} + '@csstools/postcss-normalize-display-values@4.0.0(postcss@8.4.47)': + dependencies: + postcss: 8.4.47 + postcss-value-parser: 4.2.0 - '@cspell/dict-filetypes@3.0.2': {} + '@csstools/postcss-oklab-function@4.0.2(postcss@8.4.47)': + dependencies: + '@csstools/css-color-parser': 3.0.2(@csstools/css-parser-algorithms@3.0.1(@csstools/css-tokenizer@3.0.1))(@csstools/css-tokenizer@3.0.1) + '@csstools/css-parser-algorithms': 3.0.1(@csstools/css-tokenizer@3.0.1) + '@csstools/css-tokenizer': 3.0.1 + '@csstools/postcss-progressive-custom-properties': 4.0.0(postcss@8.4.47) + '@csstools/utilities': 2.0.0(postcss@8.4.47) + postcss: 8.4.47 - '@cspell/dict-fonts@3.0.2': {} + '@csstools/postcss-progressive-custom-properties@4.0.0(postcss@8.4.47)': + dependencies: + postcss: 8.4.47 + postcss-value-parser: 4.2.0 - '@cspell/dict-fullstack@3.1.5': {} + '@csstools/postcss-relative-color-syntax@3.0.2(postcss@8.4.47)': + dependencies: + '@csstools/css-color-parser': 3.0.2(@csstools/css-parser-algorithms@3.0.1(@csstools/css-tokenizer@3.0.1))(@csstools/css-tokenizer@3.0.1) + '@csstools/css-parser-algorithms': 3.0.1(@csstools/css-tokenizer@3.0.1) + '@csstools/css-tokenizer': 3.0.1 + '@csstools/postcss-progressive-custom-properties': 4.0.0(postcss@8.4.47) + '@csstools/utilities': 2.0.0(postcss@8.4.47) + postcss: 8.4.47 - '@cspell/dict-gaming-terms@1.0.4': {} + '@csstools/postcss-scope-pseudo-class@4.0.0(postcss@8.4.47)': + dependencies: + postcss: 8.4.47 + postcss-selector-parser: 6.1.0 - '@cspell/dict-git@2.0.0': {} + '@csstools/postcss-stepped-value-functions@4.0.1(postcss@8.4.47)': + dependencies: + '@csstools/css-calc': 2.0.1(@csstools/css-parser-algorithms@3.0.1(@csstools/css-tokenizer@3.0.1))(@csstools/css-tokenizer@3.0.1) + '@csstools/css-parser-algorithms': 3.0.1(@csstools/css-tokenizer@3.0.1) + '@csstools/css-tokenizer': 3.0.1 + postcss: 8.4.47 - '@cspell/dict-golang@6.0.4': {} + '@csstools/postcss-text-decoration-shorthand@4.0.1(postcss@8.4.47)': + dependencies: + '@csstools/color-helpers': 5.0.1 + postcss: 8.4.47 + postcss-value-parser: 4.2.0 - '@cspell/dict-haskell@4.0.1': {} + '@csstools/postcss-trigonometric-functions@4.0.1(postcss@8.4.47)': + dependencies: + '@csstools/css-calc': 2.0.1(@csstools/css-parser-algorithms@3.0.1(@csstools/css-tokenizer@3.0.1))(@csstools/css-tokenizer@3.0.1) + '@csstools/css-parser-algorithms': 3.0.1(@csstools/css-tokenizer@3.0.1) + '@csstools/css-tokenizer': 3.0.1 + postcss: 8.4.47 - '@cspell/dict-html-symbol-entities@4.0.0': {} + '@csstools/postcss-unset-value@4.0.0(postcss@8.4.47)': + dependencies: + postcss: 8.4.47 - '@cspell/dict-html@4.0.5': {} + '@csstools/selector-resolve-nested@2.0.0(postcss-selector-parser@6.1.0)': + dependencies: + postcss-selector-parser: 6.1.0 - '@cspell/dict-java@5.0.6': {} + '@csstools/selector-specificity@3.1.1(postcss-selector-parser@6.1.0)': + dependencies: + postcss-selector-parser: 6.1.0 - '@cspell/dict-k8s@1.0.2': {} + '@csstools/selector-specificity@4.0.0(postcss-selector-parser@6.1.0)': + dependencies: + postcss-selector-parser: 6.1.0 - '@cspell/dict-latex@4.0.0': {} + '@csstools/utilities@2.0.0(postcss@8.4.47)': + dependencies: + postcss: 8.4.47 - '@cspell/dict-lorem-ipsum@3.0.0': {} + '@ctrl/tinycolor@3.6.1': {} - '@cspell/dict-lua@4.0.2': {} + '@develar/schema-utils@2.6.5': + dependencies: + ajv: 6.12.6 + ajv-keywords: 3.5.2(ajv@6.12.6) - '@cspell/dict-node@4.0.3': {} + '@discoveryjs/json-ext@0.5.7': {} - '@cspell/dict-npm@5.0.12': {} + '@dnd-kit/accessibility@3.1.1(react@18.2.0)': + dependencies: + react: 18.2.0 + tslib: 2.8.1 - '@cspell/dict-php@4.0.4': {} + '@dnd-kit/core@6.3.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': + dependencies: + '@dnd-kit/accessibility': 3.1.1(react@18.2.0) + '@dnd-kit/utilities': 3.2.2(react@18.2.0) + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + tslib: 2.8.1 - '@cspell/dict-powershell@5.0.2': {} + '@dnd-kit/modifiers@6.0.1(@dnd-kit/core@6.3.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react@18.2.0)': + dependencies: + '@dnd-kit/core': 6.3.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@dnd-kit/utilities': 3.2.2(react@18.2.0) + react: 18.2.0 + tslib: 2.8.1 - '@cspell/dict-public-licenses@2.0.5': {} + '@dnd-kit/sortable@7.0.2(@dnd-kit/core@6.3.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react@18.2.0)': + dependencies: + '@dnd-kit/core': 6.3.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@dnd-kit/utilities': 3.2.2(react@18.2.0) + react: 18.2.0 + tslib: 2.8.1 - '@cspell/dict-python@4.1.10': + '@dnd-kit/utilities@3.2.2(react@18.2.0)': dependencies: - '@cspell/dict-data-science': 1.0.11 + react: 18.2.0 + tslib: 2.8.1 - '@cspell/dict-r@2.0.1': {} + '@docsearch/css@3.6.2': {} - '@cspell/dict-ruby@5.0.1': {} + '@docsearch/react@3.6.2(@algolia/client-search@4.24.0)(@types/react@18.2.35)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': + dependencies: + '@algolia/autocomplete-core': 1.9.3(@algolia/client-search@4.24.0)(algoliasearch@4.24.0) + '@algolia/autocomplete-preset-algolia': 1.9.3(@algolia/client-search@4.24.0)(algoliasearch@4.24.0) + '@docsearch/css': 3.6.2 + algoliasearch: 4.24.0 + optionalDependencies: + '@types/react': 18.2.35 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + transitivePeerDependencies: + - '@algolia/client-search' - '@cspell/dict-rust@4.0.1': {} + '@docusaurus/core@3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3)))': + dependencies: + '@babel/core': 7.25.2 + '@babel/generator': 7.25.0 + '@babel/plugin-syntax-dynamic-import': 7.8.3(@babel/core@7.25.2) + '@babel/plugin-transform-runtime': 7.23.2(@babel/core@7.25.2) + '@babel/preset-env': 7.25.7(@babel/core@7.25.2) + '@babel/preset-react': 7.25.7(@babel/core@7.25.2) + '@babel/preset-typescript': 7.24.7(@babel/core@7.25.2) + '@babel/runtime': 7.25.0 + '@babel/runtime-corejs3': 7.25.7 + '@babel/traverse': 7.25.3 + '@docusaurus/cssnano-preset': 3.5.2 + '@docusaurus/logger': 3.5.2 + '@docusaurus/mdx-loader': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3) + '@docusaurus/utils': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(typescript@5.6.3) + '@docusaurus/utils-common': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)) + '@docusaurus/utils-validation': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(typescript@5.6.3) + '@mdx-js/react': 3.0.1(@types/react@18.2.35)(react@18.2.0) + autoprefixer: 10.4.16(postcss@8.4.47) + babel-loader: 9.2.1(@babel/core@7.25.2)(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))) + babel-plugin-dynamic-import-node: 2.3.3 + boxen: 6.2.1 + chalk: 4.1.2 + chokidar: 3.6.0 + clean-css: 5.3.3 + cli-table3: 0.6.5 + combine-promises: 1.2.0 + commander: 5.1.0 + copy-webpack-plugin: 11.0.0(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))) + core-js: 3.37.1 + css-loader: 6.11.0(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))) + css-minimizer-webpack-plugin: 5.0.1(clean-css@5.3.3)(lightningcss@1.28.2)(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))) + cssnano: 6.1.2(postcss@8.4.47) + del: 6.1.1 + detect-port: 1.6.1 + escape-html: 1.0.3 + eta: 2.2.0 + eval: 0.1.8 + file-loader: 6.2.0(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))) + fs-extra: 11.2.0 + html-minifier-terser: 7.2.0 + html-tags: 3.3.1 + html-webpack-plugin: 5.6.0(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))) + leven: 3.1.0 + lodash: 4.17.21 + mini-css-extract-plugin: 2.9.1(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))) + p-map: 4.0.0 + postcss: 8.4.47 + postcss-loader: 7.3.4(postcss@8.4.47)(typescript@5.6.3)(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))) + prompts: 2.4.2 + react: 18.2.0 + react-dev-utils: 12.0.1(eslint@8.57.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3)))(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))) + react-dom: 18.2.0(react@18.2.0) + react-helmet-async: 1.3.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + react-loadable: '@docusaurus/react-loadable@6.0.0(react@18.2.0)' + react-loadable-ssr-addon-v5-slorber: 1.0.1(@docusaurus/react-loadable@6.0.0(react@18.2.0))(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))) + react-router: 5.3.4(react@18.2.0) + react-router-config: 5.1.1(react-router@5.3.4(react@18.2.0))(react@18.2.0) + react-router-dom: 5.3.4(react@18.2.0) + rtl-detect: 1.1.2 + semver: 7.5.4 + serve-handler: 6.1.5 + shelljs: 0.8.5 + terser-webpack-plugin: 5.3.10(@swc/core@1.7.26(@swc/helpers@0.5.3))(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))) + tslib: 2.6.3 + update-notifier: 6.0.2 + url-loader: 4.1.1(file-loader@6.2.0(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))))(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))) + webpack: 5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3)) + webpack-bundle-analyzer: 4.10.2(bufferutil@4.0.8) + webpack-dev-server: 4.15.2(bufferutil@4.0.8)(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))) + webpack-merge: 5.10.0 + webpackbar: 5.0.2(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))) + transitivePeerDependencies: + - '@docusaurus/types' + - '@parcel/css' + - '@rspack/core' + - '@swc/core' + - '@swc/css' + - bufferutil + - csso + - debug + - esbuild + - eslint + - lightningcss + - supports-color + - typescript + - uglify-js + - utf-8-validate + - vue-template-compiler + - webpack-cli - '@cspell/dict-scala@5.0.0': {} + '@docusaurus/cssnano-preset@3.5.2': + dependencies: + cssnano-preset-advanced: 6.1.2(postcss@8.4.47) + postcss: 8.4.47 + postcss-sort-media-queries: 5.2.0(postcss@8.4.47) + tslib: 2.6.3 - '@cspell/dict-software-terms@3.3.9': {} + '@docusaurus/logger@3.5.2': + dependencies: + chalk: 4.1.2 + tslib: 2.6.3 - '@cspell/dict-sql@2.1.2': {} + '@docusaurus/lqip-loader@3.5.2(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3)))': + dependencies: + '@docusaurus/logger': 3.5.2 + file-loader: 6.2.0(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))) + lodash: 4.17.21 + sharp: 0.32.6 + tslib: 2.6.3 + transitivePeerDependencies: + - webpack - '@cspell/dict-svelte@1.0.2': {} + '@docusaurus/mdx-loader@3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)': + dependencies: + '@docusaurus/logger': 3.5.2 + '@docusaurus/utils': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(typescript@5.6.3) + '@docusaurus/utils-validation': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(typescript@5.6.3) + '@mdx-js/mdx': 3.0.1 + '@slorber/remark-comment': 1.0.0 + escape-html: 1.0.3 + estree-util-value-to-estree: 3.1.2 + file-loader: 6.2.0(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))) + fs-extra: 11.2.0 + image-size: 1.1.1 + mdast-util-mdx: 3.0.0 + mdast-util-to-string: 4.0.0 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + rehype-raw: 7.0.0 + remark-directive: 3.0.0 + remark-emoji: 4.0.1 + remark-frontmatter: 5.0.0 + remark-gfm: 4.0.0 + stringify-object: 3.3.0 + tslib: 2.6.3 + unified: 11.0.5 + unist-util-visit: 5.0.0 + url-loader: 4.1.1(file-loader@6.2.0(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))))(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))) + vfile: 6.0.3 + webpack: 5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3)) + transitivePeerDependencies: + - '@docusaurus/types' + - '@swc/core' + - esbuild + - supports-color + - typescript + - uglify-js + - webpack-cli - '@cspell/dict-swift@2.0.1': {} + '@docusaurus/module-type-aliases@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': + dependencies: + '@docusaurus/types': 3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@types/history': 4.7.11 + '@types/react': 18.2.35 + '@types/react-router-config': 5.0.11 + '@types/react-router-dom': 5.3.3 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + react-helmet-async: 2.0.5(react@18.2.0) + react-loadable: '@docusaurus/react-loadable@6.0.0(react@18.2.0)' + transitivePeerDependencies: + - '@swc/core' + - esbuild + - supports-color + - uglify-js + - webpack-cli - '@cspell/dict-typescript@3.1.2': {} + '@docusaurus/plugin-content-blog@3.5.2(@docusaurus/plugin-content-docs@3.5.2(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))))(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3)))': + dependencies: + '@docusaurus/core': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@docusaurus/logger': 3.5.2 + '@docusaurus/mdx-loader': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3) + '@docusaurus/plugin-content-docs': 3.5.2(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@docusaurus/theme-common': 3.5.2(@docusaurus/plugin-content-docs@3.5.2(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))))(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3) + '@docusaurus/types': 3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@docusaurus/utils': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(typescript@5.6.3) + '@docusaurus/utils-common': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)) + '@docusaurus/utils-validation': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(typescript@5.6.3) + cheerio: 1.0.0-rc.12 + feed: 4.2.2 + fs-extra: 11.2.0 + lodash: 4.17.21 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + reading-time: 1.5.0 + srcset: 4.0.0 + tslib: 2.6.3 + unist-util-visit: 5.0.0 + utility-types: 3.11.0 + webpack: 5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3)) + transitivePeerDependencies: + - '@mdx-js/react' + - '@parcel/css' + - '@rspack/core' + - '@swc/core' + - '@swc/css' + - bufferutil + - csso + - debug + - esbuild + - eslint + - lightningcss + - supports-color + - typescript + - uglify-js + - utf-8-validate + - vue-template-compiler + - webpack-cli - '@cspell/dict-vue@3.0.0': {} + '@docusaurus/plugin-content-docs@3.5.2(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3)))': + dependencies: + '@docusaurus/core': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@docusaurus/logger': 3.5.2 + '@docusaurus/mdx-loader': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3) + '@docusaurus/module-type-aliases': 3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@docusaurus/theme-common': 3.5.2(@docusaurus/plugin-content-docs@3.5.2(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))))(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3) + '@docusaurus/types': 3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@docusaurus/utils': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(typescript@5.6.3) + '@docusaurus/utils-common': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)) + '@docusaurus/utils-validation': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(typescript@5.6.3) + '@types/react-router-config': 5.0.11 + combine-promises: 1.2.0 + fs-extra: 11.2.0 + js-yaml: 4.1.0 + lodash: 4.17.21 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + tslib: 2.6.3 + utility-types: 3.11.0 + webpack: 5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3)) + transitivePeerDependencies: + - '@mdx-js/react' + - '@parcel/css' + - '@rspack/core' + - '@swc/core' + - '@swc/css' + - bufferutil + - csso + - debug + - esbuild + - eslint + - lightningcss + - supports-color + - typescript + - uglify-js + - utf-8-validate + - vue-template-compiler + - webpack-cli - '@cspell/dynamic-import@6.31.3': + '@docusaurus/plugin-content-pages@3.5.2(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3)))': dependencies: - import-meta-resolve: 2.2.2 + '@docusaurus/core': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@docusaurus/mdx-loader': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3) + '@docusaurus/types': 3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@docusaurus/utils': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(typescript@5.6.3) + '@docusaurus/utils-validation': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(typescript@5.6.3) + fs-extra: 11.2.0 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + tslib: 2.6.3 + webpack: 5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3)) + transitivePeerDependencies: + - '@mdx-js/react' + - '@parcel/css' + - '@rspack/core' + - '@swc/core' + - '@swc/css' + - bufferutil + - csso + - debug + - esbuild + - eslint + - lightningcss + - supports-color + - typescript + - uglify-js + - utf-8-validate + - vue-template-compiler + - webpack-cli - '@cspell/strong-weak-map@6.31.3': {} + '@docusaurus/plugin-debug@3.5.2(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3)))': + dependencies: + '@docusaurus/core': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@docusaurus/types': 3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@docusaurus/utils': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(typescript@5.6.3) + fs-extra: 11.2.0 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + react-json-view-lite: 1.5.0(react@18.2.0) + tslib: 2.6.3 + transitivePeerDependencies: + - '@mdx-js/react' + - '@parcel/css' + - '@rspack/core' + - '@swc/core' + - '@swc/css' + - bufferutil + - csso + - debug + - esbuild + - eslint + - lightningcss + - supports-color + - typescript + - uglify-js + - utf-8-validate + - vue-template-compiler + - webpack-cli - '@cspotcode/source-map-support@0.8.1': + '@docusaurus/plugin-google-analytics@3.5.2(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3)))': dependencies: - '@jridgewell/trace-mapping': 0.3.9 + '@docusaurus/core': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@docusaurus/types': 3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@docusaurus/utils-validation': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(typescript@5.6.3) + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + tslib: 2.6.3 + transitivePeerDependencies: + - '@mdx-js/react' + - '@parcel/css' + - '@rspack/core' + - '@swc/core' + - '@swc/css' + - bufferutil + - csso + - debug + - esbuild + - eslint + - lightningcss + - supports-color + - typescript + - uglify-js + - utf-8-validate + - vue-template-compiler + - webpack-cli - '@css-render/plugin-bem@0.15.14(css-render@0.15.14)': + '@docusaurus/plugin-google-gtag@3.5.2(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3)))': dependencies: - css-render: 0.15.14 + '@docusaurus/core': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@docusaurus/types': 3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@docusaurus/utils-validation': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(typescript@5.6.3) + '@types/gtag.js': 0.0.12 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + tslib: 2.6.3 + transitivePeerDependencies: + - '@mdx-js/react' + - '@parcel/css' + - '@rspack/core' + - '@swc/core' + - '@swc/css' + - bufferutil + - csso + - debug + - esbuild + - eslint + - lightningcss + - supports-color + - typescript + - uglify-js + - utf-8-validate + - vue-template-compiler + - webpack-cli - '@css-render/vue3-ssr@0.15.14(vue@3.4.35(typescript@5.4.5))': + '@docusaurus/plugin-google-tag-manager@3.5.2(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3)))': dependencies: - vue: 3.4.35(typescript@5.4.5) + '@docusaurus/core': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@docusaurus/types': 3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@docusaurus/utils-validation': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(typescript@5.6.3) + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + tslib: 2.6.3 + transitivePeerDependencies: + - '@mdx-js/react' + - '@parcel/css' + - '@rspack/core' + - '@swc/core' + - '@swc/css' + - bufferutil + - csso + - debug + - esbuild + - eslint + - lightningcss + - supports-color + - typescript + - uglify-js + - utf-8-validate + - vue-template-compiler + - webpack-cli - '@csstools/postcss-cascade-layers@4.0.6(postcss@8.4.39)': + '@docusaurus/plugin-ideal-image@3.5.2(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(prop-types@15.8.1)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3)))': dependencies: - '@csstools/selector-specificity': 3.1.1(postcss-selector-parser@6.1.0) - postcss: 8.4.39 - postcss-selector-parser: 6.1.0 + '@docusaurus/core': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@docusaurus/lqip-loader': 3.5.2(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))) + '@docusaurus/responsive-loader': 1.7.0(sharp@0.32.6) + '@docusaurus/theme-translations': 3.5.2 + '@docusaurus/types': 3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@docusaurus/utils-validation': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(typescript@5.6.3) + '@slorber/react-ideal-image': 0.0.12(prop-types@15.8.1)(react-waypoint@10.3.0(react@18.2.0))(react@18.2.0) + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + react-waypoint: 10.3.0(react@18.2.0) + sharp: 0.32.6 + tslib: 2.6.3 + webpack: 5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3)) + transitivePeerDependencies: + - '@mdx-js/react' + - '@parcel/css' + - '@rspack/core' + - '@swc/core' + - '@swc/css' + - bufferutil + - csso + - debug + - esbuild + - eslint + - lightningcss + - prop-types + - supports-color + - typescript + - uglify-js + - utf-8-validate + - vue-template-compiler + - webpack-cli - '@csstools/selector-specificity@3.1.1(postcss-selector-parser@6.1.0)': + '@docusaurus/plugin-sitemap@3.5.2(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3)))': dependencies: - postcss-selector-parser: 6.1.0 + '@docusaurus/core': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@docusaurus/logger': 3.5.2 + '@docusaurus/types': 3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@docusaurus/utils': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(typescript@5.6.3) + '@docusaurus/utils-common': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)) + '@docusaurus/utils-validation': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(typescript@5.6.3) + fs-extra: 11.2.0 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + sitemap: 7.1.2 + tslib: 2.6.3 + transitivePeerDependencies: + - '@mdx-js/react' + - '@parcel/css' + - '@rspack/core' + - '@swc/core' + - '@swc/css' + - bufferutil + - csso + - debug + - esbuild + - eslint + - lightningcss + - supports-color + - typescript + - uglify-js + - utf-8-validate + - vue-template-compiler + - webpack-cli - '@ctrl/tinycolor@3.6.1': {} + '@docusaurus/preset-classic@3.5.2(@algolia/client-search@4.24.0)(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/react@18.2.35)(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3)))': + dependencies: + '@docusaurus/core': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@docusaurus/plugin-content-blog': 3.5.2(@docusaurus/plugin-content-docs@3.5.2(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))))(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@docusaurus/plugin-content-docs': 3.5.2(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@docusaurus/plugin-content-pages': 3.5.2(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@docusaurus/plugin-debug': 3.5.2(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@docusaurus/plugin-google-analytics': 3.5.2(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@docusaurus/plugin-google-gtag': 3.5.2(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@docusaurus/plugin-google-tag-manager': 3.5.2(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@docusaurus/plugin-sitemap': 3.5.2(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@docusaurus/theme-classic': 3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/react@18.2.35)(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@docusaurus/theme-common': 3.5.2(@docusaurus/plugin-content-docs@3.5.2(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))))(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3) + '@docusaurus/theme-search-algolia': 3.5.2(@algolia/client-search@4.24.0)(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/react@18.2.35)(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@docusaurus/types': 3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + transitivePeerDependencies: + - '@algolia/client-search' + - '@mdx-js/react' + - '@parcel/css' + - '@rspack/core' + - '@swc/core' + - '@swc/css' + - '@types/react' + - bufferutil + - csso + - debug + - esbuild + - eslint + - lightningcss + - search-insights + - supports-color + - typescript + - uglify-js + - utf-8-validate + - vue-template-compiler + - webpack-cli - '@develar/schema-utils@2.6.5': + '@docusaurus/react-loadable@6.0.0(react@18.2.0)': dependencies: - ajv: 6.12.6 - ajv-keywords: 3.5.2(ajv@6.12.6) + '@types/react': 18.2.35 + react: 18.2.0 - '@dnd-kit/accessibility@3.1.0(react@18.2.0)': + '@docusaurus/responsive-loader@1.7.0(sharp@0.32.6)': dependencies: + loader-utils: 2.0.4 + optionalDependencies: + sharp: 0.32.6 + + '@docusaurus/theme-classic@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/react@18.2.35)(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3)))': + dependencies: + '@docusaurus/core': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@docusaurus/mdx-loader': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3) + '@docusaurus/module-type-aliases': 3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@docusaurus/plugin-content-blog': 3.5.2(@docusaurus/plugin-content-docs@3.5.2(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))))(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@docusaurus/plugin-content-docs': 3.5.2(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@docusaurus/plugin-content-pages': 3.5.2(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@docusaurus/theme-common': 3.5.2(@docusaurus/plugin-content-docs@3.5.2(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))))(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3) + '@docusaurus/theme-translations': 3.5.2 + '@docusaurus/types': 3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@docusaurus/utils': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(typescript@5.6.3) + '@docusaurus/utils-common': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)) + '@docusaurus/utils-validation': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(typescript@5.6.3) + '@mdx-js/react': 3.0.1(@types/react@18.2.35)(react@18.2.0) + clsx: 2.1.1 + copy-text-to-clipboard: 3.2.0 + infima: 0.2.0-alpha.44 + lodash: 4.17.21 + nprogress: 0.2.0 + postcss: 8.4.47 + prism-react-renderer: 2.4.0(react@18.2.0) + prismjs: 1.29.0 react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + react-router-dom: 5.3.4(react@18.2.0) + rtlcss: 4.3.0 tslib: 2.6.3 + utility-types: 3.11.0 + transitivePeerDependencies: + - '@parcel/css' + - '@rspack/core' + - '@swc/core' + - '@swc/css' + - '@types/react' + - bufferutil + - csso + - debug + - esbuild + - eslint + - lightningcss + - supports-color + - typescript + - uglify-js + - utf-8-validate + - vue-template-compiler + - webpack-cli - '@dnd-kit/core@6.1.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': + '@docusaurus/theme-common@3.5.2(@docusaurus/plugin-content-docs@3.5.2(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))))(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)': dependencies: - '@dnd-kit/accessibility': 3.1.0(react@18.2.0) - '@dnd-kit/utilities': 3.2.2(react@18.2.0) + '@docusaurus/mdx-loader': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3) + '@docusaurus/module-type-aliases': 3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@docusaurus/plugin-content-docs': 3.5.2(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@docusaurus/utils': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(typescript@5.6.3) + '@docusaurus/utils-common': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)) + '@types/history': 4.7.11 + '@types/react': 18.2.35 + '@types/react-router-config': 5.0.11 + clsx: 2.1.1 + parse-numeric-range: 1.3.0 + prism-react-renderer: 2.4.0(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) tslib: 2.6.3 + utility-types: 3.11.0 + transitivePeerDependencies: + - '@docusaurus/types' + - '@swc/core' + - esbuild + - supports-color + - typescript + - uglify-js + - webpack-cli - '@dnd-kit/modifiers@6.0.1(@dnd-kit/core@6.1.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react@18.2.0)': - dependencies: - '@dnd-kit/core': 6.1.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - '@dnd-kit/utilities': 3.2.2(react@18.2.0) + '@docusaurus/theme-search-algolia@3.5.2(@algolia/client-search@4.24.0)(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/react@18.2.35)(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3)))': + dependencies: + '@docsearch/react': 3.6.2(@algolia/client-search@4.24.0)(@types/react@18.2.35)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@docusaurus/core': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@docusaurus/logger': 3.5.2 + '@docusaurus/plugin-content-docs': 3.5.2(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + '@docusaurus/theme-common': 3.5.2(@docusaurus/plugin-content-docs@3.5.2(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))))(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3) + '@docusaurus/theme-translations': 3.5.2 + '@docusaurus/utils': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(typescript@5.6.3) + '@docusaurus/utils-validation': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(typescript@5.6.3) + algoliasearch: 4.24.0 + algoliasearch-helper: 3.22.5(algoliasearch@4.24.0) + clsx: 2.1.1 + eta: 2.2.0 + fs-extra: 11.2.0 + lodash: 4.17.21 react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) tslib: 2.6.3 + utility-types: 3.11.0 + transitivePeerDependencies: + - '@algolia/client-search' + - '@docusaurus/types' + - '@mdx-js/react' + - '@parcel/css' + - '@rspack/core' + - '@swc/core' + - '@swc/css' + - '@types/react' + - bufferutil + - csso + - debug + - esbuild + - eslint + - lightningcss + - search-insights + - supports-color + - typescript + - uglify-js + - utf-8-validate + - vue-template-compiler + - webpack-cli - '@dnd-kit/sortable@7.0.2(@dnd-kit/core@6.1.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react@18.2.0)': + '@docusaurus/theme-translations@3.5.2': dependencies: - '@dnd-kit/core': 6.1.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - '@dnd-kit/utilities': 3.2.2(react@18.2.0) - react: 18.2.0 + fs-extra: 11.2.0 tslib: 2.6.3 - '@dnd-kit/utilities@3.2.2(react@18.2.0)': + '@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': dependencies: + '@mdx-js/mdx': 3.0.1 + '@types/history': 4.7.11 + '@types/react': 18.2.35 + commander: 5.1.0 + joi: 17.13.3 react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + react-helmet-async: 1.3.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + utility-types: 3.11.0 + webpack: 5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3)) + webpack-merge: 5.10.0 + transitivePeerDependencies: + - '@swc/core' + - esbuild + - supports-color + - uglify-js + - webpack-cli + + '@docusaurus/utils-common@3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))': + dependencies: + tslib: 2.6.3 + optionalDependencies: + '@docusaurus/types': 3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + + '@docusaurus/utils-validation@3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(typescript@5.6.3)': + dependencies: + '@docusaurus/logger': 3.5.2 + '@docusaurus/utils': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(typescript@5.6.3) + '@docusaurus/utils-common': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)) + fs-extra: 11.2.0 + joi: 17.13.3 + js-yaml: 4.1.0 + lodash: 4.17.21 + tslib: 2.6.3 + transitivePeerDependencies: + - '@docusaurus/types' + - '@swc/core' + - esbuild + - supports-color + - typescript + - uglify-js + - webpack-cli + + '@docusaurus/utils@3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(typescript@5.6.3)': + dependencies: + '@docusaurus/logger': 3.5.2 + '@docusaurus/utils-common': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)) + '@svgr/webpack': 8.1.0(typescript@5.6.3) + escape-string-regexp: 4.0.0 + file-loader: 6.2.0(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))) + fs-extra: 11.2.0 + github-slugger: 1.5.0 + globby: 11.1.0 + gray-matter: 4.0.3 + jiti: 1.21.0 + js-yaml: 4.1.0 + lodash: 4.17.21 + micromatch: 4.0.5 + prompts: 2.4.2 + resolve-pathname: 3.0.0 + shelljs: 0.8.5 tslib: 2.6.3 + url-loader: 4.1.1(file-loader@6.2.0(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))))(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))) + utility-types: 3.11.0 + webpack: 5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3)) + optionalDependencies: + '@docusaurus/types': 3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + transitivePeerDependencies: + - '@swc/core' + - esbuild + - supports-color + - typescript + - uglify-js + - webpack-cli '@electron-forge/cli@7.4.0(encoding@0.1.13)': dependencies: @@ -18211,7 +24480,7 @@ snapshots: '@electron/get': 3.0.0 chalk: 4.1.2 commander: 4.1.1 - debug: 4.3.4 + debug: 4.3.7 fs-extra: 10.1.0 listr2: 7.0.2 semver: 7.5.4 @@ -18230,7 +24499,7 @@ snapshots: find-up: 5.0.0 fs-extra: 10.1.0 log-symbols: 4.1.0 - semver: 7.5.4 + semver: 7.6.3 yarn-or-npm: 3.0.1 transitivePeerDependencies: - bluebird @@ -18254,7 +24523,7 @@ snapshots: '@electron/rebuild': 3.6.0 '@malept/cross-spawn-promise': 2.0.0 chalk: 4.1.2 - debug: 4.3.4 + debug: 4.3.7 fast-glob: 3.3.2 filenamify: 4.3.0 find-up: 5.0.0 @@ -18268,7 +24537,7 @@ snapshots: progress: 2.0.3 rechoir: 0.8.0 resolve-package: 1.0.1 - semver: 7.5.4 + semver: 7.6.3 source-map-support: 0.5.21 sudo-prompt: 9.2.1 username: 5.1.0 @@ -18412,7 +24681,7 @@ snapshots: '@electron/get@2.0.3': dependencies: - debug: 4.3.4 + debug: 4.3.7 env-paths: 2.2.1 fs-extra: 8.1.0 got: 11.8.6 @@ -18426,7 +24695,7 @@ snapshots: '@electron/get@3.0.0': dependencies: - debug: 4.3.4 + debug: 4.3.7 env-paths: 2.2.1 fs-extra: 8.1.0 got: 11.8.6 @@ -18484,7 +24753,7 @@ snapshots: '@electron/osx-sign': 1.3.0 '@electron/universal': 2.0.1 '@electron/windows-sign': 1.1.2 - debug: 4.3.4 + debug: 4.3.7 extract-zip: 2.0.1 filenamify: 4.3.0 fs-extra: 11.2.0 @@ -18495,7 +24764,7 @@ snapshots: plist: 3.1.0 resedit: 2.0.2 resolve: 1.22.8 - semver: 7.5.4 + semver: 7.6.3 yargs-parser: 21.1.1 transitivePeerDependencies: - supports-color @@ -18504,7 +24773,7 @@ snapshots: dependencies: '@malept/cross-spawn-promise': 2.0.0 chalk: 4.1.2 - debug: 4.3.4 + debug: 4.3.7 detect-libc: 2.0.3 fs-extra: 10.1.0 got: 11.8.6 @@ -18513,7 +24782,7 @@ snapshots: node-gyp: 9.4.1 ora: 5.4.1 read-binary-file-arch: 1.0.6 - semver: 7.5.4 + semver: 7.6.3 tar: 6.2.1 yargs: 17.7.2 transitivePeerDependencies: @@ -18554,9 +24823,9 @@ snapshots: transitivePeerDependencies: - supports-color - '@element-plus/icons-vue@2.1.0(vue@3.3.7(typescript@5.4.5))': + '@element-plus/icons-vue@2.1.0(vue@3.3.7(typescript@5.6.3))': dependencies: - vue: 3.3.7(typescript@5.4.5) + vue: 3.3.7(typescript@5.6.3) '@emotion/babel-plugin@11.11.0': dependencies: @@ -18574,7 +24843,7 @@ snapshots: '@emotion/babel-plugin@11.12.0': dependencies: - '@babel/helper-module-imports': 7.24.7 + '@babel/helper-module-imports': 7.25.7 '@babel/runtime': 7.25.0 '@emotion/hash': 0.9.2 '@emotion/memoize': 0.9.0 @@ -18588,6 +24857,22 @@ snapshots: transitivePeerDependencies: - supports-color + '@emotion/babel-plugin@11.13.5': + dependencies: + '@babel/helper-module-imports': 7.25.9 + '@babel/runtime': 7.25.0 + '@emotion/hash': 0.9.2 + '@emotion/memoize': 0.9.0 + '@emotion/serialize': 1.3.3 + babel-plugin-macros: 3.1.0 + convert-source-map: 1.9.0 + escape-string-regexp: 4.0.0 + find-root: 1.1.0 + source-map: 0.5.7 + stylis: 4.2.0 + transitivePeerDependencies: + - supports-color + '@emotion/cache@11.11.0': dependencies: '@emotion/memoize': 0.8.1 @@ -18620,7 +24905,7 @@ snapshots: '@emotion/hash@0.9.2': {} - '@emotion/is-prop-valid@1.3.0': + '@emotion/is-prop-valid@1.3.1': dependencies: '@emotion/memoize': 0.9.0 @@ -18674,6 +24959,14 @@ snapshots: '@emotion/utils': 1.4.0 csstype: 3.1.3 + '@emotion/serialize@1.3.3': + dependencies: + '@emotion/hash': 0.9.2 + '@emotion/memoize': 0.9.0 + '@emotion/unitless': 0.10.0 + '@emotion/utils': 1.4.2 + csstype: 3.1.3 + '@emotion/server@11.11.0(@emotion/css@11.13.0)': dependencies: '@emotion/utils': 1.4.0 @@ -18687,21 +24980,23 @@ snapshots: '@emotion/sheet@1.4.0': {} - '@emotion/styled@11.13.0(@emotion/react@11.13.0(@types/react@18.2.35)(react@18.2.0))(@types/react@18.2.35)(react@18.2.0)': + '@emotion/styled@11.14.0(@emotion/react@11.13.0(@types/react@18.2.35)(react@18.2.0))(@types/react@18.2.35)(react@18.2.0)': dependencies: '@babel/runtime': 7.25.0 - '@emotion/babel-plugin': 11.12.0 - '@emotion/is-prop-valid': 1.3.0 + '@emotion/babel-plugin': 11.13.5 + '@emotion/is-prop-valid': 1.3.1 '@emotion/react': 11.13.0(@types/react@18.2.35)(react@18.2.0) - '@emotion/serialize': 1.3.0 - '@emotion/use-insertion-effect-with-fallbacks': 1.1.0(react@18.2.0) - '@emotion/utils': 1.4.0 + '@emotion/serialize': 1.3.3 + '@emotion/use-insertion-effect-with-fallbacks': 1.2.0(react@18.2.0) + '@emotion/utils': 1.4.2 react: 18.2.0 optionalDependencies: '@types/react': 18.2.35 transitivePeerDependencies: - supports-color + '@emotion/unitless@0.10.0': {} + '@emotion/unitless@0.7.5': {} '@emotion/unitless@0.8.1': {} @@ -18716,10 +25011,16 @@ snapshots: dependencies: react: 18.2.0 + '@emotion/use-insertion-effect-with-fallbacks@1.2.0(react@18.2.0)': + dependencies: + react: 18.2.0 + '@emotion/utils@1.2.1': {} '@emotion/utils@1.4.0': {} + '@emotion/utils@1.4.2': {} + '@emotion/weak-memoize@0.3.1': {} '@emotion/weak-memoize@0.4.0': {} @@ -18875,7 +25176,7 @@ snapshots: '@eslint/eslintrc@2.1.4': dependencies: ajv: 6.12.6 - debug: 4.3.4 + debug: 4.3.7 espree: 9.6.1 globals: 13.24.0 ignore: 5.2.4 @@ -18894,26 +25195,26 @@ snapshots: '@esri/calcite-colors@6.1.0': {} - '@esri/calcite-components@2.12.2(@floating-ui/utils@0.2.8)': + '@esri/calcite-components@2.13.0(@floating-ui/utils@0.2.8)': dependencies: - '@esri/calcite-ui-icons': 3.31.0 - '@floating-ui/dom': 1.6.10 + '@esri/calcite-ui-icons': 3.32.0 + '@floating-ui/dom': 1.6.11 '@stencil/core': 4.20.0 '@types/color': 3.0.6 - '@types/sortablejs': 1.15.7 + '@types/sortablejs': 1.15.8 color: 4.2.3 composed-offset-position: 0.0.6(@floating-ui/utils@0.2.8) - dayjs: 1.11.12 - focus-trap: 7.5.4 + dayjs: 1.11.13 + focus-trap: 7.6.0 interactjs: 1.10.27 lodash-es: 4.17.21 - sortablejs: 1.15.1 - timezone-groups: 0.9.1 + sortablejs: 1.15.3 + timezone-groups: 0.10.2 type-fest: 4.18.2 transitivePeerDependencies: - '@floating-ui/utils' - '@esri/calcite-ui-icons@3.31.0': {} + '@esri/calcite-ui-icons@3.32.0': {} '@farmfe/plugin-svgr-darwin-arm64@0.0.1': optional: true @@ -18969,20 +25270,31 @@ snapshots: '@floating-ui/core': 1.5.0 '@floating-ui/utils': 0.1.6 - '@floating-ui/dom@1.6.10': + '@floating-ui/dom@1.6.11': + dependencies: + '@floating-ui/core': 1.6.8 + '@floating-ui/utils': 0.2.8 + + '@floating-ui/dom@1.6.12': dependencies: '@floating-ui/core': 1.6.8 '@floating-ui/utils': 0.2.8 '@floating-ui/react-dom@2.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': dependencies: - '@floating-ui/dom': 1.6.10 + '@floating-ui/dom': 1.6.11 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + + '@floating-ui/react-dom@2.1.2(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': + dependencies: + '@floating-ui/dom': 1.6.12 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) '@floating-ui/react@0.24.8(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': dependencies: - '@floating-ui/react-dom': 2.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@floating-ui/react-dom': 2.1.2(react-dom@18.2.0(react@18.2.0))(react@18.2.0) aria-hidden: 1.2.4 react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -18994,18 +25306,24 @@ snapshots: '@gar/promisify@1.1.3': {} - '@guolao/vue-monaco-editor@1.5.1(@vue/composition-api@1.7.2(vue@3.4.15(typescript@5.4.5)))(vue@3.4.15(typescript@5.4.5))': + '@guolao/vue-monaco-editor@1.5.1(@vue/composition-api@1.7.2(vue@3.4.35(typescript@5.6.3)))(vue@3.4.35(typescript@5.6.3))': dependencies: '@monaco-editor/loader': 1.4.0 - vue: 3.4.15(typescript@5.4.5) - vue-demi: 0.14.10(@vue/composition-api@1.7.2(vue@3.4.15(typescript@5.4.5)))(vue@3.4.15(typescript@5.4.5)) + vue: 3.4.35(typescript@5.6.3) + vue-demi: 0.14.10(@vue/composition-api@1.7.2(vue@3.4.35(typescript@5.6.3)))(vue@3.4.35(typescript@5.6.3)) optionalDependencies: - '@vue/composition-api': 1.7.2(vue@3.4.15(typescript@5.4.5)) + '@vue/composition-api': 1.7.2(vue@3.4.35(typescript@5.6.3)) + + '@hapi/hoek@9.3.0': {} + + '@hapi/topo@5.1.0': + dependencies: + '@hapi/hoek': 9.3.0 '@humanwhocodes/config-array@0.11.14': dependencies: '@humanwhocodes/object-schema': 2.0.3 - debug: 4.3.4 + debug: 4.3.7 minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -19062,7 +25380,7 @@ snapshots: jest-util: 29.7.0 slash: 3.0.0 - '@jest/core@29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@types/node@18.19.67)(typescript@5.4.5))': + '@jest/core@29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@18.19.67)(typescript@5.4.5))': dependencies: '@jest/console': 29.7.0 '@jest/reporters': 29.7.0 @@ -19076,7 +25394,7 @@ snapshots: exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.7.0 - jest-config: 29.7.0(@types/node@18.19.67)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@types/node@18.19.67)(typescript@5.4.5)) + jest-config: 29.7.0(@types/node@18.19.67)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@18.19.67)(typescript@5.4.5)) jest-haste-map: 29.7.0 jest-message-util: 29.7.0 jest-regex-util: 29.6.3 @@ -19188,7 +25506,7 @@ snapshots: '@jest/transform@29.7.0': dependencies: - '@babel/core': 7.24.3 + '@babel/core': 7.25.2 '@jest/types': 29.6.3 '@jridgewell/trace-mapping': 0.3.25 babel-plugin-istanbul: 6.1.1 @@ -19199,7 +25517,7 @@ snapshots: jest-haste-map: 29.7.0 jest-regex-util: 29.6.3 jest-util: 29.7.0 - micromatch: 4.0.5 + micromatch: 4.0.8 pirates: 4.0.6 slash: 3.0.0 write-file-atomic: 4.0.2 @@ -19255,13 +25573,11 @@ snapshots: '@jridgewell/trace-mapping@0.3.9': dependencies: '@jridgewell/resolve-uri': 3.1.1 - '@jridgewell/sourcemap-codec': 1.4.15 + '@jridgewell/sourcemap-codec': 1.5.0 '@juggle/resize-observer@3.4.0': {} - '@koa/cors@5.0.0': - dependencies: - vary: 1.1.2 + '@leichtgewicht/ip-codec@2.0.5': {} '@lit-labs/ssr-dom-shim@1.2.1': {} @@ -19325,13 +25641,86 @@ snapshots: '@mdn/browser-compat-data@5.5.7': {} + '@mdx-js/mdx@3.0.1': + dependencies: + '@types/estree': 1.0.5 + '@types/estree-jsx': 1.0.5 + '@types/hast': 3.0.4 + '@types/mdx': 2.0.13 + collapse-white-space: 2.1.0 + devlop: 1.1.0 + estree-util-build-jsx: 3.0.1 + estree-util-is-identifier-name: 3.0.0 + estree-util-to-js: 2.0.0 + estree-walker: 3.0.3 + hast-util-to-estree: 3.1.0 + hast-util-to-jsx-runtime: 2.3.0 + markdown-extensions: 2.0.0 + periscopic: 3.1.0 + remark-mdx: 3.0.1 + remark-parse: 11.0.0 + remark-rehype: 11.1.1 + source-map: 0.7.4 + unified: 11.0.5 + unist-util-position-from-estree: 2.0.0 + unist-util-stringify-position: 4.0.0 + unist-util-visit: 5.0.0 + vfile: 6.0.3 + transitivePeerDependencies: + - supports-color + + '@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0)': + dependencies: + '@types/mdx': 2.0.13 + '@types/react': 18.2.35 + react: 18.2.0 + + '@mediapipe/tasks-vision@0.10.8': {} + + '@module-federation/runtime@0.6.9': + dependencies: + '@module-federation/sdk': 0.6.9 + + '@module-federation/sdk@0.6.9': {} + + '@module-federation/vite@1.1.1(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(rollup@4.14.1)(sass@1.74.1)(terser@5.31.1)': + dependencies: + '@module-federation/runtime': 0.6.9 + '@rollup/pluginutils': 5.1.0(rollup@4.14.1) + defu: 6.1.4 + estree-walker: 2.0.2 + magic-string: 0.30.11 + pathe: 1.1.2 + vitest: 2.1.2(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) + transitivePeerDependencies: + - '@edge-runtime/vm' + - '@types/node' + - '@vitest/browser' + - '@vitest/ui' + - happy-dom + - jsdom + - less + - lightningcss + - msw + - rollup + - sass + - stylus + - sugarss + - supports-color + - terser + '@monaco-editor/loader@1.4.0': dependencies: state-local: 1.0.7 + '@monogrid/gainmap-js@3.0.6(three@0.168.0)': + dependencies: + promise-worker-transferable: 1.0.4 + three: 0.168.0 + '@napi-rs/cli@2.18.4': {} - '@nestjs/cli@10.4.2': + '@nestjs/cli@10.4.2(@swc/core@1.7.26(@swc/helpers@0.5.3))': dependencies: '@angular-devkit/core': 17.3.8(chokidar@3.6.0) '@angular-devkit/schematics': 17.3.8(chokidar@3.6.0) @@ -19341,7 +25730,7 @@ snapshots: chokidar: 3.6.0 cli-table3: 0.6.5 commander: 4.1.1 - fork-ts-checker-webpack-plugin: 9.0.2(typescript@5.3.3)(webpack@5.92.1) + fork-ts-checker-webpack-plugin: 9.0.2(typescript@5.3.3)(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))) glob: 10.4.2 inquirer: 8.2.6 node-emoji: 1.11.0 @@ -19350,8 +25739,10 @@ snapshots: tsconfig-paths: 4.2.0 tsconfig-paths-webpack-plugin: 4.1.0 typescript: 5.3.3 - webpack: 5.92.1 + webpack: 5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3)) webpack-node-externals: 3.0.0 + optionalDependencies: + '@swc/core': 1.7.26(@swc/helpers@0.5.3) transitivePeerDependencies: - esbuild - uglify-js @@ -19438,7 +25829,7 @@ snapshots: '@npmcli/fs@2.1.2': dependencies: '@gar/promisify': 1.1.3 - semver: 7.5.4 + semver: 7.6.3 '@npmcli/move-file@2.0.1': dependencies: @@ -19453,6 +25844,69 @@ snapshots: transitivePeerDependencies: - encoding + '@octokit/auth-token@4.0.0': {} + + '@octokit/core@5.2.0': + dependencies: + '@octokit/auth-token': 4.0.0 + '@octokit/graphql': 7.1.0 + '@octokit/request': 8.4.0 + '@octokit/request-error': 5.1.0 + '@octokit/types': 13.6.1 + before-after-hook: 2.2.3 + universal-user-agent: 6.0.1 + + '@octokit/endpoint@9.0.5': + dependencies: + '@octokit/types': 13.6.1 + universal-user-agent: 6.0.1 + + '@octokit/graphql@7.1.0': + dependencies: + '@octokit/request': 8.4.0 + '@octokit/types': 13.6.1 + universal-user-agent: 6.0.1 + + '@octokit/openapi-types@22.2.0': {} + + '@octokit/plugin-paginate-rest@11.3.1(@octokit/core@5.2.0)': + dependencies: + '@octokit/core': 5.2.0 + '@octokit/types': 13.6.1 + + '@octokit/plugin-request-log@4.0.1(@octokit/core@5.2.0)': + dependencies: + '@octokit/core': 5.2.0 + + '@octokit/plugin-rest-endpoint-methods@13.2.2(@octokit/core@5.2.0)': + dependencies: + '@octokit/core': 5.2.0 + '@octokit/types': 13.6.1 + + '@octokit/request-error@5.1.0': + dependencies: + '@octokit/types': 13.6.1 + deprecation: 2.3.1 + once: 1.4.0 + + '@octokit/request@8.4.0': + dependencies: + '@octokit/endpoint': 9.0.5 + '@octokit/request-error': 5.1.0 + '@octokit/types': 13.6.1 + universal-user-agent: 6.0.1 + + '@octokit/rest@20.1.1': + dependencies: + '@octokit/core': 5.2.0 + '@octokit/plugin-paginate-rest': 11.3.1(@octokit/core@5.2.0) + '@octokit/plugin-request-log': 4.0.1(@octokit/core@5.2.0) + '@octokit/plugin-rest-endpoint-methods': 13.2.2(@octokit/core@5.2.0) + + '@octokit/types@13.6.1': + dependencies: + '@octokit/openapi-types': 22.2.0 + '@open-wc/dedupe-mixin@1.4.0': {} '@opentiny/fluent-editor@3.19.4': @@ -20410,7 +26864,7 @@ snapshots: '@opentiny/vue-guide@3.18.0': dependencies: - '@floating-ui/dom': 1.6.10 + '@floating-ui/dom': 1.6.11 '@opentiny/vue-common': 3.18.0 '@opentiny/vue-renderless': 3.18.4 '@opentiny/vue-theme': 3.18.2 @@ -21684,13 +28138,13 @@ snapshots: postcss-selector-parser: 6.1.0 ts-pattern: 5.0.8 - '@pandacss/dev@0.42.0(typescript@5.4.5)': + '@pandacss/dev@0.42.0(typescript@5.6.3)': dependencies: '@clack/prompts': 0.7.0 '@pandacss/config': 0.42.0 '@pandacss/logger': 0.42.0 - '@pandacss/node': 0.42.0(typescript@5.4.5) - '@pandacss/postcss': 0.42.0(typescript@5.4.5) + '@pandacss/node': 0.42.0(typescript@5.6.3) + '@pandacss/postcss': 0.42.0(typescript@5.6.3) '@pandacss/preset-panda': 0.42.0 '@pandacss/shared': 0.42.0 '@pandacss/token-dictionary': 0.42.0 @@ -21700,10 +28154,10 @@ snapshots: - jsdom - typescript - '@pandacss/extractor@0.42.0(typescript@5.4.5)': + '@pandacss/extractor@0.42.0(typescript@5.6.3)': dependencies: '@pandacss/shared': 0.42.0 - ts-evaluator: 1.2.0(typescript@5.4.5) + ts-evaluator: 1.2.0(typescript@5.6.3) ts-morph: 21.0.1 transitivePeerDependencies: - jsdom @@ -21730,14 +28184,14 @@ snapshots: '@pandacss/types': 0.42.0 kleur: 4.1.5 - '@pandacss/node@0.42.0(typescript@5.4.5)': + '@pandacss/node@0.42.0(typescript@5.6.3)': dependencies: '@pandacss/config': 0.42.0 '@pandacss/core': 0.42.0 - '@pandacss/extractor': 0.42.0(typescript@5.4.5) + '@pandacss/extractor': 0.42.0(typescript@5.6.3) '@pandacss/generator': 0.42.0 '@pandacss/logger': 0.42.0 - '@pandacss/parser': 0.42.0(typescript@5.4.5) + '@pandacss/parser': 0.42.0(typescript@5.6.3) '@pandacss/shared': 0.42.0 '@pandacss/token-dictionary': 0.42.0 '@pandacss/types': 0.42.0 @@ -21760,16 +28214,16 @@ snapshots: prettier: 3.2.5 ts-morph: 21.0.1 ts-pattern: 5.0.8 - tsconfck: 3.0.2(typescript@5.4.5) + tsconfck: 3.0.2(typescript@5.6.3) transitivePeerDependencies: - jsdom - typescript - '@pandacss/parser@0.42.0(typescript@5.4.5)': + '@pandacss/parser@0.42.0(typescript@5.6.3)': dependencies: '@pandacss/config': 0.42.0 '@pandacss/core': 0.42.0 - '@pandacss/extractor': 0.42.0(typescript@5.4.5) + '@pandacss/extractor': 0.42.0(typescript@5.6.3) '@pandacss/logger': 0.42.0 '@pandacss/shared': 0.42.0 '@pandacss/types': 0.42.0 @@ -21781,9 +28235,9 @@ snapshots: - jsdom - typescript - '@pandacss/postcss@0.42.0(typescript@5.4.5)': + '@pandacss/postcss@0.42.0(typescript@5.6.3)': dependencies: - '@pandacss/node': 0.42.0(typescript@5.4.5) + '@pandacss/node': 0.42.0(typescript@5.6.3) postcss: 8.4.38 transitivePeerDependencies: - jsdom @@ -21813,6 +28267,20 @@ snapshots: '@pkgr/core@0.1.1': {} + '@pnpm/config.env-replace@1.1.0': {} + + '@pnpm/network.ca-file@1.0.2': + dependencies: + graceful-fs: 4.2.10 + + '@pnpm/npm-conf@2.3.1': + dependencies: + '@pnpm/config.env-replace': 1.1.0 + '@pnpm/network.ca-file': 1.0.2 + config-chain: 1.1.13 + + '@polka/compression@1.0.0-next.25': {} + '@polka/url@1.0.0-next.23': {} '@polka/url@1.0.0-next.25': {} @@ -21823,6 +28291,184 @@ snapshots: '@popperjs/core@2.11.8': {} + '@radix-ui/primitive@1.1.0': {} + + '@radix-ui/react-arrow@1.1.0(@types/react-dom@18.2.14)(@types/react@18.2.35)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': + dependencies: + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.14)(@types/react@18.2.35)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + optionalDependencies: + '@types/react': 18.2.35 + '@types/react-dom': 18.2.14 + + '@radix-ui/react-compose-refs@1.1.0(@types/react@18.2.35)(react@18.2.0)': + dependencies: + react: 18.2.0 + optionalDependencies: + '@types/react': 18.2.35 + + '@radix-ui/react-context@1.1.0(@types/react@18.2.35)(react@18.2.0)': + dependencies: + react: 18.2.0 + optionalDependencies: + '@types/react': 18.2.35 + + '@radix-ui/react-context@1.1.1(@types/react@18.2.35)(react@18.2.0)': + dependencies: + react: 18.2.0 + optionalDependencies: + '@types/react': 18.2.35 + + '@radix-ui/react-dismissable-layer@1.1.1(@types/react-dom@18.2.14)(@types/react@18.2.35)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': + dependencies: + '@radix-ui/primitive': 1.1.0 + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.2.35)(react@18.2.0) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.14)(@types/react@18.2.35)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.2.35)(react@18.2.0) + '@radix-ui/react-use-escape-keydown': 1.1.0(@types/react@18.2.35)(react@18.2.0) + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + optionalDependencies: + '@types/react': 18.2.35 + '@types/react-dom': 18.2.14 + + '@radix-ui/react-icons@1.3.0(react@18.2.0)': + dependencies: + react: 18.2.0 + + '@radix-ui/react-id@1.1.0(@types/react@18.2.35)(react@18.2.0)': + dependencies: + '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.2.35)(react@18.2.0) + react: 18.2.0 + optionalDependencies: + '@types/react': 18.2.35 + + '@radix-ui/react-popper@1.2.0(@types/react-dom@18.2.14)(@types/react@18.2.35)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': + dependencies: + '@floating-ui/react-dom': 2.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@radix-ui/react-arrow': 1.1.0(@types/react-dom@18.2.14)(@types/react@18.2.35)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.2.35)(react@18.2.0) + '@radix-ui/react-context': 1.1.0(@types/react@18.2.35)(react@18.2.0) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.14)(@types/react@18.2.35)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.2.35)(react@18.2.0) + '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.2.35)(react@18.2.0) + '@radix-ui/react-use-rect': 1.1.0(@types/react@18.2.35)(react@18.2.0) + '@radix-ui/react-use-size': 1.1.0(@types/react@18.2.35)(react@18.2.0) + '@radix-ui/rect': 1.1.0 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + optionalDependencies: + '@types/react': 18.2.35 + '@types/react-dom': 18.2.14 + + '@radix-ui/react-portal@1.1.2(@types/react-dom@18.2.14)(@types/react@18.2.35)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': + dependencies: + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.14)(@types/react@18.2.35)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.2.35)(react@18.2.0) + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + optionalDependencies: + '@types/react': 18.2.35 + '@types/react-dom': 18.2.14 + + '@radix-ui/react-presence@1.1.1(@types/react-dom@18.2.14)(@types/react@18.2.35)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': + dependencies: + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.2.35)(react@18.2.0) + '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.2.35)(react@18.2.0) + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + optionalDependencies: + '@types/react': 18.2.35 + '@types/react-dom': 18.2.14 + + '@radix-ui/react-primitive@2.0.0(@types/react-dom@18.2.14)(@types/react@18.2.35)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': + dependencies: + '@radix-ui/react-slot': 1.1.0(@types/react@18.2.35)(react@18.2.0) + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + optionalDependencies: + '@types/react': 18.2.35 + '@types/react-dom': 18.2.14 + + '@radix-ui/react-slot@1.1.0(@types/react@18.2.35)(react@18.2.0)': + dependencies: + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.2.35)(react@18.2.0) + react: 18.2.0 + optionalDependencies: + '@types/react': 18.2.35 + + '@radix-ui/react-tooltip@1.1.3(@types/react-dom@18.2.14)(@types/react@18.2.35)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': + dependencies: + '@radix-ui/primitive': 1.1.0 + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.2.35)(react@18.2.0) + '@radix-ui/react-context': 1.1.1(@types/react@18.2.35)(react@18.2.0) + '@radix-ui/react-dismissable-layer': 1.1.1(@types/react-dom@18.2.14)(@types/react@18.2.35)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@radix-ui/react-id': 1.1.0(@types/react@18.2.35)(react@18.2.0) + '@radix-ui/react-popper': 1.2.0(@types/react-dom@18.2.14)(@types/react@18.2.35)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@radix-ui/react-portal': 1.1.2(@types/react-dom@18.2.14)(@types/react@18.2.35)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@radix-ui/react-presence': 1.1.1(@types/react-dom@18.2.14)(@types/react@18.2.35)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.14)(@types/react@18.2.35)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@radix-ui/react-slot': 1.1.0(@types/react@18.2.35)(react@18.2.0) + '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.2.35)(react@18.2.0) + '@radix-ui/react-visually-hidden': 1.1.0(@types/react-dom@18.2.14)(@types/react@18.2.35)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + optionalDependencies: + '@types/react': 18.2.35 + '@types/react-dom': 18.2.14 + + '@radix-ui/react-use-callback-ref@1.1.0(@types/react@18.2.35)(react@18.2.0)': + dependencies: + react: 18.2.0 + optionalDependencies: + '@types/react': 18.2.35 + + '@radix-ui/react-use-controllable-state@1.1.0(@types/react@18.2.35)(react@18.2.0)': + dependencies: + '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.2.35)(react@18.2.0) + react: 18.2.0 + optionalDependencies: + '@types/react': 18.2.35 + + '@radix-ui/react-use-escape-keydown@1.1.0(@types/react@18.2.35)(react@18.2.0)': + dependencies: + '@radix-ui/react-use-callback-ref': 1.1.0(@types/react@18.2.35)(react@18.2.0) + react: 18.2.0 + optionalDependencies: + '@types/react': 18.2.35 + + '@radix-ui/react-use-layout-effect@1.1.0(@types/react@18.2.35)(react@18.2.0)': + dependencies: + react: 18.2.0 + optionalDependencies: + '@types/react': 18.2.35 + + '@radix-ui/react-use-rect@1.1.0(@types/react@18.2.35)(react@18.2.0)': + dependencies: + '@radix-ui/rect': 1.1.0 + react: 18.2.0 + optionalDependencies: + '@types/react': 18.2.35 + + '@radix-ui/react-use-size@1.1.0(@types/react@18.2.35)(react@18.2.0)': + dependencies: + '@radix-ui/react-use-layout-effect': 1.1.0(@types/react@18.2.35)(react@18.2.0) + react: 18.2.0 + optionalDependencies: + '@types/react': 18.2.35 + + '@radix-ui/react-visually-hidden@1.1.0(@types/react-dom@18.2.14)(@types/react@18.2.35)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': + dependencies: + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.2.14)(@types/react@18.2.35)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + optionalDependencies: + '@types/react': 18.2.35 + '@types/react-dom': 18.2.14 + + '@radix-ui/rect@1.1.0': {} + '@rc-component/color-picker@1.4.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': dependencies: '@babel/runtime': 7.23.2 @@ -21880,6 +28526,126 @@ snapshots: react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + '@react-spring/animated@9.6.1(react@18.2.0)': + dependencies: + '@react-spring/shared': 9.6.1(react@18.2.0) + '@react-spring/types': 9.6.1 + react: 18.2.0 + + '@react-spring/animated@9.7.5(react@18.2.0)': + dependencies: + '@react-spring/shared': 9.7.5(react@18.2.0) + '@react-spring/types': 9.7.5 + react: 18.2.0 + + '@react-spring/core@9.6.1(react@18.2.0)': + dependencies: + '@react-spring/animated': 9.6.1(react@18.2.0) + '@react-spring/rafz': 9.6.1 + '@react-spring/shared': 9.6.1(react@18.2.0) + '@react-spring/types': 9.6.1 + react: 18.2.0 + + '@react-spring/core@9.7.5(react@18.2.0)': + dependencies: + '@react-spring/animated': 9.7.5(react@18.2.0) + '@react-spring/shared': 9.7.5(react@18.2.0) + '@react-spring/types': 9.7.5 + react: 18.2.0 + + '@react-spring/rafz@9.6.1': {} + + '@react-spring/rafz@9.7.5': {} + + '@react-spring/shared@9.6.1(react@18.2.0)': + dependencies: + '@react-spring/rafz': 9.6.1 + '@react-spring/types': 9.6.1 + react: 18.2.0 + + '@react-spring/shared@9.7.5(react@18.2.0)': + dependencies: + '@react-spring/rafz': 9.7.5 + '@react-spring/types': 9.7.5 + react: 18.2.0 + + '@react-spring/three@9.6.1(@react-three/fiber@8.17.7(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(three@0.168.0))(react@18.2.0)(three@0.168.0)': + dependencies: + '@react-spring/animated': 9.6.1(react@18.2.0) + '@react-spring/core': 9.6.1(react@18.2.0) + '@react-spring/shared': 9.6.1(react@18.2.0) + '@react-spring/types': 9.6.1 + '@react-three/fiber': 8.17.7(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(three@0.168.0) + react: 18.2.0 + three: 0.168.0 + + '@react-spring/types@9.6.1': {} + + '@react-spring/types@9.7.5': {} + + '@react-spring/web@9.7.5(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': + dependencies: + '@react-spring/animated': 9.7.5(react@18.2.0) + '@react-spring/core': 9.7.5(react@18.2.0) + '@react-spring/shared': 9.7.5(react@18.2.0) + '@react-spring/types': 9.7.5 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + + '@react-three/drei@9.112.1(@react-three/fiber@8.17.7(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(three@0.168.0))(@types/react@18.2.35)(@types/three@0.163.0)(immer@10.0.3)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(three@0.168.0)': + dependencies: + '@babel/runtime': 7.25.0 + '@mediapipe/tasks-vision': 0.10.8 + '@monogrid/gainmap-js': 3.0.6(three@0.168.0) + '@react-spring/three': 9.6.1(@react-three/fiber@8.17.7(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(three@0.168.0))(react@18.2.0)(three@0.168.0) + '@react-three/fiber': 8.17.7(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(three@0.168.0) + '@use-gesture/react': 10.3.1(react@18.2.0) + camera-controls: 2.9.0(three@0.168.0) + cross-env: 7.0.3 + detect-gpu: 5.0.51 + glsl-noise: 0.0.0 + hls.js: 1.3.5 + maath: 0.10.8(@types/three@0.163.0)(three@0.168.0) + meshline: 3.3.1(three@0.168.0) + react: 18.2.0 + react-composer: 5.0.3(react@18.2.0) + stats-gl: 2.2.8 + stats.js: 0.17.0 + suspend-react: 0.1.3(react@18.2.0) + three: 0.168.0 + three-mesh-bvh: 0.7.6(three@0.168.0) + three-stdlib: 2.33.0(three@0.168.0) + troika-three-text: 0.49.1(three@0.168.0) + tunnel-rat: 0.1.2(@types/react@18.2.35)(immer@10.0.3)(react@18.2.0) + utility-types: 3.11.0 + uuid: 9.0.1 + zustand: 3.7.2(react@18.2.0) + optionalDependencies: + react-dom: 18.2.0(react@18.2.0) + transitivePeerDependencies: + - '@types/react' + - '@types/three' + - immer + + '@react-three/fiber@8.17.7(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(three@0.168.0)': + dependencies: + '@babel/runtime': 7.25.0 + '@types/debounce': 1.2.4 + '@types/react-reconciler': 0.26.7 + '@types/webxr': 0.5.20 + base64-js: 1.5.1 + buffer: 6.0.3 + debounce: 1.2.1 + its-fine: 1.2.5(react@18.2.0) + react: 18.2.0 + react-reconciler: 0.27.0(react@18.2.0) + scheduler: 0.21.0 + suspend-react: 0.1.3(react@18.2.0) + three: 0.168.0 + zustand: 3.7.2(react@18.2.0) + optionalDependencies: + react-dom: 18.2.0(react@18.2.0) + '@reactflow/background@11.3.14(@types/react@18.2.35)(immer@9.0.21)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': dependencies: '@reactflow/core': 11.11.4(@types/react@18.2.35)(immer@9.0.21)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) @@ -21906,7 +28672,7 @@ snapshots: dependencies: '@types/d3': 7.4.3 '@types/d3-drag': 3.0.7 - '@types/d3-selection': 3.0.10 + '@types/d3-selection': 3.0.11 '@types/d3-zoom': 3.0.8 classcat: 5.0.5 d3-drag: 3.0.0 @@ -21922,7 +28688,7 @@ snapshots: '@reactflow/minimap@11.7.14(@types/react@18.2.35)(immer@9.0.21)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)': dependencies: '@reactflow/core': 11.11.4(@types/react@18.2.35)(immer@9.0.21)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) - '@types/d3-selection': 3.0.10 + '@types/d3-selection': 3.0.11 '@types/d3-zoom': 3.0.8 classcat: 5.0.5 d3-selection: 3.0.0 @@ -21987,7 +28753,7 @@ snapshots: '@rollup/pluginutils@5.1.0(rollup@4.14.1)': dependencies: - '@types/estree': 1.0.5 + '@types/estree': 1.0.6 estree-walker: 2.0.2 picomatch: 2.3.1 optionalDependencies: @@ -22038,66 +28804,131 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.14.1': optional: true - '@sentry-internal/browser-utils@8.33.1': + '@sentry-internal/browser-utils@8.34.0': dependencies: - '@sentry/core': 8.33.1 - '@sentry/types': 8.33.1 - '@sentry/utils': 8.33.1 + '@sentry/core': 8.34.0 + '@sentry/types': 8.34.0 + '@sentry/utils': 8.34.0 - '@sentry-internal/feedback@8.33.1': + '@sentry-internal/feedback@8.34.0': dependencies: - '@sentry/core': 8.33.1 - '@sentry/types': 8.33.1 - '@sentry/utils': 8.33.1 + '@sentry/core': 8.34.0 + '@sentry/types': 8.34.0 + '@sentry/utils': 8.34.0 - '@sentry-internal/replay-canvas@8.33.1': + '@sentry-internal/replay-canvas@8.34.0': dependencies: - '@sentry-internal/replay': 8.33.1 - '@sentry/core': 8.33.1 - '@sentry/types': 8.33.1 - '@sentry/utils': 8.33.1 + '@sentry-internal/replay': 8.34.0 + '@sentry/core': 8.34.0 + '@sentry/types': 8.34.0 + '@sentry/utils': 8.34.0 - '@sentry-internal/replay@8.33.1': + '@sentry-internal/replay@8.34.0': dependencies: - '@sentry-internal/browser-utils': 8.33.1 - '@sentry/core': 8.33.1 - '@sentry/types': 8.33.1 - '@sentry/utils': 8.33.1 + '@sentry-internal/browser-utils': 8.34.0 + '@sentry/core': 8.34.0 + '@sentry/types': 8.34.0 + '@sentry/utils': 8.34.0 - '@sentry/browser@8.33.1': + '@sentry/browser@8.34.0': dependencies: - '@sentry-internal/browser-utils': 8.33.1 - '@sentry-internal/feedback': 8.33.1 - '@sentry-internal/replay': 8.33.1 - '@sentry-internal/replay-canvas': 8.33.1 - '@sentry/core': 8.33.1 - '@sentry/types': 8.33.1 - '@sentry/utils': 8.33.1 + '@sentry-internal/browser-utils': 8.34.0 + '@sentry-internal/feedback': 8.34.0 + '@sentry-internal/replay': 8.34.0 + '@sentry-internal/replay-canvas': 8.34.0 + '@sentry/core': 8.34.0 + '@sentry/types': 8.34.0 + '@sentry/utils': 8.34.0 - '@sentry/core@8.33.1': + '@sentry/core@8.34.0': dependencies: - '@sentry/types': 8.33.1 - '@sentry/utils': 8.33.1 + '@sentry/types': 8.34.0 + '@sentry/utils': 8.34.0 - '@sentry/react@8.33.1(react@18.2.0)': + '@sentry/react@8.34.0(react@18.2.0)': dependencies: - '@sentry/browser': 8.33.1 - '@sentry/core': 8.33.1 - '@sentry/types': 8.33.1 - '@sentry/utils': 8.33.1 + '@sentry/browser': 8.34.0 + '@sentry/core': 8.34.0 + '@sentry/types': 8.34.0 + '@sentry/utils': 8.34.0 hoist-non-react-statics: 3.3.2 react: 18.2.0 - '@sentry/types@8.33.1': {} + '@sentry/types@8.34.0': {} + + '@sentry/utils@8.34.0': + dependencies: + '@sentry/types': 8.34.0 + + '@shikijs/core@1.22.0': + dependencies: + '@shikijs/engine-javascript': 1.22.0 + '@shikijs/engine-oniguruma': 1.22.0 + '@shikijs/types': 1.22.0 + '@shikijs/vscode-textmate': 9.3.0 + '@types/hast': 3.0.4 + hast-util-to-html: 9.0.3 + + '@shikijs/core@1.24.2': + dependencies: + '@shikijs/engine-javascript': 1.24.2 + '@shikijs/engine-oniguruma': 1.24.2 + '@shikijs/types': 1.24.2 + '@shikijs/vscode-textmate': 9.3.0 + '@types/hast': 3.0.4 + hast-util-to-html: 9.0.3 + + '@shikijs/engine-javascript@1.22.0': + dependencies: + '@shikijs/types': 1.22.0 + '@shikijs/vscode-textmate': 9.3.0 + oniguruma-to-js: 0.4.3 + + '@shikijs/engine-javascript@1.24.2': + dependencies: + '@shikijs/types': 1.24.2 + '@shikijs/vscode-textmate': 9.3.0 + oniguruma-to-es: 0.7.0 + + '@shikijs/engine-oniguruma@1.22.0': + dependencies: + '@shikijs/types': 1.22.0 + '@shikijs/vscode-textmate': 9.3.0 + + '@shikijs/engine-oniguruma@1.24.2': + dependencies: + '@shikijs/types': 1.24.2 + '@shikijs/vscode-textmate': 9.3.0 - '@sentry/utils@8.33.1': + '@shikijs/markdown-it@1.22.0': dependencies: - '@sentry/types': 8.33.1 + markdown-it: 14.1.0 + shiki: 1.22.0 + + '@shikijs/transformers@1.22.0': + dependencies: + shiki: 1.22.0 + + '@shikijs/types@1.22.0': + dependencies: + '@shikijs/vscode-textmate': 9.3.0 + '@types/hast': 3.0.4 - '@shikijs/core@1.14.1': + '@shikijs/types@1.24.2': dependencies: + '@shikijs/vscode-textmate': 9.3.0 '@types/hast': 3.0.4 + '@shikijs/vscode-textmate@9.3.0': {} + + '@sideway/address@4.1.5': + dependencies: + '@hapi/hoek': 9.3.0 + + '@sideway/formula@3.0.1': {} + + '@sideway/pinpoint@2.0.0': {} + '@simonwep/pickr@1.8.2': dependencies: core-js: 3.37.1 @@ -22109,6 +28940,8 @@ snapshots: '@sindresorhus/is@4.6.0': {} + '@sindresorhus/is@5.6.0': {} + '@sinonjs/commons@3.0.1': dependencies: type-detect: 4.0.8 @@ -22117,6 +28950,18 @@ snapshots: dependencies: '@sinonjs/commons': 3.0.1 + '@slorber/react-ideal-image@0.0.12(prop-types@15.8.1)(react-waypoint@10.3.0(react@18.2.0))(react@18.2.0)': + dependencies: + prop-types: 15.8.1 + react: 18.2.0 + react-waypoint: 10.3.0(react@18.2.0) + + '@slorber/remark-comment@1.0.0': + dependencies: + micromark-factory-space: 1.1.0 + micromark-util-character: 1.2.0 + micromark-util-symbol: 1.1.0 + '@solidjs/router@0.10.3(solid-js@1.8.5)': dependencies: solid-js: 1.8.5 @@ -22125,25 +28970,29 @@ snapshots: '@stencil/core@4.20.0': {} - '@sveltejs/vite-plugin-svelte-inspector@3.0.1(@sveltejs/vite-plugin-svelte@4.0.3(svelte@5.2.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1)))(svelte@5.2.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1))': + '@stitches/react@1.2.8(react@18.2.0)': dependencies: - '@sveltejs/vite-plugin-svelte': 4.0.3(svelte@5.2.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1)) + react: 18.2.0 + + '@sveltejs/vite-plugin-svelte-inspector@3.0.1(@sveltejs/vite-plugin-svelte@4.0.1(svelte@5.2.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)))(svelte@5.2.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))': + dependencies: + '@sveltejs/vite-plugin-svelte': 4.0.1(svelte@5.2.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)) debug: 4.3.7 svelte: 5.2.1 - vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1) + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) transitivePeerDependencies: - supports-color - '@sveltejs/vite-plugin-svelte@4.0.3(svelte@5.2.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1))': + '@sveltejs/vite-plugin-svelte@4.0.1(svelte@5.2.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))': dependencies: - '@sveltejs/vite-plugin-svelte-inspector': 3.0.1(@sveltejs/vite-plugin-svelte@4.0.3(svelte@5.2.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1)))(svelte@5.2.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1)) + '@sveltejs/vite-plugin-svelte-inspector': 3.0.1(@sveltejs/vite-plugin-svelte@4.0.1(svelte@5.2.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)))(svelte@5.2.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)) debug: 4.3.7 deepmerge: 4.3.1 kleur: 4.1.5 magic-string: 0.30.12 svelte: 5.2.1 - vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1) - vitefu: 1.0.4(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1)) + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) + vitefu: 1.0.3(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)) transitivePeerDependencies: - supports-color @@ -22191,12 +29040,12 @@ snapshots: '@svgr/babel-plugin-transform-react-native-svg': 8.1.0(@babel/core@7.23.2) '@svgr/babel-plugin-transform-svg-component': 8.0.0(@babel/core@7.23.2) - '@svgr/core@8.1.0(typescript@5.4.5)': + '@svgr/core@8.1.0(typescript@5.6.3)': dependencies: '@babel/core': 7.23.2 '@svgr/babel-preset': 8.1.0(@babel/core@7.23.2) camelcase: 6.3.0 - cosmiconfig: 8.3.6(typescript@5.4.5) + cosmiconfig: 8.3.6(typescript@5.6.3) snake-case: 3.0.4 transitivePeerDependencies: - supports-color @@ -22207,16 +29056,86 @@ snapshots: '@babel/types': 7.24.0 entities: 4.5.0 - '@svgr/plugin-jsx@8.1.0(@svgr/core@8.1.0(typescript@5.4.5))': + '@svgr/plugin-jsx@8.1.0(@svgr/core@8.1.0(typescript@5.6.3))': dependencies: '@babel/core': 7.23.2 '@svgr/babel-preset': 8.1.0(@babel/core@7.23.2) - '@svgr/core': 8.1.0(typescript@5.4.5) + '@svgr/core': 8.1.0(typescript@5.6.3) '@svgr/hast-util-to-babel-ast': 8.0.0 svg-parser: 2.0.4 transitivePeerDependencies: - supports-color + '@svgr/plugin-svgo@8.1.0(@svgr/core@8.1.0(typescript@5.6.3))(typescript@5.6.3)': + dependencies: + '@svgr/core': 8.1.0(typescript@5.6.3) + cosmiconfig: 8.3.6(typescript@5.6.3) + deepmerge: 4.3.1 + svgo: 3.2.0 + transitivePeerDependencies: + - typescript + + '@svgr/webpack@8.1.0(typescript@5.6.3)': + dependencies: + '@babel/core': 7.25.2 + '@babel/plugin-transform-react-constant-elements': 7.25.7(@babel/core@7.25.2) + '@babel/preset-env': 7.25.7(@babel/core@7.25.2) + '@babel/preset-react': 7.25.7(@babel/core@7.25.2) + '@babel/preset-typescript': 7.24.7(@babel/core@7.25.2) + '@svgr/core': 8.1.0(typescript@5.6.3) + '@svgr/plugin-jsx': 8.1.0(@svgr/core@8.1.0(typescript@5.6.3)) + '@svgr/plugin-svgo': 8.1.0(@svgr/core@8.1.0(typescript@5.6.3))(typescript@5.6.3) + transitivePeerDependencies: + - supports-color + - typescript + + '@swc/core-darwin-arm64@1.7.26': + optional: true + + '@swc/core-darwin-x64@1.7.26': + optional: true + + '@swc/core-linux-arm-gnueabihf@1.7.26': + optional: true + + '@swc/core-linux-arm64-gnu@1.7.26': + optional: true + + '@swc/core-linux-arm64-musl@1.7.26': + optional: true + + '@swc/core-linux-x64-gnu@1.7.26': + optional: true + + '@swc/core-linux-x64-musl@1.7.26': + optional: true + + '@swc/core-win32-arm64-msvc@1.7.26': + optional: true + + '@swc/core-win32-ia32-msvc@1.7.26': + optional: true + + '@swc/core-win32-x64-msvc@1.7.26': + optional: true + + '@swc/core@1.7.26(@swc/helpers@0.5.3)': + dependencies: + '@swc/counter': 0.1.3 + '@swc/types': 0.1.12 + optionalDependencies: + '@swc/core-darwin-arm64': 1.7.26 + '@swc/core-darwin-x64': 1.7.26 + '@swc/core-linux-arm-gnueabihf': 1.7.26 + '@swc/core-linux-arm64-gnu': 1.7.26 + '@swc/core-linux-arm64-musl': 1.7.26 + '@swc/core-linux-x64-gnu': 1.7.26 + '@swc/core-linux-x64-musl': 1.7.26 + '@swc/core-win32-arm64-msvc': 1.7.26 + '@swc/core-win32-ia32-msvc': 1.7.26 + '@swc/core-win32-x64-msvc': 1.7.26 + '@swc/helpers': 0.5.3 + '@swc/counter@0.1.3': {} '@swc/helpers@0.5.3': @@ -22227,12 +29146,27 @@ snapshots: dependencies: '@swc/counter': 0.1.3 + '@swc/types@0.1.12': + dependencies: + '@swc/counter': 0.1.3 + '@sxzz/popperjs-es@2.11.7': {} '@szmarczak/http-timer@4.0.6': dependencies: defer-to-connect: 2.0.1 + '@szmarczak/http-timer@5.0.1': + dependencies: + defer-to-connect: 2.0.1 + + '@tabler/icons-react@3.19.0(react@18.2.0)': + dependencies: + '@tabler/icons': 3.19.0 + react: 18.2.0 + + '@tabler/icons@3.19.0': {} + '@tailwindcss/node@4.0.0-beta.8': dependencies: enhanced-resolve: 5.18.0 @@ -22305,7 +29239,7 @@ snapshots: dependencies: '@adobe/css-tools': 4.4.0 '@babel/runtime': 7.25.0 - aria-query: 5.3.0 + aria-query: 5.3.2 chalk: 3.0.0 css.escape: 1.5.1 dom-accessibility-api: 0.6.3 @@ -23163,10 +30097,16 @@ snapshots: '@turf/invariant': 6.5.0 d3-voronoi: 1.1.2 + '@tweenjs/tween.js@23.1.3': {} + '@types/accepts@1.3.6': dependencies: '@types/node': 18.19.67 + '@types/acorn@4.0.6': + dependencies: + '@types/estree': 1.0.6 + '@types/babel__core@7.20.3': dependencies: '@babel/parser': 7.23.0 @@ -23192,7 +30132,11 @@ snapshots: '@types/body-parser@1.19.4': dependencies: - '@types/connect': 3.4.37 + '@types/connect': 3.4.38 + '@types/node': 18.19.67 + + '@types/bonjour@3.5.13': + dependencies: '@types/node': 18.19.67 '@types/cacheable-request@6.0.3': @@ -23216,7 +30160,16 @@ snapshots: dependencies: '@types/color-convert': 2.0.3 - '@types/connect@3.4.37': + '@types/compression@1.7.5': + dependencies: + '@types/express': 4.17.21 + + '@types/connect-history-api-fallback@1.5.4': + dependencies: + '@types/express-serve-static-core': 4.17.39 + '@types/node': 18.19.67 + + '@types/connect@3.4.38': dependencies: '@types/node': 18.19.67 @@ -23226,12 +30179,12 @@ snapshots: '@types/cookies@0.7.9': dependencies: - '@types/connect': 3.4.37 + '@types/connect': 3.4.38 '@types/express': 4.17.21 '@types/keygrip': 1.0.4 '@types/node': 18.19.67 - '@types/cross-spawn@6.0.4': + '@types/cors@2.8.17': dependencies: '@types/node': 18.19.67 @@ -23239,11 +30192,11 @@ snapshots: '@types/d3-axis@3.0.6': dependencies: - '@types/d3-selection': 3.0.10 + '@types/d3-selection': 3.0.11 '@types/d3-brush@3.0.6': dependencies: - '@types/d3-selection': 3.0.10 + '@types/d3-selection': 3.0.11 '@types/d3-chord@3.0.6': {} @@ -23252,7 +30205,7 @@ snapshots: '@types/d3-contour@3.0.6': dependencies: '@types/d3-array': 3.2.1 - '@types/geojson': 7946.0.8 + '@types/geojson': 7946.0.15 '@types/d3-delaunay@6.0.4': {} @@ -23260,7 +30213,7 @@ snapshots: '@types/d3-drag@3.0.7': dependencies: - '@types/d3-selection': 3.0.10 + '@types/d3-selection': 3.0.11 '@types/d3-dsv@3.0.7': {} @@ -23276,7 +30229,7 @@ snapshots: '@types/d3-geo@3.1.0': dependencies: - '@types/geojson': 7946.0.8 + '@types/geojson': 7946.0.15 '@types/d3-hierarchy@3.1.7': {} @@ -23292,13 +30245,13 @@ snapshots: '@types/d3-random@3.0.3': {} - '@types/d3-scale-chromatic@3.0.3': {} + '@types/d3-scale-chromatic@3.1.0': {} '@types/d3-scale@4.0.8': dependencies: - '@types/d3-time': 3.0.3 + '@types/d3-time': 3.0.4 - '@types/d3-selection@3.0.10': {} + '@types/d3-selection@3.0.11': {} '@types/d3-shape@3.1.6': dependencies: @@ -23306,18 +30259,20 @@ snapshots: '@types/d3-time-format@4.0.3': {} - '@types/d3-time@3.0.3': {} + '@types/d3-time@3.0.4': {} '@types/d3-timer@2.0.2': {} - '@types/d3-transition@3.0.8': + '@types/d3-timer@3.0.2': {} + + '@types/d3-transition@3.0.9': dependencies: - '@types/d3-selection': 3.0.10 + '@types/d3-selection': 3.0.11 '@types/d3-zoom@3.0.8': dependencies: '@types/d3-interpolate': 3.0.4 - '@types/d3-selection': 3.0.10 + '@types/d3-selection': 3.0.11 '@types/d3@7.4.3': dependencies: @@ -23343,37 +30298,51 @@ snapshots: '@types/d3-quadtree': 3.0.6 '@types/d3-random': 3.0.3 '@types/d3-scale': 4.0.8 - '@types/d3-scale-chromatic': 3.0.3 - '@types/d3-selection': 3.0.10 + '@types/d3-scale-chromatic': 3.1.0 + '@types/d3-selection': 3.0.11 '@types/d3-shape': 3.1.6 - '@types/d3-time': 3.0.3 + '@types/d3-time': 3.0.4 '@types/d3-time-format': 4.0.3 - '@types/d3-timer': 2.0.2 - '@types/d3-transition': 3.0.8 + '@types/d3-timer': 3.0.2 + '@types/d3-transition': 3.0.9 '@types/d3-zoom': 3.0.8 + '@types/debounce@1.2.4': {} + '@types/debug@4.1.12': dependencies: '@types/ms': 0.7.34 + '@types/draco3d@1.4.10': {} + '@types/envinfo@7.8.3': {} + '@types/escape-html@1.0.4': {} + '@types/eslint-scope@3.7.7': dependencies: '@types/eslint': 8.56.10 - '@types/estree': 1.0.5 + '@types/estree': 1.0.6 '@types/eslint@8.56.10': dependencies: - '@types/estree': 1.0.5 + '@types/estree': 1.0.6 '@types/json-schema': 7.0.15 + '@types/estree-jsx@1.0.5': + dependencies: + '@types/estree': 1.0.6 + '@types/estree@1.0.4': {} '@types/estree@1.0.5': {} '@types/estree@1.0.6': {} + '@types/etag@1.8.3': + dependencies: + '@types/node': 20.14.12 + '@types/express-serve-static-core@4.17.39': dependencies: '@types/node': 18.19.67 @@ -23388,6 +30357,8 @@ snapshots: '@types/qs': 6.9.9 '@types/serve-static': 1.15.4 + '@types/figlet@1.7.0': {} + '@types/fs-extra@11.0.3': dependencies: '@types/jsonfile': 6.1.3 @@ -23397,6 +30368,8 @@ snapshots: dependencies: '@types/node': 18.19.67 + '@types/geojson@7946.0.15': {} + '@types/geojson@7946.0.8': {} '@types/glob@7.2.0': @@ -23409,6 +30382,8 @@ snapshots: dependencies: '@types/node': 18.19.67 + '@types/gtag.js@0.0.12': {} + '@types/hast@2.3.10': dependencies: '@types/unist': 2.0.11 @@ -23417,11 +30392,15 @@ snapshots: dependencies: '@types/unist': 3.0.2 + '@types/history@4.7.11': {} + '@types/hoist-non-react-statics@3.3.4': dependencies: '@types/react': 18.2.35 hoist-non-react-statics: 3.3.2 + '@types/html-minifier-terser@6.1.0': {} + '@types/http-assert@1.5.4': {} '@types/http-cache-semantics@4.0.4': {} @@ -23432,15 +30411,6 @@ snapshots: dependencies: '@types/node': 18.19.67 - '@types/inquirer@9.0.6': - dependencies: - '@types/through': 0.0.32 - rxjs: 7.8.1 - - '@types/is-ci@3.0.3': - dependencies: - ci-info: 3.9.0 - '@types/istanbul-lib-coverage@2.0.5': {} '@types/istanbul-lib-report@3.0.3': @@ -23482,20 +30452,6 @@ snapshots: dependencies: '@types/koa': 2.13.10 - '@types/koa-compress@4.0.5': - dependencies: - '@types/koa': 2.13.10 - '@types/node': 18.19.67 - - '@types/koa-send@4.1.5': - dependencies: - '@types/koa': 2.13.10 - - '@types/koa-static@4.0.3': - dependencies: - '@types/koa': 2.13.10 - '@types/koa-send': 4.1.5 - '@types/koa@2.13.10': dependencies: '@types/accepts': 1.3.6 @@ -23507,10 +30463,6 @@ snapshots: '@types/koa-compose': 3.2.7 '@types/node': 18.19.67 - '@types/koa__cors@5.0.0': - dependencies: - '@types/koa': 2.13.10 - '@types/less@3.0.5': {} '@types/lodash-es@4.17.12': @@ -23525,8 +30477,16 @@ snapshots: dependencies: '@types/unist': 2.0.11 + '@types/mdast@4.0.4': + dependencies: + '@types/unist': 3.0.2 + + '@types/mdx@2.0.13': {} + '@types/methods@1.1.4': {} + '@types/mime-types@2.1.4': {} + '@types/mime@1.3.4': {} '@types/mime@3.0.3': {} @@ -23538,6 +30498,10 @@ snapshots: '@types/ms@0.7.34': {} + '@types/node-forge@1.3.11': + dependencies: + '@types/node': 20.14.12 + '@types/node@12.20.55': {} '@types/node@17.0.45': {} @@ -23556,6 +30520,8 @@ snapshots: '@types/object-path@0.11.4': {} + '@types/offscreencanvas@2019.7.3': {} + '@types/parse-json@4.0.1': {} '@types/plist@3.0.5': @@ -23571,7 +30537,9 @@ snapshots: '@types/postcss-url@10.0.4': dependencies: '@types/node': 18.19.67 - postcss: 8.4.47 + postcss: 8.4.39 + + '@types/prismjs@1.26.5': {} '@types/prompts@2.4.7': dependencies: @@ -23590,6 +30558,14 @@ snapshots: dependencies: '@types/react': 18.2.35 + '@types/react-reconciler@0.26.7': + dependencies: + '@types/react': 18.2.35 + + '@types/react-reconciler@0.28.8': + dependencies: + '@types/react': 18.2.35 + '@types/react-redux@7.1.33': dependencies: '@types/hoist-non-react-statics': 3.3.4 @@ -23597,6 +30573,23 @@ snapshots: hoist-non-react-statics: 3.3.2 redux: 4.2.1 + '@types/react-router-config@5.0.11': + dependencies: + '@types/history': 4.7.11 + '@types/react': 18.2.35 + '@types/react-router': 5.1.20 + + '@types/react-router-dom@5.3.3': + dependencies: + '@types/history': 4.7.11 + '@types/react': 18.2.35 + '@types/react-router': 5.1.20 + + '@types/react-router@5.1.20': + dependencies: + '@types/history': 4.7.11 + '@types/react': 18.2.35 + '@types/react@18.2.35': dependencies: '@types/prop-types': 15.7.9 @@ -23607,10 +30600,16 @@ snapshots: dependencies: '@types/node': 18.19.67 + '@types/retry@0.12.0': {} + '@types/sass@1.43.1': dependencies: '@types/node': 18.19.67 + '@types/sax@1.2.7': + dependencies: + '@types/node': 20.14.12 + '@types/scheduler@0.16.5': {} '@types/semver@7.5.4': {} @@ -23620,6 +30619,10 @@ snapshots: '@types/mime': 1.3.4 '@types/node': 18.19.67 + '@types/serve-index@1.9.4': + dependencies: + '@types/express': 4.17.21 + '@types/serve-static@1.15.4': dependencies: '@types/http-errors': 2.0.3 @@ -23628,12 +30631,16 @@ snapshots: '@types/sizzle@2.3.8': {} - '@types/sortablejs@1.15.7': {} + '@types/sockjs@0.3.36': + dependencies: + '@types/node': 20.14.12 '@types/sortablejs@1.15.8': {} '@types/stack-utils@2.0.3': {} + '@types/stats.js@0.17.3': {} + '@types/stylus@0.48.41': dependencies: '@types/node': 18.19.67 @@ -23649,9 +30656,13 @@ snapshots: '@types/methods': 1.1.4 '@types/superagent': 8.1.7 - '@types/through@0.0.32': + '@types/three@0.163.0': dependencies: - '@types/node': 18.19.67 + '@tweenjs/tween.js': 23.1.3 + '@types/stats.js': 0.17.3 + '@types/webxr': 0.5.20 + fflate: 0.8.2 + meshoptimizer: 0.18.1 '@types/tinycolor2@1.4.5': {} @@ -23670,6 +30681,8 @@ snapshots: '@types/web-bluetooth@0.0.16': {} + '@types/webxr@0.5.20': {} + '@types/ws@8.5.8': dependencies: '@types/node': 18.19.67 @@ -23727,7 +30740,7 @@ snapshots: dependencies: '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.5) '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.4.5) - debug: 4.3.4 + debug: 4.3.7 eslint: 8.57.0 ts-api-utils: 1.3.0(typescript@5.4.5) optionalDependencies: @@ -23741,7 +30754,7 @@ snapshots: dependencies: '@typescript-eslint/types': 6.21.0 '@typescript-eslint/visitor-keys': 6.21.0 - debug: 4.3.4 + debug: 4.3.7 globby: 11.1.0 is-glob: 4.0.3 minimatch: 9.0.3 @@ -23771,15 +30784,46 @@ snapshots: '@typescript-eslint/types': 6.21.0 eslint-visitor-keys: 3.4.3 + '@typescript/twoslash@3.1.0': + dependencies: + '@typescript/vfs': 1.3.5 + debug: 4.3.7 + lz-string: 1.5.0 + transitivePeerDependencies: + - supports-color + + '@typescript/vfs@1.3.4': + dependencies: + debug: 4.3.7 + transitivePeerDependencies: + - supports-color + + '@typescript/vfs@1.3.5': + dependencies: + debug: 4.3.7 + transitivePeerDependencies: + - supports-color + '@ungap/structured-clone@1.2.0': {} - '@unocss/astro@0.62.2(rollup@4.14.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.69.5)(terser@5.31.1))': + '@unocss/astro@0.62.2(rollup@4.14.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.69.5)(terser@5.31.1))': + dependencies: + '@unocss/core': 0.62.2 + '@unocss/reset': 0.62.2 + '@unocss/vite': 0.62.2(rollup@4.14.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.69.5)(terser@5.31.1)) + optionalDependencies: + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.69.5)(terser@5.31.1) + transitivePeerDependencies: + - rollup + - supports-color + + '@unocss/astro@0.62.2(rollup@4.14.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))': dependencies: '@unocss/core': 0.62.2 '@unocss/reset': 0.62.2 - '@unocss/vite': 0.62.2(rollup@4.14.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.69.5)(terser@5.31.1)) + '@unocss/vite': 0.62.2(rollup@4.14.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)) optionalDependencies: - vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.69.5)(terser@5.31.1) + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) transitivePeerDependencies: - rollup - supports-color @@ -23795,7 +30839,7 @@ snapshots: chokidar: 3.6.0 colorette: 2.0.20 consola: 3.2.3 - magic-string: 0.30.11 + magic-string: 0.30.12 pathe: 1.1.2 perfect-debounce: 1.0.0 tinyglobby: 0.2.2 @@ -23835,6 +30879,18 @@ snapshots: transitivePeerDependencies: - supports-color + '@unocss/postcss@0.62.2(postcss@8.4.47)': + dependencies: + '@unocss/config': 0.62.2 + '@unocss/core': 0.62.2 + '@unocss/rule-utils': 0.62.2 + css-tree: 2.3.1 + magic-string: 0.30.11 + postcss: 8.4.47 + tinyglobby: 0.2.2 + transitivePeerDependencies: + - supports-color + '@unocss/preset-attributify@0.62.2': dependencies: '@unocss/core': 0.62.2 @@ -23885,14 +30941,14 @@ snapshots: '@unocss/rule-utils@0.62.2': dependencies: '@unocss/core': 0.62.2 - magic-string: 0.30.11 + magic-string: 0.30.12 '@unocss/scope@0.62.2': {} '@unocss/transformer-attributify-jsx-babel@0.62.2': dependencies: '@babel/core': 7.25.2 - '@babel/plugin-syntax-jsx': 7.24.7(@babel/core@7.25.2) + '@babel/plugin-syntax-jsx': 7.25.7(@babel/core@7.25.2) '@babel/preset-typescript': 7.24.7(@babel/core@7.25.2) '@unocss/core': 0.62.2 transitivePeerDependencies: @@ -23916,7 +30972,7 @@ snapshots: dependencies: '@unocss/core': 0.62.2 - '@unocss/vite@0.62.2(rollup@4.14.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.69.5)(terser@5.31.1))': + '@unocss/vite@0.62.2(rollup@4.14.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.69.5)(terser@5.31.1))': dependencies: '@ampproject/remapping': 2.3.0 '@rollup/pluginutils': 5.1.0(rollup@4.14.1) @@ -23926,13 +30982,37 @@ snapshots: '@unocss/scope': 0.62.2 '@unocss/transformer-directives': 0.62.2 chokidar: 3.6.0 - magic-string: 0.30.11 + magic-string: 0.30.12 + tinyglobby: 0.2.2 + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.69.5)(terser@5.31.1) + transitivePeerDependencies: + - rollup + - supports-color + + '@unocss/vite@0.62.2(rollup@4.14.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))': + dependencies: + '@ampproject/remapping': 2.3.0 + '@rollup/pluginutils': 5.1.0(rollup@4.14.1) + '@unocss/config': 0.62.2 + '@unocss/core': 0.62.2 + '@unocss/inspector': 0.62.2 + '@unocss/scope': 0.62.2 + '@unocss/transformer-directives': 0.62.2 + chokidar: 3.6.0 + magic-string: 0.30.12 tinyglobby: 0.2.2 - vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.69.5)(terser@5.31.1) + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) transitivePeerDependencies: - rollup - supports-color + '@use-gesture/core@10.3.1': {} + + '@use-gesture/react@10.3.1(react@18.2.0)': + dependencies: + '@use-gesture/core': 10.3.1 + react: 18.2.0 + '@vaadin/a11y-base@24.3.22': dependencies: '@open-wc/dedupe-mixin': 1.4.0 @@ -24042,7 +31122,7 @@ snapshots: '@vanilla-extract/babel-plugin-debug-ids@1.0.6': dependencies: - '@babel/core': 7.24.3 + '@babel/core': 7.25.2 transitivePeerDependencies: - supports-color @@ -24062,7 +31142,7 @@ snapshots: transitivePeerDependencies: - babel-plugin-macros - '@vanilla-extract/integration@7.1.7(@types/node@20.14.12)(babel-plugin-macros@3.1.0)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1)': + '@vanilla-extract/integration@7.1.7(@types/node@20.14.12)(babel-plugin-macros@3.1.0)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)': dependencies: '@babel/core': 7.24.3 '@babel/plugin-syntax-typescript': 7.24.1(@babel/core@7.24.3) @@ -24074,8 +31154,8 @@ snapshots: find-up: 5.0.0 javascript-stringify: 2.1.0 mlly: 1.4.2 - vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1) - vite-node: 1.4.0(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1) + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) + vite-node: 1.4.0(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -24089,10 +31169,10 @@ snapshots: '@vanilla-extract/private@1.0.5': {} - '@vanilla-extract/vite-plugin@4.0.13(@types/node@20.14.12)(babel-plugin-macros@3.1.0)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1))': + '@vanilla-extract/vite-plugin@4.0.13(@types/node@20.14.12)(babel-plugin-macros@3.1.0)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))': dependencies: - '@vanilla-extract/integration': 7.1.7(@types/node@20.14.12)(babel-plugin-macros@3.1.0)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1) - vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1) + '@vanilla-extract/integration': 7.1.7(@types/node@20.14.12)(babel-plugin-macros@3.1.0)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -24104,81 +31184,86 @@ snapshots: - supports-color - terser - '@vitejs/plugin-vue-jsx@3.1.0(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.69.5)(terser@5.31.1))(vue@3.3.7(typescript@5.4.5))': + '@vitejs/plugin-vue-jsx@3.1.0(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.69.5)(terser@5.31.1))(vue@3.3.7(typescript@5.6.3))': dependencies: '@babel/core': 7.24.3 '@babel/plugin-transform-typescript': 7.24.1(@babel/core@7.24.3) '@vue/babel-plugin-jsx': 1.2.2(@babel/core@7.24.3) - vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.69.5)(terser@5.31.1) - vue: 3.3.7(typescript@5.4.5) + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.69.5)(terser@5.31.1) + vue: 3.3.7(typescript@5.6.3) transitivePeerDependencies: - supports-color - '@vitejs/plugin-vue-jsx@3.1.0(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1))(vue@3.3.7(typescript@5.4.5))': + '@vitejs/plugin-vue-jsx@3.1.0(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))(vue@3.3.7(typescript@5.6.3))': dependencies: '@babel/core': 7.24.3 '@babel/plugin-transform-typescript': 7.24.1(@babel/core@7.24.3) '@vue/babel-plugin-jsx': 1.2.2(@babel/core@7.24.3) - vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1) - vue: 3.3.7(typescript@5.4.5) + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) + vue: 3.3.7(typescript@5.6.3) transitivePeerDependencies: - supports-color - '@vitejs/plugin-vue-jsx@3.1.0(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1))(vue@3.4.27(typescript@5.4.5))': + '@vitejs/plugin-vue-jsx@3.1.0(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))(vue@3.4.27(typescript@5.6.3))': dependencies: '@babel/core': 7.24.3 '@babel/plugin-transform-typescript': 7.24.1(@babel/core@7.24.3) '@vue/babel-plugin-jsx': 1.2.2(@babel/core@7.24.3) - vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1) - vue: 3.4.27(typescript@5.4.5) + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) + vue: 3.4.27(typescript@5.6.3) transitivePeerDependencies: - supports-color - '@vitejs/plugin-vue2@2.3.1(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1))(vue@2.7.16)': + '@vitejs/plugin-vue2@2.3.1(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))(vue@2.7.16)': dependencies: - vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1) + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) vue: 2.7.16 - '@vitejs/plugin-vue@4.4.0(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1))(vue@3.3.12(typescript@5.4.5))': + '@vitejs/plugin-vue@4.4.0(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))(vue@3.3.12(typescript@5.6.3))': + dependencies: + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) + vue: 3.3.12(typescript@5.6.3) + + '@vitejs/plugin-vue@4.6.2(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))(vue@3.4.35(typescript@5.6.3))': dependencies: - vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1) - vue: 3.3.12(typescript@5.4.5) + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) + vue: 3.4.35(typescript@5.6.3) - '@vitejs/plugin-vue@4.6.2(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1))(vue@3.4.15(typescript@5.4.5))': + '@vitejs/plugin-vue@5.0.3(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))(vue@3.4.15(typescript@5.6.3))': dependencies: - vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1) - vue: 3.4.15(typescript@5.4.5) + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) + vue: 3.4.15(typescript@5.6.3) - '@vitejs/plugin-vue@5.0.3(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1))(vue@3.4.15(typescript@5.4.5))': + '@vitejs/plugin-vue@5.0.4(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))(vue@3.3.7(typescript@5.6.3))': dependencies: - vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1) - vue: 3.4.15(typescript@5.4.5) + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) + vue: 3.3.7(typescript@5.6.3) - '@vitejs/plugin-vue@5.0.4(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1))(vue@3.3.7(typescript@5.4.5))': + '@vitejs/plugin-vue@5.0.4(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))(vue@3.4.27(typescript@5.6.3))': dependencies: - vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1) - vue: 3.3.7(typescript@5.4.5) + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) + vue: 3.4.27(typescript@5.6.3) - '@vitejs/plugin-vue@5.0.4(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1))(vue@3.4.27(typescript@5.4.5))': + '@vitejs/plugin-vue@5.1.2(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))(vue@3.4.35(typescript@5.6.3))': dependencies: - vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1) - vue: 3.4.27(typescript@5.4.5) + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) + vue: 3.4.35(typescript@5.6.3) - '@vitejs/plugin-vue@5.1.2(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1))(vue@3.4.35(typescript@5.4.5))': + '@vitejs/plugin-vue@5.1.4(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.69.5)(terser@5.31.1))(vue@3.3.7(typescript@5.6.3))': dependencies: - vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1) - vue: 3.4.35(typescript@5.4.5) + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.69.5)(terser@5.31.1) + vue: 3.3.7(typescript@5.6.3) - '@vitejs/plugin-vue@5.1.4(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.69.5)(terser@5.31.1))(vue@3.3.7(typescript@5.4.5))': + '@vitejs/plugin-vue@5.1.4(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))(vue@3.4.35(typescript@5.6.3))': dependencies: - vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.69.5)(terser@5.31.1) - vue: 3.3.7(typescript@5.4.5) + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) + vue: 3.4.35(typescript@5.6.3) - '@vitest/coverage-v8@2.0.4(vitest@2.0.4(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1))': + '@vitest/coverage-v8@2.0.4(vitest@2.0.4(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))': dependencies: '@ampproject/remapping': 2.3.0 '@bcoe/v8-coverage': 0.2.3 - debug: 4.3.5 + debug: 4.3.7 istanbul-lib-coverage: 3.2.2 istanbul-lib-report: 3.0.1 istanbul-lib-source-maps: 5.0.6 @@ -24188,7 +31273,7 @@ snapshots: std-env: 3.7.0 test-exclude: 7.0.1 tinyrainbow: 1.2.0 - vitest: 2.0.4(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1) + vitest: 2.0.4(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) transitivePeerDependencies: - supports-color @@ -24199,25 +31284,59 @@ snapshots: chai: 5.1.1 tinyrainbow: 1.2.0 + '@vitest/expect@2.1.2': + dependencies: + '@vitest/spy': 2.1.2 + '@vitest/utils': 2.1.2 + chai: 5.1.1 + tinyrainbow: 1.2.0 + + '@vitest/mocker@2.1.2(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))': + dependencies: + '@vitest/spy': 2.1.2 + estree-walker: 3.0.3 + magic-string: 0.30.12 + optionalDependencies: + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) + '@vitest/pretty-format@2.0.4': dependencies: tinyrainbow: 1.2.0 + '@vitest/pretty-format@2.1.2': + dependencies: + tinyrainbow: 1.2.0 + '@vitest/runner@2.0.4': dependencies: '@vitest/utils': 2.0.4 pathe: 1.1.2 + '@vitest/runner@2.1.2': + dependencies: + '@vitest/utils': 2.1.2 + pathe: 1.1.2 + '@vitest/snapshot@2.0.4': dependencies: '@vitest/pretty-format': 2.0.4 - magic-string: 0.30.10 + magic-string: 0.30.12 + pathe: 1.1.2 + + '@vitest/snapshot@2.1.2': + dependencies: + '@vitest/pretty-format': 2.1.2 + magic-string: 0.30.12 pathe: 1.1.2 '@vitest/spy@2.0.4': dependencies: tinyspy: 3.0.0 + '@vitest/spy@2.1.2': + dependencies: + tinyspy: 3.0.0 + '@vitest/utils@2.0.4': dependencies: '@vitest/pretty-format': 2.0.4 @@ -24225,7 +31344,13 @@ snapshots: loupe: 3.1.1 tinyrainbow: 1.2.0 - '@vue-macros/common@1.10.0(rollup@4.14.1)(vue@3.3.7(typescript@5.4.5))': + '@vitest/utils@2.1.2': + dependencies: + '@vitest/pretty-format': 2.1.2 + loupe: 3.1.1 + tinyrainbow: 1.2.0 + + '@vue-macros/common@1.10.0(rollup@4.14.1)(vue@3.3.7(typescript@5.6.3))': dependencies: '@babel/types': 7.23.6 '@rollup/pluginutils': 5.1.0(rollup@4.14.1) @@ -24234,7 +31359,20 @@ snapshots: local-pkg: 0.5.0 magic-string-ast: 0.3.0 optionalDependencies: - vue: 3.3.7(typescript@5.4.5) + vue: 3.3.7(typescript@5.6.3) + transitivePeerDependencies: + - rollup + + '@vue-macros/common@1.10.0(rollup@4.14.1)(vue@3.4.35(typescript@5.6.3))': + dependencies: + '@babel/types': 7.23.6 + '@rollup/pluginutils': 5.1.0(rollup@4.14.1) + '@vue/compiler-sfc': 3.4.15 + ast-kit: 0.11.3(rollup@4.14.1) + local-pkg: 0.5.0 + magic-string-ast: 0.3.0 + optionalDependencies: + vue: 3.4.35(typescript@5.6.3) transitivePeerDependencies: - rollup @@ -24260,6 +31398,24 @@ snapshots: transitivePeerDependencies: - supports-color + '@vue/babel-plugin-jsx@1.2.2(@babel/core@7.25.2)': + dependencies: + '@babel/helper-module-imports': 7.22.15 + '@babel/helper-plugin-utils': 7.22.5 + '@babel/plugin-syntax-jsx': 7.24.1(@babel/core@7.25.2) + '@babel/template': 7.24.0 + '@babel/traverse': 7.24.1 + '@babel/types': 7.24.0 + '@vue/babel-helper-vue-transform-on': 1.2.2 + '@vue/babel-plugin-resolve-type': 1.2.2(@babel/core@7.25.2) + camelcase: 6.3.0 + html-tags: 3.3.1 + svg-tags: 1.0.0 + optionalDependencies: + '@babel/core': 7.25.2 + transitivePeerDependencies: + - supports-color + '@vue/babel-plugin-resolve-type@1.2.2(@babel/core@7.24.3)': dependencies: '@babel/code-frame': 7.24.7 @@ -24269,11 +31425,20 @@ snapshots: '@babel/parser': 7.25.3 '@vue/compiler-sfc': 3.4.15 + '@vue/babel-plugin-resolve-type@1.2.2(@babel/core@7.25.2)': + dependencies: + '@babel/code-frame': 7.24.7 + '@babel/core': 7.25.2 + '@babel/helper-module-imports': 7.22.15 + '@babel/helper-plugin-utils': 7.24.0 + '@babel/parser': 7.25.3 + '@vue/compiler-sfc': 3.4.15 + '@vue/babel-plugin-transform-vue-jsx@1.4.0(@babel/core@7.24.3)': dependencies: '@babel/core': 7.24.3 - '@babel/helper-module-imports': 7.24.7 - '@babel/plugin-syntax-jsx': 7.24.1(@babel/core@7.24.3) + '@babel/helper-module-imports': 7.25.7 + '@babel/plugin-syntax-jsx': 7.25.7(@babel/core@7.24.3) '@vue/babel-helper-vue-jsx-merge-props': 1.4.0 html-tags: 2.0.0 lodash.kebabcase: 4.1.1 @@ -24300,27 +31465,27 @@ snapshots: '@vue/babel-sugar-composition-api-inject-h@1.4.0(@babel/core@7.24.3)': dependencies: '@babel/core': 7.24.3 - '@babel/plugin-syntax-jsx': 7.24.1(@babel/core@7.24.3) + '@babel/plugin-syntax-jsx': 7.25.7(@babel/core@7.24.3) '@vue/babel-sugar-composition-api-render-instance@1.4.0(@babel/core@7.24.3)': dependencies: '@babel/core': 7.24.3 - '@babel/plugin-syntax-jsx': 7.24.1(@babel/core@7.24.3) + '@babel/plugin-syntax-jsx': 7.25.7(@babel/core@7.24.3) '@vue/babel-sugar-functional-vue@1.4.0(@babel/core@7.24.3)': dependencies: '@babel/core': 7.24.3 - '@babel/plugin-syntax-jsx': 7.24.1(@babel/core@7.24.3) + '@babel/plugin-syntax-jsx': 7.25.7(@babel/core@7.24.3) '@vue/babel-sugar-inject-h@1.4.0(@babel/core@7.24.3)': dependencies: '@babel/core': 7.24.3 - '@babel/plugin-syntax-jsx': 7.24.1(@babel/core@7.24.3) + '@babel/plugin-syntax-jsx': 7.25.7(@babel/core@7.24.3) '@vue/babel-sugar-v-model@1.4.0(@babel/core@7.24.3)': dependencies: '@babel/core': 7.24.3 - '@babel/plugin-syntax-jsx': 7.24.1(@babel/core@7.24.3) + '@babel/plugin-syntax-jsx': 7.25.7(@babel/core@7.24.3) '@vue/babel-helper-vue-jsx-merge-props': 1.4.0 '@vue/babel-plugin-transform-vue-jsx': 1.4.0(@babel/core@7.24.3) camelcase: 5.3.1 @@ -24332,7 +31497,7 @@ snapshots: '@vue/babel-sugar-v-on@1.4.0(@babel/core@7.24.3)': dependencies: '@babel/core': 7.24.3 - '@babel/plugin-syntax-jsx': 7.24.1(@babel/core@7.24.3) + '@babel/plugin-syntax-jsx': 7.25.7(@babel/core@7.24.3) '@vue/babel-plugin-transform-vue-jsx': 1.4.0(@babel/core@7.24.3) camelcase: 5.3.1 transitivePeerDependencies: @@ -24340,7 +31505,7 @@ snapshots: '@vue/compiler-core@3.3.12': dependencies: - '@babel/parser': 7.25.3 + '@babel/parser': 7.25.7 '@vue/shared': 3.3.12 estree-walker: 2.0.2 source-map-js: 1.2.0 @@ -24350,7 +31515,7 @@ snapshots: '@babel/parser': 7.24.1 '@vue/shared': 3.3.7 estree-walker: 2.0.2 - source-map-js: 1.2.0 + source-map-js: 1.2.1 '@vue/compiler-core@3.4.15': dependencies: @@ -24362,11 +31527,11 @@ snapshots: '@vue/compiler-core@3.4.19': dependencies: - '@babel/parser': 7.25.3 + '@babel/parser': 7.25.7 '@vue/shared': 3.4.19 entities: 4.5.0 estree-walker: 2.0.2 - source-map-js: 1.2.0 + source-map-js: 1.2.1 '@vue/compiler-core@3.4.27': dependencies: @@ -24378,11 +31543,11 @@ snapshots: '@vue/compiler-core@3.4.35': dependencies: - '@babel/parser': 7.25.3 + '@babel/parser': 7.25.7 '@vue/shared': 3.4.35 entities: 4.5.0 estree-walker: 2.0.2 - source-map-js: 1.2.0 + source-map-js: 1.2.1 '@vue/compiler-dom@3.3.12': dependencies: @@ -24431,7 +31596,7 @@ snapshots: '@vue/reactivity-transform': 3.3.12 '@vue/shared': 3.3.12 estree-walker: 2.0.2 - magic-string: 0.30.10 + magic-string: 0.30.12 postcss: 8.4.47 source-map-js: 1.2.0 @@ -24456,19 +31621,19 @@ snapshots: '@vue/compiler-ssr': 3.4.15 '@vue/shared': 3.4.15 estree-walker: 2.0.2 - magic-string: 0.30.10 + magic-string: 0.30.12 postcss: 8.4.47 source-map-js: 1.2.0 '@vue/compiler-sfc@3.4.19': dependencies: - '@babel/parser': 7.25.3 + '@babel/parser': 7.25.7 '@vue/compiler-core': 3.4.19 '@vue/compiler-dom': 3.4.19 '@vue/compiler-ssr': 3.4.19 '@vue/shared': 3.4.19 estree-walker: 2.0.2 - magic-string: 0.30.10 + magic-string: 0.30.11 postcss: 8.4.47 source-map-js: 1.2.0 @@ -24480,7 +31645,7 @@ snapshots: '@vue/compiler-ssr': 3.4.27 '@vue/shared': 3.4.27 estree-walker: 2.0.2 - magic-string: 0.30.10 + magic-string: 0.30.12 postcss: 8.4.47 source-map-js: 1.2.0 @@ -24492,9 +31657,9 @@ snapshots: '@vue/compiler-ssr': 3.4.35 '@vue/shared': 3.4.35 estree-walker: 2.0.2 - magic-string: 0.30.10 + magic-string: 0.30.12 postcss: 8.4.47 - source-map-js: 1.2.0 + source-map-js: 1.2.1 '@vue/compiler-ssr@3.3.12': dependencies: @@ -24601,25 +31766,27 @@ snapshots: dependencies: vue: 2.7.16 - '@vue/composition-api@1.7.2(vue@3.3.7(typescript@5.4.5))': + '@vue/composition-api@1.7.2(vue@3.3.7(typescript@5.6.3))': dependencies: - vue: 3.3.7(typescript@5.4.5) + vue: 3.3.7(typescript@5.6.3) optional: true - '@vue/composition-api@1.7.2(vue@3.4.15(typescript@5.4.5))': + '@vue/composition-api@1.7.2(vue@3.4.35(typescript@5.6.3))': dependencies: - vue: 3.4.15(typescript@5.4.5) + vue: 3.4.35(typescript@5.6.3) optional: true '@vue/devtools-api@6.5.1': {} + '@vue/devtools-api@6.6.4': {} + '@vue/reactivity-transform@3.3.12': dependencies: - '@babel/parser': 7.25.3 + '@babel/parser': 7.25.7 '@vue/compiler-core': 3.3.12 '@vue/shared': 3.3.12 estree-walker: 2.0.2 - magic-string: 0.30.10 + magic-string: 0.30.12 '@vue/reactivity-transform@3.3.7': dependencies: @@ -24627,7 +31794,7 @@ snapshots: '@vue/compiler-core': 3.3.7 '@vue/shared': 3.3.7 estree-walker: 2.0.2 - magic-string: 0.30.10 + magic-string: 0.30.12 '@vue/reactivity@3.3.12': dependencies: @@ -24705,35 +31872,35 @@ snapshots: '@vue/shared': 3.4.35 csstype: 3.1.3 - '@vue/server-renderer@3.3.12(vue@3.3.12(typescript@5.4.5))': + '@vue/server-renderer@3.3.12(vue@3.3.12(typescript@5.6.3))': dependencies: '@vue/compiler-ssr': 3.3.12 '@vue/shared': 3.3.12 - vue: 3.3.12(typescript@5.4.5) + vue: 3.3.12(typescript@5.6.3) - '@vue/server-renderer@3.3.7(vue@3.3.7(typescript@5.4.5))': + '@vue/server-renderer@3.3.7(vue@3.3.7(typescript@5.6.3))': dependencies: '@vue/compiler-ssr': 3.3.7 '@vue/shared': 3.3.7 - vue: 3.3.7(typescript@5.4.5) + vue: 3.3.7(typescript@5.6.3) - '@vue/server-renderer@3.4.15(vue@3.4.15(typescript@5.4.5))': + '@vue/server-renderer@3.4.15(vue@3.4.15(typescript@5.6.3))': dependencies: '@vue/compiler-ssr': 3.4.15 '@vue/shared': 3.4.15 - vue: 3.4.15(typescript@5.4.5) + vue: 3.4.15(typescript@5.6.3) - '@vue/server-renderer@3.4.27(vue@3.4.27(typescript@5.4.5))': + '@vue/server-renderer@3.4.27(vue@3.4.27(typescript@5.6.3))': dependencies: '@vue/compiler-ssr': 3.4.27 '@vue/shared': 3.4.27 - vue: 3.4.27(typescript@5.4.5) + vue: 3.4.27(typescript@5.6.3) - '@vue/server-renderer@3.4.35(vue@3.4.35(typescript@5.4.5))': + '@vue/server-renderer@3.4.35(vue@3.4.35(typescript@5.6.3))': dependencies: '@vue/compiler-ssr': 3.4.35 '@vue/shared': 3.4.35 - vue: 3.4.35(typescript@5.4.5) + vue: 3.4.35(typescript@5.6.3) '@vue/shared@3.3.12': {} @@ -24747,24 +31914,43 @@ snapshots: '@vue/shared@3.4.35': {} - '@vueuse/core@9.13.0(@vue/composition-api@1.7.2(vue@3.3.7(typescript@5.4.5)))(vue@3.3.7(typescript@5.4.5))': + '@vueuse/core@9.13.0(@vue/composition-api@1.7.2(vue@3.3.7(typescript@5.6.3)))(vue@3.3.7(typescript@5.6.3))': + dependencies: + '@types/web-bluetooth': 0.0.16 + '@vueuse/metadata': 9.13.0 + '@vueuse/shared': 9.13.0(@vue/composition-api@1.7.2(vue@3.3.7(typescript@5.6.3)))(vue@3.3.7(typescript@5.6.3)) + vue-demi: 0.14.10(@vue/composition-api@1.7.2(vue@3.3.7(typescript@5.6.3)))(vue@3.3.7(typescript@5.6.3)) + transitivePeerDependencies: + - '@vue/composition-api' + - vue + + '@vueuse/core@9.13.0(@vue/composition-api@1.7.2(vue@3.4.35(typescript@5.6.3)))(vue@3.4.35(typescript@5.6.3))': dependencies: '@types/web-bluetooth': 0.0.16 '@vueuse/metadata': 9.13.0 - '@vueuse/shared': 9.13.0(@vue/composition-api@1.7.2(vue@3.3.7(typescript@5.4.5)))(vue@3.3.7(typescript@5.4.5)) - vue-demi: 0.14.10(@vue/composition-api@1.7.2(vue@3.3.7(typescript@5.4.5)))(vue@3.3.7(typescript@5.4.5)) + '@vueuse/shared': 9.13.0(@vue/composition-api@1.7.2(vue@3.4.35(typescript@5.6.3)))(vue@3.4.35(typescript@5.6.3)) + vue-demi: 0.14.10(@vue/composition-api@1.7.2(vue@3.4.35(typescript@5.6.3)))(vue@3.4.35(typescript@5.6.3)) transitivePeerDependencies: - '@vue/composition-api' - vue + optional: true '@vueuse/metadata@9.13.0': {} - '@vueuse/shared@9.13.0(@vue/composition-api@1.7.2(vue@3.3.7(typescript@5.4.5)))(vue@3.3.7(typescript@5.4.5))': + '@vueuse/shared@9.13.0(@vue/composition-api@1.7.2(vue@3.3.7(typescript@5.6.3)))(vue@3.3.7(typescript@5.6.3))': + dependencies: + vue-demi: 0.14.10(@vue/composition-api@1.7.2(vue@3.3.7(typescript@5.6.3)))(vue@3.3.7(typescript@5.6.3)) + transitivePeerDependencies: + - '@vue/composition-api' + - vue + + '@vueuse/shared@9.13.0(@vue/composition-api@1.7.2(vue@3.4.35(typescript@5.6.3)))(vue@3.4.35(typescript@5.6.3))': dependencies: - vue-demi: 0.14.10(@vue/composition-api@1.7.2(vue@3.3.7(typescript@5.4.5)))(vue@3.3.7(typescript@5.4.5)) + vue-demi: 0.14.10(@vue/composition-api@1.7.2(vue@3.4.35(typescript@5.6.3)))(vue@3.4.35(typescript@5.6.3)) transitivePeerDependencies: - '@vue/composition-api' - vue + optional: true '@webassemblyjs/ast@1.12.1': dependencies: @@ -24876,18 +32062,22 @@ snapshots: dependencies: acorn: 8.12.0 + acorn-jsx@5.3.2(acorn@8.14.0): + dependencies: + acorn: 8.14.0 + acorn-typescript@1.4.13(acorn@8.14.0): dependencies: acorn: 8.14.0 acorn-walk@8.3.2: {} - acorn@8.11.2: {} - acorn@8.12.0: {} acorn@8.14.0: {} + address@1.2.2: {} + adler-32@1.2.0: dependencies: exit-on-epipe: 1.0.1 @@ -24917,14 +32107,14 @@ snapshots: '@babel/runtime': 7.25.0 '@types/js-cookie': 2.2.7 ahooks-v3-count: 1.0.0 - dayjs: 1.11.12 + dayjs: 1.11.13 intersection-observer: 0.12.2 js-cookie: 2.2.1 lodash: 4.17.21 react: 18.2.0 resize-observer-polyfill: 1.5.1 screenfull: 5.2.0 - tslib: 2.6.3 + tslib: 2.8.1 ajv-formats@2.1.1: dependencies: @@ -24934,6 +32124,11 @@ snapshots: dependencies: ajv: 6.12.6 + ajv-keywords@5.1.0(ajv@8.12.0): + dependencies: + ajv: 8.12.0 + fast-deep-equal: 3.1.3 + ajv@6.12.6: dependencies: fast-deep-equal: 3.1.3 @@ -24955,6 +32150,29 @@ snapshots: require-from-string: 2.0.2 uri-js: 4.4.1 + algoliasearch-helper@3.22.5(algoliasearch@4.24.0): + dependencies: + '@algolia/events': 4.0.1 + algoliasearch: 4.24.0 + + algoliasearch@4.24.0: + dependencies: + '@algolia/cache-browser-local-storage': 4.24.0 + '@algolia/cache-common': 4.24.0 + '@algolia/cache-in-memory': 4.24.0 + '@algolia/client-account': 4.24.0 + '@algolia/client-analytics': 4.24.0 + '@algolia/client-common': 4.24.0 + '@algolia/client-personalization': 4.24.0 + '@algolia/client-search': 4.24.0 + '@algolia/logger-common': 4.24.0 + '@algolia/logger-console': 4.24.0 + '@algolia/recommend': 4.24.0 + '@algolia/requester-browser-xhr': 4.24.0 + '@algolia/requester-common': 4.24.0 + '@algolia/requester-node-http': 4.24.0 + '@algolia/transporter': 4.24.0 + align-text@0.1.4: dependencies: kind-of: 3.2.2 @@ -24979,6 +32197,8 @@ snapshots: dependencies: type-fest: 1.4.0 + ansi-html-community@0.0.8: {} + ansi-regex@2.1.1: {} ansi-regex@3.0.1: {} @@ -25001,10 +32221,10 @@ snapshots: ansi-styles@6.2.1: {} - ant-design-vue@3.2.20(vue@3.3.7(typescript@5.4.5)): + ant-design-vue@3.2.20(vue@3.3.7(typescript@5.6.3)): dependencies: '@ant-design/colors': 6.0.0 - '@ant-design/icons-vue': 6.1.0(vue@3.3.7(typescript@5.4.5)) + '@ant-design/icons-vue': 6.1.0(vue@3.3.7(typescript@5.6.3)) '@babel/runtime': 7.23.2 '@ctrl/tinycolor': 3.6.1 '@simonwep/pickr': 1.8.2 @@ -25018,14 +32238,14 @@ snapshots: resize-observer-polyfill: 1.5.1 scroll-into-view-if-needed: 2.2.31 shallow-equal: 1.2.1 - vue: 3.3.7(typescript@5.4.5) - vue-types: 3.0.2(vue@3.3.7(typescript@5.4.5)) + vue: 3.3.7(typescript@5.6.3) + vue-types: 3.0.2(vue@3.3.7(typescript@5.6.3)) warning: 4.0.3 - ant-design-vue@4.0.6(vue@3.3.7(typescript@5.4.5)): + ant-design-vue@4.0.6(vue@3.3.7(typescript@5.6.3)): dependencies: '@ant-design/colors': 6.0.0 - '@ant-design/icons-vue': 7.0.1(vue@3.3.7(typescript@5.4.5)) + '@ant-design/icons-vue': 7.0.1(vue@3.3.7(typescript@5.6.3)) '@babel/runtime': 7.23.2 '@ctrl/tinycolor': 3.6.1 '@emotion/hash': 0.9.1 @@ -25044,14 +32264,14 @@ snapshots: shallow-equal: 1.2.1 stylis: 4.3.0 throttle-debounce: 5.0.0 - vue: 3.3.7(typescript@5.4.5) - vue-types: 3.0.2(vue@3.3.7(typescript@5.4.5)) + vue: 3.3.7(typescript@5.6.3) + vue-types: 3.0.2(vue@3.3.7(typescript@5.6.3)) warning: 4.0.3 - ant-design-vue@4.1.2(vue@3.4.15(typescript@5.4.5)): + ant-design-vue@4.1.2(vue@3.4.35(typescript@5.6.3)): dependencies: '@ant-design/colors': 6.0.0 - '@ant-design/icons-vue': 7.0.1(vue@3.4.15(typescript@5.4.5)) + '@ant-design/icons-vue': 7.0.1(vue@3.4.35(typescript@5.6.3)) '@babel/runtime': 7.25.0 '@ctrl/tinycolor': 3.6.1 '@emotion/hash': 0.9.2 @@ -25060,7 +32280,7 @@ snapshots: array-tree-filter: 2.1.0 async-validator: 4.2.5 csstype: 3.1.3 - dayjs: 1.11.12 + dayjs: 1.11.13 dom-align: 1.12.4 dom-scroll-into-view: 2.0.1 lodash: 4.17.21 @@ -25070,8 +32290,8 @@ snapshots: shallow-equal: 1.2.1 stylis: 4.3.0 throttle-debounce: 5.0.0 - vue: 3.4.15(typescript@5.4.5) - vue-types: 3.0.2(vue@3.4.15(typescript@5.4.5)) + vue: 3.4.35(typescript@5.6.3) + vue-types: 3.0.2(vue@3.4.35(typescript@5.6.3)) warning: 4.0.3 antd-style@3.6.2(@types/react@18.2.35)(antd@5.11.0(date-fns@2.30.0)(luxon@3.4.4)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0): @@ -25171,7 +32391,7 @@ snapshots: builder-util: 24.13.1 builder-util-runtime: 9.2.4 chromium-pickle-js: 0.2.0 - debug: 4.3.4 + debug: 4.3.7 dmg-builder: 24.13.3 ejs: 3.1.10 electron-publish: 24.13.1 @@ -25185,7 +32405,7 @@ snapshots: minimatch: 5.1.6 read-config-file: 6.3.2 sanitize-filename: 1.6.3 - semver: 7.5.4 + semver: 7.6.3 tar: 6.2.1 temp-file: 3.4.0 transitivePeerDependencies: @@ -25219,11 +32439,7 @@ snapshots: aria-hidden@1.2.4: dependencies: - tslib: 2.6.3 - - aria-query@5.3.0: - dependencies: - dequal: 2.0.3 + tslib: 2.8.1 aria-query@5.3.2: {} @@ -25314,6 +32530,8 @@ snapshots: astral-regex@2.0.0: optional: true + astring@1.9.0: {} + async-exit-hook@2.0.1: {} async-validator@4.2.5: {} @@ -25326,25 +32544,37 @@ snapshots: atob@2.1.2: {} + attr-accept@2.2.2: {} + author-regex@1.0.0: {} autoprefixer@10.4.16(postcss@8.4.35): dependencies: - browserslist: 4.22.1 - caniuse-lite: 1.0.30001561 + browserslist: 4.23.1 + caniuse-lite: 1.0.30001633 fraction.js: 4.3.7 normalize-range: 0.1.2 - picocolors: 1.0.0 + picocolors: 1.1.0 postcss: 8.4.35 postcss-value-parser: 4.2.0 autoprefixer@10.4.16(postcss@8.4.47): dependencies: - browserslist: 4.22.1 - caniuse-lite: 1.0.30001561 + browserslist: 4.23.1 + caniuse-lite: 1.0.30001633 fraction.js: 4.3.7 normalize-range: 0.1.2 - picocolors: 1.0.0 + picocolors: 1.1.0 + postcss: 8.4.47 + postcss-value-parser: 4.2.0 + + autoprefixer@10.4.20(postcss@8.4.47): + dependencies: + browserslist: 4.24.0 + caniuse-lite: 1.0.30001684 + fraction.js: 4.3.7 + normalize-range: 0.1.2 + picocolors: 1.1.1 postcss: 8.4.47 postcss-value-parser: 4.2.0 @@ -25366,7 +32596,7 @@ snapshots: axios@1.6.5: dependencies: - follow-redirects: 1.15.4(debug@4.3.4) + follow-redirects: 1.15.4 form-data: 4.0.0 proxy-from-env: 1.1.0 transitivePeerDependencies: @@ -25374,7 +32604,15 @@ snapshots: axios@1.7.2: dependencies: - follow-redirects: 1.15.6 + follow-redirects: 1.15.6(debug@4.3.7) + form-data: 4.0.0 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + + axios@1.7.7(debug@4.3.7): + dependencies: + follow-redirects: 1.15.6(debug@4.3.7) form-data: 4.0.0 proxy-from-env: 1.1.0 transitivePeerDependencies: @@ -25386,18 +32624,7 @@ snapshots: b-validate@1.5.3: {} - babel-jest@29.7.0(@babel/core@7.24.3): - dependencies: - '@babel/core': 7.24.3 - '@jest/transform': 29.7.0 - '@types/babel__core': 7.20.3 - babel-plugin-istanbul: 6.1.1 - babel-preset-jest: 29.6.3(@babel/core@7.24.3) - chalk: 4.1.2 - graceful-fs: 4.2.11 - slash: 3.0.0 - transitivePeerDependencies: - - supports-color + b4a@1.6.7: {} babel-jest@29.7.0(@babel/core@7.25.2): dependencies: @@ -25411,11 +32638,21 @@ snapshots: slash: 3.0.0 transitivePeerDependencies: - supports-color - optional: true + + babel-loader@9.2.1(@babel/core@7.25.2)(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))): + dependencies: + '@babel/core': 7.25.2 + find-cache-dir: 4.0.0 + schema-utils: 4.2.0 + webpack: 5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3)) + + babel-plugin-dynamic-import-node@2.3.3: + dependencies: + object.assign: 4.1.4 babel-plugin-istanbul@6.1.1: dependencies: - '@babel/helper-plugin-utils': 7.24.0 + '@babel/helper-plugin-utils': 7.25.7 '@istanbuljs/load-nyc-config': 1.1.0 '@istanbuljs/schema': 0.1.3 istanbul-lib-instrument: 5.2.1 @@ -25425,8 +32662,8 @@ snapshots: babel-plugin-jest-hoist@29.6.3: dependencies: - '@babel/template': 7.25.0 - '@babel/types': 7.25.2 + '@babel/template': 7.25.7 + '@babel/types': 7.25.7 '@types/babel__core': 7.20.3 '@types/babel__traverse': 7.20.3 @@ -25445,6 +32682,15 @@ snapshots: cosmiconfig: 7.1.0 resolve: 1.22.8 + babel-plugin-polyfill-corejs2@0.4.11(@babel/core@7.25.2): + dependencies: + '@babel/compat-data': 7.25.7 + '@babel/core': 7.25.2 + '@babel/helper-define-polyfill-provider': 0.6.3(@babel/core@7.25.2) + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + babel-plugin-polyfill-corejs2@0.4.6(@babel/core@7.25.2): dependencies: '@babel/compat-data': 7.24.1 @@ -25454,6 +32700,14 @@ snapshots: transitivePeerDependencies: - supports-color + babel-plugin-polyfill-corejs3@0.10.6(@babel/core@7.25.2): + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-define-polyfill-provider': 0.6.3(@babel/core@7.25.2) + core-js-compat: 3.38.1 + transitivePeerDependencies: + - supports-color + babel-plugin-polyfill-corejs3@0.8.6(@babel/core@7.25.2): dependencies: '@babel/core': 7.25.2 @@ -25469,6 +32723,13 @@ snapshots: transitivePeerDependencies: - supports-color + babel-plugin-polyfill-regenerator@0.6.2(@babel/core@7.25.2): + dependencies: + '@babel/core': 7.25.2 + '@babel/helper-define-polyfill-provider': 0.6.3(@babel/core@7.25.2) + transitivePeerDependencies: + - supports-color + babel-plugin-transform-replace-object-assign@2.0.0(@babel/core@7.25.2): dependencies: '@babel/core': 7.25.2 @@ -25511,20 +32772,12 @@ snapshots: '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.25.2) '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.25.2) '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.25.2) - optional: true - - babel-preset-jest@29.6.3(@babel/core@7.24.3): - dependencies: - '@babel/core': 7.24.3 - babel-plugin-jest-hoist: 29.6.3 - babel-preset-current-node-syntax: 1.0.1(@babel/core@7.24.3) babel-preset-jest@29.6.3(@babel/core@7.25.2): dependencies: '@babel/core': 7.25.2 babel-plugin-jest-hoist: 29.6.3 babel-preset-current-node-syntax: 1.0.1(@babel/core@7.25.2) - optional: true babel-preset-solid@1.8.4(@babel/core@7.23.2): dependencies: @@ -25540,6 +32793,30 @@ snapshots: balanced-match@1.0.2: {} + bare-events@2.5.0: + optional: true + + bare-fs@2.3.5: + dependencies: + bare-events: 2.5.0 + bare-path: 2.1.3 + bare-stream: 2.3.0 + optional: true + + bare-os@2.4.4: + optional: true + + bare-path@2.1.3: + dependencies: + bare-os: 2.4.4 + optional: true + + bare-stream@2.3.0: + dependencies: + b4a: 1.6.7 + streamx: 2.20.1 + optional: true + base64-js@1.5.1: {} base@0.11.2: @@ -25552,13 +32829,19 @@ snapshots: mixin-deep: 1.3.2 pascalcase: 0.1.1 + batch@0.6.1: {} + bcryptjs@2.4.3: {} + before-after-hook@2.2.3: {} + better-path-resolve@1.0.0: dependencies: is-windows: 1.0.2 - big-integer@1.6.51: {} + bidi-js@1.0.3: + dependencies: + require-from-string: 2.0.2 big.js@5.2.2: {} @@ -25629,6 +32912,11 @@ snapshots: transitivePeerDependencies: - supports-color + bonjour-service@1.2.1: + dependencies: + fast-deep-equal: 3.1.3 + multicast-dns: 7.2.5 + boolbase@1.0.0: {} boolean@3.2.0: @@ -25638,6 +32926,17 @@ snapshots: dependencies: '@popperjs/core': 2.11.8 + boxen@6.2.1: + dependencies: + ansi-align: 3.0.1 + camelcase: 6.3.0 + chalk: 4.1.2 + cli-boxes: 3.0.0 + string-width: 5.1.2 + type-fest: 2.19.0 + widest-line: 4.0.1 + wrap-ansi: 8.1.0 + boxen@7.0.0: dependencies: ansi-align: 3.0.1 @@ -25649,10 +32948,6 @@ snapshots: widest-line: 4.0.1 wrap-ansi: 8.1.0 - bplist-parser@0.2.0: - dependencies: - big-integer: 1.6.51 - brace-expansion@1.1.11: dependencies: balanced-match: 1.0.2 @@ -25681,23 +32976,13 @@ snapshots: dependencies: fill-range: 7.0.1 - breakword@1.0.6: + braces@3.0.3: dependencies: - wcwidth: 1.0.1 + fill-range: 7.1.1 - browserslist@4.22.1: - dependencies: - caniuse-lite: 1.0.30001633 - electron-to-chromium: 1.4.576 - node-releases: 2.0.13 - update-browserslist-db: 1.0.13(browserslist@4.22.1) - - browserslist@4.23.0: + breakword@1.0.6: dependencies: - caniuse-lite: 1.0.30001633 - electron-to-chromium: 1.4.832 - node-releases: 2.0.14 - update-browserslist-db: 1.1.0(browserslist@4.23.0) + wcwidth: 1.0.1 browserslist@4.23.1: dependencies: @@ -25706,6 +32991,13 @@ snapshots: node-releases: 2.0.14 update-browserslist-db: 1.1.0(browserslist@4.23.1) + browserslist@4.24.0: + dependencies: + caniuse-lite: 1.0.30001684 + electron-to-chromium: 1.5.33 + node-releases: 2.0.18 + update-browserslist-db: 1.1.0(browserslist@4.24.0) + bs-logger@0.2.6: dependencies: fast-json-stable-stringify: 2.1.0 @@ -25729,13 +33021,18 @@ snapshots: base64-js: 1.5.1 ieee754: 1.2.1 + buffer@6.0.3: + dependencies: + base64-js: 1.5.1 + ieee754: 1.2.1 + bufferutil@4.0.8: dependencies: node-gyp-build: 4.7.1 builder-util-runtime@9.2.4: dependencies: - debug: 4.3.4 + debug: 4.3.7 sax: 1.3.0 transitivePeerDependencies: - supports-color @@ -25749,7 +33046,7 @@ snapshots: builder-util-runtime: 9.2.4 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.4 + debug: 4.3.7 fs-extra: 10.1.0 http-proxy-agent: 5.0.0 https-proxy-agent: 5.0.1 @@ -25766,9 +33063,9 @@ snapshots: esbuild: 0.20.2 node-eval: 2.0.0 - bundle-name@3.0.0: + bundle-name@4.1.0: dependencies: - run-applescript: 5.0.0 + run-applescript: 7.0.0 bundle-require@5.0.0(esbuild@0.20.2): dependencies: @@ -25827,6 +33124,18 @@ snapshots: cacheable-lookup@5.0.4: {} + cacheable-lookup@7.0.0: {} + + cacheable-request@10.2.14: + dependencies: + '@types/http-cache-semantics': 4.0.4 + get-stream: 6.0.1 + http-cache-semantics: 4.1.1 + keyv: 4.5.4 + mimic-response: 4.0.0 + normalize-url: 8.0.1 + responselike: 3.0.0 + cacheable-request@7.0.4: dependencies: clone-response: 1.0.3 @@ -25847,6 +33156,11 @@ snapshots: callsites@3.1.0: {} + camel-case@4.1.2: + dependencies: + pascal-case: 3.1.2 + tslib: 2.6.3 + camelcase-css@2.0.1: {} camelcase-keys@6.2.2: @@ -25863,15 +33177,17 @@ snapshots: camelcase@7.0.1: {} + camera-controls@2.9.0(three@0.168.0): + dependencies: + three: 0.168.0 + caniuse-api@3.0.0: dependencies: - browserslist: 4.23.1 - caniuse-lite: 1.0.30001633 + browserslist: 4.24.0 + caniuse-lite: 1.0.30001684 lodash.memoize: 4.1.2 lodash.uniq: 4.5.0 - caniuse-lite@1.0.30001561: {} - caniuse-lite@1.0.30001633: {} caniuse-lite@1.0.30001684: {} @@ -25900,6 +33216,10 @@ snapshots: dependencies: chalk: 4.1.2 + chalk-template@1.1.0: + dependencies: + chalk: 5.3.0 + chalk@1.1.3: dependencies: ansi-styles: 2.2.1 @@ -25930,14 +33250,39 @@ snapshots: char-regex@1.0.2: {} + character-entities-html4@2.1.0: {} + + character-entities-legacy@3.0.0: {} + character-entities@2.0.2: {} + character-reference-invalid@2.0.1: {} + chardet@0.4.2: {} chardet@0.7.0: {} check-error@2.1.1: {} + cheerio-select@2.1.0: + dependencies: + boolbase: 1.0.0 + css-select: 5.1.0 + css-what: 6.1.0 + domelementtype: 2.3.0 + domhandler: 5.0.3 + domutils: 3.1.0 + + cheerio@1.0.0-rc.12: + dependencies: + cheerio-select: 2.1.0 + dom-serializer: 2.0.0 + domhandler: 5.0.3 + domutils: 3.1.0 + htmlparser2: 8.0.2 + parse5: 7.1.2 + parse5-htmlparser2-tree-adapter: 7.0.0 + chokidar@3.5.3: dependencies: anymatch: 3.1.3 @@ -25966,6 +33311,8 @@ snapshots: dependencies: readdirp: 4.0.2 + chownr@1.1.4: {} + chownr@2.0.0: {} chrome-trace-event@1.0.3: {} @@ -25983,12 +33330,20 @@ snapshots: isobject: 3.0.1 static-extend: 0.1.2 + class-variance-authority@0.7.0: + dependencies: + clsx: 2.0.0 + classcat@5.0.5: {} classnames@2.3.2: {} classnames@2.5.1: {} + clean-css@5.3.3: + dependencies: + source-map: 0.6.1 + clean-stack@2.2.0: {} clear-module@4.1.2: @@ -26072,6 +33427,12 @@ snapshots: strip-ansi: 6.0.1 wrap-ansi: 7.0.0 + clone-deep@4.0.1: + dependencies: + is-plain-object: 2.0.4 + kind-of: 6.0.3 + shallow-clone: 3.0.1 + clone-response@1.0.3: dependencies: mimic-response: 1.0.1 @@ -26082,6 +33443,10 @@ snapshots: clsx@1.2.1: {} + clsx@2.0.0: {} + + clsx@2.1.1: {} + co@4.6.0: {} code-block-writer@12.0.0: {} @@ -26095,6 +33460,8 @@ snapshots: codepage@1.15.0: {} + collapse-white-space@2.1.0: {} + collect-v8-coverage@1.0.2: {} collection-visit@1.0.0: @@ -26131,20 +33498,28 @@ snapshots: color-convert: 2.0.1 color-string: 1.9.1 + colord@2.9.3: {} + colorette@2.0.20: {} + combine-promises@1.2.0: {} + combined-stream@1.0.8: dependencies: delayed-stream: 1.0.0 comma-separated-tokens@2.0.3: {} + command-exists-promise@2.0.2: {} + commander@10.0.1: {} commander@11.0.0: {} commander@11.1.0: {} + commander@12.1.0: {} + commander@2.14.1: {} commander@2.17.1: {} @@ -26169,6 +33544,16 @@ snapshots: has-own-prop: 2.0.0 repeat-string: 1.6.1 + comment-json@4.2.5: + dependencies: + array-timsort: 1.0.3 + core-util-is: 1.0.3 + esprima: 4.0.1 + has-own-prop: 2.0.0 + repeat-string: 1.6.1 + + common-path-prefix@3.0.0: {} + compare-func@2.0.0: dependencies: array-ify: 1.0.0 @@ -26230,19 +33615,36 @@ snapshots: confbox@0.1.7: {} + config-chain@1.1.13: + dependencies: + ini: 1.3.8 + proto-list: 1.2.4 + config-file-ts@0.2.6: dependencies: glob: 10.3.16 - typescript: 5.4.5 + typescript: 5.6.3 - configstore@5.0.1: + configstore@6.0.0: dependencies: - dot-prop: 5.3.0 + dot-prop: 6.0.1 graceful-fs: 4.2.11 - make-dir: 3.1.0 - unique-string: 2.0.0 + unique-string: 3.0.0 write-file-atomic: 3.0.3 - xdg-basedir: 4.0.0 + xdg-basedir: 5.1.0 + + connect-history-api-fallback@1.6.0: {} + + connect-history-api-fallback@2.0.0: {} + + connect@3.7.0: + dependencies: + debug: 2.6.9 + finalhandler: 1.1.2 + parseurl: 1.3.3 + utils-merge: 1.0.1 + transitivePeerDependencies: + - supports-color consola@2.15.3: {} @@ -26264,6 +33666,8 @@ snapshots: ejs: 3.1.10 lodash: 4.17.21 + consolidated-events@2.0.2: {} + content-disposition@0.5.2: {} content-disposition@0.5.4: @@ -26312,13 +33716,31 @@ snapshots: copy-descriptor@0.1.1: {} + copy-text-to-clipboard@3.2.0: {} + copy-to-clipboard@3.3.3: dependencies: toggle-selection: 1.0.6 + copy-webpack-plugin@11.0.0(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))): + dependencies: + fast-glob: 3.3.2 + glob-parent: 6.0.2 + globby: 13.2.2 + normalize-path: 3.0.0 + schema-utils: 4.2.0 + serialize-javascript: 6.0.2 + webpack: 5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3)) + core-js-compat@3.33.2: dependencies: - browserslist: 4.23.1 + browserslist: 4.24.0 + + core-js-compat@3.38.1: + dependencies: + browserslist: 4.24.0 + + core-js-pure@3.38.1: {} core-js@2.6.12: {} @@ -26346,14 +33768,14 @@ snapshots: object-assign: 4.1.1 vary: 1.1.2 - cosmiconfig-typescript-loader@4.4.0(@types/node@20.5.1)(cosmiconfig@8.3.6(typescript@5.4.5))(ts-node@10.9.1(@types/node@20.5.1)(typescript@5.4.5))(typescript@5.4.5): + cosmiconfig-typescript-loader@4.4.0(@types/node@20.5.1)(cosmiconfig@8.3.6(typescript@5.6.3))(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@20.5.1)(typescript@5.6.3))(typescript@5.6.3): dependencies: '@types/node': 20.5.1 - cosmiconfig: 8.3.6(typescript@5.4.5) - ts-node: 10.9.1(@types/node@20.5.1)(typescript@5.4.5) - typescript: 5.4.5 + cosmiconfig: 8.3.6(typescript@5.6.3) + ts-node: 10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@20.5.1)(typescript@5.6.3) + typescript: 5.6.3 - cosmiconfig@7.1.0: + cosmiconfig@6.0.0: dependencies: '@types/parse-json': 4.0.1 import-fresh: 3.3.0 @@ -26361,12 +33783,13 @@ snapshots: path-type: 4.0.0 yaml: 1.10.2 - cosmiconfig@8.0.0: + cosmiconfig@7.1.0: dependencies: + '@types/parse-json': 4.0.1 import-fresh: 3.3.0 - js-yaml: 4.1.0 parse-json: 5.2.0 path-type: 4.0.0 + yaml: 1.10.2 cosmiconfig@8.3.6(typescript@5.3.3): dependencies: @@ -26377,14 +33800,14 @@ snapshots: optionalDependencies: typescript: 5.3.3 - cosmiconfig@8.3.6(typescript@5.4.5): + cosmiconfig@8.3.6(typescript@5.6.3): dependencies: import-fresh: 3.3.0 js-yaml: 4.1.0 parse-json: 5.2.0 path-type: 4.0.0 optionalDependencies: - typescript: 5.4.5 + typescript: 5.6.3 crc-32@1.2.2: {} @@ -26393,13 +33816,13 @@ snapshots: buffer: 5.7.1 optional: true - create-jest@29.7.0(@types/node@18.19.67)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@types/node@18.19.67)(typescript@5.4.5)): + create-jest@29.7.0(@types/node@18.19.67)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@18.19.67)(typescript@5.4.5)): dependencies: '@jest/types': 29.6.3 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 - jest-config: 29.7.0(@types/node@18.19.67)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@types/node@18.19.67)(typescript@5.4.5)) + jest-config: 29.7.0(@types/node@18.19.67)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@18.19.67)(typescript@5.4.5)) jest-util: 29.7.0 prompts: 2.4.2 transitivePeerDependencies: @@ -26446,97 +33869,159 @@ snapshots: crypto-js@4.2.0: {} - crypto-random-string@2.0.0: {} + crypto-random-string@4.0.0: + dependencies: + type-fest: 1.4.0 - cspell-dictionary@6.31.3: + cspell-config-lib@8.14.2: dependencies: - '@cspell/cspell-pipe': 6.31.3 - '@cspell/cspell-types': 6.31.3 - cspell-trie-lib: 6.31.3 - fast-equals: 4.0.3 - gensequence: 5.0.2 + '@cspell/cspell-types': 8.14.2 + comment-json: 4.2.5 + yaml: 2.5.1 - cspell-gitignore@6.31.3: + cspell-dictionary@8.14.2: dependencies: - cspell-glob: 6.31.3 - find-up: 5.0.0 + '@cspell/cspell-pipe': 8.14.2 + '@cspell/cspell-types': 8.14.2 + cspell-trie-lib: 8.14.2 + fast-equals: 5.0.1 - cspell-glob@6.31.3: + cspell-gitignore@8.14.2: dependencies: - micromatch: 4.0.5 + '@cspell/url': 8.14.2 + cspell-glob: 8.14.2 + cspell-io: 8.14.2 + find-up-simple: 1.0.0 - cspell-grammar@6.31.3: + cspell-glob@8.14.2: dependencies: - '@cspell/cspell-pipe': 6.31.3 - '@cspell/cspell-types': 6.31.3 + '@cspell/url': 8.14.2 + micromatch: 4.0.8 - cspell-io@6.31.3(encoding@0.1.13): + cspell-grammar@8.14.2: dependencies: - '@cspell/cspell-service-bus': 6.31.3 - node-fetch: 2.7.0(encoding@0.1.13) - transitivePeerDependencies: - - encoding + '@cspell/cspell-pipe': 8.14.2 + '@cspell/cspell-types': 8.14.2 + + cspell-io@8.14.2: + dependencies: + '@cspell/cspell-service-bus': 8.14.2 + '@cspell/url': 8.14.2 - cspell-lib@6.31.3(encoding@0.1.13): + cspell-lib@8.14.2: dependencies: - '@cspell/cspell-bundled-dicts': 6.31.3 - '@cspell/cspell-pipe': 6.31.3 - '@cspell/cspell-types': 6.31.3 - '@cspell/strong-weak-map': 6.31.3 + '@cspell/cspell-bundled-dicts': 8.14.2 + '@cspell/cspell-pipe': 8.14.2 + '@cspell/cspell-resolver': 8.14.2 + '@cspell/cspell-types': 8.14.2 + '@cspell/dynamic-import': 8.14.2 + '@cspell/filetypes': 8.14.2 + '@cspell/strong-weak-map': 8.14.2 + '@cspell/url': 8.14.2 clear-module: 4.1.2 - comment-json: 4.2.3 - configstore: 5.0.1 - cosmiconfig: 8.0.0 - cspell-dictionary: 6.31.3 - cspell-glob: 6.31.3 - cspell-grammar: 6.31.3 - cspell-io: 6.31.3(encoding@0.1.13) - cspell-trie-lib: 6.31.3 - fast-equals: 4.0.3 - find-up: 5.0.0 - gensequence: 5.0.2 + comment-json: 4.2.5 + cspell-config-lib: 8.14.2 + cspell-dictionary: 8.14.2 + cspell-glob: 8.14.2 + cspell-grammar: 8.14.2 + cspell-io: 8.14.2 + cspell-trie-lib: 8.14.2 + env-paths: 3.0.0 + fast-equals: 5.0.1 + gensequence: 7.0.0 import-fresh: 3.3.0 resolve-from: 5.0.0 - resolve-global: 1.0.0 - vscode-languageserver-textdocument: 1.0.11 + vscode-languageserver-textdocument: 1.0.12 vscode-uri: 3.0.8 - transitivePeerDependencies: - - encoding + xdg-basedir: 5.1.0 - cspell-trie-lib@6.31.3: + cspell-trie-lib@8.14.2: dependencies: - '@cspell/cspell-pipe': 6.31.3 - '@cspell/cspell-types': 6.31.3 - gensequence: 5.0.2 + '@cspell/cspell-pipe': 8.14.2 + '@cspell/cspell-types': 8.14.2 + gensequence: 7.0.0 - cspell@6.31.3(encoding@0.1.13): + cspell@8.14.2: dependencies: - '@cspell/cspell-json-reporter': 6.31.3 - '@cspell/cspell-pipe': 6.31.3 - '@cspell/cspell-types': 6.31.3 - '@cspell/dynamic-import': 6.31.3 - chalk: 4.1.2 - commander: 10.0.1 - cspell-gitignore: 6.31.3 - cspell-glob: 6.31.3 - cspell-io: 6.31.3(encoding@0.1.13) - cspell-lib: 6.31.3(encoding@0.1.13) - fast-glob: 3.3.1 + '@cspell/cspell-json-reporter': 8.14.2 + '@cspell/cspell-pipe': 8.14.2 + '@cspell/cspell-types': 8.14.2 + '@cspell/dynamic-import': 8.14.2 + '@cspell/url': 8.14.2 + chalk: 5.3.0 + chalk-template: 1.1.0 + commander: 12.1.0 + cspell-dictionary: 8.14.2 + cspell-gitignore: 8.14.2 + cspell-glob: 8.14.2 + cspell-io: 8.14.2 + cspell-lib: 8.14.2 + fast-glob: 3.3.2 fast-json-stable-stringify: 2.1.0 - file-entry-cache: 6.0.1 - get-stdin: 8.0.0 - imurmurhash: 0.1.4 + file-entry-cache: 9.1.0 + get-stdin: 9.0.0 + semver: 7.6.3 + strip-ansi: 7.1.0 + + css-blank-pseudo@7.0.0(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-selector-parser: 6.1.0 + + css-declaration-sorter@7.2.0(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + + css-has-pseudo@7.0.0(postcss@8.4.47): + dependencies: + '@csstools/selector-specificity': 4.0.0(postcss-selector-parser@6.1.0) + postcss: 8.4.47 + postcss-selector-parser: 6.1.0 + postcss-value-parser: 4.2.0 + + css-loader@6.11.0(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))): + dependencies: + icss-utils: 5.1.0(postcss@8.4.47) + postcss: 8.4.47 + postcss-modules-extract-imports: 3.1.0(postcss@8.4.47) + postcss-modules-local-by-default: 4.0.5(postcss@8.4.47) + postcss-modules-scope: 3.2.0(postcss@8.4.47) + postcss-modules-values: 4.0.0(postcss@8.4.47) + postcss-value-parser: 4.2.0 semver: 7.5.4 - strip-ansi: 6.0.1 - vscode-uri: 3.0.8 - transitivePeerDependencies: - - encoding + optionalDependencies: + webpack: 5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3)) + + css-minimizer-webpack-plugin@5.0.1(clean-css@5.3.3)(lightningcss@1.28.2)(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))): + dependencies: + '@jridgewell/trace-mapping': 0.3.25 + cssnano: 6.1.2(postcss@8.4.47) + jest-worker: 29.7.0 + postcss: 8.4.47 + schema-utils: 4.2.0 + serialize-javascript: 6.0.2 + webpack: 5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3)) + optionalDependencies: + clean-css: 5.3.3 + lightningcss: 1.28.2 + + css-prefers-color-scheme@10.0.0(postcss@8.4.47): + dependencies: + postcss: 8.4.47 css-render@0.15.14: dependencies: '@emotion/hash': 0.8.0 csstype: 3.0.11 + css-select@4.3.0: + dependencies: + boolbase: 1.0.0 + css-what: 6.1.0 + domhandler: 4.3.1 + domutils: 2.8.0 + nth-check: 2.1.1 + css-select@5.1.0: dependencies: boolbase: 1.0.0 @@ -26548,7 +34033,7 @@ snapshots: css-tree@2.2.1: dependencies: mdn-data: 2.0.28 - source-map-js: 1.2.0 + source-map-js: 1.2.1 css-tree@2.3.1: dependencies: @@ -26559,14 +34044,71 @@ snapshots: css.escape@1.5.1: {} + cssdb@8.1.1: {} + cssesc@3.0.0: {} cssfilter@0.0.10: {} + cssnano-preset-advanced@6.1.2(postcss@8.4.47): + dependencies: + autoprefixer: 10.4.20(postcss@8.4.47) + browserslist: 4.24.0 + cssnano-preset-default: 6.1.2(postcss@8.4.47) + postcss: 8.4.47 + postcss-discard-unused: 6.0.5(postcss@8.4.47) + postcss-merge-idents: 6.0.3(postcss@8.4.47) + postcss-reduce-idents: 6.0.3(postcss@8.4.47) + postcss-zindex: 6.0.2(postcss@8.4.47) + + cssnano-preset-default@6.1.2(postcss@8.4.47): + dependencies: + browserslist: 4.24.0 + css-declaration-sorter: 7.2.0(postcss@8.4.47) + cssnano-utils: 4.0.2(postcss@8.4.47) + postcss: 8.4.47 + postcss-calc: 9.0.1(postcss@8.4.47) + postcss-colormin: 6.1.0(postcss@8.4.47) + postcss-convert-values: 6.1.0(postcss@8.4.47) + postcss-discard-comments: 6.0.2(postcss@8.4.47) + postcss-discard-duplicates: 6.0.3(postcss@8.4.47) + postcss-discard-empty: 6.0.3(postcss@8.4.47) + postcss-discard-overridden: 6.0.2(postcss@8.4.47) + postcss-merge-longhand: 6.0.5(postcss@8.4.47) + postcss-merge-rules: 6.1.1(postcss@8.4.47) + postcss-minify-font-values: 6.1.0(postcss@8.4.47) + postcss-minify-gradients: 6.0.3(postcss@8.4.47) + postcss-minify-params: 6.1.0(postcss@8.4.47) + postcss-minify-selectors: 6.0.4(postcss@8.4.47) + postcss-normalize-charset: 6.0.2(postcss@8.4.47) + postcss-normalize-display-values: 6.0.2(postcss@8.4.47) + postcss-normalize-positions: 6.0.2(postcss@8.4.47) + postcss-normalize-repeat-style: 6.0.2(postcss@8.4.47) + postcss-normalize-string: 6.0.2(postcss@8.4.47) + postcss-normalize-timing-functions: 6.0.2(postcss@8.4.47) + postcss-normalize-unicode: 6.1.0(postcss@8.4.47) + postcss-normalize-url: 6.0.2(postcss@8.4.47) + postcss-normalize-whitespace: 6.0.2(postcss@8.4.47) + postcss-ordered-values: 6.0.2(postcss@8.4.47) + postcss-reduce-initial: 6.1.0(postcss@8.4.47) + postcss-reduce-transforms: 6.0.2(postcss@8.4.47) + postcss-svgo: 6.0.3(postcss@8.4.47) + postcss-unique-selectors: 6.0.4(postcss@8.4.47) + + cssnano-utils@4.0.2(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + cssnano-utils@5.0.0(postcss@8.4.39): dependencies: postcss: 8.4.39 + cssnano@6.1.2(postcss@8.4.47): + dependencies: + cssnano-preset-default: 6.1.2(postcss@8.4.47) + lilconfig: 3.1.2 + postcss: 8.4.47 + csso@5.0.5: dependencies: css-tree: 2.2.1 @@ -26622,6 +34164,8 @@ snapshots: d3-ease@1.0.7: {} + d3-ease@3.0.1: {} + d3-geo-projection@2.1.2: dependencies: commander: 2.20.3 @@ -26672,14 +34216,16 @@ snapshots: d3-timer@1.0.10: {} + d3-timer@3.0.1: {} + d3-transition@3.0.1(d3-selection@3.0.0): dependencies: d3-color: 3.1.0 d3-dispatch: 3.0.1 - d3-ease: 1.0.7 + d3-ease: 3.0.1 d3-interpolate: 3.0.1 d3-selection: 3.0.0 - d3-timer: 1.0.10 + d3-timer: 3.0.1 d3-voronoi@1.1.2: {} @@ -26710,10 +34256,12 @@ snapshots: dayjs@1.11.10: {} - dayjs@1.11.12: {} + dayjs@1.11.13: {} de-indent@1.0.2: {} + debounce@1.2.1: {} + debug@2.6.9: dependencies: ms: 2.0.0 @@ -26721,16 +34269,17 @@ snapshots: debug@3.2.7: dependencies: ms: 2.1.3 + optional: true debug@4.3.4: dependencies: ms: 2.1.2 - debug@4.3.5: + debug@4.3.7: dependencies: - ms: 2.1.2 + ms: 2.1.3 - debug@4.3.7: + debug@4.4.0: dependencies: ms: 2.1.3 @@ -26797,17 +34346,16 @@ snapshots: deepmerge@4.3.1: {} - default-browser-id@3.0.0: + default-browser-id@5.0.0: {} + + default-browser@5.2.1: dependencies: - bplist-parser: 0.2.0 - untildify: 4.0.0 + bundle-name: 4.1.0 + default-browser-id: 5.0.0 - default-browser@4.0.0: + default-gateway@6.0.3: dependencies: - bundle-name: 3.0.0 - default-browser-id: 3.0.0 - execa: 7.2.0 - titleize: 3.0.0 + execa: 5.1.1 defaults@1.0.4: dependencies: @@ -26821,6 +34369,8 @@ snapshots: es-errors: 1.3.0 gopd: 1.0.1 + define-lazy-prop@2.0.0: {} + define-lazy-prop@3.0.0: {} define-properties@1.2.1: @@ -26846,6 +34396,17 @@ snapshots: defu@6.1.4: {} + del@6.1.1: + dependencies: + globby: 11.1.0 + graceful-fs: 4.2.11 + is-glob: 4.0.3 + is-path-cwd: 2.2.0 + is-path-inside: 3.0.3 + p-map: 4.0.0 + rimraf: 3.0.2 + slash: 3.0.0 + delayed-stream@1.0.0: {} delegate@3.2.0: {} @@ -26858,6 +34419,8 @@ snapshots: depd@2.0.0: {} + deprecation@2.3.1: {} + dequal@2.0.3: {} destr@2.0.3: {} @@ -26866,6 +34429,10 @@ snapshots: detect-browser@5.3.0: {} + detect-gpu@5.0.51: + dependencies: + webgl-constants: 1.1.1 + detect-indent@6.1.0: {} detect-libc@1.0.3: {} @@ -26876,8 +34443,25 @@ snapshots: detect-node-es@1.1.0: {} - detect-node@2.1.0: - optional: true + detect-node@2.1.0: {} + + detect-port-alt@1.1.6: + dependencies: + address: 1.2.2 + debug: 2.6.9 + transitivePeerDependencies: + - supports-color + + detect-port@1.6.1: + dependencies: + address: 1.2.2 + debug: 4.3.7 + transitivePeerDependencies: + - supports-color + + devlop@1.1.0: + dependencies: + dequal: 2.0.3 dezalgo@1.0.4: dependencies: @@ -26938,14 +34522,40 @@ snapshots: verror: 1.10.1 optional: true + dns-packet@5.6.1: + dependencies: + '@leichtgewicht/ip-codec': 2.0.5 + doctrine@3.0.0: dependencies: esutils: 2.0.3 + docusaurus-plugin-sass@0.2.5(@docusaurus/core@3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))))(sass@1.74.1)(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))): + dependencies: + '@docusaurus/core': 3.5.2(@docusaurus/types@3.5.2(@swc/core@1.7.26(@swc/helpers@0.5.3))(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@mdx-js/react@3.0.1(@types/react@18.2.35)(react@18.2.0))(@swc/core@1.7.26(@swc/helpers@0.5.3))(bufferutil@4.0.8)(eslint@8.57.0)(lightningcss@1.28.2)(react-dom@18.2.0(react@18.2.0))(react@18.2.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3))) + sass: 1.74.1 + sass-loader: 10.5.2(sass@1.74.1)(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))) + transitivePeerDependencies: + - fibers + - node-sass + - webpack + + docusaurus-preset-shiki-twoslash@1.1.41: + dependencies: + copy-text-to-clipboard: 3.2.0 + remark-shiki-twoslash: 3.1.3(typescript@5.5.4) + typescript: 5.5.4 + transitivePeerDependencies: + - supports-color + dom-accessibility-api@0.6.3: {} dom-align@1.12.4: {} + dom-converter@0.2.0: + dependencies: + utila: 0.4.0 + dom-helpers@5.2.1: dependencies: '@babel/runtime': 7.25.0 @@ -26958,6 +34568,12 @@ snapshots: domelementtype: 2.3.0 entities: 2.2.0 + dom-serializer@1.4.1: + dependencies: + domelementtype: 2.3.0 + domhandler: 4.3.1 + entities: 2.2.0 + dom-serializer@2.0.0: dependencies: domelementtype: 2.3.0 @@ -26972,17 +34588,29 @@ snapshots: dependencies: domelementtype: 1.3.1 + domhandler@4.3.1: + dependencies: + domelementtype: 2.3.0 + domhandler@5.0.3: dependencies: domelementtype: 2.3.0 - dompurify@3.1.6: {} + dompurify@3.2.3: + optionalDependencies: + '@types/trusted-types': 2.0.7 domutils@1.7.0: dependencies: dom-serializer: 0.2.2 domelementtype: 1.3.1 + domutils@2.8.0: + dependencies: + dom-serializer: 1.4.1 + domelementtype: 2.3.0 + domhandler: 4.3.1 + domutils@3.1.0: dependencies: dom-serializer: 2.0.0 @@ -26992,18 +34620,24 @@ snapshots: dot-case@3.0.4: dependencies: no-case: 3.0.4 - tslib: 2.6.3 + tslib: 2.8.1 dot-prop@5.3.0: dependencies: is-obj: 2.0.0 + dot-prop@6.0.1: + dependencies: + is-obj: 2.0.0 + dotenv-expand@11.0.6: dependencies: dotenv: 16.4.5 dotenv-expand@5.1.0: {} + dotenv-expand@8.0.3: {} + dotenv@16.4.5: {} dotenv@9.0.2: {} @@ -27012,6 +34646,8 @@ snapshots: dependencies: minimatch: 3.1.2 + draco3d@1.5.7: {} + duplexer2@0.1.4: dependencies: readable-stream: 2.3.8 @@ -27039,7 +34675,7 @@ snapshots: effect@3.10.16: dependencies: - fast-check: 3.23.2 + fast-check: 3.23.1 ejs@3.1.10: dependencies: @@ -27071,7 +34707,7 @@ snapshots: glob: 7.2.3 lodash: 4.17.21 parse-author: 2.0.0 - semver: 7.5.4 + semver: 7.6.3 tmp-promise: 3.0.3 optionalDependencies: '@types/fs-extra': 9.0.13 @@ -27114,14 +34750,14 @@ snapshots: chalk: 4.1.2 fs-extra: 10.1.0 lazy-val: 1.0.5 - mime: 2.5.2 + mime: 2.6.0 transitivePeerDependencies: - supports-color - electron-to-chromium@1.4.576: {} - electron-to-chromium@1.4.832: {} + electron-to-chromium@1.5.33: {} + electron-winstaller@5.3.1: dependencies: '@electron/asar': 3.2.10 @@ -27143,15 +34779,15 @@ snapshots: transitivePeerDependencies: - supports-color - element-plus@2.4.2(@vue/composition-api@1.7.2(vue@3.3.7(typescript@5.4.5)))(vue@3.3.7(typescript@5.4.5)): + element-plus@2.4.2(@vue/composition-api@1.7.2(vue@3.3.7(typescript@5.6.3)))(vue@3.3.7(typescript@5.6.3)): dependencies: '@ctrl/tinycolor': 3.6.1 - '@element-plus/icons-vue': 2.1.0(vue@3.3.7(typescript@5.4.5)) + '@element-plus/icons-vue': 2.1.0(vue@3.3.7(typescript@5.6.3)) '@floating-ui/dom': 1.5.3 '@popperjs/core': '@sxzz/popperjs-es@2.11.7' '@types/lodash': 4.14.202 '@types/lodash-es': 4.17.12 - '@vueuse/core': 9.13.0(@vue/composition-api@1.7.2(vue@3.3.7(typescript@5.4.5)))(vue@3.3.7(typescript@5.4.5)) + '@vueuse/core': 9.13.0(@vue/composition-api@1.7.2(vue@3.3.7(typescript@5.6.3)))(vue@3.3.7(typescript@5.6.3)) async-validator: 4.2.5 dayjs: 1.11.10 escape-html: 1.0.3 @@ -27160,20 +34796,26 @@ snapshots: lodash-unified: 1.0.3(@types/lodash-es@4.17.12)(lodash-es@4.17.21)(lodash@4.17.21) memoize-one: 6.0.0 normalize-wheel-es: 1.2.0 - vue: 3.3.7(typescript@5.4.5) + vue: 3.3.7(typescript@5.6.3) transitivePeerDependencies: - '@vue/composition-api' emittery@0.13.1: {} + emoji-regex-xs@1.0.0: {} + emoji-regex@10.3.0: {} emoji-regex@8.0.0: {} emoji-regex@9.2.2: {} + emojilib@2.4.0: {} + emojis-list@3.0.0: {} + emoticon@4.1.0: {} + encode-utf8@1.0.3: {} encodeurl@1.0.2: {} @@ -27209,6 +34851,8 @@ snapshots: env-paths@2.2.1: {} + env-paths@3.0.0: {} + envinfo@7.11.1: {} err-code@2.0.3: {} @@ -27222,6 +34866,8 @@ snapshots: dependencies: is-arrayish: 0.2.1 + error-stack-parser-es@0.1.5: {} + es-abstract@1.22.3: dependencies: array-buffer-byte-length: 1.0.0 @@ -27358,6 +35004,8 @@ snapshots: escalade@3.1.2: {} + escape-goat@4.0.0: {} + escape-html@1.0.3: {} escape-string-regexp@1.0.5: {} @@ -27468,14 +35116,44 @@ snapshots: estraverse@5.3.0: {} + estree-util-attach-comments@3.0.0: + dependencies: + '@types/estree': 1.0.6 + + estree-util-build-jsx@3.0.1: + dependencies: + '@types/estree-jsx': 1.0.5 + devlop: 1.1.0 + estree-util-is-identifier-name: 3.0.0 + estree-walker: 3.0.3 + + estree-util-is-identifier-name@3.0.0: {} + + estree-util-to-js@2.0.0: + dependencies: + '@types/estree-jsx': 1.0.5 + astring: 1.9.0 + source-map: 0.7.4 + + estree-util-value-to-estree@3.1.2: + dependencies: + '@types/estree': 1.0.6 + + estree-util-visit@2.0.0: + dependencies: + '@types/estree-jsx': 1.0.5 + '@types/unist': 3.0.2 + estree-walker@2.0.2: {} estree-walker@3.0.3: dependencies: - '@types/estree': 1.0.5 + '@types/estree': 1.0.6 esutils@2.0.3: {} + eta@2.2.0: {} + etag@1.8.1: {} eval@0.1.8: @@ -27520,11 +35198,23 @@ snapshots: human-signals: 4.3.1 is-stream: 3.0.0 merge-stream: 2.0.0 - npm-run-path: 5.1.0 + npm-run-path: 5.3.0 onetime: 6.0.0 signal-exit: 3.0.7 strip-final-newline: 3.0.0 + execa@8.0.0: + dependencies: + cross-spawn: 7.0.3 + get-stream: 8.0.1 + human-signals: 5.0.0 + is-stream: 3.0.0 + merge-stream: 2.0.0 + npm-run-path: 5.3.0 + onetime: 6.0.0 + signal-exit: 4.1.0 + strip-final-newline: 3.0.0 + execa@8.0.1: dependencies: cross-spawn: 7.0.3 @@ -27532,7 +35222,7 @@ snapshots: human-signals: 5.0.0 is-stream: 3.0.0 merge-stream: 2.0.0 - npm-run-path: 5.1.0 + npm-run-path: 5.3.0 onetime: 6.0.0 signal-exit: 4.1.0 strip-final-newline: 3.0.0 @@ -27553,6 +35243,8 @@ snapshots: transitivePeerDependencies: - supports-color + expand-template@2.0.3: {} + expand-tilde@2.0.2: dependencies: homedir-polyfill: 1.0.3 @@ -27684,7 +35376,7 @@ snapshots: extract-zip@2.0.1: dependencies: - debug: 4.3.4 + debug: 4.3.7 get-stream: 5.2.0 yauzl: 2.10.0 optionalDependencies: @@ -27701,11 +35393,11 @@ snapshots: '@types/object-path': 0.11.4 '@types/semver': 7.5.4 '@types/ua-parser-js': 0.7.39 - browserslist: 4.23.1 + browserslist: 4.24.0 caniuse-lite: 1.0.30001684 isbot: 3.8.0 object-path: 0.11.8 - semver: 7.5.4 + semver: 7.6.3 ua-parser-js: 1.0.37 farm-plugin-remove-console-darwin-arm64@0.1.8: @@ -27751,55 +35443,12 @@ snapshots: farm-plugin-remove-console-win32-ia32-msvc: 0.1.8 farm-plugin-remove-console-win32-x64-msvc: 0.1.8 - farm-plugin-replace-dirname-darwin-arm64@0.2.1: - optional: true - - farm-plugin-replace-dirname-darwin-x64@0.2.1: - optional: true - - farm-plugin-replace-dirname-linux-arm64-gnu@0.2.1: - optional: true - - farm-plugin-replace-dirname-linux-arm64-musl@0.2.1: - optional: true - - farm-plugin-replace-dirname-linux-x64-gnu@0.2.1: - optional: true - - farm-plugin-replace-dirname-linux-x64-musl@0.2.1: - optional: true - - farm-plugin-replace-dirname-win32-arm64-msvc@0.2.1: - optional: true - - farm-plugin-replace-dirname-win32-ia32-msvc@0.2.1: - optional: true - - farm-plugin-replace-dirname-win32-x64-msvc@0.2.1: - optional: true - - farm-plugin-replace-dirname@0.2.1: - dependencies: - '@changesets/cli': 2.27.2 - '@farmfe/utils': 0.0.1 - cac: 6.7.14 - optionalDependencies: - farm-plugin-replace-dirname-darwin-arm64: 0.2.1 - farm-plugin-replace-dirname-darwin-x64: 0.2.1 - farm-plugin-replace-dirname-linux-arm64-gnu: 0.2.1 - farm-plugin-replace-dirname-linux-arm64-musl: 0.2.1 - farm-plugin-replace-dirname-linux-x64-gnu: 0.2.1 - farm-plugin-replace-dirname-linux-x64-musl: 0.2.1 - farm-plugin-replace-dirname-win32-arm64-msvc: 0.2.1 - farm-plugin-replace-dirname-win32-ia32-msvc: 0.2.1 - farm-plugin-replace-dirname-win32-x64-msvc: 0.2.1 - farmup@0.1.5: dependencies: '@farmfe/core': link:packages/core tmp: 0.2.3 - fast-check@3.23.2: + fast-check@3.23.1: dependencies: pure-rand: 6.1.0 @@ -27807,7 +35456,9 @@ snapshots: fast-diff@1.3.0: {} - fast-equals@4.0.3: {} + fast-equals@5.0.1: {} + + fast-fifo@1.3.2: {} fast-glob@3.3.1: dependencies: @@ -27839,6 +35490,14 @@ snapshots: dependencies: reusify: 1.0.4 + fault@2.0.1: + dependencies: + format: 0.2.2 + + faye-websocket@0.11.4: + dependencies: + websocket-driver: 0.7.4 + fb-watchman@2.0.2: dependencies: bser: 2.1.1 @@ -27853,8 +35512,18 @@ snapshots: fecha@4.2.3: {} + feed@4.2.2: + dependencies: + xml-js: 1.6.11 + + fenceparser@1.1.1: {} + fflate@0.3.11: {} + fflate@0.6.10: {} + + fflate@0.8.2: {} + figures@2.0.0: dependencies: escape-string-regexp: 1.0.5 @@ -27863,15 +35532,24 @@ snapshots: dependencies: escape-string-regexp: 1.0.5 - figures@5.0.0: - dependencies: - escape-string-regexp: 5.0.0 - is-unicode-supported: 1.3.0 - file-entry-cache@6.0.1: dependencies: flat-cache: 3.1.1 + file-entry-cache@9.1.0: + dependencies: + flat-cache: 5.0.0 + + file-loader@6.2.0(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))): + dependencies: + loader-utils: 2.0.4 + schema-utils: 3.3.0 + webpack: 5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3)) + + file-selector@0.5.0: + dependencies: + tslib: 2.6.3 + file-size@1.0.0: {} filelist@1.0.4: @@ -27888,6 +35566,8 @@ snapshots: filesize@10.1.2: {} + filesize@8.0.7: {} + fill-range@4.0.0: dependencies: extend-shallow: 2.0.1 @@ -27899,8 +35579,24 @@ snapshots: dependencies: to-regex-range: 5.0.1 + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + filter-obj@1.1.0: {} + finalhandler@1.1.2: + dependencies: + debug: 2.6.9 + encodeurl: 1.0.2 + escape-html: 1.0.3 + on-finished: 2.3.0 + parseurl: 1.3.3 + statuses: 1.5.0 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + finalhandler@1.2.0: dependencies: debug: 2.6.9 @@ -27913,12 +35609,23 @@ snapshots: transitivePeerDependencies: - supports-color + find-cache-dir@4.0.0: + dependencies: + common-path-prefix: 3.0.0 + pkg-dir: 7.0.0 + find-root@1.1.0: {} + find-up-simple@1.0.0: {} + find-up@2.1.0: dependencies: locate-path: 2.0.0 + find-up@3.0.0: + dependencies: + locate-path: 3.0.0 + find-up@4.1.0: dependencies: locate-path: 5.0.0 @@ -27936,7 +35643,7 @@ snapshots: find-yarn-workspace-root2@1.2.16: dependencies: - micromatch: 4.0.5 + micromatch: 4.0.8 pkg-dir: 4.2.0 flat-cache@3.1.1: @@ -27945,8 +35652,17 @@ snapshots: keyv: 4.5.4 rimraf: 3.0.2 + flat-cache@5.0.0: + dependencies: + flatted: 3.3.1 + keyv: 4.5.4 + + flat@5.0.2: {} + flatted@3.2.9: {} + flatted@3.3.1: {} + flora-colossus@2.0.0: dependencies: debug: 4.3.7 @@ -27966,17 +35682,17 @@ snapshots: dependencies: tslib: 2.6.3 - focus-trap@7.5.4: + focus-trap@7.6.0: dependencies: tabbable: 6.2.0 follow-redirects@1.15.3: {} - follow-redirects@1.15.4(debug@4.3.4): - optionalDependencies: - debug: 4.3.4 + follow-redirects@1.15.4: {} - follow-redirects@1.15.6: {} + follow-redirects@1.15.6(debug@4.3.7): + optionalDependencies: + debug: 4.3.7 font-awesome@4.7.0: {} @@ -27991,7 +35707,28 @@ snapshots: cross-spawn: 7.0.3 signal-exit: 4.1.0 - fork-ts-checker-webpack-plugin@9.0.2(typescript@5.3.3)(webpack@5.92.1): + fork-ts-checker-webpack-plugin@6.5.3(eslint@8.57.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3)))(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))): + dependencies: + '@babel/code-frame': 7.24.7 + '@types/json-schema': 7.0.15 + chalk: 4.1.2 + chokidar: 3.6.0 + cosmiconfig: 6.0.0 + deepmerge: 4.3.1 + fs-extra: 9.1.0 + glob: 7.2.3 + memfs: 3.5.3 + minimatch: 3.1.2 + schema-utils: 2.7.0 + semver: 7.6.3 + tapable: 1.1.3 + typescript: 5.6.3 + webpack: 5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3)) + optionalDependencies: + eslint: 8.57.0 + vue-template-compiler: 2.7.16(vue@3.4.35(typescript@5.6.3)) + + fork-ts-checker-webpack-plugin@9.0.2(typescript@5.3.3)(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))): dependencies: '@babel/code-frame': 7.24.2 chalk: 4.1.2 @@ -28006,7 +35743,9 @@ snapshots: semver: 7.5.4 tapable: 2.2.1 typescript: 5.3.3 - webpack: 5.92.1 + webpack: 5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3)) + + form-data-encoder@2.1.4: {} form-data@4.0.0: dependencies: @@ -28014,6 +35753,8 @@ snapshots: combined-stream: 1.0.8 mime-types: 2.1.35 + format@0.2.2: {} + formidable@2.1.2: dependencies: dezalgo: 1.0.4 @@ -28031,8 +35772,18 @@ snapshots: dependencies: map-cache: 0.2.2 + framer-motion@11.11.1(@emotion/is-prop-valid@1.3.1)(react-dom@18.2.0(react@18.2.0))(react@18.2.0): + dependencies: + tslib: 2.6.3 + optionalDependencies: + '@emotion/is-prop-valid': 1.3.1 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + fresh@0.5.2: {} + fs-constants@1.0.0: {} + fs-extra@10.1.0: dependencies: graceful-fs: 4.2.11 @@ -28114,7 +35865,7 @@ snapshots: strip-ansi: 6.0.1 wide-align: 1.1.5 - gensequence@5.0.2: {} + gensequence@7.0.0: {} gensync@1.0.0-beta.2: {} @@ -28152,6 +35903,8 @@ snapshots: has-symbols: 1.0.3 hasown: 2.0.0 + get-own-enumerable-property-symbols@3.0.2: {} + get-package-info@1.0.0: dependencies: bluebird: 3.7.2 @@ -28165,7 +35918,7 @@ snapshots: get-port@7.1.0: {} - get-stdin@8.0.0: {} + get-stdin@9.0.0: {} get-stream@4.1.0: dependencies: @@ -28198,6 +35951,10 @@ snapshots: split2: 3.2.2 through2: 4.0.2 + github-from-package@0.0.0: {} + + github-slugger@1.5.0: {} + gl-matrix@3.4.3: {} glob-parent@5.1.2: @@ -28215,7 +35972,7 @@ snapshots: foreground-child: 3.1.1 jackspeak: 3.1.2 minimatch: 9.0.5 - minipass: 7.1.1 + minipass: 7.1.2 path-scurry: 1.11.1 glob@10.4.2: @@ -28227,6 +35984,15 @@ snapshots: package-json-from-dist: 1.0.0 path-scurry: 1.11.1 + glob@11.0.0: + dependencies: + foreground-child: 3.1.1 + jackspeak: 4.0.2 + minimatch: 10.0.1 + minipass: 7.1.2 + package-json-from-dist: 1.0.0 + path-scurry: 2.0.0 + glob@7.1.6: dependencies: fs.realpath: 1.0.0 @@ -28259,20 +36025,32 @@ snapshots: es6-error: 4.1.1 matcher: 3.0.0 roarr: 2.15.4 - semver: 7.5.4 + semver: 7.6.3 serialize-error: 7.0.1 optional: true + global-directory@4.0.1: + dependencies: + ini: 4.1.1 + global-dirs@0.1.1: dependencies: ini: 1.3.8 + global-dirs@3.0.1: + dependencies: + ini: 2.0.0 + global-modules@1.0.0: dependencies: global-prefix: 1.0.2 is-windows: 1.0.2 resolve-dir: 1.0.1 + global-modules@2.0.0: + dependencies: + global-prefix: 3.0.0 + global-prefix@1.0.2: dependencies: expand-tilde: 2.0.2 @@ -28281,6 +36059,12 @@ snapshots: is-windows: 1.0.2 which: 1.3.1 + global-prefix@3.0.0: + dependencies: + ini: 1.3.8 + kind-of: 6.0.3 + which: 1.3.1 + globals@11.12.0: {} globals@13.24.0: @@ -28300,8 +36084,18 @@ snapshots: merge2: 1.4.1 slash: 3.0.0 + globby@13.2.2: + dependencies: + dir-glob: 3.0.1 + fast-glob: 3.3.2 + ignore: 5.2.4 + merge2: 1.4.1 + slash: 4.0.0 + globrex@0.1.2: {} + glsl-noise@0.0.0: {} + good-listener@1.2.2: dependencies: delegate: 3.2.0 @@ -28324,6 +36118,22 @@ snapshots: p-cancelable: 2.1.1 responselike: 2.0.1 + got@12.6.1: + dependencies: + '@sindresorhus/is': 5.6.0 + '@szmarczak/http-timer': 5.0.1 + cacheable-lookup: 7.0.0 + cacheable-request: 10.2.14 + decompress-response: 6.0.0 + form-data-encoder: 2.1.4 + get-stream: 6.0.1 + http2-wrapper: 2.2.1 + lowercase-keys: 3.0.0 + p-cancelable: 3.0.0 + responselike: 3.0.0 + + graceful-fs@4.2.10: {} + graceful-fs@4.2.11: {} gradient-string@2.0.2: @@ -28339,10 +36149,19 @@ snapshots: dependencies: lodash: 4.17.21 + gray-matter@4.0.3: + dependencies: + js-yaml: 3.14.1 + kind-of: 6.0.3 + section-matter: 1.0.0 + strip-bom-string: 1.0.0 + gzip-size@6.0.0: dependencies: duplexer: 0.1.2 + handle-thing@2.0.1: {} + hard-rejection@2.1.0: {} has-ansi@2.0.0: @@ -28392,6 +36211,8 @@ snapshots: is-number: 3.0.0 kind-of: 4.0.0 + has-yarn@3.0.0: {} + has@1.0.4: {} hash-sum@1.0.2: {} @@ -28418,7 +36239,7 @@ snapshots: dependencies: '@types/hast': 2.3.10 hast-util-from-parse5: 7.1.2 - parse5: 7.1.2 + parse5: 7.2.1 vfile: 5.3.7 vfile-message: 3.1.4 @@ -28432,6 +36253,17 @@ snapshots: vfile-location: 4.1.0 web-namespaces: 2.0.1 + hast-util-from-parse5@8.0.1: + dependencies: + '@types/hast': 3.0.4 + '@types/unist': 3.0.2 + devlop: 1.1.0 + hastscript: 8.0.0 + property-information: 6.5.0 + vfile: 6.0.3 + vfile-location: 5.0.3 + web-namespaces: 2.0.1 + hast-util-is-element@2.1.3: dependencies: '@types/hast': 2.3.10 @@ -28441,6 +36273,91 @@ snapshots: dependencies: '@types/hast': 2.3.10 + hast-util-parse-selector@4.0.0: + dependencies: + '@types/hast': 3.0.4 + + hast-util-raw@9.0.4: + dependencies: + '@types/hast': 3.0.4 + '@types/unist': 3.0.2 + '@ungap/structured-clone': 1.2.0 + hast-util-from-parse5: 8.0.1 + hast-util-to-parse5: 8.0.0 + html-void-elements: 3.0.0 + mdast-util-to-hast: 13.2.0 + parse5: 7.1.2 + unist-util-position: 5.0.0 + unist-util-visit: 5.0.0 + vfile: 6.0.3 + web-namespaces: 2.0.1 + zwitch: 2.0.4 + + hast-util-to-estree@3.1.0: + dependencies: + '@types/estree': 1.0.6 + '@types/estree-jsx': 1.0.5 + '@types/hast': 3.0.4 + comma-separated-tokens: 2.0.3 + devlop: 1.1.0 + estree-util-attach-comments: 3.0.0 + estree-util-is-identifier-name: 3.0.0 + hast-util-whitespace: 3.0.0 + mdast-util-mdx-expression: 2.0.1 + mdast-util-mdx-jsx: 3.1.3 + mdast-util-mdxjs-esm: 2.0.1 + property-information: 6.5.0 + space-separated-tokens: 2.0.2 + style-to-object: 0.4.4 + unist-util-position: 5.0.0 + zwitch: 2.0.4 + transitivePeerDependencies: + - supports-color + + hast-util-to-html@9.0.3: + dependencies: + '@types/hast': 3.0.4 + '@types/unist': 3.0.2 + ccount: 2.0.1 + comma-separated-tokens: 2.0.3 + hast-util-whitespace: 3.0.0 + html-void-elements: 3.0.0 + mdast-util-to-hast: 13.2.0 + property-information: 6.5.0 + space-separated-tokens: 2.0.2 + stringify-entities: 4.0.4 + zwitch: 2.0.4 + + hast-util-to-jsx-runtime@2.3.0: + dependencies: + '@types/estree': 1.0.6 + '@types/hast': 3.0.4 + '@types/unist': 3.0.2 + comma-separated-tokens: 2.0.3 + devlop: 1.1.0 + estree-util-is-identifier-name: 3.0.0 + hast-util-whitespace: 3.0.0 + mdast-util-mdx-expression: 2.0.1 + mdast-util-mdx-jsx: 3.1.3 + mdast-util-mdxjs-esm: 2.0.1 + property-information: 6.5.0 + space-separated-tokens: 2.0.2 + style-to-object: 1.0.8 + unist-util-position: 5.0.0 + vfile-message: 4.0.2 + transitivePeerDependencies: + - supports-color + + hast-util-to-parse5@8.0.0: + dependencies: + '@types/hast': 3.0.4 + comma-separated-tokens: 2.0.3 + devlop: 1.1.0 + property-information: 6.5.0 + space-separated-tokens: 2.0.2 + web-namespaces: 2.0.1 + zwitch: 2.0.4 + hast-util-to-text@3.1.2: dependencies: '@types/hast': 2.3.10 @@ -28450,6 +36367,10 @@ snapshots: hast-util-whitespace@2.0.1: {} + hast-util-whitespace@3.0.0: + dependencies: + '@types/hast': 3.0.4 + hastscript@7.2.0: dependencies: '@types/hast': 2.3.10 @@ -28458,6 +36379,14 @@ snapshots: property-information: 6.5.0 space-separated-tokens: 2.0.2 + hastscript@8.0.0: + dependencies: + '@types/hast': 3.0.4 + comma-separated-tokens: 2.0.3 + hast-util-parse-selector: 4.0.0 + property-information: 6.5.0 + space-separated-tokens: 2.0.2 + he@1.2.0: {} hexoid@1.0.0: {} @@ -28477,6 +36406,8 @@ snapshots: tiny-warning: 1.0.3 value-equal: 1.0.1 + hls.js@1.3.5: {} + hoist-non-react-statics@3.3.2: dependencies: react-is: 16.13.1 @@ -28493,10 +36424,37 @@ snapshots: dependencies: lru-cache: 6.0.0 + hpack.js@2.1.6: + dependencies: + inherits: 2.0.4 + obuf: 1.1.2 + readable-stream: 2.3.8 + wbuf: 1.7.3 + html-entities@2.3.3: {} html-escaper@2.0.2: {} + html-minifier-terser@6.1.0: + dependencies: + camel-case: 4.1.2 + clean-css: 5.3.3 + commander: 8.3.0 + he: 1.2.0 + param-case: 3.0.4 + relateurl: 0.2.7 + terser: 5.31.1 + + html-minifier-terser@7.2.0: + dependencies: + camel-case: 4.1.2 + clean-css: 5.3.3 + commander: 10.0.1 + entities: 4.5.0 + param-case: 3.0.4 + relateurl: 0.2.7 + terser: 5.31.1 + html-tags@2.0.0: {} html-tags@3.3.1: {} @@ -28509,6 +36467,18 @@ snapshots: readable-stream: 1.0.34 through2: 0.4.2 + html-void-elements@3.0.0: {} + + html-webpack-plugin@5.6.0(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))): + dependencies: + '@types/html-minifier-terser': 6.1.0 + html-minifier-terser: 6.1.0 + lodash: 4.17.21 + pretty-error: 4.0.0 + tapable: 2.2.1 + optionalDependencies: + webpack: 5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3)) + htmlparser2@3.10.1: dependencies: domelementtype: 1.3.1 @@ -28518,6 +36488,20 @@ snapshots: inherits: 2.0.4 readable-stream: 3.6.2 + htmlparser2@6.1.0: + dependencies: + domelementtype: 2.3.0 + domhandler: 4.3.1 + domutils: 2.8.0 + entities: 2.2.0 + + htmlparser2@8.0.2: + dependencies: + domelementtype: 2.3.0 + domhandler: 5.0.3 + domutils: 3.1.0 + entities: 4.5.0 + http-assert@1.5.0: dependencies: deep-equal: 1.0.1 @@ -28525,6 +36509,8 @@ snapshots: http-cache-semantics@4.1.1: {} + http-deceiver@1.2.7: {} + http-errors@1.6.3: dependencies: depd: 1.1.2 @@ -28548,6 +36534,8 @@ snapshots: statuses: 2.0.1 toidentifier: 1.0.1 + http-parser-js@0.5.8: {} + http-proxy-agent@5.0.0: dependencies: '@tootallnate/once': 2.0.0 @@ -28556,21 +36544,22 @@ snapshots: transitivePeerDependencies: - supports-color - http-proxy-middleware@3.0.0: + http-proxy-middleware@2.0.7(@types/express@4.17.21): dependencies: '@types/http-proxy': 1.17.14 - debug: 4.3.4 - http-proxy: 1.18.1(debug@4.3.4) + http-proxy: 1.18.1(debug@4.3.7) is-glob: 4.0.3 is-plain-obj: 3.0.0 - micromatch: 4.0.5 + micromatch: 4.0.8 + optionalDependencies: + '@types/express': 4.17.21 transitivePeerDependencies: - - supports-color + - debug - http-proxy@1.18.1(debug@4.3.4): + http-proxy@1.18.1(debug@4.3.7): dependencies: eventemitter3: 4.0.7 - follow-redirects: 1.15.4(debug@4.3.4) + follow-redirects: 1.15.6(debug@4.3.7) requires-port: 1.0.0 transitivePeerDependencies: - debug @@ -28580,6 +36569,11 @@ snapshots: quick-lru: 5.1.1 resolve-alpn: 1.2.1 + http2-wrapper@2.2.1: + dependencies: + quick-lru: 5.1.1 + resolve-alpn: 1.2.1 + https-proxy-agent@5.0.1: dependencies: agent-base: 6.0.2 @@ -28615,12 +36609,20 @@ snapshots: dependencies: safer-buffer: 2.1.2 + icss-utils@5.1.0(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + ieee754@1.2.1: {} ignore@5.2.4: {} image-size@0.5.5: {} + image-size@1.1.1: + dependencies: + queue: 6.0.2 + immediate@3.0.6: {} immer@10.0.3: {} @@ -28634,12 +36636,14 @@ snapshots: parent-module: 1.0.1 resolve-from: 4.0.0 + import-lazy@4.0.0: {} + import-local@3.1.0: dependencies: pkg-dir: 4.2.0 resolve-cwd: 3.0.0 - import-meta-resolve@2.2.2: {} + import-meta-resolve@4.1.0: {} importx@0.4.3: dependencies: @@ -28647,7 +36651,7 @@ snapshots: debug: 4.3.7 esbuild: 0.20.2 jiti: 2.0.0-beta.2 - jiti-v1: jiti@1.21.0 + jiti-v1: jiti@1.21.6 pathe: 1.1.2 pkg-types: 1.1.3 tsx: 4.17.0 @@ -28660,6 +36664,8 @@ snapshots: infer-owner@1.0.4: {} + infima@0.2.0-alpha.44: {} + inflight@1.0.6: dependencies: once: 1.4.0 @@ -28671,8 +36677,14 @@ snapshots: ini@1.3.8: {} + ini@2.0.0: {} + + ini@4.1.1: {} + inline-style-parser@0.1.1: {} + inline-style-parser@0.2.4: {} + inquirer@3.0.6: dependencies: ansi-escapes: 1.4.0 @@ -28707,24 +36719,6 @@ snapshots: through: 2.3.8 wrap-ansi: 6.2.0 - inquirer@9.2.12: - dependencies: - '@ljharb/through': 2.3.13 - ansi-escapes: 4.3.2 - chalk: 5.3.0 - cli-cursor: 3.1.0 - cli-width: 4.1.0 - external-editor: 3.1.0 - figures: 5.0.0 - lodash: 4.17.21 - mute-stream: 1.0.0 - ora: 5.4.1 - run-async: 3.0.0 - rxjs: 7.8.1 - string-width: 4.2.3 - strip-ansi: 6.0.1 - wrap-ansi: 6.2.0 - inquirer@9.2.15: dependencies: '@ljharb/through': 2.3.13 @@ -28755,10 +36749,16 @@ snapshots: internmap@1.0.1: {} + interpret@1.4.0: {} + interpret@3.1.1: {} intersection-observer@0.12.2: {} + invariant@2.2.4: + dependencies: + loose-envify: 1.4.0 + ip-address@9.0.5: dependencies: jsbn: 1.1.0 @@ -28766,10 +36766,19 @@ snapshots: ipaddr.js@1.9.1: {} + ipaddr.js@2.2.0: {} + is-accessor-descriptor@1.0.1: dependencies: hasown: 2.0.0 + is-alphabetical@2.0.1: {} + + is-alphanumerical@2.0.1: + dependencies: + is-alphabetical: 2.0.1 + is-decimal: 2.0.1 + is-arguments@1.1.1: dependencies: call-bind: 1.0.7 @@ -28820,6 +36829,8 @@ snapshots: dependencies: has-tostringtag: 1.0.0 + is-decimal@2.0.1: {} + is-descriptor@0.1.7: dependencies: is-accessor-descriptor: 1.0.1 @@ -28858,10 +36869,17 @@ snapshots: dependencies: is-extglob: 2.1.1 + is-hexadecimal@2.0.1: {} + is-inside-container@1.0.0: dependencies: is-docker: 3.0.0 + is-installed-globally@0.4.0: + dependencies: + global-dirs: 3.0.1 + is-path-inside: 3.0.3 + is-interactive@1.0.0: {} is-lambda@1.0.1: {} @@ -28870,6 +36888,8 @@ snapshots: is-negative-zero@2.0.2: {} + is-npm@6.0.0: {} + is-number-object@1.0.7: dependencies: has-tostringtag: 1.0.0 @@ -28880,8 +36900,12 @@ snapshots: is-number@7.0.0: {} + is-obj@1.0.1: {} + is-obj@2.0.0: {} + is-path-cwd@2.2.0: {} + is-path-inside@3.0.3: {} is-plain-obj@1.1.0: {} @@ -28900,6 +36924,8 @@ snapshots: is-port-reachable@4.0.0: {} + is-promise@2.2.2: {} + is-reference@3.0.3: dependencies: '@types/estree': 1.0.6 @@ -28909,6 +36935,10 @@ snapshots: call-bind: 1.0.7 has-tostringtag: 1.0.0 + is-regexp@1.0.0: {} + + is-root@2.1.0: {} + is-set@2.0.3: {} is-shared-array-buffer@1.0.2: @@ -28945,8 +36975,6 @@ snapshots: is-unicode-supported@0.1.0: {} - is-unicode-supported@1.3.0: {} - is-weakmap@2.0.2: {} is-weakref@1.0.2: @@ -28968,6 +36996,12 @@ snapshots: dependencies: is-docker: 2.2.1 + is-wsl@3.1.0: + dependencies: + is-inside-container: 1.0.0 + + is-yarn-global@0.4.1: {} + isarray@0.0.1: {} isarray@1.0.0: {} @@ -28996,8 +37030,8 @@ snapshots: istanbul-lib-instrument@5.2.1: dependencies: - '@babel/core': 7.24.3 - '@babel/parser': 7.25.3 + '@babel/core': 7.25.2 + '@babel/parser': 7.25.7 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.0 semver: 6.3.1 @@ -29006,11 +37040,11 @@ snapshots: istanbul-lib-instrument@6.0.3: dependencies: - '@babel/core': 7.24.3 - '@babel/parser': 7.25.3 + '@babel/core': 7.25.2 + '@babel/parser': 7.25.7 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.0 - semver: 7.5.4 + semver: 7.6.3 transitivePeerDependencies: - supports-color @@ -29031,7 +37065,7 @@ snapshots: istanbul-lib-source-maps@5.0.6: dependencies: '@jridgewell/trace-mapping': 0.3.25 - debug: 4.3.5 + debug: 4.3.7 istanbul-lib-coverage: 3.2.2 transitivePeerDependencies: - supports-color @@ -29048,12 +37082,21 @@ snapshots: iterare@1.2.1: {} + its-fine@1.2.5(react@18.2.0): + dependencies: + '@types/react-reconciler': 0.28.8 + react: 18.2.0 + jackspeak@3.1.2: dependencies: '@isaacs/cliui': 8.0.2 optionalDependencies: '@pkgjs/parseargs': 0.11.0 + jackspeak@4.0.2: + dependencies: + '@isaacs/cliui': 8.0.2 + jake@10.9.1: dependencies: async: 3.2.5 @@ -29095,16 +37138,16 @@ snapshots: - babel-plugin-macros - supports-color - jest-cli@29.7.0(@types/node@18.19.67)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@types/node@18.19.67)(typescript@5.4.5)): + jest-cli@29.7.0(@types/node@18.19.67)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@18.19.67)(typescript@5.4.5)): dependencies: - '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@types/node@18.19.67)(typescript@5.4.5)) + '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@18.19.67)(typescript@5.4.5)) '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 chalk: 4.1.2 - create-jest: 29.7.0(@types/node@18.19.67)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@types/node@18.19.67)(typescript@5.4.5)) + create-jest: 29.7.0(@types/node@18.19.67)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@18.19.67)(typescript@5.4.5)) exit: 0.1.2 import-local: 3.1.0 - jest-config: 29.7.0(@types/node@18.19.67)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@types/node@18.19.67)(typescript@5.4.5)) + jest-config: 29.7.0(@types/node@18.19.67)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@18.19.67)(typescript@5.4.5)) jest-util: 29.7.0 jest-validate: 29.7.0 yargs: 17.7.2 @@ -29114,12 +37157,12 @@ snapshots: - supports-color - ts-node - jest-config@29.7.0(@types/node@18.19.67)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@types/node@18.19.67)(typescript@5.4.5)): + jest-config@29.7.0(@types/node@18.19.67)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@18.19.67)(typescript@5.4.5)): dependencies: - '@babel/core': 7.24.3 + '@babel/core': 7.25.2 '@jest/test-sequencer': 29.7.0 '@jest/types': 29.6.3 - babel-jest: 29.7.0(@babel/core@7.24.3) + babel-jest: 29.7.0(@babel/core@7.25.2) chalk: 4.1.2 ci-info: 3.9.0 deepmerge: 4.3.1 @@ -29140,7 +37183,7 @@ snapshots: strip-json-comments: 3.1.1 optionalDependencies: '@types/node': 18.19.67 - ts-node: 10.9.1(@types/node@18.19.67)(typescript@5.4.5) + ts-node: 10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@18.19.67)(typescript@5.4.5) transitivePeerDependencies: - babel-plugin-macros - supports-color @@ -29186,7 +37229,7 @@ snapshots: jest-regex-util: 29.6.3 jest-util: 29.7.0 jest-worker: 29.7.0 - micromatch: 4.0.5 + micromatch: 4.0.8 walker: 1.0.8 optionalDependencies: fsevents: 2.3.3 @@ -29205,12 +37248,12 @@ snapshots: jest-message-util@29.7.0: dependencies: - '@babel/code-frame': 7.24.2 + '@babel/code-frame': 7.25.7 '@jest/types': 29.6.3 '@types/stack-utils': 2.0.3 chalk: 4.1.2 graceful-fs: 4.2.11 - micromatch: 4.0.5 + micromatch: 4.0.8 pretty-format: 29.7.0 slash: 3.0.0 stack-utils: 2.0.6 @@ -29320,7 +37363,7 @@ snapshots: jest-util: 29.7.0 natural-compare: 1.4.0 pretty-format: 29.7.0 - semver: 7.5.4 + semver: 7.6.3 transitivePeerDependencies: - supports-color @@ -29366,12 +37409,12 @@ snapshots: merge-stream: 2.0.0 supports-color: 8.1.1 - jest@29.7.0(@types/node@18.19.67)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@types/node@18.19.67)(typescript@5.4.5)): + jest@29.7.0(@types/node@18.19.67)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@18.19.67)(typescript@5.4.5)): dependencies: - '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@types/node@18.19.67)(typescript@5.4.5)) + '@jest/core': 29.7.0(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@18.19.67)(typescript@5.4.5)) '@jest/types': 29.6.3 import-local: 3.1.0 - jest-cli: 29.7.0(@types/node@18.19.67)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@types/node@18.19.67)(typescript@5.4.5)) + jest-cli: 29.7.0(@types/node@18.19.67)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@18.19.67)(typescript@5.4.5)) transitivePeerDependencies: - '@types/node' - babel-plugin-macros @@ -29380,10 +37423,20 @@ snapshots: jiti@1.21.0: {} + jiti@1.21.6: {} + jiti@2.0.0-beta.2: {} jiti@2.4.2: {} + joi@17.13.3: + dependencies: + '@hapi/hoek': 9.3.0 + '@hapi/topo': 5.1.0 + '@sideway/address': 4.1.5 + '@sideway/formula': 3.0.1 + '@sideway/pinpoint': 2.0.0 + jquery@3.7.1: {} js-base64@2.6.4: {} @@ -29405,6 +37458,8 @@ snapshots: jsesc@2.5.2: {} + jsesc@3.0.2: {} + json-buffer@3.0.1: {} json-parse-even-better-errors@2.3.1: {} @@ -29459,7 +37514,7 @@ snapshots: junk@3.1.0: {} - katex@0.16.11: + katex@0.16.15: dependencies: commander: 8.3.0 @@ -29487,39 +37542,15 @@ snapshots: kleur@4.1.5: {} - koa-compose@4.1.0: {} - - koa-compress@5.1.1: - dependencies: - bytes: 3.1.2 - compressible: 2.0.18 - http-errors: 1.8.1 - koa-is-json: 1.0.0 + klona@2.0.6: {} - koa-connect@2.1.0: {} + koa-compose@4.1.0: {} koa-convert@2.0.0: dependencies: co: 4.6.0 koa-compose: 4.1.0 - koa-is-json@1.0.0: {} - - koa-send@5.0.1: - dependencies: - debug: 4.3.4 - http-errors: 1.8.1 - resolve-path: 1.4.0 - transitivePeerDependencies: - - supports-color - - koa-static@5.0.0: - dependencies: - debug: 3.2.7 - koa-send: 5.0.1 - transitivePeerDependencies: - - supports-color - koa@2.14.2: dependencies: accepts: 1.3.8 @@ -29550,6 +37581,15 @@ snapshots: kolorist@1.8.0: {} + latest-version@7.0.0: + dependencies: + package-json: 8.1.1 + + launch-editor@2.9.1: + dependencies: + picocolors: 1.1.1 + shell-quote: 1.8.1 + lazy-cache@1.0.4: {} lazy-val@1.0.5: {} @@ -29570,6 +37610,25 @@ snapshots: transitivePeerDependencies: - supports-color + leva@0.9.35(@types/react-dom@18.2.14)(@types/react@18.2.35)(react-dom@18.2.0(react@18.2.0))(react@18.2.0): + dependencies: + '@radix-ui/react-portal': 1.1.2(@types/react-dom@18.2.14)(@types/react@18.2.35)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@radix-ui/react-tooltip': 1.1.3(@types/react-dom@18.2.14)(@types/react@18.2.35)(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@stitches/react': 1.2.8(react@18.2.0) + '@use-gesture/react': 10.3.1(react@18.2.0) + colord: 2.9.3 + dequal: 2.0.3 + merge-value: 1.0.0 + react: 18.2.0 + react-colorful: 5.6.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + react-dom: 18.2.0(react@18.2.0) + react-dropzone: 12.1.0(react@18.2.0) + v8n: 1.5.1 + zustand: 3.7.2(react@18.2.0) + transitivePeerDependencies: + - '@types/react' + - '@types/react-dom' + leven@3.1.0: {} levn@0.4.1: @@ -29577,7 +37636,7 @@ snapshots: prelude-ls: 1.2.1 type-check: 0.4.0 - lib0@0.2.97: + lib0@0.2.99: dependencies: isomorphic.js: 0.2.5 @@ -29588,58 +37647,58 @@ snapshots: lightningcss-darwin-arm64@1.25.1: optional: true - lightningcss-darwin-arm64@1.27.0: + lightningcss-darwin-arm64@1.28.2: optional: true lightningcss-darwin-x64@1.25.1: optional: true - lightningcss-darwin-x64@1.27.0: + lightningcss-darwin-x64@1.28.2: optional: true lightningcss-freebsd-x64@1.25.1: optional: true - lightningcss-freebsd-x64@1.27.0: + lightningcss-freebsd-x64@1.28.2: optional: true lightningcss-linux-arm-gnueabihf@1.25.1: optional: true - lightningcss-linux-arm-gnueabihf@1.27.0: + lightningcss-linux-arm-gnueabihf@1.28.2: optional: true lightningcss-linux-arm64-gnu@1.25.1: optional: true - lightningcss-linux-arm64-gnu@1.27.0: + lightningcss-linux-arm64-gnu@1.28.2: optional: true lightningcss-linux-arm64-musl@1.25.1: optional: true - lightningcss-linux-arm64-musl@1.27.0: + lightningcss-linux-arm64-musl@1.28.2: optional: true lightningcss-linux-x64-gnu@1.25.1: optional: true - lightningcss-linux-x64-gnu@1.27.0: + lightningcss-linux-x64-gnu@1.28.2: optional: true lightningcss-linux-x64-musl@1.25.1: optional: true - lightningcss-linux-x64-musl@1.27.0: + lightningcss-linux-x64-musl@1.28.2: optional: true - lightningcss-win32-arm64-msvc@1.27.0: + lightningcss-win32-arm64-msvc@1.28.2: optional: true lightningcss-win32-x64-msvc@1.25.1: optional: true - lightningcss-win32-x64-msvc@1.27.0: + lightningcss-win32-x64-msvc@1.28.2: optional: true lightningcss@1.25.1: @@ -29656,25 +37715,31 @@ snapshots: lightningcss-linux-x64-musl: 1.25.1 lightningcss-win32-x64-msvc: 1.25.1 - lightningcss@1.27.0: + lightningcss@1.28.2: dependencies: detect-libc: 1.0.3 optionalDependencies: - lightningcss-darwin-arm64: 1.27.0 - lightningcss-darwin-x64: 1.27.0 - lightningcss-freebsd-x64: 1.27.0 - lightningcss-linux-arm-gnueabihf: 1.27.0 - lightningcss-linux-arm64-gnu: 1.27.0 - lightningcss-linux-arm64-musl: 1.27.0 - lightningcss-linux-x64-gnu: 1.27.0 - lightningcss-linux-x64-musl: 1.27.0 - lightningcss-win32-arm64-msvc: 1.27.0 - lightningcss-win32-x64-msvc: 1.27.0 + lightningcss-darwin-arm64: 1.28.2 + lightningcss-darwin-x64: 1.28.2 + lightningcss-freebsd-x64: 1.28.2 + lightningcss-linux-arm-gnueabihf: 1.28.2 + lightningcss-linux-arm64-gnu: 1.28.2 + lightningcss-linux-arm64-musl: 1.28.2 + lightningcss-linux-x64-gnu: 1.28.2 + lightningcss-linux-x64-musl: 1.28.2 + lightningcss-win32-arm64-msvc: 1.28.2 + lightningcss-win32-x64-msvc: 1.28.2 lilconfig@2.1.0: {} + lilconfig@3.1.2: {} + lines-and-columns@1.2.4: {} + linkify-it@5.0.0: + dependencies: + uc.micro: 2.1.0 + lint-staged@13.3.0(enquirer@2.4.1): dependencies: chalk: 5.3.0 @@ -29751,6 +37816,14 @@ snapshots: emojis-list: 3.0.0 json5: 1.0.2 + loader-utils@2.0.4: + dependencies: + big.js: 5.2.2 + emojis-list: 3.0.0 + json5: 2.2.3 + + loader-utils@3.3.1: {} + local-pkg@0.4.3: {} local-pkg@0.5.0: @@ -29765,6 +37838,11 @@ snapshots: p-locate: 2.0.0 path-exists: 3.0.0 + locate-path@3.0.0: + dependencies: + p-locate: 3.0.0 + path-exists: 3.0.0 + locate-path@5.0.0: dependencies: p-locate: 4.1.0 @@ -29855,8 +37933,6 @@ snapshots: strip-ansi: 7.1.0 wrap-ansi: 8.1.0 - loglevel@1.8.1: {} - longest-streak@3.1.0: {} longest@1.0.1: {} @@ -29873,12 +37949,16 @@ snapshots: lower-case@2.0.2: dependencies: - tslib: 2.6.3 + tslib: 2.8.1 lowercase-keys@2.0.0: {} + lowercase-keys@3.0.0: {} + lru-cache@10.2.2: {} + lru-cache@11.0.1: {} + lru-cache@4.1.5: dependencies: pseudomap: 1.0.2 @@ -29898,11 +37978,22 @@ snapshots: dependencies: react: 18.2.0 + lucide-react@0.394.0(react@18.2.0): + dependencies: + react: 18.2.0 + luxon@3.4.4: {} + lz-string@1.5.0: {} + + maath@0.10.8(@types/three@0.163.0)(three@0.168.0): + dependencies: + '@types/three': 0.163.0 + three: 0.168.0 + magic-string-ast@0.3.0: dependencies: - magic-string: 0.30.10 + magic-string: 0.30.12 magic-string@0.26.7: dependencies: @@ -29922,17 +38013,17 @@ snapshots: magic-string@0.30.5: dependencies: - '@jridgewell/sourcemap-codec': 1.4.15 + '@jridgewell/sourcemap-codec': 1.5.0 magic-string@0.30.8: dependencies: - '@jridgewell/sourcemap-codec': 1.4.15 + '@jridgewell/sourcemap-codec': 1.5.0 magicast@0.3.4: dependencies: '@babel/parser': 7.24.5 '@babel/types': 7.24.0 - source-map-js: 1.2.0 + source-map-js: 1.2.1 make-dir@2.1.0: dependencies: @@ -29946,7 +38037,7 @@ snapshots: make-dir@4.0.0: dependencies: - semver: 7.5.4 + semver: 7.6.3 make-error@1.3.6: {} @@ -29990,8 +38081,21 @@ snapshots: dependencies: object-visit: 1.0.1 + markdown-extensions@2.0.0: {} + + markdown-it@14.1.0: + dependencies: + argparse: 2.0.1 + entities: 4.5.0 + linkify-it: 5.0.0 + mdurl: 2.0.0 + punycode.js: 2.3.1 + uc.micro: 2.1.0 + markdown-table@3.0.3: {} + markdown-table@3.0.4: {} + marked@12.0.2: {} matcher@3.0.0: @@ -30007,6 +38111,19 @@ snapshots: '@types/unist': 2.0.11 unist-util-visit: 4.1.2 + mdast-util-directive@3.0.0: + dependencies: + '@types/mdast': 4.0.4 + '@types/unist': 3.0.2 + devlop: 1.1.0 + mdast-util-from-markdown: 2.0.1 + mdast-util-to-markdown: 2.1.0 + parse-entities: 4.0.1 + stringify-entities: 4.0.4 + unist-util-visit-parents: 6.0.1 + transitivePeerDependencies: + - supports-color + mdast-util-find-and-replace@2.2.2: dependencies: '@types/mdast': 3.0.15 @@ -30014,6 +38131,13 @@ snapshots: unist-util-is: 5.2.1 unist-util-visit-parents: 5.1.3 + mdast-util-find-and-replace@3.0.1: + dependencies: + '@types/mdast': 4.0.4 + escape-string-regexp: 5.0.0 + unist-util-is: 6.0.0 + unist-util-visit-parents: 6.0.1 + mdast-util-from-markdown@1.3.1: dependencies: '@types/mdast': 3.0.15 @@ -30031,6 +38155,34 @@ snapshots: transitivePeerDependencies: - supports-color + mdast-util-from-markdown@2.0.1: + dependencies: + '@types/mdast': 4.0.4 + '@types/unist': 3.0.2 + decode-named-character-reference: 1.0.2 + devlop: 1.1.0 + mdast-util-to-string: 4.0.0 + micromark: 4.0.0 + micromark-util-decode-numeric-character-reference: 2.0.1 + micromark-util-decode-string: 2.0.0 + micromark-util-normalize-identifier: 2.0.0 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + unist-util-stringify-position: 4.0.0 + transitivePeerDependencies: + - supports-color + + mdast-util-frontmatter@2.0.1: + dependencies: + '@types/mdast': 4.0.4 + devlop: 1.1.0 + escape-string-regexp: 5.0.0 + mdast-util-from-markdown: 2.0.1 + mdast-util-to-markdown: 2.1.0 + micromark-extension-frontmatter: 2.0.0 + transitivePeerDependencies: + - supports-color + mdast-util-gfm-autolink-literal@1.0.3: dependencies: '@types/mdast': 3.0.15 @@ -30038,31 +38190,76 @@ snapshots: mdast-util-find-and-replace: 2.2.2 micromark-util-character: 1.2.0 + mdast-util-gfm-autolink-literal@2.0.1: + dependencies: + '@types/mdast': 4.0.4 + ccount: 2.0.1 + devlop: 1.1.0 + mdast-util-find-and-replace: 3.0.1 + micromark-util-character: 2.1.0 + mdast-util-gfm-footnote@1.0.2: dependencies: '@types/mdast': 3.0.15 mdast-util-to-markdown: 1.5.0 micromark-util-normalize-identifier: 1.1.0 + mdast-util-gfm-footnote@2.0.0: + dependencies: + '@types/mdast': 4.0.4 + devlop: 1.1.0 + mdast-util-from-markdown: 2.0.1 + mdast-util-to-markdown: 2.1.0 + micromark-util-normalize-identifier: 2.0.0 + transitivePeerDependencies: + - supports-color + mdast-util-gfm-strikethrough@1.0.3: dependencies: '@types/mdast': 3.0.15 mdast-util-to-markdown: 1.5.0 + mdast-util-gfm-strikethrough@2.0.0: + dependencies: + '@types/mdast': 4.0.4 + mdast-util-from-markdown: 2.0.1 + mdast-util-to-markdown: 2.1.0 + transitivePeerDependencies: + - supports-color + mdast-util-gfm-table@1.0.7: dependencies: '@types/mdast': 3.0.15 - markdown-table: 3.0.3 + markdown-table: 3.0.4 mdast-util-from-markdown: 1.3.1 mdast-util-to-markdown: 1.5.0 transitivePeerDependencies: - supports-color + mdast-util-gfm-table@2.0.0: + dependencies: + '@types/mdast': 4.0.4 + devlop: 1.1.0 + markdown-table: 3.0.3 + mdast-util-from-markdown: 2.0.1 + mdast-util-to-markdown: 2.1.0 + transitivePeerDependencies: + - supports-color + mdast-util-gfm-task-list-item@1.0.2: dependencies: '@types/mdast': 3.0.15 mdast-util-to-markdown: 1.5.0 + mdast-util-gfm-task-list-item@2.0.0: + dependencies: + '@types/mdast': 4.0.4 + devlop: 1.1.0 + mdast-util-from-markdown: 2.0.1 + mdast-util-to-markdown: 2.1.0 + transitivePeerDependencies: + - supports-color + mdast-util-gfm@2.0.2: dependencies: mdast-util-from-markdown: 1.3.1 @@ -30075,17 +38272,83 @@ snapshots: transitivePeerDependencies: - supports-color + mdast-util-gfm@3.0.0: + dependencies: + mdast-util-from-markdown: 2.0.1 + mdast-util-gfm-autolink-literal: 2.0.1 + mdast-util-gfm-footnote: 2.0.0 + mdast-util-gfm-strikethrough: 2.0.0 + mdast-util-gfm-table: 2.0.0 + mdast-util-gfm-task-list-item: 2.0.0 + mdast-util-to-markdown: 2.1.0 + transitivePeerDependencies: + - supports-color + mdast-util-math@2.0.2: dependencies: '@types/mdast': 3.0.15 longest-streak: 3.1.0 mdast-util-to-markdown: 1.5.0 + mdast-util-mdx-expression@2.0.1: + dependencies: + '@types/estree-jsx': 1.0.5 + '@types/hast': 3.0.4 + '@types/mdast': 4.0.4 + devlop: 1.1.0 + mdast-util-from-markdown: 2.0.1 + mdast-util-to-markdown: 2.1.0 + transitivePeerDependencies: + - supports-color + + mdast-util-mdx-jsx@3.1.3: + dependencies: + '@types/estree-jsx': 1.0.5 + '@types/hast': 3.0.4 + '@types/mdast': 4.0.4 + '@types/unist': 3.0.2 + ccount: 2.0.1 + devlop: 1.1.0 + mdast-util-from-markdown: 2.0.1 + mdast-util-to-markdown: 2.1.0 + parse-entities: 4.0.1 + stringify-entities: 4.0.4 + unist-util-stringify-position: 4.0.0 + vfile-message: 4.0.2 + transitivePeerDependencies: + - supports-color + + mdast-util-mdx@3.0.0: + dependencies: + mdast-util-from-markdown: 2.0.1 + mdast-util-mdx-expression: 2.0.1 + mdast-util-mdx-jsx: 3.1.3 + mdast-util-mdxjs-esm: 2.0.1 + mdast-util-to-markdown: 2.1.0 + transitivePeerDependencies: + - supports-color + + mdast-util-mdxjs-esm@2.0.1: + dependencies: + '@types/estree-jsx': 1.0.5 + '@types/hast': 3.0.4 + '@types/mdast': 4.0.4 + devlop: 1.1.0 + mdast-util-from-markdown: 2.0.1 + mdast-util-to-markdown: 2.1.0 + transitivePeerDependencies: + - supports-color + mdast-util-phrasing@3.0.1: dependencies: '@types/mdast': 3.0.15 unist-util-is: 5.2.1 + mdast-util-phrasing@4.1.0: + dependencies: + '@types/mdast': 4.0.4 + unist-util-is: 6.0.0 + mdast-util-to-hast@12.3.0: dependencies: '@types/hast': 2.3.10 @@ -30097,6 +38360,18 @@ snapshots: unist-util-position: 4.0.4 unist-util-visit: 4.1.2 + mdast-util-to-hast@13.2.0: + dependencies: + '@types/hast': 3.0.4 + '@types/mdast': 4.0.4 + '@ungap/structured-clone': 1.2.0 + devlop: 1.1.0 + micromark-util-sanitize-uri: 2.0.0 + trim-lines: 3.0.1 + unist-util-position: 5.0.0 + unist-util-visit: 5.0.0 + vfile: 6.0.3 + mdast-util-to-markdown@1.5.0: dependencies: '@types/mdast': 3.0.15 @@ -30108,14 +38383,31 @@ snapshots: unist-util-visit: 4.1.2 zwitch: 2.0.4 + mdast-util-to-markdown@2.1.0: + dependencies: + '@types/mdast': 4.0.4 + '@types/unist': 3.0.2 + longest-streak: 3.1.0 + mdast-util-phrasing: 4.1.0 + mdast-util-to-string: 4.0.0 + micromark-util-decode-string: 2.0.0 + unist-util-visit: 5.0.0 + zwitch: 2.0.4 + mdast-util-to-string@3.2.0: dependencies: '@types/mdast': 3.0.15 + mdast-util-to-string@4.0.0: + dependencies: + '@types/mdast': 4.0.4 + mdn-data@2.0.28: {} mdn-data@2.0.30: {} + mdurl@2.0.0: {} + media-query-parser@2.0.2: dependencies: '@babel/runtime': 7.23.2 @@ -30182,8 +38474,21 @@ snapshots: merge-stream@2.0.0: {} + merge-value@1.0.0: + dependencies: + get-value: 2.0.6 + is-extendable: 1.0.1 + mixin-deep: 1.3.2 + set-value: 2.0.1 + merge2@1.4.1: {} + meshline@3.3.1(three@0.168.0): + dependencies: + three: 0.168.0 + + meshoptimizer@0.18.1: {} + methods@1.1.2: {} microdiff@1.3.2: {} @@ -30207,6 +38512,42 @@ snapshots: micromark-util-types: 1.1.0 uvu: 0.5.6 + micromark-core-commonmark@2.0.1: + dependencies: + decode-named-character-reference: 1.0.2 + devlop: 1.1.0 + micromark-factory-destination: 2.0.0 + micromark-factory-label: 2.0.0 + micromark-factory-space: 2.0.0 + micromark-factory-title: 2.0.0 + micromark-factory-whitespace: 2.0.0 + micromark-util-character: 2.1.0 + micromark-util-chunked: 2.0.0 + micromark-util-classify-character: 2.0.0 + micromark-util-html-tag-name: 2.0.0 + micromark-util-normalize-identifier: 2.0.0 + micromark-util-resolve-all: 2.0.0 + micromark-util-subtokenize: 2.0.1 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + + micromark-extension-directive@3.0.2: + dependencies: + devlop: 1.1.0 + micromark-factory-space: 2.0.0 + micromark-factory-whitespace: 2.0.0 + micromark-util-character: 2.1.0 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + parse-entities: 4.0.1 + + micromark-extension-frontmatter@2.0.0: + dependencies: + fault: 2.0.1 + micromark-util-character: 2.1.0 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + micromark-extension-gfm-autolink-literal@1.0.5: dependencies: micromark-util-character: 1.2.0 @@ -30214,6 +38555,13 @@ snapshots: micromark-util-symbol: 1.1.0 micromark-util-types: 1.1.0 + micromark-extension-gfm-autolink-literal@2.1.0: + dependencies: + micromark-util-character: 2.1.0 + micromark-util-sanitize-uri: 2.0.0 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + micromark-extension-gfm-footnote@1.1.2: dependencies: micromark-core-commonmark: 1.1.0 @@ -30225,6 +38573,17 @@ snapshots: micromark-util-types: 1.1.0 uvu: 0.5.6 + micromark-extension-gfm-footnote@2.1.0: + dependencies: + devlop: 1.1.0 + micromark-core-commonmark: 2.0.1 + micromark-factory-space: 2.0.0 + micromark-util-character: 2.1.0 + micromark-util-normalize-identifier: 2.0.0 + micromark-util-sanitize-uri: 2.0.0 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + micromark-extension-gfm-strikethrough@1.0.7: dependencies: micromark-util-chunked: 1.1.0 @@ -30234,6 +38593,15 @@ snapshots: micromark-util-types: 1.1.0 uvu: 0.5.6 + micromark-extension-gfm-strikethrough@2.1.0: + dependencies: + devlop: 1.1.0 + micromark-util-chunked: 2.0.0 + micromark-util-classify-character: 2.0.0 + micromark-util-resolve-all: 2.0.0 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + micromark-extension-gfm-table@1.0.7: dependencies: micromark-factory-space: 1.1.0 @@ -30242,10 +38610,22 @@ snapshots: micromark-util-types: 1.1.0 uvu: 0.5.6 + micromark-extension-gfm-table@2.1.0: + dependencies: + devlop: 1.1.0 + micromark-factory-space: 2.0.0 + micromark-util-character: 2.1.0 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + micromark-extension-gfm-tagfilter@1.0.2: dependencies: micromark-util-types: 1.1.0 + micromark-extension-gfm-tagfilter@2.0.0: + dependencies: + micromark-util-types: 2.0.0 + micromark-extension-gfm-task-list-item@1.0.5: dependencies: micromark-factory-space: 1.1.0 @@ -30254,6 +38634,14 @@ snapshots: micromark-util-types: 1.1.0 uvu: 0.5.6 + micromark-extension-gfm-task-list-item@2.1.0: + dependencies: + devlop: 1.1.0 + micromark-factory-space: 2.0.0 + micromark-util-character: 2.1.0 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + micromark-extension-gfm@2.0.3: dependencies: micromark-extension-gfm-autolink-literal: 1.0.5 @@ -30265,22 +38653,91 @@ snapshots: micromark-util-combine-extensions: 1.1.0 micromark-util-types: 1.1.0 + micromark-extension-gfm@3.0.0: + dependencies: + micromark-extension-gfm-autolink-literal: 2.1.0 + micromark-extension-gfm-footnote: 2.1.0 + micromark-extension-gfm-strikethrough: 2.1.0 + micromark-extension-gfm-table: 2.1.0 + micromark-extension-gfm-tagfilter: 2.0.0 + micromark-extension-gfm-task-list-item: 2.1.0 + micromark-util-combine-extensions: 2.0.0 + micromark-util-types: 2.0.0 + micromark-extension-math@2.1.2: dependencies: '@types/katex': 0.16.7 - katex: 0.16.11 + katex: 0.16.15 micromark-factory-space: 1.1.0 micromark-util-character: 1.2.0 micromark-util-symbol: 1.1.0 micromark-util-types: 1.1.0 uvu: 0.5.6 + micromark-extension-mdx-expression@3.0.0: + dependencies: + '@types/estree': 1.0.6 + devlop: 1.1.0 + micromark-factory-mdx-expression: 2.0.2 + micromark-factory-space: 2.0.0 + micromark-util-character: 2.1.0 + micromark-util-events-to-acorn: 2.0.2 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + + micromark-extension-mdx-jsx@3.0.1: + dependencies: + '@types/acorn': 4.0.6 + '@types/estree': 1.0.6 + devlop: 1.1.0 + estree-util-is-identifier-name: 3.0.0 + micromark-factory-mdx-expression: 2.0.2 + micromark-factory-space: 2.0.0 + micromark-util-character: 2.1.0 + micromark-util-events-to-acorn: 2.0.2 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + vfile-message: 4.0.2 + + micromark-extension-mdx-md@2.0.0: + dependencies: + micromark-util-types: 2.0.0 + + micromark-extension-mdxjs-esm@3.0.0: + dependencies: + '@types/estree': 1.0.6 + devlop: 1.1.0 + micromark-core-commonmark: 2.0.1 + micromark-util-character: 2.1.0 + micromark-util-events-to-acorn: 2.0.2 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + unist-util-position-from-estree: 2.0.0 + vfile-message: 4.0.2 + + micromark-extension-mdxjs@3.0.0: + dependencies: + acorn: 8.14.0 + acorn-jsx: 5.3.2(acorn@8.14.0) + micromark-extension-mdx-expression: 3.0.0 + micromark-extension-mdx-jsx: 3.0.1 + micromark-extension-mdx-md: 2.0.0 + micromark-extension-mdxjs-esm: 3.0.0 + micromark-util-combine-extensions: 2.0.0 + micromark-util-types: 2.0.0 + micromark-factory-destination@1.1.0: dependencies: micromark-util-character: 1.2.0 micromark-util-symbol: 1.1.0 micromark-util-types: 1.1.0 + micromark-factory-destination@2.0.0: + dependencies: + micromark-util-character: 2.1.0 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + micromark-factory-label@1.1.0: dependencies: micromark-util-character: 1.2.0 @@ -30288,11 +38745,35 @@ snapshots: micromark-util-types: 1.1.0 uvu: 0.5.6 + micromark-factory-label@2.0.0: + dependencies: + devlop: 1.1.0 + micromark-util-character: 2.1.0 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + + micromark-factory-mdx-expression@2.0.2: + dependencies: + '@types/estree': 1.0.6 + devlop: 1.1.0 + micromark-factory-space: 2.0.0 + micromark-util-character: 2.1.0 + micromark-util-events-to-acorn: 2.0.2 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + unist-util-position-from-estree: 2.0.0 + vfile-message: 4.0.2 + micromark-factory-space@1.1.0: dependencies: micromark-util-character: 1.2.0 micromark-util-types: 1.1.0 + micromark-factory-space@2.0.0: + dependencies: + micromark-util-character: 2.1.0 + micromark-util-types: 2.0.0 + micromark-factory-title@1.1.0: dependencies: micromark-factory-space: 1.1.0 @@ -30300,6 +38781,13 @@ snapshots: micromark-util-symbol: 1.1.0 micromark-util-types: 1.1.0 + micromark-factory-title@2.0.0: + dependencies: + micromark-factory-space: 2.0.0 + micromark-util-character: 2.1.0 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + micromark-factory-whitespace@1.1.0: dependencies: micromark-factory-space: 1.1.0 @@ -30307,30 +38795,61 @@ snapshots: micromark-util-symbol: 1.1.0 micromark-util-types: 1.1.0 + micromark-factory-whitespace@2.0.0: + dependencies: + micromark-factory-space: 2.0.0 + micromark-util-character: 2.1.0 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + micromark-util-character@1.2.0: dependencies: micromark-util-symbol: 1.1.0 micromark-util-types: 1.1.0 + micromark-util-character@2.1.0: + dependencies: + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + micromark-util-chunked@1.1.0: dependencies: micromark-util-symbol: 1.1.0 + micromark-util-chunked@2.0.0: + dependencies: + micromark-util-symbol: 2.0.0 + micromark-util-classify-character@1.1.0: dependencies: micromark-util-character: 1.2.0 micromark-util-symbol: 1.1.0 micromark-util-types: 1.1.0 + micromark-util-classify-character@2.0.0: + dependencies: + micromark-util-character: 2.1.0 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + micromark-util-combine-extensions@1.1.0: dependencies: micromark-util-chunked: 1.1.0 micromark-util-types: 1.1.0 + micromark-util-combine-extensions@2.0.0: + dependencies: + micromark-util-chunked: 2.0.0 + micromark-util-types: 2.0.0 + micromark-util-decode-numeric-character-reference@1.1.0: dependencies: micromark-util-symbol: 1.1.0 + micromark-util-decode-numeric-character-reference@2.0.1: + dependencies: + micromark-util-symbol: 2.0.0 + micromark-util-decode-string@1.1.0: dependencies: decode-named-character-reference: 1.0.2 @@ -30338,24 +38857,60 @@ snapshots: micromark-util-decode-numeric-character-reference: 1.1.0 micromark-util-symbol: 1.1.0 + micromark-util-decode-string@2.0.0: + dependencies: + decode-named-character-reference: 1.0.2 + micromark-util-character: 2.1.0 + micromark-util-decode-numeric-character-reference: 2.0.1 + micromark-util-symbol: 2.0.0 + micromark-util-encode@1.1.0: {} + micromark-util-encode@2.0.0: {} + + micromark-util-events-to-acorn@2.0.2: + dependencies: + '@types/acorn': 4.0.6 + '@types/estree': 1.0.6 + '@types/unist': 3.0.2 + devlop: 1.1.0 + estree-util-visit: 2.0.0 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + vfile-message: 4.0.2 + micromark-util-html-tag-name@1.2.0: {} + micromark-util-html-tag-name@2.0.0: {} + micromark-util-normalize-identifier@1.1.0: dependencies: micromark-util-symbol: 1.1.0 + micromark-util-normalize-identifier@2.0.0: + dependencies: + micromark-util-symbol: 2.0.0 + micromark-util-resolve-all@1.1.0: dependencies: micromark-util-types: 1.1.0 + micromark-util-resolve-all@2.0.0: + dependencies: + micromark-util-types: 2.0.0 + micromark-util-sanitize-uri@1.2.0: dependencies: micromark-util-character: 1.2.0 micromark-util-encode: 1.1.0 micromark-util-symbol: 1.1.0 + micromark-util-sanitize-uri@2.0.0: + dependencies: + micromark-util-character: 2.1.0 + micromark-util-encode: 2.0.0 + micromark-util-symbol: 2.0.0 + micromark-util-subtokenize@1.1.0: dependencies: micromark-util-chunked: 1.1.0 @@ -30363,16 +38918,25 @@ snapshots: micromark-util-types: 1.1.0 uvu: 0.5.6 + micromark-util-subtokenize@2.0.1: + dependencies: + devlop: 1.1.0 + micromark-util-chunked: 2.0.0 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + micromark-util-symbol@1.1.0: {} micromark-util-symbol@2.0.0: {} micromark-util-types@1.1.0: {} + micromark-util-types@2.0.0: {} + micromark@3.2.0: dependencies: '@types/debug': 4.1.12 - debug: 4.3.7 + debug: 4.4.0 decode-named-character-reference: 1.0.2 micromark-core-commonmark: 1.1.0 micromark-factory-space: 1.1.0 @@ -30391,6 +38955,28 @@ snapshots: transitivePeerDependencies: - supports-color + micromark@4.0.0: + dependencies: + '@types/debug': 4.1.12 + debug: 4.3.7 + decode-named-character-reference: 1.0.2 + devlop: 1.1.0 + micromark-core-commonmark: 2.0.1 + micromark-factory-space: 2.0.0 + micromark-util-character: 2.1.0 + micromark-util-chunked: 2.0.0 + micromark-util-combine-extensions: 2.0.0 + micromark-util-decode-numeric-character-reference: 2.0.1 + micromark-util-encode: 2.0.0 + micromark-util-normalize-identifier: 2.0.0 + micromark-util-resolve-all: 2.0.0 + micromark-util-sanitize-uri: 2.0.0 + micromark-util-subtokenize: 2.0.1 + micromark-util-symbol: 2.0.0 + micromark-util-types: 2.0.0 + transitivePeerDependencies: + - supports-color + micromatch@3.1.0: dependencies: arr-diff: 4.0.0 @@ -30414,6 +39000,11 @@ snapshots: braces: 3.0.2 picomatch: 2.3.1 + micromatch@4.0.8: + dependencies: + braces: 3.0.3 + picomatch: 2.3.1 + mime-db@1.33.0: {} mime-db@1.52.0: {} @@ -30432,6 +39023,8 @@ snapshots: mime@2.6.0: {} + mime@4.0.4: {} + mimic-fn@1.2.0: {} mimic-fn@2.1.0: {} @@ -30442,10 +39035,24 @@ snapshots: mimic-response@3.1.0: {} + mimic-response@4.0.0: {} + min-indent@1.0.1: {} mind-elixir@3.3.2: {} + mini-css-extract-plugin@2.9.1(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))): + dependencies: + schema-utils: 4.2.0 + tapable: 2.2.1 + webpack: 5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3)) + + minimalistic-assert@1.0.1: {} + + minimatch@10.0.1: + dependencies: + brace-expansion: 2.0.1 + minimatch@3.0.8: dependencies: brace-expansion: 1.1.11 @@ -30510,8 +39117,6 @@ snapshots: minipass@5.0.0: {} - minipass@7.1.1: {} - minipass@7.1.2: {} minizlib@2.1.2: @@ -30528,6 +39133,8 @@ snapshots: mixme@0.5.9: {} + mkdirp-classic@0.5.3: {} + mkdirp@0.5.6: dependencies: minimist: 1.2.8 @@ -30540,14 +39147,14 @@ snapshots: mlly@1.4.2: dependencies: - acorn: 8.11.2 + acorn: 8.14.0 pathe: 1.1.1 pkg-types: 1.0.3 ufo: 1.3.1 mlly@1.7.1: dependencies: - acorn: 8.12.0 + acorn: 8.14.0 pathe: 1.1.2 pkg-types: 1.1.3 ufo: 1.5.4 @@ -30589,6 +39196,11 @@ snapshots: type-is: 1.6.18 xtend: 4.0.2 + multicast-dns@7.2.5: + dependencies: + dns-packet: 5.6.1 + thunky: 1.1.0 + multipipe@1.0.2: dependencies: duplexer2: 0.1.4 @@ -30606,10 +39218,10 @@ snapshots: object-assign: 4.1.1 thenify-all: 1.6.0 - naive-ui@2.39.0(vue@3.4.35(typescript@5.4.5)): + naive-ui@2.39.0(vue@3.4.35(typescript@5.6.3)): dependencies: '@css-render/plugin-bem': 0.15.14(css-render@0.15.14) - '@css-render/vue3-ssr': 0.15.14(vue@3.4.35(typescript@5.4.5)) + '@css-render/vue3-ssr': 0.15.14(vue@3.4.35(typescript@5.6.3)) '@types/katex': 0.16.7 '@types/lodash': 4.14.202 '@types/lodash-es': 4.17.12 @@ -30624,10 +39236,10 @@ snapshots: lodash-es: 4.17.21 seemly: 0.3.8 treemate: 0.3.11 - vdirs: 0.1.8(vue@3.4.35(typescript@5.4.5)) - vooks: 0.2.12(vue@3.4.35(typescript@5.4.5)) - vue: 3.4.35(typescript@5.4.5) - vueuc: 0.4.58(vue@3.4.35(typescript@5.4.5)) + vdirs: 0.1.8(vue@3.4.35(typescript@5.6.3)) + vooks: 0.2.12(vue@3.4.35(typescript@5.6.3)) + vue: 3.4.35(typescript@5.6.3) + vueuc: 0.4.58(vue@3.4.35(typescript@5.6.3)) nanoid@3.3.6: {} @@ -30657,6 +39269,8 @@ snapshots: dependencies: picocolors: 1.0.0 + napi-build-utils@1.0.2: {} + natural-compare@1.4.0: {} needle@3.2.0: @@ -30672,30 +39286,44 @@ snapshots: neo-async@2.6.2: {} + next-themes@0.3.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0): + dependencies: + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + nice-try@1.0.5: {} no-case@3.0.4: dependencies: lower-case: 2.0.2 - tslib: 2.6.3 + tslib: 2.8.1 node-abi@3.62.0: dependencies: - semver: 7.5.4 + semver: 7.6.3 node-abort-controller@3.1.1: {} node-addon-api@1.7.2: optional: true + node-addon-api@6.1.0: {} + node-api-version@0.2.0: dependencies: - semver: 7.5.4 + semver: 7.6.3 node-emoji@1.11.0: dependencies: lodash: 4.17.21 + node-emoji@2.1.3: + dependencies: + '@sindresorhus/is': 4.6.0 + char-regex: 1.0.2 + emojilib: 2.4.0 + skin-tone: 2.0.0 + node-eval@2.0.0: dependencies: path-is-absolute: 1.0.1 @@ -30713,6 +39341,8 @@ snapshots: optionalDependencies: encoding: 0.1.13 + node-forge@1.3.1: {} + node-gyp-build@4.7.1: {} node-gyp@9.4.1: @@ -30725,19 +39355,24 @@ snapshots: nopt: 6.0.0 npmlog: 6.0.2 rimraf: 3.0.2 - semver: 7.5.4 + semver: 7.6.3 tar: 6.2.1 which: 2.0.2 transitivePeerDependencies: - bluebird - supports-color - node-int64@0.4.0: {} + node-html-parser@5.4.2: + dependencies: + css-select: 4.3.0 + he: 1.2.0 - node-releases@2.0.13: {} + node-int64@0.4.0: {} node-releases@2.0.14: {} + node-releases@2.0.18: {} + nopt@6.0.0: dependencies: abbrev: 1.1.1 @@ -30753,7 +39388,7 @@ snapshots: dependencies: hosted-git-info: 4.1.0 is-core-module: 2.13.1 - semver: 7.5.4 + semver: 7.6.3 validate-npm-package-license: 3.0.4 normalize-path@3.0.0: {} @@ -30762,6 +39397,8 @@ snapshots: normalize-url@6.1.0: {} + normalize-url@8.0.1: {} + normalize-wheel-es@1.2.0: {} normalize.css@8.0.1: {} @@ -30774,7 +39411,7 @@ snapshots: dependencies: path-key: 3.1.1 - npm-run-path@5.1.0: + npm-run-path@5.3.0: dependencies: path-key: 4.0.0 @@ -30833,12 +39470,18 @@ snapshots: dependencies: isobject: 3.0.1 + obuf@1.1.2: {} + ofetch@1.3.4: dependencies: destr: 2.0.3 node-fetch-native: 1.6.4 ufo: 1.5.4 + on-finished@2.3.0: + dependencies: + ee-first: 1.1.1 + on-finished@2.4.1: dependencies: ee-first: 1.1.1 @@ -30861,13 +39504,29 @@ snapshots: dependencies: mimic-fn: 4.0.0 + oniguruma-to-es@0.7.0: + dependencies: + emoji-regex-xs: 1.0.0 + regex: 5.0.2 + regex-recursion: 4.3.0 + + oniguruma-to-js@0.4.3: + dependencies: + regex: 4.3.3 + only@0.0.2: {} - open@9.1.0: + open@10.1.0: dependencies: - default-browser: 4.0.0 + default-browser: 5.2.1 define-lazy-prop: 3.0.0 is-inside-container: 1.0.0 + is-wsl: 3.1.0 + + open@8.4.2: + dependencies: + define-lazy-prop: 2.0.0 + is-docker: 2.2.1 is-wsl: 2.2.0 opencollective-postinstall@2.0.3: {} @@ -30881,6 +39540,8 @@ snapshots: node-fetch: 1.6.3 opn: 4.0.2 + opener@1.5.2: {} + opn@4.0.2: dependencies: object-assign: 4.1.1 @@ -30915,6 +39576,8 @@ snapshots: p-cancelable@2.1.1: {} + p-cancelable@3.0.0: {} + p-defer@1.0.0: {} p-filter@2.1.0: @@ -30945,6 +39608,10 @@ snapshots: dependencies: p-limit: 1.3.0 + p-locate@3.0.0: + dependencies: + p-limit: 2.3.0 + p-locate@4.1.0: dependencies: p-limit: 2.3.0 @@ -30963,16 +39630,35 @@ snapshots: dependencies: aggregate-error: 3.1.0 + p-retry@4.6.2: + dependencies: + '@types/retry': 0.12.0 + retry: 0.13.1 + p-try@1.0.0: {} p-try@2.2.0: {} package-json-from-dist@1.0.0: {} + package-json@8.1.1: + dependencies: + got: 12.6.1 + registry-auth-token: 5.0.2 + registry-url: 6.0.1 + semver: 7.6.3 + package-manager-detector@0.1.2: {} + package-manager-detector@0.2.2: {} + pako@1.0.11: {} + param-case@3.0.4: + dependencies: + dot-case: 3.0.4 + tslib: 2.6.3 + parchment@3.0.0: {} parent-module@1.0.1: @@ -30989,29 +39675,56 @@ snapshots: parse-code-context@1.0.0: {} + parse-entities@4.0.1: + dependencies: + '@types/unist': 2.0.11 + character-entities: 2.0.2 + character-entities-legacy: 3.0.0 + character-reference-invalid: 2.0.1 + decode-named-character-reference: 1.0.2 + is-alphanumerical: 2.0.1 + is-decimal: 2.0.1 + is-hexadecimal: 2.0.1 + parse-json@2.2.0: dependencies: error-ex: 1.3.2 parse-json@5.2.0: dependencies: - '@babel/code-frame': 7.24.7 + '@babel/code-frame': 7.25.7 error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 parse-node-version@1.0.1: {} + parse-numeric-range@1.3.0: {} + parse-passwd@1.0.0: {} parse-svg-path@0.1.2: {} + parse5-htmlparser2-tree-adapter@7.0.0: + dependencies: + domhandler: 5.0.3 + parse5: 7.1.2 + parse5@7.1.2: dependencies: entities: 4.5.0 + parse5@7.2.1: + dependencies: + entities: 4.5.0 + parseurl@1.3.3: {} + pascal-case@3.1.2: + dependencies: + no-case: 3.0.4 + tslib: 2.8.1 + pascalcase@0.1.1: {} path-browserify@1.0.1: {} @@ -31039,6 +39752,11 @@ snapshots: lru-cache: 10.2.2 minipass: 7.1.2 + path-scurry@2.0.0: + dependencies: + lru-cache: 11.0.1 + minipass: 7.1.2 + path-to-regexp@0.1.7: {} path-to-regexp@1.8.0: @@ -31055,6 +39773,8 @@ snapshots: path-type@4.0.0: {} + pathe@0.2.0: {} + pathe@1.1.1: {} pathe@1.1.2: {} @@ -31071,6 +39791,12 @@ snapshots: performance-now@2.1.0: {} + periscopic@3.1.0: + dependencies: + '@types/estree': 1.0.6 + estree-walker: 3.0.3 + is-reference: 3.0.3 + picocolors@0.2.1: {} picocolors@1.0.0: {} @@ -31079,6 +39805,8 @@ snapshots: picocolors@1.1.0: {} + picocolors@1.1.1: {} + picomatch@2.3.1: {} picomatch@4.0.1: {} @@ -31091,14 +39819,14 @@ snapshots: pify@4.0.1: {} - pinia@2.1.7(@vue/composition-api@1.7.2(vue@3.4.15(typescript@5.4.5)))(typescript@5.4.5)(vue@3.4.15(typescript@5.4.5)): + pinia@2.1.7(@vue/composition-api@1.7.2(vue@3.4.35(typescript@5.6.3)))(typescript@5.6.3)(vue@3.4.35(typescript@5.6.3)): dependencies: - '@vue/devtools-api': 6.5.1 - vue: 3.4.15(typescript@5.4.5) - vue-demi: 0.14.7(@vue/composition-api@1.7.2(vue@3.4.15(typescript@5.4.5)))(vue@3.4.15(typescript@5.4.5)) + '@vue/devtools-api': 6.6.4 + vue: 3.4.35(typescript@5.6.3) + vue-demi: 0.14.10(@vue/composition-api@1.7.2(vue@3.4.35(typescript@5.6.3)))(vue@3.4.35(typescript@5.6.3)) optionalDependencies: - '@vue/composition-api': 1.7.2(vue@3.4.15(typescript@5.4.5)) - typescript: 5.4.5 + '@vue/composition-api': 1.7.2(vue@3.4.35(typescript@5.6.3)) + typescript: 5.6.3 pinkie-promise@2.0.1: dependencies: @@ -31112,11 +39840,15 @@ snapshots: dependencies: find-up: 4.1.0 + pkg-dir@7.0.0: + dependencies: + find-up: 6.3.0 + pkg-types@1.0.3: dependencies: jsonc-parser: 3.2.0 mlly: 1.4.2 - pathe: 1.1.1 + pathe: 1.1.2 pkg-types@1.1.3: dependencies: @@ -31124,6 +39856,10 @@ snapshots: mlly: 1.7.1 pathe: 1.1.2 + pkg-up@3.1.0: + dependencies: + find-up: 3.0.0 + playwright-chromium@1.42.1: dependencies: playwright-core: 1.42.1 @@ -31158,14 +39894,154 @@ snapshots: posix-character-classes@0.1.1: {} + postcss-attribute-case-insensitive@7.0.0(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-selector-parser: 6.1.0 + + postcss-calc@9.0.1(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-selector-parser: 6.1.0 + postcss-value-parser: 4.2.0 + + postcss-clamp@4.1.0(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-value-parser: 4.2.0 + + postcss-color-functional-notation@7.0.2(postcss@8.4.47): + dependencies: + '@csstools/css-color-parser': 3.0.2(@csstools/css-parser-algorithms@3.0.1(@csstools/css-tokenizer@3.0.1))(@csstools/css-tokenizer@3.0.1) + '@csstools/css-parser-algorithms': 3.0.1(@csstools/css-tokenizer@3.0.1) + '@csstools/css-tokenizer': 3.0.1 + '@csstools/postcss-progressive-custom-properties': 4.0.0(postcss@8.4.47) + '@csstools/utilities': 2.0.0(postcss@8.4.47) + postcss: 8.4.47 + + postcss-color-hex-alpha@10.0.0(postcss@8.4.47): + dependencies: + '@csstools/utilities': 2.0.0(postcss@8.4.47) + postcss: 8.4.47 + postcss-value-parser: 4.2.0 + + postcss-color-rebeccapurple@10.0.0(postcss@8.4.47): + dependencies: + '@csstools/utilities': 2.0.0(postcss@8.4.47) + postcss: 8.4.47 + postcss-value-parser: 4.2.0 + + postcss-colormin@6.1.0(postcss@8.4.47): + dependencies: + browserslist: 4.24.0 + caniuse-api: 3.0.0 + colord: 2.9.3 + postcss: 8.4.47 + postcss-value-parser: 4.2.0 + + postcss-convert-values@6.1.0(postcss@8.4.47): + dependencies: + browserslist: 4.24.0 + postcss: 8.4.47 + postcss-value-parser: 4.2.0 + + postcss-custom-media@11.0.2(postcss@8.4.47): + dependencies: + '@csstools/cascade-layer-name-parser': 2.0.1(@csstools/css-parser-algorithms@3.0.1(@csstools/css-tokenizer@3.0.1))(@csstools/css-tokenizer@3.0.1) + '@csstools/css-parser-algorithms': 3.0.1(@csstools/css-tokenizer@3.0.1) + '@csstools/css-tokenizer': 3.0.1 + '@csstools/media-query-list-parser': 3.0.1(@csstools/css-parser-algorithms@3.0.1(@csstools/css-tokenizer@3.0.1))(@csstools/css-tokenizer@3.0.1) + postcss: 8.4.47 + + postcss-custom-properties@14.0.1(postcss@8.4.47): + dependencies: + '@csstools/cascade-layer-name-parser': 2.0.1(@csstools/css-parser-algorithms@3.0.1(@csstools/css-tokenizer@3.0.1))(@csstools/css-tokenizer@3.0.1) + '@csstools/css-parser-algorithms': 3.0.1(@csstools/css-tokenizer@3.0.1) + '@csstools/css-tokenizer': 3.0.1 + '@csstools/utilities': 2.0.0(postcss@8.4.47) + postcss: 8.4.47 + postcss-value-parser: 4.2.0 + + postcss-custom-selectors@8.0.1(postcss@8.4.47): + dependencies: + '@csstools/cascade-layer-name-parser': 2.0.1(@csstools/css-parser-algorithms@3.0.1(@csstools/css-tokenizer@3.0.1))(@csstools/css-tokenizer@3.0.1) + '@csstools/css-parser-algorithms': 3.0.1(@csstools/css-tokenizer@3.0.1) + '@csstools/css-tokenizer': 3.0.1 + postcss: 8.4.47 + postcss-selector-parser: 6.1.0 + + postcss-dir-pseudo-class@9.0.0(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-selector-parser: 6.1.0 + + postcss-discard-comments@6.0.2(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + + postcss-discard-duplicates@6.0.3(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-discard-duplicates@7.0.0(postcss@8.4.39): dependencies: postcss: 8.4.39 + postcss-discard-empty@6.0.3(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-discard-empty@7.0.0(postcss@8.4.39): dependencies: postcss: 8.4.39 + postcss-discard-overridden@6.0.2(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + + postcss-discard-unused@6.0.5(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-selector-parser: 6.1.0 + + postcss-double-position-gradients@6.0.0(postcss@8.4.47): + dependencies: + '@csstools/postcss-progressive-custom-properties': 4.0.0(postcss@8.4.47) + '@csstools/utilities': 2.0.0(postcss@8.4.47) + postcss: 8.4.47 + postcss-value-parser: 4.2.0 + + postcss-focus-visible@10.0.0(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-selector-parser: 6.1.0 + + postcss-focus-within@9.0.0(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-selector-parser: 6.1.0 + + postcss-font-variant@5.0.0(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + + postcss-gap-properties@6.0.0(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + + postcss-image-set-function@7.0.0(postcss@8.4.47): + dependencies: + '@csstools/utilities': 2.0.0(postcss@8.4.47) + postcss: 8.4.47 + postcss-value-parser: 4.2.0 + + postcss-import@15.1.0(postcss@8.4.39): + dependencies: + postcss: 8.4.39 + postcss-value-parser: 4.2.0 + read-cache: 1.0.0 + resolve: 1.22.8 + postcss-import@15.1.0(postcss@8.4.47): dependencies: postcss: 8.4.47 @@ -31187,60 +40063,308 @@ snapshots: read-cache: 1.0.0 resolve: 1.22.8 + postcss-js@4.0.1(postcss@8.4.39): + dependencies: + camelcase-css: 2.0.1 + postcss: 8.4.39 + postcss-js@4.0.1(postcss@8.4.47): dependencies: camelcase-css: 2.0.1 postcss: 8.4.47 - postcss-load-config@4.0.1(postcss@8.4.31)(ts-node@10.9.1(@types/node@20.14.12)(typescript@5.4.5)): + postcss-lab-function@7.0.6(postcss@8.4.47): + dependencies: + '@csstools/css-color-parser': 3.0.6(@csstools/css-parser-algorithms@3.0.4(@csstools/css-tokenizer@3.0.3))(@csstools/css-tokenizer@3.0.3) + '@csstools/css-parser-algorithms': 3.0.4(@csstools/css-tokenizer@3.0.3) + '@csstools/css-tokenizer': 3.0.3 + '@csstools/postcss-progressive-custom-properties': 4.0.0(postcss@8.4.47) + '@csstools/utilities': 2.0.0(postcss@8.4.47) + postcss: 8.4.47 + + postcss-load-config@4.0.1(postcss@8.4.31)(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@20.14.12)(typescript@5.6.3)): dependencies: lilconfig: 2.1.0 yaml: 2.3.4 optionalDependencies: postcss: 8.4.31 - ts-node: 10.9.1(@types/node@20.14.12)(typescript@5.4.5) + ts-node: 10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@20.14.12)(typescript@5.6.3) - postcss-load-config@4.0.1(postcss@8.4.47)(ts-node@10.9.1(@types/node@20.14.12)(typescript@5.4.5)): + postcss-load-config@4.0.1(postcss@8.4.39)(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@20.14.12)(typescript@5.6.3)): dependencies: lilconfig: 2.1.0 yaml: 2.3.4 optionalDependencies: + postcss: 8.4.39 + ts-node: 10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@20.14.12)(typescript@5.6.3) + + postcss-load-config@4.0.1(postcss@8.4.47)(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@20.14.12)(typescript@5.6.3)): + dependencies: + lilconfig: 2.1.0 + yaml: 2.3.4 + optionalDependencies: + postcss: 8.4.47 + ts-node: 10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@20.14.12)(typescript@5.6.3) + + postcss-loader@7.3.4(postcss@8.4.47)(typescript@5.6.3)(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))): + dependencies: + cosmiconfig: 8.3.6(typescript@5.6.3) + jiti: 1.21.0 + postcss: 8.4.47 + semver: 7.6.3 + webpack: 5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3)) + transitivePeerDependencies: + - typescript + + postcss-logical@8.0.0(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-value-parser: 4.2.0 + + postcss-merge-idents@6.0.3(postcss@8.4.47): + dependencies: + cssnano-utils: 4.0.2(postcss@8.4.47) + postcss: 8.4.47 + postcss-value-parser: 4.2.0 + + postcss-merge-longhand@6.0.5(postcss@8.4.47): + dependencies: postcss: 8.4.47 - ts-node: 10.9.1(@types/node@20.14.12)(typescript@5.4.5) + postcss-value-parser: 4.2.0 + stylehacks: 6.1.1(postcss@8.4.47) + + postcss-merge-rules@6.1.1(postcss@8.4.47): + dependencies: + browserslist: 4.24.0 + caniuse-api: 3.0.0 + cssnano-utils: 4.0.2(postcss@8.4.47) + postcss: 8.4.47 + postcss-selector-parser: 6.1.0 postcss-merge-rules@7.0.2(postcss@8.4.39): dependencies: - browserslist: 4.23.1 + browserslist: 4.24.0 caniuse-api: 3.0.0 cssnano-utils: 5.0.0(postcss@8.4.39) postcss: 8.4.39 postcss-selector-parser: 6.1.0 + postcss-minify-font-values@6.1.0(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-value-parser: 4.2.0 + + postcss-minify-gradients@6.0.3(postcss@8.4.47): + dependencies: + colord: 2.9.3 + cssnano-utils: 4.0.2(postcss@8.4.47) + postcss: 8.4.47 + postcss-value-parser: 4.2.0 + + postcss-minify-params@6.1.0(postcss@8.4.47): + dependencies: + browserslist: 4.24.0 + cssnano-utils: 4.0.2(postcss@8.4.47) + postcss: 8.4.47 + postcss-value-parser: 4.2.0 + + postcss-minify-selectors@6.0.4(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-selector-parser: 6.1.0 + postcss-minify-selectors@7.0.2(postcss@8.4.39): dependencies: cssesc: 3.0.0 postcss: 8.4.39 postcss-selector-parser: 6.1.0 + postcss-modules-extract-imports@3.1.0(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + + postcss-modules-local-by-default@4.0.5(postcss@8.4.47): + dependencies: + icss-utils: 5.1.0(postcss@8.4.47) + postcss: 8.4.47 + postcss-selector-parser: 6.1.0 + postcss-value-parser: 4.2.0 + + postcss-modules-scope@3.2.0(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-selector-parser: 6.1.0 + + postcss-modules-values@4.0.0(postcss@8.4.47): + dependencies: + icss-utils: 5.1.0(postcss@8.4.47) + postcss: 8.4.47 + postcss-nested@6.0.1(postcss@8.4.39): dependencies: postcss: 8.4.39 - postcss-selector-parser: 6.0.13 + postcss-selector-parser: 6.1.0 postcss-nested@6.0.1(postcss@8.4.47): dependencies: postcss: 8.4.47 - postcss-selector-parser: 6.0.13 + postcss-selector-parser: 6.1.0 + + postcss-nesting@13.0.0(postcss@8.4.47): + dependencies: + '@csstools/selector-resolve-nested': 2.0.0(postcss-selector-parser@6.1.0) + '@csstools/selector-specificity': 4.0.0(postcss-selector-parser@6.1.0) + postcss: 8.4.47 + postcss-selector-parser: 6.1.0 + + postcss-normalize-charset@6.0.2(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + + postcss-normalize-display-values@6.0.2(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-value-parser: 4.2.0 + + postcss-normalize-positions@6.0.2(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-value-parser: 4.2.0 + + postcss-normalize-repeat-style@6.0.2(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-value-parser: 4.2.0 + + postcss-normalize-string@6.0.2(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-value-parser: 4.2.0 + + postcss-normalize-timing-functions@6.0.2(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-value-parser: 4.2.0 + + postcss-normalize-unicode@6.1.0(postcss@8.4.47): + dependencies: + browserslist: 4.24.0 + postcss: 8.4.47 + postcss-value-parser: 4.2.0 + + postcss-normalize-url@6.0.2(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-value-parser: 4.2.0 + + postcss-normalize-whitespace@6.0.2(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-value-parser: 4.2.0 postcss-normalize-whitespace@7.0.0(postcss@8.4.39): dependencies: postcss: 8.4.39 postcss-value-parser: 4.2.0 + postcss-opacity-percentage@3.0.0(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + + postcss-ordered-values@6.0.2(postcss@8.4.47): + dependencies: + cssnano-utils: 4.0.2(postcss@8.4.47) + postcss: 8.4.47 + postcss-value-parser: 4.2.0 + + postcss-overflow-shorthand@6.0.0(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-value-parser: 4.2.0 + + postcss-page-break@3.0.4(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + + postcss-place@10.0.0(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-value-parser: 4.2.0 + postcss-prefix-selector@1.16.0(postcss@5.2.18): dependencies: postcss: 5.2.18 + postcss-preset-env@10.0.6(postcss@8.4.47): + dependencies: + '@csstools/postcss-cascade-layers': 5.0.0(postcss@8.4.47) + '@csstools/postcss-color-function': 4.0.2(postcss@8.4.47) + '@csstools/postcss-color-mix-function': 3.0.2(postcss@8.4.47) + '@csstools/postcss-content-alt-text': 2.0.1(postcss@8.4.47) + '@csstools/postcss-exponential-functions': 2.0.1(postcss@8.4.47) + '@csstools/postcss-font-format-keywords': 4.0.0(postcss@8.4.47) + '@csstools/postcss-gamut-mapping': 2.0.2(postcss@8.4.47) + '@csstools/postcss-gradients-interpolation-method': 5.0.2(postcss@8.4.47) + '@csstools/postcss-hwb-function': 4.0.2(postcss@8.4.47) + '@csstools/postcss-ic-unit': 4.0.0(postcss@8.4.47) + '@csstools/postcss-initial': 2.0.0(postcss@8.4.47) + '@csstools/postcss-is-pseudo-class': 5.0.0(postcss@8.4.47) + '@csstools/postcss-light-dark-function': 2.0.4(postcss@8.4.47) + '@csstools/postcss-logical-float-and-clear': 3.0.0(postcss@8.4.47) + '@csstools/postcss-logical-overflow': 2.0.0(postcss@8.4.47) + '@csstools/postcss-logical-overscroll-behavior': 2.0.0(postcss@8.4.47) + '@csstools/postcss-logical-resize': 3.0.0(postcss@8.4.47) + '@csstools/postcss-logical-viewport-units': 3.0.1(postcss@8.4.47) + '@csstools/postcss-media-minmax': 2.0.1(postcss@8.4.47) + '@csstools/postcss-media-queries-aspect-ratio-number-values': 3.0.1(postcss@8.4.47) + '@csstools/postcss-nested-calc': 4.0.0(postcss@8.4.47) + '@csstools/postcss-normalize-display-values': 4.0.0(postcss@8.4.47) + '@csstools/postcss-oklab-function': 4.0.2(postcss@8.4.47) + '@csstools/postcss-progressive-custom-properties': 4.0.0(postcss@8.4.47) + '@csstools/postcss-relative-color-syntax': 3.0.2(postcss@8.4.47) + '@csstools/postcss-scope-pseudo-class': 4.0.0(postcss@8.4.47) + '@csstools/postcss-stepped-value-functions': 4.0.1(postcss@8.4.47) + '@csstools/postcss-text-decoration-shorthand': 4.0.1(postcss@8.4.47) + '@csstools/postcss-trigonometric-functions': 4.0.1(postcss@8.4.47) + '@csstools/postcss-unset-value': 4.0.0(postcss@8.4.47) + autoprefixer: 10.4.20(postcss@8.4.47) + browserslist: 4.23.1 + css-blank-pseudo: 7.0.0(postcss@8.4.47) + css-has-pseudo: 7.0.0(postcss@8.4.47) + css-prefers-color-scheme: 10.0.0(postcss@8.4.47) + cssdb: 8.1.1 + postcss: 8.4.47 + postcss-attribute-case-insensitive: 7.0.0(postcss@8.4.47) + postcss-clamp: 4.1.0(postcss@8.4.47) + postcss-color-functional-notation: 7.0.2(postcss@8.4.47) + postcss-color-hex-alpha: 10.0.0(postcss@8.4.47) + postcss-color-rebeccapurple: 10.0.0(postcss@8.4.47) + postcss-custom-media: 11.0.2(postcss@8.4.47) + postcss-custom-properties: 14.0.1(postcss@8.4.47) + postcss-custom-selectors: 8.0.1(postcss@8.4.47) + postcss-dir-pseudo-class: 9.0.0(postcss@8.4.47) + postcss-double-position-gradients: 6.0.0(postcss@8.4.47) + postcss-focus-visible: 10.0.0(postcss@8.4.47) + postcss-focus-within: 9.0.0(postcss@8.4.47) + postcss-font-variant: 5.0.0(postcss@8.4.47) + postcss-gap-properties: 6.0.0(postcss@8.4.47) + postcss-image-set-function: 7.0.0(postcss@8.4.47) + postcss-lab-function: 7.0.6(postcss@8.4.47) + postcss-logical: 8.0.0(postcss@8.4.47) + postcss-nesting: 13.0.0(postcss@8.4.47) + postcss-opacity-percentage: 3.0.0(postcss@8.4.47) + postcss-overflow-shorthand: 6.0.0(postcss@8.4.47) + postcss-page-break: 3.0.4(postcss@8.4.47) + postcss-place: 10.0.0(postcss@8.4.47) + postcss-pseudo-class-any-link: 10.0.0(postcss@8.4.47) + postcss-replace-overflow-wrap: 4.0.0(postcss@8.4.47) + postcss-selector-not: 8.0.0(postcss@8.4.47) + + postcss-pseudo-class-any-link@10.0.0(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-selector-parser: 6.1.0 + postcss-pxtorem@6.0.0(postcss@8.4.31): dependencies: postcss: 8.4.31 @@ -31253,6 +40377,31 @@ snapshots: dependencies: postcss: 8.4.47 + postcss-reduce-idents@6.0.3(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-value-parser: 4.2.0 + + postcss-reduce-initial@6.1.0(postcss@8.4.47): + dependencies: + browserslist: 4.24.0 + caniuse-api: 3.0.0 + postcss: 8.4.47 + + postcss-reduce-transforms@6.0.2(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-value-parser: 4.2.0 + + postcss-replace-overflow-wrap@4.0.0(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + + postcss-selector-not@8.0.0(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-selector-parser: 6.1.0 + postcss-selector-parser@6.0.13: dependencies: cssesc: 3.0.0 @@ -31263,6 +40412,22 @@ snapshots: cssesc: 3.0.0 util-deprecate: 1.0.2 + postcss-sort-media-queries@5.2.0(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + sort-css-media-queries: 2.2.0 + + postcss-svgo@6.0.3(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-value-parser: 4.2.0 + svgo: 3.2.0 + + postcss-unique-selectors@6.0.4(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss-selector-parser: 6.1.0 + postcss-url@10.1.3(postcss@8.4.31): dependencies: make-dir: 3.1.0 @@ -31273,6 +40438,10 @@ snapshots: postcss-value-parser@4.2.0: {} + postcss-zindex@6.0.2(postcss@8.4.47): + dependencies: + postcss: 8.4.47 + postcss@5.2.18: dependencies: chalk: 1.1.3 @@ -31306,7 +40475,7 @@ snapshots: postcss@8.4.38: dependencies: nanoid: 3.3.7 - picocolors: 1.0.1 + picocolors: 1.1.1 source-map-js: 1.2.0 postcss@8.4.39: @@ -31348,6 +40517,23 @@ snapshots: dependencies: commander: 9.5.0 + potpack@1.0.2: {} + + prebuild-install@7.1.2: + dependencies: + detect-libc: 2.0.3 + expand-template: 2.0.3 + github-from-package: 0.0.0 + minimist: 1.2.8 + mkdirp-classic: 0.5.3 + napi-build-utils: 1.0.2 + node-abi: 3.62.0 + pump: 3.0.0 + rc: 1.2.8 + simple-get: 4.0.1 + tar-fs: 2.1.1 + tunnel-agent: 0.6.0 + preferred-pm@3.1.2: dependencies: find-up: 5.0.0 @@ -31367,18 +40553,33 @@ snapshots: prettier@3.3.2: {} + pretty-error@4.0.0: + dependencies: + lodash: 4.17.21 + renderkid: 3.0.0 + pretty-format@29.7.0: dependencies: '@jest/schemas': 29.6.3 ansi-styles: 5.2.0 react-is: 18.2.0 - primevue@3.52.0(vue@3.3.12(typescript@5.4.5)): + pretty-time@1.1.0: {} + + primevue@3.52.0(vue@3.3.12(typescript@5.6.3)): dependencies: - vue: 3.3.12(typescript@5.4.5) + vue: 3.3.12(typescript@5.6.3) printj@1.1.2: {} + prism-react-renderer@2.4.0(react@18.2.0): + dependencies: + '@types/prismjs': 1.26.5 + clsx: 2.1.1 + react: 18.2.0 + + prismjs@1.29.0: {} + process-nextick-args@2.0.1: {} progress@2.0.3: {} @@ -31390,6 +40591,11 @@ snapshots: err-code: 2.0.3 retry: 0.12.0 + promise-worker-transferable@1.0.4: + dependencies: + is-promise: 2.2.2 + lie: 3.3.0 + prompts@2.4.2: dependencies: kleur: 3.0.3 @@ -31403,6 +40609,8 @@ snapshots: property-information@6.5.0: {} + proto-list@1.2.4: {} + proxy-addr@2.0.7: dependencies: forwarded: 0.2.0 @@ -31420,10 +40628,16 @@ snapshots: end-of-stream: 1.4.4 once: 1.4.0 + punycode.js@2.3.1: {} + punycode@1.4.1: {} punycode@2.3.1: {} + pupa@3.1.0: + dependencies: + escape-goat: 4.0.0 + pure-rand@6.1.0: {} qrcode.react@3.1.0(react@18.2.0): @@ -31464,6 +40678,12 @@ snapshots: queue-microtask@1.2.3: {} + queue-tick@1.0.1: {} + + queue@6.0.2: + dependencies: + inherits: 2.0.4 + quick-lru@4.0.1: {} quick-lru@5.1.1: {} @@ -31701,9 +40921,9 @@ snapshots: rc-resize-observer@1.4.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0): dependencies: - '@babel/runtime': 7.23.2 - classnames: 2.3.2 - rc-util: 5.38.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + '@babel/runtime': 7.25.0 + classnames: 2.5.1 + rc-util: 5.43.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) resize-observer-polyfill: 1.5.1 @@ -31852,7 +41072,12 @@ snapshots: minimist: 1.2.8 strip-json-comments: 2.0.1 - re-resizable@6.9.17(react-dom@18.2.0(react@18.2.0))(react@18.2.0): + re-resizable@6.10.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0): + dependencies: + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + + re-resizable@6.10.3(react-dom@18.2.0(react@18.2.0))(react@18.2.0): dependencies: react: 18.2.0 react-dom: 18.2.0(react@18.2.0) @@ -31873,12 +41098,56 @@ snapshots: reactcss: 1.2.3(react@17.0.2) tinycolor2: 1.6.0 + react-colorful@5.6.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0): + dependencies: + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + + react-composer@5.0.3(react@18.2.0): + dependencies: + prop-types: 15.8.1 + react: 18.2.0 + react-copy-to-clipboard@5.1.0(react@18.2.0): dependencies: copy-to-clipboard: 3.3.3 prop-types: 15.8.1 react: 18.2.0 + react-dev-utils@12.0.1(eslint@8.57.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3)))(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))): + dependencies: + '@babel/code-frame': 7.24.7 + address: 1.2.2 + browserslist: 4.23.1 + chalk: 4.1.2 + cross-spawn: 7.0.3 + detect-port-alt: 1.1.6 + escape-string-regexp: 4.0.0 + filesize: 8.0.7 + find-up: 5.0.0 + fork-ts-checker-webpack-plugin: 6.5.3(eslint@8.57.0)(typescript@5.6.3)(vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3)))(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))) + global-modules: 2.0.0 + globby: 11.1.0 + gzip-size: 6.0.0 + immer: 9.0.21 + is-root: 2.1.0 + loader-utils: 3.3.1 + open: 8.4.2 + pkg-up: 3.1.0 + prompts: 2.4.2 + react-error-overlay: 6.0.11 + recursive-readdir: 2.2.3 + shell-quote: 1.8.1 + strip-ansi: 6.0.1 + text-table: 0.2.0 + webpack: 5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3)) + optionalDependencies: + typescript: 5.6.3 + transitivePeerDependencies: + - eslint + - supports-color + - vue-template-compiler + react-dom@17.0.2(react@17.0.2): dependencies: loose-envify: 1.4.0 @@ -31899,11 +41168,22 @@ snapshots: react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + react-dropzone@12.1.0(react@18.2.0): + dependencies: + attr-accept: 2.2.2 + file-selector: 0.5.0 + prop-types: 15.8.1 + react: 18.2.0 + react-error-boundary@3.0.2(react@17.0.2): dependencies: '@babel/runtime': 7.23.2 react: 17.0.2 + react-error-overlay@6.0.11: {} + + react-fast-compare@3.2.2: {} + react-focus-lock@2.9.6(@types/react@18.2.35)(react@17.0.2): dependencies: '@babel/runtime': 7.23.2 @@ -31916,6 +41196,23 @@ snapshots: optionalDependencies: '@types/react': 18.2.35 + react-helmet-async@1.3.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0): + dependencies: + '@babel/runtime': 7.25.0 + invariant: 2.2.4 + prop-types: 15.8.1 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + react-fast-compare: 3.2.2 + shallowequal: 1.1.0 + + react-helmet-async@2.0.5(react@18.2.0): + dependencies: + invariant: 2.2.4 + react: 18.2.0 + react-fast-compare: 3.2.2 + shallowequal: 1.1.0 + react-highlight-words@0.20.0(react@17.0.2): dependencies: highlight-words-core: 1.2.3 @@ -31927,11 +41224,15 @@ snapshots: dependencies: highlight.js: 10.7.3 - react-hotkeys-hook@4.5.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0): + react-hotkeys-hook@4.6.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0): dependencies: react: 18.2.0 react-dom: 18.2.0(react@18.2.0) + react-icons@5.3.0(react@18.2.0): + dependencies: + react: 18.2.0 + react-intersection-observer@9.13.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0): dependencies: react: 18.2.0 @@ -31944,6 +41245,10 @@ snapshots: react-is@18.2.0: {} + react-json-view-lite@1.5.0(react@18.2.0): + dependencies: + react: 18.2.0 + react-layout-kit@1.9.0(react@18.2.0): dependencies: '@babel/runtime': 7.25.0 @@ -31952,6 +41257,12 @@ snapshots: transitivePeerDependencies: - supports-color + react-loadable-ssr-addon-v5-slorber@1.0.1(@docusaurus/react-loadable@6.0.0(react@18.2.0))(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))): + dependencies: + '@babel/runtime': 7.25.0 + react-loadable: '@docusaurus/react-loadable@6.0.0(react@18.2.0)' + webpack: 5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3)) + react-markdown@8.0.7(@types/react@18.2.35)(react@18.2.0): dependencies: '@types/hast': 2.3.10 @@ -31982,6 +41293,12 @@ snapshots: react: 17.0.2 scheduler: 0.19.1 + react-reconciler@0.27.0(react@18.2.0): + dependencies: + loose-envify: 1.4.0 + react: 18.2.0 + scheduler: 0.21.0 + react-redux@7.2.9(react-dom@17.0.2(react@17.0.2))(react@17.0.2): dependencies: '@babel/runtime': 7.23.2 @@ -32010,14 +41327,20 @@ snapshots: react-refresh@0.14.2: {} - react-rnd@10.4.12(react-dom@18.2.0(react@18.2.0))(react@18.2.0): + react-rnd@10.4.13(react-dom@18.2.0(react@18.2.0))(react@18.2.0): dependencies: - re-resizable: 6.9.17(react-dom@18.2.0(react@18.2.0))(react@18.2.0) + re-resizable: 6.10.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0) react: 18.2.0 react-dom: 18.2.0(react@18.2.0) react-draggable: 4.4.6(react-dom@18.2.0(react@18.2.0))(react@18.2.0) tslib: 2.6.2 + react-router-config@5.1.1(react-router@5.3.4(react@18.2.0))(react@18.2.0): + dependencies: + '@babel/runtime': 7.25.0 + react: 18.2.0 + react-router: 5.3.4(react@18.2.0) + react-router-dom@5.3.4(react@17.0.2): dependencies: '@babel/runtime': 7.23.2 @@ -32029,6 +41352,17 @@ snapshots: tiny-invariant: 1.3.1 tiny-warning: 1.0.3 + react-router-dom@5.3.4(react@18.2.0): + dependencies: + '@babel/runtime': 7.23.2 + history: 4.10.1 + loose-envify: 1.4.0 + prop-types: 15.8.1 + react: 18.2.0 + react-router: 5.3.4(react@18.2.0) + tiny-invariant: 1.3.1 + tiny-warning: 1.0.3 + react-router-dom@6.18.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0): dependencies: '@remix-run/router': 1.11.0 @@ -32056,6 +41390,19 @@ snapshots: tiny-invariant: 1.3.1 tiny-warning: 1.0.3 + react-router@5.3.4(react@18.2.0): + dependencies: + '@babel/runtime': 7.23.2 + history: 4.10.1 + hoist-non-react-statics: 3.3.2 + loose-envify: 1.4.0 + path-to-regexp: 1.8.0 + prop-types: 15.8.1 + react: 18.2.0 + react-is: 16.13.1 + tiny-invariant: 1.3.1 + tiny-warning: 1.0.3 + react-router@6.18.0(react@18.2.0): dependencies: '@remix-run/router': 1.11.0 @@ -32075,6 +41422,20 @@ snapshots: react: 17.0.2 react-dom: 17.0.2(react@17.0.2) + react-use-measure@2.1.1(react-dom@18.2.0(react@18.2.0))(react@18.2.0): + dependencies: + debounce: 1.2.1 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + + react-waypoint@10.3.0(react@18.2.0): + dependencies: + '@babel/runtime': 7.25.0 + consolidated-events: 2.0.2 + prop-types: 15.8.1 + react: 18.2.0 + react-is: 18.2.0 + react-window@1.8.10(react-dom@18.2.0(react@18.2.0))(react@18.2.0): dependencies: '@babel/runtime': 7.25.0 @@ -32189,10 +41550,20 @@ snapshots: readdirp@4.0.2: {} + reading-time@1.5.0: {} + + rechoir@0.6.2: + dependencies: + resolve: 1.22.8 + rechoir@0.8.0: dependencies: resolve: 1.22.8 + recursive-readdir@2.2.3: + dependencies: + minimatch: 3.1.2 + redent@3.0.0: dependencies: indent-string: 4.0.0 @@ -32212,6 +41583,12 @@ snapshots: reflect-metadata@0.2.2: {} + regenerate-unicode-properties@10.2.0: + dependencies: + regenerate: 1.4.2 + + regenerate@1.4.2: {} + regenerator-runtime@0.10.5: {} regenerator-runtime@0.11.1: {} @@ -32220,26 +41597,65 @@ snapshots: regenerator-runtime@0.14.0: {} + regenerator-transform@0.15.2: + dependencies: + '@babel/runtime': 7.25.0 + regex-not@1.0.2: dependencies: extend-shallow: 3.0.2 safe-regex: 1.1.0 + regex-recursion@4.3.0: + dependencies: + regex-utilities: 2.3.0 + + regex-utilities@2.3.0: {} + + regex@4.3.3: {} + + regex@5.0.2: + dependencies: + regex-utilities: 2.3.0 + regexp.prototype.flags@1.5.1: dependencies: call-bind: 1.0.7 define-properties: 1.2.1 set-function-name: 2.0.1 + regexpu-core@6.1.1: + dependencies: + regenerate: 1.4.2 + regenerate-unicode-properties: 10.2.0 + regjsgen: 0.8.0 + regjsparser: 0.11.1 + unicode-match-property-ecmascript: 2.0.0 + unicode-match-property-value-ecmascript: 2.2.0 + registry-auth-token@3.3.2: dependencies: rc: 1.2.8 safe-buffer: 5.2.1 + registry-auth-token@5.0.2: + dependencies: + '@pnpm/npm-conf': 2.3.1 + registry-url@3.1.0: dependencies: rc: 1.2.8 + registry-url@6.0.1: + dependencies: + rc: 1.2.8 + + regjsgen@0.8.0: {} + + regjsparser@0.11.1: + dependencies: + jsesc: 3.0.2 + regression@2.0.1: {} rehype-katex@6.0.3: @@ -32248,9 +41664,43 @@ snapshots: '@types/katex': 0.14.0 hast-util-from-html-isomorphic: 1.0.0 hast-util-to-text: 3.1.2 - katex: 0.16.11 + katex: 0.16.15 unist-util-visit: 4.1.2 + rehype-raw@7.0.0: + dependencies: + '@types/hast': 3.0.4 + hast-util-raw: 9.0.4 + vfile: 6.0.3 + + relateurl@0.2.7: {} + + remark-directive@3.0.0: + dependencies: + '@types/mdast': 4.0.4 + mdast-util-directive: 3.0.0 + micromark-extension-directive: 3.0.2 + unified: 11.0.5 + transitivePeerDependencies: + - supports-color + + remark-emoji@4.0.1: + dependencies: + '@types/mdast': 4.0.4 + emoticon: 4.1.0 + mdast-util-find-and-replace: 3.0.1 + node-emoji: 2.1.3 + unified: 11.0.5 + + remark-frontmatter@5.0.0: + dependencies: + '@types/mdast': 4.0.4 + mdast-util-frontmatter: 2.0.1 + micromark-extension-frontmatter: 2.0.0 + unified: 11.0.5 + transitivePeerDependencies: + - supports-color + remark-gfm@3.0.1: dependencies: '@types/mdast': 3.0.15 @@ -32260,6 +41710,17 @@ snapshots: transitivePeerDependencies: - supports-color + remark-gfm@4.0.0: + dependencies: + '@types/mdast': 4.0.4 + mdast-util-gfm: 3.0.0 + micromark-extension-gfm: 3.0.0 + remark-parse: 11.0.0 + remark-stringify: 11.0.0 + unified: 11.0.5 + transitivePeerDependencies: + - supports-color + remark-math@5.1.1: dependencies: '@types/mdast': 3.0.15 @@ -32267,6 +41728,13 @@ snapshots: micromark-extension-math: 2.1.2 unified: 10.1.2 + remark-mdx@3.0.1: + dependencies: + mdast-util-mdx: 3.0.0 + micromark-extension-mdxjs: 3.0.0 + transitivePeerDependencies: + - supports-color + remark-parse@10.0.2: dependencies: '@types/mdast': 3.0.15 @@ -32275,6 +41743,15 @@ snapshots: transitivePeerDependencies: - supports-color + remark-parse@11.0.0: + dependencies: + '@types/mdast': 4.0.4 + mdast-util-from-markdown: 2.0.1 + micromark-util-types: 2.0.0 + unified: 11.0.5 + transitivePeerDependencies: + - supports-color + remark-rehype@10.1.0: dependencies: '@types/hast': 2.3.10 @@ -32282,6 +41759,43 @@ snapshots: mdast-util-to-hast: 12.3.0 unified: 10.1.2 + remark-rehype@11.1.1: + dependencies: + '@types/hast': 3.0.4 + '@types/mdast': 4.0.4 + mdast-util-to-hast: 13.2.0 + unified: 11.0.5 + vfile: 6.0.3 + + remark-shiki-twoslash@3.1.3(typescript@5.5.4): + dependencies: + '@types/unist': 2.0.11 + '@typescript/twoslash': 3.1.0 + '@typescript/vfs': 1.3.4 + fenceparser: 1.1.1 + regenerator-runtime: 0.13.9 + shiki: 0.10.1 + shiki-twoslash: 3.1.2(typescript@5.5.4) + tslib: 2.1.0 + typescript: 5.5.4 + unist-util-visit: 2.0.3 + transitivePeerDependencies: + - supports-color + + remark-stringify@11.0.0: + dependencies: + '@types/mdast': 4.0.4 + mdast-util-to-markdown: 2.1.0 + unified: 11.0.5 + + renderkid@3.0.0: + dependencies: + css-select: 4.3.0 + dom-converter: 0.2.0 + htmlparser2: 6.1.0 + lodash: 4.17.21 + strip-ansi: 6.0.1 + repeat-element@1.1.4: {} repeat-string@1.6.1: {} @@ -32327,11 +41841,6 @@ snapshots: dependencies: get-installed-path: 2.1.1 - resolve-path@1.4.0: - dependencies: - http-errors: 1.6.3 - path-is-absolute: 1.0.1 - resolve-pathname@3.0.0: {} resolve-pkg-maps@1.0.0: {} @@ -32350,6 +41859,10 @@ snapshots: dependencies: lowercase-keys: 2.0.0 + responselike@3.0.0: + dependencies: + lowercase-keys: 3.0.0 + restore-cursor@2.0.0: dependencies: onetime: 2.0.1 @@ -32369,6 +41882,8 @@ snapshots: retry@0.12.0: {} + retry@0.13.1: {} + reusify@1.0.4: {} rfdc@1.3.0: {} @@ -32386,6 +41901,11 @@ snapshots: dependencies: glob: 7.2.3 + rimraf@6.0.1: + dependencies: + glob: 11.0.0 + package-json-from-dist: 1.0.0 + roarr@2.15.4: dependencies: boolean: 3.2.0 @@ -32433,9 +41953,16 @@ snapshots: '@rollup/rollup-win32-x64-msvc': 4.14.1 fsevents: 2.3.3 - run-applescript@5.0.0: + rtl-detect@1.1.2: {} + + rtlcss@4.3.0: dependencies: - execa: 5.1.1 + escalade: 3.1.2 + picocolors: 1.1.1 + postcss: 8.4.47 + strip-json-comments: 3.1.1 + + run-applescript@7.0.0: {} run-async@2.4.1: {} @@ -32583,6 +42110,17 @@ snapshots: sass-embedded-win32-ia32: 1.74.1 sass-embedded-win32-x64: 1.74.1 + sass-loader@10.5.2(sass@1.74.1)(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))): + dependencies: + klona: 2.0.6 + loader-utils: 2.0.4 + neo-async: 2.6.2 + schema-utils: 3.3.0 + semver: 7.5.4 + webpack: 5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3)) + optionalDependencies: + sass: 1.74.1 + sass@1.69.5: dependencies: chokidar: 3.5.3 @@ -32591,9 +42129,9 @@ snapshots: sass@1.74.1: dependencies: - chokidar: 3.5.3 + chokidar: 3.6.0 immutable: 4.3.4 - source-map-js: 1.0.2 + source-map-js: 1.2.1 sax@1.3.0: {} @@ -32607,16 +42145,33 @@ snapshots: loose-envify: 1.4.0 object-assign: 4.1.1 + scheduler@0.21.0: + dependencies: + loose-envify: 1.4.0 + scheduler@0.23.0: dependencies: loose-envify: 1.4.0 + schema-utils@2.7.0: + dependencies: + '@types/json-schema': 7.0.15 + ajv: 6.12.6 + ajv-keywords: 3.5.2(ajv@6.12.6) + schema-utils@3.3.0: dependencies: '@types/json-schema': 7.0.15 ajv: 6.12.6 ajv-keywords: 3.5.2(ajv@6.12.6) + schema-utils@4.2.0: + dependencies: + '@types/json-schema': 7.0.15 + ajv: 8.12.0 + ajv-formats: 2.1.1 + ajv-keywords: 5.1.0(ajv@8.12.0) + screenfull@5.2.0: {} scroll-into-view-if-needed@2.2.20: @@ -32633,13 +42188,29 @@ snapshots: scule@1.0.0: {} + section-matter@1.0.0: + dependencies: + extend-shallow: 2.0.1 + kind-of: 6.0.3 + seemly@0.3.8: {} + select-hose@2.0.0: {} + select@1.1.2: {} + selfsigned@2.4.1: + dependencies: + '@types/node-forge': 1.3.11 + node-forge: 1.3.1 + semver-compare@1.0.0: optional: true + semver-diff@4.0.0: + dependencies: + semver: 7.6.3 + semver@5.7.2: {} semver@6.3.1: {} @@ -32648,6 +42219,8 @@ snapshots: dependencies: lru-cache: 6.0.0 + semver@7.6.3: {} + send@0.18.0: dependencies: debug: 2.6.9 @@ -32688,6 +42261,18 @@ snapshots: path-to-regexp: 2.2.1 range-parser: 1.2.0 + serve-index@1.9.1: + dependencies: + accepts: 1.3.8 + batch: 0.6.1 + debug: 2.6.9 + escape-html: 1.0.3 + http-errors: 1.6.3 + mime-types: 2.1.35 + parseurl: 1.3.3 + transitivePeerDependencies: + - supports-color + serve-static@1.15.0: dependencies: encodeurl: 1.0.2 @@ -32743,10 +42328,25 @@ snapshots: setprototypeof@1.2.0: {} + shallow-clone@3.0.1: + dependencies: + kind-of: 6.0.3 + shallow-equal@1.2.1: {} shallowequal@1.1.0: {} + sharp@0.32.6: + dependencies: + color: 4.2.3 + detect-libc: 2.0.3 + node-addon-api: 6.1.0 + prebuild-install: 7.1.2 + semver: 7.5.4 + simple-get: 4.0.1 + tar-fs: 3.0.6 + tunnel-agent: 0.6.0 + shebang-command@1.2.0: dependencies: shebang-regex: 1.0.0 @@ -32759,16 +42359,59 @@ snapshots: shebang-regex@3.0.0: {} + shell-quote@1.8.1: {} + + shelljs@0.8.5: + dependencies: + glob: 7.2.3 + interpret: 1.4.0 + rechoir: 0.6.2 + shepherd.js@11.1.1: dependencies: - '@floating-ui/dom': 1.6.10 + '@floating-ui/dom': 1.6.11 deepmerge: 4.3.1 - shiki@1.14.1: + shiki-twoslash@3.1.2(typescript@5.5.4): + dependencies: + '@typescript/twoslash': 3.1.0 + '@typescript/vfs': 1.3.4 + fenceparser: 1.1.1 + shiki: 0.10.1 + typescript: 5.5.4 + transitivePeerDependencies: + - supports-color + + shiki@0.10.1: + dependencies: + jsonc-parser: 3.3.1 + vscode-oniguruma: 1.7.0 + vscode-textmate: 5.2.0 + + shiki@1.22.0: + dependencies: + '@shikijs/core': 1.22.0 + '@shikijs/engine-javascript': 1.22.0 + '@shikijs/engine-oniguruma': 1.22.0 + '@shikijs/types': 1.22.0 + '@shikijs/vscode-textmate': 9.3.0 + '@types/hast': 3.0.4 + + shiki@1.24.2: dependencies: - '@shikijs/core': 1.14.1 + '@shikijs/core': 1.24.2 + '@shikijs/engine-javascript': 1.24.2 + '@shikijs/engine-oniguruma': 1.24.2 + '@shikijs/types': 1.24.2 + '@shikijs/vscode-textmate': 9.3.0 '@types/hast': 3.0.4 + shikiji-core@0.9.10: {} + + shikiji@0.9.10: + dependencies: + shikiji-core: 0.9.10 + side-channel@1.0.4: dependencies: call-bind: 1.0.7 @@ -32781,6 +42424,14 @@ snapshots: signal-exit@4.1.0: {} + simple-concat@1.0.1: {} + + simple-get@4.0.1: + dependencies: + decompress-response: 6.0.0 + once: 1.4.0 + simple-concat: 1.0.1 + simple-statistics@6.1.1: {} simple-swizzle@0.2.2: @@ -32789,7 +42440,7 @@ snapshots: simple-update-notifier@2.0.0: dependencies: - semver: 7.5.4 + semver: 7.6.3 sirv@2.0.3: dependencies: @@ -32803,14 +42454,35 @@ snapshots: mrmime: 2.0.0 totalist: 3.0.1 + sirv@3.0.0: + dependencies: + '@polka/url': 1.0.0-next.25 + mrmime: 2.0.0 + totalist: 3.0.1 + sisteransi@1.0.5: {} + sitemap@7.1.2: + dependencies: + '@types/node': 17.0.45 + '@types/sax': 1.2.7 + arg: 5.0.2 + sax: 1.3.0 + size-sensor@1.0.2: {} + skin-tone@2.0.0: + dependencies: + unicode-emoji-modifier-base: 1.0.0 + skmeans@0.9.7: {} slash@3.0.0: {} + slash@4.0.0: {} + + slashes@3.0.12: {} + slice-ansi@3.0.0: dependencies: ansi-styles: 4.3.0 @@ -32862,6 +42534,12 @@ snapshots: transitivePeerDependencies: - supports-color + sockjs@0.3.24: + dependencies: + faye-websocket: 0.11.4 + uuid: 8.3.2 + websocket-driver: 0.7.4 + socks-proxy-agent@7.0.0: dependencies: agent-base: 6.0.2 @@ -32892,10 +42570,12 @@ snapshots: '@babel/types': 7.23.0 solid-js: 1.8.5 - sortablejs@1.15.1: {} + sort-css-media-queries@2.2.0: {} sortablejs@1.15.2: {} + sortablejs@1.15.3: {} + source-map-js@1.0.2: {} source-map-js@1.2.0: {} @@ -32959,6 +42639,27 @@ snapshots: spdx-license-ids@3.0.16: {} + spdy-transport@3.0.0: + dependencies: + debug: 4.3.7 + detect-node: 2.1.0 + hpack.js: 2.1.6 + obuf: 1.1.2 + readable-stream: 3.6.2 + wbuf: 1.7.3 + transitivePeerDependencies: + - supports-color + + spdy@4.0.2: + dependencies: + debug: 4.3.7 + handle-thing: 2.0.1 + http-deceiver: 1.2.7 + select-hose: 2.0.0 + spdy-transport: 3.0.0 + transitivePeerDependencies: + - supports-color + splaytree@3.1.2: {} split-on-first@1.1.0: {} @@ -32975,6 +42676,8 @@ snapshots: sprintf-js@1.1.3: {} + srcset@4.0.0: {} + ssf@0.11.2: dependencies: frac: 1.1.2 @@ -32998,6 +42701,12 @@ snapshots: define-property: 0.2.5 object-copy: 0.1.0 + stats-gl@2.2.8: + dependencies: + '@types/three': 0.163.0 + + stats.js@0.17.0: {} + statuses@1.5.0: {} statuses@2.0.1: {} @@ -33016,6 +42725,14 @@ snapshots: streamsearch@1.1.0: {} + streamx@2.20.1: + dependencies: + fast-fifo: 1.3.2 + queue-tick: 1.0.1 + text-decoder: 1.2.0 + optionalDependencies: + bare-events: 2.5.0 + strict-uri-encode@1.1.0: {} strict-uri-encode@2.0.0: {} @@ -33074,6 +42791,17 @@ snapshots: dependencies: safe-buffer: 5.2.1 + stringify-entities@4.0.4: + dependencies: + character-entities-html4: 2.1.0 + character-entities-legacy: 3.0.0 + + stringify-object@3.3.0: + dependencies: + get-own-enumerable-property-symbols: 3.0.2 + is-obj: 1.0.1 + is-regexp: 1.0.0 + strip-ansi@3.0.1: dependencies: ansi-regex: 2.1.1 @@ -33090,6 +42818,8 @@ snapshots: dependencies: ansi-regex: 6.0.1 + strip-bom-string@1.0.0: {} + strip-bom@3.0.0: {} strip-bom@4.0.0: {} @@ -33110,7 +42840,7 @@ snapshots: strip-literal@1.3.0: dependencies: - acorn: 8.11.2 + acorn: 8.14.0 strip-outer@1.0.1: dependencies: @@ -33120,13 +42850,23 @@ snapshots: dependencies: inline-style-parser: 0.1.1 + style-to-object@1.0.8: + dependencies: + inline-style-parser: 0.2.4 + + stylehacks@6.1.1(postcss@8.4.47): + dependencies: + browserslist: 4.24.0 + postcss: 8.4.47 + postcss-selector-parser: 6.1.0 + stylis@4.2.0: {} stylis@4.3.0: {} sucrase@3.34.0: dependencies: - '@jridgewell/gen-mapping': 0.3.3 + '@jridgewell/gen-mapping': 0.3.5 commander: 4.1.1 glob: 7.1.6 lines-and-columns: 1.2.4 @@ -33146,7 +42886,7 @@ snapshots: dependencies: component-emitter: 1.3.1 cookiejar: 2.1.4 - debug: 4.3.4 + debug: 4.3.7 fast-safe-stringify: 2.1.1 form-data: 4.0.0 formidable: 2.1.2 @@ -33184,12 +42924,16 @@ snapshots: supports-preserve-symlinks-flag@1.0.0: {} - svelte-check@4.1.1(picomatch@4.0.2)(svelte@5.2.1)(typescript@5.2.2): + suspend-react@0.1.3(react@18.2.0): + dependencies: + react: 18.2.0 + + svelte-check@4.0.8(picomatch@4.0.2)(svelte@5.2.1)(typescript@5.2.2): dependencies: '@jridgewell/trace-mapping': 0.3.25 chokidar: 4.0.1 fdir: 6.2.0(picomatch@4.0.2) - picocolors: 1.1.0 + picocolors: 1.0.1 sade: 1.8.1 svelte: 5.2.1 typescript: 5.2.2 @@ -33242,20 +42986,36 @@ snapshots: css-tree: 2.3.1 css-what: 6.1.0 csso: 5.0.5 - picocolors: 1.0.1 + picocolors: 1.1.1 + + swc-loader@0.2.6(@swc/core@1.7.26(@swc/helpers@0.5.3))(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))): + dependencies: + '@swc/core': 1.7.26(@swc/helpers@0.5.3) + '@swc/counter': 0.1.3 + webpack: 5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3)) symbol-observable@4.0.0: {} synckit@0.8.8: dependencies: '@pkgr/core': 0.1.1 - tslib: 2.6.2 + tslib: 2.6.3 tabbable@6.2.0: {} tailwind-merge@1.14.0: {} - tailwindcss@3.3.5(ts-node@10.9.1(@types/node@20.14.12)(typescript@5.4.5)): + tailwind-merge@2.5.5: {} + + tailwindcss-animate@1.0.7(tailwindcss@3.4.13(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@20.14.12)(typescript@5.6.3))): + dependencies: + tailwindcss: 3.4.13(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@20.14.12)(typescript@5.6.3)) + + tailwindcss-animate@1.0.7(tailwindcss@4.0.0-alpha.26): + dependencies: + tailwindcss: 4.0.0-alpha.26 + + tailwindcss@3.3.5(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@20.14.12)(typescript@5.6.3)): dependencies: '@alloc/quick-lru': 5.2.0 arg: 5.0.2 @@ -33271,12 +43031,39 @@ snapshots: normalize-path: 3.0.0 object-hash: 3.0.0 picocolors: 1.0.0 + postcss: 8.4.39 + postcss-import: 15.1.0(postcss@8.4.39) + postcss-js: 4.0.1(postcss@8.4.39) + postcss-load-config: 4.0.1(postcss@8.4.39)(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@20.14.12)(typescript@5.6.3)) + postcss-nested: 6.0.1(postcss@8.4.39) + postcss-selector-parser: 6.0.13 + resolve: 1.22.8 + sucrase: 3.34.0 + transitivePeerDependencies: + - ts-node + + tailwindcss@3.4.13(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@20.14.12)(typescript@5.6.3)): + dependencies: + '@alloc/quick-lru': 5.2.0 + arg: 5.0.2 + chokidar: 3.6.0 + didyoumean: 1.2.2 + dlv: 1.1.3 + fast-glob: 3.3.2 + glob-parent: 6.0.2 + is-glob: 4.0.3 + jiti: 1.21.0 + lilconfig: 2.1.0 + micromatch: 4.0.5 + normalize-path: 3.0.0 + object-hash: 3.0.0 + picocolors: 1.1.0 postcss: 8.4.47 postcss-import: 15.1.0(postcss@8.4.47) postcss-js: 4.0.1(postcss@8.4.47) - postcss-load-config: 4.0.1(postcss@8.4.47)(ts-node@10.9.1(@types/node@20.14.12)(typescript@5.4.5)) + postcss-load-config: 4.0.1(postcss@8.4.47)(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@20.14.12)(typescript@5.6.3)) postcss-nested: 6.0.1(postcss@8.4.47) - postcss-selector-parser: 6.0.13 + postcss-selector-parser: 6.1.0 resolve: 1.22.8 sucrase: 3.34.0 transitivePeerDependencies: @@ -33286,6 +43073,8 @@ snapshots: tailwindcss@4.0.0-beta.8: {} + tapable@1.1.3: {} + tapable@2.2.1: {} tape@4.17.0: @@ -33307,6 +43096,35 @@ snapshots: resolve: 1.22.8 string.prototype.trim: 1.2.8 + tar-fs@2.1.1: + dependencies: + chownr: 1.1.4 + mkdirp-classic: 0.5.3 + pump: 3.0.0 + tar-stream: 2.2.0 + + tar-fs@3.0.6: + dependencies: + pump: 3.0.0 + tar-stream: 3.1.7 + optionalDependencies: + bare-fs: 2.3.5 + bare-path: 2.1.3 + + tar-stream@2.2.0: + dependencies: + bl: 4.1.0 + end-of-stream: 1.4.4 + fs-constants: 1.0.0 + inherits: 2.0.4 + readable-stream: 3.6.2 + + tar-stream@3.1.7: + dependencies: + b4a: 1.6.7 + fast-fifo: 1.3.2 + streamx: 2.20.1 + tar@6.2.1: dependencies: chownr: 2.0.0 @@ -33385,19 +43203,21 @@ snapshots: term-size@2.2.1: {} - terser-webpack-plugin@5.3.10(webpack@5.92.1): + terser-webpack-plugin@5.3.10(@swc/core@1.7.26(@swc/helpers@0.5.3))(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))): dependencies: '@jridgewell/trace-mapping': 0.3.25 jest-worker: 27.5.1 schema-utils: 3.3.0 serialize-javascript: 6.0.2 terser: 5.31.1 - webpack: 5.92.1 + webpack: 5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3)) + optionalDependencies: + '@swc/core': 1.7.26(@swc/helpers@0.5.3) terser@5.31.1: dependencies: '@jridgewell/source-map': 0.3.6 - acorn: 8.12.0 + acorn: 8.14.0 commander: 2.20.3 source-map-support: 0.5.21 @@ -33413,6 +43233,10 @@ snapshots: glob: 10.4.2 minimatch: 9.0.5 + text-decoder@1.2.0: + dependencies: + b4a: 1.6.7 + text-extensions@1.9.0: {} text-table@0.2.0: {} @@ -33425,6 +43249,22 @@ snapshots: dependencies: any-promise: 1.3.0 + three-mesh-bvh@0.7.6(three@0.168.0): + dependencies: + three: 0.168.0 + + three-stdlib@2.33.0(three@0.168.0): + dependencies: + '@types/draco3d': 1.4.10 + '@types/offscreencanvas': 2019.7.3 + '@types/webxr': 0.5.20 + draco3d: 1.5.7 + fflate: 0.6.10 + potpack: 1.0.2 + three: 0.168.0 + + three@0.168.0: {} + throttle-debounce@5.0.0: {} through2@0.4.2: @@ -33438,7 +43278,9 @@ snapshots: through@2.3.8: {} - timezone-groups@0.9.1: {} + thunky@1.1.0: {} + + timezone-groups@0.10.2: {} tiny-each-async@2.0.3: optional: true @@ -33449,12 +43291,14 @@ snapshots: tiny-warning@1.0.3: {} - tinybench@2.8.0: {} + tinybench@2.9.0: {} tinycolor2@1.6.0: {} tinyexec@0.2.0: {} + tinyexec@0.3.0: {} + tinyglobby@0.2.2: dependencies: fdir: 6.2.0(picomatch@4.0.2) @@ -33473,8 +43317,6 @@ snapshots: tinyspy@3.0.0: {} - titleize@3.0.0: {} - tmp-promise@3.0.3: dependencies: tmp: 0.2.3 @@ -33539,6 +43381,20 @@ snapshots: dependencies: escape-string-regexp: 1.0.5 + troika-three-text@0.49.1(three@0.168.0): + dependencies: + bidi-js: 1.0.3 + three: 0.168.0 + troika-three-utils: 0.49.0(three@0.168.0) + troika-worker-utils: 0.49.0 + webgl-sdf-generator: 1.1.1 + + troika-three-utils@0.49.0(three@0.168.0): + dependencies: + three: 0.168.0 + + troika-worker-utils@0.49.0: {} + trough@2.2.0: {} truncate-utf8-bytes@1.0.2: @@ -33549,20 +43405,20 @@ snapshots: dependencies: typescript: 5.4.5 - ts-evaluator@1.2.0(typescript@5.4.5): + ts-evaluator@1.2.0(typescript@5.6.3): dependencies: ansi-colors: 4.1.3 crosspath: 2.0.0 object-path: 0.11.8 - typescript: 5.4.5 + typescript: 5.6.3 ts-interface-checker@0.1.13: {} - ts-jest@29.1.5(@babel/core@7.25.2)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.2))(jest@29.7.0(@types/node@18.19.67)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@types/node@18.19.67)(typescript@5.4.5)))(typescript@5.4.5): + ts-jest@29.1.5(@babel/core@7.25.2)(@jest/transform@29.7.0)(@jest/types@29.6.3)(babel-jest@29.7.0(@babel/core@7.25.2))(jest@29.7.0(@types/node@18.19.67)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@18.19.67)(typescript@5.4.5)))(typescript@5.4.5): dependencies: bs-logger: 0.2.6 fast-json-stable-stringify: 2.1.0 - jest: 29.7.0(@types/node@18.19.67)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@types/node@18.19.67)(typescript@5.4.5)) + jest: 29.7.0(@types/node@18.19.67)(babel-plugin-macros@3.1.0)(ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@18.19.67)(typescript@5.4.5)) jest-util: 29.7.0 json5: 2.2.3 lodash.memoize: 4.1.2 @@ -33576,7 +43432,7 @@ snapshots: '@jest/types': 29.6.3 babel-jest: 29.7.0(@babel/core@7.25.2) - ts-loader@9.5.1(typescript@5.4.5)(webpack@5.92.1): + ts-loader@9.5.1(typescript@5.4.5)(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))): dependencies: chalk: 4.1.2 enhanced-resolve: 5.17.0 @@ -33584,7 +43440,7 @@ snapshots: semver: 7.5.4 source-map: 0.7.4 typescript: 5.4.5 - webpack: 5.92.1 + webpack: 5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3)) ts-morph@18.0.0: dependencies: @@ -33601,7 +43457,7 @@ snapshots: '@ts-morph/common': 0.24.0 code-block-writer: 13.0.1 - ts-node@10.9.1(@types/node@18.19.67)(typescript@5.4.5): + ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@18.19.67)(typescript@5.4.5): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.9 @@ -33618,8 +43474,10 @@ snapshots: typescript: 5.4.5 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 + optionalDependencies: + '@swc/core': 1.7.26(@swc/helpers@0.5.3) - ts-node@10.9.1(@types/node@20.14.12)(typescript@5.4.5): + ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@20.14.12)(typescript@5.6.3): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.9 @@ -33633,12 +43491,13 @@ snapshots: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 5.4.5 + typescript: 5.6.3 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 - optional: true + optionalDependencies: + '@swc/core': 1.7.26(@swc/helpers@0.5.3) - ts-node@10.9.1(@types/node@20.5.1)(typescript@5.4.5): + ts-node@10.9.1(@swc/core@1.7.26(@swc/helpers@0.5.3))(@types/node@20.5.1)(typescript@5.6.3): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.9 @@ -33652,19 +43511,21 @@ snapshots: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 5.4.5 + typescript: 5.6.3 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 + optionalDependencies: + '@swc/core': 1.7.26(@swc/helpers@0.5.3) ts-pattern@5.0.8: {} - tsconfck@3.0.1(typescript@5.4.5): + tsconfck@3.0.1(typescript@5.6.3): optionalDependencies: - typescript: 5.4.5 + typescript: 5.6.3 - tsconfck@3.0.2(typescript@5.4.5): + tsconfck@3.0.2(typescript@5.6.3): optionalDependencies: - typescript: 5.4.5 + typescript: 5.6.3 tsconfig-paths-webpack-plugin@4.1.0: dependencies: @@ -33680,12 +43541,16 @@ snapshots: tslib@1.14.1: {} + tslib@2.1.0: {} + tslib@2.3.0: {} tslib@2.6.2: {} tslib@2.6.3: {} + tslib@2.8.1: {} + tsscmp@1.0.6: {} tsx@4.17.0: @@ -33705,6 +43570,18 @@ snapshots: wcwidth: 1.0.1 yargs: 17.7.2 + tunnel-agent@0.6.0: + dependencies: + safe-buffer: 5.2.1 + + tunnel-rat@0.1.2(@types/react@18.2.35)(immer@10.0.3)(react@18.2.0): + dependencies: + zustand: 4.5.5(@types/react@18.2.35)(immer@10.0.3)(react@18.2.0) + transitivePeerDependencies: + - '@types/react' + - immer + - react + turf-jsts@1.2.3: {} type-check@0.4.0: @@ -33771,16 +43648,20 @@ snapshots: typedarray@0.0.6: {} - typescript@4.9.5: {} - typescript@5.2.2: {} typescript@5.3.3: {} typescript@5.4.5: {} + typescript@5.5.4: {} + + typescript@5.6.3: {} + ua-parser-js@1.0.37: {} + uc.micro@2.1.0: {} + ufo@1.3.1: {} ufo@1.5.4: {} @@ -33816,6 +43697,19 @@ snapshots: undici-types@5.26.5: {} + unicode-canonical-property-names-ecmascript@2.0.1: {} + + unicode-emoji-modifier-base@1.0.0: {} + + unicode-match-property-ecmascript@2.0.0: + dependencies: + unicode-canonical-property-names-ecmascript: 2.0.1 + unicode-property-aliases-ecmascript: 2.1.0 + + unicode-match-property-value-ecmascript@2.2.0: {} + + unicode-property-aliases-ecmascript@2.1.0: {} + unified@10.1.2: dependencies: '@types/unist': 2.0.11 @@ -33826,13 +43720,23 @@ snapshots: trough: 2.2.0 vfile: 5.3.7 + unified@11.0.5: + dependencies: + '@types/unist': 3.0.2 + bail: 2.0.2 + devlop: 1.1.0 + extend: 3.0.2 + is-plain-obj: 4.1.0 + trough: 2.2.0 + vfile: 6.0.3 + unimport@3.4.0(rollup@4.14.1): dependencies: '@rollup/pluginutils': 5.1.0(rollup@4.14.1) escape-string-regexp: 5.0.0 fast-glob: 3.3.2 local-pkg: 0.4.3 - magic-string: 0.30.10 + magic-string: 0.30.12 mlly: 1.4.2 pathe: 1.1.1 pkg-types: 1.0.3 @@ -33857,9 +43761,9 @@ snapshots: dependencies: imurmurhash: 0.1.4 - unique-string@2.0.0: + unique-string@3.0.0: dependencies: - crypto-random-string: 2.0.0 + crypto-random-string: 4.0.0 unist-util-find-after@4.0.1: dependencies: @@ -33868,14 +43772,28 @@ snapshots: unist-util-generated@2.0.1: {} + unist-util-is@4.1.0: {} + unist-util-is@5.2.1: dependencies: '@types/unist': 2.0.11 + unist-util-is@6.0.0: + dependencies: + '@types/unist': 3.0.2 + + unist-util-position-from-estree@2.0.0: + dependencies: + '@types/unist': 3.0.2 + unist-util-position@4.0.4: dependencies: '@types/unist': 2.0.11 + unist-util-position@5.0.0: + dependencies: + '@types/unist': 3.0.2 + unist-util-remove-position@4.0.2: dependencies: '@types/unist': 2.0.11 @@ -33889,24 +43807,48 @@ snapshots: dependencies: '@types/unist': 3.0.2 + unist-util-visit-parents@3.1.1: + dependencies: + '@types/unist': 2.0.11 + unist-util-is: 4.1.0 + unist-util-visit-parents@5.1.3: dependencies: '@types/unist': 2.0.11 unist-util-is: 5.2.1 + unist-util-visit-parents@6.0.1: + dependencies: + '@types/unist': 3.0.2 + unist-util-is: 6.0.0 + + unist-util-visit@2.0.3: + dependencies: + '@types/unist': 2.0.11 + unist-util-is: 4.1.0 + unist-util-visit-parents: 3.1.1 + unist-util-visit@4.1.2: dependencies: '@types/unist': 2.0.11 unist-util-is: 5.2.1 unist-util-visit-parents: 5.1.3 + unist-util-visit@5.0.0: + dependencies: + '@types/unist': 3.0.2 + unist-util-is: 6.0.0 + unist-util-visit-parents: 6.0.1 + + universal-user-agent@6.0.1: {} + universalify@0.1.2: {} universalify@2.0.1: {} - unocss@0.62.2(postcss@8.4.32)(rollup@4.14.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.69.5)(terser@5.31.1)): + unocss@0.62.2(postcss@8.4.32)(rollup@4.14.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.69.5)(terser@5.31.1)): dependencies: - '@unocss/astro': 0.62.2(rollup@4.14.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.69.5)(terser@5.31.1)) + '@unocss/astro': 0.62.2(rollup@4.14.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.69.5)(terser@5.31.1)) '@unocss/cli': 0.62.2(rollup@4.14.1) '@unocss/core': 0.62.2 '@unocss/extractor-arbitrary-variants': 0.62.2 @@ -33925,9 +43867,38 @@ snapshots: '@unocss/transformer-compile-class': 0.62.2 '@unocss/transformer-directives': 0.62.2 '@unocss/transformer-variant-group': 0.62.2 - '@unocss/vite': 0.62.2(rollup@4.14.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.69.5)(terser@5.31.1)) + '@unocss/vite': 0.62.2(rollup@4.14.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.69.5)(terser@5.31.1)) optionalDependencies: - vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.69.5)(terser@5.31.1) + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.69.5)(terser@5.31.1) + transitivePeerDependencies: + - postcss + - rollup + - supports-color + + unocss@0.62.2(postcss@8.4.47)(rollup@4.14.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)): + dependencies: + '@unocss/astro': 0.62.2(rollup@4.14.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)) + '@unocss/cli': 0.62.2(rollup@4.14.1) + '@unocss/core': 0.62.2 + '@unocss/extractor-arbitrary-variants': 0.62.2 + '@unocss/postcss': 0.62.2(postcss@8.4.47) + '@unocss/preset-attributify': 0.62.2 + '@unocss/preset-icons': 0.62.2 + '@unocss/preset-mini': 0.62.2 + '@unocss/preset-tagify': 0.62.2 + '@unocss/preset-typography': 0.62.2 + '@unocss/preset-uno': 0.62.2 + '@unocss/preset-web-fonts': 0.62.2 + '@unocss/preset-wind': 0.62.2 + '@unocss/reset': 0.62.2 + '@unocss/transformer-attributify-jsx': 0.62.2 + '@unocss/transformer-attributify-jsx-babel': 0.62.2 + '@unocss/transformer-compile-class': 0.62.2 + '@unocss/transformer-directives': 0.62.2 + '@unocss/transformer-variant-group': 0.62.2 + '@unocss/vite': 0.62.2(rollup@4.14.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)) + optionalDependencies: + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) transitivePeerDependencies: - postcss - rollup @@ -33935,7 +43906,22 @@ snapshots: unpipe@1.0.0: {} - unplugin-auto-import@0.16.7(@vueuse/core@9.13.0(@vue/composition-api@1.7.2(vue@3.3.7(typescript@5.4.5)))(vue@3.3.7(typescript@5.4.5)))(rollup@4.14.1): + unplugin-auto-import@0.16.7(@vueuse/core@9.13.0(@vue/composition-api@1.7.2(vue@3.3.7(typescript@5.6.3)))(vue@3.3.7(typescript@5.6.3)))(rollup@4.14.1): + dependencies: + '@antfu/utils': 0.7.6 + '@rollup/pluginutils': 5.0.5(rollup@4.14.1) + fast-glob: 3.3.1 + local-pkg: 0.5.0 + magic-string: 0.30.5 + minimatch: 9.0.3 + unimport: 3.4.0(rollup@4.14.1) + unplugin: 1.5.0 + optionalDependencies: + '@vueuse/core': 9.13.0(@vue/composition-api@1.7.2(vue@3.3.7(typescript@5.6.3)))(vue@3.3.7(typescript@5.6.3)) + transitivePeerDependencies: + - rollup + + unplugin-auto-import@0.16.7(@vueuse/core@9.13.0(@vue/composition-api@1.7.2(vue@3.4.35(typescript@5.6.3)))(vue@3.4.35(typescript@5.6.3)))(rollup@4.14.1): dependencies: '@antfu/utils': 0.7.6 '@rollup/pluginutils': 5.0.5(rollup@4.14.1) @@ -33946,7 +43932,7 @@ snapshots: unimport: 3.4.0(rollup@4.14.1) unplugin: 1.5.0 optionalDependencies: - '@vueuse/core': 9.13.0(@vue/composition-api@1.7.2(vue@3.3.7(typescript@5.4.5)))(vue@3.3.7(typescript@5.4.5)) + '@vueuse/core': 9.13.0(@vue/composition-api@1.7.2(vue@3.4.35(typescript@5.6.3)))(vue@3.4.35(typescript@5.6.3)) transitivePeerDependencies: - rollup @@ -33963,7 +43949,7 @@ snapshots: transitivePeerDependencies: - supports-color - unplugin-vue-components@0.25.2(@babel/parser@7.25.3)(rollup@4.14.1)(vue@3.3.7(typescript@5.4.5)): + unplugin-vue-components@0.25.2(@babel/parser@7.26.3)(rollup@4.14.1)(vue@3.3.7(typescript@5.6.3)): dependencies: '@antfu/utils': 0.7.10 '@rollup/pluginutils': 5.1.0(rollup@4.14.1) @@ -33975,18 +43961,27 @@ snapshots: minimatch: 9.0.5 resolve: 1.22.8 unplugin: 1.10.1 - vue: 3.3.7(typescript@5.4.5) + vue: 3.3.7(typescript@5.6.3) optionalDependencies: - '@babel/parser': 7.25.3 + '@babel/parser': 7.26.3 transitivePeerDependencies: - rollup - supports-color - unplugin-vue-router@0.7.0(rollup@4.14.1)(vue-router@4.2.5(vue@3.3.7(typescript@5.4.5)))(vue@3.3.7(typescript@5.4.5)): + unplugin-vue-inspector@2.2.0(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)): + dependencies: + kolorist: 1.8.0 + unplugin: 1.10.1 + vite-plugin-vue-inspector: 5.2.0(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)) + transitivePeerDependencies: + - supports-color + - vite + + unplugin-vue-router@0.7.0(rollup@4.14.1)(vue-router@4.2.5(vue@3.3.7(typescript@5.6.3)))(vue@3.3.7(typescript@5.6.3)): dependencies: '@babel/types': 7.23.0 '@rollup/pluginutils': 5.0.5(rollup@4.14.1) - '@vue-macros/common': 1.10.0(rollup@4.14.1)(vue@3.3.7(typescript@5.4.5)) + '@vue-macros/common': 1.10.0(rollup@4.14.1)(vue@3.3.7(typescript@5.6.3)) ast-walker-scope: 0.5.0(rollup@4.14.1) chokidar: 3.5.3 fast-glob: 3.3.1 @@ -33998,28 +43993,49 @@ snapshots: unplugin: 1.5.0 yaml: 2.3.4 optionalDependencies: - vue-router: 4.2.5(vue@3.3.7(typescript@5.4.5)) + vue-router: 4.2.5(vue@3.3.7(typescript@5.6.3)) + transitivePeerDependencies: + - rollup + - vue + + unplugin-vue-router@0.7.0(rollup@4.14.1)(vue-router@4.4.5(vue@3.4.35(typescript@5.6.3)))(vue@3.4.35(typescript@5.6.3)): + dependencies: + '@babel/types': 7.23.0 + '@rollup/pluginutils': 5.0.5(rollup@4.14.1) + '@vue-macros/common': 1.10.0(rollup@4.14.1)(vue@3.4.35(typescript@5.6.3)) + ast-walker-scope: 0.5.0(rollup@4.14.1) + chokidar: 3.5.3 + fast-glob: 3.3.1 + json5: 2.2.3 + local-pkg: 0.4.3 + mlly: 1.4.2 + pathe: 1.1.1 + scule: 1.0.0 + unplugin: 1.5.0 + yaml: 2.3.4 + optionalDependencies: + vue-router: 4.4.5(vue@3.4.35(typescript@5.6.3)) transitivePeerDependencies: - rollup - vue unplugin@0.10.2: dependencies: - acorn: 8.11.2 + acorn: 8.14.0 chokidar: 3.6.0 webpack-sources: 3.2.3 webpack-virtual-modules: 0.4.6 unplugin@1.10.1: dependencies: - acorn: 8.12.0 + acorn: 8.14.0 chokidar: 3.6.0 webpack-sources: 3.2.3 webpack-virtual-modules: 0.6.2 unplugin@1.5.0: dependencies: - acorn: 8.11.2 + acorn: 8.14.0 chokidar: 3.6.0 webpack-sources: 3.2.3 webpack-virtual-modules: 0.5.0 @@ -34029,37 +44045,55 @@ snapshots: has-value: 0.3.1 isobject: 3.0.1 - untildify@4.0.0: {} - - update-browserslist-db@1.0.13(browserslist@4.22.1): - dependencies: - browserslist: 4.22.1 - escalade: 3.1.2 - picocolors: 1.0.1 - - update-browserslist-db@1.1.0(browserslist@4.23.0): + update-browserslist-db@1.1.0(browserslist@4.23.1): dependencies: - browserslist: 4.23.0 + browserslist: 4.23.1 escalade: 3.1.2 - picocolors: 1.0.1 + picocolors: 1.1.1 - update-browserslist-db@1.1.0(browserslist@4.23.1): + update-browserslist-db@1.1.0(browserslist@4.24.0): dependencies: - browserslist: 4.23.1 + browserslist: 4.24.0 escalade: 3.1.2 - picocolors: 1.0.1 + picocolors: 1.1.1 update-check@1.5.4: dependencies: registry-auth-token: 3.3.2 registry-url: 3.1.0 + update-notifier@6.0.2: + dependencies: + boxen: 7.0.0 + chalk: 5.3.0 + configstore: 6.0.0 + has-yarn: 3.0.0 + import-lazy: 4.0.0 + is-ci: 3.0.1 + is-installed-globally: 0.4.0 + is-npm: 6.0.0 + is-yarn-global: 0.4.1 + latest-version: 7.0.0 + pupa: 3.1.0 + semver: 7.5.4 + semver-diff: 4.0.0 + xdg-basedir: 5.1.0 + uri-js@4.4.1: dependencies: punycode: 2.3.1 urix@0.1.0: {} + url-loader@4.1.1(file-loader@6.2.0(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))))(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))): + dependencies: + loader-utils: 2.0.4 + mime-types: 2.1.35 + schema-utils: 3.3.0 + webpack: 5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3)) + optionalDependencies: + file-loader: 6.2.0(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))) + use-callback-ref@1.3.0(@types/react@18.2.35)(react@17.0.2): dependencies: react: 17.0.2 @@ -34098,8 +44132,16 @@ snapshots: util-deprecate@1.0.2: {} + utila@0.4.0: {} + + utility-types@3.11.0: {} + utils-merge@1.0.1: {} + uuid@8.3.2: {} + + uuid@9.0.1: {} + uvu@0.5.6: dependencies: dequal: 2.0.3 @@ -34115,6 +44157,8 @@ snapshots: '@types/istanbul-lib-coverage': 2.0.5 convert-source-map: 2.0.0 + v8n@1.5.1: {} + validate-html-nesting@1.2.2: {} validate-npm-package-license@3.0.4: @@ -34130,10 +44174,10 @@ snapshots: vary@1.1.2: {} - vdirs@0.1.8(vue@3.4.35(typescript@5.4.5)): + vdirs@0.1.8(vue@3.4.35(typescript@5.6.3)): dependencies: evtd: 0.2.4 - vue: 3.4.35(typescript@5.4.5) + vue: 3.4.35(typescript@5.6.3) verror@1.10.1: dependencies: @@ -34147,11 +44191,21 @@ snapshots: '@types/unist': 2.0.11 vfile: 5.3.7 + vfile-location@5.0.3: + dependencies: + '@types/unist': 3.0.2 + vfile: 6.0.3 + vfile-message@3.1.4: dependencies: '@types/unist': 2.0.11 unist-util-stringify-position: 3.0.3 + vfile-message@4.0.2: + dependencies: + '@types/unist': 3.0.2 + unist-util-stringify-position: 4.0.0 + vfile@5.3.7: dependencies: '@types/unist': 2.0.11 @@ -34159,13 +44213,18 @@ snapshots: unist-util-stringify-position: 3.0.3 vfile-message: 3.1.4 - vite-node@1.4.0(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1): + vfile@6.0.3: + dependencies: + '@types/unist': 3.0.2 + vfile-message: 4.0.2 + + vite-node@1.4.0(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1): dependencies: cac: 6.7.14 debug: 4.3.7 pathe: 1.1.1 - picocolors: 1.0.1 - vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1) + picocolors: 1.1.1 + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) transitivePeerDependencies: - '@types/node' - less @@ -34176,13 +44235,29 @@ snapshots: - supports-color - terser - vite-node@2.0.4(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1): + vite-node@2.0.4(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1): dependencies: cac: 6.7.14 debug: 4.3.7 pathe: 1.1.2 tinyrainbow: 1.2.0 - vite: 5.2.8(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1) + vite: 5.2.8(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) + transitivePeerDependencies: + - '@types/node' + - less + - lightningcss + - sass + - stylus + - sugarss + - supports-color + - terser + + vite-node@2.1.2(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1): + dependencies: + cac: 6.7.14 + debug: 4.3.7 + pathe: 1.1.2 + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) transitivePeerDependencies: - '@types/node' - less @@ -34193,7 +44268,58 @@ snapshots: - supports-color - terser - vite-plugin-pages@0.32.0(@vue/compiler-sfc@3.4.35)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1)): + vite-plugin-compression@0.5.1(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)): + dependencies: + chalk: 4.1.2 + debug: 4.3.7 + fs-extra: 10.1.0 + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) + transitivePeerDependencies: + - supports-color + + vite-plugin-html@3.2.2(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)): + dependencies: + '@rollup/pluginutils': 4.2.1 + colorette: 2.0.20 + connect-history-api-fallback: 1.6.0 + consola: 2.15.3 + dotenv: 16.4.5 + dotenv-expand: 8.0.3 + ejs: 3.1.10 + fast-glob: 3.3.2 + fs-extra: 10.1.0 + html-minifier-terser: 6.1.0 + node-html-parser: 5.4.2 + pathe: 0.2.0 + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) + + vite-plugin-inspect@0.8.7(rollup@4.14.1)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)): + dependencies: + '@antfu/utils': 0.7.10 + '@rollup/pluginutils': 5.1.0(rollup@4.14.1) + debug: 4.3.7 + error-stack-parser-es: 0.1.5 + fs-extra: 11.2.0 + open: 10.1.0 + perfect-debounce: 1.0.0 + picocolors: 1.1.0 + sirv: 2.0.4 + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) + transitivePeerDependencies: + - rollup + - supports-color + + vite-plugin-mkcert@1.17.6(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)): + dependencies: + '@octokit/rest': 20.1.1 + axios: 1.7.7(debug@4.3.7) + debug: 4.3.7 + picocolors: 1.1.0 + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) + transitivePeerDependencies: + - supports-color + + vite-plugin-pages@0.32.0(@vue/compiler-sfc@3.4.35)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)): dependencies: '@types/debug': 4.1.12 debug: 4.3.4 @@ -34203,14 +44329,14 @@ snapshots: json5: 2.2.3 local-pkg: 0.5.0 picocolors: 1.0.0 - vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1) + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) yaml: 2.3.4 optionalDependencies: '@vue/compiler-sfc': 3.4.35 transitivePeerDependencies: - supports-color - vite-plugin-solid@2.7.2(solid-js@1.8.5)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1)): + vite-plugin-solid@2.7.2(solid-js@1.8.5)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)): dependencies: '@babel/core': 7.23.2 '@babel/preset-typescript': 7.23.2(@babel/core@7.23.2) @@ -34219,8 +44345,23 @@ snapshots: merge-anything: 5.1.7 solid-js: 1.8.5 solid-refresh: 0.5.3(solid-js@1.8.5) - vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1) - vitefu: 0.2.5(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1)) + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) + vitefu: 0.2.5(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)) + transitivePeerDependencies: + - supports-color + + vite-plugin-vue-inspector@5.2.0(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)): + dependencies: + '@babel/core': 7.25.2 + '@babel/plugin-proposal-decorators': 7.24.1(@babel/core@7.25.2) + '@babel/plugin-syntax-import-attributes': 7.25.7(@babel/core@7.25.2) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.25.2) + '@babel/plugin-transform-typescript': 7.25.2(@babel/core@7.25.2) + '@vue/babel-plugin-jsx': 1.2.2(@babel/core@7.25.2) + '@vue/compiler-dom': 3.4.35 + kolorist: 1.8.0 + magic-string: 0.30.12 + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) transitivePeerDependencies: - supports-color @@ -34344,7 +44485,7 @@ snapshots: - walrus - whiskers - vite-plugin-vue2@2.0.3(ejs@3.1.10)(lodash@4.17.21)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1))(vue-template-compiler@2.6.14(vue@2.6.14))(vue@2.6.14): + vite-plugin-vue2@2.0.3(ejs@3.1.10)(lodash@4.17.21)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1))(vue-template-compiler@2.6.14(vue@2.6.14))(vue@2.6.14): dependencies: '@babel/core': 7.24.3 '@babel/parser': 7.24.1 @@ -34374,7 +44515,7 @@ snapshots: rollup: 2.79.1 slash: 3.0.0 source-map: 0.7.4 - vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1) + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) vue-template-babel-compiler: 1.2.0(vue-template-compiler@2.6.14(vue@2.6.14)) vue-template-compiler: 2.6.14(vue@2.6.14) transitivePeerDependencies: @@ -34434,23 +44575,23 @@ snapshots: - walrus - whiskers - vite-svg-loader@5.1.0(vue@3.3.7(typescript@5.4.5)): + vite-svg-loader@5.1.0(vue@3.3.7(typescript@5.6.3)): dependencies: svgo: 3.2.0 - vue: 3.3.7(typescript@5.4.5) + vue: 3.3.7(typescript@5.6.3) - vite-tsconfig-paths@4.3.1(typescript@5.4.5)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1)): + vite-tsconfig-paths@4.3.1(typescript@5.6.3)(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)): dependencies: debug: 4.3.4 globrex: 0.1.2 - tsconfck: 3.0.1(typescript@5.4.5) + tsconfck: 3.0.1(typescript@5.6.3) optionalDependencies: - vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1) + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) transitivePeerDependencies: - supports-color - typescript - vite@5.2.8(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1): + vite@5.2.8(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1): dependencies: esbuild: 0.20.2 postcss: 8.4.47 @@ -34459,11 +44600,11 @@ snapshots: '@types/node': 18.19.67 fsevents: 2.3.3 less: 4.2.0 - lightningcss: 1.27.0 + lightningcss: 1.28.2 sass: 1.74.1 terser: 5.31.1 - vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.69.5)(terser@5.31.1): + vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.69.5)(terser@5.31.1): dependencies: esbuild: 0.20.2 postcss: 8.4.47 @@ -34472,11 +44613,11 @@ snapshots: '@types/node': 20.14.12 fsevents: 2.3.3 less: 4.2.0 - lightningcss: 1.27.0 + lightningcss: 1.28.2 sass: 1.69.5 terser: 5.31.1 - vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1): + vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1): dependencies: esbuild: 0.20.2 postcss: 8.4.47 @@ -34485,38 +44626,38 @@ snapshots: '@types/node': 20.14.12 fsevents: 2.3.3 less: 4.2.0 - lightningcss: 1.27.0 + lightningcss: 1.28.2 sass: 1.74.1 terser: 5.31.1 - vitefu@0.2.5(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1)): + vitefu@0.2.5(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)): optionalDependencies: - vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1) + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) - vitefu@1.0.4(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1)): + vitefu@1.0.3(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)): optionalDependencies: - vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1) + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) - vitest@2.0.4(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1): + vitest@2.0.4(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1): dependencies: '@ampproject/remapping': 2.3.0 '@vitest/expect': 2.0.4 - '@vitest/pretty-format': 2.0.4 + '@vitest/pretty-format': 2.1.2 '@vitest/runner': 2.0.4 '@vitest/snapshot': 2.0.4 '@vitest/spy': 2.0.4 '@vitest/utils': 2.0.4 chai: 5.1.1 - debug: 4.3.5 + debug: 4.3.7 execa: 8.0.1 - magic-string: 0.30.10 + magic-string: 0.30.12 pathe: 1.1.2 std-env: 3.7.0 - tinybench: 2.8.0 + tinybench: 2.9.0 tinypool: 1.0.0 tinyrainbow: 1.2.0 - vite: 5.2.8(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1) - vite-node: 2.0.4(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.27.0)(sass@1.74.1)(terser@5.31.1) + vite: 5.2.8(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) + vite-node: 2.0.4(@types/node@18.19.67)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 18.19.67 @@ -34529,52 +44670,83 @@ snapshots: - supports-color - terser - vooks@0.2.12(vue@3.4.35(typescript@5.4.5)): + vitest@2.1.2(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1): + dependencies: + '@vitest/expect': 2.1.2 + '@vitest/mocker': 2.1.2(vite@5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1)) + '@vitest/pretty-format': 2.1.2 + '@vitest/runner': 2.1.2 + '@vitest/snapshot': 2.1.2 + '@vitest/spy': 2.1.2 + '@vitest/utils': 2.1.2 + chai: 5.1.1 + debug: 4.3.7 + magic-string: 0.30.12 + pathe: 1.1.2 + std-env: 3.7.0 + tinybench: 2.9.0 + tinyexec: 0.3.0 + tinypool: 1.0.0 + tinyrainbow: 1.2.0 + vite: 5.2.8(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) + vite-node: 2.1.2(@types/node@20.14.12)(less@4.2.0)(lightningcss@1.28.2)(sass@1.74.1)(terser@5.31.1) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/node': 20.14.12 + transitivePeerDependencies: + - less + - lightningcss + - msw + - sass + - stylus + - sugarss + - supports-color + - terser + + vooks@0.2.12(vue@3.4.35(typescript@5.6.3)): dependencies: evtd: 0.2.4 - vue: 3.4.35(typescript@5.4.5) + vue: 3.4.35(typescript@5.6.3) - vscode-languageserver-textdocument@1.0.11: {} + vscode-languageserver-textdocument@1.0.12: {} - vscode-uri@3.0.8: {} + vscode-oniguruma@1.7.0: {} - vue-demi@0.14.10(@vue/composition-api@1.7.2(vue@3.3.7(typescript@5.4.5)))(vue@3.3.7(typescript@5.4.5)): - dependencies: - vue: 3.3.7(typescript@5.4.5) - optionalDependencies: - '@vue/composition-api': 1.7.2(vue@3.3.7(typescript@5.4.5)) + vscode-textmate@5.2.0: {} + + vscode-uri@3.0.8: {} - vue-demi@0.14.10(@vue/composition-api@1.7.2(vue@3.4.15(typescript@5.4.5)))(vue@3.4.15(typescript@5.4.5)): + vue-demi@0.14.10(@vue/composition-api@1.7.2(vue@3.3.7(typescript@5.6.3)))(vue@3.3.7(typescript@5.6.3)): dependencies: - vue: 3.4.15(typescript@5.4.5) + vue: 3.3.7(typescript@5.6.3) optionalDependencies: - '@vue/composition-api': 1.7.2(vue@3.4.15(typescript@5.4.5)) + '@vue/composition-api': 1.7.2(vue@3.3.7(typescript@5.6.3)) - vue-demi@0.14.7(@vue/composition-api@1.7.2(vue@3.4.15(typescript@5.4.5)))(vue@3.4.15(typescript@5.4.5)): + vue-demi@0.14.10(@vue/composition-api@1.7.2(vue@3.4.35(typescript@5.6.3)))(vue@3.4.35(typescript@5.6.3)): dependencies: - vue: 3.4.15(typescript@5.4.5) + vue: 3.4.35(typescript@5.6.3) optionalDependencies: - '@vue/composition-api': 1.7.2(vue@3.4.15(typescript@5.4.5)) + '@vue/composition-api': 1.7.2(vue@3.4.35(typescript@5.6.3)) - vue-router@4.2.5(vue@3.3.12(typescript@5.4.5)): + vue-router@4.2.5(vue@3.3.12(typescript@5.6.3)): dependencies: '@vue/devtools-api': 6.5.1 - vue: 3.3.12(typescript@5.4.5) + vue: 3.3.12(typescript@5.6.3) - vue-router@4.2.5(vue@3.3.7(typescript@5.4.5)): + vue-router@4.2.5(vue@3.3.7(typescript@5.6.3)): dependencies: '@vue/devtools-api': 6.5.1 - vue: 3.3.7(typescript@5.4.5) + vue: 3.3.7(typescript@5.6.3) - vue-router@4.2.5(vue@3.4.15(typescript@5.4.5)): + vue-router@4.3.2(vue@3.4.27(typescript@5.6.3)): dependencies: '@vue/devtools-api': 6.5.1 - vue: 3.4.15(typescript@5.4.5) + vue: 3.4.27(typescript@5.6.3) - vue-router@4.3.2(vue@3.4.27(typescript@5.4.5)): + vue-router@4.4.5(vue@3.4.35(typescript@5.6.3)): dependencies: - '@vue/devtools-api': 6.5.1 - vue: 3.4.27(typescript@5.4.5) + '@vue/devtools-api': 6.6.4 + vue: 3.4.35(typescript@5.6.3) vue-template-babel-compiler@1.2.0(vue-template-compiler@2.6.14(vue@2.6.14)): dependencies: @@ -34606,17 +44778,24 @@ snapshots: he: 1.2.0 vue: 2.7.16 + vue-template-compiler@2.7.16(vue@3.4.35(typescript@5.6.3)): + dependencies: + de-indent: 1.0.2 + he: 1.2.0 + vue: 3.4.35(typescript@5.6.3) + optional: true + vue-template-es2015-compiler@1.9.1: {} - vue-types@3.0.2(vue@3.3.7(typescript@5.4.5)): + vue-types@3.0.2(vue@3.3.7(typescript@5.6.3)): dependencies: is-plain-object: 3.0.1 - vue: 3.3.7(typescript@5.4.5) + vue: 3.3.7(typescript@5.6.3) - vue-types@3.0.2(vue@3.4.15(typescript@5.4.5)): + vue-types@3.0.2(vue@3.4.35(typescript@5.6.3)): dependencies: is-plain-object: 3.0.1 - vue: 3.4.15(typescript@5.4.5) + vue: 3.4.35(typescript@5.6.3) vue@2.6.14: {} @@ -34625,68 +44804,66 @@ snapshots: '@vue/compiler-sfc': 2.7.16 csstype: 3.1.3 - vue@3.3.12(typescript@5.4.5): + vue@3.3.12(typescript@5.6.3): dependencies: '@vue/compiler-dom': 3.3.12 '@vue/compiler-sfc': 3.3.12 '@vue/runtime-dom': 3.3.12 - '@vue/server-renderer': 3.3.12(vue@3.3.12(typescript@5.4.5)) + '@vue/server-renderer': 3.3.12(vue@3.3.12(typescript@5.6.3)) '@vue/shared': 3.3.12 optionalDependencies: - typescript: 5.4.5 + typescript: 5.6.3 - vue@3.3.7(typescript@5.4.5): + vue@3.3.7(typescript@5.6.3): dependencies: '@vue/compiler-dom': 3.3.7 '@vue/compiler-sfc': 3.3.7 '@vue/runtime-dom': 3.3.7 - '@vue/server-renderer': 3.3.7(vue@3.3.7(typescript@5.4.5)) + '@vue/server-renderer': 3.3.7(vue@3.3.7(typescript@5.6.3)) '@vue/shared': 3.3.7 optionalDependencies: - typescript: 5.4.5 + typescript: 5.6.3 - vue@3.4.15(typescript@5.4.5): + vue@3.4.15(typescript@5.6.3): dependencies: '@vue/compiler-dom': 3.4.15 '@vue/compiler-sfc': 3.4.15 '@vue/runtime-dom': 3.4.15 - '@vue/server-renderer': 3.4.15(vue@3.4.15(typescript@5.4.5)) + '@vue/server-renderer': 3.4.15(vue@3.4.15(typescript@5.6.3)) '@vue/shared': 3.4.15 optionalDependencies: - typescript: 5.4.5 + typescript: 5.6.3 - vue@3.4.27(typescript@5.4.5): + vue@3.4.27(typescript@5.6.3): dependencies: '@vue/compiler-dom': 3.4.27 '@vue/compiler-sfc': 3.4.27 '@vue/runtime-dom': 3.4.27 - '@vue/server-renderer': 3.4.27(vue@3.4.27(typescript@5.4.5)) + '@vue/server-renderer': 3.4.27(vue@3.4.27(typescript@5.6.3)) '@vue/shared': 3.4.27 optionalDependencies: - typescript: 5.4.5 + typescript: 5.6.3 - vue@3.4.35(typescript@5.4.5): + vue@3.4.35(typescript@5.6.3): dependencies: '@vue/compiler-dom': 3.4.35 '@vue/compiler-sfc': 3.4.35 '@vue/runtime-dom': 3.4.35 - '@vue/server-renderer': 3.4.35(vue@3.4.35(typescript@5.4.5)) + '@vue/server-renderer': 3.4.35(vue@3.4.35(typescript@5.6.3)) '@vue/shared': 3.4.35 optionalDependencies: - typescript: 5.4.5 + typescript: 5.6.3 - vueuc@0.4.58(vue@3.4.35(typescript@5.4.5)): + vueuc@0.4.58(vue@3.4.35(typescript@5.6.3)): dependencies: - '@css-render/vue3-ssr': 0.15.14(vue@3.4.35(typescript@5.4.5)) + '@css-render/vue3-ssr': 0.15.14(vue@3.4.35(typescript@5.6.3)) '@juggle/resize-observer': 3.4.0 css-render: 0.15.14 evtd: 0.2.4 seemly: 0.3.8 - vdirs: 0.1.8(vue@3.4.35(typescript@5.4.5)) - vooks: 0.2.12(vue@3.4.35(typescript@5.4.5)) - vue: 3.4.35(typescript@5.4.5) - - walkdir@0.4.1: {} + vdirs: 0.1.8(vue@3.4.35(typescript@5.6.3)) + vooks: 0.2.12(vue@3.4.35(typescript@5.6.3)) + vue: 3.4.35(typescript@5.6.3) walker@1.0.8: dependencies: @@ -34701,14 +44878,95 @@ snapshots: glob-to-regexp: 0.4.1 graceful-fs: 4.2.11 + wbuf@1.7.3: + dependencies: + minimalistic-assert: 1.0.1 + wcwidth@1.0.1: dependencies: defaults: 1.0.4 web-namespaces@2.0.1: {} + webgl-constants@1.1.1: {} + + webgl-sdf-generator@1.1.1: {} + webidl-conversions@3.0.1: {} + webpack-bundle-analyzer@4.10.2(bufferutil@4.0.8): + dependencies: + '@discoveryjs/json-ext': 0.5.7 + acorn: 8.12.0 + acorn-walk: 8.3.2 + commander: 7.2.0 + debounce: 1.2.1 + escape-string-regexp: 4.0.0 + gzip-size: 6.0.0 + html-escaper: 2.0.2 + opener: 1.5.2 + picocolors: 1.1.0 + sirv: 2.0.4 + ws: 7.5.10(bufferutil@4.0.8) + transitivePeerDependencies: + - bufferutil + - utf-8-validate + + webpack-dev-middleware@5.3.4(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))): + dependencies: + colorette: 2.0.20 + memfs: 3.5.3 + mime-types: 2.1.35 + range-parser: 1.2.1 + schema-utils: 4.2.0 + webpack: 5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3)) + + webpack-dev-server@4.15.2(bufferutil@4.0.8)(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))): + dependencies: + '@types/bonjour': 3.5.13 + '@types/connect-history-api-fallback': 1.5.4 + '@types/express': 4.17.21 + '@types/serve-index': 1.9.4 + '@types/serve-static': 1.15.4 + '@types/sockjs': 0.3.36 + '@types/ws': 8.5.8 + ansi-html-community: 0.0.8 + bonjour-service: 1.2.1 + chokidar: 3.6.0 + colorette: 2.0.20 + compression: 1.7.4 + connect-history-api-fallback: 2.0.0 + default-gateway: 6.0.3 + express: 4.19.2 + graceful-fs: 4.2.11 + html-entities: 2.3.3 + http-proxy-middleware: 2.0.7(@types/express@4.17.21) + ipaddr.js: 2.2.0 + launch-editor: 2.9.1 + open: 8.4.2 + p-retry: 4.6.2 + rimraf: 3.0.2 + schema-utils: 4.2.0 + selfsigned: 2.4.1 + serve-index: 1.9.1 + sockjs: 0.3.24 + spdy: 4.0.2 + webpack-dev-middleware: 5.3.4(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))) + ws: 8.14.2(bufferutil@4.0.8)(utf-8-validate@6.0.3) + optionalDependencies: + webpack: 5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3)) + transitivePeerDependencies: + - bufferutil + - debug + - supports-color + - utf-8-validate + + webpack-merge@5.10.0: + dependencies: + clone-deep: 4.0.1 + flat: 5.0.2 + wildcard: 2.0.1 + webpack-node-externals@3.0.0: {} webpack-sources@3.2.3: {} @@ -34719,7 +44977,7 @@ snapshots: webpack-virtual-modules@0.6.2: {} - webpack@5.92.1: + webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3)): dependencies: '@types/eslint-scope': 3.7.7 '@types/estree': 1.0.5 @@ -34728,7 +44986,7 @@ snapshots: '@webassemblyjs/wasm-parser': 1.12.1 acorn: 8.12.0 acorn-import-attributes: 1.9.5(acorn@8.12.0) - browserslist: 4.23.0 + browserslist: 4.23.1 chrome-trace-event: 1.0.3 enhanced-resolve: 5.17.0 es-module-lexer: 1.5.4 @@ -34742,7 +45000,7 @@ snapshots: neo-async: 2.6.2 schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.10(webpack@5.92.1) + terser-webpack-plugin: 5.3.10(@swc/core@1.7.26(@swc/helpers@0.5.3))(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))) watchpack: 2.4.1 webpack-sources: 3.2.3 transitivePeerDependencies: @@ -34750,6 +45008,22 @@ snapshots: - esbuild - uglify-js + webpackbar@5.0.2(webpack@5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3))): + dependencies: + chalk: 4.1.2 + consola: 2.15.3 + pretty-time: 1.1.0 + std-env: 3.7.0 + webpack: 5.92.1(@swc/core@1.7.26(@swc/helpers@0.5.3)) + + websocket-driver@0.7.4: + dependencies: + http-parser-js: 0.5.8 + safe-buffer: 5.2.1 + websocket-extensions: 0.1.4 + + websocket-extensions@0.1.4: {} + whatwg-url@5.0.0: dependencies: tr46: 0.0.3 @@ -34806,6 +45080,8 @@ snapshots: dependencies: string-width: 5.1.2 + wildcard@2.0.1: {} + window-size@0.1.0: {} wmf@1.0.2: {} @@ -34850,6 +45126,10 @@ snapshots: imurmurhash: 0.1.4 signal-exit: 3.0.7 + ws@7.5.10(bufferutil@4.0.8): + optionalDependencies: + bufferutil: 4.0.8 + ws@8.14.2(bufferutil@4.0.8)(utf-8-validate@6.0.3): optionalDependencies: bufferutil: 4.0.8 @@ -34860,7 +45140,7 @@ snapshots: opencollective: 1.0.3 opencollective-postinstall: 2.0.3 - xdg-basedir@4.0.0: {} + xdg-basedir@5.1.0: {} xlsx-js-style@1.2.0: dependencies: @@ -34885,6 +45165,10 @@ snapshots: wmf: 1.0.2 word: 0.3.0 + xml-js@1.6.11: + dependencies: + sax: 1.3.0 + xmlbuilder@15.1.1: {} xss@1.0.11: @@ -34923,6 +45207,8 @@ snapshots: yaml@2.3.4: {} + yaml@2.5.1: {} + yargs-parser@18.1.3: dependencies: camelcase: 5.3.1 @@ -34984,9 +45270,14 @@ snapshots: buffer-crc32: 0.2.13 fd-slicer: 1.1.0 - yjs@13.6.18: + yauzl@3.1.3: dependencies: - lib0: 0.2.97 + buffer-crc32: 0.2.13 + pend: 1.2.0 + + yjs@13.6.20: + dependencies: + lib0: 0.2.99 ylru@1.3.2: {} @@ -35010,7 +45301,7 @@ snapshots: zustand-middleware-yjs@1.3.1(@types/react@18.2.35)(immer@9.0.21)(react@18.2.0): dependencies: - yjs: 13.6.18 + yjs: 13.6.20 zustand: 4.5.5(@types/react@18.2.35)(immer@9.0.21)(react@18.2.0) transitivePeerDependencies: - '@types/react' @@ -35024,6 +45315,10 @@ snapshots: react: 18.2.0 zustand: 4.5.5(@types/react@18.2.35)(immer@10.0.3)(react@18.2.0) + zustand@3.7.2(react@18.2.0): + optionalDependencies: + react: 18.2.0 + zustand@4.5.5(@types/react@18.2.35)(immer@10.0.3)(react@18.2.0): dependencies: use-sync-external-store: 1.2.2(react@18.2.0) diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index a72279fc73..969690c4d0 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -5,3 +5,4 @@ packages: - rust-plugins/* - js-plugins/* - bench/ + - docs/ diff --git a/release-plz.toml b/release-plz.toml index e04960aa82..aeb0c098c1 100644 --- a/release-plz.toml +++ b/release-plz.toml @@ -6,6 +6,10 @@ git_release_enable = false name = "farmfe_node" release = false +[[package]] +name = "farmfe_plugin_dts" +release = false + [[package]] name = "farmfe_plugin_sass" release = false diff --git a/rust-plugins/dts/.gitignore b/rust-plugins/dts/.gitignore new file mode 100644 index 0000000000..c70c112336 --- /dev/null +++ b/rust-plugins/dts/.gitignore @@ -0,0 +1,2 @@ +*.farm +*.node \ No newline at end of file diff --git a/rust-plugins/dts/CHANGELOG.md b/rust-plugins/dts/CHANGELOG.md new file mode 100644 index 0000000000..a2f8b37f3f --- /dev/null +++ b/rust-plugins/dts/CHANGELOG.md @@ -0,0 +1,7 @@ +# @farmfe/plugin-replace-dirname + +## 1.0.0-nightly-20241024075304 + +### Major Changes + +- 9a1b2b9: bump replace-dirname plugin diff --git a/rust-plugins/dts/Cargo.toml b/rust-plugins/dts/Cargo.toml new file mode 100644 index 0000000000..0aa39e67d2 --- /dev/null +++ b/rust-plugins/dts/Cargo.toml @@ -0,0 +1,18 @@ +[package] +edition = "2021" +name = "farmfe_plugin_dts" +version = "0.0.0" + +[lib] +crate-type = ["cdylib", "rlib"] + +[dependencies] +farmfe_core = { version = "*", path = "../../crates/core" } +farmfe_macro_plugin = { version = "*", path = "../../crates/macro_plugin" } +farmfe_toolkit = { version = "*", path = "../../crates/toolkit" } +regex = "1.7.3" +serde = { version = "1.0", features = ["derive", "rc"] } +serde_json = { version = "1.0", features = ["preserve_order"] } +url = "2.3.1" +pathdiff = "0.2" +farmfe_plugin_resolve = { version = "*", path = "../../crates/plugin_resolve" } diff --git a/rust-plugins/dts/index.d.ts b/rust-plugins/dts/index.d.ts new file mode 100755 index 0000000000..299c09ef00 --- /dev/null +++ b/rust-plugins/dts/index.d.ts @@ -0,0 +1,13 @@ +export interface IOptions { + /** + * The path to the root of the project + */ + include?: string[]; + /** + * exclude the path from the project + */ + exclude?: string[]; +} + +const binPath: string; +export default binPath; diff --git a/rust-plugins/dts/index.js b/rust-plugins/dts/index.js new file mode 100755 index 0000000000..39d6258dcd --- /dev/null +++ b/rust-plugins/dts/index.js @@ -0,0 +1,142 @@ +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( + "@farmfe/plugin-dts-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( + "@farmfe/plugin-dts-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( + "@farmfe/plugin-dts-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( + "@farmfe/plugin-dts-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( + "@farmfe/plugin-dts-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( + "@farmfe/plugin-dts-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( + "@farmfe/plugin-dts-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( + "@farmfe/plugin-dts-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( + "@farmfe/plugin-dts-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/dts/npm/darwin-arm64/README.md b/rust-plugins/dts/npm/darwin-arm64/README.md new file mode 100644 index 0000000000..2ad7ba06e6 --- /dev/null +++ b/rust-plugins/dts/npm/darwin-arm64/README.md @@ -0,0 +1,3 @@ +# `@farmfe/plugin-dts-darwin-arm64` + +This is the **aarch64-apple-darwin** binary for `@farmfe/plugin-dts` diff --git a/rust-plugins/dts/npm/darwin-arm64/package.json b/rust-plugins/dts/npm/darwin-arm64/package.json new file mode 100644 index 0000000000..6ad89c1933 --- /dev/null +++ b/rust-plugins/dts/npm/darwin-arm64/package.json @@ -0,0 +1,18 @@ +{ + "name": "@farmfe/plugin-dts-darwin-arm64", + "version": "0.0.0", + "os": [ + "darwin" + ], + "cpu": [ + "arm64" + ], + "main": "index.farm", + "files": [ + "index.farm" + ], + "license": "MIT", + "engines": { + "node": ">= 10" + } +} diff --git a/rust-plugins/dts/npm/darwin-x64/README.md b/rust-plugins/dts/npm/darwin-x64/README.md new file mode 100644 index 0000000000..54cebef29a --- /dev/null +++ b/rust-plugins/dts/npm/darwin-x64/README.md @@ -0,0 +1,3 @@ +# `@farmfe/plugin-dts-darwin-x64` + +This is the **x86_64-apple-darwin** binary for `@farmfe/plugin-dts` diff --git a/rust-plugins/dts/npm/darwin-x64/package.json b/rust-plugins/dts/npm/darwin-x64/package.json new file mode 100644 index 0000000000..35a36e2969 --- /dev/null +++ b/rust-plugins/dts/npm/darwin-x64/package.json @@ -0,0 +1,18 @@ +{ + "name": "@farmfe/plugin-dts-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/dts/npm/linux-arm64-gnu/README.md b/rust-plugins/dts/npm/linux-arm64-gnu/README.md new file mode 100644 index 0000000000..d0b7b3d62b --- /dev/null +++ b/rust-plugins/dts/npm/linux-arm64-gnu/README.md @@ -0,0 +1,3 @@ +# `@farmfe/plugin-dts-linux-arm64-gnu` + +This is the **aarch64-unknown-linux-gnu** binary for `@farmfe/plugin-dts` diff --git a/rust-plugins/dts/npm/linux-arm64-gnu/package.json b/rust-plugins/dts/npm/linux-arm64-gnu/package.json new file mode 100644 index 0000000000..4d9c209e03 --- /dev/null +++ b/rust-plugins/dts/npm/linux-arm64-gnu/package.json @@ -0,0 +1,21 @@ +{ + "name": "@farmfe/plugin-dts-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/dts/npm/linux-arm64-musl/README.md b/rust-plugins/dts/npm/linux-arm64-musl/README.md new file mode 100644 index 0000000000..f378728974 --- /dev/null +++ b/rust-plugins/dts/npm/linux-arm64-musl/README.md @@ -0,0 +1,3 @@ +# `@farmfe/plugin-dts-linux-arm64-musl` + +This is the **aarch64-unknown-linux-musl** binary for `@farmfe/plugin-dts` diff --git a/rust-plugins/dts/npm/linux-arm64-musl/package.json b/rust-plugins/dts/npm/linux-arm64-musl/package.json new file mode 100644 index 0000000000..fe88a9d346 --- /dev/null +++ b/rust-plugins/dts/npm/linux-arm64-musl/package.json @@ -0,0 +1,21 @@ +{ + "name": "@farmfe/plugin-dts-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/dts/npm/linux-x64-gnu/README.md b/rust-plugins/dts/npm/linux-x64-gnu/README.md new file mode 100644 index 0000000000..5d0a876ab0 --- /dev/null +++ b/rust-plugins/dts/npm/linux-x64-gnu/README.md @@ -0,0 +1,3 @@ +# `@farmfe/plugin-dts-linux-x64-gnu` + +This is the **x86_64-unknown-linux-gnu** binary for `@farmfe/plugin-dts` diff --git a/rust-plugins/dts/npm/linux-x64-gnu/package.json b/rust-plugins/dts/npm/linux-x64-gnu/package.json new file mode 100644 index 0000000000..268001b58d --- /dev/null +++ b/rust-plugins/dts/npm/linux-x64-gnu/package.json @@ -0,0 +1,21 @@ +{ + "name": "@farmfe/plugin-dts-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/dts/npm/linux-x64-musl/README.md b/rust-plugins/dts/npm/linux-x64-musl/README.md new file mode 100644 index 0000000000..2ddcff98cd --- /dev/null +++ b/rust-plugins/dts/npm/linux-x64-musl/README.md @@ -0,0 +1,3 @@ +# `@farmfe/plugin-dts-linux-x64-musl` + +This is the **x86_64-unknown-linux-musl** binary for `@farmfe/plugin-dts` diff --git a/rust-plugins/dts/npm/linux-x64-musl/package.json b/rust-plugins/dts/npm/linux-x64-musl/package.json new file mode 100644 index 0000000000..c0b477ae4f --- /dev/null +++ b/rust-plugins/dts/npm/linux-x64-musl/package.json @@ -0,0 +1,18 @@ +{ + "name": "@farmfe/plugin-dts-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/dts/npm/win32-arm64-msvc/README.md b/rust-plugins/dts/npm/win32-arm64-msvc/README.md new file mode 100644 index 0000000000..f3254c1e0d --- /dev/null +++ b/rust-plugins/dts/npm/win32-arm64-msvc/README.md @@ -0,0 +1,3 @@ +# `@farmfe/plugin-dts-win32-arm64-msvc` + +This is the aarch64-pc-windows-msvc binary for `@farmfe/plugin-dts` diff --git a/rust-plugins/dts/npm/win32-arm64-msvc/package.json b/rust-plugins/dts/npm/win32-arm64-msvc/package.json new file mode 100644 index 0000000000..eb13fc5a07 --- /dev/null +++ b/rust-plugins/dts/npm/win32-arm64-msvc/package.json @@ -0,0 +1,18 @@ +{ + "name": "@farmfe/plugin-dts-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/dts/npm/win32-ia32-msvc/README.md b/rust-plugins/dts/npm/win32-ia32-msvc/README.md new file mode 100644 index 0000000000..4fa248dfeb --- /dev/null +++ b/rust-plugins/dts/npm/win32-ia32-msvc/README.md @@ -0,0 +1,3 @@ +# `@farmfe/plugin-dts-win32-ia32-msvc` + +This is the i686-pc-windows-msvc binary for `@farmfe/plugin-dts` diff --git a/rust-plugins/dts/npm/win32-ia32-msvc/package.json b/rust-plugins/dts/npm/win32-ia32-msvc/package.json new file mode 100644 index 0000000000..166a9fb30d --- /dev/null +++ b/rust-plugins/dts/npm/win32-ia32-msvc/package.json @@ -0,0 +1,18 @@ +{ + "name": "@farmfe/plugin-dts-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/dts/npm/win32-x64-msvc/README.md b/rust-plugins/dts/npm/win32-x64-msvc/README.md new file mode 100644 index 0000000000..780ca43f59 --- /dev/null +++ b/rust-plugins/dts/npm/win32-x64-msvc/README.md @@ -0,0 +1,3 @@ +# `@farmfe/plugin-dts-win32-x64-msvc` + +This is the **x86_64-pc-windows-msvc** binary for `@farmfe/plugin-dts` diff --git a/rust-plugins/dts/npm/win32-x64-msvc/package.json b/rust-plugins/dts/npm/win32-x64-msvc/package.json new file mode 100644 index 0000000000..969fb5bf86 --- /dev/null +++ b/rust-plugins/dts/npm/win32-x64-msvc/package.json @@ -0,0 +1,18 @@ +{ + "name": "@farmfe/plugin-dts-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/dts/package.json b/rust-plugins/dts/package.json new file mode 100755 index 0000000000..edd4549831 --- /dev/null +++ b/rust-plugins/dts/package.json @@ -0,0 +1,46 @@ +{ + "name": "@farmfe/plugin-dts", + "version": "1.0.0-nightly-20241024075304", + "main": "index.js", + "types": "index.d.ts", + "type": "module", + "license": "MIT", + "engines": { + "node": ">=16" + }, + "devDependencies": { + "@farmfe/plugin-tools": "workspace:*" + }, + "napi": { + "name": "farm_plugin_dts", + "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": "./index.js", + "types": "./index.d.ts", + "default": "./index.js" + }, + "./package.json": "./package.json" + }, + "scripts": { + "dev": "cargo watch -w src -s 'scripts/watch.sh'", + "build": "farm-plugin-tools build --platform --cargo-name farmfe_plugin_dts -p farmfe_plugin_dts --release", + "build:publish": "cross-env CARGO_PROFILE_RELEASE_LTO=fat CARGO_PROFILE_RELEASE_STRIP=symbols CARGO_PROFILE_RELEASE_PANIC=abort CARGO_PROFILE_RELEASE_OPT_LEVEL=z farm-plugin-tools build --platform --cargo-name farmfe_plugin_dts -p farmfe_plugin_dts --release", + "prepublishOnly": "farm-plugin-tools prepublish" + }, + "files": [ + "index.js", + "index.d.ts", + "func.js" + ] +} diff --git a/rust-plugins/dts/rustfmt.toml b/rust-plugins/dts/rustfmt.toml new file mode 100755 index 0000000000..cab5731eda --- /dev/null +++ b/rust-plugins/dts/rustfmt.toml @@ -0,0 +1,2 @@ +tab_spaces = 2 +edition = "2021" diff --git a/rust-plugins/dts/scripts/watch.sh b/rust-plugins/dts/scripts/watch.sh new file mode 100755 index 0000000000..255a484ac2 --- /dev/null +++ b/rust-plugins/dts/scripts/watch.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +npm run build diff --git a/rust-plugins/dts/src/lib.rs b/rust-plugins/dts/src/lib.rs new file mode 100644 index 0000000000..bd5056e884 --- /dev/null +++ b/rust-plugins/dts/src/lib.rs @@ -0,0 +1,224 @@ +#![deny(clippy::all)] +use farmfe_core::{ + config::{config_regex::ConfigRegex, Config, ResolveConfig}, + context::{CompilationContext, EmitFileParams}, + error::CompilationError, + plugin::{ + Plugin, PluginAnalyzeDepsHookParam, PluginFinalizeModuleHookParam, + PluginGenerateResourcesHookResult, PluginHookContext, PluginLoadHookParam, + PluginLoadHookResult, PluginParseHookParam, PluginProcessModuleHookParam, ResolveKind, + }, + resource::{Resource, ResourceOrigin, ResourceType}, + stats::Stats, + swc_common::{comments::SingleThreadedComments, BytePos, FileName, Mark}, + swc_ecma_ast::{ImportDecl, Module as EcmaAstModule, ModuleDecl, ModuleItem, Program}, + swc_ecma_parser::{lexer::Lexer, EsSyntax as EsConfig, JscTarget, Parser, StringInput, Syntax}, +}; +use farmfe_plugin_resolve::resolver::{ResolveOptions, Resolver}; + +use farmfe_toolkit::{ + plugin_utils::path_filter::PathFilter, + swc_ecma_codegen::{to_code, Node}, + swc_ecma_transforms::{helpers::inject_helpers, typescript}, + swc_ecma_visit::{VisitMut, VisitMutWith}, + swc_typescript::fast_dts::FastDts, +}; +use std::time::Duration; +use std::{ + path::{Path, PathBuf}, + sync::{Arc, Mutex}, +}; + +use farmfe_macro_plugin::farm_plugin; + +#[farm_plugin] +pub struct FarmPluginDts { + options: FarmPluginDtsOptions, + total_dts_time: Mutex, +} + +#[derive(serde::Deserialize)] +pub struct FarmPluginDtsOptions { + exclude: Vec, + include: Vec, +} + +impl Default for FarmPluginDtsOptions { + fn default() -> Self { + Self { + exclude: vec![ConfigRegex::new("node_modules/")], + include: vec![ConfigRegex::new(".(ts|tsx)$")], + } + } +} + +impl FarmPluginDts { + fn new(_: &Config, options: String) -> Self { + let options: FarmPluginDtsOptions = serde_json::from_str(&options).unwrap_or_default(); + Self { + options, + total_dts_time: Mutex::new(Duration::from_secs(0)), + } + } +} + +impl Plugin for FarmPluginDts { + fn name(&self) -> &str { + "FarmPluginDts" + } + + fn priority(&self) -> i32 { + 101 + } + + 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); + } + let path = param.module_id.relative_path(); + let start = std::time::Instant::now(); + + let ast = &mut param.meta.as_script_mut().ast; + + let mut module: EcmaAstModule = ast.clone(); + + module.visit_mut_with(&mut ImportPathRewriter { + source_path: PathBuf::from(path), + config: (*context.config).clone(), + resolver: Resolver::new(), + }); + let filename: Arc = Arc::new(FileName::Real( + param.module_id.relative_path().to_string().into(), + )); + + let mut checker = FastDts::new(filename.clone()); + module.visit_mut_with(&mut ImportVariableRemover); + let issues = checker.transform(&mut module); + for issue in issues { + let _range = issue.range(); + } + + let dts_path = if path.ends_with(".tsx") { + path.replace(".tsx", ".d.ts") + } else { + path.replace(".ts", ".d.ts") + }; + + let dts_code = to_code(&module); + *self.total_dts_time.lock().unwrap() += start.elapsed(); + + context.emit_file(EmitFileParams { + resolved_path: param.module_id.to_string(), + name: dts_path, + content: dts_code.as_bytes().to_vec(), + resource_type: ResourceType::Custom("d.ts".to_string()), + }); + Ok(Some(())) + } + + fn finish( + &self, + _stat: &Stats, + _context: &Arc, + ) -> Result, CompilationError> { + let total_time = *self.total_dts_time.lock().unwrap(); + println!( + "\x1b[1m\x1b[38;2;113;26;95m[ Farm ]\x1b[39m\x1b[0m Dts Plugin Build completed in: \x1b[1m\x1b[32m{:.2}ms\x1b[0m", + total_time.as_secs_f64() * 1000.0 + ); + Ok(None) + } +} + +struct ImportVariableRemover; + +impl VisitMut for ImportVariableRemover { + fn visit_mut_module_items(&mut self, items: &mut Vec) { + items.retain(|item| { + !matches!( + item, + ModuleItem::ModuleDecl(ModuleDecl::Import(ImportDecl { + type_only: false, + .. + })) + ) + }); + items.visit_mut_children_with(self); + } +} + +struct ImportPathRewriter { + source_path: PathBuf, + config: Config, + resolver: Resolver, +} + +// TODO 生成后缀 +// 主要依据:根据 Rollup 的 outputOptions.entryFileNames 配置 +// 如果输出是 .js -> 生成 .d.ts +// 如果输出是 .cjs -> 生成 .d.cts +// 如果输出是 .mjs -> 生成 .d.mts + +// { +// output: { +// entryFileNames: '[name].cjs' // 将生成 .d.cts +// // 或 +// entryFileNames: '[name].mjs' // 将生成 .d.mts +// // 或 +// entryFileNames: '[name].js' // 将生成 .d.ts +// } +// } + +// 然后这个先不跟 format 走吧 format 未来可能会有问题 还是跟 entryFileNames 走吧 + +// TODO emit_file baseDir +// extraOutdir +// 默认全放在根目录 + +// 如果设置了 extraOutdir 则需要根据 extraOutdir 来生成后缀 + +impl VisitMut for ImportPathRewriter { + fn visit_mut_module_items(&mut self, items: &mut Vec) { + for item in items.iter_mut() { + if let ModuleItem::ModuleDecl(ModuleDecl::Import(import)) = item { + let src = &mut import.src; + let alias_context = CompilationContext::new( + Config { + resolve: Box::new(ResolveConfig { + alias: self.config.resolve.alias.clone(), + ..Default::default() + }), + ..Default::default() + }, + vec![], + ) + .unwrap(); + let resolved = self.resolver.resolve( + src.value.as_str(), + PathBuf::from(self.config.root.clone()), + &ResolveKind::Import, + &ResolveOptions::default(), + &Arc::new(alias_context), + ); + if let Some(resolved_path) = resolved { + let path = PathBuf::from(resolved_path.resolved_path); + + let base_path = path.with_extension(""); + let final_value = base_path + .with_extension("d.ts") + .to_string_lossy() + .to_string(); + src.value = final_value.clone().into(); + src.raw = Some(format!("'{}'", final_value).into()); + } + } + } + + items.visit_mut_children_with(self); + } +} diff --git a/rust-plugins/react/CHANGELOG.md b/rust-plugins/react/CHANGELOG.md index b038e92cb1..00a10e053e 100644 --- a/rust-plugins/react/CHANGELOG.md +++ b/rust-plugins/react/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 2.0.0-nightly-20241022124925 + +### Major Changes + +- 6a1038c: update nightly tag + ## 1.2.6 ### Patch Changes diff --git a/rust-plugins/react/Cargo.toml b/rust-plugins/react/Cargo.toml index 0d6acb34a1..3ae3c869bf 100644 --- a/rust-plugins/react/Cargo.toml +++ b/rust-plugins/react/Cargo.toml @@ -9,7 +9,7 @@ crate-type = ["cdylib", "rlib"] [dependencies] farmfe_core = { version = "*", path = "../../crates/core" } farmfe_macro_plugin = { version = "*", path = "../../crates/macro_plugin" } -farmfe_toolkit_plugin_types = { version = "*", path = "../../crates/toolkit_plugin_types" } +farmfe_toolkit = { version = "*", path = "../../crates/toolkit" } serde = { version = "1.0", features = ["derive"] } lazy_static = "1.4.0" diff --git a/rust-plugins/react/package.json b/rust-plugins/react/package.json index 3ebd57d00c..acfd00d999 100644 --- a/rust-plugins/react/package.json +++ b/rust-plugins/react/package.json @@ -1,6 +1,6 @@ { "name": "@farmfe/plugin-react", - "version": "1.2.6", + "version": "2.0.0-nightly-20241022124925", "main": "index.js", "types": "index.d.ts", "type": "module", diff --git a/rust-plugins/react/src/is_react_refresh_boundary.ts b/rust-plugins/react/src/is_react_refresh_boundary.ts index c9782114bf..40703a9edb 100644 --- a/rust-plugins/react/src/is_react_refresh_boundary.ts +++ b/rust-plugins/react/src/is_react_refresh_boundary.ts @@ -3,8 +3,6 @@ import Refresh from 'react-refresh'; type ModExport = Record; -// from: https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/src/refreshUtils.js - // @ts-ignore export function validateRefreshBoundaryAndEnqueueUpdate(prevExports: ModExport, nextExports: ModExport) { const ignoredExports = [] diff --git a/rust-plugins/react/src/lib.rs b/rust-plugins/react/src/lib.rs index b874036b7b..f3f2e9a4f8 100644 --- a/rust-plugins/react/src/lib.rs +++ b/rust-plugins/react/src/lib.rs @@ -2,20 +2,18 @@ use farmfe_core::{ config::Config, + context::create_swc_source_map, plugin::{Plugin, PluginAnalyzeDepsHookResultEntry, ResolveKind}, serde_json, }; use farmfe_macro_plugin::farm_plugin; -use farmfe_toolkit_plugin_types::{ - libloading::Library, - load_core_lib, - swc_ast::create_swc_source_map, - swc_transforms::{swc_transform_react, FarmSwcTransformReactOptions}, -}; -mod react_refresh; use react_refresh::{inject_react_refresh, IS_REACT_REFRESH_BOUNDARY}; +use react_transform::{farm_swc_transform_react, FarmSwcTransformReactOptions}; + +mod react_refresh; +mod react_transform; const GLOBAL_INJECT_MODULE_ID: &str = "farmfe_plugin_react_global_inject"; @@ -28,7 +26,7 @@ struct SwcTransformReactOptions { #[farm_plugin] pub struct FarmPluginReact { - core_lib: Library, + // core_lib: Library, options: String, enable_react_refresh: bool, use_absolute_path: bool, @@ -46,7 +44,7 @@ impl FarmPluginReact { let options = serde_json::to_string(&options_obj).unwrap(); Self { - core_lib: load_core_lib(config.core_lib_path.as_ref().unwrap()), + // core_lib: load_core_lib(config.core_lib_path.as_ref().unwrap()), options, enable_react_refresh: is_dev && react_options.refresh.unwrap_or(true), use_absolute_path: react_options.use_absolute_path.unwrap_or(false), @@ -59,7 +57,7 @@ impl Plugin for FarmPluginReact { "FarmPluginReact" } fn priority(&self) -> i32 { - 99 + 99 } fn resolve( &self, @@ -126,32 +124,36 @@ impl Plugin for FarmPluginReact { ) { let top_level_mark = param.meta.as_script().top_level_mark; let unresolved_mark = param.meta.as_script().unresolved_mark; + let comments = param.meta.as_script().comments.clone().into(); let ast = &mut param.meta.as_script_mut().ast; let file_name = if self.use_absolute_path { - param.module_id.resolved_path(&context.config.root) + param + .module_id + .resolved_path_with_query(&context.config.root) } else { param.module_id.to_string() }; - let (cm, _) = create_swc_source_map(&self.core_lib, &file_name, param.content.clone())?; + let (cm, _) = create_swc_source_map(&file_name.into(), param.content.clone()); + let globals = context.meta.get_globals(¶m.module_id); - swc_transform_react( - &self.core_lib, + farm_swc_transform_react( ast, FarmSwcTransformReactOptions { top_level_mark, unresolved_mark, inject_helpers: true, cm, - globals: &context.meta.script.globals, - mode: context.config.mode.clone(), + comments, + globals: globals.value(), + mode: context.config.mode, options: self.options.clone(), }, )?; if self.enable_react_refresh { - inject_react_refresh(&self.core_lib, ast); + inject_react_refresh(ast); } return Ok(Some(())); diff --git a/rust-plugins/react/src/react_refresh.rs b/rust-plugins/react/src/react_refresh.rs index 5ae6417a68..6d6043966b 100644 --- a/rust-plugins/react/src/react_refresh.rs +++ b/rust-plugins/react/src/react_refresh.rs @@ -1,13 +1,16 @@ +use std::sync::Arc; + use farmfe_core::{ config::FARM_MODULE, - swc_ecma_ast::{Module as SwcModule, ModuleDecl, ModuleItem}, + swc_ecma_ast::{EsVersion, Module as SwcModule, ModuleDecl, ModuleItem}, swc_ecma_parser::Syntax, }; -use farmfe_toolkit_plugin_types::{ - libloading::Library, - swc_ast::{parse_module, ParseScriptModuleResult}, -}; +use farmfe_toolkit::script::{parse_module as farm_swc_parse_module, ParseScriptModuleResult}; +// use farmfe_toolkit_plugin_types::{ +// libloading::Library, +// swc_ast::{parse_module, ParseScriptModuleResult}, +// }; use lazy_static::lazy_static; const REFRESH_RUNTIME_IMPORT: &str = "import RefreshRuntime from 'react-refresh'"; @@ -32,10 +35,55 @@ lazy_static! { }; } +pub fn parse_module( + file_name: &str, + src: &str, + syntax: Syntax, + target: EsVersion, +) -> farmfe_core::error::Result { + farm_swc_parse_module(&file_name.into(), Arc::new(src.to_string()), syntax, target) +} + +// polyfill like https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/src/refreshUtils.js +// +// +// +// ```js +// Object.defineProperty(exports, "Foo", { +// get() { +// return Foo +// } +// }); +// +// Object.defineProperty(exports, "Bar", { +// get() { +// return Bar +// } +// }); +// +// +// +// // moduleA +// const Foo = () => {} +// +// // ... +// ReactRefreshUtil.registerExportsForReactRefresh(module.exports, module.id); +// // Until here, `Bar` is still not initialized +// // ... +// +// // moduleB +// const Bar = () => {} +// ``` +// + +// When merging multiple modules, the exports will be promoted and contain side effects +// so the getter cannot be triggered immediately when `registerExportsForReactRefresh`. +// maybe there are other better ways. const POST_CODE: &str = r#" window.$RefreshReg$ = prevRefreshReg; window.$RefreshSig$ = prevRefreshSig; if (import.meta.hot) { + setTimeout(() => { ReactRefreshUtil.registerExportsForReactRefresh(module.exports, module.id); import.meta.hot.accept(nextExport => { @@ -47,15 +95,16 @@ if (import.meta.hot) { }); ReactRefreshUtil.enqueueUpdate(); + }) } "#; -fn inject_runtime_import(lib: &Library, ast: &mut SwcModule) { +fn inject_runtime_import(ast: &mut SwcModule) { let parse_import_decl = |file_name: &str, code: &str| { let ParseScriptModuleResult { ast: mut module, .. } = parse_module( - lib, + // lib, file_name, code, Syntax::Es(Default::default()), @@ -75,8 +124,7 @@ fn inject_runtime_import(lib: &Library, ast: &mut SwcModule) { // inject react boundary detection let react_boundary_import = format!("import * as ReactRefreshUtil from '{IS_REACT_REFRESH_BOUNDARY}'"); - let react_boundary_import_decl = - parse_import_decl("ReactRefreshUtil", &react_boundary_import); + let react_boundary_import_decl = parse_import_decl("ReactRefreshUtil", &react_boundary_import); ast.body.insert( 0, @@ -87,9 +135,9 @@ fn inject_runtime_import(lib: &Library, ast: &mut SwcModule) { .insert(0, ModuleItem::ModuleDecl(ModuleDecl::Import(import_decl))); } -fn inject_pre_code(lib: &Library, ast: &mut SwcModule) { +fn inject_pre_code(ast: &mut SwcModule) { let ParseScriptModuleResult { ast: module, .. } = parse_module( - lib, + // lib, "preCode", &PRE_CODE, Syntax::Es(Default::default()), @@ -101,9 +149,9 @@ fn inject_pre_code(lib: &Library, ast: &mut SwcModule) { ast.body.splice(1..1, module.body); } -fn inject_post_code(lib: &Library, ast: &mut SwcModule) { +fn inject_post_code(ast: &mut SwcModule) { let ParseScriptModuleResult { ast: module, .. } = parse_module( - lib, + // lib, "postCode", POST_CODE, Syntax::Es(Default::default()), @@ -116,8 +164,8 @@ fn inject_post_code(lib: &Library, ast: &mut SwcModule) { } // [react fast refresh](https://github.com/facebook/react/issues/16604#issuecomment-528663101) -pub fn inject_react_refresh(lib: &Library, ast: &mut SwcModule) { - inject_runtime_import(lib, ast); - inject_pre_code(lib, ast); - inject_post_code(lib, ast); +pub fn inject_react_refresh(ast: &mut SwcModule) { + inject_runtime_import(ast); + inject_pre_code(ast); + inject_post_code(ast); } diff --git a/crates/node/src/plugin_toolkit/swc_transforms.rs b/rust-plugins/react/src/react_transform.rs similarity index 68% rename from crates/node/src/plugin_toolkit/swc_transforms.rs rename to rust-plugins/react/src/react_transform.rs index 3478e98afa..12b348a63b 100644 --- a/crates/node/src/plugin_toolkit/swc_transforms.rs +++ b/rust-plugins/react/src/react_transform.rs @@ -1,25 +1,35 @@ +use std::sync::Arc; + use farmfe_core::{ config::Mode, - error::Result, serde_json, - swc_common::{comments::NoopComments, Mark}, - swc_ecma_ast, + swc_common::{comments::SingleThreadedComments, Globals, Mark, SourceMap}, + swc_ecma_ast::{self, Program}, }; + use farmfe_toolkit::{ script::swc_try_with::try_with, swc_ecma_transforms::{ helpers::inject_helpers, react::{react, Options, RefreshOptions, Runtime}, }, - swc_ecma_visit::VisitMutWith, }; -use farmfe_toolkit_plugin_types::swc_transforms::FarmSwcTransformReactOptions; -#[no_mangle] +pub struct FarmSwcTransformReactOptions<'a> { + pub top_level_mark: u32, + pub unresolved_mark: u32, + pub inject_helpers: bool, + pub mode: Mode, + pub cm: Arc, + pub comments: SingleThreadedComments, + pub globals: &'a Globals, + pub options: String, +} + pub fn farm_swc_transform_react( ast: &mut swc_ecma_ast::Module, options: FarmSwcTransformReactOptions, -) -> Result<()> { +) -> farmfe_core::error::Result<()> { let is_dev = matches!(options.mode, Mode::Development); let top_level_mark = Mark::from_u32(options.top_level_mark); let unresolved_mark = Mark::from_u32(options.unresolved_mark); @@ -53,16 +63,21 @@ pub fn farm_swc_transform_react( }; try_with(options.cm.clone(), options.globals, || { - ast.visit_mut_with(&mut react( + let take_ast = std::mem::take(ast); + let mut program = Program::Module(take_ast); + + program.mutate(&mut react( options.cm, - Some(NoopComments), + Some(options.comments), react_options, top_level_mark, unresolved_mark, )); if options.inject_helpers { - ast.visit_mut_with(&mut inject_helpers(unresolved_mark)); + program.mutate(&mut inject_helpers(unresolved_mark)); } + + *ast = program.expect_module(); }) } diff --git a/rust-plugins/replace-dirname/.gitignore b/rust-plugins/replace-dirname/.gitignore new file mode 100644 index 0000000000..c70c112336 --- /dev/null +++ b/rust-plugins/replace-dirname/.gitignore @@ -0,0 +1,2 @@ +*.farm +*.node \ No newline at end of file diff --git a/rust-plugins/replace-dirname/CHANGELOG.md b/rust-plugins/replace-dirname/CHANGELOG.md new file mode 100644 index 0000000000..a2f8b37f3f --- /dev/null +++ b/rust-plugins/replace-dirname/CHANGELOG.md @@ -0,0 +1,7 @@ +# @farmfe/plugin-replace-dirname + +## 1.0.0-nightly-20241024075304 + +### Major Changes + +- 9a1b2b9: bump replace-dirname plugin diff --git a/rust-plugins/replace-dirname/Cargo.toml b/rust-plugins/replace-dirname/Cargo.toml new file mode 100644 index 0000000000..85e2371b0d --- /dev/null +++ b/rust-plugins/replace-dirname/Cargo.toml @@ -0,0 +1,16 @@ +[package] +edition = "2021" +name = "farmfe_plugin_replace_dirname" +version = "0.0.0" + +[lib] +crate-type = ["cdylib", "rlib"] + +[dependencies] +farmfe_core = { version = "*", path = "../../crates/core" } +farmfe_macro_plugin = { version = "*", path = "../../crates/macro_plugin" } +farmfe_toolkit = { version = "*", path = "../../crates/toolkit" } +regex = "1.7.3" +serde = { version = "1.0", features = ["derive", "rc"] } +serde_json = { version = "1.0", features = ["preserve_order"] } +url = "2.3.1" diff --git a/rust-plugins/replace-dirname/index.d.ts b/rust-plugins/replace-dirname/index.d.ts new file mode 100755 index 0000000000..299c09ef00 --- /dev/null +++ b/rust-plugins/replace-dirname/index.d.ts @@ -0,0 +1,13 @@ +export interface IOptions { + /** + * The path to the root of the project + */ + include?: string[]; + /** + * exclude the path from the project + */ + exclude?: string[]; +} + +const binPath: string; +export default binPath; diff --git a/rust-plugins/replace-dirname/index.js b/rust-plugins/replace-dirname/index.js new file mode 100755 index 0000000000..46ca68e7b2 --- /dev/null +++ b/rust-plugins/replace-dirname/index.js @@ -0,0 +1,142 @@ +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( + "@farmfe/plugin-replace-dirname-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( + "@farmfe/plugin-replace-dirname-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( + "@farmfe/plugin-replace-dirname-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( + "@farmfe/plugin-replace-dirname-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( + "@farmfe/plugin-replace-dirname-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( + "@farmfe/plugin-replace-dirname-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( + "@farmfe/plugin-replace-dirname-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( + "@farmfe/plugin-replace-dirname-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( + "@farmfe/plugin-replace-dirname-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/replace-dirname/npm/darwin-arm64/README.md b/rust-plugins/replace-dirname/npm/darwin-arm64/README.md new file mode 100644 index 0000000000..a386239f4d --- /dev/null +++ b/rust-plugins/replace-dirname/npm/darwin-arm64/README.md @@ -0,0 +1,3 @@ +# `@farmfe/plugin-replace-dirname-darwin-arm64` + +This is the **aarch64-apple-darwin** binary for `@farmfe/plugin-replace-dirname` diff --git a/rust-plugins/replace-dirname/npm/darwin-arm64/package.json b/rust-plugins/replace-dirname/npm/darwin-arm64/package.json new file mode 100644 index 0000000000..5a481bd6e6 --- /dev/null +++ b/rust-plugins/replace-dirname/npm/darwin-arm64/package.json @@ -0,0 +1,18 @@ +{ + "name": "@farmfe/plugin-replace-dirname-darwin-arm64", + "version": "0.0.0", + "os": [ + "darwin" + ], + "cpu": [ + "arm64" + ], + "main": "index.farm", + "files": [ + "index.farm" + ], + "license": "MIT", + "engines": { + "node": ">= 10" + } +} diff --git a/rust-plugins/replace-dirname/npm/darwin-x64/README.md b/rust-plugins/replace-dirname/npm/darwin-x64/README.md new file mode 100644 index 0000000000..31572db338 --- /dev/null +++ b/rust-plugins/replace-dirname/npm/darwin-x64/README.md @@ -0,0 +1,3 @@ +# `@farmfe/plugin-replace-dirname-darwin-x64` + +This is the **x86_64-apple-darwin** binary for `@farmfe/plugin-replace-dirname` diff --git a/rust-plugins/replace-dirname/npm/darwin-x64/package.json b/rust-plugins/replace-dirname/npm/darwin-x64/package.json new file mode 100644 index 0000000000..752bf79500 --- /dev/null +++ b/rust-plugins/replace-dirname/npm/darwin-x64/package.json @@ -0,0 +1,18 @@ +{ + "name": "@farmfe/plugin-replace-dirname-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/replace-dirname/npm/linux-arm64-gnu/README.md b/rust-plugins/replace-dirname/npm/linux-arm64-gnu/README.md new file mode 100644 index 0000000000..ddd7dfb9d1 --- /dev/null +++ b/rust-plugins/replace-dirname/npm/linux-arm64-gnu/README.md @@ -0,0 +1,3 @@ +# `@farmfe/plugin-react-linux-arm64-gnu` + +This is the **aarch64-unknown-linux-gnu** binary for `@farmfe/plugin-react` diff --git a/rust-plugins/replace-dirname/npm/linux-arm64-gnu/package.json b/rust-plugins/replace-dirname/npm/linux-arm64-gnu/package.json new file mode 100644 index 0000000000..ccef8ff4a5 --- /dev/null +++ b/rust-plugins/replace-dirname/npm/linux-arm64-gnu/package.json @@ -0,0 +1,21 @@ +{ + "name": "@farmfe/plugin-replace-dirname-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/replace-dirname/npm/linux-arm64-musl/README.md b/rust-plugins/replace-dirname/npm/linux-arm64-musl/README.md new file mode 100644 index 0000000000..a64fd85dda --- /dev/null +++ b/rust-plugins/replace-dirname/npm/linux-arm64-musl/README.md @@ -0,0 +1,3 @@ +# `@farmfe/plugin-replace-dirname-linux-arm64-musl` + +This is the **aarch64-unknown-linux-musl** binary for `@farmfe/plugin-replace-dirname` diff --git a/rust-plugins/replace-dirname/npm/linux-arm64-musl/package.json b/rust-plugins/replace-dirname/npm/linux-arm64-musl/package.json new file mode 100644 index 0000000000..c9ea5b92b8 --- /dev/null +++ b/rust-plugins/replace-dirname/npm/linux-arm64-musl/package.json @@ -0,0 +1,21 @@ +{ + "name": "@farmfe/plugin-replace-dirname-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/replace-dirname/npm/linux-x64-gnu/README.md b/rust-plugins/replace-dirname/npm/linux-x64-gnu/README.md new file mode 100644 index 0000000000..2c17903a17 --- /dev/null +++ b/rust-plugins/replace-dirname/npm/linux-x64-gnu/README.md @@ -0,0 +1,3 @@ +# `@farmfe/plugin-replace-dirname-linux-x64-gnu` + +This is the **x86_64-unknown-linux-gnu** binary for `@farmfe/plugin-replace-dirname` diff --git a/rust-plugins/replace-dirname/npm/linux-x64-gnu/package.json b/rust-plugins/replace-dirname/npm/linux-x64-gnu/package.json new file mode 100644 index 0000000000..5a107f3590 --- /dev/null +++ b/rust-plugins/replace-dirname/npm/linux-x64-gnu/package.json @@ -0,0 +1,21 @@ +{ + "name": "@farmfe/plugin-replace-dirname-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/replace-dirname/npm/linux-x64-musl/README.md b/rust-plugins/replace-dirname/npm/linux-x64-musl/README.md new file mode 100644 index 0000000000..4947d1e792 --- /dev/null +++ b/rust-plugins/replace-dirname/npm/linux-x64-musl/README.md @@ -0,0 +1,3 @@ +# `@farmfe/plugin-replace-dirname-linux-x64-musl` + +This is the **x86_64-unknown-linux-musl** binary for `@farmfe/plugin-replace-dirname` diff --git a/rust-plugins/replace-dirname/npm/linux-x64-musl/package.json b/rust-plugins/replace-dirname/npm/linux-x64-musl/package.json new file mode 100644 index 0000000000..e5edcbbed8 --- /dev/null +++ b/rust-plugins/replace-dirname/npm/linux-x64-musl/package.json @@ -0,0 +1,18 @@ +{ + "name": "@farmfe/plugin-replace-dirname-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/replace-dirname/npm/win32-arm64-msvc/README.md b/rust-plugins/replace-dirname/npm/win32-arm64-msvc/README.md new file mode 100644 index 0000000000..7042e9575e --- /dev/null +++ b/rust-plugins/replace-dirname/npm/win32-arm64-msvc/README.md @@ -0,0 +1,3 @@ +# `@farmfe/plugin-replace-dirname-win32-arm64-msvc` + +This is the aarch64-pc-windows-msvc binary for `@farmfe/plugin-replace-dirname` diff --git a/rust-plugins/replace-dirname/npm/win32-arm64-msvc/package.json b/rust-plugins/replace-dirname/npm/win32-arm64-msvc/package.json new file mode 100644 index 0000000000..16c9f7795f --- /dev/null +++ b/rust-plugins/replace-dirname/npm/win32-arm64-msvc/package.json @@ -0,0 +1,18 @@ +{ + "name": "@farmfe/plugin-replace-dirname-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/replace-dirname/npm/win32-ia32-msvc/README.md b/rust-plugins/replace-dirname/npm/win32-ia32-msvc/README.md new file mode 100644 index 0000000000..db8c3d41af --- /dev/null +++ b/rust-plugins/replace-dirname/npm/win32-ia32-msvc/README.md @@ -0,0 +1,3 @@ +# `@farmfe/plugin-replace-dirname-win32-ia32-msvc` + +This is the i686-pc-windows-msvc binary for `@farmfe/plugin-replace-dirname` diff --git a/rust-plugins/replace-dirname/npm/win32-ia32-msvc/package.json b/rust-plugins/replace-dirname/npm/win32-ia32-msvc/package.json new file mode 100644 index 0000000000..5d576ee19b --- /dev/null +++ b/rust-plugins/replace-dirname/npm/win32-ia32-msvc/package.json @@ -0,0 +1,18 @@ +{ + "name": "@farmfe/plugin-replace-dirname-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/replace-dirname/npm/win32-x64-msvc/README.md b/rust-plugins/replace-dirname/npm/win32-x64-msvc/README.md new file mode 100644 index 0000000000..3cf9ed74bd --- /dev/null +++ b/rust-plugins/replace-dirname/npm/win32-x64-msvc/README.md @@ -0,0 +1,3 @@ +# `@farmfe/plugin-replace-dirname-win32-x64-msvc` + +This is the **x86_64-pc-windows-msvc** binary for `@farmfe/plugin-replace-dirname` diff --git a/rust-plugins/replace-dirname/npm/win32-x64-msvc/package.json b/rust-plugins/replace-dirname/npm/win32-x64-msvc/package.json new file mode 100644 index 0000000000..c579d4534f --- /dev/null +++ b/rust-plugins/replace-dirname/npm/win32-x64-msvc/package.json @@ -0,0 +1,18 @@ +{ + "name": "@farmfe/plugin-replace-dirname-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/replace-dirname/package.json b/rust-plugins/replace-dirname/package.json new file mode 100755 index 0000000000..1a1ed5932d --- /dev/null +++ b/rust-plugins/replace-dirname/package.json @@ -0,0 +1,45 @@ +{ + "name": "@farmfe/plugin-replace-dirname", + "version": "1.0.0-nightly-20241024075304", + "main": "index.js", + "types": "index.d.ts", + "type": "module", + "license": "MIT", + "engines": { + "node": ">=16" + }, + "devDependencies": { + "@farmfe/plugin-tools": "workspace:*" + }, + "napi": { + "name": "farm_plugin_replace_dirname", + "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": "./index.js", + "types": "./index.d.ts", + "default": "./index.js" + }, + "./package.json": "./package.json" + }, + "scripts": { + "build": "farm-plugin-tools build --platform --cargo-name farmfe_plugin_replace_dirname -p farmfe_plugin_replace_dirname --release", + "build:publish": "cross-env CARGO_PROFILE_RELEASE_LTO=fat CARGO_PROFILE_RELEASE_STRIP=symbols CARGO_PROFILE_RELEASE_PANIC=abort CARGO_PROFILE_RELEASE_OPT_LEVEL=z farm-plugin-tools build --platform --cargo-name farmfe_plugin_replace_dirname -p farmfe_plugin_replace_dirname --release", + "prepublishOnly": "farm-plugin-tools prepublish" + }, + "files": [ + "index.js", + "index.d.ts", + "func.js" + ] +} diff --git a/rust-plugins/replace-dirname/rustfmt.toml b/rust-plugins/replace-dirname/rustfmt.toml new file mode 100755 index 0000000000..cab5731eda --- /dev/null +++ b/rust-plugins/replace-dirname/rustfmt.toml @@ -0,0 +1,2 @@ +tab_spaces = 2 +edition = "2021" diff --git a/rust-plugins/replace-dirname/src/lib.rs b/rust-plugins/replace-dirname/src/lib.rs new file mode 100644 index 0000000000..c67e7aa3c5 --- /dev/null +++ b/rust-plugins/replace-dirname/src/lib.rs @@ -0,0 +1,152 @@ +// 2024-8-21 farmfe_core: 0.6.4 +#![deny(clippy::all)] + +use farmfe_core::{ + config::{config_regex::ConfigRegex, Config}, + context::CompilationContext, + error::CompilationError, + module::ModuleMetaData, + plugin::{Plugin, PluginProcessModuleHookParam}, + swc_common::DUMMY_SP, + swc_ecma_ast::{Callee, Expr, Lit, MemberExpr, MemberProp, MetaPropKind, Module, Str}, +}; +use std::{env, path::Path, sync::Arc}; +use url::Url; + +use farmfe_macro_plugin::farm_plugin; +use farmfe_toolkit::{ + plugin_utils::path_filter::PathFilter, + swc_ecma_visit::{VisitMut, VisitMutWith}, +}; + +#[farm_plugin] +pub struct FarmPluginReplaceDirname { + options: ReplaceDirnameOptions, +} + +#[derive(serde::Deserialize)] +pub struct ReplaceDirnameOptions { + exclude: Vec, + include: Vec, +} + +impl Default for ReplaceDirnameOptions { + fn default() -> Self { + Self { + exclude: vec![ConfigRegex::new("node_modules/")], + include: vec![], + } + } +} + +impl FarmPluginReplaceDirname { + fn new(_: &Config, options: String) -> Self { + let options: ReplaceDirnameOptions = serde_json::from_str(&options).unwrap_or_default(); + Self { options } + } +} + +impl Plugin for FarmPluginReplaceDirname { + fn name(&self) -> &str { + "FarmPluginReplaceDirname" + } + + fn process_module( + &self, + param: &mut PluginProcessModuleHookParam, + _: &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 file_path = env::current_dir() + .unwrap() + .join(param.module_id.relative_path()); + + let dir_path: &str = Path::new(&file_path) + .parent() + .map_or("", |p| p.to_str().unwrap_or("")); + + let ast = &mut param.meta.as_script_mut().ast; + + replace_dirname_with_ast(ast, dir_path, file_path.to_str().unwrap()); + Ok(Some(())) + } +} + +pub fn replace_dirname_with_ast(ast: &mut Module, dir_path: &str, file_path: &str) { + struct ReplaceLibVisitor<'a> { + dir_path: &'a str, + file_path: &'a str, + } + + impl VisitMut for ReplaceLibVisitor<'_> { + fn visit_mut_expr(&mut self, expr: &mut Expr) { + match expr { + Expr::Ident(ident) => match &*ident.sym { + "__dirname" => { + *expr = Expr::Lit(Lit::Str(Str { + value: self.dir_path.into(), + span: DUMMY_SP, + raw: None, + })); + } + "__filename" => { + *expr = Expr::Lit(Lit::Str(Str { + value: self.file_path.into(), + span: DUMMY_SP, + raw: None, + })); + } + _ => {} + }, + + Expr::Call(call_expr) => { + for arg in &mut call_expr.args { + self.visit_mut_expr(&mut arg.expr); + } + + if let Callee::Expr(expr) = &mut call_expr.callee { + self.visit_mut_expr(expr); + } + } + + Expr::Member(MemberExpr { obj, prop, .. }) => { + // #2062 + self.visit_mut_expr(obj); + if let Expr::MetaProp(meta_prop) = &**obj { + if meta_prop.kind == MetaPropKind::ImportMeta { + if let MemberProp::Ident(ident) = &prop { + if ident.sym == "url" { + if let Ok(file_path) = Url::from_file_path(self.file_path) { + *expr = Expr::Lit(Lit::Str(Str { + value: file_path.to_string().into(), + span: DUMMY_SP, + raw: None, + })); + } + } + } + } + } + } + _ => { + expr.visit_mut_children_with(self); + } + } + } + } + + let mut visitor = ReplaceLibVisitor { + dir_path, + file_path, + }; + + ast.visit_mut_with(&mut visitor); +} diff --git a/rust-plugins/sass/CHANGELOG.md b/rust-plugins/sass/CHANGELOG.md index 84f6ce3610..09cf0f54bb 100755 --- a/rust-plugins/sass/CHANGELOG.md +++ b/rust-plugins/sass/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 2.0.0-nightly-20241022124925 + +### Major Changes + +- 6a1038c: update nightly tag + ## 1.1.0 ### Minor Changes diff --git a/rust-plugins/sass/Cargo.toml b/rust-plugins/sass/Cargo.toml index a090356061..5fba30f0bd 100755 --- a/rust-plugins/sass/Cargo.toml +++ b/rust-plugins/sass/Cargo.toml @@ -9,7 +9,6 @@ crate-type = ["cdylib", "rlib"] [dependencies] farmfe_core = { version = "*", path = "../../crates/core" } farmfe_macro_plugin = { version = "*", path = "../../crates/macro_plugin" } -farmfe_toolkit_plugin_types = { version = "*", path = "../../crates/toolkit_plugin_types" } farmfe_toolkit = { path = "../../crates/toolkit" } farmfe_utils = { path = "../../crates/utils" } sass-embedded = { version = "0.7.1", features = ["legacy", "serde"] } diff --git a/rust-plugins/sass/package.json b/rust-plugins/sass/package.json index 5640bdb0c5..c0074279a0 100755 --- a/rust-plugins/sass/package.json +++ b/rust-plugins/sass/package.json @@ -1,6 +1,6 @@ { "name": "@farmfe/plugin-sass", - "version": "1.1.0", + "version": "2.0.0-nightly-20241022124925", "main": "index.js", "types": "index.d.ts", "type": "module", diff --git a/rust-plugins/sass/src/lib.rs b/rust-plugins/sass/src/lib.rs index 06ac3f0545..5def700bc9 100755 --- a/rust-plugins/sass/src/lib.rs +++ b/rust-plugins/sass/src/lib.rs @@ -1,6 +1,6 @@ #![deny(clippy::all)] #![allow(clippy::result_large_err)] -use std::{collections::HashMap, str::FromStr}; +use std::str::FromStr; use farmfe_core::{ config::Config, @@ -9,6 +9,7 @@ use farmfe_core::{ plugin::{Plugin, PluginHookContext, PluginResolveHookParam, ResolveKind}, relative_path::RelativePath, serde_json::{self, Value}, + HashMap, }; use farmfe_macro_plugin::farm_plugin; use farmfe_toolkit::{ @@ -107,29 +108,30 @@ fn resolve_importer( root_importer: &ModuleId, context: &Arc, ) -> Result, Exception> { - if let Ok(file_path) = PathBuf::from_str(&url) { - let try_prefix_list = ["_"]; + let file_path = match PathBuf::from_str(&url) { + Ok(path) => path, + Err(_) => return Ok(None), + }; - let default_import_result = - resolve_importer_with_prefix(file_path.clone(), "", root_importer, context); + let try_prefix_list = ["_"]; - if matches!(default_import_result, Ok(Some(_))) { - return default_import_result; - } + let default_import_result = + resolve_importer_with_prefix(file_path.clone(), "", root_importer, context); - for prefix in try_prefix_list { - let resolved_path = - resolve_importer_with_prefix(file_path.clone(), prefix, root_importer, context); + if matches!(default_import_result, Ok(Some(_))) { + return default_import_result; + } - if matches!(resolved_path, Ok(Some(_))) { - return resolved_path; - } - } + for prefix in try_prefix_list { + let resolved_path = + resolve_importer_with_prefix(file_path.clone(), prefix, root_importer, context); - return default_import_result; - }; + if matches!(resolved_path, Ok(Some(_))) { + return resolved_path; + } + } - Ok(None) + default_import_result } impl ImporterCollection { @@ -448,7 +450,7 @@ fn get_options( builder = builder.style(output_style); } - let mut additional_data = HashMap::new(); + let mut additional_data = HashMap::default(); // TODO support sourcemap for additionalData if let Some(additional_date) = options.get("additionalData") { additional_data.insert( diff --git a/rust-plugins/sass/tests/mod.rs b/rust-plugins/sass/tests/mod.rs index c63783aa66..fd5eae6a46 100755 --- a/rust-plugins/sass/tests/mod.rs +++ b/rust-plugins/sass/tests/mod.rs @@ -1,14 +1,15 @@ -use std::{collections::HashMap, fs, io::Write, path::PathBuf, sync::Arc}; +use std::{fs, io::Write, path::PathBuf, sync::Arc}; use farmfe_compiler::Compiler; use farmfe_core::{ config::{ - bool_or_obj::BoolOrObj, preset_env::PresetEnvConfig, Config, ResolveConfig, RuntimeConfig, - SourcemapConfig, + bool_or_obj::BoolOrObj, preset_env::PresetEnvConfig, AliasItem, Config, ResolveConfig, + RuntimeConfig, SourcemapConfig, StringOrRegex, }, context::CompilationContext, module::ModuleType, plugin::{Plugin, PluginTransformHookParam}, + HashMap, }; use farmfe_plugin_sass::FarmPluginSass; use farmfe_testing_helpers::{fixture, is_update_snapshot_from_env}; @@ -19,7 +20,7 @@ fn test() { fixture!("tests/fixtures/index.scss", |file, _cwd| { let resolved_path = file.to_string_lossy().to_string(); let config = Config { - input: HashMap::from([("button".to_string(), resolved_path.clone())]), + input: HashMap::from_iter([("button".to_string(), resolved_path.clone())]), ..Default::default() }; let plugin = Arc::new(FarmPluginSass::new( @@ -41,7 +42,7 @@ fn test() { content, module_type: ModuleType::Custom(String::from("sass")), query: vec![], - meta: HashMap::from([]), + meta: HashMap::from_iter([]), module_id: resolved_path.clone(), source_map_chain: vec![], }, @@ -74,7 +75,7 @@ fn test_with_compiler() { .to_string_lossy() .to_string(); let config = Config { - input: HashMap::from([("index".to_string(), resolved_path.clone())]), + input: HashMap::from_iter([("index".to_string(), resolved_path.clone())]), root: cwd.to_string_lossy().to_string(), runtime: Box::new(RuntimeConfig { path: runtime_path, @@ -87,10 +88,10 @@ fn test_with_compiler() { tree_shaking: Box::new(BoolOrObj::Bool(false)), progress: false, resolve: Box::new(ResolveConfig { - alias: std::collections::HashMap::from([( - "@".to_string(), - cwd.to_string_lossy().to_string(), - )]), + alias: vec![AliasItem::Complex { + find: StringOrRegex::String("@".to_string()), + replacement: cwd.to_string_lossy().to_string(), + }], ..Default::default() }), ..Default::default() diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 0eb96b51af..4e5de48e8f 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2024-04-16" +channel = "nightly-2024-10-07" components = ["clippy", "rustfmt", "rust-src", "rustc-dev"] diff --git a/scripts/bootstrap.mjs b/scripts/bootstrap.mjs index a47ebcc017..b728033869 100644 --- a/scripts/bootstrap.mjs +++ b/scripts/bootstrap.mjs @@ -1,3 +1,11 @@ -import { runTaskQueue } from './build.mjs'; +import { + runTaskQueue, + cleanBundleCommand, + installDependencies, + executeStartProject, +} from "./build.mjs"; +await installDependencies(); +await cleanBundleCommand(); await runTaskQueue(); +await executeStartProject(); diff --git a/scripts/build.mjs b/scripts/build.mjs index 606ab1e2dd..f4710e92db 100644 --- a/scripts/build.mjs +++ b/scripts/build.mjs @@ -1,63 +1,103 @@ -import fs, { existsSync } from 'node:fs'; -import os from 'node:os'; -import { join, resolve } from 'node:path'; -import { execa } from 'execa'; -import { createSpinner } from 'nanospinner'; +import fs, { existsSync } from "node:fs"; +import os from "node:os"; +import { join, resolve } from "node:path"; +import { execa } from "execa"; +import { createSpinner } from "nanospinner"; -import { logger } from './logger.mjs'; +import { logger } from "./logger.mjs"; -export const DEFAULT_PACKAGE_MANAGER = 'pnpm'; -const DEFAULT_HOMEBREW_PACKAGE_MANAGER = 'brew'; -const DEFAULT_LINUX_PACKAGE_MANAGER = 'apt'; +// Display verbose output +const isVerbose = + process.argv.includes("--verbose") || process.argv.includes("-v"); + +export const DEFAULT_PACKAGE_MANAGER = "pnpm"; +const DEFAULT_HOMEBREW_PACKAGE_MANAGER = "brew"; +const DEFAULT_LINUX_PACKAGE_MANAGER = "apt"; const CWD = process.cwd(); // Build the compiler binary -const PKG_CORE = resolve(CWD, './packages/core'); +const PKG_CORE = resolve(CWD, "./packages/core"); // Build cli -const PKG_CLI = resolve(CWD, './packages/cli'); +const PKG_CLI = resolve(CWD, "./packages/cli"); -const PKG_RUNTIME = resolve(CWD, './packages/runtime'); +const PKG_RUNTIME = resolve(CWD, "./packages/runtime"); -const PKG_RUNTIME_PLUGIN_HMR = resolve( - CWD, - './packages/runtime-plugin-hmr' -); +const PKG_RUNTIME_PLUGIN_HMR = resolve(CWD, "./packages/runtime-plugin-hmr"); const PKG_RUNTIME_PLUGIN_IMPORT_META = resolve( CWD, - './packages/runtime-plugin-import-meta' + "./packages/runtime-plugin-import-meta", ); // Build plugin-tools -const PKG_PLUGIN_TOOLS = resolve(CWD, './packages/plugin-tools'); +const PKG_PLUGIN_TOOLS = resolve(CWD, "./packages/plugin-tools"); // Build plugin dts -const PKG_DTS = resolve(CWD, './js-plugins/dts'); +const PKG_DTS = resolve(CWD, "./js-plugins/dts"); + +// Build ReplaceDirnamePlugin +const PKG_REPLACE_DIRNAME_PLUGIN = resolve( + CWD, + "./rust-plugins/replace-dirname", +); // Build rust_plugin_react -const PKG_RUST_PLUGIN = resolve(CWD, './rust-plugins'); +const PKG_RUST_PLUGIN = resolve(CWD, "./rust-plugins"); // Build js_plugin_path -export const JS_PLUGINs_DIR = resolve(CWD, './js-plugins'); -export const EXAMPLES_DIR = resolve(CWD, './examples'); +export const JS_PLUGINS_DIR = resolve(CWD, "./js-plugins"); +export const EXAMPLES_DIR = resolve(CWD, "./examples"); + +export const excludedJsPlugin = ["dts"]; + +const skipExamples = [ + // circle build when run `pnpm run build` + "electron", + // @swc/plugin-emotion version conflict + "emotion", + // solid js plugin alias compatible + "solid", + "solid-ssr", + // tree shake failed when farm build + "vanilla-extract", +]; + +export const installDependencies = async () => + runTask( + "dependencies", + async () => + await execa(DEFAULT_PACKAGE_MANAGER, ["install"], { + cwd: CWD, + stdio: isVerbose ? "inherit" : "ignore", + }), + "Installing", + "Install", + ); -export const excludedJsPlugin = ['dts']; +export const executeStartProject = async () => + execa(DEFAULT_PACKAGE_MANAGER, ["start"], { + cwd: CWD, + stdio: "inherit", + }); export const buildExamples = async () => { - const examples = fs.readdirSync('./examples'); - console.log('Building', examples.length, 'examples...'); + const examples = fs.readdirSync("./examples"); + console.log("Building", examples.length, "examples..."); for (const example of examples) { - const examplePath = join('./examples', example); - if (!existsSync(join(examplePath, 'package.json'))) { + const examplePath = join("./examples", example); + if ( + !existsSync(join(examplePath, "package.json")) || + skipExamples.includes(example) + ) { continue; } - console.log('Building', examplePath); + console.log("Building", examplePath); if (fs.statSync(examplePath).isDirectory()) { - await execa('npm', ['run', 'build'], { - cwd: examplePath + await execa("npm", ["run", "build"], { + cwd: examplePath, }); } } @@ -66,121 +106,253 @@ export const buildExamples = async () => { export async function runTaskQueue() { // The sass plug-in uses protobuf, so you need to determine whether the user installs it or not. await installProtoBuf(); - await runTask('Cli', buildCli); - await runTask('Runtime', buildRuntime); - await runTask('Core', buildCore); - await runTask('PluginTools', buildPluginTools); - await runTask('RustPlugins', buildRustPlugins); - await runTask('JsPlugins', buildJsPlugins); - await runTask('Artifacts', copyArtifacts); + await runTask("Cli", buildCli); + await runTask("Runtime", buildRuntime); + await runTask("PluginTools", buildPluginTools); + await runTask("Core", buildCore); + await runTask("RustPlugins", buildRustPlugins); + await runTask("JsPlugins", buildJsPlugins); + await runTask("Artifacts", copyArtifacts); } // install mac protobuf export const installMacProtobuf = () => - execa(DEFAULT_HOMEBREW_PACKAGE_MANAGER, ['install', 'protobuf'], { - cwd: CWD + execa(DEFAULT_HOMEBREW_PACKAGE_MANAGER, ["install", "protobuf"], { + cwd: CWD, }); // install linux protobuf -export const installLinuxProtobuf = async () => { - try { - await execa('type', DEFAULT_LINUX_PACKAGE_MANAGER); - } catch (_) { - return Promise.reject( - `not found "${DEFAULT_LINUX_PACKAGE_MANAGER}", if it's not your package manager, please install "protobuf" manually.` - ); - } - - return execa( - DEFAULT_LINUX_PACKAGE_MANAGER, - ['install', '-y', 'protobuf-compiler'], - { - cwd: CWD +export const installLinuxProtobuf = async (spinner) => { + if (isDebianSeries()) { + try { + await execa("type", DEFAULT_LINUX_PACKAGE_MANAGER); + return execa( + DEFAULT_LINUX_PACKAGE_MANAGER, + ["install", "-y", "protobuf-compiler"], + { + cwd: CWD, + }, + ); + } catch { + return Promise.reject( + `not found "${DEFAULT_LINUX_PACKAGE_MANAGER}", if it's not your package manager, please install "protobuf" manually.`, + ); } - ); + } else if (isArchLinux()) { + try { + await execa("which", ["pacman"]); + let result; + if (process.getuid() == 0) { + result = execa("pacman", ["-Sy", "protobuf"], { + cwd: CWD, + input: "y\n", + }); + } else { + spinner.stop(); + result = await execa("sudo", ["pacman", "-Sy", "protobuf"], { + cwd: CWD, + stdin: "inherit", + stdout: "inherit", + stderr: "inherit", + }); + spinner.start(); + } + return result; + } catch { + return Promise.reject( + `not found "pacman", if it's not your package manager, please install "protobuf" manually.`, + ); + } + } else { + spinner.warn({ + text: `Unknown Linux distribution, trying to use "apt"...`, + }); + try { + await execa("type", DEFAULT_LINUX_PACKAGE_MANAGER); + return execa( + DEFAULT_LINUX_PACKAGE_MANAGER, + ["install", "-y", "protobuf-compiler"], + { + cwd: CWD, + }, + ); + } catch { + return Promise.reject(``); + } + } }; // build core command export const buildCore = () => - execa(DEFAULT_PACKAGE_MANAGER, ['build:rs'], { - cwd: PKG_CORE - }).then(buildCoreCjs); + execa(DEFAULT_PACKAGE_MANAGER, ["build:rs"], { + cwd: PKG_CORE, + stdio: isVerbose ? "inherit" : "ignore", + }) + .then(buildReplaceDirnamePlugin) + .then(buildCoreCjs); export const buildCoreCjs = () => - execa(DEFAULT_PACKAGE_MANAGER, ['build:cjs'], { - cwd: PKG_CORE + execa(DEFAULT_PACKAGE_MANAGER, ["build:cjs"], { + cwd: PKG_CORE, }); // build cli command export const buildCli = () => - execa(DEFAULT_PACKAGE_MANAGER, ['build'], { - cwd: PKG_CLI + execa(DEFAULT_PACKAGE_MANAGER, ["build"], { + cwd: PKG_CLI, }); export const buildRuntime = async () => { - await execa(DEFAULT_PACKAGE_MANAGER, ['build'], { - cwd: PKG_RUNTIME - }) + await execa(DEFAULT_PACKAGE_MANAGER, ["build"], { + cwd: PKG_RUNTIME, + }); return Promise.all([ - execa(DEFAULT_PACKAGE_MANAGER, ['build'], { - cwd: PKG_RUNTIME_PLUGIN_HMR + execa(DEFAULT_PACKAGE_MANAGER, ["build"], { + cwd: PKG_RUNTIME_PLUGIN_HMR, }), - execa(DEFAULT_PACKAGE_MANAGER, ['build'], { - cwd: PKG_RUNTIME_PLUGIN_IMPORT_META - }) - ]) -} + execa(DEFAULT_PACKAGE_MANAGER, ["build"], { + cwd: PKG_RUNTIME_PLUGIN_IMPORT_META, + }), + ]); +}; // build farm-plugin-tools export const buildPluginTools = () => - execa(DEFAULT_PACKAGE_MANAGER, ['build'], { - cwd: PKG_PLUGIN_TOOLS + execa(DEFAULT_PACKAGE_MANAGER, ["build"], { + cwd: PKG_PLUGIN_TOOLS, }); // build dts command export const buildDts = () => - execa(DEFAULT_PACKAGE_MANAGER, ['build'], { - cwd: PKG_DTS + execa(DEFAULT_PACKAGE_MANAGER, ["build"], { + cwd: PKG_DTS, + }); + +export const buildReplaceDirnamePlugin = () => + execa(DEFAULT_PACKAGE_MANAGER, ["build"], { + cwd: PKG_REPLACE_DIRNAME_PLUGIN, }); // build rust plugins export const rustPlugins = () => batchBuildPlugins(PKG_RUST_PLUGIN); -// // build js plugins -// export const jsPlugins = () => batchBuildPlugins(PKG_JS_PLUGIN); +export const buildJsPlugins = async (spinner) => { + const jsPluginDirs = fs.readdirSync(JS_PLUGINS_DIR).filter((file) => { + return ( + fs.statSync(join(JS_PLUGINS_DIR, file)).isDirectory() && + !excludedJsPlugin.includes(file) + ); + }); + + const total = jsPluginDirs.length; + console.log("\n"); + logger(`Found ${total} JS plugins to build \n`, { + color: "yellow", + title: "Javascript Info", + }); + await buildDts(); + for (const pluginDir of jsPluginDirs) { + const pluginPath = resolve(JS_PLUGINS_DIR, pluginDir); + await runTask( + `Js plugin: ${pluginDir}`, + async (spinner) => { + try { + if (!existsSync(join(pluginPath, "package.json"))) { + spinner.warn({ + text: `Skipping ${pluginDir}: No package.json found`, + }); + return; + } + await execa(DEFAULT_PACKAGE_MANAGER, ["build"], { + cwd: pluginPath, + stdio: isVerbose ? "inherit" : "ignore", + }); + + spinner.success({ + text: `📦 JS plugin \x1b[32m${pluginDir}\x1b[0m built successfully.`, + }); + } catch (error) { + spinner.error({ text: `Failed to build JS plugin: ${pluginDir}` }); + throw error; + } + }, + "Building", + "Build", + spinner, + false, + ); + } +}; -// build chain -export const buildJsPlugins = async () => { - await execa( - DEFAULT_PACKAGE_MANAGER, - ['--filter', './js-plugins/**', 'build'], - { - cwd: CWD - } - ); +export const buildRustPlugins = async (spinner) => { + const filterPlugins = ["replace-dirname"]; - // // First, build Dts - // await buildDts(); + const rustPluginDirs = fs.readdirSync(PKG_RUST_PLUGIN).filter((file) => { + return fs.statSync(join(PKG_RUST_PLUGIN, file)).isDirectory(); + }); - // // Then, build other js plugins - // await Promise.all(jsPlugins()); -}; + const buildPlugins = rustPluginDirs.filter( + (item) => !filterPlugins.includes(item), + ); -export const buildRustPlugins = () => Promise.all(rustPlugins()); + const total = buildPlugins.length; + console.log("\n"); + logger(`Found ${total} Rust plugins to build \n`, { + color: "rust", + title: "Rust Info", + }); + for (const pluginDir of buildPlugins) { + const pluginPath = resolve(PKG_RUST_PLUGIN, pluginDir); + await runTask( + `Rust plugin: ${pluginDir}`, + async (spinner) => { + try { + if (!existsSync(join(pluginPath, "Cargo.toml"))) { + spinner.warn({ + text: `Skipping ${pluginDir}: No Cargo.toml found`, + }); + return; + } + + await execa("npm", ["run", "build"], { + cwd: pluginPath, + stdio: isVerbose ? "inherit" : "ignore", + }); + + spinner.success({ + text: `📦 Rust plugin \x1b[32m${pluginDir}\x1b[0m compiled successfully.`, + }); + } catch (error) { + spinner.error({ text: `Failed to build Rust plugin: ${pluginDir}` }); + throw error; + } + }, + "Building", + "Build", + spinner, + false, + ); + } +}; -export const copyArtifacts = () => - batchBuildPlugins(PKG_RUST_PLUGIN, 'copy-artifacts'); +export const copyArtifacts = (_) => + batchBuildPlugins(PKG_RUST_PLUGIN, "copy-artifacts"); export async function runTask( taskName, task, - processText = 'Building', - finishedText = 'Build' + processText = "Building", + finishedText = "Build", + spinner = createSpinner(), + showSuccess = true, ) { - const spinner = createSpinner(`${processText} ${taskName}`).start(); try { - await task(); - spinner.success({ text: `${finishedText} ${taskName} completed!` }); + await task(spinner.start({ text: `${processText} ${taskName}` })); + showSuccess + ? spinner.success({ + text: `✨ ✨ ${finishedText} ${taskName} completed! `, + }) + : spinner.reset(); } catch (e) { spinner.error({ text: `${finishedText} ${taskName} failed!` }); console.error(e.toString()); @@ -190,7 +362,7 @@ export async function runTask( export function resolveNodeVersion() { const currentVersion = process.versions.node; - const requiredMajorVersion = parseInt(currentVersion.split('.')[0], 10); + const requiredMajorVersion = parseInt(currentVersion.split(".")[0], 10); const minimumMajorVersion = 16; if (requiredMajorVersion < minimumMajorVersion) { @@ -202,8 +374,8 @@ export function resolveNodeVersion() { export function batchBuildPlugins( baseDir, - command = 'build', - packageManager = 'pnpm' + command = "build", + packageManager = "pnpm", ) { const pluginNameMap = fs.readdirSync(baseDir).filter((file) => { return ( @@ -219,17 +391,56 @@ export function batchBuildPlugins( export function isMac() { const platform = os.platform(); - return platform === 'darwin'; + return platform === "darwin"; } export function isLinux() { const platform = os.platform(); - return platform === 'linux'; + return platform === "linux"; } export function isWindows() { const platform = os.platform(); - return platform === 'win32'; + return platform === "win32"; +} + +export function getLinuxDistribution() { + const data = fs.readFileSync("/etc/os-release", { + encoding: "utf8", + }); + + const config = {}; + const lines = data.split("\n"); + + lines.forEach((line) => { + const trimmedLine = line.trim(); + if (trimmedLine && !trimmedLine.startsWith("#")) { + const [key, value] = trimmedLine.split("="); + const cleanKey = key.trim(); + const cleanValue = value.trim().replace(/"/g, ""); + + config[cleanKey] = cleanValue; + } + }); + + return config.ID; +} + +export function isArchLinux() { + return getLinuxDistribution() === "arch"; +} + +export function isDebianSeries() { + const distro = getLinuxDistribution().toLowerCase(); + return ( + distro === "debian" || + distro === "ubuntu" || + distro === "linuxmint" || + distro === "raspbian" || + distro === "kali" || + distro === "deepin" || + distro === "pop" + ); } export async function checkProtobuf() { @@ -238,9 +449,9 @@ export async function checkProtobuf() { const isLinuxFlag = isLinux(); try { if (isWindowsFlag) { - await execa('where', ['protoc']); + await execa("where", ["protoc"]); } else if (isMacFlag || isLinuxFlag) { - await execa('which', ['protoc']); + await execa("which", ["protoc"]); } return true; } catch { @@ -252,43 +463,50 @@ export async function installProtoBuf() { const installFlag = await checkProtobuf(); if (!installFlag) { logger( - 'Due to the use of protoc in the project, we currently judge that you have not installed. we need to install protobuf locally to make the project start successfully. \n\n- For mac users, will be use your local `homebrew` tool for installation. (First, Make sure your computer has `homebrew` installed) \n- For linux users, we will use your local `apt` tool for installation. (First, Make sure your computer has `apt` installed) \n- For Windows users, because the protobuf plugin cannot be installed automatically, You need to install manually according to the prompts \n', - { title: 'FARM WARN', color: 'yellow' } + "Due to the use of protoc in the project, we currently judge that you have not installed. " + + "We need to install protobuf locally to make the project start successfully. \n\n" + + "- For MacOS users, will be use your local `homebrew` tool for installation. (First, Make sure your computer has `homebrew` installed) \n" + + "- For Debian-based Linux users, we will use your local `apt` tool for installation. (First, Make sure your computer has `apt` installed) \n" + + "- For Arch Linux users, we will use your local `pacman` tool for installation. (First, Make sure your computer has `pacman` installed) \n" + + "- For other Linux users, we will try to use your local `apt` tool for installation. (If exists) \n" + + "- For Windows users, because the protobuf plugin cannot be installed automatically, You need to install manually according to the prompts \n", + { title: "FARM WARN", color: "yellow" }, ); if (isMac()) { - await runTask('Protobuf', installMacProtobuf, 'Install', 'Install'); + await runTask("Protobuf", installMacProtobuf, "Installing", "Install"); } else if (isLinux()) { - await runTask('Protobuf', installLinuxProtobuf, 'Install', 'Install'); + await runTask("Protobuf", installLinuxProtobuf, "Installing", "Install"); } if (isWindows()) { logger( - 'If you are using a windows system, you can install it in the following ways:\n\n 1. open https://github.com/protocolbuffers/protobuf \n If you are a 32-bit operating system install https://github.com/protocolbuffers/protobuf/releases/download/v21.7/protoc-21.7-win32.zip \n If you are a 64-bit operating system install https://github.com/protocolbuffers/protobuf/releases/download/v21.7/protoc-21.7-win64.zip \n 2. After installation, find the path you installed, and copy the current path, adding to the environment variable of windows \n\n Or you can directly check out the following article to install \n https://www.geeksforgeeks.org/how-to-install-protocol-buffers-on-windows/', - { title: 'FARM TIPS', color: 'yellow' } + "If you are using a windows system, you can install it in the following ways:\n\n 1. open https://github.com/protocolbuffers/protobuf \n If you are a 32-bit operating system install https://github.com/protocolbuffers/protobuf/releases/download/v21.7/protoc-21.7-win32.zip \n If you are a 64-bit operating system install https://github.com/protocolbuffers/protobuf/releases/download/v21.7/protoc-21.7-win64.zip \n 2. After installation, find the path you installed, and copy the current path, adding to the environment variable of windows \n\n Or you can directly check out the following article to install \n https://www.geeksforgeeks.org/how-to-install-protocol-buffers-on-windows/", + { title: "FARM TIPS", color: "yellow" }, ); process.exit(1); } } else { - console.log(''); - logger('Protobuf has been installed, skipping installation. \n'); + console.log(""); + logger("Protobuf has been installed, skipping installation. \n"); } } export async function cleanBundleCommand() { try { await execa(DEFAULT_PACKAGE_MANAGER, [ - '-r', - '--filter=./packages/*', - '--filter=./js-plugins/*', - 'run', - 'clean' + "-r", + "--filter=./packages/*", + "--filter=./js-plugins/*", + "run", + "clean", ]); - logger('pnpm clean command completed successfully.'); + console.log('') + logger("pnpm clean command completed successfully."); } catch (error) { - logger('An error occurred while running pnpm clean command:', { + logger("An error occurred while running pnpm clean command:", { title: error.message, - color: 'red' + color: "red", }); process.exit(1); } diff --git a/scripts/bump-nightly.mjs b/scripts/bump-nightly.mjs new file mode 100644 index 0000000000..02b63c473a --- /dev/null +++ b/scripts/bump-nightly.mjs @@ -0,0 +1,7 @@ +import { execSync } from "child_process"; + +execSync(`npx changeset version --snapshot nightly`, { + stdio: "inherit", +}); + +execSync("pnpm install --no-frozen-lockfile", { stdio: "inherit" }); diff --git a/scripts/logger.mjs b/scripts/logger.mjs index 335b0882e3..83d5dbc262 100644 --- a/scripts/logger.mjs +++ b/scripts/logger.mjs @@ -1,5 +1,5 @@ export function logger(msg, { title = 'FARM INFO', color = 'green' } = {}) { - const COLOR_CODE = [ + const BASIC_COLORS = [ 'black', 'red', 'green', @@ -8,11 +8,41 @@ export function logger(msg, { title = 'FARM INFO', color = 'green' } = {}) { 'magenta', 'cyan', 'white' - ].indexOf(color); + ]; + + const EXTENDED_COLORS = { + orange: 208 + }; + + const CUSTOM_COLORS = { + rust: { r: 183, g: 65, b: 14 } + }; + + const COLOR_CODE = BASIC_COLORS.indexOf(color); + const EXTENDED_COLOR_CODE = EXTENDED_COLORS[color]; + const CUSTOM_COLOR = CUSTOM_COLORS[color]; + + let colorCodeStr = ''; + let titleStr = ''; + if (COLOR_CODE >= 0) { - const TITLE_STR = title ? `\x1b[4${COLOR_CODE};30m ${title} \x1b[0m ` : ''; - console.log(`${TITLE_STR}\x1b[3${COLOR_CODE}m${msg}\x1b[;0m`); + colorCodeStr = `\x1b[3${COLOR_CODE}m`; + titleStr = title ? `\x1b[4${COLOR_CODE};30m ${title} \x1b[0m ` : ''; + } else if (EXTENDED_COLOR_CODE !== undefined) { + colorCodeStr = `\x1b[38;5;${EXTENDED_COLOR_CODE}m`; + titleStr = title ? `\x1b[48;5;${EXTENDED_COLOR_CODE}m\x1b[30m ${title} \x1b[0m ` : ''; + } else if (CUSTOM_COLOR) { + const { r, g, b } = CUSTOM_COLOR; + colorCodeStr = `\x1b[38;2;${r};${g};${b}m`; + titleStr = title ? `\x1b[48;2;${r};${g};${b}m\x1b[30m ${title} \x1b[0m ` : ''; } else { - console.log(title ? `${title} ${msg}` : msg); + colorCodeStr = ''; + titleStr = title ? `${title} ` : ''; + } + + if (colorCodeStr) { + console.log(`${titleStr}${colorCodeStr}${msg}\x1b[0m`); + } else { + console.log(`${titleStr}${msg}`); } } diff --git a/scripts/ready.mjs b/scripts/ready.mjs index fc2adae2fb..72303ce463 100644 --- a/scripts/ready.mjs +++ b/scripts/ready.mjs @@ -1,57 +1,57 @@ -import os from 'node:os'; -import { execa } from 'execa'; +import os from "node:os"; +import { execa } from "execa"; import { DEFAULT_PACKAGE_MANAGER, buildCoreCjs, buildExamples, - runTaskQueue -} from './build.mjs'; + runTaskQueue, +} from "./build.mjs"; const cwd = process.cwd(); -console.log('Installing dependencies...'); -await execa(DEFAULT_PACKAGE_MANAGER, ['install'], { cwd }); +console.log("Installing dependencies..."); +await execa(DEFAULT_PACKAGE_MANAGER, ["install"], { cwd }); -console.log('Cleaning...'); -await execa('node', ['./scripts/clean.mjs'], { cwd }); +console.log("Cleaning..."); +await execa("node", ["./scripts/clean.mjs"], { cwd }); -console.log('Code Spell lint...'); -await execa('npx', ['cspell', '**', '--gitignore'], { cwd }); +console.log("Code Spell lint..."); +await execa("npx", ["cspell", "**", "--gitignore"], { cwd }); -console.log('build core、js/rust plugins、cli ...'); +console.log("build core、js/rust plugins、cli ..."); await runTaskQueue(); -console.log('Cargo check'); -await execa('cargo', ['check', '--color', 'always', '--all', '--all-targets'], { - cwd +console.log("Cargo check"); +await execa("cargo", ["check", "--color", "always", "--all", "--all-targets"], { + cwd, }); -console.log('Cargo clippy'); -await execa('cargo', ['clippy'], { cwd }); +console.log("Cargo clippy"); +await execa("cargo", ["clippy"], { cwd }); -console.log('TypeScript check'); +console.log("TypeScript check"); await execa( DEFAULT_PACKAGE_MANAGER, - ['run', '--filter', '"@farmfe/*"', 'type-check'], - { cwd } + ["run", "--filter", '"@farmfe/*"', "type-check"], + { cwd }, ); -console.log('Unit Test'); -await execa(DEFAULT_PACKAGE_MANAGER, ['run', 'test'], { cwd }); +console.log("Unit Test"); +await execa(DEFAULT_PACKAGE_MANAGER, ["run", "test"], { cwd }); -console.log('Cargo test'); +console.log("Cargo test"); await execa( - 'cargo', + "cargo", // When there are too many jobs, Out of Memory may appear - ['test', '-j', Math.max(Math.floor(os.cpus().length / 4), 1)], - { cwd } + ["test", "-j", Math.max(Math.floor(os.cpus().length / 4), 1)], + { cwd }, ); -console.log('Building core CJS...'); +console.log("Building core CJS..."); await buildCoreCjs(); -console.log('Building examples'); +console.log("Building examples"); await buildExamples(); -console.log('E2E Test'); -await execa(DEFAULT_PACKAGE_MANAGER, ['run', 'test-e2e'], { cwd }); +console.log("E2E Test"); +await execa(DEFAULT_PACKAGE_MANAGER, ["run", "test-e2e"], { cwd }); diff --git a/scripts/release-nightly.mjs b/scripts/release-nightly.mjs new file mode 100644 index 0000000000..4b0d638c5c --- /dev/null +++ b/scripts/release-nightly.mjs @@ -0,0 +1,20 @@ +import { execSync } from "child_process"; +import { buildCli, buildCoreCjs, buildJsPlugins } from "./build.mjs"; + +// Build node packages +await buildCli(); +await buildCoreCjs(); +await buildJsPlugins(); + +try { + // Set npm config to public access + execSync("npm config set access public", { stdio: "inherit" }); + + // Publish nightly packages + execSync(`npx changeset publish --no-git-tag --tag nightly`, { + stdio: "inherit", + }); +} catch (error) { + console.error(error); + process.exit(1); +} diff --git a/scripts/test-examples.mjs b/scripts/test-examples.mjs index cd4d4bb9ba..fb25d0a396 100644 --- a/scripts/test-examples.mjs +++ b/scripts/test-examples.mjs @@ -3,16 +3,16 @@ import { buildCoreCjs, buildExamples, buildJsPlugins, - buildRuntime -} from './build.mjs'; + buildRuntime, +} from "./build.mjs"; -console.log('Building CLI...'); +console.log("Building CLI..."); await buildCli(); -console.log('Building runtime...'); +console.log("Building runtime..."); await buildRuntime(); -console.log('Building core CJS...'); +console.log("Building core CJS..."); await buildCoreCjs(); -console.log('Building JS plugins...'); +console.log("Building JS plugins..."); await buildJsPlugins(); -console.log('Building examples...'); -await buildExamples(); + +// await buildExamples(); diff --git a/tsconfig.base.json b/tsconfig.base.json index 2d8c3caf1c..eab16b40b5 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -5,15 +5,17 @@ "noUnusedParameters": true, "sourceMap": true, "target": "es2020", - "module": "node16", - "moduleResolution": "node16", "declaration": true, "inlineSources": true, "esModuleInterop": true, + "module": "NodeNext", + "moduleResolution": "NodeNext", "allowSyntheticDefaultImports": true, "noUnusedLocals": true, "skipDefaultLibCheck": true, "skipLibCheck": true, "resolveJsonModule": true, + "allowJs": true, + "checkJs": false } } diff --git a/vitest.workspace.ts b/vitest.workspace.ts new file mode 100644 index 0000000000..fa17c5793b --- /dev/null +++ b/vitest.workspace.ts @@ -0,0 +1,7 @@ +import { defineWorkspace } from 'vitest/config'; + +export default defineWorkspace([ + './vitest.config.e2e.ts', + './vitest.config.ts', + './examples/vite-adapter-vue-sfc-src/vite.config.ts' +]);