@systemfsoftware/stryker-js-instrumenter 15.0.0 → 16.0.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,22 @@
1
1
  # @systemfsoftware/stryker-js-instrumenter
2
2
 
3
+ ## 16.0.1
4
+
5
+ Updated dependency @systemfsoftware/stryker-framework-interface to 0.0.3
6
+
7
+ ## 16.0.0
8
+
9
+ `effect` is a peer dependency (`^4.1.2`) of every package whose library entry points import it, so a consumer's schemas, layers and errors and these packages' share one effect instance.
10
+
11
+ - cli-contract, plugin-interface, instrumenter, typescript-checker and plugin-runtime declared `effect` as a dependency. A consumer on another 4.1.x got a second copy, and the contract's `ShardPlan` no longer type-checked against the consumer's effect. They now peer on it; install `effect` yourself.
12
+ - stryker-js and the html-reporter already peered on `effect`; the floor rises from 4.1.0 to 4.1.2, the version these packages are built and tested with.
13
+
14
+ The processes Stryker starts are unchanged: the CLI (`main.mjs`), the TypeScript checker's worker and the vitest runner's worker bundle their own effect 4.1.2. The flake package `stryker-package` now declares `effect` itself.
15
+
16
+ The default mutant-set policy compares the code each candidate plants: the printed node without its outer parentheses, as the placers unwrap it. It no longer strips parentheses from text, which miscounted a parenthesis inside a string, regex, template or comment.
17
+
18
+ The install section names `pnpm add` and the npm packages instead of the flake. The workspace takes the released packages it dogfoods from npm; no published manifest changes.
19
+
3
20
  ## 15.0.0
4
21
 
5
22
  The repository's own mutation and test tooling now installs the v20.0.0 release tarballs; the published code and the dependencies a consumer installs are unchanged.
package/dist/index.mjs CHANGED
@@ -4079,20 +4079,11 @@ var MutantKept = class extends S.TaggedClass()("MutantKept", {}) {
4079
4079
  };
4080
4080
  const MutantSetOutcome = S.Union([MutantSuppressed, MutantKept]);
4081
4081
  const MutantSetDecision = S.Array(MutantSetOutcome);
4082
- const canonicalForm = (text) => stripOuterParentheses(text.trim());
4083
- const stripOuterParentheses = (text) => Match.value(wrapsWhole(text)).pipe(Match.when(true, () => stripOuterParentheses(text.slice(1, -1).trim())), Match.orElse(() => text));
4084
- const parenDepthDelta = (character) => Match.value(character).pipe(Match.when("(", () => 1), Match.when(")", () => -1), Match.orElse(() => 0));
4085
- const depthsAfter = (text) => text.split("").reduce((depths, character) => [...depths, Option.getOrElse(Arr.last(depths), () => 0) + parenDepthDelta(character)], []);
4086
- const wrapsWhole = (text) => {
4087
- const depths = depthsAfter(text);
4088
- return [
4089
- text.startsWith("("),
4090
- text.endsWith(")"),
4091
- depths.length > 0,
4092
- depths.slice(0, -1).every((depth) => depth >= 1),
4093
- Option.getOrElse(Arr.last(depths), () => 0) === 0
4094
- ].every(Boolean);
4095
- };
4082
+ /**
4083
+ * The code a candidate plants, as the instrumenter's printer wrote it from the node the placers plant. Two candidates
4084
+ * plant the same code exactly when these texts are equal, so the policy compares text and reparses nothing.
4085
+ */
4086
+ const canonicalForm = (text) => text.trim();
4096
4087
  const defaultOnly = (policy, value) => Match.value(policy).pipe(Match.when("full", () => Option.none()), Match.when("default", value), Match.exhaustive);
4097
4088
  const printedAs = (code) => canonicalForm(code);
4098
4089
  const printsSomething = (code) => printedAs(code).length > 0;
