@systemfsoftware/stryker-js 0.1.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 (47) hide show
  1. package/CHANGELOG.md +126 -0
  2. package/LICENSE +213 -0
  3. package/README.md +32 -0
  4. package/dist/Checker-Bq8NXD8d.mjs +25 -0
  5. package/dist/Checker-DYgIIEai.d.mts +40 -0
  6. package/dist/Checker.d.mts +2 -0
  7. package/dist/Checker.mjs +2 -0
  8. package/dist/Evaluator-DLVXUcVj.d.mts +19 -0
  9. package/dist/Evaluator.d.mts +3 -0
  10. package/dist/Evaluator.mjs +9 -0
  11. package/dist/ExitClass.d.mts +8 -0
  12. package/dist/ExitClass.mjs +34 -0
  13. package/dist/ExitClass.schema-BmCUn2Sm.d.mts +6 -0
  14. package/dist/Ignorer-BUY68FZQ.d.mts +21 -0
  15. package/dist/Ignorer.d.mts +2 -0
  16. package/dist/Ignorer.mjs +7 -0
  17. package/dist/Mutant-BPRJTF8f.d.mts +351 -0
  18. package/dist/Mutant.d.mts +2 -0
  19. package/dist/Mutant.mjs +114 -0
  20. package/dist/Mutant.schema-BTWhFTk4.mjs +34 -0
  21. package/dist/Plugin-Ceh1G8Dz.mjs +117 -0
  22. package/dist/Plugin-ZYNaWrl7.d.mts +134 -0
  23. package/dist/Plugin.d.mts +2 -0
  24. package/dist/Plugin.mjs +2 -0
  25. package/dist/Reporter-COVWW1my.mjs +33 -0
  26. package/dist/Reporter-eZ3M7lO6.d.mts +83 -0
  27. package/dist/Reporter.d.mts +2 -0
  28. package/dist/Reporter.mjs +2 -0
  29. package/dist/Run-BudLsVwF.d.mts +183 -0
  30. package/dist/Run-lXratlN7.mjs +225 -0
  31. package/dist/Run.d.mts +2 -0
  32. package/dist/Run.mjs +2 -0
  33. package/dist/Schema-C7nahULg.mjs +249 -0
  34. package/dist/Schema-Df2kA6F7.d.mts +159 -0
  35. package/dist/Schema.d.mts +2 -0
  36. package/dist/Schema.mjs +2 -0
  37. package/dist/TestRunner-DC9U8Unb.mjs +181 -0
  38. package/dist/TestRunner.d.mts +2 -0
  39. package/dist/TestRunner.mjs +2 -0
  40. package/dist/index.d.mts +8 -0
  41. package/dist/index.mjs +9 -0
  42. package/dist/output-file.d.mts +8 -0
  43. package/dist/output-file.mjs +8 -0
  44. package/dist/provided-options.d.mts +16 -0
  45. package/dist/provided-options.mjs +1 -0
  46. package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
  47. package/package.json +70 -0
