@systemfsoftware/stryker-js-typescript-checker 6.0.0 → 7.0.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 +54 -0
- package/README.md +30 -14
- package/dist/index.d.mts +7 -8
- package/dist/index.mjs +1 -25
- package/dist/main.mjs +2073 -2593
- package/package.json +14 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,59 @@
|
|
|
1
1
|
# @systemfsoftware/stryker-js-typescript-checker
|
|
2
2
|
|
|
3
|
+
## 7.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- `testRunner`, `checkers`, and `ignorers` now carry the plugin and its options together.
|
|
8
|
+
|
|
9
|
+
- `testRunner` is `'command'`, `'vm'`, or `{ plugin, options?, nodeArgs? }`.
|
|
10
|
+
- `checkers` is `{ plugin, options?, nodeArgs? }[]`. Each checker is its own plugin.
|
|
11
|
+
- `ignorers` is plugin file URLs. Every ignorer those modules export runs. There is no separate name list.
|
|
12
|
+
- Put Vitest settings on `testRunner.options` (`configFile`, `dir`, `related`). There is no `vitest` block.
|
|
13
|
+
- Put TypeScript checker settings on that checker's `options` (`prioritizePerformanceOverAccuracy`). There is no `typescriptChecker` block.
|
|
14
|
+
|
|
15
|
+
Before:
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
export default defineConfig({
|
|
19
|
+
testRunner: 'vitest',
|
|
20
|
+
checkers: ['typescript'],
|
|
21
|
+
plugins: [
|
|
22
|
+
import.meta.resolve('@systemfsoftware/stryker-js-vitest-runner'),
|
|
23
|
+
import.meta.resolve('@systemfsoftware/stryker-js-typescript-checker'),
|
|
24
|
+
import.meta.resolve('@systemfsoftware/stryker-ignorer-effect-schema-declarations'),
|
|
25
|
+
],
|
|
26
|
+
vitest: { configFile: 'vitest.config.ts' },
|
|
27
|
+
typescriptChecker: { prioritizePerformanceOverAccuracy: true },
|
|
28
|
+
ignorers: ['effect-schema-declarations'],
|
|
29
|
+
})
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
After:
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
export default defineConfig({
|
|
36
|
+
testRunner: {
|
|
37
|
+
plugin: import.meta.resolve('@systemfsoftware/stryker-js-vitest-runner'),
|
|
38
|
+
options: { configFile: 'vitest.config.ts' },
|
|
39
|
+
},
|
|
40
|
+
checkers: [
|
|
41
|
+
{
|
|
42
|
+
plugin: import.meta.resolve('@systemfsoftware/stryker-js-typescript-checker'),
|
|
43
|
+
options: { prioritizePerformanceOverAccuracy: true },
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
ignorers: [
|
|
47
|
+
import.meta.resolve('@systemfsoftware/stryker-ignorer-effect-schema-declarations'),
|
|
48
|
+
],
|
|
49
|
+
})
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Patch Changes
|
|
53
|
+
|
|
54
|
+
- Updated dependencies:
|
|
55
|
+
- @systemfsoftware/stryker-js-plugin-interface@6.0.0
|
|
56
|
+
|
|
3
57
|
## 6.0.0
|
|
4
58
|
|
|
5
59
|
### Major Changes
|
package/README.md
CHANGED
|
@@ -1,27 +1,43 @@
|
|
|
1
1
|
# @systemfsoftware/stryker-js-typescript-checker
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](../../LICENSE)
|
|
4
|
+
[](https://www.npmjs.com/package/@systemfsoftware/stryker-js-typescript-checker)
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
TypeScript checker plugin for Stryker mutation testing — provides native support for TypeScript 5.x through 7.x.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
## Why Use a Type Checker Plugin?
|
|
9
|
+
|
|
10
|
+
Mutation testing modifies code syntax in ways that may cause compiler errors (e.g. invalid type assignments, breaking return type contracts). Without a checker plugin, those mutants execute in your test runner, waste runner execution time, or trigger misleading test runner errors.
|
|
11
|
+
|
|
12
|
+
The TypeScript checker intercepts mutants _before_ they reach the test runner. If a mutant causes a TypeScript compilation failure, it is classified immediately as `CompileError` without spinning up test runner workers.
|
|
10
13
|
|
|
11
|
-
##
|
|
14
|
+
## Prerequisites
|
|
12
15
|
|
|
13
|
-
-
|
|
16
|
+
- Node.js `>=22.18.0`
|
|
17
|
+
- TypeScript `>=5.0.0`
|
|
18
|
+
- `@systemfsoftware/stryker-js` `>=5.0.0`
|
|
19
|
+
|
|
20
|
+
## Install
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pnpm add -D @systemfsoftware/stryker-js-typescript-checker typescript
|
|
24
|
+
```
|
|
14
25
|
|
|
15
|
-
##
|
|
26
|
+
## Setup in `stryker.config.ts`
|
|
16
27
|
|
|
17
|
-
|
|
28
|
+
```ts
|
|
29
|
+
import { defineConfig } from '@systemfsoftware/stryker-js/config'
|
|
18
30
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
31
|
+
export default defineConfig({
|
|
32
|
+
checkers: ['typescript'],
|
|
33
|
+
plugins: [
|
|
34
|
+
import.meta.resolve('@systemfsoftware/stryker-js-typescript-checker'),
|
|
35
|
+
],
|
|
36
|
+
// Optional custom tsconfig path (defaults to tsconfig.json)
|
|
37
|
+
// tsConfigFile: 'tsconfig.build.json',
|
|
38
|
+
})
|
|
23
39
|
```
|
|
24
40
|
|
|
25
41
|
## License
|
|
26
42
|
|
|
27
|
-
Apache-2.0
|
|
43
|
+
[Apache-2.0](../../LICENSE)
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
//#endregion
|
|
1
|
+
export declare const strykerPlugins: readonly {
|
|
2
|
+
readonly kind: 'Checker';
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly workerEntry: string;
|
|
5
|
+
}[];
|
|
6
|
+
|
|
7
|
+
export { }
|
package/dist/index.mjs
CHANGED
|
@@ -1,32 +1,8 @@
|
|
|
1
|
-
import * as S from "effect/Schema";
|
|
2
|
-
//#region schema/typescript-checker-options.json
|
|
3
|
-
var typescript_checker_options_default = {
|
|
4
|
-
$schema: "http://json-schema.org/draft-07/schema",
|
|
5
|
-
title: "TypescriptCheckerPluginOptions",
|
|
6
|
-
type: "object",
|
|
7
|
-
additionalProperties: false,
|
|
8
|
-
properties: { "typescriptChecker": {
|
|
9
|
-
"description": "Configuration for @systemfsoftware/stryker-js-typescript-checker",
|
|
10
|
-
"title": "TypescriptCheckerOptions",
|
|
11
|
-
"additionalProperties": false,
|
|
12
|
-
"type": "object",
|
|
13
|
-
"default": {},
|
|
14
|
-
"properties": { "prioritizePerformanceOverAccuracy": {
|
|
15
|
-
"description": "Configures the performance of the TypescriptChecker. Setting this to false results in a slower, but more accurate result.",
|
|
16
|
-
"type": "boolean",
|
|
17
|
-
"default": true
|
|
18
|
-
} }
|
|
19
|
-
} }
|
|
20
|
-
};
|
|
21
|
-
//#endregion
|
|
22
1
|
//#region src/index.ts
|
|
23
2
|
const strykerPlugins = [{
|
|
24
3
|
kind: "Checker",
|
|
25
4
|
name: "typescript",
|
|
26
5
|
workerEntry: new URL("./main.mjs", import.meta.url).href
|
|
27
6
|
}];
|
|
28
|
-
const rawSchema = typescript_checker_options_default;
|
|
29
|
-
if (!S.is(S.Record(S.String, S.Unknown))(rawSchema)) throw new Error("Invalid typescript-checker schema file");
|
|
30
|
-
const strykerValidationSchema = rawSchema;
|
|
31
7
|
//#endregion
|
|
32
|
-
export { strykerPlugins
|
|
8
|
+
export { strykerPlugins };
|