Skip to content

Commit 057447f

Browse files
author
ScriptedAlchemy
committed
chore(rstest): support rsbuild 2.x and align engines with rstest
Widen the @rsbuild/core peer range to ^1.3.21 || ^2.0.0, build and test against the 2.x line rstest actually uses, and raise engines.node to rstest's floor (^20.19.0 || >=22.12.0). rspack 2.x dropped experiments.outputModule from its types, so keep that 1.x-only assignment behind a cast.
1 parent a516e39 commit 057447f

7 files changed

Lines changed: 625 additions & 378 deletions

File tree

.github/workflows/e2e-rstest.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ jobs:
4848
- name: Install Dependencies
4949
run: pnpm install --frozen-lockfile
5050

51+
- name: Install Playwright
52+
run: pnpm exec playwright install --with-deps chromium
53+
5154
- name: Install Cypress
5255
run: npx cypress install
5356

packages/enhanced/src/schemas/container/ModuleFederationPlugin.check.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ const t = {
444444
],
445445
},
446446
timeout: { type: 'number' },
447-
family: { enum: [4, 6] },
447+
family: { enum: [0, 4, 6] },
448448
typesOnBuild: { type: 'boolean' },
449449
},
450450
},
@@ -4361,6 +4361,8 @@ function D(
43614361
const n =
43624362
c;
43634363
if (
4364+
0 !==
4365+
e &&
43644366
4 !==
43654367
e &&
43664368
6 !==

packages/enhanced/src/schemas/container/ModuleFederationPlugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,7 @@
841841
]
842842
},
843843
"timeout": { "type": "number" },
844-
"family": { "enum": [4, 6] },
844+
"family": { "enum": [0, 4, 6] },
845845
"typesOnBuild": { "type": "boolean" }
846846
}
847847
}

packages/enhanced/src/schemas/container/ModuleFederationPlugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ export default {
936936
type: 'number',
937937
},
938938
family: {
939-
enum: [4, 6],
939+
enum: [0, 4, 6],
940940
},
941941
typesOnBuild: {
942942
type: 'boolean',

packages/rstest/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@module-federation/rstest",
33
"version": "0.23.0",
4-
"description": "Rstest federation compatibility plugin (extracted from @rstest/core).",
4+
"description": "Companion Rsbuild plugin for Rstest's Module Federation mode.",
55
"homepage": "https://module-federation.io",
66
"bugs": {
77
"url": "https://github.com/module-federation/core/issues"
@@ -42,10 +42,10 @@
4242
"devDependencies": {
4343
"@rslib/core": "^0.12.4",
4444
"@rstest/core": "^0.8.1",
45-
"@rsbuild/core": "^1.3.21"
45+
"@rsbuild/core": "^2.0.12"
4646
},
4747
"peerDependencies": {
48-
"@rsbuild/core": "^1.3.21"
48+
"@rsbuild/core": "^1.3.21 || ^2.0.0"
4949
},
5050
"peerDependenciesMeta": {
5151
"@rsbuild/core": {
@@ -58,7 +58,7 @@
5858
"@module-federation/sdk": "workspace:*"
5959
},
6060
"engines": {
61-
"node": ">=16.0.0"
61+
"node": "^20.19.0 || >=22.12.0"
6262
},
6363
"publishConfig": {
6464
"access": "public",

packages/rstest/src/rspack-hook.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ export const applyNodeRspackDefaults = (
2727
rspackConfig.optimization.splitChunks = false;
2828

2929
rspackConfig.experiments ??= {};
30-
rspackConfig.experiments.outputModule = false;
30+
// `experiments.outputModule` only exists on rspack/rsbuild 1.x (the peer
31+
// range still allows it); there `output.module` alone is not enough when
32+
// the experiment is enabled. On 2.x the assignment is a harmless no-op.
33+
(rspackConfig.experiments as { outputModule?: boolean }).outputModule = false;
3134
rspackConfig.output ??= {};
3235
rspackConfig.output.module = false;
3336
};

pnpm-lock.yaml

Lines changed: 609 additions & 370 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)