@systemfsoftware/stryker-js 3.0.2 → 5.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.
Files changed (94) hide show
  1. package/CHANGELOG.md +101 -0
  2. package/LICENSE +3 -15
  3. package/README.md +69 -21
  4. package/dist/Plugins-sA_9VKus.d.mts +96 -0
  5. package/dist/builtin-reporters-wAuKFSsd.mjs +672 -0
  6. package/dist/builtin-reporters.d.mts +14 -0
  7. package/dist/builtin-reporters.mjs +2 -0
  8. package/dist/compiler-Bq9Nelu8.mjs +48406 -0
  9. package/dist/config.d.mts +11 -0
  10. package/dist/config.mjs +7 -0
  11. package/dist/dist-B3nT7z4G.mjs +5155 -0
  12. package/dist/execAsync-CfPZgJSD.mjs +10 -0
  13. package/dist/execAsync-DdCu5QLN.mjs +10 -0
  14. package/dist/getMachineId-bsd-C6bLIaiv.mjs +27 -0
  15. package/dist/getMachineId-bsd-CXSiHDga.mjs +27 -0
  16. package/dist/getMachineId-darwin-D3cIKeqx.mjs +24 -0
  17. package/dist/getMachineId-darwin-DPZ0kdKD.mjs +24 -0
  18. package/dist/getMachineId-linux-CQwLSlZk.mjs +20 -0
  19. package/dist/getMachineId-linux-Ci8OVJU0.mjs +20 -0
  20. package/dist/getMachineId-unsupported-PX0hnW6X.mjs +15 -0
  21. package/dist/getMachineId-unsupported-_ExL3Avl.mjs +15 -0
  22. package/dist/getMachineId-win-BCsS9pC_.mjs +26 -0
  23. package/dist/getMachineId-win-D9Tb0p7w.mjs +26 -0
  24. package/dist/index.d.mts +1009 -8
  25. package/dist/index.mjs +3 -9
  26. package/dist/main.mjs +104333 -0
  27. package/dist/merge-config-BrrNQWje.mjs +16 -0
  28. package/dist/mutation-test.cell-RmF-sBUm.d.mts +509 -0
  29. package/dist/output-mode-CfGHDpi5.d.mts +17 -0
  30. package/dist/parser.wasm32-wasi.wasm +0 -0
  31. package/dist/plugin-loader.d.mts +106 -0
  32. package/dist/plugin-loader.mjs +2 -0
  33. package/dist/plugin-worker-entry-DNu0SHO8.mjs +1413 -0
  34. package/dist/promises.d.mts +5 -0
  35. package/dist/promises.mjs +14 -0
  36. package/dist/rolldown-runtime-Dr7-SnC6.mjs +45 -0
  37. package/dist/src-Bzh7ykDp.mjs +4724 -0
  38. package/dist/stryker-config-BlfHxS7n.d.mts +14 -0
  39. package/dist/wasm-Dr7kZatW.mjs +13017 -0
  40. package/package.json +81 -38
  41. package/dist/Checker-A8o5B3Ub.d.mts +0 -40
  42. package/dist/Checker-Bq8NXD8d.mjs +0 -25
  43. package/dist/Checker.d.mts +0 -2
  44. package/dist/Checker.mjs +0 -2
  45. package/dist/Evaluator-CnAN8-pZ.d.mts +0 -19
  46. package/dist/Evaluator.d.mts +0 -3
  47. package/dist/Evaluator.mjs +0 -9
  48. package/dist/ExitClass.d.mts +0 -9
  49. package/dist/ExitClass.mjs +0 -59
  50. package/dist/ExitClass.schema-BmOIK5zT.d.mts +0 -18
  51. package/dist/Ignorer-BUY68FZQ.d.mts +0 -21
  52. package/dist/Ignorer.d.mts +0 -2
  53. package/dist/Ignorer.mjs +0 -7
  54. package/dist/Metrics.d.mts +0 -7
  55. package/dist/Metrics.mjs +0 -79
  56. package/dist/Metrics.schema-BaVd6rXs.d.mts +0 -50
  57. package/dist/Metrics.schema-DZdoc46X.mjs +0 -27
  58. package/dist/Module-DHKEMAFI.d.mts +0 -31
  59. package/dist/Module.d.mts +0 -2
  60. package/dist/Module.mjs +0 -16
  61. package/dist/Mutant-Ci25PsWA.d.mts +0 -351
  62. package/dist/Mutant.d.mts +0 -3
  63. package/dist/Mutant.mjs +0 -90
  64. package/dist/Mutant.schema-H3r0ho_R.mjs +0 -34
  65. package/dist/Plugin-BtItMchw.d.mts +0 -153
  66. package/dist/Plugin-DXFdJP1l.mjs +0 -105
  67. package/dist/Plugin.d.mts +0 -2
  68. package/dist/Plugin.mjs +0 -2
  69. package/dist/Report.d.mts +0 -2
  70. package/dist/Report.mjs +0 -98
  71. package/dist/Report.schema-_buHXdnZ.d.mts +0 -251
  72. package/dist/Reporter-BWTwlSJf.mjs +0 -25
  73. package/dist/Reporter-C7ysGxqX.d.mts +0 -16
  74. package/dist/Reporter.d.mts +0 -4
  75. package/dist/Reporter.mjs +0 -3
  76. package/dist/ReporterEvent.d.mts +0 -2
  77. package/dist/ReporterEvent.mjs +0 -57
  78. package/dist/ReporterEvent.schema-BhtyYCZo.d.mts +0 -189
  79. package/dist/Run-BUpNSmcM.d.mts +0 -172
  80. package/dist/Run.d.mts +0 -2
  81. package/dist/Run.mjs +0 -56
  82. package/dist/Run.schema-DZve3k2m.mjs +0 -138
  83. package/dist/Schema-4oCWQ0P0.d.mts +0 -158
  84. package/dist/Schema-CMKdWMUN.mjs +0 -244
  85. package/dist/Schema.d.mts +0 -2
  86. package/dist/Schema.mjs +0 -2
  87. package/dist/TestRunner.d.mts +0 -2
  88. package/dist/TestRunner.mjs +0 -57
  89. package/dist/TestRunner.schema-Dy0Wdro2.mjs +0 -119
  90. package/dist/output-file.d.mts +0 -8
  91. package/dist/output-file.mjs +0 -8
  92. package/dist/provided-options.d.mts +0 -16
  93. package/dist/provided-options.mjs +0 -1
  94. package/dist/rolldown-runtime-D7D4PA-g.mjs +0 -13
