doccupine 0.0.50 → 0.0.52
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 +2 -2
- package/README.md +88 -22
- package/dist/index.d.ts +2 -1
- package/dist/index.js +175 -404
- package/dist/index.test.d.ts +1 -0
- package/dist/index.test.js +48 -0
- package/dist/templates/app/api/mcp/route.d.ts +1 -1
- package/dist/templates/app/api/mcp/route.js +43 -8
- package/dist/templates/app/api/rag/route.d.ts +1 -1
- package/dist/templates/app/api/rag/route.js +27 -1
- package/dist/templates/app/api/theme/routes.d.ts +1 -1
- package/dist/templates/app/api/theme/routes.js +1 -1
- package/dist/templates/app/error.d.ts +1 -0
- package/dist/templates/app/error.js +45 -0
- package/dist/templates/app/layout.js +6 -3
- package/dist/templates/components/Chat.d.ts +1 -1
- package/dist/templates/components/Chat.js +5 -10
- package/dist/templates/components/Docs.d.ts +1 -1
- package/dist/templates/components/Docs.js +1 -1
- package/dist/templates/components/DocsSideBar.d.ts +1 -1
- package/dist/templates/components/DocsSideBar.js +1 -1
- package/dist/templates/components/MDXComponents.d.ts +1 -1
- package/dist/templates/components/MDXComponents.js +20 -10
- package/dist/templates/components/SideBar.d.ts +1 -1
- package/dist/templates/components/SideBar.js +3 -3
- package/dist/templates/components/layout/Accordion.d.ts +1 -1
- package/dist/templates/components/layout/Accordion.js +1 -1
- package/dist/templates/components/layout/ActionBar.d.ts +1 -1
- package/dist/templates/components/layout/ActionBar.js +1 -1
- package/dist/templates/components/layout/Button.d.ts +1 -1
- package/dist/templates/components/layout/Button.js +3 -2
- package/dist/templates/components/layout/Callout.d.ts +1 -1
- package/dist/templates/components/layout/Callout.js +1 -1
- package/dist/templates/components/layout/Card.d.ts +1 -1
- package/dist/templates/components/layout/Card.js +1 -1
- package/dist/templates/components/layout/Code.d.ts +1 -1
- package/dist/templates/components/layout/Code.js +1 -1
- package/dist/templates/components/layout/Columns.d.ts +1 -1
- package/dist/templates/components/layout/Columns.js +1 -1
- package/dist/templates/components/layout/DocsComponents.d.ts +1 -1
- package/dist/templates/components/layout/DocsComponents.js +1 -1
- package/dist/templates/components/layout/DocsNavigation.d.ts +1 -1
- package/dist/templates/components/layout/DocsNavigation.js +2 -2
- package/dist/templates/components/layout/Field.d.ts +1 -1
- package/dist/templates/components/layout/Field.js +1 -1
- package/dist/templates/components/layout/Footer.d.ts +1 -1
- package/dist/templates/components/layout/Footer.js +1 -1
- package/dist/templates/components/layout/Header.d.ts +1 -1
- package/dist/templates/components/layout/Header.js +4 -4
- package/dist/templates/components/layout/Pictograms.d.ts +1 -1
- package/dist/templates/components/layout/Pictograms.js +1 -1
- package/dist/templates/components/layout/SharedStyles.d.ts +1 -1
- package/dist/templates/components/layout/SharedStyles.js +1 -1
- package/dist/templates/components/layout/Steps.d.ts +1 -0
- package/dist/templates/components/layout/Steps.js +114 -0
- package/dist/templates/components/layout/Tabs.d.ts +1 -1
- package/dist/templates/components/layout/Tabs.js +1 -1
- package/dist/templates/components/layout/ThemeToggle.d.ts +1 -1
- package/dist/templates/components/layout/ThemeToggle.js +1 -1
- package/dist/templates/components/layout/Typography.d.ts +1 -1
- package/dist/templates/components/layout/Typography.js +1 -1
- package/dist/templates/components/layout/Update.d.ts +1 -1
- package/dist/templates/components/layout/Update.js +1 -1
- package/dist/templates/eslint.config.d.ts +1 -1
- package/dist/templates/eslint.config.js +28 -2
- package/dist/templates/mdx/deployment.mdx.d.ts +1 -1
- package/dist/templates/mdx/deployment.mdx.js +16 -21
- package/dist/templates/mdx/model-context-protocol.mdx.d.ts +1 -1
- package/dist/templates/mdx/model-context-protocol.mdx.js +25 -0
- package/dist/templates/package.js +2 -2
- package/dist/templates/proxy.d.ts +1 -1
- package/dist/templates/proxy.js +18 -0
- package/dist/templates/services/llm/config.d.ts +1 -1
- package/dist/templates/services/llm/config.js +1 -1
- package/dist/templates/services/llm/factory.d.ts +1 -1
- package/dist/templates/services/llm/factory.js +1 -1
- package/dist/templates/services/llm/types.d.ts +1 -1
- package/dist/templates/services/llm/types.js +1 -1
- package/dist/templates/services/mcp/tools.d.ts +1 -1
- package/dist/templates/services/mcp/tools.js +10 -3
- package/dist/templates/utils/orderNavItems.d.ts +1 -1
- package/dist/templates/utils/orderNavItems.js +3 -1
- package/dist/templates/utils/rateLimit.d.ts +1 -0
- package/dist/templates/utils/rateLimit.js +44 -0
- package/package.json +7 -5
package/LICENSE
CHANGED
|
@@ -2,7 +2,7 @@ Copyright © 2026, Doccupine.
|
|
|
2
2
|
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
4
|
|
|
5
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
-
No licensee or downstream recipient may use the Software (including any modified or derivative versions) to directly compete with the original Licensor by offering it to third parties as a hosted, managed, or Software-as-a-Service (SaaS) product or cloud service where the primary value of the service is the functionality of the Software itself.
|
|
5
|
+
1. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
2. No licensee or downstream recipient may use the Software (including any modified or derivative versions) to directly compete with the original Licensor by offering it to third parties as a hosted, managed, or Software-as-a-Service (SaaS) product or cloud service where the primary value of the service is the functionality of the Software itself.
|
|
7
7
|
|
|
8
8
|
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,39 +1,105 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Doccupine
|
|
2
2
|
|
|
3
|
-
[
|
|
3
|
+
[](https://www.npmjs.com/package/doccupine)
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Doccupine is built on open standards, enabling customization and extensibility for different documentation needs. You stay in control of your content, with the option to host docs yourself and tailor the website’s look and features to match your organization’s requirements.
|
|
5
|
+
[Doccupine](https://doccupine.com) is an open-source CLI that turns a directory of MDX files into a full-featured Next.js documentation website. Write your docs in Markdown, and Doccupine watches for changes, generates pages, and starts a live dev server automatically.
|
|
8
6
|
|
|
9
7
|
## Features
|
|
10
8
|
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
9
|
+
- **Live preview** - watches your MDX files and regenerates pages on every save
|
|
10
|
+
- **Auto-generated navigation** - sidebar built from frontmatter (`category`, `order`)
|
|
11
|
+
- **Theming** - dark/light mode with customizable theme via `theme.json`
|
|
12
|
+
- **AI chat assistant** - built-in RAG-powered chat (OpenAI, Anthropic, or Google)
|
|
13
|
+
- **MCP server** - exposes `search_docs`, `get_doc`, and `list_docs` tools for AI agents
|
|
14
|
+
- **Custom fonts** - Google Fonts or local fonts via `fonts.json`
|
|
15
|
+
- **Zero config to start** - `npx doccupine` scaffolds everything and starts the server
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
Make sure you have [Node.js](https://nodejs.org) (v18+) installed.
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npx doccupine
|
|
23
|
+
```
|
|
17
24
|
|
|
18
|
-
|
|
25
|
+
Doccupine will prompt you for:
|
|
19
26
|
|
|
20
|
-
|
|
27
|
+
1. A directory to store your MDX files (default: `docs`)
|
|
28
|
+
2. An output directory for the generated Next.js app (default: `nextjs-app`)
|
|
21
29
|
|
|
22
|
-
|
|
30
|
+
It then scaffolds the app, installs dependencies, and starts the dev server. Open http://localhost:3000 to view your docs.
|
|
23
31
|
|
|
24
|
-
|
|
32
|
+
## CLI Commands
|
|
25
33
|
|
|
26
34
|
```bash
|
|
27
|
-
|
|
35
|
+
doccupine watch [options] # Default. Watch MDX files and start dev server
|
|
36
|
+
doccupine build [options] # One-time build without starting the server
|
|
37
|
+
doccupine config --show # Show current configuration
|
|
38
|
+
doccupine config --reset # Re-prompt for configuration
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Options
|
|
42
|
+
|
|
43
|
+
| Flag | Description |
|
|
44
|
+
| --------------- | -------------------------------------------------------------------- |
|
|
45
|
+
| `--port <port>` | Port for the dev server (default: `3000`). Auto-increments if taken. |
|
|
46
|
+
| `--verbose` | Show all Next.js output including compilation details |
|
|
47
|
+
| `--reset` | Re-prompt for watch/output directories |
|
|
48
|
+
|
|
49
|
+
## MDX Frontmatter
|
|
50
|
+
|
|
51
|
+
Each MDX file supports these frontmatter fields:
|
|
52
|
+
|
|
53
|
+
```yaml
|
|
54
|
+
---
|
|
55
|
+
title: "Page Title"
|
|
56
|
+
description: "Page description for SEO"
|
|
57
|
+
category: "Getting Started"
|
|
58
|
+
categoryOrder: 0 # Sort order for the category group
|
|
59
|
+
order: 1 # Sort order within the category
|
|
60
|
+
icon: "https://..." # Page favicon URL
|
|
61
|
+
image: "https://..." # OpenGraph image URL
|
|
62
|
+
---
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Navigation is auto-generated from `category`, `categoryOrder`, and `order`. Pages without a category appear ungrouped.
|
|
66
|
+
|
|
67
|
+
## Configuration Files
|
|
68
|
+
|
|
69
|
+
Place these JSON files in your project root (where you run `doccupine`). They are auto-copied to the generated app and watched for changes.
|
|
70
|
+
|
|
71
|
+
| File | Purpose |
|
|
72
|
+
| ----------------- | --------------------------------------------------------------------------------------------------------- |
|
|
73
|
+
| `doccupine.json` | CLI config (watchDir, outputDir, port). Auto-generated on first run. |
|
|
74
|
+
| `config.json` | Site metadata: `name`, `description`, `icon`, `preview` image URL |
|
|
75
|
+
| `theme.json` | Theme overrides for [cherry-styled-components](https://github.com/cherry-design-system/styled-components) |
|
|
76
|
+
| `navigation.json` | Manual navigation structure (overrides auto-generated) |
|
|
77
|
+
| `links.json` | Static header/footer links |
|
|
78
|
+
| `fonts.json` | Font configuration (Google Fonts or local) |
|
|
79
|
+
|
|
80
|
+
## AI Chat Setup
|
|
81
|
+
|
|
82
|
+
The generated app includes an AI chat assistant. To enable it, create a `.env.local` file in the generated app directory:
|
|
83
|
+
|
|
84
|
+
```env
|
|
85
|
+
LLM_PROVIDER=openai # openai | anthropic | google
|
|
86
|
+
OPENAI_API_KEY=sk-...
|
|
87
|
+
# Or: ANTHROPIC_API_KEY=sk-ant-...
|
|
88
|
+
# Or: GOOGLE_API_KEY=...
|
|
28
89
|
```
|
|
29
90
|
|
|
30
|
-
|
|
31
|
-
|
|
91
|
+
If `LLM_PROVIDER` is not set, the chat component is hidden automatically.
|
|
92
|
+
|
|
93
|
+
## MCP Server
|
|
94
|
+
|
|
95
|
+
The generated app exposes an MCP endpoint at `/api/mcp` with three tools:
|
|
32
96
|
|
|
33
|
-
|
|
97
|
+
- `search_docs` - semantic search across all documentation
|
|
98
|
+
- `get_doc` - retrieve a specific document by path
|
|
99
|
+
- `list_docs` - list all available documents
|
|
34
100
|
|
|
35
|
-
|
|
101
|
+
This lets AI agents (Claude, ChatGPT, etc.) query your docs programmatically. Requires the AI chat setup above for embeddings.
|
|
36
102
|
|
|
37
|
-
|
|
103
|
+
## License
|
|
38
104
|
|
|
39
|
-
|
|
105
|
+
This project is licensed under a modified MIT license with a SaaS restriction. See [LICENSE](LICENSE) for details.
|
package/dist/index.d.ts
CHANGED