@ahmedrowaihi/8n 6.0.53 → 6.0.55
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/dist/index.mjs +22 -4
- package/package.json +2 -1
- package/starter/content/docs/01-getting-started.ar.mdx +7 -12
- package/starter/content/docs/01-getting-started.mdx +7 -12
- package/starter/content/mcp/02-structure.mdx +78 -49
- package/starter/content/mcp/03-frontmatter.mdx +25 -10
- package/starter/content/mcp/04-components.mdx +2 -1
- package/starter/package.json +1 -2
- package/starter/scripts/generate-docs.mts +0 -8
package/dist/index.mjs
CHANGED
|
@@ -10,6 +10,8 @@ import { createInterface } from "node:readline/promises";
|
|
|
10
10
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
11
11
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
12
12
|
import { readFile, readdir } from "node:fs/promises";
|
|
13
|
+
import { createOpenAPI } from "fumadocs-openapi/server";
|
|
14
|
+
import { generateFiles } from "fumadocs-openapi";
|
|
13
15
|
|
|
14
16
|
//#region node_modules/zod/v4/core/core.js
|
|
15
17
|
/** A special constant with type `never` */
|
|
@@ -3736,7 +3738,7 @@ async function checkSelfUpdate() {
|
|
|
3736
3738
|
});
|
|
3737
3739
|
if (!res.ok) return;
|
|
3738
3740
|
const { version: latest } = await res.json();
|
|
3739
|
-
const current = "6.0.
|
|
3741
|
+
const current = "6.0.55";
|
|
3740
3742
|
if (latest !== current) console.log(pc.yellow("⚠") + pc.dim(` new version available: `) + pc.cyan(latest) + pc.dim(` (current: ${current}) — run `) + pc.cyan("npm i -g @ahmedrowaihi/8n") + pc.dim(" to update"));
|
|
3741
3743
|
} catch {}
|
|
3742
3744
|
}
|
|
@@ -3849,7 +3851,7 @@ async function dev() {
|
|
|
3849
3851
|
async function build({ server = false } = {}) {
|
|
3850
3852
|
const { config, contentDir } = await resolveProject();
|
|
3851
3853
|
const projectDir = process.cwd();
|
|
3852
|
-
console.log(pc.cyan("8n") + pc.dim(` v6.0.
|
|
3854
|
+
console.log(pc.cyan("8n") + pc.dim(` v6.0.55 build → ${contentDir}`));
|
|
3853
3855
|
if (server) await runNextFlat(projectDir, "build", buildEnv({
|
|
3854
3856
|
config,
|
|
3855
3857
|
contentDir,
|
|
@@ -4167,7 +4169,7 @@ async function mcp() {
|
|
|
4167
4169
|
const mcpDir = join(getStarterDir(), "content", "mcp", "en");
|
|
4168
4170
|
const server = new McpServer({
|
|
4169
4171
|
name: "8n",
|
|
4170
|
-
version: "6.0.
|
|
4172
|
+
version: "6.0.55"
|
|
4171
4173
|
});
|
|
4172
4174
|
server.registerTool("read_me", {
|
|
4173
4175
|
description: "Returns how to use the 8n MCP tools. Call this BEFORE documenting anything with 8n.",
|
|
@@ -4306,9 +4308,24 @@ Example: get_component({ name: "components" }) returns all available MDX compone
|
|
|
4306
4308
|
await server.connect(transport);
|
|
4307
4309
|
}
|
|
4308
4310
|
|
|
4311
|
+
//#endregion
|
|
4312
|
+
//#region src/commands/generate.ts
|
|
4313
|
+
async function generateApi({ input, output }) {
|
|
4314
|
+
const { contentDir } = await resolveProject();
|
|
4315
|
+
const projectDir = process.cwd();
|
|
4316
|
+
const outputDir = join(contentDir, output);
|
|
4317
|
+
console.log(pc.cyan("8n") + pc.dim(` generate:api → ${outputDir}`));
|
|
4318
|
+
await generateFiles({
|
|
4319
|
+
input: createOpenAPI({ input: [resolve(projectDir, input)] }),
|
|
4320
|
+
output: outputDir,
|
|
4321
|
+
includeDescription: true
|
|
4322
|
+
});
|
|
4323
|
+
console.log(pc.green("✓") + pc.dim(` API docs generated → ${outputDir}`));
|
|
4324
|
+
}
|
|
4325
|
+
|
|
4309
4326
|
//#endregion
|
|
4310
4327
|
//#region src/index.ts
|
|
4311
|
-
const program = new Command().name("8n").description("Run your 8n docs site").version("6.0.
|
|
4328
|
+
const program = new Command().name("8n").description("Run your 8n docs site").version("6.0.55").addOption(new Option("--debug").hideHelp()).hook("preAction", (cmd) => {
|
|
4312
4329
|
if (cmd.opts().debug) process.env.DEBUG_8N = "1";
|
|
4313
4330
|
});
|
|
4314
4331
|
program.command("init").description("Scaffold a new docs project in the current directory").action(init);
|
|
@@ -4318,6 +4335,7 @@ program.command("start").description("Start the production server").action(start
|
|
|
4318
4335
|
program.command("eject").description("Unpack starter into the project root for CI/Vercel builds").action(eject);
|
|
4319
4336
|
program.command("deploy <target>").description("Generate deployment config — targets: vercel, github").action(deploy);
|
|
4320
4337
|
program.command("mcp").description("Start the MCP server for AI-assisted docs authoring").action(mcp);
|
|
4338
|
+
program.command("generate:api").description("Generate API docs from an OpenAPI spec into a content section").requiredOption("-i, --input <spec>", "Path to OpenAPI spec file (JSON or YAML)").option("-o, --output <section>", "Content section name to write into", "api").action(generateApi);
|
|
4321
4339
|
program.parse();
|
|
4322
4340
|
|
|
4323
4341
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ahmedrowaihi/8n",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.55",
|
|
4
4
|
"description": "8n docs — run your docs site from your content directory",
|
|
5
5
|
"bin": {
|
|
6
6
|
"8n": "./dist/index.mjs"
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
20
20
|
"c12": "^2.0.0",
|
|
21
21
|
"commander": "^14.0.0",
|
|
22
|
+
"fumadocs-openapi": "^10.3.18",
|
|
22
23
|
"jiti": "^2.0.0",
|
|
23
24
|
"picocolors": "^1.1.0",
|
|
24
25
|
"tinyexec": "^1.0.0"
|
|
@@ -56,20 +56,15 @@ icon: Rocket
|
|
|
56
56
|
|
|
57
57
|
## إضافة صفحة جديدة
|
|
58
58
|
|
|
59
|
-
ضع ملف `.mdx` في `content/docs
|
|
59
|
+
ضع ملف `.mdx` في `content/docs/`. للترجمة، أضف ملفاً مجاوراً بلاحقة اللغة (مثل `.ar.mdx`):
|
|
60
60
|
|
|
61
61
|
<Files>
|
|
62
62
|
<Folder name="content/docs" defaultOpen>
|
|
63
|
-
<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
<Folder name="en">
|
|
69
|
-
<File name="index.mdx" />
|
|
70
|
-
<File name="getting-started.mdx" />
|
|
71
|
-
<File name="your-new-page.mdx" />
|
|
72
|
-
</Folder>
|
|
63
|
+
<File name="index.mdx" />
|
|
64
|
+
<File name="getting-started.mdx" />
|
|
65
|
+
<File name="getting-started.ar.mdx" />
|
|
66
|
+
<File name="صفحتك-الجديدة.mdx" />
|
|
67
|
+
<File name="your-new-page.ar.mdx" />
|
|
73
68
|
</Folder>
|
|
74
69
|
</Files>
|
|
75
70
|
|
|
@@ -99,7 +94,7 @@ icon: Rocket
|
|
|
99
94
|
<Step>
|
|
100
95
|
### أنشئ مجلد المحتوى
|
|
101
96
|
|
|
102
|
-
|
|
97
|
+
أضف ملفاتك المترجمة كـ `.fr.mdx` مجاورة للملفات الإنجليزية (مثل `getting-started.fr.mdx`).
|
|
103
98
|
|
|
104
99
|
</Step>
|
|
105
100
|
</Steps>
|
|
@@ -58,20 +58,15 @@ icon: Rocket
|
|
|
58
58
|
|
|
59
59
|
## Adding a new page
|
|
60
60
|
|
|
61
|
-
Drop an `.mdx` file into `content/docs
|
|
61
|
+
Drop an `.mdx` file into `content/docs/`. For translations, add a sibling file with the locale suffix (e.g. `.ar.mdx`):
|
|
62
62
|
|
|
63
63
|
<Files>
|
|
64
64
|
<Folder name="content/docs" defaultOpen>
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
<Folder name="ar">
|
|
71
|
-
<File name="index.mdx" />
|
|
72
|
-
<File name="getting-started.mdx" />
|
|
73
|
-
<File name="your-new-page.mdx" />
|
|
74
|
-
</Folder>
|
|
65
|
+
<File name="index.mdx" />
|
|
66
|
+
<File name="getting-started.mdx" />
|
|
67
|
+
<File name="getting-started.ar.mdx" />
|
|
68
|
+
<File name="your-new-page.mdx" />
|
|
69
|
+
<File name="your-new-page.ar.mdx" />
|
|
75
70
|
</Folder>
|
|
76
71
|
</Files>
|
|
77
72
|
|
|
@@ -101,7 +96,7 @@ Drop an `.mdx` file into `content/docs/en/` (and `content/docs/ar/` for the Arab
|
|
|
101
96
|
<Step>
|
|
102
97
|
### Create the content folder
|
|
103
98
|
|
|
104
|
-
|
|
99
|
+
Add your translated files as `.fr.mdx` siblings next to the English files (e.g. `getting-started.fr.mdx`).
|
|
105
100
|
|
|
106
101
|
</Step>
|
|
107
102
|
</Steps>
|
|
@@ -1,55 +1,84 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Content Structure
|
|
3
|
-
description: LLM reference — how to organise your content directory
|
|
3
|
+
description: LLM reference — how to organise your content directory using dot-suffix i18n.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
```
|
|
7
7
|
content/
|
|
8
|
-
docs/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
8
|
+
docs/ ← main documentation section
|
|
9
|
+
index.mdx ← section landing page + sidebar title (default locale)
|
|
10
|
+
index.ar.mdx ← Arabic translation of the landing page (optional)
|
|
11
|
+
01-getting-started.mdx ← numeric prefix controls sidebar order
|
|
12
|
+
01-getting-started.ar.mdx
|
|
13
|
+
components/ ← sub-folder creates a nested sidebar group
|
|
14
|
+
index.mdx ← group title and optional landing page
|
|
15
|
+
index.ar.mdx
|
|
16
|
+
callout.mdx
|
|
17
|
+
callout.ar.mdx
|
|
18
|
+
api/ ← API reference (usually generated via `8n generate:api`)
|
|
19
|
+
index.mdx ← optional: section landing page
|
|
20
|
+
listPets.mdx ← generated endpoint page
|
|
21
|
+
showPetById.mdx
|
|
22
|
+
ui/ ← UI component showcase (optional)
|
|
23
|
+
index.mdx
|
|
24
|
+
badge.mdx
|
|
25
|
+
changelog/ ← versioned changelog, sorted newest-first
|
|
26
|
+
index.mdx
|
|
27
|
+
v2.0.0.mdx
|
|
28
|
+
v1.0.0.mdx
|
|
29
|
+
home/ ← custom landing page (optional, replaces default)
|
|
30
|
+
index.mdx
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## i18n: dot-suffix
|
|
34
|
+
|
|
35
|
+
Translations live alongside originals as `.{locale}.mdx` siblings — no locale folders needed.
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
getting-started.mdx ← default locale (first entry in config.locales)
|
|
39
|
+
getting-started.ar.mdx ← Arabic translation
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
If a translation is missing, the site falls back to the default locale automatically.
|
|
43
|
+
|
|
44
|
+
For a single-locale site, just add plain `.mdx` files with no suffix — no configuration needed.
|
|
45
|
+
|
|
46
|
+
## Numeric prefix ordering
|
|
47
|
+
|
|
48
|
+
Prefix filenames with `{n}-` to control sidebar order. The prefix is stripped from the URL slug.
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
01-getting-started.mdx → slug: getting-started, position: 1
|
|
52
|
+
02-configuration.mdx → slug: configuration, position: 2
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## index.mdx
|
|
56
|
+
|
|
57
|
+
`index.mdx` at any directory level sets the title, icon, and optional landing page for that section or folder.
|
|
58
|
+
|
|
59
|
+
```mdx
|
|
60
|
+
---
|
|
61
|
+
label: Getting Started # sidebar/nav label (falls back to title if omitted)
|
|
62
|
+
title: Introduction # page <title> when the page has body content
|
|
63
|
+
icon: Rocket # Lucide icon shown in the sidebar
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
Body content here makes this a real page.
|
|
67
|
+
Omit the body to use it as metadata-only (the section root redirects to the first child).
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Adding a new section
|
|
71
|
+
|
|
72
|
+
Create a directory under `content/` — it auto-appears in the sidebar and navigation.
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
mkdir content/guides
|
|
76
|
+
# add content/guides/index.mdx with label: Guides
|
|
77
|
+
# add content/guides/01-quickstart.mdx
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Remove it by deleting the directory, or hide it without deleting:
|
|
81
|
+
|
|
82
|
+
```ts title="8n.config.ts"
|
|
83
|
+
sections: { guides: false }
|
|
84
|
+
```
|
|
@@ -9,32 +9,47 @@ Every `.mdx` file starts with a YAML frontmatter block between `---` delimiters.
|
|
|
9
9
|
|
|
10
10
|
```mdx
|
|
11
11
|
---
|
|
12
|
-
title: My Page
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
title: My Page # required — used as the page <title>
|
|
13
|
+
label: Short Name # optional — sidebar/nav label; falls back to title
|
|
14
|
+
description: Blurb # optional — shown below the heading and in <meta description>
|
|
15
|
+
icon: Rocket # optional — Lucide icon name shown in the sidebar
|
|
16
|
+
full: true # optional — removes the sidebar and TOC for a full-width layout
|
|
17
|
+
redirect: /en/docs/other # optional — immediately redirects to another URL
|
|
17
18
|
---
|
|
18
19
|
```
|
|
19
20
|
|
|
21
|
+
## index.mdx (section or folder root)
|
|
22
|
+
|
|
23
|
+
```mdx
|
|
24
|
+
---
|
|
25
|
+
label: My Section # sidebar/nav label for the section or folder
|
|
26
|
+
title: Introduction # page <title> if the file has body content
|
|
27
|
+
icon: BookOpen # Lucide icon shown next to the section name
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
Optional body — makes this file a real landing page.
|
|
31
|
+
Omit the body to treat it as metadata-only; the section root will redirect to the first child page.
|
|
32
|
+
```
|
|
33
|
+
|
|
20
34
|
## Changelog pages
|
|
21
35
|
|
|
22
36
|
```mdx
|
|
23
37
|
---
|
|
24
38
|
title: Version 2.1.0
|
|
25
|
-
version: 2.1.0
|
|
26
|
-
date: "2025-06-01"
|
|
27
|
-
summary: What changed.
|
|
39
|
+
version: 2.1.0 # semver string — used for sorting
|
|
40
|
+
date: "2025-06-01" # ISO 8601 date (quoted to prevent YAML date parsing)
|
|
41
|
+
summary: What changed. # one-liner shown in the changelog list view
|
|
28
42
|
---
|
|
29
43
|
```
|
|
30
44
|
|
|
31
|
-
## Home page (`home/
|
|
45
|
+
## Home page (`home/index.mdx`)
|
|
32
46
|
|
|
33
47
|
Free-form MDX — no required fields. All components and Tailwind utility classes are available.
|
|
34
|
-
|
|
48
|
+
Use `title` and `description` frontmatter if you want them in `<meta>` tags.
|
|
35
49
|
|
|
36
50
|
## Notes
|
|
37
51
|
|
|
38
52
|
- `title` is the only truly required field on docs/api/ui pages.
|
|
53
|
+
- `label` lets you have a short sidebar name while keeping a longer `title` in the page heading.
|
|
39
54
|
- All string values should be unquoted unless they contain special YAML characters (`:`, `#`, etc.).
|
|
40
55
|
- `icon` accepts any name from the [Lucide icon set](https://lucide.dev/icons/).
|
|
@@ -84,9 +84,10 @@ Annotated file tree diagram.
|
|
|
84
84
|
```mdx
|
|
85
85
|
<Files>
|
|
86
86
|
<Folder name="content" defaultOpen>
|
|
87
|
-
<Folder name="docs
|
|
87
|
+
<Folder name="docs" defaultOpen>
|
|
88
88
|
<File name="index.mdx" />
|
|
89
89
|
<File name="getting-started.mdx" />
|
|
90
|
+
<File name="getting-started.ar.mdx" />
|
|
90
91
|
</Folder>
|
|
91
92
|
</Folder>
|
|
92
93
|
</Files>
|
package/starter/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ahmedrowaihi/8n-starter",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.55",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"exports": {
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
"dev": "next dev",
|
|
11
11
|
"build": "next build",
|
|
12
12
|
"start": "next start",
|
|
13
|
-
"generate:api": "tsx scripts/generate-docs.mts",
|
|
14
13
|
"types:check": "tsc --noEmit",
|
|
15
14
|
"lint": "oxlint",
|
|
16
15
|
"format": "oxfmt",
|