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
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
frontmatter_default,
|
|
4
|
+
parseHeadingMarkers,
|
|
5
|
+
HTML_COMMENT,
|
|
6
|
+
readExpandedEntryText,
|
|
7
|
+
MARKDOWN_FEATURES,
|
|
8
|
+
MDX_FEATURES,
|
|
9
|
+
componentRegistry,
|
|
10
|
+
downlevelComponentNode,
|
|
11
|
+
downlevelComponents,
|
|
12
|
+
projectComponentSerializers,
|
|
13
|
+
applyAudienceVisibility,
|
|
14
|
+
agentMarkdown,
|
|
15
|
+
buildRawMarkdown
|
|
16
|
+
} from "./chunk-xaz13gwg.js";
|
|
17
|
+
import {
|
|
18
|
+
normalizeBasePath
|
|
19
|
+
} from "./chunk-jts8mvcz.js";
|
|
20
|
+
import {
|
|
21
|
+
contentIndexable
|
|
22
|
+
} from "./chunk-zg2gtj10.js";
|
|
23
|
+
|
|
24
|
+
// src/search/documents.ts
|
|
25
|
+
import { markdownToMdast, mdxToMdast } from "satteri";
|
|
26
|
+
|
|
27
|
+
// src/markdown/fence-meta.ts
|
|
28
|
+
var QUOTED_ATTR = /[\w-]+=(?:"[^"]*"|'[^']*')/gu;
|
|
29
|
+
var LINE_RANGE = /\{[^}]*\}/u;
|
|
30
|
+
var META_TOKEN = new RegExp(`${QUOTED_ATTR.source}|${LINE_RANGE.source}|\\S+`, "gu");
|
|
31
|
+
var metaTokens = (meta) => meta?.match(META_TOKEN) ?? [];
|
|
32
|
+
var RESERVED_META_KEYWORDS = new Set([
|
|
33
|
+
"lineNumbers",
|
|
34
|
+
"ts2js",
|
|
35
|
+
"twoslash"
|
|
36
|
+
]);
|
|
37
|
+
var isLineRange = (token) => token.startsWith("{");
|
|
38
|
+
|
|
39
|
+
// src/markdown/code-title.ts
|
|
40
|
+
var TITLE_ATTR = /(?:^|\s)title=(?:"(?<dq>[^"]*)"|'(?<sq>[^']*)')/u;
|
|
41
|
+
var isTitleToken = (token) => token.length > 0 && !isLineRange(token) && !token.includes("=") && !RESERVED_META_KEYWORDS.has(token);
|
|
42
|
+
var parseCodeTitle = (raw) => {
|
|
43
|
+
if (!raw) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const scrubbed = raw.replace(QUOTED_ATTR, (attr) => attr.startsWith("title=") ? attr : " ");
|
|
47
|
+
const explicit = scrubbed.match(TITLE_ATTR);
|
|
48
|
+
const attrTitle = explicit?.groups?.dq ?? explicit?.groups?.sq;
|
|
49
|
+
if (attrTitle) {
|
|
50
|
+
return attrTitle;
|
|
51
|
+
}
|
|
52
|
+
return metaTokens(raw).find(isTitleToken);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// src/search/facets.ts
|
|
56
|
+
var isFacetValue = (value) => typeof value === "string" || typeof value === "number" || typeof value === "boolean";
|
|
57
|
+
var pageFacets = (page, config) => {
|
|
58
|
+
const declared = config.content.types[page.contentType]?.facets;
|
|
59
|
+
if (!declared || declared.length === 0 || !page.custom) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const facets = {};
|
|
63
|
+
for (const key of declared) {
|
|
64
|
+
const value = page.custom[key];
|
|
65
|
+
if (isFacetValue(value)) {
|
|
66
|
+
facets[key] = String(value);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return Object.keys(facets).length > 0 ? facets : undefined;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// src/search/documents.ts
|
|
73
|
+
var HTML_OR_JSX = /<\/?[a-zA-Z][^\n<>]*>|<\/?>/gu;
|
|
74
|
+
var WHITESPACE = /\s+/gu;
|
|
75
|
+
var INLINE_PARENTS = new Set([
|
|
76
|
+
"delete",
|
|
77
|
+
"emphasis",
|
|
78
|
+
"footnoteReference",
|
|
79
|
+
"link",
|
|
80
|
+
"linkReference",
|
|
81
|
+
"mdxJsxTextElement",
|
|
82
|
+
"strong",
|
|
83
|
+
"subscript",
|
|
84
|
+
"superscript",
|
|
85
|
+
"textDirective"
|
|
86
|
+
]);
|
|
87
|
+
var NON_PROSE = new Set([
|
|
88
|
+
"image",
|
|
89
|
+
"imageReference",
|
|
90
|
+
"inlineMath",
|
|
91
|
+
"math",
|
|
92
|
+
"mdxFlowExpression",
|
|
93
|
+
"mdxTextExpression",
|
|
94
|
+
"mdxjsEsm"
|
|
95
|
+
]);
|
|
96
|
+
var MD_PARSE = { features: { ...MARKDOWN_FEATURES, frontmatter: false } };
|
|
97
|
+
var MDX_PARSE = { features: { ...MDX_FEATURES, frontmatter: false } };
|
|
98
|
+
var parseMdx = (markdown) => {
|
|
99
|
+
try {
|
|
100
|
+
return mdxToMdast(markdown, MDX_PARSE);
|
|
101
|
+
} catch {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
var parseMarkdown = (markdown, format) => format === "mdx" ? parseMdx(markdown) : markdownToMdast(markdown, MD_PARSE);
|
|
106
|
+
var collectCode = (node, out, walk) => {
|
|
107
|
+
if (!walk.includeCodeBlocks) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const title = parseCodeTitle(node.meta ?? undefined);
|
|
111
|
+
if (title) {
|
|
112
|
+
out.push(title, " ");
|
|
113
|
+
}
|
|
114
|
+
out.push(node.value, " ");
|
|
115
|
+
};
|
|
116
|
+
var separatesWords = (node) => !INLINE_PARENTS.has(node.type) || node.children.length === 0;
|
|
117
|
+
var collectText = (node, out, walk) => {
|
|
118
|
+
if (NON_PROSE.has(node.type)) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
switch (node.type) {
|
|
122
|
+
case "code": {
|
|
123
|
+
collectCode(node, out, walk);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
case "mdxJsxFlowElement": {
|
|
127
|
+
const text = downlevelComponentNode(node, walk.downlevel);
|
|
128
|
+
if (text !== null) {
|
|
129
|
+
collectText(markdownToMdast(text, MD_PARSE), out, walk);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
case "inlineCode": {
|
|
135
|
+
out.push(node.value);
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
case "html": {
|
|
139
|
+
out.push(node.value.replaceAll(HTML_COMMENT, " ").replaceAll(HTML_OR_JSX, " "), " ");
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
case "break": {
|
|
143
|
+
out.push(" ");
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
case "heading": {
|
|
147
|
+
const last = node.children.at(-1);
|
|
148
|
+
const trailing = last?.type === "text" ? last : undefined;
|
|
149
|
+
const inner = [];
|
|
150
|
+
const kept = trailing ? node.children.slice(0, -1) : node.children;
|
|
151
|
+
for (const child of kept) {
|
|
152
|
+
collectText(child, inner, walk);
|
|
153
|
+
}
|
|
154
|
+
if (trailing) {
|
|
155
|
+
const stripped = parseHeadingMarkers(trailing.value).text;
|
|
156
|
+
const literal = stripped === "" && node.children.length === 1;
|
|
157
|
+
inner.push(literal ? trailing.value : stripped);
|
|
158
|
+
}
|
|
159
|
+
out.push(inner.join("").trimEnd(), " ");
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
default: {
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
if ("value" in node) {
|
|
167
|
+
out.push(node.value);
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if ("children" in node) {
|
|
171
|
+
for (const child of node.children) {
|
|
172
|
+
collectText(child, out, walk);
|
|
173
|
+
}
|
|
174
|
+
if (separatesWords(node)) {
|
|
175
|
+
out.push(" ");
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
var toPlainText = (markdown, format, walk) => {
|
|
180
|
+
const tree = parseMarkdown(markdown, format);
|
|
181
|
+
if (!tree) {
|
|
182
|
+
return "";
|
|
183
|
+
}
|
|
184
|
+
const out = [];
|
|
185
|
+
collectText(tree, out, walk);
|
|
186
|
+
return out.join("").replaceAll(WHITESPACE, " ").trim();
|
|
187
|
+
};
|
|
188
|
+
var buildCrumbIndex = (sidebar) => {
|
|
189
|
+
const index = new Map;
|
|
190
|
+
const groupRoutes = new Map;
|
|
191
|
+
const walk = (nodes, trail) => {
|
|
192
|
+
for (const node of nodes) {
|
|
193
|
+
if (node.kind === "group") {
|
|
194
|
+
if (node.route && !groupRoutes.has(node.route)) {
|
|
195
|
+
groupRoutes.set(node.route, {
|
|
196
|
+
breadcrumb: [...trail, node.label],
|
|
197
|
+
section: node.label
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
walk(node.children, [...trail, node.label]);
|
|
201
|
+
} else if (node.route) {
|
|
202
|
+
index.set(node.route, {
|
|
203
|
+
breadcrumb: trail,
|
|
204
|
+
section: trail.at(-1) ?? ""
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
};
|
|
209
|
+
walk(sidebar, []);
|
|
210
|
+
for (const [route, crumbs] of groupRoutes) {
|
|
211
|
+
if (!index.has(route)) {
|
|
212
|
+
index.set(route, crumbs);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return index;
|
|
216
|
+
};
|
|
217
|
+
var pageBody = async (project, page, options, components) => {
|
|
218
|
+
if (!page) {
|
|
219
|
+
return "";
|
|
220
|
+
}
|
|
221
|
+
const parsed = frontmatter_default(await readExpandedEntryText(project, page));
|
|
222
|
+
const visible = applyAudienceVisibility(parsed.content, options?.audience ?? "web");
|
|
223
|
+
if (options?.content === "markdown") {
|
|
224
|
+
return downlevelComponents(visible.trim(), components, parsed.data);
|
|
225
|
+
}
|
|
226
|
+
return toPlainText(visible, page.format, {
|
|
227
|
+
downlevel: {
|
|
228
|
+
frontmatter: parsed.data,
|
|
229
|
+
registry: componentRegistry(components),
|
|
230
|
+
source: visible
|
|
231
|
+
},
|
|
232
|
+
includeCodeBlocks: project.config.search.indexing.includeCodeBlocks
|
|
233
|
+
});
|
|
234
|
+
};
|
|
235
|
+
var buildSearchDocuments = async (project, options) => {
|
|
236
|
+
const pageById = new Map(project.graph.pages.map((page) => [page.id, page]));
|
|
237
|
+
const byLocale = Object.values(project.graph.navigationByLocale ?? {});
|
|
238
|
+
const byVersion = Object.values(project.graph.navigationByVersion ?? {}).flatMap((locales) => Object.values(locales)).map((nav) => nav.sidebar);
|
|
239
|
+
const sidebars = [
|
|
240
|
+
...byLocale.length > 0 ? byLocale.map((nav) => nav.sidebar) : [project.graph.navigation?.sidebar ?? []],
|
|
241
|
+
...byVersion
|
|
242
|
+
];
|
|
243
|
+
const crumbs = new Map;
|
|
244
|
+
for (const sidebar of sidebars) {
|
|
245
|
+
for (const [route, crumb] of buildCrumbIndex(sidebar)) {
|
|
246
|
+
crumbs.set(route, crumb);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
const indexable = project.manifest.routes.filter((route) => {
|
|
250
|
+
if (!options?.includeWhenDisabled) {
|
|
251
|
+
return route.indexable;
|
|
252
|
+
}
|
|
253
|
+
if (route.fallback) {
|
|
254
|
+
return false;
|
|
255
|
+
}
|
|
256
|
+
const page = pageById.get(route.id);
|
|
257
|
+
return page ? contentIndexable(page, project.config) : false;
|
|
258
|
+
});
|
|
259
|
+
const components = projectComponentSerializers(project);
|
|
260
|
+
return await Promise.all(indexable.map(async (route) => {
|
|
261
|
+
const page = pageById.get(route.id);
|
|
262
|
+
const body = await pageBody(project, page, options, components);
|
|
263
|
+
const tags = page?.meta?.search?.tags;
|
|
264
|
+
const crumb = crumbs.get(route.path);
|
|
265
|
+
const facets = page ? pageFacets(page, project.config) : undefined;
|
|
266
|
+
const document = {
|
|
267
|
+
breadcrumb: crumb?.breadcrumb ?? [],
|
|
268
|
+
content: body,
|
|
269
|
+
contentType: route.contentType,
|
|
270
|
+
description: page?.description ?? "",
|
|
271
|
+
locale: route.locale,
|
|
272
|
+
route: route.path,
|
|
273
|
+
section: crumb?.section || "Docs",
|
|
274
|
+
tags: tags && tags.length > 0 ? tags : undefined,
|
|
275
|
+
title: route.title,
|
|
276
|
+
version: route.version
|
|
277
|
+
};
|
|
278
|
+
if (facets) {
|
|
279
|
+
document.facets = facets;
|
|
280
|
+
}
|
|
281
|
+
return document;
|
|
282
|
+
}));
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
// src/ai/mcp/data.ts
|
|
286
|
+
var buildMcpData = async (project) => {
|
|
287
|
+
const { config, graph, manifest } = project;
|
|
288
|
+
const [documents, rawMarkdown] = await Promise.all([
|
|
289
|
+
buildSearchDocuments(project, {
|
|
290
|
+
audience: "agents",
|
|
291
|
+
includeWhenDisabled: true
|
|
292
|
+
}),
|
|
293
|
+
buildRawMarkdown(project)
|
|
294
|
+
]);
|
|
295
|
+
const pages = Object.fromEntries(Object.entries(rawMarkdown).map(([route, entry]) => [
|
|
296
|
+
route,
|
|
297
|
+
agentMarkdown(entry)
|
|
298
|
+
]));
|
|
299
|
+
const pageById = new Map(graph.pages.map((page) => [page.id, page]));
|
|
300
|
+
const routes = [];
|
|
301
|
+
for (const route of manifest.routes) {
|
|
302
|
+
if (route.hidden || route.fallback) {
|
|
303
|
+
continue;
|
|
304
|
+
}
|
|
305
|
+
const page = pageById.get(route.id);
|
|
306
|
+
const facets = page ? pageFacets(page, config) : undefined;
|
|
307
|
+
const entry = {
|
|
308
|
+
contentType: route.contentType,
|
|
309
|
+
description: page?.description,
|
|
310
|
+
indexable: route.indexable,
|
|
311
|
+
lastModified: route.lastModified ?? null,
|
|
312
|
+
locale: route.locale,
|
|
313
|
+
route: route.path,
|
|
314
|
+
title: route.title,
|
|
315
|
+
version: route.version
|
|
316
|
+
};
|
|
317
|
+
if (facets) {
|
|
318
|
+
entry.facets = facets;
|
|
319
|
+
}
|
|
320
|
+
routes.push(entry);
|
|
321
|
+
}
|
|
322
|
+
const data = {
|
|
323
|
+
base: normalizeBasePath(config.deployment.options.base),
|
|
324
|
+
defaultLocale: config.i18n?.defaultLocale,
|
|
325
|
+
documents: documents.map((doc) => {
|
|
326
|
+
const document = {
|
|
327
|
+
content: doc.content,
|
|
328
|
+
contentType: doc.contentType,
|
|
329
|
+
description: doc.description,
|
|
330
|
+
locale: doc.locale,
|
|
331
|
+
route: doc.route,
|
|
332
|
+
title: doc.title,
|
|
333
|
+
version: doc.version
|
|
334
|
+
};
|
|
335
|
+
if (doc.facets) {
|
|
336
|
+
document.facets = doc.facets;
|
|
337
|
+
}
|
|
338
|
+
return document;
|
|
339
|
+
}),
|
|
340
|
+
instructions: config.agents.mcp.instructions,
|
|
341
|
+
name: config.agents.mcp.name ?? config.title,
|
|
342
|
+
navigation: graph.navigation,
|
|
343
|
+
pages,
|
|
344
|
+
routes,
|
|
345
|
+
site: config.deployment.options.site ?? null,
|
|
346
|
+
version: manifest.blumeVersion
|
|
347
|
+
};
|
|
348
|
+
if (config.versions) {
|
|
349
|
+
data.archivedVersions = config.versions.archived.map((version) => version.id);
|
|
350
|
+
data.navigationByVersion = graph.navigationByVersion;
|
|
351
|
+
}
|
|
352
|
+
if (config.i18n) {
|
|
353
|
+
data.navigationByLocale = graph.navigationByLocale;
|
|
354
|
+
}
|
|
355
|
+
return data;
|
|
356
|
+
};
|
|
357
|
+
|
|
358
|
+
export { buildSearchDocuments, buildMcpData };
|
|
359
|
+
|
|
360
|
+
//# debugId=341A56DACBB5F6DE64756E2164756E21
|
|
361
|
+
//# sourceMappingURL=chunk-a9kptbw5.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/search/documents.ts", "../src/markdown/fence-meta.ts", "../src/markdown/code-title.ts", "../src/search/facets.ts", "../src/ai/mcp/data.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import type { Nodes } from \"mdast\";\nimport { markdownToMdast, mdxToMdast } from \"satteri\";\n\nimport {\n componentRegistry,\n downlevelComponentNode,\n downlevelComponents,\n} from \"../ai/component-markdown.ts\";\nimport type {\n ComponentMarkdown,\n DownlevelWalk,\n MdastNode as DownlevelNode,\n} from \"../ai/component-markdown.ts\";\nimport { projectComponentSerializers } from \"../ai/serializers.ts\";\nimport { applyAudienceVisibility } from \"../ai/visibility.ts\";\nimport type { VisibilityAudience } from \"../ai/visibility.ts\";\nimport matter from \"../core/frontmatter.ts\";\nimport { parseHeadingMarkers } from \"../core/heading-markers.ts\";\nimport { contentIndexable } from \"../core/manifest.ts\";\nimport type { BlumeProject } from \"../core/project-graph.ts\";\nimport { HTML_COMMENT } from \"../core/sources/normalize.ts\";\nimport { readExpandedEntryText } from \"../core/sources/read.ts\";\nimport type { NavNode, PageRecord } from \"../core/types.ts\";\nimport { parseCodeTitle } from \"../markdown/code-title.ts\";\nimport { MARKDOWN_FEATURES, MDX_FEATURES } from \"../markdown/features.ts\";\nimport { pageFacets } from \"./facets.ts\";\n\n/** A document indexed by the client-side search providers (Orama, FlexSearch). */\nexport interface SearchDocument {\n route: string;\n title: string;\n description: string;\n content: string;\n /** Ancestor section labels for the result breadcrumb, e.g. `[\"Guides\"]`. */\n breadcrumb: string[];\n /** Top-level section label, used by the search filter pills. */\n section: string;\n /** Locale code, so the dialog can filter results to the active language. */\n locale: string;\n /** Resolved page `type` (`doc`, `blog`, a custom `rfc`…), for type filters. */\n contentType: string;\n /** Docs version (`\"\"` for the current docs), so results scope to the viewed version. */\n version: string;\n /** Frontmatter `search.tags`, surfaced for hosted-provider faceting. */\n tags?: string[];\n /**\n * Declared facet values (`content.types.<type>.facets`), key → value.\n * Filterable through the MCP tools' `filters` input.\n */\n facets?: Record<string, string>;\n}\n\n/**\n * A record uploaded to a hosted search backend (Algolia, Orama Cloud,\n * Typesense, Mixedbread). `_id` is the stable per-page key; each sync adapts it\n * to the backend's own id field (`objectID`, `id`, …).\n */\nexport interface SearchRecord {\n _id: string;\n url: string;\n title: string;\n description: string;\n content: string;\n /** Locale code, carried as a facet for per-language filtering. */\n locale: string;\n /**\n * Docs version, carried as a facet for per-version filtering. The current\n * docs upload as `\"current\"` — hosted backends treat an empty facet value\n * unreliably, so the sentinel stands in for the empty version id.\n */\n version: string;\n /** Single faceting tag (the first frontmatter tag, when present). */\n tag?: string;\n}\n\n// Tag-shaped only: a name (or closing slash/fragment) right after `<`, and no\n// newline inside. Applied *within* html/JSX nodes so their inner prose is\n// kept; the surrounding Markdown is walked as a tree, so a bare `<` in prose\n// (\"costs < 5 credits\") is ordinary text and never at risk.\nconst HTML_OR_JSX = /<\\/?[a-zA-Z][^\\n<>]*>|<\\/?>/gu;\nconst WHITESPACE = /\\s+/gu;\n\n// Parents whose children are inline: no separator is inserted after them, or\n// `re*ally*` would index as `re ally`. Every other parent is block-shaped and\n// ends with a space so adjacent paragraphs/headings/cells don't fuse.\nconst INLINE_PARENTS = new Set([\n \"delete\",\n \"emphasis\",\n \"footnoteReference\",\n \"link\",\n \"linkReference\",\n \"mdxJsxTextElement\",\n \"strong\",\n \"subscript\",\n \"superscript\",\n \"textDirective\",\n]);\n\n// Nodes that never render as prose: image alt text was never indexed, MDX\n// expressions (`{props.x}`) and ESM (`export const meta`) are code, and math\n// is LaTeX source rendered by KaTeX, not searchable words.\nconst NON_PROSE = new Set<Nodes[\"type\"]>([\n \"image\",\n \"imageReference\",\n \"inlineMath\",\n \"math\",\n \"mdxFlowExpression\",\n \"mdxTextExpression\",\n \"mdxjsEsm\",\n]);\n\ntype PageFormat = PageRecord[\"format\"];\n\n/** What the plain-text walk carries: the code-block policy and the downlevel context. */\ninterface Walk {\n includeCodeBlocks: boolean;\n downlevel: DownlevelWalk;\n}\n\n// Front matter is already off (core/frontmatter.ts) by the time a body gets\n// here, so a body that opens with a `---` divider must read as a thematic\n// break rather than a second front matter block.\nconst MD_PARSE = { features: { ...MARKDOWN_FEATURES, frontmatter: false } };\nconst MDX_PARSE = { features: { ...MDX_FEATURES, frontmatter: false } };\n\nconst parseMdx = (markdown: string): Nodes | undefined => {\n try {\n return mdxToMdast(markdown, MDX_PARSE);\n } catch {\n return undefined;\n }\n};\n\n/**\n * Parse a page body the way the renderer reads it. `.mdx` pages go through\n * the MDX grammar with the renderer's feature set, so components become\n * `mdxJsx*` nodes whose children — prose and fences, however they're indented\n * — walk like top-level content, and `:::` directives and `$$` math parse as\n * such; Markdown would instead fold a tight component into one html node and\n * read its indented children as an indented code block. A page the MDX\n * grammar rejects (an HTML comment, an unclosed tag) fails to render too, so\n * it has no body to index: reading it as Markdown instead would put its ESM,\n * expressions, and raw tags in the index as prose.\n */\nconst parseMarkdown = (\n markdown: string,\n format: PageFormat\n): Nodes | undefined =>\n format === \"mdx\" ? parseMdx(markdown) : markdownToMdast(markdown, MD_PARSE);\n\n// Fenced code is excluded from the plain index by default (ranking noise) —\n// the \"markdown\" extraction keeps it for Ask AI grounding. Code-heavy docs opt\n// in via `search.indexing.includeCodeBlocks`, which indexes the fence body and\n// its rendered title (```ts blume.config.ts) but never the fence markers,\n// language, or other meta keywords.\nconst collectCode = (\n node: Extract<Nodes, { type: \"code\" }>,\n out: string[],\n walk: Walk\n): void => {\n if (!walk.includeCodeBlocks) {\n return;\n }\n const title = parseCodeTitle(node.meta ?? undefined);\n if (title) {\n out.push(title, \" \");\n }\n // The trailing space keeps the fence apart from what follows it.\n out.push(node.value, \" \");\n};\n\n// Block boundaries separate words; so does an empty inline element (`<br />`,\n// a self-closing icon), which otherwise fuses its neighbors.\nconst separatesWords = (node: Extract<Nodes, { children: unknown }>): boolean =>\n !INLINE_PARENTS.has(node.type) || node.children.length === 0;\n\n/** Fold one mdast node into the plain-text accumulator. */\nconst collectText = (node: Nodes, out: string[], walk: Walk): void => {\n if (NON_PROSE.has(node.type)) {\n return;\n }\n switch (node.type) {\n case \"code\": {\n collectCode(node, out, walk);\n return;\n }\n // A component with a serializer indexes as the text the page shows —\n // a Card's title and call to action, a TypeTable's descriptions — read\n // from the Markdown the serializer emits (its contract is Markdown, not\n // MDX). One without a serializer walks its children like any block.\n case \"mdxJsxFlowElement\": {\n // SAFETY: DownlevelNode is a structural subset of Satteri's mdast\n // output — the walk checks for offsets before reading them.\n const text = downlevelComponentNode(\n node as DownlevelNode,\n walk.downlevel\n );\n if (text !== null) {\n collectText(markdownToMdast(text, MD_PARSE), out, walk);\n return;\n }\n break;\n }\n // Inline code is kept verbatim — `Array<T>` is a type parameter, not a\n // tag, and its tokens must stay searchable.\n case \"inlineCode\": {\n out.push(node.value);\n return;\n }\n // A raw-HTML run. In a `.md` page (or an `.mdx` page MDX couldn't parse)\n // CommonMark folds a block-level `<Callout>` with no blank lines into ONE\n // html node holding all its inner prose, so the node can't just be\n // dropped — strip the tag-shaped runs and keep the text.\n case \"html\": {\n out.push(\n node.value.replaceAll(HTML_COMMENT, \" \").replaceAll(HTML_OR_JSX, \" \"),\n \" \"\n );\n return;\n }\n case \"break\": {\n out.push(\" \");\n return;\n }\n // Trailing heading markers (`[#custom-id]`, `{#custom-id}`, `[!toc]`,\n // `[toc]`) are anchor\n\n // metadata, not prose — strip them so they never pollute the index. Only\n // a marker that ends the heading's final plain-text child counts,\n // mirroring the renderer: a heading ending in inline code or an image\n // keeps its bracketed text on the page (so it stays searchable), and a\n // heading that is nothing but markers renders them literally.\n case \"heading\": {\n const last = node.children.at(-1);\n const trailing = last?.type === \"text\" ? last : undefined;\n const inner: string[] = [];\n const kept = trailing ? node.children.slice(0, -1) : node.children;\n for (const child of kept) {\n collectText(child, inner, walk);\n }\n if (trailing) {\n const stripped = parseHeadingMarkers(trailing.value).text;\n const literal = stripped === \"\" && node.children.length === 1;\n inner.push(literal ? trailing.value : stripped);\n }\n out.push(inner.join(\"\").trimEnd(), \" \");\n return;\n }\n default: {\n break;\n }\n }\n if (\"value\" in node) {\n out.push(node.value);\n return;\n }\n if (\"children\" in node) {\n for (const child of node.children) {\n collectText(child, out, walk);\n }\n if (separatesWords(node)) {\n out.push(\" \");\n }\n }\n};\n\n/**\n * Reduce Markdown/MDX to plain, searchable text: parse (GFM included) and walk\n * the tree instead of regex-stripping the source, so reference-style links,\n * autolinks, setext headings, tables, and literal `*`/`~`/`>` in prose all\n * reduce correctly. This feeds the client index *and* every hosted-provider\n * record, so anything lost here is a permanent search-quality loss.\n */\nconst toPlainText = (\n markdown: string,\n format: PageFormat,\n walk: Walk\n): string => {\n const tree = parseMarkdown(markdown, format);\n if (!tree) {\n return \"\";\n }\n const out: string[] = [];\n collectText(tree, out, walk);\n return out.join(\"\").replaceAll(WHITESPACE, \" \").trim();\n};\n\ninterface Crumbs {\n breadcrumb: string[];\n section: string;\n}\n\n/**\n * Map each page route to its ancestor section labels by walking the nav sidebar\n * once. The nearest ancestor group — the sidebar section a page appears under —\n * becomes its `section`, the dimension the search filter pills group by, so the\n * pills mirror the visible sidebar (and honor folder-meta renames).\n */\nconst buildCrumbIndex = (sidebar: NavNode[]): Map<string, Crumbs> => {\n const index = new Map<string, Crumbs>();\n // A config-sidebar section's landing page (the group's `root`) lives on the\n // *group* node, not on any page leaf — record it under the group's own label\n // so the section's landing page carries the same facet as its children. A\n // real page leaf for the route (filesystem sidebars emit index pages as\n // leaves) wins, so group routes are merged in only where no leaf claimed one.\n const groupRoutes = new Map<string, Crumbs>();\n const walk = (nodes: NavNode[], trail: string[]): void => {\n for (const node of nodes) {\n if (node.kind === \"group\") {\n if (node.route && !groupRoutes.has(node.route)) {\n groupRoutes.set(node.route, {\n breadcrumb: [...trail, node.label],\n section: node.label,\n });\n }\n walk(node.children, [...trail, node.label]);\n } else if (node.route) {\n index.set(node.route, {\n breadcrumb: trail,\n section: trail.at(-1) ?? \"\",\n });\n }\n }\n };\n walk(sidebar, []);\n for (const [route, crumbs] of groupRoutes) {\n if (!index.has(route)) {\n index.set(route, crumbs);\n }\n }\n return index;\n};\n\ninterface BuildOptions {\n includeWhenDisabled?: boolean;\n content?: \"markdown\" | \"plain\";\n audience?: VisibilityAudience;\n}\n\n/**\n * Read a page's body and reduce it per the extraction options. The\n * `\"markdown\"` body is agent-facing, so its components are downleveled in the\n * source with the serializers every agent surface uses (front matter in scope\n * for prop expressions). The plain body is parsed as written and walked, with\n * the same serializers applied per component on the way, so the index reads a\n * `<Card>` or `<TypeTable>` as the text it shows.\n */\nconst pageBody = async (\n project: BlumeProject,\n page: PageRecord | undefined,\n options: Pick<BuildOptions, \"audience\" | \"content\"> | undefined,\n components: Record<string, ComponentMarkdown>\n): Promise<string> => {\n if (!page) {\n return \"\";\n }\n const parsed = matter(await readExpandedEntryText(project, page));\n const visible = applyAudienceVisibility(\n parsed.content,\n options?.audience ?? \"web\"\n );\n if (options?.content === \"markdown\") {\n return downlevelComponents(visible.trim(), components, parsed.data);\n }\n return toPlainText(visible, page.format, {\n downlevel: {\n frontmatter: parsed.data,\n registry: componentRegistry(components),\n source: visible,\n },\n includeCodeBlocks: project.config.search.indexing.includeCodeBlocks,\n });\n};\n\n/**\n * Build search documents from the content graph. Only indexable pages are\n * included (per the route manifest), and content comes from the source files,\n * so the index is identical in dev and build.\n *\n * Pass `includeWhenDisabled` to index pages on their content merits even when\n * the search provider is `none` — used by the MCP server, which is a separate\n * feature from on-page search.\n *\n * `content` selects the extraction: `\"plain\"` (default) strips Markdown to bare\n * searchable text; `\"markdown\"` keeps the body's Markdown — code blocks, lists,\n * headings — for Ask AI grounding, where fenced examples are often the answer\n * and stripping them makes the model unable to cite content the docs do contain.\n * The `\"markdown\"` body is agent-facing, so components are downleveled with the\n * same serializers the `.md` mirror, llms-full.txt and MCP `get_page` use: a\n * page whose body is a `<CardGroup>` of `<Card>`s is prose to a reader and bare\n * JSX to anything reading the source, and section landing pages are exactly\n * that shape.\n *\n * `audience` resolves `<Visibility>` blocks before extraction: `\"web\"`\n * (default) keeps web-only content and drops agents-only blocks — the site\n * search and hosted syncs must not surface content the page hides — while\n * `\"agents\"` mirrors llms-full.txt/MCP `get_page` (web removed, agents kept).\n *\n * Whether fenced code joins the plain extraction is site-wide policy, read\n * from `search.indexing.includeCodeBlocks` here rather than threaded by each\n * caller, so the client index, hosted syncs, eject, and the MCP `search_docs`\n * index can't drift apart.\n */\nexport const buildSearchDocuments = async (\n project: BlumeProject,\n options?: BuildOptions\n): Promise<SearchDocument[]> => {\n const pageById = new Map(project.graph.pages.map((page) => [page.id, page]));\n\n // Build the crumb index from every locale's sidebar (their nodes carry\n // locale-prefixed routes), so localized pages get the right section/breadcrumb.\n // Falls back to the single default-locale nav when i18n is off.\n const byLocale = Object.values(project.graph.navigationByLocale ?? {});\n // Archived versions' trees contribute too, so snapshot pages get their own\n // section/breadcrumb instead of falling through to the \"Docs\" default.\n const byVersion = Object.values(project.graph.navigationByVersion ?? {})\n .flatMap((locales) => Object.values(locales))\n .map((nav) => nav.sidebar);\n const sidebars = [\n ...(byLocale.length > 0\n ? byLocale.map((nav) => nav.sidebar)\n : [project.graph.navigation?.sidebar ?? []]),\n ...byVersion,\n ];\n const crumbs = new Map<string, Crumbs>();\n for (const sidebar of sidebars) {\n for (const [route, crumb] of buildCrumbIndex(sidebar)) {\n crumbs.set(route, crumb);\n }\n }\n\n const indexable = project.manifest.routes.filter((route) => {\n if (!options?.includeWhenDisabled) {\n return route.indexable;\n }\n // A fallback route renders the fallback locale's page at another locale's\n // URL, so indexing it would only repeat that page as a second hit — the\n // reason site search leaves it out too.\n if (route.fallback) {\n return false;\n }\n const page = pageById.get(route.id);\n return page ? contentIndexable(page, project.config) : false;\n });\n\n // Built once — `downlevelComponents` rebuilds its registry per call\n // otherwise.\n const components = projectComponentSerializers(project);\n\n return await Promise.all(\n indexable.map(async (route) => {\n const page = pageById.get(route.id);\n const body = await pageBody(project, page, options, components);\n const tags = page?.meta?.search?.tags;\n const crumb = crumbs.get(route.path);\n const facets = page ? pageFacets(page, project.config) : undefined;\n const document: SearchDocument = {\n breadcrumb: crumb?.breadcrumb ?? [],\n content: body,\n contentType: route.contentType,\n description: page?.description ?? \"\",\n locale: route.locale,\n route: route.path,\n section: crumb?.section || \"Docs\",\n tags: tags && tags.length > 0 ? tags : undefined,\n title: route.title,\n version: route.version,\n };\n if (facets) {\n document.facets = facets;\n }\n return document;\n })\n );\n};\n\n/**\n * Map per-page search documents to the flat record shape hosted backends\n * ingest. One record per page, keyed by route; the first tag becomes the\n * faceting `tag`.\n */\nexport const toSearchRecords = (documents: SearchDocument[]): SearchRecord[] =>\n documents.map((doc) => ({\n _id: doc.route,\n content: doc.content,\n description: doc.description,\n locale: doc.locale,\n tag: doc.tags?.[0],\n title: doc.title,\n url: doc.route,\n version: doc.version || \"current\",\n }));\n",
|
|
6
|
+
"/**\n * The shared fence-meta grammar: how the tokens after a code fence's language\n * (```ts title=\"...\" {1,3-5} lineNumbers) split, and which of them carry\n * reserved meaning. Both the Shiki-side meta reader (`code-title.ts`) and the\n * MDAST plugins that rewrite marked fences (`ts2js.ts`) consume this, so the\n * two layers can't drift on token boundaries or keyword lists.\n */\n\n/**\n * Any quoted `key=\"...\"` attr (spaces allowed inside the quotes). The body\n * excludes only the delimiting quote, so `title=\"foo's file.ts\"` (an\n * apostrophe inside double quotes) still matches. The left boundary stops\n * `subtitle=\"...\"` (or any `*title=` attr) from reading as a title.\n */\nexport const QUOTED_ATTR = /[\\w-]+=(?:\"[^\"]*\"|'[^']*')/gu;\n\n/**\n * A Shiki `{1,3-5}` line-range token, braces included. Shiki tolerates\n * whitespace inside the braces (`{1, 3-5}`), so the range is one token even\n * when it contains spaces — split on whitespace alone, `3-5}` would surface\n * as a bare word and be promoted to the block title.\n */\nconst LINE_RANGE = /\\{[^}]*\\}/u;\n\n/**\n * One fence-meta token: a quoted attribute, a line range, or a bare word, so\n * a keyword inside a quoted value (`title=\"enable ts2js later\"`) never reads\n * as a bare token and a spaced line range never splits.\n */\nconst META_TOKEN = new RegExp(\n `${QUOTED_ATTR.source}|${LINE_RANGE.source}|\\\\S+`,\n \"gu\"\n);\n\n/** Split a raw fence meta string into its tokens. */\nexport const metaTokens = (meta: string | null | undefined): string[] =>\n meta?.match(META_TOKEN) ?? [];\n\n/**\n * Bare keywords with reserved meaning after the language; never promoted to\n * a block title.\n */\nexport const RESERVED_META_KEYWORDS: ReadonlySet<string> = new Set([\n \"lineNumbers\",\n \"ts2js\",\n \"twoslash\",\n]);\n\n/** A Shiki `{1,3-5}` line-range token. */\nexport const isLineRange = (token: string): boolean => token.startsWith(\"{\");\n",
|
|
7
|
+
"/**\n * Code-fence meta. A Shiki transformer reads the tokens after the language and\n * promotes them to attributes on the rendered `<pre>`:\n *\n * - a title — the first bare token (```ts blume.config.ts) or `title=\"...\"` —\n * becomes `data-title`; the theme's code header shows it, falling back to the\n * language label.\n * - the `lineNumbers` keyword (```ts file.ts lineNumbers) becomes\n * `data-line-numbers`; the theme renders a counter-driven line-number gutter.\n */\n\nimport {\n isLineRange,\n metaTokens,\n QUOTED_ATTR,\n RESERVED_META_KEYWORDS,\n} from \"./fence-meta.ts\";\n\n/** The slice of Shiki's transformer `this` context Blume reads. */\ninterface CodeMetaContext {\n options: { meta?: { __raw?: string } };\n}\n\n/** The `<pre>` hast node a Shiki `pre` hook receives. */\ninterface PreNode {\n properties: Record<string, boolean | number | string | undefined>;\n}\n\n/** A Shiki-compatible transformer, typed structurally to avoid a Shiki dep. */\nexport interface CodeTitleTransformer {\n name: string;\n pre: (this: CodeMetaContext, node: PreNode) => void;\n}\n\nconst TITLE_ATTR = /(?:^|\\s)title=(?:\"(?<dq>[^\"]*)\"|'(?<sq>[^']*)')/u;\nconst LINE_NUMBERS = /(?:^|\\s)lineNumbers(?=\\s|$)/u;\n\n// Quoted attrs are blanked before keyword/bare-token scans so a quoted value\n// can't leak tokens (`title=\"enable lineNumbers later\"`).\nconst withoutQuotedAttrs = (raw: string): string =>\n raw.replace(QUOTED_ATTR, \" \");\n\n// The first bare token is the title (```ts blume.config.ts): a non-empty token\n// that isn't a Shiki line range (`{1,3-5}`), a `key=value` attr, or a reserved\n// keyword.\nconst isTitleToken = (token: string): boolean =>\n token.length > 0 &&\n !isLineRange(token) &&\n !token.includes(\"=\") &&\n !RESERVED_META_KEYWORDS.has(token);\n\n/** The title a fence's meta string promotes to `data-title`, if any. */\nexport const parseCodeTitle = (raw: string | undefined): string | undefined => {\n if (!raw) {\n return undefined;\n }\n // Blank every *other* quoted attr first, so a `title=\"…\"` embedded in\n // another attribute's value (`caption='set title=\"X\" here'`) can't be\n // promoted to the block title.\n const scrubbed = raw.replace(QUOTED_ATTR, (attr) =>\n attr.startsWith(\"title=\") ? attr : \" \"\n );\n const explicit = scrubbed.match(TITLE_ATTR);\n const attrTitle = explicit?.groups?.dq ?? explicit?.groups?.sq;\n if (attrTitle) {\n return attrTitle;\n }\n // The shared tokenizer keeps a quoted attr (rejected below by its `=`) and\n // a spaced line range (`{1, 3-5}`) whole, so neither can shed a fragment\n // that reads as a bare title.\n return metaTokens(raw).find(isTitleToken);\n};\n\nconst hasLineNumbers = (raw: string | undefined): boolean =>\n Boolean(raw && LINE_NUMBERS.test(withoutQuotedAttrs(raw)));\n\n/** Build the transformer. Runs after Shiki's built-in `data-language` hook. */\nexport const codeTitleTransformer = (): CodeTitleTransformer => ({\n name: \"blume:code-meta\",\n pre(node) {\n const raw = this.options.meta?.__raw;\n const title = parseCodeTitle(raw);\n if (title) {\n node.properties.dataTitle = title;\n }\n if (hasLineNumbers(raw)) {\n node.properties.dataLineNumbers = true;\n }\n },\n});\n",
|
|
8
|
+
"import type { ResolvedConfig } from \"../core/schema.ts\";\nimport type { PageRecord } from \"../core/types.ts\";\n\n/**\n * Resolve a page's facet values: the subset of its validated custom\n * frontmatter named by its content type's `facets` declaration. Strings facet\n * as-is; numbers and booleans are stringified so an enum-like `priority: 1`\n * or `enforced: true` still filters; any other shape (objects, arrays,\n * transformed dates) is not a facet value and is skipped. Returns `undefined`\n * when nothing facets, so the field stays absent from serialized documents\n * rather than shipping as `{}` on every page.\n */\n/** Whether a custom frontmatter value stringifies into a usable facet value. */\nconst isFacetValue = <T>(value: T): value is T & (string | number | boolean) =>\n typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\";\n\nexport const pageFacets = (\n page: Pick<PageRecord, \"contentType\" | \"custom\">,\n config: ResolvedConfig\n): Record<string, string> | undefined => {\n const declared = config.content.types[page.contentType]?.facets;\n if (!declared || declared.length === 0 || !page.custom) {\n return;\n }\n const facets: Record<string, string> = {};\n for (const key of declared) {\n const value = page.custom[key];\n if (isFacetValue(value)) {\n facets[key] = String(value);\n }\n }\n return Object.keys(facets).length > 0 ? facets : undefined;\n};\n",
|
|
9
|
+
"import { normalizeBasePath } from \"../../core/base-path.ts\";\nimport type { BlumeProject } from \"../../core/project-graph.ts\";\nimport type { Navigation } from \"../../core/types.ts\";\nimport { buildSearchDocuments } from \"../../search/documents.ts\";\nimport { pageFacets } from \"../../search/facets.ts\";\nimport type { OramaDoc } from \"../../search/orama-index.ts\";\nimport { agentMarkdown, buildRawMarkdown } from \"../markdown.ts\";\n\n/** A page entry surfaced by the `list_pages` MCP tool. */\nexport interface McpRoute {\n contentType: string;\n description?: string;\n /** Declared facet values (`content.types.<type>.facets`), key → value. */\n facets?: Record<string, string>;\n indexable: boolean;\n lastModified: string | null;\n /** Resolved locale code (the default locale when not under i18n). */\n locale: string;\n route: string;\n title: string;\n /** Docs version (`\"\"` for the current docs). */\n version: string;\n}\n\n/**\n * The self-contained snapshot the generated MCP endpoint serves. Bundles the\n * search documents, raw page Markdown, route list, and navigation so the server\n * works regardless of the configured search provider and needs no filesystem\n * access at request time. Serialized to `generated/mcp-data.json`.\n */\nexport interface McpData {\n /**\n * Normalized `deployment.base` (`\"\"` or `/seg`), layered onto routes when\n * emitting URLs — the site is base-less and routes are base-less manifest\n * paths, matching the sitemap/llms.txt convention.\n */\n base: string;\n /**\n * The site's `i18n.defaultLocale`, when i18n is configured. Selects a\n * word-segmenting Orama tokenizer for every non-Latin script, so\n * `search_docs` can match CJK, Cyrillic, Greek, Hebrew, or Devanagari\n * content.\n */\n defaultLocale?: string;\n /**\n * Archived docs version ids, in configured order. Present only on a\n * versioned site; its presence is what makes `search_docs`/`list_pages`\n * default to the current docs.\n */\n archivedVersions?: string[];\n documents: OramaDoc[];\n instructions?: string;\n name: string;\n navigation: Navigation;\n /** Per-locale trees for a locale-aware `get_navigation` (i18n sites only). */\n navigationByLocale?: Record<string, Navigation>;\n /** Per-archived-version trees, keyed by version id then locale code. */\n navigationByVersion?: Record<string, Record<string, Navigation>>;\n pages: Record<string, string>;\n routes: McpRoute[];\n site: string | null;\n version: string;\n}\n\n/** Build the MCP data snapshot from a resolved project. */\nexport const buildMcpData = async (project: BlumeProject): Promise<McpData> => {\n const { config, graph, manifest } = project;\n const [documents, rawMarkdown] = await Promise.all([\n // The MCP server is independent of on-page search, so index docs even when\n // the search provider is `none`. Documents are agent-facing, so\n // `<Visibility>` resolves like `get_page`/llms-full.txt (web-only content\n // removed, agents-only kept).\n buildSearchDocuments(project, {\n audience: \"agents\",\n includeWhenDisabled: true,\n }),\n buildRawMarkdown(project),\n ]);\n\n // `get_page` serves the agent variant: components downleveled to Markdown.\n const pages = Object.fromEntries(\n Object.entries(rawMarkdown).map(([route, entry]) => [\n route,\n agentMarkdown(entry),\n ])\n );\n\n const pageById = new Map(graph.pages.map((page) => [page.id, page]));\n\n const routes: McpRoute[] = [];\n // Fallback routes render the fallback locale's page at another locale's\n // URL: listing them would pass that page off as a translation, once per\n // locale. `get_page` still resolves them through `pages`, as llms.txt and\n // search leave them out.\n for (const route of manifest.routes) {\n if (route.hidden || route.fallback) {\n continue;\n }\n const page = pageById.get(route.id);\n const facets = page ? pageFacets(page, config) : undefined;\n const entry: McpRoute = {\n contentType: route.contentType,\n description: page?.description,\n indexable: route.indexable,\n lastModified: route.lastModified ?? null,\n locale: route.locale,\n route: route.path,\n title: route.title,\n version: route.version,\n };\n if (facets) {\n entry.facets = facets;\n }\n routes.push(entry);\n }\n\n const data: McpData = {\n base: normalizeBasePath(config.deployment.options.base),\n defaultLocale: config.i18n?.defaultLocale,\n documents: documents.map((doc) => {\n const document: OramaDoc = {\n content: doc.content,\n contentType: doc.contentType,\n description: doc.description,\n locale: doc.locale,\n route: doc.route,\n title: doc.title,\n version: doc.version,\n };\n if (doc.facets) {\n document.facets = doc.facets;\n }\n return document;\n }),\n instructions: config.agents.mcp.instructions,\n name: config.agents.mcp.name ?? config.title,\n navigation: graph.navigation,\n pages,\n routes,\n site: config.deployment.options.site ?? null,\n version: manifest.blumeVersion,\n };\n if (config.versions) {\n data.archivedVersions = config.versions.archived.map(\n (version) => version.id\n );\n data.navigationByVersion = graph.navigationByVersion;\n }\n if (config.i18n) {\n data.navigationByLocale = graph.navigationByLocale;\n }\n return data;\n};\n"
|
|
10
|
+
],
|
|
11
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AACA;;;ACaO,IAAM,cAAc;AAQ3B,IAAM,aAAa;AAOnB,IAAM,aAAa,IAAI,OACrB,GAAG,YAAY,UAAU,WAAW,eACpC,IACF;AAGO,IAAM,aAAa,CAAC,SACzB,MAAM,MAAM,UAAU,KAAK,CAAC;AAMvB,IA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,IAAI;AAAA,QACjB,QAAQ,IAAI;AAAA,QACZ,OAAO,IAAI;AAAA,QACX,OAAO,IAAI;AAAA,QACX,SAAS,IAAI;AAAA,MACf;AAAA,MACA,IAAI,IAAI,QAAQ;AAAA,QACd,SAAS,SAAS,IAAI;AAAA,MACxB;AAAA,MACA,OAAO;AAAA,KACR;AAAA,IACD,cAAc,OAAO,OAAO,IAAI;AAAA,IAChC,MAAM,OAAO,OAAO,IAAI,QAAQ,OAAO;AAAA,IACvC,YAAY,MAAM;AAAA,IAClB;AAAA,IACA;AAAA,IACA,MAAM,OAAO,WAAW,QAAQ,QAAQ;AAAA,IACxC,SAAS,SAAS;AAAA,EACpB;AAAA,EACA,IAAI,OAAO,UAAU;AAAA,IACnB,KAAK,mBAAmB,OAAO,SAAS,SAAS,IAC/C,CAAC,YAAY,QAAQ,EACvB;AAAA,IACA,KAAK,sBAAsB,MAAM;AAAA,EACnC;AAAA,EACA,IAAI,OAAO,MAAM;AAAA,IACf,KAAK,qBAAqB,MAAM;AAAA,EAClC;AAAA,EACA,OAAO;AAAA;",
|
|
12
|
+
"debugId": "341A56DACBB5F6DE64756E2164756E21",
|
|
13
|
+
"names": []
|
|
14
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/core/sources/watch.ts
|
|
4
|
+
var BLUME_IGNORE_DIRS = [
|
|
5
|
+
".blume",
|
|
6
|
+
".blume-verify",
|
|
7
|
+
".cache",
|
|
8
|
+
".git",
|
|
9
|
+
".next",
|
|
10
|
+
".turbo",
|
|
11
|
+
".vercel",
|
|
12
|
+
"dist",
|
|
13
|
+
"node_modules"
|
|
14
|
+
];
|
|
15
|
+
var baselineScanIgnore = () => BLUME_IGNORE_DIRS.map((dir) => `**/${dir}/**`);
|
|
16
|
+
var BLUME_WATCH_IGNORE_DIRS = BLUME_IGNORE_DIRS;
|
|
17
|
+
var excludeDirSegments = (patterns) => patterns.map((pattern) => /^(?<dir>[^*/]+)\/\*\*$/u.exec(pattern)?.groups?.dir).filter((dir) => dir !== undefined);
|
|
18
|
+
var ignoringWatchListener = (onChange, ignoreDirs = BLUME_WATCH_IGNORE_DIRS, ignoreSegment = () => false) => {
|
|
19
|
+
const ignore = new Set(ignoreDirs);
|
|
20
|
+
return (_event, filename) => {
|
|
21
|
+
if (filename !== null && filename.split(/[/\\]/u).some((segment) => ignore.has(segment) || ignoreSegment(segment))) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
onChange();
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export { BLUME_IGNORE_DIRS, baselineScanIgnore, BLUME_WATCH_IGNORE_DIRS, excludeDirSegments, ignoringWatchListener };
|
|
29
|
+
|
|
30
|
+
//# debugId=E327C8C451E6563064756E2164756E21
|
|
31
|
+
//# sourceMappingURL=chunk-abh8yjkn.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/core/sources/watch.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import type { WatchListener } from \"node:fs\";\n\n/**\n * Directory segments that are never authored content: VCS, dependency trees,\n * Blume's own generated project and build output, and framework/deploy caches.\n * Both the content scan and the dev watcher skip these unconditionally, on top\n * of the user's `content.exclude`.\n *\n * The scan needs them because a broadly-scoped `content.root` — `\".\"` or an app\n * dir that also holds `node_modules`/`dist`, the common shape when migrating a\n * docs app that lives at the repo or app root — would otherwise glob thousands\n * of stray markdown files out of dependencies and build artifacts. `content.root`\n * defaults to `docs/` where this rarely bites, but any wider root hits it.\n *\n * The watcher needs them because a recursive `fs.watch` rooted at the project\n * also sees Blume's own `.blume/` output, which the dev server rewrites on every\n * render (e.g. `.blume/.astro/data-store.json`). Left unfiltered, each such write\n * re-triggers a rescan + runtime regeneration whose writes land back under\n * `.blume/` and fire the watcher again: a self-sustaining loop that stalls page\n * renders and floods the console. `fs.watch` has no ignore option, so we filter\n * by the changed path in the callback.\n */\nexport const BLUME_IGNORE_DIRS = [\n \".blume\",\n // The isolated `blume check --isolated` runtime. A sibling of `.blume`, it is\n // written while a dev server runs; without this the content-layer watcher (or\n // a `.`-rooted fs.watch) would treat its generation as a content change and\n // reload — the very thing `--isolated` promises not to do.\n \".blume-verify\",\n \".cache\",\n \".git\",\n \".next\",\n \".turbo\",\n \".vercel\",\n \"dist\",\n \"node_modules\",\n];\n\n/**\n * Baseline scan-ignore globs applied to every filesystem source, unioned with\n * the user's `content.exclude`. Kept in sync with the watcher via the shared\n * {@link BLUME_IGNORE_DIRS} so `load()` and `watch()` never disagree on what is\n * content. `**\\/<dir>/**` matches the directory at the content root or nested.\n */\nexport const baselineScanIgnore = (): string[] =>\n BLUME_IGNORE_DIRS.map((dir) => `**/${dir}/**`);\n\n/**\n * Alias retained for the dev watcher's call site and its tests; the watcher and\n * the scan share the same never-content directory set.\n */\nexport const BLUME_WATCH_IGNORE_DIRS = BLUME_IGNORE_DIRS;\n\n/** Extract single-segment ignore dirs (`foo`) from `foo/**`-style excludes. */\nexport const excludeDirSegments = (patterns: readonly string[]): string[] =>\n patterns\n .map((pattern) => /^(?<dir>[^*/]+)\\/\\*\\*$/u.exec(pattern)?.groups?.dir)\n .filter((dir): dir is string => dir !== undefined);\n\n/**\n * Build a recursive-watch listener that fires `onChange` for content changes but\n * ignores events whose path crosses an ignored directory segment — one in\n * `ignoreDirs`, or one `ignoreSegment` rejects, for a scan whose skip rule is\n * a shape (every dot-name) rather than a list. A missing `filename` — rare;\n * the platform couldn't name the changed path — falls through to `onChange`\n * rather than silently dropping a real edit. Exported for testing.\n */\nexport const ignoringWatchListener = (\n onChange: () => void,\n ignoreDirs: Iterable<string> = BLUME_WATCH_IGNORE_DIRS,\n ignoreSegment: (segment: string) => boolean = () => false\n): WatchListener<string> => {\n const ignore = new Set(ignoreDirs);\n return (_event, filename) => {\n if (\n filename !== null &&\n filename\n .split(/[/\\\\]/u)\n .some((segment) => ignore.has(segment) || ignoreSegment(segment))\n ) {\n return;\n }\n onChange();\n };\n};\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;AAsBO,IAAM,oBAAoB;AAAA,EAC/B;AAAA,EAKA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAQO,IAAM,qBAAqB,MAChC,kBAAkB,IAAI,CAAC,QAAQ,MAAM,QAAQ;AAMxC,IAAM,0BAA0B;AAGhC,IAAM,qBAAqB,CAAC,aACjC,SACG,IAAI,CAAC,YAAY,0BAA0B,KAAK,OAAO,GAAG,QAAQ,GAAG,EACrE,OAAO,CAAC,QAAuB,QAAQ,SAAS;AAU9C,IAAM,wBAAwB,CACnC,UACA,aAA+B,yBAC/B,gBAA8C,MAAM,UAC1B;AAAA,EAC1B,MAAM,SAAS,IAAI,IAAI,UAAU;AAAA,EACjC,OAAO,CAAC,QAAQ,aAAa;AAAA,IAC3B,IACE,aAAa,QACb,SACG,MAAM,QAAQ,EACd,KAAK,CAAC,YAAY,OAAO,IAAI,OAAO,KAAK,cAAc,OAAO,CAAC,GAClE;AAAA,MACA;AAAA,IACF;AAAA,IACA,SAAS;AAAA;AAAA;",
|
|
8
|
+
"debugId": "E327C8C451E6563064756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
loadConfig
|
|
4
|
+
} from "./chunk-xaz13gwg.js";
|
|
5
|
+
import"./chunk-jts8mvcz.js";
|
|
6
|
+
import {
|
|
7
|
+
commandMeta,
|
|
8
|
+
reportInternalError,
|
|
9
|
+
BlumeError,
|
|
10
|
+
logger,
|
|
11
|
+
reportDiagnostics
|
|
12
|
+
} from "./index.js";
|
|
13
|
+
import"./chunk-jq5n4avg.js";
|
|
14
|
+
import"./chunk-zg2gtj10.js";
|
|
15
|
+
import {
|
|
16
|
+
CutError,
|
|
17
|
+
cutVersion
|
|
18
|
+
} from "./chunk-sqn5t4q0.js";
|
|
19
|
+
|
|
20
|
+
// src/cli/commands/version.ts
|
|
21
|
+
import { defineCommand } from "citty";
|
|
22
|
+
var listVersions = async (root) => {
|
|
23
|
+
const { config } = await loadConfig(root);
|
|
24
|
+
if (!config.versions) {
|
|
25
|
+
logger.info("Versioning is not configured. Cut the first version with `blume version <id>` (e.g. `blume version v1.0`).");
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const { current, archived } = config.versions;
|
|
29
|
+
process.stdout.write(` ${current.label} (current)${current.badge ? ` — ${current.badge}` : ""}
|
|
30
|
+
`);
|
|
31
|
+
for (const version of archived) {
|
|
32
|
+
process.stdout.write(` ${version.label ?? version.id} — ${version.id}/
|
|
33
|
+
`);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
var reportCut = (id, result) => {
|
|
37
|
+
logger.success(`Snapshot ${result.dir} (${result.copied} file(s) copied)`);
|
|
38
|
+
const totalRewrites = result.rewritten.reduce((sum, entry) => sum + entry.count, 0);
|
|
39
|
+
if (totalRewrites > 0) {
|
|
40
|
+
logger.info(`Rewrote root-absolute links in ${result.rewritten.length} page(s) (${totalRewrites} line(s)).`);
|
|
41
|
+
}
|
|
42
|
+
if (result.versionsAdded) {
|
|
43
|
+
logger.success(`Turned on versioning in blume.config.ts with "${id}" archived; the live docs are labeled "Latest" in the switcher until you rename versions.current.label.`);
|
|
44
|
+
} else if (result.configUpdated) {
|
|
45
|
+
logger.success(`Added "${id}" to versions.archived in blume.config.ts`);
|
|
46
|
+
} else if (result.configSnippet) {
|
|
47
|
+
logger.warn(`blume.config.ts couldn't be updated automatically, so "${id}" isn't registered yet and its pages build as ordinary content until it is. ${result.configSnippet}`);
|
|
48
|
+
}
|
|
49
|
+
logger.info("Archived versions are frozen — future edits belong in the live tree. Restart `blume dev` to pick up the snapshot.");
|
|
50
|
+
};
|
|
51
|
+
var versionCommand = defineCommand({
|
|
52
|
+
args: {
|
|
53
|
+
force: {
|
|
54
|
+
description: "Overwrite an existing snapshot directory.",
|
|
55
|
+
type: "boolean"
|
|
56
|
+
},
|
|
57
|
+
id: {
|
|
58
|
+
description: 'Version id to cut (e.g. "v1.0").',
|
|
59
|
+
required: false,
|
|
60
|
+
type: "positional"
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
meta: commandMeta.version,
|
|
64
|
+
async run({ args }) {
|
|
65
|
+
const root = process.cwd();
|
|
66
|
+
try {
|
|
67
|
+
if (args.id) {
|
|
68
|
+
reportCut(args.id, await cutVersion(root, args.id, { force: args.force }));
|
|
69
|
+
} else {
|
|
70
|
+
await listVersions(root);
|
|
71
|
+
}
|
|
72
|
+
} catch (error) {
|
|
73
|
+
if (error instanceof CutError) {
|
|
74
|
+
logger.error(error.message);
|
|
75
|
+
process.exit(1);
|
|
76
|
+
}
|
|
77
|
+
if (error instanceof BlumeError) {
|
|
78
|
+
reportDiagnostics([error.diagnostic], root);
|
|
79
|
+
process.exit(1);
|
|
80
|
+
}
|
|
81
|
+
reportInternalError(error);
|
|
82
|
+
process.exit(1);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
export {
|
|
87
|
+
versionCommand
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
//# debugId=86F69482E9E3E55264756E2164756E21
|
|
91
|
+
//# sourceMappingURL=chunk-b5aj94ah.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/cli/commands/version.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { defineCommand } from \"citty\";\n\nimport { loadConfig } from \"../../core/config.ts\";\nimport { BlumeError } from \"../../core/diagnostics.ts\";\nimport { CutError, cutVersion } from \"../../core/version-cut.ts\";\nimport type { CutResult } from \"../../core/version-cut.ts\";\nimport { commandMeta } from \"../command-meta.ts\";\nimport { reportInternalError } from \"../internal-error.ts\";\nimport { logger, reportDiagnostics } from \"../log.ts\";\n\n/** `blume version` with no id: list the configured versions. */\nconst listVersions = async (root: string): Promise<void> => {\n const { config } = await loadConfig(root);\n if (!config.versions) {\n logger.info(\n \"Versioning is not configured. Cut the first version with `blume version <id>` (e.g. `blume version v1.0`).\"\n );\n return;\n }\n const { current, archived } = config.versions;\n process.stdout.write(\n ` ${current.label} (current)${current.badge ? ` — ${current.badge}` : \"\"}\\n`\n );\n for (const version of archived) {\n process.stdout.write(` ${version.label ?? version.id} — ${version.id}/\\n`);\n }\n};\n\n/** Report what a cut did, including how its id reached the config (or didn't). */\nconst reportCut = (id: string, result: CutResult): void => {\n logger.success(`Snapshot ${result.dir} (${result.copied} file(s) copied)`);\n const totalRewrites = result.rewritten.reduce(\n (sum, entry) => sum + entry.count,\n 0\n );\n if (totalRewrites > 0) {\n logger.info(\n `Rewrote root-absolute links in ${result.rewritten.length} page(s) (${totalRewrites} line(s)).`\n );\n }\n if (result.versionsAdded) {\n logger.success(\n `Turned on versioning in blume.config.ts with \"${id}\" archived; the live docs are labeled \"Latest\" in the switcher until you rename versions.current.label.`\n );\n } else if (result.configUpdated) {\n logger.success(`Added \"${id}\" to versions.archived in blume.config.ts`);\n } else if (result.configSnippet) {\n // A warning, not info: until it's pasted, the snapshot builds as ordinary\n // content — every page twice — and consola drops info lines under CI.\n logger.warn(\n `blume.config.ts couldn't be updated automatically, so \"${id}\" isn't registered yet and its pages build as ordinary content until it is. ${result.configSnippet}`\n );\n }\n logger.info(\n \"Archived versions are frozen — future edits belong in the live tree. Restart `blume dev` to pick up the snapshot.\"\n );\n};\n\nexport const versionCommand = defineCommand({\n args: {\n force: {\n description: \"Overwrite an existing snapshot directory.\",\n type: \"boolean\",\n },\n id: {\n description: 'Version id to cut (e.g. \"v1.0\").',\n required: false,\n type: \"positional\",\n },\n },\n meta: commandMeta.version,\n async run({ args }) {\n const root = process.cwd();\n try {\n if (args.id) {\n reportCut(\n args.id,\n await cutVersion(root, args.id, { force: args.force })\n );\n } else {\n await listVersions(root);\n }\n } catch (error) {\n if (error instanceof CutError) {\n logger.error(error.message);\n process.exit(1);\n }\n if (error instanceof BlumeError) {\n reportDiagnostics([error.diagnostic], root);\n process.exit(1);\n }\n reportInternalError(error);\n process.exit(1);\n }\n },\n});\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAWA,IAAM,eAAe,OAAO,SAAgC;AAAA,EAC1D,QAAQ,WAAW,MAAM,WAAW,IAAI;AAAA,EACxC,IAAI,CAAC,OAAO,UAAU;AAAA,IACpB,OAAO,KACL,4GACF;AAAA,IACA;AAAA,EACF;AAAA,EACA,QAAQ,SAAS,aAAa,OAAO;AAAA,EACrC,QAAQ,OAAO,MACb,KAAK,QAAQ,kBAAkB,QAAQ,QAAQ,MAAM,QAAQ,UAAU;AAAA,CACzE;AAAA,EACA,WAAW,WAAW,UAAU;AAAA,IAC9B,QAAQ,OAAO,MAAM,KAAK,QAAQ,SAAS,QAAQ,QAAQ,QAAQ;AAAA,CAAO;AAAA,EAC5E;AAAA;AAIF,IAAM,YAAY,CAAC,IAAY,WAA4B;AAAA,EACzD,OAAO,QAAQ,YAAY,OAAO,QAAQ,OAAO,wBAAwB;AAAA,EACzE,MAAM,gBAAgB,OAAO,UAAU,OACrC,CAAC,KAAK,UAAU,MAAM,MAAM,OAC5B,CACF;AAAA,EACA,IAAI,gBAAgB,GAAG;AAAA,IACrB,OAAO,KACL,kCAAkC,OAAO,UAAU,mBAAmB,yBACxE;AAAA,EACF;AAAA,EACA,IAAI,OAAO,eAAe;AAAA,IACxB,OAAO,QACL,iDAAiD,2GACnD;AAAA,EACF,EAAO,SAAI,OAAO,eAAe;AAAA,IAC/B,OAAO,QAAQ,UAAU,6CAA6C;AAAA,EACxE,EAAO,SAAI,OAAO,eAAe;AAAA,IAG/B,OAAO,KACL,0DAA0D,iFAAiF,OAAO,eACpJ;AAAA,EACF;AAAA,EACA,OAAO,KACL,mHACF;AAAA;AAGK,IAAM,iBAAiB,cAAc;AAAA,EAC1C,MAAM;AAAA,IACJ,OAAO;AAAA,MACL,aAAa;AAAA,MACb,MAAM;AAAA,IACR;AAAA,IACA,IAAI;AAAA,MACF,aAAa;AAAA,MACb,UAAU;AAAA,MACV,MAAM;AAAA,IACR;AAAA,EACF;AAAA,EACA,MAAM,YAAY;AAAA,OACZ,IAAG,GAAG,QAAQ;AAAA,IAClB,MAAM,OAAO,QAAQ,IAAI;AAAA,IACzB,IAAI;AAAA,MACF,IAAI,KAAK,IAAI;AAAA,QACX,UACE,KAAK,IACL,MAAM,WAAW,MAAM,KAAK,IAAI,EAAE,OAAO,KAAK,MAAM,CAAC,CACvD;AAAA,MACF,EAAO;AAAA,QACL,MAAM,aAAa,IAAI;AAAA;AAAA,MAEzB,OAAO,OAAO;AAAA,MACd,IAAI,iBAAiB,UAAU;AAAA,QAC7B,OAAO,MAAM,MAAM,OAAO;AAAA,QAC1B,QAAQ,KAAK,CAAC;AAAA,MAChB;AAAA,MACA,IAAI,iBAAiB,YAAY;AAAA,QAC/B,kBAAkB,CAAC,MAAM,UAAU,GAAG,IAAI;AAAA,QAC1C,QAAQ,KAAK,CAAC;AAAA,MAChB;AAAA,MACA,oBAAoB,KAAK;AAAA,MACzB,QAAQ,KAAK,CAAC;AAAA;AAAA;AAGpB,CAAC;",
|
|
8
|
+
"debugId": "86F69482E9E3E55264756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -2,15 +2,19 @@
|
|
|
2
2
|
import {
|
|
3
3
|
resolveProjectContext,
|
|
4
4
|
loadConfig
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-xaz13gwg.js";
|
|
6
|
+
import"./chunk-jts8mvcz.js";
|
|
6
7
|
import {
|
|
7
8
|
commandMeta,
|
|
8
9
|
normalizeHost,
|
|
9
10
|
logger
|
|
10
11
|
} from "./index.js";
|
|
12
|
+
import {
|
|
13
|
+
deployOutputDir
|
|
14
|
+
} from "./chunk-nk3ts2xk.js";
|
|
11
15
|
import {
|
|
12
16
|
parsePort
|
|
13
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-zxccj738.js";
|
|
14
18
|
|
|
15
19
|
// src/cli/commands/preview.ts
|
|
16
20
|
import { existsSync } from "node:fs";
|
|
@@ -27,7 +31,7 @@ var previewCommand = defineCommand({
|
|
|
27
31
|
const root = process.cwd();
|
|
28
32
|
const { config } = await loadConfig(root);
|
|
29
33
|
const context = resolveProjectContext(root, config);
|
|
30
|
-
if (!existsSync(join(context.outDir, "astro.config.mjs"))) {
|
|
34
|
+
if (!existsSync(join(context.outDir, "astro.config.mjs")) || !existsSync(deployOutputDir(config, context))) {
|
|
31
35
|
logger.error("No build found. Run `blume build` first.");
|
|
32
36
|
process.exit(1);
|
|
33
37
|
}
|
|
@@ -45,5 +49,5 @@ export {
|
|
|
45
49
|
previewCommand
|
|
46
50
|
};
|
|
47
51
|
|
|
48
|
-
//# debugId=
|
|
49
|
-
//# sourceMappingURL=chunk-
|
|
52
|
+
//# debugId=7FC21538FC698FBD64756E2164756E21
|
|
53
|
+
//# sourceMappingURL=chunk-bctazmbk.js.map
|