@systemfsoftware/stryker-js 1.0.0 → 3.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 (44) hide show
  1. package/CHANGELOG.md +164 -0
  2. package/README.md +1 -1
  3. package/dist/{Checker-DYgIIEai.d.mts → Checker-A8o5B3Ub.d.mts} +1 -1
  4. package/dist/Checker.d.mts +1 -1
  5. package/dist/{Evaluator-RZBS4oeh.d.mts → Evaluator-CnAN8-pZ.d.mts} +2 -2
  6. package/dist/Evaluator.d.mts +1 -1
  7. package/dist/ExitClass.d.mts +1 -1
  8. package/dist/ExitClass.mjs +20 -31
  9. package/dist/Metrics.d.mts +7 -0
  10. package/dist/Metrics.mjs +79 -0
  11. package/dist/Metrics.schema-BaVd6rXs.d.mts +50 -0
  12. package/dist/Metrics.schema-DZdoc46X.mjs +27 -0
  13. package/dist/{Mutant-BPRJTF8f.d.mts → Mutant-Ci25PsWA.d.mts} +6 -6
  14. package/dist/Mutant.d.mts +3 -2
  15. package/dist/Mutant.mjs +54 -78
  16. package/dist/{Mutant.schema-BTWhFTk4.mjs → Mutant.schema-H3r0ho_R.mjs} +3 -3
  17. package/dist/{Plugin-DcDAIBQi.d.mts → Plugin-CunIOPtw.d.mts} +31 -13
  18. package/dist/Plugin-DXFdJP1l.mjs +105 -0
  19. package/dist/Plugin.d.mts +2 -2
  20. package/dist/Plugin.mjs +2 -2
  21. package/dist/Report.d.mts +2 -0
  22. package/dist/Report.mjs +98 -0
  23. package/dist/Report.schema-_buHXdnZ.d.mts +251 -0
  24. package/dist/Reporter-BU7qo6MR.d.mts +16 -0
  25. package/dist/Reporter-BWTwlSJf.mjs +25 -0
  26. package/dist/Reporter.d.mts +4 -2
  27. package/dist/Reporter.mjs +3 -2
  28. package/dist/ReporterEvent.d.mts +2 -0
  29. package/dist/ReporterEvent.mjs +58 -0
  30. package/dist/ReporterEvent.schema-Db6r_euv.d.mts +190 -0
  31. package/dist/{Run-BnmGGgWj.d.mts → Run-CnhaYlAC.d.mts} +6 -12
  32. package/dist/Run.d.mts +2 -2
  33. package/dist/Run.mjs +56 -2
  34. package/dist/{Run-BcDo-hIC.mjs → Run.schema-C4m-b9Ki.mjs} +2 -62
  35. package/dist/TestRunner.d.mts +1 -1
  36. package/dist/TestRunner.mjs +57 -2
  37. package/dist/{TestRunner-DC9U8Unb.mjs → TestRunner.schema-Dy0Wdro2.mjs} +2 -64
  38. package/dist/index.d.mts +5 -5
  39. package/dist/index.mjs +4 -4
  40. package/dist/provided-options.d.mts +1 -1
  41. package/package.json +13 -10
  42. package/dist/Plugin-Ceh1G8Dz.mjs +0 -117
  43. package/dist/Reporter-COVWW1my.mjs +0 -33
  44. package/dist/Reporter-eZ3M7lO6.d.mts +0 -83
