diff --git a/admin/backend/tsconfig.json b/admin/backend/tsconfig.json index 91b2868..20532b5 100644 --- a/admin/backend/tsconfig.json +++ b/admin/backend/tsconfig.json @@ -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"] diff --git a/admin/frontend/tsconfig.json b/admin/frontend/tsconfig.json index 61fbdd5..589a6e3 100644 --- a/admin/frontend/tsconfig.json +++ b/admin/frontend/tsconfig.json @@ -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/**/*"], diff --git a/bull-adapter/tsconfig.json b/bull-adapter/tsconfig.json index caa6707..f677f8d 100644 --- a/bull-adapter/tsconfig.json +++ b/bull-adapter/tsconfig.json @@ -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"] } diff --git a/core/tsconfig.json b/core/tsconfig.json index 134a001..f677f8d 100644 --- a/core/tsconfig.json +++ b/core/tsconfig.json @@ -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"] } diff --git a/ml/tsconfig.json b/ml/tsconfig.json index caa6707..f677f8d 100644 --- a/ml/tsconfig.json +++ b/ml/tsconfig.json @@ -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"] } diff --git a/nestjs/tsconfig.json b/nestjs/tsconfig.json index caa6707..f677f8d 100644 --- a/nestjs/tsconfig.json +++ b/nestjs/tsconfig.json @@ -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"] } diff --git a/reporting/tsconfig.json b/reporting/tsconfig.json index a0842c0..c8ca278 100644 --- a/reporting/tsconfig.json +++ b/reporting/tsconfig.json @@ -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"] } diff --git a/tsconfig.base.json b/tsconfig.base.json new file mode 100644 index 0000000..3320fe6 --- /dev/null +++ b/tsconfig.base.json @@ -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/*"] + } + } +} diff --git a/vitest.config.ts b/vitest.config.ts new file mode 100644 index 0000000..ac84b9f --- /dev/null +++ b/vitest.config.ts @@ -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'), + }, + }, +});