@systemfsoftware/stryker-js-typescript-checker 3.0.0 → 3.0.1
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/CHANGELOG.md +8 -0
- package/dist/index.mjs +47 -22
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @systemfsoftware/stryker-js-typescript-checker
|
|
2
2
|
|
|
3
|
+
## 3.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- When two or more mutants in one TypeScript project file produce a compiler error that cannot be blamed on exactly one of them, `check` now rechecks each mutant alone. A mutant that typechecks by itself is reported `passed`. A mutant that fails typecheck by itself is reported `compileError`.
|
|
8
|
+
|
|
9
|
+
- Peer Effect requirement advances to 4.0.0-rc.112. No API changes.
|
|
10
|
+
|
|
3
11
|
## 3.0.0
|
|
4
12
|
|
|
5
13
|
### Major Changes
|
package/dist/index.mjs
CHANGED
|
@@ -59,8 +59,8 @@ var CompilerFailed = class extends S.TaggedError()("CompilerFailed", {
|
|
|
59
59
|
* Checker — pure check decision.
|
|
60
60
|
*
|
|
61
61
|
* `Workflow.make` lives here and only here. The workflow receives a fully
|
|
62
|
-
* decoded input (mutants + diagnostics + file graph) and produces
|
|
63
|
-
*
|
|
62
|
+
* decoded input (mutants + diagnostics + file graph) and produces results plus
|
|
63
|
+
* `needsRetest` without touching I/O.
|
|
64
64
|
*/
|
|
65
65
|
var DiagnosticWithoutFileError = class extends S.TaggedError()("DiagnosticWithoutFileError", { text: Wire.mint(S.String) }) {};
|
|
66
66
|
var DiagnosticInUnrelatedFileError = class extends S.TaggedError()("DiagnosticInUnrelatedFileError", {
|
|
@@ -131,22 +131,37 @@ const buildResult = (input) => {
|
|
|
131
131
|
const mutants = input.mutants;
|
|
132
132
|
const diagnostics = input.diagnostics;
|
|
133
133
|
const nodes = input.nodes;
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
134
|
+
if (mutants.length === 0) return Result$1.succeed({
|
|
135
|
+
results: {},
|
|
136
|
+
needsRetest: []
|
|
137
|
+
});
|
|
137
138
|
const first = mutants[0];
|
|
138
|
-
if (first === void 0 || nodes[normalizeFileName$3(first.fileName)] === void 0)
|
|
139
|
+
if (first === void 0 || nodes[normalizeFileName$3(first.fileName)] === void 0) {
|
|
140
|
+
const results = {};
|
|
141
|
+
for (const m of mutants) results[m.id] = { status: "passed" };
|
|
142
|
+
return Result$1.succeed({
|
|
143
|
+
results,
|
|
144
|
+
needsRetest: []
|
|
145
|
+
});
|
|
146
|
+
}
|
|
139
147
|
const classified = classifyDiagnosticsPure(diagnostics, mutants, nodes);
|
|
140
148
|
if (Result$1.isFailure(classified)) return Result$1.fail(classified.failure);
|
|
141
|
-
const { definitive } = classified.success;
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
149
|
+
const { definitive, needsRetest } = classified.success;
|
|
150
|
+
const retestIds = {};
|
|
151
|
+
for (const m of needsRetest) retestIds[m.id] = true;
|
|
152
|
+
const results = {};
|
|
153
|
+
for (const m of mutants) {
|
|
154
|
+
const diags = definitive[m.id];
|
|
155
|
+
if (diags !== void 0) results[m.id] = {
|
|
145
156
|
status: "compileError",
|
|
146
157
|
reason: diags.map((d) => d.text).join("\n")
|
|
147
158
|
};
|
|
159
|
+
else if (retestIds[m.id] !== true) results[m.id] = { status: "passed" };
|
|
148
160
|
}
|
|
149
|
-
return Result$1.succeed(
|
|
161
|
+
return Result$1.succeed({
|
|
162
|
+
results,
|
|
163
|
+
needsRetest
|
|
164
|
+
});
|
|
150
165
|
};
|
|
151
166
|
const checkMutants = Workflow.make(CheckMutantsInput, (input) => buildResult(input));
|
|
152
167
|
//#endregion
|
|
@@ -1135,15 +1150,7 @@ const makeCheckDescription = (compiler) => pipe(Cell.read((command) => Effect.ge
|
|
|
1135
1150
|
mutantIds: [],
|
|
1136
1151
|
cause: errorToString(failure)
|
|
1137
1152
|
})),
|
|
1138
|
-
onSuccess: (
|
|
1139
|
-
let map = HashMap.empty();
|
|
1140
|
-
for (const [id, value] of Object.entries(record)) if (value.status === "passed") map = HashMap.set(map, id, { status: "passed" });
|
|
1141
|
-
else map = HashMap.set(map, id, {
|
|
1142
|
-
status: "compileError",
|
|
1143
|
-
reason: value.reason
|
|
1144
|
-
});
|
|
1145
|
-
return Effect.succeed(map);
|
|
1146
|
-
}
|
|
1153
|
+
onSuccess: (decision) => Effect.succeed(decision)
|
|
1147
1154
|
})));
|
|
1148
1155
|
function makeCheckerService({ options, compiler }) {
|
|
1149
1156
|
const formatDiagnostic = (error) => Effect.gen(function* () {
|
|
@@ -1186,9 +1193,27 @@ function makeCheckerService({ options, compiler }) {
|
|
|
1186
1193
|
}
|
|
1187
1194
|
}),
|
|
1188
1195
|
check: (mutants) => Effect.gen(function* () {
|
|
1189
|
-
const command = new CheckMutantsCommand({ mutants: [...mutants] });
|
|
1190
1196
|
const description = makeCheckDescription(compiler);
|
|
1191
|
-
|
|
1197
|
+
const applyOnce = (group) => Cell.apply(description, new CheckMutantsCommand({ mutants: [...group] }));
|
|
1198
|
+
const first = yield* applyOnce(mutants);
|
|
1199
|
+
let map = HashMap.empty();
|
|
1200
|
+
const mergeResults = (results) => {
|
|
1201
|
+
for (const [id, value] of Object.entries(results)) if (value.status === "passed") map = HashMap.set(map, id, { status: "passed" });
|
|
1202
|
+
else map = HashMap.set(map, id, {
|
|
1203
|
+
status: "compileError",
|
|
1204
|
+
reason: value.reason
|
|
1205
|
+
});
|
|
1206
|
+
};
|
|
1207
|
+
mergeResults(first.results);
|
|
1208
|
+
if (first.needsRetest.length > 0) yield* applyOnce([]);
|
|
1209
|
+
const originals = {};
|
|
1210
|
+
for (const m of mutants) originals[m.id] = m;
|
|
1211
|
+
for (const pending of first.needsRetest) {
|
|
1212
|
+
const original = originals[pending.id];
|
|
1213
|
+
if (original === void 0) continue;
|
|
1214
|
+
mergeResults((yield* applyOnce([original])).results);
|
|
1215
|
+
}
|
|
1216
|
+
return map;
|
|
1192
1217
|
}),
|
|
1193
1218
|
group: (mutants) => Effect.gen(function* () {
|
|
1194
1219
|
const nodes = yield* compiler.nodes.pipe(Effect.mapError((cause) => new CheckerFailed({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@systemfsoftware/stryker-js-typescript-checker",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/systemfsoftware/systemfsoftware.git",
|
|
@@ -23,9 +23,10 @@
|
|
|
23
23
|
"effect": "^4.0.0-rc.112",
|
|
24
24
|
"typescript": "^7",
|
|
25
25
|
"@systemfsoftware/stryker-js": "^0.1.0",
|
|
26
|
-
"@systemfsoftware/effect-cell-types": "^5.0.
|
|
26
|
+
"@systemfsoftware/effect-cell-types": "^5.0.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
+
"@effect/platform-node-shared": "^4.0.0-rc.112",
|
|
29
30
|
"@std/jsonc": "npm:@jsr/std__jsonc@^1.0.2",
|
|
30
31
|
"@systemfsoftware/arethetypeswrong-cli": "^1.1.1",
|
|
31
32
|
"@types/node": "^24",
|
|
@@ -33,14 +34,13 @@
|
|
|
33
34
|
"rimraf": "^6.1.3",
|
|
34
35
|
"tsdown": "^0.22.14",
|
|
35
36
|
"vitest": "^4.1.10",
|
|
36
|
-
"@systemfsoftware/
|
|
37
|
-
"@systemfsoftware/effect-
|
|
38
|
-
"@systemfsoftware/effect-schema-
|
|
39
|
-
"@systemfsoftware/
|
|
37
|
+
"@systemfsoftware/all": "^1.0.1",
|
|
38
|
+
"@systemfsoftware/effect-gherkin-spec": "^2.0.2",
|
|
39
|
+
"@systemfsoftware/effect-schema-law": "^2.0.0",
|
|
40
|
+
"@systemfsoftware/effect-schema-vite": "^2.0.1",
|
|
40
41
|
"@systemfsoftware/oxlint-config": "^0.1.0",
|
|
41
|
-
"@systemfsoftware/
|
|
42
|
-
"@systemfsoftware/
|
|
43
|
-
"@systemfsoftware/effect-schema-vite": "^2.0.0"
|
|
42
|
+
"@systemfsoftware/tsconfig": "^1.3.3",
|
|
43
|
+
"@systemfsoftware/vitest-config": "^0.1.0"
|
|
44
44
|
},
|
|
45
45
|
"inlinedDependencies": {
|
|
46
46
|
"@jsr/std__jsonc": "1.0.2"
|