From e7cb8c942b2abc1e2a3c422c877e9568956358da Mon Sep 17 00:00:00 2001 From: jules Date: Thu, 30 Apr 2026 08:26:45 +1000 Subject: [PATCH] feat: add /ai nav entry; pre-bundle arcadia/phoenix deps to fix 504s Adds an "AI" item to the sidebar nav (mirrors Vibespace's /ai route, already wired in routes.ts). vite.config.ts now lists openapi-fetch, phoenix, lucide-react, clsx, tailwind-merge, class-variance-authority in optimizeDeps.include and adds explicit resolve.alias entries for the arcadia and crema sibling libs so Vite resolves them on first load instead of triggering a re-optimize mid-session. Co-Authored-By: Claude Opus 4.7 (1M context) --- app/components/layout/app-shell.tsx | 1 + vite.config.ts | 37 +++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/app/components/layout/app-shell.tsx b/app/components/layout/app-shell.tsx index 240eb15..92e3591 100644 --- a/app/components/layout/app-shell.tsx +++ b/app/components/layout/app-shell.tsx @@ -89,6 +89,7 @@ const navItems: NavItem[] = [ { to: "/", icon: LayoutDashboard, label: "Overview", end: true }, { to: "/tenants", icon: Building2, label: "Tenants" }, { to: "/activity", icon: Activity, label: "Audit log" }, + { to: "/ai", icon: Bot, label: "AI" }, { to: "/settings", icon: Settings, label: "Settings" }, // CREMA:NAV-ITEMS ] diff --git a/vite.config.ts b/vite.config.ts index 4444802..89190c4 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -50,6 +50,21 @@ const codeUiSrc = fileURLToPath( const aiUiSrc = fileURLToPath( new URL("../lib-ai-ui/src", import.meta.url), ) +const authUiSrc = fileURLToPath( + new URL("../lib-auth-ui/src", import.meta.url), +) +const tableUiSrc = fileURLToPath( + new URL("../lib-table-ui/src", import.meta.url), +) +const searchUiSrc = fileURLToPath( + new URL("../lib-search-ui/src", import.meta.url), +) +const arcadiaClientSrc = fileURLToPath( + new URL("../lib-arcadia-client/src", import.meta.url), +) +const arcadiaAuthUiSrc = fileURLToPath( + new URL("../lib-arcadia-auth-ui/src", import.meta.url), +) // Sibling lib packages (lib-content-ui, lib-content-editor-ui) import bare // deps like clsx and @tiptap/* but have no node_modules of their own. Pin @@ -60,6 +75,8 @@ const aliasedDeps = [ "clsx", "tailwind-merge", "lucide-react", + "openapi-fetch", + "phoenix", "@tiptap/core", "@tiptap/react", "@tiptap/starter-kit", @@ -96,10 +113,30 @@ export default defineConfig({ "@crema/calendar-ui": `${calendarUiSrc}/index.tsx`, "@crema/code-ui": `${codeUiSrc}/index.tsx`, "@crema/ai-ui": `${aiUiSrc}/index.tsx`, + "@crema/auth-ui": `${authUiSrc}/index.tsx`, + "@crema/table-ui": `${tableUiSrc}/index.tsx`, + "@crema/search-ui": `${searchUiSrc}/index.tsx`, + "@crema/arcadia-client": `${arcadiaClientSrc}/index.tsx`, + "@crema/arcadia-auth-ui": `${arcadiaAuthUiSrc}/index.tsx`, ...sharedDepAliases, }, dedupe: dedupeDeps, }, + // Pre-bundle deps that sibling libs reach for. Without this, Vite + // discovers them lazily as routes are hit and re-runs the optimizer, + // invalidating already-served module URLs (browser sees 504 "Outdated + // Optimize Dep"). Listing them here forces one optimizer pass on + // startup so the cache is stable before the browser connects. + optimizeDeps: { + include: [ + "openapi-fetch", + "phoenix", + "lucide-react", + "clsx", + "tailwind-merge", + "class-variance-authority", + ], + }, server: { fs: { allow: [fileURLToPath(new URL("..", import.meta.url))],