@systemfsoftware/stryker-js 2.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.
Files changed (48) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/{Checker-DYgIIEai.d.mts → Checker-A8o5B3Ub.d.mts} +1 -1
  3. package/dist/Checker.d.mts +1 -1
  4. package/dist/{Evaluator-RZBS4oeh.d.mts → Evaluator-CnAN8-pZ.d.mts} +2 -2
  5. package/dist/Evaluator.d.mts +1 -1
  6. package/dist/ExitClass.d.mts +1 -1
  7. package/dist/ExitClass.mjs +20 -31
  8. package/dist/Metrics.d.mts +7 -0
  9. package/dist/Metrics.mjs +79 -0
  10. package/dist/Metrics.schema-BaVd6rXs.d.mts +50 -0
  11. package/dist/Metrics.schema-DZdoc46X.mjs +27 -0
  12. package/dist/{Mutant-BPRJTF8f.d.mts → Mutant-Ci25PsWA.d.mts} +6 -6
  13. package/dist/Mutant.d.mts +3 -2
  14. package/dist/Mutant.mjs +54 -78
  15. package/dist/{Mutant.schema-BTWhFTk4.mjs → Mutant.schema-H3r0ho_R.mjs} +3 -3
  16. package/dist/{Plugin-DcDAIBQi.d.mts → Plugin-BtItMchw.d.mts} +31 -13
  17. package/dist/Plugin-DXFdJP1l.mjs +105 -0
  18. package/dist/Plugin.d.mts +2 -2
  19. package/dist/Plugin.mjs +2 -2
  20. package/dist/Report.d.mts +2 -0
  21. package/dist/Report.mjs +98 -0
  22. package/dist/Report.schema-_buHXdnZ.d.mts +251 -0
  23. package/dist/Reporter-BWTwlSJf.mjs +25 -0
  24. package/dist/Reporter-C7ysGxqX.d.mts +16 -0
  25. package/dist/Reporter.d.mts +4 -2
  26. package/dist/Reporter.mjs +3 -2
  27. package/dist/ReporterEvent.d.mts +2 -0
  28. package/dist/ReporterEvent.mjs +57 -0
  29. package/dist/ReporterEvent.schema-BhtyYCZo.d.mts +189 -0
  30. package/dist/{Run-BnmGGgWj.d.mts → Run-BUpNSmcM.d.mts} +82 -89
  31. package/dist/Run.d.mts +2 -2
  32. package/dist/Run.mjs +56 -2
  33. package/dist/Run.schema-DZve3k2m.mjs +138 -0
  34. package/dist/{Schema-CXKiLnTu.d.mts → Schema-4oCWQ0P0.d.mts} +63 -64
  35. package/dist/{Schema-CdNkubPi.mjs → Schema-CMKdWMUN.mjs} +55 -57
  36. package/dist/Schema.d.mts +1 -1
  37. package/dist/Schema.mjs +1 -1
  38. package/dist/TestRunner.d.mts +1 -1
  39. package/dist/TestRunner.mjs +57 -2
  40. package/dist/{TestRunner-DC9U8Unb.mjs → TestRunner.schema-Dy0Wdro2.mjs} +2 -64
  41. package/dist/index.d.mts +6 -6
  42. package/dist/index.mjs +5 -5
  43. package/dist/provided-options.d.mts +1 -1
  44. package/package.json +10 -7
  45. package/dist/Plugin-Ceh1G8Dz.mjs +0 -117
  46. package/dist/Reporter-COVWW1my.mjs +0 -33
  47. package/dist/Reporter-eZ3M7lO6.d.mts +0 -83
  48. package/dist/Run-BcDo-hIC.mjs +0 -199
