@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 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, Node } from "@systemfsoftware/stryker-ignorer-interface";
2
- //#region src/mod.d.ts
3
- export interface IgnorerContext {
4
- /** Nearest-first as the host hands it over; the parent is the first element. */
5
- readonly ancestors: readonly Node[];
6
- parentIf<K extends Node['type']>(kind: K): Extract<Node, {
7
- readonly type: K;
8
- }> | undefined;
9
- ancestorIf<K extends Node['type']>(kind: K): Extract<Node, {
10
- readonly type: K;
11
- }> | undefined;
12
- }
13
- export type IgnorerVisitor<K extends Node['type']> = (node: Extract<Node, {
14
- readonly type: K;
15
- }>, ctx: IgnorerContext) => string | undefined;
16
- export type IgnorerVisitors = { readonly [K in Node['type']]?: IgnorerVisitor<K>; } & {
17
- readonly onAnyNode?: (node: Node, ctx: IgnorerContext) => string | undefined;
18
- };
19
- export interface IgnorerDefinition {
20
- readonly name: string;
21
- readonly visitors: IgnorerVisitors;
22
- }
23
- export declare function defineIgnorer(definition: IgnorerDefinition): Ignorer;
24
- //#endregion
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 "@systemfsoftware/stryker-ignorer-interface";
2
- //#region src/tester.d.ts
3
- export type ScriptLang = 'js' | 'jsx' | 'ts' | 'tsx';
4
- export interface IgnoredSpan {
5
- readonly text: string;
6
- readonly reason?: string;
7
- }
8
- export interface IgnoredCase {
9
- readonly name: string;
10
- readonly code: string;
11
- readonly lang?: ScriptLang;
12
- readonly ignores: readonly (string | IgnoredSpan)[];
13
- readonly keeps?: readonly string[];
14
- }
15
- export interface KeptCase {
16
- readonly name: string;
17
- readonly code: string;
18
- readonly lang?: ScriptLang;
19
- readonly keeps?: readonly string[];
20
- }
21
- export interface IgnorerCases {
22
- readonly ignored?: readonly IgnoredCase[];
23
- readonly kept?: readonly KeptCase[];
24
- }
25
- /**
26
- * Parses each case with the instrumenter's parser convention, walks with host-shaped
27
- * ancestor semantics, and consults the subject at every node. With runner globals present
28
- * this registers one test per case under the subject's name; without them it runs every
29
- * case here and rejects with one error enumerating every failing case.
30
- */
31
- export declare function testIgnorer(subject: Ignorer, cases: IgnorerCases): Promise<void>;
32
- //#endregion
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.0.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.0.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": {