Skip to content

feat: automated developer docs site (TypeDoc + Starlight + CI)#4

Merged
acebytes merged 7 commits into
mainfrom
feat/docs-site
Jul 24, 2026
Merged

feat: automated developer docs site (TypeDoc + Starlight + CI)#4
acebytes merged 7 commits into
mainfrom
feat/docs-site

Conversation

@acebytes

Copy link
Copy Markdown
Contributor

Automated developer-documentation site for the plugin SDK, targeting docs.appos.space. Everything lives in a new top-level docs-site/ directory plus one CI workflow.

Pipeline

  1. API Reference (TypeDoc) — three starlight-typedoc instances (one per package: plugin-types, view-builders, plugin-utils) run TypeDoc + typedoc-plugin-markdown over packages/*/src/index.ts during astro build. Output lands in src/content/docs/api/ (gitignored, regenerated every build). One instance per package is deliberate: starlight-typedoc's multi-entry mode deletes per-module index pages and leaves broken "Modules" links. tsconfig.typedoc.json maps @appos.space/plugin-types to the source entry so view-builders documents without a prior package build.
  2. Generated data pagesdocs-site/scripts/generate-docs-data.mjs extracts from the in-repo sources of truth (schemas/plugin-v1.json, schemas/constraints.json, packages/plugin-types/src/{permissions,core}.ts) and emits committed, deterministic pages: namespace map (all 43 context.* namespaces), manifest field reference, permission-scope catalog (135 canonical scopes grouped by subsystem + oauth.* family + 5 legacy aliases, with cross-source drift surfacing), runtime limits, and extension-point contribution surfaces.
  3. Site — Astro Starlight with sidebar: Getting Started (seeded from repo READMEs) / API Reference / Manifest & Permissions / Extension Points. Full-text search (Pagefind), sitemap, /api redirect.
  4. llms.txtgenerate-llms-txt.mjs runs post-build and emits dist/llms.txt (index) + dist/llms-full.txt (full corpus: every page incl. TypeDoc output + the SDK type sources + schemas), per llmstxt.org.
  5. CI (.github/workflows/docs.yml) — on push to main / relevant PRs: npm cidrift gate (npm run check-drift byte-compares committed generated pages against a fresh regeneration and verifies the SHA-256 input hash in generated-docs.hash; fails when the type declarations changed without regenerating) → full build → artifact upload.

What's stubbed

  • Cloudflare Pages deploy — committed as a commented job (project appos-docs, target docs.appos.space). Requires CLOUDFLARE_API_TOKEN + CLOUDFLARE_ACCOUNT_ID repo secrets before enabling; no credentials fabricated.
  • Extension-point payload schemas — the per-point payload catalog is host-repo-owned and not machine-readable here; the page derives contribution surfaces from contributor permission scopes and carries an explicit TODO callout.
  • Event-topic catalog — host-repo-owned; the page documents the typed-bus mechanism and carries a TODO callout (runtime fallback: events.listTopics()).

Verification

  • cd docs-site && npm install && npm run build → 224 pages, exit 0, zero TypeDoc/Astro warnings.
  • Internal-link sweep over built HTML: 225 files, all internal hrefs resolve.
  • Drift gate negative-tested: mutating permissions.tscheck-drift exits 1; restore → exits 0.

Local dev

cd docs-site && npm install && npm run dev

acebytes added 4 commits July 23, 2026 02:24
Astro Starlight site under docs-site/ targeting docs.appos.space:

- Three starlight-typedoc instances (one per SDK package) generate the
  API Reference from packages/*/src/index.ts at build time into
  src/content/docs/api/ (gitignored — regenerated every build).
  Single-entry-point mode per package is deliberate: multi-entry mode
  deletes per-module index pages and leaves broken Modules links.
- tsconfig.typedoc.json maps @appos.space/plugin-types to the source
  entry so view-builders documents without a prior package build.
- Hand-written Getting Started guides seeded from the repo READMEs
  (installation, first plugin, package overview) + manifest overview.
- Sidebar: Getting Started / API Reference / Manifest & Permissions /
  Extension Points. /api redirects to the plugin-types index.
scripts/generate-docs-data.mjs extracts from the in-repo sources of
truth (schemas/plugin-v1.json, schemas/constraints.json,
packages/plugin-types/src/{permissions,core}.ts) and emits committed,
deterministic pages:

