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.
Files changed (85) hide show
  1. package/LICENSE +2 -2
  2. package/README.md +88 -22
  3. package/dist/index.d.ts +2 -1
  4. package/dist/index.js +175 -404
  5. package/dist/index.test.d.ts +1 -0
  6. package/dist/index.test.js +48 -0
  7. package/dist/templates/app/api/mcp/route.d.ts +1 -1
  8. package/dist/templates/app/api/mcp/route.js +43 -8
  9. package/dist/templates/app/api/rag/route.d.ts +1 -1
  10. package/dist/templates/app/api/rag/route.js +27 -1
  11. package/dist/templates/app/api/theme/routes.d.ts +1 -1
  12. package/dist/templates/app/api/theme/routes.js +1 -1
  13. package/dist/templates/app/error.d.ts +1 -0
  14. package/dist/templates/app/error.js +45 -0
  15. package/dist/templates/app/layout.js +6 -3
  16. package/dist/templates/components/Chat.d.ts +1 -1
  17. package/dist/templates/components/Chat.js +5 -10
  18. package/dist/templates/components/Docs.d.ts +1 -1
  19. package/dist/templates/components/Docs.js +1 -1
  20. package/dist/templates/components/DocsSideBar.d.ts +1 -1
  21. package/dist/templates/components/DocsSideBar.js +1 -1
  22. package/dist/templates/components/MDXComponents.d.ts +1 -1
  23. package/dist/templates/components/MDXComponents.js +20 -10
  24. package/dist/templates/components/SideBar.d.ts +1 -1
  25. package/dist/templates/components/SideBar.js +3 -3
  26. package/dist/templates/components/layout/Accordion.d.ts +1 -1
  27. package/dist/templates/components/layout/Accordion.js +1 -1
  28. package/dist/templates/components/layout/ActionBar.d.ts +1 -1
  29. package/dist/templates/components/layout/ActionBar.js +1 -1
  30. package/dist/templates/components/layout/Button.d.ts +1 -1
  31. package/dist/templates/components/layout/Button.js +3 -2
  32. package/dist/templates/components/layout/Callout.d.ts +1 -1
  33. package/dist/templates/components/layout/Callout.js +1 -1
  34. package/dist/templates/components/layout/Card.d.ts +1 -1
  35. package/dist/templates/components/layout/Card.js +1 -1
  36. package/dist/templates/components/layout/Code.d.ts +1 -1
  37. package/dist/templates/components/layout/Code.js +1 -1
  38. package/dist/templates/components/layout/Columns.d.ts +1 -1
  39. package/dist/templates/components/layout/Columns.js +1 -1
  40. package/dist/templates/components/layout/DocsComponents.d.ts +1 -1
  41. package/dist/templates/components/layout/DocsComponents.js +1 -1
  42. package/dist/templates/components/layout/DocsNavigation.d.ts +1 -1
  43. package/dist/templates/components/layout/DocsNavigation.js +2 -2
  44. package/dist/templates/components/layout/Field.d.ts +1 -1
  45. package/dist/templates/components/layout/Field.js +1 -1
  46. package/dist/templates/components/layout/Footer.d.ts +1 -1
  47. package/dist/templates/components/layout/Footer.js +1 -1
  48. package/dist/templates/components/layout/Header.d.ts +1 -1
  49. package/dist/templates/components/layout/Header.js +4 -4
  50. package/dist/templates/components/layout/Pictograms.d.ts +1 -1
  51. package/dist/templates/components/layout/Pictograms.js +1 -1
  52. package/dist/templates/components/layout/SharedStyles.d.ts +1 -1
  53. package/dist/templates/components/layout/SharedStyles.js +1 -1
  54. package/dist/templates/components/layout/Steps.d.ts +1 -0
  55. package/dist/templates/components/layout/Steps.js +114 -0
  56. package/dist/templates/components/layout/Tabs.d.ts +1 -1
  57. package/dist/templates/components/layout/Tabs.js +1 -1
  58. package/dist/templates/components/layout/ThemeToggle.d.ts +1 -1
  59. package/dist/templates/components/layout/ThemeToggle.js +1 -1
  60. package/dist/templates/components/layout/Typography.d.ts +1 -1
  61. package/dist/templates/components/layout/Typography.js +1 -1
  62. package/dist/templates/components/layout/Update.d.ts +1 -1
  63. package/dist/templates/components/layout/Update.js +1 -1
  64. package/dist/templates/eslint.config.d.ts +1 -1
  65. package/dist/templates/eslint.config.js +28 -2
  66. package/dist/templates/mdx/deployment.mdx.d.ts +1 -1
  67. package/dist/templates/mdx/deployment.mdx.js +16 -21
  68. package/dist/templates/mdx/model-context-protocol.mdx.d.ts +1 -1
  69. package/dist/templates/mdx/model-context-protocol.mdx.js +25 -0
  70. package/dist/templates/package.js +2 -2
  71. package/dist/templates/proxy.d.ts +1 -1
  72. package/dist/templates/proxy.js +18 -0
  73. package/dist/templates/services/llm/config.d.ts +1 -1
  74. package/dist/templates/services/llm/config.js +1 -1
  75. package/dist/templates/services/llm/factory.d.ts +1 -1
  76. package/dist/templates/services/llm/factory.js +1 -1
  77. package/dist/templates/services/llm/types.d.ts +1 -1
  78. package/dist/templates/services/llm/types.js +1 -1
  79. package/dist/templates/services/mcp/tools.d.ts +1 -1
  80. package/dist/templates/services/mcp/tools.js +10 -3
  81. package/dist/templates/utils/orderNavItems.d.ts +1 -1
  82. package/dist/templates/utils/orderNavItems.js +3 -1
  83. package/dist/templates/utils/rateLimit.d.ts +1 -0
  84. package/dist/templates/utils/rateLimit.js +44 -0
  85. 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
