A package registry website for Cabin, a package manager and build system for C++.
This site is a fully static Astro build. Package data is fetched from
https://cabin.hasura.app/v1/graphql at build time, package detail pages are
pre-rendered, and /packages.json is generated for client-side search.
The output in dist/ can be served by Cloudflare Pages, Cloudflare Workers
Static Assets, or any static file host. No Next.js, Vercel runtime, SSR adapter,
API routes, or server functions are required.
Install Node.js dependencies:
yarn installStart the local Astro dev server:
yarn devyarn dev regenerates GraphQL types from Hasura before starting Astro, so a
fresh checkout works without a separate yarn generate step. Astro serves the
site at localhost:4321 by default.
yarn lint
yarn typecheck
yarn build
yarn previewyarn build regenerates GraphQL types, runs Astro type checking, fetches package
data from Hasura, verifies that generated HTML has no inline scripts, and writes
the static site to dist/.
Biome is used for TypeScript, JavaScript, CSS, and config files. Astro component
files are excluded from Biome because this setup relies on Astro's own parser and
type checker for .astro; run yarn typecheck directly, or rely on yarn build,
which runs astro check before building.
wrangler.jsonc is configured for Workers Static Assets with ./dist as the
asset directory. Build before deploying:
yarn build
yarn wrangler deployNo deploy workflow is included because Cloudflare account and project secrets vary by environment.
/search is a static page. In the browser it reads q, page, and perPage
from the URL, fetches /packages.json, searches the package index with Fuse.js,
and renders pagination links by updating the query string. The browser does not
call Hasura.
Each package gets two statically generated detail routes:
/packages/<group>/<name>renders the latest version./packages/<group>/<name>/<version>renders that exact version.
Both are pre-rendered at build time from the same Hasura package data and share
their markup through src/components/package/PackageDetailView.astro.
README Markdown is rendered with inline HTML disabled. README images must use
absolute http: or https: URLs to display; relative image URLs are rendered
without src so the browser does not request missing Cabin-local assets.
Package detail routes use /packages/<group>/<name>, matching the previous site
and Cabin's current two-segment package naming. Packages with names that do not
fit exactly one slash are included in /packages.json but do not get a generated
detail page; the search UI renders them as non-clickable cards.