@brainfish-ai/devdoc 0.1.21
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 +33 -0
- package/README.md +415 -0
- package/bin/devdoc.js +13 -0
- package/dist/cli/commands/build.d.ts +5 -0
- package/dist/cli/commands/build.js +87 -0
- package/dist/cli/commands/check.d.ts +1 -0
- package/dist/cli/commands/check.js +143 -0
- package/dist/cli/commands/create.d.ts +24 -0
- package/dist/cli/commands/create.js +387 -0
- package/dist/cli/commands/deploy.d.ts +9 -0
- package/dist/cli/commands/deploy.js +433 -0
- package/dist/cli/commands/dev.d.ts +6 -0
- package/dist/cli/commands/dev.js +139 -0
- package/dist/cli/commands/init.d.ts +11 -0
- package/dist/cli/commands/init.js +238 -0
- package/dist/cli/commands/keys.d.ts +12 -0
- package/dist/cli/commands/keys.js +165 -0
- package/dist/cli/commands/start.d.ts +5 -0
- package/dist/cli/commands/start.js +56 -0
- package/dist/cli/commands/upload.d.ts +13 -0
- package/dist/cli/commands/upload.js +238 -0
- package/dist/cli/commands/whoami.d.ts +8 -0
- package/dist/cli/commands/whoami.js +91 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +106 -0
- package/dist/config/index.d.ts +80 -0
- package/dist/config/index.js +133 -0
- package/dist/constants.d.ts +9 -0
- package/dist/constants.js +13 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +12 -0
- package/dist/utils/logger.d.ts +16 -0
- package/dist/utils/logger.js +61 -0
- package/dist/utils/paths.d.ts +16 -0
- package/dist/utils/paths.js +50 -0
- package/package.json +51 -0
- package/renderer/app/api/assets/[...path]/route.ts +123 -0
- package/renderer/app/api/assets/route.ts +124 -0
- package/renderer/app/api/assets/upload/route.ts +177 -0
- package/renderer/app/api/auth-schemes/route.ts +77 -0
- package/renderer/app/api/chat/route.ts +858 -0
- package/renderer/app/api/codegen/route.ts +72 -0
- package/renderer/app/api/collections/route.ts +1016 -0
- package/renderer/app/api/debug/route.ts +53 -0
- package/renderer/app/api/deploy/route.ts +234 -0
- package/renderer/app/api/device/route.ts +42 -0
- package/renderer/app/api/docs/route.ts +187 -0
- package/renderer/app/api/keys/regenerate/route.ts +80 -0
- package/renderer/app/api/openapi-spec/route.ts +151 -0
- package/renderer/app/api/projects/[slug]/route.ts +153 -0
- package/renderer/app/api/projects/[slug]/stats/route.ts +96 -0
- package/renderer/app/api/projects/register/route.ts +152 -0
- package/renderer/app/api/proxy/route.ts +149 -0
- package/renderer/app/api/proxy-stream/route.ts +168 -0
- package/renderer/app/api/redirects/route.ts +47 -0
- package/renderer/app/api/schema/route.ts +65 -0
- package/renderer/app/api/subdomains/check/route.ts +172 -0
- package/renderer/app/api/suggestions/route.ts +144 -0
- package/renderer/app/favicon.ico +0 -0
- package/renderer/app/globals.css +1103 -0
- package/renderer/app/layout.tsx +47 -0
- package/renderer/app/llms-full.txt/route.ts +346 -0
- package/renderer/app/llms.txt/route.ts +279 -0
- package/renderer/app/page.tsx +14 -0
- package/renderer/app/robots.txt/route.ts +84 -0
- package/renderer/app/sitemap.xml/route.ts +199 -0
- package/renderer/components/docs/index.ts +12 -0
- package/renderer/components/docs/mdx/accordion.tsx +169 -0
- package/renderer/components/docs/mdx/badge.tsx +132 -0
- package/renderer/components/docs/mdx/callouts.tsx +154 -0
- package/renderer/components/docs/mdx/cards.tsx +213 -0
- package/renderer/components/docs/mdx/changelog.tsx +120 -0
- package/renderer/components/docs/mdx/code-block.tsx +186 -0
- package/renderer/components/docs/mdx/code-group.tsx +421 -0
- package/renderer/components/docs/mdx/file-embeds.tsx +105 -0
- package/renderer/components/docs/mdx/frame.tsx +112 -0
- package/renderer/components/docs/mdx/highlight.tsx +151 -0
- package/renderer/components/docs/mdx/iframe.tsx +134 -0
- package/renderer/components/docs/mdx/image.tsx +235 -0
- package/renderer/components/docs/mdx/index.ts +204 -0
- package/renderer/components/docs/mdx/mermaid.tsx +240 -0
- package/renderer/components/docs/mdx/param-field.tsx +200 -0
- package/renderer/components/docs/mdx/steps.tsx +113 -0
- package/renderer/components/docs/mdx/tabs.tsx +86 -0
- package/renderer/components/docs/mdx-renderer.tsx +100 -0
- package/renderer/components/docs/navigation/breadcrumbs.tsx +76 -0
- package/renderer/components/docs/navigation/index.ts +8 -0
- package/renderer/components/docs/navigation/page-nav.tsx +64 -0
- package/renderer/components/docs/navigation/sidebar.tsx +515 -0
- package/renderer/components/docs/navigation/toc.tsx +113 -0
- package/renderer/components/docs/notice.tsx +105 -0
- package/renderer/components/docs-header.tsx +274 -0
- package/renderer/components/docs-viewer/agent/agent-chat.tsx +2076 -0
- package/renderer/components/docs-viewer/agent/cards/debug-context-card.tsx +90 -0
- package/renderer/components/docs-viewer/agent/cards/endpoint-context-card.tsx +49 -0
- package/renderer/components/docs-viewer/agent/cards/index.tsx +50 -0
- package/renderer/components/docs-viewer/agent/cards/response-options-card.tsx +212 -0
- package/renderer/components/docs-viewer/agent/cards/types.ts +84 -0
- package/renderer/components/docs-viewer/agent/chat-message.tsx +17 -0
- package/renderer/components/docs-viewer/agent/index.tsx +6 -0
- package/renderer/components/docs-viewer/agent/messages/assistant-message.tsx +119 -0
- package/renderer/components/docs-viewer/agent/messages/chat-message.tsx +46 -0
- package/renderer/components/docs-viewer/agent/messages/index.ts +17 -0
- package/renderer/components/docs-viewer/agent/messages/tool-call-display.tsx +721 -0
- package/renderer/components/docs-viewer/agent/messages/types.ts +61 -0
- package/renderer/components/docs-viewer/agent/messages/typing-indicator.tsx +24 -0
- package/renderer/components/docs-viewer/agent/messages/user-message.tsx +51 -0
- package/renderer/components/docs-viewer/code-editor/index.tsx +2 -0
- package/renderer/components/docs-viewer/code-editor/notes-mode.tsx +1283 -0
- package/renderer/components/docs-viewer/content/changelog-page.tsx +331 -0
- package/renderer/components/docs-viewer/content/doc-page.tsx +285 -0
- package/renderer/components/docs-viewer/content/documentation-viewer.tsx +17 -0
- package/renderer/components/docs-viewer/content/index.tsx +29 -0
- package/renderer/components/docs-viewer/content/introduction.tsx +21 -0
- package/renderer/components/docs-viewer/content/request-details.tsx +330 -0
- package/renderer/components/docs-viewer/content/sections/auth.tsx +69 -0
- package/renderer/components/docs-viewer/content/sections/body.tsx +66 -0
- package/renderer/components/docs-viewer/content/sections/headers.tsx +43 -0
- package/renderer/components/docs-viewer/content/sections/overview.tsx +40 -0
- package/renderer/components/docs-viewer/content/sections/parameters.tsx +43 -0
- package/renderer/components/docs-viewer/content/sections/responses.tsx +87 -0
- package/renderer/components/docs-viewer/global-auth-modal.tsx +352 -0
- package/renderer/components/docs-viewer/index.tsx +1466 -0
- package/renderer/components/docs-viewer/playground/auth-editor.tsx +280 -0
- package/renderer/components/docs-viewer/playground/body-editor.tsx +221 -0
- package/renderer/components/docs-viewer/playground/code-editor.tsx +224 -0
- package/renderer/components/docs-viewer/playground/code-snippet.tsx +387 -0
- package/renderer/components/docs-viewer/playground/graphql-playground.tsx +745 -0
- package/renderer/components/docs-viewer/playground/index.tsx +671 -0
- package/renderer/components/docs-viewer/playground/key-value-editor.tsx +261 -0
- package/renderer/components/docs-viewer/playground/method-selector.tsx +60 -0
- package/renderer/components/docs-viewer/playground/request-builder.tsx +179 -0
- package/renderer/components/docs-viewer/playground/request-tabs.tsx +237 -0
- package/renderer/components/docs-viewer/playground/response-cards/idle-card.tsx +21 -0
- package/renderer/components/docs-viewer/playground/response-cards/index.tsx +93 -0
- package/renderer/components/docs-viewer/playground/response-cards/loading-card.tsx +16 -0
- package/renderer/components/docs-viewer/playground/response-cards/network-error-card.tsx +23 -0
- package/renderer/components/docs-viewer/playground/response-cards/response-body-card.tsx +268 -0
- package/renderer/components/docs-viewer/playground/response-cards/types.ts +82 -0
- package/renderer/components/docs-viewer/playground/response-viewer.tsx +43 -0
- package/renderer/components/docs-viewer/search/index.ts +2 -0
- package/renderer/components/docs-viewer/search/search-dialog.tsx +331 -0
- package/renderer/components/docs-viewer/search/use-search.ts +117 -0
- package/renderer/components/docs-viewer/shared/markdown-renderer.tsx +431 -0
- package/renderer/components/docs-viewer/shared/method-badge.tsx +41 -0
- package/renderer/components/docs-viewer/shared/schema-viewer.tsx +349 -0
- package/renderer/components/docs-viewer/sidebar/collection-tree.tsx +239 -0
- package/renderer/components/docs-viewer/sidebar/endpoint-options.tsx +316 -0
- package/renderer/components/docs-viewer/sidebar/index.tsx +343 -0
- package/renderer/components/docs-viewer/sidebar/right-sidebar.tsx +202 -0
- package/renderer/components/docs-viewer/sidebar/sidebar-group.tsx +118 -0
- package/renderer/components/docs-viewer/sidebar/sidebar-item.tsx +226 -0
- package/renderer/components/docs-viewer/sidebar/sidebar-section.tsx +52 -0
- package/renderer/components/theme-provider.tsx +11 -0
- package/renderer/components/theme-toggle.tsx +76 -0
- package/renderer/components/ui/badge.tsx +46 -0
- package/renderer/components/ui/button.tsx +59 -0
- package/renderer/components/ui/dialog.tsx +118 -0
- package/renderer/components/ui/dropdown-menu.tsx +257 -0
- package/renderer/components/ui/input.tsx +21 -0
- package/renderer/components/ui/label.tsx +24 -0
- package/renderer/components/ui/navigation-menu.tsx +168 -0
- package/renderer/components/ui/select.tsx +190 -0
- package/renderer/components/ui/spinner.tsx +114 -0
- package/renderer/components/ui/tabs.tsx +66 -0
- package/renderer/components/ui/tooltip.tsx +61 -0
- package/renderer/hooks/use-code-copy.ts +88 -0
- package/renderer/hooks/use-openapi-title.ts +44 -0
- package/renderer/lib/api-docs/agent/index.ts +6 -0
- package/renderer/lib/api-docs/agent/indexer.ts +323 -0
- package/renderer/lib/api-docs/agent/spec-summary.ts +335 -0
- package/renderer/lib/api-docs/agent/types.ts +116 -0
- package/renderer/lib/api-docs/auth/auth-context.tsx +225 -0
- package/renderer/lib/api-docs/auth/auth-storage.ts +87 -0
- package/renderer/lib/api-docs/auth/crypto.ts +89 -0
- package/renderer/lib/api-docs/auth/index.ts +4 -0
- package/renderer/lib/api-docs/code-editor/db.ts +164 -0
- package/renderer/lib/api-docs/code-editor/hooks.ts +266 -0
- package/renderer/lib/api-docs/code-editor/index.ts +6 -0
- package/renderer/lib/api-docs/code-editor/mode-context.tsx +207 -0
- package/renderer/lib/api-docs/code-editor/types.ts +105 -0
- package/renderer/lib/api-docs/codegen/definitions.ts +297 -0
- package/renderer/lib/api-docs/codegen/har.ts +251 -0
- package/renderer/lib/api-docs/codegen/index.ts +159 -0
- package/renderer/lib/api-docs/factories.ts +151 -0
- package/renderer/lib/api-docs/index.ts +17 -0
- package/renderer/lib/api-docs/mobile-context.tsx +112 -0
- package/renderer/lib/api-docs/navigation-context.tsx +88 -0
- package/renderer/lib/api-docs/parsers/graphql/README.md +129 -0
- package/renderer/lib/api-docs/parsers/graphql/index.ts +91 -0
- package/renderer/lib/api-docs/parsers/graphql/parser.ts +491 -0
- package/renderer/lib/api-docs/parsers/graphql/transformer.ts +246 -0
- package/renderer/lib/api-docs/parsers/graphql/types.ts +283 -0
- package/renderer/lib/api-docs/parsers/openapi/README.md +32 -0
- package/renderer/lib/api-docs/parsers/openapi/dereferencer.ts +60 -0
- package/renderer/lib/api-docs/parsers/openapi/extractors/auth.ts +574 -0
- package/renderer/lib/api-docs/parsers/openapi/extractors/body.ts +403 -0
- package/renderer/lib/api-docs/parsers/openapi/extractors/index.ts +232 -0
- package/renderer/lib/api-docs/parsers/openapi/index.ts +171 -0
- package/renderer/lib/api-docs/parsers/openapi/transformer.ts +277 -0
- package/renderer/lib/api-docs/parsers/openapi/validator.ts +31 -0
- package/renderer/lib/api-docs/playground/context.tsx +107 -0
- package/renderer/lib/api-docs/playground/navigation-context.tsx +124 -0
- package/renderer/lib/api-docs/playground/request-builder.ts +223 -0
- package/renderer/lib/api-docs/playground/request-runner.ts +282 -0
- package/renderer/lib/api-docs/playground/types.ts +35 -0
- package/renderer/lib/api-docs/types.ts +269 -0
- package/renderer/lib/api-docs/utils.ts +311 -0
- package/renderer/lib/cache.ts +193 -0
- package/renderer/lib/docs/config/index.ts +29 -0
- package/renderer/lib/docs/config/loader.ts +142 -0
- package/renderer/lib/docs/config/schema.ts +298 -0
- package/renderer/lib/docs/index.ts +12 -0
- package/renderer/lib/docs/mdx/compiler.ts +176 -0
- package/renderer/lib/docs/mdx/frontmatter.ts +80 -0
- package/renderer/lib/docs/mdx/index.ts +26 -0
- package/renderer/lib/docs/navigation/generator.ts +348 -0
- package/renderer/lib/docs/navigation/index.ts +12 -0
- package/renderer/lib/docs/navigation/types.ts +123 -0
- package/renderer/lib/docs-navigation-context.tsx +80 -0
- package/renderer/lib/multi-tenant/context.ts +105 -0
- package/renderer/lib/storage/blob.ts +845 -0
- package/renderer/lib/utils.ts +6 -0
- package/renderer/next.config.ts +76 -0
- package/renderer/package.json +66 -0
- package/renderer/postcss.config.mjs +5 -0
- package/renderer/public/assets/images/screenshot.png +0 -0
- package/renderer/public/assets/logo/dark.svg +9 -0
- package/renderer/public/assets/logo/light.svg +9 -0
- package/renderer/public/assets/logo.svg +9 -0
- package/renderer/public/file.svg +1 -0
- package/renderer/public/globe.svg +1 -0
- package/renderer/public/icon.png +0 -0
- package/renderer/public/logo.svg +9 -0
- package/renderer/public/window.svg +1 -0
- package/renderer/tsconfig.json +28 -0
- package/templates/basic/README.md +139 -0
- package/templates/basic/assets/favicon.svg +4 -0
- package/templates/basic/assets/logo.svg +9 -0
- package/templates/basic/docs.json +47 -0
- package/templates/basic/guides/configuration.mdx +149 -0
- package/templates/basic/guides/overview.mdx +96 -0
- package/templates/basic/index.mdx +39 -0
- package/templates/basic/package.json +14 -0
- package/templates/basic/quickstart.mdx +92 -0
- package/templates/basic/vercel.json +6 -0
- package/templates/graphql/README.md +139 -0
- package/templates/graphql/api-reference/schema.graphql +305 -0
- package/templates/graphql/assets/favicon.svg +4 -0
- package/templates/graphql/assets/logo.svg +9 -0
- package/templates/graphql/docs.json +54 -0
- package/templates/graphql/guides/configuration.mdx +149 -0
- package/templates/graphql/guides/overview.mdx +96 -0
- package/templates/graphql/index.mdx +39 -0
- package/templates/graphql/package.json +14 -0
- package/templates/graphql/quickstart.mdx +92 -0
- package/templates/graphql/vercel.json +6 -0
- package/templates/openapi/README.md +139 -0
- package/templates/openapi/api-reference/openapi.json +419 -0
- package/templates/openapi/assets/favicon.svg +4 -0
- package/templates/openapi/assets/logo.svg +9 -0
- package/templates/openapi/docs.json +61 -0
- package/templates/openapi/guides/configuration.mdx +149 -0
- package/templates/openapi/guides/overview.mdx +96 -0
- package/templates/openapi/index.mdx +39 -0
- package/templates/openapi/package.json +14 -0
- package/templates/openapi/quickstart.mdx +92 -0
- package/templates/openapi/vercel.json +6 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
GNU AFFERO GENERAL PUBLIC LICENSE
|
|
2
|
+
Version 3, 19 November 2007
|
|
3
|
+
|
|
4
|
+
Copyright (C) 2024 Brainfish AI
|
|
5
|
+
|
|
6
|
+
This program is free software: you can redistribute it and/or modify
|
|
7
|
+
it under the terms of the GNU Affero General Public License as published by
|
|
8
|
+
the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
(at your option) any later version.
|
|
10
|
+
|
|
11
|
+
This program is distributed in the hope that it will be useful,
|
|
12
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
GNU Affero General Public License for more details.
|
|
15
|
+
|
|
16
|
+
You should have received a copy of the GNU Affero General Public License
|
|
17
|
+
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
ADDITIONAL TERMS
|
|
22
|
+
|
|
23
|
+
This software is provided by Brainfish AI for use with the Brainfish
|
|
24
|
+
documentation platform. Commercial use, redistribution, or creation of
|
|
25
|
+
derivative works for commercial purposes requires explicit written
|
|
26
|
+
permission from Brainfish AI.
|
|
27
|
+
|
|
28
|
+
For commercial licensing inquiries, contact: support@brainfi.sh
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
The complete text of the GNU Affero General Public License v3.0 can be
|
|
33
|
+
found at: https://www.gnu.org/licenses/agpl-3.0.txt
|
package/README.md
ADDED
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
# @brainfish-ai/devdoc
|
|
2
|
+
|
|
3
|
+
Documentation framework for developers. Write docs in MDX, preview locally, deploy to Brainfish.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
Create a new documentation site with one command:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx @brainfish-ai/devdoc create my-docs
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This will prompt you to select a template:
|
|
14
|
+
|
|
15
|
+
- **Basic** - Simple documentation site with guides and pages
|
|
16
|
+
- **OpenAPI** - Documentation with REST API reference (OpenAPI/Swagger)
|
|
17
|
+
- **GraphQL** - Documentation with GraphQL API playground
|
|
18
|
+
|
|
19
|
+
You can also specify the template directly:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npx @brainfish-ai/devdoc create my-docs --template openapi
|
|
23
|
+
npx @brainfish-ai/devdoc create my-docs --template graphql
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Then start the development server:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
cd my-docs
|
|
30
|
+
npm run dev
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Open http://localhost:3000 to preview your docs.
|
|
34
|
+
|
|
35
|
+
## Installation
|
|
36
|
+
|
|
37
|
+
For existing projects:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
npm install @brainfish-ai/devdoc
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Or install globally:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npm install -g @brainfish-ai/devdoc
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Project Structure
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
my-docs/
|
|
53
|
+
├── docs.json # Configuration
|
|
54
|
+
├── index.mdx # Homepage
|
|
55
|
+
├── quickstart.mdx # Getting started guide
|
|
56
|
+
├── api-reference/ # API specs (OpenAPI/GraphQL)
|
|
57
|
+
└── public/ # Static assets
|
|
58
|
+
└── logo.svg
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### 2. Configure docs.json
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"name": "My Documentation",
|
|
66
|
+
"favicon": "/favicon.svg",
|
|
67
|
+
"navigation": {
|
|
68
|
+
"tabs": [
|
|
69
|
+
{
|
|
70
|
+
"tab": "Guides",
|
|
71
|
+
"type": "docs",
|
|
72
|
+
"groups": [
|
|
73
|
+
{
|
|
74
|
+
"group": "Getting Started",
|
|
75
|
+
"pages": ["index", "quickstart"]
|
|
76
|
+
}
|
|
77
|
+
]
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### 3. Write your docs
|
|
85
|
+
|
|
86
|
+
Create MDX files with frontmatter:
|
|
87
|
+
|
|
88
|
+
```mdx
|
|
89
|
+
---
|
|
90
|
+
title: Welcome
|
|
91
|
+
description: Get started with our documentation
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
# Welcome
|
|
95
|
+
|
|
96
|
+
This is your documentation homepage.
|
|
97
|
+
|
|
98
|
+
<Note>
|
|
99
|
+
This is a helpful note for your readers.
|
|
100
|
+
</Note>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### 4. Run the dev server
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
npx devdoc dev
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Open http://localhost:3000 to preview your docs.
|
|
110
|
+
|
|
111
|
+
## CLI Commands
|
|
112
|
+
|
|
113
|
+
| Command | Description |
|
|
114
|
+
| --------------- | ---------------------------------------- |
|
|
115
|
+
| `devdoc create` | Create a new DevDoc documentation site |
|
|
116
|
+
| `devdoc dev` | Start development server with hot reload |
|
|
117
|
+
| `devdoc build` | Build documentation for production |
|
|
118
|
+
| `devdoc start` | Start production server |
|
|
119
|
+
| `devdoc check` | Validate configuration and MDX files |
|
|
120
|
+
| `devdoc deploy` | Deploy documentation to DevDoc platform |
|
|
121
|
+
|
|
122
|
+
### Command Options
|
|
123
|
+
|
|
124
|
+
**devdoc create**
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
devdoc create [project-directory] [options]
|
|
128
|
+
|
|
129
|
+
Options:
|
|
130
|
+
-t, --template <type> Template to use (basic, openapi, graphql)
|
|
131
|
+
--no-git Skip git initialization
|
|
132
|
+
--no-install Skip installing dependencies
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Templates available:
|
|
136
|
+
- `basic` - Simple docs with guides
|
|
137
|
+
- `openapi` - Docs + REST API reference (OpenAPI/Swagger)
|
|
138
|
+
- `graphql` - Docs + GraphQL API playground
|
|
139
|
+
|
|
140
|
+
**devdoc dev**
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
devdoc dev [options]
|
|
144
|
+
|
|
145
|
+
Options:
|
|
146
|
+
-p, --port <port> Port to run server on (default: 3000)
|
|
147
|
+
-H, --host <host> Host to bind to (default: localhost)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
**devdoc build**
|
|
151
|
+
|
|
152
|
+
```bash
|
|
153
|
+
devdoc build [options]
|
|
154
|
+
|
|
155
|
+
Options:
|
|
156
|
+
-o, --output <dir> Output directory (default: dist)
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**devdoc start**
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
devdoc start [options]
|
|
163
|
+
|
|
164
|
+
Options:
|
|
165
|
+
-p, --port <port> Port to run server on (default: 3000)
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
**devdoc deploy**
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
devdoc deploy [options]
|
|
172
|
+
|
|
173
|
+
Options:
|
|
174
|
+
-u, --url <url> API URL (default: https://devdoc.sh)
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Deploy your documentation to the DevDoc platform and get a public URL (e.g., `https://my-docs.devdoc.sh`).
|
|
178
|
+
|
|
179
|
+
On first deploy, a `.devdoc.json` file is created to track your project. Subsequent deploys will update the same project.
|
|
180
|
+
|
|
181
|
+
## Configuration (docs.json)
|
|
182
|
+
|
|
183
|
+
### Basic Configuration
|
|
184
|
+
|
|
185
|
+
```json
|
|
186
|
+
{
|
|
187
|
+
"name": "My Product",
|
|
188
|
+
"logo": {
|
|
189
|
+
"light": "/logo/light.svg",
|
|
190
|
+
"dark": "/logo/dark.svg"
|
|
191
|
+
},
|
|
192
|
+
"favicon": "/favicon.ico",
|
|
193
|
+
"colors": {
|
|
194
|
+
"primary": "#10b981"
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
### Navigation
|
|
200
|
+
|
|
201
|
+
```json
|
|
202
|
+
{
|
|
203
|
+
"navigation": {
|
|
204
|
+
"tabs": [
|
|
205
|
+
{
|
|
206
|
+
"tab": "Documentation",
|
|
207
|
+
"type": "docs",
|
|
208
|
+
"groups": [
|
|
209
|
+
{
|
|
210
|
+
"group": "Getting Started",
|
|
211
|
+
"icon": "rocket-launch",
|
|
212
|
+
"pages": ["index", "quickstart"]
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"group": "Guides",
|
|
216
|
+
"pages": [
|
|
217
|
+
"guides/overview",
|
|
218
|
+
{
|
|
219
|
+
"group": "Advanced",
|
|
220
|
+
"pages": ["guides/advanced/topic1", "guides/advanced/topic2"]
|
|
221
|
+
}
|
|
222
|
+
]
|
|
223
|
+
}
|
|
224
|
+
]
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"tab": "API Reference",
|
|
228
|
+
"type": "openapi",
|
|
229
|
+
"path": "/api-reference",
|
|
230
|
+
"versions": [
|
|
231
|
+
{ "version": "v2", "spec": "api-reference/v2/openapi.json", "default": true },
|
|
232
|
+
{ "version": "v1", "spec": "api-reference/v1/openapi.json" }
|
|
233
|
+
]
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
"tab": "GraphQL API",
|
|
237
|
+
"type": "graphql",
|
|
238
|
+
"path": "/graphql-api",
|
|
239
|
+
"schema": "api-reference/schema.graphql",
|
|
240
|
+
"endpoint": "https://api.example.com/graphql"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
"tab": "Changelog",
|
|
244
|
+
"type": "changelog",
|
|
245
|
+
"path": "/changelog"
|
|
246
|
+
}
|
|
247
|
+
]
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### Notice Banner
|
|
253
|
+
|
|
254
|
+
```json
|
|
255
|
+
{
|
|
256
|
+
"notice": {
|
|
257
|
+
"content": "🚀 Check out [what's new](/changelog) in the latest release!",
|
|
258
|
+
"dismissible": true,
|
|
259
|
+
"background": "#1e293b"
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
### Redirects
|
|
265
|
+
|
|
266
|
+
```json
|
|
267
|
+
{
|
|
268
|
+
"redirects": [
|
|
269
|
+
{
|
|
270
|
+
"source": "/old-page",
|
|
271
|
+
"destination": "/new-page"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"source": "/docs/:slug*",
|
|
275
|
+
"destination": "/guides/:slug*"
|
|
276
|
+
}
|
|
277
|
+
]
|
|
278
|
+
}
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
## MDX Components
|
|
282
|
+
|
|
283
|
+
### Note / Warning / Tip
|
|
284
|
+
|
|
285
|
+
```mdx
|
|
286
|
+
<Note title="Important">
|
|
287
|
+
This is important information.
|
|
288
|
+
</Note>
|
|
289
|
+
|
|
290
|
+
<Warning>
|
|
291
|
+
Be careful with this operation.
|
|
292
|
+
</Warning>
|
|
293
|
+
|
|
294
|
+
<Tip>
|
|
295
|
+
Here's a helpful tip.
|
|
296
|
+
</Tip>
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
### Cards
|
|
300
|
+
|
|
301
|
+
```mdx
|
|
302
|
+
<Card title="Getting Started" href="/quickstart">
|
|
303
|
+
Learn how to get started quickly.
|
|
304
|
+
</Card>
|
|
305
|
+
|
|
306
|
+
<CardGroup cols={2}>
|
|
307
|
+
<Card title="Installation">Install the package</Card>
|
|
308
|
+
<Card title="Configuration">Configure your project</Card>
|
|
309
|
+
</CardGroup>
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
### Steps
|
|
313
|
+
|
|
314
|
+
```mdx
|
|
315
|
+
<Steps>
|
|
316
|
+
<Step title="Install">
|
|
317
|
+
Run `npm install @brainfish/devdoc`
|
|
318
|
+
</Step>
|
|
319
|
+
<Step title="Configure">
|
|
320
|
+
Create your `docs.json` file
|
|
321
|
+
</Step>
|
|
322
|
+
<Step title="Run">
|
|
323
|
+
Start the dev server with `devdoc dev`
|
|
324
|
+
</Step>
|
|
325
|
+
</Steps>
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
### Code Blocks
|
|
329
|
+
|
|
330
|
+
````mdx
|
|
331
|
+
```javascript title="example.js" {2-3}
|
|
332
|
+
function hello() {
|
|
333
|
+
// These lines are highlighted
|
|
334
|
+
console.log("Hello, world!");
|
|
335
|
+
}
|
|
336
|
+
```
|
|
337
|
+
````
|
|
338
|
+
|
|
339
|
+
### Accordion
|
|
340
|
+
|
|
341
|
+
```mdx
|
|
342
|
+
<Accordion title="Click to expand">
|
|
343
|
+
Hidden content that can be revealed.
|
|
344
|
+
</Accordion>
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
### Tabs
|
|
348
|
+
|
|
349
|
+
```mdx
|
|
350
|
+
<Tabs>
|
|
351
|
+
<Tab title="npm">
|
|
352
|
+
```bash
|
|
353
|
+
npm install package
|
|
354
|
+
```
|
|
355
|
+
</Tab>
|
|
356
|
+
<Tab title="yarn">
|
|
357
|
+
```bash
|
|
358
|
+
yarn add package
|
|
359
|
+
```
|
|
360
|
+
</Tab>
|
|
361
|
+
</Tabs>
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
## Deployment
|
|
365
|
+
|
|
366
|
+
### Brainfish (Recommended)
|
|
367
|
+
|
|
368
|
+
Deploy to Brainfish with a single command:
|
|
369
|
+
|
|
370
|
+
```bash
|
|
371
|
+
npx @brainfish-ai/devdoc deploy
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
Your docs will be live at `https://your-project.devdoc.sh`
|
|
375
|
+
|
|
376
|
+
### Manual Deployment
|
|
377
|
+
|
|
378
|
+
```bash
|
|
379
|
+
# Build for production
|
|
380
|
+
npx @brainfish-ai/devdoc build
|
|
381
|
+
|
|
382
|
+
# The output is in the dist/ directory
|
|
383
|
+
# Deploy this to any static hosting (Vercel, Netlify, etc.)
|
|
384
|
+
```
|
|
385
|
+
|
|
386
|
+
## Development
|
|
387
|
+
|
|
388
|
+
### Testing locally
|
|
389
|
+
|
|
390
|
+
```bash
|
|
391
|
+
# Clone the repo
|
|
392
|
+
git clone https://github.com/brainfish/brainfish-api-docs
|
|
393
|
+
|
|
394
|
+
# Install dependencies
|
|
395
|
+
cd brainfish-api-docs
|
|
396
|
+
npm install
|
|
397
|
+
|
|
398
|
+
# Build and test the CLI
|
|
399
|
+
npm run devdoc:dev
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
### Building for publish
|
|
403
|
+
|
|
404
|
+
```bash
|
|
405
|
+
# Build the full bundle (CLI + renderer)
|
|
406
|
+
npm run devdoc:bundle
|
|
407
|
+
|
|
408
|
+
# This creates packages/devdoc/renderer/ with the built app
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
## License
|
|
412
|
+
|
|
413
|
+
AGPL-3.0 - See [LICENSE](./LICENSE) for details.
|
|
414
|
+
|
|
415
|
+
For commercial licensing, contact: support@brainfi.sh
|
package/bin/devdoc.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* DevDoc CLI - Documentation framework for developers
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* devdoc dev - Start development server
|
|
8
|
+
* devdoc build - Build for production
|
|
9
|
+
* devdoc start - Start production server
|
|
10
|
+
* devdoc check - Validate configuration
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import('../dist/cli/index.js');
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.build = build;
|
|
7
|
+
const child_process_1 = require("child_process");
|
|
8
|
+
const path_1 = __importDefault(require("path"));
|
|
9
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
10
|
+
const config_1 = require("../../config");
|
|
11
|
+
const logger_1 = require("../../utils/logger");
|
|
12
|
+
const paths_1 = require("../../utils/paths");
|
|
13
|
+
async function build(options) {
|
|
14
|
+
const projectRoot = process.cwd();
|
|
15
|
+
logger_1.logger.info('Building documentation for production...');
|
|
16
|
+
// Check for docs.json
|
|
17
|
+
const configPath = path_1.default.join(projectRoot, 'docs.json');
|
|
18
|
+
if (!fs_extra_1.default.existsSync(configPath)) {
|
|
19
|
+
logger_1.logger.error('docs.json not found in current directory');
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
// Load and validate config
|
|
23
|
+
try {
|
|
24
|
+
const config = await (0, config_1.loadConfig)(projectRoot);
|
|
25
|
+
const validation = (0, config_1.validateConfig)(config);
|
|
26
|
+
if (!validation.valid) {
|
|
27
|
+
logger_1.logger.error('Invalid docs.json configuration:');
|
|
28
|
+
validation.errors.forEach(err => logger_1.logger.error(` - ${err}`));
|
|
29
|
+
process.exit(1);
|
|
30
|
+
}
|
|
31
|
+
logger_1.logger.success(`Building: ${config.name || 'Untitled'}`);
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
logger_1.logger.error(`Failed to load docs.json: ${error.message}`);
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
// Get the renderer directory
|
|
38
|
+
const rendererDir = (0, paths_1.getRendererDir)();
|
|
39
|
+
if (!rendererDir || !fs_extra_1.default.existsSync(rendererDir)) {
|
|
40
|
+
logger_1.logger.error('Renderer not found. Package may be corrupted.');
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
// Set environment variables
|
|
44
|
+
const env = {
|
|
45
|
+
...process.env,
|
|
46
|
+
STARTER_PATH: projectRoot,
|
|
47
|
+
};
|
|
48
|
+
const startTime = Date.now();
|
|
49
|
+
// Run Next.js build
|
|
50
|
+
const child = (0, child_process_1.spawn)('npx', ['next', 'build'], {
|
|
51
|
+
cwd: rendererDir,
|
|
52
|
+
env,
|
|
53
|
+
stdio: 'inherit',
|
|
54
|
+
shell: true,
|
|
55
|
+
});
|
|
56
|
+
child.on('error', (error) => {
|
|
57
|
+
logger_1.logger.error(`Build failed: ${error.message}`);
|
|
58
|
+
process.exit(1);
|
|
59
|
+
});
|
|
60
|
+
child.on('exit', async (code) => {
|
|
61
|
+
if (code !== 0) {
|
|
62
|
+
logger_1.logger.error('Build failed');
|
|
63
|
+
process.exit(code || 1);
|
|
64
|
+
}
|
|
65
|
+
// Copy build output to user's output directory
|
|
66
|
+
const nextOutput = path_1.default.join(rendererDir, '.next');
|
|
67
|
+
const outputDir = path_1.default.resolve(projectRoot, options.output);
|
|
68
|
+
try {
|
|
69
|
+
await fs_extra_1.default.ensureDir(outputDir);
|
|
70
|
+
await fs_extra_1.default.copy(nextOutput, path_1.default.join(outputDir, '.next'));
|
|
71
|
+
// Copy public assets from user's project
|
|
72
|
+
const publicDir = path_1.default.join(projectRoot, 'public');
|
|
73
|
+
if (fs_extra_1.default.existsSync(publicDir)) {
|
|
74
|
+
await fs_extra_1.default.copy(publicDir, path_1.default.join(outputDir, 'public'));
|
|
75
|
+
}
|
|
76
|
+
const duration = ((Date.now() - startTime) / 1000).toFixed(2);
|
|
77
|
+
logger_1.logger.success(`Build completed in ${duration}s`);
|
|
78
|
+
logger_1.logger.info(`Output: ${outputDir}`);
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
logger_1.logger.error(`Failed to copy build output: ${error.message}`);
|
|
82
|
+
process.exit(1);
|
|
83
|
+
}
|
|
84
|
+
process.exit(0);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVpbGQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY2xpL2NvbW1hbmRzL2J1aWxkLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBV0Esc0JBNEZDO0FBdkdELGlEQUFzQztBQUN0QyxnREFBd0I7QUFDeEIsd0RBQTBCO0FBQzFCLHlDQUEwRDtBQUMxRCwrQ0FBNEM7QUFDNUMsNkNBQW1EO0FBTTVDLEtBQUssVUFBVSxLQUFLLENBQUMsT0FBcUI7SUFDL0MsTUFBTSxXQUFXLEdBQUcsT0FBTyxDQUFDLEdBQUcsRUFBRSxDQUFDO0lBRWxDLGVBQU0sQ0FBQyxJQUFJLENBQUMsMENBQTBDLENBQUMsQ0FBQztJQUV4RCxzQkFBc0I7SUFDdEIsTUFBTSxVQUFVLEdBQUcsY0FBSSxDQUFDLElBQUksQ0FBQyxXQUFXLEVBQUUsV0FBVyxDQUFDLENBQUM7SUFDdkQsSUFBSSxDQUFDLGtCQUFFLENBQUMsVUFBVSxDQUFDLFVBQVUsQ0FBQyxFQUFFLENBQUM7UUFDL0IsZUFBTSxDQUFDLEtBQUssQ0FBQywwQ0FBMEMsQ0FBQyxDQUFDO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