diff --git a/.github/actions/binary-limit/action.yml b/.github/actions/binary-limit/action.yml index f7ac45ce62cd..62d157d96360 100644 --- a/.github/actions/binary-limit/action.yml +++ b/.github/actions/binary-limit/action.yml @@ -13,7 +13,7 @@ runs: steps: - name: GitHub Script - uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd + uses: actions/github-script@450193c5abd4cdb17ba9f3ffcfe8f635c4bb6c2a with: script: | const limit = parseInt("${{ inputs.size-threshold }}") || 51200; diff --git a/.github/workflows/ci-diff.yml b/.github/workflows/ci-diff.yml index d74691858933..2d51d7912bec 100644 --- a/.github/workflows/ci-diff.yml +++ b/.github/workflows/ci-diff.yml @@ -11,6 +11,7 @@ on: push: branches: - main + - v2 # Ignore md files in push to skip workflow when only documentation changes paths-ignore: - '**/*.md' diff --git a/.github/workflows/ci-lint.yaml b/.github/workflows/ci-lint.yaml index 405aba004889..aeb85f61280b 100644 --- a/.github/workflows/ci-lint.yaml +++ b/.github/workflows/ci-lint.yaml @@ -9,6 +9,7 @@ on: push: branches: - main + - v2 paths-ignore: - '**/*.md' - 'website/**' @@ -108,7 +109,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5 - - uses: crate-ci/typos@5c19779cb52ea50e151f5a10333ccd269227b5ae # v1.41.0 + - uses: crate-ci/typos@bb4666ad77b539a6b4ce4eda7ebb6de553704021 # v1.42.0 with: files: . diff --git a/.github/workflows/ci-rust.yaml b/.github/workflows/ci-rust.yaml index 632e5d93fcb4..a49675372106 100644 --- a/.github/workflows/ci-rust.yaml +++ b/.github/workflows/ci-rust.yaml @@ -9,6 +9,7 @@ on: push: branches: - main + - v2 paths: - '.github/workflows/**' - 'crates/**' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 054afe635464..d9a5c9043cfb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,6 +15,7 @@ on: push: branches: - main + - v2 paths-ignore: - '**/*.md' - 'website/**' @@ -23,7 +24,7 @@ on: concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} - cancel-in-progress: ${{ github.ref_name != 'main' }} + cancel-in-progress: ${{ github.ref_name != 'main' && github.ref_name != 'v2' }} permissions: # Allow commenting on issues for `reusable-build.yml` diff --git a/.github/workflows/ecosystem-benchmark.yml b/.github/workflows/ecosystem-benchmark.yml index 0080fbd9434e..4f58fd9da3dd 100644 --- a/.github/workflows/ecosystem-benchmark.yml +++ b/.github/workflows/ecosystem-benchmark.yml @@ -10,6 +10,7 @@ on: push: branches: - main + - v2 paths-ignore: - '**/*.md' - 'website/**' diff --git a/.github/workflows/ecosystem-ci.yml b/.github/workflows/ecosystem-ci.yml index bc1fcbe0d67b..9923c9968947 100644 --- a/.github/workflows/ecosystem-ci.yml +++ b/.github/workflows/ecosystem-ci.yml @@ -33,6 +33,7 @@ on: push: branches: - main + - v2 paths-ignore: - '**/*.md' - 'website/**' diff --git a/.github/workflows/reusable-build-bench.yml b/.github/workflows/reusable-build-bench.yml index 430e85a09942..0fc566686e80 100644 --- a/.github/workflows/reusable-build-bench.yml +++ b/.github/workflows/reusable-build-bench.yml @@ -42,7 +42,7 @@ jobs: key: build-bench-${{ inputs.target }} - name: Install cargo-codspeed binary - uses: taiki-e/install-action@0e76c5c569f13f7eb21e8e5b26fe710062b57b62 # v2 + uses: taiki-e/install-action@dfcb1ee29051d97c8d0f2d437199570008fd5612 # v2 with: tool: cargo-codspeed@2.10.1 diff --git a/.github/workflows/reusable-build-codspeed.yml b/.github/workflows/reusable-build-codspeed.yml index e8798ffa7773..763fe288d07f 100644 --- a/.github/workflows/reusable-build-codspeed.yml +++ b/.github/workflows/reusable-build-codspeed.yml @@ -30,7 +30,7 @@ jobs: key: build-bench-${{ inputs.target }} - name: Install cargo-codspeed binary - uses: taiki-e/install-action@0e76c5c569f13f7eb21e8e5b26fe710062b57b62 # v2 + uses: taiki-e/install-action@dfcb1ee29051d97c8d0f2d437199570008fd5612 # v2 with: tool: cargo-codspeed@2.10.1 diff --git a/.github/workflows/reusable-rust-test.yml b/.github/workflows/reusable-rust-test.yml index e6cc480a481c..8dbe0ea44161 100644 --- a/.github/workflows/reusable-rust-test.yml +++ b/.github/workflows/reusable-rust-test.yml @@ -95,7 +95,7 @@ jobs: run: cargo codegen - name: Install cargo-deny - uses: taiki-e/install-action@0e76c5c569f13f7eb21e8e5b26fe710062b57b62 # v2 + uses: taiki-e/install-action@dfcb1ee29051d97c8d0f2d437199570008fd5612 # v2 with: tool: cargo-deny@0.18.3 - name: Check licenses diff --git a/Cargo.lock b/Cargo.lock index 5c18e9e927ab..1d408d7f012d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -191,7 +191,7 @@ checksum = "2eb025ef00a6da925cf40870b9c8d008526b6004ece399cb0974209720f0b194" dependencies = [ "quote", "swc_macros_common", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -202,7 +202,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -213,7 +213,7 @@ checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -230,7 +230,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -455,7 +455,7 @@ checksum = "523363cbe1df49b68215efdf500b103ac3b0fb4836aed6d15689a076eadb8fff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -667,9 +667,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.53" +version = "4.5.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e340e012a1bf4935f5282ed1436d1489548e8f72308207ea5df0e23d2d03f8" +checksum = "c6e6ff9dcd79cff5cd969a17a545d79e84ab086e444102a591e288a8aa3ce394" dependencies = [ "clap_builder", "clap_derive", @@ -677,9 +677,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.53" +version = "4.5.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76b5d13eaa18c901fd2f7fca939fefe3a0727a953561fefdf3b2922b8569d00" +checksum = "fa42cf4d2b7a41bc8f663a7cab4031ebafa1bf3875705bfaf8466dc60ab52c00" dependencies = [ "anstream", "anstyle", @@ -696,7 +696,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -1103,7 +1103,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -1153,7 +1153,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -1164,7 +1164,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -1247,7 +1247,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -1257,7 +1257,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" dependencies = [ "derive_builder_core", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -1277,7 +1277,7 @@ checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", "unicode-xid", ] @@ -1305,7 +1305,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -1403,7 +1403,7 @@ checksum = "1ccd72f8e71e242f71705868f5478fe7592a6e194c06330d8732421ffdbc554c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -1531,7 +1531,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5ff35a391aef949120a0340d690269b3d9f63460a6106e99bd07b961f345ea9" dependencies = [ "swc_macros_common", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -1616,7 +1616,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -1979,7 +1979,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -2122,7 +2122,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -2133,7 +2133,7 @@ checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" dependencies = [ "hermit-abi 0.5.2", "libc", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -2476,7 +2476,7 @@ checksum = "db5b29714e950dbb20d5e6f74f9dcec4edbcc1067bb7f8ed198c097b8c1a818b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -2549,7 +2549,7 @@ checksum = "1bb5c1d8184f13f7d0ccbeeca0def2f9a181bce2624302793005f5ca8aa62e5e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -2587,7 +2587,7 @@ dependencies = [ "napi-derive-backend", "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -2600,7 +2600,7 @@ dependencies = [ "proc-macro2", "quote", "semver", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -2688,7 +2688,7 @@ version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -2973,7 +2973,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -3091,9 +3091,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.104" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9695f8df41bb4f3d222c95a67532365f569318332d03d5f3f67f37b20e6ebdf0" +checksum = "535d180e0ecab6268a3e718bb9fd44db66bbbc256257165fc699dadf70d16fe7" dependencies = [ "unicode-ident", ] @@ -3118,7 +3118,7 @@ dependencies = [ "itertools 0.14.0", "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -3167,7 +3167,7 @@ checksum = "ca414edb151b4c8d125c12566ab0d74dc9cdba36fb80eb7b848c15f495fd32d1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -3190,14 +3190,14 @@ checksum = "938543690519c20c3a480d20a8efcc8e69abeb44093ab1df4e7c1f81f26c677a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] name = "quote" -version = "1.0.42" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" +checksum = "dc74d9a594b72ae6656596548f56f667211f8a97b3d4c3d467150794690dc40a" dependencies = [ "proc-macro2", ] @@ -3315,7 +3315,7 @@ checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -3445,7 +3445,7 @@ checksum = "09cb82b74b4810f07e460852c32f522e979787691b0b7b7439fe473e49d49b2f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -3531,7 +3531,7 @@ checksum = "125d6c4fea52a20e2baaa381c122e111a825ac4c3cccdbb50605805f025d7197" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -3696,7 +3696,7 @@ dependencies = [ "proc-macro2", "quote", "rspack_binding_builder", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -3755,7 +3755,7 @@ name = "rspack_cacheable_macros" version = "0.7.1" dependencies = [ "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -4092,7 +4092,7 @@ version = "0.7.1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -4131,7 +4131,7 @@ version = "0.7.1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -5329,14 +5329,14 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] name = "serde_json" -version = "1.0.148" +version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3084b546a1dd6289475996f182a22aba973866ea8e8b02c51d9f46b1336a22da" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" dependencies = [ "indexmap", "itoa", @@ -5544,7 +5544,7 @@ checksum = "710e9696ef338691287aeb937ee6ffe60022f579d3c8d2fd9d58973a9a10a466" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -5589,7 +5589,7 @@ checksum = "ae36a4951ca7bd1cfd991c241584a9824a70f6aff1e7d4f693fb3f2465e4030e" dependencies = [ "quote", "swc_macros_common", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -5803,7 +5803,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -5888,7 +5888,7 @@ checksum = "e276dc62c0a2625a560397827989c82a93fd545fcf6f7faec0935a82cc4ddbb8" dependencies = [ "proc-macro2", "swc_macros_common", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -6211,7 +6211,7 @@ dependencies = [ "swc_ecma_ast", "swc_ecma_parser", "swc_macros_common", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -6324,7 +6324,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -6499,7 +6499,7 @@ checksum = "c16ce73424a6316e95e09065ba6a207eba7765496fed113702278b7711d4b632" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -6523,7 +6523,7 @@ checksum = "b45db26cc495a8695f8034277ceb6a44e52eb702d6c64ea5c7156dd673ea8c98" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -6626,7 +6626,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f98ef1f87379c816ba7d22351c9fc993af38b034bce4da3286cfe4b17e7ec9e2" dependencies = [ "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -6702,7 +6702,7 @@ checksum = "aae1efbaa74943dc5ad2a2fb16cbd78b77d7e4d63188f3c5b4df2b4dcd2faaae" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -6788,7 +6788,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfd2b4b0adb82e36f2ac688d00a6a67132c7f4170c772617516793a701be89e8" dependencies = [ "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -6826,9 +6826,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.112" +version = "2.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21f182278bf2d2bcb3c88b1b08a37df029d71ce3d3ae26168e3c653b213b99d4" +checksum = "678faa00651c9eb72dd2020cbdf275d92eccb2400d568e419efdd64838145cb4" dependencies = [ "proc-macro2", "quote", @@ -6843,7 +6843,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -6890,7 +6890,7 @@ dependencies = [ "getrandom 0.3.2", "once_cell", "rustix 1.0.8", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -6948,7 +6948,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -6959,7 +6959,7 @@ checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -7049,7 +7049,7 @@ checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -7151,7 +7151,7 @@ checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -7208,9 +7208,9 @@ dependencies = [ [[package]] name = "tracy-client" -version = "0.18.3" +version = "0.18.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91d722a05fe49b31fef971c4732a7d4aa6a18283d9ba46abddab35f484872947" +checksum = "a4f6fc3baeac5d86ab90c772e9e30620fc653bf1864295029921a15ef478e6a5" dependencies = [ "loom", "once_cell", @@ -7316,9 +7316,9 @@ checksum = "81e544489bf3d8ef66c953931f56617f423cd4b5494be343d9b9d3dda037b9a3" [[package]] name = "url" -version = "2.5.7" +version = "2.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" dependencies = [ "form_urlencoded", "idna", @@ -7509,7 +7509,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", "wasm-bindgen-shared", ] @@ -7531,7 +7531,7 @@ checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -7752,7 +7752,7 @@ checksum = "342b0466f92b7217a4de9e114175fedee1907028567d2548bcd42f71a8b5b016" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -7816,7 +7816,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", "witx", ] @@ -7828,7 +7828,7 @@ checksum = "f5872fbe512b73acd514e7ef5bd5aee0ff951a12c1fed0293e1f7992de30df9f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", "wiggle-generate", ] @@ -7946,7 +7946,7 @@ checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -7957,7 +7957,7 @@ checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -8277,7 +8277,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", "synstructure", ] @@ -8308,7 +8308,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -8319,7 +8319,7 @@ checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] @@ -8339,7 +8339,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", "synstructure", ] @@ -8362,7 +8362,7 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.112", + "syn 2.0.113", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 16f09f382df2..0d38140fc954 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,7 @@ bytes = { version = "1.10.0", default-features = false } camino = { version = "1.2.2", default-features = false } cargo_toml = { version = "0.21.0", default-features = false } cfg-if = { version = "1.0.4", default-features = false } -clap = { version = "4.5.53", default-features = false } +clap = { version = "4.5.54", default-features = false } color-backtrace = { version = "0.7.2", default-features = false, features = ["use-backtrace-crate"] } concat-string = { version = "1.0.1", default-features = false } cow-utils = { version = "0.1.3", default-features = false } @@ -72,9 +72,9 @@ paste = { version = "1.0.15", default-features = false } path-clean = { version = "1.0.1", default-features = false } pathdiff = { version = "0.2.3", default-features = false } pretty_assertions = { version = "1.4.1", default-features = false, features = ["std"] } -proc-macro2 = { version = "1.0.104", default-features = false } +proc-macro2 = { version = "1.0.105", default-features = false } prost = { version = "0.13", default-features = false } -quote = { version = "1.0.42", default-features = false } +quote = { version = "1.0.43", default-features = false } rayon = { version = "1.11.0", default-features = false } regex = { version = "1.12.2", default-features = false } regex-syntax = { version = "0.8.8", default-features = false, features = ["std"] } @@ -86,7 +86,7 @@ rustc-hash = { version = "2.1.1", default-features = false } ryu-js = { version = "1.0.2", default-features = false } scopeguard = { version = "1.2.0", default-features = false } serde = { version = "1.0.228", default-features = false, features = ["derive"] } -serde_json = { version = "1.0.148", default-features = false, features = ["std"] } +serde_json = { version = "1.0.149", default-features = false, features = ["std"] } sftrace-setup = { version = "0.1.2", default-features = false } sha2 = { version = "0.10.9", default-features = false } signal-hook = { version = "0.3.18", default-features = false, features = ["iterator"] } @@ -94,7 +94,7 @@ simd-json = { version = "0.17.0", default-features = false } smol_str = { version = "0.3.4", default-features = false } stacker = { version = "0.1.22", default-features = false } sugar_path = { version = "1.2.1", default-features = false, features = ["cached_current_dir"] } -syn = { version = "2.0.112", default-features = false } +syn = { version = "2.0.113", default-features = false } termcolor = { version = "1.4.1", default-features = false } textwrap = { version = "0.16.1", default-features = false } thread_local = { version = "1.1.9", default-features = false } @@ -105,7 +105,7 @@ tracing-subscriber = { version = "0.3.22", default-features = false, features = trybuild = { version = "1.0.114", default-features = false, features = ["diff"] } unicase = { version = "2.8.1", default-features = false } unicode-width = { version = "0.2.2", default-features = false } -url = { version = "2.5.7", default-features = false } +url = { version = "2.5.8", default-features = false } urlencoding = { version = "2.1.3", default-features = false } ustr = { package = "ustr-fxhash", version = "1.0.1", default-features = false } wasmparser = { version = "0.222.0", default-features = false } @@ -149,7 +149,7 @@ swc_experimental_ecma_parser = { version = "0.4.0", default-features = false } swc_experimental_ecma_semantic = { version = "0.4.0", default-features = false } rspack_dojang = { version = "0.1.11", default-features = false } -tracy-client = { version = "=0.18.3", default-features = false, features = [ +tracy-client = { version = "=0.18.4", default-features = false, features = [ "enable", "sampling", "demangle", diff --git a/crates/node_binding/napi-binding.d.ts b/crates/node_binding/napi-binding.d.ts index 0d06f682ea55..11d109d6388f 100644 --- a/crates/node_binding/napi-binding.d.ts +++ b/crates/node_binding/napi-binding.d.ts @@ -1205,6 +1205,8 @@ export interface JsRuntimeModule { moduleIdentifier: string constructorName: string name: string + stage: number + isolate: boolean } export interface JsRuntimeModuleArg { @@ -2781,6 +2783,7 @@ export interface RawRstestPluginOptions { importMetaPathName: boolean hoistMockModule: boolean manualMockRoot: string + preserveNewUrl?: Array } export interface RawRuleSetCondition { diff --git a/crates/rspack_binding_api/src/module.rs b/crates/rspack_binding_api/src/module.rs index 6d90c053ad8e..0448865d1b0e 100644 --- a/crates/rspack_binding_api/src/module.rs +++ b/crates/rspack_binding_api/src/module.rs @@ -745,6 +745,8 @@ pub struct JsRuntimeModule { pub module_identifier: String, pub constructor_name: String, pub name: String, + pub stage: u32, + pub isolate: bool, } #[napi(object, object_from_js = false)] diff --git a/crates/rspack_binding_api/src/module_graph.rs b/crates/rspack_binding_api/src/module_graph.rs index f39fa8cb4755..ab1d1cf853b3 100644 --- a/crates/rspack_binding_api/src/module_graph.rs +++ b/crates/rspack_binding_api/src/module_graph.rs @@ -28,6 +28,11 @@ impl JsModuleGraph { fn as_ref(&self) -> napi::Result<(&'static Compilation, &'static ModuleGraph)> { let compilation = unsafe { self.compilation.as_ref() }; + if compilation.build_module_graph_artifact.is_none() { + return Err(napi::Error::from_reason( + "ModuleGraph is not available during module graph building phase".to_string(), + )); + } let module_graph = compilation.get_module_graph(); Ok((compilation, module_graph)) diff --git a/crates/rspack_binding_api/src/plugins/interceptor.rs b/crates/rspack_binding_api/src/plugins/interceptor.rs index e8e2c55ce5f6..9f022a6697c6 100644 --- a/crates/rspack_binding_api/src/plugins/interceptor.rs +++ b/crates/rspack_binding_api/src/plugins/interceptor.rs @@ -10,7 +10,7 @@ use napi::{ Env, JsValue, bindgen_prelude::{Buffer, FromNapiValue, Function, JsValuesTupleIntoVec, Promise, ToNapiValue}, }; -use rspack_collections::IdentifierSet; +use rspack_collections::{IdentifierMap, IdentifierSet}; use rspack_core::{ AfterResolveResult, AssetEmittedInfo, AsyncModulesArtifact, BeforeResolveResult, BindingCell, BoxModule, ChunkUkey, Compilation, CompilationAdditionalTreeRuntimeRequirements, @@ -41,7 +41,7 @@ use rspack_core::{ NormalModuleFactoryFactorizeHook, NormalModuleFactoryResolve, NormalModuleFactoryResolveForScheme, NormalModuleFactoryResolveForSchemeHook, NormalModuleFactoryResolveHook, NormalModuleFactoryResolveResult, ResourceData, RuntimeGlobals, - Scheme, build_module_graph::BuildModuleGraphArtifact, parse_resource, + RuntimeModule, Scheme, build_module_graph::BuildModuleGraphArtifact, parse_resource, rspack_sources::RawStringSource, }; use rspack_error::Diagnostic; @@ -1340,11 +1340,12 @@ impl CompilationRuntimeRequirementInTree for CompilationRuntimeRequirementInTree impl CompilationRuntimeModule for CompilationRuntimeModuleTap { async fn run( &self, - compilation: &mut Compilation, + compilation: &Compilation, m: &ModuleIdentifier, chunk_ukey: &ChunkUkey, + runtime_modules: &mut IdentifierMap>, ) -> rspack_error::Result<()> { - let Some(module) = compilation.runtime_modules.get(m) else { + let Some(module) = runtime_modules.get(m) else { return Ok(()); }; let source_string = module.generate(compilation).await?; @@ -1358,16 +1359,15 @@ impl CompilationRuntimeModule for CompilationRuntimeModuleTap { .as_str() .cow_replace(compilation.runtime_template.runtime_module_prefix(), "") .into_owned(), + stage: module.stage().into(), + isolate: module.should_isolate(), }, chunk: ChunkWrapper::new(*chunk_ukey, compilation), }; if let Some(module) = self.function.call_with_sync(arg).await? && let Some(source) = module.source { - let module = compilation - .runtime_modules - .get_mut(m) - .expect("should have module"); + let module = runtime_modules.get_mut(m).expect("should have module"); match source.source { napi::Either::A(string) => { module.set_custom_source(string); diff --git a/crates/rspack_binding_api/src/rstest.rs b/crates/rspack_binding_api/src/rstest.rs index 09f29968373b..c4c2411880a1 100644 --- a/crates/rspack_binding_api/src/rstest.rs +++ b/crates/rspack_binding_api/src/rstest.rs @@ -12,6 +12,11 @@ pub struct RawRstestPluginOptions { pub hoist_mock_module: bool, // Root of the manual mock directory. pub manual_mock_root: String, + // Preserve `new URL("*.", import.meta.url)` expressions for specified extensions + // instead of transforming them to asset imports. + // This allows rstest to dynamically load modules (e.g., wasm) at runtime. + // Example: [".wasm"] to preserve wasm URL expressions. + pub preserve_new_url: Option>, } impl From for RstestPluginOptions { @@ -21,6 +26,7 @@ impl From for RstestPluginOptions { hoist_mock_module: value.hoist_mock_module, import_meta_path_name: value.import_meta_path_name, manual_mock_root: value.manual_mock_root, + preserve_new_url: value.preserve_new_url.unwrap_or_default(), } } } diff --git a/crates/rspack_core/src/compilation/mod.rs b/crates/rspack_core/src/compilation/mod.rs index 6313b6e995c9..f469a7904e04 100644 --- a/crates/rspack_core/src/compilation/mod.rs +++ b/crates/rspack_core/src/compilation/mod.rs @@ -86,7 +86,7 @@ define_hook!(CompilationOptimizeTree: Series(compilation: &Compilation)); define_hook!(CompilationOptimizeChunkModules: SeriesBail(compilation: &mut Compilation) -> bool); define_hook!(CompilationModuleIds: Series(compilation: &Compilation, module_ids: &mut ModuleIdsArtifact, diagnostics: &mut Vec)); define_hook!(CompilationChunkIds: Series(compilation: &Compilation, chunk_by_ukey: &mut ChunkByUkey, named_chunk_ids_artifact: &mut ChunkNamedIdArtifact, diagnostics: &mut Vec)); -define_hook!(CompilationRuntimeModule: Series(compilation: &mut Compilation, module: &ModuleIdentifier, chunk: &ChunkUkey)); +define_hook!(CompilationRuntimeModule: Series(compilation: &Compilation, module: &ModuleIdentifier, chunk: &ChunkUkey, runtime_modules: &mut IdentifierMap>)); define_hook!(CompilationAdditionalModuleRuntimeRequirements: Series(compilation: &Compilation, module_identifier: &ModuleIdentifier, runtime_requirements: &mut RuntimeGlobals),tracing=false); define_hook!(CompilationRuntimeRequirementInModule: SeriesBail(compilation: &Compilation, module_identifier: &ModuleIdentifier, all_runtime_requirements: &RuntimeGlobals, runtime_requirements: &RuntimeGlobals, runtime_requirements_mut: &mut RuntimeGlobals),tracing=false); define_hook!(CompilationAdditionalChunkRuntimeRequirements: Series(compilation: &mut Compilation, chunk_ukey: &ChunkUkey, runtime_requirements: &mut RuntimeGlobals)); @@ -94,7 +94,7 @@ define_hook!(CompilationRuntimeRequirementInChunk: SeriesBail(compilation: &mut define_hook!(CompilationAdditionalTreeRuntimeRequirements: Series(compilation: &mut Compilation, chunk_ukey: &ChunkUkey, runtime_requirements: &mut RuntimeGlobals)); define_hook!(CompilationRuntimeRequirementInTree: SeriesBail(compilation: &mut Compilation, chunk_ukey: &ChunkUkey, all_runtime_requirements: &RuntimeGlobals, runtime_requirements: &RuntimeGlobals, runtime_requirements_mut: &mut RuntimeGlobals)); define_hook!(CompilationOptimizeCodeGeneration: Series(compilation: &mut Compilation)); -define_hook!(CompilationAfterCodeGeneration: Series(compilation: &mut Compilation)); +define_hook!(CompilationAfterCodeGeneration: Series(compilation: &Compilation, diagnostics: &mut Vec)); define_hook!(CompilationChunkHash: Series(compilation: &Compilation, chunk_ukey: &ChunkUkey, hasher: &mut RspackHash),tracing=false); define_hook!(CompilationContentHash: Series(compilation: &Compilation, chunk_ukey: &ChunkUkey, hashes: &mut HashMap)); define_hook!(CompilationDependentFullHash: SeriesBail(compilation: &Compilation, chunk_ukey: &ChunkUkey) -> bool); @@ -1292,6 +1292,7 @@ impl Compilation { )); chunks } else { + self.chunk_render_artifact.clear(); self.chunk_by_ukey.keys().copied().collect() }; let results = rspack_futures::scope::<_, Result<_>>(|token| { @@ -1850,6 +1851,7 @@ impl Compilation { modules } else { + self.cgm_hash_artifact.clear(); self.get_module_graph().modules().keys().copied().collect() }; self @@ -1889,16 +1891,20 @@ impl Compilation { )); modules } else { + self.code_generation_results = Default::default(); self.get_module_graph().modules().keys().copied().collect() }; self.code_generation(code_generation_modules).await?; + let mut diagnostics = vec![]; plugin_driver .compilation_hooks .after_code_generation - .call(self) + .call(self, &mut diagnostics) .await .map_err(|e| e.wrap_err("caused by plugins in Compilation.hooks.afterCodeGeneration"))?; + self.extend_diagnostics(diagnostics); + logger.time_end(start); let start = logger.time("runtime requirements"); @@ -1931,6 +1937,7 @@ impl Compilation { )); modules } else { + self.cgm_runtime_requirements_artifact = Default::default(); self.get_module_graph().modules().keys().copied().collect() }; self @@ -1972,6 +1979,7 @@ impl Compilation { )); affected_chunks } else { + self.cgc_runtime_requirements_artifact.clear(); self.chunk_by_ukey.keys().copied().collect() }; self @@ -2283,6 +2291,7 @@ impl Compilation { // NOTE: webpack runs hooks.runtime_module in compilation.add_runtime_module // and overwrite the runtime_module.generate() to get new source in create_chunk_assets // this needs full runtime requirements, so run hooks.runtime_module after runtime_requirements_in_tree + let mut runtime_modules = mem::take(&mut self.runtime_modules); for entry_ukey in &entries { let runtime_module_ids: Vec<_> = self .chunk_graph @@ -2293,11 +2302,12 @@ impl Compilation { plugin_driver .compilation_hooks .runtime_module - .call(self, &runtime_module_id, entry_ukey) + .call(self, &runtime_module_id, entry_ukey, &mut runtime_modules) .await .map_err(|e| e.wrap_err("caused by plugins in Compilation.hooks.runtimeModule"))?; } } + self.runtime_modules = runtime_modules; logger.time_end(start); Ok(()) @@ -2372,6 +2382,7 @@ impl Compilation { )); chunks } else { + self.chunk_hashes_artifact.clear(); self.chunk_by_ukey.keys().copied().collect() }; diff --git a/crates/rspack_core/src/runtime_module.rs b/crates/rspack_core/src/runtime_module.rs index 64088d66b37d..43f0d27d5de3 100644 --- a/crates/rspack_core/src/runtime_module.rs +++ b/crates/rspack_core/src/runtime_module.rs @@ -67,6 +67,17 @@ impl From for RuntimeModuleStage { } } +impl From for u32 { + fn from(value: RuntimeModuleStage) -> Self { + match value { + RuntimeModuleStage::Normal => 0, + RuntimeModuleStage::Basic => 5, + RuntimeModuleStage::Attach => 10, + RuntimeModuleStage::Trigger => 20, + } + } +} + pub trait RuntimeModuleExt { fn boxed(self) -> Box; } diff --git a/crates/rspack_plugin_devtool/src/source_map_dev_tool_module_options_plugin.rs b/crates/rspack_plugin_devtool/src/source_map_dev_tool_module_options_plugin.rs index a40915cc277d..b549449ff7b4 100644 --- a/crates/rspack_plugin_devtool/src/source_map_dev_tool_module_options_plugin.rs +++ b/crates/rspack_plugin_devtool/src/source_map_dev_tool_module_options_plugin.rs @@ -1,6 +1,7 @@ +use rspack_collections::IdentifierMap; use rspack_core::{ BoxModule, ChunkUkey, Compilation, CompilationBuildModule, CompilationId, - CompilationRuntimeModule, CompilerId, ModuleIdentifier, Plugin, + CompilationRuntimeModule, CompilerId, ModuleIdentifier, Plugin, RuntimeModule, }; use rspack_error::Result; use rspack_hook::{plugin, plugin_hook}; @@ -46,21 +47,22 @@ async fn build_module( #[plugin_hook(CompilationRuntimeModule for SourceMapDevToolModuleOptionsPlugin)] async fn runtime_module( &self, - compilation: &mut Compilation, - module: &ModuleIdentifier, + _compilation: &Compilation, + module_identifier: &ModuleIdentifier, _chunk: &ChunkUkey, + runtime_modules: &mut IdentifierMap>, ) -> Result<()> { - let Some(module) = compilation.runtime_modules.get_mut(module) else { + let Some(runtime_module) = runtime_modules.get_mut(module_identifier) else { return Ok(()); }; if self.module { - module.set_source_map_kind(SourceMapKind::SourceMap); + runtime_module.set_source_map_kind(SourceMapKind::SourceMap); } else { - module.set_source_map_kind(SourceMapKind::SimpleSourceMap); + runtime_module.set_source_map_kind(SourceMapKind::SimpleSourceMap); } if self.cheap { - let current_kind = *module.get_source_map_kind(); - module.set_source_map_kind(current_kind | SourceMapKind::Cheap) + let current_kind = *runtime_module.get_source_map_kind(); + runtime_module.set_source_map_kind(current_kind | SourceMapKind::Cheap) } Ok(()) } diff --git a/crates/rspack_plugin_esm_library/src/link.rs b/crates/rspack_plugin_esm_library/src/link.rs index 617a4135be37..ea7e2667076a 100644 --- a/crates/rspack_plugin_esm_library/src/link.rs +++ b/crates/rspack_plugin_esm_library/src/link.rs @@ -139,7 +139,11 @@ impl EsmLibraryPlugin { } } - pub(crate) async fn link(&self, compilation: &mut Compilation) -> Result<()> { + pub(crate) async fn link( + &self, + compilation: &Compilation, + diagnostics: &mut Vec, + ) -> Result<()> { let module_graph = compilation.get_module_graph(); // codegen uses self.concatenated_modules_map_for_codegen which has hold another Arc, so @@ -247,7 +251,7 @@ impl EsmLibraryPlugin { // link imported specifier with exported symbol let mut needed_namespace_objects_by_ukey = UkeyMap::default(); - compilation.extend_diagnostics(self.link_imports_and_exports( + diagnostics.extend(self.link_imports_and_exports( compilation, &mut link, &mut concate_modules_map, diff --git a/crates/rspack_plugin_esm_library/src/plugin.rs b/crates/rspack_plugin_esm_library/src/plugin.rs index 1e51362f0679..f5b67db72a37 100644 --- a/crates/rspack_plugin_esm_library/src/plugin.rs +++ b/crates/rspack_plugin_esm_library/src/plugin.rs @@ -18,7 +18,7 @@ use rspack_core::{ ParserOptions, Plugin, PrefetchExportsInfoMode, RuntimeGlobals, get_target, is_esm_dep_like, rspack_sources::{ReplaceSource, Source}, }; -use rspack_error::Result; +use rspack_error::{Diagnostic, Result}; use rspack_hook::{plugin, plugin_hook}; use rspack_plugin_javascript::{ JavascriptModulesRenderChunkContent, JsPlugin, RenderSource, @@ -303,7 +303,11 @@ async fn concatenation_scope( } #[plugin_hook(CompilationAfterCodeGeneration for EsmLibraryPlugin)] -async fn after_code_generation(&self, compilation: &mut Compilation) -> Result<()> { +async fn after_code_generation( + &self, + compilation: &Compilation, + diagnostics: &mut Vec, +) -> Result<()> { let mut chunk_ids_to_ukey = FxHashMap::default(); for chunk_ukey in compilation.chunk_by_ukey.keys() { @@ -316,7 +320,7 @@ async fn after_code_generation(&self, compilation: &mut Compilation) -> Result<( *self.chunk_ids_to_ukey.borrow_mut() = chunk_ids_to_ukey; - self.link(compilation).await?; + self.link(compilation, diagnostics).await?; Ok(()) } diff --git a/crates/rspack_plugin_rsdoctor/src/plugin.rs b/crates/rspack_plugin_rsdoctor/src/plugin.rs index 165982245414..30274f25f2a7 100644 --- a/crates/rspack_plugin_rsdoctor/src/plugin.rs +++ b/crates/rspack_plugin_rsdoctor/src/plugin.rs @@ -418,7 +418,11 @@ async fn module_ids( } #[plugin_hook(CompilationAfterCodeGeneration for RsdoctorPlugin, stage = 9999)] -async fn after_code_generation(&self, compilation: &mut Compilation) -> Result<()> { +async fn after_code_generation( + &self, + compilation: &Compilation, + _diagnostics: &mut Vec, +) -> Result<()> { if !self.has_module_graph_feature(RsdoctorPluginModuleGraphFeature::ModuleSources) { return Ok(()); } diff --git a/crates/rspack_plugin_rstest/src/lib.rs b/crates/rspack_plugin_rstest/src/lib.rs index 3486ac76e143..3d19deb29baa 100644 --- a/crates/rspack_plugin_rstest/src/lib.rs +++ b/crates/rspack_plugin_rstest/src/lib.rs @@ -4,5 +4,6 @@ mod mock_module_id_dependency; mod module_path_name_dependency; mod parser_plugin; mod plugin; +mod url_dependency; pub use plugin::*; diff --git a/crates/rspack_plugin_rstest/src/plugin.rs b/crates/rspack_plugin_rstest/src/plugin.rs index e371cf39c85b..9733dcfba2b4 100644 --- a/crates/rspack_plugin_rstest/src/plugin.rs +++ b/crates/rspack_plugin_rstest/src/plugin.rs @@ -19,6 +19,7 @@ use crate::{ mock_method_dependency::MockMethodDependencyTemplate, mock_module_id_dependency::MockModuleIdDependencyTemplate, module_path_name_dependency::ModulePathNameDependencyTemplate, parser_plugin::RstestParserPlugin, + url_dependency::RstestUrlDependencyTemplate, }; #[derive(Debug)] @@ -27,6 +28,7 @@ pub struct RstestPluginOptions { pub hoist_mock_module: bool, pub import_meta_path_name: bool, pub manual_mock_root: String, + pub preserve_new_url: Vec, } #[derive(Debug)] @@ -148,6 +150,15 @@ async fn compilation_stage_9999( Arc::new(ImportDependencyTemplate::default()), ); + if !self.options.preserve_new_url.is_empty() { + compilation.set_dependency_template( + RstestUrlDependencyTemplate::template_type(), + Arc::new(RstestUrlDependencyTemplate::new( + self.options.preserve_new_url.clone(), + )), + ); + } + Ok(()) } diff --git a/crates/rspack_plugin_rstest/src/url_dependency.rs b/crates/rspack_plugin_rstest/src/url_dependency.rs new file mode 100644 index 000000000000..ebaad46ed832 --- /dev/null +++ b/crates/rspack_plugin_rstest/src/url_dependency.rs @@ -0,0 +1,57 @@ +use rspack_cacheable::cacheable; +use rspack_core::{ + DependencyCodeGeneration, DependencyTemplate, DependencyTemplateType, DependencyType, + ModuleDependency, TemplateContext, TemplateReplaceSource, +}; +use rspack_plugin_javascript::dependency::{URLDependency, URLDependencyTemplate}; + +#[cacheable] +#[derive(Debug, Default)] +pub struct RstestUrlDependencyTemplate { + /// List of extensions to preserve (e.g., [".wasm", ".node"]) + preserve_extensions: Vec, +} + +impl RstestUrlDependencyTemplate { + pub fn new(preserve_extensions: Vec) -> Self { + Self { + preserve_extensions, + } + } + + pub fn template_type() -> DependencyTemplateType { + DependencyTemplateType::Dependency(DependencyType::NewUrl) + } +} + +impl DependencyTemplate for RstestUrlDependencyTemplate { + fn render( + &self, + dep: &dyn DependencyCodeGeneration, + source: &mut TemplateReplaceSource, + code_generatable_context: &mut TemplateContext, + ) { + let dep = dep + .as_any() + .downcast_ref::() + .expect("RstestUrlDependencyTemplate should be used for URLDependency"); + + // Strip query string and fragment from request path before checking extension + let request = dep.request(); + let request_path = request.split(&['?', '#'][..]).next().unwrap_or(request); + + let should_preserve = request_path.rsplit('.').next().is_some_and(|ext| { + self.preserve_extensions.iter().any(|preserve_ext| { + // Support both ".ext" and "ext" formats + let preserve_ext = preserve_ext.trim_start_matches('.'); + ext.eq_ignore_ascii_case(preserve_ext) + }) + }); + + if should_preserve { + return; + } + + URLDependencyTemplate::default().render(dep, source, code_generatable_context); + } +} diff --git a/package.json b/package.json index 12cee121c00a..7467cede552a 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "pnpm": "10.26.2" }, "devDependencies": { - "@biomejs/biome": "^2.3.10", + "@biomejs/biome": "^2.3.11", "@microsoft/api-extractor": "7.55.2", "@microsoft/api-extractor-model": "7.32.2", "@rslint/core": "0.1.13", @@ -74,7 +74,7 @@ "cross-env": "^10.1.0", "husky": "^9.1.7", "is-ci": "4.1.0", - "@rstest/core": "^0.7.7", + "@rstest/core": "^0.7.8", "lint-staged": "^16.2.7", "prettier": "3.7.4", "prettier-2": "npm:prettier@2.8.8", diff --git a/packages/create-rspack/package.json b/packages/create-rspack/package.json index 243022d447b6..e030e8a2e13d 100644 --- a/packages/create-rspack/package.json +++ b/packages/create-rspack/package.json @@ -27,7 +27,7 @@ "create-rstack": "1.7.20" }, "devDependencies": { - "@rslib/core": "0.19.0", + "@rslib/core": "0.19.1", "typescript": "^5.9.3" }, "publishConfig": { diff --git a/packages/rspack-cli/package.json b/packages/rspack-cli/package.json index 54e5b0b955de..2c66e0ac6f89 100644 --- a/packages/rspack-cli/package.json +++ b/packages/rspack-cli/package.json @@ -39,7 +39,7 @@ "webpack-bundle-analyzer": "4.10.2" }, "devDependencies": { - "@rslib/core": "0.19.0", + "@rslib/core": "0.19.1", "@rspack/core": "workspace:*", "@rspack/test-tools": "workspace:*", "@types/webpack-bundle-analyzer": "^4.7.0", diff --git a/packages/rspack-test-tools/src/helper/hot-update/plugin.ts b/packages/rspack-test-tools/src/helper/hot-update/plugin.ts index f8d19f439eeb..3f7a8065246b 100644 --- a/packages/rspack-test-tools/src/helper/hot-update/plugin.ts +++ b/packages/rspack-test-tools/src/helper/hot-update/plugin.ts @@ -167,7 +167,9 @@ export class HotUpdatePlugin { compilation.hooks.runtimeModule.tap( PLUGIN_NAME, (module: any, _set: any) => { - if (module.constructorName === 'DefinePropertyGettersRuntimeModule') { + if ( + module.constructor.name === 'DefinePropertyGettersRuntimeModule' + ) { module.source.source = Buffer.from( ` ${RuntimeGlobals.definePropertyGetters} = function (exports, definition) { diff --git a/packages/rspack/etc/core.api.md b/packages/rspack/etc/core.api.md index ea0472d6bac9..d783eb784adb 100644 --- a/packages/rspack/etc/core.api.md +++ b/packages/rspack/etc/core.api.md @@ -53,7 +53,6 @@ import { JsRsdoctorChunkGraph } from '@rspack/binding'; import { JsRsdoctorModuleGraph } from '@rspack/binding'; import { JsRsdoctorModuleIdsPatch } from '@rspack/binding'; import { JsRsdoctorModuleSourcesPatch } from '@rspack/binding'; -import type { JsRuntimeModule } from '@rspack/binding'; import type { JsStats } from '@rspack/binding'; import type { JsStatsCompilation } from '@rspack/binding'; import type { JsStatsError } from '@rspack/binding'; @@ -1033,7 +1032,7 @@ export class Compilation { Set ]>; runtimeRequirementInTree: liteTapable.HookMap], void>>; - runtimeModule: liteTapable.SyncHook<[JsRuntimeModule, Chunk]>; + runtimeModule: liteTapable.SyncHook<[RuntimeModule, Chunk]>; seal: liteTapable.SyncHook<[]>; afterSeal: liteTapable.AsyncSeriesHook<[], void>; needAdditionalPass: liteTapable.SyncBailHook<[], boolean>; diff --git a/packages/rspack/package.json b/packages/rspack/package.json index 2df9e39b04e4..2be157ff09cd 100644 --- a/packages/rspack/package.json +++ b/packages/rspack/package.json @@ -46,10 +46,10 @@ "directory": "packages/rspack" }, "devDependencies": { - "@ast-grep/napi": "^0.40.3", + "@ast-grep/napi": "^0.40.4", "@napi-rs/wasm-runtime": "1.0.7", "@rsbuild/plugin-node-polyfill": "^1.4.2", - "@rslib/core": "0.19.0", + "@rslib/core": "0.19.1", "@swc/types": "0.1.25", "@types/node": "^20.19.27", "@types/watchpack": "^2.4.5", diff --git a/packages/rspack/src/Compilation.ts b/packages/rspack/src/Compilation.ts index 3d4140158bc6..7ee225efa277 100644 --- a/packages/rspack/src/Compilation.ts +++ b/packages/rspack/src/Compilation.ts @@ -15,7 +15,6 @@ import type { ExternalObject, JsCompilation, JsPathData, - JsRuntimeModule, JsSource, } from '@rspack/binding'; import binding from '@rspack/binding'; @@ -252,7 +251,7 @@ export class Compilation { runtimeRequirementInTree: liteTapable.HookMap< liteTapable.SyncBailHook<[Chunk, Set], void> >; - runtimeModule: liteTapable.SyncHook<[JsRuntimeModule, Chunk]>; + runtimeModule: liteTapable.SyncHook<[RuntimeModule, Chunk]>; seal: liteTapable.SyncHook<[]>; afterSeal: liteTapable.AsyncSeriesHook<[], void>; needAdditionalPass: liteTapable.SyncBailHook<[], boolean>; diff --git a/packages/rspack/src/FileSystem.ts b/packages/rspack/src/FileSystem.ts index 491b32c1fa29..6c7de612256b 100644 --- a/packages/rspack/src/FileSystem.ts +++ b/packages/rspack/src/FileSystem.ts @@ -242,7 +242,7 @@ class ThreadsafeIntermediateNodeFS extends ThreadsafeOutputNodeFS { this.write = memoizeFn(() => { const writeFn = util.promisify(fs.write.bind(fs)); return async (fd: number, content: Buffer, position: number) => { - return await writeFn(fd, content, { + return writeFn(fd, content, { position, }); }; @@ -250,13 +250,13 @@ class ThreadsafeIntermediateNodeFS extends ThreadsafeOutputNodeFS { this.writeAll = memoizeFn(() => { const writeFn = util.promisify(fs.writeFile.bind(fs)); return async (fd: number, content: Buffer) => { - return await writeFn(fd, content); + return writeFn(fd, content); }; }); this.read = memoizeFn(() => { const readFn = fs.read.bind(fs); - return async (fd: number, length: number, position: number) => { - new Promise((resolve) => { + return (fd: number, length: number, position: number) => { + return new Promise((resolve, reject) => { readFn( fd, { @@ -265,7 +265,7 @@ class ThreadsafeIntermediateNodeFS extends ThreadsafeOutputNodeFS { }, (err, _bytesRead, buffer) => { if (err) { - resolve(err); + reject(err); } else { resolve(buffer); } diff --git a/packages/rspack/src/RuntimeModule.ts b/packages/rspack/src/RuntimeModule.ts index dfe97ad096f4..c349b3cae727 100644 --- a/packages/rspack/src/RuntimeModule.ts +++ b/packages/rspack/src/RuntimeModule.ts @@ -1,4 +1,8 @@ -import type { JsAddingRuntimeModule } from '@rspack/binding'; +import type { + JsAddingRuntimeModule, + JsRuntimeModule, + JsSource, +} from '@rspack/binding'; import type { Chunk } from './Chunk'; import type { ChunkGraph } from './ChunkGraph'; import type { Compilation } from './Compilation'; @@ -71,3 +75,52 @@ export class RuntimeModule { ); } } + +export function createRenderedRuntimeModule( + module: JsRuntimeModule, +): RuntimeModule { + const RuntimeModuleClass = { + [module.constructorName]: class extends RuntimeModule { + private _source: JsSource | undefined; + constructor() { + super(module.name, module.stage); + this._source = module.source; + } + + /** + * @deprecated use `module.constructor.name` instead + */ + get constructorName() { + return module.constructorName; + } + + /** + * @deprecated use `module.identifier()` instead + */ + get moduleIdentifier() { + return module.moduleIdentifier; + } + + get source(): JsSource | undefined { + return this._source; + } + + identifier(): string { + return module.moduleIdentifier; + } + + readableIdentifier(): string { + return module.moduleIdentifier; + } + + shouldIsolate(): boolean { + return module.isolate; + } + + generate(): string { + return this._source?.source.toString('utf-8') || ''; + } + }, + }[module.constructorName]; + return new RuntimeModuleClass(); +} diff --git a/packages/rspack/src/browser/service.ts b/packages/rspack/src/browser/service.ts index 9184cde3def9..c40997ea5a1f 100644 --- a/packages/rspack/src/browser/service.ts +++ b/packages/rspack/src/browser/service.ts @@ -23,6 +23,6 @@ export enum RequestType { CompilationGetAssetPathWithInfo = 'CompilationGetAssetPathWithInfo', } -export async function run() { - throw new Error('Not support browser'); +export function run(): Promise { + return Promise.reject(new Error('Not support browser')); } diff --git a/packages/rspack/src/builtin-plugin/ExternalsPlugin.ts b/packages/rspack/src/builtin-plugin/ExternalsPlugin.ts index cbd7f4efa186..fd2af1f44dcc 100644 --- a/packages/rspack/src/builtin-plugin/ExternalsPlugin.ts +++ b/packages/rspack/src/builtin-plugin/ExternalsPlugin.ts @@ -70,7 +70,7 @@ export class ExternalsPlugin extends RspackBuiltinPlugin { const processResolveResult = this.#processResolveResult; return async (ctx: RawExternalItemFnCtx) => { - return await new Promise((resolve, reject) => { + return new Promise((resolve, reject) => { const data = ctx.data(); const promise = item( { diff --git a/packages/rspack/src/builtin-plugin/RsdoctorPlugin.ts b/packages/rspack/src/builtin-plugin/RsdoctorPlugin.ts index 6893a5f64850..c3571cfed869 100644 --- a/packages/rspack/src/builtin-plugin/RsdoctorPlugin.ts +++ b/packages/rspack/src/builtin-plugin/RsdoctorPlugin.ts @@ -161,7 +161,7 @@ export const createRsdoctorPluginHooksRegisters: CreatePartialRegisters< }, function (queried) { return async function (data: JsRsdoctorModuleGraph) { - return await queried.promise(data); + return queried.promise(data); }; }, ), @@ -174,7 +174,7 @@ export const createRsdoctorPluginHooksRegisters: CreatePartialRegisters< }, function (queried) { return async function (data: JsRsdoctorChunkGraph) { - return await queried.promise(data); + return queried.promise(data); }; }, ), @@ -187,7 +187,7 @@ export const createRsdoctorPluginHooksRegisters: CreatePartialRegisters< }, function (queried) { return async function (data: JsRsdoctorModuleIdsPatch) { - return await queried.promise(data); + return queried.promise(data); }; }, ), @@ -200,7 +200,7 @@ export const createRsdoctorPluginHooksRegisters: CreatePartialRegisters< }, function (queried) { return async function (data: JsRsdoctorModuleSourcesPatch) { - return await queried.promise(data); + return queried.promise(data); }; }, ), @@ -213,7 +213,7 @@ export const createRsdoctorPluginHooksRegisters: CreatePartialRegisters< }, function (queried) { return async function (data: JsRsdoctorAssetPatch) { - return await queried.promise(data); + return queried.promise(data); }; }, ), diff --git a/packages/rspack/src/builtin-plugin/SubresourceIntegrityPlugin.ts b/packages/rspack/src/builtin-plugin/SubresourceIntegrityPlugin.ts index 0eb3a6442720..1e9799285690 100644 --- a/packages/rspack/src/builtin-plugin/SubresourceIntegrityPlugin.ts +++ b/packages/rspack/src/builtin-plugin/SubresourceIntegrityPlugin.ts @@ -286,9 +286,9 @@ export class SubresourceIntegrityPlugin extends NativeSubresourceIntegrityPlugin const hwpHooks = getHooks(compilation); hwpHooks.beforeAssetTagGeneration.tapPromise( PLUGIN_NAME, - async (data) => { + (data) => { self.handleHwpPluginArgs(data); - return data; + return Promise.resolve(data); }, ); @@ -297,13 +297,13 @@ export class SubresourceIntegrityPlugin extends NativeSubresourceIntegrityPlugin name: PLUGIN_NAME, stage: 10000, }, - async (data) => { + (data) => { self.handleHwpBodyTags( data, compiler.outputPath, compiler.options.output.crossOriginLoading, ); - return data; + return Promise.resolve(data); }, ); }); diff --git a/packages/rspack/src/exports.ts b/packages/rspack/src/exports.ts index 42a0cc340c46..5b8a542b5f6e 100644 --- a/packages/rspack/src/exports.ts +++ b/packages/rspack/src/exports.ts @@ -412,7 +412,7 @@ export const experiments: Experiments = { }, async cleanup() { await JavaScriptTracer.cleanupJavaScriptTrace(); - await syncTraceEvent(JavaScriptTracer.events); + syncTraceEvent(JavaScriptTracer.events); cleanupGlobalTrace(); }, }, diff --git a/packages/rspack/src/loader-runner/worker.ts b/packages/rspack/src/loader-runner/worker.ts index 3111f59e3f92..d3d91eb28db2 100644 --- a/packages/rspack/src/loader-runner/worker.ts +++ b/packages/rspack/src/loader-runner/worker.ts @@ -648,10 +648,10 @@ function worker(workerOptions: WorkerOptions) { const waitFor = createWaitForPendingRequest(sendRequest); loaderImpl(workerOptions, sendRequest, waitFor) - .then(async (data) => { + .then((data) => { workerData.workerPort.postMessage({ type: 'done', data }); }) - .catch(async (err) => { + .catch((err) => { workerData.workerPort.postMessage({ type: 'done-error', error: serializeError(err), diff --git a/packages/rspack/src/taps/compilation.ts b/packages/rspack/src/taps/compilation.ts index 00af3f009b8e..ebebba20e4d8 100644 --- a/packages/rspack/src/taps/compilation.ts +++ b/packages/rspack/src/taps/compilation.ts @@ -6,6 +6,7 @@ import { __to_binding_runtime_globals, isReservedRuntimeGlobal, } from '../RuntimeGlobals'; +import { createRenderedRuntimeModule } from '../RuntimeModule'; import { createHash } from '../util/createHash'; import type { CreatePartialRegisters } from './types'; @@ -133,8 +134,11 @@ export const createCompilationHooksRegisters: CreatePartialRegisters< function (queried) { return function ({ module, chunk }: binding.JsRuntimeModuleArg) { + const runtimeModule = createRenderedRuntimeModule(module); + const compilation = getCompiler().__internal__get_compilation()!; + runtimeModule.attach(compilation, chunk, compilation.chunkGraph); const originSource = module.source?.source; - queried.call(module, chunk); + queried.call(runtimeModule, chunk); const newSource = module.source?.source; if (newSource && newSource !== originSource) { return module; @@ -282,7 +286,7 @@ export const createCompilationHooksRegisters: CreatePartialRegisters< function (queried) { return async function () { - return await queried.promise( + return queried.promise( getCompiler().__internal__get_compilation()!.modules, ); }; @@ -329,7 +333,7 @@ export const createCompilationHooksRegisters: CreatePartialRegisters< function (queried) { return async function () { - return await queried.promise( + return queried.promise( getCompiler().__internal__get_compilation()!.chunks, getCompiler().__internal__get_compilation()!.modules, ); @@ -346,7 +350,7 @@ export const createCompilationHooksRegisters: CreatePartialRegisters< function (queried) { return async function () { - return await queried.promise( + return queried.promise( getCompiler().__internal__get_compilation()!.chunks, getCompiler().__internal__get_compilation()!.modules, ); @@ -403,7 +407,7 @@ export const createCompilationHooksRegisters: CreatePartialRegisters< function (queried) { return async function () { - return await queried.promise( + return queried.promise( getCompiler().__internal__get_compilation()!.assets, ); }; @@ -447,7 +451,7 @@ export const createCompilationHooksRegisters: CreatePartialRegisters< function (queried) { return async function () { - return await queried.promise(); + return queried.promise(); }; }, ), diff --git a/packages/rspack/src/taps/compiler.ts b/packages/rspack/src/taps/compiler.ts index 6a88440ab187..73c8408cd988 100644 --- a/packages/rspack/src/taps/compiler.ts +++ b/packages/rspack/src/taps/compiler.ts @@ -47,9 +47,7 @@ export const createCompilerHooksRegisters: CreatePartialRegisters< function (queried) { return async function () { - return await queried.promise( - getCompiler().__internal__get_compilation()!, - ); + return queried.promise(getCompiler().__internal__get_compilation()!); }; }, ), @@ -62,9 +60,7 @@ export const createCompilerHooksRegisters: CreatePartialRegisters< function (queried) { return async function () { - return await queried.promise( - getCompiler().__internal__get_compilation()!, - ); + return queried.promise(getCompiler().__internal__get_compilation()!); }; }, ), @@ -90,9 +86,7 @@ export const createCompilerHooksRegisters: CreatePartialRegisters< function (queried) { return async function () { - return await queried.promise( - getCompiler().__internal__get_compilation()!, - ); + return queried.promise(getCompiler().__internal__get_compilation()!); }; }, ), @@ -105,9 +99,7 @@ export const createCompilerHooksRegisters: CreatePartialRegisters< function (queried) { return async function () { - return await queried.promise( - getCompiler().__internal__get_compilation()!, - ); + return queried.promise(getCompiler().__internal__get_compilation()!); }; }, ), diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b1b40cbc2d1d..257445961ef0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -14,8 +14,8 @@ importers: .: devDependencies: '@biomejs/biome': - specifier: ^2.3.10 - version: 2.3.10 + specifier: ^2.3.11 + version: 2.3.11 '@microsoft/api-extractor': specifier: 7.55.2 version: 7.55.2(@types/node@20.19.27) @@ -29,8 +29,8 @@ importers: specifier: workspace:* version: link:packages/rspack-cli '@rstest/core': - specifier: ^0.7.7 - version: 0.7.7(jsdom@26.1.0) + specifier: ^0.7.8 + version: 0.7.8(jsdom@26.1.0) '@taplo/cli': specifier: ^0.7.0 version: 0.7.0 @@ -221,8 +221,8 @@ importers: version: 1.7.20 devDependencies: '@rslib/core': - specifier: 0.19.0 - version: 0.19.0(@microsoft/api-extractor@7.55.2(@types/node@20.19.27))(typescript@5.9.3) + specifier: 0.19.1 + version: 0.19.1(@microsoft/api-extractor@7.55.2(@types/node@20.19.27))(typescript@5.9.3) typescript: specifier: ^5.9.3 version: 5.9.3 @@ -358,17 +358,17 @@ importers: version: 0.5.17 devDependencies: '@ast-grep/napi': - specifier: ^0.40.3 - version: 0.40.3 + specifier: ^0.40.4 + version: 0.40.4 '@napi-rs/wasm-runtime': specifier: 1.0.7 version: 1.0.7 '@rsbuild/plugin-node-polyfill': specifier: ^1.4.2 - version: 1.4.2(@rsbuild/core@1.6.15) + version: 1.4.2(@rsbuild/core@1.7.2) '@rslib/core': - specifier: 0.19.0 - version: 0.19.0(@microsoft/api-extractor@7.55.2(@types/node@20.19.27))(typescript@5.9.3) + specifier: 0.19.1 + version: 0.19.1(@microsoft/api-extractor@7.55.2(@types/node@20.19.27))(typescript@5.9.3) '@swc/types': specifier: 0.1.25 version: 0.1.25 @@ -449,8 +449,8 @@ importers: version: 4.10.2 devDependencies: '@rslib/core': - specifier: 0.19.0 - version: 0.19.0(@microsoft/api-extractor@7.55.2(@types/node@20.19.27))(typescript@5.9.3) + specifier: 0.19.1 + version: 0.19.1(@microsoft/api-extractor@7.55.2(@types/node@20.19.27))(typescript@5.9.3) '@rspack/core': specifier: workspace:* version: link:../rspack @@ -733,8 +733,8 @@ importers: specifier: workspace:* version: link:../../packages/rspack-test-tools '@rstest/core': - specifier: ^0.7.7 - version: 0.7.7(jsdom@26.1.0) + specifier: ^0.7.8 + version: 0.7.8(jsdom@26.1.0) '@swc/helpers': specifier: 0.5.18 version: 0.5.18 @@ -957,7 +957,7 @@ importers: devDependencies: '@rsbuild/plugin-sass': specifier: ^1.4.0 - version: 1.4.0(@rsbuild/core@1.7.0-beta.2) + version: 1.4.0(@rsbuild/core@1.7.2) '@rspress/core': specifier: 2.0.0-rc.4 version: 2.0.0-rc.4(@types/react@19.2.7) @@ -1002,10 +1002,10 @@ importers: version: 1.0.4 rsbuild-plugin-google-analytics: specifier: 1.0.4 - version: 1.0.4(@rsbuild/core@1.7.0-beta.2) + version: 1.0.4(@rsbuild/core@1.7.2) rsbuild-plugin-open-graph: specifier: 1.1.0 - version: 1.1.0(@rsbuild/core@1.7.0-beta.2) + version: 1.1.0(@rsbuild/core@1.7.2) rspress-plugin-font-open-sans: specifier: 1.0.3 version: 1.0.3(@rspress/core@2.0.0-rc.4(@types/react@19.2.7)) @@ -1142,8 +1142,8 @@ packages: cpu: [arm64] os: [darwin] - '@ast-grep/napi-darwin-arm64@0.40.3': - resolution: {integrity: sha512-uIUecbLHjGE2HHSrCH2jzpjekPFaHOnBkqhUkMmfNUTG5c3H/4zSUDcWRLalFPOlNBgHtKGPe/RcIYGfC7Uk6Q==} + '@ast-grep/napi-darwin-arm64@0.40.4': + resolution: {integrity: sha512-UIkpoEExRghZe5wN6QXGkDzI65zKVoaBQowAzmEd3MCGP8VlAK3FoxDMdy0OLgQVTyRUdBUwG384WpxiWilYEw==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] @@ -1154,8 +1154,8 @@ packages: cpu: [x64] os: [darwin] - '@ast-grep/napi-darwin-x64@0.40.3': - resolution: {integrity: sha512-j6wNLb0LGNpKCkCYRd4zDWe5Q/+1CSKP62WtKgvACEvlLw4nMldxE6TnNYZpZddV7wG+Rb+tfuih33rB4h+dZA==} + '@ast-grep/napi-darwin-x64@0.40.4': + resolution: {integrity: sha512-derMkDWiMFjRlcN0SEHXNPeZ67OGR5So6b4r/+ETvZMZavLQv+ER0vevltFS4ci8m402g7l/wVOdSE1oHcN2Iw==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] @@ -1166,8 +1166,8 @@ packages: cpu: [arm64] os: [linux] - '@ast-grep/napi-linux-arm64-gnu@0.40.3': - resolution: {integrity: sha512-/KNX7byCcXrmPXLbtBExJSjajVxlgwl3rlFxtDZvgPAoIa+kpTZ4IGKgciNaUi0TXEpJsq9mPvVHLR2WpP52rA==} + '@ast-grep/napi-linux-arm64-gnu@0.40.4': + resolution: {integrity: sha512-1CeDsK6WRMz169mTXLfXdn2GkQAsMkYbqGd7mHDa2VqutJwDYrqe6t4QiFAlr+LRT2bQuExpPh3AiC8BNd6UQQ==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] @@ -1178,8 +1178,8 @@ packages: cpu: [arm64] os: [linux] - '@ast-grep/napi-linux-arm64-musl@0.40.3': - resolution: {integrity: sha512-w5ivvONb3zb6AigCvl0sr+O4WYgMziQg+I4n4JDdYu8rCGLUBc0WSb4++nmEY0KSNbHxKYVduLIPaEtXKUVhdg==} + '@ast-grep/napi-linux-arm64-musl@0.40.4': + resolution: {integrity: sha512-VqjL9Xbq5NNXexY4rluaFtpuHHGbcNIwFXInbm8hdaZS3Rsr9tz+QCEhDNO4IJgPtcRUOpa7AIztZotwxrb/iw==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] @@ -1190,8 +1190,8 @@ packages: cpu: [x64] os: [linux] - '@ast-grep/napi-linux-x64-gnu@0.40.3': - resolution: {integrity: sha512-3W1I9hKREFR/Wpu443C7RCR7s3kIP61eBDaevpJcO3Xi99+t2UNas6p765oqv08M7DOxJoTbC4OpI9GybD0aUA==} + '@ast-grep/napi-linux-x64-gnu@0.40.4': + resolution: {integrity: sha512-6BrPYjP+Gr+mkI3z3Xh/UHkOedJ25qKGdhRwbYteeK/QX3rWeuuo/tUjow4nh/8ewhk04wHGw/G96OiF47ICjA==} engines: {node: '>= 10'} cpu: [x64] os: [linux] @@ -1202,8 +1202,8 @@ packages: cpu: [x64] os: [linux] - '@ast-grep/napi-linux-x64-musl@0.40.3': - resolution: {integrity: sha512-A7W/iRlkuGQG7qR6ov4QZjk7/1QPSxTOLxQFHjvdUUEa5Eklv85YMpMCi38v9NI2PP9fBFNB/dQisf6cvQUoLA==} + '@ast-grep/napi-linux-x64-musl@0.40.4': + resolution: {integrity: sha512-4LGq6xYmOsgEycx4Cu9CdyNYa99O/C1bOsZi09T0C/NifKR+55v8og6nZrGCwsKEs4jWresdal4p7WXw3k8+0g==} engines: {node: '>= 10'} cpu: [x64] os: [linux] @@ -1214,8 +1214,8 @@ packages: cpu: [arm64] os: [win32] - '@ast-grep/napi-win32-arm64-msvc@0.40.3': - resolution: {integrity: sha512-nvBtz+g0d0eNIJo8+ryP2pETuGg1K5Up5AwDWQ+dbfQq3xvuL/kSseG+3MwNp6ASWjL3OZ/JinTDo6r3p/BocA==} + '@ast-grep/napi-win32-arm64-msvc@0.40.4': + resolution: {integrity: sha512-QrI9m9wmFYTRnyTsYOX+9/D/B+h0eyFqZf2qh/U3kbRU/ZZJnxI75YjYVjtoa2QI4oEJlzYb0QhKAN8NKIDYRA==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] @@ -1226,8 +1226,8 @@ packages: cpu: [ia32] os: [win32] - '@ast-grep/napi-win32-ia32-msvc@0.40.3': - resolution: {integrity: sha512-4oiHlAEuD8BcdtDPGhodN9vBzW7P2z0YU1Yeau5rEzLrfwi2SHptfTDsmngBAKLYXoRqHHs9T4E5ZENnDs6SQA==} + '@ast-grep/napi-win32-ia32-msvc@0.40.4': + resolution: {integrity: sha512-JLhcgCUD7e74rZ39XLEfUOU26TQboJltzHir2oSpvjZPtq4aBHEJOynq7dGABZdMrzRUOPdbBdM+nFzPiU38iQ==} engines: {node: '>= 10'} cpu: [ia32] os: [win32] @@ -1238,8 +1238,8 @@ packages: cpu: [x64] os: [win32] - '@ast-grep/napi-win32-x64-msvc@0.40.3': - resolution: {integrity: sha512-aZijW9FjFlUaC9NBv8f+yAR5Ql5tPtBPNBZkyy6GcOPiiHSjZKObvNJxIiw5KsQ26mTtZzq/l7z3t/z3lDqWWA==} + '@ast-grep/napi-win32-x64-msvc@0.40.4': + resolution: {integrity: sha512-DdsqVs/kg4Iun8GU8GoOw9L9WkT2pVLAZ+1hV9t+PsdI6SR3HGRIUIJSzKz2uejr8tY8evTZmdjBWyjUav8qbQ==} engines: {node: '>= 10'} cpu: [x64] os: [win32] @@ -1248,8 +1248,8 @@ packages: resolution: {integrity: sha512-Hb4o6h1Pf6yRUAX07DR4JVY7dmQw+RVQMW5/m55GoiAT/VRoKCWBtIUPPOnqDVhbx1Cjfil9b6EDrgJsUAujEQ==} engines: {node: '>= 10'} - '@ast-grep/napi@0.40.3': - resolution: {integrity: sha512-pRChD3a571FjQndLyabnrrZ5N3T0n68Q+6LyJz5SaZs/gc/TA0s4+UuoL12GEx/oqmaHHYOhnaFW0WB6dvI6fA==} + '@ast-grep/napi@0.40.4': + resolution: {integrity: sha512-unRhSrSn4X0tf7nCuj300rBrlrXqtGbKanFX75CNmn2NM+NyPrdvq1tdDk2F+XA8Z574MynpSeCESii3WBK+bw==} engines: {node: '>= 10'} '@babel/code-frame@7.27.1': @@ -1456,55 +1456,55 @@ packages: resolution: {integrity: sha512-qQ5m48eI/MFLQ5PxQj4PFaprjyCTLI37ElWMmNs0K8Lk3dVeOdNpB3ks8jc7yM5CDmVC73eMVk/trk3fgmrUpA==} engines: {node: '>=6.9.0'} - '@biomejs/biome@2.3.10': - resolution: {integrity: sha512-/uWSUd1MHX2fjqNLHNL6zLYWBbrJeG412/8H7ESuK8ewoRoMPUgHDebqKrPTx/5n6f17Xzqc9hdg3MEqA5hXnQ==} + '@biomejs/biome@2.3.11': + resolution: {integrity: sha512-/zt+6qazBWguPG6+eWmiELqO+9jRsMZ/DBU3lfuU2ngtIQYzymocHhKiZRyrbra4aCOoyTg/BmY+6WH5mv9xmQ==} engines: {node: '>=14.21.3'} hasBin: true - '@biomejs/cli-darwin-arm64@2.3.10': - resolution: {integrity: sha512-M6xUjtCVnNGFfK7HMNKa593nb7fwNm43fq1Mt71kpLpb+4mE7odO8W/oWVDyBVO4ackhresy1ZYO7OJcVo/B7w==} + '@biomejs/cli-darwin-arm64@2.3.11': + resolution: {integrity: sha512-/uXXkBcPKVQY7rc9Ys2CrlirBJYbpESEDme7RKiBD6MmqR2w3j0+ZZXRIL2xiaNPsIMMNhP1YnA+jRRxoOAFrA==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [darwin] - '@biomejs/cli-darwin-x64@2.3.10': - resolution: {integrity: sha512-Vae7+V6t/Avr8tVbFNjnFSTKZogZHFYl7MMH62P/J1kZtr0tyRQ9Fe0onjqjS2Ek9lmNLmZc/VR5uSekh+p1fg==} + '@biomejs/cli-darwin-x64@2.3.11': + resolution: {integrity: sha512-fh7nnvbweDPm2xEmFjfmq7zSUiox88plgdHF9OIW4i99WnXrAC3o2P3ag9judoUMv8FCSUnlwJCM1B64nO5Fbg==} engines: {node: '>=14.21.3'} cpu: [x64] os: [darwin] - '@biomejs/cli-linux-arm64-musl@2.3.10': - resolution: {integrity: sha512-B9DszIHkuKtOH2IFeeVkQmSMVUjss9KtHaNXquYYWCjH8IstNgXgx5B0aSBQNr6mn4RcKKRQZXn9Zu1rM3O0/A==} + '@biomejs/cli-linux-arm64-musl@2.3.11': + resolution: {integrity: sha512-XPSQ+XIPZMLaZ6zveQdwNjbX+QdROEd1zPgMwD47zvHV+tCGB88VH+aynyGxAHdzL+Tm/+DtKST5SECs4iwCLg==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] - '@biomejs/cli-linux-arm64@2.3.10': - resolution: {integrity: sha512-hhPw2V3/EpHKsileVOFynuWiKRgFEV48cLe0eA+G2wO4SzlwEhLEB9LhlSrVeu2mtSn205W283LkX7Fh48CaxA==} + '@biomejs/cli-linux-arm64@2.3.11': + resolution: {integrity: sha512-l4xkGa9E7Uc0/05qU2lMYfN1H+fzzkHgaJoy98wO+b/7Gl78srbCRRgwYSW+BTLixTBrM6Ede5NSBwt7rd/i6g==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] - '@biomejs/cli-linux-x64-musl@2.3.10': - resolution: {integrity: sha512-QTfHZQh62SDFdYc2nfmZFuTm5yYb4eO1zwfB+90YxUumRCR171tS1GoTX5OD0wrv4UsziMPmrePMtkTnNyYG3g==} + '@biomejs/cli-linux-x64-musl@2.3.11': + resolution: {integrity: sha512-vU7a8wLs5C9yJ4CB8a44r12aXYb8yYgBn+WeyzbMjaCMklzCv1oXr8x+VEyWodgJt9bDmhiaW/I0RHbn7rsNmw==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] - '@biomejs/cli-linux-x64@2.3.10': - resolution: {integrity: sha512-wwAkWD1MR95u+J4LkWP74/vGz+tRrIQvr8kfMMJY8KOQ8+HMVleREOcPYsQX82S7uueco60L58Wc6M1I9WA9Dw==} + '@biomejs/cli-linux-x64@2.3.11': + resolution: {integrity: sha512-/1s9V/H3cSe0r0Mv/Z8JryF5x9ywRxywomqZVLHAoa/uN0eY7F8gEngWKNS5vbbN/BsfpCG5yeBT5ENh50Frxg==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] - '@biomejs/cli-win32-arm64@2.3.10': - resolution: {integrity: sha512-o7lYc9n+CfRbHvkjPhm8s9FgbKdYZu5HCcGVMItLjz93EhgJ8AM44W+QckDqLA9MKDNFrR8nPbO4b73VC5kGGQ==} + '@biomejs/cli-win32-arm64@2.3.11': + resolution: {integrity: sha512-PZQ6ElCOnkYapSsysiTy0+fYX+agXPlWugh6+eQ6uPKI3vKAqNp6TnMhoM3oY2NltSB89hz59o8xIfOdyhi9Iw==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [win32] - '@biomejs/cli-win32-x64@2.3.10': - resolution: {integrity: sha512-pHEFgq7dUEsKnqG9mx9bXihxGI49X+ar+UBrEIj3Wqj3UCZp1rNgV+OoyjFgcXsjCWpuEAF4VJdkZr3TrWdCbQ==} + '@biomejs/cli-win32-x64@2.3.11': + resolution: {integrity: sha512-43VrG813EW+b5+YbDbz31uUsheX+qFKCpXeY9kfdAx+ww3naKxeVkTD9zLIWxUPfJquANMHrmW3wbe/037G0Qg==} engines: {node: '>=14.21.3'} cpu: [x64] os: [win32] @@ -3203,13 +3203,13 @@ packages: engines: {node: '>=18.12.0'} hasBin: true - '@rsbuild/core@1.7.0-beta.1': - resolution: {integrity: sha512-qQ9jKF0GzUI2a53Ql18p252PBPBRVnLWQQXOWevolHNakSrTQ+ESD9pK0AvmJIF8TiQ7qaSccEzrisTg+EQfEA==} + '@rsbuild/core@1.7.1': + resolution: {integrity: sha512-ULIE/Qh+Ne80Pm/aUPbRHUvwvIzpap07jYNFB47azI8w5Q3sDEC4Gn574jsluT/42iNDsZTFADRBog9FEvtN9Q==} engines: {node: '>=18.12.0'} hasBin: true - '@rsbuild/core@1.7.0-beta.2': - resolution: {integrity: sha512-sPJ21GTJiX9dTj9xtB10ZFbWMdX2PML0MgF98msaLLVDpwYGa8kvS6jFGO+L2T+zbuWFxfMYdU7a8jX6G4JRsQ==} + '@rsbuild/core@1.7.2': + resolution: {integrity: sha512-VAFO6cM+cyg2ntxNW6g3tB2Jc5J5mpLjLluvm7VtW2uceNzyUlVv41o66Yp1t1ikxd3ljtqegViXem62JqzveA==} engines: {node: '>=18.12.0'} hasBin: true @@ -3231,8 +3231,8 @@ packages: peerDependencies: '@rsbuild/core': 1.x - '@rslib/core@0.19.0': - resolution: {integrity: sha512-t94QnZGU8YSn5xQ8vNqxIpee5Mo+S77SEVA/0Tjft0I0dLmU6GZHeYAmoztNfWLudSUl4KrvilnxGPlySMdPvw==} + '@rslib/core@0.19.1': + resolution: {integrity: sha512-Fz+uknjf9BRE6tNax7zcZOZ8FX3FLT5kKcR10vHdo6IgCaMZpJxQmM62NNfv21kdy5u1PdIRgKFVpqP2QTarfg==} engines: {node: '>=18.12.0'} hasBin: true peerDependencies: @@ -3283,8 +3283,13 @@ packages: cpu: [arm64] os: [darwin] - '@rspack/binding-darwin-arm64@1.7.0-beta.1': - resolution: {integrity: sha512-UR+WRtuRttu1dMY8lIP3qHcDVjRfz8RtS5KegUw7EArmOMDQBUpZtc+xporXnKr/bf6FTdwUpUh2KTJ9Ss3H2Q==} + '@rspack/binding-darwin-arm64@1.7.0': + resolution: {integrity: sha512-HMYrhvVh3sMRBXl6cSI2JqsvlHJKQ42qX+Sw4qbj7LeZBN6Gv4GjfL3cXRLUTdO37FOC0uLEUYgxVXetx/Y4sA==} + cpu: [arm64] + os: [darwin] + + '@rspack/binding-darwin-arm64@1.7.1': + resolution: {integrity: sha512-3C0w0kfCHfgOH+AP/Dx1bm/b3AR/or5CmU22Abevek0m95ndU3iT902eLcm9JNiMQnDQLBQbolfj5P591t0oPg==} cpu: [arm64] os: [darwin] @@ -3293,8 +3298,13 @@ packages: cpu: [x64] os: [darwin] - '@rspack/binding-darwin-x64@1.7.0-beta.1': - resolution: {integrity: sha512-wPR3uE0PXL+AUHI7rH2SKAYxinjjhiVOLgE+KxeHQwx5P3G1GjmMi9b+vif/NRTDNyFYS0VnxHFMb7Ja5rFhRw==} + '@rspack/binding-darwin-x64@1.7.0': + resolution: {integrity: sha512-R/SoR04ySmHPqoIBGC+SjP9zRGjL1fS908mdwBvQ1RfFinKu7a/o/5rxH/vxUUsVQrHCyX+o7YXpfWq9xpvyQA==} + cpu: [x64] + os: [darwin] + + '@rspack/binding-darwin-x64@1.7.1': + resolution: {integrity: sha512-HTrBpdw2gWwcpJ3c8h4JF8B1YRNvrFT+K620ycttrlu/HvI4/U770BBJ/ej36R/hdh59JvMCGe+w49FyXv6rzg==} cpu: [x64] os: [darwin] @@ -3303,8 +3313,13 @@ packages: cpu: [arm64] os: [linux] - '@rspack/binding-linux-arm64-gnu@1.7.0-beta.1': - resolution: {integrity: sha512-iI+84/jOgLCTfORniIsQFoqwSsT9ppJXCCZS0Hzx9nn5vjZ+i/dmh6C7EwD9pJQgLhuqMLRv9Pd7Cz8zD9pv/A==} + '@rspack/binding-linux-arm64-gnu@1.7.0': + resolution: {integrity: sha512-jDCcso++qshu58+Iuo6oiL0XKuX04lDugL0qwrWHW8SS/EjZ2rc1J3yQx+XDW0PCQsfI2c9ji0IOW56PzW1hXQ==} + cpu: [arm64] + os: [linux] + + '@rspack/binding-linux-arm64-gnu@1.7.1': + resolution: {integrity: sha512-BX9yAPCO0WBFyOzKl9bSXT/cH27nnOJp02smIQMxfv7RNfwGkJg5GgakYcuYG+9U1HEFitBSzmwS2+dxDcAxlg==} cpu: [arm64] os: [linux] @@ -3313,8 +3328,13 @@ packages: cpu: [arm64] os: [linux] - '@rspack/binding-linux-arm64-musl@1.7.0-beta.1': - resolution: {integrity: sha512-EdYWcjXOMTYB+qdR84u2wBwhNlqdwDmiMrL3TnFYh2NH6dQJqEUvzSe7bx2UKOobIkNnVU0wCeT5jZOPnEwXBg==} + '@rspack/binding-linux-arm64-musl@1.7.0': + resolution: {integrity: sha512-0W49s0SQQhr3hZ8Zd7Auyf2pv4OTBr6wQhgWUQ6XeeMEjB16KpAVypSK5Jpn1ON0v9jAPLdod+a255rz8/f3kg==} + cpu: [arm64] + os: [linux] + + '@rspack/binding-linux-arm64-musl@1.7.1': + resolution: {integrity: sha512-maBX19XyiVkxzh/NA79ALetCobc4zUyoWkWLeCGyW5xKzhPVFatJp+qCiHqHkqUZcgRo+1i5ihoZ2bXmelIeZg==} cpu: [arm64] os: [linux] @@ -3323,8 +3343,13 @@ packages: cpu: [x64] os: [linux] - '@rspack/binding-linux-x64-gnu@1.7.0-beta.1': - resolution: {integrity: sha512-3G3bkWnxkGnCn/t4KtU9KHG4lLdmIWF3ApEkXZL0YNHSEg+eFkMm3oVL/YtJUdRNU4QlbL4lwPcuMIDK6FOefw==} + '@rspack/binding-linux-x64-gnu@1.7.0': + resolution: {integrity: sha512-oFjzjTD1MmG0ucAaP0Wyg9eobrsnFwZjEHa7LwyzWDRBeC3GWAF9T04Bqd6Ba6DgASGzU0BjEJcUpjvtXxO95Q==} + cpu: [x64] + os: [linux] + + '@rspack/binding-linux-x64-gnu@1.7.1': + resolution: {integrity: sha512-8KJAeBLiWcN7zEc9aaS7LRJPZVtZuQU8mCsn+fRhdQDSc+a9FcTN8b6Lw29z8cejwbU6Gxr/8wk5XGexMWFaZA==} cpu: [x64] os: [linux] @@ -3333,8 +3358,13 @@ packages: cpu: [x64] os: [linux] - '@rspack/binding-linux-x64-musl@1.7.0-beta.1': - resolution: {integrity: sha512-q5LnITueKNPFFDmOjGU7e17cczr65MXQKC72VvNEpD2lDSqe9GbQ9tmlbG1seWmGKtsRSwi+j1qeZhoC3AQW4w==} + '@rspack/binding-linux-x64-musl@1.7.0': + resolution: {integrity: sha512-MNGslPLOsurdwOcoo6r0u8mLpw1ADar3hkx67WzwwMqYnem/Ky0aANJC2JvQHPC22mu01gCOukHYyEaUFTxcuw==} + cpu: [x64] + os: [linux] + + '@rspack/binding-linux-x64-musl@1.7.1': + resolution: {integrity: sha512-Gn9x5vhKRELvSoZ3ZjquY8eWtCXur0OsYnZ2/ump8mofM6IDaL7Qqu3Hf4Kud31PDH0tfz0jWf9piX32HHPmgg==} cpu: [x64] os: [linux] @@ -3342,8 +3372,12 @@ packages: resolution: {integrity: sha512-VUwdhl/lI4m6o1OGCZ9JwtMjTV/yLY5VZTQdEPKb40JMTlmZ5MBlr5xk7ByaXXYHr6I+qnqEm73iMKQvg6iknw==} cpu: [wasm32] - '@rspack/binding-wasm32-wasi@1.7.0-beta.1': - resolution: {integrity: sha512-cJ41fUloY6RMMMsa5JQ0z13BDDlmMR5NX5LYWB0aY+rppF77EfxaPeNzb9NTL3QKh8zy1OPcZzZ+n27JEWlAXg==} + '@rspack/binding-wasm32-wasi@1.7.0': + resolution: {integrity: sha512-eaZzkGpxzVESmaX/UALMiQO+eNppe/i1VWQksGRfdoUu0rILqr/YDjsWFTcpbI9Dt3fg2kshHawBHxfwtxHcZQ==} + cpu: [wasm32] + + '@rspack/binding-wasm32-wasi@1.7.1': + resolution: {integrity: sha512-2r9M5iVchmsFkp3sz7A5YnMm2TfpkB71LK3AoaRWKMfvf5oFky0GSGISYd2TCBASO+X2Qskaq+B24Szo8zH5FA==} cpu: [wasm32] '@rspack/binding-win32-arm64-msvc@1.6.8': @@ -3351,8 +3385,13 @@ packages: cpu: [arm64] os: [win32] - '@rspack/binding-win32-arm64-msvc@1.7.0-beta.1': - resolution: {integrity: sha512-+Jbx0le019Xc692pD6bqN7pZQDZg1fZuKLpBaI+FINIkJ7JzkCn64UhbxFpcskc1Z8/tBojEvu9FIozVnWq7Kg==} + '@rspack/binding-win32-arm64-msvc@1.7.0': + resolution: {integrity: sha512-XFg4l7sOhupnpG0soOfzYLeF2cgpSJMenmjmdzd9y06CotTyVId0hNoS7y+A7hEP8XGf3YPbdiUL5UDp6+DRBA==} + cpu: [arm64] + os: [win32] + + '@rspack/binding-win32-arm64-msvc@1.7.1': + resolution: {integrity: sha512-/WIHp982yqqqAuiz2WLtf1ofo9d1lHDGZJ7flxFllb1iMgnUeSRyX6stxEi11K3Rg6pQa7FdCZGKX/engyj2bw==} cpu: [arm64] os: [win32] @@ -3361,8 +3400,13 @@ packages: cpu: [ia32] os: [win32] - '@rspack/binding-win32-ia32-msvc@1.7.0-beta.1': - resolution: {integrity: sha512-UOqEsWL8Udp1Fb2YwoY3Na2fo5gwzGW9EXVJ7l0AJEVSKGSwuM/Wk0dD5jmwKYilVzwZ23Dx8hVZreM6/Y33aQ==} + '@rspack/binding-win32-ia32-msvc@1.7.0': + resolution: {integrity: sha512-eWt2XV6la/c0IlU/18RlhQsqwHGShSypwA3kt4s/dpfOK0YB1h4f0fYeUZuvj2X0MIoJQGhMofMrgA35/IcAcw==} + cpu: [ia32] + os: [win32] + + '@rspack/binding-win32-ia32-msvc@1.7.1': + resolution: {integrity: sha512-Kpela29n+kDGGsss6q/3qTd6n9VW7TOQaiA7t1YLdCCl8qqcdKlz/vWjFMd2MqgcSGC/16PvChE4sgpUvryfCQ==} cpu: [ia32] os: [win32] @@ -3371,16 +3415,24 @@ packages: cpu: [x64] os: [win32] - '@rspack/binding-win32-x64-msvc@1.7.0-beta.1': - resolution: {integrity: sha512-YtziYe5sSLcJRItkp4Vq/dKGUV9dBZHwhXGjf44K4AlwEtAblf2GnlzrYfDeZP6uqqCjH0f9A//3+zytO2so0w==} + '@rspack/binding-win32-x64-msvc@1.7.0': + resolution: {integrity: sha512-LOL5G8rfbAwlmusx+t98r9QzuGRz+L9Bg+8s5s6K/Qe64iemcNIuxGr5QLVq1jLa0SGNTeog4N21pAzlkWh4jw==} + cpu: [x64] + os: [win32] + + '@rspack/binding-win32-x64-msvc@1.7.1': + resolution: {integrity: sha512-B/y4MWqP2Xeto1/HV0qtZNOMPSLrEVOqi2b7JSIXG/bhlf+3IAkDzEEoHs+ZikLR4C8hMaS0pVJsDGKFmGzC9A==} cpu: [x64] os: [win32] '@rspack/binding@1.6.8': resolution: {integrity: sha512-lUeL4mbwGo+nqRKqFDCm9vH2jv9FNMVt1X8jqayWRcOCPlj/2UVMEFgqjR7Pp2vlvnTKq//31KbDBJmDZq31RQ==} - '@rspack/binding@1.7.0-beta.1': - resolution: {integrity: sha512-BZXEMduPOyGkqJNRaf90uI2QMSH241S1YwXyK9DKH406sZfUTvIwhE9LFVaEgNucChwJ7DXTriwuBJSHVf0R1Q==} + '@rspack/binding@1.7.0': + resolution: {integrity: sha512-xO+pZKG2dvU9CuRTTi+DcCc4p+CZhBJlvuYikBja/0a62cTntQV2PWV+/xU1a6Vbo89yNz158LR05nvjtKVwTw==} + + '@rspack/binding@1.7.1': + resolution: {integrity: sha512-qVTV1/UWpMSZktvK5A8+HolgR1Qf0nYR3Gg4Vax5x3/BcHDpwGZ0fbdFRUirGVWH/XwxZ81zoI6F2SZq7xbX+w==} '@rspack/core@1.6.8': resolution: {integrity: sha512-FolcIAH5FW4J2FET+qwjd1kNeFbCkd0VLuIHO0thyolEjaPSxw5qxG67DA7BZGm6PVcoiSgPLks1DL6eZ8c+fA==} @@ -3391,8 +3443,17 @@ packages: '@swc/helpers': optional: true - '@rspack/core@1.7.0-beta.1': - resolution: {integrity: sha512-dqLODRPWFCWs4YR34kPT4Gr7ruLBihn4lxM+nf87FiaXKIeb7Ga5K0cnh52t+Wzly6GsdAWZQWmq0pDiqPhy0w==} + '@rspack/core@1.7.0': + resolution: {integrity: sha512-uDxPQsPh/+2DnOISuKnUiXZ9M0y2G1BOsI0IesxPJGp42ME2QW7axbJfUqD3bwp4bi3RN2zqh56NgxU/XETQvA==} + engines: {node: '>=18.12.0'} + peerDependencies: + '@swc/helpers': '>=0.5.1' + peerDependenciesMeta: + '@swc/helpers': + optional: true + + '@rspack/core@1.7.1': + resolution: {integrity: sha512-kRxfY8RRa6nU3/viDvAIP6CRpx+0rfXFRonPL0pHBx8u6HhV7m9rLEyaN6MWsLgNIAWkleFGb7tdo4ux2ljRJQ==} engines: {node: '>=18.12.0'} peerDependencies: '@swc/helpers': '>=0.5.1' @@ -3521,8 +3582,8 @@ packages: '@rstack-dev/doc-ui@1.12.2': resolution: {integrity: sha512-4C+tfhODxCp81ohCik9baOdbhYGNFqdwcwQMAESncF0YX3EawdNCORI1E26DqkY/F3ggfKG4qOlEAu+oOxrPxg==} - '@rstest/core@0.7.7': - resolution: {integrity: sha512-WZSTMcgdrg6BVEZSP6XP0Bl4Ng+riaTmIuJrW4QPGOOefFXxVpPjQ4p1NpMZQAGOVf9qK2jxH+fus0X3/SpNDA==} + '@rstest/core@0.7.8': + resolution: {integrity: sha512-A7oN5GLMYuVkTGjXTH+69nz3wR0lxHUkWax+hVq+jNQmcf81ZqJosTLqN6jwFZdmCfHbj3iTd9ku6boo8tJlnA==} engines: {node: '>=18.12.0'} hasBin: true peerDependencies: @@ -7489,8 +7550,8 @@ packages: rrweb-cssom@0.8.0: resolution: {integrity: sha512-guoltQEx+9aMf2gDZ0s62EcV8lsXR+0w8915TC3ITdn2YueuNjdAYh/levpU9nFaoChh9RUS5ZdQMrKfVEN9tw==} - rsbuild-plugin-dts@0.19.0: - resolution: {integrity: sha512-5NkHONFDMBXv0qr1voHQigVhPmqai2icbJtckXJSCrpSTAJO0eXkGsHNVR8QvnsZEZWXL+KsIgNEJ7C8tYginQ==} + rsbuild-plugin-dts@0.19.1: + resolution: {integrity: sha512-LaK1RAvHPrb/ulfwvZckeui5qkQSKxf1RD7rzBTgK2UY8fMTQgsxsvun/XzfzAOKqdagzIohhnmNd5+j2Niqww==} engines: {node: '>=18.12.0'} peerDependencies: '@microsoft/api-extractor': ^7 @@ -8929,55 +8990,55 @@ snapshots: '@ast-grep/napi-darwin-arm64@0.37.0': optional: true - '@ast-grep/napi-darwin-arm64@0.40.3': + '@ast-grep/napi-darwin-arm64@0.40.4': optional: true '@ast-grep/napi-darwin-x64@0.37.0': optional: true - '@ast-grep/napi-darwin-x64@0.40.3': + '@ast-grep/napi-darwin-x64@0.40.4': optional: true '@ast-grep/napi-linux-arm64-gnu@0.37.0': optional: true - '@ast-grep/napi-linux-arm64-gnu@0.40.3': + '@ast-grep/napi-linux-arm64-gnu@0.40.4': optional: true '@ast-grep/napi-linux-arm64-musl@0.37.0': optional: true - '@ast-grep/napi-linux-arm64-musl@0.40.3': + '@ast-grep/napi-linux-arm64-musl@0.40.4': optional: true '@ast-grep/napi-linux-x64-gnu@0.37.0': optional: true - '@ast-grep/napi-linux-x64-gnu@0.40.3': + '@ast-grep/napi-linux-x64-gnu@0.40.4': optional: true '@ast-grep/napi-linux-x64-musl@0.37.0': optional: true - '@ast-grep/napi-linux-x64-musl@0.40.3': + '@ast-grep/napi-linux-x64-musl@0.40.4': optional: true '@ast-grep/napi-win32-arm64-msvc@0.37.0': optional: true - '@ast-grep/napi-win32-arm64-msvc@0.40.3': + '@ast-grep/napi-win32-arm64-msvc@0.40.4': optional: true '@ast-grep/napi-win32-ia32-msvc@0.37.0': optional: true - '@ast-grep/napi-win32-ia32-msvc@0.40.3': + '@ast-grep/napi-win32-ia32-msvc@0.40.4': optional: true '@ast-grep/napi-win32-x64-msvc@0.37.0': optional: true - '@ast-grep/napi-win32-x64-msvc@0.40.3': + '@ast-grep/napi-win32-x64-msvc@0.40.4': optional: true '@ast-grep/napi@0.37.0': @@ -8992,17 +9053,17 @@ snapshots: '@ast-grep/napi-win32-ia32-msvc': 0.37.0 '@ast-grep/napi-win32-x64-msvc': 0.37.0 - '@ast-grep/napi@0.40.3': + '@ast-grep/napi@0.40.4': optionalDependencies: - '@ast-grep/napi-darwin-arm64': 0.40.3 - '@ast-grep/napi-darwin-x64': 0.40.3 - '@ast-grep/napi-linux-arm64-gnu': 0.40.3 - '@ast-grep/napi-linux-arm64-musl': 0.40.3 - '@ast-grep/napi-linux-x64-gnu': 0.40.3 - '@ast-grep/napi-linux-x64-musl': 0.40.3 - '@ast-grep/napi-win32-arm64-msvc': 0.40.3 - '@ast-grep/napi-win32-ia32-msvc': 0.40.3 - '@ast-grep/napi-win32-x64-msvc': 0.40.3 + '@ast-grep/napi-darwin-arm64': 0.40.4 + '@ast-grep/napi-darwin-x64': 0.40.4 + '@ast-grep/napi-linux-arm64-gnu': 0.40.4 + '@ast-grep/napi-linux-arm64-musl': 0.40.4 + '@ast-grep/napi-linux-x64-gnu': 0.40.4 + '@ast-grep/napi-linux-x64-musl': 0.40.4 + '@ast-grep/napi-win32-arm64-msvc': 0.40.4 + '@ast-grep/napi-win32-ia32-msvc': 0.40.4 + '@ast-grep/napi-win32-x64-msvc': 0.40.4 '@babel/code-frame@7.27.1': dependencies: @@ -9272,39 +9333,39 @@ snapshots: '@babel/helper-string-parser': 7.27.1 '@babel/helper-validator-identifier': 7.28.5 - '@biomejs/biome@2.3.10': + '@biomejs/biome@2.3.11': optionalDependencies: - '@biomejs/cli-darwin-arm64': 2.3.10 - '@biomejs/cli-darwin-x64': 2.3.10 - '@biomejs/cli-linux-arm64': 2.3.10 - '@biomejs/cli-linux-arm64-musl': 2.3.10 - '@biomejs/cli-linux-x64': 2.3.10 - '@biomejs/cli-linux-x64-musl': 2.3.10 - '@biomejs/cli-win32-arm64': 2.3.10 - '@biomejs/cli-win32-x64': 2.3.10 - - '@biomejs/cli-darwin-arm64@2.3.10': + '@biomejs/cli-darwin-arm64': 2.3.11 + '@biomejs/cli-darwin-x64': 2.3.11 + '@biomejs/cli-linux-arm64': 2.3.11 + '@biomejs/cli-linux-arm64-musl': 2.3.11 + '@biomejs/cli-linux-x64': 2.3.11 + '@biomejs/cli-linux-x64-musl': 2.3.11 + '@biomejs/cli-win32-arm64': 2.3.11 + '@biomejs/cli-win32-x64': 2.3.11 + + '@biomejs/cli-darwin-arm64@2.3.11': optional: true - '@biomejs/cli-darwin-x64@2.3.10': + '@biomejs/cli-darwin-x64@2.3.11': optional: true - '@biomejs/cli-linux-arm64-musl@2.3.10': + '@biomejs/cli-linux-arm64-musl@2.3.11': optional: true - '@biomejs/cli-linux-arm64@2.3.10': + '@biomejs/cli-linux-arm64@2.3.11': optional: true - '@biomejs/cli-linux-x64-musl@2.3.10': + '@biomejs/cli-linux-x64-musl@2.3.11': optional: true - '@biomejs/cli-linux-x64@2.3.10': + '@biomejs/cli-linux-x64@2.3.11': optional: true - '@biomejs/cli-win32-arm64@2.3.10': + '@biomejs/cli-win32-arm64@2.3.11': optional: true - '@biomejs/cli-win32-x64@2.3.10': + '@biomejs/cli-win32-x64@2.3.11': optional: true '@braintree/sanitize-url@7.1.1': {} @@ -10724,23 +10785,23 @@ snapshots: core-js: 3.47.0 jiti: 2.6.1 - '@rsbuild/core@1.7.0-beta.1': + '@rsbuild/core@1.7.1': dependencies: - '@rspack/core': 1.7.0-beta.1(@swc/helpers@0.5.18) + '@rspack/core': 1.7.0(@swc/helpers@0.5.18) '@rspack/lite-tapable': 1.1.0 '@swc/helpers': 0.5.18 core-js: 3.47.0 jiti: 2.6.1 - '@rsbuild/core@1.7.0-beta.2': + '@rsbuild/core@1.7.2': dependencies: - '@rspack/core': 1.7.0-beta.1(@swc/helpers@0.5.18) + '@rspack/core': 1.7.1(@swc/helpers@0.5.18) '@rspack/lite-tapable': 1.1.0 '@swc/helpers': 0.5.18 core-js: 3.47.0 jiti: 2.6.1 - '@rsbuild/plugin-node-polyfill@1.4.2(@rsbuild/core@1.6.15)': + '@rsbuild/plugin-node-polyfill@1.4.2(@rsbuild/core@1.7.2)': dependencies: assert: 2.1.0 browserify-zlib: 0.2.0 @@ -10766,7 +10827,7 @@ snapshots: util: 0.12.5 vm-browserify: 1.1.2 optionalDependencies: - '@rsbuild/core': 1.6.15 + '@rsbuild/core': 1.7.2 '@rsbuild/plugin-react@1.4.2(@rsbuild/core@1.6.15)': dependencies: @@ -10776,19 +10837,19 @@ snapshots: transitivePeerDependencies: - webpack-hot-middleware - '@rsbuild/plugin-sass@1.4.0(@rsbuild/core@1.7.0-beta.2)': + '@rsbuild/plugin-sass@1.4.0(@rsbuild/core@1.7.2)': dependencies: - '@rsbuild/core': 1.7.0-beta.2 + '@rsbuild/core': 1.7.2 deepmerge: 4.3.1 loader-utils: 2.0.4 postcss: 8.5.6 reduce-configs: 1.1.1 sass-embedded: 1.93.2 - '@rslib/core@0.19.0(@microsoft/api-extractor@7.55.2(@types/node@20.19.27))(typescript@5.9.3)': + '@rslib/core@0.19.1(@microsoft/api-extractor@7.55.2(@types/node@20.19.27))(typescript@5.9.3)': dependencies: - '@rsbuild/core': 1.7.0-beta.2 - rsbuild-plugin-dts: 0.19.0(@microsoft/api-extractor@7.55.2(@types/node@20.19.27))(@rsbuild/core@1.7.0-beta.2)(typescript@5.9.3) + '@rsbuild/core': 1.7.2 + rsbuild-plugin-dts: 0.19.1(@microsoft/api-extractor@7.55.2(@types/node@20.19.27))(@rsbuild/core@1.7.2)(typescript@5.9.3) optionalDependencies: '@microsoft/api-extractor': 7.55.2(@types/node@20.19.27) typescript: 5.9.3 @@ -10825,37 +10886,55 @@ snapshots: '@rspack/binding-darwin-arm64@1.6.8': optional: true - '@rspack/binding-darwin-arm64@1.7.0-beta.1': + '@rspack/binding-darwin-arm64@1.7.0': + optional: true + + '@rspack/binding-darwin-arm64@1.7.1': optional: true '@rspack/binding-darwin-x64@1.6.8': optional: true - '@rspack/binding-darwin-x64@1.7.0-beta.1': + '@rspack/binding-darwin-x64@1.7.0': + optional: true + + '@rspack/binding-darwin-x64@1.7.1': optional: true '@rspack/binding-linux-arm64-gnu@1.6.8': optional: true - '@rspack/binding-linux-arm64-gnu@1.7.0-beta.1': + '@rspack/binding-linux-arm64-gnu@1.7.0': + optional: true + + '@rspack/binding-linux-arm64-gnu@1.7.1': optional: true '@rspack/binding-linux-arm64-musl@1.6.8': optional: true - '@rspack/binding-linux-arm64-musl@1.7.0-beta.1': + '@rspack/binding-linux-arm64-musl@1.7.0': + optional: true + + '@rspack/binding-linux-arm64-musl@1.7.1': optional: true '@rspack/binding-linux-x64-gnu@1.6.8': optional: true - '@rspack/binding-linux-x64-gnu@1.7.0-beta.1': + '@rspack/binding-linux-x64-gnu@1.7.0': + optional: true + + '@rspack/binding-linux-x64-gnu@1.7.1': optional: true '@rspack/binding-linux-x64-musl@1.6.8': optional: true - '@rspack/binding-linux-x64-musl@1.7.0-beta.1': + '@rspack/binding-linux-x64-musl@1.7.0': + optional: true + + '@rspack/binding-linux-x64-musl@1.7.1': optional: true '@rspack/binding-wasm32-wasi@1.6.8': @@ -10863,7 +10942,12 @@ snapshots: '@napi-rs/wasm-runtime': 1.0.7 optional: true - '@rspack/binding-wasm32-wasi@1.7.0-beta.1': + '@rspack/binding-wasm32-wasi@1.7.0': + dependencies: + '@napi-rs/wasm-runtime': 1.0.7 + optional: true + + '@rspack/binding-wasm32-wasi@1.7.1': dependencies: '@napi-rs/wasm-runtime': 1.0.7 optional: true @@ -10871,19 +10955,28 @@ snapshots: '@rspack/binding-win32-arm64-msvc@1.6.8': optional: true - '@rspack/binding-win32-arm64-msvc@1.7.0-beta.1': + '@rspack/binding-win32-arm64-msvc@1.7.0': + optional: true + + '@rspack/binding-win32-arm64-msvc@1.7.1': optional: true '@rspack/binding-win32-ia32-msvc@1.6.8': optional: true - '@rspack/binding-win32-ia32-msvc@1.7.0-beta.1': + '@rspack/binding-win32-ia32-msvc@1.7.0': + optional: true + + '@rspack/binding-win32-ia32-msvc@1.7.1': optional: true '@rspack/binding-win32-x64-msvc@1.6.8': optional: true - '@rspack/binding-win32-x64-msvc@1.7.0-beta.1': + '@rspack/binding-win32-x64-msvc@1.7.0': + optional: true + + '@rspack/binding-win32-x64-msvc@1.7.1': optional: true '@rspack/binding@1.6.8': @@ -10899,18 +10992,31 @@ snapshots: '@rspack/binding-win32-ia32-msvc': 1.6.8 '@rspack/binding-win32-x64-msvc': 1.6.8 - '@rspack/binding@1.7.0-beta.1': + '@rspack/binding@1.7.0': + optionalDependencies: + '@rspack/binding-darwin-arm64': 1.7.0 + '@rspack/binding-darwin-x64': 1.7.0 + '@rspack/binding-linux-arm64-gnu': 1.7.0 + '@rspack/binding-linux-arm64-musl': 1.7.0 + '@rspack/binding-linux-x64-gnu': 1.7.0 + '@rspack/binding-linux-x64-musl': 1.7.0 + '@rspack/binding-wasm32-wasi': 1.7.0 + '@rspack/binding-win32-arm64-msvc': 1.7.0 + '@rspack/binding-win32-ia32-msvc': 1.7.0 + '@rspack/binding-win32-x64-msvc': 1.7.0 + + '@rspack/binding@1.7.1': optionalDependencies: - '@rspack/binding-darwin-arm64': 1.7.0-beta.1 - '@rspack/binding-darwin-x64': 1.7.0-beta.1 - '@rspack/binding-linux-arm64-gnu': 1.7.0-beta.1 - '@rspack/binding-linux-arm64-musl': 1.7.0-beta.1 - '@rspack/binding-linux-x64-gnu': 1.7.0-beta.1 - '@rspack/binding-linux-x64-musl': 1.7.0-beta.1 - '@rspack/binding-wasm32-wasi': 1.7.0-beta.1 - '@rspack/binding-win32-arm64-msvc': 1.7.0-beta.1 - '@rspack/binding-win32-ia32-msvc': 1.7.0-beta.1 - '@rspack/binding-win32-x64-msvc': 1.7.0-beta.1 + '@rspack/binding-darwin-arm64': 1.7.1 + '@rspack/binding-darwin-x64': 1.7.1 + '@rspack/binding-linux-arm64-gnu': 1.7.1 + '@rspack/binding-linux-arm64-musl': 1.7.1 + '@rspack/binding-linux-x64-gnu': 1.7.1 + '@rspack/binding-linux-x64-musl': 1.7.1 + '@rspack/binding-wasm32-wasi': 1.7.1 + '@rspack/binding-win32-arm64-msvc': 1.7.1 + '@rspack/binding-win32-ia32-msvc': 1.7.1 + '@rspack/binding-win32-x64-msvc': 1.7.1 '@rspack/core@1.6.8(@swc/helpers@0.5.18)': dependencies: @@ -10920,10 +11026,18 @@ snapshots: optionalDependencies: '@swc/helpers': 0.5.18 - '@rspack/core@1.7.0-beta.1(@swc/helpers@0.5.18)': + '@rspack/core@1.7.0(@swc/helpers@0.5.18)': dependencies: - '@module-federation/runtime-tools': 0.21.6 - '@rspack/binding': 1.7.0-beta.1 + '@module-federation/runtime-tools': 0.22.0 + '@rspack/binding': 1.7.0 + '@rspack/lite-tapable': 1.1.0 + optionalDependencies: + '@swc/helpers': 0.5.18 + + '@rspack/core@1.7.1(@swc/helpers@0.5.18)': + dependencies: + '@module-federation/runtime-tools': 0.22.0 + '@rspack/binding': 1.7.1 '@rspack/lite-tapable': 1.1.0 optionalDependencies: '@swc/helpers': 0.5.18 @@ -11120,9 +11234,9 @@ snapshots: - react - react-dom - '@rstest/core@0.7.7(jsdom@26.1.0)': + '@rstest/core@0.7.8(jsdom@26.1.0)': dependencies: - '@rsbuild/core': 1.7.0-beta.1 + '@rsbuild/core': 1.7.1 '@types/chai': 5.2.3 tinypool: 1.1.1 optionalDependencies: @@ -15966,21 +16080,21 @@ snapshots: rrweb-cssom@0.8.0: {} - rsbuild-plugin-dts@0.19.0(@microsoft/api-extractor@7.55.2(@types/node@20.19.27))(@rsbuild/core@1.7.0-beta.2)(typescript@5.9.3): + rsbuild-plugin-dts@0.19.1(@microsoft/api-extractor@7.55.2(@types/node@20.19.27))(@rsbuild/core@1.7.2)(typescript@5.9.3): dependencies: '@ast-grep/napi': 0.37.0 - '@rsbuild/core': 1.7.0-beta.2 + '@rsbuild/core': 1.7.2 optionalDependencies: '@microsoft/api-extractor': 7.55.2(@types/node@20.19.27) typescript: 5.9.3 - rsbuild-plugin-google-analytics@1.0.4(@rsbuild/core@1.7.0-beta.2): + rsbuild-plugin-google-analytics@1.0.4(@rsbuild/core@1.7.2): optionalDependencies: - '@rsbuild/core': 1.7.0-beta.2 + '@rsbuild/core': 1.7.2 - rsbuild-plugin-open-graph@1.1.0(@rsbuild/core@1.7.0-beta.2): + rsbuild-plugin-open-graph@1.1.0(@rsbuild/core@1.7.2): optionalDependencies: - '@rsbuild/core': 1.7.0-beta.2 + '@rsbuild/core': 1.7.2 rspress-plugin-font-open-sans@1.0.3(@rspress/core@2.0.0-rc.4(@types/react@19.2.7)): dependencies: diff --git a/rslint.json b/rslint.json index 6b2ff6dabad6..937303190a4c 100644 --- a/rslint.json +++ b/rslint.json @@ -25,10 +25,9 @@ "@typescript-eslint/no-confusing-void-expression": "off", "@typescript-eslint/promise-function-async": "off", "@typescript-eslint/use-unknown-in-catch-callback-variable": "off", - "@typescript-eslint/require-await": "off", + "@typescript-eslint/require-await": "error", "@typescript-eslint/switch-exhaustiveness-check": "off", - "@typescript-eslint/await-thenable": "off", - "@typescript-eslint/return-await": "off", + "@typescript-eslint/return-await": "error", "@typescript-eslint/non-nullable-type-assertion-style": "off", "@typescript-eslint/no-misused-spread": "off", "@typescript-eslint/unbound-method": "off", diff --git a/tests/rspack-test/configCases/hooks/modify-extract-css-loading-runtime/rspack.config.js b/tests/rspack-test/configCases/hooks/modify-extract-css-loading-runtime/rspack.config.js index 5185739088a8..4f6fbf3427f3 100644 --- a/tests/rspack-test/configCases/hooks/modify-extract-css-loading-runtime/rspack.config.js +++ b/tests/rspack-test/configCases/hooks/modify-extract-css-loading-runtime/rspack.config.js @@ -4,7 +4,11 @@ class Plugin { apply(compiler) { compiler.hooks.compilation.tap("TestFakePlugin", compilation => { compilation.hooks.runtimeModule.tap("TestFakePlugin", (module, chunk) => { - if (module.constructorName === "CssLoadingRuntimeModule") { + if (module.constructor.name === "CssLoadingRuntimeModule") { + expect(module.constructorName).toBe("CssLoadingRuntimeModule"); + expect(module.moduleIdentifier).toBe("webpack/runtime/css loading"); + expect(module.identifier()).toBe("webpack/runtime/css loading"); + expect(module.readableIdentifier()).toBe("webpack/runtime/css loading"); const originSource = module.source.source.toString("utf-8"); module.source.source = Buffer.from( `${originSource}\n__webpack_require__.f.miniCss.test = true;\n`, diff --git a/tests/rspack-test/configCases/loader/access-module-graph/access-mg-loader.js b/tests/rspack-test/configCases/loader/access-module-graph/access-mg-loader.js new file mode 100644 index 000000000000..85c54827a861 --- /dev/null +++ b/tests/rspack-test/configCases/loader/access-module-graph/access-mg-loader.js @@ -0,0 +1,7 @@ +module.exports = function loader(content) { + + const moduleGraph = this._compilation.moduleGraph; + let issuer = moduleGraph.getIssuer(this._module); + console.log(issuer); + return content; +} \ No newline at end of file diff --git a/tests/rspack-test/configCases/loader/access-module-graph/errors.js b/tests/rspack-test/configCases/loader/access-module-graph/errors.js new file mode 100644 index 000000000000..3233ccca0e74 --- /dev/null +++ b/tests/rspack-test/configCases/loader/access-module-graph/errors.js @@ -0,0 +1 @@ +module.exports = [/ModuleGraph is not available during module graph building phase/] \ No newline at end of file diff --git a/tests/rspack-test/configCases/loader/access-module-graph/index.js b/tests/rspack-test/configCases/loader/access-module-graph/index.js new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/tests/rspack-test/configCases/loader/access-module-graph/rspack.config.js b/tests/rspack-test/configCases/loader/access-module-graph/rspack.config.js new file mode 100644 index 000000000000..3208e94d7e20 --- /dev/null +++ b/tests/rspack-test/configCases/loader/access-module-graph/rspack.config.js @@ -0,0 +1,16 @@ + +/** + * @type {import('@rspack/core').RspackOptions} + */ +module.exports = { + context: __dirname, + entry: './index.js', + module: { + rules: [ + { + test: /index.js/, + use: [{ loader: "./access-mg-loader.js" }] + } + ] + } +}; diff --git a/tests/rspack-test/configCases/rstest/new-url-wasm/index.js b/tests/rspack-test/configCases/rstest/new-url-wasm/index.js new file mode 100644 index 000000000000..55d37cbff3c4 --- /dev/null +++ b/tests/rspack-test/configCases/rstest/new-url-wasm/index.js @@ -0,0 +1,4 @@ +const wasmUrl = new URL("./test.wasm", import.meta.url); +const pngUrl = new URL("./test.png", import.meta.url); + +console.log(wasmUrl, pngUrl); diff --git a/tests/rspack-test/configCases/rstest/new-url-wasm/rspack.config.js b/tests/rspack-test/configCases/rstest/new-url-wasm/rspack.config.js new file mode 100644 index 000000000000..96bdaf9c3eed --- /dev/null +++ b/tests/rspack-test/configCases/rstest/new-url-wasm/rspack.config.js @@ -0,0 +1,38 @@ +const { + experiments: { RstestPlugin } +} = require("@rspack/core"); + +/** @type {import("@rspack/core").Configuration} */ +module.exports = [ + { + entry: "./index.js", + target: "node", + node: { + __filename: false, + __dirname: false + }, + output: { + filename: "bundle.js" + }, + plugins: [ + new RstestPlugin({ + injectModulePathName: true, + hoistMockModule: true, + importMetaPathName: true, + manualMockRoot: __dirname, + preserveNewUrl: [".wasm"] + }) + ] + }, + { + entry: { + main: "./test.js" + }, + output: { + filename: "[name].js" + }, + externalsPresets: { + node: true + } + } +]; diff --git a/tests/rspack-test/configCases/rstest/new-url-wasm/test.config.js b/tests/rspack-test/configCases/rstest/new-url-wasm/test.config.js new file mode 100644 index 000000000000..964d44756a72 --- /dev/null +++ b/tests/rspack-test/configCases/rstest/new-url-wasm/test.config.js @@ -0,0 +1,7 @@ +/** @type {import("../../../..").TConfigCaseConfig} */ +module.exports = { + findBundle: function (i) { + if (i === 0) return ["main.js"]; + return ["main.js"]; + } +}; diff --git a/tests/rspack-test/configCases/rstest/new-url-wasm/test.js b/tests/rspack-test/configCases/rstest/new-url-wasm/test.js new file mode 100644 index 000000000000..054d0862dadc --- /dev/null +++ b/tests/rspack-test/configCases/rstest/new-url-wasm/test.js @@ -0,0 +1,12 @@ +const fs = require("fs"); +const path = require("path"); + +const content = fs.readFileSync(path.resolve(__dirname, "bundle.js"), "utf-8"); + +it("should keep wasm new URL untouched in rstest", () => { + expect(content).toContain('new URL("./test.wasm", import.meta.url)'); +}); + +it("should keep non-wasm new URL behavior", () => { + expect(content).toContain("/* asset import */"); +}); diff --git a/tests/rspack-test/configCases/rstest/new-url-wasm/test.png b/tests/rspack-test/configCases/rstest/new-url-wasm/test.png new file mode 100644 index 000000000000..19b11ce57205 --- /dev/null +++ b/tests/rspack-test/configCases/rstest/new-url-wasm/test.png @@ -0,0 +1 @@ +png \ No newline at end of file diff --git a/tests/rspack-test/configCases/rstest/new-url-wasm/test.wasm b/tests/rspack-test/configCases/rstest/new-url-wasm/test.wasm new file mode 100644 index 000000000000..d8fc92d022fb Binary files /dev/null and b/tests/rspack-test/configCases/rstest/new-url-wasm/test.wasm differ diff --git a/tests/rspack-test/package.json b/tests/rspack-test/package.json index 0eb43a100395..7b0238c94597 100644 --- a/tests/rspack-test/package.json +++ b/tests/rspack-test/package.json @@ -19,7 +19,7 @@ "@rspack/plugin-preact-refresh": "1.1.4", "@rspack/plugin-react-refresh": "^1.5.3", "@rspack/test-tools": "workspace:*", - "@rstest/core": "^0.7.7", + "@rstest/core": "^0.7.8", "@swc/helpers": "0.5.18", "@swc/plugin-remove-console": "^12.1.0", "@types/babel__generator": "7.27.0", diff --git a/tests/rspack-test/watchCases/recover-from-error/delete-file/0/file.js b/tests/rspack-test/watchCases/recover-from-error/delete-file/0/file.js new file mode 100644 index 000000000000..46c7130a8a1f --- /dev/null +++ b/tests/rspack-test/watchCases/recover-from-error/delete-file/0/file.js @@ -0,0 +1 @@ +module.exports = 'ok'; diff --git a/tests/rspack-test/watchCases/recover-from-error/delete-file/0/index.js b/tests/rspack-test/watchCases/recover-from-error/delete-file/0/index.js new file mode 100644 index 000000000000..0cc4b5bbb95b --- /dev/null +++ b/tests/rspack-test/watchCases/recover-from-error/delete-file/0/index.js @@ -0,0 +1,15 @@ +it('should recover when recreate file', function () { + switch (WATCH_STEP) { + case '0': + expect(require('./file')).toBe('ok'); + break; + case '1': + expect(function () { + require('./file'); + }).toThrow(); + break; + case '2': + expect(require('./file')).toBe('ok'); + break; + } +}); diff --git a/tests/rspack-test/watchCases/recover-from-error/delete-file/1/errors.js b/tests/rspack-test/watchCases/recover-from-error/delete-file/1/errors.js new file mode 100644 index 000000000000..5608e5447bfd --- /dev/null +++ b/tests/rspack-test/watchCases/recover-from-error/delete-file/1/errors.js @@ -0,0 +1 @@ +module.exports = [/Module not found: Can't resolve/]; diff --git a/tests/rspack-test/watchCases/recover-from-error/delete-file/1/file.js b/tests/rspack-test/watchCases/recover-from-error/delete-file/1/file.js new file mode 100644 index 000000000000..f42a9f0e7e14 --- /dev/null +++ b/tests/rspack-test/watchCases/recover-from-error/delete-file/1/file.js @@ -0,0 +1 @@ +DELETE diff --git a/tests/rspack-test/watchCases/recover-from-error/delete-file/2/file.js b/tests/rspack-test/watchCases/recover-from-error/delete-file/2/file.js new file mode 100644 index 000000000000..46c7130a8a1f --- /dev/null +++ b/tests/rspack-test/watchCases/recover-from-error/delete-file/2/file.js @@ -0,0 +1 @@ +module.exports = 'ok'; diff --git a/tests/rspack-test/watchCases/recover-from-error/delete-file/rspack.config.js b/tests/rspack-test/watchCases/recover-from-error/delete-file/rspack.config.js new file mode 100644 index 000000000000..5e67dfe8e2d3 --- /dev/null +++ b/tests/rspack-test/watchCases/recover-from-error/delete-file/rspack.config.js @@ -0,0 +1,7 @@ +/** @type {import("@rspack/core").Configuration} */ +module.exports = { + ignoreWarnings: [/FlagDependencyUsagePlugin/], + optimization: { + usedExports: true, + }, +}; diff --git a/website/docs/en/types/runtime-module.mdx b/website/docs/en/types/runtime-module.mdx index 2c18016ea79b..de5a6390d2fc 100644 --- a/website/docs/en/types/runtime-module.mdx +++ b/website/docs/en/types/runtime-module.mdx @@ -1,17 +1,18 @@ <> ```ts -type RuntimeModule = { +class RuntimeModule { source?: { isRaw: boolean; isBuffer: boolean; source: Buffer; map?: Buffer; }; - moduleIdentifier: string; - constructorName: string; + stage: number; name: string; -}; + identifier(): string; + readableIdentifier(): string; +} ``` diff --git a/website/docs/zh/types/runtime-module.mdx b/website/docs/zh/types/runtime-module.mdx index 2c18016ea79b..de5a6390d2fc 100644 --- a/website/docs/zh/types/runtime-module.mdx +++ b/website/docs/zh/types/runtime-module.mdx @@ -1,17 +1,18 @@ <> ```ts -type RuntimeModule = { +class RuntimeModule { source?: { isRaw: boolean; isBuffer: boolean; source: Buffer; map?: Buffer; }; - moduleIdentifier: string; - constructorName: string; + stage: number; name: string; -}; + identifier(): string; + readableIdentifier(): string; +} ```