@@ -0,0 +1,57 @@
1
+ import { t as LocationSchema } from "./Mutant.schema-H3r0ho_R.mjs";
2
+ import { MutationTestResultSchema } from "./Report.mjs";
3
+ import { t as MetricsResultSchema } from "./Metrics.schema-DZdoc46X.mjs";
4
+ import { i as MutantStatus } from "./Run.schema-DZve3k2m.mjs";
5
+ import { d as TestRunnerCapabilitiesSchema, u as TestResultSchema } from "./TestRunner.schema-Dy0Wdro2.mjs";
6
+ import * as S from "effect/Schema";
7
+ //#region src/ReporterEvent.schema.ts
8
+ const ReporterEventKind = S.Literals([
9
+ "dryRunCompleted",
10
+ "mutationTestingPlanReady",
11
+ "mutantTested",
12
+ "mutationTestReportReady"
13
+ ]);
14
+ const RunTimingSchema = S.Struct({
15
+ net: S.Finite,
16
+ overhead: S.Finite
17
+ });
18
+ const ReporterPlanKind = S.Literals(["EarlyResult", "Run"]);
19
+ const ReporterPlanDescriptorSchema = S.Struct({
20
+ mutantId: S.String,
21
+ plan: ReporterPlanKind,
22
+ netTime: S.Finite,
23
+ reloadEnvironment: S.Boolean
24
+ });
25
+ var DryRunCompleted = class extends S.TaggedClass()("dryRunCompleted", {
26
+ timing: RunTimingSchema,
27
+ capabilities: TestRunnerCapabilitiesSchema,
28
+ testCount: S.Finite,
29
+ tests: S.Array(TestResultSchema)
30
+ }) {};
31
+ var MutationTestingPlanReady = class extends S.TaggedClass()("mutationTestingPlanReady", {
32
+ total: S.Finite,
33
+ plans: S.Array(ReporterPlanDescriptorSchema)
34
+ }) {};
35
+ var MutantTested = class extends S.TaggedClass()("mutantTested", {
36
+ id: S.String,
37
+ status: MutantStatus,
38
+ file: S.String,
39
+ location: LocationSchema,
40
+ mutator: S.String,
41
+ replacement: S.NullOr(S.String),
42
+ completed: S.Finite,
43
+ total: S.Finite
44
+ }) {};
45
+ var MutationTestReportReady = class extends S.TaggedClass()("mutationTestReportReady", {
46
+ report: MutationTestResultSchema,
47
+ metrics: MetricsResultSchema
48
+ }) {};
49
+ const ReporterEventUnion = S.Union([
50
+ DryRunCompleted,
51
+ MutationTestingPlanReady,
52
+ MutantTested,
53
+ MutationTestReportReady
54
+ ]);
55
+ const ReporterEventSchema = S.toStandardSchemaV1(ReporterEventUnion);
56
+ //#endregion
57
+ export { DryRunCompleted, MutantTested, MutationTestReportReady, MutationTestingPlanReady, ReporterEventKind, ReporterEventSchema, ReporterEventUnion };
@@ -0,0 +1,189 @@
1
+ import { n as MetricsResult } from "./Metrics.schema-BaVd6rXs.mjs";
2
+ import { m as StrykerOptions } from "./Schema-4oCWQ0P0.mjs";
3
+ import * as S from "effect/Schema";
4
+ import { StandardSchemaV1 } from "effect/StandardSchema";
5
+ //#region src/ReporterEvent.schema.d.ts
6
+ declare const ReporterEventKind: S.Literals<readonly ["dryRunCompleted", "mutationTestingPlanReady", "mutantTested", "mutationTestReportReady"]>;
7
+ type ReporterEventKind = typeof ReporterEventKind.Type;
8
+ declare const RunTimingSchema: S.Struct<{
9
+ readonly net: S.Finite;
10
+ readonly overhead: S.Finite;
11
+ }>;
12
+ type RunTiming = typeof RunTimingSchema.Type;
13
+ declare const ReporterPlanDescriptorSchema: S.Struct<{
14
+ readonly mutantId: S.String;
15
+ readonly plan: S.Literals<readonly ["EarlyResult", "Run"]>;
16
+ readonly netTime: S.Finite;
17
+ readonly reloadEnvironment: S.Boolean;
18
+ }>;
19
+ type ReporterPlanDescriptor = typeof ReporterPlanDescriptorSchema.Type;
20
+ declare const DryRunCompleted_base: S.Class<DryRunCompleted, S.TaggedStruct<"dryRunCompleted", {
21
+ readonly timing: S.Struct<{
22
+ readonly net: S.Finite;
23
+ readonly overhead: S.Finite;
24
+ }>;
25
+ readonly capabilities: S.Struct<{
26
+ readonly reloadEnvironment: S.Boolean;
27
+ }>;
28
+ readonly testCount: S.Finite;
29
+ readonly tests: S.$Array<S.Union<readonly [S.Struct<{
30
+ readonly id: S.String;
31
+ readonly name: S.String;
32
+ readonly timeSpentMs: S.Finite;
33
+ readonly fileName: S.optionalKey<S.String>;
34
+ readonly startPosition: S.optionalKey<S.Struct<{
35
+ readonly line: S.Finite;
36
+ readonly column: S.Finite;
37
+ }>>;
38
+ readonly status: S.Literal<"failed">;
39
+ readonly failureMessage: S.String;
40
+ }>, S.Struct<{
41
+ readonly id: S.String;
42
+ readonly name: S.String;
43
+ readonly timeSpentMs: S.Finite;
44
+ readonly fileName: S.optionalKey<S.String>;
45
+ readonly startPosition: S.optionalKey<S.Struct<{
46
+ readonly line: S.Finite;
47
+ readonly column: S.Finite;
48
+ }>>;
49
+ readonly status: S.Literal<"skipped">;
50
+ }>, S.Struct<{
51
+ readonly id: S.String;
52
+ readonly name: S.String;
53
+ readonly timeSpentMs: S.Finite;
54
+ readonly fileName: S.optionalKey<S.String>;
55
+ readonly startPosition: S.optionalKey<S.Struct<{
56
+ readonly line: S.Finite;
57
+ readonly column: S.Finite;
58
+ }>>;
59
+ readonly status: S.Literal<"success">;
60
+ }>]>>;
61
+ }>, {}>;
62
+ declare class DryRunCompleted extends DryRunCompleted_base {}
63
+ declare const MutationTestingPlanReady_base: S.Class<MutationTestingPlanReady, S.TaggedStruct<"mutationTestingPlanReady", {
64
+ readonly total: S.Finite;
65
+ readonly plans: S.$Array<S.Struct<{
66
+ readonly mutantId: S.String;
67
+ readonly plan: S.Literals<readonly ["EarlyResult", "Run"]>;
68
+ readonly netTime: S.Finite;
69
+ readonly reloadEnvironment: S.Boolean;
70
+ }>>;
71
+ }>, {}>;
72
+ declare class MutationTestingPlanReady extends MutationTestingPlanReady_base {}
73
+ declare const MutantTested_base: S.Class<MutantTested, S.TaggedStruct<"mutantTested", {
74
+ readonly id: S.String;
75
+ readonly status: S.Literals<readonly ["Killed", "Survived", "NoCoverage", "Timeout", "CompileError", "RuntimeError", "Ignored", "Pending"]>;
76
+ readonly file: S.String;
77
+ readonly location: S.Struct<{
78
+ readonly start: S.Struct<{
79
+ readonly line: S.Finite;
80
+ readonly column: S.Finite;
81
+ }>;
82
+ readonly end: S.Struct<{
83
+ readonly line: S.Finite;
84
+ readonly column: S.Finite;
85
+ }>;
86
+ }>;
87
+ readonly mutator: S.String;
88
+ readonly replacement: S.NullOr<S.String>;
89
+ readonly completed: S.Finite;
90
+ readonly total: S.Finite;
91
+ }>, {}>;
92
+ declare class MutantTested extends MutantTested_base {}
93
+ declare const MutationTestReportReady_base: S.Class<MutationTestReportReady, S.TaggedStruct<"mutationTestReportReady", {
94
+ readonly report: S.Struct<{
95
+ readonly schemaVersion: S.String;
96
+ readonly files: S.$Record<S.String, S.Struct<{
97
+ readonly language: S.String;
98
+ readonly source: S.String;
99
+ readonly mutants: S.$Array<S.Struct<{
100
+ readonly id: S.String;
101
+ readonly mutatorName: S.String;
102
+ readonly status: S.Literals<readonly ["Killed", "Survived", "NoCoverage", "CompileError", "RuntimeError", "Timeout", "Ignored", "Pending"]>;
103
+ readonly location: S.Struct<{
104
+ readonly start: S.Struct<{
105
+ readonly line: S.Finite;
106
+ readonly column: S.Finite;
107
+ }>;
108
+ readonly end: S.Struct<{
109
+ readonly line: S.Finite;
110
+ readonly column: S.Finite;
111
+ }>;
112
+ }>;
113
+ readonly replacement: S.optional<S.String>;
114
+ readonly description: S.optional<S.String>;
115
+ readonly statusReason: S.optional<S.String>;
116
+ readonly static: S.optional<S.Boolean>;
117
+ readonly coveredBy: S.optional<S.$Array<S.String>>;
118
+ readonly killedBy: S.optional<S.$Array<S.String>>;
119
+ readonly testsCompleted: S.optional<S.Finite>;
120
+ readonly duration: S.optional<S.Finite>;
121
+ }>>;
122
+ }>>;
123
+ readonly thresholds: S.Struct<{
124
+ readonly high: S.Finite;
125
+ readonly low: S.Finite;
126
+ }>;
127
+ readonly config: S.optional<S.$Record<S.String, S.Unknown>>;
128
+ readonly testFiles: S.optional<S.$Record<S.String, S.Struct<{
129
+ readonly source: S.optional<S.String>;
130
+ readonly tests: S.$Array<S.Struct<{
131
+ readonly id: S.String;
132
+ readonly name: S.String;
133
+ readonly location: S.optional<S.Struct<{
134
+ readonly start: S.Struct<{
135
+ readonly line: S.Finite;
136
+ readonly column: S.Finite;
137
+ }>;
138
+ readonly end: S.optional<S.Struct<{
139
+ readonly line: S.Finite;
140
+ readonly column: S.Finite;
141
+ }>>;
142
+ }>>;
143
+ }>>;
144
+ }>>>;
145
+ readonly projectRoot: S.optional<S.String>;
146
+ readonly framework: S.optional<S.Struct<{
147
+ readonly name: S.String;
148
+ readonly version: S.optional<S.String>;
149
+ readonly branding: S.optional<S.Struct<{
150
+ readonly homepageUrl: S.String;
151
+ readonly imageUrl: S.optional<S.String>;
152
+ }>>;
153
+ readonly dependencies: S.optional<S.$Record<S.String, S.String>>;
154
+ }>>;
155
+ }>;
156
+ readonly metrics: S.Struct<{
157
+ readonly name: S.String;
158
+ readonly metrics: S.Struct<{
159
+ readonly pending: S.Finite;
160
+ readonly killed: S.Finite;
161
+ readonly timeout: S.Finite;
162
+ readonly survived: S.Finite;
163
+ readonly noCoverage: S.Finite;
164
+ readonly runtimeErrors: S.Finite;
165
+ readonly compileErrors: S.Finite;
166
+ readonly ignored: S.Finite;
167
+ readonly totalDetected: S.Finite;
168
+ readonly totalUndetected: S.Finite;
169
+ readonly totalInvalid: S.Finite;
170
+ readonly totalValid: S.Finite;
171
+ readonly totalMutants: S.Finite;
172
+ readonly totalCovered: S.Finite;
173
+ readonly mutationScore: S.Finite;
174
+ readonly mutationScoreBasedOnCoveredCode: S.Finite;
175
+ }>;
176
+ readonly childResults: S.$Array<S.suspend<S.Codec<MetricsResult, MetricsResult, never, never>>>;
177
+ }>;
178
+ }>, {}>;
179
+ declare class MutationTestReportReady extends MutationTestReportReady_base {}
180
+ declare const ReporterEventUnion: S.Union<readonly [typeof DryRunCompleted, typeof MutationTestingPlanReady, typeof MutantTested, typeof MutationTestReportReady]>;
181
+ type ReporterEvent = DryRunCompleted | MutationTestingPlanReady | MutantTested | MutationTestReportReady;
182
+ declare const ReporterEventSchema: StandardSchemaV1<unknown, ReporterEvent>;
183
+ interface ReporterInit {
184
+ readonly traceparent?: string | undefined;
185
+ readonly tracestate?: string | undefined;
186
+ }
187
+ type ReporterFactory = (options: StrykerOptions, init: ReporterInit) => (events: AsyncIterable<ReporterEvent>) => Promise<void>;
188
+ //#endregion
189
+ export { ReporterEvent as a, ReporterEventUnion as c, ReporterPlanDescriptor as d, RunTiming as f, MutationTestingPlanReady as i, ReporterFactory as l, MutantTested as n, ReporterEventKind as o, MutationTestReportReady as r, ReporterEventSchema as s, DryRunCompleted as t, ReporterInit as u };
@@ -2,7 +2,6 @@ import * as Context from "effect/Context";
2
2
  import * as S from "effect/Schema";
