@ahmedrowaihi/8n 6.0.33 → 6.0.34
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 +4 -4
- package/package.json +1 -1
- package/starter/package.json +1 -1
- package/starter/src/features/ai/chat/tools.js +1 -1
- package/starter/src/lib/content-source.js +1 -1
- package/starter/src/lib/create-docs-page.jsx +1 -1
- package/starter/src/lib/pages-api.js +1 -1
- package/starter/src/lib/sitemap.js +1 -1
- package/starter/src/lib/source.js +1 -1
- package/starter/app/[lang]/changelog/[...slug]/layout.jsx +0 -1
- package/starter/app/[lang]/changelog/[...slug]/page.jsx +0 -1
- package/starter/app/[lang]/changelog/layout.jsx +0 -1
- package/starter/app/[lang]/changelog/page.jsx +0 -1
- package/starter/src/features/changelog/components/changelog-list.jsx +0 -2
- package/starter/src/features/changelog/components/entry-content.jsx +0 -2
- package/starter/src/features/changelog/index.js +0 -1
package/dist/index.mjs
CHANGED
|
@@ -3736,7 +3736,7 @@ async function checkSelfUpdate() {
|
|
|
3736
3736
|
});
|
|
3737
3737
|
if (!res.ok) return;
|
|
3738
3738
|
const { version: latest } = await res.json();
|
|
3739
|
-
const current = "6.0.
|
|
3739
|
+
const current = "6.0.34";
|
|
3740
3740
|
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
3741
|
} catch {}
|
|
3742
3742
|
}
|
|
@@ -3846,7 +3846,7 @@ async function dev() {
|
|
|
3846
3846
|
async function build({ server = false } = {}) {
|
|
3847
3847
|
const { config, contentDir } = await resolveProject();
|
|
3848
3848
|
const projectDir = process.cwd();
|
|
3849
|
-
console.log(pc.cyan("8n") + pc.dim(` v6.0.
|
|
3849
|
+
console.log(pc.cyan("8n") + pc.dim(` v6.0.34 build → ${contentDir}`));
|
|
3850
3850
|
if (server) await runNextFlat(projectDir, "build", buildEnv({
|
|
3851
3851
|
config,
|
|
3852
3852
|
contentDir,
|
|
@@ -4164,7 +4164,7 @@ async function mcp() {
|
|
|
4164
4164
|
const mcpDir = join(getStarterDir(), "content", "mcp", "en");
|
|
4165
4165
|
const server = new McpServer({
|
|
4166
4166
|
name: "8n",
|
|
4167
|
-
version: "6.0.
|
|
4167
|
+
version: "6.0.34"
|
|
4168
4168
|
});
|
|
4169
4169
|
server.registerTool("read_me", {
|
|
4170
4170
|
description: "Returns how to use the 8n MCP tools. Call this BEFORE documenting anything with 8n.",
|
|
@@ -4305,7 +4305,7 @@ Example: get_component({ name: "components" }) returns all available MDX compone
|
|
|
4305
4305
|
|
|
4306
4306
|
//#endregion
|
|
4307
4307
|
//#region src/index.ts
|
|
4308
|
-
const program = new Command().name("8n").description("Run your 8n docs site").version("6.0.
|
|
4308
|
+
const program = new Command().name("8n").description("Run your 8n docs site").version("6.0.34").addOption(new Option("--debug").hideHelp()).hook("preAction", (cmd) => {
|
|
4309
4309
|
if (cmd.opts().debug) process.env.DEBUG_8N = "1";
|
|
4310
4310
|
});
|
|
4311
4311
|
program.command("init").description("Scaffold a new docs project in the current directory").action(init);
|
package/package.json
CHANGED
package/starter/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getAllPages as t
|
|
1
|
+
import{getAllPages as t}from"../../../lib/source";import{readFile as e}from"node:fs/promises";import a from"gray-matter";import{create as i,insertMultiple as r,search as n}from"@orama/orama";import{tool as o}from"ai";import{z as l}from"zod";let c={url:"string",title:"string",description:"string",content:"string"},s=null;export const searchTool=o({description:"Search the docs content and return relevant results.",inputSchema:l.object({query:l.string(),limit:l.number().int().min(1).max(20).default(8)}),async execute({query:o,limit:l}){let u=await (!s&&(s=(async()=>{let n=i({schema:c}),o=await t();return r(n,(await Promise.all(o.map(async t=>{if(!t.data.filePath)return null;let{content:i}=a(await e(t.data.filePath,"utf-8"));return{url:t.url,title:t.data.title,description:t.data.description??"",content:i}}))).filter(Boolean)),n})()),s);return(await n(u,{term:o,limit:l,properties:["title","description","content"]})).hits.map(t=>({url:t.document.url,title:t.document.title,description:t.document.description,content:t.document.content.slice(0,500)}))}});export const getPageTool=o({description:"Fetch the full content of a specific documentation or changelog page by its URL path.",inputSchema:l.object({url:l.string().describe("The URL path of the page, e.g. /en/docs/getting-started")}),async execute({url:i}){let r=(await t()).find(t=>t.url===i);if(!r)return{error:`Page not found: ${i}`};if(!r.data.filePath)return{error:"Page has no text content"};let{content:n}=a(await e(r.data.filePath,"utf-8"));return{url:r.url,title:r.data.title,content:n}}});export const listPagesTool=o({description:"List all available documentation and changelog pages with their URLs and titles.",inputSchema:l.object({}),execute:async()=>(await t()).map(t=>({url:t.url,title:t.data.title,type:"docs"}))});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readdir as t,readFile as e,stat as a}from"node:fs/promises";let i=new Set(["
|
|
1
|
+
import{readdir as t,readFile as e,stat as a}from"node:fs/promises";let i=new Set(["home"]);export async function discoverSections(e){let a;try{a=await t(e,{withFileTypes:!0})}catch{return[]}return a.filter(t=>t.isDirectory()&&!i.has(t.name)).map(t=>t.name)}import{join as r,relative as o,extname as n,basename as l}from"node:path";import c from"gray-matter";async function*s(e){let a;try{a=await t(e,{withFileTypes:!0})}catch{return}for(let t of a){let a=r(e,t.name);t.isDirectory()?yield*s(a):yield a}}export async function createFsSource(t){let i=[];for await(let r of s(t)){let s=o(t,r),m=n(r);if("meta.json"===l(r))try{let t=await e(r,"utf8");i.push({type:"meta",path:s,data:JSON.parse(t)})}catch{}else if(".mdx"===m||".md"===m)try{let t=await e(r,"utf8"),o=await a(r),{data:n}=c(t);i.push({type:"page",path:s,data:{...n,title:n.title??"Untitled",filePath:r,lastModified:o.mtime}})}catch{}}return{files:i}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{notFound as e,redirect as a}from"next/navigation";import{
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{notFound as e,redirect as a}from"next/navigation";import{relative as r}from"node:path";import{findNeighbour as o}from"fumadocs-core/page-tree";import{DocsPageContent as i}from"../features/docs";import{getMDXComponentsForLang as n}from"../components/fumadocs/mdx-server.js";import{getSources as l,getUnifiedPageTree as m}from"./source";import{localeConfig as s}from"../locale.config";import{env as c}from"../config";import{compiler as d}from"./mdx-compiler";import{readFile as f}from"node:fs/promises";export function createDocsPage(u,p={}){let{getMarkdownUrl:g,render:P}=p;return{generateStaticParams:async function t(){let{sections:t}=await l(),e=t[u];return e?e.generateParams():[]},generateMetadata:async function t({params:e}){let{lang:a,slug:r=[]}=await e,{sections:o}=await l(),i=o[u];if(!i)return{};let n=i.getPage(r,a);if(!n)return{};let m=s[a]?.siteName??s.en.siteName;return{title:`${n.data.title} — ${m}`,description:n.data.description}},default:async function s({params:p}){let{lang:_,slug:w=[]}=await p,{sections:U}=await l(),h=U[u];h||e();let E=h.getPage(w,_);if(!E){if(0===w.length){let t=h.getPages(_)[0];t&&a(t.url)}e()}E.data.redirect&&a(E.data.redirect);let B=await f(E.absolutePath,"utf-8"),I=await d.compile({source:B}),T=I.body,b=I.toc,x=o(await m(_),E.url);return P?P({page:E,toc:b,lang:_,MDX:T}):t(i,{toc:b,frontmatter:{title:E.data.title,description:E.data.description},github:c.NEXT_PUBLIC_GITHUB_REPO?{repo:c.NEXT_PUBLIC_GITHUB_REPO,fileUrl:`${c.NEXT_PUBLIC_GITHUB_REPO}/blob/HEAD/${r(process.cwd(),E.absolutePath)}`}:void 0,markdownUrl:g?.(E.slugs),path:E.path,lang:_,lastModified:E.data.lastModified??null,neighbours:x,full:E.data.full??!1,children:t(T,{components:n(_,E.data.title,c.NEXT_PUBLIC_GITHUB_REPO)})})}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getAllPages as t
|
|
1
|
+
import{getAllPages as t}from"./source";export async function getPageEntries(){return(await t()).map(t=>({url:t.url,title:t.data.title,type:"docs"}))}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getSections as
|
|
1
|
+
import{getSections as o}from"./source";import{env as t}from"../config";import{locales as e}from"../locale.config";export async function buildSitemap(){let i=await o(),r=[];for(let o of e)for(let e of(r.push({url:`${t.SITE_URL}/${o}`}),Object.values(i)))for(let i of e.getPages(o))r.push({url:`${t.SITE_URL}${i.url}`,lastModified:i.data.lastModified?new Date(i.data.lastModified):void 0});return r}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{loader as e}from"fumadocs-core/source";import{lucideIconsPlugin as t}from"fumadocs-core/source/lucide-icons";import{openapiPlugin as r}from"fumadocs-openapi/server";import{createSearchAPI as a}from"fumadocs-core/search/server";import{i18n as
|
|
1
|
+
import{loader as e}from"fumadocs-core/source";import{lucideIconsPlugin as t}from"fumadocs-core/source/lucide-icons";import{openapiPlugin as r}from"fumadocs-openapi/server";import{createSearchAPI as a}from"fumadocs-core/search/server";import{i18n as o}from"./i18n";import{join as n}from"node:path";import{existsSync as i,watch as c}from"node:fs";import{readFile as s}from"node:fs/promises";import l from"gray-matter";import{env as u,isSectionHidden as f}from"../config";import{createFsSource as m,discoverSections as p}from"./content-source.js";let g=[t(),r()];async function d(){let t=await p(u.CONTENT_DIR),r=Object.fromEntries(await Promise.all(t.map(async t=>{let r=e({source:await m(n(u.CONTENT_DIR,t)),baseUrl:`/${t}`,i18n:o,plugins:g});return[t,r]}))),i=a("simple",{indexes:await Promise.all(Object.entries(r).filter(([e])=>!f(e)).flatMap(([,e])=>e.getLanguages().flatMap(({language:e,pages:t})=>t.map(async t=>{let{content:r}=l(await s(t.data.filePath,"utf-8"));return{id:t.url,url:t.url,locale:e,title:t.data.title,content:r}}))))});return{sections:r,searchServer:i}}let T=null;export function getSources(){return T||(T=d(),"development"===process.env.NODE_ENV&&T.then(()=>{i(u.CONTENT_DIR)&&c(u.CONTENT_DIR,{recursive:!0},()=>{T=null})})),T}export async function getSections(){let{sections:e}=await getSources();return Object.fromEntries(Object.entries(e).filter(([e])=>!f(e)))}export async function getAllPages(){return Object.values(await getSections()).flatMap(e=>e.getPages())}export async function getUnifiedPageTree(e){let t=await getSections(),r=[],a=t.docs;for(let[o,n]of(a&&r.push(...a.getPageTree(e).children),Object.entries(t))){if("docs"===o)continue;let t=n.getPageTree(e);0!==t.children.length&&r.push({type:"folder",name:t.name,children:t.children})}return{name:"",children:r}}export async function getNavLinks(e){return Object.entries(await getSections()).map(([t,r])=>({text:r.getPageTree(e).name??t,url:`/${e}/${t}`,active:"nested-url"}))}export async function getLLMText(e){let{content:t}=l(await s(e.data.filePath,"utf-8"));return`# ${e.data.title}
|
|
2
2
|
|
|
3
3
|
${t}`}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createDocsLayout as o}from"../../../../src/lib/create-docs-layout";export default o();
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{createDocsPage as a}from"../../../../src/lib/create-docs-page";import{ChangelogEntryContent as t}from"../../../../src/features/changelog";import{getMDXComponents as r}from"../../../../src/components/fumadocs/mdx";export const{generateStaticParams,generateMetadata,default:Page}=a("changelog",{render:({page:a,toc:o,lang:d,MDX:s})=>e(t,{toc:o,lang:d,lastModified:a.data.lastModified??null,version:a.data.version,date:a.data.date,children:e(s,{components:r()})})});export default Page;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{Transition as r}from"../../../src/components/page-transition";export default function t({children:o}){return e(r,{className:"flex flex-col flex-1",children:o})}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{getSources as e}from"../../../src/lib/source";import{localeConfig as a}from"../../../src/locale.config";import{ChangelogList as r}from"../../../src/features/changelog";export async function generateMetadata({params:t}){let{lang:e}=await t,r=a[e]?.translations??a.en.translations,n=a[e]?.siteName??a.en.siteName;return{title:`${r.changelog} — ${n}`}}export default async function n({params:a}){let{lang:i}=await a,{changelogSource:s}=await e();return t(r,{entries:s.getPages(i).map(t=>({url:t.url,title:t.data.title,summary:t.data.summary??null,version:t.data.version,date:t.data.date})).sort((t,e)=>new Date(e.date).getTime()-new Date(t.date).getTime()),lang:i})}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import{jsx as e,jsxs as l}from"react/jsx-runtime";import{Link as t}from"../../../lib/navigation";import{HomeLayout as a}from"../../../components/fumadocs/layout/home";import{baseOptions as r}from"../../../lib/layout.shared";import{localeConfig as m}from"../../../locale.config";export function ChangelogList({entries:n,lang:i}){let s=m[i]?.translations??m.en.translations;return e(a,{...r(i),children:l("main",{className:"flex flex-col flex-1 max-w-3xl mx-auto w-full px-6 py-16",children:[l("div",{className:"mb-12",children:[e("p",{className:"text-xs font-medium tracking-widest uppercase text-muted-foreground mb-3",children:s.changelog}),e("h1",{className:"text-3xl font-bold tracking-tight",children:s.changelogTitle}),e("p",{className:"mt-2 text-muted-foreground",children:s.changelogDescription})]}),e("div",{className:"flex flex-col",children:n.map((a,r)=>l("div",{className:"flex gap-8 group",children:[l("div",{className:"flex flex-col items-center",children:[e("div",{className:"w-2.5 h-2.5 rounded-full bg-primary mt-1.5 shrink-0 ring-4 ring-background"}),r<n.length-1&&e("div",{className:"w-px flex-1 bg-border mt-2"})]}),l("div",{className:`pb-12 min-w-0 flex-1 ${r===n.length-1?"pb-0":""}`,children:[l("div",{className:"flex flex-wrap items-center gap-2 mb-1",children:[l("span",{className:"inline-flex items-center rounded-full bg-primary/10 text-primary px-2.5 py-0.5 text-xs font-semibold font-mono",children:["v",a.version]}),e("time",{className:"text-xs text-muted-foreground",children:new Intl.DateTimeFormat(s.dateLocale,{year:"numeric",month:"long",day:"numeric"}).format(new Date(a.date))})]}),e("h2",{className:"text-lg font-semibold mt-1 mb-2",children:a.title}),a.summary&&e("p",{className:"text-muted-foreground text-sm leading-relaxed mb-3",children:a.summary}),e(t,{href:a.url,className:"text-sm font-medium text-primary hover:underline",children:s.changelogReadMore})]})]},a.url))})]})})}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{DocsBody as n,DocsDescription as o,DocsPage as a,DocsTitle as r,PageLastUpdate as i}from"../../../components/fumadocs/layout/docs/page";import{Transition as l}from"../../../components/page-transition";import{localeConfig as m}from"../../../locale.config";export function ChangelogEntryContent({toc:s,children:c,lang:d,lastModified:p,version:f,date:h}){return e(a,{asChild:!0,toc:s,tableOfContent:{style:"clerk"},tableOfContentPopover:{style:"clerk"},children:t(l,{animationKey:f,children:[e(r,{children:e("span",{className:"inline-flex items-center gap-2",children:t("span",{className:"inline-flex items-center rounded-full bg-primary/10 text-primary px-2.5 py-0.5 text-sm font-semibold font-mono",children:["v",f]})})}),e(o,{children:e("time",{className:"text-muted-foreground text-sm",children:new Intl.DateTimeFormat(m[d]?.translations.dateLocale??m.en.translations.dateLocale,{year:"numeric",month:"long",day:"numeric"}).format(new Date(h))})}),e(n,{children:c}),p&&e(i,{date:new Date(p)})]})})}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{ChangelogEntryContent}from"./components/entry-content";export{ChangelogList}from"./components/changelog-list";
|