@@ -0,0 +1,134 @@
1
+ import { n as Checker } from "./Checker-DYgIIEai.mjs";
2
+ import { J as TestRunner } from "./Mutant-BPRJTF8f.mjs";
3
+ import { t as Evaluator } from "./Evaluator-DLVXUcVj.mjs";
4
+ import { t as Ignorer } from "./Ignorer-BUY68FZQ.mjs";
5
+ import { c as Reporter } from "./Reporter-eZ3M7lO6.mjs";
6
+ import * as Context from "effect/Context";
7
+ import * as S from "effect/Schema";
8
+ import * as Layer from "effect/Layer";
9
+ import * as Option from "effect/Option";
10
+ import * as FileSystem from "effect/FileSystem";
11
+ import * as Path from "effect/Path";
12
+ //#region src/Plugin.schema.d.ts
13
+ declare const PluginKind: S.Literals<readonly ["Checker", "TestRunner", "Reporter", "Ignore", "Evaluator"]>;
14
+ type PluginKind = typeof PluginKind.Type;
15
+ declare const PluginContribution_base: S.Class<PluginContribution<"Checker" | "Evaluator" | "Ignore" | "Reporter" | "TestRunner">, S.TaggedStruct<"PluginContribution", {
16
+ readonly kind: S.Literals<readonly ["Checker", "TestRunner", "Reporter", "Ignore", "Evaluator"]>;
17
+ readonly name: S.String;
18
+ readonly layer: S.Unknown;
19
+ }>, {}>;
20
+ declare class PluginContribution<K extends PluginKind = PluginKind> extends PluginContribution_base {
21
+ readonly kind: K;
22
+ readonly name: string;
23
+ readonly layer: Layer.Layer<PluginInterfaces[K], never, PluginEnvironment>;
24
+ }
25
+ declare const Shadowing_base: S.Class<Shadowing, S.TaggedStruct<"Shadowing", {
26
+ readonly kind: S.String;
27
+ readonly name: S.String;
28
+ readonly shadowedIndex: S.Finite;
29
+ readonly winnerIndex: S.Finite;
30
+ }>, {}>;
31
+ declare class Shadowing extends Shadowing_base {}
32
+ declare namespace Plugin_d_exports {
33
+ export { AnyPluginContribution, ComposedPlugins, ContributionOf, MergedPluginServices, PluginContribution, PluginEnvironment, PluginInterfaces, PluginKind, RunConfiguration, SandboxDirectory, Shadowing, composePlugins, declarePlugin };
34
+ }
35
+ declare const RunConfiguration_base: Context.ServiceClass<RunConfiguration, "~@systemfsoftware/stryker-js/RunConfiguration", {
36
+ readonly [x: string]: unknown;
37
+ readonly allowConsoleColors: boolean;
38
+ readonly buildCommand?: string | undefined;
39
+ readonly checkers: readonly string[];
40
+ readonly checkerNodeArgs: readonly string[];
41
+ readonly concurrency?: string | number | undefined;
42
+ readonly commandRunner: {
43
+ readonly [x: string]: unknown;
44
+ readonly command: string;
45
+ };
46
+ readonly coverageAnalysis: "all" | "off" | "perTest";
47
+ readonly clearTextReporter: {
48
+ readonly [x: string]: unknown;
49
+ readonly allowColor: boolean;
50
+ readonly allowEmojis: boolean;
51
+ readonly logTests: boolean;
52
+ readonly maxTestsToLog: number;
53
+ readonly reportTests: boolean;
54
+ readonly reportMutants: boolean;
55
+ readonly reportScoreTable: boolean;
56
+ readonly skipFull: boolean;
57
+ };
58
+ readonly dryRunOnly: boolean;
59
+ readonly ignorePatterns: readonly string[];
60
+ readonly ignoreStatic: boolean;
61
+ readonly incremental: boolean;
62
+ readonly incrementalFile: string;
63
+ readonly force: boolean;
64
+ readonly fileLogLevel: "debug" | "error" | "fatal" | "info" | "off" | "trace" | "warn";
65
+ readonly inPlace: boolean;
66
+ readonly logLevel: "debug" | "error" | "fatal" | "info" | "off" | "trace" | "warn";
67
+ readonly maxConcurrentTestRunners: number;
68
+ readonly maxTestRunnerReuse: number;
69
+ readonly mutate: readonly string[];
70
+ readonly mutator: {
71
+ readonly plugins: readonly (string | readonly unknown[])[] | null;
72
+ readonly excludedMutations: readonly string[];
73
+ };
74
+ readonly packageManager?: "npm" | "pnpm" | "yarn" | undefined;
75
+ readonly plugins: readonly string[];
76
+ readonly appendPlugins: readonly string[];
77
+ readonly reporters: readonly string[];
78
+ readonly htmlReporter: {
79
+ readonly fileName: string;
80
+ };
81
+ readonly jsonReporter: {
82
+ readonly fileName: string;
83
+ };
84
+ readonly disableTypeChecks: string | boolean;
85
+ readonly symlinkNodeModules: boolean;
86
+ readonly tempDirName: string;
87
+ readonly cleanTempDir: "always" | boolean;
88
+ readonly testRunner: string;
89
+ readonly testRunnerNodeArgs: readonly string[];
90
+ readonly thresholds: {
91
+ readonly high: number;
92
+ readonly low: number;
93
+ readonly break: number | null;
94
+ };
95
+ readonly timeoutFactor: number;
96
+ readonly timeoutMS: number;
97
+ readonly dryRunTimeoutMinutes: number;
98
+ readonly tsconfigFile: string;
99
+ readonly warnings: boolean | {
100
+ readonly [x: string]: unknown;
101
+ readonly unknownOptions: boolean;
102
+ readonly preprocessorErrors: boolean;
103
+ readonly unserializableOptions: boolean;
104
+ readonly slow: boolean;
105
+ };
106
+ readonly disableBail: boolean;
107
+ readonly allowEmpty: boolean;
108
+ readonly ignorers: readonly string[];
109
+ readonly testFiles: readonly string[];
110
+ }>;
111
+ declare class RunConfiguration extends RunConfiguration_base {}
112
+ declare const SandboxDirectory_base: Context.ServiceClass<SandboxDirectory, "~@systemfsoftware/stryker-js/SandboxDirectory", string>;
113
+ declare class SandboxDirectory extends SandboxDirectory_base {}
114
+ interface PluginInterfaces {
115
+ Checker: Checker;
116
+ TestRunner: TestRunner;
117
+ Reporter: Reporter;
118
+ Ignore: Ignorer;
119
+ Evaluator: Evaluator;
120
+ }
121
+ type PluginEnvironment = RunConfiguration | SandboxDirectory | FileSystem.FileSystem | Path.Path;
122
+ type AnyPluginContribution = { [K in PluginKind]: PluginContribution<K>; }[PluginKind];
123
+ type ContributionOf<K extends PluginKind> = Extract<AnyPluginContribution, {
124
+ readonly kind: K;
125
+ }>;
126
+ declare function declarePlugin<K extends PluginKind>(kind: K, name: string, layer: Layer.Layer<PluginInterfaces[K], never, PluginEnvironment>): PluginContribution<K>;
127
+ type MergedPluginServices = Checker & Ignorer & Reporter & TestRunner;
128
+ interface ComposedPlugins {
129
+ readonly layer: Option.Option<Layer.Layer<MergedPluginServices, never, PluginEnvironment>>;
130
+ readonly shadowings: readonly Shadowing[];
131
+ }
132
+ declare function composePlugins(contributions: readonly AnyPluginContribution[]): ComposedPlugins;
133
+ //#endregion
134
+ export { PluginEnvironment as a, RunConfiguration as c, declarePlugin as d, PluginContribution as f, MergedPluginServices as i, SandboxDirectory as l, Shadowing as m, ComposedPlugins as n, PluginInterfaces as o, PluginKind as p, ContributionOf as r, Plugin_d_exports as s, AnyPluginContribution as t, composePlugins as u };
@@ -0,0 +1,2 @@
1
+ import { a as PluginEnvironment, c as RunConfiguration, d as declarePlugin, f as PluginContribution, i as MergedPluginServices, l as SandboxDirectory, m as Shadowing, n as ComposedPlugins, o as PluginInterfaces, p as PluginKind, r as ContributionOf, t as AnyPluginContribution, u as composePlugins } from "./Plugin-ZYNaWrl7.mjs";
2
+ export { AnyPluginContribution, ComposedPlugins, ContributionOf, MergedPluginServices, PluginContribution, PluginEnvironment, PluginInterfaces, PluginKind, RunConfiguration, SandboxDirectory, Shadowing, composePlugins, declarePlugin };
@@ -0,0 +1,2 @@
1
+ import { a as declarePlugin, c as Shadowing, i as composePlugins, n as RunConfiguration, o as PluginContribution, r as SandboxDirectory, s as PluginKind } from "./Plugin-Ceh1G8Dz.mjs";
2
+ export { PluginContribution, PluginKind, RunConfiguration, SandboxDirectory, Shadowing, composePlugins, declarePlugin };
@@ -0,0 +1,33 @@
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 };
@@ -0,0 +1,83 @@
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 };
@@ -0,0 +1,2 @@
1
+ import { a as MutationTestMetricsResult, c as Reporter, d as RunTiming, f as TestMetrics, h as ReporterFailed, i as MetricsResult, l as ReporterService, m as broadcastReporter, n as DryRunCompletedEvent, o as MutationTestingPlanReadyEvent, p as TestRunnerCapabilities, r as Metrics, s as NamedReporter, t as CompleteDryRunResultForReporter } from "./Reporter-eZ3M7lO6.mjs";
2
+ export { CompleteDryRunResultForReporter, DryRunCompletedEvent, Metrics, MetricsResult, MutationTestMetricsResult, MutationTestingPlanReadyEvent, NamedReporter, Reporter, ReporterFailed, ReporterService, RunTiming, TestMetrics, TestRunnerCapabilities, broadcastReporter };
@@ -0,0 +1,2 @@
1
+ import { i as ReporterFailed, r as broadcastReporter, t as Reporter } from "./Reporter-COVWW1my.mjs";
2
+ export { Reporter, ReporterFailed, broadcastReporter };
@@ -0,0 +1,183 @@
1
+ import * as Context from "effect/Context";
2
+ import * as S from "effect/Schema";
3
+ import * as Effect from "effect/Effect";
4
+ import { Wire, Workflow } from "@systemfsoftware/effect-cell-types";
5
+ import * as Exit from "effect/Exit";
6
+ import "effect/Result";
7
+ import * as Cause from "effect/Cause";
8
+ import * as Queue from "effect/Queue";
9
+ //#region src/Run.schema.d.ts
10
+ declare const RunPhase: S.Literals<readonly ["prepare", "instrument", "dry-run", "mutation-test"]>;
11
+ type RunPhase = typeof RunPhase.Type;
12
+ declare const OutputMode: S.Literals<readonly ["human", "machine"]>;
13
+ type OutputMode = typeof OutputMode.Type;
14
+ declare const ModeSignal: S.Literals<readonly ["flag", "env", "tty", "agent", "tool"]>;
15
+ type ModeSignal = typeof ModeSignal.Type;
16
+ declare const MutantStatus: S.Literals<readonly ["Killed", "Survived", "NoCoverage", "Timeout", "CompileError", "RuntimeError", "Ignored", "Pending"]>;
17
+ type MutantStatus = typeof MutantStatus.Type;
18
+ declare const Position: S.Struct<{
19
+ line: S.Finite & Wire.Mark;
20
+ column: S.Finite & Wire.Mark;
21
+ }> & Wire.Mark;
22
+ declare const Location: S.Struct<{
23
+ start: S.Struct<{
24
+ line: S.Finite & Wire.Mark;
25
+ column: S.Finite & Wire.Mark;
26
+ }> & Wire.Mark;
27
+ end: S.Struct<{
28
+ line: S.Finite & Wire.Mark;
29
+ column: S.Finite & Wire.Mark;
30
+ }> & Wire.Mark;
31
+ }> & Wire.Mark;
32
+ type Location = typeof Location.Type;
33
+ type Position = typeof Position.Type;
34
+ declare const RunStarted_base: S.Class<RunStarted, S.TaggedStruct<"stream", {
35
+ readonly schemaVersion: S.String & Wire.Mark;
36
+ readonly runId: S.String & Wire.Mark;
37
+ readonly mode: S.Literals<readonly ["human", "machine"]>;
38
+ readonly signal: S.Literals<readonly ["flag", "env", "tty", "agent", "tool"]>;
39
+ }>, {}>;
40
+ declare class RunStarted extends RunStarted_base {}
41
+ declare const PhaseEntered_base: S.Class<PhaseEntered, S.TaggedStruct<"phase", {
42
+ readonly phase: S.Literals<readonly ["prepare", "instrument", "dry-run", "mutation-test"]>;
43
+ readonly elapsedMs: S.Finite & Wire.Mark;
44
+ }>, {}>;
45
+ declare class PhaseEntered extends PhaseEntered_base {}
46
+ declare const PlanKnown_base: S.Class<PlanKnown, S.TaggedStruct<"plan", {
47
+ readonly total: S.Finite & Wire.Mark;
48
+ }>, {}>;
49
+ declare class PlanKnown extends PlanKnown_base {}
50
+ declare const MutantTested_base: S.Class<MutantTested, S.TaggedStruct<"mutant", {
51
+ readonly id: S.String & Wire.Mark;
52
+ readonly status: S.Literals<readonly ["Killed", "Survived", "NoCoverage", "Timeout", "CompileError", "RuntimeError", "Ignored", "Pending"]>;
53
+ readonly file: S.String & Wire.Mark;
54
+ readonly location: S.Struct<{
55
+ start: S.Struct<{
56
+ line: S.Finite & Wire.Mark;
57
+ column: S.Finite & Wire.Mark;
58
+ }> & Wire.Mark;
59
+ end: S.Struct<{
60
+ line: S.Finite & Wire.Mark;
61
+ column: S.Finite & Wire.Mark;
62
+ }> & Wire.Mark;
63
+ }> & Wire.Mark;
64
+ readonly mutator: S.String & Wire.Mark;
65
+ readonly replacement: S.NullOr<S.String & Wire.Mark> & Wire.Mark;
66
+ readonly completed: S.Finite & Wire.Mark;
67
+ readonly total: S.Finite & Wire.Mark;
68
+ }>, {}>;
69
+ declare class MutantTested extends MutantTested_base {}
70
+ declare const Heartbeat_base: S.Class<Heartbeat, S.TaggedStruct<"tick", {
71
+ readonly elapsedMs: S.Finite & Wire.Mark;
72
+ readonly completed: S.Finite & Wire.Mark;
73
+ readonly total: S.NullOr<S.Finite & Wire.Mark> & Wire.Mark;
74
+ }>, {}>;
75
+ declare class Heartbeat extends Heartbeat_base {}
76
+ declare const VerdictReached_base: S.Class<VerdictReached, S.TaggedStruct<"verdict", {
77
+ readonly schemaVersion: S.String & Wire.Mark;
78
+ readonly runId: S.String & Wire.Mark;
79
+ readonly mode: S.Literals<readonly ["human", "machine"]>;
80
+ readonly signal: S.Literals<readonly ["flag", "env", "tty", "agent", "tool"]>;
81
+ readonly score: S.NullOr<S.Finite & Wire.Mark> & Wire.Mark;
82
+ readonly thresholds: S.Struct<{
83
+ high: S.Finite & Wire.Mark;
84
+ low: S.Finite & Wire.Mark;
85
+ break: S.NullOr<S.Finite & Wire.Mark> & Wire.Mark;
86
+ }> & Wire.Mark;
87
+ readonly reportFile: S.NullOr<S.String & Wire.Mark> & Wire.Mark;
88
+ readonly counts: S.Struct<{
89
+ killed: S.Finite & Wire.Mark;
90
+ timeout: S.Finite & Wire.Mark;
91
+ survived: S.Finite & Wire.Mark;
92
+ noCoverage: S.Finite & Wire.Mark;
93
+ runtimeErrors: S.Finite & Wire.Mark;
94
+ compileErrors: S.Finite & Wire.Mark;
95
+ ignored: S.Finite & Wire.Mark;
96
+ pending: S.Finite & Wire.Mark;
97
+ }> & Wire.Mark;
98
+ readonly mutants: S.$Array<S.Struct<{
99
+ readonly id: S.String & Wire.Mark;
100
+ readonly file: S.String & Wire.Mark;
101
+ readonly location: S.Struct<{
102
+ start: S.Struct<{
103
+ line: S.Finite & Wire.Mark;
104
+ column: S.Finite & Wire.Mark;
105
+ }> & Wire.Mark;
106
+ end: S.Struct<{
107
+ line: S.Finite & Wire.Mark;
108
+ column: S.Finite & Wire.Mark;
109
+ }> & Wire.Mark;
110
+ }> & Wire.Mark;
111
+ readonly mutator: S.String & Wire.Mark;
112
+ readonly replacement: S.NullOr<S.String & Wire.Mark> & Wire.Mark;
113
+ readonly status: S.Literals<readonly ["Killed", "Survived", "NoCoverage", "Timeout", "CompileError", "RuntimeError", "Ignored", "Pending"]>;
114
+ }>>;
115
+ }>, {}>;
116
+ declare class VerdictReached extends VerdictReached_base {}
117
+ declare const RunFailed_base: S.Class<RunFailed, S.TaggedStruct<"error", {
118
+ readonly schemaVersion: S.String & Wire.Mark;
119
+ readonly code: S.Finite & Wire.Mark;
120
+ readonly error: S.String & Wire.Mark;
121
+ readonly remediation: S.String & Wire.Mark;
122
+ }>, {}>;
123
+ declare class RunFailed extends RunFailed_base {}
124
+ declare const HelpRendered_base: S.Class<HelpRendered, S.TaggedStruct<"help", {
125
+ readonly schemaVersion: S.String & Wire.Mark;
126
+ readonly code: S.Literals<readonly [0]> & Wire.Mark;
127
+ readonly help: S.String & Wire.Mark;
128
+ }>, {}>;
129
+ declare class HelpRendered extends HelpRendered_base {}
130
+ declare const ManifestRendered_base: S.Class<ManifestRendered, S.TaggedStruct<"manifest", {
131
+ readonly schemaVersion: S.String & Wire.Mark;
132
+ readonly code: S.Literals<readonly [0]> & Wire.Mark;
133
+ readonly manifest: S.String & Wire.Mark;
134
+ }>, {}>;
135
+ declare class ManifestRendered extends ManifestRendered_base {}
136
+ declare const RunEvent: S.Union<readonly [typeof RunStarted, typeof PhaseEntered, typeof PlanKnown, typeof MutantTested, typeof Heartbeat, typeof VerdictReached, typeof RunFailed, typeof HelpRendered, typeof ManifestRendered]>;
137
+ type RunEvent = typeof RunEvent.Type;
138
+ type RunTerminalEvent = VerdictReached | RunFailed | HelpRendered | ManifestRendered;
139
+ declare const RunCommand_base: S.Class<RunCommand, S.TaggedStruct<"RunCommand", {
140
+ readonly cliOptionsJson: S.String;
141
+ readonly targetMutatePatterns: S.$Array<S.String>;
142
+ }>, {}>;
143
+ declare class RunCommand extends RunCommand_base {}
144
+ declare const RunOutput_base: S.Class<RunOutput, S.TaggedStruct<"RunOutput", {
145
+ readonly verdictJson: S.String;
146
+ readonly exitCode: S.Finite;
147
+ }>, {}>;
148
+ declare class RunOutput extends RunOutput_base {}
149
+ //#endregion
150
+ //#region src/Run.workflow.d.ts
151
+ declare const PlanMutationRunError_base: S.Class<PlanMutationRunError, S.TaggedStruct<"PlanMutationRunError", {
152
+ readonly message: S.String;
153
+ readonly detail: S.String;
154
+ }>, import("effect/Cause").YieldableError>;
155
+ declare class PlanMutationRunError extends PlanMutationRunError_base {}
156
+ declare namespace Run_d_exports {
157
+ 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, runMutationTest, shouldKeepTempDir };
158
+ }
159
+ 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>>>;
160
+ /**
161
+ * Where a run's events go.
162
+ *
163
+ * The error channel carries `Cause.Done`, the graceful completion signal: a finished run
164
+ * ends the queue, and `Stream.fromQueue` excludes `Done` from its own error channel, so the
165
+ * consumer sees end-of-stream. Interrupting the queue instead would end it with an
166
+ * interrupt cause, and joining the drain would then re-raise that into the caller and lose
167
+ * the exit code the run had already decided.
168
+ */
169
+ declare class RunEvents extends RunEvents_base {}
170
+ interface RunIdentityShape {
171
+ readonly runId: string;
172
+ readonly basePath: string;
173
+ }
174
+ declare const RunIdentity_base: Context.ServiceClass<RunIdentity, "~@systemfsoftware/stryker-js/RunIdentity", RunIdentityShape>;
175
+ declare class RunIdentity extends RunIdentity_base {}
176
+ interface MutationRunIo {
177
+ readonly read: (command: RunCommand) => Effect.Effect<unknown, S.SchemaError, RunIdentity>;
178
+ readonly write: (output: RunOutput) => Effect.Effect<void, S.SchemaError, RunIdentity>;
179
+ }
180
+ declare const runMutationTest: (io: MutationRunIo, command: RunCommand) => Effect.Effect<void, S.SchemaError, RunIdentity>;
181
+ declare const shouldKeepTempDir: (exit: Exit.Exit<void, PlanMutationRunError | S.SchemaError>, cleanTempDir: 'always' | boolean) => boolean;
182
+ //#endregion
183
+ export { RunTerminalEvent as C, RunStarted as S, PlanKnown as _, Run_d_exports as a, RunFailed as b, Heartbeat as c, ManifestRendered as d, ModeSignal as f, PhaseEntered as g, OutputMode as h, RunIdentityShape as i, HelpRendered as l, MutantTested as m, RunEvents as n, runMutationTest as o, MutantStatus as p, RunIdentity as r, shouldKeepTempDir as s, MutationRunIo as t, Location as u, Position as v, VerdictReached as w, RunPhase as x, RunEvent as y };
@@ -0,0 +1,225 @@
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
+ import { Cell, Wire, Workflow } from "@systemfsoftware/effect-cell-types";
6
+ import * as Exit from "effect/Exit";
7
+ import { pipe } from "effect/Function";
8
+ import * as Result from "effect/Result";
9
+ //#region src/Run.schema.ts
10
+ const RunPhase = S.Literals([
11
+ "prepare",
12
+ "instrument",
13
+ "dry-run",
14
+ "mutation-test"
15
+ ]);
16
+ const OutputMode = S.Literals(["human", "machine"]);
17
+ const ModeSignal = S.Literals([
18
+ "flag",
19
+ "env",
20
+ "tty",
21
+ "agent",
22
+ "tool"
23
+ ]);
24
+ const MutantStatus = S.Literals([
25
+ "Killed",
26
+ "Survived",
27
+ "NoCoverage",
28
+ "Timeout",
29
+ "CompileError",
30
+ "RuntimeError",
31
+ "Ignored",
32
+ "Pending"
33
+ ]);
34
+ const Position = Wire.wire({
35
+ line: Wire.mint(S.Finite),
36
+ column: Wire.mint(S.Finite)
37
+ });
38
+ const Location = Wire.wire({
39
+ start: Position,
40
+ end: Position
41
+ });
42
+ var RunStarted = class extends S.TaggedClass()("stream", {
43
+ schemaVersion: Wire.mint(S.String),
44
+ runId: Wire.mint(S.String),
45
+ mode: OutputMode,
46
+ signal: ModeSignal
47
+ }) {};
48
+ var PhaseEntered = class extends S.TaggedClass()("phase", {
49
+ phase: RunPhase,
50
+ elapsedMs: Wire.mint(S.Finite)
51
+ }) {};
52
+ var PlanKnown = class extends S.TaggedClass()("plan", { total: Wire.mint(S.Finite) }) {};
53
+ var MutantTested = class extends S.TaggedClass()("mutant", {
54
+ id: Wire.mint(S.String),
55
+ status: MutantStatus,
56
+ file: Wire.mint(S.String),
57
+ location: Location,
58
+ mutator: Wire.mint(S.String),
59
+ replacement: Wire.mint(S.NullOr(Wire.mint(S.String))),
60
+ completed: Wire.mint(S.Finite),
61
+ total: Wire.mint(S.Finite)
62
+ }) {};
63
+ var Heartbeat = class extends S.TaggedClass()("tick", {
64
+ elapsedMs: Wire.mint(S.Finite),
65
+ completed: Wire.mint(S.Finite),
66
+ total: Wire.mint(S.NullOr(Wire.mint(S.Finite)))
67
+ }) {};
68
+ const VerdictThresholds = Wire.wire({
69
+ high: Wire.mint(S.Finite),
70
+ low: Wire.mint(S.Finite),
71
+ break: Wire.mint(S.NullOr(Wire.mint(S.Finite)))
72
+ });
73
+ const VerdictMutant = S.Struct({
74
+ id: Wire.mint(S.String),
75
+ file: Wire.mint(S.String),
76
+ location: Location,
77
+ mutator: Wire.mint(S.String),
78
+ replacement: Wire.mint(S.NullOr(Wire.mint(S.String))),
79
+ status: MutantStatus
80
+ });
81
+ const VerdictCounts = Wire.wire({
82
+ killed: Wire.mint(S.Finite),
83
+ timeout: Wire.mint(S.Finite),
84
+ survived: Wire.mint(S.Finite),
85
+ noCoverage: Wire.mint(S.Finite),
86
+ runtimeErrors: Wire.mint(S.Finite),
87
+ compileErrors: Wire.mint(S.Finite),
88
+ ignored: Wire.mint(S.Finite),
89
+ pending: Wire.mint(S.Finite)
90
+ });
91
+ var VerdictReached = class extends S.TaggedClass()("verdict", {
92
+ schemaVersion: Wire.mint(S.String),
93
+ runId: Wire.mint(S.String),
94
+ mode: OutputMode,
95
+ signal: ModeSignal,
96
+ score: Wire.mint(S.NullOr(Wire.mint(S.Finite))),
97
+ thresholds: VerdictThresholds,
98
+ reportFile: Wire.mint(S.NullOr(Wire.mint(S.String))),
99
+ counts: VerdictCounts,
100
+ mutants: S.Array(VerdictMutant)
101
+ }) {};
102
+ var RunFailed = class extends S.TaggedClass()("error", {
103
+ schemaVersion: Wire.mint(S.String),
104
+ code: Wire.mint(S.Finite),
105
+ error: Wire.mint(S.String),
106
+ remediation: Wire.mint(S.String)
107
+ }) {};
108
+ var HelpRendered = class extends S.TaggedClass()("help", {
109
+ schemaVersion: Wire.mint(S.String),
110
+ code: Wire.mint(S.Literals([0])),
111
+ help: Wire.mint(S.String)
112
+ }) {};
113
+ var ManifestRendered = class extends S.TaggedClass()("manifest", {
114
+ schemaVersion: Wire.mint(S.String),
115
+ code: Wire.mint(S.Literals([0])),
116
+ manifest: Wire.mint(S.String)
117
+ }) {};
118
+ const RunEvent = S.Union([
119
+ RunStarted,
120
+ PhaseEntered,
121
+ PlanKnown,
122
+ MutantTested,
123
+ Heartbeat,
124
+ VerdictReached,
125
+ RunFailed,
126
+ HelpRendered,
127
+ ManifestRendered
128
+ ]);
129
+ S.TaggedClass()("RunCommand", {
130
+ cliOptionsJson: S.String,
131
+ targetMutatePatterns: S.Array(S.String)
132
+ });
133
+ var RunOutput = class extends S.TaggedClass()("RunOutput", {
134
+ verdictJson: S.String,
135
+ exitCode: S.Finite
136
+ }) {};
137
+ S.TaggedError()("RunDecodeError", { message: S.String });
138
+ S.TaggedError()("RunReadError", { message: S.String });
139
+ S.TaggedError()("RunWriteError", { message: S.String });
140
+ //#endregion
141
+ //#region src/Run.workflow.ts
142
+ var PlanMutationRunCommand = class extends S.TaggedClass()("PlanMutationRunCommand", {
143
+ configMutatePatterns: Wire.mint(S.Array(Wire.mint(S.String))),
144
+ configMutatorNames: Wire.mint(S.Array(Wire.mint(S.String))),
145
+ targetMutatePatterns: Wire.mint(S.Array(Wire.mint(S.String))),
146
+ availableMutators: Wire.mint(S.Array(Wire.mint(S.String)))
147
+ }) {};
148
+ var MutationRunPlan = class extends S.TaggedClass()("MutationRunPlan", {
149
+ mutatePatterns: Wire.mint(S.Array(Wire.mint(S.String))),
150
+ mutatorNames: Wire.mint(S.Array(Wire.mint(S.String)))
151
+ }) {};
152
+ S.TaggedError()("PlanMutationRunError", {
153
+ message: S.String,
154
+ detail: S.String
155
+ });
156
+ const selectMutatePatterns = (target, fallback) => {
157
+ if (target.length > 0) return [...target];
158
+ return [...fallback];
159
+ };
160
+ const selectMutatorNames = (available, fallback) => {
161
+ if (available.length > 0) return [...available];
162
+ return [...fallback];
163
+ };
164
+ const decidePlan = (command) => {
165
+ const mutatePatterns = selectMutatePatterns(command.targetMutatePatterns, command.configMutatePatterns);
166
+ const mutatorNames = selectMutatorNames(command.availableMutators, command.configMutatorNames);
167
+ return Result.succeed(MutationRunPlan.make({
168
+ mutatePatterns,
169
+ mutatorNames
170
+ }));
171
+ };
172
+ const planMutationRun = Workflow.make(PlanMutationRunCommand, (command) => decidePlan(command));
173
+ //#endregion
174
+ //#region src/Run.ts
175
+ var Run_exports = /* @__PURE__ */ __exportAll({
176
+ Heartbeat: () => Heartbeat,
177
+ HelpRendered: () => HelpRendered,
178
+ ManifestRendered: () => ManifestRendered,
179
+ ModeSignal: () => ModeSignal,
180
+ MutantStatus: () => MutantStatus,
181
+ MutantTested: () => MutantTested,
182
+ OutputMode: () => OutputMode,
183
+ PhaseEntered: () => PhaseEntered,
184
+ PlanKnown: () => PlanKnown,
185
+ RunEvent: () => RunEvent,
186
+ RunEvents: () => RunEvents,
187
+ RunFailed: () => RunFailed,
188
+ RunIdentity: () => RunIdentity,
189
+ RunPhase: () => RunPhase,
190
+ RunStarted: () => RunStarted,
191
+ VerdictReached: () => VerdictReached,
192
+ runMutationTest: () => runMutationTest,
193
+ shouldKeepTempDir: () => shouldKeepTempDir
194
+ });
195
+ /**
196
+ * Where a run's events go.
197
+ *
198
+ * The error channel carries `Cause.Done`, the graceful completion signal: a finished run
199
+ * ends the queue, and `Stream.fromQueue` excludes `Done` from its own error channel, so the
200
+ * consumer sees end-of-stream. Interrupting the queue instead would end it with an
201
+ * interrupt cause, and joining the drain would then re-raise that into the caller and lose
202
+ * the exit code the run had already decided.
203
+ */
204
+ var RunEvents = class extends Context.Service()("~@systemfsoftware/stryker-js/RunEvents") {};
205
+ var RunIdentity = class extends Context.Service()("~@systemfsoftware/stryker-js/RunIdentity") {};
206
+ const mutationRunDescription = (io, services) => pipe(Cell.read((command) => Effect.provideContext(io.read(command), services)), Cell.decode((raw) => S.decodeUnknownResult(PlanMutationRunCommand)(raw)), Cell.decide(planMutationRun), Cell.encode((outcome) => Result.match(outcome, {
207
+ onFailure: (error) => new RunOutput({
208
+ verdictJson: JSON.stringify({ error: error.message }),
209
+ exitCode: 1
210
+ }),
211
+ onSuccess: (plan) => new RunOutput({
212
+ verdictJson: JSON.stringify({
213
+ mutate: plan.mutatePatterns,
214
+ mutators: plan.mutatorNames
215
+ }),
216
+ exitCode: 0
217
+ })
218
+ })), Cell.write((output) => Effect.provideContext(io.write(output), services)));
219
+ const runMutationTest = (io, command) => Effect.gen(function* () {
220
+ const services = yield* Effect.context();
221
+ return yield* Cell.apply(mutationRunDescription(io, services), command);
222
+ });
223
+ const shouldKeepTempDir = (exit, cleanTempDir) => Exit.isFailure(exit) && cleanTempDir !== "always";
224
+ //#endregion
225
+ export { RunPhase as _, shouldKeepTempDir as a, ManifestRendered as c, MutantTested as d, OutputMode as f, RunFailed as g, RunEvent as h, runMutationTest as i, ModeSignal as l, PlanKnown as m, RunIdentity as n, Heartbeat as o, PhaseEntered as p, Run_exports as r, HelpRendered as s, RunEvents as t, MutantStatus as u, RunStarted as v, VerdictReached as y };