Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"start": "next start -p 3020",
"lint": "eslint",
"typecheck": "tsc --noEmit --pretty false",
"check": "pnpm lint && pnpm typecheck && pnpm build"
"test:home-navigation": "node scripts/test-home-navigation.mjs",
"check": "pnpm lint && pnpm typecheck && pnpm test:home-navigation && pnpm build"
},
"dependencies": {
"@base-ui/react": "^1.5.0",
Expand Down
24 changes: 24 additions & 0 deletions scripts/test-home-navigation.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import assert from "node:assert/strict";
import { readFile, access } from "node:fs/promises";
import path from "node:path";
import { fileURLToPath } from "node:url";

const scriptDir = path.dirname(fileURLToPath(import.meta.url));
const repoRoot = path.resolve(scriptDir, "..");
const homeSourcePath = path.join(repoRoot, "src/components/product-home.tsx");
const validatePagePath = path.join(repoRoot, "src/app/validate/page.tsx");

const homeSource = await readFile(homeSourcePath, "utf8");

const validateHrefPattern =
/<Link\b[^>]*\bhref=\{?\s*["']\/validate["']\s*\}?[^>]*>/;

assert.match(
homeSource,
validateHrefPattern,
"Expected homepage to contain a static /validate Link href.",
);

await access(validatePagePath);

console.log("Home navigation contract OK: homepage links to /validate and page exists.");
9 changes: 9 additions & 0 deletions src/components/product-home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,15 @@ export function ProductHome() {
Watch guided replay
</Link>
</motion.div>
<motion.div variants={itemVariants} className="mt-4">
<Link
href="/validate"
className="inline-flex items-center gap-2 text-[13px] font-semibold text-[var(--text-dim)] transition-colors hover:text-[var(--accent)]"
>
Validate an event payload
<ArrowRight className="size-4" />
</Link>
</motion.div>
<motion.div variants={itemVariants} className="mt-14">
<p className="font-mono text-[10px] font-bold uppercase text-[var(--mute)]">Trusted by leading AI teams</p>
<div className="mt-5 flex flex-wrap items-center gap-x-7 gap-y-3 text-[12px] font-semibold text-[#8c97ad]">
Expand Down