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,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* On-Demand Snippet Compiler for ISR
|
|
3
|
+
*
|
|
4
|
+
* Compiles JSX/TSX snippet files from R2 on demand for ISR rendering.
|
|
5
|
+
* Uses Babel standalone for transpilation and caches results.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { transform } from '@babel/standalone';
|
|
9
|
+
import { fetchSnippet } from './r2-content';
|
|
10
|
+
|
|
11
|
+
interface CompiledSnippet {
|
|
12
|
+
/** Exported component/function names */
|
|
13
|
+
exports: string[];
|
|
14
|
+
/** Transpiled JavaScript code */
|
|
15
|
+
code: string;
|
|
16
|
+
/** Whether the snippet has 'use client' directive */
|
|
17
|
+
isClientComponent: boolean;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// In-memory cache for compiled snippets
|
|
21
|
+
const snippetCache = new Map<string, { result: CompiledSnippet; timestamp: number }>();
|
|
22
|
+
const CACHE_TTL = 300_000; // 5 minutes
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Compile a snippet file on demand for ISR.
|
|
26
|
+
* Fetches from R2, transpiles JSX, caches result.
|
|
27
|
+
*
|
|
28
|
+
* @param projectSlug - Project identifier
|
|
29
|
+
* @param snippetPath - Path to snippet file (e.g., 'badge.tsx')
|
|
30
|
+
* @returns Compiled snippet with exports and code
|
|
31
|
+
*/
|
|
32
|
+
export async function compileSnippetIsr(
|
|
33
|
+
projectSlug: string,
|
|
34
|
+
snippetPath: string
|
|
35
|
+
): Promise<CompiledSnippet> {
|
|
36
|
+
const cacheKey = `${projectSlug}:${snippetPath}`;
|
|
37
|
+
|
|
38
|
+
// Check cache
|
|
39
|
+
const cached = snippetCache.get(cacheKey);
|
|
40
|
+
if (cached && Date.now() - cached.timestamp < CACHE_TTL) {
|
|
41
|
+
return cached.result;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// Fetch from R2
|
|
45
|
+
const source = await fetchSnippet(projectSlug, snippetPath);
|
|
46
|
+
|
|
47
|
+
// Check for 'use client' directive
|
|
48
|
+
const trimmed = source.trimStart();
|
|
49
|
+
const isClientComponent =
|
|
50
|
+
trimmed.startsWith("'use client'") || trimmed.startsWith('"use client"');
|
|
51
|
+
|
|
52
|
+
// Transpile JSX to JavaScript
|
|
53
|
+
const transpiled = transform(source, {
|
|
54
|
+
presets: ['react', 'typescript'],
|
|
55
|
+
plugins: [['transform-react-jsx', { runtime: 'automatic' }]],
|
|
56
|
+
filename: snippetPath,
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
if (!transpiled.code) {
|
|
60
|
+
throw new Error(`Failed to compile snippet: ${snippetPath}`);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Extract export names (const, function, class exports)
|
|
64
|
+
const exportMatches = source.matchAll(/export\s+(?:const|function|class)\s+(\w+)/g);
|
|
65
|
+
const exports = Array.from(exportMatches, (m) => m[1]);
|
|
66
|
+
|
|
67
|
+
const result: CompiledSnippet = {
|
|
68
|
+
exports,
|
|
69
|
+
code: transpiled.code,
|
|
70
|
+
isClientComponent,
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
// Cache it
|
|
74
|
+
snippetCache.set(cacheKey, { result, timestamp: Date.now() });
|
|
75
|
+
|
|
76
|
+
return result;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Clear snippet cache.
|
|
81
|
+
*
|
|
82
|
+
* @param projectSlug - Optional project to clear. If not provided, clears all.
|
|
83
|
+
*/
|
|
84
|
+
export function clearSnippetCache(projectSlug?: string): void {
|
|
85
|
+
if (projectSlug) {
|
|
86
|
+
for (const key of snippetCache.keys()) {
|
|
87
|
+
if (key.startsWith(`${projectSlug}:`)) {
|
|
88
|
+
snippetCache.delete(key);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
} else {
|
|
92
|
+
snippetCache.clear();
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Preload commonly used snippets.
|
|
98
|
+
*
|
|
99
|
+
* @param projectSlug - Project identifier
|
|
100
|
+
* @param snippetPaths - Paths to preload
|
|
101
|
+
*/
|
|
102
|
+
export async function preloadSnippets(
|
|
103
|
+
projectSlug: string,
|
|
104
|
+
snippetPaths: string[]
|
|
105
|
+
): Promise<void> {
|
|
106
|
+
await Promise.all(snippetPaths.map((path) => compileSnippetIsr(projectSlug, path)));
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Get the current size of the snippet cache.
|
|
111
|
+
*/
|
|
112
|
+
export function getSnippetCacheSize(): number {
|
|
113
|
+
return snippetCache.size;
|
|
114
|
+
}
|
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ISR Snippet Loader
|
|
3
|
+
*
|
|
4
|
+
* Dynamically loads and compiles snippet components from R2 for ISR mode.
|
|
5
|
+
* Handles the complete flow:
|
|
6
|
+
* 1. Extract snippet imports from MDX content
|
|
7
|
+
* 2. Fetch snippet files from R2
|
|
8
|
+
* 3. Compile and evaluate to React components
|
|
9
|
+
* 4. Return components map for MDXRemote
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import * as jsxRuntime from 'react/jsx-runtime';
|
|
14
|
+
import { transform } from '@babel/standalone';
|
|
15
|
+
import { fetchSnippet } from './r2-content';
|
|
16
|
+
import { extractSnippetImports } from './preprocess-mdx';
|
|
17
|
+
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
|
+
type AnyComponent = React.ComponentType<any>;
|
|
20
|
+
|
|
21
|
+
interface CompiledSnippet {
|
|
22
|
+
exports: Record<string, AnyComponent>;
|
|
23
|
+
isClientComponent: boolean;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// In-memory cache for compiled snippet components
|
|
27
|
+
const snippetComponentCache = new Map<
|
|
28
|
+
string,
|
|
29
|
+
{ result: CompiledSnippet; timestamp: number }
|
|
30
|
+
>();
|
|
31
|
+
const CACHE_TTL = 300_000; // 5 minutes
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Convert kebab-case or snake_case to PascalCase.
|
|
35
|
+
*/
|
|
36
|
+
function toPascalCase(str: string): string {
|
|
37
|
+
return str
|
|
38
|
+
.split(/[-_]/)
|
|
39
|
+
.map((part) => part.charAt(0).toUpperCase() + part.slice(1).toLowerCase())
|
|
40
|
+
.join('');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Extract snippet path from import statement.
|
|
45
|
+
* '/snippets/plans-available.mdx' -> 'plans-available.mdx'
|
|
46
|
+
* '../snippets/foo.tsx' -> 'foo.tsx'
|
|
47
|
+
*/
|
|
48
|
+
function normalizeSnippetPath(importPath: string): string {
|
|
49
|
+
// Remove leading dots and slashes, and 'snippets/' prefix
|
|
50
|
+
return importPath
|
|
51
|
+
.replace(/^(?:\.\.\/)*\/?snippets\//, '')
|
|
52
|
+
.replace(/^\//, '');
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Transpile JSX source code to JavaScript.
|
|
57
|
+
*/
|
|
58
|
+
function transpileJsx(source: string): string {
|
|
59
|
+
const result = transform(source, {
|
|
60
|
+
presets: ['react', 'typescript'],
|
|
61
|
+
plugins: [['transform-react-jsx', { runtime: 'automatic', importSource: 'react' }]],
|
|
62
|
+
filename: 'snippet.tsx',
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
if (!result.code) {
|
|
66
|
+
throw new Error('Babel transpilation failed');
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Remove the automatic imports that Babel adds
|
|
70
|
+
return result.code.replace(/^import\s+.*?;\s*/gm, '').trim();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Extract export statements from transpiled JavaScript.
|
|
75
|
+
* Returns map of export names to their function code.
|
|
76
|
+
*
|
|
77
|
+
* Handles:
|
|
78
|
+
* - export const Name = ...
|
|
79
|
+
* - export function Name(...) { ... }
|
|
80
|
+
*/
|
|
81
|
+
function extractExports(transpiledCode: string): Record<string, string> {
|
|
82
|
+
const exports: Record<string, string> = {};
|
|
83
|
+
|
|
84
|
+
// Pattern 1: export const Name = (arrow function or expression)
|
|
85
|
+
// The transpiled code will have: export const Name = props => _jsx(...)
|
|
86
|
+
const constPattern = /export\s+const\s+(\w+)\s*=\s*([\s\S]*?)(?=export\s+(?:const|function)|\s*$)/g;
|
|
87
|
+
|
|
88
|
+
let match;
|
|
89
|
+
while ((match = constPattern.exec(transpiledCode)) !== null) {
|
|
90
|
+
const [, name, body] = match;
|
|
91
|
+
// Clean up the body - remove trailing semicolons and whitespace
|
|
92
|
+
const cleanBody = body.trim().replace(/;?\s*$/, '');
|
|
93
|
+
exports[name] = cleanBody;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Pattern 2: export function Name(...) { ... }
|
|
97
|
+
// Need to match balanced braces for the function body
|
|
98
|
+
const funcPattern = /export\s+function\s+(\w+)\s*(\([^)]*\)\s*\{)/g;
|
|
99
|
+
while ((match = funcPattern.exec(transpiledCode)) !== null) {
|
|
100
|
+
const [fullMatch, name, paramsAndBrace] = match;
|
|
101
|
+
const startIdx = match.index + fullMatch.length - 1; // Position of opening brace
|
|
102
|
+
|
|
103
|
+
// Find matching closing brace
|
|
104
|
+
let depth = 1;
|
|
105
|
+
let endIdx = startIdx + 1;
|
|
106
|
+
while (depth > 0 && endIdx < transpiledCode.length) {
|
|
107
|
+
if (transpiledCode[endIdx] === '{') depth++;
|
|
108
|
+
if (transpiledCode[endIdx] === '}') depth--;
|
|
109
|
+
endIdx++;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Extract the full function and convert to arrow function format
|
|
113
|
+
const funcBody = transpiledCode.slice(startIdx, endIdx);
|
|
114
|
+
const params = paramsAndBrace.replace(/\s*\{$/, '');
|
|
115
|
+
exports[name] = `${params} => ${funcBody}`;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return exports;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Compile a single snippet into React components.
|
|
123
|
+
*/
|
|
124
|
+
async function compileSnippet(
|
|
125
|
+
projectSlug: string,
|
|
126
|
+
snippetPath: string,
|
|
127
|
+
builtInComponents: Record<string, AnyComponent> = {}
|
|
128
|
+
): Promise<CompiledSnippet> {
|
|
129
|
+
const cacheKey = `${projectSlug}:${snippetPath}`;
|
|
130
|
+
|
|
131
|
+
// Check cache
|
|
132
|
+
const cached = snippetComponentCache.get(cacheKey);
|
|
133
|
+
if (cached && Date.now() - cached.timestamp < CACHE_TTL) {
|
|
134
|
+
return cached.result;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Fetch from R2
|
|
138
|
+
const source = await fetchSnippet(projectSlug, snippetPath);
|
|
139
|
+
|
|
140
|
+
// Check for 'use client' directive
|
|
141
|
+
const trimmed = source.trimStart();
|
|
142
|
+
const isClientComponent =
|
|
143
|
+
trimmed.startsWith("'use client'") || trimmed.startsWith('"use client"');
|
|
144
|
+
|
|
145
|
+
// Transpile JSX to JavaScript
|
|
146
|
+
const transpiled = transpileJsx(source);
|
|
147
|
+
|
|
148
|
+
// Extract exports from transpiled code
|
|
149
|
+
const exportedFunctions = extractExports(transpiled);
|
|
150
|
+
|
|
151
|
+
// Compile each export into an actual React component
|
|
152
|
+
const builtInNames = Object.keys(builtInComponents);
|
|
153
|
+
const exports: Record<string, AnyComponent> = {};
|
|
154
|
+
|
|
155
|
+
for (const [name, functionCode] of Object.entries(exportedFunctions)) {
|
|
156
|
+
try {
|
|
157
|
+
// Create function that returns the component
|
|
158
|
+
// NOTE: new Function() is intentionally used here to compile user-provided snippets
|
|
159
|
+
// eslint-disable-next-line @typescript-eslint/no-implied-eval
|
|
160
|
+
const createComponent = new Function(
|
|
161
|
+
'React',
|
|
162
|
+
'_jsx',
|
|
163
|
+
'_jsxs',
|
|
164
|
+
'_Fragment',
|
|
165
|
+
...builtInNames,
|
|
166
|
+
`return ${functionCode}`
|
|
167
|
+
);
|
|
168
|
+
|
|
169
|
+
const component = createComponent(
|
|
170
|
+
React,
|
|
171
|
+
jsxRuntime.jsx,
|
|
172
|
+
jsxRuntime.jsxs,
|
|
173
|
+
jsxRuntime.Fragment,
|
|
174
|
+
...builtInNames.map((n) => builtInComponents[n])
|
|
175
|
+
);
|
|
176
|
+
|
|
177
|
+
exports[name] = component;
|
|
178
|
+
} catch (error) {
|
|
179
|
+
console.error(
|
|
180
|
+
`[ISR Snippet] Failed to compile "${name}" from ${snippetPath}:`,
|
|
181
|
+
error instanceof Error ? error.message : error
|
|
182
|
+
);
|
|
183
|
+
// Continue with other exports
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
const result: CompiledSnippet = { exports, isClientComponent };
|
|
188
|
+
|
|
189
|
+
// Cache the result
|
|
190
|
+
snippetComponentCache.set(cacheKey, { result, timestamp: Date.now() });
|
|
191
|
+
|
|
192
|
+
return result;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Load all snippets referenced in MDX content for ISR mode.
|
|
197
|
+
*
|
|
198
|
+
* @param projectSlug - Project identifier
|
|
199
|
+
* @param mdxContent - Raw MDX content (before preprocessing)
|
|
200
|
+
* @param builtInComponents - Built-in MDX components (Note, Card, etc.)
|
|
201
|
+
* @returns Map of component names to compiled React components
|
|
202
|
+
*/
|
|
203
|
+
export async function loadSnippetsForIsr(
|
|
204
|
+
projectSlug: string,
|
|
205
|
+
mdxContent: string,
|
|
206
|
+
builtInComponents: Record<string, AnyComponent> = {}
|
|
207
|
+
): Promise<Record<string, AnyComponent>> {
|
|
208
|
+
// Extract snippet imports from the MDX content
|
|
209
|
+
const imports = extractSnippetImports(mdxContent);
|
|
210
|
+
|
|
211
|
+
if (imports.length === 0) {
|
|
212
|
+
return {};
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
const components: Record<string, AnyComponent> = {};
|
|
216
|
+
|
|
217
|
+
// Process each import
|
|
218
|
+
await Promise.all(
|
|
219
|
+
imports.map(async (imp) => {
|
|
220
|
+
try {
|
|
221
|
+
const snippetPath = normalizeSnippetPath(imp.path);
|
|
222
|
+
const compiled = await compileSnippet(
|
|
223
|
+
projectSlug,
|
|
224
|
+
snippetPath,
|
|
225
|
+
builtInComponents
|
|
226
|
+
);
|
|
227
|
+
|
|
228
|
+
// Map import aliases to compiled components
|
|
229
|
+
for (const alias of imp.imports) {
|
|
230
|
+
// Check if the alias matches an exported name directly
|
|
231
|
+
if (alias in compiled.exports) {
|
|
232
|
+
components[alias] = compiled.exports[alias];
|
|
233
|
+
} else {
|
|
234
|
+
// Try to find the component by various naming conventions
|
|
235
|
+
// The snippet might export with a different name than the alias
|
|
236
|
+
const exportNames = Object.keys(compiled.exports);
|
|
237
|
+
if (exportNames.length === 1) {
|
|
238
|
+
// Single export - use it regardless of name
|
|
239
|
+
components[alias] = compiled.exports[exportNames[0]];
|
|
240
|
+
} else if (exportNames.length > 1) {
|
|
241
|
+
// Multiple exports - try to match by PascalCase conversion of filename
|
|
242
|
+
const filename = snippetPath.replace(/\.(mdx|jsx|tsx|js|ts)$/, '');
|
|
243
|
+
const pascalName = toPascalCase(filename);
|
|
244
|
+
if (pascalName in compiled.exports) {
|
|
245
|
+
components[alias] = compiled.exports[pascalName];
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
} catch (error) {
|
|
251
|
+
console.error(
|
|
252
|
+
`[ISR Snippet] Failed to load snippet "${imp.path}":`,
|
|
253
|
+
error instanceof Error ? error.message : error
|
|
254
|
+
);
|
|
255
|
+
// Continue with other snippets
|
|
256
|
+
}
|
|
257
|
+
})
|
|
258
|
+
);
|
|
259
|
+
|
|
260
|
+
return components;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Clear the snippet component cache.
|
|
265
|
+
*/
|
|
266
|
+
export function clearSnippetComponentCache(projectSlug?: string): void {
|
|
267
|
+
if (projectSlug) {
|
|
268
|
+
for (const key of snippetComponentCache.keys()) {
|
|
269
|
+
if (key.startsWith(`${projectSlug}:`)) {
|
|
270
|
+
snippetComponentCache.delete(key);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
} else {
|
|
274
|
+
snippetComponentCache.clear();
|
|
275
|
+
}
|
|
276
|
+
}
|