@rspack-canary/test-tools 1.5.9-canary-bddc650e-20251012024608 → 1.5.9-canary-e259bc79-20251014173821
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/builtin.js +0 -22
- package/dist/case/common.js +5 -1
- package/dist/case/error.js +1 -1
- package/dist/case/hook.js +2 -2
- 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 +1 -5
- package/dist/case/watch.js +0 -7
- package/dist/compare/compare.js +6 -3
- package/dist/helper/expect/placeholder.js +7 -7
- package/dist/helper/expect/to-match-file-snapshot.d.ts +0 -1
- 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/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/dist/runner/node/index.js +4 -0
- package/dist/runner/web/fake.js +6 -3
- package/dist/runner/web/jsdom.js +0 -4
- package/dist/type.d.ts +8 -0
- package/package.json +8 -5
- 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/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
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.DiffStatsReporter = void 0;
|
|
7
|
-
const csv_to_markdown_table_1 = __importDefault(require("csv-to-markdown-table"));
|
|
8
|
-
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
9
|
-
const type_1 = require("../type");
|
|
10
|
-
const toPercent = (d) => `${(d * 100).toFixed(2)}%`;
|
|
11
|
-
const toFirstLetterUpperCase = (s) => (s.charAt(0).toUpperCase() + s.slice(1)).split("-").join(" ");
|
|
12
|
-
const GITHUB_RUN_ID = process.env.GITHUB_RUN_ID;
|
|
13
|
-
class DiffStatsReporter {
|
|
14
|
-
constructor(options) {
|
|
15
|
-
this.options = options;
|
|
16
|
-
this.summary = new Map();
|
|
17
|
-
this.failed = new Set();
|
|
18
|
-
}
|
|
19
|
-
async init(data = []) { }
|
|
20
|
-
async failure(id) {
|
|
21
|
-
this.failed.add(id);
|
|
22
|
-
if (this.summary.has(id)) {
|
|
23
|
-
this.summary.delete(id);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
async increment(id, data) {
|
|
27
|
-
if (this.failed.has(id))
|
|
28
|
-
return;
|
|
29
|
-
if (!this.summary.has(id)) {
|
|
30
|
-
this.summary.set(id, this.createSummary());
|
|
31
|
-
}
|
|
32
|
-
const current = this.summary.get(id);
|
|
33
|
-
for (const item of data) {
|
|
34
|
-
if (item.type === type_1.ECompareResultType.Missing)
|
|
35
|
-
continue;
|
|
36
|
-
const moduleType = item.name.startsWith("webpack/runtime")
|
|
37
|
-
? "runtime"
|
|
38
|
-
: "normal";
|
|
39
|
-
// handle modules
|
|
40
|
-
if (item.type === type_1.ECompareResultType.OnlySource) {
|
|
41
|
-
current[`${type_1.ECompilerType.Rspack}|${moduleType}|${"modules"}`]++;
|
|
42
|
-
}
|
|
43
|
-
else if (item.type === type_1.ECompareResultType.OnlyDist) {
|
|
44
|
-
current[`${type_1.ECompilerType.Webpack}|${moduleType}|${"modules"}`]++;
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
current[`${"common"}|${moduleType}|${"modules"}`]++;
|
|
48
|
-
}
|
|
49
|
-
// handle lines
|
|
50
|
-
current[`${type_1.ECompilerType.Rspack}|${moduleType}|${"lines"}`] +=
|
|
51
|
-
item.lines?.source || 0;
|
|
52
|
-
current[`${type_1.ECompilerType.Webpack}|${moduleType}|${"lines"}`] +=
|
|
53
|
-
item.lines?.dist || 0;
|
|
54
|
-
current[`${"common"}|${moduleType}|${"lines"}`] +=
|
|
55
|
-
item.lines?.common || 0;
|
|
56
|
-
// handle lines in common modules
|
|
57
|
-
if (item.type === type_1.ECompareResultType.Same ||
|
|
58
|
-
item.type === type_1.ECompareResultType.Different) {
|
|
59
|
-
current[`${type_1.ECompilerType.Rspack}|${moduleType}|${"lines-in-common"}`] +=
|
|
60
|
-
item.lines?.source || 0;
|
|
61
|
-
current[`${type_1.ECompilerType.Webpack}|${moduleType}|${"lines-in-common"}`] += item.lines?.dist || 0;
|
|
62
|
-
current[`${"common"}|${moduleType}|${"lines-in-common"}`] +=
|
|
63
|
-
item.lines?.common || 0;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
async output() {
|
|
68
|
-
const chunks = [];
|
|
69
|
-
for (const [id, summary] of this.summary.entries()) {
|
|
70
|
-
chunks.push(this.stringifySummary(id, summary));
|
|
71
|
-
}
|
|
72
|
-
for (const id of this.failed.values()) {
|
|
73
|
-
chunks.push(`### ${id}\n\n> Failed\n\n`);
|
|
74
|
-
}
|
|
75
|
-
const output = [
|
|
76
|
-
...(this.options.header || []),
|
|
77
|
-
chunks.join("\n---\n"),
|
|
78
|
-
...(this.options.footer || [])
|
|
79
|
-
].join("\n\n");
|
|
80
|
-
fs_extra_1.default.ensureFileSync(this.options.file);
|
|
81
|
-
fs_extra_1.default.writeFileSync(this.options.file, output);
|
|
82
|
-
}
|
|
83
|
-
stringifySummary(id, summary) {
|
|
84
|
-
let output = `### ${id}\n\n`;
|
|
85
|
-
for (const moduleType of ["runtime", "normal"]) {
|
|
86
|
-
const csv = [];
|
|
87
|
-
csv.push(`${moduleType.charAt(0).toUpperCase() + moduleType.slice(1)} Modules,Rspack Only,Common,Webpack Only,Common Percent`);
|
|
88
|
-
for (const dimen of [
|
|
89
|
-
"modules",
|
|
90
|
-
"lines",
|
|
91
|
-
"lines-in-common"
|
|
92
|
-
]) {
|
|
93
|
-
const counts = [
|
|
94
|
-
type_1.ECompilerType.Rspack,
|
|
95
|
-
"common",
|
|
96
|
-
type_1.ECompilerType.Webpack
|
|
97
|
-
].map(i => summary[`${i}|${moduleType}|${dimen}`]);
|
|
98
|
-
csv.push(`${dimen === "lines-in-common"
|
|
99
|
-
? "Lines(Common Modules)"
|
|
100
|
-
: toFirstLetterUpperCase(dimen)},${counts.join(",")},${toPercent(counts[1] / (counts[0] + counts[1] + counts[2]))}`);
|
|
101
|
-
}
|
|
102
|
-
output += (0, csv_to_markdown_table_1.default)(csv.join("\n"), ",", true);
|
|
103
|
-
output += "\n\n";
|
|
104
|
-
}
|
|
105
|
-
if (this.options.report && GITHUB_RUN_ID) {
|
|
106
|
-
output += `> [View diff report](https://web-infra-dev.github.io/rspack-report-website/diff/${GITHUB_RUN_ID}/diff_${id}.html)`;
|
|
107
|
-
output += "\n\n";
|
|
108
|
-
}
|
|
109
|
-
return output;
|
|
110
|
-
}
|
|
111
|
-
createSummary() {
|
|
112
|
-
const result = {};
|
|
113
|
-
for (const i of [
|
|
114
|
-
type_1.ECompilerType.Rspack,
|
|
115
|
-
type_1.ECompilerType.Webpack,
|
|
116
|
-
"common"
|
|
117
|
-
]) {
|
|
118
|
-
for (const j of ["runtime", "normal"]) {
|
|
119
|
-
for (const k of [
|
|
120
|
-
"modules",
|
|
121
|
-
"lines",
|
|
122
|
-
"lines-in-common"
|
|
123
|
-
]) {
|
|
124
|
-
result[`${i}|${j}|${k}`] = 0;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
return result;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
exports.DiffStatsReporter = DiffStatsReporter;
|
package/dist/reporter/index.d.ts
DELETED
package/dist/reporter/index.js
DELETED
|
@@ -1,18 +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("./diff-html"), exports);
|
|
18
|
-
__exportStar(require("./diff-stats"), exports);
|