- reference/namespaces.md — all 43 context.* namespaces from
  PluginContext, split legacy tier vs core-plugin tier
- manifest/reference.md — every plugin.json field from the JSON Schema
- manifest/permission-scopes.md — 135 canonical scopes grouped by
  subsystem + dynamic oauth.* family + 5 legacy aliases, with a
  cross-check between permissions.ts and constraints.json that surfaces
  drift in the page
- manifest/limits.md — runtime quotas, build constraints, view tokens
- extension-points/index.md — extensions[] mechanism + contribution
  surfaces derived from contributor permission scopes; TODO stub for
  the host-owned per-point payload schemas (not machine-readable here)
- extension-points/event-topics.md — typed-bus mechanism; TODO stub for
  the host-owned topic catalog (use events.listTopics() at runtime)

--check mode is the CI drift gate: regenerates in-memory, byte-compares
against committed files, and verifies the recorded SHA-256 input hash
(generated-docs.hash). Fails when type declarations change without the
generated docs being regenerated.
scripts/generate-llms-txt.mjs runs after astro build and emits into
dist/ per the llms.txt convention (llmstxt.org):

- llms.txt — site summary + grouped index of every page with URLs
- llms-full.txt — full corpus: raw markdown of every docs page
  (including the TypeDoc-generated API reference), the SDK TypeScript
  sources from all three packages, and the manifest schemas

Wired into npm run build as the final step.
.github/workflows/docs.yml — on push to main, PRs touching
docs-site/ | packages/ | schemas/, and manual dispatch:

1. npm ci in docs-site
2. Drift gate: npm run check-drift fails the build when the committed
   generated docs are stale vs the current type declarations/schemas
   (byte-compare + SHA-256 input-hash check)
3. Full site build (TypeDoc API reference + llms.txt) and artifact
   upload

The Cloudflare Pages deploy job (target docs.appos.space, project
appos-docs) is committed as a commented stub: CLOUDFLARE_API_TOKEN and
CLOUDFLARE_ACCOUNT_ID must be added as repo secrets before enabling.
No credentials are fabricated or committed.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 84b03afbf4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs-site/src/content/docs/getting-started/first-plugin.md Outdated
Comment thread docs-site/astro.config.mjs
Comment thread docs-site/src/content/docs/getting-started/packages.md Outdated
Comment thread docs-site/src/content/docs/getting-started/packages.md Outdated
Comment thread docs-site/src/content/docs/getting-started/installation.md Outdated
Comment thread docs-site/scripts/generate-docs-data.mjs
- Rewrite first-plugin quick-start against real fileOps/registerPanel surface (ctx.fs/ui.render + 3 more invented APIs)
- Fix packages.md snippets: button() options, callable prefix-keyed action router, real ctx.ui.openEditor
- Require no-op deactivate in installation guide per schemas/constraints.json requiredExports
- Extension-points generator: segment-boundary contributor-verb regex (adds palette.contribute.scope, webhook.route.register.unsigned)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b16ae5af6d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs-site/src/content/docs/getting-started/first-plugin.md
Comment thread docs-site/src/content/docs/getting-started/first-plugin.md Outdated
Comment thread docs-site/src/content/docs/getting-started/installation.md Outdated
Comment thread docs-site/src/content/docs/getting-started/installation.md Outdated
- installation.md: esbuild in install block, npx build one-liner, remove fictional global-types path (verified in fresh project)
- first-plugin.md: (globalThis as any) casts per host skill-doc idiom (strict-tsc verified)
- validate-schema.mjs: positional manifest support so the documented command actually validates the given file (also repairs manifest/index.md's invocation)
- docs.yml: un-stub Cloudflare Pages deploy (project appos-docs live, repo secrets set)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3d3d57a894

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/docs.yml
Comment thread docs-site/src/content/docs/getting-started/first-plugin.md Outdated
- README: replace stale 'deploy stubbed' bullet with Deployment section (job enabled, secrets configured, docs.appos.space live)
- first-plugin: npx esbuild build command matching installation.md idiom (scratch-verified)
@acebytes
acebytes merged commit 70af09b into main Jul 24, 2026
2 checks 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