- # Welcome to Doccupine
1
+ # Doccupine
2
2
 
3
- [Doccupine](https://doccupine.com) is a free and open-source document management system that allows you to store, organize, and share your documentation with ease. Using Doccupine, you simply create your documentation in MDX files with traditional Markdown syntax, Doccupine monitors your changes automatically generating a beautiful, modern documentation website.
3
+ [![npm version](https://img.shields.io/npm/v/doccupine.svg)](https://www.npmjs.com/package/doccupine)
4
4
 
5
- ## Open Source and Extensible
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
- - 📝 Markdown-based content
12
- - 📦 Built-in file structure
13
- - Live Preview & Auto-Update
14
- - 🚀 Easy Deployment
15
- - 🤖 AI-powered
16
- - 🔌 Model Context Protocol (MCP)
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
- ## Getting Started
25
+ Doccupine will prompt you for:
19
26
 
20
- To get started with Doccupine, make sure you have [Node.js](https://nodejs.org) and npm installed on your machine. Then, follow these steps:
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
- - **Run Doccupine CLI:**
30
+ It then scaffolds the app, installs dependencies, and starts the dev server. Open http://localhost:3000 to view your docs.
23
31
 
24
- Create a new directory for your project and navigate to it in your terminal. Run the following command to create a new Doccupine project:
32
+ ## CLI Commands
25
33
 
26
34
  ```bash
27
- npx doccupine
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
- Once you run the command, Doccupine will ask you to select a directory to store your MDX files. Choose the directory where you want to create your documentation files.
31
- After selecting the directory, Doccupine will ask you to enter the name of the directory for the generated website. Enter the name of the directory where you want to create your website.
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
- This will start the development server on port 3000. Open your browser and navigate to http://localhost:3000 to view your documentation.
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
- ## Start documenting
101
+ This lets AI agents (Claude, ChatGPT, etc.) query your docs programmatically. Requires the AI chat setup above for embeddings.
36
102
 
37
- Start documenting your project by editing the `index.mdx` file in the choosen MDX directory, this is the content for the home page of your documentation website.
103
+ ## License
38
104
 
39
- In your MDX directory, you can structure your content using folders and files. Doccupine will automatically generate a navigation menu based on the configured categories and order.
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
@@ -1,2 +1,3 @@
1
1
  #!/usr/bin/env node
2
- export {};
2
+ export declare function generateSlug(filePath: string): string;
3
+ export declare function escapeTemplateContent(content: string): string;