@systemfsoftware/stryker-ignorer-angular 0.1.1 → 0.1.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,11 @@
1
1
  # @systemfsoftware/stryker-ignorer-angular
2
2
 
3
+ ## 0.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Stages now run as cells over workflows, multi-item work runs as Effect streams, pools and worker transport use scoped Effect resources, and named operations are traced with Effect.fn. The Angular ignorer now declares @systemfsoftware/stryker-ignorer-kit as a runtime dependency.
8
+
3
9
  ## 0.1.1
4
10
 
5
11
  ### Patch Changes
package/dist/index.mjs CHANGED
@@ -1,4 +1,5 @@
1
- //#region src/AngularSignalIgnore.ts
1
+ import { defineIgnorer } from "@systemfsoftware/stryker-ignorer-kit";
2
+ //#region src/angular-signals.ts
2
3
  const INPUT_MODEL_OUTPUT_CONFIG_MSG = "Angular signal based input, model and output functions configuration object cannot be mutated as that causes issues with the Angular compiler.";
3
4
  const SIGNAL_QUERY_OPTIONS_MSG = "Angular signal query options object cannot be mutated as that causes issues with the Angular compiler.";
4
5
  const SIGNAL_IO_FUNCTIONS = Object.freeze([
@@ -38,37 +39,34 @@ const ownsPropertyDefinitionField = (owner) => owner?.type === "PropertyDefiniti
38
39
  const ownsClassField = (owner) => CLASS_FIELD_KINDS.some((kind) => kind === owner?.type);
39
40
  const holdsArgument = (call, node) => call.arguments.some((argument) => argument === node);
40
41
  const isObjectArgumentOf = (node, call) => isObjectExpression(node) && holdsArgument(call, node);
41
- const parentCallOf = (ancestors, offset) => {
42
- const parent = ancestors[offset];
43
- return isCallExpression(parent) ? parent : void 0;
44
- };
45
- const callOfObjectArgument = (node, call) => isObjectArgumentOf(node, call) ? call : void 0;
46
- const argumentCallOf = (node, ancestors, offset) => {
47
- const call = parentCallOf(ancestors, offset);
48
- return call === void 0 ? void 0 : callOfObjectArgument(node, call);
49
- };
50
- const ownedCallOf = (node, ancestors, offset, ownsCallSite) => {
51
- const call = argumentCallOf(node, ancestors, offset);
52
- return ownsCallSite(ancestors[offset + 1]) ? call : void 0;
42
+ const holdsObjectArgument = (parent, node) => isCallExpression(parent) && isObjectArgumentOf(node, parent);
43
+ const objectArgumentCall = (node, parent) => holdsObjectArgument(parent, node) ? parent : void 0;
44
+ const ownedCallOf = (node, parent, owner, ownsCallSite) => {
45
+ const call = objectArgumentCall(node, parent);
46
+ return ownsCallSite(owner) ? call : void 0;
53
47
  };
54
48
  const isArgumentAt = (index, call, node) => index !== void 0 && call.arguments[index] === node;
55
49
  const ioConfigReason = (call, node) => isArgumentAt(signalIoArgumentIndex(call.callee), call, node) ? INPUT_MODEL_OUTPUT_CONFIG_MSG : void 0;
56
50
  const isQueryOptionsArgument = (call, node) => isSignalQueryCall(call.callee) && isArgumentAt(1, call, node);
57
51
  const queryOptionsReason = (call, node) => isQueryOptionsArgument(call, node) ? SIGNAL_QUERY_OPTIONS_MSG : void 0;
58
- const ioReasonOf = (node, ancestors, offset) => {
59
- const call = ownedCallOf(node, ancestors, offset, ownsPropertyDefinitionField);
52
+ const ioReasonFor = (node, parent, owner) => {
53
+ const call = ownedCallOf(node, parent, owner, ownsPropertyDefinitionField);
60
54
  return call === void 0 ? void 0 : ioConfigReason(call, node);
61
55
  };
62
- const queryReasonOf = (node, ancestors, offset) => {
63
- const call = ownedCallOf(node, ancestors, offset, ownsClassField);
56
+ const queryReasonFor = (node, parent, owner) => {
57
+ const call = ownedCallOf(node, parent, owner, ownsClassField);
64
58
  return call === void 0 ? void 0 : queryOptionsReason(call, node);
65
59
  };
66
- const reasonAt = (node, ancestors, offset) => ioReasonOf(node, ancestors, offset) ?? queryReasonOf(node, ancestors, offset);
67
- const ancestorReason = (node, ancestors) => ancestors.map((ancestor, position) => reasonAt(ancestor, ancestors, position + 1)).find((reason) => reason !== void 0);
68
- const shouldIgnore = (node, ancestors) => reasonAt(node, ancestors, 0) ?? ancestorReason(node, ancestors);
69
- const strykerIgnorers = [{
60
+ const reasonFor = (node, parent, owner) => ioReasonFor(node, parent, owner) ?? queryReasonFor(node, parent, owner);
61
+ const pointReason = (node, ancestors) => reasonFor(node, ancestors[0], ancestors[1]);
62
+ const ancestorReason = (ancestors) => ancestors.map((ancestor, position) => reasonFor(ancestor, ancestors[position + 1], ancestors[position + 2])).find((reason) => reason !== void 0);
63
+ const shouldIgnore = (node, ancestors) => pointReason(node, ancestors) ?? ancestorReason(ancestors);
64
+ const strykerIgnorers = [defineIgnorer({
70
65
  name: "angular-signals",
71
- shouldIgnore
72
- }];
66
+ visitors: {
67
+ ObjectExpression: (node, ctx) => pointReason(node, ctx.ancestors),
68
+ onAnyNode: (_node, ctx) => ancestorReason(ctx.ancestors)
69
+ }
70
+ })];
73
71
  //#endregion
74
72
  export { INPUT_MODEL_OUTPUT_CONFIG_MSG, SIGNAL_QUERY_OPTIONS_MSG, shouldIgnore, strykerIgnorers };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@systemfsoftware/stryker-ignorer-angular",
3
3
  "license": "Apache-2.0",
4
- "version": "0.1.1",
4
+ "version": "0.1.2",
5
5
  "author": "Ryan Lee <drdgvhbh@gmail.com>",
6
6
  "repository": {
7
7
  "type": "git",
@@ -32,12 +32,14 @@
32
32
  "./package.json": "./package.json"
33
33
  },
34
34
  "dependencies": {
35
+ "@systemfsoftware/stryker-ignorer-kit": "^0.1.1",
35
36
  "@systemfsoftware/stryker-ignorer-interface": "^0.1.1"
36
37
  },
37
38
  "devDependencies": {
38
39
  "@microsoft/api-extractor": "^7",
39
40
  "@systemfsoftware/arethetypeswrong-cli": "^4.2.0",
40
- "@systemfsoftware/tsconfig": "^1.3.6",
41
+ "@systemfsoftware/tsconfig": "^2.0.1",
42
+ "@systemfsoftware/vitest": "^0.1.0",
41
43
  "@types/node": "^24",
42
44
  "@vitest/coverage-v8": "^5",
43
45
  "oxlint": "^1",
@@ -45,9 +47,8 @@
45
47
  "tsdown": "^0.23.0",
46
48
  "typescript": "^7",
47
49
  "vitest": "^5",
48
- "@systemfsoftware/oxlint-ignorer-config": "^0.1.1",
49
- "@systemfsoftware/stryker-ignorer-kit": "^0.1.1",
50
50
  "@systemfsoftware/tsdown-config": "^0.1.0",
51
+ "@systemfsoftware/oxlint-ignorer-config": "^0.1.1",
51
52
  "@systemfsoftware/vitest-config": "^0.1.0"
52
53
  },
53
54
  "publishConfig": {
@@ -57,7 +58,7 @@
57
58
  "scripts": {
58
59
  "build": "tsdown",
59
60
  "clean": "rimraf dist",
60
- "typecheck": "tsc --noEmit --incremental && tsc -p tsconfig.node.json --noEmit",
61
+ "typecheck": "tsc -b",
61
62
  "test": "vitest run",
62
63
  "lint": "f=${OXLINT_FORMAT:-${AGENT:+agent}}; oxlint . --format=${f:-default}",
63
64
  "attw": "attw --pack .",