@systemfsoftware/stryker-js-instrumenter 16.0.1 → 16.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,13 @@
1
1
  # @systemfsoftware/stryker-js-instrumenter
2
2
 
3
+ ## 16.0.2
4
+
5
+ Rebuilt against the span taxonomy that declares the html report write attribute; behaviour is unchanged. The html reporter test of that span is a trace-spec contract.
6
+
7
+ Format resolution now decides only which format claims a file; the skip reason is built where the skip is recorded, byte for byte as before, and an unclaimed pinned format id is a decision the type-check disabler turns into its InstrumentError.
8
+
9
+ Rebuilt against the span taxonomy that declares the checker compile counts; behaviour is unchanged. The span tests of the instrument phase, sandbox acquisition, worker trace propagation and importer shortcut are trace-spec contracts.
10
+
3
11
  ## 16.0.1
4
12
 
5
13
  Updated dependency @systemfsoftware/stryker-framework-interface to 0.0.3
package/dist/index.mjs CHANGED
@@ -3561,19 +3561,15 @@ var FormatAssigned = class extends S.TaggedClass()("FormatAssigned", {
3561
3561
  };
3562
3562
  var FormatSkipped = class extends S.TaggedClass()("FormatSkipped", {
3563
3563
  fileName: S.String,
3564
- extension: S.String,
3565
- reason: S.String
3564
+ extension: S.String
3566
3565
  }) {
3567
3566
  [FormatResolutionTypeId] = FormatResolutionTypeId;
3568
3567
  };
3569
- var FormatOverrideUnclaimed = class extends S.TaggedError()("FormatOverrideUnclaimed", {
3568
+ var FormatOverrideUnclaimed = class extends S.TaggedClass()("FormatOverrideUnclaimed", {
3570
3569
  fileName: S.String,
3571
- formatId: S.String,
3572
- reason: S.String
3570
+ formatId: S.String
3573
3571
  }) {
3574
- get message() {
3575
- return `Cannot instrument ${this.fileName}: ${this.reason}`;
3576
- }
3572
+ [FormatResolutionTypeId] = FormatResolutionTypeId;
3577
3573
  };
3578
3574
  const pinOf = (command) => Option.fromUndefinedOr(command.formatId);
3579
3575
  const matchesCommand = (claim, command) => Match.value(pinOf(command)).pipe(Match.when(Option.isSome, (pin) => claim.formatId === pin.value), Match.orElse(() => claim.extensions.includes(command.extension)));
@@ -3586,13 +3582,11 @@ const assignedFrom = (claim, command) => FormatAssigned.make({
3586
3582
  });
3587
3583
  const skippedFrom = (command) => FormatSkipped.make({
3588
3584
  fileName: command.fileName,
3589
- extension: command.extension,
3590
- reason: `No installed format claims "${command.extension}". Install the framework plugin that claims this file type to instrument it.`
3585
+ extension: command.extension
3591
3586
  });
3592
3587
  const overrideUnclaimedFrom = (command, formatId) => FormatOverrideUnclaimed.make({
3593
3588
  fileName: command.fileName,
3594
- formatId,
3595
- reason: `No installed format carries the id "${formatId}" pinned for this file.`
3589
+ formatId
3596
3590
  });
3597
3591
  const ClaimSelected = S.TaggedStruct("ClaimSelected", { claim: FormatClaimSchema });
3598
3592
  const PinUnclaimed = S.TaggedStruct("PinUnclaimed", { formatId: S.String });
@@ -3611,9 +3605,13 @@ const selectionFor = (command) => Option.match(Option.fromUndefinedOr(claimFor(c
3611
3605
  });
3612
3606
  const resolveFormat = Workflow.make({
3613
3607
  command: FormatResolutionCommand,
3614
- decision: S.Union([FormatAssigned, FormatSkipped]),
3615
- error: FormatOverrideUnclaimed,
3616
- decide: (command) => Match.value(selectionFor(command)).pipe(Match.tag("ClaimSelected", ({ claim }) => Result.succeed(assignedFrom(claim, command))), Match.tag("PinUnclaimed", ({ formatId }) => Result.fail(overrideUnclaimedFrom(command, formatId))), Match.tag("ExtensionUnclaimed", () => Result.succeed(skippedFrom(command))), Match.exhaustive)
3608
+ decision: S.Union([
3609
+ FormatAssigned,
3610
+ FormatSkipped,
3611
+ FormatOverrideUnclaimed
3612
+ ]),
3613
+ error: S.Never,
3614
+ decide: (command) => Match.value(selectionFor(command)).pipe(Match.tag("ClaimSelected", ({ claim }) => Result.succeed(assignedFrom(claim, command))), Match.tag("PinUnclaimed", ({ formatId }) => Result.succeed(overrideUnclaimedFrom(command, formatId))), Match.tag("ExtensionUnclaimed", () => Result.succeed(skippedFrom(command))), Match.exhaustive)
3617
3615
  });
3618
3616
  const AridRuleId = S.Literals([
3619
3617
  "arid-logging",
@@ -5242,20 +5240,22 @@ const parsedOutcomeFor = (registry, file, assigned) => Option.match(registry.ent
5242
5240
  }
5243
5241
  }))
5244
5242
  });
5243
+ const skipReasonOf = (skipped) => `No installed format claims "${skipped.extension}". Install the framework plugin that claims this file type to instrument it.`;
5244
+ const overrideUnclaimedTextOf = (unclaimed) => `Cannot instrument ${unclaimed.fileName}: No installed format carries the id "${unclaimed.formatId}" pinned for this file.`;
5245
5245
  const skippedOutcomeFor = (file, skipped) => ({
5246
5246
  kind: "skipped",
5247
5247
  record: InstrumentFileSkip.make({
5248
5248
  file: file.name,
5249
5249
  extension: skipped.extension,
5250
- reason: skipped.reason
5250
+ reason: skipReasonOf(skipped)
5251
5251
  })
5252
5252
  });
5253
5253
  const unclaimedOverrideError = (file) => InstrumentError.make({
5254
5254
  message: `No installed format owns ${file.name}`,
5255
5255
  cause: /* @__PURE__ */ new Error(`Unresolvable format pin for ${file.name}`)
5256
5256
  });
5257
- const outcomeFor = (registry, file, decision) => Match.value(decision).pipe(Match.when(S.is(FormatAssigned), (assigned) => parsedOutcomeFor(registry, file, assigned)), Match.when(S.is(FormatSkipped), (skipped) => Effect.succeed(skippedOutcomeFor(file, skipped))), Match.exhaustive);
5258
- const fileOutcome = (request) => Match.value(resolveFile(request.registry, request.file.name)).pipe(Match.when(Result.isSuccess, (resolved) => outcomeFor(request.registry, request.file, resolved.success)), Match.orElse(() => Effect.fail(unclaimedOverrideError(request.file))));
5257
+ const outcomeFor = (registry, file, decision) => Match.value(decision).pipe(Match.when(S.is(FormatAssigned), (assigned) => parsedOutcomeFor(registry, file, assigned)), Match.when(S.is(FormatSkipped), (skipped) => Effect.succeed(skippedOutcomeFor(file, skipped))), Match.when(S.is(FormatOverrideUnclaimed), () => Effect.fail(unclaimedOverrideError(file))), Match.exhaustive);
5258
+ const fileOutcome = (request) => Effect.flatMap(Effect.fromResult(resolveFile(request.registry, request.file.name)), (decision) => outcomeFor(request.registry, request.file, decision));
5259
5259
  const isParsedOutcome = (outcome) => outcome.kind === "parsed";
5260
5260
  const skipsOf = (outcome) => outcome.kind === "skipped" ? [outcome.record] : [];
5261
5261
  const transformInto = (request) => transform(request.ast, request.collector, {
@@ -5427,7 +5427,10 @@ const disableTypeChecksCell = Sandwich.named(SpanTaxonomy.Spans.instrumentDisabl
5427
5427
  formatId: assigned.formatId
5428
5428
  }),
5429
5429
  FormatSkipped: (_skipped, raw) => Effect.succeed(raw.file),
5430
- FormatOverrideUnclaimed: (failure) => Effect.fail(FormatOverrideUnclaimed.make(failure)),
5430
+ FormatOverrideUnclaimed: (unclaimed, raw) => Effect.fail(InstrumentError.make({
5431
+ message: `No installed format owns ${raw.file.name}`,
5432
+ cause: new Error(overrideUnclaimedTextOf(unclaimed))
5433
+ })),
5431
5434
  CommandRejected: ({ issue }) => Effect.fail(InstrumentError.make({
5432
5435
  message: issue,
5433
5436
  cause: new Error(issue)
@@ -5536,9 +5539,6 @@ const disableTypeChecksDataFirst = (file, registry = coreFormatRegistry) => disa
5536
5539
  }).pipe(Effect.map((disabled) => ({
5537
5540
  ...file,
5538
5541
  content: disabled.content
5539
- })), Effect.mapError((cause) => S.is(InstrumentError)(cause) ? cause : InstrumentError.make({
5540
- message: `No installed format owns ${file.name}`,
5541
- cause
5542
5542
  })));
5543
5543
  const disableTypeChecks = dual((args) => Predicate.hasProperty(args[0], "content"), disableTypeChecksDataFirst);
5544
5544
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@systemfsoftware/stryker-js-instrumenter",
3
- "version": "16.0.1",
3
+ "version": "16.0.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/systemfsoftware/stryker-js-effect.git",
@@ -28,7 +28,7 @@
28
28
  "@oxc-project/types": "^0.150.0",
29
29
  "@systemfsoftware/effect-cell-types": "^12.1.4",
30
30
  "@systemfsoftware/stryker-framework-interface": "^0.0.3",
31
- "@systemfsoftware/stryker-js-cli-contract": "^3.0.1",
31
+ "@systemfsoftware/stryker-js-cli-contract": "^3.1.0",
32
32
  "@systemfsoftware/stryker-js-plugin-interface": "^19.0.1",
33
33
  "oxc-parser": "^0.150.0",
34
34
  "oxc-walker": "^1"