Turn Document · 2026-05-21 · islandflow-c8f

Fix shared type imports for Next build

Resolved the web production build failure on the Electron/Codex branch by normalizing sibling imports in packages/types/src. The fix keeps the change surface narrow: only TypeScript module specifiers changed, with no runtime contract updates.

Summary

The shared type package was exporting and importing local files with explicit .ts suffixes. Next 16 type-checking rejected that layout during bun --cwd=apps/web run build. This turn removed those suffixes across the affected files and verified that the web production build now completes successfully.

Changes Made

Context

Recent Electron/Codex work introduced a new packages/types/src/desktop-ai.ts surface and switched the package to source-based workspace exports. That was compatible with the desktop runtime path, but the web production build still runs under Next's stricter TypeScript pipeline, which flagged the explicit .ts sibling imports.

Important Implementation Details

Relevant Diff Snippets

Snippets below use unified diff formatting compatible with tools documented by diffs.com.

diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts
-export * from "./events.ts";
-export * from "./live.ts";
-export * from "./options-flow.ts";
+export * from "./events";
+export * from "./live";
+export * from "./options-flow";
diff --git a/packages/types/src/desktop-ai.ts b/packages/types/src/desktop-ai.ts
-} from "./events.ts";
-import { OptionFlowFiltersSchema } from "./options-flow.ts";
+} from "./events";
+import { OptionFlowFiltersSchema } from "./options-flow";

Expected Impact for End-Users

The Electron/Codex branch can now produce a successful web build again, which unblocks shipping and testing of the desktop AI settings and Copilot surfaces without a separate manual tsconfig workaround.

Validation

Issues, Limitations, and Mitigations

Follow-up Work