blume 2.0.1 → 2.0.3
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/CHANGELOG.md +147 -0
- package/dist/cli/{chunk-qwsrynx5.js → chunk-1d7ve1dm.js} +38 -19
- package/dist/cli/{chunk-qwsrynx5.js.map → chunk-1d7ve1dm.js.map} +4 -4
- package/dist/cli/{chunk-s6jhgk0q.js → chunk-2eytanqx.js} +2 -2
- package/dist/cli/{chunk-kdp5q7ke.js → chunk-2hsdwb9n.js} +18 -19
- package/dist/cli/{chunk-kdp5q7ke.js.map → chunk-2hsdwb9n.js.map} +2 -2
- package/dist/cli/{chunk-hdpx1tax.js → chunk-2z928egk.js} +5 -5
- package/dist/cli/{chunk-jwyddg7y.js → chunk-35d4wj9f.js} +30 -24
- package/dist/cli/chunk-35d4wj9f.js.map +15 -0
- package/dist/cli/{chunk-ah61y8py.js → chunk-364znk6q.js} +2 -2
- package/dist/cli/{chunk-jts8mvcz.js → chunk-3em5wd2y.js} +25 -6
- package/dist/cli/{chunk-jts8mvcz.js.map → chunk-3em5wd2y.js.map} +3 -3
- package/dist/cli/{chunk-s1p84fyh.js → chunk-5f86nr5m.js} +63 -22
- package/dist/cli/chunk-5f86nr5m.js.map +11 -0
- package/dist/cli/{chunk-2hn4b8z7.js → chunk-5m5nmvyq.js} +170 -76
- package/dist/cli/chunk-5m5nmvyq.js.map +13 -0
- package/dist/cli/{chunk-epjnccmv.js → chunk-5xvm6tfj.js} +18 -15
- package/dist/cli/chunk-5xvm6tfj.js.map +10 -0
- package/dist/cli/{chunk-fz5wtpmh.js → chunk-6dsbexzp.js} +18 -15
- package/dist/cli/chunk-6dsbexzp.js.map +10 -0
- package/dist/cli/{chunk-vtk4a6dg.js → chunk-8ktnccpt.js} +1 -1
- package/dist/cli/{chunk-6hsn950k.js → chunk-9t7a85s3.js} +178 -48
- package/dist/cli/chunk-9t7a85s3.js.map +10 -0
- package/dist/cli/{chunk-fxypxtvm.js → chunk-a58773jm.js} +2 -2
- package/dist/cli/{chunk-mb2919y2.js → chunk-acanzt5p.js} +17 -6
- package/dist/cli/chunk-acanzt5p.js.map +10 -0
- package/dist/cli/{chunk-27g6wdth.js → chunk-akbpwfxc.js} +90 -26
- package/dist/cli/chunk-akbpwfxc.js.map +10 -0
- package/dist/cli/{chunk-wm7js3j9.js → chunk-b07cmahc.js} +2 -2
- package/dist/cli/{chunk-wgm7m9qk.js → chunk-c8chx29p.js} +179 -51
- package/dist/cli/chunk-c8chx29p.js.map +36 -0
- package/dist/cli/{chunk-qs4q5p4e.js → chunk-crgn1q09.js} +32 -14
- package/dist/cli/chunk-crgn1q09.js.map +10 -0
- package/dist/cli/chunk-e04dxsz1.js +39 -0
- package/dist/cli/chunk-e04dxsz1.js.map +10 -0
- package/dist/cli/{chunk-yt5n7ppj.js → chunk-ey84smr6.js} +17 -7
- package/dist/cli/chunk-ey84smr6.js.map +10 -0
- package/dist/cli/{chunk-f2z5v128.js → chunk-g4hq16wv.js} +14 -15
- package/dist/cli/{chunk-f2z5v128.js.map → chunk-g4hq16wv.js.map} +2 -2
- package/dist/cli/{chunk-fa25z98p.js → chunk-ga0pf4aj.js} +9 -8
- package/dist/cli/chunk-ga0pf4aj.js.map +11 -0
- package/dist/cli/{chunk-kpf8rrjc.js → chunk-hm3vjy5s.js} +109 -58
- package/dist/cli/chunk-hm3vjy5s.js.map +19 -0
- package/dist/cli/{chunk-fs23ddbb.js → chunk-j85vccga.js} +625 -750
- package/dist/cli/chunk-j85vccga.js.map +36 -0
- package/dist/cli/{chunk-ch6g3ar0.js → chunk-p3v96n38.js} +6 -6
- package/dist/cli/{chunk-ch6g3ar0.js.map → chunk-p3v96n38.js.map} +3 -3
- package/dist/cli/{chunk-q5163e60.js → chunk-p73c0m7w.js} +21 -19
- package/dist/cli/chunk-p73c0m7w.js.map +11 -0
- package/dist/cli/{chunk-dh8cwk36.js → chunk-pehfxfta.js} +24 -9
- package/dist/cli/chunk-pehfxfta.js.map +10 -0
- package/dist/cli/{chunk-qkqwkpte.js → chunk-pv29h0wf.js} +3688 -1313
- package/dist/cli/chunk-pv29h0wf.js.map +190 -0
- package/dist/cli/{chunk-6vm74dry.js → chunk-q58y5e6a.js} +10 -10
- package/dist/cli/{chunk-6vm74dry.js.map → chunk-q58y5e6a.js.map} +3 -3
- package/dist/cli/{chunk-zxcczpyx.js → chunk-r20tn01b.js} +1 -1
- package/dist/cli/{chunk-m3vmjgmq.js → chunk-r9rcc4w7.js} +16 -8
- package/dist/cli/chunk-r9rcc4w7.js.map +10 -0
- package/dist/cli/{chunk-5shv93fd.js → chunk-tkacnehg.js} +2 -2
- package/dist/cli/{chunk-zxh4d9vy.js → chunk-tzmab476.js} +4 -4
- package/dist/cli/{chunk-yw7dm696.js → chunk-vg9r4eb9.js} +24 -11
- package/dist/cli/chunk-vg9r4eb9.js.map +14 -0
- package/dist/cli/{chunk-79jhk4py.js → chunk-wrr3j9w9.js} +260 -132
- package/dist/cli/chunk-wrr3j9w9.js.map +35 -0
- package/dist/cli/{chunk-6crbhc3x.js → chunk-yfyb25rh.js} +54 -27
- package/dist/cli/chunk-yfyb25rh.js.map +14 -0
- package/dist/cli/index.js +162 -35
- package/dist/cli/index.js.map +4 -4
- package/dist/types/ai/agent-surface.d.ts +32 -0
- package/dist/types/ai/api-catalog.d.ts +7 -1
- package/dist/types/ai/ask-context.d.ts +7 -0
- package/dist/types/ai/component-markdown.d.ts +4 -4
- package/dist/types/ai/link-headers.d.ts +8 -1
- package/dist/types/ai/openapi-components.d.ts +5 -2
- package/dist/types/ai/relative-links.d.ts +11 -4
- package/dist/types/ai/skills.d.ts +4 -1
- package/dist/types/ai/static-expression.d.ts +28 -0
- package/dist/types/ai/tar.d.ts +1 -3
- package/dist/types/analytics/databuddy.d.ts +43 -0
- package/dist/types/analytics/index.d.ts +4 -0
- package/dist/types/analytics/one-dollar-stats.d.ts +48 -0
- package/dist/types/analytics/schema.d.ts +28 -0
- package/dist/types/astro/integration.d.ts +3 -2
- package/dist/types/cli/env.d.ts +5 -0
- package/dist/types/cli/init/scaffold.d.ts +19 -3
- package/dist/types/cli/init/starter-spec.d.ts +11 -0
- package/dist/types/core/base-path.d.ts +24 -1
- package/dist/types/core/config-input.d.ts +13 -11
- package/dist/types/core/config.d.ts +2 -2
- package/dist/types/core/directive-diagnostics.d.ts +12 -0
- package/dist/types/core/graph.d.ts +2 -0
- package/dist/types/core/heading-markers.d.ts +5 -7
- package/dist/types/core/i18n-ui.d.ts +31 -0
- package/dist/types/core/i18n.d.ts +9 -1
- package/dist/types/core/last-modified.d.ts +10 -0
- package/dist/types/core/links.d.ts +3 -1
- package/dist/types/core/load-module.d.ts +10 -0
- package/dist/types/core/locale-links.d.ts +12 -2
- package/dist/types/core/meta.d.ts +13 -1
- package/dist/types/core/nav-diagnostics.d.ts +10 -0
- package/dist/types/core/navigation.d.ts +38 -0
- package/dist/types/core/ordering-prefix.d.ts +4 -0
- package/dist/types/core/safe-links.d.ts +3 -1
- package/dist/types/core/schema.d.ts +59 -13
- package/dist/types/core/sources/github-releases.d.ts +5 -0
- package/dist/types/core/sources/lower.d.ts +38 -13
- package/dist/types/core/sources/normalize.d.ts +23 -2
- package/dist/types/core/sources/remote.d.ts +11 -1
- package/dist/types/core/sources/resolve.d.ts +12 -0
- package/dist/types/core/sources/types.d.ts +31 -0
- package/dist/types/core/sources/watch.d.ts +12 -5
- package/dist/types/core/standard-schema.d.ts +5 -0
- package/dist/types/core/types.d.ts +9 -0
- package/dist/types/deploy/adapters/node.d.ts +5 -2
- package/dist/types/deploy/adapters/types.d.ts +7 -0
- package/dist/types/deploy/artifacts.d.ts +6 -4
- package/dist/types/deploy/cloudflare-negotiation.d.ts +3 -2
- package/dist/types/deploy/headers.d.ts +36 -7
- package/dist/types/deploy/node-headers.d.ts +43 -8
- package/dist/types/deploy/platforms/netlify.d.ts +27 -2
- package/dist/types/deploy/platforms/node.d.ts +6 -5
- package/dist/types/deploy/platforms/types.d.ts +15 -0
- package/dist/types/deploy/platforms/vercel.d.ts +3 -2
- package/dist/types/deploy/redirects.d.ts +31 -15
- package/dist/types/deploy/vercel-negotiation.d.ts +3 -2
- package/dist/types/markdown/directives.d.ts +62 -0
- package/dist/types/markdown/features.d.ts +21 -0
- package/dist/types/markdown/mdast.d.ts +63 -0
- package/dist/types/openapi/asyncapi.d.ts +4 -2
- package/dist/types/openapi/model.d.ts +20 -6
- package/dist/types/search/sync/algolia.d.ts +3 -1
- package/docs/01-quickstart.mdx +3 -2
- package/docs/02-deployment.mdx +20 -9
- package/docs/08-faq.mdx +10 -3
- package/docs/advanced/changelog.mdx +1 -1
- package/docs/advanced/custom-pages.mdx +7 -5
- package/docs/cli/audit.mdx +19 -3
- package/docs/cli/doctor.mdx +2 -2
- package/docs/cli/evals.mdx +4 -4
- package/docs/cli/index.mdx +4 -1
- package/docs/cli/translate.mdx +4 -4
- package/docs/cli/version.mdx +1 -1
- package/docs/configuration/analytics.mdx +42 -2
- package/docs/configuration/assistant.mdx +1 -1
- package/docs/configuration/customization.mdx +6 -3
- package/docs/configuration/index.mdx +5 -3
- package/docs/configuration/search.mdx +2 -2
- package/docs/content/components.mdx +2 -2
- package/docs/content/frontmatter.mdx +5 -1
- package/docs/content/i18n.mdx +3 -1
- package/docs/content/index.mdx +8 -4
- package/docs/content/islands.mdx +1 -1
- package/docs/content/meta.mdx +7 -3
- package/docs/content/navigation.mdx +29 -4
- package/docs/content/sources.mdx +18 -16
- package/docs/content/syntax.mdx +14 -0
- package/docs/content/versioning.mdx +2 -1
- package/docs/discoverability/agent-discovery.mdx +22 -8
- package/docs/discoverability/index.mdx +4 -3
- package/docs/discoverability/llms-txt.mdx +2 -5
- package/docs/discoverability/markdown.mdx +6 -4
- package/docs/discoverability/mcp.mdx +4 -0
- package/docs/discoverability/metadata.mdx +3 -2
- package/docs/discoverability/open-graph.mdx +8 -4
- package/docs/discoverability/rss.mdx +4 -2
- package/docs/references/asyncapi.mdx +2 -2
- package/docs/references/graphql.mdx +2 -2
- package/docs/references/openapi.mdx +6 -4
- package/package.json +1 -1
- package/skills/blume-migrate/SKILL.md +6 -6
- package/skills/blume-migrate/references/docusaurus.md +6 -6
- package/skills/blume-migrate/references/fumadocs.md +1 -1
- package/skills/blume-migrate/references/mintlify.md +3 -3
- package/skills/blume-migrate/references/monorepo.md +1 -1
- package/skills/blume-migrate/references/nextra.md +2 -2
- package/skills/blume-migrate/references/starlight.md +5 -5
- package/skills/blume-migrate/scripts/mintlify-codemod.mjs +9 -4
- package/skills/blume-update-docs/references/audit-checklist.md +1 -1
- package/src/ai/agent-readability.ts +2 -2
- package/src/ai/agent-surface.ts +56 -0
- package/src/ai/ai-catalog.ts +6 -2
- package/src/ai/api/handlers.ts +2 -2
- package/src/ai/api/spec.ts +17 -4
- package/src/ai/api-catalog.ts +13 -3
- package/src/ai/ask-context.ts +14 -2
- package/src/ai/ask-data.ts +26 -12
- package/src/ai/changelog-markdown.ts +2 -2
- package/src/ai/component-markdown.ts +43 -37
- package/src/ai/link-headers.ts +22 -8
- package/src/ai/llms.ts +22 -10
- package/src/ai/markdown.ts +23 -11
- package/src/ai/mcp/discovery.ts +2 -2
- package/src/ai/mcp/query.ts +2 -2
- package/src/ai/mcp/server.ts +80 -9
- package/src/ai/openapi-components.ts +22 -6
- package/src/ai/relative-links.ts +99 -15
- package/src/ai/serializers.ts +2 -1
- package/src/ai/skills.ts +14 -1
- package/src/ai/static-expression.ts +416 -0
- package/src/ai/tar.ts +139 -12
- package/src/ai/visibility.ts +45 -14
- package/src/analytics/databuddy.ts +67 -0
- package/src/analytics/head.ts +8 -0
- package/src/analytics/index.ts +7 -0
- package/src/analytics/one-dollar-stats.ts +86 -0
- package/src/analytics/posthog.ts +21 -3
- package/src/analytics/schema.ts +4 -0
- package/src/astro/generate.ts +72 -28
- package/src/astro/include-hmr.ts +31 -12
- package/src/astro/include-refresh.ts +19 -8
- package/src/astro/integration.ts +108 -14
- package/src/astro/runtime-modules.ts +28 -13
- package/src/astro/templates.ts +139 -57
- package/src/audit/catalog.ts +2 -2
- package/src/audit/checks/assets.ts +25 -5
- package/src/audit/checks/content.ts +20 -2
- package/src/audit/checks/i18n.ts +46 -8
- package/src/audit/checks/indexability.ts +39 -19
- package/src/audit/checks/links.ts +22 -1
- package/src/audit/checks/llms.ts +6 -3
- package/src/audit/checks/network.ts +3 -1
- package/src/audit/checks/og-image.ts +10 -0
- package/src/audit/checks/robots.ts +6 -1
- package/src/audit/checks/sitemap.ts +56 -31
- package/src/audit/checks/social.ts +21 -2
- package/src/audit/crawl.ts +88 -15
- package/src/audit/graph.ts +3 -1
- package/src/audit/report.ts +54 -17
- package/src/audit/run.ts +13 -9
- package/src/audit/snapshot.ts +5 -0
- package/src/audit/types.ts +18 -0
- package/src/audit/url.ts +37 -6
- package/src/cli/args.ts +32 -0
- package/src/cli/build-failure.ts +50 -0
- package/src/cli/commands/audit.ts +11 -1
- package/src/cli/commands/build.ts +19 -5
- package/src/cli/commands/check.ts +2 -0
- package/src/cli/commands/doctor.ts +3 -1
- package/src/cli/commands/eval.ts +20 -18
- package/src/cli/commands/init.ts +15 -5
- package/src/cli/commands/preview.ts +15 -0
- package/src/cli/commands/sync.ts +2 -0
- package/src/cli/commands/translate.ts +18 -18
- package/src/cli/commands/upgrade.ts +11 -0
- package/src/cli/commands/validate.ts +3 -1
- package/src/cli/dev-lock.ts +157 -37
- package/src/cli/eject-scripts.ts +32 -7
- package/src/cli/env.ts +12 -1
- package/src/cli/init/scaffold.ts +117 -11
- package/src/cli/init/starter-spec.ts +235 -0
- package/src/cli/report-format.ts +11 -6
- package/src/components/colors.ts +19 -0
- package/src/components/content/AccordionItem.astro +26 -22
- package/src/components/content/Badge.astro +7 -12
- package/src/components/content/Card.astro +2 -2
- package/src/components/content/Component.astro +11 -5
- package/src/components/content/Expandable.astro +5 -1
- package/src/components/content/Frame.astro +2 -7
- package/src/components/content/GithubInfo.astro +12 -2
- package/src/components/content/Prompt.astro +2 -7
- package/src/components/content/Tab.astro +0 -1
- package/src/components/content/Tabs.astro +58 -5
- package/src/components/content/Tile.astro +1 -1
- package/src/components/content/Tooltip.astro +69 -7
- package/src/components/content/Tree.astro +7 -2
- package/src/components/content/TypeTable.astro +10 -5
- package/src/components/content/Update.astro +8 -2
- package/src/components/content/auto-type-table.ts +4 -1
- package/src/components/content/badge-color.ts +20 -0
- package/src/components/content/base-href.ts +14 -22
- package/src/components/content/inline-markdown.ts +27 -7
- package/src/components/copy-feedback.ts +35 -8
- package/src/components/islands/assistant.tsx +37 -6
- package/src/components/islands/base-path.ts +47 -10
- package/src/components/islands/hooks.ts +42 -21
- package/src/components/islands/webmcp.ts +16 -10
- package/src/components/layout/Banner.astro +23 -4
- package/src/components/layout/Breadcrumbs.astro +5 -2
- package/src/components/layout/DiscoveryLinks.astro +9 -5
- package/src/components/layout/Header.astro +23 -10
- package/src/components/layout/LanguageSwitcher.astro +2 -2
- package/src/components/layout/Logo.astro +5 -0
- package/src/components/layout/NavSelector.astro +8 -3
- package/src/components/layout/NavTabMenu.astro +133 -0
- package/src/components/layout/NavTree.astro +31 -12
- package/src/components/layout/NavTreeCache.astro +5 -2
- package/src/components/layout/NavTreeScript.astro +45 -5
- package/src/components/layout/PageActions.astro +4 -3
- package/src/components/layout/PageLayout.astro +28 -13
- package/src/components/layout/Pagination.astro +3 -3
- package/src/components/layout/ReferenceLayout.astro +4 -1
- package/src/components/layout/RootLayout.astro +25 -12
- package/src/components/layout/Search.astro +38 -14
- package/src/components/layout/VersionBanner.astro +2 -2
- package/src/components/layout/analytics-client.ts +14 -0
- package/src/components/layout/toc-active.ts +41 -0
- package/src/components/layout/toc-element.ts +8 -14
- package/src/components/openapi/ApiTagOperations.astro +2 -2
- package/src/components/openapi/AsyncApiOperation.astro +7 -4
- package/src/components/openapi/GraphqlChip.astro +2 -2
- package/src/components/openapi/GraphqlType.astro +11 -3
- package/src/components/openapi/MessageComposer.astro +1 -1
- package/src/components/openapi/Operation.astro +23 -5
- package/src/components/openapi/PanelTabs.astro +4 -1
- package/src/components/openapi/Playground.astro +8 -2
- package/src/components/openapi/RequestPanel.astro +13 -6
- package/src/components/openapi/SchemaProperty.astro +11 -33
- package/src/components/openapi/SchemaTable.astro +34 -52
- package/src/components/openapi/async.ts +38 -6
- package/src/components/openapi/helpers.ts +100 -12
- package/src/components/openapi/message-composer.ts +14 -1
- package/src/components/openapi/message-model.ts +12 -2
- package/src/components/openapi/message.ts +21 -3
- package/src/components/openapi/operation-model.ts +119 -17
- package/src/components/openapi/panel.ts +31 -5
- package/src/components/openapi/param-style.ts +181 -0
- package/src/components/openapi/playground-client.ts +110 -23
- package/src/components/openapi/playground-schema.ts +25 -6
- package/src/components/openapi/request.ts +192 -26
- package/src/components/openapi/schema-tree.ts +209 -0
- package/src/components/openapi/snippets.ts +113 -19
- package/src/components/openapi/validate-json.ts +1 -1
- package/src/components/openapi/ws-client.ts +18 -2
- package/src/core/base-path.ts +69 -8
- package/src/core/config-input.ts +13 -11
- package/src/core/config.ts +18 -4
- package/src/core/diagnostics.ts +219 -30
- package/src/core/directive-diagnostics.ts +99 -0
- package/src/core/frontmatter.ts +21 -18
- package/src/core/graph.ts +120 -11
- package/src/core/heading-markers.ts +5 -18
- package/src/core/i18n-ui.ts +39 -2
- package/src/core/i18n.ts +44 -5
- package/src/core/last-modified.ts +25 -3
- package/src/core/links.ts +7 -4
- package/src/core/load-module.ts +20 -0
- package/src/core/locale-links.ts +22 -18
- package/src/core/manifest.ts +3 -2
- package/src/core/meta.ts +89 -12
- package/src/core/nav-diagnostics.ts +56 -1
- package/src/core/navigation.ts +272 -83
- package/src/core/ordering-prefix.ts +27 -0
- package/src/core/project-graph.ts +50 -6
- package/src/core/safe-href.ts +53 -1
- package/src/core/safe-links.ts +11 -2
- package/src/core/schema.ts +94 -18
- package/src/core/sources/assets.ts +83 -41
- package/src/core/sources/contentful-rich-text.ts +28 -20
- package/src/core/sources/contentful.ts +25 -12
- package/src/core/sources/filesystem.ts +25 -3
- package/src/core/sources/github-releases.ts +131 -11
- package/src/core/sources/lexical.ts +30 -20
- package/src/core/sources/lower.ts +276 -56
- package/src/core/sources/mdx-remote.ts +52 -16
- package/src/core/sources/normalize.ts +456 -119
- package/src/core/sources/notion.ts +77 -34
- package/src/core/sources/obsidian.ts +40 -9
- package/src/core/sources/payload.ts +1 -0
- package/src/core/sources/portable-text.ts +85 -49
- package/src/core/sources/remote.ts +18 -2
- package/src/core/sources/resolve.ts +52 -33
- package/src/core/sources/sanity.ts +1 -0
- package/src/core/sources/strapi-blocks.ts +28 -19
- package/src/core/sources/strapi.ts +1 -0
- package/src/core/sources/types.ts +31 -0
- package/src/core/sources/watch.ts +20 -7
- package/src/core/standard-schema.ts +10 -6
- package/src/core/types.ts +9 -0
- package/src/core/ui-packs/ar.ts +13 -0
- package/src/core/ui-packs/bg.ts +13 -0
- package/src/core/ui-packs/bn.ts +13 -0
- package/src/core/ui-packs/ca.ts +13 -0
- package/src/core/ui-packs/cs.ts +13 -0
- package/src/core/ui-packs/da.ts +13 -0
- package/src/core/ui-packs/de.ts +13 -0
- package/src/core/ui-packs/el.ts +13 -0
- package/src/core/ui-packs/es.ts +13 -0
- package/src/core/ui-packs/fa.ts +13 -0
- package/src/core/ui-packs/fi.ts +13 -0
- package/src/core/ui-packs/fr.ts +13 -0
- package/src/core/ui-packs/he.ts +13 -0
- package/src/core/ui-packs/hi.ts +13 -0
- package/src/core/ui-packs/hr.ts +13 -0
- package/src/core/ui-packs/hu.ts +13 -0
- package/src/core/ui-packs/id.ts +13 -0
- package/src/core/ui-packs/it.ts +13 -0
- package/src/core/ui-packs/ja.ts +13 -0
- package/src/core/ui-packs/ko.ts +13 -0
- package/src/core/ui-packs/nl.ts +13 -0
- package/src/core/ui-packs/no.ts +13 -0
- package/src/core/ui-packs/pl.ts +13 -0
- package/src/core/ui-packs/pt-br.ts +13 -0
- package/src/core/ui-packs/pt.ts +13 -0
- package/src/core/ui-packs/ro.ts +13 -0
- package/src/core/ui-packs/ru.ts +13 -0
- package/src/core/ui-packs/sk.ts +13 -0
- package/src/core/ui-packs/sr.ts +13 -0
- package/src/core/ui-packs/sv.ts +13 -0
- package/src/core/ui-packs/th.ts +13 -0
- package/src/core/ui-packs/tr.ts +13 -0
- package/src/core/ui-packs/uk.ts +13 -0
- package/src/core/ui-packs/vi.ts +13 -0
- package/src/core/ui-packs/zh-tw.ts +13 -0
- package/src/core/ui-packs/zh.ts +13 -0
- package/src/core/version-cut.ts +69 -17
- package/src/core/versions.ts +4 -1
- package/src/deploy/adapters/node.ts +5 -2
- package/src/deploy/adapters/registry.ts +2 -1
- package/src/deploy/adapters/types.ts +13 -1
- package/src/deploy/artifacts.ts +52 -11
- package/src/deploy/cloudflare-negotiation.ts +27 -16
- package/src/deploy/headers.ts +75 -55
- package/src/deploy/node-headers.ts +148 -27
- package/src/deploy/platforms/cloudflare.ts +13 -3
- package/src/deploy/platforms/netlify.ts +83 -5
- package/src/deploy/platforms/node.ts +8 -5
- package/src/deploy/platforms/static.ts +2 -0
- package/src/deploy/platforms/types.ts +15 -0
- package/src/deploy/platforms/vercel.ts +10 -3
- package/src/deploy/redirects.ts +68 -21
- package/src/deploy/robots.ts +2 -2
- package/src/deploy/rss.ts +4 -3
- package/src/deploy/sitemap.ts +7 -5
- package/src/deploy/vercel-negotiation.ts +35 -3
- package/src/eval/agents.ts +10 -2
- package/src/eval/run.ts +25 -0
- package/src/markdown/base-links.ts +74 -29
- package/src/markdown/directives.ts +242 -36
- package/src/markdown/features.ts +17 -0
- package/src/markdown/index.ts +13 -9
- package/src/markdown/mdast.ts +5 -2
- package/src/markdown/relative-links.ts +15 -27
- package/src/markdown/route-snapshot.ts +37 -0
- package/src/og/card.ts +149 -9
- package/src/og/derive.ts +156 -5
- package/src/og/index.ts +1 -0
- package/src/openapi/asyncapi.ts +4 -2
- package/src/openapi/graphql-build.ts +28 -2
- package/src/openapi/model.ts +99 -27
- package/src/openapi/proxy.ts +63 -10
- package/src/openapi/render-mdx.ts +51 -3
- package/src/registry/eject.ts +297 -43
- package/src/search/adapters/version-scope.ts +30 -0
- package/src/search/documents.ts +89 -27
- package/src/search/popular.ts +2 -1
- package/src/search/sync/algolia.ts +36 -2
- package/src/seo/jsonld.ts +7 -3
- package/src/sources/registry.ts +5 -0
- package/src/theme/entry.ts +11 -4
- package/src/translate/agents.ts +6 -1
- package/src/translate/ledger.ts +26 -3
- package/src/translate/meta.ts +76 -24
- package/src/translate/run.ts +14 -8
- package/src/translate/validate.ts +14 -2
- package/src/translate/work-list.ts +91 -19
- package/src/upgrade/upgrade.ts +36 -4
- package/dist/cli/chunk-27g6wdth.js.map +0 -10
- package/dist/cli/chunk-2hn4b8z7.js.map +0 -12
- package/dist/cli/chunk-6crbhc3x.js.map +0 -14
- package/dist/cli/chunk-6hsn950k.js.map +0 -10
- package/dist/cli/chunk-79jhk4py.js.map +0 -35
- package/dist/cli/chunk-82bbrxdn.js +0 -51
- package/dist/cli/chunk-82bbrxdn.js.map +0 -10
- package/dist/cli/chunk-abh8yjkn.js +0 -31
- package/dist/cli/chunk-abh8yjkn.js.map +0 -10
- package/dist/cli/chunk-ce574jw2.js +0 -23
- package/dist/cli/chunk-ce574jw2.js.map +0 -10
- package/dist/cli/chunk-dh8cwk36.js.map +0 -10
- package/dist/cli/chunk-epjnccmv.js.map +0 -10
- package/dist/cli/chunk-fa25z98p.js.map +0 -11
- package/dist/cli/chunk-fs23ddbb.js.map +0 -35
- package/dist/cli/chunk-fz5wtpmh.js.map +0 -10
- package/dist/cli/chunk-jwyddg7y.js.map +0 -15
- package/dist/cli/chunk-kpf8rrjc.js.map +0 -19
- package/dist/cli/chunk-m3vmjgmq.js.map +0 -10
- package/dist/cli/chunk-mb2919y2.js.map +0 -10
- package/dist/cli/chunk-q5163e60.js.map +0 -11
- package/dist/cli/chunk-qkqwkpte.js.map +0 -182
- package/dist/cli/chunk-qs4q5p4e.js.map +0 -10
- package/dist/cli/chunk-s1p84fyh.js.map +0 -10
- package/dist/cli/chunk-wgm7m9qk.js.map +0 -36
- package/dist/cli/chunk-yt5n7ppj.js.map +0 -10
- package/dist/cli/chunk-yw7dm696.js.map +0 -14
- /package/dist/cli/{chunk-s6jhgk0q.js.map → chunk-2eytanqx.js.map} +0 -0
- /package/dist/cli/{chunk-hdpx1tax.js.map → chunk-2z928egk.js.map} +0 -0
- /package/dist/cli/{chunk-ah61y8py.js.map → chunk-364znk6q.js.map} +0 -0
- /package/dist/cli/{chunk-vtk4a6dg.js.map → chunk-8ktnccpt.js.map} +0 -0
- /package/dist/cli/{chunk-fxypxtvm.js.map → chunk-a58773jm.js.map} +0 -0
- /package/dist/cli/{chunk-wm7js3j9.js.map → chunk-b07cmahc.js.map} +0 -0
- /package/dist/cli/{chunk-zxcczpyx.js.map → chunk-r20tn01b.js.map} +0 -0
- /package/dist/cli/{chunk-5shv93fd.js.map → chunk-tkacnehg.js.map} +0 -0
- /package/dist/cli/{chunk-zxh4d9vy.js.map → chunk-tzmab476.js.map} +0 -0
|
@@ -11,9 +11,18 @@ export interface RequestSample {
|
|
|
11
11
|
method: string;
|
|
12
12
|
url: string;
|
|
13
13
|
headers: Record<string, string>;
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* The request body as sent, when the operation takes one: JSON text,
|
|
16
|
+
* form-urlencoded pairs, or a raw media type's text.
|
|
17
|
+
*/
|
|
15
18
|
body?: string;
|
|
16
19
|
bodyValue?: unknown;
|
|
20
|
+
/**
|
|
21
|
+
* A `multipart/form-data` body's parts as `[name, value]` pairs, set
|
|
22
|
+
* instead of `body`. The request carries no Content-Type of its own for
|
|
23
|
+
* them: the client writes one with the parts' boundary.
|
|
24
|
+
*/
|
|
25
|
+
formData?: [string, string][];
|
|
17
26
|
}
|
|
18
27
|
|
|
19
28
|
const headerLines = (
|
|
@@ -22,26 +31,73 @@ const headerLines = (
|
|
|
22
31
|
): string[] =>
|
|
23
32
|
Object.entries(headers).map(([key, value]) => format(key, value));
|
|
24
33
|
|
|
34
|
+
/**
|
|
35
|
+
* A single-quoted POSIX shell word. Nothing expands inside single quotes — no
|
|
36
|
+
* `$`, backtick, `!`, or `\` — so a value reaches curl byte for byte; a
|
|
37
|
+
* literal `'` closes the quote, adds an escaped one, and reopens it.
|
|
38
|
+
*/
|
|
39
|
+
const shellQuote = (value: string): string =>
|
|
40
|
+
`'${value.replaceAll("'", String.raw`'\''`)}'`;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* A double-quoted string literal for the JavaScript and Python samples. JSON's
|
|
44
|
+
* string escapes are a subset of both languages' — a quote in a header value
|
|
45
|
+
* (`If-Match: "33a64df5"`) or a backslash becomes an escape rather than
|
|
46
|
+
* ending the literal early.
|
|
47
|
+
*/
|
|
48
|
+
const stringLiteral = (value: string): string => JSON.stringify(value);
|
|
49
|
+
|
|
25
50
|
const curlSnippet = (sample: RequestSample): string => {
|
|
26
51
|
const lines = [
|
|
27
|
-
|
|
28
|
-
|
|
52
|
+
// `-X HEAD` sends a HEAD but still waits for the body the response
|
|
53
|
+
// announces, so the command hangs; `--head` knows there is none.
|
|
54
|
+
sample.method === "HEAD"
|
|
55
|
+
? `curl --head ${shellQuote(sample.url)}`
|
|
56
|
+
: `curl -X ${sample.method} ${shellQuote(sample.url)}`,
|
|
57
|
+
...headerLines(
|
|
58
|
+
sample.headers,
|
|
59
|
+
(key, value) => ` -H ${shellQuote(`${key}: ${value}`)}`
|
|
60
|
+
),
|
|
29
61
|
];
|
|
30
62
|
if (sample.body) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
63
|
+
lines.push(` -d ${shellQuote(sample.body)}`);
|
|
64
|
+
}
|
|
65
|
+
// `--form-string`, not `-F`: `-F` reads a value starting with `@` or `<` as
|
|
66
|
+
// a file to upload.
|
|
67
|
+
for (const [name, value] of sample.formData ?? []) {
|
|
68
|
+
lines.push(` --form-string ${shellQuote(`${name}=${value}`)}`);
|
|
35
69
|
}
|
|
36
70
|
return lines.join(" \\\n");
|
|
37
71
|
};
|
|
38
72
|
|
|
73
|
+
/**
|
|
74
|
+
* Whether fetch refuses to send `method` (an upper-case HTTP method). TRACE is
|
|
75
|
+
* one of the Fetch standard's forbidden methods, and the only one an OpenAPI
|
|
76
|
+
* spec can declare: browsers and Node's fetch alike throw a TypeError before
|
|
77
|
+
* any request goes out.
|
|
78
|
+
*/
|
|
79
|
+
export const fetchRefusesMethod = (method: string): boolean =>
|
|
80
|
+
method === "TRACE";
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The JavaScript sample for a method fetch refuses: a note in place of a call
|
|
84
|
+
* that could only throw.
|
|
85
|
+
*/
|
|
86
|
+
const FETCH_REFUSED_NOTE = [
|
|
87
|
+
"// fetch() refuses the TRACE method: browsers and Node both throw before",
|
|
88
|
+
"// sending, so there's no fetch sample for this operation. Send it with",
|
|
89
|
+
"// curl or another HTTP client instead.",
|
|
90
|
+
].join("\n");
|
|
91
|
+
|
|
39
92
|
const fetchSnippet = (sample: RequestSample): string => {
|
|
40
|
-
|
|
93
|
+
if (fetchRefusesMethod(sample.method)) {
|
|
94
|
+
return FETCH_REFUSED_NOTE;
|
|
95
|
+
}
|
|
96
|
+
const options = [` method: ${stringLiteral(sample.method)}`];
|
|
41
97
|
if (Object.keys(sample.headers).length > 0) {
|
|
42
98
|
const headers = headerLines(
|
|
43
99
|
sample.headers,
|
|
44
|
-
(key, value) => `
|
|
100
|
+
(key, value) => ` ${stringLiteral(key)}: ${stringLiteral(value)}`
|
|
45
101
|
).join(",\n");
|
|
46
102
|
options.push(` headers: {\n${headers}\n }`);
|
|
47
103
|
}
|
|
@@ -53,32 +109,70 @@ const fetchSnippet = (sample: RequestSample): string => {
|
|
|
53
109
|
// and an id past 2^53 loses digits through a JS number. The string
|
|
54
110
|
// literal also stays syntactically valid while the editor holds mid-edit
|
|
55
111
|
// text that isn't JSON yet.
|
|
56
|
-
options.push(` body: ${
|
|
112
|
+
options.push(` body: ${stringLiteral(sample.body)}`);
|
|
113
|
+
}
|
|
114
|
+
// A FormData body: fetch writes the multipart Content-Type and boundary.
|
|
115
|
+
let form = "";
|
|
116
|
+
if (sample.formData) {
|
|
117
|
+
form = [
|
|
118
|
+
"const form = new FormData();\n",
|
|
119
|
+
...sample.formData.map(
|
|
120
|
+
([name, value]) =>
|
|
121
|
+
`form.append(${stringLiteral(name)}, ${stringLiteral(value)});\n`
|
|
122
|
+
),
|
|
123
|
+
"\n",
|
|
124
|
+
].join("");
|
|
125
|
+
options.push(" body: form");
|
|
57
126
|
}
|
|
58
|
-
return
|
|
127
|
+
return `${form}const response = await fetch(${stringLiteral(sample.url)}, {\n${options.join(
|
|
59
128
|
",\n"
|
|
60
129
|
)}\n});`;
|
|
61
130
|
};
|
|
62
131
|
|
|
132
|
+
/** The methods `requests` has a module-level helper for. */
|
|
133
|
+
const PYTHON_METHODS = new Set([
|
|
134
|
+
"delete",
|
|
135
|
+
"get",
|
|
136
|
+
"head",
|
|
137
|
+
"options",
|
|
138
|
+
"patch",
|
|
139
|
+
"post",
|
|
140
|
+
"put",
|
|
141
|
+
]);
|
|
142
|
+
|
|
63
143
|
const pythonSnippet = (sample: RequestSample): string => {
|
|
64
|
-
const args = [`
|
|
144
|
+
const args = [` ${stringLiteral(sample.url)}`];
|
|
65
145
|
if (Object.keys(sample.headers).length > 0) {
|
|
66
146
|
const headers = headerLines(
|
|
67
147
|
sample.headers,
|
|
68
|
-
(key, value) => `
|
|
148
|
+
(key, value) => ` ${stringLiteral(key)}: ${stringLiteral(value)}`
|
|
69
149
|
).join(",\n");
|
|
70
150
|
args.push(` headers={\n${headers}\n }`);
|
|
71
151
|
}
|
|
72
152
|
if (sample.body) {
|
|
73
153
|
// Same rule as the fetch snippet: the raw text travels as a string via
|
|
74
|
-
// `data=`
|
|
75
|
-
// valid) rather than a `json=` dict — a Python literal re-serializes
|
|
154
|
+
// `data=` rather than a `json=` dict — a Python literal re-serializes
|
|
76
155
|
// `1e400` as `Infinity` and would otherwise diverge from the live send.
|
|
77
|
-
args.push(` data=${
|
|
156
|
+
args.push(` data=${stringLiteral(sample.body)}`);
|
|
78
157
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
158
|
+
if (sample.formData) {
|
|
159
|
+
// `files=` is what makes requests encode multipart; a `(None, value)`
|
|
160
|
+
// tuple is a plain field rather than an upload.
|
|
161
|
+
const parts = sample.formData.map(
|
|
162
|
+
([name, value]) =>
|
|
163
|
+
` (${stringLiteral(name)}, (None, ${stringLiteral(value)})),\n`
|
|
164
|
+
);
|
|
165
|
+
args.push(` files=[\n${parts.join("")} ]`);
|
|
166
|
+
}
|
|
167
|
+
// requests has a helper per common method; anything else (TRACE) goes
|
|
168
|
+
// through `requests.request` with the method named.
|
|
169
|
+
const method = sample.method.toLowerCase();
|
|
170
|
+
let call = `requests.${method}`;
|
|
171
|
+
if (!PYTHON_METHODS.has(method)) {
|
|
172
|
+
call = "requests.request";
|
|
173
|
+
args.unshift(` ${stringLiteral(sample.method)}`);
|
|
174
|
+
}
|
|
175
|
+
return `import requests\n\nresponse = ${call}(\n${args.join(",\n")},\n)`;
|
|
82
176
|
};
|
|
83
177
|
|
|
84
178
|
/** A code-sample language: config id -> label, Shiki lang, and builder. */
|
|
@@ -57,7 +57,10 @@ export interface WsClientOptions {
|
|
|
57
57
|
/** Clock for frame timestamps; defaults to `Date.now`. */
|
|
58
58
|
now?: () => number;
|
|
59
59
|
onFrame: (frame: WsFrame) => void;
|
|
60
|
-
/**
|
|
60
|
+
/**
|
|
61
|
+
* State transitions, with an optional human detail: the close reason/code,
|
|
62
|
+
* or why a URL couldn't be dialed at all.
|
|
63
|
+
*/
|
|
61
64
|
onState: (state: WsState, detail?: string) => void;
|
|
62
65
|
}
|
|
63
66
|
|
|
@@ -125,7 +128,20 @@ export const createWsClient = (options: WsClientOptions): WsClient => {
|
|
|
125
128
|
return;
|
|
126
129
|
}
|
|
127
130
|
transition("connecting");
|
|
128
|
-
|
|
131
|
+
let next: SocketLike;
|
|
132
|
+
try {
|
|
133
|
+
next = create(url);
|
|
134
|
+
} catch (error) {
|
|
135
|
+
// `new WebSocket` throws synchronously on a URL it can't dial (a bad
|
|
136
|
+
// scheme, a malformed host), before any event could settle the state:
|
|
137
|
+
// left alone, the panel would say "Connecting…" forever with nothing to
|
|
138
|
+
// disconnect.
|
|
139
|
+
transition(
|
|
140
|
+
"error",
|
|
141
|
+
error instanceof Error ? error.message : String(error)
|
|
142
|
+
);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
129
145
|
socket = next;
|
|
130
146
|
// Every listener below is scoped to the socket it was wired for: a browser
|
|
131
147
|
// can deliver a discarded socket's error/close/message after `disconnect`
|
package/src/core/base-path.ts
CHANGED
|
@@ -73,16 +73,49 @@ export const isInternalPath = (target: string): boolean =>
|
|
|
73
73
|
export const isExternalUrl = (target: string): boolean =>
|
|
74
74
|
/^https?:\/\//iu.test(target) || target.startsWith("//");
|
|
75
75
|
|
|
76
|
+
/**
|
|
77
|
+
* The path part of a root-relative target, before any `?query` or `#fragment`
|
|
78
|
+
* (`/docs#install` -> `/docs`).
|
|
79
|
+
*/
|
|
80
|
+
const pathPart = (target: string): string => {
|
|
81
|
+
const at = target.search(/[#?]/u);
|
|
82
|
+
return at === -1 ? target : target.slice(0, at);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Whether `route`'s path already equals or sits under `base`. Only the path
|
|
87
|
+
* part is compared, so a fragment or query (`/docs#install`) doesn't hide a
|
|
88
|
+
* base written by hand.
|
|
89
|
+
*/
|
|
90
|
+
const isUnderBase = (base: string, route: string): boolean => {
|
|
91
|
+
const path = pathPart(route);
|
|
92
|
+
return path === base || path.startsWith(`${base}/`);
|
|
93
|
+
};
|
|
94
|
+
|
|
76
95
|
/**
|
|
77
96
|
* Idempotently prepend `basePath` to a root-relative route. A route already
|
|
78
97
|
* equal to or nested under the base is returned unchanged, so authors who write
|
|
79
|
-
* the base by hand (`/docs/x`) aren't double-prefixed to
|
|
98
|
+
* the base by hand (`/docs/x`, `/docs#install`) aren't double-prefixed to
|
|
99
|
+
* `/docs/docs/x`.
|
|
80
100
|
*/
|
|
81
101
|
export const withBasePath = (basePath: string, route: string): string => {
|
|
82
|
-
if (!basePath || !isInternalPath(route)) {
|
|
102
|
+
if (!basePath || !isInternalPath(route) || isUnderBase(basePath, route)) {
|
|
83
103
|
return route;
|
|
84
104
|
}
|
|
85
|
-
|
|
105
|
+
return route === "/" ? basePath : `${basePath}${route}`;
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Mount a route Blume generates under a base, unconditionally: `basePath` for
|
|
110
|
+
* a content route, `deployment.base` for any generated URL (a sitemap entry,
|
|
111
|
+
* a feed item). {@link withBasePath} leaves a route that already starts with
|
|
112
|
+
* the base alone, which is right for a link an author based by hand but wrong
|
|
113
|
+
* for a generated route: with `basePath: "/docs"`, `docs/guide.md` routes to
|
|
114
|
+
* `/docs/guide` before the base and publishes at `/docs/docs/guide`, not on
|
|
115
|
+
* top of the root `guide.md` — and likewise under `deployment.base: "/docs"`.
|
|
116
|
+
*/
|
|
117
|
+
export const mountBasePath = (basePath: string, route: string): string => {
|
|
118
|
+
if (!basePath) {
|
|
86
119
|
return route;
|
|
87
120
|
}
|
|
88
121
|
return route === "/" ? basePath : `${basePath}${route}`;
|
|
@@ -102,16 +135,44 @@ export const withComposedBasePath = (
|
|
|
102
135
|
route: string
|
|
103
136
|
): string => {
|
|
104
137
|
const composed = `${deployBase}${basePath}`;
|
|
105
|
-
if (
|
|
106
|
-
composed &&
|
|
107
|
-
isInternalPath(route) &&
|
|
108
|
-
(route === composed || route.startsWith(`${composed}/`))
|
|
109
|
-
) {
|
|
138
|
+
if (composed && isInternalPath(route) && isUnderBase(composed, route)) {
|
|
110
139
|
return route;
|
|
111
140
|
}
|
|
112
141
|
return withBasePath(deployBase, withBasePath(basePath, route));
|
|
113
142
|
};
|
|
114
143
|
|
|
144
|
+
/**
|
|
145
|
+
* A path whose final segment carries a file extension (`/spec.pdf`,
|
|
146
|
+
* `/logo.svg`) — a public asset, unless a page is served there.
|
|
147
|
+
*/
|
|
148
|
+
const DOTTED_PATH = /\.[a-z0-9]+$/iu;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Base a root-relative link an author wrote as if mounted at root — a content
|
|
152
|
+
* link (`markdown/base-links.ts`, `components/content/base-href.ts`) or a
|
|
153
|
+
* redirect target (`deploy/redirects.ts`) — by what it names. A page gains the
|
|
154
|
+
* composed stack ({@link withComposedBasePath}). A public asset — a path whose
|
|
155
|
+
* final segment carries a file extension, with no page served there (a dotted
|
|
156
|
+
* route like `/releases/v1.2` is still a page) — gains the deployment base
|
|
157
|
+
* alone: Astro serves `public/` under `deployment.base`, but never under
|
|
158
|
+
* `basePath`. `servesPage` answers whether a page is served at a
|
|
159
|
+
* `basePath`-prefixed, fragment-less path. Other targets pass through.
|
|
160
|
+
*/
|
|
161
|
+
export const withAuthoredBasePath = (
|
|
162
|
+
deployBase: string,
|
|
163
|
+
basePath: string,
|
|
164
|
+
target: string,
|
|
165
|
+
servesPage: (route: string) => boolean
|
|
166
|
+
): string => {
|
|
167
|
+
if (!isInternalPath(target)) {
|
|
168
|
+
return target;
|
|
169
|
+
}
|
|
170
|
+
const path = pathPart(target);
|
|
171
|
+
return DOTTED_PATH.test(path) && !servesPage(withBasePath(basePath, path))
|
|
172
|
+
? withBasePath(deployBase, target)
|
|
173
|
+
: withComposedBasePath(deployBase, basePath, target);
|
|
174
|
+
};
|
|
175
|
+
|
|
115
176
|
/**
|
|
116
177
|
* Remove `basePath` from the front of a route (`/docs/guide` -> `/guide`,
|
|
117
178
|
* `/docs` -> `/`). A route not under the base is returned unchanged. Inverse of
|
package/src/core/config-input.ts
CHANGED
|
@@ -596,14 +596,14 @@ export interface LlmsTxtConfig {
|
|
|
596
596
|
/**
|
|
597
597
|
* Markdown placed after the title and summary in `llms.txt`, before the
|
|
598
598
|
* page sections — the llms.txt spec's "details" block. Use it to tell
|
|
599
|
-
* agents when to reach for the product and how to call it (
|
|
600
|
-
*
|
|
601
|
-
* dropped.
|
|
599
|
+
* agents when to reach for the product and how to call it (the install
|
|
600
|
+
* command, the package name). The spec allows any Markdown there but
|
|
601
|
+
* headings. Blank values are dropped.
|
|
602
602
|
*
|
|
603
603
|
* ```ts
|
|
604
604
|
* agents: {
|
|
605
605
|
* llmsTxt: {
|
|
606
|
-
* details: "
|
|
606
|
+
* details: "Use Acme when…",
|
|
607
607
|
* },
|
|
608
608
|
* }
|
|
609
609
|
* ```
|
|
@@ -958,13 +958,15 @@ export interface OgConfig {
|
|
|
958
958
|
*/
|
|
959
959
|
enabled?: boolean;
|
|
960
960
|
/**
|
|
961
|
-
* Fonts for the generated card,
|
|
962
|
-
*
|
|
963
|
-
*
|
|
964
|
-
*
|
|
965
|
-
*
|
|
966
|
-
*
|
|
967
|
-
*
|
|
961
|
+
* Fonts for the generated card, replacing the default stack: Takumi's
|
|
962
|
+
* Latin-only built-in font plus a Noto fallback per script, which a card
|
|
963
|
+
* fetches only when its text needs one. A bare string is a Google Fonts
|
|
964
|
+
* family fetched at build; the name-only object form pins weights (`700`,
|
|
965
|
+
* `[400, 700]`, or a `"100..900"` variable range) and styles; the `src`
|
|
966
|
+
* form reads a local font file from the project instead. When omitted and
|
|
967
|
+
* `theme.fonts` is explicitly configured, the theme's display and body
|
|
968
|
+
* fonts are used automatically, ahead of the fallbacks — pass `[]` to opt
|
|
969
|
+
* out of both.
|
|
968
970
|
*/
|
|
969
971
|
fonts?: (
|
|
970
972
|
| string
|
package/src/core/config.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "node:fs";
|
|
2
2
|
|
|
3
|
+
import { basename } from "pathe";
|
|
3
4
|
import { z } from "zod";
|
|
4
5
|
|
|
5
6
|
import type { BlumeConfig } from "./config-input.ts";
|
|
@@ -9,7 +10,7 @@ import {
|
|
|
9
10
|
diagnosticsFromIssues,
|
|
10
11
|
diagnosticsFromZod,
|
|
11
12
|
} from "./diagnostics.ts";
|
|
12
|
-
import {
|
|
13
|
+
import { createDefaultExportLoader } from "./load-module.ts";
|
|
13
14
|
import { findConfigFile } from "./project.ts";
|
|
14
15
|
import { blumeConfigSchema } from "./schema.ts";
|
|
15
16
|
import type { ResolvedConfig } from "./schema.ts";
|
|
@@ -68,8 +69,8 @@ import type { Diagnostic } from "./types.ts";
|
|
|
68
69
|
* - `theme` — `accent` color, `fonts` (curated slugs, any provider family, or
|
|
69
70
|
* local font files), `radius`,
|
|
70
71
|
* `mode` (`system`/`light`/`dark`), and `background`.
|
|
71
|
-
* - `markdown` — `code` (language icons,
|
|
72
|
-
* `
|
|
72
|
+
* - `markdown` — `code` (language icons, light/dark Shiki `theme`, line
|
|
73
|
+
* `wrap`), `externalLinks`, `headingAnchors`, and `imageZoom`.
|
|
73
74
|
* - `toc` — on-page table of contents; `true`/`false` or a heading-level range.
|
|
74
75
|
* - `lastModified` — "Last updated" stamps from `git` history or frontmatter.
|
|
75
76
|
* - `feedback` — the per-page "Was this helpful?" widget (on by default).
|
|
@@ -199,7 +200,7 @@ export interface ConfigLoadResult {
|
|
|
199
200
|
themeFontsConfigured: boolean;
|
|
200
201
|
}
|
|
201
202
|
|
|
202
|
-
const importConfigModule =
|
|
203
|
+
const importConfigModule = createDefaultExportLoader();
|
|
203
204
|
|
|
204
205
|
/**
|
|
205
206
|
* The slice of a user config module probed before schema defaults apply:
|
|
@@ -290,6 +291,19 @@ export const loadConfig = async (
|
|
|
290
291
|
severity: "error",
|
|
291
292
|
});
|
|
292
293
|
}
|
|
294
|
+
// Validating whatever else the module holds would build a silent default
|
|
295
|
+
// site (a bare `defineConfig({…})` call) or reject a named `config` export
|
|
296
|
+
// as an unknown key, neither of which names the actual mistake.
|
|
297
|
+
if (raw === undefined) {
|
|
298
|
+
throw new BlumeError({
|
|
299
|
+
code: "BLUME_CONFIG_INVALID",
|
|
300
|
+
file: configFile,
|
|
301
|
+
message: `${basename(configFile)} has no default export, so Blume can't read its config.`,
|
|
302
|
+
severity: "error",
|
|
303
|
+
suggestion:
|
|
304
|
+
"Export the config as the file's default: `export default defineConfig({ … })`.",
|
|
305
|
+
});
|
|
306
|
+
}
|
|
293
307
|
}
|
|
294
308
|
|
|
295
309
|
// Read before parsing: schema defaults erase the set-vs-defaulted distinction.
|