package/dist/Run.mjs CHANGED
@@ -1,2 +1,56 @@
1
- import { _ as RunFailed, a as runMutationTest, b as VerdictReached, c as HelpRendered, d as MutantStatus, f as MutantTested, g as RunEvent, h as PlanKnown, i as planMutationRun, l as ManifestRendered, m as PhaseEntered, n as RunIdentity, o as shouldKeepTempDir, p as OutputMode, s as Heartbeat, t as RunEvents, u as ModeSignal, v as RunPhase, y as RunStarted } from "./Run-BcDo-hIC.mjs";
2
- export { Heartbeat, HelpRendered, ManifestRendered, ModeSignal, MutantStatus, MutantTested, OutputMode, PhaseEntered, PlanKnown, RunEvent, RunEvents, RunFailed, RunIdentity, RunPhase, RunStarted, VerdictReached, planMutationRun, runMutationTest, shouldKeepTempDir };
1
+ import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
+ import { a as MutantTested, c as PhaseEntered, d as RunEvent, f as RunFailed, g as VerdictReached, h as RunStarted, i as MutantStatus, l as PlanKnown, m as RunPhase, n as HelpRendered, o as MutationRunPlan, p as RunOutput, r as ModeSignal, s as OutputMode, t as Heartbeat, u as PlanMutationRunCommand } from "./Run.schema-C4m-b9Ki.mjs";
3
+ import * as Context from "effect/Context";
4
+ import * as S from "effect/Schema";
5
+ import * as Effect from "effect/Effect";
6
+ import * as Exit from "effect/Exit";
7
+ import * as Result from "effect/Result";
8
+ //#region src/Run.ts
9
+ var Run_exports = /* @__PURE__ */ __exportAll({
10
+ Heartbeat: () => Heartbeat,
11
+ HelpRendered: () => HelpRendered,
12
+ ModeSignal: () => ModeSignal,
13
+ MutantStatus: () => MutantStatus,
14
+ MutantTested: () => MutantTested,
15
+ OutputMode: () => OutputMode,
16
+ PhaseEntered: () => PhaseEntered,
17
+ PlanKnown: () => PlanKnown,
18
+ RunEvent: () => RunEvent,
19
+ RunEvents: () => RunEvents,
20
+ RunFailed: () => RunFailed,
21
+ RunIdentity: () => RunIdentity,
22
+ RunPhase: () => RunPhase,
23
+ RunStarted: () => RunStarted,
24
+ VerdictReached: () => VerdictReached,
25
+ planMutationRun: () => planMutationRun,
26
+ runMutationTest: () => runMutationTest,
27
+ shouldKeepTempDir: () => shouldKeepTempDir
28
+ });
29
+ const firstNonEmpty = (preferred, fallback) => {
30
+ if (preferred.length > 0) return [...preferred];
31
+ return [...fallback];
32
+ };
33
+ const planMutationRun = (command) => MutationRunPlan.make({
34
+ mutatePatterns: firstNonEmpty(command.targetMutatePatterns, command.configMutatePatterns),
35
+ mutatorNames: firstNonEmpty(command.availableMutators, command.configMutatorNames)
36
+ });
37
+ var RunEvents = class extends Context.Service()("~@systemfsoftware/stryker-js/RunEvents") {};
38
+ var RunIdentity = class extends Context.Service()("~@systemfsoftware/stryker-js/RunIdentity") {};
39
+ const runMutationTest = (io, command) => Effect.gen(function* () {
40
+ const raw = yield* io.read(command);
41
+ const planCommand = yield* Result.match(S.decodeUnknownResult(PlanMutationRunCommand)(raw), {
42
+ onFailure: (error) => Effect.fail(error),
43
+ onSuccess: (decoded) => Effect.succeed(decoded)
44
+ });
45
+ const plan = planMutationRun(planCommand);
46
+ return yield* io.write(new RunOutput({
47
+ verdictJson: JSON.stringify({
48
+ mutate: plan.mutatePatterns,
49
+ mutatorNames: plan.mutatorNames
50
+ }),
51
+ exitCode: 0
52
+ }));
53
+ });
54
+ const shouldKeepTempDir = (exit, cleanTempDir) => Exit.isFailure(exit) && cleanTempDir !== "always";
55
+ //#endregion
56
+ export { Heartbeat, HelpRendered, ModeSignal, MutantStatus, MutantTested, OutputMode, PhaseEntered, PlanKnown, RunEvent, RunEvents, RunFailed, RunIdentity, RunPhase, RunStarted, VerdictReached, planMutationRun, runMutationTest, shouldKeepTempDir, Run_exports as t };
@@ -1,9 +1,4 @@
1
- import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
- import * as Context from "effect/Context";
3
1
  import * as S from "effect/Schema";
4
- import * as Effect from "effect/Effect";
5
- import * as Exit from "effect/Exit";
6
- import * as Result from "effect/Result";
7
2
  import { Wire } from "@systemfsoftware/effect-cell-types";
8
3
  //#region src/Run.schema.ts
