diff --git a/scripts/generate-framework-api.ts b/scripts/generate-framework-api.ts index 7e94b11..7478168 100644 --- a/scripts/generate-framework-api.ts +++ b/scripts/generate-framework-api.ts @@ -8,10 +8,10 @@ import { Project, type InterfaceDeclaration } from 'ts-morph'; import { readFileSync, writeFileSync } from 'node:fs'; -import { resolve, dirname } from 'node:path'; -import { fileURLToPath } from 'node:url'; +import { resolve } from 'node:path'; -const __dirname = dirname(fileURLToPath(import.meta.url)); +// The package is CommonJS (no "type": "module"), so tsx runs this as CJS and __dirname is native. +// An import.meta.url shim would not typecheck against the root tsconfig (module: commonjs). const ROOT = resolve(__dirname, '..'); const OUTPUT = resolve(ROOT, 'FRAMEWORK-API.md'); diff --git a/tests/unit/performance-caches.spec.ts b/tests/unit/performance-caches.spec.ts index e8f2d2e..164b0d4 100644 --- a/tests/unit/performance-caches.spec.ts +++ b/tests/unit/performance-caches.spec.ts @@ -728,8 +728,10 @@ describe('Native access security gates', () => { }); function createTestService(mockModel: any) { + // CrudService is resolved at runtime via a dynamic import, so its compile-time type is `any`. + // TypeScript rejects `override` against an `any` base (TS4113); the method still overrides at runtime. class TestService extends CrudService { - override get() { return null; } + get() { return null; } callCollection(reason: string) { return this.getNativeCollection(reason); } callConnection(reason: string) { return this.getNativeConnection(reason); } } diff --git a/tests/unit/unified-field-whitelist.spec.ts b/tests/unit/unified-field-whitelist.spec.ts index 57637eb..835df44 100644 --- a/tests/unit/unified-field-whitelist.spec.ts +++ b/tests/unit/unified-field-whitelist.spec.ts @@ -35,7 +35,7 @@ class ChildInput extends BaseInput { class ChildWithExclude extends BaseInput { @UnifiedField({ exclude: true }) - override email?: string; + override email?: string = undefined; @UnifiedField({ description: 'Phone', isOptional: true }) phone?: string; @@ -43,12 +43,12 @@ class ChildWithExclude extends BaseInput { class GrandchildReEnable extends ChildWithExclude { @UnifiedField({ exclude: false, description: 'Email re-enabled', isOptional: true }) - override email?: string; + override email?: string = undefined; } class ChildImplicitOverrideAttempt extends ChildWithExclude { @UnifiedField({ description: 'Email implicit', isOptional: true }) - override email?: string; + override email?: string = undefined; } class NoUnifiedFieldClass { diff --git a/tsconfig.json b/tsconfig.json index b55ac51..e1c85d0 100755 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,7 +15,15 @@ "incremental": true, "noImplicitOverride": true, "skipLibCheck": true, - "types": ["vitest/globals", "node"] + "types": [ + "vitest/globals", + "node" + ] }, - "exclude": ["node_modules", "dist"] + "exclude": [ + "node_modules", + "dist", + "vite.config.ts", + "src/core/modules/migrate/templates/migration-project.template.ts" + ] } diff --git a/vite.config.ts b/vite.config.ts index f6c5283..b88dfa4 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -18,7 +18,7 @@ export default defineConfig({ adapter: 'nest', appPath: './src/main.ts', exportName: 'viteNodeApp', - tsCompiler: 'esbuild', + tsCompiler: 'swc', }), ], server: {