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
17 changes: 10 additions & 7 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Probitas Documentation Site

Documentation for Probitas - a scenario-based testing framework for Deno.
Documentation for Probitas - a scenario-based testing framework shipped as a
single `probitas` binary (Bun runtime embedded).

## Quick Reference

- **Runtime**: Node.js + HonoX + Vite SSG
- **API Generation**: Deno (for generate-api-docs.ts)
- **API Generation**: Deno 2.6 (`deno doc --json` schema version 1)
- **Deploy**: GitHub Pages

## Commands
Expand All @@ -15,8 +16,8 @@ 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)
deno run -A scripts/generate-api-docs.ts
# API docs generation (requires Deno 2.6 on PATH)
npm run generate-api
```

## Pre-Completion Verification
Expand All @@ -29,8 +30,10 @@ npm run build

## Reference Probitas Packages

When referencing `@probitas/*` API:
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
- Check `../probitas/` for core framework source
- Check `../probitas-client/` for client package source
- Check `../probitas/` for the user-facing package and CLI source
- Check `../probitas-packages/` for framework and client package source
13 changes: 8 additions & 5 deletions .claude/rules/content.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ paths: "docs/**/*.md"
Every concept needs a runnable example:

```typescript
import { client, expect, scenario } from "jsr:@probitas/probitas";
import { client, expect, scenario } from "@probitas-test/probitas";

export default scenario("Example")
.resource(
Expand All @@ -29,9 +29,12 @@ export default scenario("Example")
.build();
```

Scenarios run on Bun inside the `probitas` binary: use `process.env` and `node:`
modules, never `Deno.*` APIs or `npm:`/`jsr:` specifiers.

## Package Documentation

| Repository | Packages |
| ------------------ | ------------------------------------------- |
| `probitas/` | Core: probitas, builder, runner, reporter |
| `probitas-client/` | Clients: http, grpc, graphql, redis, sql... |
| Repository | Packages |
| -------------------- | ------------------------------------------------------ |
| `probitas/` | User-facing package and CLI: `@probitas-test/probitas` |
| `probitas-packages/` | Framework and clients: builder, runner, client-*... |
15 changes: 10 additions & 5 deletions AI.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ Example prompt snippet:
- Keep steps in one scenario only when they depend on `ctx.previous`; otherwise
split into separate scenarios.
- Always `export default` and finish builders with `.build()`.
- Import Probitas from `@probitas-test/probitas`. Use Node.js APIs
(`process.env`, `node:fs/promises`, ...), not `Deno.*`, and import other
packages by bare name after installing them with a package manager.
- Register clients with `.resource()` and use env-driven URLs:
`Deno.env.get("API_URL") ?? "http://localhost:8080"`.
`process.env.API_URL ?? "http://localhost:8080"`.
- Use fluent `expect()` chains—no manual `if/throw` checks.
- `.setup()` should return a cleanup function when it creates fixtures.
- One responsibility per step; return data needed by subsequent steps.
Expand All @@ -70,6 +73,7 @@ Local probitas CLI commands:
- `probitas fmt` — format scenario files
- `probitas lint` — lint scenario files
- `probitas check` — type-check scenario files
- `probitas cache duckdb` — pre-fetch the DuckDB native binding

See `probitas <command> -h` for detailed CLI options.

Expand All @@ -79,14 +83,15 @@ See `probitas <command> -h` for detailed CLI options.
- `/docs/scenario/index.md` — scenario authoring guide
- `/docs/client/index.md` — client usage
- `/docs/expect/index.md` — assertion API
- For API details use `deno doc` directly (preferred over Markdown):
- `deno doc jsr:@probitas/probitas`
- `deno doc jsr:@probitas/probitas/client/http`
- `deno doc jsr:@probitas/probitas/expect`
- `/docs/migration/index.md` — differences from Probitas 1.x (Deno)
- For API details, read the type declarations installed by `probitas init` and
your package manager (`node_modules/@probitas-test/probitas/dist/**/*.d.ts`),
or the API reference under `/api/{package}/index.md`

## Links

