Skip to content

feat(landing): fetch live npm version for UI chips#21

Merged
Markeljan merged 1 commit into
mainfrom
live-version-npm
May 21, 2026
Merged

feat(landing): fetch live npm version for UI chips#21
Markeljan merged 1 commit into
mainfrom
live-version-npm

Conversation

@Markeljan
Copy link
Copy Markdown
Collaborator

Summary

  • New apps/landing/lib/version.ts fetches registry.npmjs.org/agentsec/latest with Next.js ISR (1h revalidate); falls back to packages/cli/package.json version on failure.
  • Hero and Header accept a version prop; Footer is now an async server component that fetches directly. The three pages (/, /skill-watch, /examples) resolve the version once per render and thread it down.
  • scripts/version-stamps.ts drops the three landing chip entries — release stamps go from 7 → 4. bun run check:versions still gates the four remaining stamps (CLI package.json, AUDIT_VERSION, SKILL.md, SKILL.md mirror).
  • AGENTS.md versioning section updated to reflect the new "landing UI is self-updating" reality.

Why

The landing version chips were stamped into source on every bun run bump, which meant the website could drift from npm if a release was published out-of-band or if the bump skipped a file. Pulling the version live from the npm registry makes the chips authoritative without changing the release workflow — and the fallback to the in-repo packages/cli/package.json keeps things working offline and in build environments without network access.

Test plan

  • bun run check:versions — passes (4 stamps in sync)
  • tsc --noEmit on apps/landing — clean
  • Dev server SSR confirmed v0.3.2 rendered in Header on /, /skill-watch, /examples; Hero on /; Footer on all three
  • Sentinel test: temporarily set FALLBACK_VERSION = "FALLBACK-SENTINEL", reloaded — chips still showed v0.3.2, confirming the live npm fetch is the source (not the fallback)
  • Reviewer: confirm Vercel build picks up the new lib/ path

🤖 Generated with Claude Code

The Header/Hero/Footer version chips were stamped into source by the bump
script on every release. They now fetch from registry.npmjs.org/agentsec/latest
via a new lib/version.ts helper using Next.js ISR (1h revalidate), with a
fallback to packages/cli/package.json on failure. Page server components
thread the resolved version to <Header>/<Hero>; Footer fetches directly.

scripts/version-stamps.ts drops the three landing entries (7 stamps -> 4)
and AGENTS.md is updated to reflect the new behavior.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Markeljan Markeljan merged commit 372d3bd into main May 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant