blume 1.7.3 → 2.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/AGENTS.md +19 -0
- package/CHANGELOG.md +217 -0
- package/README.md +34 -21
- package/dist/cli/chunk-11j0384y.js +148 -0
- package/dist/cli/chunk-11j0384y.js.map +10 -0
- package/dist/cli/{chunk-rqy0s5wh.js → chunk-1w8dp3qb.js} +17 -16
- package/dist/cli/{chunk-rqy0s5wh.js.map → chunk-1w8dp3qb.js.map} +3 -3
- package/dist/cli/chunk-2q1dwty4.js +75 -0
- package/dist/cli/chunk-2q1dwty4.js.map +11 -0
- package/dist/cli/chunk-41za066z.js +122 -0
- package/dist/cli/chunk-41za066z.js.map +11 -0
- package/dist/cli/chunk-5a2z0198.js +133 -0
- package/dist/cli/chunk-5a2z0198.js.map +10 -0
- package/dist/cli/{chunk-5g0w1e2c.js → chunk-6k8vp3ta.js} +25 -13
- package/dist/cli/{chunk-5g0w1e2c.js.map → chunk-6k8vp3ta.js.map} +4 -4
- package/dist/cli/{chunk-5qk08vmp.js → chunk-79njf86q.js} +133 -54
- package/dist/cli/chunk-79njf86q.js.map +11 -0
- package/dist/cli/{chunk-e7f42gdj.js → chunk-7ez8ny0t.js} +2 -2
- package/dist/cli/{chunk-nn13znc2.js → chunk-88cpgt6h.js} +1 -1
- package/dist/cli/chunk-a9kptbw5.js +361 -0
- package/dist/cli/chunk-a9kptbw5.js.map +14 -0
- package/dist/cli/chunk-abh8yjkn.js +31 -0
- package/dist/cli/chunk-abh8yjkn.js.map +10 -0
- package/dist/cli/chunk-b5aj94ah.js +91 -0
- package/dist/cli/chunk-b5aj94ah.js.map +10 -0
- package/dist/cli/{chunk-b27xqwn9.js → chunk-bctazmbk.js} +9 -5
- package/dist/cli/chunk-bctazmbk.js.map +10 -0
- package/dist/cli/chunk-beat36xx.js +279 -0
- package/dist/cli/chunk-beat36xx.js.map +10 -0
- package/dist/cli/chunk-bnbmcwfb.js +145 -0
- package/dist/cli/chunk-bnbmcwfb.js.map +11 -0
- package/dist/cli/{chunk-0xjyb285.js → chunk-bw22s759.js} +15 -5
- package/dist/cli/{chunk-0xjyb285.js.map → chunk-bw22s759.js.map} +4 -4
- package/dist/cli/chunk-by2290sx.js +39 -0
- package/dist/cli/chunk-by2290sx.js.map +10 -0
- package/dist/cli/chunk-d1tadaw7.js +79 -0
- package/dist/cli/chunk-d1tadaw7.js.map +10 -0
- package/dist/cli/{chunk-ahnw3kxw.js → chunk-d80hr03s.js} +24 -19
- package/dist/cli/chunk-d80hr03s.js.map +15 -0
- package/dist/cli/chunk-ernrthtr.js +97 -0
- package/dist/cli/chunk-ernrthtr.js.map +10 -0
- package/dist/cli/chunk-f2972sbt.js +374 -0
- package/dist/cli/chunk-f2972sbt.js.map +10 -0
- package/dist/cli/{chunk-vacwm2hv.js → chunk-f7t03s3g.js} +2 -2
- package/dist/cli/{chunk-2z47ypj8.js → chunk-fa25z98p.js} +16 -3
- package/dist/cli/chunk-fa25z98p.js.map +11 -0
- package/dist/cli/{chunk-cjtn640a.js → chunk-fh5hj5jt.js} +43 -20
- package/dist/cli/chunk-fh5hj5jt.js.map +10 -0
- package/dist/cli/{chunk-yg63d42r.js → chunk-j8mw0za6.js} +86 -57
- package/dist/cli/chunk-j8mw0za6.js.map +35 -0
- package/dist/cli/{chunk-ct47dqpx.js → chunk-jts8mvcz.js} +67 -7
- package/dist/cli/{chunk-2mzebbbz.js.map → chunk-jts8mvcz.js.map} +6 -4
- package/dist/cli/{chunk-ps4m1xh4.js → chunk-mnqj32sj.js} +505 -542
- package/dist/cli/chunk-mnqj32sj.js.map +12 -0
- package/dist/cli/{chunk-8cjtbafj.js → chunk-mwt1k8n7.js} +100 -374
- package/dist/cli/chunk-mwt1k8n7.js.map +10 -0
- package/dist/cli/chunk-nk3ts2xk.js +51 -0
- package/dist/cli/chunk-nk3ts2xk.js.map +10 -0
- package/dist/cli/{chunk-3r45185y.js → chunk-pat2zzwc.js} +9 -11
- package/dist/cli/{chunk-3r45185y.js.map → chunk-pat2zzwc.js.map} +2 -2
- package/dist/cli/chunk-pnnvybbk.js +176 -0
- package/dist/cli/chunk-pnnvybbk.js.map +11 -0
- package/dist/cli/{chunk-4x36ddpw.js → chunk-sqn5t4q0.js} +81 -87
- package/dist/cli/chunk-sqn5t4q0.js.map +10 -0
- package/dist/cli/{chunk-bvwwhd84.js → chunk-tzne8qfq.js} +15 -15
- package/dist/cli/{chunk-bvwwhd84.js.map → chunk-tzne8qfq.js.map} +1 -1
- package/dist/cli/chunk-xaz13gwg.js +12449 -0
- package/dist/cli/chunk-xaz13gwg.js.map +182 -0
- package/dist/cli/chunk-y3e45rc8.js +102 -0
- package/dist/cli/chunk-y3e45rc8.js.map +10 -0
- package/dist/cli/chunk-z01ze5c1.js +261 -0
- package/dist/cli/chunk-z01ze5c1.js.map +10 -0
- package/dist/cli/{chunk-k79xp7av.js → chunk-z1f5arsg.js} +219 -689
- package/dist/cli/chunk-z1f5arsg.js.map +36 -0
- package/dist/cli/{chunk-1jefwnfs.js → chunk-zg2gtj10.js} +1076 -2592
- package/dist/cli/chunk-zg2gtj10.js.map +35 -0
- package/dist/cli/{chunk-dwgcp5sm.js → chunk-zxccj738.js} +1 -1
- package/dist/cli/index.js +214 -57
- package/dist/cli/index.js.map +8 -7
- package/dist/types/ai/agent-readability.d.ts +52 -0
- package/dist/types/ai/ai-catalog.d.ts +42 -0
- package/dist/types/ai/api/paths.d.ts +17 -0
- package/dist/types/ai/api-catalog.d.ts +18 -0
- package/dist/types/ai/ask.d.ts +368 -0
- package/dist/types/ai/changelog-markdown.d.ts +2 -0
- package/dist/types/ai/component-markdown.d.ts +2 -2
- package/dist/types/ai/index.d.ts +24 -0
- package/dist/types/ai/link-headers.d.ts +24 -0
- package/dist/types/ai/llms.d.ts +25 -0
- package/dist/types/ai/markdown.d.ts +45 -0
- package/dist/types/ai/mcp/discovery.d.ts +68 -0
- package/dist/types/ai/mcp/tools.d.ts +16 -0
- package/dist/types/ai/openapi-components.d.ts +43 -0
- package/dist/types/ai/relative-links.d.ts +26 -0
- package/dist/types/ai/serializers.d.ts +15 -0
- package/dist/types/ai/skills.d.ts +42 -0
- package/dist/types/ai/tar.d.ts +25 -0
- package/dist/types/ai/visibility.d.ts +17 -0
- package/dist/types/ai/web-bot-auth.d.ts +16 -0
- package/dist/types/analytics/adobe.d.ts +35 -0
- package/dist/types/analytics/amplitude.d.ts +50 -0
- package/dist/types/analytics/clarity.d.ts +31 -0
- package/dist/types/analytics/clearbit.d.ts +29 -0
- package/dist/types/analytics/cloudflare.d.ts +41 -0
- package/dist/types/analytics/fathom.d.ts +41 -0
- package/dist/types/analytics/google-analytics.d.ts +44 -0
- package/dist/types/analytics/google-tag-manager.d.ts +40 -0
- package/dist/types/analytics/head.d.ts +30 -0
- package/dist/types/analytics/heap.d.ts +40 -0
- package/dist/types/analytics/hightouch.d.ts +44 -0
- package/dist/types/analytics/hotjar.d.ts +33 -0
- package/dist/types/analytics/index.d.ts +61 -0
- package/dist/types/analytics/inline.d.ts +17 -0
- package/dist/types/analytics/logrocket.d.ts +44 -0
- package/dist/types/analytics/mixpanel.d.ts +67 -0
- package/dist/types/analytics/pirsch.d.ts +42 -0
- package/dist/types/analytics/plausible.d.ts +56 -0
- package/dist/types/analytics/posthog.d.ts +45 -0
- package/dist/types/analytics/schema.d.ts +320 -0
- package/dist/types/analytics/script.d.ts +46 -0
- package/dist/types/analytics/segment.d.ts +50 -0
- package/dist/types/analytics/vercel.d.ts +48 -0
- package/dist/types/astro/integration.d.ts +76 -0
- package/dist/types/astro/markdown-negotiation.d.ts +23 -0
- package/dist/types/astro/module-types.d.ts +14 -0
- package/dist/types/astro/pages.d.ts +44 -0
- package/dist/types/cli/env.d.ts +12 -0
- package/dist/types/cli/init/scaffold.d.ts +154 -0
- package/dist/types/components/layout/nav-utils.d.ts +11 -0
- package/dist/types/core/adapter.d.ts +47 -0
- package/dist/types/core/api-name.d.ts +7 -0
- package/dist/types/core/changelog-index.d.ts +13 -0
- package/dist/types/core/config-input.d.ts +186 -515
- package/dist/types/core/config.d.ts +60 -34
- package/dist/types/core/content-assets.d.ts +76 -0
- package/dist/types/core/custom-pages.d.ts +33 -0
- package/dist/types/core/data.d.ts +27 -12
- package/dist/types/core/define-components.d.ts +12 -9
- package/dist/types/core/deployment-env.d.ts +6 -11
- package/dist/types/core/frontmatter.d.ts +10 -0
- package/dist/types/core/graph.d.ts +18 -0
- package/dist/types/core/heading-markers.d.ts +54 -0
- package/dist/types/core/i18n-ui.d.ts +6 -2
- package/dist/types/core/i18n.d.ts +87 -0
- package/dist/types/core/includes.d.ts +138 -0
- package/dist/types/core/last-modified.d.ts +47 -0
- package/dist/types/core/links.d.ts +95 -0
- package/dist/types/core/locale-links.d.ts +60 -0
- package/dist/types/core/manifest.d.ts +17 -0
- package/dist/types/core/meta.d.ts +38 -0
- package/dist/types/core/nav-diagnostics.d.ts +26 -0
- package/dist/types/core/navigation.d.ts +6 -0
- package/dist/types/core/node-require.d.ts +19 -0
- package/dist/types/core/package-json.d.ts +13 -0
- package/dist/types/core/probe.d.ts +42 -0
- package/dist/types/core/project-graph.d.ts +51 -0
- package/dist/types/core/project.d.ts +2 -0
- package/dist/types/core/safe-href.d.ts +2 -0
- package/dist/types/core/safe-links.d.ts +26 -0
- package/dist/types/core/schema.d.ts +2282 -452
- package/dist/types/core/site-url.d.ts +16 -0
- package/dist/types/core/sources/assets.d.ts +36 -0
- package/dist/types/core/sources/cache.d.ts +37 -0
- package/dist/types/core/sources/collection.d.ts +28 -0
- package/dist/types/core/sources/contentful-rich-text.d.ts +31 -0
- package/dist/types/core/sources/contentful.d.ts +40 -0
- package/dist/types/core/sources/filesystem.d.ts +24 -0
- package/dist/types/core/sources/github-releases.d.ts +31 -0
- package/dist/types/core/sources/json.d.ts +30 -0
- package/dist/types/core/sources/lexical.d.ts +19 -0
- package/dist/types/core/sources/lower.d.ts +75 -0
- package/dist/types/core/sources/mdx-remote.d.ts +28 -0
- package/dist/types/core/sources/normalize.d.ts +147 -0
- package/dist/types/core/sources/notion.d.ts +131 -0
- package/dist/types/core/sources/obsidian.d.ts +46 -0
- package/dist/types/core/sources/payload.d.ts +39 -0
- package/dist/types/core/sources/portable-text.d.ts +42 -0
- package/dist/types/core/sources/read.d.ts +23 -0
- package/dist/types/core/sources/remote.d.ts +74 -0
- package/dist/types/core/sources/resolve.d.ts +19 -0
- package/dist/types/core/sources/sanity.d.ts +43 -0
- package/dist/types/core/sources/strapi-blocks.d.ts +12 -0
- package/dist/types/core/sources/strapi.d.ts +33 -0
- package/dist/types/core/sources/types.d.ts +7 -0
- package/dist/types/core/sources/watch.d.ts +45 -0
- package/dist/types/core/text-width.d.ts +11 -0
- package/dist/types/core/types.d.ts +15 -1
- package/dist/types/core/unrecognized-keys.d.ts +7 -0
- package/dist/types/core/versions.d.ts +72 -0
- package/dist/types/core/yaml.d.ts +9 -0
- package/dist/types/deploy/adapter-output.d.ts +45 -0
- package/dist/types/deploy/adapters/cloudflare.d.ts +40 -0
- package/dist/types/deploy/adapters/index.d.ts +29 -0
- package/dist/types/deploy/adapters/netlify.d.ts +37 -0
- package/dist/types/deploy/adapters/node.d.ts +37 -0
- package/dist/types/deploy/adapters/registry.d.ts +133 -0
- package/dist/types/deploy/adapters/types.d.ts +71 -0
- package/dist/types/deploy/adapters/vercel.d.ts +38 -0
- package/dist/types/deploy/artifacts.d.ts +65 -0
- package/dist/types/deploy/cloudflare-negotiation.d.ts +196 -0
- package/dist/types/deploy/function-bundle.d.ts +80 -0
- package/dist/types/deploy/headers.d.ts +50 -0
- package/dist/types/deploy/node-headers.d.ts +42 -0
- package/dist/types/deploy/platforms/cloudflare.d.ts +40 -0
- package/dist/types/deploy/platforms/index.d.ts +18 -0
- package/dist/types/deploy/platforms/netlify.d.ts +13 -0
- package/dist/types/deploy/platforms/node.d.ts +11 -0
- package/dist/types/deploy/platforms/paths.d.ts +27 -0
- package/dist/types/deploy/platforms/static.d.ts +10 -0
- package/dist/types/deploy/platforms/types.d.ts +104 -0
- package/dist/types/deploy/platforms/vercel.d.ts +32 -0
- package/dist/types/deploy/redirects.d.ts +53 -0
- package/dist/types/deploy/robots.d.ts +8 -0
- package/dist/types/deploy/rss.d.ts +31 -0
- package/dist/types/deploy/sitemap.d.ts +21 -0
- package/dist/types/deploy/vercel-negotiation.d.ts +109 -0
- package/dist/types/markdown/code-title.d.ts +32 -0
- package/dist/types/markdown/fence-meta.d.ts +23 -0
- package/dist/types/markdown/themes.d.ts +3 -3
- package/dist/types/openapi/asyncapi.d.ts +129 -0
- package/dist/types/openapi/graphql-build.d.ts +8 -0
- package/dist/types/openapi/graphql.d.ts +122 -0
- package/dist/types/openapi/model.d.ts +158 -0
- package/dist/types/openapi/parse.d.ts +57 -0
- package/dist/types/openapi/references.d.ts +37 -25
- package/dist/types/openapi/render-mdx.d.ts +33 -0
- package/dist/types/openapi/sentence.d.ts +7 -0
- package/dist/types/openapi/signature.d.ts +10 -0
- package/dist/types/openapi/source.d.ts +22 -0
- package/dist/types/openapi/spec-dependency-error.d.ts +10 -0
- package/dist/types/reference/asyncapi.d.ts +166 -0
- package/dist/types/reference/graphql.d.ts +181 -0
- package/dist/types/reference/index.d.ts +32 -0
- package/dist/types/reference/openapi.d.ts +165 -0
- package/dist/types/reference/options.d.ts +157 -0
- package/dist/types/reference/scalar.d.ts +136 -0
- package/dist/types/reference/schema.d.ts +630 -0
- package/dist/types/search/adapters/algolia.d.ts +32 -0
- package/dist/types/search/adapters/flexsearch.d.ts +12 -0
- package/dist/types/search/adapters/index.d.ts +31 -0
- package/dist/types/search/adapters/mixedbread.d.ts +22 -0
- package/dist/types/search/adapters/orama-cloud.d.ts +33 -0
- package/dist/types/search/adapters/orama.d.ts +13 -0
- package/dist/types/search/adapters/pagefind.d.ts +12 -0
- package/dist/types/search/adapters/registry.d.ts +228 -0
- package/dist/types/search/adapters/types.d.ts +34 -0
- package/dist/types/search/adapters/typesense.d.ts +42 -0
- package/dist/types/search/build.d.ts +23 -0
- package/dist/types/search/documents.d.ts +90 -0
- package/dist/types/search/facets.d.ts +3 -0
- package/dist/types/search/sync/algolia.d.ts +14 -0
- package/dist/types/search/sync/index.d.ts +14 -0
- package/dist/types/search/sync/orama-cloud.d.ts +10 -0
- package/dist/types/search/sync/typesense.d.ts +14 -0
- package/dist/types/sources/contentful.d.ts +68 -0
- package/dist/types/sources/custom.d.ts +20 -0
- package/dist/types/sources/filesystem.d.ts +42 -0
- package/dist/types/sources/github-releases.d.ts +46 -0
- package/dist/types/sources/index.d.ts +48 -0
- package/dist/types/sources/mdx-remote.d.ts +63 -0
- package/dist/types/sources/notion.d.ts +65 -0
- package/dist/types/sources/obsidian.d.ts +34 -0
- package/dist/types/sources/payload.d.ts +68 -0
- package/dist/types/sources/registry.d.ts +1414 -0
- package/dist/types/sources/sanity.d.ts +69 -0
- package/dist/types/sources/shared.d.ts +46 -0
- package/dist/types/sources/strapi.d.ts +66 -0
- package/dist/types/theme/icon-kind.d.ts +11 -0
- package/dist/types/theme/icons.d.ts +20 -0
- package/docs/01-quickstart.mdx +18 -18
- package/docs/02-deployment.mdx +50 -26
- package/docs/03-upgrading.mdx +351 -0
- package/docs/04-migrating.mdx +58 -0
- package/docs/08-faq.mdx +3 -3
- package/docs/advanced/blog.mdx +13 -6
- package/docs/advanced/changelog.mdx +23 -35
- package/docs/advanced/custom-pages.mdx +20 -8
- package/docs/advanced/meta.ts +1 -8
- package/docs/advanced/skills.mdx +8 -0
- package/docs/cli/audit.mdx +646 -0
- package/docs/cli/doctor.mdx +29 -0
- package/docs/{reference/eval.mdx → cli/evals.mdx} +9 -8
- package/docs/cli/index.mdx +105 -0
- package/docs/cli/meta.ts +7 -0
- package/docs/{reference → cli}/translate.mdx +1 -1
- package/docs/cli/validate.mdx +41 -0
- package/docs/cli/version.mdx +40 -0
- package/docs/configuration/analytics.mdx +350 -59
- package/docs/configuration/ask-ai.mdx +162 -61
- package/docs/configuration/customization.mdx +15 -9
- package/docs/configuration/index.mdx +50 -31
- package/docs/configuration/search.mdx +75 -54
- package/docs/configuration/theming.mdx +24 -15
- package/docs/content/components.mdx +21 -5
- package/docs/{reference → content}/frontmatter.mdx +35 -1
- package/docs/content/i18n.mdx +8 -6
- package/docs/content/includes.mdx +2 -4
- package/docs/content/index.mdx +1 -1
- package/docs/content/islands.mdx +10 -5
- package/docs/content/meta.mdx +1 -1
- package/docs/content/meta.ts +1 -0
- package/docs/content/navigation.mdx +9 -7
- package/docs/content/sources.mdx +145 -50
- package/docs/content/syntax.mdx +16 -12
- package/docs/content/versioning.mdx +3 -3
- package/docs/discoverability/agent-discovery.mdx +11 -11
- package/docs/discoverability/index.mdx +4 -4
- package/docs/discoverability/json-api.mdx +4 -4
- package/docs/discoverability/llms-txt.mdx +6 -6
- package/docs/discoverability/markdown.mdx +4 -4
- package/docs/discoverability/mcp.mdx +11 -11
- package/docs/discoverability/sitemap-and-robots.mdx +3 -3
- package/docs/index.mdx +2 -2
- package/docs/references/asyncapi.mdx +59 -0
- package/docs/{advanced → references}/graphql.mdx +45 -32
- package/docs/{reference → references}/meta.ts +2 -2
- package/docs/references/openapi.mdx +171 -0
- package/docs/references/scalar.mdx +64 -0
- package/package.json +42 -8
- package/skills/blume/SKILL.md +21 -8
- package/skills/blume-migrate/SKILL.md +22 -21
- package/skills/blume-migrate/assets/oxfmt@0.67.0.patch +49 -0
- package/skills/blume-migrate/references/docusaurus.md +5 -4
- package/skills/blume-migrate/references/fumadocs.md +4 -4
- package/skills/blume-migrate/references/mintlify.md +23 -8
- package/skills/blume-migrate/references/monorepo.md +6 -6
- package/skills/blume-migrate/references/starlight.md +4 -4
- package/src/ai/agent-readability.ts +21 -22
- package/src/ai/ai-catalog.ts +50 -32
- package/src/ai/api/handlers.ts +46 -11
- package/src/ai/api-catalog.ts +8 -8
- package/src/ai/ask-data.ts +1 -1
- package/src/ai/ask.ts +624 -100
- package/src/ai/changelog-markdown.ts +91 -0
- package/src/ai/component-markdown.ts +328 -12
- package/src/ai/index.ts +45 -0
- package/src/ai/link-headers.ts +7 -6
- package/src/ai/llms.ts +20 -15
- package/src/ai/markdown.ts +35 -5
- package/src/ai/mcp/data.ts +9 -5
- package/src/ai/openapi-components.ts +4 -1
- package/src/ai/relative-links.ts +170 -0
- package/src/ai/serializers.ts +2 -2
- package/src/ai/skills.ts +1 -1
- package/src/ai/web-bot-auth.ts +2 -2
- package/src/analytics/adobe.ts +46 -0
- package/src/analytics/amplitude.ts +79 -0
- package/src/analytics/clarity.ts +46 -0
- package/src/analytics/clearbit.ts +47 -0
- package/src/analytics/cloudflare.ts +67 -0
- package/src/analytics/fathom.ts +64 -0
- package/src/analytics/google-analytics.ts +84 -0
- package/src/analytics/google-tag-manager.ts +61 -0
- package/src/analytics/head.ts +130 -0
- package/src/analytics/heap.ts +65 -0
- package/src/analytics/hightouch.ts +77 -0
- package/src/analytics/hotjar.ts +47 -0
- package/src/analytics/index.ts +71 -0
- package/src/analytics/inline.ts +21 -0
- package/src/analytics/logrocket.ts +71 -0
- package/src/analytics/mixpanel.ts +92 -0
- package/src/analytics/pirsch.ts +66 -0
- package/src/analytics/plausible.ts +83 -0
- package/src/analytics/posthog.ts +78 -0
- package/src/analytics/schema.ts +60 -0
- package/src/analytics/script.ts +60 -0
- package/src/analytics/segment.ts +85 -0
- package/src/analytics/vercel.ts +50 -0
- package/src/astro/adapter-root.ts +7 -9
- package/src/astro/component-slots.ts +131 -91
- package/src/astro/generate.ts +112 -345
- package/src/astro/integration.ts +2 -6
- package/src/astro/pages.ts +13 -101
- package/src/astro/render-deps.ts +379 -0
- package/src/astro/runtime-deps.ts +201 -0
- package/src/astro/templates.ts +554 -541
- package/src/audit/agent.ts +24 -0
- package/src/audit/catalog.ts +2 -2
- package/src/audit/checks/assets.ts +2 -2
- package/src/audit/checks/dns-aid.ts +1 -1
- package/src/audit/checks/duplicates.ts +3 -1
- package/src/audit/checks/i18n.ts +1 -1
- package/src/audit/checks/indexability.ts +7 -7
- package/src/audit/checks/links.ts +2 -2
- package/src/audit/checks/llms.ts +6 -6
- package/src/audit/checks/network.ts +3 -3
- package/src/audit/checks/og-image.ts +2 -2
- package/src/audit/checks/robots.ts +1 -1
- package/src/audit/checks/sitemap.ts +2 -2
- package/src/audit/checks/social.ts +1 -1
- package/src/audit/run.ts +4 -3
- package/src/audit/terms.ts +31 -0
- package/src/audit/url.ts +13 -13
- package/src/cli/command-meta.ts +10 -0
- package/src/cli/commands/audit.ts +39 -20
- package/src/cli/commands/build.ts +71 -316
- package/src/cli/commands/check.ts +1 -0
- package/src/cli/commands/dev.ts +40 -1
- package/src/cli/commands/doctor.ts +90 -14
- package/src/cli/commands/eject.ts +44 -7
- package/src/cli/commands/eval.ts +2 -2
- package/src/cli/commands/init.ts +161 -41
- package/src/cli/commands/migrate.ts +121 -0
- package/src/cli/commands/preview.ts +7 -1
- package/src/cli/commands/translate.ts +2 -2
- package/src/cli/commands/upgrade.ts +141 -0
- package/src/cli/commands/version.ts +57 -44
- package/src/cli/eject-scripts.ts +121 -6
- package/src/cli/index.ts +11 -1
- package/src/cli/init/install.ts +70 -0
- package/src/cli/init/questions.ts +7 -0
- package/src/cli/init/scaffold.ts +459 -75
- package/src/cli/lazy-command.ts +37 -1
- package/src/cli/prepare.ts +40 -6
- package/src/cli/required-secrets.ts +38 -11
- package/src/cli/unknown-flags.ts +266 -0
- package/src/cli/yarn-pnp.ts +52 -0
- package/src/components/content/AccordionItem.astro +7 -1
- package/src/components/content/Card.astro +4 -3
- package/src/components/content/ColorItem.astro +22 -4
- package/src/components/content/GithubInfo.astro +2 -2
- package/src/components/content/Prompt.astro +25 -25
- package/src/components/content/Tabs.astro +3 -1
- package/src/components/content/Tile.astro +2 -3
- package/src/components/content/Tooltip.astro +57 -9
- package/src/components/content/content-strings.ts +34 -0
- package/src/components/content/diff.ts +1 -1
- package/src/components/content/mermaid-element.ts +13 -2
- package/src/components/content/prompt-markdown.ts +292 -0
- package/src/components/content/tooltip-id.ts +41 -0
- package/src/components/islands/hooks.ts +25 -2
- package/src/components/layout/Analytics.astro +21 -79
- package/src/components/layout/Banner.astro +3 -1
- package/src/components/layout/DiscoveryLinks.astro +69 -0
- package/src/components/layout/Header.astro +83 -20
- package/src/components/layout/LanguageSwitcher.astro +4 -1
- package/src/components/layout/Logo.astro +23 -2
- package/src/components/layout/NavSelector.astro +13 -2
- package/src/components/layout/NavTree.astro +12 -3
- package/src/components/layout/NavTreeScript.astro +17 -3
- package/src/components/layout/PageActions.astro +3 -3
- package/src/components/layout/PageFeedback.astro +11 -1
- package/src/components/layout/PageLayout.astro +52 -5
- package/src/components/layout/ReferenceLayout.astro +21 -12
- package/src/components/layout/RootLayout.astro +69 -66
- package/src/components/layout/Search.astro +30 -6
- package/src/components/layout/WebMcp.astro +1 -1
- package/src/components/layout/analytics-client.ts +72 -15
- package/src/components/layout/drawer-inert.ts +113 -15
- package/src/components/layout/dropdown-clamp.ts +105 -0
- package/src/components/layout/head-scripts.ts +15 -6
- package/src/components/layout/nav-utils.ts +17 -0
- package/src/components/layout/search/algolia.ts +8 -8
- package/src/components/layout/search/orama-cloud.ts +9 -7
- package/src/components/layout/search/typesense.ts +11 -17
- package/src/components/openapi/MessageComposer.astro +2 -2
- package/src/components/openapi/Playground.astro +2 -2
- package/src/components/openapi/playground-client.ts +79 -10
- package/src/core/changelog-index.ts +24 -0
- package/src/core/component-overrides.ts +399 -154
- package/src/core/config-input.ts +188 -553
- package/src/core/config.ts +130 -41
- package/src/core/custom-pages.ts +105 -0
- package/src/core/data.ts +31 -12
- package/src/core/define-components.ts +12 -9
- package/src/core/deployment-env.ts +18 -74
- package/src/core/diagnostics.ts +14 -7
- package/src/core/graph.ts +69 -25
- package/src/core/i18n-ui.ts +6 -2
- package/src/core/i18n.ts +17 -0
- package/src/core/includes.ts +156 -38
- package/src/core/last-modified.ts +6 -11
- package/src/core/links.ts +166 -2
- package/src/core/manifest.ts +10 -3
- package/src/core/navigation.ts +115 -16
- package/src/core/new-tab.ts +35 -0
- package/src/core/node-require.ts +21 -0
- package/src/core/project-graph.ts +42 -26
- package/src/core/project.ts +9 -4
- package/src/core/request-body.ts +61 -0
- package/src/core/safe-href.ts +28 -0
- package/src/core/safe-links.ts +68 -0
- package/src/core/schema.ts +517 -739
- package/src/core/server-features.ts +8 -9
- package/src/core/sources/assets.ts +47 -11
- package/src/core/sources/collection.ts +67 -0
- package/src/core/sources/contentful-rich-text.ts +285 -0
- package/src/core/sources/contentful.ts +173 -0
- package/src/core/sources/github-releases.ts +51 -1
- package/src/core/sources/json.ts +71 -0
- package/src/core/sources/lexical.ts +195 -0
- package/src/core/sources/lower.ts +226 -0
- package/src/core/sources/normalize.ts +52 -2
- package/src/core/sources/notion.ts +39 -28
- package/src/core/sources/payload.ts +135 -0
- package/src/core/sources/portable-text.ts +11 -16
- package/src/core/sources/remote.ts +226 -0
- package/src/core/sources/resolve.ts +104 -166
- package/src/core/sources/sanity.ts +16 -49
- package/src/core/sources/strapi-blocks.ts +124 -0
- package/src/core/sources/strapi.ts +191 -0
- package/src/core/sources/types.ts +12 -1
- package/src/core/types.ts +15 -1
- package/src/core/ui-packs/ar.ts +6 -2
- package/src/core/ui-packs/bg.ts +6 -2
- package/src/core/ui-packs/bn.ts +6 -2
- package/src/core/ui-packs/ca.ts +3 -1
- package/src/core/ui-packs/cs.ts +6 -2
- package/src/core/ui-packs/da.ts +6 -2
- package/src/core/ui-packs/de.ts +6 -2
- package/src/core/ui-packs/el.ts +3 -1
- package/src/core/ui-packs/es.ts +3 -1
- package/src/core/ui-packs/fa.ts +6 -2
- package/src/core/ui-packs/fi.ts +6 -2
- package/src/core/ui-packs/fr.ts +3 -1
- package/src/core/ui-packs/he.ts +6 -2
- package/src/core/ui-packs/hi.ts +6 -2
- package/src/core/ui-packs/hr.ts +6 -2
- package/src/core/ui-packs/hu.ts +6 -2
- package/src/core/ui-packs/id.ts +6 -2
- package/src/core/ui-packs/it.ts +3 -1
- package/src/core/ui-packs/ja.ts +3 -1
- package/src/core/ui-packs/ko.ts +3 -1
- package/src/core/ui-packs/nl.ts +6 -2
- package/src/core/ui-packs/no.ts +6 -2
- package/src/core/ui-packs/pl.ts +6 -2
- package/src/core/ui-packs/pt-br.ts +3 -1
- package/src/core/ui-packs/pt.ts +3 -1
- package/src/core/ui-packs/ro.ts +6 -2
- package/src/core/ui-packs/ru.ts +6 -2
- package/src/core/ui-packs/sk.ts +6 -2
- package/src/core/ui-packs/sr.ts +6 -2
- package/src/core/ui-packs/sv.ts +6 -2
- package/src/core/ui-packs/th.ts +3 -1
- package/src/core/ui-packs/tr.ts +6 -2
- package/src/core/ui-packs/uk.ts +6 -2
- package/src/core/ui-packs/vi.ts +3 -1
- package/src/core/ui-packs/zh-tw.ts +3 -1
- package/src/core/ui-packs/zh.ts +3 -1
- package/src/core/unrecognized-keys.ts +10 -0
- package/src/core/version-cut.ts +116 -8
- package/src/deploy/adapter-output.ts +57 -97
- package/src/deploy/adapters/cloudflare.ts +39 -0
- package/src/deploy/adapters/index.ts +41 -0
- package/src/deploy/adapters/netlify.ts +34 -0
- package/src/deploy/adapters/node.ts +34 -0
- package/src/deploy/adapters/registry.ts +127 -0
- package/src/deploy/adapters/types.ts +92 -0
- package/src/deploy/adapters/vercel.ts +35 -0
- package/src/deploy/artifacts.ts +55 -27
- package/src/deploy/cloudflare-negotiation.ts +179 -100
- package/src/deploy/function-bundle.ts +18 -3
- package/src/deploy/headers.ts +124 -23
- package/src/deploy/node-headers.ts +198 -0
- package/src/deploy/platforms/cloudflare.ts +312 -0
- package/src/deploy/platforms/index.ts +67 -0
- package/src/deploy/platforms/netlify.ts +52 -0
- package/src/deploy/platforms/node.ts +40 -0
- package/src/deploy/platforms/paths.ts +42 -0
- package/src/deploy/platforms/static.ts +29 -0
- package/src/deploy/platforms/types.ts +112 -0
- package/src/deploy/platforms/vercel.ts +193 -0
- package/src/deploy/redirects.ts +30 -18
- package/src/deploy/robots.ts +3 -3
- package/src/deploy/rss.ts +2 -2
- package/src/deploy/sitemap.ts +2 -2
- package/src/deploy/vercel-negotiation.ts +2 -2
- package/src/eval/agents.ts +32 -1
- package/src/eval/findings.ts +19 -11
- package/src/eval/report.ts +10 -2
- package/src/markdown/external-links.ts +65 -0
- package/src/markdown/include.ts +45 -27
- package/src/markdown/index.ts +34 -9
- package/src/markdown/inline-code.ts +12 -6
- package/src/markdown/relative-links.ts +324 -0
- package/src/markdown/themes.ts +3 -3
- package/src/migrate/migrate.ts +149 -0
- package/src/openapi/parse.ts +64 -16
- package/src/openapi/proxy.ts +62 -10
- package/src/openapi/references.ts +147 -147
- package/src/openapi/render-mdx.ts +32 -10
- package/src/openapi/scalar.ts +15 -13
- package/src/openapi/sentence.ts +14 -0
- package/src/openapi/source.ts +37 -21
- package/src/openapi/spec-dependency-error.ts +15 -0
- package/src/reference/asyncapi.ts +83 -0
- package/src/reference/graphql.ts +89 -0
- package/src/reference/index.ts +40 -0
- package/src/reference/openapi.ts +83 -0
- package/src/reference/options.ts +201 -0
- package/src/reference/scalar.ts +136 -0
- package/src/reference/schema.ts +88 -0
- package/src/registry/eject.ts +97 -42
- package/src/search/adapters/algolia.ts +46 -0
- package/src/search/adapters/flexsearch.ts +29 -0
- package/src/search/adapters/index.ts +39 -0
- package/src/search/adapters/mixedbread.ts +39 -0
- package/src/search/adapters/orama-cloud.ts +51 -0
- package/src/search/adapters/orama.ts +24 -0
- package/src/search/adapters/pagefind.ts +27 -0
- package/src/search/adapters/registry.ts +131 -0
- package/src/search/adapters/types.ts +46 -0
- package/src/search/adapters/typesense.ts +57 -0
- package/src/search/build.ts +8 -4
- package/src/search/documents.ts +6 -0
- package/src/search/sync/algolia.ts +12 -11
- package/src/search/sync/index.ts +35 -20
- package/src/search/sync/orama-cloud.ts +12 -9
- package/src/search/sync/typesense.ts +15 -13
- package/src/sources/contentful.ts +63 -0
- package/src/sources/custom.ts +38 -0
- package/src/sources/filesystem.ts +51 -0
- package/src/sources/github-releases.ts +52 -0
- package/src/sources/index.ts +60 -0
- package/src/sources/mdx-remote.ts +76 -0
- package/src/sources/notion.ts +63 -0
- package/src/sources/obsidian.ts +38 -0
- package/src/sources/payload.ts +60 -0
- package/src/sources/registry.ts +182 -0
- package/src/sources/sanity.ts +66 -0
- package/src/sources/shared.ts +52 -0
- package/src/sources/strapi.ts +58 -0
- package/src/theme/entry.ts +24 -2
- package/src/translate/report.ts +40 -7
- package/src/upgrade/upgrade.ts +499 -0
- package/dist/cli/chunk-0qymqwzz.js +0 -164
- package/dist/cli/chunk-0qymqwzz.js.map +0 -15
- package/dist/cli/chunk-1jefwnfs.js.map +0 -48
- package/dist/cli/chunk-2mzebbbz.js +0 -69
- package/dist/cli/chunk-2z47ypj8.js.map +0 -11
- package/dist/cli/chunk-4x36ddpw.js.map +0 -11
- package/dist/cli/chunk-5093q3n7.js +0 -68
- package/dist/cli/chunk-5093q3n7.js.map +0 -10
- package/dist/cli/chunk-5qk08vmp.js.map +0 -11
- package/dist/cli/chunk-7s8hm3b6.js +0 -5347
- package/dist/cli/chunk-7s8hm3b6.js.map +0 -58
- package/dist/cli/chunk-8cjtbafj.js.map +0 -13
- package/dist/cli/chunk-97r59kpr.js +0 -381
- package/dist/cli/chunk-97r59kpr.js.map +0 -12
- package/dist/cli/chunk-ahnw3kxw.js.map +0 -15
- package/dist/cli/chunk-b27xqwn9.js.map +0 -10
- package/dist/cli/chunk-bf6bt1xt.js +0 -185
- package/dist/cli/chunk-bf6bt1xt.js.map +0 -11
- package/dist/cli/chunk-cjtn640a.js.map +0 -10
- package/dist/cli/chunk-ct47dqpx.js.map +0 -11
- package/dist/cli/chunk-esphfr8p.js +0 -107
- package/dist/cli/chunk-esphfr8p.js.map +0 -11
- package/dist/cli/chunk-ex56aa81.js +0 -1016
- package/dist/cli/chunk-ex56aa81.js.map +0 -13
- package/dist/cli/chunk-garjf5z9.js +0 -30
- package/dist/cli/chunk-garjf5z9.js.map +0 -10
- package/dist/cli/chunk-js7saxwm.js +0 -1045
- package/dist/cli/chunk-js7saxwm.js.map +0 -22
- package/dist/cli/chunk-k79xp7av.js.map +0 -39
- package/dist/cli/chunk-ps4m1xh4.js.map +0 -15
- package/dist/cli/chunk-q4rae3bg.js +0 -60
- package/dist/cli/chunk-q4rae3bg.js.map +0 -10
- package/dist/cli/chunk-rz9jmfhz.js +0 -108
- package/dist/cli/chunk-rz9jmfhz.js.map +0 -10
- package/dist/cli/chunk-vh9w1sgp.js +0 -73
- package/dist/cli/chunk-vh9w1sgp.js.map +0 -10
- package/dist/cli/chunk-vrfp10qk.js +0 -81
- package/dist/cli/chunk-vrfp10qk.js.map +0 -10
- package/dist/cli/chunk-yg63d42r.js.map +0 -34
- package/docs/advanced/api-reference.mdx +0 -240
- package/docs/reference/cli.mdx +0 -197
- package/skills/blume-migrate/assets/oxfmt@0.55.0.patch +0 -20
- package/src/components/content/changelog-element.ts +0 -69
- package/src/search/providers.ts +0 -91
- /package/dist/cli/{chunk-e7f42gdj.js.map → chunk-7ez8ny0t.js.map} +0 -0
- /package/dist/cli/{chunk-nn13znc2.js.map → chunk-88cpgt6h.js.map} +0 -0
- /package/dist/cli/{chunk-vacwm2hv.js.map → chunk-f7t03s3g.js.map} +0 -0
- /package/dist/cli/{chunk-dwgcp5sm.js.map → chunk-zxccj738.js.map} +0 -0
package/src/core/diagnostics.ts
CHANGED
|
@@ -22,7 +22,7 @@ export const createDiagnostic = (diagnostic: Diagnostic): Diagnostic =>
|
|
|
22
22
|
const DOCS_BASE = "https://useblume.dev";
|
|
23
23
|
|
|
24
24
|
const DOCS_DEPLOYMENT = "/docs/deployment";
|
|
25
|
-
const
|
|
25
|
+
const DOCS_CLI_VALIDATE = "/docs/cli/validate";
|
|
26
26
|
const DOCS_CONTENT_SOURCES = "/docs/content/sources";
|
|
27
27
|
const DOCS_CONTENT_NAVIGATION = "/docs/content/navigation";
|
|
28
28
|
const DOCS_CONTENT_INCLUDES = "/docs/content/includes";
|
|
@@ -31,19 +31,22 @@ const DOCS_CONTENT_INCLUDES = "/docs/content/includes";
|
|
|
31
31
|
const DOCS_PATHS = new Map(
|
|
32
32
|
Object.entries({
|
|
33
33
|
BLUME_ADAPTER_REQUIRED: DOCS_DEPLOYMENT,
|
|
34
|
-
BLUME_ASSETS_UNCHECKED:
|
|
34
|
+
BLUME_ASSETS_UNCHECKED: DOCS_CLI_VALIDATE,
|
|
35
35
|
BLUME_ASSET_FETCH_FAILED: DOCS_CONTENT_SOURCES,
|
|
36
|
-
BLUME_BROKEN_ANCHOR:
|
|
37
|
-
BLUME_BROKEN_ASSET:
|
|
38
|
-
BLUME_BROKEN_LINK:
|
|
36
|
+
BLUME_BROKEN_ANCHOR: DOCS_CLI_VALIDATE,
|
|
37
|
+
BLUME_BROKEN_ASSET: DOCS_CLI_VALIDATE,
|
|
38
|
+
BLUME_BROKEN_LINK: DOCS_CLI_VALIDATE,
|
|
39
|
+
BLUME_COMPONENTS_INVALID: "/docs/configuration/customization",
|
|
39
40
|
BLUME_CONFIG_INVALID: "/docs/configuration",
|
|
40
41
|
BLUME_CONFIG_LOAD_FAILED: "/docs/configuration",
|
|
41
42
|
BLUME_CONTENT_ROOT_MISSING: DOCS_CONTENT_SOURCES,
|
|
42
|
-
BLUME_DEAD_LINK:
|
|
43
|
+
BLUME_DEAD_LINK: DOCS_CLI_VALIDATE,
|
|
44
|
+
BLUME_DEPENDENCY_MISSING: "/docs/cli/doctor",
|
|
43
45
|
BLUME_DUPLICATE_ROUTE: DOCS_CONTENT_NAVIGATION,
|
|
44
46
|
BLUME_DUPLICATE_SIDEBAR_ORDER: DOCS_CONTENT_NAVIGATION,
|
|
45
|
-
BLUME_FRONTMATTER_INVALID: "/docs/
|
|
47
|
+
BLUME_FRONTMATTER_INVALID: "/docs/content/frontmatter",
|
|
46
48
|
BLUME_INCLUDE_CYCLE: DOCS_CONTENT_INCLUDES,
|
|
49
|
+
BLUME_INCLUDE_MALFORMED: DOCS_CONTENT_INCLUDES,
|
|
47
50
|
BLUME_INCLUDE_NOT_FOUND: DOCS_CONTENT_INCLUDES,
|
|
48
51
|
BLUME_INCLUDE_OUTSIDE_ROOT: DOCS_CONTENT_INCLUDES,
|
|
49
52
|
BLUME_MDX_CURLY_ANCHOR: "/docs/content/syntax",
|
|
@@ -63,10 +66,14 @@ const DOCS_PATHS = new Map(
|
|
|
63
66
|
BLUME_SOURCE_OFFLINE: DOCS_CONTENT_SOURCES,
|
|
64
67
|
BLUME_SOURCE_SDK_MISSING: DOCS_CONTENT_SOURCES,
|
|
65
68
|
BLUME_SOURCE_UNAVAILABLE: DOCS_CONTENT_SOURCES,
|
|
69
|
+
BLUME_TRANSLATE_MISSING: "/docs/cli/translate",
|
|
70
|
+
BLUME_TRANSLATE_STALE: "/docs/cli/translate",
|
|
66
71
|
BLUME_UNKNOWN_COMPONENT: "/docs/configuration/customization",
|
|
67
72
|
BLUME_UNKNOWN_ICON: DOCS_CONTENT_NAVIGATION,
|
|
73
|
+
BLUME_UNKNOWN_OPTION: "/docs/cli",
|
|
68
74
|
BLUME_WIKILINK_AMBIGUOUS: DOCS_CONTENT_SOURCES,
|
|
69
75
|
BLUME_WIKILINK_UNRESOLVED: DOCS_CONTENT_SOURCES,
|
|
76
|
+
BLUME_YARN_PNP: "/docs/quickstart",
|
|
70
77
|
})
|
|
71
78
|
);
|
|
72
79
|
|
package/src/core/graph.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { withBasePath } from "./base-path.ts";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
localizeInternalPath,
|
|
4
|
+
localizeRoute,
|
|
5
|
+
resolveFallbackLocale,
|
|
6
|
+
} from "./i18n.ts";
|
|
3
7
|
import { validateNavIcons, validateNavStructure } from "./nav-diagnostics.ts";
|
|
4
8
|
import { buildNavigation } from "./navigation.ts";
|
|
5
9
|
import type {
|
|
@@ -21,6 +25,10 @@ import { versionizeRoute } from "./versions.ts";
|
|
|
21
25
|
interface BuildContentGraphOptions {
|
|
22
26
|
/** Site-wide route mount point (`""` or `/seg`); invisible to the nav tree. */
|
|
23
27
|
basePath?: string;
|
|
28
|
+
/** The header brand link as configured (`logo.href`, default `/`). */
|
|
29
|
+
brandHref?: string;
|
|
30
|
+
/** Routes served outside the content tree that tabs may link to directly. */
|
|
31
|
+
extraRoutes?: ReadonlySet<string>;
|
|
24
32
|
folderMeta: Map<string, FolderMeta>;
|
|
25
33
|
sharedFolderMeta?: Map<string, FolderMeta>;
|
|
26
34
|
navigation: ResolvedConfig["navigation"];
|
|
@@ -138,17 +146,54 @@ const buildLocaleNavigation = (
|
|
|
138
146
|
diagnostics: Diagnostic[],
|
|
139
147
|
version = ""
|
|
140
148
|
): Navigation => {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
const basePath = options.basePath ?? "";
|
|
150
|
+
const real = pages.filter((page) => page.locale === code);
|
|
151
|
+
const localePages = localePagesFor(
|
|
152
|
+
code,
|
|
153
|
+
real,
|
|
154
|
+
fallback,
|
|
155
|
+
fallbackByKey,
|
|
156
|
+
i18n,
|
|
157
|
+
basePath
|
|
158
|
+
);
|
|
159
|
+
// Every route the build serves: each locale's pages (this locale's fallback
|
|
160
|
+
// copies included) plus the routes outside the content tree — custom pages
|
|
161
|
+
// and the generated changelog index, which mount outside `basePath`.
|
|
162
|
+
const pageRoutes = [
|
|
163
|
+
...new Set([...pages, ...localePages].map((page) => page.route)),
|
|
164
|
+
];
|
|
165
|
+
const extraRoutes = options.extraRoutes ?? new Set<string>();
|
|
166
|
+
// Whether `path` (authored at root, like a tab path) is served — exactly, or
|
|
167
|
+
// with `section`, as the prefix of a served page (a tab resolves to its
|
|
168
|
+
// section's first page, a plain link doesn't).
|
|
169
|
+
const serves = (path: string, section: boolean): boolean => {
|
|
170
|
+
if (extraRoutes.has(path)) {
|
|
171
|
+
return true;
|
|
172
|
+
}
|
|
173
|
+
const based = withBasePath(basePath, path);
|
|
174
|
+
const prefix = based === "/" ? "/" : `${based}/`;
|
|
175
|
+
return pageRoutes.some(
|
|
176
|
+
(route) => route === based || (section && route.startsWith(prefix))
|
|
177
|
+
);
|
|
178
|
+
};
|
|
179
|
+
// Localize an internal link so it points to its in-locale route (e.g. `/docs`
|
|
180
|
+
// -> `/fr/docs`); external paths pass through. A route this locale doesn't
|
|
181
|
+
// serve while the default one does — a custom page, the generated changelog
|
|
182
|
+
// index — exists only at its own path, so the link stays there instead of
|
|
183
|
+
// 404ing. Tab paths (and their dropdown items') resolve to a section's first
|
|
184
|
+
// page, so a translated section counts; hrefs must be served exactly.
|
|
185
|
+
// Selectors are left alone: a language selector's items intentionally target
|
|
186
|
+
// specific locales. The header's brand link resolves the same way, so the
|
|
187
|
+
// logo and the tabs beside it always agree on the reader's locale.
|
|
188
|
+
const localizeServed = (path: string, section: boolean): string => {
|
|
189
|
+
const localized = localizeInternalPath(path, code, i18n);
|
|
190
|
+
return localized === path ||
|
|
191
|
+
serves(localized, section) ||
|
|
192
|
+
!serves(path, section)
|
|
193
|
+
? localized
|
|
151
194
|
: path;
|
|
195
|
+
};
|
|
196
|
+
const localizePath = (path: string): string => localizeServed(path, true);
|
|
152
197
|
const tabs = resolveTabLabels(
|
|
153
198
|
options.navigation.tabs,
|
|
154
199
|
code,
|
|
@@ -163,19 +208,10 @@ const buildLocaleNavigation = (
|
|
|
163
208
|
path: localizePath(tab.path),
|
|
164
209
|
};
|
|
165
210
|
if (localized.href) {
|
|
166
|
-
localized.href =
|
|
211
|
+
localized.href = localizeServed(localized.href, false);
|
|
167
212
|
}
|
|
168
213
|
return localized;
|
|
169
214
|
});
|
|
170
|
-
const real = pages.filter((page) => page.locale === code);
|
|
171
|
-
const localePages = localePagesFor(
|
|
172
|
-
code,
|
|
173
|
-
real,
|
|
174
|
-
fallback,
|
|
175
|
-
fallbackByKey,
|
|
176
|
-
i18n,
|
|
177
|
-
options.basePath ?? ""
|
|
178
|
-
);
|
|
179
215
|
// Meta files live in locale directories only under the `dir` parser
|
|
180
216
|
// (`fr/guides/meta.ts` -> key `fr/guides`). Under `dot`, translations sit
|
|
181
217
|
// next to the originals and `guides/meta.ts` applies to every locale —
|
|
@@ -188,16 +224,17 @@ const buildLocaleNavigation = (
|
|
|
188
224
|
// locale, not kick them back to the default one.
|
|
189
225
|
const localizeHref = <T extends { href: string }>(item: T): T => ({
|
|
190
226
|
...item,
|
|
191
|
-
href:
|
|
227
|
+
href: localizeServed(item.href, false),
|
|
192
228
|
});
|
|
193
229
|
const { actions, cta, featured } = options.navigation;
|
|
194
230
|
|
|
195
|
-
|
|
231
|
+
const navigation = buildNavigation(localePages, {
|
|
196
232
|
actions: actions?.map(localizeHref),
|
|
197
|
-
basePath
|
|
233
|
+
basePath,
|
|
198
234
|
cta: cta ? localizeHref(cta) : null,
|
|
199
235
|
diagnostics,
|
|
200
236
|
display: options.navigation.sidebar.display,
|
|
237
|
+
extraRoutes: options.extraRoutes,
|
|
201
238
|
featured: featured?.map(localizeHref),
|
|
202
239
|
folderMeta: options.folderMeta,
|
|
203
240
|
// The localized tree root ("/" for the hidden default, "/fr" otherwise;
|
|
@@ -217,6 +254,9 @@ const buildLocaleNavigation = (
|
|
|
217
254
|
sidebar: version ? undefined : options.navigation.sidebar.items,
|
|
218
255
|
tabs,
|
|
219
256
|
});
|
|
257
|
+
return options.brandHref === undefined
|
|
258
|
+
? navigation
|
|
259
|
+
: { ...navigation, brandHref: localizeServed(options.brandHref, false) };
|
|
220
260
|
};
|
|
221
261
|
|
|
222
262
|
/**
|
|
@@ -234,10 +274,12 @@ const buildI18nNavigation = (
|
|
|
234
274
|
// Pages of the fallback locale, by translation key — used to fill in a
|
|
235
275
|
// locale's sidebar for pages it hasn't translated yet.
|
|
236
276
|
const fallback = resolveFallbackLocale(i18n);
|
|
277
|
+
// Monolingual pages (GitHub releases) are left out: they aren't served at the
|
|
278
|
+
// other locales' URLs (see the route manifest), so no sidebar may link there.
|
|
237
279
|
const fallbackByKey = new Map<string, PageRecord>();
|
|
238
280
|
if (fallback) {
|
|
239
281
|
for (const page of pages) {
|
|
240
|
-
if (page.locale === fallback) {
|
|
282
|
+
if (page.locale === fallback && !page.monolingual) {
|
|
241
283
|
fallbackByKey.set(page.translationKey, page);
|
|
242
284
|
}
|
|
243
285
|
}
|
|
@@ -298,6 +340,7 @@ const buildVersionNavigation = (
|
|
|
298
340
|
cta: options.navigation.cta,
|
|
299
341
|
diagnostics,
|
|
300
342
|
display: options.navigation.sidebar.display,
|
|
343
|
+
extraRoutes: options.extraRoutes,
|
|
301
344
|
featured: options.navigation.featured,
|
|
302
345
|
folderMeta: options.folderMeta,
|
|
303
346
|
localizedRoot: versionizeRoute("/", id),
|
|
@@ -345,6 +388,7 @@ export const buildContentGraph = (
|
|
|
345
388
|
cta: options.navigation.cta,
|
|
346
389
|
diagnostics,
|
|
347
390
|
display: options.navigation.sidebar.display,
|
|
391
|
+
extraRoutes: options.extraRoutes,
|
|
348
392
|
featured: options.navigation.featured,
|
|
349
393
|
folderMeta: options.folderMeta,
|
|
350
394
|
selectors: options.navigation.selectors,
|
package/src/core/i18n-ui.ts
CHANGED
|
@@ -68,13 +68,15 @@ const uiStringsObject = z.object({
|
|
|
68
68
|
.default(
|
|
69
69
|
"Product updates, new features, and fixes from every release."
|
|
70
70
|
),
|
|
71
|
-
// `{version}` is replaced with the major line ("2.x") at render time.
|
|
72
|
-
showReleases: z.string().default("Show {version} releases"),
|
|
73
71
|
title: z.string().default("Changelog"),
|
|
74
72
|
})
|
|
75
73
|
.prefault({}),
|
|
76
74
|
content: z
|
|
77
75
|
.object({
|
|
76
|
+
// A `<Color.Item>` swatch's accessible name; `{name}` and `{value}` are
|
|
77
|
+
// replaced with the color's name and the value it shows.
|
|
78
|
+
copyColor: z.string().default("Copy {name} color {value}"),
|
|
79
|
+
copyPrompt: z.string().default("Copy prompt"),
|
|
78
80
|
diagramError: z.string().default("Could not render this diagram."),
|
|
79
81
|
})
|
|
80
82
|
.prefault({}),
|
|
@@ -101,6 +103,8 @@ const uiStringsObject = z.object({
|
|
|
101
103
|
featured: z.string().default("Featured"),
|
|
102
104
|
githubRepository: z.string().default("GitHub repository"),
|
|
103
105
|
navigation: z.string().default("Navigation"),
|
|
106
|
+
// The screen-reader description every new-tab link points at.
|
|
107
|
+
opensInNewTab: z.string().default("Opens in a new tab"),
|
|
104
108
|
primary: z.string().default("Primary"),
|
|
105
109
|
sections: z.string().default("Sections"),
|
|
106
110
|
toggleNavigation: z.string().default("Toggle navigation"),
|
package/src/core/i18n.ts
CHANGED
|
@@ -79,6 +79,23 @@ export const localizeRoute = (
|
|
|
79
79
|
return logicalRoute === "/" ? prefix : `${prefix}${logicalRoute}`;
|
|
80
80
|
};
|
|
81
81
|
|
|
82
|
+
/**
|
|
83
|
+
* Localize a configured link target the way header tabs are: a root-relative
|
|
84
|
+
* internal path (`/`, `/docs`) moves into `code`'s prefix, and anything else —
|
|
85
|
+
* an absolute URL, a fragment, a relative path — passes through. `//host/path`
|
|
86
|
+
* is protocol-relative, an external URL that happens to start with a slash, so
|
|
87
|
+
* it must not pick up a locale prefix (`withBasePath` draws the same line).
|
|
88
|
+
* With no i18n (`null`) the path is returned as-is.
|
|
89
|
+
*/
|
|
90
|
+
export const localizeInternalPath = (
|
|
91
|
+
path: string,
|
|
92
|
+
code: string,
|
|
93
|
+
i18n: LocaleRouting | null
|
|
94
|
+
): string =>
|
|
95
|
+
i18n && path.startsWith("/") && !path.startsWith("//")
|
|
96
|
+
? localizeRoute(path, code, i18n)
|
|
97
|
+
: path;
|
|
98
|
+
|
|
82
99
|
/**
|
|
83
100
|
* Detect a leading non-default locale directory in a path's segments. The
|
|
84
101
|
* default locale lives at the content root, so only non-default codes are
|
package/src/core/includes.ts
CHANGED
|
@@ -141,6 +141,100 @@ export const parseIncludeStatement = (
|
|
|
141
141
|
export const parseIncludeLine = (line: string): IncludeStatement | null =>
|
|
142
142
|
INDENTED_CODE.test(line) ? null : parseIncludeStatement(line.trim());
|
|
143
143
|
|
|
144
|
+
/** A line that opens an include statement: `<include`, then a space, `>`, or its end. */
|
|
145
|
+
const INCLUDE_OPEN = /^<include(?:[\s>]|$)/u;
|
|
146
|
+
|
|
147
|
+
/** A line that closes one. */
|
|
148
|
+
const INCLUDE_CLOSE = /<\/include\s*>$/u;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* How many lines a wrapped statement may span: room for a formatter that puts
|
|
152
|
+
* every attribute on its own line, short enough that an unclosed `<include`
|
|
153
|
+
* can't reach across a page.
|
|
154
|
+
*/
|
|
155
|
+
const MAX_STATEMENT_LINES = 8;
|
|
156
|
+
|
|
157
|
+
/** What a line that may open an include statement turned out to be. */
|
|
158
|
+
export type IncludeMatch =
|
|
159
|
+
/** A statement, ending on line `end` (the same line when it isn't wrapped). */
|
|
160
|
+
| { kind: "statement"; end: number; statement: IncludeStatement }
|
|
161
|
+
/** A line that opens `<include` but no statement Blume can read. */
|
|
162
|
+
| { kind: "malformed" }
|
|
163
|
+
/** Not an include statement at all. */
|
|
164
|
+
| { kind: "none" };
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Read the include statement opening at `lines[index]`, if any. A statement
|
|
168
|
+
* sits on a line of its own, or — as a formatter wraps a long one — runs from a
|
|
169
|
+
* line opening `<include` to the next line closing `</include>`, with no blank
|
|
170
|
+
* line between (the path on its own line, attributes on one line or several):
|
|
171
|
+
*
|
|
172
|
+
* ```mdx
|
|
173
|
+
* <include lang="ts" meta='title="config.ts"'>
|
|
174
|
+
* ./examples/config.ts
|
|
175
|
+
* </include>
|
|
176
|
+
* ```
|
|
177
|
+
*
|
|
178
|
+
* The lines' trimmed text joins into the one-line form, so both parse by the
|
|
179
|
+
* same rules. In `.md` a first line indented like code is a code block, never
|
|
180
|
+
* a statement. A line that opens `<include` but doesn't close into a
|
|
181
|
+
* statement is `malformed`, so the author hears about it instead of the page
|
|
182
|
+
* rendering the raw tag. Shared by the string-level scanner and the render
|
|
183
|
+
* plugin so they splice exactly the same statements.
|
|
184
|
+
*/
|
|
185
|
+
export const matchIncludeStatement = (
|
|
186
|
+
lines: readonly string[],
|
|
187
|
+
index: number,
|
|
188
|
+
format: "md" | "mdx"
|
|
189
|
+
): IncludeMatch => {
|
|
190
|
+
const first = lines[index] ?? "";
|
|
191
|
+
if (format === "md" && INDENTED_CODE.test(first)) {
|
|
192
|
+
return { kind: "none" };
|
|
193
|
+
}
|
|
194
|
+
const opening = first.trim();
|
|
195
|
+
if (!INCLUDE_OPEN.test(opening)) {
|
|
196
|
+
return { kind: "none" };
|
|
197
|
+
}
|
|
198
|
+
const single = parseIncludeStatement(opening);
|
|
199
|
+
if (single) {
|
|
200
|
+
return { end: index, kind: "statement", statement: single };
|
|
201
|
+
}
|
|
202
|
+
const parts = [opening];
|
|
203
|
+
const last = Math.min(lines.length, index + MAX_STATEMENT_LINES) - 1;
|
|
204
|
+
for (let end = index + 1; end <= last; end += 1) {
|
|
205
|
+
const part = (lines[end] ?? "").trim();
|
|
206
|
+
if (part === "") {
|
|
207
|
+
break;
|
|
208
|
+
}
|
|
209
|
+
parts.push(part);
|
|
210
|
+
if (INCLUDE_CLOSE.test(part)) {
|
|
211
|
+
const statement = parseIncludeStatement(parts.join(" "));
|
|
212
|
+
return statement
|
|
213
|
+
? { end, kind: "statement", statement }
|
|
214
|
+
: { kind: "malformed" };
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return { kind: "malformed" };
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* The warning for a line that opens `<include` but isn't a statement Blume can
|
|
222
|
+
* read — it renders as written, so a silent miss would ship a raw tag.
|
|
223
|
+
*/
|
|
224
|
+
export const malformedIncludeDiagnostic = (
|
|
225
|
+
file: string,
|
|
226
|
+
line: number
|
|
227
|
+
): Diagnostic => ({
|
|
228
|
+
code: "BLUME_INCLUDE_MALFORMED",
|
|
229
|
+
file,
|
|
230
|
+
line,
|
|
231
|
+
message:
|
|
232
|
+
"This <include> isn't a statement Blume can read, so the page shows it as written.",
|
|
233
|
+
severity: "warning",
|
|
234
|
+
suggestion:
|
|
235
|
+
"Write <include>./path.mdx</include> on a line of its own, or wrap it with the path on its own line and no blank lines; only lang and meta attributes are read.",
|
|
236
|
+
});
|
|
237
|
+
|
|
144
238
|
/**
|
|
145
239
|
* Advance the HTML comment state across one `.md` line — the render plugin's
|
|
146
240
|
* half of the comment rule (a statement inside `<!-- -->` never splices),
|
|
@@ -432,67 +526,82 @@ const expandStatement = async (
|
|
|
432
526
|
};
|
|
433
527
|
|
|
434
528
|
/**
|
|
435
|
-
*
|
|
436
|
-
* code, comments, and — in `.md` — indented code blocks)
|
|
437
|
-
*
|
|
438
|
-
*
|
|
439
|
-
*
|
|
529
|
+
* Pass 1 of {@link expandLines}: find each include statement (outside fenced
|
|
530
|
+
* code, comments, and — in `.md` — indented code blocks), indexed by the line
|
|
531
|
+
* it opens on. A commented-out statement never renders, so expanding it would
|
|
532
|
+
* leak the partial into search/mirror surfaces the page doesn't show.
|
|
533
|
+
* Indented code and setext underlines only exist in `.md` (MDX has neither,
|
|
534
|
+
* and an indented `<include>` there is still JSX flow the renderer splices).
|
|
440
535
|
*/
|
|
441
|
-
const
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
ctx: ExpandContext,
|
|
446
|
-
stack: readonly string[]
|
|
447
|
-
): Promise<ExpandedLines> => {
|
|
448
|
-
const sourceLines = body.split("\n");
|
|
449
|
-
const isMdx = extname(filePath).toLowerCase() === ".mdx";
|
|
536
|
+
const scanStatements = (
|
|
537
|
+
sourceLines: string[],
|
|
538
|
+
isMdx: boolean
|
|
539
|
+
): (IncludeMatch | null)[] => {
|
|
450
540
|
const delimiters = COMMENT_DELIMITERS[isMdx ? "mdx" : "md"];
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
// a commented-out statement never renders, so expanding it would leak the
|
|
454
|
-
// partial into search/mirror surfaces the page doesn't show. Indented code
|
|
455
|
-
// and setext underlines only exist in `.md` (MDX has neither, and an
|
|
456
|
-
// indented `<include>` there is still JSX flow the renderer splices).
|
|
541
|
+
const format = isMdx ? "mdx" : "md";
|
|
542
|
+
const matches: (IncludeMatch | null)[] = sourceLines.map(() => null);
|
|
457
543
|
let fence: FenceState = null;
|
|
458
544
|
let inComment = false;
|
|
459
|
-
|
|
545
|
+
for (let index = 0; index < sourceLines.length; index += 1) {
|
|
546
|
+
const line = sourceLines[index] ?? "";
|
|
460
547
|
if (inComment) {
|
|
461
548
|
inComment = advanceCommentState(line, delimiters, true);
|
|
462
|
-
|
|
549
|
+
continue;
|
|
463
550
|
}
|
|
464
551
|
const next = nextFenceState(line, fence);
|
|
465
552
|
const inFence = fence !== null || next !== null;
|
|
466
553
|
fence = next;
|
|
467
554
|
if (inFence) {
|
|
468
|
-
|
|
555
|
+
continue;
|
|
469
556
|
}
|
|
470
557
|
inComment = advanceCommentState(line, delimiters, false);
|
|
471
558
|
if (inComment || !hasIncludeStatements(line)) {
|
|
472
|
-
|
|
559
|
+
continue;
|
|
473
560
|
}
|
|
474
|
-
const
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
// A setext underline directly below folds the statement line into a
|
|
478
|
-
// heading — the renderer shows a heading, not a splice, so skip it.
|
|
561
|
+
const match = matchIncludeStatement(sourceLines, index, format);
|
|
562
|
+
// A setext underline directly below folds the statement into a heading —
|
|
563
|
+
// the renderer shows a heading, not a splice, so skip it.
|
|
479
564
|
if (
|
|
480
|
-
statement &&
|
|
565
|
+
match.kind === "statement" &&
|
|
481
566
|
!isMdx &&
|
|
482
|
-
SETEXT_UNDERLINE.test(sourceLines[
|
|
567
|
+
SETEXT_UNDERLINE.test(sourceLines[match.end + 1] ?? "")
|
|
483
568
|
) {
|
|
484
|
-
|
|
569
|
+
continue;
|
|
485
570
|
}
|
|
486
|
-
|
|
487
|
-
|
|
571
|
+
matches[index] = match;
|
|
572
|
+
if (match.kind === "statement") {
|
|
573
|
+
// A wrapped statement's remaining lines belong to it.
|
|
574
|
+
index = match.end;
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
return matches;
|
|
578
|
+
};
|
|
579
|
+
|
|
580
|
+
/**
|
|
581
|
+
* Walk a document's lines, replacing each include statement (outside fenced
|
|
582
|
+
* code, comments, and — in `.md` — indented code blocks) with the target's
|
|
583
|
+
* expanded lines. Statements that error stay verbatim so downstream surfaces
|
|
584
|
+
* show what the author wrote; a blank line is padded around each splice so a
|
|
585
|
+
* partial can't merge into an adjacent paragraph.
|
|
586
|
+
*/
|
|
587
|
+
const expandLines = async (
|
|
588
|
+
body: string,
|
|
589
|
+
filePath: string,
|
|
590
|
+
lineOffset: number,
|
|
591
|
+
ctx: ExpandContext,
|
|
592
|
+
stack: readonly string[]
|
|
593
|
+
): Promise<ExpandedLines> => {
|
|
594
|
+
const sourceLines = body.split("\n");
|
|
595
|
+
const isMdx = extname(filePath).toLowerCase() === ".mdx";
|
|
596
|
+
const matches = scanStatements(sourceLines, isMdx);
|
|
488
597
|
|
|
489
598
|
// Pass 2: expand every statement concurrently — reads are independent, and
|
|
490
599
|
// each branch carries its own cycle stack.
|
|
491
600
|
const expansions = await Promise.all(
|
|
492
|
-
|
|
493
|
-
statement
|
|
601
|
+
matches.map((match, index) =>
|
|
602
|
+
match?.kind === "statement"
|
|
494
603
|
? expandStatement(
|
|
495
|
-
statement,
|
|
604
|
+
match.statement,
|
|
496
605
|
filePath,
|
|
497
606
|
lineOffset + index + 1,
|
|
498
607
|
ctx,
|
|
@@ -506,9 +615,14 @@ const expandLines = async (
|
|
|
506
615
|
// accumulated output, and error order should follow document order.
|
|
507
616
|
const lines: string[] = [];
|
|
508
617
|
const origins: LineOrigin[] = [];
|
|
509
|
-
for (
|
|
618
|
+
for (let index = 0; index < sourceLines.length; index += 1) {
|
|
619
|
+
const line = sourceLines[index] ?? "";
|
|
510
620
|
const rawLine = lineOffset + index + 1;
|
|
621
|
+
const match = matches[index];
|
|
511
622
|
const expanded = expansions[index];
|
|
623
|
+
if (match?.kind === "malformed") {
|
|
624
|
+
ctx.errors.push(malformedIncludeDiagnostic(filePath, rawLine));
|
|
625
|
+
}
|
|
512
626
|
if (!expanded || "error" in expanded) {
|
|
513
627
|
if (expanded) {
|
|
514
628
|
ctx.errors.push(expanded.error);
|
|
@@ -526,6 +640,10 @@ const expandLines = async (
|
|
|
526
640
|
}
|
|
527
641
|
lines.push(...expanded.lines);
|
|
528
642
|
origins.push(...expanded.origins);
|
|
643
|
+
// A wrapped statement's remaining lines were spliced with it.
|
|
644
|
+
if (match?.kind === "statement") {
|
|
645
|
+
index = match.end;
|
|
646
|
+
}
|
|
529
647
|
if (sourceLines[index + 1]?.trim()) {
|
|
530
648
|
pad();
|
|
531
649
|
}
|
|
@@ -31,18 +31,13 @@ const gitEnv = (): NodeJS.ProcessEnv =>
|
|
|
31
31
|
Object.entries(process.env).filter(([key]) => !GIT_LOCATION_VARS.has(key))
|
|
32
32
|
);
|
|
33
33
|
|
|
34
|
-
/** Normalize the `lastModified` config
|
|
34
|
+
/** Normalize the `lastModified` config (`false | "git" | "frontmatter"`) into `{ enabled, source }`. */
|
|
35
35
|
export const resolveLastModifiedConfig = (
|
|
36
|
-
value:
|
|
37
|
-
): ResolvedLastModified =>
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if (value === true) {
|
|
42
|
-
return { enabled: true, source: "git" };
|
|
43
|
-
}
|
|
44
|
-
return { enabled: true, source: value.type };
|
|
45
|
-
};
|
|
36
|
+
value: false | "git" | "frontmatter"
|
|
37
|
+
): ResolvedLastModified =>
|
|
38
|
+
value === false
|
|
39
|
+
? { enabled: false, source: "git" }
|
|
40
|
+
: { enabled: true, source: value };
|
|
46
41
|
|
|
47
42
|
/**
|
|
48
43
|
* Parse `git log --format=%x00%cI --name-only` output into a map of
|