@rspack-canary/test-tools 1.5.9-canary-a915dabc-20251013174148 → 1.6.0-canary-5bacb922-20251015173619
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/hot-step.d.ts +1 -1
- package/dist/case/hot-step.js +12 -10
- package/dist/case/hot.d.ts +5 -4
- package/dist/case/hot.js +32 -41
- package/dist/case/incremental.d.ts +1 -1
- package/dist/case/incremental.js +8 -6
- package/dist/case/normal.js +0 -4
- package/dist/case/watch.js +0 -7
- package/dist/helper/hot-update/plugin.d.ts +1 -1
- package/dist/helper/hot-update/plugin.js +4 -4
- package/dist/helper/legacy/update.d.ts +2 -0
- package/dist/helper/legacy/update.esm.d.ts +1 -0
- package/dist/helper/legacy/update.esm.js +23 -0
- package/dist/helper/legacy/update.js +19 -0
- package/dist/helper/setup-env.js +3 -2
- package/dist/helper/util/checkStats.d.ts +0 -1
- package/dist/helper/util/checkStats.js +0 -18
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/jest/ignore-snapshot-default-reporter.d.ts +2 -0
- package/dist/jest/ignore-snapshot-default-reporter.js +57 -0
- package/dist/jest/ignore-snapshot-summary-reporter.d.ts +2 -0
- package/dist/jest/ignore-snapshot-summary-reporter.js +24 -0
- package/dist/jest/patch-node-env.d.ts +5 -0
- package/dist/jest/patch-node-env.js +18 -0
- package/dist/jest/slash.d.ts +2 -0
- package/dist/jest/slash.js +16 -0
- package/package.json +6 -37
- package/dist/helper/legacy/createLogger.d.ts +0 -23
- package/dist/helper/legacy/createLogger.js +0 -20
- package/dist/helper/legacy/diffStats.d.ts +0 -2
- package/dist/helper/legacy/diffStats.js +0 -13
- package/dist/helper/legacy/supportsBlob.d.ts +0 -2
- package/dist/helper/legacy/supportsBlob.js +0 -10
- package/dist/helper/legacy/supportsClassFields.d.ts +0 -2
- package/dist/helper/legacy/supportsClassFields.js +0 -11
- package/dist/helper/legacy/supportsES6.d.ts +0 -2
- package/dist/helper/legacy/supportsES6.js +0 -11
- package/dist/helper/legacy/supportsForOf.d.ts +0 -2
- package/dist/helper/legacy/supportsForOf.js +0 -11
- package/dist/helper/legacy/supportsIteratorDestructuring.d.ts +0 -2
- package/dist/helper/legacy/supportsIteratorDestructuring.js +0 -11
- package/dist/helper/legacy/supportsLogicalAssignment.d.ts +0 -2
- package/dist/helper/legacy/supportsLogicalAssignment.js +0 -11
- package/dist/helper/legacy/supportsObjectDestructuring.d.ts +0 -2
- package/dist/helper/legacy/supportsObjectDestructuring.js +0 -11
- package/dist/helper/legacy/supportsOptionalCatchBinding.d.ts +0 -2
- package/dist/helper/legacy/supportsOptionalCatchBinding.js +0 -11
- package/dist/helper/legacy/supportsOptionalChaining.d.ts +0 -2
- package/dist/helper/legacy/supportsOptionalChaining.js +0 -11
- package/dist/helper/legacy/supportsRequireInModule.d.ts +0 -2
- package/dist/helper/legacy/supportsRequireInModule.js +0 -5
- package/dist/helper/legacy/supportsResponse.d.ts +0 -2
- package/dist/helper/legacy/supportsResponse.js +0 -10
- package/dist/helper/legacy/supportsSpread.d.ts +0 -2
- package/dist/helper/legacy/supportsSpread.js +0 -12
- package/dist/helper/legacy/supportsTemplateStrings.d.ts +0 -2
- package/dist/helper/legacy/supportsTemplateStrings.js +0 -11
- package/dist/helper/legacy/supportsTextDecoder.d.ts +0 -2
- package/dist/helper/legacy/supportsTextDecoder.js +0 -10
- package/dist/helper/legacy/supportsWebAssembly.d.ts +0 -2
- package/dist/helper/legacy/supportsWebAssembly.js +0 -10
- package/dist/helper/legacy/supportsWorker.d.ts +0 -2
- package/dist/helper/legacy/supportsWorker.js +0 -17
- package/dist/helper/legacy/warmup-webpack.d.ts +0 -1
- package/dist/helper/legacy/warmup-webpack.js +0 -26
- package/dist/helper/loaders/hot-update.d.ts +0 -1
- package/dist/helper/loaders/hot-update.js +0 -43
- package/dist/helper/plugins/hot-update.d.ts +0 -7
- package/dist/helper/plugins/hot-update.js +0 -40
- package/dist/helper/plugins/index.d.ts +0 -1
- package/dist/helper/plugins/index.js +0 -17
- package/dist/helper/util/currentWatchStep.d.ts +0 -1
- package/dist/helper/util/currentWatchStep.js +0 -2
- package/dist/helper/util/identifier.d.ts +0 -76
- package/dist/helper/util/identifier.js +0 -339
- package/dist/helper/util/replaceMitteDiagnostic.d.ts +0 -2
- package/dist/helper/util/replaceMitteDiagnostic.js +0 -17
- package/dist/reporter/diff-html.d.ts +0 -15
- package/dist/reporter/diff-html.js +0 -69
- package/dist/reporter/diff-stats.d.ts +0 -24
- package/dist/reporter/diff-stats.js +0 -131
- package/dist/reporter/index.d.ts +0 -2
- package/dist/reporter/index.js +0 -18
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rspack-canary/test-tools",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0-canary-5bacb922-20251015173619",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Test tools for rspack",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
"./package.json": "./package.json",
|
|
16
16
|
"./helper/*": "./dist/helper/*.js",
|
|
17
17
|
"./helper/legacy/*": "./dist/helper/legacy/*.js",
|
|
18
|
-
"./helper/util/*": "./dist/helper/util/*.js"
|
|
18
|
+
"./helper/util/*": "./dist/helper/util/*.js",
|
|
19
|
+
"./jest/*": "./dist/jest/*.js"
|
|
19
20
|
},
|
|
20
21
|
"files": [
|
|
21
22
|
"client",
|
|
@@ -39,19 +40,19 @@
|
|
|
39
40
|
"@babel/parser": "7.28.4",
|
|
40
41
|
"@babel/traverse": "7.28.4",
|
|
41
42
|
"@babel/types": "7.28.4",
|
|
43
|
+
"@jest/reporters": "29.7.0",
|
|
42
44
|
"cross-env": "^10.1.0",
|
|
43
45
|
"csv-to-markdown-table": "1.5.0",
|
|
44
46
|
"deepmerge": "^4.3.1",
|
|
45
47
|
"filenamify": "4.3.0",
|
|
46
48
|
"fs-extra": "^11.3.2",
|
|
47
|
-
"glob": "^11.0.3",
|
|
48
49
|
"graceful-fs": "^4.2.11",
|
|
49
50
|
"iconv-lite": "^0.6.3",
|
|
50
51
|
"jest-diff": "^29.7.0",
|
|
51
52
|
"jest-snapshot": "29.7.0",
|
|
53
|
+
"jest-environment-node": "29.7.0",
|
|
52
54
|
"jsdom": "^26.1.0",
|
|
53
55
|
"memfs": "4.48.1",
|
|
54
|
-
"loader-utils": "^2.0.4",
|
|
55
56
|
"path-serializer": "0.5.1",
|
|
56
57
|
"pretty-format": "29.7.0",
|
|
57
58
|
"rimraf": "^5.0.10",
|
|
@@ -62,48 +63,16 @@
|
|
|
62
63
|
"webpack-sources": "3.3.3"
|
|
63
64
|
},
|
|
64
65
|
"devDependencies": {
|
|
65
|
-
"@rspack/plugin-preact-refresh": "1.1.3",
|
|
66
|
-
"@rspack/plugin-react-refresh": "^1.5.1",
|
|
67
|
-
"@swc/helpers": "0.5.17",
|
|
68
|
-
"@swc/plugin-remove-console": "^9.1.0",
|
|
69
66
|
"@types/babel__generator": "7.27.0",
|
|
70
67
|
"@types/babel__traverse": "7.28.0",
|
|
71
68
|
"@types/fs-extra": "11.0.4",
|
|
72
69
|
"@types/jsdom": "^21.1.7",
|
|
73
|
-
"@types/react": "^19.1.13",
|
|
74
|
-
"@types/react-dom": "^19.1.9",
|
|
75
|
-
"@webdiscus/pug-loader": "^2.11.1",
|
|
76
|
-
"acorn": "^8.15.0",
|
|
77
|
-
"babel-loader": "^10.0.0",
|
|
78
|
-
"babel-plugin-import": "^1.13.8",
|
|
79
70
|
"chalk": "^4.1.2",
|
|
80
|
-
"core-js": "3.45.1",
|
|
81
|
-
"css-loader": "^7.1.2",
|
|
82
|
-
"file-loader": "^6.2.0",
|
|
83
|
-
"graceful-fs": "^4.2.11",
|
|
84
|
-
"html-loader": "^5.1.0",
|
|
85
|
-
"html-webpack-plugin": "^5.6.4",
|
|
86
|
-
"less-loader": "^12.3.0",
|
|
87
|
-
"lodash": "^4.17.21",
|
|
88
|
-
"postcss-loader": "^8.2.0",
|
|
89
|
-
"postcss-pxtorem": "^6.1.0",
|
|
90
|
-
"raw-loader": "^4.0.2",
|
|
91
|
-
"react": "^19.1.1",
|
|
92
|
-
"react-dom": "^19.1.1",
|
|
93
|
-
"react-refresh": "^0.17.0",
|
|
94
|
-
"sass-loader": "^16.0.5",
|
|
95
71
|
"source-map": "^0.7.6",
|
|
96
|
-
"source-map-loader": "^5.0.0",
|
|
97
|
-
"style-loader": "^4.0.0",
|
|
98
72
|
"terser": "5.43.1",
|
|
99
73
|
"typescript": "^5.9.3",
|
|
100
74
|
"wast-loader": "^1.14.1",
|
|
101
|
-
"
|
|
102
|
-
"exports-loader": "^5.0.0",
|
|
103
|
-
"@rspack/cli": "npm:@rspack-canary/cli@1.5.9-canary-a915dabc-20251013174148",
|
|
104
|
-
"@rspack/core": "npm:@rspack-canary/core@1.5.9-canary-a915dabc-20251013174148",
|
|
105
|
-
"@rspack/test-tools": "npm:@rspack-canary/test-tools@1.5.9-canary-a915dabc-20251013174148",
|
|
106
|
-
"@rspack/binding-testing": "1.4.1"
|
|
75
|
+
"@rspack/core": "npm:@rspack-canary/core@1.6.0-canary-5bacb922-20251015173619"
|
|
107
76
|
},
|
|
108
77
|
"peerDependencies": {
|
|
109
78
|
"@rspack/core": ">=1.0.0"
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
declare function _exports(appendTarget: any): {
|
|
2
|
-
log: (l: any) => any;
|
|
3
|
-
debug: (l: any) => any;
|
|
4
|
-
trace: (l: any) => any;
|
|
5
|
-
info: (l: any) => any;
|
|
6
|
-
warn: {
|
|
7
|
-
(...data: any[]): void;
|
|
8
|
-
(message?: any, ...optionalParams: any[]): void;
|
|
9
|
-
};
|
|
10
|
-
error: {
|
|
11
|
-
(...data: any[]): void;
|
|
12
|
-
(message?: any, ...optionalParams: any[]): void;
|
|
13
|
-
};
|
|
14
|
-
logTime: () => void;
|
|
15
|
-
group: () => void;
|
|
16
|
-
groupCollapsed: () => void;
|
|
17
|
-
groupEnd: () => void;
|
|
18
|
-
profile: () => void;
|
|
19
|
-
profileEnd: () => void;
|
|
20
|
-
clear: () => void;
|
|
21
|
-
status: () => void;
|
|
22
|
-
};
|
|
23
|
-
export = _exports;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
module.exports = appendTarget => {
|
|
4
|
-
return {
|
|
5
|
-
log: l => appendTarget.push(l),
|
|
6
|
-
debug: l => appendTarget.push(l),
|
|
7
|
-
trace: l => appendTarget.push(l),
|
|
8
|
-
info: l => appendTarget.push(l),
|
|
9
|
-
warn: console.warn.bind(console),
|
|
10
|
-
error: console.error.bind(console),
|
|
11
|
-
logTime: () => { },
|
|
12
|
-
group: () => { },
|
|
13
|
-
groupCollapsed: () => { },
|
|
14
|
-
groupEnd: () => { },
|
|
15
|
-
profile: () => { },
|
|
16
|
-
profileEnd: () => { },
|
|
17
|
-
clear: () => { },
|
|
18
|
-
status: () => { }
|
|
19
|
-
};
|
|
20
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
const diff = require("jest-diff").diff;
|
|
4
|
-
const { stripVTControlCharacters: stripAnsi } = require("node:util");
|
|
5
|
-
const processStats = str => {
|
|
6
|
-
return str.trim().split('\n').map(i => i.trim()).join('\n').replace(/\d+(\.\d+)?/g, 'XX').replace(/"/g, "");
|
|
7
|
-
};
|
|
8
|
-
const webpackStats = require('../__snapshots__/StatsTestCases.basictest.js.snap.webpack');
|
|
9
|
-
module.exports = (rawStats, name) => {
|
|
10
|
-
const key = `StatsTestCases should print correct stats for ${name} 1`;
|
|
11
|
-
const res = stripAnsi(diff(processStats(rawStats), processStats(webpackStats[key] || ''), { expand: false, contextLines: 0 }));
|
|
12
|
-
return res;
|
|
13
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
const nodeVersion = process.versions.node.split(".").map(Number);
|
|
4
|
-
module.exports = function supportsWorker() {
|
|
5
|
-
// Verify that in the current node version new Worker() accepts URL as the first parameter:
|
|
6
|
-
// https://nodejs.org/api/worker_threads.html#worker_threads_new_worker_filename_options
|
|
7
|
-
if (nodeVersion[0] >= 14) {
|
|
8
|
-
return true;
|
|
9
|
-
}
|
|
10
|
-
else if (nodeVersion[0] === 13 && nodeVersion[1] >= 12) {
|
|
11
|
-
return true;
|
|
12
|
-
}
|
|
13
|
-
else if (nodeVersion[0] === 12 && nodeVersion[1] >= 17) {
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
16
|
-
return false;
|
|
17
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
describe("warmup", () => {
|
|
4
|
-
it("should warmup webpack", done => {
|
|
5
|
-
let webpack = require("@rspack/core");
|
|
6
|
-
const END = new Error("end warmup");
|
|
7
|
-
webpack({
|
|
8
|
-
entry: "data:text/javascript,import 'data:text/javascript,'",
|
|
9
|
-
plugins: [
|
|
10
|
-
c => c.hooks.emit.tap("Warmup", () => {
|
|
11
|
-
throw END;
|
|
12
|
-
})
|
|
13
|
-
]
|
|
14
|
-
}, err => {
|
|
15
|
-
webpack = undefined;
|
|
16
|
-
try {
|
|
17
|
-
// CHANGE: rspack will format error into diagnostic.
|
|
18
|
-
expect(err.message).toContain("end warmup");
|
|
19
|
-
done();
|
|
20
|
-
}
|
|
21
|
-
catch (e) {
|
|
22
|
-
done(e);
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
}, 300000);
|
|
26
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function (this: any, c: string): string;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = default_1;
|
|
4
|
-
function default_1(c) {
|
|
5
|
-
let content = c;
|
|
6
|
-
if (content.includes("NEXT_HMR")) {
|
|
7
|
-
content = `
|
|
8
|
-
${content}
|
|
9
|
-
let __hmr_children__ = [...module.children];
|
|
10
|
-
let __hmr_used_exports__ = __hmr_children__.reduce((res, child) => {
|
|
11
|
-
if (__webpack_module_cache__[child]) {
|
|
12
|
-
res[child] = __webpack_module_cache__[child].exports;
|
|
13
|
-
}
|
|
14
|
-
return res;
|
|
15
|
-
}, {});
|
|
16
|
-
module.hot.accept(__hmr_children__, () => {
|
|
17
|
-
__hmr_children__.forEach((child) => {
|
|
18
|
-
const reexports = __webpack_require__(child);
|
|
19
|
-
for (let key in reexports) {
|
|
20
|
-
if (!__hmr_used_exports__[child]) { continue; }
|
|
21
|
-
Object.defineProperty(__hmr_used_exports__[child], key, {
|
|
22
|
-
configurable: true,
|
|
23
|
-
enumerable: true,
|
|
24
|
-
get: () => reexports[key]
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
`;
|
|
30
|
-
}
|
|
31
|
-
content = content.replace(/NEXT_HMR/g, "NEXT_HMR.bind(null, module)");
|
|
32
|
-
const options = this.getOptions();
|
|
33
|
-
const items = content.split(/---+\r?\n/g);
|
|
34
|
-
if (items.length <= 1) {
|
|
35
|
-
return content;
|
|
36
|
-
}
|
|
37
|
-
options.totalUpdates = Math.max(options.totalUpdates, items.length);
|
|
38
|
-
options.changedFiles.push(this.resourcePath);
|
|
39
|
-
if (options.updateIndex >= items.length) {
|
|
40
|
-
return items[items.length - 1];
|
|
41
|
-
}
|
|
42
|
-
return items[options.updateIndex];
|
|
43
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TestHotUpdatePlugin = void 0;
|
|
4
|
-
class TestHotUpdatePlugin {
|
|
5
|
-
constructor(updateOptions) {
|
|
6
|
-
this.updateOptions = updateOptions;
|
|
7
|
-
}
|
|
8
|
-
apply(compiler) {
|
|
9
|
-
let isRebuild = false;
|
|
10
|
-
compiler.hooks.beforeRun.tap("TestHotUpdatePlugin", () => {
|
|
11
|
-
if (isRebuild) {
|
|
12
|
-
compiler.modifiedFiles = new Set(this.updateOptions.changedFiles);
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
compiler.modifiedFiles = new Set();
|
|
16
|
-
}
|
|
17
|
-
this.updateOptions.changedFiles = [];
|
|
18
|
-
isRebuild = true;
|
|
19
|
-
});
|
|
20
|
-
compiler.hooks.compilation.tap("TestHotUpdatePlugin", compilation => {
|
|
21
|
-
compilation.hooks.additionalTreeRuntimeRequirements.tap("HMR_TEST_PLUGIN", (_chunk, set) => {
|
|
22
|
-
set.add(compiler.webpack.RuntimeGlobals.moduleCache);
|
|
23
|
-
});
|
|
24
|
-
compilation.hooks.runtimeModule.tap("HMR_TEST_PLUGIN", (module, _set) => {
|
|
25
|
-
if (module.constructorName === "DefinePropertyGettersRuntimeModule") {
|
|
26
|
-
module.source.source = Buffer.from(`
|
|
27
|
-
__webpack_require__.d = function (exports, definition) {
|
|
28
|
-
for (var key in definition) {
|
|
29
|
-
if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
30
|
-
Object.defineProperty(exports, key, { configurable: true, enumerable: true, get: definition[key] });
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
`, "utf-8");
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
exports.TestHotUpdatePlugin = TestHotUpdatePlugin;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./hot-update";
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./hot-update"), exports);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const step: {};
|