@systemfsoftware/stryker-js-typescript-checker 5.0.3 → 5.0.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/CHANGELOG.md +10 -0
- package/dist/index.d.mts +7 -5
- package/dist/index.mjs +8 -10
- package/package.json +11 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @systemfsoftware/stryker-js-typescript-checker
|
|
2
2
|
|
|
3
|
+
## 5.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Imports rewired to the collapsed `@systemfsoftware/stryker-js` root entry; each package now co-releases against the root-entry major.
|
|
8
|
+
|
|
9
|
+
- Updated dependencies:
|
|
10
|
+
- @systemfsoftware/effect-cell-types@8.0.0
|
|
11
|
+
- @systemfsoftware/stryker-js@4.0.0
|
|
12
|
+
|
|
3
13
|
## 5.0.3
|
|
4
14
|
|
|
5
15
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare const
|
|
4
|
-
|
|
5
|
-
export
|
|
1
|
+
import { PluginLayerContribution } from '@systemfsoftware/stryker-js';
|
|
2
|
+
|
|
3
|
+
export declare const strykerPlugins: PluginLayerContribution<"Checker">[];
|
|
4
|
+
|
|
5
|
+
export declare const strykerValidationSchema: Record<string, unknown>;
|
|
6
|
+
|
|
7
|
+
export { }
|
package/dist/index.mjs
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { Checker, CheckerFailed } from "@systemfsoftware/stryker-js
|
|
2
|
-
import { RunConfiguration, declarePlugin } from "@systemfsoftware/stryker-js/Plugin";
|
|
1
|
+
import { Checker, CheckerFailed, Mutant, RunConfiguration, StrykerOptionsSchema, declarePlugin, errorToString, normalizeFileName } from "@systemfsoftware/stryker-js";
|
|
3
2
|
import * as Effect from "effect/Effect";
|
|
4
3
|
import * as FileSystem from "effect/FileSystem";
|
|
5
4
|
import * as Layer from "effect/Layer";
|
|
6
5
|
import * as Path from "effect/Path";
|
|
7
6
|
import * as S from "effect/Schema";
|
|
8
7
|
import { Cell, Workflow } from "@systemfsoftware/effect-cell-types";
|
|
9
|
-
import { Mutant, errorToString, normalizeFileName } from "@systemfsoftware/stryker-js/Mutant";
|
|
10
8
|
import { Predicate, Result, Schema } from "effect";
|
|
11
9
|
import * as HashMap from "effect/HashMap";
|
|
12
10
|
import * as Match from "effect/Match";
|
|
@@ -14,7 +12,6 @@ import * as Option from "effect/Option";
|
|
|
14
12
|
import { API, DiagnosticCategory } from "typescript/unstable/sync";
|
|
15
13
|
import * as Arr from "effect/Array";
|
|
16
14
|
import * as Result$1 from "effect/Result";
|
|
17
|
-
import { StrykerOptionsSchema } from "@systemfsoftware/stryker-js/Schema";
|
|
18
15
|
import * as Context from "effect/Context";
|
|
19
16
|
import * as MutableHashMap from "effect/MutableHashMap";
|
|
20
17
|
import * as MutableHashSet from "effect/MutableHashSet";
|
|
@@ -1245,7 +1242,7 @@ const checkCell = Cell.layer({
|
|
|
1245
1242
|
onSuccess: Effect.succeed
|
|
1246
1243
|
})
|
|
1247
1244
|
});
|
|
1248
|
-
|
|
1245
|
+
const makeCheckerService = ({ options, compiler }) => {
|
|
1249
1246
|
const verify = Cell.provide(checkCell, Layer.succeed(TypeScriptCompiler, compiler));
|
|
1250
1247
|
const positionOf = (error) => Option.match(Option.filter(Option.fromUndefinedOr(error.fileName), (fileName) => fileName !== ""), {
|
|
1251
1248
|
onNone: () => Effect.succeed(""),
|
|
@@ -1256,26 +1253,27 @@ function makeCheckerService({ options, compiler }) {
|
|
|
1256
1253
|
});
|
|
1257
1254
|
const formatDiagnostic = (error) => positionOf(error).pipe(Effect.map((position) => `${position}${severityOf(error.category)} TS${error.code}: ${error.text}`));
|
|
1258
1255
|
const createErrorText = (errors) => Effect.map(Effect.forEach(errors, formatDiagnostic), (parts) => parts.join("\n"));
|
|
1259
|
-
const soloRound = (mutant) =>
|
|
1260
|
-
const soloRounds = (decision) => Match.value(decision).pipe(Match.tag("CheckFinished", () => Effect.succeed([])), Match.tag("RetestRequired", (retest) =>
|
|
1256
|
+
const soloRound = (mutant) => verify.run(new CheckMutantsCommand({ mutants: [mutant] })).pipe(Effect.map((decision) => decision.results));
|
|
1257
|
+
const soloRounds = (decision) => Match.value(decision).pipe(Match.tag("CheckFinished", () => Effect.succeed([])), Match.tag("RetestRequired", (retest) => verify.run(new CheckMutantsCommand({ mutants: [] })).pipe(Effect.flatMap(() => Effect.forEach(retest.needsRetest, soloRound)))), Match.exhaustive);
|
|
1261
1258
|
return {
|
|
1262
1259
|
init: compiler.init.pipe(Effect.mapError((cause) => refuse([], cause)), Effect.flatMap((errors) => {
|
|
1263
1260
|
if (errors.length === 0) return Effect.void;
|
|
1264
1261
|
return createErrorText(errors).pipe(Effect.map((text) => refuse([], /* @__PURE__ */ new Error(`Typescript error(s) found in dry run compilation: ${text}`))), Effect.flatMap(Effect.fail));
|
|
1265
1262
|
})),
|
|
1266
|
-
check: (mutants) =>
|
|
1263
|
+
check: (mutants) => verify.run(new CheckMutantsCommand({ mutants: [...mutants] })).pipe(Effect.flatMap((first) => Effect.map(soloRounds(first), (rounds) => mergeAnswers([first.results, ...rounds])))),
|
|
1267
1264
|
group: (mutants) => compiler.nodes.pipe(Effect.map((nodes) => groupMutants(mutants, nodes, getPrioritize(options))), Effect.mapError((cause) => refuse(mutants.map((mutant) => mutant.id), cause)))
|
|
1268
1265
|
};
|
|
1269
|
-
}
|
|
1266
|
+
};
|
|
1270
1267
|
//#endregion
|
|
1271
1268
|
//#region src/index.ts
|
|
1272
1269
|
const strykerPlugins = [declarePlugin("Checker", "typescript", Layer.effect(Checker, Effect.gen(function* () {
|
|
1273
1270
|
const options = yield* RunConfiguration;
|
|
1274
1271
|
const fsService = yield* FileSystem.FileSystem;
|
|
1275
1272
|
const pathService = yield* Path.Path;
|
|
1273
|
+
const compiler = makeTypescriptCompiler(options, yield* makeHybridFileSystem(fsService), fsService, pathService);
|
|
1276
1274
|
return makeCheckerService({
|
|
1277
1275
|
options,
|
|
1278
|
-
compiler
|
|
1276
|
+
compiler
|
|
1279
1277
|
});
|
|
1280
1278
|
})))];
|
|
1281
1279
|
const rawSchema = typescript_checker_options_default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@systemfsoftware/stryker-js-typescript-checker",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.4",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/systemfsoftware/systemfsoftware.git",
|
|
@@ -22,12 +22,13 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"effect": "4.0.0-rc.112",
|
|
24
24
|
"typescript": "^7",
|
|
25
|
-
"@systemfsoftware/effect-cell-types": "^
|
|
26
|
-
"@systemfsoftware/stryker-js": "^
|
|
25
|
+
"@systemfsoftware/effect-cell-types": "^8.0.0",
|
|
26
|
+
"@systemfsoftware/stryker-js": "^4.0.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@effect/platform-node": "4.0.0-rc.112",
|
|
30
30
|
"@effect/platform-node-shared": "4.0.0-rc.112",
|
|
31
|
+
"@microsoft/api-extractor": "^7.58.7",
|
|
31
32
|
"@std/jsonc": "npm:@jsr/std__jsonc@^1.0.2",
|
|
32
33
|
"@systemfsoftware/arethetypeswrong-cli": "^4.1.0",
|
|
33
34
|
"@types/node": "^24",
|
|
@@ -35,13 +36,13 @@
|
|
|
35
36
|
"rimraf": "^6.1.3",
|
|
36
37
|
"tsdown": "^0.22.14",
|
|
37
38
|
"vitest": "^4",
|
|
38
|
-
"@systemfsoftware/all": "^2.0.1",
|
|
39
39
|
"@systemfsoftware/effect-gherkin-spec": "^4.0.2",
|
|
40
40
|
"@systemfsoftware/effect-schema-law": "^2.1.1",
|
|
41
41
|
"@systemfsoftware/effect-schema-vite": "^2.1.1",
|
|
42
|
-
"@systemfsoftware/
|
|
42
|
+
"@systemfsoftware/all": "^2.0.2",
|
|
43
43
|
"@systemfsoftware/oxlint-config": "^0.1.0",
|
|
44
|
-
"@systemfsoftware/tsconfig": "^1.3.4"
|
|
44
|
+
"@systemfsoftware/tsconfig": "^1.3.4",
|
|
45
|
+
"@systemfsoftware/vitest-config": "^0.1.0"
|
|
45
46
|
},
|
|
46
47
|
"inlinedDependencies": {
|
|
47
48
|
"@jsr/std__jsonc": "1.0.2"
|
|
@@ -51,10 +52,12 @@
|
|
|
51
52
|
},
|
|
52
53
|
"scripts": {
|
|
53
54
|
"clean": "rimraf dist",
|
|
54
|
-
"build": "tsdown",
|
|
55
|
+
"build": "tsdown && pnpm api:check",
|
|
55
56
|
"typecheck": "tsc --noEmit --incremental",
|
|
56
57
|
"attw": "attw --pack .",
|
|
57
58
|
"test": "vitest run",
|
|
58
|
-
"lint": "f=${OXLINT_FORMAT:-${AGENT:+agent}}; oxlint . --format=${f:-default}"
|
|
59
|
+
"lint": "f=${OXLINT_FORMAT:-${AGENT:+agent}}; oxlint . --format=${f:-default}",
|
|
60
|
+
"api:check": "tsdown && api-extractor run",
|
|
61
|
+
"api:update": "api-extractor run --local"
|
|
59
62
|
}
|
|
60
63
|
}
|