README.md
4.0 kB · markdown
KIT
- This folder is stamped as-is into each site's
kit/; a stamped copy is never edited, only its source. ssg/is the site builder:build.tsscans, fingerprints, renders and writes a site from itssite.jsonand a spec;links.tsresolves every markdown link;pic.tsdraws a dark and light picture pair.ssg/md.tsis the markdown pipeline: front matter, slugs, inline render, full render, sheet.git/is the code viewer, optional: agitblock insite.jsonenables it, and only then must the site carry the Shiki packagesdeps.jsonlists for it.lambda.tsis the builder Lambda both sites run: the event, the head, the GitHub ancestor check and ETag poll, the/opt/nodemodules layer, the build and the push, over one config object a repo's thinaws/*.tspasses in.stats/handler.pyis the 15-minute stats Lambda both sites run: CloudFront, Lambda and bucket numbers into one JSON key, and it names no site of its own.- It reads only
STATS_BUCKET,STATS_DISTRIBUTION(empty means no cdn block),STATS_FUNCTIONS,STATS_KEYand threelabel=prefixcount lists:STATS_SIZES(<label>_objectsand<label>_bytes),STATS_COUNTS(objects under a prefix) andSTATS_FOLDERS(immediate subfolders, narrowed by an optional regex third field). push.tsships a built site to its bucket by manifest diff: apushblock insite.jsonnames the prefix, the guarded paths, the bucket env keys, the manifest store and the immutable rule;--drylists every hashed path andDRY=1holds the manifest on disk instead of S3.shots.tsis the screenshot driver: ashotsblock insite.jsonnames the default routes and the sizes, it serves the builtdist/itself, drives one headless Chrome on one port with one throwaway profile, and writes intodata/<repo>/site/scripts/shots/{latest,baseline}.serve.tsis the SSR seam:serve(spec, site, path)finds the route that publishes a path, its own, one it lists inurlsor the slash route above it, renders it and answers aResponsewith the type the output carries, a placed copy from the globals, the 404 page for anything else, and never a file read by path;dev.tsimports it today and a Lambda imports the same function the day a page needs a request.dev.tsis the one dev server both sites run overserve.ts: it binds 127.0.0.1, renders on request, keeps the Bun HTML routes for the React entries a site names and builds its script entries on demand, watches every declared input, template and the kit, pushescssorreloadover one socket, injects the overlay into every HTML answer and never intodist/; underbun --hota script edit re-runs the entry with fresh modules while the socket stays up, and each site passes its spec, its entries, its disk mounts and its fixtures from ascripts/dev.tsof a handful of lines.vendor.tswrites a site's font folder: afontsblock insite.jsonnames the output folder, the Google families and their axes, the optional icon subset, and akeepcss of the faces the site cuts itself, which it copies verbatim intofonts.cssunder the vendored ones.palette.cssis the fifteen generated colours as CSS variables, at the kit root because a site's stylesheet loads it first.code/is the code viewer's skin:code.css, the SETI icon font, andcontract.cssbetween them and a site.- The kit's CSS reads only
--kit-*names;contract.cssgives each one a--site-*hook and a plain default. theme/is the same colours in JS:palette.jsthe fifteen as an object,theme.jsthe two role maps over them,darkandlight.font/is the pixel font that writes a wordmark:font.jslays out, writes, folds and plays a text,font.jsonthe glyph bookmrlyrs::fontgenerates.deps.jsonnames, per module, the npm packages it imports and the range each site must carry.- Every import between kit files is relative and stays inside the kit; nothing reaches out into a site.
bun test ./kitfrom a site runs every test, each one beside the file it covers.