Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ single `probitas` binary (Bun runtime embedded).
## Quick Reference

- **Runtime**: Node.js + HonoX + Vite SSG
- **API Generation**: Deno 2.6 (`deno doc --json` schema version 1)
- **API Generation**: TypeDoc JSON from the npm packages
- **Deploy**: GitHub Pages

## Commands
Expand All @@ -15,9 +15,8 @@ single `probitas` binary (Bun runtime embedded).
npm run dev # Dev server with HMR
npm run build # Build static site (client + SSG + Pagefind)
npm run preview # Preview production build

# API docs generation (requires Deno 2.6 on PATH)
npm run generate-api
npm test # Check internal links in the built site
npm run generate-api # Regenerate data/api/ from the npm packages
```

## Pre-Completion Verification
Expand All @@ -34,6 +33,6 @@ When referencing Probitas API:

- Scenarios import from `@probitas-test/probitas` (npm); the JSR mirror is
`@probitas/probitas`
- Use `deno doc jsr:@probitas/{package}` for API data
- `data/api/{package}.json` holds the generated TypeDoc JSON of each package
- Check `../probitas/` for the user-facing package and CLI source
- Check `../probitas-packages/` for framework and client package source
21 changes: 14 additions & 7 deletions .claude/rules/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,17 @@ documents/
│ ├── llms.ts # LLM-friendly endpoints generation
│ ├── path.ts # basePath() helper for GitHub Pages
│ ├── signature-formatters.ts # Type signature formatting
│ ├── type-format.ts # Type formatting (TypeDoc types to text and links)
│ └── type-references.ts # Type reference resolution
├── data/ # Data modules
│ ├── api/ # Generated API JSON (deno doc --json)
│ ├── api/ # Generated API JSON (TypeDoc)
│ ├── docs.ts # Documentation pages configuration
│ └── api-pages.ts # API documentation loader
├── docs/ # Markdown documentation source
├── public/ # Static assets (CSS, images, favicon)
├── scripts/ # Build and generation scripts
│ ├── post-build.js # Pagefind indexing & llms.txt.html→llms.txt rename
│ └── generate-api-docs.ts # Fetch & process API docs from JSR
│ └── generate-api-docs.ts # Generate API docs from the npm packages
├── package.json # npm dependencies
├── vite.config.ts # Vite + HonoX SSG configuration
└── tsconfig.json # TypeScript configuration
Expand All @@ -76,15 +77,21 @@ documents/
### 1. API Documentation Generation

```bash
deno run -A scripts/generate-api-docs.ts
npm run generate-api
```

1. Fetches all `@probitas/*` packages from JSR API
2. Runs `deno doc --json` for each package
3. Processes and filters exports (removes private items, imports, etc.)
4. Saves to `data/api/{package}.json`
1. Lists the `@probitas-test/*` packages of the npm organization
2. Installs their latest versions into a temporary directory
3. Runs TypeDoc on each package's entry point (the published `.ts` sources),
documenting other `@probitas-test` packages' symbols a package re-exports
4. Drops namespaces and TypeDoc's theme-only data, and saves the TypeDoc JSON
to `data/api/{package}.json`
5. Generates `data/api/index.json` with package metadata

The site reads the TypeDoc JSON for types only and never loads TypeDoc at
runtime. `vite.config.ts` keeps Vite from resolving `typedoc`, because HonoX
otherwise walks into it while looking for islands.

### 2. Static Site Generation

```bash
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ jobs:

- run: npm run build

- run: npm test

# Upload artifact for GitHub Pages
- name: Upload artifact
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
Expand Down
25 changes: 11 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Probitas Documentation

[![GitHub Pages](https://img.shields.io/badge/docs-GitHub%20Pages-blue)](https://probitas-test.github.io/documents)
[![GitHub Pages](https://img.shields.io/badge/docs-GitHub%20Pages-blue)](https://probitas-test.github.io/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)

Documentation site for [Probitas](https://github.com/probitas-test/probitas) - a
Expand Down Expand Up @@ -34,7 +34,8 @@ npm run dev
| `npm run dev` | Start dev server with HMR |
| `npm run build` | Build static site to `dist/` (client + SSG + search) |
| `npm run preview` | Preview built site |
| `npm run generate-api` | Regenerate API documentation JSON (requires Deno) |
| `npm test` | Check internal links in the built site |
| `npm run generate-api` | Regenerate API documentation JSON |

## Project Structure

Expand All @@ -43,7 +44,7 @@ npm run dev
├── app/ # HonoX routes, templates, components, and libraries
├── docs/ # Markdown documentation source
├── data/
│ ├── api/ # Generated API JSON (deno doc --json)
│ ├── api/ # Generated API JSON (TypeDoc)
│ ├── index/ # Example scenarios shown on the home page
│ └── docs.ts # Documentation pages configuration
├── public/ # Static assets (CSS, images, favicon)
Expand Down Expand Up @@ -71,27 +72,23 @@ npm run dev
### Prerequisites

- [Node.js](https://nodejs.org/) (LTS)
- [Deno](https://deno.land/) 2.6 to regenerate the API documentation

### Regenerating API Documentation

API documentation is generated from the JSR packages using `deno doc`:
API documentation is generated from the npm packages using
[TypeDoc](https://typedoc.org/):

```bash
npm run generate-api
```

This script:

1. Fetches all `@probitas/*` packages from JSR API (skipping packages that are
no longer part of Probitas)
2. Runs `deno doc --json` for each package
3. Processes and saves the output to `data/api/`
4. Formats the generated JSON files

The site renders version 1 of the `deno doc --json` schema. Newer Deno releases
emit version 2, which the script rejects; until the site supports the new
schema, run it with Deno 2.6 first on `PATH` (the script spawns `deno` itself).
1. Lists the `@probitas-test/*` packages of the npm organization
2. Installs their latest versions into a temporary directory
3. Runs TypeDoc on each package's entry point
4. Saves each package's TypeDoc JSON to `data/api/`, with an index of the
packages in `data/api/index.json`

### Build Process

Expand Down
Loading
Loading