@systemfsoftware/stryker-js-plugin-interface 7.1.0 → 7.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-plugin-interface
2
2
 
3
+ ## 7.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Effect moves to `4.0.0-rc.116` (with `@effect/platform-node`, `@effect/platform-node-shared`, `@effect/vitest` and `@effect/opentelemetry` on the same release), the `@systemfsoftware/*` toolchain pins move to their current releases, and `vitest` 5 with `oxc-parser` 0.150 come along. Both worker bundles (`stryker-js-typescript-checker`, `stryker-js-vitest-runner`) now inline their whole runtime rather than resolving `effect`, `@effect/*` and the sibling packages from the host's tree, so a worker runs on its own copy of the effect that built it; the project's `typescript` and `vitest` remain the only imports beside Node builtins. The filter-level `arbitrary.candidate` generators that the thresholds schemas carried are gone: v4 no longer reads them, so thresholds still reject a `low` above `high` and the property tests generate the pair from the schema again. Log calls inside `Effect.catch*` handlers moved to `Effect.tapError`/`Effect.tapCause` at the same level and message. `@systemfsoftware/stryker-ignorer-interface` re-exports the 0.150 AST, where `FormalParameterRest.decorators` is now `Array<Decorator>`.
8
+
3
9
  ## 7.1.0
4
10
 
5
11
  ### Minor Changes
package/dist/index.d.mts CHANGED
@@ -579,11 +579,19 @@ declare const MutantTested_base: S.Class<MutantTested, S.TaggedStruct<"mutantTes
579
579
 
580
580
  export declare type MutationScoreThresholds = typeof MutationScoreThresholdsSchema.Type;
581
581
 
582
- export declare const MutationScoreThresholdsSchema: S.Struct<{
582
+ export declare const MutationScoreThresholdsSchema: S.decodeTo<S.declare<{
583
+ readonly high: number;
584
+ readonly low: number;
585
+ readonly break: number | null;
586
+ }, {
587
+ readonly high: number;
588
+ readonly low: number;
589
+ readonly break: number | null;
590
+ }>, S.Struct<{
583
591
  readonly high: S.withDecodingDefaultKey<S.Finite, never>;
584
592
  readonly low: S.withDecodingDefaultKey<S.Finite, never>;
585
593
  readonly break: S.withDecodingDefaultKey<S.NullOr<S.Finite>, never>;
586
- }>;
594
+ }>, never, never>;
587
595
 
588
596
  export declare class MutationTestingPlanReady extends MutationTestingPlanReady_base {}
589
597
 
@@ -629,10 +637,16 @@ declare const MutationTestReportReady_base: S.Class<MutationTestReportReady, S.T
629
637
  readonly duration: S.optional<S.Finite>;
630
638
  }>>;
631
639
  }>>;
632
- readonly thresholds: S.Struct<{
640
+ readonly thresholds: S.decodeTo<S.declare<{
641
+ readonly high: number;
642
+ readonly low: number;
643
+ }, {
644
+ readonly high: number;
645
+ readonly low: number;
646
+ }>, S.Struct<{
633
647
  readonly high: S.Finite;
634
648
  readonly low: S.Finite;
635
- }>;
649
+ }>, never, never>;
636
650
  readonly config: S.optional<S.$Record<S.String, S.Unknown>>;
637
651
  readonly testFiles: S.optional<S.$Record<S.String, S.Struct<{
638
652
  readonly source: S.optional<S.String>;
@@ -696,10 +710,16 @@ export declare const MutationTestResultSchema: S.Struct<{
696
710
  readonly duration: S.optional<S.Finite>;
697
711
  }>>;
698
712
  }>>;
699
- readonly thresholds: S.Struct<{
713
+ readonly thresholds: S.decodeTo<S.declare<{
714
+ readonly high: number;
715
+ readonly low: number;
716
+ }, {
717
+ readonly high: number;
718
+ readonly low: number;
719
+ }>, S.Struct<{
700
720
  readonly high: S.Finite;
701
721
  readonly low: S.Finite;
702
- }>;
722
+ }>, never, never>;
703
723
  readonly config: S.optional<S.$Record<S.String, S.Unknown>>;
704
724
  readonly testFiles: S.optional<S.$Record<S.String, S.Struct<{
705
725
  readonly source: S.optional<S.String>;
@@ -949,11 +969,19 @@ export declare const StrykerOptionsSchema: S.StructWithRest<S.Struct<{
949
969
  readonly options: S.optional<S.$Record<S.String, S.Unknown>>;
950
970
  }>]>, never>;
951
971
  readonly testRunnerNodeArgs: S.withDecodingDefaultKey<S.$Array<S.String>, never>;
