From d1d37749f77c914ad7f911700fb3d536501ede89 Mon Sep 17 00:00:00 2001 From: Till JS Date: Mon, 20 Apr 2026 14:58:59 +0200 Subject: [PATCH] fix(install): remove silent `|| true` from postinstall + narrow filter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The root postinstall was `node scripts/generate-env.mjs || true && pnpm run build:packages || true`. Two failures were being swallowed: 1. shared-auth's build has been broken for a while. shared-types re-exports its submodules with explicit `.ts` extensions (`export * from './theme.ts'`), which only works for downstream consumers that set `allowImportingTsExtensions: true`. shared-auth didn't — tsc emitted TS5097 on every re-export, the build failed, `|| true` hid it, every `pnpm install` appeared clean. 2. The filter `@mana/*` matches everything in the workspace, including `@mana/web` — the full 27-module SvelteKit build. On postinstall this kicked off vite, which OOM-aborted during SW generation. That's the original reason `|| true` was added, judging by shape. Fixes: - Dropped the `.ts` suffix from shared-types/src/index.ts re-exports. shared-types is consumed in bundler-mode tsconfigs everywhere, so no extension is the portable form. shared-types' own `tsc --noEmit` still passes. - Narrowed the filter from `@mana/*` (name-glob, matches apps) to `./packages/*` (path-glob, only workspace packages). Scope drops from 133 → 39 projects; build:packages now runs cleanly in ~15s. - Removed both `|| true` guards. A broken postinstall now fails loudly instead of producing a half-built state nobody notices. Verified: `pnpm install` completes exit 0 in 13s; all 39 packages build green. Closes audit item #37 (postinstall swallows errors). Co-Authored-By: Claude Opus 4.7 (1M context) --- package.json | 4 ++-- packages/shared-types/src/index.ts | 18 +++++++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index db7558bba..5d1b2eb17 100644 --- a/package.json +++ b/package.json @@ -36,8 +36,8 @@ "setup:db:chat": "./scripts/setup-databases.sh chat", "setup:db:auth": "./scripts/setup-databases.sh auth", "setup:dev-user": "./scripts/dev/setup-dev-user.sh", - "build:packages": "pnpm --filter '@mana/*' build", - "postinstall": "node scripts/generate-env.mjs || true && pnpm run build:packages || true", + "build:packages": "pnpm --filter './packages/*' build", + "postinstall": "node scripts/generate-env.mjs && pnpm run build:packages", "mana:dev": "turbo run dev --filter=mana...", "cards:dev": "turbo run dev --filter=cards...", "picture:dev": "turbo run dev --filter=picture...", diff --git a/packages/shared-types/src/index.ts b/packages/shared-types/src/index.ts index 19a97e2ef..7baa62e2d 100644 --- a/packages/shared-types/src/index.ts +++ b/packages/shared-types/src/index.ts @@ -4,26 +4,30 @@ * This package contains common TypeScript types used across all projects. */ +// Re-exports without file extensions. shared-types is consumed in +// bundler-mode tsconfigs across the monorepo; explicit `.ts` extensions +// require `allowImportingTsExtensions` on every downstream, which broke +// `shared-auth` and silently hid in the postinstall behind `|| true`. // Theme types -export * from './theme.ts'; +export * from './theme'; // Auth types -export * from './auth.ts'; +export * from './auth'; // UI types -export * from './ui.ts'; +export * from './ui'; // Common utility types -export * from './common.ts'; +export * from './common'; // Contact types for cross-app integration -export * from './contact.ts'; +export * from './contact'; // Landing page configuration types -export * from './landing-config.ts'; +export * from './landing-config'; // AI structured-output Zod schemas (shared between mana-api + web frontend) -export * from './ai-schemas.ts'; +export * from './ai-schemas'; // API types export interface User {