diff --git a/package.json b/package.json index 9b51765..8bf24d4 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,8 @@ "build:dev": "vite build --mode development", "preview": "vite preview", "lint": "eslint .", - "format": "prettier --write ." + "format": "prettier --write .", + "postinstall": "node scripts/patch-lovable-config.cjs" }, "dependencies": { "@cloudflare/vite-plugin": "^1.25.5", diff --git a/scripts/patch-lovable-config.cjs b/scripts/patch-lovable-config.cjs new file mode 100644 index 0000000..6ef5953 --- /dev/null +++ b/scripts/patch-lovable-config.cjs @@ -0,0 +1,37 @@ +// Patches @lovable.dev/vite-tanstack-config to prefer the ESM entrypoint +// (dist/index.js) over the CJS one (dist/index.cjs) for import contexts. +// Required for Node.js >=22.12 compat — the CJS file does require("vite"), +// which is ESM-only, causing ERR_REQUIRE_CYCLE_MODULE. +const fs = require("fs"); +const path = require("path"); + +const pkgPath = path.resolve( + __dirname, + "..", + "node_modules", + "@lovable.dev", + "vite-tanstack-config", + "package.json", +); + +if (!fs.existsSync(pkgPath)) { + console.warn("[patch-lovable-config] package not found — skipping"); + process.exit(0); +} + +const pkg = JSON.parse(fs.readFileSync(pkgPath, "utf8")); + +if (pkg.exports) { + console.log("[patch-lovable-config] exports already present — nothing to do"); + process.exit(0); +} + +pkg.exports = { + ".": { + import: "./dist/index.js", + require: "./dist/index.cjs", + }, +}; + +fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2) + "\n"); +console.log("[patch-lovable-config] added exports field to prefer ESM entrypoint"); diff --git a/src/components/Commands.tsx b/src/components/Commands.tsx index 93266cd..083fea2 100644 --- a/src/components/Commands.tsx +++ b/src/components/Commands.tsx @@ -63,12 +63,12 @@ export const Commands = () => {
-
+
{commands.map((c, i) => (
-
+
-
12k+
+
12k+
Active clusters
-
99.99%
+
99.99%
Uptime SLA
-
<50ms
+
<50ms
Stream latency
diff --git a/src/components/Navbar.tsx b/src/components/Navbar.tsx index 1b953f0..41c42db 100644 --- a/src/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -1,5 +1,12 @@ import { Link } from "@tanstack/react-router"; -import { Star } from "lucide-react"; +import { Menu, Star } from "lucide-react"; + +import { + Sheet, + SheetTrigger, + SheetContent, + SheetClose, +} from "@/components/ui/sheet"; export const Navbar = () => { return ( @@ -15,11 +22,65 @@ export const Navbar = () => { Docs
+ {/* Mobile hamburger trigger — visible only below md */} + + + + + + + + + + {/* Desktop GitHub CTA — hidden on mobile (replaced by Sheet) */} Star us diff --git a/src/components/Terminal.tsx b/src/components/Terminal.tsx index 1d45020..40c5b77 100644 --- a/src/components/Terminal.tsx +++ b/src/components/Terminal.tsx @@ -30,7 +30,7 @@ export const Terminal = () => { ~/cluster — kdm
-
+
{lines.slice(0, visible).map((l, i) => (
{l.prompt && {l.prompt}} diff --git a/vite.config.ts b/vite.config.ts index bb81147..773c92a 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -12,7 +12,7 @@ const isVercel = process.env.VERCEL === "1"; // Redirect TanStack Start's bundled server entry to src/server.ts (our SSR error wrapper). // @cloudflare/vite-plugin builds from this — wrangler.jsonc main alone is insufficient. export default defineConfig({ - cloudflare: !isVercel, // Disable cloudflare plugin on Vercel + cloudflare: isVercel ? false : {}, // Disable cloudflare plugin on Vercel vite: { plugins: isVercel ? [nitro({ preset: "vercel" })] : [], },