Background
Multiple build failures point to inconsistent or missing TypeScript configuration across packages. The workspace includes packages with TypeScript builds (e.g., packages/contracts, packages/env, packages/integration-client, packages/webhook-utils) and apps (apps/docs, apps/discord-bot, apps/access-api, apps/dashboard), each potentially with different or incomplete tsconfig.json settings.
Problem
Inconsistent TypeScript configurations lead to:
- Unpredictable output paths (some emit to
dist/, others elsewhere or nowhere)
- Mixed declaration/JavaScript emission strategies
- Different module resolution and target settings across the monorepo
- Difficulty maintaining and debugging builds
- Incompatible imports when packages don't emit expected file types
Expected Outcome
All TypeScript packages and apps follow a consistent configuration baseline:
- Shared base
tsconfig.json in the workspace root
- Each package/app
tsconfig.json extends the base and overrides only as needed
- Consistent
outDir, declaration, emitDeclarationOnly, module, target, and moduleResolution across the repo
- Clear, predictable file output structure
Suggested Implementation
- Create a shared
tsconfig.base.json in the workspace root with common settings:
{
"compilerOptions": {
"target": "es2020",
"module": "esnext",
"lib": ["es2020"],
"moduleResolution": "bundler",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"outDir": "./dist",
"rootDir": "./src",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
}
}
- Update each package/app
tsconfig.json to extend tsconfig.base.json
- Override only package-specific settings (e.g.,
outDir for monorepo structure)
- Run
pnpm -r build to verify consistency
- Document the baseline in
tsconfig.base.json comments
Acceptance Criteria
Affected Files/Directories
tsconfig.json (workspace root)
tsconfig.base.json (create)
- All
*/tsconfig.json files in packages/ and apps/
Background
Multiple build failures point to inconsistent or missing TypeScript configuration across packages. The workspace includes packages with TypeScript builds (e.g.,
packages/contracts,packages/env,packages/integration-client,packages/webhook-utils) and apps (apps/docs,apps/discord-bot,apps/access-api,apps/dashboard), each potentially with different or incompletetsconfig.jsonsettings.Problem
Inconsistent TypeScript configurations lead to:
dist/, others elsewhere or nowhere)Expected Outcome
All TypeScript packages and apps follow a consistent configuration baseline:
tsconfig.jsonin the workspace roottsconfig.jsonextends the base and overrides only as neededoutDir,declaration,emitDeclarationOnly,module,target, andmoduleResolutionacross the repoSuggested Implementation
tsconfig.base.jsonin the workspace root with common settings:{ "compilerOptions": { "target": "es2020", "module": "esnext", "lib": ["es2020"], "moduleResolution": "bundler", "declaration": true, "declarationMap": true, "sourceMap": true, "outDir": "./dist", "rootDir": "./src", "strict": true, "esModuleInterop": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true } }tsconfig.jsonto extendtsconfig.base.jsonoutDirfor monorepo structure)pnpm -r buildto verify consistencytsconfig.base.jsoncommentsAcceptance Criteria
tsconfig.base.jsonexists in the workspace root with shared, sensible defaultspackages/havetsconfig.jsonextendingtsconfig.base.jsonapps/havetsconfig.jsonextendingtsconfig.base.jsonpnpm -r buildsucceedsdist/or as needed per package type)Affected Files/Directories
tsconfig.json(workspace root)tsconfig.base.json(create)*/tsconfig.jsonfiles inpackages/andapps/