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
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Jamdesk
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
# Jamdesk CLI
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/jamdesk)
|
|
4
|
+
[](https://nodejs.org)
|
|
5
|
+
[](./LICENSE)
|
|
6
|
+
|
|
7
|
+
CLI for [Jamdesk](https://jamdesk.com) — build, preview, and deploy documentation sites from MDX.
|
|
8
|
+
|
|
9
|
+

|
|
10
|
+
|
|
11
|
+
## What is Jamdesk?
|
|
12
|
+
|
|
13
|
+
Jamdesk is a docs-as-code platform. Connect a GitHub repo, write in MDX, and your docs deploy globally in seconds — with AI search, analytics, and custom domains built in. The CLI is how you develop locally: preview your site, validate config, catch broken links, and migrate from other tools.
|
|
14
|
+
|
|
15
|
+
- **Dev server** — Turbopack-powered with hot reload on every save
|
|
16
|
+
- **50+ MDX components** — accordions, tabs, code groups, callouts, [and more](https://jamdesk.com/docs/components/overview)
|
|
17
|
+
- **Three themes** — Jam, Nebula, Pulsar. Configured in `docs.json`
|
|
18
|
+
- **OpenAPI** — auto-generate API reference pages from your specs
|
|
19
|
+
- **Full-text search** — works locally and in production, with AI search on hosted sites
|
|
20
|
+
- **Validation** — broken links, MDX syntax errors, config issues. Catch them before deploy
|
|
21
|
+
- **Mintlify migration** — one command to convert your existing docs
|
|
22
|
+
|
|
23
|
+
## Quick Start
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
jamdesk init my-docs
|
|
27
|
+
cd my-docs
|
|
28
|
+
jamdesk dev
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Your docs are at **http://localhost:3000/docs**. That's it.
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
### npm (recommended)
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm install -g jamdesk
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Homebrew (macOS/Linux)
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
brew tap jamdesk/tap
|
|
45
|
+
brew install jamdesk
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### curl (macOS/Linux)
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
curl -fsSL https://get.jamdesk.com | bash
|
|
52
|
+
|
|
53
|
+
# Install specific version
|
|
54
|
+
curl -fsSL https://get.jamdesk.com | bash -s -- --version 1.2.3
|
|
55
|
+
|
|
56
|
+
# Upgrade
|
|
57
|
+
curl -fsSL https://get.jamdesk.com/upgrade | bash
|
|
58
|
+
|
|
59
|
+
# Uninstall
|
|
60
|
+
curl -fsSL https://get.jamdesk.com/uninstall | bash
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### PowerShell (Windows)
|
|
64
|
+
|
|
65
|
+
```powershell
|
|
66
|
+
# Install
|
|
67
|
+
iwr https://get.jamdesk.com/win | iex
|
|
68
|
+
|
|
69
|
+
# Upgrade
|
|
70
|
+
iwr https://get.jamdesk.com/upgrade | iex
|
|
71
|
+
|
|
72
|
+
# Uninstall
|
|
73
|
+
iwr https://get.jamdesk.com/uninstall | iex
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### npx (no install)
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
npx jamdesk dev
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Commands
|
|
83
|
+
|
|
84
|
+
| Command | Description |
|
|
85
|
+
|---------|-------------|
|
|
86
|
+
| `jamdesk init [name]` | Create a new docs project |
|
|
87
|
+
| `jamdesk dev` | Start dev server with Turbopack |
|
|
88
|
+
| `jamdesk preview` | Alias for `jamdesk dev` |
|
|
89
|
+
| `jamdesk dev --webpack` | Use Webpack instead of Turbopack |
|
|
90
|
+
| `jamdesk dev --clean` | Clear cache before starting |
|
|
91
|
+
| `jamdesk dev --port 3001` | Custom port |
|
|
92
|
+
| `jamdesk migrate` | Migrate from Mintlify |
|
|
93
|
+
| `jamdesk validate` | Validate docs.json, MDX syntax, OpenAPI specs |
|
|
94
|
+
| `jamdesk openapi-check <spec>` | Validate a single OpenAPI spec |
|
|
95
|
+
| `jamdesk broken-links` | Find broken internal links |
|
|
96
|
+
| `jamdesk rename <from> <to>` | Rename file, update all references |
|
|
97
|
+
| `jamdesk deploy <target>` | Deploy wizard (Cloudflare Worker setup, auth, config) |
|
|
98
|
+
| `jamdesk doctor` | Diagnose environment issues |
|
|
99
|
+
| `jamdesk clean` | Clear ~/.jamdesk cache |
|
|
100
|
+
| `jamdesk update` | Update to latest version |
|
|
101
|
+
| `jamdesk update --check` | Check for updates without installing |
|
|
102
|
+
|
|
103
|
+
All commands support `--verbose`. Run `jamdesk <command> --help` for details.
|
|
104
|
+
|
|
105
|
+
## Dev Server
|
|
106
|
+
|
|
107
|
+
Run `jamdesk dev` at the root of your project (where `docs.json` lives) to preview docs locally. Turbopack is the default and compiles roughly 5x faster than Webpack.
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
jamdesk dev # Turbopack (default)
|
|
111
|
+
jamdesk dev --webpack # Webpack (slower, more compatible)
|
|
112
|
+
jamdesk dev --clean # Clear cache first
|
|
113
|
+
jamdesk dev --port 3001 # Custom port
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
The dev server auto-validates on startup, auto-recovers from corrupted Turbopack cache, and auto-increments the port if yours is taken. Full search, all themes, and all components work locally.
|
|
117
|
+
|
|
118
|
+
Set a default port in `~/.jamdeskrc`:
|
|
119
|
+
|
|
120
|
+
```json
|
|
121
|
+
{
|
|
122
|
+
"defaultPort": 3001
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Validation
|
|
127
|
+
|
|
128
|
+
### `jamdesk validate`
|
|
129
|
+
|
|
130
|
+
Checks your project for issues:
|
|
131
|
+
|
|
132
|
+
- **docs.json** — schema validation against the [Jamdesk spec](https://jamdesk.com/docs/config/docs-json-reference)
|
|
133
|
+
- **MDX syntax** — catches things like `<50%` being parsed as JSX
|
|
134
|
+
- **OpenAPI specs** — validates if configured
|
|
135
|
+
- **Navigation** — warns when pages in your nav don't exist
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
jamdesk validate
|
|
139
|
+
jamdesk validate --skip-mdx # Skip MDX checks
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Example output:
|
|
143
|
+
|
|
144
|
+
```
|
|
145
|
+
✗ Found 1 MDX syntax error(s)
|
|
146
|
+
|
|
147
|
+
getting-started.mdx:42
|
|
148
|
+
Unexpected character `5` (U+0035) before name
|
|
149
|
+
Fix: A < character is being parsed as JSX. Use < or rewrite (e.g., "Below 50%" instead of "<50%")
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### `jamdesk openapi-check`
|
|
153
|
+
|
|
154
|
+
Validate a single OpenAPI spec:
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
jamdesk openapi-check path/to/openapi.yaml
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Reports endpoint count, schemas, tags. Warns if you're on Swagger 2.0.
|
|
161
|
+
|
|
162
|
+
### `jamdesk broken-links`
|
|
163
|
+
|
|
164
|
+
Find broken internal links across your docs:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
jamdesk broken-links
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
```
|
|
171
|
+
docs/getting-started.mdx:15 - /docs/quikstart
|
|
172
|
+
Did you mean: /docs/quickstart
|
|
173
|
+
|
|
174
|
+
Found 1 broken link in 45 files.
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## File Management
|
|
178
|
+
|
|
179
|
+
Rename a page and every reference updates automatically — docs.json navigation, internal links, snippet imports:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
jamdesk rename docs/old-name.mdx docs/new-name.mdx
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Migration
|
|
186
|
+
|
|
187
|
+
### `jamdesk migrate`
|
|
188
|
+
|
|
189
|
+
Migrate from Mintlify to Jamdesk:
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
cd /path/to/mintlify-docs
|
|
193
|
+
jamdesk migrate
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
Detects your `mint.json`, converts config to `docs.json`, lets you pick a theme, copies everything.
|
|
197
|
+
|
|
198
|
+
**What gets converted:**
|
|
199
|
+
|
|
200
|
+
- **Config** — `mint.json` → `docs.json` (navbar, navigation, footer, SEO, appearance)
|
|
201
|
+
- **Components** — deprecated components like `<CardGroup>` → `<Columns>`
|
|
202
|
+
- **React hooks** — inline components with `useState`/`useEffect` get extracted to `/snippets` as `.tsx` files with `'use client'`
|
|
203
|
+
- **Video embeds** — iframe normalization
|
|
204
|
+
|
|
205
|
+
| Option | Description |
|
|
206
|
+
|--------|-------------|
|
|
207
|
+
| `--yes`, `-y` | Skip confirmation prompts |
|
|
208
|
+
| `--theme <theme>` | Pre-select theme (`jam`, `nebula`, `pulsar`) |
|
|
209
|
+
|
|
210
|
+
After migration:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
cd jamdesk-docs
|
|
214
|
+
jamdesk dev
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
See the [migration guide](https://jamdesk.com/docs/migration) for the full list of conversions.
|
|
218
|
+
|
|
219
|
+
## Deployment
|
|
220
|
+
|
|
221
|
+
### Jamdesk Hosting
|
|
222
|
+
|
|
223
|
+
Push your docs to GitHub and Jamdesk builds and deploys them automatically. Your site gets a `*.jamdesk.app` subdomain with SSL, AI search, analytics, and custom domain support — no infrastructure to manage.
|
|
224
|
+
|
|
225
|
+
[Get started with Jamdesk hosting](https://jamdesk.com/docs/quickstart)
|
|
226
|
+
|
|
227
|
+
### Cloudflare Worker (subpath hosting)
|
|
228
|
+
|
|
229
|
+
Host your docs at a subpath on your existing domain (e.g., `yoursite.com/docs`) using a Cloudflare Worker:
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
jamdesk deploy cloudflare
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
The wizard handles wrangler setup, Cloudflare auth, zone selection, and worker generation. Supports multiple accounts.
|
|
236
|
+
|
|
237
|
+
| Option | Description |
|
|
238
|
+
|--------|-------------|
|
|
239
|
+
| `--slug <slug>` | Project slug (skip auto-detection) |
|
|
240
|
+
| `--domain <domain>` | Target domain (e.g., yoursite.com) |
|
|
241
|
+
| `--path <path>` | Path prefix (default: /docs) |
|
|
242
|
+
| `--output-dir <dir>` | Output directory (default: cloudflare-worker/) |
|
|
243
|
+
| `--skip-deploy` | Generate files only |
|
|
244
|
+
| `--force` | Overwrite existing directory |
|
|
245
|
+
| `--yes` | Skip prompts (CI mode) |
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
jamdesk deploy cloudflare --slug acme --domain example.com --path /docs --yes
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
Generates `index.js`, `wrangler.toml`, `package.json`, and `.gitignore`. Deploy manually with `npx wrangler deploy`.
|
|
252
|
+
|
|
253
|
+
See the [Cloudflare deployment guide](https://jamdesk.com/docs/deploy/cloudflare) for details.
|
|
254
|
+
|
|
255
|
+
## Configuration
|
|
256
|
+
|
|
257
|
+
Everything lives in `docs.json` — themes, navigation, branding, integrations (analytics, OpenAPI, search), and SEO. Works with monorepos too.
|
|
258
|
+
|
|
259
|
+
See the [docs.json reference](https://jamdesk.com/docs/config/docs-json-reference) for all options.
|
|
260
|
+
|
|
261
|
+
### CLI Defaults
|
|
262
|
+
|
|
263
|
+
`~/.jamdeskrc`:
|
|
264
|
+
|
|
265
|
+
```json
|
|
266
|
+
{
|
|
267
|
+
"defaultPort": 3001,
|
|
268
|
+
"verbose": false,
|
|
269
|
+
"checkUpdates": true
|
|
270
|
+
}
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
## Troubleshooting
|
|
274
|
+
|
|
275
|
+
**"docs.json not found"**
|
|
276
|
+
- Run from a directory with `docs.json`, or `jamdesk init` to start fresh
|
|
277
|
+
|
|
278
|
+
**Dev server won't start**
|
|
279
|
+
- `jamdesk doctor` to check your environment
|
|
280
|
+
- `jamdesk clean` to clear the cache
|
|
281
|
+
- `jamdesk dev --verbose` for details
|
|
282
|
+
|
|
283
|
+
**Turbopack cache corruption**
|
|
284
|
+
- `jamdesk dev --clean` to clear and restart
|
|
285
|
+
- Happens when the dev server is killed mid-build
|
|
286
|
+
|
|
287
|
+
**Slow first run**
|
|
288
|
+
- First run installs deps to `~/.jamdesk/node_modules`. Subsequent runs are fast.
|
|
289
|
+
|
|
290
|
+
**Port in use**
|
|
291
|
+
- `jamdesk dev --port 3001` or let auto-increment find the next open port
|
|
292
|
+
|
|
293
|
+
**MDX syntax errors**
|
|
294
|
+
- `<` is parsed as JSX in MDX. Use `<` or rewrite ("Below 50%" instead of "<50%")
|
|
295
|
+
- `jamdesk validate` shows errors with line numbers
|
|
296
|
+
|
|
297
|
+
## Requirements
|
|
298
|
+
|
|
299
|
+
- Node.js v20.0.0+
|
|
300
|
+
- npm v8+ (recommended)
|
|
301
|
+
|
|
302
|
+
## Learn More
|
|
303
|
+
|
|
304
|
+
- [Documentation](https://jamdesk.com/docs)
|
|
305
|
+
- [Getting Started](https://jamdesk.com/docs/quickstart)
|
|
306
|
+
- [Components](https://jamdesk.com/docs/components/overview)
|
|
307
|
+
- [Themes](https://jamdesk.com/docs/themes)
|
|
308
|
+
- [Config Reference](https://jamdesk.com/docs/config/docs-json-reference)
|
|
309
|
+
- [OpenAPI](https://jamdesk.com/docs/api-reference/openapi-setup)
|
|
310
|
+
- [Deployment](https://jamdesk.com/docs/deploy)
|
|
311
|
+
- [Homepage](https://jamdesk.com)
|
|
312
|
+
- [Pricing](https://jamdesk.com/pricing)
|
|
313
|
+
|
|
314
|
+
**Example:** [jamdesk.com/docs](https://jamdesk.com/docs)
|
|
315
|
+
|
|
316
|
+
## Support
|
|
317
|
+
|
|
318
|
+
- [Report Issues](https://github.com/jamdesk/jamdesk/issues)
|
|
319
|
+
- [Contact Support](https://jamdesk.com/docs/help/support/contact)
|
|
320
|
+
|
|
321
|
+
## License
|
|
322
|
+
|
|
323
|
+
MIT
|
package/bin/jamdesk.js
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { existsSync, statSync, readdirSync } from 'fs';
|
|
4
|
+
import { join, dirname } from 'path';
|
|
5
|
+
import { fileURLToPath } from 'url';
|
|
6
|
+
import { execSync } from 'child_process';
|
|
7
|
+
|
|
8
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const cliRoot = join(__dirname, '..');
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Check if any TypeScript source files are newer than the compiled dist.
|
|
13
|
+
* This catches cases where someone edited src/ but forgot to rebuild.
|
|
14
|
+
*/
|
|
15
|
+
function isDistStale() {
|
|
16
|
+
const srcDir = join(cliRoot, 'src');
|
|
17
|
+
const distIndex = join(cliRoot, 'dist', 'index.js');
|
|
18
|
+
|
|
19
|
+
// Only check in development (when src/ exists)
|
|
20
|
+
if (!existsSync(srcDir)) return false;
|
|
21
|
+
|
|
22
|
+
// Get dist/index.js mtime, or return stale if it doesn't exist
|
|
23
|
+
let distMtime;
|
|
24
|
+
try {
|
|
25
|
+
distMtime = statSync(distIndex).mtimeMs;
|
|
26
|
+
} catch {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return hasNewerSourceFiles(srcDir, distMtime);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Recursively check if any .ts/.tsx files are newer than the given timestamp.
|
|
35
|
+
*/
|
|
36
|
+
function hasNewerSourceFiles(dir, threshold) {
|
|
37
|
+
let entries;
|
|
38
|
+
try {
|
|
39
|
+
entries = readdirSync(dir, { withFileTypes: true });
|
|
40
|
+
} catch {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
for (const entry of entries) {
|
|
45
|
+
if (entry.name.startsWith('.') || entry.name === '__tests__') continue;
|
|
46
|
+
|
|
47
|
+
const fullPath = join(dir, entry.name);
|
|
48
|
+
|
|
49
|
+
if (entry.isDirectory()) {
|
|
50
|
+
if (hasNewerSourceFiles(fullPath, threshold)) return true;
|
|
51
|
+
} else if (entry.name.endsWith('.ts') || entry.name.endsWith('.tsx')) {
|
|
52
|
+
try {
|
|
53
|
+
if (statSync(fullPath).mtimeMs > threshold) return true;
|
|
54
|
+
} catch {
|
|
55
|
+
// Skip unreadable files
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Check for stale dist and auto-rebuild if needed
|
|
64
|
+
if (isDistStale()) {
|
|
65
|
+
console.log('\x1b[33m⚠ Source files are newer than compiled dist, rebuilding...\x1b[0m');
|
|
66
|
+
try {
|
|
67
|
+
// Safe: hardcoded command with no user input
|
|
68
|
+
execSync('npm run build', { cwd: cliRoot, stdio: 'inherit' });
|
|
69
|
+
console.log('\x1b[32m✓ Rebuild complete\x1b[0m\n');
|
|
70
|
+
} catch (err) {
|
|
71
|
+
console.error('\x1b[31m✗ Rebuild failed. Run "npm run build" manually.\x1b[0m');
|
|
72
|
+
process.exit(1);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
import('../dist/index.js');
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Integration tests for deprecated component detection in CLI
|
|
3
|
+
*
|
|
4
|
+
* Tests that the dev command properly detects deprecated components
|
|
5
|
+
* and provides actionable error messages.
|
|
6
|
+
*/
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=deprecated-components.integration.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deprecated-components.integration.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/integration/deprecated-components.integration.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Integration tests for deprecated component detection in CLI
|
|
3
|
+
*
|
|
4
|
+
* Tests that the dev command properly detects deprecated components
|
|
5
|
+
* and provides actionable error messages.
|
|
6
|
+
*/
|
|
7
|
+
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
|
|
8
|
+
import fs from 'fs-extra';
|
|
9
|
+
import path from 'path';
|
|
10
|
+
import os from 'os';
|
|
11
|
+
import { checkForDeprecatedComponents, DEPRECATED_COMPONENTS } from '../../lib/deprecated-components.js';
|
|
12
|
+
describe('deprecated component detection integration', () => {
|
|
13
|
+
let tempDir;
|
|
14
|
+
beforeAll(async () => {
|
|
15
|
+
// Create a temporary directory for test fixtures
|
|
16
|
+
tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'jamdesk-test-'));
|
|
17
|
+
});
|
|
18
|
+
afterAll(async () => {
|
|
19
|
+
// Clean up temp directory
|
|
20
|
+
await fs.remove(tempDir);
|
|
21
|
+
});
|
|
22
|
+
describe('checkForDeprecatedComponents', () => {
|
|
23
|
+
it('detects CardGroup in MDX content', () => {
|
|
24
|
+
const content = `---
|
|
25
|
+
title: Getting Started
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
# Welcome
|
|
29
|
+
|
|
30
|
+
<CardGroup cols={2}>
|
|
31
|
+
<Card title="Quick Start" href="/quickstart" />
|
|
32
|
+
<Card title="Installation" href="/install" />
|
|
33
|
+
</CardGroup>
|
|
34
|
+
`;
|
|
35
|
+
const errors = checkForDeprecatedComponents(content, 'getting-started.mdx');
|
|
36
|
+
expect(errors).toHaveLength(1);
|
|
37
|
+
expect(errors[0].component).toBe('CardGroup');
|
|
38
|
+
expect(errors[0].file).toBe('getting-started.mdx');
|
|
39
|
+
expect(errors[0].line).toBe(7); // Line where <CardGroup> appears
|
|
40
|
+
expect(errors[0].replacement).toBe('Columns');
|
|
41
|
+
expect(errors[0].migrationHint).toContain('<Columns');
|
|
42
|
+
});
|
|
43
|
+
it('detects CardGroup with different casing', () => {
|
|
44
|
+
const content = `<cardgroup cols={3}></cardgroup>`;
|
|
45
|
+
const errors = checkForDeprecatedComponents(content, 'test.mdx');
|
|
46
|
+
expect(errors).toHaveLength(1);
|
|
47
|
+
expect(errors[0].component).toBe('CardGroup');
|
|
48
|
+
});
|
|
49
|
+
it('returns empty array when no deprecated components found', () => {
|
|
50
|
+
const content = `---
|
|
51
|
+
title: Clean Page
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
# Clean Content
|
|
55
|
+
|
|
56
|
+
<Columns cols={2}>
|
|
57
|
+
<Card title="Item 1" />
|
|
58
|
+
<Card title="Item 2" />
|
|
59
|
+
</Columns>
|
|
60
|
+
`;
|
|
61
|
+
const errors = checkForDeprecatedComponents(content, 'clean.mdx');
|
|
62
|
+
expect(errors).toHaveLength(0);
|
|
63
|
+
});
|
|
64
|
+
it('detects multiple deprecated components in same file', () => {
|
|
65
|
+
const content = `
|
|
66
|
+
# Page with multiple deprecated components
|
|
67
|
+
|
|
68
|
+
<CardGroup cols={2}>
|
|
69
|
+
<Card title="First" />
|
|
70
|
+
</CardGroup>
|
|
71
|
+
|
|
72
|
+
Some text in between.
|
|
73
|
+
|
|
74
|
+
<CardGroup cols={3}>
|
|
75
|
+
<Card title="Second" />
|
|
76
|
+
</CardGroup>
|
|
77
|
+
`;
|
|
78
|
+
const errors = checkForDeprecatedComponents(content, 'multi.mdx');
|
|
79
|
+
// Implementation finds first occurrence per component type
|
|
80
|
+
expect(errors).toHaveLength(1);
|
|
81
|
+
expect(errors[0].component).toBe('CardGroup');
|
|
82
|
+
});
|
|
83
|
+
it('provides correct line numbers', () => {
|
|
84
|
+
const content = `Line 1
|
|
85
|
+
Line 2
|
|
86
|
+
Line 3
|
|
87
|
+
<CardGroup>
|
|
88
|
+
Line 5
|
|
89
|
+
</CardGroup>`;
|
|
90
|
+
const errors = checkForDeprecatedComponents(content, 'lines.mdx');
|
|
91
|
+
expect(errors).toHaveLength(1);
|
|
92
|
+
expect(errors[0].line).toBe(4); // CardGroup is on line 4
|
|
93
|
+
});
|
|
94
|
+
it('does not false-positive on CardGroup in code blocks', () => {
|
|
95
|
+
// Note: Current implementation doesn't skip code blocks
|
|
96
|
+
// This test documents current behavior
|
|
97
|
+
const content = `
|
|
98
|
+
\`\`\`jsx
|
|
99
|
+
<CardGroup cols={2}>
|
|
100
|
+
<Card />
|
|
101
|
+
</CardGroup>
|
|
102
|
+
\`\`\`
|
|
103
|
+
`;
|
|
104
|
+
const errors = checkForDeprecatedComponents(content, 'codeblock.mdx');
|
|
105
|
+
// Current behavior: it will detect it even in code blocks
|
|
106
|
+
// This is acceptable as it's rare to have deprecated components in code examples
|
|
107
|
+
// and the user can safely ignore the warning
|
|
108
|
+
expect(errors).toHaveLength(1);
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
describe('DEPRECATED_COMPONENTS map', () => {
|
|
112
|
+
it('includes CardGroup with proper metadata', () => {
|
|
113
|
+
expect(DEPRECATED_COMPONENTS).toHaveProperty('CardGroup');
|
|
114
|
+
expect(DEPRECATED_COMPONENTS.CardGroup.replacement).toBe('Columns');
|
|
115
|
+
expect(DEPRECATED_COMPONENTS.CardGroup.migrationHint).toContain('CardGroup');
|
|
116
|
+
expect(DEPRECATED_COMPONENTS.CardGroup.migrationHint).toContain('Columns');
|
|
117
|
+
});
|
|
118
|
+
it('has required fields for all deprecated components', () => {
|
|
119
|
+
for (const [name, info] of Object.entries(DEPRECATED_COMPONENTS)) {
|
|
120
|
+
expect(info.name).toBe(name);
|
|
121
|
+
expect(typeof info.replacement).toBe('string');
|
|
122
|
+
expect(info.replacement.length).toBeGreaterThan(0);
|
|
123
|
+
expect(typeof info.migrationHint).toBe('string');
|
|
124
|
+
expect(info.migrationHint.length).toBeGreaterThan(0);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
describe('file scanning workflow', () => {
|
|
129
|
+
it('scans MDX file from disk and detects deprecated components', async () => {
|
|
130
|
+
// Create a test MDX file
|
|
131
|
+
const testFile = path.join(tempDir, 'test-page.mdx');
|
|
132
|
+
await fs.writeFile(testFile, `---
|
|
133
|
+
title: Test Page
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
<CardGroup cols={2}>
|
|
137
|
+
<Card title="Test" />
|
|
138
|
+
</CardGroup>
|
|
139
|
+
`);
|
|
140
|
+
// Read and check
|
|
141
|
+
const content = await fs.readFile(testFile, 'utf-8');
|
|
142
|
+
const errors = checkForDeprecatedComponents(content, 'test-page.mdx');
|
|
143
|
+
expect(errors).toHaveLength(1);
|
|
144
|
+
expect(errors[0].component).toBe('CardGroup');
|
|
145
|
+
});
|
|
146
|
+
it('scans snippet file from disk and detects deprecated components', async () => {
|
|
147
|
+
// Create a test snippet file
|
|
148
|
+
const snippetsDir = path.join(tempDir, 'snippets');
|
|
149
|
+
await fs.ensureDir(snippetsDir);
|
|
150
|
+
const snippetFile = path.join(snippetsDir, 'card-layout.mdx');
|
|
151
|
+
await fs.writeFile(snippetFile, `<CardGroup cols={3}>
|
|
152
|
+
<Card title="A" />
|
|
153
|
+
<Card title="B" />
|
|
154
|
+
<Card title="C" />
|
|
155
|
+
</CardGroup>
|
|
156
|
+
`);
|
|
157
|
+
// Read and check
|
|
158
|
+
const content = await fs.readFile(snippetFile, 'utf-8');
|
|
159
|
+
const errors = checkForDeprecatedComponents(content, 'snippets/card-layout.mdx');
|
|
160
|
+
expect(errors).toHaveLength(1);
|
|
161
|
+
expect(errors[0].file).toBe('snippets/card-layout.mdx');
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
//# sourceMappingURL=deprecated-components.integration.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deprecated-components.integration.test.js","sourceRoot":"","sources":["../../../src/__tests__/integration/deprecated-components.integration.test.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACnE,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,4BAA4B,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAEzG,QAAQ,CAAC,4CAA4C,EAAE,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C;YAEG,iBAAiB;YACjB,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;YACxD,MAAM,MAAM,GAAG,4BAA4B,CAAC,OAAO,EAAE,0BAA0B,CAAC,CAAC;YAEjF,MAAM,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;YAC/B,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate.integration.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/integration/migrate.integration.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
|
|
2
|
+
import fs from 'fs-extra';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import os from 'os';
|
|
5
|
+
import { findConfigFile, detectMintlify } from '../../commands/migrate/detect.js';
|
|
6
|
+
import { convertMintlifyToJamdesk } from '../../commands/migrate/convert.js';
|
|
7
|
+
describe('migrate integration', () => {
|
|
8
|
+
let tempDir;
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'jamdesk-migrate-test-'));
|
|
11
|
+
});
|
|
12
|
+
afterEach(async () => {
|
|
13
|
+
await fs.remove(tempDir);
|
|
14
|
+
});
|
|
15
|
+
it('detects and converts a Mintlify project', async () => {
|
|
16
|
+
// Create a mock Mintlify project
|
|
17
|
+
const mintConfig = {
|
|
18
|
+
$schema: 'https://mintlify.com/schema.json',
|
|
19
|
+
name: 'Test Docs',
|
|
20
|
+
topbarLinks: [{ name: 'Support', url: 'https://support.example.com' }],
|
|
21
|
+
navigation: [
|
|
22
|
+
{ group: 'Getting Started', pages: ['intro'] },
|
|
23
|
+
],
|
|
24
|
+
footerSocials: {
|
|
25
|
+
twitter: 'https://twitter.com/test',
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
await fs.writeJSON(path.join(tempDir, 'mint.json'), mintConfig);
|
|
29
|
+
await fs.writeFile(path.join(tempDir, 'intro.mdx'), '# Introduction');
|
|
30
|
+
// Detect the config
|
|
31
|
+
const result = findConfigFile(tempDir);
|
|
32
|
+
expect(result).not.toBeNull();
|
|
33
|
+
expect(result.filename).toBe('mint.json');
|
|
34
|
+
expect(detectMintlify(result.config)).toBe(true);
|
|
35
|
+
// Convert it
|
|
36
|
+
const converted = convertMintlifyToJamdesk(result.config, 'jam');
|
|
37
|
+
expect(converted.$schema).toBe('https://www.jamdesk.com/docs.json');
|
|
38
|
+
expect(converted.theme).toBe('jam');
|
|
39
|
+
expect(converted.navbar?.links).toEqual([
|
|
40
|
+
{ label: 'Support', href: 'https://support.example.com' },
|
|
41
|
+
]);
|
|
42
|
+
expect(converted.navigation?.pages).toEqual([
|
|
43
|
+
{ group: 'Getting Started', pages: ['intro'] },
|
|
44
|
+
]);
|
|
45
|
+
expect(converted.footer?.socials).toEqual({
|
|
46
|
+
twitter: 'https://twitter.com/test',
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
it('handles docs.json that is already Jamdesk format', async () => {
|
|
50
|
+
// Create a non-Mintlify project
|
|
51
|
+
const jamdeskConfig = {
|
|
52
|
+
$schema: 'https://www.jamdesk.com/docs.json',
|
|
53
|
+
name: 'Test Docs',
|
|
54
|
+
theme: 'jam',
|
|
55
|
+
};
|
|
56
|
+
await fs.writeJSON(path.join(tempDir, 'docs.json'), jamdeskConfig);
|
|
57
|
+
// Detect the config
|
|
58
|
+
const result = findConfigFile(tempDir);
|
|
59
|
+
expect(result).not.toBeNull();
|
|
60
|
+
expect(result.filename).toBe('docs.json');
|
|
61
|
+
expect(detectMintlify(result.config)).toBe(false);
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
//# sourceMappingURL=migrate.integration.test.js.map
|