@systemfsoftware/stryker-js 10.1.0 → 10.1.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @systemfsoftware/stryker-js
2
2
 
3
+ ## 10.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Exported declarations that previously took `unknown` now take a defaulted type parameter: calls that omit the type argument are unchanged, and calls that were previously rejected for passing an unconstrained value are accepted. No runtime behaviour changes.
8
+
3
9
  ## 10.1.0
4
10
 
5
11
  ### Minor Changes
@@ -3107,24 +3107,29 @@ const COMMENT_KEYS = /* @__PURE__ */ new Set(["leadingComments", "trailingCommen
3107
3107
  function isCommentKey(key) {
3108
3108
  return typeof key === "string" && COMMENT_KEYS.has(key);
3109
3109
  }
3110
+ function walkTraverse(root, stack, visitors) {
3111
+ walk(walkableNode(root), {
3112
+ enter(node, _parent, context) {
3113
+ readPath(stack, node, this, context, visitors);
3114
+ },
3115
+ leave(_node, _parent, context) {
3116
+ closePath(stack, context, visitors);
3117
+ }
3118
+ });
3119
+ }
3120
+ const toTraverseError = (error) => error instanceof Error ? error : new Error("Traversal failed", { cause: error });
3121
+ const handleTraverseError = (error) => {
3122
+ const err = toTraverseError(error);
3123
+ if (!S.is(TraversalStopped)(err)) throw err;
3124
+ };
3110
3125
  function traverse(root, visitors) {
3111
3126
  const stack = [];
3112
3127
  try {
3113
- walk(walkableNode(root), {
3114
- enter(node, _parent, context) {
3115
- readPath(stack, node, this, context, visitors);
3116
- },
3117
- leave(_node, _parent, context) {
3118
- closePath(stack, context, visitors);
3119
- }
3120
- });
3128
+ walkTraverse(root, stack, visitors);
3121
3129
  } catch (error) {
3122
- rethrowUnlessStopped(error);
3130
+ handleTraverseError(error);
3123
3131
  }
3124
3132
  }
3125
- const rethrowUnlessStopped = (error) => {
3126
- if (!S.is(TraversalStopped)(error)) throw error;
3127
- };
3128
3133
  const readPath = (stack, node, controls, context, visitors) => {
3129
3134
  if (isCommentKey(context.key)) return;
3130
3135
  const path = createPath(node, parentOf(stack), controls, context);
@@ -3192,7 +3197,7 @@ function writeInto(parent, key, index, replacement) {
3192
3197
  writeAtKey(parent, key, index, replacement);
3193
3198
  }
3194
3199
  function writeAtKey(parent, key, index, replacement) {
3195
- Match.value(key).pipe(Match.when(Predicate.isString, (slot) => writeAtSlot(parent, slot, index, replacement)), Match.orElse(() => void 0));
3200
+ if (Predicate.isString(key)) writeAtSlot(parent, key, index, replacement);
3196
3201
  }
3197
3202
  function writeAtSlot(parent, key, index, replacement) {
3198
3203
  Match.value(index).pipe(Match.when(Match.null, () => overwrite(parent, key, replacement)), Match.orElse((position) => writeElement(parent[key], position, replacement)));
@@ -3272,17 +3277,16 @@ function isRangedBaseNode(value) {
3272
3277
  function isNonEmptyArray(value) {
3273
3278
  return Array.isArray(value) && value.length > 0;
3274
3279
  }
3275
- function hasField(value, key) {
3276
- return isPlainRecord(value) && key in value;
3277
- }
3278
- function hasContent(value) {
3279
- return hasField(value, "content");
3280
+ function hasContentField(value) {
3281
+ return isPlainRecord(value) && "content" in value;
3280
3282
  }
3281
- function hasHtml(value) {
3282
- return hasField(value, "html");
3283
+ function hasHtmlField(value) {
3284
+ return isPlainRecord(value) && "html" in value;
3283
3285
  }
3286
+ const readRecordField = (record, key) => record[key];
3284
3287
  function fieldOf$1(value, key) {
3285
- return Match.value(value).pipe(Match.when(isPlainRecord, (record) => record[key]), Match.orElse(() => void 0));
3288
+ if (!isPlainRecord(value)) return void 0;
3289
+ return readRecordField(value, key);
3286
3290
  }
3287
3291
  function appendIfDefined(values, value) {
3288
3292
  if (value !== void 0) values.push(value);
@@ -3557,12 +3561,12 @@ function isTextRange(value) {
3557
3561
  function isTemplateExpressionTag(value) {
3558
3562
  return isTypedRecord(value) && TEMPLATE_EXPRESSION_TYPES[value["type"]] === true;
3559
3563
  }
3560
- /**
3561
- * The first child of a `<script>` element node. A template `<script>` tag
3562
- * carries its code as that single `Text` child.
3563
- */
3564
+ const firstChild = (element) => {
3565
+ const children = element["children"];
3566
+ return isNonEmptyArray(children) ? Option.getOrUndefined(Arr.head(children)) : void 0;
3567
+ };
3564
3568
  function scriptChild(node) {
3565
- return Match.value(node).pipe(Match.when(isScriptElement, (element) => Match.value(element["children"]).pipe(Match.when(isNonEmptyArray, (values) => Option.getOrUndefined(Arr.head(values))), Match.orElse(() => void 0))), Match.orElse(() => void 0));
3569
+ return isScriptElement(node) ? firstChild(node) : void 0;
3566
3570
  }
3567
3571
  function tryGetScriptRangeFromElement(node) {
3568
3572
  return Match.value(scriptChild(node)).pipe(Match.when(isTextRange, (range) => ({
@@ -3572,14 +3576,14 @@ function tryGetScriptRangeFromElement(node) {
3572
3576
  })), Match.orElse(() => void 0));
3573
3577
  }
3574
3578
  function templateExpressionRange(node) {
3575
- return Match.value(node).pipe(Match.when(isTemplateExpressionTag, (tag) => rangedExpressionOf(tag["expression"])), Match.orElse(() => void 0));
3579
+ return isTemplateExpressionTag(node) ? rangedExpressionOf(node["expression"]) : void 0;
3576
3580
  }
3577
3581
  function rangedExpressionOf(payload) {
3578
- return Match.value(payload).pipe(Match.when(isRangedBaseNode, (expression) => ({
3579
- start: expression.start,
3580
- end: expression.end,
3582
+ if (isRangedBaseNode(payload)) return {
3583
+ start: payload.start,
3584
+ end: payload.end,
3581
3585
  isExpression: true
3582
- })), Match.orElse(() => void 0));
3586
+ };
3583
3587
  }
3584
3588
  /**
3585
3589
  * Allow instrumentation of Svelte 5 projects without dropping support for Svelte 4.
@@ -3591,9 +3595,10 @@ const loadWalker = (version, fileName) => Match.value(isAtLeast(version, SVELTE_
3591
3595
  * The specifier is chosen at run time and both modules are optional peers of
3592
3596
  * this package, so neither can be a static import.
3593
3597
  */
3598
+ const findWalker = (module) => isRecordWithWalk(module) ? module.walk : void 0;
3594
3599
  const loadWalkerModule = (specifier, fileName, cause) => Effect$1.gen(function* () {
3595
3600
  const module = yield* Effect$1.promise(() => import(specifier));
3596
- const walk = Match.value(module).pipe(Match.when(isRecordWithWalk, (record) => record.walk), Match.orElse(() => void 0));
3601
+ const walk = findWalker(module);
3597
3602
  if (walk === void 0) return yield* SvelteWalkerNotFound.make({
3598
3603
  fileName,
3599
3604
  cause
@@ -3668,29 +3673,31 @@ function getTemplateScriptRanges(ast, walker) {
3668
3673
  return ranges;
3669
3674
  }
3670
3675
  function htmlRootOf(ast) {
3671
- return Match.value(ast).pipe(Match.when(hasHtml, (record) => record["html"]), Match.orElse(() => {
3672
- throw new Error("Svelte AST without html");
3673
- }));
3676
+ if (!hasHtmlField(ast)) throw new Error("Svelte AST without html");
3677
+ return ast["html"];
3674
3678
  }
3675
3679
  function instanceScriptRange(ast) {
3676
- return Match.value(fieldOf$1(ast, "instance")).pipe(Match.when(hasContent, (instance) => scriptContentRange(instance["content"], INSTANCE_RANGE_MISSING)), Match.orElse(() => void 0));
3680
+ const record = contentFieldOf(fieldOf$1(ast, "instance"));
3681
+ return record === void 0 ? void 0 : scriptContentRange(record["content"], INSTANCE_RANGE_MISSING);
3677
3682
  }
3678
3683
  function scriptContentRange(content, missingRange) {
3679
- return Match.value(content).pipe(Match.when(isRange, (range) => ({
3680
- start: range.start,
3681
- end: range.end,
3684
+ if (isRange(content)) return {
3685
+ start: content.start,
3686
+ end: content.end,
3682
3687
  isExpression: false
3683
- })), Match.orElse(() => {
3684
- throw new Error(missingRange);
3685
- }));
3688
+ };
3689
+ throw new Error(missingRange);
3686
3690
  }
3687
3691
  function getModuleScriptRange(svelteAst) {
3688
3692
  return Match.value(fieldOf$1(svelteAst, "module")).pipe(Match.when(void 0, () => void 0), Match.when(null, () => void 0), Match.orElse((block) => moduleBlockRange(block)));
3689
3693
  }
3694
+ function contentFieldOf(value) {
3695
+ return Option.getOrUndefined(Option.filter(Option.fromNullishOr(value), hasContentField));
3696
+ }
3690
3697
  function moduleBlockRange(block) {
3691
- return Match.value(block).pipe(Match.when(hasContent, (record) => scriptContentRange(record["content"], MODULE_RANGE_MISSING)), Match.orElse(() => {
3692
- throw new Error(MODULE_RANGE_MISSING);
3693
- }));
3698
+ const record = contentFieldOf(block);
3699
+ if (record === void 0) throw new Error(MODULE_RANGE_MISSING);
3700
+ return scriptContentRange(record["content"], MODULE_RANGE_MISSING);
3694
3701
  }
3695
3702
  /**
3696
3703
  * Remaps script locations back to the original places using the script map
@@ -5888,16 +5895,19 @@ function literalWithoutRegex(node) {
5888
5895
  return valueLiteralText(node.value);
5889
5896
  }
5890
5897
  function valueLiteralText(value) {
5891
- switch (typeof value) {
5892
- case "string": return JSON.stringify(value);
5893
- case "number": return String(value);
5894
- case "boolean": return String(value);
5895
- case "bigint": return `${value}n`;
5896
- case "symbol":
5897
- case "undefined":
5898
- case "object":
5899
- case "function": return "null";
5900
- }
5898
+ if (typeof value === "string") return JSON.stringify(value);
5899
+ return nonStringLiteralText(value);
5900
+ }
5901
+ function nonStringLiteralText(value) {
5902
+ if (typeof value === "number") return String(value);
5903
+ return booleanOrBigintText(value);
5904
+ }
5905
+ function booleanOrBigintText(value) {
5906
+ if (typeof value === "boolean") return String(value);
5907
+ return bigintText(value);
5908
+ }
5909
+ function bigintText(value) {
5910
+ return typeof value === "bigint" ? `${value}n` : "null";
5901
5911
  }
5902
5912
  function flagText(present, text) {
5903
5913
  switch (Boolean(present)) {
@@ -5949,13 +5959,12 @@ const HASHBANG_FIELDS = {
5949
5959
  function isHashbang(value) {
5950
5960
  return Predicate.isObject(value) && Object.entries(HASHBANG_FIELDS).every(([key, accepts]) => accepts(value[key]));
5951
5961
  }
5952
- const hashbangOf = (root) => {
5953
- const hashbang = Reflect.get(root, "hashbang");
5954
- if (!isHashbang(hashbang)) return null;
5955
- return hashbang;
5956
- };
5957
- const jsPrint = (file) => printProgram(file.root, { hashbang: hashbangOf(file.root) });
5958
- const tsPrint = (file) => printProgram(file.root, { hashbang: hashbangOf(file.root) });
5962
+ const toHashbang = (hashbang) => isHashbang(hashbang) ? hashbang : null;
5963
+ function getHashbang(root) {
5964
+ return toHashbang("hashbang" in root ? root.hashbang : null);
5965
+ }
5966
+ const jsPrint = (file) => printProgram(file.root, { hashbang: getHashbang(file.root) });
5967
+ const tsPrint = (file) => printProgram(file.root, { hashbang: getHashbang(file.root) });
5959
5968
  function getScriptStart$1(script) {
5960
5969
  const span = spanOf(script.root);
5961
5970
  if (span === void 0) throw new Error("Script AST root without start");
@@ -6019,9 +6028,14 @@ function normalizeFileName(fileName) {
6019
6028
  }
6020
6029
  const hasText = (value) => Predicate.isString(value) && value.length > 0;
6021
6030
  const textIfNonEmpty = (value) => Option.getOrUndefined(Option.filter(Option.fromUndefinedOr(value), hasText));
6022
- const fieldOf = (value, key) => Match.value(key in value).pipe(Match.when(true, () => {
6023
- return Reflect.get(value, key);
6024
- }), Match.orElse(() => void 0));
6031
+ function readFieldOf(record, key) {
6032
+ return record[key];
6033
+ }
6034
+ const hasFieldIn = (value, key) => key in value;
6035
+ const fieldOf = (value, key) => {
6036
+ if (!hasFieldIn(value, key)) return;
6037
+ return readFieldOf(value, key);
6038
+ };
6025
6039
  const hasStringCode = (error) => Match.value(fieldOf(error, "code")).pipe(Match.when(Match.string, () => true), Match.orElse(() => false));
6026
6040
  function isErrnoException(error) {
6027
6041
  return Match.value(error).pipe(Match.when(Match.instanceOf(Error), hasStringCode), Match.orElse(() => false));
@@ -6046,7 +6060,7 @@ const isNonPlaceholderText = (text) => Match.value({
6046
6060
  isPlaceholder: false
6047
6061
  }, () => true), Match.orElse(() => false));
6048
6062
  const isUsableText = (value) => Match.value(value).pipe(Match.when(Match.string, isNonPlaceholderText), Match.orElse(() => false));
6049
- const usableText = (value) => Match.value(value).pipe(Match.when(isUsableText, (text) => text), Match.orElse(() => ""));
6063
+ const usableText = (value) => isUsableText(value) ? value : "";
6050
6064
  const objectToStringText = (value) => Match.value(fieldOf(value, "toString")).pipe(Match.when(Match.instanceOf(Function), (callable) => {
6051
6065
  try {
6052
6066
  return usableText(Reflect.apply(callable, value, []));
@@ -6055,9 +6069,19 @@ const objectToStringText = (value) => Match.value(fieldOf(value, "toString")).pi
6055
6069
  }
6056
6070
  }), Match.orElse(() => ""));
6057
6071
  const isObjectType = (cause) => typeof cause === "object";
6058
- const toStringText = (error) => Match.value(error).pipe(Match.when(Match.null, () => ""), Match.when(isObjectType, (value) => objectToStringText(value)), Match.orElse(() => ""));
6059
- const stringifyRest = (error) => Match.value(jsonText(error)).pipe(Match.when(hasText, (json) => json), Match.orElse(() => toStringText(error)));
6060
- const stringifyNonError = (error) => Match.value(error).pipe(Match.when(Match.string, (text) => text), Match.when(isJsonPrimitive, (primitive) => JSON.stringify(primitive)), Match.orElse(() => stringifyRest(error)));
6072
+ const isNonNullObjectType = (error) => error !== null && isObjectType(error);
6073
+ const toStringText = (error) => isNonNullObjectType(error) ? objectToStringText(error) : "";
6074
+ const stringifyRest = (error) => {
6075
+ const json = jsonText(error);
6076
+ return hasText(json) ? json : toStringText(error);
6077
+ };
6078
+ function primitiveJsonOf(error) {
6079
+ return isJsonPrimitive(error) ? JSON.stringify(error) : void 0;
6080
+ }
6081
+ const stringifyNonError = (error) => typeof error === "string" ? error : nonStringTextOf(error);
6082
+ function nonStringTextOf(error) {
6083
+ return primitiveJsonOf(error) ?? stringifyRest(error);
6084
+ }
6061
6085
  const errorText = (error) => Match.value(error).pipe(Match.when(isErrnoException, formatErrnoException), Match.orElse(() => formatError(error)));
6062
6086
  function errorToString(error) {
6063
6087
  return Match.value(error).pipe(Match.when(isEmptyError, () => ""), Match.when(Match.instanceOf(Error), errorText), Match.orElse(() => stringifyNonError(error)));
@@ -6349,9 +6373,10 @@ function withOperator(node, operator) {
6349
6373
  function mutantsWhen(holds, build) {
6350
6374
  return Match.value(holds).pipe(Match.when(true, build), Match.orElse(() => NO_MUTANTS));
6351
6375
  }
6352
- /** A named property of a node that may or may not carry it. */
6376
+ const hasPropertyIn = (node, key) => key in node;
6377
+ const readPropertyOf = (node, key) => hasPropertyIn(node, key) ? node[key] : void 0;
6353
6378
  function propertyOf(node, key) {
6354
- return Match.value(node).pipe(Match.when((candidate) => Predicate.hasProperty(candidate, key), (host) => host[key]), Match.orElse(() => void 0));
6379
+ return Predicate.isObject(node) ? readPropertyOf(node, key) : void 0;
6355
6380
  }
6356
6381
  function isIdentifier(node) {
6357
6382
  return nodeType(node) === "Identifier";
@@ -7415,7 +7440,8 @@ function frozenContainer(value) {
7415
7440
  freezableChildren(object).forEach((child) => {
7416
7441
  deepFreeze(child);
7417
7442
  });
7418
- return Object.freeze(object);
7443
+ Object.freeze(object);
7444
+ return value;
7419
7445
  });
7420
7446
  }
7421
7447
  function freezableChildren(value) {
@@ -1,4 +1,4 @@
1
- import { C as Metrics, _ as ExitClass } from "./index-BopuZXrl.mjs";
1
+ import { C as Metrics, _ as ExitClass } from "./index-CogNSD0V.mjs";
2
2
  import * as S from "effect/Schema";
3
3
  //#region src/RunEvent.schema.d.ts
4
4
  declare const RunPhase: S.Literals<readonly ["prepare", "instrument", "dry-run", "mutation-test"]>;
package/dist/config.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { K as StrykerOptions, P as PartialStrykerOptions } from "./index-BopuZXrl.mjs";
1
+ import { K as StrykerOptions, P as PartialStrykerOptions } from "./index-CogNSD0V.mjs";
2
2
  import { n as OutputMode } from "./output-mode-CfGHDpi5.mjs";
3
3
  //#region src/config/stryker-config.d.ts
4
4
  interface ConfigEnv {
package/dist/config.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as mergeConfig } from "./merge-config-BrrNQWje.mjs";
1
+ import { t as mergeConfig } from "./merge-config-CHZWyvVQ.mjs";
2
2
  //#region src/config/define-config.ts
3
3
  function defineConfig(config) {
4
4
  return config;
package/dist/events.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { S as VerdictThresholds, _ as RunStarted, a as ModeSignal, b as VerdictMutant, c as PhaseEntered, d as RunDecodeError, f as RunEvent, g as RunReadError, h as RunPhase, i as HelpRendered, l as PlanKnown, m as RunMutantTested, n as StageError, o as MutationRunPlan, p as RunFailed, r as Heartbeat, s as OutputMode, t as PrepareError, u as PlanMutationRunCommand, x as VerdictReached, y as VerdictCounts } from "./Run.schema-RWUb38ZE.mjs";
1
+ import { S as VerdictThresholds, _ as RunStarted, a as ModeSignal, b as VerdictMutant, c as PhaseEntered, d as RunDecodeError, f as RunEvent, g as RunReadError, h as RunPhase, i as HelpRendered, l as PlanKnown, m as RunMutantTested, n as StageError, o as MutationRunPlan, p as RunFailed, r as Heartbeat, s as OutputMode, t as PrepareError, u as PlanMutationRunCommand, x as VerdictReached, y as VerdictCounts } from "./Run.schema-BsSOfQnD.mjs";
2
2
  export { Heartbeat, HelpRendered, ModeSignal, MutationRunPlan, OutputMode, PhaseEntered, PlanKnown, PlanMutationRunCommand, PrepareError, RunDecodeError, RunEvent, RunFailed, RunMutantTested, RunPhase, RunReadError, RunStarted, StageError, type VerdictCounts, type VerdictMutant, VerdictReached, type VerdictThresholds };
package/dist/events.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import { _ as RunStarted, a as ModeSignal, c as PhaseEntered, d as RunDecodeError, f as RunEvent, g as RunReadError, h as RunPhase, i as HelpRendered, l as PlanKnown, m as RunMutantTested, n as StageError, o as MutationRunPlan, p as RunFailed, r as Heartbeat, s as OutputMode, t as PrepareError, u as PlanMutationRunCommand, v as VerdictReached } from "./Run.schema-B0ERLxQj.mjs";
1
+ import { _ as RunStarted, a as ModeSignal, c as PhaseEntered, d as RunDecodeError, f as RunEvent, g as RunReadError, h as RunPhase, i as HelpRendered, l as PlanKnown, m as RunMutantTested, n as StageError, o as MutationRunPlan, p as RunFailed, r as Heartbeat, s as OutputMode, t as PrepareError, u as PlanMutationRunCommand, v as VerdictReached } from "./Run.schema-B_KpPeBA.mjs";
2
2
  export { Heartbeat, HelpRendered, ModeSignal, MutationRunPlan, OutputMode, PhaseEntered, PlanKnown, PlanMutationRunCommand, PrepareError, RunDecodeError, RunEvent, RunFailed, RunMutantTested, RunPhase, RunReadError, RunStarted, StageError, VerdictReached };
@@ -8,11 +8,12 @@ import * as RpcGroup from "effect/unstable/rpc/RpcGroup";
8
8
  import * as RpcMiddleware from "effect/unstable/rpc/RpcMiddleware";
9
9
  import * as HashMap from "effect/HashMap";
10
10
  import { YieldableError } from "effect/Cause";
11
+ import { JsonSchema } from "effect/JsonSchema";
11
12
  import { StandardSchemaV1 } from "effect/StandardSchema";
12
13
  declare namespace index_d_exports$1 {
13
14
  export { Coverage, CoverageData, CoveragePerTestId, ERROR_CODES, EarlyResultPlan, ErrnoException, File_2 as File, FileDescription, FileDescriptions, INSTRUMENTER_CONSTANTS, InstrumentError, InstrumentResult, InstrumenterContext, InstrumenterOptions, InstrumenterOptionsSchema, Location, LocationSchema, Mutant, MutantActivation, MutantActivationSchema, MutantCoverage, MutantEarlyResultPlan, MutantRunOptions, MutantRunOptionsSchema, MutantRunPlan, MutantStatus, MutantStatusSchema, MutantTestCoverage, MutantTestPlan, MutateDescription, MutationRange, OpenEndLocation, OpenEndLocationSchema, ParserOptions, Position, PositionSchema, RunMutantResult, RunOptions, RunOptionsFields, RunPlan, TestPlan, causeText, disableTypeChecks, errorToString, instrument, isErrnoException, isMutant, normalizeFileName };
14
15
  }
15
- declare const causeText: (cause: unknown, depth: number) => string | undefined;
16
+ declare const causeText: <A = unknown>(cause: A, depth: number) => string | undefined;
16
17
  declare interface Coverage {
17
18
  readonly static: CoverageData;
18
19
  readonly perTest: CoveragePerTestId;
@@ -33,7 +34,7 @@ declare interface ErrnoException extends Error {
33
34
  declare const ERROR_CODES: Readonly<{
34
35
  NoSuchFileOrDirectory: 'ENOENT';
35
36
  }>;
36
- declare function errorToString(error: unknown): string;
37
+ declare function errorToString<A = unknown>(error: A): string;
37
38
  declare interface File_2 extends FileDescription {
38
39
  name: string;
39
40
  content: string;
@@ -317,7 +318,7 @@ declare const CoverageAnalysisSchema: S.Literals<readonly ["off", "all", "perTes
317
318
  * caller CONSTRUCTS by assignment, so `readonly` is stripped. The decoded
318
319
  * `StrykerOptions` keeps it - that side is read, never built.
319
320
  */
320
- declare type DeepOptional<T> = { -readonly [P in keyof T]?: T[P] extends Record<string, unknown> ? DeepOptional<T[P]> | undefined : T[P]; };
321
+ declare type DeepOptional<T, V = unknown> = { -readonly [P in keyof T]?: T[P] extends Record<string, V> ? DeepOptional<T[P], V> | undefined : T[P]; };
321
322
  declare type Dependencies = typeof DependenciesSchema.Type;
322
323
  declare const DependenciesSchema: S.$Record<S.String, S.String>;
323
324
  declare const DetectedStatus: S.Union<readonly [S.Literal<"Killed">, S.Literal<"Timeout">]>;
@@ -858,7 +859,7 @@ declare const ReporterEventBatch: S.$Array<S.Union<readonly [typeof DryRunComple
858
859
  declare type ReporterEventBatch = typeof ReporterEventBatch.Type;
859
860
  declare const ReporterEventKind: S.Literals<readonly ["dryRunCompleted", "mutationTestingPlanReady", "mutantTested", "mutationTestReportReady"]>;
860
861
  declare type ReporterEventKind = typeof ReporterEventKind.Type;
861
- declare const ReporterEventSchema: StandardSchemaV1<unknown, ReporterEvent>;
862
+ declare const ReporterEventSchema: StandardSchemaV1<typeof ReporterEventUnion['Encoded'], ReporterEvent>;
862
863
  declare const ReporterEventUnion: S.Union<readonly [typeof DryRunCompleted, typeof MutationTestingPlanReady, typeof MutantTested, typeof MutationTestReportReady]>;
863
864
  declare type ReporterFactory = (options: StrykerOptions, init: ReporterInit) => (events: AsyncIterable<ReporterEvent>) => Effect$1.Effect<void, ReporterFailed>;
864
865
  declare class ReporterFailed extends ReporterFailed_base {}
@@ -905,7 +906,7 @@ declare interface SkippedTestResult extends BaseTestResult {
905
906
  * one is a schema - the generated law suite does exactly that, and a document
906
907
  * handed to `toEncoded` takes the whole suite down with it.
907
908
  */
908
- declare const strykerCoreSchema: Record<string, unknown>;
909
+ declare const strykerCoreSchema: JsonSchema;
909
910
  /** The decoded type: every defaulted option is present. */
910
911
  declare type StrykerOptions = S.Schema.Type<typeof StrykerOptionsSchema>;
911
912
  declare const StrykerOptionsSchema: S.StructWithRest<S.Struct<{
package/dist/index.d.mts CHANGED
@@ -9,6 +9,7 @@ import * as EffectDuration from 'effect/Duration';
9
9
  import * as Exit from 'effect/Exit';
10
10
  import * as FileSystem from 'effect/FileSystem';
11
11
  import * as HashMap from 'effect/HashMap';
12
+ import { JsonSchema } from 'effect/JsonSchema';
12
13
  import * as Layer from 'effect/Layer';
13
14
  import * as Metric from 'effect/Metric';
14
15
  import * as MutableHashMap from 'effect/MutableHashMap';
@@ -563,7 +564,7 @@ export declare function deepFreeze<T>(target: T): Immutable<T>;
563
564
  * caller CONSTRUCTS by assignment, so `readonly` is stripped. The decoded
564
565
  * `StrykerOptions` keeps it - that side is read, never built.
565
566
  */
566
- export declare type DeepOptional<T> = { -readonly [P in keyof T]?: T[P] extends Record<string, unknown> ? DeepOptional<T[P]> | undefined : T[P]; };
567
+ export declare type DeepOptional<T, V = unknown> = { -readonly [P in keyof T]?: T[P] extends Record<string, V> ? DeepOptional<T[P], V> | undefined : T[P]; };
567
568
 
568
569
  export declare const defaultOptions: Effect.Effect<Immutable<StrykerOptions>, never, never>;
569
570
 
@@ -829,7 +830,7 @@ export declare const FileResultSchema: S.Struct<{
829
830
  }>>;
830
831
  }>;
831
832
 
832
- export declare function findUnserializables(thing: unknown): UnserializableDescription[] | undefined;
833
+ export declare function findUnserializables<A = unknown>(thing: A): UnserializableDescription[] | undefined;
833
834
 
834
835
  declare interface ForInStatement$1 extends Span$1 {
835
836
  type: "ForInStatement";
@@ -839,7 +840,7 @@ declare interface ForInStatement$1 extends Span$1 {
839
840
  parent?: Node$1;
840
841
  }
841
842
 
842
- export declare const forkCoreSchema: Record<string, unknown>;
843
+ export declare const forkCoreSchema: JsonSchema;
843
844
 
844
845
  export declare const forkOptionsSchema: S.StructWithRest<S.Struct<{
845
846
  readonly allowConsoleColors: S.withDecodingDefaultKey<S.Boolean, never>;
@@ -1059,7 +1060,7 @@ export declare interface Ignorer {
1059
1060
 
1060
1061
  export declare type Immutable<T> = T extends ImmutablePrimitive ? T : T extends Array<infer U> ? ReadonlyArray<Immutable<U>> : T extends Map<infer K, infer V> ? ReadonlyMap<Immutable<K>, Immutable<V>> : T extends Set<infer M> ? ReadonlySet<Immutable<M>> : T extends RegExp ? Readonly<RegExp> : { readonly [K in keyof T]: Immutable<T[K]>; };
1061
1062
 
1062
- export declare type ImmutablePrimitive = Primitive | ((...args: never[]) => unknown);
1063
+ export declare type ImmutablePrimitive = Primitive | ((...args: never[]) => void);
1063
1064
 
1064
1065
  declare interface ImportAttribute$1 extends Span$1 {
1065
1066
  type: "ImportAttribute";
@@ -1100,7 +1101,7 @@ declare interface ImportExpression$1 extends Span$1 {
1100
1101
  parent?: Node$1;
1101
1102
  }
1102
1103
 
1103
- export declare function importModule(moduleName: string): Effect.Effect<unknown, StrykerError>;
1104
+ export declare function importModule<A = unknown>(moduleName: string): Effect.Effect<A, StrykerError>;
1104
1105
 
1105
1106
  declare interface ImportNamespaceSpecifier extends Span$1 {
1106
1107
  type: "ImportNamespaceSpecifier";
@@ -1355,8 +1356,8 @@ declare interface LabelIdentifier$1 extends Span$1 {
1355
1356
 
1356
1357
  export declare const loadConfigCell: typeof readConfig;
1357
1358
 
1358
- export declare interface LoadedPlugins {
1359
- readonly schemaContributions: readonly Record<string, unknown>[];
1359
+ export declare interface LoadedPlugins<A = unknown> {
1360
+ readonly schemaContributions: readonly Record<string, A>[];
1360
1361
  readonly pluginsByKind: HashMap.HashMap<PluginKind, readonly PluginDescriptor[]>;
1361
1362
  readonly pluginModulePaths: readonly string[];
1362
1363
  readonly pluginSources: readonly PluginSource[];
@@ -2224,7 +2225,7 @@ declare interface SequenceExpression$1 extends Span$1 {
2224
2225
  parent?: Node$1;
2225
2226
  }
2226
2227
 
2227
- export declare const shouldKeepTempDir: (exit: Exit.Exit<unknown, unknown>, cleanTempDir: 'always' | boolean) => boolean;
2228
+ export declare const shouldKeepTempDir: <A = unknown, E = unknown>(exit: Exit.Exit<A, E>, cleanTempDir: 'always' | boolean) => boolean;
2228
2229
 
2229
2230
  declare type SimpleAssignmentTarget$1 = IdentifierReference$1 | TSAsExpression$1 | TSSatisfiesExpression$1 | TSNonNullExpression$1 | TSTypeAssertion$1 | MemberExpression$1;
2230
2231
 
@@ -3118,11 +3119,11 @@ declare interface V8IntrinsicExpression extends Span$1 {
3118
3119
  parent?: Node$1;
3119
3120
  }
3120
3121
 
3121
- export declare function validateOptions(options: Record<string, unknown>, schema: ValidationSchemaDocument): Effect.Effect<StrykerOptions, ConfigError>;
3122
+ export declare function validateOptions<A = unknown>(options: Record<string, A>, schema: ValidationSchemaDocument): Effect.Effect<StrykerOptions, ConfigError>;
3122
3123
 
3123
- export declare type ValidationSchemaDocument = {
3124
- readonly properties?: unknown;
3125
- readonly [key: string]: unknown;
3124
+ export declare type ValidationSchemaDocument<A = unknown> = {
3125
+ readonly properties?: A;
3126
+ readonly [key: string]: A;
3126
3127
  };
3127
3128
 
3128
3129
  declare interface VariableDeclaration$1 extends Span$1 {
@@ -3237,7 +3238,7 @@ export declare interface VmPlatform {
3237
3238
  readonly vm: VmModule;
3238
3239
  }
3239
3240
 
3240
- export declare type VmRequire = (specifier: string) => unknown;
3241
+ export declare type VmRequire = <A = unknown>(specifier: string) => A;
3241
3242
 
3242
3243
  export declare class VmRunner extends VmRunner_base {}
3243
3244
 
@@ -3250,7 +3251,7 @@ export declare const vmRunnerCapabilities: {
3250
3251
  export declare const vmRunnerName = "vm";
3251
3252
 
3252
3253
  export declare interface VmScript {
3253
- readonly runInContext: (context: object) => unknown;
3254
+ readonly runInContext: <A = unknown>(context: object) => A;
3254
3255
  }
3255
3256
 
3256
3257
  export declare const vmTestRunner: (config: VmTestRunnerConfig) => Effect.Effect<PooledTestRunner, TestRunnerFailed, FileSystem.FileSystem | VmRunner>;
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { A as MetricsSchema, B as ReporterEventBatch, C as CheckerRequest, D as FileResultSchema, E as ExitClass, F as MutationTestingPlanReady, H as ReporterInitOptions, M as MutantTested, N as MutationTestReportReady, P as MutationTestResultSchema, R as ReporterAck, S as CheckerMutantWire, T as DryRunCompleted, U as ReporterRpcs, W as StrykerOptionsSchema, X as TraceContextMiddleware, _ as RunStarted, b as CheckerFailed, c as PhaseEntered, dt as PositionSchema, et as WorkerPluginKind, h as RunPhase, i as HelpRendered, j as MutantResultSchema, l as PlanKnown, lt as MutantActivationSchema, m as RunMutantTested, n as StageError, p as RunFailed, q as TestRunnerConfigSchema, r as Heartbeat, st as LocationSchema, ut as MutantStatusSchema, v as VerdictReached, w as CheckerRpcs, x as CheckerGroupResult, y as CheckerCheckResult, z as ReporterDrained } from "./Run.schema-B0ERLxQj.mjs";
2
- import { $ as validateOptions, A as strykerVersion, At as MergeResult, B as optionsPath, C as checkerMutantsSkipped, Ct as ExtendsStepDone, D as CheckerSkippedRequested, Dt as ExtendsStepStateSchema, E as CheckerAnsweredUnrequested, Et as ExtendsStepResolve, F as deepFreeze, Ft as toRelativeNormalizedFileName, G as decideExtendsStep, H as REPORTER_EVENT_BATCH_BOUND, I as defaultOptions, It as RunEvents, J as importModule, K as describeErrors, L as findUnserializables, Lt as RunIdentity, M as CONFIG_SYNTAX_HELP, Mt as extendsPropertySchema, N as SUPPORTED_CONFIG_FILE_NAMES, Nt as forkOptionsSchema, O as createFileMatcher, Ot as ImportedModuleSchema, P as createDefaultOptions, Pt as survivorsPriorReport, Q as readConfig, R as isModuleSpecifier, Rt as RunEventWireLine, S as checkerMutantsChecked, St as ExtendsStepDocumentSchema, T as checkerRpcFailures, Tt as ExtendsStepRefused, U as reporterWorkerFactory, V as RunEnvironment, W as spawnReporterWorker, X as loadConfigCell, Y as initialExtendsStepState, Z as mergeConfigs, _ as verdictExitClass, _t as ConfigError, a as RUN_EVENTS_QUEUE_BOUND, at as IdGenerator, b as checkGroupedPlans, bt as ConfigFileUnreadableError, c as shouldKeepTempDir, ct as OutOfMemoryError, d as buildVerdictEnvelope, dt as isVmRunner, et as buildTestRunner, f as generateRunId, ft as vmRunnerCapabilities, g as resolveExitCode, gt as ConfigDocumentSchema, h as highestExitClass, ht as StrykerError, i as makeRunEventStream, it as makeWorkerClient, j as IncrementalReportSchema, jt as ReadConfigCommand, k as matchesFile, kt as MergeCommand, l as ACTIONABLE_STATUSES, lt as WorkerBootTimeoutError, m as EXIT_CODE, mt as vmTestRunner, n as RunEventDrain, nt as WorkerLauncher, o as makeRunLayer, ot as classifyWorkerExit, p as isActionableStatus, pt as vmRunnerName, q as forkCoreSchema, r as RunEventDrainLive, rt as connectRetry, s as mutationTestCell, st as ChildProcessCrashedError, t as strykerCell, tt as isCommandRunner, u as VERDICT_ENVELOPE_SCHEMA_VERSION, ut as VmRunner, v as calculateMetrics, vt as ConfigFileInvalidError, w as checkerProcessCrashes, wt as ExtendsStepRead, x as checkerDuration, xt as ConfigFileUnsupportedError, y as countMutants, yt as ConfigFileNotFoundError, z as isWarningEnabled, zt as S } from "./src-Baq6uz-6.mjs";
1
+ import { A as MetricsSchema, B as ReporterEventBatch, C as CheckerRequest, D as FileResultSchema, E as ExitClass, F as MutationTestingPlanReady, H as ReporterInitOptions, M as MutantTested, N as MutationTestReportReady, P as MutationTestResultSchema, R as ReporterAck, S as CheckerMutantWire, T as DryRunCompleted, U as ReporterRpcs, W as StrykerOptionsSchema, X as TraceContextMiddleware, _ as RunStarted, b as CheckerFailed, c as PhaseEntered, dt as PositionSchema, et as WorkerPluginKind, h as RunPhase, i as HelpRendered, j as MutantResultSchema, l as PlanKnown, lt as MutantActivationSchema, m as RunMutantTested, n as StageError, p as RunFailed, q as TestRunnerConfigSchema, r as Heartbeat, st as LocationSchema, ut as MutantStatusSchema, v as VerdictReached, w as CheckerRpcs, x as CheckerGroupResult, y as CheckerCheckResult, z as ReporterDrained } from "./Run.schema-B_KpPeBA.mjs";
2
+ import { $ as OutOfMemoryError, A as strykerVersion, At as defaultOptions, B as initialExtendsStepState, C as checkerMutantsSkipped, Ct as extendsPropertySchema, D as CheckerSkippedRequested, Dt as SUPPORTED_CONFIG_FILE_NAMES, E as CheckerAnsweredUnrequested, Et as CONFIG_SYNTAX_HELP, F as spawnReporterWorker, Ft as toRelativeNormalizedFileName, G as buildTestRunner, H as mergeConfigs, I as decideExtendsStep, It as RunEvents, J as connectRetry, K as isCommandRunner, L as describeErrors, Lt as RunIdentity, M as RunEnvironment, Mt as isModuleSpecifier, N as REPORTER_EVENT_BATCH_BOUND, Nt as isWarningEnabled, O as createFileMatcher, Ot as createDefaultOptions, P as reporterWorkerFactory, Pt as optionsPath, Q as ChildProcessCrashedError, R as forkCoreSchema, Rt as RunEventWireLine, S as checkerMutantsChecked, St as ReadConfigCommand, T as checkerRpcFailures, Tt as survivorsPriorReport, U as readConfig, V as loadConfigCell, W as validateOptions, X as IdGenerator, Y as makeWorkerClient, Z as classifyWorkerExit, _ as verdictExitClass, _t as ExtendsStepResolve, a as RUN_EVENTS_QUEUE_BOUND, at as vmTestRunner, b as checkGroupedPlans, bt as MergeCommand, c as shouldKeepTempDir, ct as ConfigError, d as buildVerdictEnvelope, dt as ConfigFileUnreadableError, et as WorkerBootTimeoutError, f as generateRunId, ft as ConfigFileUnsupportedError, g as resolveExitCode, gt as ExtendsStepRefused, h as highestExitClass, ht as ExtendsStepRead, i as makeRunEventStream, it as vmRunnerName, j as IncrementalReportSchema, jt as findUnserializables, k as matchesFile, kt as deepFreeze, l as ACTIONABLE_STATUSES, lt as ConfigFileInvalidError, m as EXIT_CODE, mt as ExtendsStepDone, n as RunEventDrain, nt as isVmRunner, o as makeRunLayer, ot as StrykerError, p as isActionableStatus, pt as ExtendsStepDocumentSchema, q as WorkerLauncher, r as RunEventDrainLive, rt as vmRunnerCapabilities, s as mutationTestCell, st as ConfigDocumentSchema, t as strykerCell, tt as VmRunner, u as VERDICT_ENVELOPE_SCHEMA_VERSION, ut as ConfigFileNotFoundError, v as calculateMetrics, vt as ExtendsStepStateSchema, w as checkerProcessCrashes, wt as forkOptionsSchema, x as checkerDuration, xt as MergeResult, y as countMutants, yt as ImportedModuleSchema, z as importModule, zt as S } from "./src-BkTsNvl0.mjs";
3
3
  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, RunEventDrain, RunEventDrainLive, RunEventWireLine, RunEvents, RunFailed, RunIdentity, RunMutantTested, RunPhase, RunStarted, S, 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, makeRunEventStream, makeRunLayer, makeWorkerClient, matchesFile, mergeConfigs, mutationTestCell, optionsPath, readConfig, reporterWorkerFactory, resolveExitCode, shouldKeepTempDir, spawnReporterWorker, strykerCell, strykerVersion, survivorsPriorReport, toRelativeNormalizedFileName, validateOptions, verdictExitClass, vmRunnerCapabilities, vmRunnerName, vmTestRunner };