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) <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
]
|
||||
|
||||
@@ -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))],
|
||||
|
||||
Reference in New Issue
Block a user