3
3
  import * as Effect from "effect/Effect";
4
4
  import * as Exit from "effect/Exit";
5
- import { Wire } from "@systemfsoftware/effect-cell-types";
6
5
  import * as Cause from "effect/Cause";
7
6
  import * as Queue from "effect/Queue";
8
7
  //#region src/Run.schema.d.ts
@@ -15,126 +14,120 @@ type ModeSignal = typeof ModeSignal.Type;
15
14
  declare const MutantStatus: S.Literals<readonly ["Killed", "Survived", "NoCoverage", "Timeout", "CompileError", "RuntimeError", "Ignored", "Pending"]>;
16
15
  type MutantStatus = typeof MutantStatus.Type;
17
16
  declare const Position: S.Struct<{
18
- line: S.Finite & Wire.Mark;
19
- column: S.Finite & Wire.Mark;
20
- }> & Wire.Mark;
17
+ readonly line: S.Finite;
18
+ readonly column: S.Finite;
19
+ }>;
21
20
  declare const Location: S.Struct<{
22
- start: S.Struct<{
23
- line: S.Finite & Wire.Mark;
24
- column: S.Finite & Wire.Mark;
25
- }> & Wire.Mark;
26
- end: S.Struct<{
27
- line: S.Finite & Wire.Mark;
28
- column: S.Finite & Wire.Mark;
29
- }> & Wire.Mark;
30
- }> & Wire.Mark;
21
+ readonly start: S.Struct<{
22
+ readonly line: S.Finite;
23
+ readonly column: S.Finite;
24
+ }>;
25
+ readonly end: S.Struct<{
26
+ readonly line: S.Finite;
27
+ readonly column: S.Finite;
28
+ }>;
29
+ }>;
31
30
  type Location = typeof Location.Type;
