mirror of
https://github.com/hanzoai/site.git
synced 2026-11-20 21:21:13 +00:00
* Type model, templates, reviews and sms pages under strict Props, state, refs and handlers typed; null guards where the types showed a possible null. creativeData exports Slug. Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk * Type Kai/Mori/Koe/Uta, research, philosophy, press and risk pages under strict Props, state, refs and handlers typed; ref callbacks no longer return the element. Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk * Type x-tender, solutions, story, tag, startups, support, newsletter and mcp pages under strict Captured-page trees and docs get shared types. Null-safe reads where a figure has no source or a page has no siblings. Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk * Type open source, platform, products, operative, trust, sdks and o11y pages under strict Captured-page trees, product docs and org data get shared types. Null guards on refs and canvas contexts; product() throws a clear error for a captured page with no API section. Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk * Type post, pricing, team, slack, skills, security, tabs and proof pages under strict Live pricing uses the lib Rung/Group/Row types. Null guards on refs and canvas contexts. Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk * Type models, studio, university, science, referral, operator, network and module pages under strict Model and university data tables get explicit row types; the Opener shape is shared by ModelsPage and Studio. Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk * Narrow the review entry in its test entry() returns Review | null under strict; the test asserts it is set before use. Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk * Type the Newsletter send button ref as a button Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk * Fit the callers of the typed pages to their types Product, solutions and tabs-tree callers use the page types; the open-source snapshot reads lib/oss's own Summary and Activity; the O11y card ref is a list item ref. Claude-Session: https://claude.ai/code/session_015XYKLix9PSyn6Jw2HWKprk
67 lines
3.3 KiB
TypeScript
67 lines
3.3 KiB
TypeScript
/* One Go module, at the address its import path has. It answers two callers with one page: the go tool reads the
|
|
go-import tag in the head (app/[...mod]/page.jsx), and a person who followed an import out of a stack trace lands
|
|
somewhere that says what the module is and where to read it. Words are hanzo-inc/app's. */
|
|
import type { ComponentType } from 'react';
|
|
import { CodeBlock } from '../kit';
|
|
import { UNREFERENCED, modulePathOf, repoOf } from '../../lib/modules';
|
|
import './Module.css';
|
|
|
|
/* The command is the path the module declares: Go accepts a module only under the path its own go.mod names, and
|
|
pkg.go.dev files it there. Any other path fetches the repo and then fails. */
|
|
export default function Module({ name }: { name: string }) {
|
|
const repo = repoOf(name);
|
|
const path = modulePathOf(name);
|
|
const About = ABOUT[name];
|
|
return (
|
|
<main className="xmo">
|
|
<div className="xmo-in">
|
|
<h1>hanzo.ai/{name}</h1>
|
|
<p className="xmo-lede">A Go module. This address is where its documentation lives; the source is on GitHub.</p>
|
|
<CodeBlock code={`go get ${path}`} />
|
|
<dl className="xmo-facts">
|
|
<div><dt>Source</dt><dd><a href={repo}>{repo}</a></dd></div>
|
|
<div>
|
|
<dt>Reference</dt>
|
|
<dd>{UNREFERENCED.has(name) ? 'pkg.go.dev has no page for this module.' : <a href={`https://pkg.go.dev/${path}`}>pkg.go.dev/{path}</a>}</dd>
|
|
</div>
|
|
</dl>
|
|
{About && <About />}
|
|
</div>
|
|
</main>
|
|
);
|
|
}
|
|
|
|
/* What a module is, where it has more to say than its name. */
|
|
const ABOUT: Partial<Record<string, ComponentType>> = { ci: Ci };
|
|
|
|
/* hanzo.ai/ci is Hanzo CI, the pipeline every Hanzo repo imports. */
|
|
function Ci() {
|
|
return (
|
|
<>
|
|
<h2>Hanzo CI</h2>
|
|
<p>One pipeline builds, tests and publishes every Hanzo repo. A repo says what it makes; the pipeline makes it the same way everywhere.</p>
|
|
|
|
<h2>hanzo.yml</h2>
|
|
<p>One file at the root of a repo names its images, the tests that gate them, and the static site it publishes, if it has one. The repo carries no build logic of its own.</p>
|
|
<CodeBlock label="hanzo.yml" code={`images:
|
|
- { name: api, context: ., repo: ghcr.io/acme/api }
|
|
test:
|
|
- { name: unit, run: go test ./... }`} />
|
|
|
|
<h2>The shared workflow</h2>
|
|
<p>A short workflow imports the pipeline from hanzoai/ci, so every repo runs the same steps from one definition. Tests run first, and a commit that fails them publishes nothing.</p>
|
|
<CodeBlock label=".hanzo/workflows/cicd.yml" code={`jobs:
|
|
cicd:
|
|
uses: hanzoai/ci/.github/workflows/build.yml@v2
|
|
secrets: inherit`} />
|
|
|
|
<h2>Runners</h2>
|
|
<p>Jobs run on Hanzo's runner fleet. To run them on your own machines, pass your runners' labels as <code>runner</code>.</p>
|
|
|
|
<h2>The build door</h2>
|
|
<p>With <code>mode: delegate</code>, a job hands each image to the build door, <code>POST /v1/build</code> on api.hanzo.ai. It builds every declared architecture on a native node and pushes one multi-architecture image, only into registries your organization owns. It reads the organization from the job's Hanzo identity, so it needs no secret of its own.</p>
|
|
<p>A build ends at a published image. What runs where is declared separately, and applied from that declaration.</p>
|
|
</>
|
|
);
|
|
}
|