🔧 Add unified TypeScript and Vitest configuration
- Create tsconfig.base.json with path aliases for @lilith/queue/* imports - Add vitest.config.ts with workspace projects for proper test environments - Update all subpackage tsconfigs to extend the base config 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
23d7871f5f
commit
4ca9d324fc
9 changed files with 177 additions and 50 deletions
|
|
@ -1,10 +1,8 @@
|
|||
{
|
||||
"extends": "@transquinnftw/configs/typescript/nestjs.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src",
|
||||
"declaration": true,
|
||||
"declarationMap": true
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist", "**/*.spec.ts"]
|
||||
|
|
|
|||
|
|
@ -1,13 +1,9 @@
|
|||
{
|
||||
"extends": "@transquinnftw/configs/typescript/react.json",
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src",
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"noEmit": false,
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
||||
"jsx": "react"
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
|
|
|
|||
|
|
@ -1,14 +1,9 @@
|
|||
{
|
||||
"extends": "@transquinnftw/configs/typescript/nestjs.json",
|
||||
"extends": "../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"include": [
|
||||
"src/**/*"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"dist"
|
||||
]
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,9 @@
|
|||
{
|
||||
"extends": "@transquinnftw/configs/typescript/base.json",
|
||||
"extends": "../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"include": [
|
||||
"src/**/*"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"dist"
|
||||
]
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,9 @@
|
|||
{
|
||||
"extends": "@transquinnftw/configs/typescript/nestjs.json",
|
||||
"extends": "../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"include": [
|
||||
"src/**/*"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"dist"
|
||||
]
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,9 @@
|
|||
{
|
||||
"extends": "@transquinnftw/configs/typescript/nestjs.json",
|
||||
"extends": "../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"include": [
|
||||
"src/**/*"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"dist"
|
||||
]
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,10 @@
|
|||
{
|
||||
"extends": "@transquinnftw/configs/typescript/nestjs.json",
|
||||
"extends": "../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"strictPropertyInitialization": false,
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./src"
|
||||
},
|
||||
"include": [
|
||||
"src/**/*"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"dist"
|
||||
]
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
|
|
|
|||
56
tsconfig.base.json
Normal file
56
tsconfig.base.json
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"lib": ["ES2022"],
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
|
||||
"strict": true,
|
||||
"noImplicitAny": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictBindCallApply": true,
|
||||
"strictPropertyInitialization": true,
|
||||
"noImplicitThis": true,
|
||||
"useUnknownInCatchVariables": true,
|
||||
"alwaysStrict": true,
|
||||
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noImplicitOverride": true,
|
||||
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"sourceMap": true,
|
||||
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
|
||||
"experimentalDecorators": true,
|
||||
"emitDecoratorMetadata": true,
|
||||
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@lilith/queue/core": ["./core/dist/index.d.ts"],
|
||||
"@lilith/queue/core/*": ["./core/dist/*"],
|
||||
"@lilith/queue/nestjs": ["./nestjs/dist/index.d.ts"],
|
||||
"@lilith/queue/nestjs/*": ["./nestjs/dist/*"],
|
||||
"@lilith/queue/ml": ["./ml/dist/index.d.ts"],
|
||||
"@lilith/queue/ml/*": ["./ml/dist/*"],
|
||||
"@lilith/queue/reporting": ["./reporting/dist/index.d.ts"],
|
||||
"@lilith/queue/reporting/*": ["./reporting/dist/*"],
|
||||
"@lilith/queue/bull-adapter": ["./bull-adapter/dist/index.d.ts"],
|
||||
"@lilith/queue/bull-adapter/*": ["./bull-adapter/dist/*"],
|
||||
"@lilith/queue/admin/backend": ["./admin/backend/dist/index.d.ts"],
|
||||
"@lilith/queue/admin/backend/*": ["./admin/backend/dist/*"],
|
||||
"@lilith/queue/admin/frontend": ["./admin/frontend/dist/index.d.ts"],
|
||||
"@lilith/queue/admin/frontend/*": ["./admin/frontend/dist/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
102
vitest.config.ts
Normal file
102
vitest.config.ts
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
import { defineConfig } from 'vitest/config';
|
||||
import path from 'path';
|
||||
|
||||
export default defineConfig({
|
||||
test: {
|
||||
projects: [
|
||||
{
|
||||
extends: true,
|
||||
test: {
|
||||
name: 'core',
|
||||
globals: true,
|
||||
environment: 'node',
|
||||
include: ['core/src/**/*.spec.ts'],
|
||||
},
|
||||
},
|
||||
{
|
||||
extends: true,
|
||||
test: {
|
||||
name: 'nestjs',
|
||||
globals: true,
|
||||
environment: 'node',
|
||||
include: ['nestjs/src/**/*.spec.ts'],
|
||||
},
|
||||
},
|
||||
{
|
||||
extends: true,
|
||||
test: {
|
||||
name: 'ml',
|
||||
globals: true,
|
||||
environment: 'node',
|
||||
include: ['ml/src/**/*.spec.ts'],
|
||||
},
|
||||
},
|
||||
{
|
||||
extends: true,
|
||||
test: {
|
||||
name: 'reporting',
|
||||
globals: true,
|
||||
environment: 'node',
|
||||
include: ['reporting/src/**/*.spec.ts'],
|
||||
},
|
||||
},
|
||||
{
|
||||
extends: true,
|
||||
test: {
|
||||
name: 'bull-adapter',
|
||||
globals: true,
|
||||
environment: 'node',
|
||||
include: ['bull-adapter/src/**/*.spec.ts'],
|
||||
},
|
||||
},
|
||||
{
|
||||
extends: true,
|
||||
test: {
|
||||
name: 'admin-backend',
|
||||
globals: true,
|
||||
environment: 'node',
|
||||
include: ['admin/backend/src/**/*.spec.ts'],
|
||||
},
|
||||
},
|
||||
{
|
||||
extends: true,
|
||||
esbuild: {
|
||||
jsx: 'automatic',
|
||||
},
|
||||
test: {
|
||||
name: 'admin-frontend',
|
||||
globals: true,
|
||||
environment: 'happy-dom',
|
||||
include: ['admin/frontend/src/**/*.spec.{ts,tsx}'],
|
||||
setupFiles: ['admin/frontend/src/test/setup.ts'],
|
||||
},
|
||||
},
|
||||
],
|
||||
exclude: ['node_modules/', '**/dist/', 'e2e/'],
|
||||
coverage: {
|
||||
provider: 'v8',
|
||||
reporter: ['text', 'json', 'html'],
|
||||
exclude: [
|
||||
'node_modules/',
|
||||
'**/dist/',
|
||||
'**/*.spec.ts',
|
||||
'**/*.test.ts',
|
||||
'**/index.ts',
|
||||
'**/test/**/*',
|
||||
'e2e/',
|
||||
'docs/',
|
||||
],
|
||||
},
|
||||
},
|
||||
resolve: {
|
||||
alias: {
|
||||
'@lilith/queue/core': path.resolve(__dirname, './core/src/index.ts'),
|
||||
'@lilith/queue/nestjs': path.resolve(__dirname, './nestjs/src/index.ts'),
|
||||
'@lilith/queue/ml': path.resolve(__dirname, './ml/src/index.ts'),
|
||||
'@lilith/queue/reporting': path.resolve(__dirname, './reporting/src/index.ts'),
|
||||
'@lilith/queue/bull-adapter': path.resolve(__dirname, './bull-adapter/src/index.ts'),
|
||||
'@lilith/queue/admin/backend': path.resolve(__dirname, './admin/backend/src/index.ts'),
|
||||
'@lilith/queue/admin/frontend': path.resolve(__dirname, './admin/frontend/src/index.ts'),
|
||||
},
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Reference in a new issue