@systemfsoftware/stryker-js-cli 5.0.1 → 7.0.0
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 +226 -0
- package/README.md +2 -4
- package/dist/main.mjs +947 -891
- package/dist/{node-D-ynY_kk.mjs → node-B7U4hEuW.mjs} +7 -5
- package/dist/workers/checker-worker.mjs +2 -2
- package/dist/workers/child-process-test-runner-worker.mjs +23 -12
- package/package.json +19 -20
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as Effect from "effect/Effect";
|
|
2
2
|
import * as Layer from "effect/Layer";
|
|
3
|
+
import * as Option from "effect/Option";
|
|
3
4
|
import * as NodeChildProcessSpawner from "@effect/platform-node-shared/NodeChildProcessSpawner";
|
|
4
5
|
import { ChildProcessCrashedError, WorkerEntries, WorkerLauncher } from "@systemfsoftware/stryker-js-engine";
|
|
5
|
-
import * as FileSystem from "effect/FileSystem";
|
|
6
6
|
import * as Match from "effect/Match";
|
|
7
7
|
import * as Path from "effect/Path";
|
|
8
|
+
import * as FileSystem from "effect/FileSystem";
|
|
8
9
|
import { NodeFileSystem, NodePath, NodeSocket } from "@effect/platform-node";
|
|
9
10
|
import { Module } from "@systemfsoftware/stryker-js/Module";
|
|
10
11
|
import * as ChildProcess from "effect/unstable/process/ChildProcess";
|
|
@@ -12,13 +13,14 @@ import * as ChildProcessSpawner from "effect/unstable/process/ChildProcessSpawne
|
|
|
12
13
|
import * as RpcClient from "effect/unstable/rpc/RpcClient";
|
|
13
14
|
import * as RpcSerialization from "effect/unstable/rpc/RpcSerialization";
|
|
14
15
|
//#region src/platform/node.ts
|
|
16
|
+
const EMPTY_PATHS = [];
|
|
15
17
|
const makeModuleRequire = (nodeModule, filename) => {
|
|
16
18
|
const requireFrom = nodeModule.createRequire(filename);
|
|
17
19
|
const requireFn = (request) => requireFrom(request);
|
|
18
|
-
requireFn.resolve = (request, options) => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
};
|
|
20
|
+
requireFn.resolve = (request, options) => Option.match(Option.fromUndefinedOr(options), {
|
|
21
|
+
onNone: () => requireFrom.resolve(request),
|
|
22
|
+
onSome: (present) => requireFrom.resolve(request, { paths: [...Option.getOrElse(Option.fromNullishOr(present.paths), () => EMPTY_PATHS)] })
|
|
23
|
+
});
|
|
22
24
|
return requireFn;
|
|
23
25
|
};
|
|
24
26
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { t as nodeModuleLayer } from "../node-
|
|
1
|
+
import { t as nodeModuleLayer } from "../node-B7U4hEuW.mjs";
|
|
2
2
|
import { n as workerSocketPath, t as launchWorker } from "../worker-runtime-CT5LMMgY.mjs";
|
|
3
3
|
import * as Effect from "effect/Effect";
|
|
4
4
|
import * as Layer from "effect/Layer";
|
|
5
|
-
import * as FileSystem from "effect/FileSystem";
|
|
6
5
|
import * as Option from "effect/Option";
|
|
7
6
|
import * as Path from "effect/Path";
|
|
7
|
+
import * as FileSystem from "effect/FileSystem";
|
|
8
8
|
import { NodeFileSystem, NodePath, NodeSocketServer } from "@effect/platform-node";
|
|
9
9
|
import * as RpcSerialization from "effect/unstable/rpc/RpcSerialization";
|
|
10
10
|
import { Checker, CheckerFailed } from "@systemfsoftware/stryker-js/Checker";
|
|
@@ -1,34 +1,45 @@
|
|
|
1
|
-
import { t as nodeModuleLayer } from "../node-
|
|
1
|
+
import { t as nodeModuleLayer } from "../node-B7U4hEuW.mjs";
|
|
2
2
|
import { n as workerSocketPath, t as launchWorker } from "../worker-runtime-CT5LMMgY.mjs";
|
|
3
3
|
import * as Effect from "effect/Effect";
|
|
4
4
|
import * as Layer from "effect/Layer";
|
|
5
|
+
import * as Option from "effect/Option";
|
|
5
6
|
import { errorToString } from "@systemfsoftware/stryker-js/Mutant";
|
|
6
7
|
import * as Cause from "effect/Cause";
|
|
7
|
-
import * as FileSystem from "effect/FileSystem";
|
|
8
8
|
import * as Path from "effect/Path";
|
|
9
|
+
import * as FileSystem from "effect/FileSystem";
|
|
9
10
|
import { NodeFileSystem, NodePath, NodeSocketServer } from "@effect/platform-node";
|
|
10
11
|
import * as RpcSerialization from "effect/unstable/rpc/RpcSerialization";
|
|
11
12
|
import { RunConfiguration, SandboxDirectory } from "@systemfsoftware/stryker-js/Plugin";
|
|
12
13
|
import * as RpcServer from "effect/unstable/rpc/RpcServer";
|
|
13
14
|
import { MutantCoverageSchema, TestRunnerRpcs, create, decodeWorkerOptions, loadPlugins } from "@systemfsoftware/stryker-js-engine/worker";
|
|
14
15
|
import { TestRunner, TestRunnerFailed } from "@systemfsoftware/stryker-js/TestRunner";
|
|
15
|
-
import { Schema } from "effect";
|
|
16
|
+
import { Match, Schema } from "effect";
|
|
16
17
|
//#region src/workers/child-process-test-runner-worker.ts
|
|
17
|
-
const
|
|
18
|
+
const isCompleteDryRun = (result) => result.status === "complete";
|
|
19
|
+
const COVERAGE_SETTLED = [
|
|
20
|
+
(result) => result.status !== "complete",
|
|
21
|
+
(result) => Option.exists(Option.liftPredicate(result, isCompleteDryRun), (complete) => complete.mutantCoverage !== void 0),
|
|
22
|
+
(_result, options) => options.coverageAnalysis === "off"
|
|
23
|
+
];
|
|
24
|
+
const coverageNeeded = (result, options) => !COVERAGE_SETTLED.some((settled) => settled(result, options));
|
|
25
|
+
const normalizeDryRun = (result) => {
|
|
18
26
|
if (result.status === "error") return {
|
|
19
27
|
...result,
|
|
20
28
|
errorMessage: errorToString(result.errorMessage)
|
|
21
29
|
};
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
30
|
+
return result;
|
|
31
|
+
};
|
|
32
|
+
const decodeCoverageInto = (result) => Effect.gen(function* () {
|
|
25
33
|
const decoded = yield* Schema.decodeUnknownEffect(Schema.optional(MutantCoverageSchema))(globalThis.__mutantCoverage__).pipe(Effect.orElseSucceed(() => void 0));
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
34
|
+
return Option.match(Option.liftPredicate(result, isCompleteDryRun), {
|
|
35
|
+
onNone: () => normalizeDryRun(result),
|
|
36
|
+
onSome: (complete) => Option.getOrElse(Option.map(Option.fromUndefinedOr(decoded), (coverage) => ({
|
|
37
|
+
...complete,
|
|
38
|
+
mutantCoverage: coverage
|
|
39
|
+
})), () => complete)
|
|
40
|
+
});
|
|
31
41
|
});
|
|
42
|
+
const withCoverage = (result, options) => Match.value(coverageNeeded(result, options)).pipe(Match.when(true, () => decodeCoverageInto(result)), Match.when(false, () => Effect.succeed(normalizeDryRun(result))), Match.exhaustive);
|
|
32
43
|
const normalizeMutantRun = (result) => {
|
|
33
44
|
if (result.status === "error") return {
|
|
34
45
|
...result,
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@systemfsoftware/stryker-js-cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/systemfsoftware/systemfsoftware.git",
|
|
7
|
-
"directory": "packages/
|
|
7
|
+
"directory": "packages/stryker-js/stryker-js-cli"
|
|
8
8
|
},
|
|
9
|
-
"homepage": "https://github.com/systemfsoftware/systemfsoftware/tree/main/packages/
|
|
9
|
+
"homepage": "https://github.com/systemfsoftware/systemfsoftware/tree/main/packages/stryker-js/stryker-js-cli#readme",
|
|
10
10
|
"bugs": "https://github.com/systemfsoftware/systemfsoftware/issues",
|
|
11
11
|
"description": "The stryker command-line interface — terminal framing, run-event stream, and exit handling for the @systemfsoftware mutation engine.",
|
|
12
12
|
"type": "module",
|
|
@@ -14,37 +14,36 @@
|
|
|
14
14
|
"dist"
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@effect/platform-node": "
|
|
18
|
-
"@effect/platform-node-shared": "
|
|
17
|
+
"@effect/platform-node": "4.0.0-rc.112",
|
|
18
|
+
"@effect/platform-node-shared": "4.0.0-rc.112",
|
|
19
19
|
"@noble/hashes": "1.8.0",
|
|
20
|
-
"effect": "
|
|
21
|
-
"@systemfsoftware/effect-cell-types": "^6.0.
|
|
22
|
-
"@systemfsoftware/stryker-js
|
|
23
|
-
"@systemfsoftware/stryker-js-engine": "^0.
|
|
24
|
-
"@systemfsoftware/stryker-js": "^
|
|
20
|
+
"effect": "4.0.0-rc.112",
|
|
21
|
+
"@systemfsoftware/effect-cell-types": "^6.0.1",
|
|
22
|
+
"@systemfsoftware/stryker-js": "^3.0.0",
|
|
23
|
+
"@systemfsoftware/stryker-js-engine": "^2.0.0",
|
|
24
|
+
"@systemfsoftware/stryker-js-html-reporter": "^3.0.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@systemfsoftware/arethetypeswrong-cli": "^1.1.1",
|
|
28
28
|
"@types/node": "^24",
|
|
29
29
|
"@vitest/coverage-v8": "^4",
|
|
30
|
-
"mutation-testing-report-schema": "3.7.3",
|
|
31
30
|
"oxlint": "^1.77.0",
|
|
32
31
|
"rimraf": "^6.1.3",
|
|
33
32
|
"testcontainers": "^12.1.0",
|
|
34
33
|
"tsdown": "^0.22.14",
|
|
35
34
|
"vite-tsconfig-paths": "^6.1.1",
|
|
36
35
|
"vitest": "^4",
|
|
37
|
-
"@systemfsoftware/
|
|
36
|
+
"@systemfsoftware/effect-gherkin-spec": "^4.0.1",
|
|
37
|
+
"@systemfsoftware/all": "^2.0.0",
|
|
38
|
+
"@systemfsoftware/effect-schema-vite": "^2.0.3",
|
|
39
|
+
"@systemfsoftware/effect-schema-law": "^2.0.2",
|
|
40
|
+
"@systemfsoftware/stryker-js-typescript-checker": "^5.0.1",
|
|
38
41
|
"@systemfsoftware/oxlint-config": "^0.1.0",
|
|
39
|
-
"@systemfsoftware/
|
|
40
|
-
"@systemfsoftware/
|
|
41
|
-
"@systemfsoftware/stryker-js-typescript-checker": "^4.0.0",
|
|
42
|
-
"@systemfsoftware/stryker-test-contribution": "^1.1.3",
|
|
43
|
-
"@systemfsoftware/stryker-js-vitest-runner": "^3.0.0",
|
|
42
|
+
"@systemfsoftware/stryker-js-vitest-runner": "^4.0.1",
|
|
43
|
+
"@systemfsoftware/stryker-test-contribution": "^2.0.1",
|
|
44
44
|
"@systemfsoftware/tsconfig": "^1.3.3",
|
|
45
|
-
"@systemfsoftware/stryker-plugins": "^
|
|
46
|
-
"@systemfsoftware/vitest-config": "^0.1.0"
|
|
47
|
-
"@systemfsoftware/effect-gherkin-spec": "^4.0.0"
|
|
45
|
+
"@systemfsoftware/stryker-plugins": "^3.0.1",
|
|
46
|
+
"@systemfsoftware/vitest-config": "^0.1.0"
|
|
48
47
|
},
|
|
49
48
|
"engines": {
|
|
50
49
|
"node": ">=20.0.0"
|