952
- readonly thresholds: S.withDecodingDefaultKey<S.Struct<{
972
+ readonly thresholds: S.withDecodingDefaultKey<S.decodeTo<S.declare<{
973
+ readonly high: number;
974
+ readonly low: number;
975
+ readonly break: number | null;
976
+ }, {
977
+ readonly high: number;
978
+ readonly low: number;
979
+ readonly break: number | null;
980
+ }>, S.Struct<{
953
981
  readonly high: S.withDecodingDefaultKey<S.Finite, never>;
954
982
  readonly low: S.withDecodingDefaultKey<S.Finite, never>;
955
983
  readonly break: S.withDecodingDefaultKey<S.NullOr<S.Finite>, never>;
956
- }>, never>;
984
+ }>, never, never>, never>;
957
985
  readonly timeoutFactor: S.withDecodingDefaultKey<S.Finite, never>;
958
986
  readonly timeoutMS: S.withDecodingDefaultKey<S.Finite, never>;
959
987
  readonly dryRunTimeoutMinutes: S.withDecodingDefaultKey<S.Finite, never>;
@@ -1167,10 +1195,16 @@ export declare type TestStatus = typeof TestStatus.Type;
1167
1195
 
1168
1196
  export declare type Thresholds = typeof ThresholdsSchema.Type;
1169
1197
 
1170
- export declare const ThresholdsSchema: S.Struct<{
1198
+ export declare const ThresholdsSchema: S.decodeTo<S.declare<{
1199
+ readonly high: number;
1200
+ readonly low: number;
1201
+ }, {
1202
+ readonly high: number;
1203
+ readonly low: number;
1204
+ }>, S.Struct<{
1171
1205
  readonly high: S.Finite;
1172
1206
  readonly low: S.Finite;
1173
- }>;
1207
+ }>, never, never>;
1174
1208
 
