From 46994bea340ccd5fd7a86e2d85dd90594b9e6a4a Mon Sep 17 00:00:00 2001 From: Kacper Date: Sat, 20 Dec 2025 22:42:36 +0100 Subject: [PATCH] refactor: Optimize TypeScript configs and fix build ordering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Create shared libs/tsconfig.base.json to eliminate duplication across 6 packages - Update all lib tsconfig.json files to extend base config - Fix build ordering to ensure sequential dependency chain (types -> utils -> platform/model-resolver/dependency-resolver -> git-utils) - Add .gitignore patterns to prevent compiled files in src directories Resolves PR review issues #3 and #4 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- .gitignore | 8 ++++++++ libs/dependency-resolver/tsconfig.json | 15 +++------------ libs/git-utils/tsconfig.json | 15 ++------------- libs/model-resolver/tsconfig.json | 15 ++------------- libs/platform/tsconfig.json | 15 ++------------- libs/tsconfig.base.json | 16 ++++++++++++++++ libs/types/tsconfig.json | 15 ++------------- libs/utils/tsconfig.json | 15 ++------------- package.json | 2 +- 9 files changed, 38 insertions(+), 78 deletions(-) create mode 100644 libs/tsconfig.base.json diff --git a/.gitignore b/.gitignore index c752c12e..2a5d3f18 100644 --- a/.gitignore +++ b/.gitignore @@ -76,6 +76,14 @@ blob-report/ # TypeScript *.tsbuildinfo +# Prevent compiled files in source directories +libs/*/src/**/*.js +libs/*/src/**/*.d.ts +libs/*/src/**/*.d.ts.map +apps/*/src/**/*.js +apps/*/src/**/*.d.ts +apps/*/src/**/*.d.ts.map + # Misc *.pem diff --git a/libs/dependency-resolver/tsconfig.json b/libs/dependency-resolver/tsconfig.json index 7fb871b0..d46e6126 100644 --- a/libs/dependency-resolver/tsconfig.json +++ b/libs/dependency-resolver/tsconfig.json @@ -1,19 +1,10 @@ { + "extends": "../tsconfig.base.json", "compilerOptions": { - "target": "ES2020", "module": "ESNext", - "lib": ["ES2020"], - "types": ["node"], - "declaration": true, - "declarationMap": true, + "moduleResolution": "bundler", "outDir": "./dist", - "rootDir": "./src", - "strict": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "resolveJsonModule": true, - "moduleResolution": "bundler" + "rootDir": "./src" }, "include": ["src/**/*"], "exclude": ["node_modules", "dist"] diff --git a/libs/git-utils/tsconfig.json b/libs/git-utils/tsconfig.json index 54e9774b..f677f8d5 100644 --- a/libs/git-utils/tsconfig.json +++ b/libs/git-utils/tsconfig.json @@ -1,19 +1,8 @@ { + "extends": "../tsconfig.base.json", "compilerOptions": { - "target": "ES2020", - "module": "commonjs", - "lib": ["ES2020"], - "types": ["node"], - "declaration": true, - "declarationMap": true, "outDir": "./dist", - "rootDir": "./src", - "strict": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "resolveJsonModule": true, - "moduleResolution": "node" + "rootDir": "./src" }, "include": ["src/**/*"], "exclude": ["node_modules", "dist"] diff --git a/libs/model-resolver/tsconfig.json b/libs/model-resolver/tsconfig.json index 54e9774b..f677f8d5 100644 --- a/libs/model-resolver/tsconfig.json +++ b/libs/model-resolver/tsconfig.json @@ -1,19 +1,8 @@ { + "extends": "../tsconfig.base.json", "compilerOptions": { - "target": "ES2020", - "module": "commonjs", - "lib": ["ES2020"], - "types": ["node"], - "declaration": true, - "declarationMap": true, "outDir": "./dist", - "rootDir": "./src", - "strict": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "resolveJsonModule": true, - "moduleResolution": "node" + "rootDir": "./src" }, "include": ["src/**/*"], "exclude": ["node_modules", "dist"] diff --git a/libs/platform/tsconfig.json b/libs/platform/tsconfig.json index 54e9774b..f677f8d5 100644 --- a/libs/platform/tsconfig.json +++ b/libs/platform/tsconfig.json @@ -1,19 +1,8 @@ { + "extends": "../tsconfig.base.json", "compilerOptions": { - "target": "ES2020", - "module": "commonjs", - "lib": ["ES2020"], - "types": ["node"], - "declaration": true, - "declarationMap": true, "outDir": "./dist", - "rootDir": "./src", - "strict": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "resolveJsonModule": true, - "moduleResolution": "node" + "rootDir": "./src" }, "include": ["src/**/*"], "exclude": ["node_modules", "dist"] diff --git a/libs/tsconfig.base.json b/libs/tsconfig.base.json new file mode 100644 index 00000000..048dc46d --- /dev/null +++ b/libs/tsconfig.base.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "target": "ES2020", + "module": "commonjs", + "lib": ["ES2020"], + "types": ["node"], + "declaration": true, + "declarationMap": true, + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "resolveJsonModule": true, + "moduleResolution": "node" + } +} diff --git a/libs/types/tsconfig.json b/libs/types/tsconfig.json index 54e9774b..f677f8d5 100644 --- a/libs/types/tsconfig.json +++ b/libs/types/tsconfig.json @@ -1,19 +1,8 @@ { + "extends": "../tsconfig.base.json", "compilerOptions": { - "target": "ES2020", - "module": "commonjs", - "lib": ["ES2020"], - "types": ["node"], - "declaration": true, - "declarationMap": true, "outDir": "./dist", - "rootDir": "./src", - "strict": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "resolveJsonModule": true, - "moduleResolution": "node" + "rootDir": "./src" }, "include": ["src/**/*"], "exclude": ["node_modules", "dist"] diff --git a/libs/utils/tsconfig.json b/libs/utils/tsconfig.json index 54e9774b..f677f8d5 100644 --- a/libs/utils/tsconfig.json +++ b/libs/utils/tsconfig.json @@ -1,19 +1,8 @@ { + "extends": "../tsconfig.base.json", "compilerOptions": { - "target": "ES2020", - "module": "commonjs", - "lib": ["ES2020"], - "types": ["node"], - "declaration": true, - "declarationMap": true, "outDir": "./dist", - "rootDir": "./src", - "strict": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true, - "resolveJsonModule": true, - "moduleResolution": "node" + "rootDir": "./src" }, "include": ["src/**/*"], "exclude": ["node_modules", "dist"] diff --git a/package.json b/package.json index 26860ff4..d2081351 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "dev:server": "npm run dev --workspace=apps/server", "dev:full": "concurrently \"npm run dev:server\" \"npm run dev:web\"", "build": "npm run build --workspace=apps/ui", - "build:packages": "npm run build -w @automaker/types && npm run build -w @automaker/utils -w @automaker/platform -w @automaker/model-resolver -w @automaker/dependency-resolver && npm run build -w @automaker/git-utils", + "build:packages": "npm run build -w @automaker/types && npm run build -w @automaker/utils && npm run build -w @automaker/platform -w @automaker/model-resolver -w @automaker/dependency-resolver && npm run build -w @automaker/git-utils", "build:server": "npm run build --workspace=apps/server", "build:electron": "npm run build:electron --workspace=apps/ui", "build:electron:dir": "npm run build:electron:dir --workspace=apps/ui",