32
31
  type Position = typeof Position.Type;
33
32
  declare const RunStarted_base: S.Class<RunStarted, S.TaggedStruct<"stream", {
34
- readonly schemaVersion: S.String & Wire.Mark;
35
- readonly runId: S.String & Wire.Mark;
33
+ readonly schemaVersion: S.String;
34
+ readonly runId: S.String;
36
35
  readonly mode: S.Literals<readonly ["human", "machine"]>;
37
36
  readonly signal: S.Literals<readonly ["flag", "env", "tty", "agent", "tool"]>;
38
37
  }>, {}>;
39
38
  declare class RunStarted extends RunStarted_base {}
40
39
  declare const PhaseEntered_base: S.Class<PhaseEntered, S.TaggedStruct<"phase", {
41
40
  readonly phase: S.Literals<readonly ["prepare", "instrument", "dry-run", "mutation-test"]>;
42
- readonly elapsedMs: S.Finite & Wire.Mark;
41
+ readonly elapsedMs: S.Finite;
43
42
  }>, {}>;
44
43
  declare class PhaseEntered extends PhaseEntered_base {}
45
44
  declare const PlanKnown_base: S.Class<PlanKnown, S.TaggedStruct<"plan", {
46
- readonly total: S.Finite & Wire.Mark;
45
+ readonly total: S.Finite;
47
46
  }>, {}>;