package/package.json CHANGED
@@ -1,72 +1,115 @@
1
1
  {
2
2
  "name": "@systemfsoftware/stryker-js",
3
- "version": "3.0.2",
3
+ "version": "5.0.0",
4
4
  "repository": {
5
5
  "type": "git",
6
- "url": "git+https://github.com/systemfsoftware/systemfsoftware.git",
7
- "directory": "packages/stryker-js/stryker-js"
6
+ "url": "git+https://github.com/systemfsoftware/stryker-js-effect.git",
7
+ "directory": "packages/stryker-js"
8
8
  },
9
- "homepage": "https://github.com/systemfsoftware/systemfsoftware/tree/main/packages/stryker-js/stryker-js#readme",
10
- "bugs": "https://github.com/systemfsoftware/systemfsoftware/issues",
11
- "description": "The mutation-testing language — concept modules, no platform.",
9
+ "homepage": "https://github.com/systemfsoftware/stryker-js-effect",
10
+ "bugs": {
11
+ "url": "https://github.com/systemfsoftware/stryker-js-effect/issues"
12
+ },
13
+ "description": "The Stryker mutation testing tool — the stryker executable, the run engine, and the configuration surface.",
12
14
  "type": "module",
13
15
  "files": [
14
16
  "dist"
15
17
  ],
18
+ "bin": {
19
+ "stryker": "./dist/main.mjs"
20
+ },
16
21
  "license": "Apache-2.0",
17
22
  "engines": {
18
- "node": ">=20.0.0"
23
+ "node": ">=22.18.0"
19
24
  },
20
25
  "dependencies": {
21
- "effect": "4.0.0-rc.112",
22
- "@systemfsoftware/effect-cell-types": "^7.0.1"
26
+ "@effect/opentelemetry": "4.0.0-rc.112",
27
+ "@effect/platform-node": "4.0.0-rc.112",
28
+ "@effect/platform-node-shared": "4.0.0-rc.112",
29
+ "@noble/hashes": "^2",
30
+ "@opentelemetry/api": "^1.9.0",
31
+ "@opentelemetry/exporter-trace-otlp-http": "^0.208.0",
32
+ "@opentelemetry/sdk-trace-base": "^2.2.0",
33
+ "@systemfsoftware/effect-cell-types": "^8",
34
+ "diff-match-patch": "1.0.5",
35
+ "minimatch": "~10.2.4",
36
+ "@systemfsoftware/stryker-ignorer-interface": "^0.1.0",
37
+ "@systemfsoftware/stryker-js-html-reporter": "^4.0.0",
38
+ "@systemfsoftware/stryker-js-plugin-runtime": "^5.0.0",
39
+ "@systemfsoftware/stryker-js-plugin-interface": "^5.0.0",
40
+ "@systemfsoftware/stryker-js-instrumenter": "^7.0.0"
41
+ },
42
+ "peerDependencies": {
43
+ "effect": "4.0.0-rc.112"
23
44
  },
24
45
  "devDependencies": {
46
+ "@effect/tsgo": "^0.45.0",
25
47
  "@effect/vitest": "4.0.0-rc.112",
26
- "@systemfsoftware/arethetypeswrong-cli": "^4.1.0",
48
+ "@microsoft/api-extractor": "^7",
49
+ "@oxc-parser/binding-wasm32-wasi": "^0.140.0",
50
+ "@std/jsonc": "npm:@jsr/std__jsonc@^1",
51
+ "@systemfsoftware/all": "^2",
52
+ "@systemfsoftware/arethetypeswrong-cli": "^4",
53
+ "@systemfsoftware/effect-gherkin-spec": "^4",
54
+ "@systemfsoftware/effect-schema-law": "^2",
55
+ "@systemfsoftware/effect-schema-vite": "^2",
56
+ "@systemfsoftware/tsconfig": "^1",
57
+ "@types/diff-match-patch": "1.0.36",
27
58
  "@types/node": "^24",
28
- "oxlint": "^1.77.0",
29
- "oxlint-tsgolint": "7.0.2001",
59
+ "@vitest/coverage-v8": "^4",
60
+ "concurrently": "^10",
61
+ "mutation-testing-elements": "3.7.3",
62
+ "oxc-parser": "^0.140.0",
63
+ "oxlint": "^1",
64
+ "oxlint-tsgolint": "^7",
30
65
  "rimraf": "^6.1.3",
31
- "tsdown": "^0.22.14",
66
+ "tsdown": "^0.23.0",
32
67
  "typescript": "^7",
33
68
  "vitest": "^4",
34
- "@systemfsoftware/all": "^2.0.1",
35
- "@systemfsoftware/effect-schema-vite": "^2.1.1",
36
- "@systemfsoftware/vitest-config": "^0.1.0",
37
- "@systemfsoftware/tsconfig": "^1.3.4",
38
- "@systemfsoftware/effect-schema-law": "^2.1.1"
69
+ "@systemfsoftware/stryker-ignorer-effect-schema-declarations": "^0.1.0",
70
+ "@systemfsoftware/stryker-ignorer-in-source-vitest-block": "^0.1.0",
71
+ "@systemfsoftware/tsdown-config": "^0.1.0",
72
+ "@systemfsoftware/vitest-config": "^0.1.0"
39
73
  },
40
74
  "publishConfig": {
41
75
  "access": "public",
42
76
  "provenance": true
43
77
  },
44
78
  "exports": {
45
- ".": "./dist/index.mjs",
46
- "./Checker": "./dist/Checker.mjs",
47
- "./Evaluator": "./dist/Evaluator.mjs",
48
- "./ExitClass": "./dist/ExitClass.mjs",
49
- "./Ignorer": "./dist/Ignorer.mjs",
50
- "./Metrics": "./dist/Metrics.mjs",
51
- "./Module": "./dist/Module.mjs",
52
- "./Mutant": "./dist/Mutant.mjs",
53
- "./output-file": "./dist/output-file.mjs",
54
- "./Plugin": "./dist/Plugin.mjs",
55
- "./provided-options": "./dist/provided-options.mjs",
56
- "./Report": "./dist/Report.mjs",
57
- "./Reporter": "./dist/Reporter.mjs",
58
- "./ReporterEvent": "./dist/ReporterEvent.mjs",
59
- "./Run": "./dist/Run.mjs",
60
- "./Schema": "./dist/Schema.mjs",
61
- "./TestRunner": "./dist/TestRunner.mjs",
79
+ ".": {
80
+ "types": "./dist/index.d.mts",
81
+ "default": "./dist/index.mjs"
82
+ },
83
+ "./builtin-reporters": {
84
+ "types": "./dist/builtin-reporters.d.mts",
85
+ "default": "./dist/builtin-reporters.mjs"
86
+ },
87
+ "./config": {
88
+ "types": "./dist/config.d.mts",
89
+ "default": "./dist/config.mjs"
90
+ },
91
+ "./plugin-loader": {
92
+ "types": "./dist/plugin-loader.d.mts",
93
+ "default": "./dist/plugin-loader.mjs"
94
+ },
95
+ "./promises": {
96
+ "types": "./dist/promises.d.mts",
97
+ "default": "./dist/promises.mjs"
98
+ },
62
99
  "./package.json": "./package.json"
63
100
  },
101
+ "inlinedDependencies": {
102
+ "@jsr/std__jsonc": "1.0.2"
103
+ },
64
104
  "scripts": {
65
105
  "clean": "rimraf dist",
66
- "build": "tsdown",
67
- "typecheck": "tsc --noEmit --incremental",
106
+ "build": "rimraf dist && tsdown --config tsdown.bin.config.ts && tsdown --config tsdown.config.ts",
107
+ "typecheck": "tsc --noEmit --incremental && tsc -p tsconfig.node.json --noEmit",
68
108
  "test": "vitest run",
69
109
  "attw": "attw --pack .",
70
- "lint": "f=${OXLINT_FORMAT:-${AGENT:+agent}}; oxlint . --format=${f:-default}"
110
+ "lint": "f=${OXLINT_FORMAT:-${AGENT:+agent}}; oxlint . --format=${f:-default}",
111
+ "api:check": "concurrently --kill-others-on-fail \"api-extractor run\" \"api-extractor run --config api-extractor.builtin-reporters.json\" \"api-extractor run --config api-extractor.plugin-loader.json\"",
112
+ "api:update": "concurrently --kill-others-on-fail \"api-extractor run --local\" \"api-extractor run --local --config api-extractor.builtin-reporters.json\" \"api-extractor run --local --config api-extractor.plugin-loader.json\"",
113
+ "lint:tsgo": "effect-tsgo diagnostics --project tsconfig.json --format ${TSGO_FORMAT:-text}"
71
114
  }
72
115
  }
