@systemfsoftware/stryker-js 7.0.0 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @systemfsoftware/stryker-js
2
2
 
3
+ ## 9.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - The incremental file now carries `incrementalVersion` (the Stryker package version). Stryker writes it on every incremental run and discards an incremental file it cannot parse or whose `incrementalVersion` differs from the running version, falling back to a full mutation testing run instead of failing. `IncrementalReportSchema` requires `incrementalVersion`, and `decodeIncrementalReport` and `IncrementalReportError` are no longer exported.
8
+
9
+ ## 8.0.0
10
+
11
+ ### Major Changes
12
+
13
+ - The checker request carries a plain data record, not the instrumenter's `Mutant` class. `CheckerRequest.mutants` and `CheckerService.check`/`group` now speak `CheckerMutantWire` - `id`, `fileName`, `mutatorName`, `replacement`, and `location`. A mutant that cannot be described to a checker is skipped instead of reaching it.
14
+
15
+ With `OTEL_ENABLED=true` the CLI now exports its OpenTelemetry metrics to `OTEL_EXPORTER_OTLP_ENDPOINT`, and `OTEL_METRIC_EXPORT_INTERVAL` sets the export interval in milliseconds. Checker timings, mutant counts, and worker crashes now reach a metrics backend.
16
+
17
+ `ConfigEnv` and `resolveExtends` are no longer exported. Import `ConfigEnv` from the config entry point of the package, and read merged options with `loadConfigCell` or `readConfig` from the package root - either performs the `extends` walk, validation and merge in order.
18
+
3
19
  ## 7.0.0
4
20
 
5
21
  ### Major Changes
package/dist/config.d.mts CHANGED
@@ -1,5 +1,15 @@
1
- import { U as StrykerOptions, j as PartialStrykerOptions } from "./output-mode-C5DpB11I.mjs";
2
- import { i as StrykerConfigFn, n as StrykerConfig, r as StrykerConfigExport, t as ConfigEnv } from "./stryker-config-CTcO2hiS.mjs";
1
+ import { L as PartialStrykerOptions, Y as StrykerOptions, n as OutputMode } from "./output-mode-CE6VNHfH.mjs";
2
+ //#region src/config/stryker-config.d.ts
3
+ interface ConfigEnv {
4
+ readonly command: 'run' | 'merge-reports';
5
+ readonly isDryRun: boolean;
6
+ readonly mode: OutputMode;
7
+ readonly isCi: boolean;
8
+ }
9
+ type StrykerConfig = PartialStrykerOptions;
10
+ type StrykerConfigFn = (env: ConfigEnv) => StrykerConfig | Promise<StrykerConfig>;
11
+ type StrykerConfigExport = StrykerConfig | Promise<StrykerConfig> | StrykerConfigFn;
12
+ //#endregion
3
13
  //#region src/config/define-config.d.ts
4
14
  export declare function defineConfig(config: StrykerConfig): StrykerConfig;
5
15
  export declare function defineConfig(config: Promise<StrykerConfig>): Promise<StrykerConfig>;
package/dist/index.d.mts CHANGED
@@ -10,6 +10,7 @@ import * as Exit from 'effect/Exit';
10
10
  import * as FileSystem from 'effect/FileSystem';
11
11
  import * as HashMap from 'effect/HashMap';
12
12
  import * as Layer from 'effect/Layer';
13
+ import * as Metric from 'effect/Metric';
13
14
  import * as MutableHashMap from 'effect/MutableHashMap';
14
15
  import * as MutableHashSet from 'effect/MutableHashSet';
15
16
  import * as Option from 'effect/Option';
@@ -294,10 +295,76 @@ declare const CheckerAnsweredUnrequested_base: S.Class<CheckerAnsweredUnrequeste
294
295
  readonly requestedIds: S.$Array<S.String>;
295
296
  }>, YieldableError>;
296
297
 
