Skip to content

Commit 0402205

Browse files
authored
chore: upgrade template to Rspack 2.0 rc.1 (#75)
### Summary This PR updates `rspack-binding-template` to be compatible with Rspack 2.0 (rc.1), including Rust workspace dependency bumps, regenerated binding typings, and Node.js engine requirements aligned with Rspack 2.0. ### Key changes - **Deps/Tooling** - Rust workspace: edition **2024**, deps bumped to `=0.100.0-rc.1`, `napi` updated, toolchain refreshed and add `rust-src`. - JS: upgrade to `@rspack/core@2.0.0-rc.1`; update lockfile accordingly. - **Runtime compatibility** - Add `engines.node: ">=20.19.0 <21 || >=22.12.0"` (root + binding package) and update README note. - Update index.js to correctly load `@rspack/core` when the callable export is `default`, while preserving named exports via `Object.assign`. - **Bindings** - Regenerate index.d.ts / index.js to match upstream API changes (notably `JsSource` types, new plugin/tap kinds, `JsCoordinator`, etc.). - **Rust plugin** - Use `RawStringSource` for banner injection to match updated `rspack_sources`. ### Notes - This is a template upgrade; downstream projects should also move to Node **20.19+ / 22.12+** when adopting Rspack 2.0.
1 parent c83f633 commit 0402205

File tree

15 files changed

+1591
-1224
lines changed

15 files changed

+1591
-1224
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949

5050
build:
5151
name: Build
52-
uses: rstackjs/rspack-toolchain/.github/workflows/build.yml@v1
52+
uses: rstackjs/rspack-toolchain/.github/workflows/build.yml@a0ff0d85e7dd792d5ed23c4d55f369e4b87aae87
5353

5454
test:
5555
name: Test

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ jobs:
8989

9090
- name: Get NAPI info
9191
id: napi-info
92-
uses: rstackjs/rspack-toolchain/get-napi-info@v1
92+
uses: rstackjs/rspack-toolchain/get-napi-info@a0ff0d85e7dd792d5ed23c4d55f369e4b87aae87
9393

9494
- name: Download rspack binding
95-
uses: rstackjs/rspack-toolchain/download-rspack-binding@v1
95+
uses: rstackjs/rspack-toolchain/download-rspack-binding@a0ff0d85e7dd792d5ed23c4d55f369e4b87aae87
9696
with:
9797
path: ${{ steps.napi-info.outputs.binding-directory }}/artifacts
9898

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ jobs:
2626

2727
- name: Get NAPI info
2828
id: napi-info
29-
uses: rstackjs/rspack-toolchain/get-napi-info@v1
29+
uses: rstackjs/rspack-toolchain/get-napi-info@a0ff0d85e7dd792d5ed23c4d55f369e4b87aae87
3030

3131
- name: Download rspack binding
32-
uses: rstackjs/rspack-toolchain/download-rspack-binding@v1
32+
uses: rstackjs/rspack-toolchain/download-rspack-binding@a0ff0d85e7dd792d5ed23c4d55f369e4b87aae87
3333
with:
3434
target: ${{ matrix.target }}
3535
path: ${{ steps.napi-info.outputs.binding-directory }}

0 commit comments

Comments
 (0)