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,167 @@
|
|
|
1
|
+
import { ImageResponse } from '@vercel/og';
|
|
2
|
+
import { NextRequest } from 'next/server';
|
|
3
|
+
|
|
4
|
+
export const runtime = 'edge';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* OG Image Generator
|
|
8
|
+
*
|
|
9
|
+
* Generates branded Open Graph images for documentation sites.
|
|
10
|
+
*
|
|
11
|
+
* Query Parameters:
|
|
12
|
+
* - title: Page title (required)
|
|
13
|
+
* - description: Page description (optional)
|
|
14
|
+
* - section: Section/group name (optional, e.g., "Get Started")
|
|
15
|
+
* - siteName: Site name (optional, defaults to "Documentation")
|
|
16
|
+
* - logo: URL to the project's logo (optional)
|
|
17
|
+
* - theme: "light" or "dark" (optional, defaults to "dark")
|
|
18
|
+
*
|
|
19
|
+
* Example:
|
|
20
|
+
* /api/og?title=Introduction§ion=Get%20Started&siteName=Acme%20Docs&logo=https://...
|
|
21
|
+
*/
|
|
22
|
+
export async function GET(request: NextRequest) {
|
|
23
|
+
const searchParams = request.nextUrl.searchParams;
|
|
24
|
+
|
|
25
|
+
const title = searchParams.get('title') || 'Documentation';
|
|
26
|
+
const description = searchParams.get('description') || '';
|
|
27
|
+
const section = searchParams.get('section') || '';
|
|
28
|
+
const siteName = searchParams.get('siteName') || 'Documentation';
|
|
29
|
+
const logo = searchParams.get('logo') || '';
|
|
30
|
+
const theme = searchParams.get('theme') || 'dark';
|
|
31
|
+
|
|
32
|
+
const isDark = theme === 'dark';
|
|
33
|
+
|
|
34
|
+
// Colors based on theme
|
|
35
|
+
const bgColor = isDark ? '#0f0f23' : '#ffffff';
|
|
36
|
+
const textColor = isDark ? '#ffffff' : '#1a1a2e';
|
|
37
|
+
const mutedColor = isDark ? '#a0a0b0' : '#666680';
|
|
38
|
+
const accentColor = '#8B5CF6'; // Jamdesk purple
|
|
39
|
+
const gradientStart = isDark ? '#1a1a3e' : '#f8f8fc';
|
|
40
|
+
const gradientEnd = isDark ? '#0f0f23' : '#ffffff';
|
|
41
|
+
|
|
42
|
+
return new ImageResponse(
|
|
43
|
+
(
|
|
44
|
+
<div
|
|
45
|
+
style={{
|
|
46
|
+
height: '100%',
|
|
47
|
+
width: '100%',
|
|
48
|
+
display: 'flex',
|
|
49
|
+
flexDirection: 'column',
|
|
50
|
+
padding: '60px',
|
|
51
|
+
background: `linear-gradient(135deg, ${gradientStart} 0%, ${gradientEnd} 100%)`,
|
|
52
|
+
fontFamily: 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
53
|
+
}}
|
|
54
|
+
>
|
|
55
|
+
{/* Top bar with logo and site name */}
|
|
56
|
+
<div
|
|
57
|
+
style={{
|
|
58
|
+
display: 'flex',
|
|
59
|
+
alignItems: 'center',
|
|
60
|
+
marginBottom: '40px',
|
|
61
|
+
}}
|
|
62
|
+
>
|
|
63
|
+
{logo && (
|
|
64
|
+
<img
|
|
65
|
+
src={logo}
|
|
66
|
+
alt=""
|
|
67
|
+
width={40}
|
|
68
|
+
height={40}
|
|
69
|
+
style={{
|
|
70
|
+
marginRight: '16px',
|
|
71
|
+
borderRadius: '8px',
|
|
72
|
+
}}
|
|
73
|
+
/>
|
|
74
|
+
)}
|
|
75
|
+
<span
|
|
76
|
+
style={{
|
|
77
|
+
fontSize: '24px',
|
|
78
|
+
fontWeight: 600,
|
|
79
|
+
color: mutedColor,
|
|
80
|
+
textTransform: 'uppercase',
|
|
81
|
+
letterSpacing: '0.05em',
|
|
82
|
+
}}
|
|
83
|
+
>
|
|
84
|
+
{siteName}
|
|
85
|
+
</span>
|
|
86
|
+
</div>
|
|
87
|
+
|
|
88
|
+
{/* Section badge */}
|
|
89
|
+
{section && (
|
|
90
|
+
<div
|
|
91
|
+
style={{
|
|
92
|
+
display: 'flex',
|
|
93
|
+
marginBottom: '20px',
|
|
94
|
+
}}
|
|
95
|
+
>
|
|
96
|
+
<span
|
|
97
|
+
style={{
|
|
98
|
+
fontSize: '18px',
|
|
99
|
+
fontWeight: 500,
|
|
100
|
+
color: accentColor,
|
|
101
|
+
padding: '8px 16px',
|
|
102
|
+
background: isDark ? 'rgba(139, 92, 246, 0.15)' : 'rgba(139, 92, 246, 0.1)',
|
|
103
|
+
borderRadius: '20px',
|
|
104
|
+
}}
|
|
105
|
+
>
|
|
106
|
+
{section}
|
|
107
|
+
</span>
|
|
108
|
+
</div>
|
|
109
|
+
)}
|
|
110
|
+
|
|
111
|
+
{/* Main title */}
|
|
112
|
+
<div
|
|
113
|
+
style={{
|
|
114
|
+
display: 'flex',
|
|
115
|
+
flex: 1,
|
|
116
|
+
flexDirection: 'column',
|
|
117
|
+
justifyContent: 'center',
|
|
118
|
+
}}
|
|
119
|
+
>
|
|
120
|
+
<h1
|
|
121
|
+
style={{
|
|
122
|
+
fontSize: title.length > 40 ? '52px' : '64px',
|
|
123
|
+
fontWeight: 700,
|
|
124
|
+
color: textColor,
|
|
125
|
+
lineHeight: 1.2,
|
|
126
|
+
margin: 0,
|
|
127
|
+
maxWidth: '900px',
|
|
128
|
+
}}
|
|
129
|
+
>
|
|
130
|
+
{title}
|
|
131
|
+
</h1>
|
|
132
|
+
|
|
133
|
+
{description && (
|
|
134
|
+
<p
|
|
135
|
+
style={{
|
|
136
|
+
fontSize: '28px',
|
|
137
|
+
color: mutedColor,
|
|
138
|
+
marginTop: '24px',
|
|
139
|
+
lineHeight: 1.4,
|
|
140
|
+
maxWidth: '800px',
|
|
141
|
+
}}
|
|
142
|
+
>
|
|
143
|
+
{description.length > 120
|
|
144
|
+
? description.substring(0, 120) + '...'
|
|
145
|
+
: description}
|
|
146
|
+
</p>
|
|
147
|
+
)}
|
|
148
|
+
</div>
|
|
149
|
+
|
|
150
|
+
{/* Bottom accent bar */}
|
|
151
|
+
<div
|
|
152
|
+
style={{
|
|
153
|
+
display: 'flex',
|
|
154
|
+
height: '6px',
|
|
155
|
+
background: `linear-gradient(90deg, ${accentColor} 0%, #C4B5FD 50%, #A78BFA 100%)`,
|
|
156
|
+
borderRadius: '3px',
|
|
157
|
+
marginTop: '40px',
|
|
158
|
+
}}
|
|
159
|
+
/>
|
|
160
|
+
</div>
|
|
161
|
+
),
|
|
162
|
+
{
|
|
163
|
+
width: 1200,
|
|
164
|
+
height: 630,
|
|
165
|
+
}
|
|
166
|
+
);
|
|
167
|
+
}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* R2 Proxy API Route
|
|
3
|
+
*
|
|
4
|
+
* Fetches project files from Cloudflare R2 and streams them to the client.
|
|
5
|
+
* This is called by middleware for all project subdomains.
|
|
6
|
+
*
|
|
7
|
+
* This route only runs on Vercel in production (ISR mode).
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import { NextRequest, NextResponse } from 'next/server';
|
|
11
|
+
import { getFileFromR2 } from '@/lib/r2';
|
|
12
|
+
|
|
13
|
+
export const runtime = 'nodejs'; // Use Node.js runtime for AWS SDK
|
|
14
|
+
export const dynamic = 'force-dynamic'; // Always run dynamically
|
|
15
|
+
|
|
16
|
+
// Dynamic route params type for Next.js 15+
|
|
17
|
+
type RouteParams = {
|
|
18
|
+
params: Promise<{ project: string; path: string[] }>;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
// Content type mapping with proper charset
|
|
22
|
+
const CONTENT_TYPES: Record<string, string> = {
|
|
23
|
+
html: 'text/html; charset=utf-8',
|
|
24
|
+
css: 'text/css; charset=utf-8',
|
|
25
|
+
js: 'application/javascript; charset=utf-8',
|
|
26
|
+
json: 'application/json; charset=utf-8',
|
|
27
|
+
png: 'image/png',
|
|
28
|
+
jpg: 'image/jpeg',
|
|
29
|
+
jpeg: 'image/jpeg',
|
|
30
|
+
gif: 'image/gif',
|
|
31
|
+
svg: 'image/svg+xml; charset=utf-8',
|
|
32
|
+
webp: 'image/webp',
|
|
33
|
+
woff: 'font/woff',
|
|
34
|
+
woff2: 'font/woff2',
|
|
35
|
+
ttf: 'font/ttf',
|
|
36
|
+
txt: 'text/plain; charset=utf-8',
|
|
37
|
+
mdx: 'text/markdown; charset=utf-8',
|
|
38
|
+
xml: 'application/xml; charset=utf-8',
|
|
39
|
+
ico: 'image/x-icon',
|
|
40
|
+
map: 'application/json',
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
function getContentType(filePath: string): string {
|
|
44
|
+
const ext = filePath.split('.').pop()?.toLowerCase() || '';
|
|
45
|
+
return CONTENT_TYPES[ext] || 'application/octet-stream';
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Cache headers - long cache for immutable assets, shorter for HTML
|
|
49
|
+
function getCacheControl(filePath: string): string {
|
|
50
|
+
const isImmutable = filePath.includes('/_next/') || filePath.includes('/static/');
|
|
51
|
+
return isImmutable
|
|
52
|
+
? 'public, max-age=31536000, immutable' // 1 year for hashed assets
|
|
53
|
+
: 'public, max-age=3600, s-maxage=86400'; // 1 hour client, 1 day CDN for HTML
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export async function GET(
|
|
57
|
+
request: NextRequest,
|
|
58
|
+
{ params }: RouteParams
|
|
59
|
+
) {
|
|
60
|
+
const { project, path } = await params;
|
|
61
|
+
const filePath = '/' + (path?.join('/') || 'index.html');
|
|
62
|
+
|
|
63
|
+
try {
|
|
64
|
+
const stream = await getFileFromR2(project, filePath);
|
|
65
|
+
|
|
66
|
+
if (!stream) {
|
|
67
|
+
// Try to serve the project's 404 page instead of plain text
|
|
68
|
+
const notFoundPage = await getFileFromR2(project, '/404.html');
|
|
69
|
+
|
|
70
|
+
if (notFoundPage) {
|
|
71
|
+
return new NextResponse(notFoundPage as any, {
|
|
72
|
+
status: 404,
|
|
73
|
+
headers: {
|
|
74
|
+
'Content-Type': 'text/html; charset=utf-8',
|
|
75
|
+
'Cache-Control': 'no-cache',
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Fallback to simple 404 if project's 404.html doesn't exist
|
|
81
|
+
return new NextResponse(get404Html(project), {
|
|
82
|
+
status: 404,
|
|
83
|
+
headers: {
|
|
84
|
+
'Content-Type': 'text/html; charset=utf-8',
|
|
85
|
+
'Cache-Control': 'no-cache',
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
// Raw MDX source: prevent indexing and embedding
|
|
91
|
+
const isMdx = filePath.endsWith('.mdx');
|
|
92
|
+
|
|
93
|
+
return new NextResponse(stream as any, {
|
|
94
|
+
status: 200,
|
|
95
|
+
headers: {
|
|
96
|
+
'Content-Type': getContentType(filePath),
|
|
97
|
+
'Cache-Control': getCacheControl(filePath),
|
|
98
|
+
...(isMdx && {
|
|
99
|
+
'Content-Disposition': 'inline',
|
|
100
|
+
'X-Robots-Tag': 'noindex, nofollow',
|
|
101
|
+
'X-Frame-Options': 'DENY',
|
|
102
|
+
'Content-Security-Policy': "default-src 'none'",
|
|
103
|
+
}),
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
} catch (error) {
|
|
107
|
+
console.error(`[R2 API] Error fetching ${project}${filePath}:`, error);
|
|
108
|
+
return new NextResponse(get500Html(), {
|
|
109
|
+
status: 500,
|
|
110
|
+
headers: {
|
|
111
|
+
'Content-Type': 'text/html; charset=utf-8',
|
|
112
|
+
'Cache-Control': 'no-cache',
|
|
113
|
+
},
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Jamdesk favicon as inline SVG data URI (fallback when project favicon unavailable)
|
|
119
|
+
const JAMDESK_FAVICON = "data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' fill='none'><rect x='3' y='7' width='14' height='19' rx='2.5' fill='%23C4B5FD' fill-opacity='0.9'/><rect x='8' y='4' width='14' height='19' rx='2.5' fill='%23A78BFA' fill-opacity='0.85'/><rect x='13' y='9' width='14' height='19' rx='2.5' fill='%238B5CF6' fill-opacity='0.9'/></svg>";
|
|
120
|
+
|
|
121
|
+
// Simple fallback 404 page if project's 404.html doesn't exist
|
|
122
|
+
function get404Html(project: string): string {
|
|
123
|
+
return `<!DOCTYPE html>
|
|
124
|
+
<html>
|
|
125
|
+
<head>
|
|
126
|
+
<title>Page Not Found</title>
|
|
127
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
128
|
+
<link rel="icon" id="favicon" type="image/svg+xml" href="/_jd/branding/favicon.svg">
|
|
129
|
+
<script>
|
|
130
|
+
// Try project favicon, fall back to Jamdesk
|
|
131
|
+
var link = document.getElementById('favicon');
|
|
132
|
+
var img = new Image();
|
|
133
|
+
img.onerror = function() { link.href = "${JAMDESK_FAVICON}"; };
|
|
134
|
+
img.src = link.href;
|
|
135
|
+
</script>
|
|
136
|
+
<style>
|
|
137
|
+
body {
|
|
138
|
+
font-family: system-ui, -apple-system, sans-serif;
|
|
139
|
+
display: flex;
|
|
140
|
+
align-items: center;
|
|
141
|
+
justify-content: center;
|
|
142
|
+
min-height: 100vh;
|
|
143
|
+
margin: 0;
|
|
144
|
+
background: #0f172a;
|
|
145
|
+
color: #f8fafc;
|
|
146
|
+
}
|
|
147
|
+
.container { text-align: center; padding: 2rem; }
|
|
148
|
+
h1 { font-size: 4rem; margin: 0 0 1rem; font-weight: 700; }
|
|
149
|
+
p { color: #94a3b8; font-size: 1.125rem; margin: 0 0 2rem; }
|
|
150
|
+
a {
|
|
151
|
+
color: #3b82f6;
|
|
152
|
+
text-decoration: none;
|
|
153
|
+
padding: 0.75rem 1.5rem;
|
|
154
|
+
border: 1px solid #3b82f6;
|
|
155
|
+
border-radius: 0.5rem;
|
|
156
|
+
display: inline-block;
|
|
157
|
+
transition: all 0.2s;
|
|
158
|
+
}
|
|
159
|
+
a:hover { background: #3b82f6; color: white; }
|
|
160
|
+
</style>
|
|
161
|
+
</head>
|
|
162
|
+
<body>
|
|
163
|
+
<div class="container">
|
|
164
|
+
<h1>404</h1>
|
|
165
|
+
<p>The page you're looking for doesn't exist.</p>
|
|
166
|
+
<a href="/">Go Home</a>
|
|
167
|
+
</div>
|
|
168
|
+
</body>
|
|
169
|
+
</html>`;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// Simple fallback 500 page (uses inline favicon since server errored)
|
|
173
|
+
function get500Html(): string {
|
|
174
|
+
return `<!DOCTYPE html>
|
|
175
|
+
<html>
|
|
176
|
+
<head>
|
|
177
|
+
<title>Server Error</title>
|
|
178
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
179
|
+
<link rel="icon" type="image/svg+xml" href="${JAMDESK_FAVICON}">
|
|
180
|
+
<style>
|
|
181
|
+
body {
|
|
182
|
+
font-family: system-ui, -apple-system, sans-serif;
|
|
183
|
+
display: flex;
|
|
184
|
+
align-items: center;
|
|
185
|
+
justify-content: center;
|
|
186
|
+
min-height: 100vh;
|
|
187
|
+
margin: 0;
|
|
188
|
+
background: #0f172a;
|
|
189
|
+
color: #f8fafc;
|
|
190
|
+
}
|
|
191
|
+
.container { text-align: center; padding: 2rem; }
|
|
192
|
+
h1 { font-size: 4rem; margin: 0 0 1rem; font-weight: 700; }
|
|
193
|
+
p { color: #94a3b8; font-size: 1.125rem; margin: 0 0 2rem; }
|
|
194
|
+
a {
|
|
195
|
+
color: #3b82f6;
|
|
196
|
+
text-decoration: none;
|
|
197
|
+
padding: 0.75rem 1.5rem;
|
|
198
|
+
border: 1px solid #3b82f6;
|
|
199
|
+
border-radius: 0.5rem;
|
|
200
|
+
display: inline-block;
|
|
201
|
+
transition: all 0.2s;
|
|
202
|
+
}
|
|
203
|
+
a:hover { background: #3b82f6; color: white; }
|
|
204
|
+
</style>
|
|
205
|
+
</head>
|
|
206
|
+
<body>
|
|
207
|
+
<div class="container">
|
|
208
|
+
<h1>500</h1>
|
|
209
|
+
<p>Something went wrong. Please try again later.</p>
|
|
210
|
+
<a href="/">Go Home</a>
|
|
211
|
+
</div>
|
|
212
|
+
</body>
|
|
213
|
+
</html>`;
|
|
214
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Revalidation API Route
|
|
3
|
+
*
|
|
4
|
+
* POST /api/revalidate
|
|
5
|
+
*
|
|
6
|
+
* Triggers on-demand cache revalidation for ISR pages.
|
|
7
|
+
* Called by the build service after uploading new content to R2.
|
|
8
|
+
*
|
|
9
|
+
* Request body:
|
|
10
|
+
* {
|
|
11
|
+
* "project": "acme", // Project to revalidate
|
|
12
|
+
* "paths": ["/intro", "/api"], // Specific paths (optional)
|
|
13
|
+
* "tags": ["docs"], // Cache tags (optional)
|
|
14
|
+
* "all": true // Revalidate everything (optional)
|
|
15
|
+
* }
|
|
16
|
+
*
|
|
17
|
+
* Headers:
|
|
18
|
+
* - x-revalidate-secret: Secret token for authentication
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { NextRequest, NextResponse } from 'next/server';
|
|
22
|
+
import { revalidatePath, revalidateTag } from 'next/cache';
|
|
23
|
+
import {
|
|
24
|
+
validateRevalidateSecret,
|
|
25
|
+
parseRevalidateRequest,
|
|
26
|
+
executeRevalidation,
|
|
27
|
+
buildSuccessResponse,
|
|
28
|
+
buildErrorResponse,
|
|
29
|
+
} from '@/lib/revalidation-helpers';
|
|
30
|
+
|
|
31
|
+
export async function POST(request: NextRequest) {
|
|
32
|
+
// Verify secret
|
|
33
|
+
const secret = request.headers.get('x-revalidate-secret');
|
|
34
|
+
|
|
35
|
+
if (!validateRevalidateSecret(secret)) {
|
|
36
|
+
return NextResponse.json(
|
|
37
|
+
buildErrorResponse('Unauthorized'),
|
|
38
|
+
{ status: 401 }
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
try {
|
|
43
|
+
// Parse request body
|
|
44
|
+
const body = await request.json();
|
|
45
|
+
const parsedRequest = parseRevalidateRequest(body);
|
|
46
|
+
|
|
47
|
+
// Execute revalidation with Next.js functions
|
|
48
|
+
const result = await executeRevalidation(
|
|
49
|
+
parsedRequest,
|
|
50
|
+
revalidatePath,
|
|
51
|
+
revalidateTag
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
return NextResponse.json(buildSuccessResponse(result));
|
|
55
|
+
} catch (error) {
|
|
56
|
+
console.error('Revalidation error:', error);
|
|
57
|
+
return NextResponse.json(
|
|
58
|
+
buildErrorResponse('Revalidation failed', (error as Error).message),
|
|
59
|
+
{ status: 500 }
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* GET /api/revalidate
|
|
66
|
+
*
|
|
67
|
+
* Health check endpoint for the revalidation API.
|
|
68
|
+
*/
|
|
69
|
+
export async function GET() {
|
|
70
|
+
return NextResponse.json({
|
|
71
|
+
status: 'ok',
|
|
72
|
+
endpoint: '/api/revalidate',
|
|
73
|
+
method: 'POST',
|
|
74
|
+
description: 'Trigger on-demand cache revalidation',
|
|
75
|
+
});
|
|
76
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Light/Dark mode image utilities
|
|
5
|
+
* These utilities enable showing different images based on theme.
|
|
6
|
+
* Usage in MDX:
|
|
7
|
+
* <img className="block dark:hidden" src="/light.png" noStyle />
|
|
8
|
+
* <img className="hidden dark:block" src="/dark.png" noStyle />
|
|
9
|
+
*
|
|
10
|
+
* Note: Using !important to override .prose img { display: block } styles
|
|
11
|
+
*/
|
|
12
|
+
img.block { display: block !important; }
|
|
13
|
+
img.hidden { display: none !important; }
|
|
14
|
+
img.inline { display: inline !important; }
|
|
15
|
+
img.inline-block { display: inline-block !important; }
|
|
16
|
+
|
|
17
|
+
/* Dark mode variants - when .dark class is on <html> */
|
|
18
|
+
.dark img.dark\:block, .dark .dark\:block { display: block !important; }
|
|
19
|
+
.dark img.dark\:hidden, .dark .dark\:hidden { display: none !important; }
|
|
20
|
+
.dark img.dark\:inline, .dark .dark\:inline { display: inline !important; }
|
|
21
|
+
.dark img.dark\:inline-block, .dark .dark\:inline-block { display: inline-block !important; }
|
|
22
|
+
|
|
23
|
+
/* Shiki handles syntax highlighting via CSS variables - no theme import needed */
|
|
24
|
+
|
|
25
|
+
/* Import base shared styles */
|
|
26
|
+
@import "../themes/base.css";
|
|
27
|
+
|
|
28
|
+
/*
|
|
29
|
+
* Theme loading strategy:
|
|
30
|
+
* - Jam theme (default): loaded here via @import
|
|
31
|
+
* - Other themes: loaded dynamically via <style> tag in layout.tsx
|
|
32
|
+
*
|
|
33
|
+
* This means jam's CSS is always present, but jam-specific styles (like the
|
|
34
|
+
* background gradient) are scoped to body[data-theme="jam"] so they don't
|
|
35
|
+
* affect other themes.
|
|
36
|
+
*/
|
|
37
|
+
@import "../themes/jam/variables.css";
|