Skip to content

Commit dde828e

Browse files
antfubotantfu
andauthored
docs: migrate the site from VitePress to Nuxt with the comark-docs layer (#274)
Co-authored-by: Anthony Fu <github@antfu.me>
1 parent 3c01a91 commit dde828e

198 files changed

Lines changed: 6559 additions & 3178 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ node_modules
1717
temp
1818
.turbo
1919
.ghfs
20-
**/.vitepress/cache
21-
**/.vitepress/dist
20+
.nuxt
21+
.data
2222
packages/devframe/skills
2323
test-results
2424
playwright-report

AGENTS.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Ahead-of-time build artifacts that live under `src/` - the shadow-root styleshee
4343
## Conventions
4444

4545
- RPC functions must use `defineRpcFunction`; always namespace IDs `devframes:plugin:<slug>:<fn-name>` (matching the plugin's `@devframes/plugin-<slug>` package name).
46-
- **No magic event names — use the centralized event maps.** Every event, broadcast, shared-state key, and channel name lives in one of two source-of-truth maps: `DEVFRAME_EVENTS` (`packages/devframe/src/events.ts`, re-exported from `devframe/constants`) for the core runtime, and `HUB_EVENTS` (`packages/hub/src/events.ts`, re-exported from `@devframes/hub/constants`) for the hub. Reference `DEVFRAME_EVENTS.*` / `HUB_EVENTS.*` at call sites (`.events.emit`/`.on`, `rpc.broadcast({ method })`, `sharedState.get(key)`, `defineHubRpcFunction({ name })`, `rpc.call`) instead of re-typing a string literal. The two maps and the [`docs/guide/events.md`](docs/guide/events.md) Events Reference are kept in lockstep: adding, renaming, or removing a name means editing the map **and** that page in the same change — every name in the maps appears in the tables, and vice versa. The only literals left are unavoidable type-position keys (the `EventEmitter<…>` maps in `types/*` and the `DevframeRpcClientFunctions`/`DevframeRpcServerFunctions` augmentations), which mirror the maps; a package that deliberately avoids a hub dependency (e.g. `@devframes/plugin-terminals`, which models the hub bridge structurally) keeps a local literal rather than importing `HUB_EVENTS`.
46+
- **No magic event names — use the centralized event maps.** Every event, broadcast, shared-state key, and channel name lives in one of two source-of-truth maps: `DEVFRAME_EVENTS` (`packages/devframe/src/events.ts`, re-exported from `devframe/constants`) for the core runtime, and `HUB_EVENTS` (`packages/hub/src/events.ts`, re-exported from `@devframes/hub/constants`) for the hub. Reference `DEVFRAME_EVENTS.*` / `HUB_EVENTS.*` at call sites (`.events.emit`/`.on`, `rpc.broadcast({ method })`, `sharedState.get(key)`, `defineHubRpcFunction({ name })`, `rpc.call`) instead of re-typing a string literal. The two maps and the [`docs/content/1.guide/20.events.md`](docs/content/1.guide/20.events.md) Events Reference are kept in lockstep: adding, renaming, or removing a name means editing the map **and** that page in the same change — every name in the maps appears in the tables, and vice versa. The only literals left are unavoidable type-position keys (the `EventEmitter<…>` maps in `types/*` and the `DevframeRpcClientFunctions`/`DevframeRpcServerFunctions` augmentations), which mirror the maps; a package that deliberately avoids a hub dependency (e.g. `@devframes/plugin-terminals`, which models the hub bridge structurally) keeps a local literal rather than importing `HUB_EVENTS`.
4747
- **Stay validator-neutral.** `devframe` and every `@devframes/*` package must not introduce a preferred schema validator dependency - no `valibot`, `zod`, `arktype`, etc. in their runtime `dependencies`. `args`/`returns`/flag schemas are typed against [Standard Schema](https://standardschema.dev/) (`@standard-schema/spec`, types-only); first-party code that needs to author a schema uses the built-in zero-dep `devframe/utils/simple-schema` builder (deliberately minimal - not a general validator). JSON-schema conversion uses each schema's own Standard JSON Schema converter (`~standard.jsonSchema`, implemented by e.g. zod 4) when present and degrades to a permissive object otherwise - no converter library and no vendor dependency is required. Docs, by contrast, should point *users* at a real validator for their own integrations - recommend **valibot** (lightest) or **zod** (worth reusing if they already pull it via the JSON-render or MCP integrations).
4848
- Shared state via `devframe/utils/shared-state`; keep values serializable.
4949
- Utility imports use the package-path form `devframe/utils/*`, never relative `../utils/*`.
@@ -134,12 +134,12 @@ Range allocation:
134134
diagnostics.DF0033({ id, reason, cause: error }, { method: 'warn' }) // attach cause
135135
```
136136

137-
3. **Create a docs page** at `docs/errors/DF0033.md` (when `docs/` lands):
137+
3. **Create a docs page** at `docs/content/6.errors/DF0033.md`:
138138
```md
139139
---
140-
outline: deep
140+
title: 'DF0033: Short Title'
141+
description: 'Something went wrong with "{name}"'
141142
---
142-
# DF0033: Short Title
143143

144144
## Message
145145
> Something went wrong with "`{name}`"

docs/.env.example

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Local comark-docs layer checkout for development
2+
# COMARK_DOCS_LAYER=../../comark-docs
3+
4+
# GitHub personal access token (production content reads; avoids anonymous rate limits)
5+
# GITHUB_TOKEN=

docs/.vitepress/config.ts

Lines changed: 0 additions & 252 deletions
This file was deleted.

docs/.vitepress/theme/index.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

docs/.vitepress/theme/style.css

Lines changed: 0 additions & 53 deletions
This file was deleted.

docs/adapters/index.md

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)