298
+ export declare const CheckerCheckResult: S.$Record<S.String, S.Union<readonly [S.Struct<{
299
+ readonly status: S.Literal<"passed">;
300
+ }>, S.Struct<{
301
+ readonly status: S.Literal<"compileError">;
302
+ readonly reason: S.String;
303
+ }>]>>;
304
+
297
305
  export declare type CheckerContractBroken = CheckerAnsweredUnrequested | CheckerSkippedRequested;
298
306
 
299
307
  export declare type CheckerCrash = ChildProcessCrashedError | OutOfMemoryError;
300
308
 
309
+ export declare const checkerDuration: Metric.Histogram<Duration>;
310
+
311
+ export declare class CheckerFailed extends CheckerFailed_base {}
312
+
313
+ declare const CheckerFailed_base: S.Class<CheckerFailed, S.TaggedStruct<"CheckerFailed", {
314
+ readonly cause: S.String;
315
+ readonly checkerName: S.String;
316
+ readonly mutantIds: S.$Array<S.String>;
317
+ }>, YieldableError>;
318
+
319
+ export declare const CheckerGroupResult: S.$Array<S.$Array<S.String>>;
320
+
321
+ export declare const checkerMutantsChecked: Metric.Counter<number>;
322
+
323
+ export declare const checkerMutantsSkipped: Metric.Counter<number>;
324
+
325
+ export declare const CheckerMutantWire: S.Struct<{
326
+ readonly id: S.NonEmptyString;
327
+ readonly fileName: S.NonEmptyString;
328
+ readonly mutatorName: S.NonEmptyString;
329
+ readonly replacement: S.String;
330
+ readonly location: S.Struct<{
331
+ readonly start: S.Struct<{
332
+ readonly line: S.Finite;
333
+ readonly column: S.Finite;
334
+ }>;
335
+ readonly end: S.Struct<{
336
+ readonly line: S.Finite;
337
+ readonly column: S.Finite;
338
+ }>;
339
+ }>;
340
+ }>;
341
+
342
+ export declare type CheckerMutantWire = typeof CheckerMutantWire.Type;
343
+
344
+ export declare const checkerProcessCrashes: Metric.Counter<number>;
345
+
346
+ export declare const CheckerRequest: S.Struct<{
347
+ readonly checkerName: S.String;
348
+ readonly mutants: S.$Array<S.Struct<{
349
+ readonly id: S.NonEmptyString;
350
+ readonly fileName: S.NonEmptyString;
351
+ readonly mutatorName: S.NonEmptyString;
352
+ readonly replacement: S.String;
353
+ readonly location: S.Struct<{
354
+ readonly start: S.Struct<{
355
+ readonly line: S.Finite;
356
+ readonly column: S.Finite;
357
+ }>;
358
+ readonly end: S.Struct<{
359
+ readonly line: S.Finite;
360
+ readonly column: S.Finite;
361
+ }>;
362
+ }>;
363
+ }>>;
364
+ }>;
365
+
366
+ export declare type CheckerRequest = typeof CheckerRequest.Type;
367
+
301
368
  /**
302
369
  * A checker held by the pool.
303
370
  *
@@ -307,17 +374,14 @@ export declare type CheckerCrash = ChildProcessCrashedError | OutOfMemoryError;
307
374
  * which lets the retry combinator prove it handles every one of them.
308
375
  */
309
376
  export declare interface CheckerResourceService {
310
- readonly check: (checkerName: string, mutants: readonly Mutant[]) => Effect.Effect<Record<string, CheckResult>, CheckerCrash>;
311
- /**
312
- * Partition mutants into groups that can be checked together.
313
- *
314
- * A checker with no grouping opinion returns one group per mutant — the
315
- * identity partition — rather than leaving the member off, which is what
316
- * every call site used to synthesise for itself.
317
- */
318
- readonly group: (checkerName: string, mutants: readonly Mutant[]) => Effect.Effect<readonly (readonly string[])[], CheckerCrash>;
377
+ readonly check: (checkerName: string, mutants: readonly CheckerMutantWire[]) => Effect.Effect<Record<string, CheckResult>, CheckerCrash>;
378
+ readonly group: (checkerName: string, mutants: readonly CheckerMutantWire[]) => Effect.Effect<readonly (readonly string[])[], CheckerCrash>;
319
379
  }
