@systemfsoftware/stryker-plugins 0.3.6 → 0.4.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.
|
@@ -10,6 +10,7 @@ const StringLiteral = Schema.Struct({
|
|
|
10
10
|
value: Schema.String
|
|
11
11
|
});
|
|
12
12
|
const ObjectExpression = Schema.Struct({ type: Schema.Literal("ObjectExpression") });
|
|
13
|
+
const ArrowFunctionExpression = Schema.Struct({ type: Schema.Literal("ArrowFunctionExpression") });
|
|
13
14
|
const UnknownNode = Schema.Struct({ type: Schema.String });
|
|
14
15
|
const MemberExpression = Schema.suspend(() => Schema.Struct({
|
|
15
16
|
type: Schema.Literal("MemberExpression"),
|
|
@@ -21,23 +22,26 @@ const CallExpression = Schema.suspend(() => Schema.Struct({
|
|
|
21
22
|
callee: Schema.suspend(() => AstNode),
|
|
22
23
|
arguments: Schema.Array(Schema.suspend(() => AstNode))
|
|
23
24
|
}));
|
|
24
|
-
const AstNode = Schema.suspend(() => Schema.Union(Identifier, StringLiteral, ObjectExpression, MemberExpression, CallExpression, UnknownNode));
|
|
25
|
+
const AstNode = Schema.suspend(() => Schema.Union(Identifier, StringLiteral, ObjectExpression, ArrowFunctionExpression, MemberExpression, CallExpression, UnknownNode));
|
|
25
26
|
//#endregion
|
|
26
27
|
//#region src/effect-schema-ignorer/schema-declaration-ignore.ts
|
|
27
28
|
const SYMBOL_DESCRIPTION_IGNORED = "Symbol.for() brand description is identity-only data, not behaviour";
|
|
28
29
|
const TAGGED_TAG_IGNORED = "TaggedClass/TaggedError _tag is a declaration discriminant, not behaviour";
|
|
29
30
|
const TAGGED_FIELDS_IGNORED = "TaggedClass/TaggedError field schema is a declaration, not behaviour";
|
|
31
|
+
const OPTIONAL_DEFAULT_IGNORED = "optionalWith default value is config, not behaviour";
|
|
30
32
|
const TAGGED_FACTORIES = ["TaggedClass", "TaggedError"];
|
|
31
33
|
const isIdentifier = Schema.is(Identifier);
|
|
32
34
|
const isStringLiteral = Schema.is(StringLiteral);
|
|
33
35
|
const isObjectExpression = Schema.is(ObjectExpression);
|
|
36
|
+
const isArrowFunctionExpression = Schema.is(ArrowFunctionExpression);
|
|
34
37
|
const isMemberExpression = Schema.is(MemberExpression);
|
|
35
38
|
const isCallExpression = Schema.is(CallExpression);
|
|
36
39
|
const isNamedMember = (node, object, property) => isMemberExpression(node) && isIdentifier(node.object) && node.object.name === object && isIdentifier(node.property) && node.property.name === property;
|
|
37
40
|
const isSymbolForCallee = (callee) => isNamedMember(callee, "Symbol", "for");
|
|
38
|
-
const isTaggedFactoryReference = (reference) => isIdentifier(reference.property) && TAGGED_FACTORIES.includes(reference.property.name);
|
|
39
|
-
const isTaggedFactoryCallee = (callee) => isCallExpression(callee) &&
|
|
41
|
+
const isTaggedFactoryReference = (reference) => isMemberExpression(reference) && isIdentifier(reference.property) && TAGGED_FACTORIES.includes(reference.property.name);
|
|
42
|
+
const isTaggedFactoryCallee = (callee) => isCallExpression(callee) && isTaggedFactoryReference(callee.callee);
|
|
40
43
|
const isArgumentOf = (node, parent, index, calleeMatches) => isCallExpression(parent) && calleeMatches(parent.callee) && parent.arguments[index] === node;
|
|
44
|
+
const isOptionalWithCallee = (callee) => isNamedMember(callee, "S", "optionalWith");
|
|
41
45
|
const RULES = [
|
|
42
46
|
{
|
|
43
47
|
is: isStringLiteral,
|
|
@@ -56,6 +60,12 @@ const RULES = [
|
|
|
56
60
|
argumentIndex: 1,
|
|
57
61
|
calleeMatches: isTaggedFactoryCallee,
|
|
58
62
|
reason: TAGGED_FIELDS_IGNORED
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
is: isArrowFunctionExpression,
|
|
66
|
+
argumentIndex: 1,
|
|
67
|
+
calleeMatches: isOptionalWithCallee,
|
|
68
|
+
reason: OPTIONAL_DEFAULT_IGNORED
|
|
59
69
|
}
|
|
60
70
|
];
|
|
61
71
|
const decideSchemaDeclarationIgnore = (node, parent) => RULES.find((rule) => rule.is(node) && isArgumentOf(node, parent, rule.argumentIndex, rule.calleeMatches))?.reason;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as strykerPlugins } from "./effect-schema-ignorer-
|
|
1
|
+
import { t as strykerPlugins } from "./effect-schema-ignorer-D-acEaX8.mjs";
|
|
2
2
|
export { strykerPlugins };
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@systemfsoftware/stryker-plugins",
|
|
3
3
|
"license": "MIT",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.1",
|
|
5
5
|
"author": "Ryan Lee <drdgvhbh@gmail.com>",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -38,9 +38,6 @@
|
|
|
38
38
|
},
|
|
39
39
|
"./package.json": "./package.json"
|
|
40
40
|
},
|
|
41
|
-
"dependencies": {
|
|
42
|
-
"effect": "^3.22.0"
|
|
43
|
-
},
|
|
44
41
|
"devDependencies": {
|
|
45
42
|
"@babel/types": "^7.29.0",
|
|
46
43
|
"@effect/vitest": "0.30.0",
|
|
@@ -49,20 +46,22 @@
|
|
|
49
46
|
"@stryker-mutator/vitest-runner": "^9.6.1",
|
|
50
47
|
"@types/node": "^24",
|
|
51
48
|
"@vitest/coverage-v8": "^4",
|
|
49
|
+
"effect": "^3.22.0",
|
|
52
50
|
"rimraf": "^6.1.3",
|
|
53
51
|
"tsdown": "^0.22.9",
|
|
54
52
|
"tstyche": "^7.1.0",
|
|
55
53
|
"vitest": "^4",
|
|
56
|
-
"@systemfsoftware/
|
|
54
|
+
"@systemfsoftware/arethetypeswrong-cli": "^1.0.7",
|
|
55
|
+
"@systemfsoftware/effect-schema-law": "^0.3.9",
|
|
57
56
|
"@systemfsoftware/oxlint-config": "^0.1.0",
|
|
58
|
-
"@systemfsoftware/stryker-js-typescript-checker": "^1.1.
|
|
59
|
-
"@systemfsoftware/
|
|
60
|
-
"@systemfsoftware/
|
|
61
|
-
"@systemfsoftware/tsconfig": "^1.2.4",
|
|
57
|
+
"@systemfsoftware/stryker-js-typescript-checker": "^1.1.6",
|
|
58
|
+
"@systemfsoftware/stryker-js-core": "^1.1.6",
|
|
59
|
+
"@systemfsoftware/tsconfig": "^1.2.5",
|
|
62
60
|
"@systemfsoftware/vitest-config": "^0.1.0"
|
|
63
61
|
},
|
|
64
62
|
"peerDependencies": {
|
|
65
63
|
"@stryker-mutator/api": "^9.6.1",
|
|
64
|
+
"effect": "^3.22.0",
|
|
66
65
|
"typescript": ">=5.0.0"
|
|
67
66
|
},
|
|
68
67
|
"publishConfig": {
|
|
@@ -79,7 +78,7 @@
|
|
|
79
78
|
"mutation:full": "stryker run",
|
|
80
79
|
"lint": "oxlint . ${AGENT:+--format=unix --quiet}",
|
|
81
80
|
"attw": "attw --pack .",
|
|
82
|
-
"api:check": "api-extractor run
|
|
83
|
-
"api:update": "api-extractor run --local
|
|
81
|
+
"api:check": "concurrently --kill-others-on-fail \"api-extractor run\" \"api-extractor run --config api-extractor.effect-schema-ignorer.json\"",
|
|
82
|
+
"api:update": "concurrently --kill-others-on-fail \"api-extractor run --local\" \"api-extractor run --local --config api-extractor.effect-schema-ignorer.json\""
|
|
84
83
|
}
|
|
85
84
|
}
|