@rspack/test-tools 1.3.9 → 1.3.10
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/case/index.d.ts
CHANGED
package/dist/case/index.js
CHANGED
|
@@ -32,5 +32,4 @@ __exportStar(require("./treeshaking"), exports);
|
|
|
32
32
|
__exportStar(require("./watch"), exports);
|
|
33
33
|
__exportStar(require("./new-incremental"), exports);
|
|
34
34
|
__exportStar(require("./cache"), exports);
|
|
35
|
-
__exportStar(require("./new-code-splitting"), exports);
|
|
36
35
|
__exportStar(require("./serial"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack/test-tools",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.10",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Test tools for rspack",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@rspack/plugin-preact-refresh": "1.1.2",
|
|
61
|
-
"@rspack/plugin-react-refresh": "^1.4.
|
|
61
|
+
"@rspack/plugin-react-refresh": "^1.4.3",
|
|
62
62
|
"@swc/helpers": "0.5.17",
|
|
63
63
|
"@swc/plugin-remove-console": "^7.0.4",
|
|
64
64
|
"@types/babel__generator": "7.27.0",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"graceful-fs": "^4.2.11",
|
|
81
81
|
"html-loader": "^5.1.0",
|
|
82
82
|
"html-webpack-plugin": "^5.6.3",
|
|
83
|
-
"less-loader": "^12.
|
|
83
|
+
"less-loader": "^12.3.0",
|
|
84
84
|
"lodash": "^4.17.21",
|
|
85
85
|
"postcss-loader": "^8.1.1",
|
|
86
86
|
"postcss-pxtorem": "^6.1.0",
|
|
@@ -96,9 +96,9 @@
|
|
|
96
96
|
"typescript": "^5.8.3",
|
|
97
97
|
"wast-loader": "^1.14.1",
|
|
98
98
|
"worker-rspack-loader": "^3.1.2",
|
|
99
|
-
"@rspack/
|
|
100
|
-
"@rspack/
|
|
101
|
-
"@rspack/cli": "1.3.
|
|
99
|
+
"@rspack/test-tools": "1.3.10",
|
|
100
|
+
"@rspack/core": "1.3.10",
|
|
101
|
+
"@rspack/cli": "1.3.10"
|
|
102
102
|
},
|
|
103
103
|
"peerDependencies": {
|
|
104
104
|
"@rspack/core": ">=1.0.0"
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createConfigNewCodeSplittingCase = createConfigNewCodeSplittingCase;
|
|
4
|
-
exports.createStatsAPINewCodeSplittingCase = createStatsAPINewCodeSplittingCase;
|
|
5
|
-
const processor_1 = require("../processor");
|
|
6
|
-
const runner_1 = require("../runner");
|
|
7
|
-
const creator_1 = require("../test/creator");
|
|
8
|
-
const simple_1 = require("../test/simple");
|
|
9
|
-
const type_1 = require("../type");
|
|
10
|
-
function createConfigNewCodeSplittingCase(name, src, dist) {
|
|
11
|
-
configCreator.create(name, src, dist);
|
|
12
|
-
}
|
|
13
|
-
const configCreator = new creator_1.BasicCaseCreator({
|
|
14
|
-
clean: true,
|
|
15
|
-
runner: runner_1.MultipleRunnerFactory,
|
|
16
|
-
describe: false,
|
|
17
|
-
testConfig: testConfig => {
|
|
18
|
-
const oldModuleScope = testConfig.moduleScope;
|
|
19
|
-
testConfig.moduleScope = (ms, stats) => {
|
|
20
|
-
let res = ms;
|
|
21
|
-
// TODO: modify runner module scope based on stats here
|
|
22
|
-
if (typeof oldModuleScope === "function") {
|
|
23
|
-
res = oldModuleScope(ms, stats);
|
|
24
|
-
}
|
|
25
|
-
return res;
|
|
26
|
-
};
|
|
27
|
-
},
|
|
28
|
-
steps: ({ name }) => {
|
|
29
|
-
const processor = new NewCodeSplittingProcessor({
|
|
30
|
-
name,
|
|
31
|
-
runable: true,
|
|
32
|
-
compilerType: type_1.ECompilerType.Rspack,
|
|
33
|
-
configFiles: [
|
|
34
|
-
"rspack.config.cjs",
|
|
35
|
-
"rspack.config.js",
|
|
36
|
-
"webpack.config.js"
|
|
37
|
-
]
|
|
38
|
-
});
|
|
39
|
-
return [processor];
|
|
40
|
-
},
|
|
41
|
-
concurrent: true
|
|
42
|
-
});
|
|
43
|
-
class NewCodeSplittingProcessor extends processor_1.ConfigProcessor {
|
|
44
|
-
constructor(_configOptions) {
|
|
45
|
-
super({
|
|
46
|
-
..._configOptions,
|
|
47
|
-
overrideOptions: (NewCodeSplittingProcessor.overrideOptions)
|
|
48
|
-
});
|
|
49
|
-
this._configOptions = _configOptions;
|
|
50
|
-
}
|
|
51
|
-
static overrideOptions(index, context, options) {
|
|
52
|
-
processor_1.ConfigProcessor.overrideOptions(index, context, options);
|
|
53
|
-
options.experiments ??= {};
|
|
54
|
-
options.experiments.parallelCodeSplitting ??= true;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
function createStatsAPINewCodeSplittingCase(name, src, dist, testConfig) {
|
|
58
|
-
const caseConfig = require(testConfig);
|
|
59
|
-
const runner = (0, simple_1.getSimpleProcessorRunner)(src, dist);
|
|
60
|
-
it(caseConfig.description, async () => {
|
|
61
|
-
await runner(name, new NewCodeSplittingStatsAPIProcessor({
|
|
62
|
-
name: name,
|
|
63
|
-
snapshotName: "NewCodeSplittingStatsOutput",
|
|
64
|
-
compilerType: type_1.ECompilerType.Rspack,
|
|
65
|
-
...caseConfig
|
|
66
|
-
}));
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
class NewCodeSplittingStatsAPIProcessor extends processor_1.StatsAPIProcessor {
|
|
70
|
-
constructor(_statsAPIOptions) {
|
|
71
|
-
super({
|
|
72
|
-
..._statsAPIOptions,
|
|
73
|
-
options: context => {
|
|
74
|
-
const res = _statsAPIOptions.options?.(context) || {};
|
|
75
|
-
res.experiments ??= {};
|
|
76
|
-
res.experiments.parallelCodeSplitting ??= true;
|
|
77
|
-
return res;
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
this._statsAPIOptions = _statsAPIOptions;
|
|
81
|
-
}
|
|
82
|
-
}
|