@bleedingdev/modern-js-adapter-rstest 3.4.0-ultramodern.2 → 3.4.0-ultramodern.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +9 -1
- package/package.json +5 -5
- package/src/index.ts +8 -0
- package/tests/index.test.ts +2 -0
package/dist/index.js
CHANGED
|
@@ -13,6 +13,7 @@ function withModernConfig(options = {}) {
|
|
|
13
13
|
const { rsbuildConfig } = await resolveModernRsbuildConfig({
|
|
14
14
|
...options,
|
|
15
15
|
command: 'rstest',
|
|
16
|
+
disableReactCompiler: true,
|
|
16
17
|
modifyModernConfig: async (config)=>{
|
|
17
18
|
if (config.server?.rsc) {
|
|
18
19
|
console.warn('RSC is not fully supported in rstest environment, some features may not work as expected.\n');
|
|
@@ -28,7 +29,14 @@ function withModernConfig(options = {}) {
|
|
|
28
29
|
const { toRstestConfig } = await import("@rstest/adapter-rsbuild");
|
|
29
30
|
const rstestExtendConfig = toRstestConfig({
|
|
30
31
|
rsbuildConfig,
|
|
31
|
-
environmentName: options.environmentName || 'client'
|
|
32
|
+
environmentName: options.environmentName || 'client',
|
|
33
|
+
modifyRsbuildConfig: (buildConfig)=>({
|
|
34
|
+
...buildConfig,
|
|
35
|
+
output: {
|
|
36
|
+
...buildConfig.output,
|
|
37
|
+
module: true
|
|
38
|
+
}
|
|
39
|
+
})
|
|
32
40
|
});
|
|
33
41
|
return rstestExtendConfig;
|
|
34
42
|
};
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"directory": "packages/cli/adapter-rstest"
|
|
12
12
|
},
|
|
13
13
|
"license": "MIT",
|
|
14
|
-
"version": "3.4.0-ultramodern.
|
|
14
|
+
"version": "3.4.0-ultramodern.4",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"main": "dist/index.js",
|
|
17
17
|
"types": "dist/types/index.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@rstest/adapter-rsbuild": "0.10.6",
|
|
26
|
-
"@modern-js/app-tools": "npm:@bleedingdev/modern-js-app-tools@3.4.0-ultramodern.
|
|
26
|
+
"@modern-js/app-tools": "npm:@bleedingdev/modern-js-app-tools@3.4.0-ultramodern.4"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@rsbuild/core": "2.1.0",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"@types/node": "^26.0.1",
|
|
33
33
|
"@typescript/native-preview": "7.0.0-dev.20260624.1",
|
|
34
34
|
"typescript": "^6.0.3",
|
|
35
|
-
"@modern-js/tsconfig": "npm:@bleedingdev/modern-js-tsconfig@3.4.0-ultramodern.
|
|
36
|
-
"@
|
|
37
|
-
"@
|
|
35
|
+
"@modern-js/tsconfig": "npm:@bleedingdev/modern-js-tsconfig@3.4.0-ultramodern.4",
|
|
36
|
+
"@scripts/rstest-config": "2.66.0",
|
|
37
|
+
"@modern-js/types": "npm:@bleedingdev/modern-js-types@3.4.0-ultramodern.4"
|
|
38
38
|
},
|
|
39
39
|
"sideEffects": false,
|
|
40
40
|
"publishConfig": {
|
package/src/index.ts
CHANGED
|
@@ -29,6 +29,7 @@ export function withModernConfig(
|
|
|
29
29
|
const { rsbuildConfig } = await resolveModernRsbuildConfig({
|
|
30
30
|
...options,
|
|
31
31
|
command: 'rstest',
|
|
32
|
+
disableReactCompiler: true,
|
|
32
33
|
modifyModernConfig: async config => {
|
|
33
34
|
if (config.server?.rsc) {
|
|
34
35
|
console.warn(
|
|
@@ -55,6 +56,13 @@ export function withModernConfig(
|
|
|
55
56
|
const rstestExtendConfig = toRstestConfig({
|
|
56
57
|
rsbuildConfig,
|
|
57
58
|
environmentName: options.environmentName || 'client',
|
|
59
|
+
modifyRsbuildConfig: buildConfig => ({
|
|
60
|
+
...buildConfig,
|
|
61
|
+
output: {
|
|
62
|
+
...buildConfig.output,
|
|
63
|
+
module: true,
|
|
64
|
+
},
|
|
65
|
+
}),
|
|
58
66
|
});
|
|
59
67
|
|
|
60
68
|
return rstestExtendConfig;
|
package/tests/index.test.ts
CHANGED
|
@@ -38,9 +38,11 @@ describe('withModernConfig', () => {
|
|
|
38
38
|
cwd: '/app',
|
|
39
39
|
configPath: 'custom.modern.config.ts',
|
|
40
40
|
command: 'rstest',
|
|
41
|
+
disableReactCompiler: true,
|
|
41
42
|
modifyModernConfig: expect.any(Function),
|
|
42
43
|
});
|
|
43
44
|
expect(config.testEnvironment).toBe('node');
|
|
44
45
|
expect(config.root).toBe('/app');
|
|
46
|
+
expect(config.output?.module).toBe(true);
|
|
45
47
|
});
|
|
46
48
|
});
|