@@ -1,40 +0,0 @@
1
- import { gt as Mutant } from "./Mutant-Ci25PsWA.mjs";
2
- import * as Context from "effect/Context";
3
- import * as S from "effect/Schema";
4
- import * as Effect from "effect/Effect";
5
- import * as HashMap from "effect/HashMap";
6
- //#region src/Checker.schema.d.ts
7
- declare const CheckStatus: S.Literals<readonly ["passed", "compileError"]>;
8
- type CheckStatus = typeof CheckStatus.Type;
9
- declare const CheckResultSchema: S.Union<readonly [S.Struct<{
10
- readonly status: S.Literal<"passed">;
11
- }>, S.Struct<{
12
- readonly status: S.Literal<"compileError">;
13
- readonly reason: S.String;
14
- }>]>;
15
- declare const CheckerFailed_base: S.Class<CheckerFailed, S.TaggedStruct<"CheckerFailed", {
16
- readonly cause: S.String;
17
- readonly checkerName: S.String;
18
- readonly mutantIds: S.$Array<S.String>;
19
- }>, import("effect/Cause").YieldableError>;
20
- declare class CheckerFailed extends CheckerFailed_base {}
21
- declare namespace Checker_d_exports {
22
- export { CheckResult, CheckResultSchema, CheckStatus, Checker, CheckerFailed, CheckerService, FailedCheckResult, PassedCheckResult };
23
- }
24
- interface FailedCheckResult {
25
- readonly reason: string;
26
- readonly status: 'compileError';
27
- }
28
- interface PassedCheckResult {
29
- readonly status: 'passed';
30
- }
31
- type CheckResult = FailedCheckResult | PassedCheckResult;
32
- interface CheckerService {
33
- readonly init: Effect.Effect<void, CheckerFailed>;
34
- readonly check: (mutants: readonly Mutant[]) => Effect.Effect<HashMap.HashMap<string, CheckResult>, CheckerFailed>;
35
- readonly group: (mutants: readonly Mutant[]) => Effect.Effect<readonly (readonly string[])[], CheckerFailed>;
36
- }
37
- declare const Checker_base: Context.ServiceClass<Checker, "~@systemfsoftware/stryker-js/Checker", CheckerService>;
38
- declare class Checker extends Checker_base {}
39
- //#endregion
40
- export { FailedCheckResult as a, CheckStatus as c, Checker_d_exports as i, CheckerFailed as l, Checker as n, PassedCheckResult as o, CheckerService as r, CheckResultSchema as s, CheckResult as t };
@@ -1,25 +0,0 @@
1
- import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
- import * as Context from "effect/Context";
3
- import * as S from "effect/Schema";
4
- //#region src/Checker.schema.ts
5
- const CheckStatus = S.Literals(["passed", "compileError"]);
6
- const CheckResultSchema = S.Union([S.Struct({ status: S.Literal("passed") }), S.Struct({
7
- status: S.Literal("compileError"),
8
- reason: S.String
9
- })]);
10
- var CheckerFailed = class extends S.TaggedError()("CheckerFailed", {
11
- cause: S.String,
12
- checkerName: S.String,
13
- mutantIds: S.Array(S.String)
14
- }) {};
15
- //#endregion
16
- //#region src/Checker.ts
17
- var Checker_exports = /* @__PURE__ */ __exportAll({
18
- CheckResultSchema: () => CheckResultSchema,
19
- CheckStatus: () => CheckStatus,
20
- Checker: () => Checker,
21
- CheckerFailed: () => CheckerFailed
22
- });
23
- var Checker = class extends Context.Service()("~@systemfsoftware/stryker-js/Checker") {};
24
- //#endregion
25
- export { CheckerFailed as a, CheckStatus as i, Checker_exports as n, CheckResultSchema as r, Checker as t };
@@ -1,2 +0,0 @@
1
- import { a as FailedCheckResult, c as CheckStatus, l as CheckerFailed, n as Checker, o as PassedCheckResult, r as CheckerService, s as CheckResultSchema, t as CheckResult } from "./Checker-A8o5B3Ub.mjs";
2
- export { CheckResult, CheckResultSchema, CheckStatus, Checker, CheckerFailed, CheckerService, FailedCheckResult, PassedCheckResult };
package/dist/Checker.mjs DELETED
@@ -1,2 +0,0 @@
1
- import { a as CheckerFailed, i as CheckStatus, r as CheckResultSchema, t as Checker } from "./Checker-Bq8NXD8d.mjs";
2
- export { CheckResultSchema, CheckStatus, Checker, CheckerFailed };
@@ -1,19 +0,0 @@
1
- import { _ as MutationTestResult } from "./Report.schema-_buHXdnZ.mjs";
2
- import { r as ExitClass } from "./ExitClass.schema-BmOIK5zT.mjs";
3
- import * as Context from "effect/Context";
4
- import * as S from "effect/Schema";
5
- import * as Effect from "effect/Effect";
6
- //#region src/Evaluator.schema.d.ts
7
- declare const EvaluatorFailed_base: S.Class<EvaluatorFailed, S.TaggedStruct<"EvaluatorFailed", {
8
- readonly cause: S.Unknown;
9
- }>, import("effect/Cause").YieldableError>;
10
- declare class EvaluatorFailed extends EvaluatorFailed_base {}
11
- //#endregion
12
- //#region src/Evaluator.d.ts
13
- interface EvaluatorService {
14
- readonly evaluate: (report: MutationTestResult) => Effect.Effect<ExitClass | null, EvaluatorFailed>;
15
- }
16
- declare const Evaluator_base: Context.ServiceClass<Evaluator, "~@systemfsoftware/stryker-js/Evaluator", EvaluatorService>;
17
- declare class Evaluator extends Evaluator_base {}
18
- //#endregion
19
- export { EvaluatorService as n, EvaluatorFailed as r, Evaluator as t };
@@ -1,3 +0,0 @@
1
- import { n as EvaluatorService, r as EvaluatorFailed, t as Evaluator } from "./Evaluator-CnAN8-pZ.mjs";
2
- import { r as ExitClass } from "./ExitClass.schema-BmOIK5zT.mjs";
3
- export { Evaluator, EvaluatorFailed, EvaluatorService, type ExitClass };
@@ -1,9 +0,0 @@
1
- import * as Context from "effect/Context";
2
- import * as S from "effect/Schema";
3
- //#region src/Evaluator.schema.ts
4
- var EvaluatorFailed = class extends S.TaggedError()("EvaluatorFailed", { cause: S.Unknown }) {};
5
- //#endregion
6
- //#region src/Evaluator.ts
7
- var Evaluator = class extends Context.Service()("~@systemfsoftware/stryker-js/Evaluator") {};
8
- //#endregion
9
- export { Evaluator, EvaluatorFailed };
@@ -1,9 +0,0 @@
1
- import { n as ClassifyExitDecision, r as ExitClass, t as ClassifyExitCommand } from "./ExitClass.schema-BmOIK5zT.mjs";
2
- //#region src/ExitClass.d.ts
3
- declare const EXIT_CODE: Record<ExitClass, number>;
4
- declare function highestExitClass(pending: Iterable<ExitClass>): ExitClass | null;
5
- declare function resolveExitCode(pending: Iterable<ExitClass>, signal: number | null): number;
6
- declare function verdictExitClass(score: number | null, breakingThreshold: number | null): ExitClass | null;
7
- declare const classifyExit: (command: ClassifyExitCommand) => ClassifyExitDecision;
8
- //#endregion
9
- export { EXIT_CODE, ExitClass, classifyExit, highestExitClass, resolveExitCode, verdictExitClass };
@@ -1,59 +0,0 @@
1
- import * as S from "effect/Schema";
2
- import * as Match from "effect/Match";
3
- import * as Option from "effect/Option";
4
- //#region src/ExitClass.schema.ts
5
- const ExitClass = S.Literals([
6
- "VerdictFail",
7
- "ConfigError",
8
- "RuntimeError",
9
- "InternalError"
10
- ]);
11
- S.TaggedClass()("ClassifyExitCommand", {
12
- pending: S.Array(ExitClass),
13
- signal: S.NullOr(S.Number),
14
- score: S.NullOr(S.Number),
15
- breakingThreshold: S.NullOr(S.Number)
16
- });
17
- var ClassifyExitDecision = class extends S.TaggedClass()("ClassifyExitDecision", {
18
- highestClass: S.NullOr(ExitClass),
19
- verdictClass: S.NullOr(ExitClass)
20
- }) {};
21
- //#endregion
22
- //#region src/ExitClass.ts
23
- const EXIT_CODE = {
24
- VerdictFail: 1,
25
- ConfigError: 2,
26
- RuntimeError: 3,
27
- InternalError: 4
28
- };
29
- function highestExitClass(pending) {
30
- return Array.from(pending).reduce((incumbent, challenger) => Option.match(Option.fromNullishOr(incumbent), {
31
- onNone: () => challenger,
32
- onSome: (value) => Match.value(EXIT_CODE[value] < EXIT_CODE[challenger]).pipe(Match.when(true, () => challenger), Match.when(false, () => value), Match.exhaustive)
33
- }), null);
34
- }
35
- function resolveExitCode(pending, signal) {
36
- return Option.match(Option.fromNullishOr(signal), {
37
- onNone: () => Option.match(Option.fromNullishOr(highestExitClass(pending)), {
38
- onNone: () => 0,
39
- onSome: (exitClass) => EXIT_CODE[exitClass]
40
- }),
41
- onSome: (value) => 128 + value
42
- });
43
- }
44
- function verdictExitClass(score, breakingThreshold) {
45
- return Option.getOrNull(Option.zipWith(Option.fromNullishOr(score), Option.fromNullishOr(breakingThreshold), (value, threshold) => Match.value(value < threshold).pipe(Match.when(true, () => "VerdictFail"), Match.when(false, () => null), Match.exhaustive)));
46
- }
47
- const classifyExit = (command) => {
48
- const verdictClass = verdictExitClass(command.score, command.breakingThreshold);
49
- const highestClass = highestExitClass(Option.match(Option.fromNullishOr(verdictClass), {
50
- onNone: () => command.pending,
51
- onSome: (verdict) => Array.from(/* @__PURE__ */ new Set([...command.pending, verdict]))
52
- }));
53
- return ClassifyExitDecision.make({
54
- highestClass,
55
- verdictClass
56
- });
57
- };
58
- //#endregion
59
- export { EXIT_CODE, ExitClass, classifyExit, highestExitClass, resolveExitCode, verdictExitClass };
@@ -1,18 +0,0 @@
1
- import * as S from "effect/Schema";
2
- //#region src/ExitClass.schema.d.ts
3
- declare const ExitClass: S.Literals<readonly ["VerdictFail", "ConfigError", "RuntimeError", "InternalError"]>;
4
- type ExitClass = typeof ExitClass.Type;
5
- declare const ClassifyExitCommand_base: S.Class<ClassifyExitCommand, S.TaggedStruct<"ClassifyExitCommand", {
6
- readonly pending: S.$Array<S.Literals<readonly ["VerdictFail", "ConfigError", "RuntimeError", "InternalError"]>>;
7
- readonly signal: S.NullOr<S.Number>;
8
- readonly score: S.NullOr<S.Number>;
9
- readonly breakingThreshold: S.NullOr<S.Number>;
10
- }>, {}>;
11
- declare class ClassifyExitCommand extends ClassifyExitCommand_base {}
12
- declare const ClassifyExitDecision_base: S.Class<ClassifyExitDecision, S.TaggedStruct<"ClassifyExitDecision", {
13
- readonly highestClass: S.NullOr<S.Literals<readonly ["VerdictFail", "ConfigError", "RuntimeError", "InternalError"]>>;
14
- readonly verdictClass: S.NullOr<S.Literals<readonly ["VerdictFail", "ConfigError", "RuntimeError", "InternalError"]>>;
15
- }>, {}>;
16
- declare class ClassifyExitDecision extends ClassifyExitDecision_base {}
17
- //#endregion
18
- export { ClassifyExitDecision as n, ExitClass as r, ClassifyExitCommand as t };
@@ -1,21 +0,0 @@
1
- import * as Context from "effect/Context";
2
- import * as Option from "effect/Option";
3
- declare namespace Ignorer_d_exports {
4
- export { Ignorer, IgnorerService, NodePath };
5
- }
6
- interface NodePath {
7
- readonly node: unknown;
8
- readonly parentPath?: NodePath | null;
9
- isObjectExpression(): boolean;
10
- isCallExpression(): boolean;
11
- isClassProperty(): boolean;
12
- isClassPrivateProperty(): boolean;
13
- isClassAccessorProperty(): boolean;
14
- }
15
- interface IgnorerService {
16
- readonly shouldIgnore: (path: NodePath) => Option.Option<string>;
17
- }
18
- declare const Ignorer_base: Context.ServiceClass<Ignorer, "~@systemfsoftware/stryker-js/Ignorer", IgnorerService>;
19
- declare class Ignorer extends Ignorer_base {}
20
- //#endregion
21
- export { NodePath as i, IgnorerService as n, Ignorer_d_exports as r, Ignorer as t };
@@ -1,2 +0,0 @@
1
- import { i as NodePath, n as IgnorerService, t as Ignorer } from "./Ignorer-BUY68FZQ.mjs";
2
- export { Ignorer, IgnorerService, NodePath };
package/dist/Ignorer.mjs DELETED
@@ -1,7 +0,0 @@
1
- import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
- import * as Context from "effect/Context";
3
- //#region src/Ignorer.ts
4
- var Ignorer_exports = /* @__PURE__ */ __exportAll({ Ignorer: () => Ignorer });
5
- var Ignorer = class extends Context.Service()("~@systemfsoftware/stryker-js/Ignorer") {};
6
- //#endregion
7
- export { Ignorer, Ignorer_exports as t };
@@ -1,7 +0,0 @@
1
- import { a as FileResult, p as MutantResult } from "./Report.schema-_buHXdnZ.mjs";
2
- import { i as MetricsSchema, n as MetricsResult, r as MetricsResultSchema, t as Metrics } from "./Metrics.schema-BaVd6rXs.mjs";
3
- //#region src/Metrics.d.ts
4
- declare const countMutants: (mutants: readonly MutantResult[]) => Metrics;
5
- declare const calculateMetrics: (files: Readonly<Record<string, FileResult>>) => MetricsResult;
6
- //#endregion
7
- export { type Metrics, type MetricsResult, MetricsResultSchema, MetricsSchema, calculateMetrics, countMutants };
package/dist/Metrics.mjs DELETED
@@ -1,79 +0,0 @@
1
- import { n as MetricsSchema, t as MetricsResultSchema } from "./Metrics.schema-DZdoc46X.mjs";
2
- import * as Match from "effect/Match";
3
- import * as Option from "effect/Option";
4
- import * as Arr from "effect/Array";
5
- //#region src/Metrics.ts
6
- const countStatus = (mutants, status) => mutants.filter((mutant) => mutant.status === status).length;
7
- const percentage = (numerator, denominator) => numerator / denominator * 100;
8
- /** A percentage whose denominator is zero is not 0%; `emptyDenominator` says what it is instead. */
9
- const percentOr = (emptyDenominator, numerator, denominator) => Match.value(denominator).pipe(Match.when(0, () => emptyDenominator), Match.orElse(() => percentage(numerator, denominator)));
10
- const coveredFraction = (totalDetected, totalCovered, totalValid) => Match.value(totalValid).pipe(Match.when(0, () => NaN), Match.orElse(() => percentOr(0, totalDetected, totalCovered)));
11
- const countMutants = (mutants) => {
12
- const pending = countStatus(mutants, "Pending");
13
- const killed = countStatus(mutants, "Killed");
14
- const timeout = countStatus(mutants, "Timeout");
15
- const survived = countStatus(mutants, "Survived");
16
- const noCoverage = countStatus(mutants, "NoCoverage");
17
- const runtimeErrors = countStatus(mutants, "RuntimeError");
18
- const compileErrors = countStatus(mutants, "CompileError");
19
- const ignored = countStatus(mutants, "Ignored");
20
- const totalDetected = timeout + killed;
21
- const totalUndetected = survived + noCoverage;
22
- const totalCovered = totalDetected + survived;
23
- const totalValid = totalUndetected + totalDetected;
24
- const totalInvalid = runtimeErrors + compileErrors;
25
- return {
26
- pending,
27
- killed,
28
- timeout,
29
- survived,
30
- noCoverage,
31
- runtimeErrors,
32
- compileErrors,
33
- ignored,
34
- totalDetected,
35
- totalUndetected,
36
- totalCovered,
37
- totalValid,
38
- totalInvalid,
39
- totalMutants: totalValid + totalInvalid + ignored + pending,
40
- mutationScore: percentOr(NaN, totalDetected, totalValid),
41
- mutationScoreBasedOnCoveredCode: coveredFraction(totalDetected, totalCovered, totalValid)
42
- };
43
- };
44
- const segmentOf = (fileName) => {
45
- const separator = fileName.indexOf("/");
46
- if (separator === -1) return fileName;
47
- return fileName.slice(0, separator);
48
- };
49
- const groupBySegment = (files) => Object.entries(files).reduce((groups, [fileName, file]) => {
50
- const segment = segmentOf(fileName);
51
- const group = groups[segment] ?? {};
52
- group[fileName] = file;
53
- groups[segment] = group;
54
- return groups;
55
- }, {});
56
- const metricsOf = (files) => countMutants(Object.values(files).flatMap((file) => file.mutants));
57
- const fileResultOf = (fileName, file) => ({
58
- name: fileName,
59
- metrics: countMutants(file.mutants),
60
- childResults: []
61
- });
62
- const nestedGroupResult = (segment, entries) => {
63
- const nested = Object.fromEntries(entries.map(([fileName, file]) => [fileName.slice(segment.length + 1), file]));
64
- return {
65
- name: segment,
66
- metrics: metricsOf(nested),
67
- childResults: childResultsOf(nested)
68
- };
69
- };
70
- const soleSegmentFileResult = (segment, entries) => Option.flatMap(Arr.head(entries), ([fileName, file]) => Match.value(fileName === segment && entries.length === 1).pipe(Match.when(true, () => Option.some(fileResultOf(fileName, file))), Match.orElse(() => Option.none())));
71
- const childResultOf = (segment, entries) => Option.getOrElse(soleSegmentFileResult(segment, entries), () => nestedGroupResult(segment, entries));
72
- const childResultsOf = (files) => Object.entries(groupBySegment(files)).map(([segment, grouped]) => childResultOf(segment, Object.entries(grouped))).sort((left, right) => left.name.localeCompare(right.name));
73
- const calculateMetrics = (files) => ({
74
- name: "All files",
75
- metrics: metricsOf(files),
76
- childResults: childResultsOf(files)
77
- });
78
- //#endregion
79
- export { MetricsResultSchema, MetricsSchema, calculateMetrics, countMutants };
@@ -1,50 +0,0 @@
1
- import * as S from "effect/Schema";
2
- //#region src/Metrics.schema.d.ts
3
- declare const MetricsSchema: S.Struct<{
4
- readonly pending: S.Finite;
5
- readonly killed: S.Finite;
6
- readonly timeout: S.Finite;
7
- readonly survived: S.Finite;
8
- readonly noCoverage: S.Finite;
9
- readonly runtimeErrors: S.Finite;
10
- readonly compileErrors: S.Finite;
11
- readonly ignored: S.Finite;
12
- readonly totalDetected: S.Finite;
13
- readonly totalUndetected: S.Finite;
14
- readonly totalInvalid: S.Finite;
15
- readonly totalValid: S.Finite;
16
- readonly totalMutants: S.Finite;
17
- readonly totalCovered: S.Finite;
18
- readonly mutationScore: S.Finite;
19
- readonly mutationScoreBasedOnCoveredCode: S.Finite;
20
- }>;
21
- type Metrics = typeof MetricsSchema.Type;
22
- interface MetricsResult {
23
- readonly name: string;
24
- readonly metrics: Metrics;
25
- readonly childResults: readonly MetricsResult[];
26
- }
27
- declare const MetricsResultSchema: S.Struct<{
28
- readonly name: S.String;
29
- readonly metrics: S.Struct<{
30
- readonly pending: S.Finite;
31
- readonly killed: S.Finite;
32
- readonly timeout: S.Finite;
33
- readonly survived: S.Finite;
34
- readonly noCoverage: S.Finite;
35
- readonly runtimeErrors: S.Finite;
36
- readonly compileErrors: S.Finite;
37
- readonly ignored: S.Finite;
38
- readonly totalDetected: S.Finite;
39
- readonly totalUndetected: S.Finite;
40
- readonly totalInvalid: S.Finite;
41
- readonly totalValid: S.Finite;
42
- readonly totalMutants: S.Finite;
43
- readonly totalCovered: S.Finite;
44
- readonly mutationScore: S.Finite;
45
- readonly mutationScoreBasedOnCoveredCode: S.Finite;
46
- }>;
47
- readonly childResults: S.$Array<S.suspend<S.Codec<MetricsResult, MetricsResult, never, never>>>;
48
- }>;
49
- //#endregion
50
- export { MetricsSchema as i, MetricsResult as n, MetricsResultSchema as r, Metrics as t };
@@ -1,27 +0,0 @@
1
- import * as S from "effect/Schema";
2
- //#region src/Metrics.schema.ts
3
- const MetricsSchema = S.Struct({
4
- pending: S.Finite,
5
- killed: S.Finite,
6
- timeout: S.Finite,
7
- survived: S.Finite,
8
- noCoverage: S.Finite,
9
- runtimeErrors: S.Finite,
10
- compileErrors: S.Finite,
11
- ignored: S.Finite,
12
- totalDetected: S.Finite,
13
- totalUndetected: S.Finite,
14
- totalInvalid: S.Finite,
15
- totalValid: S.Finite,
16
- totalMutants: S.Finite,
17
- totalCovered: S.Finite,
18
- mutationScore: S.Finite,
19
- mutationScoreBasedOnCoveredCode: S.Finite
20
- });
21
- const MetricsResultSchema = S.Struct({
22
- name: S.String,
23
- metrics: MetricsSchema,
24
- childResults: S.Array(S.suspend(() => MetricsResultSchema))
25
- }).annotate({ identifier: "MetricsResult" });
26
- //#endregion
27
- export { MetricsSchema as n, MetricsResultSchema as t };
@@ -1,31 +0,0 @@
1
- import * as Context from "effect/Context";
2
- //#region src/Module.d.ts
3
- /**
4
- * The subset of `node:module`'s `createRequire` result this port certifies: a
5
- * require function bound to one path, plus its resolution. Calling it loads
6
- * the specifier exactly as a module evaluated next to that path would.
7
- */
8
- interface ModuleRequire {
9
- (request: string): unknown;
10
- resolve(request: string, options?: {
11
- readonly paths?: readonly string[];
12
- }): string;
13
- }
14
- declare const Module_base: Context.ServiceClass<Module, "@systemfsoftware/stryker-js/Module", {
15
- readonly createRequire: (filename: string | URL) => ModuleRequire;
16
- readonly isBuiltin: (moduleName: string) => boolean;
17
- }>;
18
- /**
19
- * Port over the host module loader, shaped as the subset of `node:module`
20
- * feature code may use: `createRequire` and `isBuiltin`. Resolving a
21
- * specifier against a project directory, importing a plugin, and asking
22
- * whether a name is a builtin all go through this one tag; no feature module
23
- * touches the host module API. The Node implementation ships in the
24
- * composition-root package (`@systemfsoftware/stryker-js-cli`); tests that do
25
- * not need real plugin resolution substitute a layer returning fixed paths.
26
- *
27
- * @since 2.0.0
28
- */
29
- declare class Module extends Module_base {}
30
- //#endregion
31
- export { ModuleRequire as n, Module as t };
package/dist/Module.d.mts DELETED
@@ -1,2 +0,0 @@
1
- import { n as ModuleRequire, t as Module } from "./Module-DHKEMAFI.mjs";
2
- export { Module, ModuleRequire };
package/dist/Module.mjs DELETED
@@ -1,16 +0,0 @@
1
- import * as Context from "effect/Context";
2
- //#region src/Module.ts
3
- /**
4
- * Port over the host module loader, shaped as the subset of `node:module`
5
- * feature code may use: `createRequire` and `isBuiltin`. Resolving a
6
- * specifier against a project directory, importing a plugin, and asking
7
- * whether a name is a builtin all go through this one tag; no feature module
8
- * touches the host module API. The Node implementation ships in the
9
- * composition-root package (`@systemfsoftware/stryker-js-cli`); tests that do
10
- * not need real plugin resolution substitute a layer returning fixed paths.
11
- *
12
- * @since 2.0.0
13
- */
14
- var Module = class extends Context.Service()("@systemfsoftware/stryker-js/Module") {};
15
- //#endregion
16
- export { Module };