@webpresso/agent-config 0.1.4 → 0.1.5
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/package.json +36 -12
- package/dist/esm/stryker/index.d.ts +0 -135
- package/dist/esm/stryker/index.js +0 -128
- package/dist/esm/tsconfig/base.json +0 -37
- package/dist/esm/tsconfig/cloudflare.json +0 -10
- package/dist/esm/tsconfig/library.json +0 -16
- package/dist/esm/tsconfig/react-library.json +0 -10
- package/dist/esm/tsconfig/react-router.json +0 -10
- package/dist/esm/vitest/bun-sqlite-shim.d.ts +0 -14
- package/dist/esm/vitest/bun-sqlite-shim.js +0 -14
- package/dist/esm/vitest/consumer-package.d.ts +0 -4
- package/dist/esm/vitest/consumer-package.js +0 -63
- package/dist/esm/vitest/flakiness-reporter.d.ts +0 -7
- package/dist/esm/vitest/flakiness-reporter.js +0 -53
- package/dist/esm/vitest/generated-runtime-aliases.d.ts +0 -6
- package/dist/esm/vitest/generated-runtime-aliases.js +0 -3
- package/dist/esm/vitest/node-setup.d.ts +0 -6
- package/dist/esm/vitest/node-setup.js +0 -16
- package/dist/esm/vitest/node.d.ts +0 -43
- package/dist/esm/vitest/node.js +0 -180
- package/dist/esm/vitest/pool-defaults.d.ts +0 -11
- package/dist/esm/vitest/pool-defaults.js +0 -43
- package/dist/esm/vitest/react-router.d.ts +0 -22
- package/dist/esm/vitest/react-router.js +0 -83
- package/dist/esm/vitest/react-setup.d.ts +0 -13
- package/dist/esm/vitest/react-setup.js +0 -27
- package/dist/esm/vitest/react.d.ts +0 -22
- package/dist/esm/vitest/react.js +0 -85
- package/dist/esm/vitest/version-guard.d.ts +0 -7
- package/dist/esm/vitest/version-guard.js +0 -42
- package/dist/esm/vitest/workers.d.ts +0 -28
- package/dist/esm/vitest/workers.js +0 -44
- package/dist/esm/workers-test/cloudflare-types.d.ts +0 -30
- package/dist/esm/workers-test/cloudflare-types.js +0 -2
- package/dist/esm/workers-test/durable-objects.d.ts +0 -60
- package/dist/esm/workers-test/durable-objects.js +0 -73
- package/dist/esm/workers-test/env.d.ts +0 -58
- package/dist/esm/workers-test/env.js +0 -74
- package/dist/esm/workers-test/execution-context.d.ts +0 -21
- package/dist/esm/workers-test/execution-context.js +0 -22
- package/dist/esm/workers-test/index.d.ts +0 -16
- package/dist/esm/workers-test/index.js +0 -15
- package/dist/esm/workers-test/requests.d.ts +0 -44
- package/dist/esm/workers-test/requests.js +0 -71
- package/dist/esm/workers-test/setup.d.ts +0 -63
- package/dist/esm/workers-test/setup.js +0 -86
- package/tsconfig/base.json +0 -37
- package/tsconfig/cloudflare.json +0 -10
- package/tsconfig/library.json +0 -16
- package/tsconfig/react-library.json +0 -10
- package/tsconfig/react-router.json +0 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webpresso/agent-config",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,24 +14,48 @@
|
|
|
14
14
|
"registry": "https://registry.npmjs.org/",
|
|
15
15
|
"access": "public"
|
|
16
16
|
},
|
|
17
|
-
"description": "Shared vitest, tsconfig, stryker, and workers-test config for webpresso consumers. Binary-free
|
|
17
|
+
"description": "Shared vitest, tsconfig, stryker, and workers-test config for webpresso consumers. Binary-free — pure test/config tooling.",
|
|
18
18
|
"license": "Elastic-2.0",
|
|
19
19
|
"type": "module",
|
|
20
20
|
"sideEffects": false,
|
|
21
21
|
"files": [
|
|
22
22
|
"dist/esm",
|
|
23
|
-
"tsconfig",
|
|
24
23
|
"!dist/**/*.map",
|
|
25
24
|
"!dist/**/*.test.*",
|
|
26
25
|
"LICENSE",
|
|
27
26
|
"README.md"
|
|
28
27
|
],
|
|
29
28
|
"exports": {
|
|
30
|
-
"./tsconfig/base.json":
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
"./tsconfig/base.json": {
|
|
30
|
+
"import": {
|
|
31
|
+
"types": "./dist/esm/tsconfig/base.json",
|
|
32
|
+
"default": "./dist/esm/tsconfig/base.json"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"./tsconfig/cloudflare.json": {
|
|
36
|
+
"import": {
|
|
37
|
+
"types": "./dist/esm/tsconfig/cloudflare.json",
|
|
38
|
+
"default": "./dist/esm/tsconfig/cloudflare.json"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"./tsconfig/library.json": {
|
|
42
|
+
"import": {
|
|
43
|
+
"types": "./dist/esm/tsconfig/library.json",
|
|
44
|
+
"default": "./dist/esm/tsconfig/library.json"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"./tsconfig/react-library.json": {
|
|
48
|
+
"import": {
|
|
49
|
+
"types": "./dist/esm/tsconfig/react-library.json",
|
|
50
|
+
"default": "./dist/esm/tsconfig/react-library.json"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"./tsconfig/react-router.json": {
|
|
54
|
+
"import": {
|
|
55
|
+
"types": "./dist/esm/tsconfig/react-router.json",
|
|
56
|
+
"default": "./dist/esm/tsconfig/react-router.json"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
35
59
|
"./vitest/node": {
|
|
36
60
|
"import": {
|
|
37
61
|
"types": "./dist/esm/vitest/node.d.ts",
|
|
@@ -94,10 +118,10 @@
|
|
|
94
118
|
"lint:pkg": "publint && attw --pack ."
|
|
95
119
|
},
|
|
96
120
|
"dependencies": {
|
|
97
|
-
"@vitejs/plugin-react": "
|
|
98
|
-
"vite": "
|
|
99
|
-
"vite-plus": "
|
|
100
|
-
"vitest": "
|
|
121
|
+
"@vitejs/plugin-react": "catalog:",
|
|
122
|
+
"vite": "catalog:",
|
|
123
|
+
"vite-plus": "catalog:",
|
|
124
|
+
"vitest": "catalog:"
|
|
101
125
|
},
|
|
102
126
|
"peerDependencies": {
|
|
103
127
|
"@cloudflare/vitest-pool-workers": "*",
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared mutation-testing defaults for Webpresso packages.
|
|
3
|
-
*
|
|
4
|
-
* Import and extend this in package-root `stryker.config.mjs` files:
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* import { baseConfig } from '@webpresso/agent-config/stryker'
|
|
8
|
-
*
|
|
9
|
-
* export default {
|
|
10
|
-
* ...baseConfig,
|
|
11
|
-
* vitest: { configFile: 'vitest.node.config.ts' },
|
|
12
|
-
* mutate: ['src/**\/*.ts', '!src/**\/*.test.ts'],
|
|
13
|
-
* }
|
|
14
|
-
*/
|
|
15
|
-
export declare const baseConfig: {
|
|
16
|
-
packageManager: string;
|
|
17
|
-
testRunner: string;
|
|
18
|
-
plugins: string[];
|
|
19
|
-
ignorePatterns: string[];
|
|
20
|
-
mutate: string[];
|
|
21
|
-
concurrency: number;
|
|
22
|
-
timeoutMS: number;
|
|
23
|
-
dryRunTimeoutMinutes: number;
|
|
24
|
-
ignoreStatic: boolean;
|
|
25
|
-
vitest: {
|
|
26
|
-
related: boolean;
|
|
27
|
-
};
|
|
28
|
-
thresholds: {
|
|
29
|
-
high: number;
|
|
30
|
-
low: number;
|
|
31
|
-
break: number;
|
|
32
|
-
};
|
|
33
|
-
mutator: {
|
|
34
|
-
excludedMutations: string[];
|
|
35
|
-
};
|
|
36
|
-
reporters: string[];
|
|
37
|
-
htmlReporter: {
|
|
38
|
-
fileName: string;
|
|
39
|
-
};
|
|
40
|
-
jsonReporter: {
|
|
41
|
-
fileName: string;
|
|
42
|
-
};
|
|
43
|
-
incremental: boolean;
|
|
44
|
-
incrementalFile: string;
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* Extends baseConfig with TypeScript checker defaults.
|
|
48
|
-
* Use this in any TypeScript package instead of baseConfig directly.
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
* import { typescriptBaseConfig } from '@webpresso/agent-config/stryker'
|
|
52
|
-
*
|
|
53
|
-
* export default { ...typescriptBaseConfig }
|
|
54
|
-
* // or, for packages with a CF-pool vitest config:
|
|
55
|
-
* export default { ...typescriptBaseConfig, vitest: { configFile: 'vitest.stryker.config.ts' } }
|
|
56
|
-
*/
|
|
57
|
-
export declare const typescriptBaseConfig: {
|
|
58
|
-
checkers: string[];
|
|
59
|
-
tsconfigFile: string;
|
|
60
|
-
packageManager: string;
|
|
61
|
-
testRunner: string;
|
|
62
|
-
plugins: string[];
|
|
63
|
-
ignorePatterns: string[];
|
|
64
|
-
mutate: string[];
|
|
65
|
-
concurrency: number;
|
|
66
|
-
timeoutMS: number;
|
|
67
|
-
dryRunTimeoutMinutes: number;
|
|
68
|
-
ignoreStatic: boolean;
|
|
69
|
-
vitest: {
|
|
70
|
-
related: boolean;
|
|
71
|
-
};
|
|
72
|
-
thresholds: {
|
|
73
|
-
high: number;
|
|
74
|
-
low: number;
|
|
75
|
-
break: number;
|
|
76
|
-
};
|
|
77
|
-
mutator: {
|
|
78
|
-
excludedMutations: string[];
|
|
79
|
-
};
|
|
80
|
-
reporters: string[];
|
|
81
|
-
htmlReporter: {
|
|
82
|
-
fileName: string;
|
|
83
|
-
};
|
|
84
|
-
jsonReporter: {
|
|
85
|
-
fileName: string;
|
|
86
|
-
};
|
|
87
|
-
incremental: boolean;
|
|
88
|
-
incrementalFile: string;
|
|
89
|
-
};
|
|
90
|
-
/**
|
|
91
|
-
* Extends typescriptBaseConfig for Cloudflare Workers packages whose vitest config
|
|
92
|
-
* uses @cloudflare/vitest-pool-workers (incompatible with Stryker's pool injection).
|
|
93
|
-
* Points to a per-package vitest.stryker.config.ts that uses the standard forks pool
|
|
94
|
-
* and excludes any tests that require CF runtime globals (cloudflare:test).
|
|
95
|
-
*
|
|
96
|
-
* @example
|
|
97
|
-
* import { typescriptWorkersBaseConfig } from '@webpresso/agent-config/stryker'
|
|
98
|
-
*
|
|
99
|
-
* export default { ...typescriptWorkersBaseConfig }
|
|
100
|
-
*/
|
|
101
|
-
export declare const typescriptWorkersBaseConfig: {
|
|
102
|
-
vitest: {
|
|
103
|
-
configFile: string;
|
|
104
|
-
};
|
|
105
|
-
checkers: string[];
|
|
106
|
-
tsconfigFile: string;
|
|
107
|
-
packageManager: string;
|
|
108
|
-
testRunner: string;
|
|
109
|
-
plugins: string[];
|
|
110
|
-
ignorePatterns: string[];
|
|
111
|
-
mutate: string[];
|
|
112
|
-
concurrency: number;
|
|
113
|
-
timeoutMS: number;
|
|
114
|
-
dryRunTimeoutMinutes: number;
|
|
115
|
-
ignoreStatic: boolean;
|
|
116
|
-
thresholds: {
|
|
117
|
-
high: number;
|
|
118
|
-
low: number;
|
|
119
|
-
break: number;
|
|
120
|
-
};
|
|
121
|
-
mutator: {
|
|
122
|
-
excludedMutations: string[];
|
|
123
|
-
};
|
|
124
|
-
reporters: string[];
|
|
125
|
-
htmlReporter: {
|
|
126
|
-
fileName: string;
|
|
127
|
-
};
|
|
128
|
-
jsonReporter: {
|
|
129
|
-
fileName: string;
|
|
130
|
-
};
|
|
131
|
-
incremental: boolean;
|
|
132
|
-
incrementalFile: string;
|
|
133
|
-
};
|
|
134
|
-
export default baseConfig;
|
|
135
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared mutation-testing defaults for Webpresso packages.
|
|
3
|
-
*
|
|
4
|
-
* Import and extend this in package-root `stryker.config.mjs` files:
|
|
5
|
-
*
|
|
6
|
-
* @example
|
|
7
|
-
* import { baseConfig } from '@webpresso/agent-config/stryker'
|
|
8
|
-
*
|
|
9
|
-
* export default {
|
|
10
|
-
* ...baseConfig,
|
|
11
|
-
* vitest: { configFile: 'vitest.node.config.ts' },
|
|
12
|
-
* mutate: ['src/**\/*.ts', '!src/**\/*.test.ts'],
|
|
13
|
-
* }
|
|
14
|
-
*/
|
|
15
|
-
export const baseConfig = {
|
|
16
|
-
packageManager: 'pnpm',
|
|
17
|
-
testRunner: 'vitest',
|
|
18
|
-
plugins: ['@stryker-mutator/vitest-runner'],
|
|
19
|
-
ignorePatterns: [
|
|
20
|
-
'**/.git/**',
|
|
21
|
-
'**/node_modules/**',
|
|
22
|
-
'**/.stryker-tmp/**',
|
|
23
|
-
'**/.agent/**',
|
|
24
|
-
'**/.agents/**',
|
|
25
|
-
'**/.claude/**',
|
|
26
|
-
'**/.codex/**',
|
|
27
|
-
'**/.cursor/**',
|
|
28
|
-
'**/.opencode/**',
|
|
29
|
-
'**/.omx/**',
|
|
30
|
-
'**/dist/**',
|
|
31
|
-
'**/coverage/**',
|
|
32
|
-
'**/*.d.ts',
|
|
33
|
-
],
|
|
34
|
-
// Default mutate patterns - exclude all test files.
|
|
35
|
-
// Individual packages can override or extend these patterns.
|
|
36
|
-
mutate: [
|
|
37
|
-
'src/**/*.ts',
|
|
38
|
-
'src/**/*.tsx',
|
|
39
|
-
'apps/**/*.ts',
|
|
40
|
-
'apps/**/*.tsx',
|
|
41
|
-
'packages/**/*.ts',
|
|
42
|
-
'packages/**/*.tsx',
|
|
43
|
-
'infra/**/*.ts',
|
|
44
|
-
'infra/**/*.tsx',
|
|
45
|
-
'scripts/**/*.ts',
|
|
46
|
-
'scripts/**/*.tsx',
|
|
47
|
-
'!**/*.test.ts',
|
|
48
|
-
'!**/*.test.tsx',
|
|
49
|
-
'!**/*.spec.ts',
|
|
50
|
-
'!**/*.spec.tsx',
|
|
51
|
-
'!**/*.integration.test.ts',
|
|
52
|
-
'!**/*.integration.test.tsx',
|
|
53
|
-
'!**/*.workers.test.ts',
|
|
54
|
-
'!**/*.e2e.ts',
|
|
55
|
-
'!**/*.d.ts',
|
|
56
|
-
'!**/__fixtures__/**',
|
|
57
|
-
'!**/fixtures/**',
|
|
58
|
-
'!**/generated/**',
|
|
59
|
-
'!src/quality-sample.ts',
|
|
60
|
-
],
|
|
61
|
-
// Performance settings.
|
|
62
|
-
concurrency: 4,
|
|
63
|
-
timeoutMS: 60000,
|
|
64
|
-
dryRunTimeoutMinutes: 10,
|
|
65
|
-
// Static mutants (module-level constants) can't be activated per-test — they require
|
|
66
|
-
// a fresh process per mutant, which is extremely slow. Ignore them instead.
|
|
67
|
-
ignoreStatic: true,
|
|
68
|
-
// Run the full configured test surface by default. Consumer repos often mutate
|
|
69
|
-
// files that are not directly imported from tests, so Vitest related-only selection
|
|
70
|
-
// can yield zero executed tests.
|
|
71
|
-
vitest: { related: false },
|
|
72
|
-
// Quality thresholds.
|
|
73
|
-
thresholds: {
|
|
74
|
-
high: 85,
|
|
75
|
-
low: 80,
|
|
76
|
-
break: 75,
|
|
77
|
-
},
|
|
78
|
-
// Exclude cosmetic mutations that don't affect behavior.
|
|
79
|
-
// This focuses mutation testing on actual business logic.
|
|
80
|
-
mutator: {
|
|
81
|
-
excludedMutations: ['StringLiteral', 'ArrayDeclaration'],
|
|
82
|
-
},
|
|
83
|
-
// Reporting.
|
|
84
|
-
reporters: ['html', 'clear-text', 'progress-append-only', 'json'],
|
|
85
|
-
htmlReporter: {
|
|
86
|
-
fileName: 'reports/mutation/mutation-report.html',
|
|
87
|
-
},
|
|
88
|
-
jsonReporter: {
|
|
89
|
-
fileName: 'reports/mutation/mutation-report.json',
|
|
90
|
-
},
|
|
91
|
-
// Incremental mutation testing - caches results to avoid re-running unchanged code.
|
|
92
|
-
// Results stored in reports/stryker-incremental.json.
|
|
93
|
-
incremental: true,
|
|
94
|
-
incrementalFile: 'reports/stryker-incremental.json',
|
|
95
|
-
};
|
|
96
|
-
/**
|
|
97
|
-
* Extends baseConfig with TypeScript checker defaults.
|
|
98
|
-
* Use this in any TypeScript package instead of baseConfig directly.
|
|
99
|
-
*
|
|
100
|
-
* @example
|
|
101
|
-
* import { typescriptBaseConfig } from '@webpresso/agent-config/stryker'
|
|
102
|
-
*
|
|
103
|
-
* export default { ...typescriptBaseConfig }
|
|
104
|
-
* // or, for packages with a CF-pool vitest config:
|
|
105
|
-
* export default { ...typescriptBaseConfig, vitest: { configFile: 'vitest.stryker.config.ts' } }
|
|
106
|
-
*/
|
|
107
|
-
export const typescriptBaseConfig = {
|
|
108
|
-
...baseConfig,
|
|
109
|
-
checkers: ['typescript'],
|
|
110
|
-
tsconfigFile: 'tsconfig.json',
|
|
111
|
-
};
|
|
112
|
-
/**
|
|
113
|
-
* Extends typescriptBaseConfig for Cloudflare Workers packages whose vitest config
|
|
114
|
-
* uses @cloudflare/vitest-pool-workers (incompatible with Stryker's pool injection).
|
|
115
|
-
* Points to a per-package vitest.stryker.config.ts that uses the standard forks pool
|
|
116
|
-
* and excludes any tests that require CF runtime globals (cloudflare:test).
|
|
117
|
-
*
|
|
118
|
-
* @example
|
|
119
|
-
* import { typescriptWorkersBaseConfig } from '@webpresso/agent-config/stryker'
|
|
120
|
-
*
|
|
121
|
-
* export default { ...typescriptWorkersBaseConfig }
|
|
122
|
-
*/
|
|
123
|
-
export const typescriptWorkersBaseConfig = {
|
|
124
|
-
...typescriptBaseConfig,
|
|
125
|
-
vitest: { configFile: 'vitest.stryker.config.ts' },
|
|
126
|
-
};
|
|
127
|
-
export default baseConfig;
|
|
128
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
-
"display": "Base",
|
|
4
|
-
"compilerOptions": {
|
|
5
|
-
"target": "ES2024",
|
|
6
|
-
"lib": [
|
|
7
|
-
"ES2024"
|
|
8
|
-
],
|
|
9
|
-
"module": "ESNext",
|
|
10
|
-
"moduleResolution": "Bundler",
|
|
11
|
-
"resolveJsonModule": true,
|
|
12
|
-
"allowImportingTsExtensions": true,
|
|
13
|
-
"declaration": true,
|
|
14
|
-
"declarationMap": true,
|
|
15
|
-
"sourceMap": true,
|
|
16
|
-
"strict": true,
|
|
17
|
-
"noImplicitAny": true,
|
|
18
|
-
"noUncheckedIndexedAccess": true,
|
|
19
|
-
"noEmit": true,
|
|
20
|
-
"esModuleInterop": true,
|
|
21
|
-
"skipLibCheck": true,
|
|
22
|
-
"forceConsistentCasingInFileNames": true,
|
|
23
|
-
"allowSyntheticDefaultImports": true,
|
|
24
|
-
"isolatedModules": true,
|
|
25
|
-
"verbatimModuleSyntax": true,
|
|
26
|
-
"types": [
|
|
27
|
-
"node"
|
|
28
|
-
]
|
|
29
|
-
},
|
|
30
|
-
"exclude": [
|
|
31
|
-
"node_modules",
|
|
32
|
-
"dist",
|
|
33
|
-
"build",
|
|
34
|
-
".next",
|
|
35
|
-
".react-router"
|
|
36
|
-
]
|
|
37
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
-
"display": "Library",
|
|
4
|
-
"extends": "@webpresso/agent-config/tsconfig/base.json",
|
|
5
|
-
"compilerOptions": {
|
|
6
|
-
"declaration": true,
|
|
7
|
-
"declarationMap": true,
|
|
8
|
-
"outDir": "./dist",
|
|
9
|
-
"rootDir": "./src",
|
|
10
|
-
"paths": {
|
|
11
|
-
"#*": ["./src/*"]
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
"include": ["src/**/*.ts", "src/**/*.tsx"],
|
|
15
|
-
"exclude": ["src/**/*.test.ts", "src/**/*.test.tsx"]
|
|
16
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
-
"display": "React Library",
|
|
4
|
-
"extends": "@webpresso/agent-config/tsconfig/library.json",
|
|
5
|
-
"compilerOptions": {
|
|
6
|
-
"lib": ["ES2024", "DOM", "DOM.Iterable"],
|
|
7
|
-
"jsx": "react-jsx",
|
|
8
|
-
"types": ["react", "react-dom"]
|
|
9
|
-
}
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
-
"display": "React Router v7",
|
|
4
|
-
"extends": "@webpresso/agent-config/tsconfig/react-library.json",
|
|
5
|
-
"compilerOptions": {
|
|
6
|
-
"lib": ["ES2024", "DOM", "DOM.Iterable"],
|
|
7
|
-
"jsx": "react-jsx",
|
|
8
|
-
"types": ["vite/client"]
|
|
9
|
-
}
|
|
10
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Vitest shim for `bun:sqlite`.
|
|
3
|
-
*
|
|
4
|
-
* `bun:sqlite` is Bun's built-in SQLite driver and is unavailable in Node.js.
|
|
5
|
-
* Aliased as `bun:sqlite` in vitest.config.ts so tests running under Node.js
|
|
6
|
-
* transparently use `better-sqlite3`, which has an intentionally compatible
|
|
7
|
-
* synchronous API (same `.prepare().get()/.all()/.run()` shape).
|
|
8
|
-
*
|
|
9
|
-
* Re-exports the default export as the named `{ Database }` export to match
|
|
10
|
-
* bun:sqlite's export shape (`import { Database } from 'bun:sqlite'`).
|
|
11
|
-
*/
|
|
12
|
-
import Database from 'better-sqlite3';
|
|
13
|
-
export { Database };
|
|
14
|
-
//# sourceMappingURL=bun-sqlite-shim.d.ts.map
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Vitest shim for `bun:sqlite`.
|
|
3
|
-
*
|
|
4
|
-
* `bun:sqlite` is Bun's built-in SQLite driver and is unavailable in Node.js.
|
|
5
|
-
* Aliased as `bun:sqlite` in vitest.config.ts so tests running under Node.js
|
|
6
|
-
* transparently use `better-sqlite3`, which has an intentionally compatible
|
|
7
|
-
* synchronous API (same `.prepare().get()/.all()/.run()` shape).
|
|
8
|
-
*
|
|
9
|
-
* Re-exports the default export as the named `{ Database }` export to match
|
|
10
|
-
* bun:sqlite's export shape (`import { Database } from 'bun:sqlite'`).
|
|
11
|
-
*/
|
|
12
|
-
import Database from 'better-sqlite3';
|
|
13
|
-
export { Database };
|
|
14
|
-
//# sourceMappingURL=bun-sqlite-shim.js.map
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
-
import { createRequire } from 'node:module';
|
|
3
|
-
import { dirname, join, resolve } from 'node:path';
|
|
4
|
-
const localRequire = createRequire(import.meta.url);
|
|
5
|
-
function findNearestPackageRoot(startDirectory) {
|
|
6
|
-
let directory = resolve(startDirectory);
|
|
7
|
-
while (true) {
|
|
8
|
-
if (existsSync(join(directory, 'package.json'))) {
|
|
9
|
-
return directory;
|
|
10
|
-
}
|
|
11
|
-
const parent = dirname(directory);
|
|
12
|
-
if (parent === directory) {
|
|
13
|
-
return undefined;
|
|
14
|
-
}
|
|
15
|
-
directory = parent;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
function resolvePackageRootFromConfigArg(argv) {
|
|
19
|
-
for (let index = 0; index < argv.length; index += 1) {
|
|
20
|
-
const arg = argv[index];
|
|
21
|
-
if (!arg)
|
|
22
|
-
continue;
|
|
23
|
-
const configPath = arg === '--config' || arg === '-c'
|
|
24
|
-
? argv[index + 1]
|
|
25
|
-
: arg.startsWith('--config=')
|
|
26
|
-
? arg.slice('--config='.length)
|
|
27
|
-
: undefined;
|
|
28
|
-
if (!configPath)
|
|
29
|
-
continue;
|
|
30
|
-
return findNearestPackageRoot(dirname(resolve(configPath)));
|
|
31
|
-
}
|
|
32
|
-
return undefined;
|
|
33
|
-
}
|
|
34
|
-
function resolveConsumerPackageRoot() {
|
|
35
|
-
const npmPackageJson = process.env.npm_package_json;
|
|
36
|
-
if (npmPackageJson) {
|
|
37
|
-
const npmPackageRoot = findNearestPackageRoot(dirname(resolve(npmPackageJson)));
|
|
38
|
-
if (npmPackageRoot)
|
|
39
|
-
return npmPackageRoot;
|
|
40
|
-
}
|
|
41
|
-
const configPackageRoot = resolvePackageRootFromConfigArg(process.argv);
|
|
42
|
-
if (configPackageRoot)
|
|
43
|
-
return configPackageRoot;
|
|
44
|
-
return findNearestPackageRoot(process.cwd());
|
|
45
|
-
}
|
|
46
|
-
export const consumerPackageRoot = resolveConsumerPackageRoot();
|
|
47
|
-
const consumerPackageJsonPath = consumerPackageRoot
|
|
48
|
-
? join(consumerPackageRoot, 'package.json')
|
|
49
|
-
: undefined;
|
|
50
|
-
export const requireFromConsumer = consumerPackageJsonPath
|
|
51
|
-
? createRequire(consumerPackageJsonPath)
|
|
52
|
-
: localRequire;
|
|
53
|
-
export function readConsumerPackageJson() {
|
|
54
|
-
if (!consumerPackageJsonPath)
|
|
55
|
-
return undefined;
|
|
56
|
-
try {
|
|
57
|
-
return JSON.parse(readFileSync(consumerPackageJsonPath, 'utf8'));
|
|
58
|
-
}
|
|
59
|
-
catch {
|
|
60
|
-
return undefined;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
//# sourceMappingURL=consumer-package.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Reporter } from 'vitest/reporters';
|
|
2
|
-
export interface FlakinessReporterOptions {
|
|
3
|
-
outputFile?: string;
|
|
4
|
-
}
|
|
5
|
-
export declare function createFlakinessReporter(options?: FlakinessReporterOptions): Reporter;
|
|
6
|
-
export default createFlakinessReporter;
|
|
7
|
-
//# sourceMappingURL=flakiness-reporter.d.ts.map
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { mkdir, writeFile } from 'node:fs/promises';
|
|
2
|
-
import { resolve } from 'node:path';
|
|
3
|
-
const DEFAULT_REPORT_DIR = resolve(process.cwd(), '.test-reports');
|
|
4
|
-
async function writeReport(path, payload) {
|
|
5
|
-
await mkdir(resolve(path, '..'), { recursive: true });
|
|
6
|
-
await writeFile(path, JSON.stringify(payload, null, 2));
|
|
7
|
-
}
|
|
8
|
-
export function createFlakinessReporter(options = {}) {
|
|
9
|
-
const reportPath = options.outputFile ?? resolve(DEFAULT_REPORT_DIR, `flakiness-${process.pid}.json`);
|
|
10
|
-
const entries = [];
|
|
11
|
-
let totalTests = 0;
|
|
12
|
-
return {
|
|
13
|
-
onTestCaseResult(testCase) {
|
|
14
|
-
totalTests += 1;
|
|
15
|
-
const diagnostic = testCase.diagnostic();
|
|
16
|
-
if (!diagnostic || !diagnostic.retryCount || diagnostic.retryCount <= 0)
|
|
17
|
-
return;
|
|
18
|
-
const meta = testCase.meta();
|
|
19
|
-
const moduleFilepath = testCase.module.filepath;
|
|
20
|
-
const result = testCase.result();
|
|
21
|
-
const duration = typeof result === 'object' && result !== null && 'duration' in result
|
|
22
|
-
? (result.duration ?? null)
|
|
23
|
-
: null;
|
|
24
|
-
entries.push({
|
|
25
|
-
testId: testCase.id,
|
|
26
|
-
name: testCase.name,
|
|
27
|
-
fullName: testCase.fullName,
|
|
28
|
-
file: moduleFilepath ??
|
|
29
|
-
testCase.task?.file?.filepath,
|
|
30
|
-
retryCount: diagnostic.retryCount,
|
|
31
|
-
repeatCount: diagnostic.repeatCount ?? 0,
|
|
32
|
-
flaky: diagnostic.flaky ?? true,
|
|
33
|
-
duration,
|
|
34
|
-
timestamp: new Date().toISOString(),
|
|
35
|
-
meta: meta,
|
|
36
|
-
});
|
|
37
|
-
},
|
|
38
|
-
async onTestRunEnd() {
|
|
39
|
-
const flakyTests = entries.length;
|
|
40
|
-
const flakinessRate = totalTests ? flakyTests / totalTests : 0;
|
|
41
|
-
await writeReport(reportPath, {
|
|
42
|
-
version: 1,
|
|
43
|
-
generatedAt: new Date().toISOString(),
|
|
44
|
-
totalTests,
|
|
45
|
-
flakyTests,
|
|
46
|
-
flakinessRate,
|
|
47
|
-
entries,
|
|
48
|
-
});
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
export default createFlakinessReporter;
|
|
53
|
-
//# sourceMappingURL=flakiness-reporter.js.map
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Global Vitest setup for Node.js tests
|
|
3
|
-
* Suppresses console output for clean test runs
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Suppress console output globally for clean test output
|
|
7
|
-
* This prevents stderr/stdout noise from error handling tests
|
|
8
|
-
*/
|
|
9
|
-
const noop = () => {
|
|
10
|
-
// Intentionally empty - suppresses console output
|
|
11
|
-
};
|
|
12
|
-
global.console.error = noop;
|
|
13
|
-
global.console.warn = noop;
|
|
14
|
-
global.console.log = noop;
|
|
15
|
-
export const __nodeSetupModule = true;
|
|
16
|
-
//# sourceMappingURL=node-setup.js.map
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared Vitest configuration for Node.js packages
|
|
3
|
-
*
|
|
4
|
-
* Usage in vitest.config.ts:
|
|
5
|
-
* ```ts
|
|
6
|
-
* import { nodeConfig } from '@webpresso/agent-config/vitest/node'
|
|
7
|
-
* import { defineConfig, mergeConfig } from 'vite-plus/test/config'
|
|
8
|
-
*
|
|
9
|
-
* export default mergeConfig(nodeConfig, defineConfig({
|
|
10
|
-
* // Your overrides here
|
|
11
|
-
* }))
|
|
12
|
-
* ```
|
|
13
|
-
*/
|
|
14
|
-
import type { UserWorkspaceConfig, ViteUserConfigExport } from 'vite-plus/test/config';
|
|
15
|
-
export interface CreateNodeProjectsOptions {
|
|
16
|
-
unitInclude?: string[];
|
|
17
|
-
unitExclude?: string[];
|
|
18
|
-
integrationInclude?: string[];
|
|
19
|
-
maxWorkers?: number;
|
|
20
|
-
fileParallelism?: boolean;
|
|
21
|
-
isolate?: boolean;
|
|
22
|
-
testTimeout?: number;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Create vitest projects for unit/integration test split.
|
|
26
|
-
*
|
|
27
|
-
* Usage in vitest.config.ts:
|
|
28
|
-
* ```ts
|
|
29
|
-
* import { nodeConfig, createNodeProjects } from '@webpresso/agent-config/vitest/node'
|
|
30
|
-
* import { mergeConfig } from 'vite-plus/test/config'
|
|
31
|
-
*
|
|
32
|
-
* export default mergeConfig(nodeConfig, {
|
|
33
|
-
* test: { projects: createNodeProjects('my-package') },
|
|
34
|
-
* })
|
|
35
|
-
* ```
|
|
36
|
-
*
|
|
37
|
-
* @param name - Package name used as vitest project name prefix (e.g. 'deploy' → 'deploy/unit', 'deploy/integration')
|
|
38
|
-
* @param options - Optional overrides for unit/integration include patterns
|
|
39
|
-
*/
|
|
40
|
-
export declare function createNodeProjects(name: string, options?: CreateNodeProjectsOptions): UserWorkspaceConfig[];
|
|
41
|
-
export declare const nodeConfig: ViteUserConfigExport;
|
|
42
|
-
export default nodeConfig;
|
|
43
|
-
//# sourceMappingURL=node.d.ts.map
|