fix(types): enable allowImportingTsExtensions, restore .ts on shared-types

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) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-04-14 20:54:35 +02:00
parent e38257b93d
commit 513e3c7496
2 changed files with 8 additions and 7 deletions

View file

@ -10,6 +10,7 @@
"sourceMap": true,
"strict": true,
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true
}
}

View file

@ -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 {