1175
1209
  export declare interface TimeoutDryRunResult {
1176
1210
  readonly status: 'timeout';
package/dist/index.mjs CHANGED
@@ -3,8 +3,8 @@ import * as Context from "effect/Context";
3
3
  import * as S from "effect/Schema";
4
4
  import * as Rpc from "effect/unstable/rpc/Rpc";
5
5
  import * as RpcGroup from "effect/unstable/rpc/RpcGroup";
6
+ import { Effect, SchemaGetter, SchemaTransformation } from "effect";
6
7
  import * as RpcMiddleware from "effect/unstable/rpc/RpcMiddleware";
7
- import { Effect } from "effect";
8
8
  import * as Match from "effect/Match";
9
9
  import * as Option from "effect/Option";
10
10
  //#region src/Checker.schema.ts
@@ -186,24 +186,30 @@ const TestFileSchema = S.Struct({
186
186
  tests: S.Array(TestDefinitionSchema)
187
187
  });
188
188
  const TestFileDefinitionDictionarySchema = S.Record(S.String, TestFileSchema);
189
- const ThresholdsSchema = S.Struct({
189
+ const ThresholdsValuesSchema = S.Struct({
190
190
  high: Percentage,
191
191
  low: Percentage
192
- }).pipe(S.check(S.makeFilter((t) => t.low <= t.high, {
193
- expected: "thresholds where low <= high",
194
- arbitrary: { candidate: { make: (fc) => fc.tuple(fc.float({
195
- min: 0,
196
- max: 100,
197
- noNaN: true
198
- }), fc.float({
199
- min: 0,
200
- max: 100,
201
- noNaN: true
202
- })).map(([a, b]) => ({
203
- high: Math.max(a, b),
204
- low: Math.min(a, b)
205
- })) } }
206
- })));
192
+ });
193
+ const isThresholds = (value) => S.is(ThresholdsValuesSchema)(value) && value.low <= value.high;
194
+ /**
195
+ * The pair is *built* ordered — a drawn pair is sorted — rather than drawn at
196
+ * random and discarded until it happens to be ordered. The invariant lives on
197
+ * the declaration because a filter over the pair cannot express `low <= high`
198
+ * in the generation-constraint vocabulary, and only a declaration carries a
199
+ * `toCodecArbitrary` derivation. `ThresholdsValuesSchema` stays the wire side, so
200
+ * decoding keeps its field paths.
201
+ */
202
+ const OrderedThresholds = S.declare(isThresholds, {
203
+ message: "expected thresholds where low <= high",
204
+ toCodecArbitrary: () => S.link()(ThresholdsValuesSchema, {
205
+ decode: SchemaGetter.transform(({ high, low }) => ({
206
+ high: Math.max(high, low),
207
+ low: Math.min(high, low)
208
+ })),
209
+ encode: SchemaGetter.transform((thresholds) => thresholds)
210
+ })
211
+ });
212
+ const ThresholdsSchema = ThresholdsValuesSchema.pipe(S.decodeTo(OrderedThresholds, SchemaTransformation.passthrough()));
207
213
  const BrandingInformationSchema = S.Struct({
208
214
  homepageUrl: S.String,
209
215
  imageUrl: S.optional(S.String)
@@ -548,30 +554,32 @@ const ClearTextReporterOptions = openStruct({
548
554
  });
549
555
  const HtmlReporterOptions = S.Struct({ fileName: defaulted(S.String, "reports/mutation/mutation.html") });
550
556
  const JsonReporterOptions = S.Struct({ fileName: defaulted(S.String, "reports/mutation/mutation.json") });
551
- const MutationScoreThresholdsSchema = S.Struct({
557
+ const MutationScoreThresholdsValuesSchema = S.Struct({
552
558
  high: defaulted(Percentage, 80),
553
559
  low: defaulted(Percentage, 60),
554
560
  break: defaulted(S.NullOr(Percentage), null)
555
- }).pipe(S.check(S.makeFilter((t) => t.low <= t.high, {
556
- expected: "thresholds where low <= high",
557
- arbitrary: { candidate: { make: (fc) => fc.tuple(fc.float({
558
- min: 0,
559
- max: 100,
560
- noNaN: true
561
- }), fc.float({
562
- min: 0,
563
- max: 100,
564
- noNaN: true
565
- }), fc.option(fc.float({
566
- min: 0,
567
- max: 100,
568
- noNaN: true
569
- }), { nil: null })).map(([a, b, brk]) => ({
570
- high: Math.max(a, b),
571
- low: Math.min(a, b),
572
- break: brk
573
- })) } }
574
- })));
561
+ });
562
+ const isMutationScoreThresholds = (value) => S.is(MutationScoreThresholdsValuesSchema)(value) && value.low <= value.high;
563
+ /**
564
+ * The pair is *built* ordered — a drawn pair is sorted — rather than drawn at
565
+ * random and discarded until it happens to be ordered. The invariant lives on
566
+ * the declaration because a filter over the pair cannot express `low <= high`
567
+ * in the generation-constraint vocabulary, and only a declaration carries a
568
+ * `toCodecArbitrary` derivation. The struct stays the wire side, so decoding
569
+ * keeps member defaults and field paths.
570
+ */
571
+ const OrderedMutationScoreThresholds = S.declare(isMutationScoreThresholds, {
572
+ message: "expected thresholds where low <= high",
573
+ toCodecArbitrary: () => S.link()(MutationScoreThresholdsValuesSchema, {
574
+ decode: SchemaGetter.transform(({ break: breaking, high, low }) => ({
575
+ break: breaking,
576
+ high: Math.max(high, low),
577
+ low: Math.min(high, low)
578
+ })),
579
+ encode: SchemaGetter.transform((thresholds) => thresholds)
580
+ })
581
+ });
582
+ const MutationScoreThresholdsSchema = MutationScoreThresholdsValuesSchema.pipe(S.decodeTo(OrderedMutationScoreThresholds, SchemaTransformation.passthrough()));
575
583
  const MutatorDescriptor = S.Struct({ excludedMutations: defaulted(S.Array(S.String), []) });
576
584
  const WarningOptions = openStruct({
577
585
  unknownOptions: defaulted(S.Boolean, true),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@systemfsoftware/stryker-js-plugin-interface",
3
- "version": "7.1.0",
3
+ "version": "7.1.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/systemfsoftware/stryker-js-effect.git",
@@ -18,24 +18,24 @@
18
18
  "node": ">=20.0.0"
19
19
  },
20
20
  "dependencies": {
21
- "effect": "4.0.0-rc.112",
21
+ "effect": "4.0.0-rc.116",
22
22
  "@systemfsoftware/stryker-js-instrumenter": "^8.0.0"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@effect/tsgo": "^0.45.0",
26
26
  "@microsoft/api-extractor": "^7",
27
- "@systemfsoftware/all": "^2",
28
- "@systemfsoftware/arethetypeswrong-cli": "^4",
29
- "@systemfsoftware/effect-schema-law": "^2",
30
- "@systemfsoftware/effect-schema-vite": "^2",
31
- "@systemfsoftware/tsconfig": "^1",
27
+ "@systemfsoftware/all": "^2.1.1",
28
+ "@systemfsoftware/arethetypeswrong-cli": "^4.2.0",
29
+ "@systemfsoftware/effect-schema-law": "^2.2.0",
30
+ "@systemfsoftware/effect-schema-vite": "^2.2.0",
31
+ "@systemfsoftware/tsconfig": "^1.3.5",
32
32
  "@types/node": "^24",
33
33
  "oxlint": "^1",
34
34
  "oxlint-tsgolint": "^7",
35
35
  "rimraf": "^6.1.3",
36
36
  "tsdown": "^0.23.0",
37
37
  "typescript": "^7",
38
- "vitest": "^4",
38
+ "vitest": "^5",
39
39
  "@systemfsoftware/tsdown-config": "^0.1.0",
40
40
  "@systemfsoftware/vitest-config": "^0.1.0"
41
41
  },