@blaaiz/docs-core 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +103 -0
- package/dist/chunk-3ZX4WIE3.js +2984 -0
- package/dist/chunk-3ZX4WIE3.js.map +1 -0
- package/dist/chunk-JCYR6RPE.js +31 -0
- package/dist/chunk-JCYR6RPE.js.map +1 -0
- package/dist/chunk-ZKOOKLZ3.js +124 -0
- package/dist/chunk-ZKOOKLZ3.js.map +1 -0
- package/dist/cli.js +534 -0
- package/dist/cli.js.map +1 -0
- package/dist/generator.cjs +508 -0
- package/dist/generator.cjs.map +1 -0
- package/dist/generator.d.cts +122 -0
- package/dist/generator.d.ts +122 -0
- package/dist/generator.js +177 -0
- package/dist/generator.js.map +1 -0
- package/dist/index.cjs +3024 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1182 -0
- package/dist/index.d.ts +1182 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/navigation-CGqFIPlP.d.cts +498 -0
- package/dist/navigation-CGqFIPlP.d.ts +498 -0
- package/dist/openapi-types-CJ6p5Cux.d.cts +78 -0
- package/dist/openapi-types-CJ6p5Cux.d.ts +78 -0
- package/dist/ui/api-try-it.cjs +654 -0
- package/dist/ui/api-try-it.cjs.map +1 -0
- package/dist/ui/api-try-it.d.cts +78 -0
- package/dist/ui/api-try-it.d.ts +78 -0
- package/dist/ui/api-try-it.js +509 -0
- package/dist/ui/api-try-it.js.map +1 -0
- package/dist/ui/ask-ai.cjs +810 -0
- package/dist/ui/ask-ai.cjs.map +1 -0
- package/dist/ui/ask-ai.d.cts +57 -0
- package/dist/ui/ask-ai.d.ts +57 -0
- package/dist/ui/ask-ai.js +808 -0
- package/dist/ui/ask-ai.js.map +1 -0
- package/dist/ui/copy-page.cjs +312 -0
- package/dist/ui/copy-page.cjs.map +1 -0
- package/dist/ui/copy-page.d.cts +33 -0
- package/dist/ui/copy-page.d.ts +33 -0
- package/dist/ui/copy-page.js +183 -0
- package/dist/ui/copy-page.js.map +1 -0
- package/dist/ui/mermaid.cjs +363 -0
- package/dist/ui/mermaid.cjs.map +1 -0
- package/dist/ui/mermaid.d.cts +13 -0
- package/dist/ui/mermaid.d.ts +13 -0
- package/dist/ui/mermaid.js +361 -0
- package/dist/ui/mermaid.js.map +1 -0
- package/dist/ui.cjs +661 -0
- package/dist/ui.cjs.map +1 -0
- package/dist/ui.d.cts +428 -0
- package/dist/ui.d.ts +428 -0
- package/dist/ui.js +537 -0
- package/dist/ui.js.map +1 -0
- package/package.json +145 -0
- package/patches/fumadocs-openapi.patch +173 -0
- package/skills/AGENTS-section.md +36 -0
- package/skills/SKILL.md +363 -0
- package/styles/api-reference.css +1417 -0
- package/styles/ask-ai.css +563 -0
- package/styles/auth.css +462 -0
- package/styles/docs.css +247 -0
- package/styles/home.css +376 -0
- package/templates/init/content/docs/index.mdx.tmpl +52 -0
- package/templates/init/content/docs/meta.json.tmpl +3 -0
- package/templates/init/content/docs.json.tmpl +12 -0
- package/templates/init/content/nav.json.tmpl +7 -0
- package/templates/init/docs.config.ts.tmpl +36 -0
- package/templates/init/env.example.tmpl +15 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Blaaiz
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
<h1 align="center">@blaaiz/docs-core</h1>
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
A neutral, self-hostable documentation framework.<br>
|
|
5
|
+
Mintlify-compatible authoring · OpenAPI reference with a try-it playground · a hardened proxy.
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
<p align="center">
|
|
9
|
+
<a href="#status"><img alt="status" src="https://img.shields.io/badge/status-foundation-blue"></a>
|
|
10
|
+
<a href="./LICENSE"><img alt="license" src="https://img.shields.io/badge/license-MIT-green"></a>
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## What this is
|
|
16
|
+
|
|
17
|
+
`@blaaiz/docs-core` is the shared engine for Blaaiz-family documentation sites. It wraps
|
|
18
|
+
[Fumadocs](https://fumadocs.dev) and adds the pieces every docs site needs. The core owns the
|
|
19
|
+
logic. Each docs site installs this package and supplies only its own config and content.
|
|
20
|
+
|
|
21
|
+
- **Mintlify-compatible** — reads a `docs.json` navigation file and Mintlify-style MDX components.
|
|
22
|
+
- **OpenAPI-native** — renders an API reference and an interactive try-it playground from your
|
|
23
|
+
OpenAPI files.
|
|
24
|
+
- **Secure by default** — the try-it proxy forwards the caller's own token, injects no secrets, and
|
|
25
|
+
only reaches the API origins a site allow-lists. Every forward is rate-limited per client IP.
|
|
26
|
+
- **Ask AI built in** — `ai: { provider: 'anthropic' }` in config is a complete setup: a streaming
|
|
27
|
+
answer panel grounded in the site's own pages, with Anthropic and OpenAI as equals. The API key
|
|
28
|
+
stays on the server.
|
|
29
|
+
- **A CLI and agent skills** — `npx docs-core init` scaffolds a working site; `npx docs-core agents`
|
|
30
|
+
installs the docs-core skill for Claude Code and Codex, so an assistant edits the site correctly.
|
|
31
|
+
|
|
32
|
+
> **Status** — This repository currently contains the project foundation: the toolchain, the
|
|
33
|
+
> standards, and the architecture. Feature code lands next. See `docs/adr/`.
|
|
34
|
+
|
|
35
|
+
## Who uses it
|
|
36
|
+
|
|
37
|
+
Blaaiz publishes this as a public npm package. Any organization can install it and keep its own
|
|
38
|
+
config and content private. Each site is config plus content:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
your-docs/
|
|
42
|
+
docs.config.ts # theme, auth mode, API allow-list
|
|
43
|
+
docs.json # navigation
|
|
44
|
+
guides/**/*.mdx # prose
|
|
45
|
+
api-reference/**/*.json # OpenAPI files
|
|
46
|
+
package.json # installs @blaaiz/docs-core
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Start a site
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npx docs-core init # docs.config.ts, content/docs.json, starter pages, .env example
|
|
53
|
+
npx docs-core agents # the docs-core skill for Claude Code and Codex, plus AGENTS.md
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
`init` never overwrites without `--force`, and both commands print exactly what they wrote.
|
|
57
|
+
|
|
58
|
+
## Wire a site
|
|
59
|
+
|
|
60
|
+
Three pieces of the API reference live in this package and plug into a site:
|
|
61
|
+
|
|
62
|
+
```css
|
|
63
|
+
/* app/globals.css — after the fumadocs imports */
|
|
64
|
+
@import '@blaaiz/docs-core/styles/docs.css';
|
|
65
|
+
@import '@blaaiz/docs-core/styles/api-reference.css';
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
```tsx
|
|
69
|
+
// components/api-page.tsx
|
|
70
|
+
'use client';
|
|
71
|
+
import { apiOperationLayout } from '@blaaiz/docs-core/ui';
|
|
72
|
+
import { createOpenAPIPage } from 'fumadocs-openapi/ui';
|
|
73
|
+
|
|
74
|
+
export const APIPage = createOpenAPIPage({
|
|
75
|
+
content: { renderOperationLayout: apiOperationLayout },
|
|
76
|
+
});
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Copy `patches/fumadocs-openapi.patch` into the site and register it in
|
|
80
|
+
`pnpm-workspace.yaml` under `patchedDependencies`. It turns the code-sample
|
|
81
|
+
language tabs into a dropdown with the endpoint name as the panel title.
|
|
82
|
+
Re-check the patch on each `fumadocs-openapi` upgrade.
|
|
83
|
+
|
|
84
|
+
## Design in one rule
|
|
85
|
+
|
|
86
|
+
**The core owns the logic. Each site owns config and content.** If a thing is the same for every
|
|
87
|
+
organization, it is in this repo. If it changes per organization, it is in the site.
|
|
88
|
+
|
|
89
|
+
See [`docs/ARCHITECTURE.md`](./docs/ARCHITECTURE.md).
|
|
90
|
+
|
|
91
|
+
## Develop
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
corepack enable
|
|
95
|
+
pnpm install
|
|
96
|
+
pnpm run verify # format, lint, types, architecture, tests, build, public API
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
See [`CONTRIBUTING.md`](./CONTRIBUTING.md) for the full workflow.
|
|
100
|
+
|
|
101
|
+
## License
|
|
102
|
+
|
|
103
|
+
[MIT](./LICENSE) © Blaaiz
|