@@ -4821,6 +4812,7 @@ const mutablesFor = (frame, location, context) => {
4821
4812
  const ignorerAnswer = Option.getOrUndefined(ignorerAnswerFor(frame.node, ancestors, context.ignorers));
4822
4813
  const aridReason = Option.getOrUndefined(aridReasonOf(frame, context.mutantSetPolicy, context.aridImportTable));
4823
4814
  const originalCode = printNode(frame.node);
4815
+ const plantedOriginal = printNode(unwrapParenthesizedExpression(frame.node));
4824
4816
  return replacements.map(({ mutatorName, replacement }) => {
4825
4817
  const replacementCode = printNode(replacement);
4826
4818
  const tuple = {
@@ -4843,8 +4835,8 @@ const mutablesFor = (frame, location, context) => {
4843
4835
  ignorerAnswer,
4844
4836
  ...aridReason === void 0 ? {} : { aridReason },
4845
4837
  mutantSet: {
4846
- originalCode,
4847
- replacementCode
4838
+ originalCode: plantedOriginal,
4839
+ replacementCode: printNode(unwrapParenthesizedExpression(replacement))
4848
4840
  },
4849
4841
  subsumption: subsumptionReplacementOf(mutatorName, replacement)
4850
4842
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@systemfsoftware/stryker-js-instrumenter",
3
- "version": "15.0.0",
3
+ "version": "16.0.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/systemfsoftware/stryker-js-effect.git",
@@ -26,11 +26,10 @@
26
26
  "@eslint-community/regexpp": "^4.12.2",
27
27
  "@noble/hashes": "^2",
28
28
  "@oxc-project/types": "^0.150.0",
29
- "@systemfsoftware/effect-cell-types": "^12.0.0",
30
- "@systemfsoftware/stryker-framework-interface": "^0.0.2",
31
- "@systemfsoftware/stryker-js-cli-contract": "^2.0.0",
32
- "@systemfsoftware/stryker-js-plugin-interface": "^18.0.0",
33
- "effect": "^4.1.0",
29
+ "@systemfsoftware/effect-cell-types": "^12.1.4",
30
+ "@systemfsoftware/stryker-framework-interface": "^0.0.3",
31
+ "@systemfsoftware/stryker-js-cli-contract": "^3.0.1",
32
+ "@systemfsoftware/stryker-js-plugin-interface": "^19.0.1",
34
33
  "oxc-parser": "^0.150.0",
35
34
  "oxc-walker": "^1"
36
35
  },
@@ -43,17 +42,18 @@
43
42
  "@systemfsoftware/effect-schema-recursion-budget": "^2.0.0",
44
43
  "@systemfsoftware/oxlint-config-recommended": "^4.0.0",
45
44
  "@systemfsoftware/stryker-config": "^0.1.0",
46
- "@systemfsoftware/stryker-ignorer-effect-schema-declarations": "^0.3.1",
47
- "@systemfsoftware/stryker-ignorer-in-source-vitest-block": "file:../../.deps/stryker-ignorer-in-source-vitest-block.tgz",
48
- "@systemfsoftware/stryker-ignorer-interface": "^0.1.3",
49
- "@systemfsoftware/stryker-js": "file:../../.deps/stryker-js.tgz",
50
- "@systemfsoftware/stryker-js-typescript-checker": "file:../../.deps/stryker-js-typescript-checker.tgz",
51
- "@systemfsoftware/stryker-js-vitest-runner": "file:../../.deps/stryker-js-vitest-runner.tgz",
45
+ "@systemfsoftware/stryker-ignorer-effect-schema-declarations": "^0.3.2",
46
+ "@systemfsoftware/stryker-ignorer-in-source-vitest-block": "^0.1.3",
47
+ "@systemfsoftware/stryker-ignorer-interface": "^0.1.4",
48
+ "@systemfsoftware/stryker-js": "^23.0.0",
49
+ "@systemfsoftware/stryker-js-typescript-checker": "^10.0.0",
50
+ "@systemfsoftware/stryker-js-vitest-runner": "^10.1.0",
52
51
  "@systemfsoftware/tsconfig": "^2.0.1",
53
52
  "@systemfsoftware/tsdown-config": "^0.1.0",
54
53
  "@systemfsoftware/vitest": "^2.0.0",
55
54
  "@systemfsoftware/vitest-config": "^0.1.0",
56
55
  "@types/node": "^24",
56
+ "effect": "^4.1.2",
57
57
  "oxlint": "~1.90.0",
58
58
  "rimraf": "^6.1.3",
59
59
  "tsdown": "^0.23.0",
@@ -67,6 +67,9 @@
67
67
  "access": "public",
68
68
  "provenance": true
69
69
  },
70
+ "peerDependencies": {
71
+ "effect": "^4.1.2"
72
+ },
70
73
  "scripts": {
71
74
  "clean": "rimraf dist",
72
75
  "build": "tsdown",