@ahmedrowaihi/8n 6.0.2 → 6.0.4
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/{cli/adapter.cjs → adapter.cjs} +1 -1
- package/dist/index.mjs +4100 -0
- package/package.json +11 -108
- package/starter/.github/workflows/publish.yml +66 -0
- package/starter/.mcp.json +8 -0
- package/starter/.vscode/settings.json +7 -0
- package/starter/biome.json +33 -0
- package/starter/cli.json +13 -0
- package/starter/components.json +25 -0
- package/starter/next-env.d.ts +6 -0
- package/starter/openapi/petstore.json +123 -0
- package/starter/package-lock.json +18174 -0
- package/starter/package.json +107 -0
- package/starter/scripts/build-dist.mts +73 -0
- package/starter/scripts/generate-docs.mts +8 -0
- package/starter/serve.json +3 -0
- package/{tsconfig.json → starter/tsconfig.json} +2 -1
- package/dist/cli/index.mjs +0 -456
- package/src/cli/adapter.ts +0 -41
- package/src/cli/commands/build.ts +0 -13
- package/src/cli/commands/dev.ts +0 -13
- package/src/cli/commands/init.ts +0 -141
- package/src/cli/commands/mcp.ts +0 -195
- package/src/cli/commands/start.ts +0 -12
- package/src/cli/index.ts +0 -26
- package/src/cli/load-config.ts +0 -26
- package/src/cli/web-app.ts +0 -95
- /package/{README.md → starter/README.md} +0 -0
- /package/{app → starter/app}/[lang]/(docs)/[section]/[[...slug]]/page.jsx +0 -0
- /package/{app → starter/app}/[lang]/(docs)/error.jsx +0 -0
- /package/{app → starter/app}/[lang]/(docs)/layout.jsx +0 -0
- /package/{app → starter/app}/[lang]/(docs)/loading.jsx +0 -0
- /package/{app → starter/app}/[lang]/(marketing)/layout.jsx +0 -0
- /package/{app → starter/app}/[lang]/(marketing)/page.jsx +0 -0
- /package/{app → starter/app}/[lang]/changelog/[...slug]/layout.jsx +0 -0
- /package/{app → starter/app}/[lang]/changelog/[...slug]/page.jsx +0 -0
- /package/{app → starter/app}/[lang]/changelog/layout.jsx +0 -0
- /package/{app → starter/app}/[lang]/changelog/page.jsx +0 -0
- /package/{app → starter/app}/[lang]/error.jsx +0 -0
- /package/{app → starter/app}/[lang]/lang-setup.jsx +0 -0
- /package/{app → starter/app}/[lang]/layout.jsx +0 -0
- /package/{app → starter/app}/[lang]/loading.jsx +0 -0
- /package/{app → starter/app}/[lang]/playground/page.jsx +0 -0
- /package/{app → starter/app}/[lang]/rss.xml/route.js +0 -0
- /package/{app → starter/app}/api/chat/route.js +0 -0
- /package/{app → starter/app}/api/dev/watch/route.js +0 -0
- /package/{app → starter/app}/api/pages/route.js +0 -0
- /package/{app → starter/app}/api/search/route.js +0 -0
- /package/{app → starter/app}/excalidraw/layout.jsx +0 -0
- /package/{app → starter/app}/excalidraw/page.jsx +0 -0
- /package/{app → starter/app}/layout.jsx +0 -0
- /package/{app → starter/app}/llms-full.txt/route.js +0 -0
- /package/{app → starter/app}/llms.mdx/[section]/[...slug]/route.js +0 -0
- /package/{app → starter/app}/llms.txt/route.js +0 -0
- /package/{app → starter/app}/not-found.jsx +0 -0
- /package/{app → starter/app}/page.jsx +0 -0
- /package/{app → starter/app}/robots.js +0 -0
- /package/{app → starter/app}/sitemap.js +0 -0
- /package/{content → starter/content}/api/ar/meta.json +0 -0
- /package/{content → starter/content}/api/en/createPet.mdx +0 -0
- /package/{content → starter/content}/api/en/deletePet.mdx +0 -0
- /package/{content → starter/content}/api/en/index.mdx +0 -0
- /package/{content → starter/content}/api/en/listPets.mdx +0 -0
- /package/{content → starter/content}/api/en/meta.json +0 -0
- /package/{content → starter/content}/api/en/showPetById.mdx +0 -0
- /package/{content → starter/content}/changelog/ar/meta.json +0 -0
- /package/{content → starter/content}/changelog/ar/v1.0.0.mdx +0 -0
- /package/{content → starter/content}/changelog/en/meta.json +0 -0
- /package/{content → starter/content}/changelog/en/v1.0.0.mdx +0 -0
- /package/{content → starter/content}/docs/ar/components/accordion.mdx +0 -0
- /package/{content → starter/content}/docs/ar/components/audio.mdx +0 -0
- /package/{content → starter/content}/docs/ar/components/callout.mdx +0 -0
- /package/{content → starter/content}/docs/ar/components/cards.mdx +0 -0
- /package/{content → starter/content}/docs/ar/components/circuit-board.mdx +0 -0
- /package/{content → starter/content}/docs/ar/components/code-blocks.mdx +0 -0
- /package/{content → starter/content}/docs/ar/components/drawio.mdx +0 -0
- /package/{content → starter/content}/docs/ar/components/dynamic-code-block.mdx +0 -0
- /package/{content → starter/content}/docs/ar/components/excalidraw.mdx +0 -0
- /package/{content → starter/content}/docs/ar/components/figma.mdx +0 -0
- /package/{content → starter/content}/docs/ar/components/files.mdx +0 -0
- /package/{content → starter/content}/docs/ar/components/index.mdx +0 -0
- /package/{content → starter/content}/docs/ar/components/inline-toc.mdx +0 -0
- /package/{content → starter/content}/docs/ar/components/math.mdx +0 -0
- /package/{content → starter/content}/docs/ar/components/mermaid.mdx +0 -0
- /package/{content → starter/content}/docs/ar/components/meta.json +0 -0
- /package/{content → starter/content}/docs/ar/components/steps.mdx +0 -0
- /package/{content → starter/content}/docs/ar/components/tabs.mdx +0 -0
- /package/{content → starter/content}/docs/ar/components/tweet.mdx +0 -0
- /package/{content → starter/content}/docs/ar/components/twoslash.mdx +0 -0
- /package/{content → starter/content}/docs/ar/components/type-table.mdx +0 -0
- /package/{content → starter/content}/docs/ar/components/video.mdx +0 -0
- /package/{content → starter/content}/docs/ar/getting-started.mdx +0 -0
- /package/{content → starter/content}/docs/ar/index.mdx +0 -0
- /package/{content → starter/content}/docs/ar/meta.json +0 -0
- /package/{content → starter/content}/docs/en/components/accordion.mdx +0 -0
- /package/{content → starter/content}/docs/en/components/audio.mdx +0 -0
- /package/{content → starter/content}/docs/en/components/callout.mdx +0 -0
- /package/{content → starter/content}/docs/en/components/cards.mdx +0 -0
- /package/{content → starter/content}/docs/en/components/circuit-board.mdx +0 -0
- /package/{content → starter/content}/docs/en/components/code-blocks.mdx +0 -0
- /package/{content → starter/content}/docs/en/components/drawio.mdx +0 -0
- /package/{content → starter/content}/docs/en/components/dynamic-code-block.mdx +0 -0
- /package/{content → starter/content}/docs/en/components/excalidraw.mdx +0 -0
- /package/{content → starter/content}/docs/en/components/figma.mdx +0 -0
- /package/{content → starter/content}/docs/en/components/files.mdx +0 -0
- /package/{content → starter/content}/docs/en/components/index.mdx +0 -0
- /package/{content → starter/content}/docs/en/components/inline-toc.mdx +0 -0
- /package/{content → starter/content}/docs/en/components/math.mdx +0 -0
- /package/{content → starter/content}/docs/en/components/mermaid.mdx +0 -0
- /package/{content → starter/content}/docs/en/components/meta.json +0 -0
- /package/{content → starter/content}/docs/en/components/steps.mdx +0 -0
- /package/{content → starter/content}/docs/en/components/tabs.mdx +0 -0
- /package/{content → starter/content}/docs/en/components/tweet.mdx +0 -0
- /package/{content → starter/content}/docs/en/components/twoslash.mdx +0 -0
- /package/{content → starter/content}/docs/en/components/type-table.mdx +0 -0
- /package/{content → starter/content}/docs/en/components/video.mdx +0 -0
- /package/{content → starter/content}/docs/en/getting-started.mdx +0 -0
- /package/{content → starter/content}/docs/en/index.mdx +0 -0
- /package/{content → starter/content}/docs/en/meta.json +0 -0
- /package/{content → starter/content}/mcp/ar/meta.json +0 -0
- /package/{content → starter/content}/mcp/en/components.mdx +0 -0
- /package/{content → starter/content}/mcp/en/config.mdx +0 -0
- /package/{content → starter/content}/mcp/en/frontmatter.mdx +0 -0
- /package/{content → starter/content}/mcp/en/meta.json +0 -0
- /package/{content → starter/content}/mcp/en/structure.mdx +0 -0
- /package/{content → starter/content}/ui/ar/meta.json +0 -0
- /package/{content → starter/content}/ui/en/badge.mdx +0 -0
- /package/{content → starter/content}/ui/en/index.mdx +0 -0
- /package/{content → starter/content}/ui/en/meta.json +0 -0
- /package/{next.config.mjs → starter/next.config.mjs} +0 -0
- /package/{postcss.config.mjs → starter/postcss.config.mjs} +0 -0
- /package/{public → starter/public}/apple-touch-icon.png +0 -0
- /package/{public → starter/public}/fonts/ThmanyahSans/Thmanyahsans12-Black.woff2 +0 -0
- /package/{public → starter/public}/fonts/ThmanyahSans/Thmanyahsans12-Bold.woff2 +0 -0
- /package/{public → starter/public}/fonts/ThmanyahSans/Thmanyahsans12-Light.woff2 +0 -0
- /package/{public → starter/public}/fonts/ThmanyahSans/Thmanyahsans12-Medium.woff2 +0 -0
- /package/{public → starter/public}/fonts/ThmanyahSans/Thmanyahsans12-Regular.woff2 +0 -0
- /package/{public → starter/public}/fonts/ThmanyahSerifDisplay/Thmanyahserifdisplay12-Black.woff2 +0 -0
- /package/{public → starter/public}/fonts/ThmanyahSerifDisplay/Thmanyahserifdisplay12-Bold.woff2 +0 -0
- /package/{public → starter/public}/fonts/ThmanyahSerifDisplay/Thmanyahserifdisplay12-Light.woff2 +0 -0
- /package/{public → starter/public}/fonts/ThmanyahSerifDisplay/Thmanyahserifdisplay12-Medium.woff2 +0 -0
- /package/{public → starter/public}/fonts/ThmanyahSerifDisplay/Thmanyahserifdisplay12-Regular.woff2 +0 -0
- /package/{public → starter/public}/fonts/sar.woff +0 -0
- /package/{public → starter/public}/manifest.json +0 -0
- /package/{public → starter/public}/thmanyah-icon.svg +0 -0
- /package/{src → starter/src}/components/ai-elements/conversation.jsx +0 -0
- /package/{src → starter/src}/components/ai-elements/reasoning.jsx +0 -0
- /package/{src → starter/src}/components/ai-elements/shimmer.jsx +0 -0
- /package/{src → starter/src}/components/api-page.client.jsx +0 -0
- /package/{src → starter/src}/components/api-page.jsx +0 -0
- /package/{src → starter/src}/components/blocks/audio.jsx +0 -0
- /package/{src → starter/src}/components/blocks/circuit-board.jsx +0 -0
- /package/{src → starter/src}/components/blocks/drawio-block.jsx +0 -0
- /package/{src → starter/src}/components/blocks/excalidraw.jsx +0 -0
- /package/{src → starter/src}/components/blocks/figma-block.jsx +0 -0
- /package/{src → starter/src}/components/blocks/mermaid.jsx +0 -0
- /package/{src → starter/src}/components/blocks/video.jsx +0 -0
- /package/{src → starter/src}/components/credit-button.jsx +0 -0
- /package/{src → starter/src}/components/dev-refresh.jsx +0 -0
- /package/{src → starter/src}/components/error-state.jsx +0 -0
- /package/{src → starter/src}/components/feedback/client.jsx +0 -0
- /package/{src → starter/src}/components/feedback/github.js +0 -0
- /package/{src → starter/src}/components/feedback/schema.js +0 -0
- /package/{src → starter/src}/components/fumadocs/layout/docs/client.jsx +0 -0
- /package/{src → starter/src}/components/fumadocs/layout/docs/index.jsx +0 -0
- /package/{src → starter/src}/components/fumadocs/layout/docs/page/client.jsx +0 -0
- /package/{src → starter/src}/components/fumadocs/layout/docs/page/docs-toc.jsx +0 -0
- /package/{src → starter/src}/components/fumadocs/layout/docs/page/index.jsx +0 -0
- /package/{src → starter/src}/components/fumadocs/layout/docs/sidebar.jsx +0 -0
- /package/{src → starter/src}/components/fumadocs/layout/editor-button.jsx +0 -0
- /package/{src → starter/src}/components/fumadocs/layout/home/client.jsx +0 -0
- /package/{src → starter/src}/components/fumadocs/layout/home/index.jsx +0 -0
- /package/{src → starter/src}/components/fumadocs/layout/link-item.jsx +0 -0
- /package/{src → starter/src}/components/fumadocs/layout/page-actions.jsx +0 -0
- /package/{src → starter/src}/components/fumadocs/layout/search-toggle.jsx +0 -0
- /package/{src → starter/src}/components/fumadocs/layout/shared.jsx +0 -0
- /package/{src → starter/src}/components/fumadocs/layout/sidebar/base.jsx +0 -0
- /package/{src → starter/src}/components/fumadocs/layout/sidebar/link-item.jsx +0 -0
- /package/{src → starter/src}/components/fumadocs/layout/sidebar/page-tree.jsx +0 -0
- /package/{src → starter/src}/components/fumadocs/layout/sidebar/tabs/dropdown.jsx +0 -0
- /package/{src → starter/src}/components/fumadocs/layout/sidebar/tabs/index.jsx +0 -0
- /package/{src → starter/src}/components/fumadocs/layout/sidebar-back-button.jsx +0 -0
- /package/{src → starter/src}/components/fumadocs/layout/sidebar-footer.jsx +0 -0
- /package/{src → starter/src}/components/fumadocs/layout/theme-toggle.jsx +0 -0
- /package/{src → starter/src}/components/fumadocs/mdx/base-ui.jsx +0 -0
- /package/{src → starter/src}/components/fumadocs/mdx/blocks.jsx +0 -0
- /package/{src → starter/src}/components/fumadocs/mdx/openapi.js +0 -0
- /package/{src → starter/src}/components/fumadocs/mdx-server.js +0 -0
- /package/{src → starter/src}/components/fumadocs/mdx.jsx +0 -0
- /package/{src → starter/src}/components/fumadocs/search-toggle.jsx +0 -0
- /package/{src → starter/src}/components/fumadocs/search.jsx +0 -0
- /package/{src → starter/src}/components/fumadocs/toc/clerk.jsx +0 -0
- /package/{src → starter/src}/components/fumadocs/toc/default.jsx +0 -0
- /package/{src → starter/src}/components/fumadocs/toc/index.jsx +0 -0
- /package/{src → starter/src}/components/language-switcher.jsx +0 -0
- /package/{src → starter/src}/components/logo-loader.jsx +0 -0
- /package/{src → starter/src}/components/logo.jsx +0 -0
- /package/{src → starter/src}/components/markdown.jsx +0 -0
- /package/{src → starter/src}/components/not-found.jsx +0 -0
- /package/{src → starter/src}/components/page-transition.jsx +0 -0
- /package/{src → starter/src}/components/story/badge.js +0 -0
- /package/{src → starter/src}/components/story/button.js +0 -0
- /package/{src → starter/src}/components/story/index.js +0 -0
- /package/{src → starter/src}/components/ui/accordion.jsx +0 -0
- /package/{src → starter/src}/components/ui/alert-dialog.jsx +0 -0
- /package/{src → starter/src}/components/ui/alert.jsx +0 -0
- /package/{src → starter/src}/components/ui/aspect-ratio.jsx +0 -0
- /package/{src → starter/src}/components/ui/avatar.jsx +0 -0
- /package/{src → starter/src}/components/ui/badge.client.jsx +0 -0
- /package/{src → starter/src}/components/ui/badge.jsx +0 -0
- /package/{src → starter/src}/components/ui/breadcrumb.jsx +0 -0
- /package/{src → starter/src}/components/ui/button-group.jsx +0 -0
- /package/{src → starter/src}/components/ui/button.client.jsx +0 -0
- /package/{src → starter/src}/components/ui/button.jsx +0 -0
- /package/{src → starter/src}/components/ui/calendar.jsx +0 -0
- /package/{src → starter/src}/components/ui/card.jsx +0 -0
- /package/{src → starter/src}/components/ui/carousel.jsx +0 -0
- /package/{src → starter/src}/components/ui/chart.jsx +0 -0
- /package/{src → starter/src}/components/ui/checkbox.jsx +0 -0
- /package/{src → starter/src}/components/ui/collapsible.jsx +0 -0
- /package/{src → starter/src}/components/ui/combobox.jsx +0 -0
- /package/{src → starter/src}/components/ui/command.jsx +0 -0
- /package/{src → starter/src}/components/ui/context-menu.jsx +0 -0
- /package/{src → starter/src}/components/ui/dialog.jsx +0 -0
- /package/{src → starter/src}/components/ui/direction.jsx +0 -0
- /package/{src → starter/src}/components/ui/drawer.jsx +0 -0
- /package/{src → starter/src}/components/ui/dropdown-menu.jsx +0 -0
- /package/{src → starter/src}/components/ui/empty.jsx +0 -0
- /package/{src → starter/src}/components/ui/field.jsx +0 -0
- /package/{src → starter/src}/components/ui/hover-card.jsx +0 -0
- /package/{src → starter/src}/components/ui/input-group.jsx +0 -0
- /package/{src → starter/src}/components/ui/input-otp.jsx +0 -0
- /package/{src → starter/src}/components/ui/input.jsx +0 -0
- /package/{src → starter/src}/components/ui/item.jsx +0 -0
- /package/{src → starter/src}/components/ui/kbd.jsx +0 -0
- /package/{src → starter/src}/components/ui/label.jsx +0 -0
- /package/{src → starter/src}/components/ui/menubar.jsx +0 -0
- /package/{src → starter/src}/components/ui/native-select.jsx +0 -0
- /package/{src → starter/src}/components/ui/navigation-menu.jsx +0 -0
- /package/{src → starter/src}/components/ui/pagination.jsx +0 -0
- /package/{src → starter/src}/components/ui/popover.jsx +0 -0
- /package/{src → starter/src}/components/ui/progress.jsx +0 -0
- /package/{src → starter/src}/components/ui/radio-group.jsx +0 -0
- /package/{src → starter/src}/components/ui/resizable.jsx +0 -0
- /package/{src → starter/src}/components/ui/scroll-area.jsx +0 -0
- /package/{src → starter/src}/components/ui/select.jsx +0 -0
- /package/{src → starter/src}/components/ui/separator.jsx +0 -0
- /package/{src → starter/src}/components/ui/sheet.jsx +0 -0
- /package/{src → starter/src}/components/ui/sidebar.jsx +0 -0
- /package/{src → starter/src}/components/ui/skeleton.jsx +0 -0
- /package/{src → starter/src}/components/ui/slider.jsx +0 -0
- /package/{src → starter/src}/components/ui/sonner.jsx +0 -0
- /package/{src → starter/src}/components/ui/spinner.jsx +0 -0
- /package/{src → starter/src}/components/ui/switch.jsx +0 -0
- /package/{src → starter/src}/components/ui/table.jsx +0 -0
- /package/{src → starter/src}/components/ui/tabs.jsx +0 -0
- /package/{src → starter/src}/components/ui/textarea.jsx +0 -0
- /package/{src → starter/src}/components/ui/toggle-group.jsx +0 -0
- /package/{src → starter/src}/components/ui/toggle.jsx +0 -0
- /package/{src → starter/src}/components/ui/tooltip.jsx +0 -0
- /package/{src → starter/src}/config.js +0 -0
- /package/{src → starter/src}/features/ai/chat/agents.js +0 -0
- /package/{src → starter/src}/features/ai/chat/components/api-key-form.jsx +0 -0
- /package/{src → starter/src}/features/ai/chat/components/brand.jsx +0 -0
- /package/{src → starter/src}/features/ai/chat/components/content.jsx +0 -0
- /package/{src → starter/src}/features/ai/chat/components/layout.jsx +0 -0
- /package/{src → starter/src}/features/ai/chat/components/message.jsx +0 -0
- /package/{src → starter/src}/features/ai/chat/components/model-select.jsx +0 -0
- /package/{src → starter/src}/features/ai/chat/components/panels.jsx +0 -0
- /package/{src → starter/src}/features/ai/chat/components/prompt.jsx +0 -0
- /package/{src → starter/src}/features/ai/chat/components/tool-renderer.jsx +0 -0
- /package/{src → starter/src}/features/ai/chat/components/trigger.jsx +0 -0
- /package/{src → starter/src}/features/ai/chat/constants.js +0 -0
- /package/{src → starter/src}/features/ai/chat/handler.js +0 -0
- /package/{src → starter/src}/features/ai/chat/hooks/use-pages.js +0 -0
- /package/{src → starter/src}/features/ai/chat/index.js +0 -0
- /package/{src → starter/src}/features/ai/chat/panel-store.js +0 -0
- /package/{src → starter/src}/features/ai/chat/provider.jsx +0 -0
- /package/{src → starter/src}/features/ai/chat/selection-store.js +0 -0
- /package/{src → starter/src}/features/ai/chat/settings-store.js +0 -0
- /package/{src → starter/src}/features/ai/chat/store.js +0 -0
- /package/{src → starter/src}/features/ai/chat/tools.js +0 -0
- /package/{src → starter/src}/features/ai/chat/types.js +0 -0
- /package/{src → starter/src}/features/ai/playground/agents.js +0 -0
- /package/{src → starter/src}/features/ai/playground/tools.js +0 -0
- /package/{src → starter/src}/features/ai/shared/create-model.js +0 -0
- /package/{src → starter/src}/features/ai/shared/filter-reasoning.js +0 -0
- /package/{src → starter/src}/features/changelog/components/changelog-list.jsx +0 -0
- /package/{src → starter/src}/features/changelog/components/entry-content.jsx +0 -0
- /package/{src → starter/src}/features/changelog/index.js +0 -0
- /package/{src → starter/src}/features/docs/components/page-content.jsx +0 -0
- /package/{src → starter/src}/features/docs/index.js +0 -0
- /package/{src → starter/src}/features/docs/section-page.jsx +0 -0
- /package/{src → starter/src}/features/feedback/components/feedback-block-mdx.jsx +0 -0
- /package/{src → starter/src}/features/feedback/components/feedback.jsx +0 -0
- /package/{src → starter/src}/features/feedback/github.js +0 -0
- /package/{src → starter/src}/features/feedback/index.js +0 -0
- /package/{src → starter/src}/features/feedback/schema.js +0 -0
- /package/{src → starter/src}/features/marketing/components/home.jsx +0 -0
- /package/{src → starter/src}/features/marketing/index.js +0 -0
- /package/{src → starter/src}/features/mdx-playground/components/editor.jsx +0 -0
- /package/{src → starter/src}/features/mdx-playground/components/playground-provider.jsx +0 -0
- /package/{src → starter/src}/features/mdx-playground/components/playground-sidebar.jsx +0 -0
- /package/{src → starter/src}/features/mdx-playground/components/playground.jsx +0 -0
- /package/{src → starter/src}/features/mdx-playground/components/proposal-context.jsx +0 -0
- /package/{src → starter/src}/features/mdx-playground/components/update-content-card.jsx +0 -0
- /package/{src → starter/src}/features/mdx-playground/hooks/use-mdx-compiler.js +0 -0
- /package/{src → starter/src}/features/mdx-playground/hooks/use-playground-chat.js +0 -0
- /package/{src → starter/src}/features/mdx-playground/lib/compile.js +0 -0
- /package/{src → starter/src}/features/mdx-playground/lib/components-reference.js +0 -0
- /package/{src → starter/src}/features/mdx-playground/store/settings.js +0 -0
- /package/{src → starter/src}/hooks/use-copy-button.js +0 -0
- /package/{src → starter/src}/hooks/use-locale.js +0 -0
- /package/{src → starter/src}/hooks/use-mobile.js +0 -0
- /package/{src → starter/src}/i18n.d.ts +0 -0
- /package/{src → starter/src}/lib/cn.js +0 -0
- /package/{src → starter/src}/lib/content-source.js +0 -0
- /package/{src → starter/src}/lib/create-docs-layout.jsx +0 -0
- /package/{src → starter/src}/lib/create-docs-page.jsx +0 -0
- /package/{src → starter/src}/lib/i18n.js +0 -0
- /package/{src → starter/src}/lib/layout.shared.jsx +0 -0
- /package/{src → starter/src}/lib/llms.js +0 -0
- /package/{src → starter/src}/lib/mdx-compiler.js +0 -0
- /package/{src → starter/src}/lib/mdx-plugins.js +0 -0
- /package/{src → starter/src}/lib/merge-refs.js +0 -0
- /package/{src → starter/src}/lib/navigation.js +0 -0
- /package/{src → starter/src}/lib/openapi.js +0 -0
- /package/{src → starter/src}/lib/pages-api.js +0 -0
- /package/{src → starter/src}/lib/rss.js +0 -0
- /package/{src → starter/src}/lib/sitemap.js +0 -0
- /package/{src → starter/src}/lib/source.js +0 -0
- /package/{src → starter/src}/lib/story.js +0 -0
- /package/{src → starter/src}/lib/theme-transition.js +0 -0
- /package/{src → starter/src}/lib/urls.js +0 -0
- /package/{src → starter/src}/lib/utils.js +0 -0
- /package/{src → starter/src}/locale.config.js +0 -0
- /package/{src → starter/src}/styles/app.css +0 -0
- /package/{src → starter/src}/styles/theme.css +0 -0
package/src/cli/adapter.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { renameSync, rmSync, existsSync, cpSync } from "node:fs";
|
|
2
|
-
import { join } from "node:path";
|
|
3
|
-
import type { NextAdapter } from "next";
|
|
4
|
-
|
|
5
|
-
const adapter: NextAdapter = {
|
|
6
|
-
name: "8n",
|
|
7
|
-
modifyConfig(config, { phase }) {
|
|
8
|
-
if (phase !== "phase-production-build") return config;
|
|
9
|
-
|
|
10
|
-
const basePath = process.env.NEXT_BASE_PATH || "";
|
|
11
|
-
const staticExport = process.env.NEXT_STATIC_EXPORT === "true";
|
|
12
|
-
|
|
13
|
-
return {
|
|
14
|
-
...config,
|
|
15
|
-
...(staticExport ? { output: "export", trailingSlash: true } : {}),
|
|
16
|
-
...(basePath ? { basePath, assetPrefix: basePath } : {}),
|
|
17
|
-
};
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
async onBuildComplete({ projectDir }) {
|
|
21
|
-
const docsProjectDir = process.env.DOCS_PROJECT_DIR;
|
|
22
|
-
const staticExport = process.env.NEXT_STATIC_EXPORT === "true";
|
|
23
|
-
|
|
24
|
-
if (!docsProjectDir || !staticExport) return;
|
|
25
|
-
|
|
26
|
-
const src = join(projectDir, "out");
|
|
27
|
-
const dest = join(docsProjectDir, "out");
|
|
28
|
-
|
|
29
|
-
if (existsSync(dest)) rmSync(dest, { recursive: true, force: true });
|
|
30
|
-
|
|
31
|
-
try {
|
|
32
|
-
renameSync(src, dest);
|
|
33
|
-
} catch (err: any) {
|
|
34
|
-
if (err.code !== "EXDEV") throw err;
|
|
35
|
-
cpSync(src, dest, { recursive: true });
|
|
36
|
-
rmSync(src, { recursive: true, force: true });
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
module.exports = adapter;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import pc from "picocolors";
|
|
2
|
-
import { buildEnv, syncPublicDir, resolveProject, runNext } from "../web-app.js";
|
|
3
|
-
|
|
4
|
-
export async function build() {
|
|
5
|
-
const { config, contentDir } = await resolveProject();
|
|
6
|
-
|
|
7
|
-
console.log(pc.cyan("8n") + pc.dim(` build → ${contentDir}`));
|
|
8
|
-
|
|
9
|
-
syncPublicDir(process.cwd());
|
|
10
|
-
await runNext("build", buildEnv({ config, contentDir, staticExport: true }));
|
|
11
|
-
|
|
12
|
-
console.log(pc.green("✓") + pc.dim(` build complete → out/`));
|
|
13
|
-
}
|
package/src/cli/commands/dev.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import pc from "picocolors";
|
|
2
|
-
import { buildEnv, checkSelfUpdate, syncPublicDir, watchPublicDir, resolveProject, runNext } from "../web-app.js";
|
|
3
|
-
|
|
4
|
-
export async function dev() {
|
|
5
|
-
const { config, contentDir } = await resolveProject();
|
|
6
|
-
|
|
7
|
-
console.log(pc.cyan("8n") + pc.dim(` dev → ${contentDir}`));
|
|
8
|
-
|
|
9
|
-
checkSelfUpdate();
|
|
10
|
-
syncPublicDir(process.cwd());
|
|
11
|
-
watchPublicDir(process.cwd());
|
|
12
|
-
await runNext("dev", buildEnv({ config, contentDir }));
|
|
13
|
-
}
|
package/src/cli/commands/init.ts
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { resolve, join, basename } from "node:path";
|
|
2
|
-
import { existsSync, mkdirSync, writeFileSync, readFileSync, appendFileSync, readdirSync } from "node:fs";
|
|
3
|
-
import { createInterface } from "node:readline/promises";
|
|
4
|
-
import pc from "picocolors";
|
|
5
|
-
|
|
6
|
-
const CONFIG_FILE = "8n.config.ts";
|
|
7
|
-
|
|
8
|
-
const SCAFFOLD: Record<string, string> = {
|
|
9
|
-
[CONFIG_FILE]: `export default {
|
|
10
|
-
content: "./content",
|
|
11
|
-
locales: ["en"],
|
|
12
|
-
siteName: "Docs",
|
|
13
|
-
|
|
14
|
-
// Pin to a specific starter version (git tag or commit SHA).
|
|
15
|
-
// Remove this line to always track the latest release.
|
|
16
|
-
// version: "v1.0.0",
|
|
17
|
-
|
|
18
|
-
// Sections auto-show when content exists, auto-hide when empty.
|
|
19
|
-
// Set a section to false to hide it even if content is present.
|
|
20
|
-
// sections: { api: false },
|
|
21
|
-
|
|
22
|
-
// Add links to the top navigation bar.
|
|
23
|
-
// nav: { links: [{ text: "Blog", url: "https://example.com/blog" }] },
|
|
24
|
-
};
|
|
25
|
-
`,
|
|
26
|
-
["content/docs/en/meta.json"]: JSON.stringify({ title: "Documentation", pages: ["index", "getting-started"] }, null, 2) + "\n",
|
|
27
|
-
["content/docs/en/index.mdx"]: `---
|
|
28
|
-
title: Introduction
|
|
29
|
-
description: Welcome to the docs.
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
Welcome to your documentation. Edit files in \`content/\` and run \`8n dev\` to start.
|
|
33
|
-
`,
|
|
34
|
-
["content/docs/en/getting-started/meta.json"]: JSON.stringify({ title: "Getting Started", pages: ["installation"] }, null, 2) + "\n",
|
|
35
|
-
["content/docs/en/getting-started/installation.mdx"]: `---
|
|
36
|
-
title: Installation
|
|
37
|
-
description: How to install and set up the project.
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
## Installation
|
|
41
|
-
|
|
42
|
-
Add your installation steps here.
|
|
43
|
-
`,
|
|
44
|
-
["content/home/en/index.mdx"]: `---
|
|
45
|
-
title: Home
|
|
46
|
-
---
|
|
47
|
-
|
|
48
|
-
<div className="flex flex-col items-center justify-center text-center flex-1 gap-6 px-6 py-24">
|
|
49
|
-
<h1 className="text-4xl sm:text-5xl md:text-6xl font-bold leading-tight tracking-tight max-w-2xl">
|
|
50
|
-
Welcome to your docs.
|
|
51
|
-
</h1>
|
|
52
|
-
<div className="text-muted-foreground text-lg max-w-md leading-relaxed">
|
|
53
|
-
Edit \`content/home/en/index.mdx\` to customize this page.
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
`,
|
|
57
|
-
["content/changelog/en/meta.json"]: JSON.stringify({ title: "Changelog" }, null, 2) + "\n",
|
|
58
|
-
["content/changelog/en/v1.0.0.mdx"]: `---
|
|
59
|
-
title: Version 1.0.0
|
|
60
|
-
version: 1.0.0
|
|
61
|
-
date: "${new Date().toISOString().slice(0, 10)}"
|
|
62
|
-
summary: Initial release.
|
|
63
|
-
---
|
|
64
|
-
|
|
65
|
-
## Initial Release
|
|
66
|
-
|
|
67
|
-
First version of the docs.
|
|
68
|
-
`,
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
const GITIGNORE_ENTRIES = ["out"];
|
|
72
|
-
|
|
73
|
-
function isDirEmpty(dir: string): boolean {
|
|
74
|
-
if (!existsSync(dir)) return true;
|
|
75
|
-
return readdirSync(dir).filter((f) => !f.startsWith(".")).length === 0;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function scaffold(targetDir: string) {
|
|
79
|
-
let created = 0;
|
|
80
|
-
|
|
81
|
-
const files: Record<string, string> = {
|
|
82
|
-
...SCAFFOLD,
|
|
83
|
-
"package.json": JSON.stringify(
|
|
84
|
-
{ name: basename(targetDir), private: true, scripts: { dev: "8n dev", build: "8n build", start: "8n start" } },
|
|
85
|
-
null,
|
|
86
|
-
2,
|
|
87
|
-
) + "\n",
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
for (const [rel, content] of Object.entries(files)) {
|
|
91
|
-
const abs = resolve(targetDir, rel);
|
|
92
|
-
if (existsSync(abs)) {
|
|
93
|
-
console.log(pc.dim(` skip ${rel}`));
|
|
94
|
-
continue;
|
|
95
|
-
}
|
|
96
|
-
mkdirSync(join(abs, ".."), { recursive: true });
|
|
97
|
-
writeFileSync(abs, content);
|
|
98
|
-
console.log(pc.green(" create") + pc.dim(` ${rel}`));
|
|
99
|
-
created++;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
const gitignorePath = resolve(targetDir, ".gitignore");
|
|
103
|
-
const existing = existsSync(gitignorePath) ? readFileSync(gitignorePath, "utf-8") : "";
|
|
104
|
-
const missing = GITIGNORE_ENTRIES.filter((e) => !existing.split("\n").includes(e));
|
|
105
|
-
if (missing.length > 0) {
|
|
106
|
-
const prefix = existing.length > 0 && !existing.endsWith("\n") ? "\n" : "";
|
|
107
|
-
appendFileSync(gitignorePath, prefix + missing.join("\n") + "\n");
|
|
108
|
-
for (const e of missing) console.log(pc.green(" gitignore") + pc.dim(` ${e}`));
|
|
109
|
-
created += missing.length;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
if (created > 0) {
|
|
113
|
-
console.log(pc.green("\n✓") + ` ready — run ${pc.cyan("pnpm dev")} to start`);
|
|
114
|
-
} else {
|
|
115
|
-
console.log(pc.dim("\n already initialized"));
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export async function init() {
|
|
120
|
-
const cwd = process.cwd();
|
|
121
|
-
|
|
122
|
-
console.log(pc.cyan("8n") + pc.dim(" init"));
|
|
123
|
-
|
|
124
|
-
if (isDirEmpty(cwd)) {
|
|
125
|
-
scaffold(cwd);
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
130
|
-
const name = (await rl.question(pc.dim(" directory name: "))).trim();
|
|
131
|
-
rl.close();
|
|
132
|
-
|
|
133
|
-
if (!name) {
|
|
134
|
-
console.log(pc.red(" aborted"));
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
const targetDir = resolve(cwd, name);
|
|
139
|
-
mkdirSync(targetDir, { recursive: true });
|
|
140
|
-
scaffold(targetDir);
|
|
141
|
-
}
|
package/src/cli/commands/mcp.ts
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
-
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
import { readdir, readFile } from "node:fs/promises";
|
|
5
|
-
import { join, basename, extname, relative } from "node:path";
|
|
6
|
-
import { existsSync } from "node:fs";
|
|
7
|
-
import { getPackageRoot, resolveProject } from "../web-app.js";
|
|
8
|
-
|
|
9
|
-
declare const __CLI_VERSION__: string;
|
|
10
|
-
|
|
11
|
-
async function listMdFiles(dir: string): Promise<string[]> {
|
|
12
|
-
let entries;
|
|
13
|
-
try { entries = await readdir(dir, { withFileTypes: true }); } catch { return []; }
|
|
14
|
-
return entries
|
|
15
|
-
.filter((e) => !e.isDirectory() && (e.name.endsWith(".mdx") || e.name.endsWith(".md")))
|
|
16
|
-
.map((e) => e.name);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export async function mcp() {
|
|
20
|
-
const mcpDir = join(getPackageRoot(), "content", "mcp", "en");
|
|
21
|
-
|
|
22
|
-
const server = new McpServer({ name: "8n", version: __CLI_VERSION__ });
|
|
23
|
-
|
|
24
|
-
server.registerTool(
|
|
25
|
-
"read_me",
|
|
26
|
-
{
|
|
27
|
-
description: "Returns how to use the 8n MCP tools. Call this BEFORE documenting anything with 8n.",
|
|
28
|
-
inputSchema: {},
|
|
29
|
-
},
|
|
30
|
-
async () => ({
|
|
31
|
-
content: [{
|
|
32
|
-
type: "text" as const,
|
|
33
|
-
text: `# 8n MCP
|
|
34
|
-
|
|
35
|
-
Use these tools to learn how to write documentation for an 8n project before creating any content.
|
|
36
|
-
|
|
37
|
-
## Tools
|
|
38
|
-
|
|
39
|
-
### list_components
|
|
40
|
-
Lists all available reference topics (config, structure, frontmatter, components).
|
|
41
|
-
Call this first to discover what topics are available.
|
|
42
|
-
|
|
43
|
-
### get_component
|
|
44
|
-
Reads a specific topic by name (without extension).
|
|
45
|
-
Example: get_component({ name: "components" }) returns all available MDX components with usage examples.
|
|
46
|
-
|
|
47
|
-
## Workflow
|
|
48
|
-
1. Call list_components to see available topics
|
|
49
|
-
2. Call get_component for the topics relevant to your task
|
|
50
|
-
3. Use that knowledge to write correct MDX content for the user's project
|
|
51
|
-
`,
|
|
52
|
-
}],
|
|
53
|
-
}),
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
server.registerTool(
|
|
57
|
-
"list_components",
|
|
58
|
-
{
|
|
59
|
-
description: "Lists all available 8n reference topics (config, structure, frontmatter, MDX components).",
|
|
60
|
-
inputSchema: {},
|
|
61
|
-
},
|
|
62
|
-
async () => {
|
|
63
|
-
if (!existsSync(mcpDir)) {
|
|
64
|
-
return { content: [{ type: "text" as const, text: "8n MCP knowledge not found. Reinstall @ahmedrowaihi/8n." }] };
|
|
65
|
-
}
|
|
66
|
-
const files = await listMdFiles(mcpDir);
|
|
67
|
-
const names = files.map((f) => basename(f, extname(f)));
|
|
68
|
-
return { content: [{ type: "text" as const, text: names.join("\n") }] };
|
|
69
|
-
},
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
server.registerTool(
|
|
73
|
-
"get_component",
|
|
74
|
-
{
|
|
75
|
-
description: "Reads a specific 8n reference topic by name. Use list_components first to discover available names.",
|
|
76
|
-
inputSchema: {
|
|
77
|
-
name: z.string().describe("Topic name without extension, e.g. components, config, structure, frontmatter"),
|
|
78
|
-
},
|
|
79
|
-
},
|
|
80
|
-
async ({ name }) => {
|
|
81
|
-
if (!existsSync(mcpDir)) {
|
|
82
|
-
return { content: [{ type: "text" as const, text: "8n MCP knowledge not found. Reinstall @ahmedrowaihi/8n." }] };
|
|
83
|
-
}
|
|
84
|
-
for (const ext of [".mdx", ".md"]) {
|
|
85
|
-
const file = join(mcpDir, `${name}${ext}`);
|
|
86
|
-
if (existsSync(file)) {
|
|
87
|
-
const text = await readFile(file, "utf-8");
|
|
88
|
-
return { content: [{ type: "text" as const, text }] };
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
return { content: [{ type: "text" as const, text: `Unknown topic: ${name}. Call list_components to see available topics.` }] };
|
|
92
|
-
},
|
|
93
|
-
);
|
|
94
|
-
|
|
95
|
-
server.registerTool(
|
|
96
|
-
"analyze",
|
|
97
|
-
{
|
|
98
|
-
description: "Runs static analysis on the user's content directory and reports issues that may break the documentation site.",
|
|
99
|
-
inputSchema: {},
|
|
100
|
-
},
|
|
101
|
-
async () => {
|
|
102
|
-
let contentDir = join(process.cwd(), "content");
|
|
103
|
-
let locales: string[] = ["en"];
|
|
104
|
-
try {
|
|
105
|
-
const project = await resolveProject();
|
|
106
|
-
contentDir = project.contentDir;
|
|
107
|
-
locales = project.config.locales ?? ["en"];
|
|
108
|
-
} catch { /* use defaults */ }
|
|
109
|
-
|
|
110
|
-
const issues: string[] = [];
|
|
111
|
-
|
|
112
|
-
async function walkAll(dir: string): Promise<string[]> {
|
|
113
|
-
const results: string[] = [];
|
|
114
|
-
let entries;
|
|
115
|
-
try { entries = await readdir(dir, { withFileTypes: true }); } catch { return results; }
|
|
116
|
-
for (const e of entries) {
|
|
117
|
-
const full = join(dir, e.name);
|
|
118
|
-
if (e.isDirectory()) results.push(...await walkAll(full));
|
|
119
|
-
else results.push(full);
|
|
120
|
-
}
|
|
121
|
-
return results;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
const allFiles = await walkAll(contentDir);
|
|
125
|
-
const mdxFiles = allFiles.filter((f) => f.endsWith(".mdx") || f.endsWith(".md"));
|
|
126
|
-
const metaFiles = allFiles.filter((f) => f.endsWith("meta.json"));
|
|
127
|
-
|
|
128
|
-
for (const file of mdxFiles) {
|
|
129
|
-
const raw = await readFile(file, "utf-8").catch(() => "");
|
|
130
|
-
const rel = relative(contentDir, file);
|
|
131
|
-
if (!raw.match(/^---[\s\S]*?\ntitle:/m)) {
|
|
132
|
-
issues.push(`Missing title in frontmatter: ${rel}`);
|
|
133
|
-
}
|
|
134
|
-
if (rel.startsWith("changelog/")) {
|
|
135
|
-
if (!raw.match(/\nversion:/)) issues.push(`Changelog page missing version: ${rel}`);
|
|
136
|
-
if (!raw.match(/\ndate:/)) issues.push(`Changelog page missing date: ${rel}`);
|
|
137
|
-
}
|
|
138
|
-
const bodyMatch = raw.match(/^---[\s\S]*?---\s*([\s\S]*)$/m);
|
|
139
|
-
if (bodyMatch && bodyMatch[1].trim() === "") {
|
|
140
|
-
issues.push(`Empty page body: ${rel}`);
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
for (const file of metaFiles) {
|
|
145
|
-
const rel = relative(contentDir, file);
|
|
146
|
-
const raw = await readFile(file, "utf-8").catch(() => "");
|
|
147
|
-
let meta: { pages?: string[] };
|
|
148
|
-
try {
|
|
149
|
-
meta = JSON.parse(raw);
|
|
150
|
-
} catch {
|
|
151
|
-
issues.push(`Malformed JSON: ${rel}`);
|
|
152
|
-
continue;
|
|
153
|
-
}
|
|
154
|
-
if (meta.pages) {
|
|
155
|
-
const dir = join(file, "..");
|
|
156
|
-
for (const page of meta.pages) {
|
|
157
|
-
// Skip Fumadocs special syntax: ...folder (extract), --- (separator), [text](url) (link)
|
|
158
|
-
if (page.startsWith("...") || page === "---" || page.startsWith("[")) continue;
|
|
159
|
-
const isFolder = existsSync(join(dir, page)) && !existsSync(join(dir, `${page}.mdx`)) && !existsSync(join(dir, `${page}.md`));
|
|
160
|
-
if (isFolder) continue;
|
|
161
|
-
const exists = [".mdx", ".md"].some((ext) => existsSync(join(dir, `${page}${ext}`)));
|
|
162
|
-
if (!exists) issues.push(`meta.json references missing page "${page}": ${rel}`);
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
const defaultLocale = locales[0];
|
|
168
|
-
const otherLocales = locales.slice(1);
|
|
169
|
-
for (const locale of otherLocales) {
|
|
170
|
-
const defaultFiles = mdxFiles
|
|
171
|
-
.filter((f) => f.includes(`/${defaultLocale}/`))
|
|
172
|
-
.map((f) => relative(contentDir, f).replace(`${defaultLocale}/`, `${locale}/`));
|
|
173
|
-
for (const expected of defaultFiles) {
|
|
174
|
-
if (!existsSync(join(contentDir, expected))) {
|
|
175
|
-
issues.push(`Missing ${locale} translation: ${expected}`);
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
if (issues.length === 0) {
|
|
181
|
-
return { content: [{ type: "text" as const, text: "✓ No issues found." }] };
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
return {
|
|
185
|
-
content: [{
|
|
186
|
-
type: "text" as const,
|
|
187
|
-
text: `Found ${issues.length} issue${issues.length === 1 ? "" : "s"}:\n\n${issues.map((i) => `- ${i}`).join("\n")}`,
|
|
188
|
-
}],
|
|
189
|
-
};
|
|
190
|
-
},
|
|
191
|
-
);
|
|
192
|
-
|
|
193
|
-
const transport = new StdioServerTransport();
|
|
194
|
-
await server.connect(transport);
|
|
195
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import pc from "picocolors";
|
|
2
|
-
import { buildEnv, syncPublicDir, resolveProject, runNext } from "../web-app.js";
|
|
3
|
-
|
|
4
|
-
export async function start() {
|
|
5
|
-
const { config, contentDir } = await resolveProject();
|
|
6
|
-
|
|
7
|
-
console.log(pc.cyan("8n") + pc.dim(` start → ${contentDir}`));
|
|
8
|
-
|
|
9
|
-
syncPublicDir(process.cwd());
|
|
10
|
-
await runNext("build", buildEnv({ config, contentDir }));
|
|
11
|
-
await runNext("start", buildEnv({ config, contentDir }));
|
|
12
|
-
}
|
package/src/cli/index.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { Command, Option } from "commander";
|
|
3
|
-
import { dev } from "./commands/dev.js";
|
|
4
|
-
import { build } from "./commands/build.js";
|
|
5
|
-
import { start } from "./commands/start.js";
|
|
6
|
-
import { init } from "./commands/init.js";
|
|
7
|
-
import { mcp } from "./commands/mcp.js";
|
|
8
|
-
|
|
9
|
-
declare const __CLI_VERSION__: string;
|
|
10
|
-
|
|
11
|
-
const program = new Command()
|
|
12
|
-
.name("8n")
|
|
13
|
-
.description("Run your 8n docs site")
|
|
14
|
-
.version(__CLI_VERSION__)
|
|
15
|
-
.addOption(new Option("--debug").hideHelp())
|
|
16
|
-
.hook("preAction", (cmd) => {
|
|
17
|
-
if (cmd.opts().debug) process.env.DEBUG_8N = "1";
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
program.command("init").description("Scaffold a new docs project in the current directory").action(init);
|
|
21
|
-
program.command("dev").description("Start the dev server").action(dev);
|
|
22
|
-
program.command("build").description("Build for production").action(build);
|
|
23
|
-
program.command("start").description("Start the production server").action(start);
|
|
24
|
-
program.command("mcp").description("Start the MCP server for AI-assisted docs authoring").action(mcp);
|
|
25
|
-
|
|
26
|
-
program.parse();
|
package/src/cli/load-config.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { loadConfig } from "c12";
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
export const configSchema = z.object({
|
|
5
|
-
content: z.string().default("./content"),
|
|
6
|
-
locales: z.array(z.string()).min(1).default(["en"]),
|
|
7
|
-
github: z.object({ repo: z.string() }).optional(),
|
|
8
|
-
siteName: z.string().optional(),
|
|
9
|
-
version: z.string().optional(),
|
|
10
|
-
sections: z.record(z.string(), z.boolean()).optional(),
|
|
11
|
-
nav: z.object({
|
|
12
|
-
links: z.array(z.object({ text: z.string(), url: z.string() })).default([]),
|
|
13
|
-
}).default({ links: [] }),
|
|
14
|
-
animations: z.boolean().default(true),
|
|
15
|
-
basePath: z.string().optional(),
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
export type DocsConfig = z.infer<typeof configSchema>;
|
|
19
|
-
|
|
20
|
-
export async function resolveConfig(): Promise<DocsConfig> {
|
|
21
|
-
const { config } = await loadConfig<DocsConfig>({
|
|
22
|
-
name: "8n",
|
|
23
|
-
defaults: configSchema.parse({}),
|
|
24
|
-
});
|
|
25
|
-
return configSchema.parse(config);
|
|
26
|
-
}
|
package/src/cli/web-app.ts
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { join, dirname, resolve } from "node:path";
|
|
2
|
-
import { fileURLToPath } from "node:url";
|
|
3
|
-
import { existsSync, cpSync, watch } from "node:fs";
|
|
4
|
-
import { x } from "tinyexec";
|
|
5
|
-
import pc from "picocolors";
|
|
6
|
-
import type { DocsConfig } from "./load-config.js";
|
|
7
|
-
import { resolveConfig } from "./load-config.js";
|
|
8
|
-
|
|
9
|
-
declare const __CLI_VERSION__: string;
|
|
10
|
-
|
|
11
|
-
export function getPackageRoot(): string {
|
|
12
|
-
// dist/cli/index.mjs is 2 levels deep from package root
|
|
13
|
-
return join(dirname(fileURLToPath(import.meta.url)), "..", "..");
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export async function checkSelfUpdate(): Promise<void> {
|
|
17
|
-
try {
|
|
18
|
-
const res = await fetch("https://registry.npmjs.org/@ahmedrowaihi/8n/latest", {
|
|
19
|
-
headers: { Accept: "application/json" },
|
|
20
|
-
signal: AbortSignal.timeout(3000),
|
|
21
|
-
});
|
|
22
|
-
if (!res.ok) return;
|
|
23
|
-
const { version: latest } = await res.json() as { version: string };
|
|
24
|
-
const current = __CLI_VERSION__;
|
|
25
|
-
if (latest !== current) {
|
|
26
|
-
console.log(
|
|
27
|
-
pc.yellow("⚠") + pc.dim(` new version available: `) +
|
|
28
|
-
pc.cyan(latest) + pc.dim(` (current: ${current}) — run `) +
|
|
29
|
-
pc.cyan("npm i -g @ahmedrowaihi/8n") + pc.dim(" to update"),
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
} catch {
|
|
33
|
-
// ignore — network may be unavailable
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export function syncPublicDir(projectDir: string): void {
|
|
38
|
-
const src = join(projectDir, "public");
|
|
39
|
-
if (!existsSync(src)) return;
|
|
40
|
-
cpSync(src, join(getPackageRoot(), "public", "_assets"), { recursive: true, force: true });
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export function watchPublicDir(projectDir: string): void {
|
|
44
|
-
const src = join(projectDir, "public");
|
|
45
|
-
if (!existsSync(src)) return;
|
|
46
|
-
watch(src, { recursive: true }, () => {
|
|
47
|
-
cpSync(src, join(getPackageRoot(), "public", "_assets"), { recursive: true, force: true });
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export function getNextBin(): string {
|
|
52
|
-
return join(getPackageRoot(), "node_modules", ".bin", "next");
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
export async function resolveProject() {
|
|
56
|
-
const config = await resolveConfig();
|
|
57
|
-
const contentDir = resolve(process.cwd(), config.content ?? "./content");
|
|
58
|
-
return { config, contentDir };
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export async function runNext(cmd: string, env: NodeJS.ProcessEnv): Promise<void> {
|
|
62
|
-
await x(getNextBin(), [cmd], {
|
|
63
|
-
nodeOptions: { cwd: getPackageRoot(), stdio: "inherit", env },
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export interface BuildEnvOptions {
|
|
68
|
-
config: DocsConfig;
|
|
69
|
-
contentDir: string;
|
|
70
|
-
staticExport?: boolean;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
const adapterPath = join(dirname(fileURLToPath(import.meta.url)), "adapter.cjs");
|
|
74
|
-
|
|
75
|
-
export function buildEnv({ config, contentDir, staticExport = false }: BuildEnvOptions): NodeJS.ProcessEnv {
|
|
76
|
-
const ghRepo = process.env.GITHUB_REPOSITORY;
|
|
77
|
-
const ghServer = process.env.GITHUB_SERVER_URL ?? "https://github.com";
|
|
78
|
-
const ghPagesUrl = ghRepo ? `${ghServer}/${ghRepo}` : undefined;
|
|
79
|
-
const ghPagesBasePath = ghRepo ? `/${ghRepo.split("/")[1]}` : undefined;
|
|
80
|
-
|
|
81
|
-
return {
|
|
82
|
-
...process.env,
|
|
83
|
-
CONTENT_DIR: contentDir,
|
|
84
|
-
LOCALES: (config.locales ?? ["en"]).join(","),
|
|
85
|
-
NEXT_PUBLIC_SITE_NAME: config.siteName ?? "Docs",
|
|
86
|
-
NEXT_PUBLIC_GITHUB_REPO: config.github?.repo ?? ghPagesUrl,
|
|
87
|
-
SECTIONS: JSON.stringify(config.sections ?? {}),
|
|
88
|
-
NEXT_PUBLIC_NAV_LINKS: JSON.stringify(config.nav?.links ?? []),
|
|
89
|
-
NEXT_PUBLIC_ANIMATIONS: config.animations === false ? "false" : "true",
|
|
90
|
-
NEXT_BASE_PATH: config.basePath ?? ghPagesBasePath ?? "",
|
|
91
|
-
NEXT_STATIC_EXPORT: staticExport ? "true" : "false",
|
|
92
|
-
NEXT_ADAPTER_PATH: adapterPath,
|
|
93
|
-
DOCS_PROJECT_DIR: process.cwd(),
|
|
94
|
-
};
|
|
95
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|