48
47
  declare class PlanKnown extends PlanKnown_base {}
49
48
  declare const MutantTested_base: S.Class<MutantTested, S.TaggedStruct<"mutant", {
50
- readonly id: S.String & Wire.Mark;
49
+ readonly id: S.String;
51
50
  readonly status: S.Literals<readonly ["Killed", "Survived", "NoCoverage", "Timeout", "CompileError", "RuntimeError", "Ignored", "Pending"]>;
52
- readonly file: S.String & Wire.Mark;
51
+ readonly file: S.String;
53
52
  readonly location: S.Struct<{
54
- start: S.Struct<{
55
- line: S.Finite & Wire.Mark;
56
- column: S.Finite & Wire.Mark;
57
- }> & Wire.Mark;
58
- end: S.Struct<{
59
- line: S.Finite & Wire.Mark;
60
- column: S.Finite & Wire.Mark;
61
- }> & Wire.Mark;
62
- }> & Wire.Mark;
63
- readonly mutator: S.String & Wire.Mark;
64
- readonly replacement: S.NullOr<S.String & Wire.Mark> & Wire.Mark;
65
- readonly completed: S.Finite & Wire.Mark;
66
- readonly total: S.Finite & Wire.Mark;
53
+ readonly start: S.Struct<{
54
+ readonly line: S.Finite;
55
+ readonly column: S.Finite;
56
+ }>;
57
+ readonly end: S.Struct<{
58
+ readonly line: S.Finite;
59
+ readonly column: S.Finite;
60
+ }>;
61
+ }>;
62
+ readonly mutator: S.String;
63
+ readonly replacement: S.NullOr<S.String>;
64
+ readonly completed: S.Finite;
65
+ readonly total: S.Finite;
67
66
  }>, {}>;
68
67
  declare class MutantTested extends MutantTested_base {}
69
68
  declare const Heartbeat_base: S.Class<Heartbeat, S.TaggedStruct<"tick", {
70
- readonly elapsedMs: S.Finite & Wire.Mark;
71
- readonly completed: S.Finite & Wire.Mark;
72
- readonly total: S.NullOr<S.Finite & Wire.Mark> & Wire.Mark;
69
+ readonly elapsedMs: S.Finite;
70
+ readonly completed: S.Finite;
71
+ readonly total: S.NullOr<S.Finite>;
73
72
  }>, {}>;
74
73
  declare class Heartbeat extends Heartbeat_base {}