320
380
 
381
+ export declare const checkerRpcFailures: Metric.Counter<number>;
382
+
383
+ export declare const CheckerRpcs: RpcGroup.RpcGroup<TracedRpc<'check', typeof CheckerRequest, typeof CheckerCheckResult, typeof CheckerFailed> | TracedRpc<'group', typeof CheckerRequest, typeof CheckerGroupResult, typeof CheckerFailed>>;
384
+
321
385
  export declare class CheckerSkippedRequested extends CheckerSkippedRequested_base {}
322
386
 
323
387
  declare const CheckerSkippedRequested_base: S.Class<CheckerSkippedRequested, S.TaggedStruct<"CheckerSkippedRequested", {
@@ -409,13 +473,6 @@ export declare const CONFIG_SYNTAX_HELP: string;
409
473
 
410
474
  export declare const ConfigDocumentSchema: S.$Record<S.String, S.Unknown>;
411
475
 
412
- export declare interface ConfigEnv {
413
- readonly command: 'run' | 'merge-reports';
414
- readonly isDryRun: boolean;
415
- readonly mode: OutputMode;
416
- readonly isCi: boolean;
417
- }
418
-
419
476
  export declare class ConfigError extends ConfigError_base {
420
477
  readonly exitClass: 'ConfigError';
421
478
  }
@@ -1053,6 +1110,7 @@ declare interface ImportSpecifier extends Span$1 {
1053
1110
  }
1054
1111
 
1055
1112
  export declare const IncrementalReportSchema: S.StructWithRest<S.Struct<{
1113
+ readonly incrementalVersion: S.String;
1056
1114
  readonly schemaVersion: S.String;
1057
1115
  readonly thresholds: S.Struct<{
1058
1116
  readonly high: S.Finite;
@@ -1999,8 +2057,6 @@ export declare interface ResolvedMode {
1999
2057
 
2000
2058
  export declare function resolveExitCode(pending: Iterable<ExitClass>, signal: number | null): number;
2001
2059
 
2002
- export declare function resolveExtends(configFile: string, document: PartialStrykerOptions, configEnv: ConfigEnv): Effect.Effect<PartialStrykerOptions, ConfigFileUnreadableError | ConfigFileInvalidError | ConfigFileUnsupportedError, Path.Path>;
2003
-
2004
2060
  declare interface ReturnStatement$1 extends Span$1 {
2005
2061
  type: "ReturnStatement";
2006
2062
  argument: Expression$1 | null;
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { $ as ConfigFileNotFoundError, $t as ReporterInitOptions, A as mergeConfigs, At as resolveExitCode, B as classifyWorkerExit, Bt as optionsPath, C as spawnReporterWorker, Ct as RunFailed, D as importModule, Dt as VerdictReached, E as forkCoreSchema, Et as RunStarted, F as isCommandRunner, Ft as deepFreeze, G as isVmRunner, Gt as MutantResultSchema, H as OutOfMemoryError, Ht as ExitClass, I as WorkerLauncher, It as defaultOptions, J as vmTestRunner, Jt as MutationTestResultSchema, K as vmRunnerCapabilities, Kt as MutantTested, L as connectRetry, Lt as findUnserializables, M as resolveExtends, Mt as CONFIG_SYNTAX_HELP, N as validateOptions, Nt as SUPPORTED_CONFIG_FILE_NAMES, O as initialExtendsStepState, Ot as EXIT_CODE, P as buildTestRunner, Pt as createDefaultOptions, Q as ConfigFileInvalidError, Qt as ReporterEventBatch, R as makeWorkerClient, Rt as isModuleSpecifier, S as reporterWorkerFactory, St as PlanKnown, T as describeErrors, Tt as RunPhase, U as WorkerBootTimeoutError, Ut as FileResultSchema, V as ChildProcessCrashedError, Vt as DryRunCompleted, W as VmRunner, Wt as MetricsSchema, X as ConfigDocumentSchema, Xt as ReporterAck, Y as StrykerError, Yt as MutationTestingPlanReady, Z as ConfigError, Zt as ReporterDrained, _ as createFileMatcher, _t as RunEvents, a as shouldKeepTempDir, an as LocationSchema, at as ExtendsStepRefused, b as RunEnvironment, bt as HelpRendered, c as buildVerdictEnvelope, cn as PositionSchema, ct as ImportedModuleSchema, d as strykerVersion, dt as ReadConfigCommand, en as ReporterRpcs, et as ConfigFileUnreadableError, f as calculateMetrics, ft as extendsPropertySchema, g as CheckerSkippedRequested, gt as StageError, h as CheckerAnsweredUnrequested, ht as toRelativeNormalizedFileName, i as mutationTestCell, in as WorkerPluginKind, it as ExtendsStepRead, j as readConfig, jt as verdictExitClass, k as loadConfigCell, kt as highestExitClass, l as generateRunId, lt as MergeCommand, m as checkGroupedPlans, mt as survivorsPriorReport, n as RUN_EVENTS_QUEUE_BOUND, nn as TestRunnerConfigSchema, nt as ExtendsStepDocumentSchema, o as ACTIONABLE_STATUSES, on as MutantActivationSchema, ot as ExtendsStepResolve, p as countMutants, pt as forkOptionsSchema, q as vmRunnerName, qt as MutationTestReportReady, r as makeRunLayer, rn as TraceContextMiddleware, rt as ExtendsStepDone, s as VERDICT_ENVELOPE_SCHEMA_VERSION, sn as MutantStatusSchema, st as ExtendsStepStateSchema, t as strykerCell, tn as StrykerOptionsSchema, tt as ConfigFileUnsupportedError, u as isActionableStatus, ut as MergeResult, v as matchesFile, vt as RunIdentity, w as decideExtendsStep, wt as RunMutantTested, x as REPORTER_EVENT_BATCH_BOUND, xt as PhaseEntered, y as IncrementalReportSchema, yt as Heartbeat, z as IdGenerator, zt as isWarningEnabled } from "./src-BY5pFAY5.mjs";
2
- export { ACTIONABLE_STATUSES, CONFIG_SYNTAX_HELP, CheckerAnsweredUnrequested, CheckerSkippedRequested, ChildProcessCrashedError, ConfigDocumentSchema, ConfigError, ConfigFileInvalidError, ConfigFileNotFoundError, ConfigFileUnreadableError, ConfigFileUnsupportedError, DryRunCompleted, EXIT_CODE, ExitClass, ExtendsStepDocumentSchema, ExtendsStepDone, ExtendsStepRead, ExtendsStepRefused, ExtendsStepResolve, ExtendsStepStateSchema, FileResultSchema, Heartbeat, HelpRendered, IdGenerator, ImportedModuleSchema, IncrementalReportSchema, LocationSchema, MergeCommand, MergeResult, MetricsSchema, MutantActivationSchema, MutantResultSchema, MutantStatusSchema, MutantTested, MutationTestReportReady, MutationTestResultSchema, MutationTestingPlanReady, OutOfMemoryError, PhaseEntered, PlanKnown, PositionSchema, REPORTER_EVENT_BATCH_BOUND, RUN_EVENTS_QUEUE_BOUND, ReadConfigCommand, ReporterAck, ReporterDrained, ReporterEventBatch, ReporterInitOptions, ReporterRpcs, RunEnvironment, RunEvents, RunFailed, RunIdentity, RunMutantTested, RunPhase, RunStarted, SUPPORTED_CONFIG_FILE_NAMES, StageError, StrykerError, StrykerOptionsSchema, TestRunnerConfigSchema, TraceContextMiddleware, VERDICT_ENVELOPE_SCHEMA_VERSION, VerdictReached, VmRunner, WorkerBootTimeoutError, WorkerLauncher, WorkerPluginKind, buildTestRunner, buildVerdictEnvelope, calculateMetrics, checkGroupedPlans, classifyWorkerExit, connectRetry, countMutants, createDefaultOptions, createFileMatcher, decideExtendsStep, deepFreeze, defaultOptions, describeErrors, extendsPropertySchema, findUnserializables, forkCoreSchema, forkOptionsSchema, generateRunId, highestExitClass, importModule, initialExtendsStepState, isActionableStatus, isCommandRunner, isModuleSpecifier, isVmRunner, isWarningEnabled, loadConfigCell, makeRunLayer, makeWorkerClient, matchesFile, mergeConfigs, mutationTestCell, optionsPath, readConfig, reporterWorkerFactory, resolveExitCode, resolveExtends, shouldKeepTempDir, spawnReporterWorker, strykerCell, strykerVersion, survivorsPriorReport, toRelativeNormalizedFileName, validateOptions, verdictExitClass, vmRunnerCapabilities, vmRunnerName, vmTestRunner };
1
+ import { $ as StrykerError, $t as FileResultSchema, A as describeErrors, At as RunStarted, B as WorkerLauncher, Bt as defaultOptions, C as strykerVersion, Ct as Heartbeat, D as reporterWorkerFactory, Dt as RunFailed, E as REPORTER_EVENT_BATCH_BOUND, Et as PlanKnown, F as mergeConfigs, Ft as verdictExitClass, G as ChildProcessCrashedError, Gt as CheckerCheckResult, H as makeWorkerClient, Ht as isModuleSpecifier, I as readConfig, It as CONFIG_SYNTAX_HELP, J as VmRunner, Jt as CheckerMutantWire, K as OutOfMemoryError, Kt as CheckerFailed, L as validateOptions, Lt as SUPPORTED_CONFIG_FILE_NAMES, M as importModule, Mt as EXIT_CODE, N as initialExtendsStepState, Nt as highestExitClass, O as spawnReporterWorker, Ot as RunMutantTested, P as loadConfigCell, Pt as resolveExitCode, Q as vmTestRunner, Qt as ExitClass, R as buildTestRunner, Rt as createDefaultOptions, S as matchesFile, St as RunIdentity, T as RunEnvironment, Tt as PhaseEntered, U as IdGenerator, Ut as isWarningEnabled, V as connectRetry, Vt as findUnserializables, W as classifyWorkerExit, Wt as optionsPath, X as vmRunnerCapabilities, Xt as CheckerRpcs, Y as isVmRunner, Yt as CheckerRequest, Z as vmRunnerName, Zt as DryRunCompleted, _ as checkerProcessCrashes, _n as MutantStatusSchema, _t as forkOptionsSchema, a as shouldKeepTempDir, an as MutationTestingPlanReady, at as ConfigFileUnsupportedError, b as CheckerSkippedRequested, bt as StageError, c as buildVerdictEnvelope, cn as ReporterEventBatch, ct as ExtendsStepRead, d as calculateMetrics, dn as StrykerOptionsSchema, dt as ExtendsStepStateSchema, en as MetricsSchema, et as ConfigDocumentSchema, f as countMutants, fn as TestRunnerConfigSchema, ft as ImportedModuleSchema, g as checkerMutantsSkipped, gn as MutantActivationSchema, gt as extendsPropertySchema, h as checkerMutantsChecked, hn as LocationSchema, ht as ReadConfigCommand, i as mutationTestCell, in as MutationTestResultSchema, it as ConfigFileUnreadableError, j as forkCoreSchema, jt as VerdictReached, k as decideExtendsStep, kt as RunPhase, l as generateRunId, ln as ReporterInitOptions, lt as ExtendsStepRefused, m as checkerDuration, mn as WorkerPluginKind, mt as MergeResult, n as RUN_EVENTS_QUEUE_BOUND, nn as MutantTested, nt as ConfigFileInvalidError, o as ACTIONABLE_STATUSES, on as ReporterAck, ot as ExtendsStepDocumentSchema, p as checkGroupedPlans, pn as TraceContextMiddleware, pt as MergeCommand, q as WorkerBootTimeoutError, qt as CheckerGroupResult, r as makeRunLayer, rn as MutationTestReportReady, rt as ConfigFileNotFoundError, s as VERDICT_ENVELOPE_SCHEMA_VERSION, sn as ReporterDrained, st as ExtendsStepDone, t as strykerCell, tn as MutantResultSchema, tt as ConfigError, u as isActionableStatus, un as ReporterRpcs, ut as ExtendsStepResolve, v as checkerRpcFailures, vn as PositionSchema, vt as survivorsPriorReport, w as IncrementalReportSchema, wt as HelpRendered, x as createFileMatcher, xt as RunEvents, y as CheckerAnsweredUnrequested, yt as toRelativeNormalizedFileName, z as isCommandRunner, zt as deepFreeze } from "./src-BQuaL-fB.mjs";
2
+ export { ACTIONABLE_STATUSES, CONFIG_SYNTAX_HELP, CheckerAnsweredUnrequested, CheckerCheckResult, CheckerFailed, CheckerGroupResult, CheckerMutantWire, CheckerRequest, CheckerRpcs, CheckerSkippedRequested, ChildProcessCrashedError, ConfigDocumentSchema, ConfigError, ConfigFileInvalidError, ConfigFileNotFoundError, ConfigFileUnreadableError, ConfigFileUnsupportedError, DryRunCompleted, EXIT_CODE, ExitClass, ExtendsStepDocumentSchema, ExtendsStepDone, ExtendsStepRead, ExtendsStepRefused, ExtendsStepResolve, ExtendsStepStateSchema, FileResultSchema, Heartbeat, HelpRendered, IdGenerator, ImportedModuleSchema, IncrementalReportSchema, LocationSchema, MergeCommand, MergeResult, MetricsSchema, MutantActivationSchema, MutantResultSchema, MutantStatusSchema, MutantTested, MutationTestReportReady, MutationTestResultSchema, MutationTestingPlanReady, OutOfMemoryError, PhaseEntered, PlanKnown, PositionSchema, REPORTER_EVENT_BATCH_BOUND, RUN_EVENTS_QUEUE_BOUND, ReadConfigCommand, ReporterAck, ReporterDrained, ReporterEventBatch, ReporterInitOptions, ReporterRpcs, RunEnvironment, RunEvents, RunFailed, RunIdentity, RunMutantTested, RunPhase, RunStarted, SUPPORTED_CONFIG_FILE_NAMES, StageError, StrykerError, StrykerOptionsSchema, TestRunnerConfigSchema, TraceContextMiddleware, VERDICT_ENVELOPE_SCHEMA_VERSION, VerdictReached, VmRunner, WorkerBootTimeoutError, WorkerLauncher, WorkerPluginKind, buildTestRunner, buildVerdictEnvelope, calculateMetrics, checkGroupedPlans, checkerDuration, checkerMutantsChecked, checkerMutantsSkipped, checkerProcessCrashes, checkerRpcFailures, classifyWorkerExit, connectRetry, countMutants, createDefaultOptions, createFileMatcher, decideExtendsStep, deepFreeze, defaultOptions, describeErrors, extendsPropertySchema, findUnserializables, forkCoreSchema, forkOptionsSchema, generateRunId, highestExitClass, importModule, initialExtendsStepState, isActionableStatus, isCommandRunner, isModuleSpecifier, isVmRunner, isWarningEnabled, loadConfigCell, makeRunLayer, makeWorkerClient, matchesFile, mergeConfigs, mutationTestCell, optionsPath, readConfig, reporterWorkerFactory, resolveExitCode, shouldKeepTempDir, spawnReporterWorker, strykerCell, strykerVersion, survivorsPriorReport, toRelativeNormalizedFileName, validateOptions, verdictExitClass, vmRunnerCapabilities, vmRunnerName, vmTestRunner };