diff --git a/apps/core-services/market-data-gateway/tsconfig.json b/apps/core-services/market-data-gateway/tsconfig.json index 1d1f732..168d88b 100644 --- a/apps/core-services/market-data-gateway/tsconfig.json +++ b/apps/core-services/market-data-gateway/tsconfig.json @@ -1,16 +1,10 @@ { + "extends": "../../../tsconfig.json", "compilerOptions": { - "target": "ES2022", - "module": "ESNext", - "moduleResolution": "bundler", "outDir": "./dist", "rootDir": "./src", - "strict": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "allowSyntheticDefaultImports": true, - "resolveJsonModule": true, + "module": "ESNext", + "moduleResolution": "bundler", "types": ["bun-types"] }, "include": ["src/**/*"], diff --git a/apps/core-services/risk-guardian/tsconfig.json b/apps/core-services/risk-guardian/tsconfig.json new file mode 100644 index 0000000..168d88b --- /dev/null +++ b/apps/core-services/risk-guardian/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "../../../tsconfig.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src", + "module": "ESNext", + "moduleResolution": "bundler", + "types": ["bun-types"] + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist"] +} diff --git a/apps/data-services/data-processor/tsconfig.json b/apps/data-services/data-processor/tsconfig.json index 8a936d4..92187cf 100644 --- a/apps/data-services/data-processor/tsconfig.json +++ b/apps/data-services/data-processor/tsconfig.json @@ -1,21 +1,13 @@ { + "extends": "../../../tsconfig.json", "compilerOptions": { - "target": "ES2022", - "module": "ESNext", - "moduleResolution": "bundler", - "allowImportingTsExtensions": true, - "allowSyntheticDefaultImports": true, - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "strict": true, - "noImplicitAny": true, - "skipLibCheck": true, "outDir": "./dist", "rootDir": "./src", - "resolveJsonModule": true, - "declaration": true, + "module": "ESNext", + "moduleResolution": "bundler", + "noEmit": true, + "allowImportingTsExtensions": true, "declarationMap": true, - "sourceMap": true, "types": ["bun-types"] }, "include": ["src/**/*"], diff --git a/apps/data-services/feature-store/tsconfig.json b/apps/data-services/feature-store/tsconfig.json index 1a9f3dc..c324c66 100644 --- a/apps/data-services/feature-store/tsconfig.json +++ b/apps/data-services/feature-store/tsconfig.json @@ -1,19 +1,12 @@ { + "extends": "../../../tsconfig.json", "compilerOptions": { - "target": "ES2022", - "lib": ["ES2022"], + "outDir": "./dist", + "rootDir": "./src", "module": "ESNext", "moduleResolution": "bundler", "declaration": true, "declarationMap": true, - "sourceMap": true, - "outDir": "./dist", - "rootDir": "./src", - "strict": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "resolveJsonModule": true, "allowImportingTsExtensions": true, "noEmit": true, "paths": { diff --git a/apps/intelligence-services/backtest-engine/tsconfig.json b/apps/intelligence-services/backtest-engine/tsconfig.json index e69de29..0c12276 100644 --- a/apps/intelligence-services/backtest-engine/tsconfig.json +++ b/apps/intelligence-services/backtest-engine/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "../../../tsconfig.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src", + "module": "ESNext", + "moduleResolution": "bundler", + "types": ["bun-types"] + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist"] +} \ No newline at end of file diff --git a/apps/intelligence-services/signal-engine/tsconfig.json b/apps/intelligence-services/signal-engine/tsconfig.json index e69de29..0c12276 100644 --- a/apps/intelligence-services/signal-engine/tsconfig.json +++ b/apps/intelligence-services/signal-engine/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "../../../tsconfig.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src", + "module": "ESNext", + "moduleResolution": "bundler", + "types": ["bun-types"] + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist"] +} \ No newline at end of file diff --git a/apps/intelligence-services/strategy-orchestrator/tsconfig.json b/apps/intelligence-services/strategy-orchestrator/tsconfig.json new file mode 100644 index 0000000..168d88b --- /dev/null +++ b/apps/intelligence-services/strategy-orchestrator/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "../../../tsconfig.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src", + "module": "ESNext", + "moduleResolution": "bundler", + "types": ["bun-types"] + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist"] +} diff --git a/apps/interface-services/trading-dashboard/tsconfig.json b/apps/interface-services/trading-dashboard/tsconfig.json index e4955f2..e8d2a3f 100644 --- a/apps/interface-services/trading-dashboard/tsconfig.json +++ b/apps/interface-services/trading-dashboard/tsconfig.json @@ -1,18 +1,16 @@ /* To learn more about Typescript configuration file: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html. */ /* To learn more about Angular compiler options: https://angular.dev/reference/configs/angular-compiler-options. */ { + "extends": "../../../tsconfig.json", "compileOnSave": false, "compilerOptions": { - "strict": true, "noImplicitOverride": true, "noPropertyAccessFromIndexSignature": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, - "skipLibCheck": true, "isolatedModules": true, "experimentalDecorators": true, "importHelpers": true, - "target": "ES2022", "module": "preserve" }, "angularCompilerOptions": { diff --git a/docs/typescript-configuration.md b/docs/typescript-configuration.md new file mode 100644 index 0000000..784537f --- /dev/null +++ b/docs/typescript-configuration.md @@ -0,0 +1,118 @@ +# TypeScript Configuration Structure + +This document explains the TypeScript configuration structure used in the Stock Bot trading platform. + +## Root Configuration + +The root `tsconfig.json` at the project root establishes common settings for all projects in the monorepo: + +```json +{ + "$schema": "https://json.schemastore.org/tsconfig", + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "strict": true, + "noImplicitAny": true, + "strictNullChecks": true, + "noImplicitThis": true, + "alwaysStrict": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "sourceMap": true, + "declaration": true, + "baseUrl": ".", + "paths": { + "@stock-bot/*": ["libs/*/src"] + } + }, + "exclude": [ + "node_modules", + "dist" + ] +} +``` + +## Template Configurations + +We provide two template configurations: + +1. `tsconfig.lib.json` - For library projects: +```json +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src", + "declaration": true + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.spec.ts"] +} +``` + +2. `tsconfig.app.json` - For application projects: +```json +{ + "extends": "../../../tsconfig.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src", + "module": "ESNext", + "moduleResolution": "bundler", + "types": ["bun-types"] + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist"] +} +``` + +## Project-Specific Configurations + +Each project in the monorepo extends from the root configuration and adds its own specific settings: + +### Library Projects + +Library projects extend the root configuration with a relative path: +```json +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src", + "declaration": true + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.spec.ts"] +} +``` + +### Application Projects + +Application projects also extend the root configuration with a relative path: +```json +{ + "extends": "../../../tsconfig.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src", + "module": "ESNext", + "moduleResolution": "bundler", + "types": ["bun-types"] + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist"] +} +``` + +## Special Configurations + +Some projects have special needs: + +1. **Trading Dashboard (Angular)**: Uses an extended configuration structure with separate files for app and testing. + +2. **Projects with TypeScript imports from extensions**: These projects set `"allowImportingTsExtensions": true` and `"noEmit": true`. diff --git a/libs/api-client/tsconfig.json b/libs/api-client/tsconfig.json index 801f6e1..2e0bad5 100644 --- a/libs/api-client/tsconfig.json +++ b/libs/api-client/tsconfig.json @@ -1,13 +1,10 @@ { + "extends": "../../tsconfig.json", "compilerOptions": { - "target": "ES2022", - "module": "NodeNext", - "moduleResolution": "NodeNext", - "esModuleInterop": true, - "declaration": true, - "outDir": "dist", - "strict": true, - "sourceMap": true + "outDir": "./dist", + "rootDir": "./src", + "declaration": true }, - "include": ["src/**/*"] + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.spec.ts"] } diff --git a/libs/event-bus/tsconfig.json b/libs/event-bus/tsconfig.json index 801f6e1..2e0bad5 100644 --- a/libs/event-bus/tsconfig.json +++ b/libs/event-bus/tsconfig.json @@ -1,13 +1,10 @@ { + "extends": "../../tsconfig.json", "compilerOptions": { - "target": "ES2022", - "module": "NodeNext", - "moduleResolution": "NodeNext", - "esModuleInterop": true, - "declaration": true, - "outDir": "dist", - "strict": true, - "sourceMap": true + "outDir": "./dist", + "rootDir": "./src", + "declaration": true }, - "include": ["src/**/*"] + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.spec.ts"] } diff --git a/libs/http-client/tsconfig.json b/libs/http-client/tsconfig.json index 34acc69..1afb3c6 100644 --- a/libs/http-client/tsconfig.json +++ b/libs/http-client/tsconfig.json @@ -4,9 +4,8 @@ "outDir": "./dist", "rootDir": "./src", "declaration": true, - "declarationMap": true, - "sourceMap": true + "declarationMap": true }, "include": ["src/**/*"], - "exclude": ["dist", "node_modules", "**/*.test.ts"] + "exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.spec.ts"] } diff --git a/libs/shared-types/tsconfig.json b/libs/shared-types/tsconfig.json index 62d9619..2e0bad5 100644 --- a/libs/shared-types/tsconfig.json +++ b/libs/shared-types/tsconfig.json @@ -1,18 +1,10 @@ { + "extends": "../../tsconfig.json", "compilerOptions": { - "target": "ES2022", - "module": "ESNext", - "moduleResolution": "bundler", - "declaration": true, "outDir": "./dist", "rootDir": "./src", - "strict": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "allowSyntheticDefaultImports": true, - "resolveJsonModule": true + "declaration": true }, "include": ["src/**/*"], - "exclude": ["node_modules", "dist"] + "exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.spec.ts"] } diff --git a/libs/utils/tsconfig.json b/libs/utils/tsconfig.json index 801f6e1..2e0bad5 100644 --- a/libs/utils/tsconfig.json +++ b/libs/utils/tsconfig.json @@ -1,13 +1,10 @@ { + "extends": "../../tsconfig.json", "compilerOptions": { - "target": "ES2022", - "module": "NodeNext", - "moduleResolution": "NodeNext", - "esModuleInterop": true, - "declaration": true, - "outDir": "dist", - "strict": true, - "sourceMap": true + "outDir": "./dist", + "rootDir": "./src", + "declaration": true }, - "include": ["src/**/*"] + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.spec.ts"] } diff --git a/tsconfig.app.json b/tsconfig.app.json new file mode 100644 index 0000000..168d88b --- /dev/null +++ b/tsconfig.app.json @@ -0,0 +1,12 @@ +{ + "extends": "../../../tsconfig.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src", + "module": "ESNext", + "moduleResolution": "bundler", + "types": ["bun-types"] + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist"] +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..42b9f5b --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,39 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "compilerOptions": { + // JavaScript output target version + "target": "ES2022", + + // Module configuration for different project types + "module": "NodeNext", + "moduleResolution": "NodeNext", + + // Type checking + "strict": true, + "noImplicitAny": true, + "strictNullChecks": true, + "noImplicitThis": true, + "alwaysStrict": true, + + // Module interoperability + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + + // Additional features + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "sourceMap": true, + "declaration": true, + + // Paths and output + "baseUrl": ".", + "paths": { + "@stock-bot/*": ["libs/*/src"] + } + }, + "exclude": [ + "node_modules", + "dist" + ] +} diff --git a/tsconfig.lib.json b/tsconfig.lib.json new file mode 100644 index 0000000..2e0bad5 --- /dev/null +++ b/tsconfig.lib.json @@ -0,0 +1,10 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "outDir": "./dist", + "rootDir": "./src", + "declaration": true + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.spec.ts"] +}