diff --git a/docs/turns/2026-05-21-fix-types-imports-next-build.html b/docs/turns/2026-05-21-fix-types-imports-next-build.html new file mode 100644 index 0000000..691e196 --- /dev/null +++ b/docs/turns/2026-05-21-fix-types-imports-next-build.html @@ -0,0 +1,234 @@ + + + + + + Fix packages/types imports for Next build + + + +
+
+
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

+ +
+
+ + diff --git a/packages/types/src/desktop-ai.ts b/packages/types/src/desktop-ai.ts index ecec773..c3e8e9a 100644 --- a/packages/types/src/desktop-ai.ts +++ b/packages/types/src/desktop-ai.ts @@ -5,8 +5,8 @@ import { FlowPacketSchema, OptionPrintSchema, SmartMoneyEventSchema -} from "./events.ts"; -import { OptionFlowFiltersSchema } from "./options-flow.ts"; +} from "./events"; +import { OptionFlowFiltersSchema } from "./options-flow"; export const IslandflowAiReasoningEffortSchema = z.enum([ "none", diff --git a/packages/types/src/events.ts b/packages/types/src/events.ts index b61e88e..0556bd8 100644 --- a/packages/types/src/events.ts +++ b/packages/types/src/events.ts @@ -1,5 +1,5 @@ import { z } from "zod"; -import { OptionNbboSideSchema, OptionTypeSchema, OptionsSignalModeSchema } from "./options-flow.ts"; +import { OptionNbboSideSchema, OptionTypeSchema, OptionsSignalModeSchema } from "./options-flow"; export const EventMetaSchema = z.object({ source_ts: z.number().int().nonnegative(), diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index 22b60bc..2e01011 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -1,6 +1,6 @@ -export * from "./events.ts"; -export * from "./live.ts"; -export * from "./options-flow.ts"; -export * from "./sp500.ts"; -export * from "./synthetic-market.ts"; -export * from "./desktop-ai.ts"; +export * from "./events"; +export * from "./live"; +export * from "./options-flow"; +export * from "./sp500"; +export * from "./synthetic-market"; +export * from "./desktop-ai"; diff --git a/packages/types/src/live.ts b/packages/types/src/live.ts index 9b60c34..10ac486 100644 --- a/packages/types/src/live.ts +++ b/packages/types/src/live.ts @@ -12,11 +12,11 @@ import { OptionNBBOSchema, OptionPrintSchema, SmartMoneyEventSchema -} from "./events.ts"; +} from "./events"; import { OptionFlowFiltersSchema, optionFlowFilterKey -} from "./options-flow.ts"; +} from "./options-flow"; export const CursorSchema = z.object({ ts: z.number().int().nonnegative(), diff --git a/packages/types/src/options-flow.ts b/packages/types/src/options-flow.ts index 0530ffd..75dd581 100644 --- a/packages/types/src/options-flow.ts +++ b/packages/types/src/options-flow.ts @@ -1,5 +1,5 @@ import { z } from "zod"; -import type { FlowPacket, OptionNBBO, OptionPrint } from "./events.ts"; +import type { FlowPacket, OptionNBBO, OptionPrint } from "./events"; export const SyntheticMarketModeSchema = z.enum(["realistic", "active", "firehose"]); export type SyntheticMarketMode = z.infer; diff --git a/packages/types/src/synthetic-market.ts b/packages/types/src/synthetic-market.ts index c46036b..ea30c86 100644 --- a/packages/types/src/synthetic-market.ts +++ b/packages/types/src/synthetic-market.ts @@ -1,7 +1,7 @@ import { z } from "zod"; -import type { SmartMoneyProfileId } from "./events.ts"; -import type { SyntheticMarketMode } from "./options-flow.ts"; -import { SP500_SYMBOLS } from "./sp500.ts"; +import type { SmartMoneyProfileId } from "./events"; +import type { SyntheticMarketMode } from "./options-flow"; +import { SP500_SYMBOLS } from "./sp500"; const SYNTHETIC_PROFILE_WEIGHT_VALUES = [0.6, 1.0, 1.6] as const; const SYNTHETIC_COVERAGE_WINDOW_VALUES = [10, 20, 30] as const;