doccupine 0.0.87 → 0.0.89
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/README.md +15 -2
- package/dist/index.js +177 -4
- package/dist/lib/layout.js +38 -24
- package/dist/lib/metadata.d.ts +30 -0
- package/dist/lib/metadata.js +98 -1
- package/dist/lib/structures.js +0 -2
- package/dist/lib/types.d.ts +1 -0
- package/dist/templates/app/robots.d.ts +1 -1
- package/dist/templates/app/robots.js +28 -1
- package/dist/templates/app/sitemap.d.ts +7 -0
- package/dist/templates/app/sitemap.js +56 -0
- package/dist/templates/app/theme.d.ts +1 -1
- package/dist/templates/app/theme.js +84 -19
- package/dist/templates/components/Chat.d.ts +1 -1
- package/dist/templates/components/Chat.js +26 -27
- package/dist/templates/components/SearchModalContent.d.ts +1 -1
- package/dist/templates/components/SearchModalContent.js +12 -6
- package/dist/templates/components/SideBar.d.ts +1 -1
- package/dist/templates/components/SideBar.js +3 -1
- package/dist/templates/components/layout/Accordion.d.ts +1 -1
- package/dist/templates/components/layout/Accordion.js +2 -1
- package/dist/templates/components/layout/ActionBar.d.ts +1 -1
- package/dist/templates/components/layout/ActionBar.js +4 -6
- package/dist/templates/components/layout/Button.d.ts +1 -1
- package/dist/templates/components/layout/Button.js +10 -0
- package/dist/templates/components/layout/Callout.d.ts +1 -1
- package/dist/templates/components/layout/Callout.js +75 -20
- package/dist/templates/components/layout/Card.d.ts +1 -1
- package/dist/templates/components/layout/Card.js +2 -1
- package/dist/templates/components/layout/CherryThemeProvider.d.ts +1 -1
- package/dist/templates/components/layout/CherryThemeProvider.js +6 -12
- package/dist/templates/components/layout/ClientThemeProvider.d.ts +1 -1
- package/dist/templates/components/layout/ClientThemeProvider.js +45 -40
- package/dist/templates/components/layout/Code.d.ts +1 -1
- package/dist/templates/components/layout/Code.js +223 -255
- package/dist/templates/components/layout/ColorSwatch.d.ts +1 -1
- package/dist/templates/components/layout/ColorSwatch.js +2 -2
- package/dist/templates/components/layout/Columns.d.ts +1 -1
- package/dist/templates/components/layout/Columns.js +1 -1
- package/dist/templates/components/layout/DemoTheme.d.ts +1 -1
- package/dist/templates/components/layout/DemoTheme.js +65 -167
- package/dist/templates/components/layout/DocsComponents.d.ts +1 -1
- package/dist/templates/components/layout/DocsComponents.js +13 -19
- package/dist/templates/components/layout/Field.d.ts +1 -1
- package/dist/templates/components/layout/Field.js +6 -4
- package/dist/templates/components/layout/Footer.d.ts +1 -1
- package/dist/templates/components/layout/Footer.js +1 -2
- package/dist/templates/components/layout/GlobalStyles.d.ts +1 -1
- package/dist/templates/components/layout/GlobalStyles.js +63 -10
- package/dist/templates/components/layout/Header.d.ts +1 -1
- package/dist/templates/components/layout/Header.js +14 -11
- package/dist/templates/components/layout/SharedStyles.d.ts +1 -1
- package/dist/templates/components/layout/SharedStyles.js +4 -5
- package/dist/templates/components/layout/StaticLinks.d.ts +1 -1
- package/dist/templates/components/layout/StaticLinks.js +4 -6
- package/dist/templates/components/layout/Steps.d.ts +1 -1
- package/dist/templates/components/layout/Steps.js +3 -3
- package/dist/templates/components/layout/Tabs.d.ts +1 -1
- package/dist/templates/components/layout/Tabs.js +5 -2
- package/dist/templates/components/layout/ThemeToggle.d.ts +1 -1
- package/dist/templates/components/layout/ThemeToggle.js +17 -19
- 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 +4 -3
- package/dist/templates/env.example.d.ts +1 -1
- package/dist/templates/env.example.js +5 -1
- package/dist/templates/mdx/deployment-and-hosting.mdx.d.ts +1 -1
- package/dist/templates/mdx/deployment-and-hosting.mdx.js +19 -0
- package/dist/templates/mdx/globals.mdx.d.ts +1 -1
- package/dist/templates/mdx/globals.mdx.js +3 -1
- package/dist/templates/mdx/platform/site-settings.mdx.d.ts +1 -1
- package/dist/templates/mdx/platform/site-settings.mdx.js +5 -1
- package/dist/templates/package.js +17 -18
- package/dist/templates/proxy.js +14 -20
- package/dist/templates/utils/config.d.ts +1 -1
- package/dist/templates/utils/config.js +1 -0
- package/package.json +8 -8
|
@@ -18,7 +18,8 @@ Place a \`config.json\` at your project root (the same folder where you execute
|
|
|
18
18
|
"name": "Doccupine",
|
|
19
19
|
"description": "${DEFAULT_DESCRIPTION}",
|
|
20
20
|
"icon": "${DEFAULT_FAVICON}",
|
|
21
|
-
"image": "${DEFAULT_OG_IMAGE}"
|
|
21
|
+
"image": "${DEFAULT_OG_IMAGE}",
|
|
22
|
+
"url": "https://docs.example.com"
|
|
22
23
|
}
|
|
23
24
|
\`\`\`
|
|
24
25
|
|
|
@@ -29,6 +30,7 @@ All fields are optional. Doccupine uses sensible defaults when a field is not se
|
|
|
29
30
|
- **description**: A concise summary of your project, used in site metadata (e.g., HTML meta description) and social previews when not overridden.
|
|
30
31
|
- **icon**: The favicon for your site. You can provide a full URL or a relative path to an asset in your project.
|
|
31
32
|
- **image**: The Open Graph image used when links to your docs are shared on social platforms. Accepts a full URL or a relative path.
|
|
33
|
+
- **url**: The public URL of your deployed site. Used as the base URL for \`sitemap.xml\` and \`robots.txt\`. When omitted, no sitemap is generated. Can be overridden at deploy time with the \`NEXT_PUBLIC_SITE_URL\` environment variable.
|
|
32
34
|
|
|
33
35
|
## Per-page overrides
|
|
34
36
|
Any page can override global values by defining the matching key in its frontmatter. When present, the page's value takes precedence over \`config.json\` for that page only.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const platformSiteSettingsMdxTemplate = "---\ntitle: \"Site Settings\"\ndescription: \"Configure your documentation site's name, description, icon, and image.\"\ndate: \"2026-02-19\"\ncategory: \"Configuration\"\ncategoryOrder: 2\norder: 0\nsection: \"Platform\"\n---\n# Site Settings\nThe Site settings page lets you configure the core metadata for your documentation site. These values are stored in `config.json` at the root of your repository.\n\n## Fields\n\n### Name\nThe name of your documentation site. This appears in the site header and browser tab title.\n\n### Description\nA short description of your documentation. Used in meta tags for search engine optimization and social media previews.\n\n### Favicon\nUpload a favicon image that appears in browser tabs. Supported formats include PNG, ICO, and SVG. Use the file upload button to select an image from your computer.\n\n### Preview image\nUpload an image used for social media and OpenGraph previews. This is the image that appears when your documentation URL is shared on platforms like Twitter, Slack, or Discord.\n\n<Callout type=\"note\">\n Changes to site settings are staged as pending changes, just like file edits. Click **Publish** to commit them to your repository and trigger a deploy.\n</Callout>\n\n## How it works\nBehind the scenes, the Site settings page reads and writes `config.json` in your repository. You can also edit this file directly in the file editor if you prefer. See the [Globals](/globals) page for the full configuration reference.\n\n```json\n{\n \"name\": \"My Documentation\",\n \"description\": \"Documentation for my project\",\n \"icon\": \"/favicon.png\",\n \"image\": \"/preview.png\"\n}\n```";
|
|
1
|
+
export declare const platformSiteSettingsMdxTemplate = "---\ntitle: \"Site Settings\"\ndescription: \"Configure your documentation site's name, description, icon, and image.\"\ndate: \"2026-02-19\"\ncategory: \"Configuration\"\ncategoryOrder: 2\norder: 0\nsection: \"Platform\"\n---\n# Site Settings\nThe Site settings page lets you configure the core metadata for your documentation site. These values are stored in `config.json` at the root of your repository.\n\n## Fields\n\n### Name\nThe name of your documentation site. This appears in the site header and browser tab title.\n\n### Description\nA short description of your documentation. Used in meta tags for search engine optimization and social media previews.\n\n### Favicon\nUpload a favicon image that appears in browser tabs. Supported formats include PNG, ICO, and SVG. Use the file upload button to select an image from your computer.\n\n### Preview image\nUpload an image used for social media and OpenGraph previews. This is the image that appears when your documentation URL is shared on platforms like Twitter, Slack, or Discord.\n\n### Site URL\nThe public URL of your deployed documentation site, such as `https://docs.example.com`. This value is used as the base URL when generating `sitemap.xml` and `robots.txt`, so search engines can discover and index your pages correctly. You can override this at deploy time by setting the `NEXT_PUBLIC_SITE_URL` environment variable.\n\n<Callout type=\"note\">\n Changes to site settings are staged as pending changes, just like file edits. Click **Publish** to commit them to your repository and trigger a deploy.\n</Callout>\n\n## How it works\nBehind the scenes, the Site settings page reads and writes `config.json` in your repository. You can also edit this file directly in the file editor if you prefer. See the [Globals](/globals) page for the full configuration reference.\n\n```json\n{\n \"name\": \"My Documentation\",\n \"description\": \"Documentation for my project\",\n \"icon\": \"/favicon.png\",\n \"image\": \"/preview.png\",\n \"url\": \"https://docs.example.com\"\n}\n```";
|
|
@@ -24,6 +24,9 @@ Upload a favicon image that appears in browser tabs. Supported formats include P
|
|
|
24
24
|
### Preview image
|
|
25
25
|
Upload an image used for social media and OpenGraph previews. This is the image that appears when your documentation URL is shared on platforms like Twitter, Slack, or Discord.
|
|
26
26
|
|
|
27
|
+
### Site URL
|
|
28
|
+
The public URL of your deployed documentation site, such as \`https://docs.example.com\`. This value is used as the base URL when generating \`sitemap.xml\` and \`robots.txt\`, so search engines can discover and index your pages correctly. You can override this at deploy time by setting the \`NEXT_PUBLIC_SITE_URL\` environment variable.
|
|
29
|
+
|
|
27
30
|
<Callout type="note">
|
|
28
31
|
Changes to site settings are staged as pending changes, just like file edits. Click **Publish** to commit them to your repository and trigger a deploy.
|
|
29
32
|
</Callout>
|
|
@@ -36,6 +39,7 @@ Behind the scenes, the Site settings page reads and writes \`config.json\` in yo
|
|
|
36
39
|
"name": "My Documentation",
|
|
37
40
|
"description": "Documentation for my project",
|
|
38
41
|
"icon": "/favicon.png",
|
|
39
|
-
"image": "/preview.png"
|
|
42
|
+
"image": "/preview.png",
|
|
43
|
+
"url": "https://docs.example.com"
|
|
40
44
|
}
|
|
41
45
|
\`\`\``;
|
|
@@ -10,29 +10,28 @@ export const packageJsonTemplate = JSON.stringify({
|
|
|
10
10
|
format: "prettier --write .",
|
|
11
11
|
},
|
|
12
12
|
dependencies: {
|
|
13
|
-
"@langchain/anthropic": "^1.3.
|
|
14
|
-
"@langchain/core": "^1.1.
|
|
15
|
-
"@langchain/google-genai": "^2.1.
|
|
16
|
-
"@langchain/openai": "^1.4.
|
|
13
|
+
"@langchain/anthropic": "^1.3.27",
|
|
14
|
+
"@langchain/core": "^1.1.41",
|
|
15
|
+
"@langchain/google-genai": "^2.1.28",
|
|
16
|
+
"@langchain/openai": "^1.4.4",
|
|
17
17
|
"@mdx-js/react": "^3.1.1",
|
|
18
18
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
19
|
-
"@posthog/react": "^1.
|
|
20
|
-
"cherry-styled-components": "^0.1.
|
|
21
|
-
langchain: "^1.
|
|
22
|
-
"lucide-react": "^1.
|
|
19
|
+
"@posthog/react": "^1.9.0",
|
|
20
|
+
"cherry-styled-components": "^0.1.17",
|
|
21
|
+
langchain: "^1.3.4",
|
|
22
|
+
"lucide-react": "^1.9.0",
|
|
23
23
|
minisearch: "^7.2.0",
|
|
24
|
-
next: "16.2.
|
|
24
|
+
next: "16.2.4",
|
|
25
25
|
"next-mdx-remote": "^6.0.0",
|
|
26
|
-
|
|
27
|
-
"posthog-
|
|
28
|
-
|
|
29
|
-
react: "19.2.
|
|
30
|
-
"react-dom": "19.2.4",
|
|
26
|
+
"posthog-js": "^1.371.2",
|
|
27
|
+
"posthog-node": "^5.30.0",
|
|
28
|
+
react: "19.2.5",
|
|
29
|
+
"react-dom": "19.2.5",
|
|
31
30
|
"rehype-highlight": "^7.0.2",
|
|
32
31
|
"rehype-parse": "^9.0.1",
|
|
33
32
|
"rehype-stringify": "^10.0.1",
|
|
34
33
|
"remark-gfm": "^4.0.1",
|
|
35
|
-
"styled-components": "^6.
|
|
34
|
+
"styled-components": "^6.4.1",
|
|
36
35
|
unified: "^11.0.5",
|
|
37
36
|
zod: "^4.3.6",
|
|
38
37
|
},
|
|
@@ -40,10 +39,10 @@ export const packageJsonTemplate = JSON.stringify({
|
|
|
40
39
|
"@types/node": "^25",
|
|
41
40
|
"@types/react": "^19",
|
|
42
41
|
"@types/react-dom": "^19",
|
|
43
|
-
"baseline-browser-mapping": "^2.10.
|
|
42
|
+
"baseline-browser-mapping": "^2.10.21",
|
|
44
43
|
eslint: "^9",
|
|
45
|
-
"eslint-config-next": "16.2.
|
|
46
|
-
prettier: "^3.8.
|
|
44
|
+
"eslint-config-next": "16.2.4",
|
|
45
|
+
prettier: "^3.8.3",
|
|
47
46
|
typescript: "^6",
|
|
48
47
|
},
|
|
49
48
|
}, null, 2) + "\n";
|
package/dist/templates/proxy.js
CHANGED
|
@@ -58,6 +58,18 @@ function captureServerPageview(req: NextRequest, event: NextFetchEvent) {
|
|
|
58
58
|
? `export function proxy(req: NextRequest, event: NextFetchEvent)`
|
|
59
59
|
: `export function proxy(req: NextRequest)`;
|
|
60
60
|
const eventImport = hasPostHog ? ", NextFetchEvent" : "";
|
|
61
|
+
// Matcher scope:
|
|
62
|
+
// - With PostHog server-side tracking: run on every path so pageviews
|
|
63
|
+
// fire (the capture function uses event.waitUntil and never mutates
|
|
64
|
+
// the response, so doc pages remain edge-cacheable).
|
|
65
|
+
// - Otherwise: only run on /api/* — the only routes that need middleware
|
|
66
|
+
// (e.g. MCP key auth). Doc pages bypass middleware entirely.
|
|
67
|
+
//
|
|
68
|
+
// Theme detection happens client-side via the theme-init blocking script
|
|
69
|
+
// in the root layout (sets a "dark" class on <html>). Middleware no longer
|
|
70
|
+
// sets Vary, Accept-CH, or a theme cookie, because doing so would mark
|
|
71
|
+
// every response as dynamic and disable caching at Vercel/Cloudflare.
|
|
72
|
+
const matcher = hasPostHog ? `["/:path*"]` : `["/api/:path*"]`;
|
|
61
73
|
return `import { NextResponse } from "next/server";
|
|
62
74
|
import type { NextRequest${eventImport} } from "next/server";
|
|
63
75
|
${posthogImport}${posthogPageviewFn}
|
|
@@ -77,29 +89,11 @@ ${posthogCall} // API key auth for /api/mcp when DOCS_API_KEY is configured
|
|
|
77
89
|
}
|
|
78
90
|
}
|
|
79
91
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
res.headers.set("Accept-CH", "Sec-CH-Prefers-Color-Scheme");
|
|
83
|
-
res.headers.set("Vary", "Sec-CH-Prefers-Color-Scheme");
|
|
84
|
-
res.headers.set("Critical-CH", "Sec-CH-Prefers-Color-Scheme");
|
|
85
|
-
|
|
86
|
-
const existing = req.cookies.get("theme")?.value;
|
|
87
|
-
const hint = req.headers.get("Sec-CH-Prefers-Color-Scheme");
|
|
88
|
-
|
|
89
|
-
if (!existing && hint) {
|
|
90
|
-
const value = hint === "dark" ? "dark" : "light";
|
|
91
|
-
res.cookies.set("theme", value, {
|
|
92
|
-
path: "/",
|
|
93
|
-
maxAge: 60 * 60 * 24 * 365,
|
|
94
|
-
sameSite: "lax",
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
return res;
|
|
92
|
+
return NextResponse.next();
|
|
99
93
|
}
|
|
100
94
|
|
|
101
95
|
export const config = {
|
|
102
|
-
matcher:
|
|
96
|
+
matcher: ${matcher},
|
|
103
97
|
};
|
|
104
98
|
`;
|
|
105
99
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const configTemplate = "import { z } from \"zod\";\nimport configData from \"@/config.json\";\n\nconst configSchema = z.object({\n name: z.string().optional(),\n description: z.string().optional(),\n icon: z.string().optional(),\n image: z.string().optional(),\n});\n\ntype Config = z.infer<typeof configSchema>;\n\nexport const config: Config = configSchema.parse(configData);\n";
|
|
1
|
+
export declare const configTemplate = "import { z } from \"zod\";\nimport configData from \"@/config.json\";\n\nconst configSchema = z.object({\n name: z.string().optional(),\n description: z.string().optional(),\n icon: z.string().optional(),\n image: z.string().optional(),\n url: z.string().url().optional(),\n});\n\ntype Config = z.infer<typeof configSchema>;\n\nexport const config: Config = configSchema.parse(configData);\n";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "doccupine",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.89",
|
|
4
4
|
"description": "Free and open-source documentation platform. Write MDX, get a production-ready site with AI chat, built-in components, and an MCP server - in one command.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -39,19 +39,19 @@
|
|
|
39
39
|
"commander": "^14.0.3",
|
|
40
40
|
"fs-extra": "^11.3.4",
|
|
41
41
|
"gray-matter": "^4.0.3",
|
|
42
|
-
"next": "^16.2.
|
|
42
|
+
"next": "^16.2.4",
|
|
43
43
|
"prompts": "^2.4.2",
|
|
44
|
-
"react": "^19.2.
|
|
45
|
-
"react-dom": "^19.2.
|
|
44
|
+
"react": "^19.2.5",
|
|
45
|
+
"react-dom": "^19.2.5"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/chokidar": "^2.1.7",
|
|
49
49
|
"@types/fs-extra": "^11.0.4",
|
|
50
|
-
"@types/node": "^25.
|
|
50
|
+
"@types/node": "^25.6.0",
|
|
51
51
|
"@types/prompts": "^2.4.9",
|
|
52
|
-
"prettier": "^3.8.
|
|
53
|
-
"typescript": "^6.0.
|
|
54
|
-
"vitest": "^4.1.
|
|
52
|
+
"prettier": "^3.8.3",
|
|
53
|
+
"typescript": "^6.0.3",
|
|
54
|
+
"vitest": "^4.1.5"
|
|
55
55
|
},
|
|
56
56
|
"files": [
|
|
57
57
|
"dist/**/*"
|