From 513e3c7496d372ebff34963bd8ec4d17a9bbae41 Mon Sep 17 00:00:00 2001 From: Till JS Date: Tue, 14 Apr 2026 20:54:35 +0200 Subject: [PATCH] fix(types): enable allowImportingTsExtensions, restore .ts on shared-types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The prior dance (93bb94a12 drop .ts, bb278fb3c switch to .js) kept breaking one consumer or the other: - bare specifiers (no extension) satisfied svelte-check but broke the Node ESM loader invoked via @tailwindcss/node during SSR — SSR of every (app) route 500'd with ERR_MODULE_NOT_FOUND on 'theme'. - .js extensions satisfied svelte-check and Vite but still broke the Tailwind loader, because the files on disk are .ts — Node ESM walks the actual filesystem and can't rewrite .js → .ts the way tsc does at type-check time. Flip the web app's tsconfig to "allowImportingTsExtensions": true and put the .ts extensions back. tsc now accepts the imports, and Node's loader finds the real file on disk. No build step, no emit, and the shared-types package stays a pure source-only TS workspace. Co-Authored-By: Claude Opus 4.6 (1M context) --- apps/mana/apps/web/tsconfig.json | 1 + packages/shared-types/src/index.ts | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/apps/mana/apps/web/tsconfig.json b/apps/mana/apps/web/tsconfig.json index 9bcfdfe7a..6de3882ad 100644 --- a/apps/mana/apps/web/tsconfig.json +++ b/apps/mana/apps/web/tsconfig.json @@ -10,6 +10,7 @@ "sourceMap": true, "strict": true, "moduleResolution": "bundler", + "allowImportingTsExtensions": true, "verbatimModuleSyntax": true } } diff --git a/packages/shared-types/src/index.ts b/packages/shared-types/src/index.ts index 3b5047f00..19a97e2ef 100644 --- a/packages/shared-types/src/index.ts +++ b/packages/shared-types/src/index.ts @@ -5,25 +5,25 @@ */ // Theme types -export * from './theme.js'; +export * from './theme.ts'; // Auth types -export * from './auth.js'; +export * from './auth.ts'; // UI types -export * from './ui.js'; +export * from './ui.ts'; // Common utility types -export * from './common.js'; +export * from './common.ts'; // Contact types for cross-app integration -export * from './contact.js'; +export * from './contact.ts'; // Landing page configuration types -export * from './landing-config.js'; +export * from './landing-config.ts'; // AI structured-output Zod schemas (shared between mana-api + web frontend) -export * from './ai-schemas.js'; +export * from './ai-schemas.ts'; // API types export interface User {