jamdesk 1.0.0
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/LICENSE +21 -0
- package/README.md +323 -0
- package/bin/jamdesk.js +76 -0
- package/dist/__tests__/integration/deprecated-components.integration.test.d.ts +8 -0
- package/dist/__tests__/integration/deprecated-components.integration.test.d.ts.map +1 -0
- package/dist/__tests__/integration/deprecated-components.integration.test.js +165 -0
- package/dist/__tests__/integration/deprecated-components.integration.test.js.map +1 -0
- package/dist/__tests__/integration/migrate.integration.test.d.ts +2 -0
- package/dist/__tests__/integration/migrate.integration.test.d.ts.map +1 -0
- package/dist/__tests__/integration/migrate.integration.test.js +64 -0
- package/dist/__tests__/integration/migrate.integration.test.js.map +1 -0
- package/dist/__tests__/integration/prepublish.integration.test.d.ts +2 -0
- package/dist/__tests__/integration/prepublish.integration.test.d.ts.map +1 -0
- package/dist/__tests__/integration/prepublish.integration.test.js +27 -0
- package/dist/__tests__/integration/prepublish.integration.test.js.map +1 -0
- package/dist/__tests__/integration/validate.integration.test.d.ts +2 -0
- package/dist/__tests__/integration/validate.integration.test.d.ts.map +1 -0
- package/dist/__tests__/integration/validate.integration.test.js +56 -0
- package/dist/__tests__/integration/validate.integration.test.js.map +1 -0
- package/dist/__tests__/unit/deploy-templates.test.d.ts +2 -0
- package/dist/__tests__/unit/deploy-templates.test.d.ts.map +1 -0
- package/dist/__tests__/unit/deploy-templates.test.js +124 -0
- package/dist/__tests__/unit/deploy-templates.test.js.map +1 -0
- package/dist/__tests__/unit/deprecated-components-sync.test.d.ts +2 -0
- package/dist/__tests__/unit/deprecated-components-sync.test.d.ts.map +1 -0
- package/dist/__tests__/unit/deprecated-components-sync.test.js +69 -0
- package/dist/__tests__/unit/deprecated-components-sync.test.js.map +1 -0
- package/dist/__tests__/unit/deps-sync.test.d.ts +14 -0
- package/dist/__tests__/unit/deps-sync.test.d.ts.map +1 -0
- package/dist/__tests__/unit/deps-sync.test.js +166 -0
- package/dist/__tests__/unit/deps-sync.test.js.map +1 -0
- package/dist/__tests__/unit/docs-config.test.d.ts +2 -0
- package/dist/__tests__/unit/docs-config.test.d.ts.map +1 -0
- package/dist/__tests__/unit/docs-config.test.js +288 -0
- package/dist/__tests__/unit/docs-config.test.js.map +1 -0
- package/dist/__tests__/unit/errors.test.d.ts +2 -0
- package/dist/__tests__/unit/errors.test.d.ts.map +1 -0
- package/dist/__tests__/unit/errors.test.js +27 -0
- package/dist/__tests__/unit/errors.test.js.map +1 -0
- package/dist/__tests__/unit/extract-hooks.test.d.ts +5 -0
- package/dist/__tests__/unit/extract-hooks.test.d.ts.map +1 -0
- package/dist/__tests__/unit/extract-hooks.test.js +205 -0
- package/dist/__tests__/unit/extract-hooks.test.js.map +1 -0
- package/dist/__tests__/unit/frontmatter-sync.test.d.ts +8 -0
- package/dist/__tests__/unit/frontmatter-sync.test.d.ts.map +1 -0
- package/dist/__tests__/unit/frontmatter-sync.test.js +26 -0
- package/dist/__tests__/unit/frontmatter-sync.test.js.map +1 -0
- package/dist/__tests__/unit/mdx-validator.test.d.ts +2 -0
- package/dist/__tests__/unit/mdx-validator.test.d.ts.map +1 -0
- package/dist/__tests__/unit/mdx-validator.test.js +264 -0
- package/dist/__tests__/unit/mdx-validator.test.js.map +1 -0
- package/dist/__tests__/unit/migrate-convert.test.d.ts +2 -0
- package/dist/__tests__/unit/migrate-convert.test.d.ts.map +1 -0
- package/dist/__tests__/unit/migrate-convert.test.js +297 -0
- package/dist/__tests__/unit/migrate-convert.test.js.map +1 -0
- package/dist/__tests__/unit/migrate-detect.test.d.ts +2 -0
- package/dist/__tests__/unit/migrate-detect.test.d.ts.map +1 -0
- package/dist/__tests__/unit/migrate-detect.test.js +35 -0
- package/dist/__tests__/unit/migrate-detect.test.js.map +1 -0
- package/dist/__tests__/unit/migrate-mdx.test.d.ts +2 -0
- package/dist/__tests__/unit/migrate-mdx.test.d.ts.map +1 -0
- package/dist/__tests__/unit/migrate-mdx.test.js +158 -0
- package/dist/__tests__/unit/migrate-mdx.test.js.map +1 -0
- package/dist/__tests__/unit/openapi.test.d.ts +2 -0
- package/dist/__tests__/unit/openapi.test.d.ts.map +1 -0
- package/dist/__tests__/unit/openapi.test.js +52 -0
- package/dist/__tests__/unit/openapi.test.js.map +1 -0
- package/dist/__tests__/unit/package-config.test.d.ts +2 -0
- package/dist/__tests__/unit/package-config.test.d.ts.map +1 -0
- package/dist/__tests__/unit/package-config.test.js +63 -0
- package/dist/__tests__/unit/package-config.test.js.map +1 -0
- package/dist/__tests__/unit/port.test.d.ts +2 -0
- package/dist/__tests__/unit/port.test.d.ts.map +1 -0
- package/dist/__tests__/unit/port.test.js +20 -0
- package/dist/__tests__/unit/port.test.js.map +1 -0
- package/dist/__tests__/unit/vendored-sync.test.d.ts +14 -0
- package/dist/__tests__/unit/vendored-sync.test.d.ts.map +1 -0
- package/dist/__tests__/unit/vendored-sync.test.js +90 -0
- package/dist/__tests__/unit/vendored-sync.test.js.map +1 -0
- package/dist/commands/broken-links.d.ts +11 -0
- package/dist/commands/broken-links.d.ts.map +1 -0
- package/dist/commands/broken-links.js +95 -0
- package/dist/commands/broken-links.js.map +1 -0
- package/dist/commands/clean.d.ts +7 -0
- package/dist/commands/clean.d.ts.map +1 -0
- package/dist/commands/clean.js +59 -0
- package/dist/commands/clean.js.map +1 -0
- package/dist/commands/deploy/cloudflare.d.ts +12 -0
- package/dist/commands/deploy/cloudflare.d.ts.map +1 -0
- package/dist/commands/deploy/cloudflare.js +409 -0
- package/dist/commands/deploy/cloudflare.js.map +1 -0
- package/dist/commands/deploy/templates.d.ts +23 -0
- package/dist/commands/deploy/templates.d.ts.map +1 -0
- package/dist/commands/deploy/templates.js +179 -0
- package/dist/commands/deploy/templates.js.map +1 -0
- package/dist/commands/deploy/types.d.ts +19 -0
- package/dist/commands/deploy/types.d.ts.map +1 -0
- package/dist/commands/deploy/types.js +5 -0
- package/dist/commands/deploy/types.js.map +1 -0
- package/dist/commands/dev.d.ts +14 -0
- package/dist/commands/dev.d.ts.map +1 -0
- package/dist/commands/dev.js +817 -0
- package/dist/commands/dev.js.map +1 -0
- package/dist/commands/doctor.d.ts +7 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +159 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/init.d.ts +7 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +96 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/migrate/convert-mdx.d.ts +50 -0
- package/dist/commands/migrate/convert-mdx.d.ts.map +1 -0
- package/dist/commands/migrate/convert-mdx.js +108 -0
- package/dist/commands/migrate/convert-mdx.js.map +1 -0
- package/dist/commands/migrate/convert.d.ts +80 -0
- package/dist/commands/migrate/convert.d.ts.map +1 -0
- package/dist/commands/migrate/convert.js +158 -0
- package/dist/commands/migrate/convert.js.map +1 -0
- package/dist/commands/migrate/detect.d.ts +31 -0
- package/dist/commands/migrate/detect.d.ts.map +1 -0
- package/dist/commands/migrate/detect.js +62 -0
- package/dist/commands/migrate/detect.js.map +1 -0
- package/dist/commands/migrate/extract-hooks.d.ts +71 -0
- package/dist/commands/migrate/extract-hooks.d.ts.map +1 -0
- package/dist/commands/migrate/extract-hooks.js +473 -0
- package/dist/commands/migrate/extract-hooks.js.map +1 -0
- package/dist/commands/migrate/index.d.ts +17 -0
- package/dist/commands/migrate/index.d.ts.map +1 -0
- package/dist/commands/migrate/index.js +282 -0
- package/dist/commands/migrate/index.js.map +1 -0
- package/dist/commands/migrate/prompts.d.ts +22 -0
- package/dist/commands/migrate/prompts.d.ts.map +1 -0
- package/dist/commands/migrate/prompts.js +67 -0
- package/dist/commands/migrate/prompts.js.map +1 -0
- package/dist/commands/migrate/types.d.ts +22 -0
- package/dist/commands/migrate/types.d.ts.map +1 -0
- package/dist/commands/migrate/types.js +26 -0
- package/dist/commands/migrate/types.js.map +1 -0
- package/dist/commands/openapi-check.d.ts +11 -0
- package/dist/commands/openapi-check.d.ts.map +1 -0
- package/dist/commands/openapi-check.js +88 -0
- package/dist/commands/openapi-check.js.map +1 -0
- package/dist/commands/rename.d.ts +10 -0
- package/dist/commands/rename.d.ts.map +1 -0
- package/dist/commands/rename.js +125 -0
- package/dist/commands/rename.js.map +1 -0
- package/dist/commands/update.d.ts +10 -0
- package/dist/commands/update.d.ts.map +1 -0
- package/dist/commands/update.js +57 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/validate.d.ts +12 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +163 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +334 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/config.d.ts +7 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +18 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/deprecated-components.d.ts +72 -0
- package/dist/lib/deprecated-components.d.ts.map +1 -0
- package/dist/lib/deprecated-components.js +138 -0
- package/dist/lib/deprecated-components.js.map +1 -0
- package/dist/lib/deps.d.ts +17 -0
- package/dist/lib/deps.d.ts.map +1 -0
- package/dist/lib/deps.js +186 -0
- package/dist/lib/deps.js.map +1 -0
- package/dist/lib/docs-config.d.ts +67 -0
- package/dist/lib/docs-config.d.ts.map +1 -0
- package/dist/lib/docs-config.js +294 -0
- package/dist/lib/docs-config.js.map +1 -0
- package/dist/lib/errors.d.ts +23 -0
- package/dist/lib/errors.d.ts.map +1 -0
- package/dist/lib/errors.js +32 -0
- package/dist/lib/errors.js.map +1 -0
- package/dist/lib/frontmatter-utils.d.ts +25 -0
- package/dist/lib/frontmatter-utils.d.ts.map +1 -0
- package/dist/lib/frontmatter-utils.js +64 -0
- package/dist/lib/frontmatter-utils.js.map +1 -0
- package/dist/lib/mdx-validator.d.ts +27 -0
- package/dist/lib/mdx-validator.d.ts.map +1 -0
- package/dist/lib/mdx-validator.js +148 -0
- package/dist/lib/mdx-validator.js.map +1 -0
- package/dist/lib/navigation-validator.d.ts +31 -0
- package/dist/lib/navigation-validator.d.ts.map +1 -0
- package/dist/lib/navigation-validator.js +75 -0
- package/dist/lib/navigation-validator.js.map +1 -0
- package/dist/lib/normalize-config.d.ts +57 -0
- package/dist/lib/normalize-config.d.ts.map +1 -0
- package/dist/lib/normalize-config.js +63 -0
- package/dist/lib/normalize-config.js.map +1 -0
- package/dist/lib/openapi/cache.d.ts +40 -0
- package/dist/lib/openapi/cache.d.ts.map +1 -0
- package/dist/lib/openapi/cache.js +76 -0
- package/dist/lib/openapi/cache.js.map +1 -0
- package/dist/lib/openapi/errors.d.ts +36 -0
- package/dist/lib/openapi/errors.d.ts.map +1 -0
- package/dist/lib/openapi/errors.js +162 -0
- package/dist/lib/openapi/errors.js.map +1 -0
- package/dist/lib/openapi/index.d.ts +10 -0
- package/dist/lib/openapi/index.d.ts.map +1 -0
- package/dist/lib/openapi/index.js +12 -0
- package/dist/lib/openapi/index.js.map +1 -0
- package/dist/lib/openapi/types.d.ts +198 -0
- package/dist/lib/openapi/types.d.ts.map +1 -0
- package/dist/lib/openapi/types.js +8 -0
- package/dist/lib/openapi/types.js.map +1 -0
- package/dist/lib/openapi/validator.d.ts +45 -0
- package/dist/lib/openapi/validator.d.ts.map +1 -0
- package/dist/lib/openapi/validator.js +128 -0
- package/dist/lib/openapi/validator.js.map +1 -0
- package/dist/lib/openapi.d.ts +7 -0
- package/dist/lib/openapi.d.ts.map +1 -0
- package/dist/lib/openapi.js +7 -0
- package/dist/lib/openapi.js.map +1 -0
- package/dist/lib/output.d.ts +14 -0
- package/dist/lib/output.d.ts.map +1 -0
- package/dist/lib/output.js +19 -0
- package/dist/lib/output.js.map +1 -0
- package/dist/lib/path-security.d.ts +23 -0
- package/dist/lib/path-security.d.ts.map +1 -0
- package/dist/lib/path-security.js +35 -0
- package/dist/lib/path-security.js.map +1 -0
- package/dist/lib/port.d.ts +18 -0
- package/dist/lib/port.d.ts.map +1 -0
- package/dist/lib/port.js +65 -0
- package/dist/lib/port.js.map +1 -0
- package/dist/lib/spinner.d.ts +4 -0
- package/dist/lib/spinner.d.ts.map +1 -0
- package/dist/lib/spinner.js +16 -0
- package/dist/lib/spinner.js.map +1 -0
- package/dist/lib/version.d.ts +2 -0
- package/dist/lib/version.d.ts.map +1 -0
- package/dist/lib/version.js +49 -0
- package/dist/lib/version.js.map +1 -0
- package/dist/utils/update-checker.d.ts +34 -0
- package/dist/utils/update-checker.d.ts.map +1 -0
- package/dist/utils/update-checker.js +142 -0
- package/dist/utils/update-checker.js.map +1 -0
- package/package.json +125 -0
- package/templates/docs.json +11 -0
- package/templates/introduction.mdx +19 -0
- package/templates/quickstart.mdx +20 -0
- package/vendored/app/[[...slug]]/error.tsx +103 -0
- package/vendored/app/[[...slug]]/page.tsx +690 -0
- package/vendored/app/api/assets/[...path]/route.ts +78 -0
- package/vendored/app/api/ev/route.ts +61 -0
- package/vendored/app/api/isr-health/route.ts +66 -0
- package/vendored/app/api/mcp/[project]/route.ts +435 -0
- package/vendored/app/api/og/route.tsx +167 -0
- package/vendored/app/api/r2/[project]/[...path]/route.ts +214 -0
- package/vendored/app/api/revalidate/route.ts +76 -0
- package/vendored/app/globals.css +37 -0
- package/vendored/app/layout.tsx +571 -0
- package/vendored/app/not-found.tsx +47 -0
- package/vendored/components/CodeBlockCopyButton.tsx +146 -0
- package/vendored/components/HeaderLinkCopy.tsx +135 -0
- package/vendored/components/errors/NotFoundContent.tsx +147 -0
- package/vendored/components/layout/LayoutWrapper.tsx +128 -0
- package/vendored/components/mdx/Accordion.tsx +91 -0
- package/vendored/components/mdx/ApiCodePanel.tsx +51 -0
- package/vendored/components/mdx/ApiEndpoint.tsx +104 -0
- package/vendored/components/mdx/ApiPage.tsx +379 -0
- package/vendored/components/mdx/Badge.tsx +169 -0
- package/vendored/components/mdx/Callouts.tsx +140 -0
- package/vendored/components/mdx/Card.tsx +214 -0
- package/vendored/components/mdx/CodeGroup.tsx +136 -0
- package/vendored/components/mdx/Color.tsx +244 -0
- package/vendored/components/mdx/Columns.tsx +37 -0
- package/vendored/components/mdx/Expandable.tsx +37 -0
- package/vendored/components/mdx/Frame.tsx +51 -0
- package/vendored/components/mdx/Icon.tsx +132 -0
- package/vendored/components/mdx/Latex.tsx +75 -0
- package/vendored/components/mdx/MDXComponents.tsx +414 -0
- package/vendored/components/mdx/Mermaid.tsx +35 -0
- package/vendored/components/mdx/MermaidInner.tsx +342 -0
- package/vendored/components/mdx/OpenApiEndpoint.tsx +971 -0
- package/vendored/components/mdx/Panel.tsx +26 -0
- package/vendored/components/mdx/PanelWrapper.tsx +100 -0
- package/vendored/components/mdx/ParamField.tsx +75 -0
- package/vendored/components/mdx/RequestExample.tsx +91 -0
- package/vendored/components/mdx/ResponseExample.tsx +145 -0
- package/vendored/components/mdx/ResponseField.tsx +109 -0
- package/vendored/components/mdx/Steps.tsx +173 -0
- package/vendored/components/mdx/Table.tsx +352 -0
- package/vendored/components/mdx/Tabs.tsx +147 -0
- package/vendored/components/mdx/Tile.tsx +127 -0
- package/vendored/components/mdx/Tooltip.tsx +111 -0
- package/vendored/components/mdx/Tree.tsx +484 -0
- package/vendored/components/mdx/Update.tsx +90 -0
- package/vendored/components/mdx/View.tsx +354 -0
- package/vendored/components/mdx/YouTube.tsx +35 -0
- package/vendored/components/mdx/ZoomableImage.tsx +83 -0
- package/vendored/components/navigation/Breadcrumb.tsx +241 -0
- package/vendored/components/navigation/DefaultLogo.tsx +81 -0
- package/vendored/components/navigation/Header.tsx +512 -0
- package/vendored/components/navigation/LanguageSelector.tsx +249 -0
- package/vendored/components/navigation/PageNavigation.tsx +174 -0
- package/vendored/components/navigation/Sidebar.tsx +713 -0
- package/vendored/components/navigation/SocialFooter.tsx +186 -0
- package/vendored/components/navigation/TableOfContents.tsx +435 -0
- package/vendored/components/navigation/TabsNav.tsx +182 -0
- package/vendored/components/search/LazySearchModal.tsx +19 -0
- package/vendored/components/search/SearchModal.tsx +573 -0
- package/vendored/components/snippets/ProjectSnippets.tsx +4 -0
- package/vendored/components/theme/ThemeProvider.tsx +31 -0
- package/vendored/components/theme/ThemeToggle.tsx +134 -0
- package/vendored/components/ui/CodePanel.tsx +517 -0
- package/vendored/components/ui/CodePanelModal.tsx +342 -0
- package/vendored/contexts/TabSyncContext.tsx +30 -0
- package/vendored/hooks/useFocusTrap.ts +42 -0
- package/vendored/hooks/useHashNavigation.ts +39 -0
- package/vendored/hooks/useShikiHighlight.ts +101 -0
- package/vendored/lib/analytics-client.ts +77 -0
- package/vendored/lib/build/cache.ts +138 -0
- package/vendored/lib/build/error-parser.ts +690 -0
- package/vendored/lib/build/estimation.ts +113 -0
- package/vendored/lib/build/index.ts +17 -0
- package/vendored/lib/build/page-file-map.ts +48 -0
- package/vendored/lib/build/r2-upload.ts +179 -0
- package/vendored/lib/cache-keys.ts +117 -0
- package/vendored/lib/code-utils.ts +42 -0
- package/vendored/lib/content-loader.ts +176 -0
- package/vendored/lib/deprecated-components.ts +185 -0
- package/vendored/lib/docs-isr.ts +180 -0
- package/vendored/lib/docs-types.ts +874 -0
- package/vendored/lib/docs.ts +203 -0
- package/vendored/lib/domain-helpers.ts +107 -0
- package/vendored/lib/email-notifier.ts +102 -0
- package/vendored/lib/email-templates/build-failure.tsx +193 -0
- package/vendored/lib/email-templates/components/base-layout.tsx +150 -0
- package/vendored/lib/email-templates/components/error-box.tsx +88 -0
- package/vendored/lib/email-templates/components/info-row.tsx +63 -0
- package/vendored/lib/email-templates/index.ts +13 -0
- package/vendored/lib/empty-polyfill.js +3 -0
- package/vendored/lib/extract-highlights.ts +124 -0
- package/vendored/lib/fonts.ts +227 -0
- package/vendored/lib/frontmatter-utils.ts +77 -0
- package/vendored/lib/fs-utils.ts +20 -0
- package/vendored/lib/git-utils.ts +87 -0
- package/vendored/lib/health-checks.ts +224 -0
- package/vendored/lib/icon-utils.ts +492 -0
- package/vendored/lib/infer-page-type.ts +14 -0
- package/vendored/lib/isr-build-executor.ts +185 -0
- package/vendored/lib/language-icons.ts +152 -0
- package/vendored/lib/language-utils.ts +338 -0
- package/vendored/lib/latex-config.ts +64 -0
- package/vendored/lib/link-prefix-context.tsx +32 -0
- package/vendored/lib/logger.ts +63 -0
- package/vendored/lib/mcp-search.ts +255 -0
- package/vendored/lib/mdx-inline-components.ts +155 -0
- package/vendored/lib/mdx.ts +100 -0
- package/vendored/lib/middleware-helpers.ts +519 -0
- package/vendored/lib/navigation-resolver.ts +621 -0
- package/vendored/lib/navigation-utils.ts +103 -0
- package/vendored/lib/normalize-config.ts +94 -0
- package/vendored/lib/openapi/cache.ts +92 -0
- package/vendored/lib/openapi/code-examples.ts +389 -0
- package/vendored/lib/openapi/errors.ts +253 -0
- package/vendored/lib/openapi/generator.ts +230 -0
- package/vendored/lib/openapi/index.ts +84 -0
- package/vendored/lib/openapi/parser.ts +474 -0
- package/vendored/lib/openapi/types.ts +232 -0
- package/vendored/lib/openapi/validator.ts +156 -0
- package/vendored/lib/openapi-isr.ts +121 -0
- package/vendored/lib/page-isr-helpers.ts +137 -0
- package/vendored/lib/path-safety.ts +130 -0
- package/vendored/lib/paths.ts +35 -0
- package/vendored/lib/preprocess-mdx.ts +951 -0
- package/vendored/lib/process-mdx-with-exports.ts +75 -0
- package/vendored/lib/project-resolver.ts +165 -0
- package/vendored/lib/r2-content.ts +60 -0
- package/vendored/lib/r2-manifest.ts +84 -0
- package/vendored/lib/recent-searches.ts +41 -0
- package/vendored/lib/recma-compound-components.ts +84 -0
- package/vendored/lib/redirect-compiler.ts +160 -0
- package/vendored/lib/redirect-matcher.ts +296 -0
- package/vendored/lib/redis.ts +23 -0
- package/vendored/lib/rehype-class-to-classname.ts +31 -0
- package/vendored/lib/rehype-code-meta.ts +275 -0
- package/vendored/lib/rehype-nozoom-to-data.ts +45 -0
- package/vendored/lib/remark-extract-exports.ts +104 -0
- package/vendored/lib/resilience.ts +260 -0
- package/vendored/lib/revalidation-helpers.ts +200 -0
- package/vendored/lib/revalidation-trigger.ts +150 -0
- package/vendored/lib/screenshot-capture.ts +229 -0
- package/vendored/lib/search-client.ts +91 -0
- package/vendored/lib/search-suggestions.ts +38 -0
- package/vendored/lib/search.ts +158 -0
- package/vendored/lib/seo.ts +264 -0
- package/vendored/lib/shiki-client.ts +131 -0
- package/vendored/lib/shiki-config.ts +289 -0
- package/vendored/lib/shiki-css-theme.ts +46 -0
- package/vendored/lib/shiki-highlighter.ts +62 -0
- package/vendored/lib/shiki-transformers.ts +337 -0
- package/vendored/lib/slack-notifier.ts +248 -0
- package/vendored/lib/snippet-compiler-isr.ts +114 -0
- package/vendored/lib/snippet-loader-isr.ts +276 -0
- package/vendored/lib/static-artifacts.ts +375 -0
- package/vendored/lib/static-file-route.ts +72 -0
- package/vendored/lib/tracking-script.ts +19 -0
- package/vendored/lib/typography-config.ts +42 -0
- package/vendored/lib/validate-config.ts +268 -0
- package/vendored/next.config.js +45 -0
- package/vendored/postcss.config.js +6 -0
- package/vendored/schema/README.md +28 -0
- package/vendored/schema/docs-schema.json +4631 -0
- package/vendored/scripts/build-project.cjs +174 -0
- package/vendored/scripts/build-search-index.cjs +347 -0
- package/vendored/scripts/compile-snippets.cjs +488 -0
- package/vendored/scripts/copy-files.cjs +295 -0
- package/vendored/scripts/dev-project.cjs +534 -0
- package/vendored/scripts/enhance-navigation.cjs +354 -0
- package/vendored/scripts/validate-links.cjs +423 -0
- package/vendored/shared/constants.ts +6 -0
- package/vendored/shared/index.ts +19 -0
- package/vendored/shared/logger.ts +62 -0
- package/vendored/shared/memory-monitor.ts +190 -0
- package/vendored/shared/navigation-validator.ts +101 -0
- package/vendored/shared/path-security.ts +39 -0
- package/vendored/shared/status-reporter.ts +199 -0
- package/vendored/shared/timer.ts +51 -0
- package/vendored/shared/types.ts +102 -0
- package/vendored/tailwind.config.ts +39 -0
- package/vendored/themes/base.css +1311 -0
- package/vendored/themes/index.ts +119 -0
- package/vendored/themes/jam/variables.css +835 -0
- package/vendored/themes/nebula/variables.css +282 -0
- package/vendored/themes/pulsar/variables.css +1009 -0
- package/vendored/themes/types.ts +89 -0
- package/vendored/tsconfig.json +48 -0
|
@@ -0,0 +1,690 @@
|
|
|
1
|
+
import type { ErrorDetails } from '../../shared/types.js';
|
|
2
|
+
import { DEPRECATED_COMPONENTS } from '../deprecated-components.js';
|
|
3
|
+
|
|
4
|
+
/** Format: ERR-XXXXXXXX (first 8 chars of buildId, uppercase) */
|
|
5
|
+
export function generateErrorRef(buildId: string): string {
|
|
6
|
+
return `ERR-${buildId.substring(0, 8).toUpperCase()}`;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Extract file path from error output using various patterns.
|
|
11
|
+
* @param pageToFileMap - Optional mapping of URL paths to MDX files
|
|
12
|
+
*/
|
|
13
|
+
export function extractErrorSource(
|
|
14
|
+
output: string,
|
|
15
|
+
pageToFileMap?: Record<string, string>
|
|
16
|
+
): {
|
|
17
|
+
file?: string;
|
|
18
|
+
line?: number;
|
|
19
|
+
component?: string;
|
|
20
|
+
} {
|
|
21
|
+
const result: { file?: string; line?: number; component?: string } = {};
|
|
22
|
+
|
|
23
|
+
// Pattern 1: "Error occurred prerendering page "/path""
|
|
24
|
+
const prerenderMatch = output.match(/Error occurred prerendering page "([^"]+)"/);
|
|
25
|
+
if (prerenderMatch) {
|
|
26
|
+
const urlPath = prerenderMatch[1];
|
|
27
|
+
// Try to map URL path to actual file
|
|
28
|
+
if (pageToFileMap && pageToFileMap[urlPath]) {
|
|
29
|
+
result.file = pageToFileMap[urlPath];
|
|
30
|
+
} else {
|
|
31
|
+
result.file = urlPath;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Pattern 2: "Expected component `ComponentName` to be defined"
|
|
36
|
+
const missingComponentMatch = output.match(/Expected component `(\w+)` to be defined/);
|
|
37
|
+
if (missingComponentMatch) {
|
|
38
|
+
result.component = missingComponentMatch[1];
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Pattern 2: File path with line number (e.g., "./content/docs/intro.mdx:15:10")
|
|
42
|
+
const fileLineMatch = output.match(
|
|
43
|
+
/(?:\.\/|\/)?(?:content\/)?([^\s:]+\.(?:mdx?|tsx?|jsx?)):(\d+)/
|
|
44
|
+
);
|
|
45
|
+
if (fileLineMatch) {
|
|
46
|
+
result.file = result.file || fileLineMatch[1];
|
|
47
|
+
result.line = parseInt(fileLineMatch[2], 10);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Pattern 3: "in /path/to/file" or "at /path/to/file"
|
|
51
|
+
const inFileMatch = output.match(
|
|
52
|
+
/(?:in|at)\s+(?:\.\/|\/)?([^\s:\n]+\.(?:mdx?|tsx?|jsx?))/i
|
|
53
|
+
);
|
|
54
|
+
if (inFileMatch && !result.file) {
|
|
55
|
+
result.file = inFileMatch[1];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Pattern 4: MDX component from build output "components/mdx/ComponentName.tsx"
|
|
59
|
+
const componentMatch = output.match(/components\/mdx\/(\w+)\.tsx/);
|
|
60
|
+
if (componentMatch) {
|
|
61
|
+
result.component = componentMatch[1];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Pattern 5: "Compiling /path/to/page..." followed by error
|
|
65
|
+
const compilingMatch = output.match(/Compiling\s+([^\s]+\.(?:mdx?|tsx?|jsx?))/);
|
|
66
|
+
if (compilingMatch && !result.file) {
|
|
67
|
+
result.file = compilingMatch[1];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Pattern 6: MDX content file from docs directory
|
|
71
|
+
const docsFileMatch = output.match(/\/docs\/([^\s:\n]+\.mdx?)/);
|
|
72
|
+
if (docsFileMatch && !result.file) {
|
|
73
|
+
result.file = docsFileMatch[1];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return result;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export function formatErrorLocation(source: {
|
|
80
|
+
file?: string;
|
|
81
|
+
line?: number;
|
|
82
|
+
component?: string;
|
|
83
|
+
}): string {
|
|
84
|
+
const parts: string[] = [];
|
|
85
|
+
|
|
86
|
+
if (source.file) {
|
|
87
|
+
parts.push(`File: ${source.file}${source.line ? `:${source.line}` : ''}`);
|
|
88
|
+
}
|
|
89
|
+
if (source.component) {
|
|
90
|
+
parts.push(`Component: <${source.component}>`);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
return parts.join('\n');
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Parse build error output into user-friendly error information.
|
|
98
|
+
* @param pageToFileMap - Optional mapping of URL paths to MDX files
|
|
99
|
+
*/
|
|
100
|
+
export function parseErrorDetails(
|
|
101
|
+
output: string,
|
|
102
|
+
message: string,
|
|
103
|
+
phase: string,
|
|
104
|
+
pageToFileMap?: Record<string, string>
|
|
105
|
+
): ErrorDetails {
|
|
106
|
+
const lowerOutput = output.toLowerCase();
|
|
107
|
+
|
|
108
|
+
// Extract error source information upfront - used by multiple error types
|
|
109
|
+
const errorSource = extractErrorSource(output, pageToFileMap);
|
|
110
|
+
|
|
111
|
+
// Configuration validation errors (from validate phase)
|
|
112
|
+
if (message.includes('Missing docs.json') || message.includes('Invalid docs.json')) {
|
|
113
|
+
return {
|
|
114
|
+
type: 'config_error',
|
|
115
|
+
message: message.split('. ')[0] + '.', // Get first sentence with period
|
|
116
|
+
details: message,
|
|
117
|
+
suggestion:
|
|
118
|
+
'Check your repository has a valid docs.json file in the root directory.\n\n' +
|
|
119
|
+
'Required fields:\n' +
|
|
120
|
+
'• "name": Your site name\n' +
|
|
121
|
+
'• "theme": One of "jam", "nebula", or "pulsar"\n' +
|
|
122
|
+
'• "colors": { "primary": "#hexcolor" }\n' +
|
|
123
|
+
'• "navigation": { "anchors": [...] } or { "groups": [...] }\n\n' +
|
|
124
|
+
'Tip: Use JSON5 format to add comments to your docs.json.\n' +
|
|
125
|
+
'See https://www.jamdesk.com/docs/configuration for examples.',
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Array navigation format error
|
|
130
|
+
if (message.includes('Array of groups is not supported')) {
|
|
131
|
+
return {
|
|
132
|
+
type: 'config_error',
|
|
133
|
+
message: 'Array of groups is not supported',
|
|
134
|
+
details: message,
|
|
135
|
+
suggestion:
|
|
136
|
+
'Your docs.json uses an array for navigation.\n\n' +
|
|
137
|
+
'Please use the hierarchical object format:\n\n' +
|
|
138
|
+
'// Not supported:\n' +
|
|
139
|
+
'"navigation": [{ "group": "...", "pages": [...] }]\n\n' +
|
|
140
|
+
'// Correct format:\n' +
|
|
141
|
+
'"navigation": {\n' +
|
|
142
|
+
' "groups": [{ "group": "Getting Started", "pages": ["intro"] }]\n' +
|
|
143
|
+
'}\n\n' +
|
|
144
|
+
'See https://www.jamdesk.com/docs/navigation for details.',
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// Navigation configuration error
|
|
149
|
+
if (
|
|
150
|
+
output.includes('navigation.map is not a function') ||
|
|
151
|
+
(output.includes('navigation') && output.includes('is not iterable'))
|
|
152
|
+
) {
|
|
153
|
+
const fileMatch = output.match(/Error occurred prerendering page "([^"]+)"/);
|
|
154
|
+
const file = fileMatch ? fileMatch[1] : 'unknown page';
|
|
155
|
+
return {
|
|
156
|
+
type: 'navigation_config',
|
|
157
|
+
message: 'Invalid navigation configuration',
|
|
158
|
+
details:
|
|
159
|
+
`The navigation structure in your configuration file is malformed. ` +
|
|
160
|
+
`Error occurred while building: ${file}`,
|
|
161
|
+
suggestion:
|
|
162
|
+
'Check your docs.json configuration file. The "navigation" field ' +
|
|
163
|
+
'must be an object with "anchors", "tabs", or "groups".\n\n' +
|
|
164
|
+
'Example:\n' +
|
|
165
|
+
'"navigation": {\n' +
|
|
166
|
+
' "anchors": [{ "anchor": "Docs", "groups": [...] }]\n' +
|
|
167
|
+
'}\n\n' +
|
|
168
|
+
'See https://www.jamdesk.com/docs/navigation for details.',
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// Icon-related errors (LucideIcon casting issues)
|
|
173
|
+
if (
|
|
174
|
+
output.includes("Property 'Icon' is incompatible") ||
|
|
175
|
+
output.includes('LucideIcon') ||
|
|
176
|
+
(output.includes('lucide-react') && lowerOutput.includes('type error'))
|
|
177
|
+
) {
|
|
178
|
+
// Try to find which icon name caused the issue
|
|
179
|
+
const iconMatch = output.match(/Property '(\w+)' is incompatible/);
|
|
180
|
+
const iconName = iconMatch?.[1];
|
|
181
|
+
const file = errorSource.file;
|
|
182
|
+
const line = errorSource.line;
|
|
183
|
+
|
|
184
|
+
let details = iconName
|
|
185
|
+
? `The icon "${iconName}" doesn't exist or is not supported.`
|
|
186
|
+
: 'One of the icons used in your content is not available.';
|
|
187
|
+
|
|
188
|
+
if (file) {
|
|
189
|
+
const lineInfo = line ? `:${line}` : '';
|
|
190
|
+
details += `\n\nLocation: ${file}${lineInfo}`;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
let suggestion = '';
|
|
194
|
+
if (file) {
|
|
195
|
+
suggestion = `Check this file: ${file}${line ? `:${line}` : ''}\n\n`;
|
|
196
|
+
}
|
|
197
|
+
suggestion +=
|
|
198
|
+
"Check that you're using a valid icon name.\n\n" +
|
|
199
|
+
'Icons should be specified in kebab-case, like:\n' +
|
|
200
|
+
'• icon="arrow-right"\n' +
|
|
201
|
+
'• icon="check-circle"\n' +
|
|
202
|
+
'• icon="book-open"\n\n' +
|
|
203
|
+
'See https://www.jamdesk.com/docs/icons for the full list of available icons.';
|
|
204
|
+
|
|
205
|
+
return {
|
|
206
|
+
type: 'icon_error',
|
|
207
|
+
message: iconName ? `Icon "${iconName}" is not available` : 'Invalid icon specified',
|
|
208
|
+
details: details,
|
|
209
|
+
suggestion: suggestion,
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
// Component/prop errors (from Next.js build)
|
|
214
|
+
if (lowerOutput.includes('type error') || output.includes('Type error')) {
|
|
215
|
+
// Check for missing/invalid props
|
|
216
|
+
const propertyMatch = output.match(
|
|
217
|
+
/Property '(\w+)' is missing|Property '(\w+)' does not exist/i
|
|
218
|
+
);
|
|
219
|
+
|
|
220
|
+
const property = propertyMatch?.[1] || propertyMatch?.[2];
|
|
221
|
+
const component = errorSource.component;
|
|
222
|
+
const file = errorSource.file;
|
|
223
|
+
const line = errorSource.line;
|
|
224
|
+
|
|
225
|
+
// Determine the user-friendly message
|
|
226
|
+
let userMessage = 'Build failed due to a configuration issue';
|
|
227
|
+
let details = "There's an issue with one of the components in your documentation.";
|
|
228
|
+
|
|
229
|
+
if (property && component) {
|
|
230
|
+
userMessage = `Invalid configuration for <${component}> component`;
|
|
231
|
+
details = `The "${property}" prop is missing or incorrect.`;
|
|
232
|
+
} else if (property) {
|
|
233
|
+
userMessage = `Missing or invalid prop: "${property}"`;
|
|
234
|
+
details = 'A required prop is missing or has an invalid value.';
|
|
235
|
+
} else if (component) {
|
|
236
|
+
userMessage = `Issue with <${component}> component`;
|
|
237
|
+
details = "There's a configuration problem with this component.";
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
// Always include file location if available
|
|
241
|
+
if (file) {
|
|
242
|
+
const lineInfo = line ? `:${line}` : '';
|
|
243
|
+
details += `\n\nLocation: ${file}${lineInfo}`;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
// Build a helpful suggestion based on what we know
|
|
247
|
+
let suggestion =
|
|
248
|
+
'Check your documentation files for:\n' +
|
|
249
|
+
'• Missing required props on components\n' +
|
|
250
|
+
'• Typos in component names or props\n' +
|
|
251
|
+
"• Using components that aren't available\n\n";
|
|
252
|
+
|
|
253
|
+
if (file) {
|
|
254
|
+
suggestion += `Start by checking: ${file}\n\n`;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
suggestion +=
|
|
258
|
+
'See https://www.jamdesk.com/docs/components for available components and their usage.';
|
|
259
|
+
|
|
260
|
+
return {
|
|
261
|
+
type: 'component_error',
|
|
262
|
+
message: userMessage,
|
|
263
|
+
details: details,
|
|
264
|
+
suggestion: suggestion,
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// Module not found
|
|
269
|
+
if (lowerOutput.includes('module not found') || lowerOutput.includes('cannot find module')) {
|
|
270
|
+
const moduleMatch = output.match(
|
|
271
|
+
/(?:Module not found|Cannot find module)[:\s]+['"]?([^'">\n]+)/i
|
|
272
|
+
);
|
|
273
|
+
const moduleName = moduleMatch ? moduleMatch[1] : 'unknown module';
|
|
274
|
+
return {
|
|
275
|
+
type: 'module_not_found',
|
|
276
|
+
message: `Missing dependency: ${moduleName}`,
|
|
277
|
+
details: `A required module "${moduleName}" could not be found during the build.`,
|
|
278
|
+
suggestion:
|
|
279
|
+
'Make sure all dependencies are listed in your package.json. ' +
|
|
280
|
+
'If using a local import, check that the file path is correct and the file exists.',
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
// Syntax error in MDX/JSX
|
|
285
|
+
if (
|
|
286
|
+
lowerOutput.includes('syntax error') ||
|
|
287
|
+
lowerOutput.includes('unexpected token') ||
|
|
288
|
+
lowerOutput.includes('parsing error')
|
|
289
|
+
) {
|
|
290
|
+
const file = errorSource.file || 'your content files';
|
|
291
|
+
const line = errorSource.line;
|
|
292
|
+
const lineInfo = line ? ` at line ${line}` : '';
|
|
293
|
+
|
|
294
|
+
let suggestion =
|
|
295
|
+
'Check your MDX files for:\n' +
|
|
296
|
+
'• Unclosed JSX tags (every <Tag> needs </Tag> or be self-closing)\n' +
|
|
297
|
+
'• Invalid frontmatter YAML (must be between --- markers)\n' +
|
|
298
|
+
'• Special characters that need escaping (< > { })';
|
|
299
|
+
|
|
300
|
+
if (errorSource.file) {
|
|
301
|
+
suggestion =
|
|
302
|
+
`Start by checking: ${errorSource.file}${line ? `:${line}` : ''}\n\n` + suggestion;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
return {
|
|
306
|
+
type: 'syntax_error',
|
|
307
|
+
message: `Syntax error in ${errorSource.file ? errorSource.file : 'content'}`,
|
|
308
|
+
details:
|
|
309
|
+
`There's a syntax error${lineInfo} in ${file}. This could be invalid MDX, ` +
|
|
310
|
+
'unclosed tags, or malformed frontmatter.',
|
|
311
|
+
suggestion: suggestion,
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
// MDX compilation error from next-mdx-remote (must be early, before frontmatter check)
|
|
316
|
+
// Pattern: "[next-mdx-remote] error compiling MDX:" followed by specific error
|
|
317
|
+
// Examples:
|
|
318
|
+
// "Expected a closing tag for `<Blah>` (11:1-11:7)"
|
|
319
|
+
// "Expected the closing tag `</Card>`"
|
|
320
|
+
if (output.includes('[next-mdx-remote]') || output.includes('error compiling MDX')) {
|
|
321
|
+
// Pattern 1: "Expected a closing tag for `<ComponentName>` (line:col-line:col)"
|
|
322
|
+
const closingTagForMatch = output.match(
|
|
323
|
+
/Expected a closing tag for `<(\w+)>`\s*\((\d+):(\d+)/
|
|
324
|
+
);
|
|
325
|
+
if (closingTagForMatch) {
|
|
326
|
+
const tagName = closingTagForMatch[1];
|
|
327
|
+
const lineNum = parseInt(closingTagForMatch[2], 10);
|
|
328
|
+
const file = errorSource.file;
|
|
329
|
+
|
|
330
|
+
let details = `The <${tagName}> component is missing a closing tag.`;
|
|
331
|
+
if (file) {
|
|
332
|
+
details += `\n\nLocation: ${file}:${lineNum}`;
|
|
333
|
+
} else {
|
|
334
|
+
details += `\n\nLine: ${lineNum}`;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
let suggestion = `Add a closing </${tagName}> tag after your content, or make it self-closing <${tagName} />.\n\n`;
|
|
338
|
+
if (file) {
|
|
339
|
+
suggestion += `Check: ${file}:${lineNum}\n\n`;
|
|
340
|
+
}
|
|
341
|
+
suggestion +=
|
|
342
|
+
'Common fixes:\n' +
|
|
343
|
+
`• Add </${tagName}> after the component content\n` +
|
|
344
|
+
`• Or change <${tagName}> to <${tagName} /> if it has no children\n\n` +
|
|
345
|
+
'Example:\n' +
|
|
346
|
+
` <${tagName}>\n` +
|
|
347
|
+
' Your content here\n' +
|
|
348
|
+
` </${tagName}>`;
|
|
349
|
+
|
|
350
|
+
return {
|
|
351
|
+
type: 'mdx_syntax_error',
|
|
352
|
+
message: `Unclosed tag <${tagName}> on line ${lineNum}`,
|
|
353
|
+
details: details,
|
|
354
|
+
suggestion: suggestion,
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
// Pattern 2: Generic MDX error - extract what we can
|
|
359
|
+
const mdxErrorMatch = output.match(/\[next-mdx-remote\][^:]*:\s*([^\n]+)/);
|
|
360
|
+
if (mdxErrorMatch) {
|
|
361
|
+
const errorText = mdxErrorMatch[1].trim();
|
|
362
|
+
const lineMatch = errorText.match(/\((\d+):\d+/);
|
|
363
|
+
const lineNum = lineMatch ? parseInt(lineMatch[1], 10) : errorSource.line;
|
|
364
|
+
const file = errorSource.file;
|
|
365
|
+
|
|
366
|
+
let details = errorText;
|
|
367
|
+
if (file) {
|
|
368
|
+
const lineInfo = lineNum ? `:${lineNum}` : '';
|
|
369
|
+
details += `\n\nLocation: ${file}${lineInfo}`;
|
|
370
|
+
} else if (lineNum) {
|
|
371
|
+
details += `\n\nLine: ${lineNum}`;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
let suggestion =
|
|
375
|
+
'Check your MDX syntax:\n' +
|
|
376
|
+
'• Every opening tag needs a closing tag (e.g., <Note>...</Note>)\n' +
|
|
377
|
+
'• Self-closing tags need a slash (e.g., <Icon name="star" />)\n' +
|
|
378
|
+
'• Curly braces { } must be properly closed';
|
|
379
|
+
if (file) {
|
|
380
|
+
suggestion = `Check: ${file}${lineNum ? `:${lineNum}` : ''}\n\n` + suggestion;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
return {
|
|
384
|
+
type: 'mdx_syntax_error',
|
|
385
|
+
message: lineNum ? `MDX syntax error on line ${lineNum}` : 'MDX syntax error',
|
|
386
|
+
details: details,
|
|
387
|
+
suggestion: suggestion,
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
// Unclosed JSX tag error (alternative pattern)
|
|
393
|
+
// Pattern: "Expected the closing tag `</ComponentName>`"
|
|
394
|
+
const unclosedTagMatch = output.match(/Expected the closing tag `<\/(\w+)>`/);
|
|
395
|
+
if (unclosedTagMatch) {
|
|
396
|
+
const tagName = unclosedTagMatch[1];
|
|
397
|
+
const file = errorSource.file;
|
|
398
|
+
const line = errorSource.line;
|
|
399
|
+
|
|
400
|
+
let details = `The <${tagName}> component is not properly closed.`;
|
|
401
|
+
if (file) {
|
|
402
|
+
const lineInfo = line ? `:${line}` : '';
|
|
403
|
+
details += `\n\nLocation: ${file}${lineInfo}`;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
let suggestion = `Add a closing </${tagName}> tag or make it self-closing <${tagName} />.\n\n`;
|
|
407
|
+
if (file) {
|
|
408
|
+
suggestion += `Check this file: ${file}${line ? `:${line}` : ''}\n\n`;
|
|
409
|
+
}
|
|
410
|
+
suggestion +=
|
|
411
|
+
'Common causes:\n' +
|
|
412
|
+
'• Missing closing tag\n' +
|
|
413
|
+
'• Markdown lists inside JSX components can break parsing\n' +
|
|
414
|
+
'• Mismatched opening and closing tags';
|
|
415
|
+
|
|
416
|
+
return {
|
|
417
|
+
type: 'mdx_syntax_error',
|
|
418
|
+
message: `Unclosed tag: <${tagName}>`,
|
|
419
|
+
details: details,
|
|
420
|
+
suggestion: suggestion,
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
// React hook error in inline components
|
|
425
|
+
// Pattern: "useState is not defined" or similar for any React hook
|
|
426
|
+
// These errors occur when someone tries to use hooks in inline MDX components
|
|
427
|
+
const hookErrorMatch = output.match(
|
|
428
|
+
/\b(useState|useEffect|useContext|useReducer|useCallback|useMemo|useRef|useImperativeHandle|useLayoutEffect|useDebugValue|useDeferredValue|useTransition|useId|useSyncExternalStore|useInsertionEffect)\b[^a-zA-Z0-9_]*is not defined/i
|
|
429
|
+
);
|
|
430
|
+
if (hookErrorMatch) {
|
|
431
|
+
const hookName = hookErrorMatch[1];
|
|
432
|
+
const file = errorSource.file;
|
|
433
|
+
const line = errorSource.line;
|
|
434
|
+
|
|
435
|
+
let details =
|
|
436
|
+
`The React hook "${hookName}" cannot be used in inline MDX components. ` +
|
|
437
|
+
`Inline components are server-rendered during build, and React hooks only work client-side.`;
|
|
438
|
+
if (file) {
|
|
439
|
+
const lineInfo = line ? `:${line}` : '';
|
|
440
|
+
details += `\n\nLocation: ${file}${lineInfo}`;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
let suggestion =
|
|
444
|
+
'Inline MDX components (export const MyComponent = ...) cannot use React hooks.\n\n' +
|
|
445
|
+
'**Solution: Convert to a snippet file**\n\n' +
|
|
446
|
+
'1. Create a file in /snippets directory (e.g., /snippets/my-component.tsx)\n' +
|
|
447
|
+
'2. Add \'use client\'; at the top of the file\n' +
|
|
448
|
+
'3. Import and use the component in your MDX\n\n' +
|
|
449
|
+
'Example snippet file:\n' +
|
|
450
|
+
'```tsx\n' +
|
|
451
|
+
'\'use client\';\n' +
|
|
452
|
+
`import { ${hookName} } from 'react';\n\n` +
|
|
453
|
+
'export const MyComponent = () => {\n' +
|
|
454
|
+
` const [...] = ${hookName}(...);\n` +
|
|
455
|
+
' return <div>...</div>;\n' +
|
|
456
|
+
'};\n' +
|
|
457
|
+
'```\n\n' +
|
|
458
|
+
'Then import in your MDX:\n' +
|
|
459
|
+
'```mdx\n' +
|
|
460
|
+
'import { MyComponent } from \'/snippets/my-component\';\n' +
|
|
461
|
+
'```\n\n' +
|
|
462
|
+
'**Automatic fix:** Run `jamdesk migrate` to automatically convert hook-using components to snippets.\n\n' +
|
|
463
|
+
'See https://jamdesk.com/docs/content/react-components for details.';
|
|
464
|
+
|
|
465
|
+
if (file) {
|
|
466
|
+
suggestion = `Check this file: ${file}${line ? `:${line}` : ''}\n\n` + suggestion;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
return {
|
|
470
|
+
type: 'react_hook_error',
|
|
471
|
+
message: `React hook "${hookName}" not allowed in inline components`,
|
|
472
|
+
details: details,
|
|
473
|
+
suggestion: suggestion,
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
// Deprecated components (uses shared DEPRECATED_COMPONENTS map)
|
|
478
|
+
// Pattern: "Expected component `ComponentName` to be defined"
|
|
479
|
+
for (const [componentName, info] of Object.entries(DEPRECATED_COMPONENTS)) {
|
|
480
|
+
if (output.includes(`Expected component \`${componentName}\` to be defined`)) {
|
|
481
|
+
const file = errorSource.file;
|
|
482
|
+
const line = errorSource.line;
|
|
483
|
+
|
|
484
|
+
let details = `The <${componentName}> component has been removed.`;
|
|
485
|
+
if (file) {
|
|
486
|
+
const lineInfo = line ? `:${line}` : '';
|
|
487
|
+
details += `\n\nLocation: ${file}${lineInfo}`;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
let suggestion = `${info.migrationHint}\n\n`;
|
|
491
|
+
suggestion += 'Run `jamdesk migrate` to fix your source files, or use "Fix & Rebuild" in the dashboard to deploy immediately.';
|
|
492
|
+
if (file) {
|
|
493
|
+
suggestion = `Check this file: ${file}${line ? `:${line}` : ''}\n\n` + suggestion;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
return {
|
|
497
|
+
type: 'deprecated_component',
|
|
498
|
+
message: `<${componentName}> has been removed — use <${info.replacement}> instead`,
|
|
499
|
+
details,
|
|
500
|
+
suggestion,
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
// Missing MDX component error (must be before frontmatter check)
|
|
506
|
+
// Pattern: "Expected component `ComponentName` to be defined"
|
|
507
|
+
const missingComponentMatch2 = output.match(/Expected component `(\w+)` to be defined/);
|
|
508
|
+
if (missingComponentMatch2) {
|
|
509
|
+
const componentName = missingComponentMatch2[1];
|
|
510
|
+
const file = errorSource.file;
|
|
511
|
+
const line = errorSource.line;
|
|
512
|
+
|
|
513
|
+
// Built-in component names that are known to Jamdesk
|
|
514
|
+
const builtInComponents = [
|
|
515
|
+
'Note',
|
|
516
|
+
'Tip',
|
|
517
|
+
'Info',
|
|
518
|
+
'Warning',
|
|
519
|
+
'Check',
|
|
520
|
+
'Danger',
|
|
521
|
+
'Card',
|
|
522
|
+
'Columns',
|
|
523
|
+
'Tabs',
|
|
524
|
+
'Tab',
|
|
525
|
+
'Steps',
|
|
526
|
+
'Step',
|
|
527
|
+
'CodeGroup',
|
|
528
|
+
'ParamField',
|
|
529
|
+
'ResponseField',
|
|
530
|
+
'Expandable',
|
|
531
|
+
'Frame',
|
|
532
|
+
'Icon',
|
|
533
|
+
'Accordion',
|
|
534
|
+
'AccordionGroup',
|
|
535
|
+
'Badge',
|
|
536
|
+
];
|
|
537
|
+
|
|
538
|
+
// Check if this might be an inline component (PascalCase but not a built-in)
|
|
539
|
+
const isPascalCase = /^[A-Z][a-zA-Z0-9]*$/.test(componentName);
|
|
540
|
+
const isBuiltIn = builtInComponents.includes(componentName);
|
|
541
|
+
const isLikelyInlineComponent = isPascalCase && !isBuiltIn;
|
|
542
|
+
|
|
543
|
+
let details = `The component <${componentName}> is not available.`;
|
|
544
|
+
if (file) {
|
|
545
|
+
const lineInfo = line ? `:${line}` : '';
|
|
546
|
+
details += `\n\nLocation: ${file}${lineInfo}`;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
let suggestion = '';
|
|
550
|
+
if (isLikelyInlineComponent) {
|
|
551
|
+
// Suggest inline component syntax for custom components
|
|
552
|
+
suggestion =
|
|
553
|
+
`If you're defining <${componentName}> as an inline component, add this to the top of your MDX file:\n\n` +
|
|
554
|
+
`\`\`\`jsx\n` +
|
|
555
|
+
`export const ${componentName} = ({ /* props */ }) => (\n` +
|
|
556
|
+
` <div>Your component content</div>\n` +
|
|
557
|
+
`);\n` +
|
|
558
|
+
`\`\`\`\n\n` +
|
|
559
|
+
'Check that:\n' +
|
|
560
|
+
'• The export syntax is correct: `export const ComponentName = ({ props }) => ...`\n' +
|
|
561
|
+
'• The component uses valid JSX\n' +
|
|
562
|
+
'• There are no syntax errors in the component code\n\n';
|
|
563
|
+
if (file) {
|
|
564
|
+
suggestion += `Check this file: ${file}${line ? `:${line}` : ''}\n\n`;
|
|
565
|
+
}
|
|
566
|
+
suggestion += 'See https://www.jamdesk.com/docs/react-components for inline component documentation.';
|
|
567
|
+
} else {
|
|
568
|
+
// Standard suggestion for built-in components
|
|
569
|
+
suggestion = `The <${componentName}> component is not available in Jamdesk.\n\n`;
|
|
570
|
+
if (file) {
|
|
571
|
+
suggestion += `Check this file: ${file}${line ? `:${line}` : ''}\n\n`;
|
|
572
|
+
}
|
|
573
|
+
suggestion +=
|
|
574
|
+
'Supported components include:\n' +
|
|
575
|
+
'• Callouts: <Note>, <Tip>, <Info>, <Warning>, <Check>, <Danger>\n' +
|
|
576
|
+
'• Layout: <Card>, <Columns>, <Tabs>, <Tab>, <Steps>, <Step>\n' +
|
|
577
|
+
'• Code: <CodeGroup>\n' +
|
|
578
|
+
'• API docs: <ParamField>, <ResponseField>, <Expandable>\n' +
|
|
579
|
+
'• Media: <Frame>, <Icon>\n\n' +
|
|
580
|
+
'See https://www.jamdesk.com/docs/components for the full list of available components.';
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
return {
|
|
584
|
+
type: 'missing_component',
|
|
585
|
+
message: `Unsupported component: <${componentName}>`,
|
|
586
|
+
details: details,
|
|
587
|
+
suggestion: suggestion,
|
|
588
|
+
};
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
// Frontmatter/YAML error
|
|
592
|
+
if (
|
|
593
|
+
lowerOutput.includes('yaml') ||
|
|
594
|
+
lowerOutput.includes('frontmatter') ||
|
|
595
|
+
lowerOutput.includes('unexpected end of file')
|
|
596
|
+
) {
|
|
597
|
+
const file = errorSource.file;
|
|
598
|
+
const line = errorSource.line;
|
|
599
|
+
|
|
600
|
+
let details =
|
|
601
|
+
'One or more of your MDX files has a syntax error in the metadata section at the top of the file.';
|
|
602
|
+
if (file) {
|
|
603
|
+
const lineInfo = line ? ` on line ${line}` : '';
|
|
604
|
+
details = `The file ${file} has a syntax error in the metadata section${lineInfo}.`;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
let suggestion = '';
|
|
608
|
+
if (file) {
|
|
609
|
+
suggestion = `Check this file: ${file}${line ? `:${line}` : ''}\n\n`;
|
|
610
|
+
}
|
|
611
|
+
suggestion +=
|
|
612
|
+
'Check the metadata at the top of your MDX file (the section between --- markers). ' +
|
|
613
|
+
'Common issues:\n' +
|
|
614
|
+
'• Missing closing --- marker\n' +
|
|
615
|
+
'• Incorrect formatting (check indentation, colons, quotes)\n' +
|
|
616
|
+
'• Special characters that need to be quoted';
|
|
617
|
+
|
|
618
|
+
return {
|
|
619
|
+
type: 'frontmatter_error',
|
|
620
|
+
message: file ? `Metadata error in ${file}` : 'File metadata error',
|
|
621
|
+
details: details,
|
|
622
|
+
suggestion: suggestion,
|
|
623
|
+
};
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
// Build timeout
|
|
627
|
+
if (lowerOutput.includes('timeout') || lowerOutput.includes('timed out')) {
|
|
628
|
+
return {
|
|
629
|
+
type: 'timeout',
|
|
630
|
+
message: 'Build timed out',
|
|
631
|
+
details: 'The build process took too long and was terminated.',
|
|
632
|
+
suggestion:
|
|
633
|
+
'This can happen with very large documentation sites. ' +
|
|
634
|
+
'Try reducing the number of pages or simplifying complex MDX components.',
|
|
635
|
+
};
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
// Out of memory
|
|
639
|
+
if (
|
|
640
|
+
lowerOutput.includes('out of memory') ||
|
|
641
|
+
lowerOutput.includes('heap') ||
|
|
642
|
+
lowerOutput.includes('allocation failed')
|
|
643
|
+
) {
|
|
644
|
+
return {
|
|
645
|
+
type: 'out_of_memory',
|
|
646
|
+
message: 'Build ran out of memory',
|
|
647
|
+
details: 'The build process exceeded available memory.',
|
|
648
|
+
suggestion:
|
|
649
|
+
'This can happen with very large documentation sites or complex builds. ' +
|
|
650
|
+
'Try reducing the number of pages or optimizing images.',
|
|
651
|
+
};
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
// Clone failure
|
|
655
|
+
if (phase === 'clone' || lowerOutput.includes('clone')) {
|
|
656
|
+
return {
|
|
657
|
+
type: 'clone_failed',
|
|
658
|
+
message: 'Failed to clone repository',
|
|
659
|
+
details: 'Could not clone your GitHub repository.',
|
|
660
|
+
suggestion:
|
|
661
|
+
'Check that:\n' +
|
|
662
|
+
'• The repository exists and is accessible\n' +
|
|
663
|
+
'• The Jamdesk GitHub App has access to the repository\n' +
|
|
664
|
+
'• The branch name is correct',
|
|
665
|
+
};
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
// Default error - still include file location if we found one
|
|
669
|
+
let details = message || 'An error occurred during the build process.';
|
|
670
|
+
if (errorSource.file) {
|
|
671
|
+
const lineInfo = errorSource.line ? `:${errorSource.line}` : '';
|
|
672
|
+
details += `\n\nLocation: ${errorSource.file}${lineInfo}`;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
let suggestion =
|
|
676
|
+
'Please review the error details and try again. ' +
|
|
677
|
+
'If the problem persists, check your repository configuration.';
|
|
678
|
+
if (errorSource.file) {
|
|
679
|
+
suggestion =
|
|
680
|
+
`Check this file: ${errorSource.file}${errorSource.line ? `:${errorSource.line}` : ''}\n\n` +
|
|
681
|
+
suggestion;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
return {
|
|
685
|
+
type: 'build_error',
|
|
686
|
+
message: 'Build failed',
|
|
687
|
+
details: details,
|
|
688
|
+
suggestion: suggestion,
|
|
689
|
+
};
|
|
690
|
+
}
|