@codyswann/lisa 1.63.0 → 1.65.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/cdk/package-lisa/package.lisa.json +10 -2
- package/expo/package-lisa/package.lisa.json +9 -1
- package/nestjs/copy-overwrite/vitest.config.ts +30 -0
- package/nestjs/copy-overwrite/vitest.nestjs.ts +25 -0
- package/nestjs/create-only/vitest.config.local.ts +31 -0
- package/nestjs/create-only/vitest.thresholds.json +8 -0
- package/nestjs/deletions.json +5 -1
- package/nestjs/package-lisa/package.lisa.json +9 -2
- package/package.json +6 -6
- package/plugins/lisa/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-cdk/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-expo/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-nestjs/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-rails/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/.claude-plugin/plugin.json +1 -1
- package/plugins/lisa-typescript/rules/lisa.md +3 -3
- package/plugins/src/typescript/rules/lisa.md +3 -3
- package/typescript/copy-overwrite/vitest.config.ts +30 -0
- package/typescript/create-only/vitest.config.local.ts +31 -0
- package/typescript/create-only/vitest.thresholds.json +8 -0
- package/typescript/deletions.json +4 -1
- package/typescript/package-lisa/package.lisa.json +8 -5
- package/nestjs/copy-overwrite/jest.config.ts +0 -32
- package/nestjs/copy-overwrite/jest.nestjs.ts +0 -92
- package/typescript/copy-overwrite/jest.config.ts +0 -32
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
"watch": "tsc -w",
|
|
5
5
|
"cdk": "cdk",
|
|
6
6
|
"build": "tsc --noEmit",
|
|
7
|
-
"prepare": "husky install || true"
|
|
7
|
+
"prepare": "husky install || true",
|
|
8
|
+
"test": "NODE_ENV=test jest --passWithNoTests",
|
|
9
|
+
"test:unit": "NODE_ENV=test jest --testPathIgnorePatterns=\"\\.integration[.\\\\-](test|spec)\\.(ts|tsx)$\" --passWithNoTests",
|
|
10
|
+
"test:integration": "NODE_ENV=test jest --testPathPatterns=\"\\.integration[.\\\\-](test|spec)\\.(ts|tsx)$\" --passWithNoTests",
|
|
11
|
+
"test:cov": "NODE_ENV=test jest --coverage"
|
|
8
12
|
},
|
|
9
13
|
"dependencies": {
|
|
10
14
|
"@aws-cdk/aws-amplify-alpha": "^2.235.0-alpha.0",
|
|
@@ -15,7 +19,11 @@
|
|
|
15
19
|
},
|
|
16
20
|
"devDependencies": {
|
|
17
21
|
"@codyswann/lisa": "^1.54.6",
|
|
18
|
-
"aws-cdk": "^2.1104.0"
|
|
22
|
+
"aws-cdk": "^2.1104.0",
|
|
23
|
+
"jest": "^30.0.0",
|
|
24
|
+
"ts-jest": "^29.4.6",
|
|
25
|
+
"@types/jest": "^30.0.0",
|
|
26
|
+
"@jest/test-sequencer": "^30.2.0"
|
|
19
27
|
},
|
|
20
28
|
"bin": {
|
|
21
29
|
"infrastructure": "bin/infrastructure.js"
|
|
@@ -43,7 +43,11 @@
|
|
|
43
43
|
"eas:publish:dev": "eas update --channel dev --non-interactive",
|
|
44
44
|
"eas:publish:staging": "eas update --channel staging --non-interactive",
|
|
45
45
|
"eas:publish:production": "eas update --channel production --non-interactive",
|
|
46
|
-
"security:zap": "bash scripts/zap-baseline.sh"
|
|
46
|
+
"security:zap": "bash scripts/zap-baseline.sh",
|
|
47
|
+
"test": "NODE_ENV=test jest --passWithNoTests",
|
|
48
|
+
"test:unit": "NODE_ENV=test jest --testPathIgnorePatterns=\"\\.integration[.\\\\-](test|spec)\\.(ts|tsx)$\" --passWithNoTests",
|
|
49
|
+
"test:integration": "NODE_ENV=test jest --testPathPatterns=\"\\.integration[.\\\\-](test|spec)\\.(ts|tsx)$\" --passWithNoTests",
|
|
50
|
+
"test:cov": "NODE_ENV=test jest --coverage"
|
|
47
51
|
},
|
|
48
52
|
"dependencies": {
|
|
49
53
|
"@apollo/client": "^3.10.8",
|
|
@@ -132,6 +136,10 @@
|
|
|
132
136
|
"babel-plugin-module-resolver": "^5.0.2",
|
|
133
137
|
"baseline-browser-mapping": "^2.9.2",
|
|
134
138
|
"expo-atlas": "^0.4.0",
|
|
139
|
+
"jest": "^30.0.0",
|
|
140
|
+
"ts-jest": "^29.4.6",
|
|
141
|
+
"@types/jest": "^30.0.0",
|
|
142
|
+
"@jest/test-sequencer": "^30.2.0",
|
|
135
143
|
"jest-environment-jsdom": "^30.2.0",
|
|
136
144
|
"jest-expo": "^54.0.12",
|
|
137
145
|
"serve": "^14.2.0"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is managed by Lisa.
|
|
3
|
+
* Do not edit directly — changes will be overwritten on the next `lisa` run.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Vitest Configuration - Main Entry Point (NestJS)
|
|
8
|
+
*
|
|
9
|
+
* Thin wrapper around @codyswann/lisa vitest config factory.
|
|
10
|
+
* Customize via vitest.config.local.ts and vitest.thresholds.json.
|
|
11
|
+
*
|
|
12
|
+
* @see https://vitest.dev/config/
|
|
13
|
+
* @module vitest.config
|
|
14
|
+
*/
|
|
15
|
+
import {
|
|
16
|
+
defaultThresholds,
|
|
17
|
+
getNestjsVitestConfig,
|
|
18
|
+
mergeVitestConfigs,
|
|
19
|
+
mergeThresholds,
|
|
20
|
+
} from "@codyswann/lisa/vitest/nestjs";
|
|
21
|
+
|
|
22
|
+
import localConfig from "./vitest.config.local";
|
|
23
|
+
import thresholdsOverrides from "./vitest.thresholds.json" with { type: "json" };
|
|
24
|
+
|
|
25
|
+
export default mergeVitestConfigs(
|
|
26
|
+
getNestjsVitestConfig({
|
|
27
|
+
thresholds: mergeThresholds(defaultThresholds, thresholdsOverrides),
|
|
28
|
+
}),
|
|
29
|
+
localConfig
|
|
30
|
+
);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is managed by Lisa.
|
|
3
|
+
* Do not edit directly — changes will be overwritten on the next `lisa` run.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Vitest Configuration - NestJS Stack
|
|
8
|
+
*
|
|
9
|
+
* Re-exports NestJS-specific Vitest configuration from @codyswann/lisa.
|
|
10
|
+
* This file exists as a local sibling for projects that import stack
|
|
11
|
+
* config from a relative path.
|
|
12
|
+
*
|
|
13
|
+
* @see https://vitest.dev/config/
|
|
14
|
+
* @module vitest.nestjs
|
|
15
|
+
*/
|
|
16
|
+
export {
|
|
17
|
+
defaultCoverageExclusions,
|
|
18
|
+
defaultThresholds,
|
|
19
|
+
getNestjsVitestConfig,
|
|
20
|
+
mapThresholds,
|
|
21
|
+
mergeThresholds,
|
|
22
|
+
mergeVitestConfigs,
|
|
23
|
+
} from "@codyswann/lisa/vitest/nestjs";
|
|
24
|
+
|
|
25
|
+
export type { PortableThresholds } from "@codyswann/lisa/vitest/nestjs";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vitest Configuration - Project-Local Customizations
|
|
3
|
+
*
|
|
4
|
+
* Add project-specific Vitest settings here. This file is create-only,
|
|
5
|
+
* meaning Lisa will create it but never overwrite your customizations.
|
|
6
|
+
*
|
|
7
|
+
* Example:
|
|
8
|
+
* ```ts
|
|
9
|
+
* import type { ViteUserConfig } from "vitest/config";
|
|
10
|
+
*
|
|
11
|
+
* const config: ViteUserConfig = {
|
|
12
|
+
* resolve: {
|
|
13
|
+
* alias: {
|
|
14
|
+
* "@/": new URL("./src/", import.meta.url).pathname,
|
|
15
|
+
* },
|
|
16
|
+
* },
|
|
17
|
+
* };
|
|
18
|
+
*
|
|
19
|
+
* export default config;
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @see https://vitest.dev/config/
|
|
23
|
+
* @module vitest.config.local
|
|
24
|
+
*/
|
|
25
|
+
import type { ViteUserConfig } from "vitest/config";
|
|
26
|
+
|
|
27
|
+
const config: ViteUserConfig = {
|
|
28
|
+
// Add project-specific settings here
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default config;
|
package/nestjs/deletions.json
CHANGED
|
@@ -5,7 +5,11 @@
|
|
|
5
5
|
".claude/skills/security-zap-scan",
|
|
6
6
|
".claude/skills/typeorm-patterns",
|
|
7
7
|
".github/workflows/zap-baseline.yml",
|
|
8
|
-
".github/workflows/load-test.yml"
|
|
8
|
+
".github/workflows/load-test.yml",
|
|
9
|
+
"jest.config.ts",
|
|
10
|
+
"jest.config.local.ts",
|
|
11
|
+
"jest.nestjs.ts",
|
|
12
|
+
"jest.thresholds.json"
|
|
9
13
|
],
|
|
10
14
|
"keep": [
|
|
11
15
|
".github/workflows/zap-baseline-nestjs.yml",
|
|
@@ -30,7 +30,12 @@
|
|
|
30
30
|
"deploy:dev": "sls deploy --stage dev",
|
|
31
31
|
"deploy:staging": "sls deploy --stage staging",
|
|
32
32
|
"deploy:production": "sls deploy --stage production",
|
|
33
|
-
"security:zap": "bash scripts/zap-baseline.sh"
|
|
33
|
+
"security:zap": "bash scripts/zap-baseline.sh",
|
|
34
|
+
"test": "vitest run",
|
|
35
|
+
"test:unit": "vitest run --exclude='**/integration/**'",
|
|
36
|
+
"test:integration": "vitest run tests/integration",
|
|
37
|
+
"test:cov": "vitest run --coverage",
|
|
38
|
+
"test:watch": "vitest"
|
|
34
39
|
},
|
|
35
40
|
"dependencies": {
|
|
36
41
|
"@apollo/server": "^5.2.0",
|
|
@@ -75,7 +80,9 @@
|
|
|
75
80
|
"@types/express": "^5.0.6",
|
|
76
81
|
"serverless": "^4.30.0",
|
|
77
82
|
"serverless-esbuild": "^1.57.0",
|
|
78
|
-
"serverless-offline": "^14.4.0"
|
|
83
|
+
"serverless-offline": "^14.4.0",
|
|
84
|
+
"vitest": "^4.1.0",
|
|
85
|
+
"@vitest/coverage-v8": "^4.1.0"
|
|
79
86
|
}
|
|
80
87
|
}
|
|
81
88
|
}
|
package/package.json
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"scripts": {
|
|
3
3
|
"build": "tsc && bun run build:plugins",
|
|
4
4
|
"pretest": "[ -d dist/configs ] || bun run build",
|
|
5
|
-
"test": "
|
|
6
|
-
"test:unit": "
|
|
7
|
-
"test:integration": "
|
|
8
|
-
"test:cov": "
|
|
5
|
+
"test": "vitest run",
|
|
6
|
+
"test:unit": "vitest run --exclude='**/integration/**'",
|
|
7
|
+
"test:integration": "vitest run tests/integration",
|
|
8
|
+
"test:cov": "vitest run --coverage",
|
|
9
9
|
"lint": "eslint . --quiet",
|
|
10
10
|
"lint:fix": "eslint . --fix",
|
|
11
11
|
"lint:slow": "eslint . --config eslint.slow.config.ts --quiet",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"prepare": "node -e \"if (process.env.INIT_CWD && process.env.INIT_CWD.includes('.serverless')) { process.exit(0); }\" && husky install || true",
|
|
20
20
|
"start": "node dist/index.js",
|
|
21
21
|
"dev": "tsx src/index.ts",
|
|
22
|
-
"test:watch": "
|
|
22
|
+
"test:watch": "vitest",
|
|
23
23
|
"update-node-version": "tsx scripts/update-node-version.ts",
|
|
24
24
|
"cleanup:amplify-branches": "bash scripts/cleanup-amplify-branches.sh",
|
|
25
25
|
"cleanup:github-branches": "bash scripts/cleanup-github-branches.sh",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"axios": ">=1.13.5"
|
|
73
73
|
},
|
|
74
74
|
"name": "@codyswann/lisa",
|
|
75
|
-
"version": "1.
|
|
75
|
+
"version": "1.65.0",
|
|
76
76
|
"description": "Claude Code governance framework that applies guardrails, guidance, and automated enforcement to projects",
|
|
77
77
|
"main": "dist/index.js",
|
|
78
78
|
"exports": {
|
|
@@ -7,14 +7,14 @@ The following files are managed by Lisa and will be overwritten on every `lisa`
|
|
|
7
7
|
| Managed File (do not edit) | Local Override (edit this instead) |
|
|
8
8
|
|---|---|
|
|
9
9
|
| `eslint.config.ts` | `eslint.config.local.ts` |
|
|
10
|
-
| `
|
|
10
|
+
| `vitest.config.ts` | `vitest.config.local.ts` |
|
|
11
11
|
| `tsconfig.json` | `tsconfig.local.json` |
|
|
12
12
|
|
|
13
13
|
## Create-only files (edit freely, Lisa won't overwrite)
|
|
14
14
|
|
|
15
15
|
- `.claude/rules/PROJECT_RULES.md`
|
|
16
16
|
- `eslint.thresholds.json`
|
|
17
|
-
- `
|
|
17
|
+
- `vitest.thresholds.json`
|
|
18
18
|
|
|
19
19
|
## Deep-merged by Lisa (Lisa wins conflicts, but project can add its own keys)
|
|
20
20
|
|
|
@@ -30,7 +30,7 @@ These resources are distributed via the stack Claude Code plugin (e.g., `typescr
|
|
|
30
30
|
- `.yamllint`, `.gitleaksignore`, `.coderabbit.yml`, `commitlint.config.cjs`, `sgconfig.yml`, `knip.json`
|
|
31
31
|
- `.safety-net.json`, `audit.ignore.config.json`
|
|
32
32
|
- `eslint.base.ts`, `eslint.typescript.ts` (+ `expo`/`nestjs`/`cdk` variants), `eslint.slow.config.ts`
|
|
33
|
-
- `
|
|
33
|
+
- `vitest.config.ts`
|
|
34
34
|
- `tsconfig.base.json`, `tsconfig.typescript.json` (+ variants), `tsconfig.eslint.json`, `tsconfig.build.json`, `tsconfig.spec.json`
|
|
35
35
|
- `.github/workflows/quality.yml`, `release.yml`, `claude.yml`, and all other Claude/CI workflows
|
|
36
36
|
- `.github/dependabot.yml`, `.github/GITHUB_ACTIONS.md`
|
|
@@ -7,14 +7,14 @@ The following files are managed by Lisa and will be overwritten on every `lisa`
|
|
|
7
7
|
| Managed File (do not edit) | Local Override (edit this instead) |
|
|
8
8
|
|---|---|
|
|
9
9
|
| `eslint.config.ts` | `eslint.config.local.ts` |
|
|
10
|
-
| `
|
|
10
|
+
| `vitest.config.ts` | `vitest.config.local.ts` |
|
|
11
11
|
| `tsconfig.json` | `tsconfig.local.json` |
|
|
12
12
|
|
|
13
13
|
## Create-only files (edit freely, Lisa won't overwrite)
|
|
14
14
|
|
|
15
15
|
- `.claude/rules/PROJECT_RULES.md`
|
|
16
16
|
- `eslint.thresholds.json`
|
|
17
|
-
- `
|
|
17
|
+
- `vitest.thresholds.json`
|
|
18
18
|
|
|
19
19
|
## Deep-merged by Lisa (Lisa wins conflicts, but project can add its own keys)
|
|
20
20
|
|
|
@@ -30,7 +30,7 @@ These resources are distributed via the stack Claude Code plugin (e.g., `typescr
|
|
|
30
30
|
- `.yamllint`, `.gitleaksignore`, `.coderabbit.yml`, `commitlint.config.cjs`, `sgconfig.yml`, `knip.json`
|
|
31
31
|
- `.safety-net.json`, `audit.ignore.config.json`
|
|
32
32
|
- `eslint.base.ts`, `eslint.typescript.ts` (+ `expo`/`nestjs`/`cdk` variants), `eslint.slow.config.ts`
|
|
33
|
-
- `
|
|
33
|
+
- `vitest.config.ts`
|
|
34
34
|
- `tsconfig.base.json`, `tsconfig.typescript.json` (+ variants), `tsconfig.eslint.json`, `tsconfig.build.json`, `tsconfig.spec.json`
|
|
35
35
|
- `.github/workflows/quality.yml`, `release.yml`, `claude.yml`, and all other Claude/CI workflows
|
|
36
36
|
- `.github/dependabot.yml`, `.github/GITHUB_ACTIONS.md`
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is managed by Lisa.
|
|
3
|
+
* Do not edit directly — changes will be overwritten on the next `lisa` run.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Vitest Configuration - Main Entry Point (TypeScript)
|
|
8
|
+
*
|
|
9
|
+
* Thin wrapper around @codyswann/lisa vitest config factory.
|
|
10
|
+
* Customize via vitest.config.local.ts and vitest.thresholds.json.
|
|
11
|
+
*
|
|
12
|
+
* @see https://vitest.dev/config/
|
|
13
|
+
* @module vitest.config
|
|
14
|
+
*/
|
|
15
|
+
import {
|
|
16
|
+
defaultThresholds,
|
|
17
|
+
getTypescriptVitestConfig,
|
|
18
|
+
mergeVitestConfigs,
|
|
19
|
+
mergeThresholds,
|
|
20
|
+
} from "@codyswann/lisa/vitest/typescript";
|
|
21
|
+
|
|
22
|
+
import localConfig from "./vitest.config.local";
|
|
23
|
+
import thresholdsOverrides from "./vitest.thresholds.json" with { type: "json" };
|
|
24
|
+
|
|
25
|
+
export default mergeVitestConfigs(
|
|
26
|
+
getTypescriptVitestConfig({
|
|
27
|
+
thresholds: mergeThresholds(defaultThresholds, thresholdsOverrides),
|
|
28
|
+
}),
|
|
29
|
+
localConfig
|
|
30
|
+
);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vitest Configuration - Project-Local Customizations
|
|
3
|
+
*
|
|
4
|
+
* Add project-specific Vitest settings here. This file is create-only,
|
|
5
|
+
* meaning Lisa will create it but never overwrite your customizations.
|
|
6
|
+
*
|
|
7
|
+
* Example:
|
|
8
|
+
* ```ts
|
|
9
|
+
* import type { ViteUserConfig } from "vitest/config";
|
|
10
|
+
*
|
|
11
|
+
* const config: ViteUserConfig = {
|
|
12
|
+
* resolve: {
|
|
13
|
+
* alias: {
|
|
14
|
+
* "@/": new URL("./src/", import.meta.url).pathname,
|
|
15
|
+
* },
|
|
16
|
+
* },
|
|
17
|
+
* };
|
|
18
|
+
*
|
|
19
|
+
* export default config;
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* @see https://vitest.dev/config/
|
|
23
|
+
* @module vitest.config.local
|
|
24
|
+
*/
|
|
25
|
+
import type { ViteUserConfig } from "vitest/config";
|
|
26
|
+
|
|
27
|
+
const config: ViteUserConfig = {
|
|
28
|
+
// Add project-specific settings here
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default config;
|
|
@@ -32,7 +32,10 @@
|
|
|
32
32
|
".github/workflows/reusable-claude-deploy-auto-fix.yml",
|
|
33
33
|
".github/workflows/reusable-claude-nightly-code-complexity.yml",
|
|
34
34
|
".github/workflows/reusable-claude-nightly-test-coverage.yml",
|
|
35
|
-
".github/workflows/reusable-claude-nightly-test-improvement.yml"
|
|
35
|
+
".github/workflows/reusable-claude-nightly-test-improvement.yml",
|
|
36
|
+
"jest.config.ts",
|
|
37
|
+
"jest.config.local.ts",
|
|
38
|
+
"jest.thresholds.json"
|
|
36
39
|
],
|
|
37
40
|
"keep": [
|
|
38
41
|
"eslint-plugin-code-organization",
|
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
"lint": "eslint . --quiet",
|
|
5
5
|
"format:check": "prettier --check .",
|
|
6
6
|
"format": "prettier --check . --write",
|
|
7
|
-
"test": "
|
|
8
|
-
"test:unit": "
|
|
9
|
-
"test:integration": "
|
|
10
|
-
"test:cov": "
|
|
7
|
+
"test": "vitest run",
|
|
8
|
+
"test:unit": "vitest run --exclude='**/integration/**'",
|
|
9
|
+
"test:integration": "vitest run tests/integration",
|
|
10
|
+
"test:cov": "vitest run --coverage",
|
|
11
|
+
"test:watch": "vitest",
|
|
11
12
|
"lint:fix": "eslint . --fix",
|
|
12
13
|
"lint:slow": "eslint . --config eslint.slow.config.ts --quiet",
|
|
13
14
|
"typecheck": "tsc --noEmit",
|
|
@@ -17,7 +18,9 @@
|
|
|
17
18
|
"prepare": "node -e \"if (process.env.INIT_CWD && process.env.INIT_CWD.includes('.serverless')) { process.exit(0); }\" && husky install || true"
|
|
18
19
|
},
|
|
19
20
|
"devDependencies": {
|
|
20
|
-
"@codyswann/lisa": "^1.54.6"
|
|
21
|
+
"@codyswann/lisa": "^1.54.6",
|
|
22
|
+
"vitest": "^4.1.0",
|
|
23
|
+
"@vitest/coverage-v8": "^4.1.0"
|
|
21
24
|
},
|
|
22
25
|
"resolutions": {
|
|
23
26
|
"@isaacs/brace-expansion": "^5.0.1",
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is managed by Lisa.
|
|
3
|
-
* Do not edit directly — changes will be overwritten on the next `lisa` run.
|
|
4
|
-
*
|
|
5
|
-
* @jest-config-loader esbuild-register
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Jest Configuration - Main Entry Point (NestJS)
|
|
10
|
-
*
|
|
11
|
-
* Thin wrapper around @codyswann/lisa jest config factory.
|
|
12
|
-
* Customize via jest.config.local.ts and jest.thresholds.json.
|
|
13
|
-
*
|
|
14
|
-
* @see https://jestjs.io/docs/configuration
|
|
15
|
-
* @module jest.config
|
|
16
|
-
*/
|
|
17
|
-
import {
|
|
18
|
-
defaultThresholds,
|
|
19
|
-
getNestjsJestConfig,
|
|
20
|
-
mergeConfigs,
|
|
21
|
-
mergeThresholds,
|
|
22
|
-
} from "@codyswann/lisa/jest/nestjs";
|
|
23
|
-
|
|
24
|
-
import localConfig from "./jest.config.local.ts";
|
|
25
|
-
import thresholdsOverrides from "./jest.thresholds.json" with { type: "json" };
|
|
26
|
-
|
|
27
|
-
export default mergeConfigs(
|
|
28
|
-
getNestjsJestConfig({
|
|
29
|
-
thresholds: mergeThresholds(defaultThresholds, thresholdsOverrides),
|
|
30
|
-
}),
|
|
31
|
-
localConfig
|
|
32
|
-
);
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is managed by Lisa.
|
|
3
|
-
* Do not edit directly — changes will be overwritten on the next `lisa` run.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Jest Configuration - NestJS Stack
|
|
8
|
-
*
|
|
9
|
-
* Provides NestJS-specific Jest configuration with extensive coverage
|
|
10
|
-
* exclusions for generated files, DTOs, entities, and modules.
|
|
11
|
-
*
|
|
12
|
-
* Inheritance chain:
|
|
13
|
-
* jest.nestjs.ts (this file)
|
|
14
|
-
* └── jest.base.ts
|
|
15
|
-
*
|
|
16
|
-
* @see https://jestjs.io/docs/configuration
|
|
17
|
-
* @module jest.nestjs
|
|
18
|
-
*/
|
|
19
|
-
import type { Config } from "jest";
|
|
20
|
-
|
|
21
|
-
import {
|
|
22
|
-
defaultCoverageExclusions,
|
|
23
|
-
defaultThresholds,
|
|
24
|
-
mergeConfigs,
|
|
25
|
-
mergeThresholds,
|
|
26
|
-
} from "./jest.base.ts";
|
|
27
|
-
|
|
28
|
-
// Re-export base utilities for entry-point configs
|
|
29
|
-
export {
|
|
30
|
-
defaultCoverageExclusions,
|
|
31
|
-
defaultThresholds,
|
|
32
|
-
mergeConfigs,
|
|
33
|
-
mergeThresholds,
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Options for configuring the NestJS Jest config factory.
|
|
38
|
-
*/
|
|
39
|
-
interface NestjsJestOptions {
|
|
40
|
-
/** Coverage thresholds (merged defaults + project overrides) */
|
|
41
|
-
readonly thresholds?: Config["coverageThreshold"];
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* NestJS-specific patterns excluded from coverage collection.
|
|
46
|
-
* These are generated or boilerplate files that don't benefit from coverage tracking.
|
|
47
|
-
*/
|
|
48
|
-
const nestjsCoverageExclusions: readonly string[] = [
|
|
49
|
-
...defaultCoverageExclusions,
|
|
50
|
-
"!**/*.entity.ts",
|
|
51
|
-
"!**/*.dto.ts",
|
|
52
|
-
"!**/*.input.ts",
|
|
53
|
-
"!**/*.args.ts",
|
|
54
|
-
"!**/*.model.ts",
|
|
55
|
-
"!**/*.module.ts",
|
|
56
|
-
"!**/*.factory.ts",
|
|
57
|
-
"!**/*.enum.ts",
|
|
58
|
-
"!**/*.interface.ts",
|
|
59
|
-
"!**/*.constants.ts",
|
|
60
|
-
"!**/database/migrations/**",
|
|
61
|
-
"!**/database/seeds/**",
|
|
62
|
-
"!**/graphql/**",
|
|
63
|
-
"!**/main.ts",
|
|
64
|
-
];
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Creates a Jest configuration for NestJS projects.
|
|
68
|
-
*
|
|
69
|
-
* @param options - Configuration options for threshold overrides
|
|
70
|
-
* @param options.thresholds - Coverage thresholds (merged defaults + project overrides)
|
|
71
|
-
* @returns Jest config object with ts-jest transform, node environment, and NestJS-specific exclusions
|
|
72
|
-
* @remarks NestJS projects use CommonJS modules and spec.ts test file convention.
|
|
73
|
-
* Uses tsconfig.spec.json for ts-jest diagnostics because the main tsconfig.json
|
|
74
|
-
* excludes spec files from compilation — without this, path aliases used only in
|
|
75
|
-
* test files (e.g. @test-utils) fail to resolve during type checking.
|
|
76
|
-
* Coverage excludes entities, DTOs, modules, and other boilerplate files
|
|
77
|
-
* that are better validated through integration tests.
|
|
78
|
-
*/
|
|
79
|
-
export const getNestjsJestConfig = ({
|
|
80
|
-
thresholds = defaultThresholds,
|
|
81
|
-
}: NestjsJestOptions = {}): Config => ({
|
|
82
|
-
testEnvironment: "node",
|
|
83
|
-
rootDir: "src",
|
|
84
|
-
testRegex: ".*\\.spec\\.ts$",
|
|
85
|
-
transform: {
|
|
86
|
-
"^.+\\.ts$": ["ts-jest", { tsconfig: "tsconfig.spec.json" }],
|
|
87
|
-
},
|
|
88
|
-
moduleFileExtensions: ["js", "json", "ts"],
|
|
89
|
-
collectCoverageFrom: ["**/*.ts", ...nestjsCoverageExclusions],
|
|
90
|
-
coverageThreshold: thresholds,
|
|
91
|
-
testTimeout: 10000,
|
|
92
|
-
});
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is managed by Lisa.
|
|
3
|
-
* Do not edit directly — changes will be overwritten on the next `lisa` run.
|
|
4
|
-
*
|
|
5
|
-
* @jest-config-loader esbuild-register
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Jest Configuration - Main Entry Point (TypeScript)
|
|
10
|
-
*
|
|
11
|
-
* Thin wrapper around @codyswann/lisa jest config factory.
|
|
12
|
-
* Customize via jest.config.local.ts and jest.thresholds.json.
|
|
13
|
-
*
|
|
14
|
-
* @see https://jestjs.io/docs/configuration
|
|
15
|
-
* @module jest.config
|
|
16
|
-
*/
|
|
17
|
-
import {
|
|
18
|
-
defaultThresholds,
|
|
19
|
-
getTypescriptJestConfig,
|
|
20
|
-
mergeConfigs,
|
|
21
|
-
mergeThresholds,
|
|
22
|
-
} from "@codyswann/lisa/jest/typescript";
|
|
23
|
-
|
|
24
|
-
import localConfig from "./jest.config.local.ts";
|
|
25
|
-
import thresholdsOverrides from "./jest.thresholds.json" with { type: "json" };
|
|
26
|
-
|
|
27
|
-
export default mergeConfigs(
|
|
28
|
-
getTypescriptJestConfig({
|
|
29
|
-
thresholds: mergeThresholds(defaultThresholds, thresholdsOverrides),
|
|
30
|
-
}),
|
|
31
|
-
localConfig
|
|
32
|
-
);
|