75
74
  declare const VerdictReached_base: S.Class<VerdictReached, S.TaggedStruct<"verdict", {
76
- readonly schemaVersion: S.String & Wire.Mark;
77
- readonly runId: S.String & Wire.Mark;
75
+ readonly schemaVersion: S.String;
76
+ readonly runId: S.String;
78
77
  readonly mode: S.Literals<readonly ["human", "machine"]>;
79
78
  readonly signal: S.Literals<readonly ["flag", "env", "tty", "agent", "tool"]>;
80
- readonly score: S.NullOr<S.Finite & Wire.Mark> & Wire.Mark;
79
+ readonly score: S.NullOr<S.Finite>;
81
80
  readonly thresholds: S.Struct<{
82
- high: S.Finite & Wire.Mark;
83
- low: S.Finite & Wire.Mark;
84
- break: S.NullOr<S.Finite & Wire.Mark> & Wire.Mark;
85
- }> & Wire.Mark;
86
- readonly reportFile: S.NullOr<S.String & Wire.Mark> & Wire.Mark;
81
+ readonly high: S.Finite;
82
+ readonly low: S.Finite;
83
+ readonly break: S.NullOr<S.Finite>;
84
+ }>;
85
+ readonly reportFile: S.NullOr<S.String>;
87
86
  readonly counts: S.Struct<{
88
- killed: S.Finite & Wire.Mark;
89
- timeout: S.Finite & Wire.Mark;
90
- survived: S.Finite & Wire.Mark;
91
- noCoverage: S.Finite & Wire.Mark;
92
- runtimeErrors: S.Finite & Wire.Mark;
93
- compileErrors: S.Finite & Wire.Mark;
94
- ignored: S.Finite & Wire.Mark;
95
- pending: S.Finite & Wire.Mark;
96
- }> & Wire.Mark;
87
+ readonly killed: S.Finite;
88
+ readonly timeout: S.Finite;
89
+ readonly survived: S.Finite;
90
+ readonly noCoverage: S.Finite;
91
+ readonly runtimeErrors: S.Finite;
92
+ readonly compileErrors: S.Finite;
93
+ readonly ignored: S.Finite;
94
+ readonly pending: S.Finite;
95
+ }>;
97
96
  readonly mutants: S.$Array<S.Struct<{
98
- readonly id: S.String & Wire.Mark;
99
- readonly file: S.String & Wire.Mark;
97
+ readonly id: S.String;
98
+ readonly file: S.String;
100
99
  readonly location: S.Struct<{
101
- start: S.Struct<{
102
- line: S.Finite & Wire.Mark;
103
- column: S.Finite & Wire.Mark;
104
- }> & Wire.Mark;
105
- end: S.Struct<{
106
- line: S.Finite & Wire.Mark;
107
- column: S.Finite & Wire.Mark;
108
- }> & Wire.Mark;
109
- }> & Wire.Mark;
110
- readonly mutator: S.String & Wire.Mark;
111
- readonly replacement: S.NullOr<S.String & Wire.Mark> & Wire.Mark;
100
+ readonly start: S.Struct<{
101
+ readonly line: S.Finite;
102
+ readonly column: S.Finite;
103
+ }>;
104
+ readonly end: S.Struct<{
105
+ readonly line: S.Finite;
106
+ readonly column: S.Finite;
107
+ }>;
108
+ }>;
109
+ readonly mutator: S.String;
110
+ readonly replacement: S.NullOr<S.String>;
112
111
  readonly status: S.Literals<readonly ["Killed", "Survived", "NoCoverage", "Timeout", "CompileError", "RuntimeError", "Ignored", "Pending"]>;
113
112
  }>>;
114
113
  }>, {}>;
115
114
  declare class VerdictReached extends VerdictReached_base {}
116
115
  declare const RunFailed_base: S.Class<RunFailed, S.TaggedStruct<"error", {
117
- readonly schemaVersion: S.String & Wire.Mark;
118
- readonly code: S.Finite & Wire.Mark;
119
- readonly error: S.String & Wire.Mark;
120
- readonly remediation: S.String & Wire.Mark;
116
+ readonly schemaVersion: S.String;
117
+ readonly code: S.Finite;
118
+ readonly error: S.String;
119
+ readonly remediation: S.String;
121
120
  }>, {}>;
122
121
  declare class RunFailed extends RunFailed_base {}
123
122
  declare const HelpRendered_base: S.Class<HelpRendered, S.TaggedStruct<"help", {
124
- readonly schemaVersion: S.String & Wire.Mark;
125
- readonly code: S.Literals<readonly [0]> & Wire.Mark;
126
- readonly help: S.String & Wire.Mark;
123
+ readonly schemaVersion: S.String;
124
+ readonly code: S.Literals<readonly [0]>;
125
+ readonly help: S.String;
127
126
  }>, {}>;
