@systemfsoftware/stryker-ignorer-kit 0.0.0 → 0.1.0
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 +14 -0
- package/dist/index.d.ts +30 -24
- package/dist/tester.d.ts +38 -32
- package/package.json +3 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# @systemfsoftware/stryker-ignorer-kit
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Debut: authoring and testing kit for the ignorer family. `defineIgnorer` compiles typed
|
|
8
|
+
visitors (visited node narrowed by key, typed ancestor context via `parentIf`/`ancestorIf`)
|
|
9
|
+
into the plain `Ignorer` wire contract; the `./tester` entry's `testIgnorer` verifies any
|
|
10
|
+
compiled ignorer from source snippets, registering one test per case.
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Maintenance release. Every published entry point, export, option, and behaviour is exactly as it was.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,24 +1,30 @@
|
|
|
1
|
-
import { Ignorer
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import { Ignorer } from '@systemfsoftware/stryker-ignorer-interface';
|
|
2
|
+
import { Node as Node_2 } from '@systemfsoftware/stryker-ignorer-interface';
|
|
3
|
+
|
|
4
|
+
export declare function defineIgnorer(definition: IgnorerDefinition): Ignorer;
|
|
5
|
+
|
|
6
|
+
export declare interface IgnorerContext {
|
|
7
|
+
/** Nearest-first as the host hands it over; the parent is the first element. */
|
|
8
|
+
readonly ancestors: readonly Node_2[];
|
|
9
|
+
parentIf<K extends Node_2['type']>(kind: K): Extract<Node_2, {
|
|
10
|
+
readonly type: K;
|
|
11
|
+
}> | undefined;
|
|
12
|
+
ancestorIf<K extends Node_2['type']>(kind: K): Extract<Node_2, {
|
|
13
|
+
readonly type: K;
|
|
14
|
+
}> | undefined;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export declare interface IgnorerDefinition {
|
|
18
|
+
readonly name: string;
|
|
19
|
+
readonly visitors: IgnorerVisitors;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export declare type IgnorerVisitor<K extends Node_2['type']> = (node: Extract<Node_2, {
|
|
23
|
+
readonly type: K;
|
|
24
|
+
}>, ctx: IgnorerContext) => string | undefined;
|
|
25
|
+
|
|
26
|
+
export declare type IgnorerVisitors = { readonly [K in Node_2['type']]?: IgnorerVisitor<K>; } & {
|
|
27
|
+
readonly onAnyNode?: (node: Node_2, ctx: IgnorerContext) => string | undefined;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export { }
|
package/dist/tester.d.ts
CHANGED
|
@@ -1,32 +1,38 @@
|
|
|
1
|
-
import { Ignorer } from
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export interface
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
import { Ignorer } from '@systemfsoftware/stryker-ignorer-interface';
|
|
2
|
+
|
|
3
|
+
export declare interface IgnoredCase {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly code: string;
|
|
6
|
+
readonly lang?: ScriptLang;
|
|
7
|
+
readonly ignores: readonly (string | IgnoredSpan)[];
|
|
8
|
+
readonly keeps?: readonly string[];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export declare interface IgnoredSpan {
|
|
12
|
+
readonly text: string;
|
|
13
|
+
readonly reason?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export declare interface IgnorerCases {
|
|
17
|
+
readonly ignored?: readonly IgnoredCase[];
|
|
18
|
+
readonly kept?: readonly KeptCase[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export declare interface KeptCase {
|
|
22
|
+
readonly name: string;
|
|
23
|
+
readonly code: string;
|
|
24
|
+
readonly lang?: ScriptLang;
|
|
25
|
+
readonly keeps?: readonly string[];
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export declare type ScriptLang = 'js' | 'jsx' | 'ts' | 'tsx';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Parses each case with the instrumenter's parser convention, walks with host-shaped
|
|
32
|
+
* ancestor semantics, and consults the subject at every node. With runner globals present
|
|
33
|
+
* this registers one test per case under the subject's name; without them it runs every
|
|
34
|
+
* case here and rejects with one error enumerating every failing case.
|
|
35
|
+
*/
|
|
36
|
+
export declare function testIgnorer(subject: Ignorer, cases: IgnorerCases): Promise<void>;
|
|
37
|
+
|
|
38
|
+
export { }
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@systemfsoftware/stryker-ignorer-kit",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.1.0",
|
|
5
5
|
"author": "Ryan Lee <drdgvhbh@gmail.com>",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@oxc-project/types": "^0.140.0",
|
|
40
40
|
"oxc-parser": "^0.140.0",
|
|
41
41
|
"oxc-walker": "^1",
|
|
42
|
-
"@systemfsoftware/stryker-ignorer-interface": "^0.
|
|
42
|
+
"@systemfsoftware/stryker-ignorer-interface": "^0.1.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@microsoft/api-extractor": "^7",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"tsdown": "^0.23.0",
|
|
54
54
|
"typescript": "^7",
|
|
55
55
|
"vitest": "^4",
|
|
56
|
+
"@systemfsoftware/oxlint-ignorer-config": "^0.1.0",
|
|
56
57
|
"@systemfsoftware/tsdown-config": "^0.1.0",
|
|
57
|
-
"@systemfsoftware/oxlint-ignorer-config": "^0.0.0",
|
|
58
58
|
"@systemfsoftware/vitest-config": "^0.1.0"
|
|
59
59
|
},
|
|
60
60
|
"publishConfig": {
|