9
4
  const RunPhase = S.Literals([
@@ -109,11 +104,6 @@ var HelpRendered = class extends S.TaggedClass()("help", {
109
104
  code: Wire.mint(S.Literals([0])),
110
105
  help: Wire.mint(S.String)
111
106
  }) {};
112
- var ManifestRendered = class extends S.TaggedClass()("manifest", {
113
- schemaVersion: Wire.mint(S.String),
114
- code: Wire.mint(S.Literals([0])),
115
- manifest: Wire.mint(S.String)
116
- }) {};
117
107
  const RunEvent = S.Union([
118
108
  RunStarted,
119
109
  PhaseEntered,
@@ -122,8 +112,7 @@ const RunEvent = S.Union([
122
112
  Heartbeat,
123
113
  VerdictReached,
124
114
  RunFailed,
125
- HelpRendered,
126
- ManifestRendered
115
+ HelpRendered
127
116
  ]);
128
117
  S.TaggedClass()("RunCommand", {
129
118
  cliOptionsJson: S.String,
@@ -147,53 +136,4 @@ var MutationRunPlan = class extends S.TaggedClass()("MutationRunPlan", {
147
136
  mutatorNames: Wire.mint(S.Array(Wire.mint(S.String)))
148
137
  }) {};
149
138
  //#endregion
150
- //#region src/Run.ts
151
- var Run_exports = /* @__PURE__ */ __exportAll({
152
- Heartbeat: () => Heartbeat,
153
- HelpRendered: () => HelpRendered,
154
- ManifestRendered: () => ManifestRendered,
155
- ModeSignal: () => ModeSignal,
156
- MutantStatus: () => MutantStatus,
157
- MutantTested: () => MutantTested,
158
- OutputMode: () => OutputMode,
159
- PhaseEntered: () => PhaseEntered,
160
- PlanKnown: () => PlanKnown,
161
- RunEvent: () => RunEvent,
162
- RunEvents: () => RunEvents,
163
- RunFailed: () => RunFailed,
164
- RunIdentity: () => RunIdentity,
165
- RunPhase: () => RunPhase,
166
- RunStarted: () => RunStarted,
167
- VerdictReached: () => VerdictReached,
168
- planMutationRun: () => planMutationRun,
169
- runMutationTest: () => runMutationTest,
170
- shouldKeepTempDir: () => shouldKeepTempDir
171
- });
172
- const firstNonEmpty = (preferred, fallback) => {
173
- if (preferred.length > 0) return [...preferred];
174
- return [...fallback];
175
- };
176
- const planMutationRun = (command) => MutationRunPlan.make({
177
- mutatePatterns: firstNonEmpty(command.targetMutatePatterns, command.configMutatePatterns),
178
- mutatorNames: firstNonEmpty(command.availableMutators, command.configMutatorNames)
179
- });
180
- var RunEvents = class extends Context.Service()("~@systemfsoftware/stryker-js/RunEvents") {};
181
- var RunIdentity = class extends Context.Service()("~@systemfsoftware/stryker-js/RunIdentity") {};
182
- const runMutationTest = (io, command) => Effect.gen(function* () {
183
- const raw = yield* io.read(command);
184
- const planCommand = yield* Result.match(S.decodeUnknownResult(PlanMutationRunCommand)(raw), {
185
- onFailure: (error) => Effect.fail(error),
186
- onSuccess: (decoded) => Effect.succeed(decoded)
187
- });
188
- const plan = planMutationRun(planCommand);
189
- return yield* io.write(new RunOutput({
190
- verdictJson: JSON.stringify({
191
- mutate: plan.mutatePatterns,
192
- mutatorNames: plan.mutatorNames
193
- }),
194
- exitCode: 0
195
- }));
196
- });
197
- const shouldKeepTempDir = (exit, cleanTempDir) => Exit.isFailure(exit) && cleanTempDir !== "always";
198
- //#endregion
199
- export { RunFailed as _, runMutationTest as a, VerdictReached as b, HelpRendered as c, MutantStatus as d, MutantTested as f, RunEvent as g, PlanKnown as h, planMutationRun as i, ManifestRendered as l, PhaseEntered as m, RunIdentity as n, shouldKeepTempDir as o, OutputMode as p, Run_exports as r, Heartbeat as s, RunEvents as t, ModeSignal as u, RunPhase as v, RunStarted as y };
139
+ export { MutantTested as a, PhaseEntered as c, RunEvent as d, RunFailed as f, VerdictReached as g, RunStarted as h, MutantStatus as i, PlanKnown as l, RunPhase as m, HelpRendered as n, MutationRunPlan as o, RunOutput as p, ModeSignal as r, OutputMode as s, Heartbeat as t, PlanMutationRunCommand as u };
@@ -1,2 +1,2 @@
1
- import { $ as TimeoutMutantRunResult, A as CompleteDryRunResult, B as MutantRunOptions, F as ErrorMutantRunResult, G as SuccessTestResult, H as Position, I as FailedTestResult, J as TestRunner, K as SurvivedMutantRunResult, L as KilledMutantRunResult, M as DryRunOptions, N as DryRunResult, P as ErrorDryRunResult, Q as TimeoutDryRunResult, R as MutantActivation, U as RunOptions, V as MutantRunResult, W as SkippedTestResult, X as TestRunnerService, Y as TestRunnerCapabilities, at as DryRunStatus, ct as MutantRunOptionsSchema, dt as TestResultSchema, et as testFilesProvided, ft as TestRunnerCapabilitiesSchema, it as DryRunResultSchema, j as CoverageAnalysis, k as BaseTestResult, lt as MutantRunResultSchema, mt as TestStatus, nt as CoverageAnalysisSchema, ot as MutantActivationSchema, pt as TestRunnerFailed, q as TestResult, rt as DryRunOptionsSchema, st as MutantCoverageSchema, tt as toMutantRunResult, ut as MutantRunStatus, z as MutantCoverage } from "./Mutant-BPRJTF8f.mjs";
1
+ import { $ as testFilesProvided, A as CoverageAnalysis, B as MutantRunResult, F as FailedTestResult, G as SurvivedMutantRunResult, H as RunOptions, I as KilledMutantRunResult, J as TestRunnerCapabilities, K as TestResult, L as MutantActivation, M as DryRunResult, N as ErrorDryRunResult, O as BaseTestResult, P as ErrorMutantRunResult, Q as TimeoutMutantRunResult, R as MutantCoverage, U as SkippedTestResult, V as Position, W as SuccessTestResult, Y as TestRunnerService, Z as TimeoutDryRunResult, at as MutantActivationSchema, ct as MutantRunResultSchema, dt as TestRunnerCapabilitiesSchema, et as toMutantRunResult, ft as TestRunnerFailed, it as DryRunStatus, j as DryRunOptions, k as CompleteDryRunResult, lt as MutantRunStatus, nt as DryRunOptionsSchema, ot as MutantCoverageSchema, pt as TestStatus, q as TestRunner, rt as DryRunResultSchema, st as MutantRunOptionsSchema, tt as CoverageAnalysisSchema, ut as TestResultSchema, z as MutantRunOptions } from "./Mutant-Ci25PsWA.mjs";
2
2
  export { BaseTestResult, CompleteDryRunResult, CoverageAnalysis, CoverageAnalysisSchema, DryRunOptions, DryRunOptionsSchema, DryRunResult, DryRunResultSchema, DryRunStatus, ErrorDryRunResult, ErrorMutantRunResult, FailedTestResult, KilledMutantRunResult, MutantActivation, MutantActivationSchema, MutantCoverage, MutantCoverageSchema, MutantRunOptions, MutantRunOptionsSchema, MutantRunResult, MutantRunResultSchema, MutantRunStatus, Position, RunOptions, SkippedTestResult, SuccessTestResult, SurvivedMutantRunResult, TestResult, TestResultSchema, TestRunner, TestRunnerCapabilities, TestRunnerCapabilitiesSchema, TestRunnerFailed, TestRunnerService, TestStatus, TimeoutDryRunResult, TimeoutMutantRunResult, testFilesProvided, toMutantRunResult };
@@ -1,2 +1,57 @@
1
- import { _ as TestStatus, a as CoverageAnalysisSchema, c as DryRunStatus, d as MutantRunOptionsSchema, f as MutantRunResultSchema, g as TestRunnerFailed, h as TestRunnerCapabilitiesSchema, i as toMutantRunResult, l as MutantActivationSchema, m as TestResultSchema, o as DryRunOptionsSchema, p as MutantRunStatus, r as testFilesProvided, s as DryRunResultSchema, t as TestRunner, u as MutantCoverageSchema } from "./TestRunner-DC9U8Unb.mjs";
2
- export { CoverageAnalysisSchema, DryRunOptionsSchema, DryRunResultSchema, DryRunStatus, MutantActivationSchema, MutantCoverageSchema, MutantRunOptionsSchema, MutantRunResultSchema, MutantRunStatus, TestResultSchema, TestRunner, TestRunnerCapabilitiesSchema, TestRunnerFailed, TestStatus, testFilesProvided, toMutantRunResult };
1
+ import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
+ import { a as MutantActivationSchema, c as MutantRunResultSchema, d as TestRunnerCapabilitiesSchema, f as TestRunnerFailed, i as DryRunStatus, l as MutantRunStatus, n as DryRunOptionsSchema, o as MutantCoverageSchema, p as TestStatus, r as DryRunResultSchema, s as MutantRunOptionsSchema, t as CoverageAnalysisSchema, u as TestResultSchema } from "./TestRunner.schema-Dy0Wdro2.mjs";
3
+ import * as Context from "effect/Context";
4
+ import * as Match from "effect/Match";
5
+ import * as Option from "effect/Option";
6
+ //#region src/TestRunner.ts
7
+ var TestRunner_exports = /* @__PURE__ */ __exportAll({
8
+ CoverageAnalysisSchema: () => CoverageAnalysisSchema,
9
+ DryRunOptionsSchema: () => DryRunOptionsSchema,
10
+ DryRunResultSchema: () => DryRunResultSchema,
11
+ DryRunStatus: () => DryRunStatus,
12
+ MutantActivationSchema: () => MutantActivationSchema,
13
+ MutantCoverageSchema: () => MutantCoverageSchema,
14
+ MutantRunOptionsSchema: () => MutantRunOptionsSchema,
15
+ MutantRunResultSchema: () => MutantRunResultSchema,
16
+ MutantRunStatus: () => MutantRunStatus,
17
+ TestResultSchema: () => TestResultSchema,
18
+ TestRunner: () => TestRunner,
19
+ TestRunnerCapabilitiesSchema: () => TestRunnerCapabilitiesSchema,
20
+ TestRunnerFailed: () => TestRunnerFailed,
21
+ TestStatus: () => TestStatus,
22
+ testFilesProvided: () => testFilesProvided,
23
+ toMutantRunResult: () => toMutantRunResult
24
+ });
25
+ function toMutantRunResult(dryRunResult, reportAllKillers) {
26
+ return Match.value(dryRunResult).pipe(Match.discriminator("status")("complete", (complete) => {
27
+ const failed = complete.tests.filter((t) => t.status === "failed");
28
+ const nrOfTests = complete.tests.filter((t) => t.status !== "skipped").length;
29
+ return Option.match(Option.fromUndefinedOr(failed.at(0)), {
30
+ onNone: () => ({
31
+ nrOfTests,
32
+ status: "survived"
33
+ }),
34
+ onSome: (firstFailed) => ({
35
+ failureMessage: firstFailed.failureMessage,
36
+ killedBy: Match.value(reportAllKillers).pipe(Match.when(true, () => failed.map((t) => t.id)), Match.when(false, () => [firstFailed.id]), Match.exhaustive),
37
+ nrOfTests,
38
+ status: "killed"
39
+ })
40
+ });
41
+ }), Match.discriminator("status")("error", (errored) => ({
42
+ errorMessage: errored.errorMessage,
43
+ status: "error"
44
+ })), Match.discriminator("status")("timeout", (timedOut) => Option.match(Option.fromUndefinedOr(timedOut.reason), {
45
+ onNone: () => ({ status: "timeout" }),
46
+ onSome: (reason) => ({
47
+ reason,
48
+ status: "timeout"
49
+ })
50
+ })), Match.exhaustive);
51
+ }
52
+ var TestRunner = class extends Context.Service()("~@systemfsoftware/stryker-js/TestRunner") {};
53
+ function testFilesProvided(options) {
54
+ return options.testFiles !== void 0 && options.testFiles.length > 0;
55
+ }
56
+ //#endregion
57
+ export { CoverageAnalysisSchema, DryRunOptionsSchema, DryRunResultSchema, DryRunStatus, MutantActivationSchema, MutantCoverageSchema, MutantRunOptionsSchema, MutantRunResultSchema, MutantRunStatus, TestResultSchema, TestRunner, TestRunnerCapabilitiesSchema, TestRunnerFailed, TestStatus, TestRunner_exports as t, testFilesProvided, toMutantRunResult };
@@ -1,6 +1,4 @@
1
- import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
- import { n as Mutant, r as PositionSchema } from "./Mutant.schema-BTWhFTk4.mjs";
3
- import * as Context from "effect/Context";
1
+ import { n as Mutant, r as PositionSchema } from "./Mutant.schema-H3r0ho_R.mjs";
4
2
  import * as S from "effect/Schema";
5
3
  //#region src/TestRunner.schema.ts
6
4
  const DryRunStatus = S.Literals([
@@ -118,64 +116,4 @@ var TestRunnerFailed = class extends S.TaggedError()("TestRunnerFailed", {
118
116
  runnerName: S.String
119
117
  }) {};
120
118
  //#endregion
121
- //#region src/TestRunner.ts
122
- var TestRunner_exports = /* @__PURE__ */ __exportAll({
123
- CoverageAnalysisSchema: () => CoverageAnalysisSchema,
124
- DryRunOptionsSchema: () => DryRunOptionsSchema,
125
- DryRunResultSchema: () => DryRunResultSchema,
126
- DryRunStatus: () => DryRunStatus,
127
- MutantActivationSchema: () => MutantActivationSchema,
128
- MutantCoverageSchema: () => MutantCoverageSchema,
129
- MutantRunOptionsSchema: () => MutantRunOptionsSchema,
130
- MutantRunResultSchema: () => MutantRunResultSchema,
131
- MutantRunStatus: () => MutantRunStatus,
132
- TestResultSchema: () => TestResultSchema,
133
- TestRunner: () => TestRunner,
134
- TestRunnerCapabilitiesSchema: () => TestRunnerCapabilitiesSchema,
135
- TestRunnerFailed: () => TestRunnerFailed,
136
- TestStatus: () => TestStatus,
137
- testFilesProvided: () => testFilesProvided,
138
- toMutantRunResult: () => toMutantRunResult
139
- });
140
- function toMutantRunResult(dryRunResult, reportAllKillers) {
141
- switch (dryRunResult.status) {
142
- case "timeout":
143
- if (dryRunResult.reason === void 0) return { status: "timeout" };
144
- return {
145
- reason: dryRunResult.reason,
146
- status: "timeout"
147
- };
148
- case "error": return {
149
- errorMessage: dryRunResult.errorMessage,
150
- status: "error"
151
- };
152
- case "complete": {
153
- const failed = dryRunResult.tests.filter((t) => t.status === "failed");
154
- const nrOfTests = dryRunResult.tests.filter((t) => t.status !== "skipped").length;
155
- if (failed.length === 0) return {
156
- nrOfTests,
157
- status: "survived"
158
- };
159
- const firstFailed = failed.at(0);
160
- if (firstFailed === void 0) return {
161
- nrOfTests,
162
- status: "survived"
163
- };
164
- let killedBy;
165
- if (reportAllKillers) killedBy = failed.map((t) => t.id);
166
- else killedBy = [firstFailed.id];
167
- return {
168
- failureMessage: firstFailed.failureMessage,
169
- killedBy,
170
- nrOfTests,
171
- status: "killed"
172
- };
173
- }
174
- }
175
- }
176
- var TestRunner = class extends Context.Service()("~@systemfsoftware/stryker-js/TestRunner") {};
177
- function testFilesProvided(options) {
178
- return options.testFiles !== void 0 && options.testFiles.length > 0;
179
- }
180
- //#endregion
181
- export { TestStatus as _, CoverageAnalysisSchema as a, DryRunStatus as c, MutantRunOptionsSchema as d, MutantRunResultSchema as f, TestRunnerFailed as g, TestRunnerCapabilitiesSchema as h, toMutantRunResult as i, MutantActivationSchema as l, TestResultSchema as m, TestRunner_exports as n, DryRunOptionsSchema as o, MutantRunStatus as p, testFilesProvided as r, DryRunResultSchema as s, TestRunner as t, MutantCoverageSchema as u };
119
+ export { MutantActivationSchema as a, MutantRunResultSchema as c, TestRunnerCapabilitiesSchema as d, TestRunnerFailed as f, DryRunStatus as i, MutantRunStatus as l, DryRunOptionsSchema as n, MutantCoverageSchema as o, TestStatus as p, DryRunResultSchema as r, MutantRunOptionsSchema as s, CoverageAnalysisSchema as t, TestResultSchema as u };
package/dist/index.d.mts CHANGED
@@ -1,8 +1,8 @@
1
- import { i as Checker_d_exports } from "./Checker-DYgIIEai.mjs";
2
- import { Z as TestRunner_d_exports, v as Mutant_d_exports } from "./Mutant-BPRJTF8f.mjs";
1
+ import { i as Checker_d_exports } from "./Checker-A8o5B3Ub.mjs";
2
+ import { X as TestRunner_d_exports, v as Mutant_d_exports } from "./Mutant-Ci25PsWA.mjs";
3
3
  import { r as Ignorer_d_exports } from "./Ignorer-BUY68FZQ.mjs";
4
- import { s as Plugin_d_exports } from "./Plugin-DcDAIBQi.mjs";
5
- import { u as Reporter_d_exports } from "./Reporter-eZ3M7lO6.mjs";
6
- import { a as Run_d_exports } from "./Run-BnmGGgWj.mjs";
7
4
  import { a as Schema_d_exports } from "./Schema-CXKiLnTu.mjs";
5
+ import { s as Plugin_d_exports } from "./Plugin-CunIOPtw.mjs";
6
+ import { n as Reporter_d_exports } from "./Reporter-BU7qo6MR.mjs";
7
+ import { a as Run_d_exports } from "./Run-CnhaYlAC.mjs";
8
8
  export { Checker_d_exports as Checker, Ignorer_d_exports as Ignorer, Mutant_d_exports as Mutant, Plugin_d_exports as Plugin, Reporter_d_exports as Reporter, Run_d_exports as Run, Schema_d_exports as Schema, TestRunner_d_exports as TestRunner };
package/dist/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  import { n as Checker_exports } from "./Checker-Bq8NXD8d.mjs";
2
2
  import { t as Ignorer_exports } from "./Ignorer.mjs";
3
3
  import { t as Mutant_exports } from "./Mutant.mjs";
4
- import { t as Plugin_exports } from "./Plugin-Ceh1G8Dz.mjs";
5
- import { n as Reporter_exports } from "./Reporter-COVWW1my.mjs";
6
- import { r as Run_exports } from "./Run-BcDo-hIC.mjs";
4
+ import { t as Plugin_exports } from "./Plugin-DXFdJP1l.mjs";
5
+ import { n as Reporter_exports } from "./Reporter-BWTwlSJf.mjs";
6
+ import { t as Run_exports } from "./Run.mjs";
7
7
  import { n as Schema_exports } from "./Schema-CdNkubPi.mjs";
8
- import { n as TestRunner_exports } from "./TestRunner-DC9U8Unb.mjs";
8
+ import { t as TestRunner_exports } from "./TestRunner.mjs";
9
9
  export { Checker_exports as Checker, Ignorer_exports as Ignorer, Mutant_exports as Mutant, Plugin_exports as Plugin, Reporter_exports as Reporter, Run_exports as Run, Schema_exports as Schema, TestRunner_exports as TestRunner };
@@ -1,4 +1,4 @@
1
- import { c as RunConfiguration } from "./Plugin-DcDAIBQi.mjs";
1
+ import { c as RunConfiguration } from "./Plugin-CunIOPtw.mjs";
2
2
  //#region src/provided-options.d.ts
3
3
  /**
4
4
  * The run's options exactly as the `RunConfiguration` service hands them over.
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@systemfsoftware/stryker-js",
3
- "version": "1.0.0",
3
+ "version": "3.0.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/systemfsoftware/systemfsoftware.git",
7
- "directory": "packages/testing/mutation/stryker-js/stryker-js"
7
+ "directory": "packages/stryker-js/stryker-js"
8
8
  },
9
- "homepage": "https://github.com/systemfsoftware/systemfsoftware/tree/main/packages/testing/mutation/stryker-js/stryker-js#readme",
9
+ "homepage": "https://github.com/systemfsoftware/systemfsoftware/tree/main/packages/stryker-js/stryker-js#readme",
10
10
  "bugs": "https://github.com/systemfsoftware/systemfsoftware/issues",
11
11
  "description": "The mutation-testing language — concept modules, no platform.",
12
12
  "type": "module",
@@ -18,11 +18,11 @@
18
18
  "node": ">=20.0.0"
19
19
  },
20
20
  "dependencies": {
21
- "effect": "^4.0.0-rc.112",
22
- "mutation-testing-report-schema": "3.7.3",
23
- "@systemfsoftware/effect-cell-types": "^6.0.0"
21
+ "effect": "4.0.0-rc.112",
22
+ "@systemfsoftware/effect-cell-types": "^6.0.1"
24
23
  },
25
24
  "devDependencies": {
25
+ "@effect/vitest": "4.0.0-rc.112",
26
26
  "@systemfsoftware/arethetypeswrong-cli": "^1.1.1",
27
27
  "@types/node": "^24",
28
28
  "oxlint": "^1.77.0",
@@ -31,11 +31,11 @@
31
31
  "tsdown": "^0.22.14",
32
32
  "typescript": "^7",
33
33
  "vitest": "^4",
34
- "@systemfsoftware/effect-schema-law": "^2.0.1",
35
- "@systemfsoftware/effect-schema-vite": "^2.0.2",
36
- "@systemfsoftware/all": "^1.1.2",
34
+ "@systemfsoftware/all": "^2.0.0",
35
+ "@systemfsoftware/effect-schema-law": "^2.0.2",
36
+ "@systemfsoftware/vitest-config": "^0.1.0",
37
37
  "@systemfsoftware/tsconfig": "^1.3.3",
38
- "@systemfsoftware/vitest-config": "^0.1.0"
38
+ "@systemfsoftware/effect-schema-vite": "^2.0.3"
39
39
  },
40
40
  "publishConfig": {
41
41
  "access": "public",
@@ -47,12 +47,15 @@
47
47
  "./Evaluator": "./dist/Evaluator.mjs",
48
48
  "./ExitClass": "./dist/ExitClass.mjs",
49
49
  "./Ignorer": "./dist/Ignorer.mjs",
50
+ "./Metrics": "./dist/Metrics.mjs",
50
51
  "./Module": "./dist/Module.mjs",
51
52
  "./Mutant": "./dist/Mutant.mjs",
52
53
  "./output-file": "./dist/output-file.mjs",
53
54
  "./Plugin": "./dist/Plugin.mjs",
54
55
  "./provided-options": "./dist/provided-options.mjs",
56
+ "./Report": "./dist/Report.mjs",
55
57
  "./Reporter": "./dist/Reporter.mjs",
58
+ "./ReporterEvent": "./dist/ReporterEvent.mjs",
56
59
  "./Run": "./dist/Run.mjs",
57
60
  "./Schema": "./dist/Schema.mjs",
58
61
  "./TestRunner": "./dist/TestRunner.mjs",
@@ -1,117 +0,0 @@
1
- import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
- import { t as Reporter } from "./Reporter-COVWW1my.mjs";
3
- import * as Context from "effect/Context";
4
- import * as S from "effect/Schema";
5
- import * as Effect from "effect/Effect";
6
- import * as Layer from "effect/Layer";
7
- import * as MutableHashMap from "effect/MutableHashMap";
8
- import * as Option from "effect/Option";
9
- //#region src/Plugin.schema.ts
10
- const PluginKind = S.Literals([
11
- "Checker",
12
- "TestRunner",
13
- "Reporter",
14
- "Ignore",
15
- "Evaluator"
16
- ]);
17
- var PluginContribution = class extends S.TaggedClass()("PluginContribution", {
18
- kind: PluginKind,
19
- name: S.String,
20
- layer: S.Unknown
21
- }) {};
22
- var Shadowing = class extends S.TaggedClass()("Shadowing", {
23
- kind: S.String,
24
- name: S.String,
25
- shadowedIndex: S.Finite,
26
- winnerIndex: S.Finite
27
- }) {};
28
- //#endregion
29
- //#region src/Plugin.ts
30
- var Plugin_exports = /* @__PURE__ */ __exportAll({
31
- PluginContribution: () => PluginContribution,
32
- PluginKind: () => PluginKind,
33
- RunConfiguration: () => RunConfiguration,
34
- SandboxDirectory: () => SandboxDirectory,
35
- Shadowing: () => Shadowing,
36
- composePlugins: () => composePlugins,
37
- declarePlugin: () => declarePlugin
38
- });
39
- var RunConfiguration = class extends Context.Service()("~@systemfsoftware/stryker-js/RunConfiguration") {};
40
- var SandboxDirectory = class extends Context.Service()("~@systemfsoftware/stryker-js/SandboxDirectory") {};
41
- function declarePlugin(kind, name, layer) {
42
- return new PluginContribution({
43
- kind,
44
- name,
45
- layer
46
- });
47
- }
48
- function foldContributions(contributions) {
49
- const resolved = MutableHashMap.empty();
50
- const shadowings = [];
51
- const lastSeen = MutableHashMap.empty();
52
- for (const [index, contribution] of contributions.entries()) {
53
- const key = `${contribution.kind}:${contribution.name}`;
54
- const previous = MutableHashMap.get(lastSeen, key);
55
- if (Option.isSome(previous)) shadowings.push(new Shadowing({
56
- kind: String(contribution.kind),
57
- name: contribution.name,
58
- shadowedIndex: previous.value,
59
- winnerIndex: index
60
- }));
61
- MutableHashMap.set(resolved, key, contribution);
62
- MutableHashMap.set(lastSeen, key, index);
63
- }
64
- return {
65
- resolved,
66
- shadowings
67
- };
68
- }
69
- function composePlugins(contributions) {
70
- const { resolved, shadowings } = foldContributions(contributions);
71
- const allResolved = Array.from(MutableHashMap.values(resolved));
72
- const reporterContributions = allResolved.filter((c) => c.kind === "Reporter");
73
- const nonReporterLayers = allResolved.filter((c) => c.kind !== "Reporter").map((contribution) => contribution.layer);
74
- let broadcastLayer;
75
- if (reporterContributions.length > 0) broadcastLayer = Layer.effect(Reporter, Effect.gen(function* () {
76
- const config = yield* RunConfiguration;
77
- const wantedNames = {};
78
- for (const name of config.reporters) wantedNames[name.toLowerCase()] = true;
79
- const selected = reporterContributions.filter((c) => c.name.toLowerCase() in wantedNames);
80
- const sandboxOption = yield* Effect.serviceOption(SandboxDirectory);
81
- const namedReporters = [];
82
- for (const contribution of selected) {
83
- let buildEffect = Layer.build(contribution.layer).pipe(Effect.provideService(RunConfiguration, config));
84
- if (Option.isSome(sandboxOption)) buildEffect = buildEffect.pipe(Effect.provideService(SandboxDirectory, sandboxOption.value));
85
- const ctx = yield* buildEffect;
86
- const reporter = Context.get(ctx, Reporter);
87
- namedReporters.push({
88
- name: contribution.name,
89
- reporter
90
- });
91
- }
92
- const toEach = (event, call) => Effect.forEach(namedReporters, ({ name, reporter }) => call(reporter).pipe(Effect.catchCause((cause) => Effect.logWarning(`Reporter "${name}" failed handling ${event}`).pipe(Effect.annotateLogs("cause", cause)))), {
93
- concurrency: "unbounded",
94
- discard: true
95
- });
96
- return {
97
- onDryRunCompleted: (event) => toEach("onDryRunCompleted", (r) => r.onDryRunCompleted(event)),
98
- onMutationTestingPlanReady: (event) => toEach("onMutationTestingPlanReady", (r) => r.onMutationTestingPlanReady(event)),
99
- onMutantTested: (result) => toEach("onMutantTested", (r) => r.onMutantTested(result)),
100
- onMutationTestReportReady: (report, metrics) => toEach("onMutationTestReportReady", (r) => r.onMutationTestReportReady(report, metrics)),
101
- wrapUp: toEach("wrapUp", (r) => r.wrapUp)
102
- };
103
- }));
104
- const allLayers = [...nonReporterLayers];
105
- if (broadcastLayer !== void 0) allLayers.push(broadcastLayer);
106
- if (allLayers.length === 0) return {
107
- layer: Option.none(),
108
- shadowings
109
- };
110
- const merged = allLayers.reduce((acc, next) => Layer.merge(acc, next));
111
- return {
112
- layer: Option.some(merged),
113
- shadowings
114
- };
115
- }
116
- //#endregion
117
- export { declarePlugin as a, Shadowing as c, composePlugins as i, RunConfiguration as n, PluginContribution as o, SandboxDirectory as r, PluginKind as s, Plugin_exports as t };
@@ -1,33 +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
- import * as Effect from "effect/Effect";
5
- //#region src/Reporter.schema.ts
6
- var ReporterFailed = class extends S.TaggedError()("ReporterFailed", {
7
- cause: S.String,
8
- event: S.Literals([
9
- "onDryRunCompleted",
10
- "onMutationTestingPlanReady",
11
- "onMutantTested",
12
- "onMutationTestReportReady",
13
- "wrapUp"
14
- ]),
15
- reporterName: S.String
16
- }) {};
17
- //#endregion
18
- //#region src/Reporter.ts
19
- var Reporter_exports = /* @__PURE__ */ __exportAll({
20
- Reporter: () => Reporter,
21
- ReporterFailed: () => ReporterFailed,
22
- broadcastReporter: () => broadcastReporter
23
- });
24
- var Reporter = class extends Context.Service()("~@systemfsoftware/stryker-js/Reporter") {};
25
- const broadcastReporter = (reporters) => ({
26
- onDryRunCompleted: (event) => Effect.forEach(reporters, (r) => r.reporter.onDryRunCompleted(event), { discard: true }),
27
- onMutationTestingPlanReady: (event) => Effect.forEach(reporters, (r) => r.reporter.onMutationTestingPlanReady(event), { discard: true }),
28
- onMutantTested: (result) => Effect.forEach(reporters, (r) => r.reporter.onMutantTested(result), { discard: true }),
29
- onMutationTestReportReady: (report, metrics) => Effect.forEach(reporters, (r) => r.reporter.onMutationTestReportReady(report, metrics), { discard: true }),
30
- wrapUp: Effect.forEach(reporters, (r) => r.reporter.wrapUp, { discard: true }).pipe(Effect.asVoid)
31
- });
32
- //#endregion
33
- export { ReporterFailed as i, Reporter_exports as n, broadcastReporter as r, Reporter as t };
@@ -1,83 +0,0 @@
1
- import { S as TestPlan, p as MutantResult } from "./Mutant-BPRJTF8f.mjs";
2
- import * as Context from "effect/Context";
3
- import * as S from "effect/Schema";
4
- import * as schema from "mutation-testing-report-schema/api";
5
- import * as Effect from "effect/Effect";
6
- //#region src/Reporter.schema.d.ts
7
- declare const ReporterFailed_base: S.Class<ReporterFailed, S.TaggedStruct<"ReporterFailed", {
8
- readonly cause: S.String;
9
- readonly event: S.Literals<readonly ["onDryRunCompleted", "onMutationTestingPlanReady", "onMutantTested", "onMutationTestReportReady", "wrapUp"]>;
10
- readonly reporterName: S.String;
11
- }>, import("effect/Cause").YieldableError>;
12
- declare class ReporterFailed extends ReporterFailed_base {}
13
- declare namespace Reporter_d_exports {
14
- export { CompleteDryRunResultForReporter, DryRunCompletedEvent, Metrics, MetricsResult, MutationTestMetricsResult, MutationTestingPlanReadyEvent, NamedReporter, Reporter, ReporterFailed, ReporterService, RunTiming, TestMetrics, TestRunnerCapabilities, broadcastReporter };
15
- }
16
- interface Metrics {
17
- readonly pending: number;
18
- readonly killed: number;
19
- readonly timeout: number;
20
- readonly survived: number;
21
- readonly noCoverage: number;
22
- readonly runtimeErrors: number;
23
- readonly compileErrors: number;
24
- readonly ignored: number;
25
- readonly totalDetected: number;
26
- readonly totalUndetected: number;
27
- readonly totalInvalid: number;
28
- readonly totalValid: number;
29
- readonly totalMutants: number;
30
- readonly totalCovered: number;
31
- readonly mutationScore: number;
32
- readonly mutationScoreBasedOnCoveredCode: number;
33
- }
34
- interface TestMetrics {
35
- readonly total: number;
36
- readonly killing: number;
37
- readonly covering: number;
38
- readonly notCovering: number;
39
- }
40
- interface MetricsResult<TMetrics> {
41
- readonly name: string;
42
- readonly metrics: TMetrics;
43
- readonly childResults: readonly MetricsResult<TMetrics>[];
44
- }
45
- interface MutationTestMetricsResult {
46
- readonly systemUnderTestMetrics: MetricsResult<Metrics>;
47
- readonly testMetrics: MetricsResult<TestMetrics> | undefined;
48
- }
49
- interface RunTiming {
50
- readonly net: number;
51
- readonly overhead: number;
52
- }
53
- interface CompleteDryRunResultForReporter {
54
- readonly tests: readonly unknown[];
55
- readonly status: 'complete';
56
- }
57
- interface TestRunnerCapabilities {
58
- readonly reloadEnvironment: boolean;
59
- }
60
- interface DryRunCompletedEvent {
61
- readonly result: CompleteDryRunResultForReporter;
62
- readonly timing: RunTiming;
63
- readonly capabilities: TestRunnerCapabilities;
64
- }
65
- interface MutationTestingPlanReadyEvent {
66
- readonly mutantPlans: readonly TestPlan[];
67
- }
68
- interface ReporterService {
69
- readonly onDryRunCompleted: (event: DryRunCompletedEvent) => Effect.Effect<void, ReporterFailed>;
70
- readonly onMutationTestingPlanReady: (event: MutationTestingPlanReadyEvent) => Effect.Effect<void, ReporterFailed>;
71
- readonly onMutantTested: (result: Readonly<MutantResult>) => Effect.Effect<void, ReporterFailed>;
72
- readonly onMutationTestReportReady: (report: Readonly<schema.MutationTestResult>, metrics: Readonly<MutationTestMetricsResult>) => Effect.Effect<void, ReporterFailed>;
73
- readonly wrapUp: Effect.Effect<void, ReporterFailed>;
74
- }
75
- interface NamedReporter {
76
- readonly name: string;
77
- readonly reporter: ReporterService;
78
- }
79
- declare const Reporter_base: Context.ServiceClass<Reporter, "~@systemfsoftware/stryker-js/Reporter", ReporterService>;
80
- declare class Reporter extends Reporter_base {}
81
- declare const broadcastReporter: (reporters: readonly NamedReporter[]) => ReporterService;
82
- //#endregion
83
- export { MutationTestMetricsResult as a, Reporter as c, RunTiming as d, TestMetrics as f, ReporterFailed as h, MetricsResult as i, ReporterService as l, broadcastReporter as m, DryRunCompletedEvent as n, MutationTestingPlanReadyEvent as o, TestRunnerCapabilities as p, Metrics as r, NamedReporter as s, CompleteDryRunResultForReporter as t, Reporter_d_exports as u };