-
Notifications
You must be signed in to change notification settings - Fork 129
feat: enable isolatedModules #683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add tsconfig.base.json with shared compiler options - Enable isolatedModules for compatibility with esbuild/swc/Babel - Convert const enums to regular enums (required for isolatedModules) - Remove emitDecoratorMetadata (unused, Deepkit uses type-compiler) - All package tsconfigs now extend the base config BREAKING CHANGE: const enums converted to regular enums in: - MappedModifier (type-spec) - BinaryBigIntType (type) - BrokerType (broker) - RpcMessageRouteType (rpc) - AuthMechanism (mongo)
1635737 to
1a5cc33
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR establishes a centralized TypeScript configuration pattern by introducing tsconfig.base.json with shared compiler options, most notably enabling isolatedModules for compatibility with modern fast transpilers (esbuild, swc, Babel). All package-level tsconfig.json files now extend this base configuration, eliminating duplication across 50+ packages.
Key changes:
- Created
tsconfig.base.jsonwith shared TypeScript compiler options includingisolatedModules: true - Converted all
const enumdeclarations to regularenum(required forisolatedModules) - Removed
emitDecoratorMetadatafrom all configs (unused since Deepkit uses type-compiler)
Reviewed changes
Copilot reviewed 62 out of 62 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.base.json | New centralized TypeScript configuration with shared compiler options and isolatedModules enabled |
| packages/*/tsconfig.json | All package configs now extend the base config, removing duplicated options |
| packages/type/src/reflection/type.ts | Converted BinaryBigIntType from const enum to regular enum |
| packages/type-spec/src/type.ts | Converted MappedModifier from const enum to regular enum |
| packages/rpc/src/protocol.ts | Converted RpcMessageRouteType from const enum to regular enum |
| packages/broker/src/model.ts | Converted BrokerType from const enum to regular enum |
| packages/mongo/src/client/command/handshake.ts | Converted AuthMechanism from const enum to regular enum |
Comments suppressed due to low confidence (4)
packages/orm-browser-gui/tsconfig.json:28
- These compiler options (
forceConsistentCasingInFileNames,strict,noFallthroughCasesInSwitch,sourceMap,experimentalDecorators,esModuleInterop,moduleResolution,skipLibCheck) are redundant as they're already defined intsconfig.base.json. Consider removing them to avoid duplication and potential inconsistencies.
packages/framework-debug-gui/tsconfig.json:27 - These compiler options (
forceConsistentCasingInFileNames,strict,noFallthroughCasesInSwitch,sourceMap,experimentalDecorators,esModuleInterop,moduleResolution,skipLibCheck) are redundant as they're already defined intsconfig.base.json. Consider removing them to avoid duplication and potential inconsistencies.
"forceConsistentCasingInFileNames": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"noFallthroughCasesInSwitch": true,
"sourceMap": true,
"skipLibCheck": true,
"declaration": false,
"composite": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"target": "es2022",
"module": "ES2022",
"useDefineForClassFields": false,
"types": [
"dagre",
"file-saver",
"jasmine",
"marked"
]
packages/api-console-gui/tsconfig.json:25
- These compiler options (
forceConsistentCasingInFileNames,strict,noFallthroughCasesInSwitch,sourceMap,experimentalDecorators,esModuleInterop,moduleResolution,skipLibCheck) are redundant as they're already defined intsconfig.base.json. Consider removing them to avoid duplication and potential inconsistencies.
"forceConsistentCasingInFileNames": true,
"strict": true,
"noFallthroughCasesInSwitch": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"skipLibCheck": true,
"declaration": false,
"composite": false,
"downlevelIteration": true,
"experimentalDecorators": true,
"moduleResolution": "node",
"importHelpers": true,
"target": "es2022",
"module": "ES2022",
"useDefineForClassFields": false,
"types": [
"jasmine",
"marked"
]
packages/desktop-ui/tsconfig.json:28
- These compiler options (
moduleResolution,experimentalDecorators,downlevelIteration,sourceMap,strict,esModuleInterop,skipLibCheck) are redundant as they're already defined intsconfig.base.json. Consider removing them to avoid duplication and potential inconsistencies.
"moduleResolution": "node",
"experimentalDecorators": true,
"downlevelIteration": true,
"sourceMap": true,
"strict": true,
"target": "es2022",
"useDefineForClassFields": false,
"noImplicitAny": true,
"esModuleInterop": true,
"preserveSymlinks": true,
"types": [
"fs-extra",
"node"
],
"paths": {
"angular-desktop-ui": [
"dist/"
]
},
"skipLibCheck": true
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
BREAKING CHANGE: const enums converted to regular enums in: