@systemfsoftware/stryker-ignorer-in-source-vitest-block 0.1.1 → 0.1.3
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 +12 -0
- package/README.md +3 -5
- package/dist/index.d.ts +6 -9
- package/dist/index.mjs +12 -34
- package/package.json +15 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @systemfsoftware/stryker-ignorer-in-source-vitest-block
|
|
2
2
|
|
|
3
|
+
## 0.1.3
|
|
4
|
+
|
|
5
|
+
Build and lint with effect 4.1.0 and @effect/tsgo 0.63.0; the published code is unchanged.
|
|
6
|
+
|
|
7
|
+
## 0.1.2
|
|
8
|
+
|
|
9
|
+
Effect moves to `4.0.0-rc.117`, together with the `@effect/*` packages these libraries use. Projects that install `effect` next to them need the same release.
|
|
10
|
+
|
|
11
|
+
- The TypeScript checker and test-runner workers now bundle their own runtime, so the only modules they load from your project are the TypeScript compiler and your test framework.
|
|
12
|
+
- The test-runner plugin supports the framework's fifth major release.
|
|
13
|
+
- The ignorer interface re-exports the `oxc-parser` 0.150 AST, in which `FormalParameterRest.decorators` is `Array<Decorator>`. Enable the `@effect/language-service` tsgo plugin in every source package's `tsconfig.app.json` and `tsconfig.test.json`, and bump `@effect/tsgo` to `^0.50.0`. This turns on Effect-aware diagnostics during `effect-tsgo` type checking; it changes no runtime behaviour or public API.
|
|
14
|
+
|
|
3
15
|
## 0.1.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -17,18 +17,16 @@ pnpm add -D @systemfsoftware/stryker-ignorer-in-source-vitest-block
|
|
|
17
17
|
|
|
18
18
|
## Setup in `stryker.config.ts`
|
|
19
19
|
|
|
20
|
-
Add the
|
|
20
|
+
Add the package name to `ignorers`. Every ignorer the module exports is then active.
|
|
21
21
|
|
|
22
22
|
```ts
|
|
23
23
|
import { defineConfig } from '@systemfsoftware/stryker-js/config'
|
|
24
24
|
|
|
25
25
|
export default defineConfig({
|
|
26
26
|
testRunner: {
|
|
27
|
-
plugin:
|
|
27
|
+
plugin: '@systemfsoftware/stryker-js-vitest-runner',
|
|
28
28
|
},
|
|
29
|
-
ignorers: [
|
|
30
|
-
import.meta.resolve('@systemfsoftware/stryker-ignorer-in-source-vitest-block'),
|
|
31
|
-
],
|
|
29
|
+
ignorers: ['@systemfsoftware/stryker-ignorer-in-source-vitest-block'],
|
|
32
30
|
})
|
|
33
31
|
```
|
|
34
32
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { Ignorer } from
|
|
2
|
-
|
|
3
|
-
export declare const IN_SOURCE_TEST_IGNORED: 'inside an `if (import.meta.vitest)` block — test code, not production behaviour';
|
|
4
|
-
|
|
5
|
-
export declare const strykerIgnorers: readonly Ignorer[];
|
|
6
|
-
|
|
7
|
-
export declare const VITEST_META_PROPERTY: 'vitest';
|
|
8
|
-
|
|
9
|
-
export { }
|
|
1
|
+
import { Ignorer } from "@systemfsoftware/stryker-ignorer-interface";
|
|
2
|
+
//#region src/in-source-vitest-block.d.ts
|
|
3
|
+
export declare const IN_SOURCE_TEST_IGNORED: 'inside an `if (import.meta.vitest)` block — test code, not production behaviour';
|
|
4
|
+
export declare const VITEST_META_PROPERTY: 'vitest';
|
|
5
|
+
export declare const strykerIgnorers: readonly Ignorer[];
|
|
6
|
+
//#endregion
|
package/dist/index.mjs
CHANGED
|
@@ -1,40 +1,18 @@
|
|
|
1
1
|
import { defineIgnorer } from "@systemfsoftware/stryker-ignorer-kit";
|
|
2
|
-
//#region src/
|
|
2
|
+
//#region src/in-source-vitest-block.ts
|
|
3
3
|
const IN_SOURCE_TEST_IGNORED = "inside an `if (import.meta.vitest)` block — test code, not production behaviour";
|
|
4
4
|
const VITEST_META_PROPERTY = "vitest";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
function propertyIsVitest(node) {
|
|
18
|
-
return isIdentifierNamed(node.property, VITEST_META_PROPERTY);
|
|
19
|
-
}
|
|
20
|
-
function isImportMetaVitestMemberShape(node) {
|
|
21
|
-
return objectIsImportMeta(node) && propertyIsVitest(node);
|
|
22
|
-
}
|
|
23
|
-
function isImportMetaVitestMember(node) {
|
|
24
|
-
return isNonComputedMember(node) && isImportMetaVitestMemberShape(node);
|
|
25
|
-
}
|
|
26
|
-
function operandIsImportMetaVitest(node) {
|
|
27
|
-
return isImportMetaVitestMember(node.left) || isImportMetaVitestMember(node.right);
|
|
28
|
-
}
|
|
29
|
-
function isBinaryGuardTest(node) {
|
|
30
|
-
return node.type === "BinaryExpression" && operandIsImportMetaVitest(node);
|
|
31
|
-
}
|
|
32
|
-
function isGuardTest(node) {
|
|
33
|
-
return isImportMetaVitestMember(node) || isBinaryGuardTest(node);
|
|
34
|
-
}
|
|
35
|
-
function isGuardStatement(node) {
|
|
36
|
-
return node.type === "IfStatement" && isGuardTest(node.test);
|
|
37
|
-
}
|
|
5
|
+
const isIdentifierNamed = (node, name) => node.type === "Identifier" && node.name === name;
|
|
6
|
+
const isNonComputedMember = (node) => node.type === "MemberExpression" && node.computed === false;
|
|
7
|
+
const isImportMeta = (node) => isIdentifierNamed(node.meta, "import") && isIdentifierNamed(node.property, "meta");
|
|
8
|
+
const objectIsImportMeta = (node) => node.object.type === "MetaProperty" && isImportMeta(node.object);
|
|
9
|
+
const propertyIsVitest = (node) => isIdentifierNamed(node.property, VITEST_META_PROPERTY);
|
|
10
|
+
const isImportMetaVitestMemberShape = (node) => objectIsImportMeta(node) && propertyIsVitest(node);
|
|
11
|
+
const isImportMetaVitestMember = (node) => isNonComputedMember(node) && isImportMetaVitestMemberShape(node);
|
|
12
|
+
const operandIsImportMetaVitest = (node) => isImportMetaVitestMember(node.left) || isImportMetaVitestMember(node.right);
|
|
13
|
+
const isBinaryGuardTest = (node) => node.type === "BinaryExpression" && operandIsImportMetaVitest(node);
|
|
14
|
+
const isGuardTest = (node) => isImportMetaVitestMember(node) || isBinaryGuardTest(node);
|
|
15
|
+
const isGuardStatement = (node) => node.type === "IfStatement" && isGuardTest(node.test);
|
|
38
16
|
const strykerIgnorers = [defineIgnorer({
|
|
39
17
|
name: "in-source-vitest-block",
|
|
40
18
|
visitors: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@systemfsoftware/stryker-ignorer-in-source-vitest-block",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.3",
|
|
5
5
|
"author": "Ryan Lee <drdgvhbh@gmail.com>",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
],
|
|
22
22
|
"type": "module",
|
|
23
23
|
"files": [
|
|
24
|
-
"dist"
|
|
24
|
+
"dist",
|
|
25
|
+
"CHANGELOG.md"
|
|
25
26
|
],
|
|
26
27
|
"exports": {
|
|
27
28
|
".": {
|
|
@@ -31,24 +32,25 @@
|
|
|
31
32
|
"./package.json": "./package.json"
|
|
32
33
|
},
|
|
33
34
|
"dependencies": {
|
|
34
|
-
"@systemfsoftware/stryker-ignorer-interface": "^0.1.
|
|
35
|
-
"@systemfsoftware/stryker-ignorer-kit": "^0.1.
|
|
35
|
+
"@systemfsoftware/stryker-ignorer-interface": "^0.1.3",
|
|
36
|
+
"@systemfsoftware/stryker-ignorer-kit": "^0.1.3"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
|
-
"@effect/tsgo": "^0.
|
|
39
|
+
"@effect/tsgo": "^0.63.0",
|
|
39
40
|
"@microsoft/api-extractor": "^7",
|
|
40
41
|
"@systemfsoftware/arethetypeswrong-cli": "^4.2.0",
|
|
41
|
-
"@systemfsoftware/
|
|
42
|
+
"@systemfsoftware/oxlint-ignorer-config": "^0.1.3",
|
|
43
|
+
"@systemfsoftware/tsconfig": "^2.0.1",
|
|
44
|
+
"@systemfsoftware/tsdown-config": "^0.1.0",
|
|
45
|
+
"@systemfsoftware/vitest": "^2.0.0",
|
|
46
|
+
"@systemfsoftware/vitest-config": "^0.1.0",
|
|
42
47
|
"@types/node": "^24",
|
|
43
48
|
"@vitest/coverage-v8": "^5",
|
|
44
|
-
"oxlint": "
|
|
49
|
+
"oxlint": "~1.90.0",
|
|
45
50
|
"rimraf": "^6.1.3",
|
|
46
51
|
"tsdown": "^0.23.0",
|
|
47
52
|
"typescript": "^7",
|
|
48
|
-
"vitest": "^5"
|
|
49
|
-
"@systemfsoftware/vitest-config": "^0.1.0",
|
|
50
|
-
"@systemfsoftware/oxlint-ignorer-config": "^0.1.1",
|
|
51
|
-
"@systemfsoftware/tsdown-config": "^0.1.0"
|
|
53
|
+
"vitest": "^5"
|
|
52
54
|
},
|
|
53
55
|
"publishConfig": {
|
|
54
56
|
"access": "public",
|
|
@@ -57,12 +59,12 @@
|
|
|
57
59
|
"scripts": {
|
|
58
60
|
"build": "tsdown",
|
|
59
61
|
"clean": "rimraf dist",
|
|
60
|
-
"typecheck": "tsc
|
|
62
|
+
"typecheck": "tsc -b",
|
|
61
63
|
"test": "vitest run",
|
|
62
64
|
"lint": "f=${OXLINT_FORMAT:-${AGENT:+agent}}; oxlint . --format=${f:-default}",
|
|
63
65
|
"attw": "attw --pack .",
|
|
64
66
|
"api:check": "api-extractor run",
|
|
65
67
|
"api:update": "api-extractor run --local",
|
|
66
|
-
"lint:tsgo": "effect-tsgo diagnostics --project tsconfig.json --format ${TSGO_FORMAT:-text}"
|
|
68
|
+
"lint:tsgo": "effect-tsgo diagnostics --project tsconfig.app.json --format ${TSGO_FORMAT:-text} && effect-tsgo diagnostics --project tsconfig.test.json --format ${TSGO_FORMAT:-text}"
|
|
67
69
|
}
|
|
68
70
|
}
|