- Claude Code plugin: https://github.com/probitas-test/claude-plugins
- Probitas documentation: https://probitas-test.github.io/documents
- Probitas repository: https://github.com/probitas-test/probitas
- npm package: https://www.npmjs.com/package/@probitas-test/probitas
- JSR package: https://jsr.io/@probitas/probitas
97 changes: 35 additions & 62 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,74 +3,53 @@
[![GitHub Pages](https://img.shields.io/badge/docs-GitHub%20Pages-blue)](https://probitas-test.github.io/documents)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)

Documentation site for [Probitas](https://jsr.io/@probitas/probitas) - a
scenario-based testing framework for Deno.
Documentation site for [Probitas](https://github.com/probitas-test/probitas) - a
scenario-based testing framework shipped as a single binary.

## Features

- 📖 Comprehensive documentation with markdown source
- 🔗 Auto-generated API reference from TypeScript source
- 🤖 LLM-friendly endpoints (`/llms.txt`, `*.md`)
- ⚡ Static site generation with Hono SSG
- ⚡ Static site generation with HonoX + Vite SSG

## Quick Start

```bash
# Clone the repository
git clone https://github.com/probitas-test/documents.git
cd documents
git clone https://github.com/probitas-test/probitas-test.github.io.git
cd probitas-test.github.io

# Start development server
deno task dev
# Install dependencies
npm ci

# Open http://localhost:8000
# Start development server
npm run dev
```

## Commands

| Command | Description |
| ------------------------ | --------------------------------- |
| `deno task dev` | Start dev server with watch mode |
| `deno task start` | Start production server |
| `deno task build` | Build static site to `dist/` |
| `deno task preview` | Preview built site |
| `deno task check` | Type check all files |
| `deno task test` | Run tests |
| `deno task verify` | Run fmt, lint, check, and test |
| `deno task generate-api` | Regenerate API documentation JSON |
| Command | Description |
| ---------------------- | ---------------------------------------------------- |
| `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) |

## Project Structure

```
documents/
├── main.ts # Entry point & Hono routes
├── deno.json # Project configuration
.
├── app/ # HonoX routes, templates, components, and libraries
├── docs/ # Markdown documentation source
├── data/
│ ├── api/ # Generated API JSON (deno doc --json)
│ ├── index/ # Example scenario index files
│ ├── index/ # Example scenarios shown on the home page
│ └── docs.ts # Documentation pages configuration
├── templates/ # JSX page templates
│ ├── api/ # API reference templates
│ ├── docs/ # Documentation page templates
│ ├── Layout.tsx # Main layout component
│ ├── HomeLayout.tsx # Home page layout
│ ├── components.tsx # Shared UI components
│ ├── home.tsx # Home page template
│ └── scripts.ts # Client-side JavaScript
├── lib/ # Utility modules
│ ├── api-docs.ts # API documentation types & utilities
│ ├── api-markdown.ts # API markdown generation
│ ├── markdown.ts # Markdown processing
│ ├── llms.ts # LLM-friendly endpoints
│ ├── signature-formatters.ts # Type signature formatting
│ └── type-references.ts # Type reference resolution
├── static/ # Static assets (CSS, images, favicon)
├── public/ # Static assets (CSS, images, favicon)
├── scripts/ # Build & generation scripts
│ ├── build.ts # Static site generation & Pagefind indexing
│ └── generate-api-docs.ts # API documentation fetching
├── tests/ # Integration tests
└── probitas/ # Example Probitas scenarios
└── probitas/ # Probitas scenarios checking the site
```

## Routes
Expand All @@ -91,54 +70,48 @@ documents/

### Prerequisites

- [Deno](https://deno.land/) 2.x or later
- [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 JSR packages using `deno doc`:
API documentation is generated from the JSR packages using `deno doc`:

```bash
deno task generate-api
npm run generate-api
```

This script:

1. Fetches all `@probitas/*` packages from JSR API
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 generated files are then used by the build process to create API reference
pages.
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).

### Build Process

The `deno task build` command performs the following steps:
The `npm run build` command performs the following steps:

1. **Static Site Generation**: Uses Hono's SSG to generate HTML, JSON, and
Markdown files
2. **Asset Copying**: Copies static assets (CSS, images, favicon) to `dist/`
1. **Client Build**: Bundles `app/client.ts`
2. **Static Site Generation**: Uses HonoX + Vite SSG to generate HTML, JSON, and
Markdown files (`public/` is copied to `dist/`)
3. **Search Indexing**: Runs [Pagefind](https://pagefind.app/) to generate a
search index

The build requires Pagefind to be installed. On macOS:

```bash
brew install pagefind
```

For other platforms, see
[Pagefind installation guide](https://pagefind.app/docs/installation/).

## Deployment

This site is deployed to **GitHub Pages** via GitHub Actions.

1. Push to `main` branch
2. GitHub Actions runs `deno task build`
2. GitHub Actions runs `npm run build`
3. Static files in `dist/` are deployed to GitHub Pages

Live site: https://probitas-test.github.io/documents
Live site: https://probitas-test.github.io/

## License

Expand Down
2 changes: 2 additions & 0 deletions app/lib/llms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export interface SiteMetadata {
name: string;
description: string;
github: string;
npm: string;
jsr: string;
}

Expand Down Expand Up @@ -135,6 +136,7 @@ export async function generateLlmsTxt(
"## Links",
"",
`- [GitHub](${siteMetadata.github})`,
`- [npm Package](${siteMetadata.npm})`,
`- [JSR Package](${siteMetadata.jsr})`,
"",
);
Expand Down
2 changes: 1 addition & 1 deletion app/templates/api/ApiPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ export async function PackagePage({ packageName }: PackagePageProps) {
<h2>Installation</h2>
<pre>
<code class="language-bash">
deno add jsr:{doc.specifier}
npm install @probitas-test/{doc.name}
</code>
</pre>
</div>
Expand Down
Loading
Loading