128
127
  declare class HelpRendered extends HelpRendered_base {}
129
- declare const ManifestRendered_base: S.Class<ManifestRendered, S.TaggedStruct<"manifest", {
130
- readonly schemaVersion: S.String & Wire.Mark;
131
- readonly code: S.Literals<readonly [0]> & Wire.Mark;
132
- readonly manifest: S.String & Wire.Mark;
133
- }>, {}>;
134
- declare class ManifestRendered extends ManifestRendered_base {}
135
- declare const RunEvent: S.Union<readonly [typeof RunStarted, typeof PhaseEntered, typeof PlanKnown, typeof MutantTested, typeof Heartbeat, typeof VerdictReached, typeof RunFailed, typeof HelpRendered, typeof ManifestRendered]>;
128
+ declare const RunEvent: S.Union<readonly [typeof RunStarted, typeof PhaseEntered, typeof PlanKnown, typeof MutantTested, typeof Heartbeat, typeof VerdictReached, typeof RunFailed, typeof HelpRendered]>;
136
129
  type RunEvent = typeof RunEvent.Type;
137
- type RunTerminalEvent = VerdictReached | RunFailed | HelpRendered | ManifestRendered;
130
+ type RunTerminalEvent = VerdictReached | RunFailed | HelpRendered;
138
131
  declare const RunCommand_base: S.Class<RunCommand, S.TaggedStruct<"RunCommand", {
139
132
  readonly cliOptionsJson: S.String;
140
133
  readonly targetMutatePatterns: S.$Array<S.String>;
@@ -146,22 +139,22 @@ declare const RunOutput_base: S.Class<RunOutput, S.TaggedStruct<"RunOutput", {
146
139
  }>, {}>;
147
140
  declare class RunOutput extends RunOutput_base {}
148
141
  declare const PlanMutationRunCommand_base: S.Class<PlanMutationRunCommand, S.TaggedStruct<"PlanMutationRunCommand", {
149
- readonly configMutatePatterns: S.$Array<S.String & Wire.Mark> & Wire.Mark;
150
- readonly configMutatorNames: S.$Array<S.String & Wire.Mark> & Wire.Mark;
151
- readonly targetMutatePatterns: S.$Array<S.String & Wire.Mark> & Wire.Mark;
152
- readonly availableMutators: S.$Array<S.String & Wire.Mark> & Wire.Mark;
142
+ readonly configMutatePatterns: S.$Array<S.String>;
143
+ readonly configMutatorNames: S.$Array<S.String>;
144
+ readonly targetMutatePatterns: S.$Array<S.String>;
145
+ readonly availableMutators: S.$Array<S.String>;
153
146
  }>, {}>;
154
147
  declare class PlanMutationRunCommand extends PlanMutationRunCommand_base {}
155
148
  declare const MutationRunPlan_base: S.Class<MutationRunPlan, S.TaggedStruct<"MutationRunPlan", {
156
- readonly mutatePatterns: S.$Array<S.String & Wire.Mark> & Wire.Mark;
157
- readonly mutatorNames: S.$Array<S.String & Wire.Mark> & Wire.Mark;
149
+ readonly mutatePatterns: S.$Array<S.String>;
150
+ readonly mutatorNames: S.$Array<S.String>;
158
151
  }>, {}>;
159
152
  declare class MutationRunPlan extends MutationRunPlan_base {}
160
153
  declare namespace Run_d_exports {
161
- export { Heartbeat, HelpRendered, Location, ManifestRendered, ModeSignal, MutantStatus, MutantTested, MutationRunIo, OutputMode, PhaseEntered, PlanKnown, Position, RunEvent, RunEvent as RunEventType, RunEvents, RunFailed, RunIdentity, RunIdentityShape, RunPhase, RunStarted, RunTerminalEvent, VerdictReached, planMutationRun, runMutationTest, shouldKeepTempDir };
154
+ export { Heartbeat, HelpRendered, Location, ModeSignal, MutantStatus, MutantTested, MutationRunIo, OutputMode, PhaseEntered, PlanKnown, Position, RunEvent, RunEvent as RunEventType, RunEvents, RunFailed, RunIdentity, RunIdentityShape, RunPhase, RunStarted, RunTerminalEvent, VerdictReached, planMutationRun, runMutationTest, shouldKeepTempDir };
162
155
  }
163
156
  declare const planMutationRun: (command: PlanMutationRunCommand) => MutationRunPlan;
164
- declare const RunEvents_base: Context.ServiceClass<RunEvents, "~@systemfsoftware/stryker-js/RunEvents", Queue.Queue<Heartbeat | HelpRendered | ManifestRendered | MutantTested | PhaseEntered | PlanKnown | RunFailed | RunStarted | VerdictReached, Cause.Done<void>>>;
157
+ declare const RunEvents_base: Context.ServiceClass<RunEvents, "~@systemfsoftware/stryker-js/RunEvents", Queue.Queue<Heartbeat | HelpRendered | MutantTested | PhaseEntered | PlanKnown | RunFailed | RunStarted | VerdictReached, Cause.Done<void>>>;
165
158
  declare class RunEvents extends RunEvents_base {}
166
159
  interface RunIdentityShape {
167
160
  readonly runId: string;
@@ -176,4 +169,4 @@ interface MutationRunIo {
176
169
  declare const runMutationTest: (io: MutationRunIo, command: RunCommand) => Effect.Effect<void, S.SchemaError, RunIdentity>;
177
170
  declare const shouldKeepTempDir: (exit: Exit.Exit<void, unknown>, cleanTempDir: 'always' | boolean) => boolean;
178
171
  //#endregion
179
- export { RunStarted as C, RunPhase as S, VerdictReached as T, PhaseEntered as _, Run_d_exports as a, RunEvent as b, shouldKeepTempDir as c, Location as d, ManifestRendered as f, OutputMode as g, MutantTested as h, RunIdentityShape as i, Heartbeat as l, MutantStatus as m, RunEvents as n, planMutationRun as o, ModeSignal as p, RunIdentity as r, runMutationTest as s, MutationRunIo as t, HelpRendered as u, PlanKnown as v, RunTerminalEvent as w, RunFailed as x, Position as y };
172
+ export { RunTerminalEvent as C, RunStarted as S, PlanKnown as _, Run_d_exports as a, RunFailed as b, shouldKeepTempDir as c, Location as d, ModeSignal as f, PhaseEntered as g, OutputMode as h, RunIdentityShape as i, Heartbeat as l, MutantTested as m, RunEvents as n, planMutationRun as o, MutantStatus as p, RunIdentity as r, runMutationTest as s, MutationRunIo as t, HelpRendered as u, Position as v, VerdictReached as w, RunPhase as x, RunEvent as y };
package/dist/Run.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { C as RunStarted, S as RunPhase, T as VerdictReached, _ as PhaseEntered, b as RunEvent, c as shouldKeepTempDir, d as Location, f as ManifestRendered, g as OutputMode, h as MutantTested, i as RunIdentityShape, l as Heartbeat, m as MutantStatus, n as RunEvents, o as planMutationRun, p as ModeSignal, r as RunIdentity, s as runMutationTest, t as MutationRunIo, u as HelpRendered, v as PlanKnown, w as RunTerminalEvent, x as RunFailed, y as Position } from "./Run-BnmGGgWj.mjs";
2
- export { Heartbeat, HelpRendered, type Location, ManifestRendered, ModeSignal, MutantStatus, MutantTested, MutationRunIo, OutputMode, PhaseEntered, PlanKnown, type Position, RunEvent, type RunEvent as RunEventType, RunEvents, RunFailed, RunIdentity, RunIdentityShape, RunPhase, RunStarted, type RunTerminalEvent, VerdictReached, planMutationRun, runMutationTest, shouldKeepTempDir };
1
+ import { C as RunTerminalEvent, S as RunStarted, _ as PlanKnown, b as RunFailed, c as shouldKeepTempDir, d as Location, f as ModeSignal, g as PhaseEntered, h as OutputMode, i as RunIdentityShape, l as Heartbeat, m as MutantTested, n as RunEvents, o as planMutationRun, p as MutantStatus, r as RunIdentity, s as runMutationTest, t as MutationRunIo, u as HelpRendered, v as Position, w as VerdictReached, x as RunPhase, y as RunEvent } from "./Run-BUpNSmcM.mjs";
2
+ export { Heartbeat, HelpRendered, type Location, ModeSignal, MutantStatus, MutantTested, MutationRunIo, OutputMode, PhaseEntered, PlanKnown, type Position, RunEvent, type RunEvent as RunEventType, RunEvents, RunFailed, RunIdentity, RunIdentityShape, RunPhase, RunStarted, type RunTerminalEvent, VerdictReached, planMutationRun, runMutationTest, shouldKeepTempDir };
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-DZve3k2m.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 };