@systemfsoftware/stryker-js-typescript-checker 10.0.1 → 10.0.2

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,9 @@
1
1
  # @systemfsoftware/stryker-js-typescript-checker
2
2
 
3
+ ## 10.0.2
4
+
5
+ Updated dependency @systemfsoftware/stryker-js to 23.2.1
6
+
3
7
  ## 10.0.1
4
8
 
5
9
  The workspace dogfoods @systemfsoftware/stryker-js 23.0.0 and the TypeScript checker 10.0.0, and every package resolves one @systemfsoftware/effect-cell-types (12.1.4). The TypeScript checker and the vitest runner bundle 12.1.4 in place of 12.0.0, and stryker-js and the checker bundle @jsr/std__jsonc 1.0.3 in place of 1.0.2. Every package that takes @systemfsoftware/effect-cell-types from the catalog publishes the range ^12.1.4 in place of ^12.0.0.
package/dist/main.mjs CHANGED
@@ -59875,6 +59875,7 @@ const SpanName = String$2.check(isPattern(/^[A-Za-z][A-Za-z0-9_-]*(?:\.[A-Za-z][
59875
59875
  const SpanAttributeKey = String$2.check(isPattern(/^[A-Za-z][A-Za-z0-9_.-]*$/u, { expected: "an attribute key starting with a letter, such as \"stryker.checker.name\"" })).pipe(brand("SpanAttributeKey"));
59876
59876
  const SpanAttributeText = String$2;
59877
59877
  const SpanAttributeCount = Finite;
59878
+ const SpanAttributeCountWhenRecorded = optionalKey(SpanAttributeCount);
59878
59879
  const SpanRunStatus = Literals([
59879
59880
  "success",
59880
59881
  "failure",
@@ -59882,6 +59883,24 @@ const SpanRunStatus = Literals([
59882
59883
  "aborted",
59883
59884
  "skipped"
59884
59885
  ]);
59886
+ const CompilerCheckAttributes = {
59887
+ "typescript.snapshot_updates.count": SpanAttributeCountWhenRecorded,
59888
+ "typescript.resplices.count": SpanAttributeCountWhenRecorded,
59889
+ "typescript.importer_shortcut.count": SpanAttributeCountWhenRecorded,
59890
+ "typescript.importer_shortcut.fallback.original.outside-function-body.count": SpanAttributeCountWhenRecorded,
59891
+ "typescript.importer_shortcut.fallback.original.body-dependent-signature.count": SpanAttributeCountWhenRecorded,
59892
+ "typescript.importer_shortcut.fallback.original.not-typescript-module.count": SpanAttributeCountWhenRecorded,
59893
+ "typescript.importer_shortcut.fallback.original.module-reference.count": SpanAttributeCountWhenRecorded,
59894
+ "typescript.importer_shortcut.fallback.original.syntax-error.count": SpanAttributeCountWhenRecorded,
59895
+ "typescript.importer_shortcut.fallback.original.shared-file.count": SpanAttributeCountWhenRecorded,
59896
+ "typescript.importer_shortcut.fallback.mutated.outside-function-body.count": SpanAttributeCountWhenRecorded,
59897
+ "typescript.importer_shortcut.fallback.mutated.body-dependent-signature.count": SpanAttributeCountWhenRecorded,
59898
+ "typescript.importer_shortcut.fallback.mutated.not-typescript-module.count": SpanAttributeCountWhenRecorded,
59899
+ "typescript.importer_shortcut.fallback.mutated.module-reference.count": SpanAttributeCountWhenRecorded,
59900
+ "typescript.importer_shortcut.fallback.mutated.syntax-error.count": SpanAttributeCountWhenRecorded,
59901
+ "typescript.importer_shortcut.fallback.mutated.shared-file.count": SpanAttributeCountWhenRecorded,
59902
+ "typescript.importer_shortcut.fallback.unread.count": SpanAttributeCountWhenRecorded
59903
+ };
59885
59904
  const SpanDocument = Struct({
59886
59905
  id: SpanName,
59887
59906
  name: SpanName,
@@ -60046,7 +60065,7 @@ const Spans = {
60046
60065
  },
60047
60066
  htmlReportWrite: {
60048
60067
  name: "html_report.write",
60049
- attributes: {}
60068
+ attributes: { "stryker.html_report.file_name": SpanAttributeText }
60050
60069
  },
60051
60070
  htmlReportWriteBundleFromDisk: {
60052
60071
  name: "html_report.write_bundle_from_disk",
@@ -60670,7 +60689,7 @@ const Spans = {
60670
60689
  },
60671
60690
  typescriptCheckerCompilerCheck: {
60672
60691
  name: "typescript-checker.compiler.check",
60673
- attributes: {}
60692
+ attributes: CompilerCheckAttributes
60674
60693
  },
60675
60694
  typescriptCheckerCompilerClose: {
60676
60695
  name: "typescript-checker.compiler.close",
@@ -61393,15 +61412,15 @@ const serverMiddleware = (effect, options) => {
61393
61412
  };
61394
61413
  const layerTraceContextServer = succeed$3(Trace_exports.TraceContextMiddleware, serverMiddleware);
61395
61414
  dual(3, (spanName, attributes, effect) => flatMap$1(context(), (context) => match$7(remoteSpanOf(context), {
61396
- onNone: () => useSpan(spanName, { attributes }, () => effect),
61397
- onSome: (linked) => useSpan(spanName, {
61415
+ onNone: () => withSpan(effect, spanName, { attributes }),
61416
+ onSome: (linked) => withSpan(effect, spanName, {
61398
61417
  attributes,
61399
61418
  root: true,
61400
61419
  links: [{
61401
61420
  span: linked,
61402
61421
  attributes: {}
61403
61422
  }]
61404
- }, () => effect)
61423
+ })
61405
61424
  })));
61406
61425
  const jsonEscapesKey = (key) => JSON.stringify(key) !== `"${key}"`;
61407
61426
  const isJsonArray$2 = (value) => Array.isArray(value);
@@ -64577,7 +64596,7 @@ const isEmptyNumber = (value$14) => value(value$14).pipe(when(0, () => true), or
64577
64596
  const isEmptyError = (error) => value(error).pipe(when(_undefined, () => true), when(_null, () => true), when(string, (text) => text.length === 0), when(number, isEmptyNumber), when(boolean, (value) => !value), orElse$1(() => false));
64578
64597
  const formatErrnoException = (error) => value(error.stack).pipe(when(hasText, (stack) => `${error.name}: ${error.code} (${error.syscall}) ${stack}`), orElse$1(() => `${error.name}: ${error.code} (${error.syscall})`));
64579
64598
  const formatError = (error) => value(error.stack).pipe(when(hasText, (stack) => `${error.name}: ${error.message}\n${stack}`), orElse$1(() => `${error.name}: ${error.message}`));
64580
- const isJsonPrimitive = (value$8) => value(value$8).pipe(when(number, () => true), when(boolean, () => true), when(bigint, () => true), orElse$1(() => false));
64599
+ const isJsonPrimitive = (value$9) => value(value$9).pipe(when(number, () => true), when(boolean, () => true), when(bigint, () => true), orElse$1(() => false));
64581
64600
  const jsonText = (error) => getOrElse(try_$2({
64582
64601
  try: () => textIfNonEmpty(JSON.stringify(error)),
64583
64602
  catch: () => void 0
@@ -64608,13 +64627,13 @@ function nonStringTextOf(error) {
64608
64627
  return primitiveJsonOf(error) ?? stringifyRest(error);
64609
64628
  }
64610
64629
  const errorText = (error) => value(error).pipe(when(isErrnoException, formatErrnoException), orElse$1(() => formatError(error)));
64611
- const errorNameOf = (value$7) => value(value$7).pipe(when(instanceOf(Error), (error) => textIfNonEmpty(error.name)), orElse$1(() => void 0));
64630
+ const errorNameOf = (value$8) => value(value$8).pipe(when(instanceOf(Error), (error) => textIfNonEmpty(error.name)), orElse$1(() => void 0));
64612
64631
  const tagOf = (value$5) => value(textIfNonEmpty(fieldOf(value$5, "_tag"))).pipe(when(hasText, (tag) => tag), orElse$1(() => errorNameOf(value$5)));
64613
64632
  const textWithNested = (own, nested) => value(own).pipe(when(hasText, (text) => appendNested(text, nested)), orElse$1(() => nested));
64614
64633
  const appendNested = (own, nested) => value(nested).pipe(when(hasText, (text) => `${own}: ${text}`), orElse$1(() => own));
64615
64634
  const errorMessage = (error) => value(error.message.length > 0).pipe(when(true, () => error.message), orElse$1(() => tagOf(error)));
64616
64635
  const errorMessageOrTag = (value$20) => value(value$20).pipe(when(instanceOf(Error), errorMessage), orElse$1(() => tagOf(value$20)));
64617
- const messageText = (value$6) => value(textIfNonEmpty(fieldOf(value$6, "message"))).pipe(when(hasText, (message) => message), orElse$1(() => errorMessageOrTag(value$6)));
64636
+ const messageText = (value$7) => value(textIfNonEmpty(fieldOf(value$7, "message"))).pipe(when(hasText, (message) => message), orElse$1(() => errorMessageOrTag(value$7)));
64618
64637
  const ownCauseText = (value$19) => value(textIfNonEmpty(fieldOf(value$19, "reason"))).pipe(when(hasText, (reason) => reason), orElse$1(() => messageText(value$19)));
64619
64638
  const isPastDepth = (depth) => depth > 4;
64620
64639
  const isMissingCause = (cause) => cause === void 0 || cause === null;
@@ -65593,7 +65612,7 @@ const identifierText = (node) => match$7(fromNullishOr(node), {
65593
65612
  onNone: () => none(),
65594
65613
  onSome: (present) => value(present).pipe(when(isNamedIdentifier, (name) => some$1(name.name)), when(isStringLiteral$1, (literal) => literalValueText(literal.value)), orElse$1(() => none()))
65595
65614
  });
65596
- const literalValueText = (value$10) => value(value$10).pipe(when(isString$3, (text) => some$1(text)), orElse$1(() => none()));
65615
+ const literalValueText = (value$11) => value(value$11).pipe(when(isString$3, (text) => some$1(text)), orElse$1(() => none()));
65597
65616
  const moduleExportName = (name) => getOrElse$1(identifierText(name), () => "");
65598
65617
  const staticMemberName = (member) => value(member.computed).pipe(when(false, () => identifierText(member.property)), orElse$1(() => none()));
65599
65618
  const nodesOutsideFunctions = (root) => {
@@ -67393,7 +67412,7 @@ const literalWithoutRegex = (node) => match$7(fromNullishOr(node.bigint), {
67393
67412
  const valueLiteralText = (value$23) => value(value$23).pipe(when(string, (v) => JSON.stringify(v)), orElse$1(nonStringLiteralText));
67394
67413
  const nonStringLiteralText = (value$13) => value(value$13).pipe(when(number, (v) => String(v)), orElse$1(booleanOrBigintText));
67395
67414
  const booleanOrBigintText = (value$4) => value(value$4).pipe(when(boolean, (v) => String(v)), orElse$1(bigintText));
67396
- const bigintText = (value$11) => value(value$11).pipe(when((candidate) => typeof candidate === "bigint", (v) => `${String(v)}n`), orElse$1(() => "null"));
67415
+ const bigintText = (value$12) => value(value$12).pipe(when((candidate) => typeof candidate === "bigint", (v) => `${String(v)}n`), orElse$1(() => "null"));
67397
67416
  const flagText = (present, text) => match$1(isTruthy(present), {
67398
67417
  onTrue: () => text,
67399
67418
  onFalse: () => ""
@@ -67408,7 +67427,7 @@ const objectExpressionText = (ctx, node) => match$1(node.properties.length === 0
67408
67427
  onFalse: () => `{ ${nodeListText(ctx, node.properties, PREC.Sequence)} }`
67409
67428
  });
67410
67429
  const propertyText = (ctx, node) => value(propertyFormOf(node)).pipe(when("accessor", () => `${node.kind} ${propertyKeyText(ctx, node.key, node.computed === true, PREC.Assignment)}${functionValueTailText(ctx, node.value)}`), when("method", () => `${propertyKeyText(ctx, node.key, node.computed === true, PREC.Assignment)}${functionValueTailText(ctx, node.value)}`), when("shorthand", () => identifierNameText(node.key)), when("shorthandDefault", () => shorthandDefaultPropertyText(ctx, node)), orElse$1(() => `${propertyKeyText(ctx, node.key, node.computed === true, PREC.Assignment)}: ${printNodePrec(ctx, node.value, PREC.Assignment)}`));
67411
- const functionValueTailText = (ctx, value$9) => value(value$9).pipe(when(isFunctionNode, (fn) => functionTailText(ctx, fn)), orElse$1(() => ""));
67430
+ const functionValueTailText = (ctx, value$10) => value(value$10).pipe(when(isFunctionNode, (fn) => functionTailText(ctx, fn)), orElse$1(() => ""));
67412
67431
  const shorthandDefaultPropertyText = (ctx, node) => value(node.value).pipe(when(isAssignmentPattern, (value) => `${identifierNameText(node.key)} = ${printNodePrec(ctx, value.right, PREC.Assignment)}`), orElse$1(() => ""));
67413
67432
  const propertyKeyText = (ctx, key, computed, computedPrec) => match$1(computed, {
67414
67433
  onTrue: () => `[${dispatchNode(ctx, key, computedPrec)}]`,
@@ -68040,19 +68059,15 @@ var FormatAssigned = class extends TaggedClass()("FormatAssigned", {
68040
68059
  };
68041
68060
  var FormatSkipped = class extends TaggedClass()("FormatSkipped", {
68042
68061
  fileName: String$2,
68043
- extension: String$2,
68044
- reason: String$2
68062
+ extension: String$2
68045
68063
  }) {
68046
68064
  [FormatResolutionTypeId] = FormatResolutionTypeId;
68047
68065
  };
68048
- var FormatOverrideUnclaimed = class extends TaggedError()("FormatOverrideUnclaimed", {
68066
+ var FormatOverrideUnclaimed = class extends TaggedClass()("FormatOverrideUnclaimed", {
68049
68067
  fileName: String$2,
68050
- formatId: String$2,
68051
- reason: String$2
68068
+ formatId: String$2
68052
68069
  }) {
68053
- get message() {
68054
- return `Cannot instrument ${this.fileName}: ${this.reason}`;
68055
- }
68070
+ [FormatResolutionTypeId] = FormatResolutionTypeId;
68056
68071
  };
68057
68072
  const pinOf = (command) => fromUndefinedOr(command.formatId);
68058
68073
  const matchesCommand = (claim, command) => value(pinOf(command)).pipe(when(isSome, (pin) => claim.formatId === pin.value), orElse$1(() => claim.extensions.includes(command.extension)));
@@ -68065,13 +68080,11 @@ const assignedFrom = (claim, command) => FormatAssigned.make({
68065
68080
  });
68066
68081
  const skippedFrom = (command) => FormatSkipped.make({
68067
68082
  fileName: command.fileName,
68068
- extension: command.extension,
68069
- reason: `No installed format claims "${command.extension}". Install the framework plugin that claims this file type to instrument it.`
68083
+ extension: command.extension
68070
68084
  });
68071
68085
  const overrideUnclaimedFrom = (command, formatId) => FormatOverrideUnclaimed.make({
68072
68086
  fileName: command.fileName,
68073
- formatId,
68074
- reason: `No installed format carries the id "${formatId}" pinned for this file.`
68087
+ formatId
68075
68088
  });
68076
68089
  const ClaimSelected = TaggedStruct("ClaimSelected", { claim: FormatClaimSchema });
68077
68090
  const PinUnclaimed = TaggedStruct("PinUnclaimed", { formatId: String$2 });
@@ -68090,9 +68103,13 @@ const selectionFor = (command) => match$7(fromUndefinedOr(claimFor(command)), {
68090
68103
  });
68091
68104
  const resolveFormat = Workflow_exports.make({
68092
68105
  command: FormatResolutionCommand,
68093
- decision: Union([FormatAssigned, FormatSkipped]),
68094
- error: FormatOverrideUnclaimed,
68095
- decide: (command) => value(selectionFor(command)).pipe(tag("ClaimSelected", ({ claim }) => succeed$6(assignedFrom(claim, command))), tag("PinUnclaimed", ({ formatId }) => fail$9(overrideUnclaimedFrom(command, formatId))), tag("ExtensionUnclaimed", () => succeed$6(skippedFrom(command))), exhaustive)
68106
+ decision: Union([
68107
+ FormatAssigned,
68108
+ FormatSkipped,
68109
+ FormatOverrideUnclaimed
68110
+ ]),
68111
+ error: Never,
68112
+ decide: (command) => value(selectionFor(command)).pipe(tag("ClaimSelected", ({ claim }) => succeed$6(assignedFrom(claim, command))), tag("PinUnclaimed", ({ formatId }) => succeed$6(overrideUnclaimedFrom(command, formatId))), tag("ExtensionUnclaimed", () => succeed$6(skippedFrom(command))), exhaustive)
68096
68113
  });
68097
68114
  const AridRuleId = Literals([
68098
68115
  "arid-logging",
@@ -68542,7 +68559,7 @@ const MutantSetDecision = ArraySchema(Union([MutantSuppressed, MutantKept]));
68542
68559
  * plant the same code exactly when these texts are equal, so the policy compares text and reparses nothing.
68543
68560
  */
68544
68561
  const canonicalForm = (text) => text.trim();
68545
- const defaultOnly = (policy, value$12) => value(policy).pipe(when("full", () => none()), when("default", value$12), exhaustive);
68562
+ const defaultOnly = (policy, value$6) => value(policy).pipe(when("full", () => none()), when("default", value$6), exhaustive);
68546
68563
  const printedAs = (code) => canonicalForm(code);
68547
68564
  const printsSomething = (code) => printedAs(code).length > 0;
68548
68565
  const samePrintedCode = (left, right) => [printsSomething(left), printedAs(left) === printedAs(right)].every(Boolean);
@@ -69688,20 +69705,22 @@ const parsedOutcomeFor = (registry, file, assigned) => match$7(registry.entryFor
69688
69705
  }
69689
69706
  }))
69690
69707
  });
69708
+ const skipReasonOf = (skipped) => `No installed format claims "${skipped.extension}". Install the framework plugin that claims this file type to instrument it.`;
69709
+ const overrideUnclaimedTextOf = (unclaimed) => `Cannot instrument ${unclaimed.fileName}: No installed format carries the id "${unclaimed.formatId}" pinned for this file.`;
69691
69710
  const skippedOutcomeFor = (file, skipped) => ({
69692
69711
  kind: "skipped",
69693
69712
  record: InstrumentFileSkip.make({
69694
69713
  file: file.name,
69695
69714
  extension: skipped.extension,
69696
- reason: skipped.reason
69715
+ reason: skipReasonOf(skipped)
69697
69716
  })
69698
69717
  });
69699
69718
  const unclaimedOverrideError = (file) => InstrumentError.make({
69700
69719
  message: `No installed format owns ${file.name}`,
69701
69720
  cause: /* @__PURE__ */ new Error(`Unresolvable format pin for ${file.name}`)
69702
69721
  });
69703
- const outcomeFor = (registry, file, decision) => value(decision).pipe(when(is(FormatAssigned), (assigned) => parsedOutcomeFor(registry, file, assigned)), when(is(FormatSkipped), (skipped) => succeed$2(skippedOutcomeFor(file, skipped))), exhaustive);
69704
- const fileOutcome = (request) => value(resolveFile(request.registry, request.file.name)).pipe(when(isSuccess$1, (resolved) => outcomeFor(request.registry, request.file, resolved.success)), orElse$1(() => fail$4(unclaimedOverrideError(request.file))));
69722
+ const outcomeFor = (registry, file, decision) => value(decision).pipe(when(is(FormatAssigned), (assigned) => parsedOutcomeFor(registry, file, assigned)), when(is(FormatSkipped), (skipped) => succeed$2(skippedOutcomeFor(file, skipped))), when(is(FormatOverrideUnclaimed), () => fail$4(unclaimedOverrideError(file))), exhaustive);
69723
+ const fileOutcome = (request) => flatMap$1(fromResult(resolveFile(request.registry, request.file.name)), (decision) => outcomeFor(request.registry, request.file, decision));
69705
69724
  const isParsedOutcome = (outcome) => outcome.kind === "parsed";
69706
69725
  const skipsOf = (outcome) => outcome.kind === "skipped" ? [outcome.record] : [];
69707
69726
  const transformInto = (request) => transform(request.ast, request.collector, {
@@ -69859,7 +69878,10 @@ const disableTypeChecksCell = Sandwich_exports.named(SpanTaxonomy_exports.Spans.
69859
69878
  formatId: assigned.formatId
69860
69879
  }),
69861
69880
  FormatSkipped: (_skipped, raw) => succeed$2(raw.file),
69862
- FormatOverrideUnclaimed: (failure) => fail$4(FormatOverrideUnclaimed.make(failure)),
69881
+ FormatOverrideUnclaimed: (unclaimed, raw) => fail$4(InstrumentError.make({
69882
+ message: `No installed format owns ${raw.file.name}`,
69883
+ cause: new Error(overrideUnclaimedTextOf(unclaimed))
69884
+ })),
69863
69885
  CommandRejected: ({ issue }) => fail$4(InstrumentError.make({
69864
69886
  message: issue,
69865
69887
  cause: new Error(issue)
@@ -69962,9 +69984,6 @@ const disableTypeChecksDataFirst = (file, registry = coreFormatRegistry) => disa
69962
69984
  }).pipe(map$2((disabled) => ({
69963
69985
  ...file,
69964
69986
  content: disabled.content
69965
- })), mapError$1((cause) => is(InstrumentError)(cause) ? cause : InstrumentError.make({
69966
- message: `No installed format owns ${file.name}`,
69967
- cause
69968
69987
  })));
69969
69988
  dual((args) => hasProperty(args[0], "content"), disableTypeChecksDataFirst);
69970
69989
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@systemfsoftware/stryker-js-typescript-checker",
3
- "version": "10.0.1",
3
+ "version": "10.0.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/systemfsoftware/stryker-js-effect.git",
@@ -38,10 +38,10 @@
38
38
  "@opentelemetry/sdk-node": "^0.222.0",
39
39
  "@opentelemetry/sdk-trace-base": "^2.2.0",
40
40
  "@systemfsoftware/effect-cell-types": "^12.1.4",
41
- "@systemfsoftware/stryker-js-cli-contract": "^3.0.1",
42
- "@systemfsoftware/stryker-js-instrumenter": "^16.0.1",
41
+ "@systemfsoftware/stryker-js-cli-contract": "^3.1.0",
42
+ "@systemfsoftware/stryker-js-instrumenter": "^16.0.2",
43
43
  "@systemfsoftware/stryker-js-plugin-interface": "^19.0.1",
44
- "@systemfsoftware/stryker-js-plugin-runtime": "^9.0.1",
44
+ "@systemfsoftware/stryker-js-plugin-runtime": "^9.0.2",
45
45
  "typescript": "^7"
46
46
  },
47
47
  "devDependencies": {
@@ -61,6 +61,8 @@
61
61
  "@systemfsoftware/stryker-js": "^23.0.0",
62
62
  "@systemfsoftware/stryker-js-typescript-checker": "^10.0.0",
63
63
  "@systemfsoftware/stryker-js-vitest-runner": "^10.1.0",
64
+ "@systemfsoftware/trace-spec": "^1.0.0",
65
+ "@systemfsoftware/trace-taxonomy": "^1.0.0",
64
66
  "@systemfsoftware/tsconfig": "^2.0.1",
65
67
  "@systemfsoftware/tsdown-config": "^0.1.0",
66
68
  "@systemfsoftware/vitest": "^2.0.0",