feat(landing): fetch live npm version for UI chips#21
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
apps/landing/lib/version.tsfetchesregistry.npmjs.org/agentsec/latestwith Next.js ISR (1h revalidate); falls back topackages/cli/package.jsonversion on failure.HeroandHeaderaccept aversionprop;Footeris 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.tsdrops the three landing chip entries — release stamps go from 7 → 4.bun run check:versionsstill gates the four remaining stamps (CLIpackage.json,AUDIT_VERSION, SKILL.md, SKILL.md mirror).AGENTS.mdversioning 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-repopackages/cli/package.jsonkeeps things working offline and in build environments without network access.Test plan
bun run check:versions— passes (4 stamps in sync)tsc --noEmitonapps/landing— cleanv0.3.2rendered in Header on/,/skill-watch,/examples; Hero on/; Footer on all threeFALLBACK_VERSION = "FALLBACK-SENTINEL", reloaded — chips still showedv0.3.2, confirming the live npm fetch is the source (not the fallback)🤖 Generated with Claude Code