blume 1.7.3 → 2.0.1
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 +245 -0
- package/README.md +34 -21
- package/dist/cli/{chunk-vacwm2hv.js → chunk-27g6wdth.js} +2 -2
- package/dist/cli/{chunk-ps4m1xh4.js → chunk-2hn4b8z7.js} +513 -550
- package/dist/cli/chunk-2hn4b8z7.js.map +12 -0
- package/dist/cli/chunk-5shv93fd.js +39 -0
- package/dist/cli/chunk-5shv93fd.js.map +10 -0
- package/dist/cli/chunk-6crbhc3x.js +361 -0
- package/dist/cli/chunk-6crbhc3x.js.map +14 -0
- package/dist/cli/{chunk-8cjtbafj.js → chunk-6hsn950k.js} +109 -383
- package/dist/cli/chunk-6hsn950k.js.map +10 -0
- package/dist/cli/chunk-6vm74dry.js +148 -0
- package/dist/cli/chunk-6vm74dry.js.map +10 -0
- package/dist/cli/{chunk-yg63d42r.js → chunk-79jhk4py.js} +87 -58
- package/dist/cli/chunk-79jhk4py.js.map +35 -0
- package/dist/cli/chunk-82bbrxdn.js +51 -0
- package/dist/cli/chunk-82bbrxdn.js.map +10 -0
- package/dist/cli/chunk-abh8yjkn.js +31 -0
- package/dist/cli/chunk-abh8yjkn.js.map +10 -0
- package/dist/cli/chunk-ah61y8py.js +75 -0
- package/dist/cli/chunk-ah61y8py.js.map +11 -0
- package/dist/cli/{chunk-dwgcp5sm.js → chunk-ce574jw2.js} +1 -1
- package/dist/cli/chunk-ch6g3ar0.js +102 -0
- package/dist/cli/chunk-ch6g3ar0.js.map +10 -0
- package/dist/cli/chunk-dh8cwk36.js +279 -0
- package/dist/cli/chunk-dh8cwk36.js.map +10 -0
- package/dist/cli/{chunk-rqy0s5wh.js → chunk-epjnccmv.js} +17 -16
- package/dist/cli/{chunk-rqy0s5wh.js.map → chunk-epjnccmv.js.map} +3 -3
- package/dist/cli/chunk-f2z5v128.js +97 -0
- package/dist/cli/chunk-f2z5v128.js.map +10 -0
- package/dist/cli/{chunk-2z47ypj8.js → chunk-fa25z98p.js} +16 -3
- package/dist/cli/chunk-fa25z98p.js.map +11 -0
- package/dist/cli/{chunk-1jefwnfs.js → chunk-fs23ddbb.js} +1076 -2592
- package/dist/cli/chunk-fs23ddbb.js.map +35 -0
- package/dist/cli/{chunk-e7f42gdj.js → chunk-fxypxtvm.js} +2 -2
- package/dist/cli/{chunk-bvwwhd84.js → chunk-fz5wtpmh.js} +15 -15
- package/dist/cli/{chunk-bvwwhd84.js.map → chunk-fz5wtpmh.js.map} +1 -1
- package/dist/cli/chunk-hdpx1tax.js +91 -0
- package/dist/cli/chunk-hdpx1tax.js.map +10 -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-ahnw3kxw.js → chunk-jwyddg7y.js} +27 -22
- package/dist/cli/chunk-jwyddg7y.js.map +15 -0
- package/dist/cli/{chunk-cjtn640a.js → chunk-kdp5q7ke.js} +43 -20
- package/dist/cli/chunk-kdp5q7ke.js.map +10 -0
- package/dist/cli/{chunk-5g0w1e2c.js → chunk-kpf8rrjc.js} +28 -16
- package/dist/cli/{chunk-5g0w1e2c.js.map → chunk-kpf8rrjc.js.map} +4 -4
- package/dist/cli/chunk-m3vmjgmq.js +133 -0
- package/dist/cli/chunk-m3vmjgmq.js.map +10 -0
- package/dist/cli/{chunk-b27xqwn9.js → chunk-mb2919y2.js} +9 -5
- package/dist/cli/chunk-mb2919y2.js.map +10 -0
- package/dist/cli/{chunk-5qk08vmp.js → chunk-q5163e60.js} +133 -54
- package/dist/cli/chunk-q5163e60.js.map +11 -0
- package/dist/cli/chunk-qkqwkpte.js +12437 -0
- package/dist/cli/chunk-qkqwkpte.js.map +182 -0
- package/dist/cli/{chunk-4x36ddpw.js → chunk-qs4q5p4e.js} +81 -87
- package/dist/cli/chunk-qs4q5p4e.js.map +10 -0
- package/dist/cli/{chunk-0xjyb285.js → chunk-qwsrynx5.js} +15 -5
- package/dist/cli/{chunk-0xjyb285.js.map → chunk-qwsrynx5.js.map} +4 -4
- package/dist/cli/chunk-s1p84fyh.js +261 -0
- package/dist/cli/chunk-s1p84fyh.js.map +10 -0
- package/dist/cli/chunk-s6jhgk0q.js +176 -0
- package/dist/cli/chunk-s6jhgk0q.js.map +11 -0
- package/dist/cli/chunk-vtk4a6dg.js +374 -0
- package/dist/cli/chunk-vtk4a6dg.js.map +10 -0
- package/dist/cli/{chunk-k79xp7av.js → chunk-wgm7m9qk.js} +230 -700
- package/dist/cli/chunk-wgm7m9qk.js.map +36 -0
- package/dist/cli/chunk-wm7js3j9.js +145 -0
- package/dist/cli/chunk-wm7js3j9.js.map +11 -0
- package/dist/cli/chunk-yt5n7ppj.js +79 -0
- package/dist/cli/chunk-yt5n7ppj.js.map +10 -0
- package/dist/cli/{chunk-3r45185y.js → chunk-yw7dm696.js} +9 -11
- package/dist/cli/{chunk-3r45185y.js.map → chunk-yw7dm696.js.map} +3 -3
- package/dist/cli/{chunk-nn13znc2.js → chunk-zxcczpyx.js} +1 -1
- package/dist/cli/chunk-zxh4d9vy.js +122 -0
- package/dist/cli/chunk-zxh4d9vy.js.map +11 -0
- 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-context.d.ts +7 -7
- 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 +197 -526
- package/dist/types/core/config.d.ts +61 -35
- 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 +30 -15
- 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 +12 -10
- 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 +2284 -454
- 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/orama-index.d.ts +1 -1
- 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 +52 -28
- package/docs/03-upgrading.mdx +364 -0
- package/docs/04-migrating.mdx +58 -0
- package/docs/08-faq.mdx +5 -5
- package/docs/advanced/blog.mdx +13 -6
- package/docs/advanced/changelog.mdx +23 -35
- package/docs/advanced/custom-pages.mdx +22 -10
- 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} +12 -11
- package/docs/cli/index.mdx +105 -0
- package/docs/cli/meta.ts +7 -0
- package/docs/{reference → cli}/translate.mdx +9 -9
- package/docs/cli/validate.mdx +41 -0
- package/docs/cli/version.mdx +40 -0
- package/docs/configuration/analytics.mdx +350 -59
- package/docs/configuration/assistant.mdx +357 -0
- package/docs/configuration/customization.mdx +16 -10
- package/docs/configuration/index.mdx +50 -31
- package/docs/configuration/meta.ts +1 -1
- package/docs/configuration/search.mdx +76 -55
- 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 +9 -7
- package/docs/content/includes.mdx +2 -4
- package/docs/content/index.mdx +1 -1
- package/docs/content/islands.mdx +11 -6
- 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 +12 -12
- 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 +4 -4
- 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 +23 -10
- 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 +25 -26
- package/src/ai/ai-catalog.ts +50 -32
- package/src/ai/api/handlers.ts +46 -11
- package/src/ai/api/paths.ts +1 -1
- package/src/ai/api-catalog.ts +8 -8
- package/src/ai/ask-context.ts +7 -7
- package/src/ai/ask-data.ts +3 -3
- package/src/ai/ask.ts +637 -100
- package/src/ai/changelog-markdown.ts +91 -0
- package/src/ai/component-markdown.ts +328 -12
- package/src/ai/cors.ts +3 -3
- 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 +5 -2
- package/src/ai/relative-links.ts +170 -0
- package/src/ai/serializers.ts +3 -3
- package/src/ai/skills.ts +1 -1
- package/src/ai/visibility.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 +129 -361
- package/src/astro/integration.ts +2 -6
- package/src/astro/module-types.ts +1 -1
- 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 +575 -562
- 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/blume-modules.d.ts +2 -2
- package/src/cli/command-meta.ts +10 -0
- package/src/cli/commands/audit.ts +40 -21
- 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 +92 -14
- package/src/cli/commands/eject.ts +44 -7
- package/src/cli/commands/eval.ts +5 -5
- 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 +5 -5
- 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 +39 -12
- 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/copy-feedback.ts +1 -1
- package/src/components/islands/{AskAI.astro → Assistant.astro} +10 -10
- package/src/components/islands/{ask-ai.tsx → assistant.tsx} +23 -23
- package/src/components/islands/hooks.ts +36 -11
- 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 +93 -30
- 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 +58 -11
- package/src/components/layout/Pagination.astro +7 -7
- package/src/components/layout/ReferenceLayout.astro +22 -13
- package/src/components/layout/RootLayout.astro +75 -72
- package/src/components/layout/Search.astro +43 -19
- package/src/components/layout/WebMcp.astro +1 -1
- package/src/components/layout/analytics-client.ts +73 -16
- 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/description.ts +2 -2
- package/src/components/openapi/playground-client.ts +79 -10
- package/src/core/changelog-index.ts +24 -0
- package/src/core/code-fences.ts +1 -1
- package/src/core/component-overrides.ts +399 -154
- package/src/core/config-input.ts +201 -566
- package/src/core/config.ts +131 -42
- package/src/core/custom-pages.ts +105 -0
- package/src/core/data.ts +34 -15
- 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 +41 -11
- 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 +528 -745
- package/src/core/server-features.ts +10 -11
- 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 +10 -7
- package/src/core/ui-packs/bg.ts +10 -7
- package/src/core/ui-packs/bn.ts +10 -7
- package/src/core/ui-packs/ca.ts +7 -6
- package/src/core/ui-packs/cs.ts +10 -7
- package/src/core/ui-packs/da.ts +10 -7
- package/src/core/ui-packs/de.ts +10 -7
- package/src/core/ui-packs/el.ts +7 -6
- package/src/core/ui-packs/es.ts +7 -6
- package/src/core/ui-packs/fa.ts +10 -7
- package/src/core/ui-packs/fi.ts +10 -7
- package/src/core/ui-packs/fr.ts +7 -6
- package/src/core/ui-packs/he.ts +10 -7
- package/src/core/ui-packs/hi.ts +10 -7
- package/src/core/ui-packs/hr.ts +10 -7
- package/src/core/ui-packs/hu.ts +10 -7
- package/src/core/ui-packs/id.ts +10 -7
- package/src/core/ui-packs/it.ts +7 -6
- package/src/core/ui-packs/ja.ts +7 -6
- package/src/core/ui-packs/ko.ts +7 -6
- package/src/core/ui-packs/nl.ts +10 -7
- package/src/core/ui-packs/no.ts +10 -7
- package/src/core/ui-packs/pl.ts +10 -7
- package/src/core/ui-packs/pt-br.ts +7 -6
- package/src/core/ui-packs/pt.ts +7 -6
- package/src/core/ui-packs/ro.ts +10 -7
- package/src/core/ui-packs/ru.ts +10 -7
- package/src/core/ui-packs/sk.ts +10 -7
- package/src/core/ui-packs/sr.ts +10 -7
- package/src/core/ui-packs/sv.ts +10 -7
- package/src/core/ui-packs/th.ts +7 -6
- package/src/core/ui-packs/tr.ts +10 -7
- package/src/core/ui-packs/uk.ts +10 -7
- package/src/core/ui-packs/vi.ts +7 -6
- package/src/core/ui-packs/zh-tw.ts +7 -6
- package/src/core/ui-packs/zh.ts +7 -6
- 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 +109 -53
- 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 +8 -2
- package/src/search/orama-index.ts +1 -1
- 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/configuration/ask-ai.mdx +0 -256
- 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-vacwm2hv.js.map → chunk-27g6wdth.js.map} +0 -0
- /package/dist/cli/{chunk-dwgcp5sm.js.map → chunk-ce574jw2.js.map} +0 -0
- /package/dist/cli/{chunk-e7f42gdj.js.map → chunk-fxypxtvm.js.map} +0 -0
- /package/dist/cli/{chunk-nn13znc2.js.map → chunk-zxcczpyx.js.map} +0 -0
|
@@ -6,11 +6,28 @@ import {
|
|
|
6
6
|
enrichDiagnostic
|
|
7
7
|
} from "./index.js";
|
|
8
8
|
import {
|
|
9
|
+
OPENAPI_PATH,
|
|
10
|
+
API_PAGES_PATH,
|
|
11
|
+
API_PAGE_PATH,
|
|
12
|
+
API_NAVIGATION_PATH,
|
|
13
|
+
API_SEARCH_PATH,
|
|
14
|
+
apiNamePhrase,
|
|
9
15
|
resolveReferences,
|
|
10
16
|
referenceRoutes,
|
|
11
17
|
hasScalarReferences,
|
|
12
|
-
|
|
18
|
+
builtinProxyReferences,
|
|
13
19
|
needsPlaygroundProxy,
|
|
20
|
+
buildMcpDiscovery,
|
|
21
|
+
buildMcpServerCard,
|
|
22
|
+
hasAiCatalog,
|
|
23
|
+
buildHomeLinkHeader,
|
|
24
|
+
resolveDocsCollection,
|
|
25
|
+
discoverPages,
|
|
26
|
+
routeIsTaken,
|
|
27
|
+
hasGeneratedChangelog,
|
|
28
|
+
customOgRoutes,
|
|
29
|
+
resolveFallbackLocale,
|
|
30
|
+
resolveAskBackend,
|
|
14
31
|
GOOGLE_FONTS,
|
|
15
32
|
isFontSlug,
|
|
16
33
|
fontLocaleCodes,
|
|
@@ -20,47 +37,40 @@ import {
|
|
|
20
37
|
editBaseUrl,
|
|
21
38
|
apiUrl,
|
|
22
39
|
EN_UI,
|
|
23
|
-
resolveUIStrings
|
|
24
|
-
} from "./chunk-7s8hm3b6.js";
|
|
25
|
-
import {
|
|
26
|
-
resolveFallbackLocale,
|
|
27
|
-
validateSearchPopularIcons,
|
|
28
|
-
validateNavTargets,
|
|
40
|
+
resolveUIStrings,
|
|
29
41
|
buildIncludeGraph,
|
|
30
|
-
|
|
42
|
+
rewriteRelativeImages,
|
|
43
|
+
collectContentAssets,
|
|
44
|
+
buildRssFeeds,
|
|
45
|
+
renderRssFeed,
|
|
31
46
|
isOpenApiSource,
|
|
32
|
-
|
|
33
|
-
|
|
47
|
+
buildRawMarkdown,
|
|
48
|
+
markdownRoutePaths
|
|
49
|
+
} from "./chunk-qkqwkpte.js";
|
|
34
50
|
import {
|
|
51
|
+
trimChar,
|
|
52
|
+
normalizeBasePath,
|
|
53
|
+
withBasePath,
|
|
35
54
|
siteRoot,
|
|
36
|
-
|
|
37
|
-
} from "./chunk-
|
|
55
|
+
absoluteUrl2
|
|
56
|
+
} from "./chunk-jts8mvcz.js";
|
|
57
|
+
import {
|
|
58
|
+
validateSearchPopularIcons,
|
|
59
|
+
validateNavTargets
|
|
60
|
+
} from "./chunk-fs23ddbb.js";
|
|
38
61
|
import {
|
|
39
|
-
buildRssFeeds,
|
|
40
|
-
renderRssFeed,
|
|
41
|
-
buildRawMarkdown,
|
|
42
|
-
markdownRoutePaths,
|
|
43
62
|
buildSearchDocuments,
|
|
44
63
|
buildMcpData
|
|
45
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-6crbhc3x.js";
|
|
46
65
|
import {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
API_NAVIGATION_PATH,
|
|
51
|
-
API_SEARCH_PATH,
|
|
52
|
-
buildMcpDiscovery,
|
|
53
|
-
buildMcpServerCard,
|
|
54
|
-
hasAiCatalog
|
|
55
|
-
} from "./chunk-0qymqwzz.js";
|
|
66
|
+
emptyComponentOverrides,
|
|
67
|
+
analyzeComponentOverrides
|
|
68
|
+
} from "./chunk-vtk4a6dg.js";
|
|
56
69
|
import {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
} from "./chunk-bf6bt1xt.js";
|
|
70
|
+
writeTextAtomic
|
|
71
|
+
} from "./chunk-jq5n4avg.js";
|
|
60
72
|
import {
|
|
61
|
-
|
|
62
|
-
askBackendRuntimeDep,
|
|
63
|
-
buildHomeLinkHeader,
|
|
73
|
+
planComponentSlots,
|
|
64
74
|
publishRuntimeModules,
|
|
65
75
|
runtimeDependencies,
|
|
66
76
|
astroConfigTemplate,
|
|
@@ -92,40 +102,21 @@ import {
|
|
|
92
102
|
apiNavigationTemplate,
|
|
93
103
|
apiSearchTemplate,
|
|
94
104
|
apiNotFoundTemplate,
|
|
95
|
-
islandWrapperTemplate,
|
|
96
|
-
islandMapTemplate,
|
|
97
105
|
exampleSlug,
|
|
98
106
|
exampleWrapperTemplate,
|
|
99
107
|
exampleMapTemplate,
|
|
100
108
|
examplesPageTemplate,
|
|
101
109
|
runtimePackageTemplate,
|
|
102
110
|
runtimeTsconfigTemplate
|
|
103
|
-
} from "./chunk-
|
|
104
|
-
import {
|
|
105
|
-
discoverPages,
|
|
106
|
-
routeIsTaken,
|
|
107
|
-
hasGeneratedChangelog,
|
|
108
|
-
customOgRoutes
|
|
109
|
-
} from "./chunk-vrfp10qk.js";
|
|
110
|
-
import {
|
|
111
|
-
writeTextAtomic
|
|
112
|
-
} from "./chunk-jq5n4avg.js";
|
|
111
|
+
} from "./chunk-2hn4b8z7.js";
|
|
113
112
|
import {
|
|
114
113
|
registry
|
|
115
|
-
} from "./chunk-
|
|
114
|
+
} from "./chunk-zxcczpyx.js";
|
|
116
115
|
import {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
trimChar,
|
|
122
|
-
normalizeBasePath,
|
|
123
|
-
withBasePath
|
|
124
|
-
} from "./chunk-2mzebbbz.js";
|
|
125
|
-
|
|
126
|
-
// src/ai/web-bot-auth.ts
|
|
127
|
-
var SIGNATURES_DIRECTORY_PATH = "/.well-known/http-message-signatures-directory";
|
|
128
|
-
var SIGNATURES_DIRECTORY_TYPE = "application/http-message-signatures-directory+json";
|
|
116
|
+
readClientMode,
|
|
117
|
+
discoverIslands,
|
|
118
|
+
missingDependencyDiagnostic
|
|
119
|
+
} from "./chunk-wm7js3j9.js";
|
|
129
120
|
|
|
130
121
|
// src/astro/integration.ts
|
|
131
122
|
import { join as join3, relative, resolve as resolve2 } from "pathe";
|
|
@@ -134,6 +125,7 @@ import { join as join3, relative, resolve as resolve2 } from "pathe";
|
|
|
134
125
|
import { dirname as dirname2, join as join2, resolve } from "pathe";
|
|
135
126
|
|
|
136
127
|
// src/search/build.ts
|
|
128
|
+
import { close, createIndex } from "pagefind";
|
|
137
129
|
import { dirname, join } from "pathe";
|
|
138
130
|
|
|
139
131
|
// src/deploy/sitemap.ts
|
|
@@ -248,11 +240,11 @@ var cardCacheTally = () => {
|
|
|
248
240
|
|
|
249
241
|
// src/astro/generate.ts
|
|
250
242
|
import { createHash } from "node:crypto";
|
|
251
|
-
import { existsSync as existsSync6, readFileSync as readFileSync3, realpathSync } from "node:fs";
|
|
243
|
+
import { existsSync as existsSync6, readFileSync as readFileSync3, realpathSync as realpathSync2 } from "node:fs";
|
|
252
244
|
import {
|
|
253
245
|
lstat,
|
|
254
246
|
mkdir as mkdir2,
|
|
255
|
-
readFile as
|
|
247
|
+
readFile as readFile4,
|
|
256
248
|
readlink,
|
|
257
249
|
realpath,
|
|
258
250
|
rm as rm2,
|
|
@@ -260,17 +252,9 @@ import {
|
|
|
260
252
|
} from "node:fs/promises";
|
|
261
253
|
import { createRequire as createRequire2 } from "node:module";
|
|
262
254
|
import { pathToFileURL } from "node:url";
|
|
263
|
-
import
|
|
264
|
-
import {
|
|
265
|
-
|
|
266
|
-
dirname as dirname7,
|
|
267
|
-
isAbsolute as isAbsolute6,
|
|
268
|
-
join as join11,
|
|
269
|
-
normalize,
|
|
270
|
-
relative as relative4,
|
|
271
|
-
resolve as resolve6
|
|
272
|
-
} from "pathe";
|
|
273
|
-
import { glob as glob3 } from "tinyglobby";
|
|
255
|
+
import pMap2 from "p-map";
|
|
256
|
+
import { dirname as dirname7, isAbsolute as isAbsolute6, join as join11, normalize as normalize2, relative as relative5, resolve as resolve6 } from "pathe";
|
|
257
|
+
import { glob as glob2 } from "tinyglobby";
|
|
274
258
|
|
|
275
259
|
// src/ai/api/problem.ts
|
|
276
260
|
var PROBLEM_TYPE = "application/problem+json";
|
|
@@ -591,7 +575,7 @@ var ROUTE_PARAM = {
|
|
|
591
575
|
};
|
|
592
576
|
var serverUrl = (input) => {
|
|
593
577
|
if (input.site) {
|
|
594
|
-
return input.base ?
|
|
578
|
+
return input.base ? absoluteUrl2(input.site, input.base) : siteRoot(input.site);
|
|
595
579
|
}
|
|
596
580
|
return input.base || "/";
|
|
597
581
|
};
|
|
@@ -779,7 +763,7 @@ var buildApiSpec = (input) => {
|
|
|
779
763
|
if (input.site) {
|
|
780
764
|
document.externalDocs = {
|
|
781
765
|
description: `${input.name} documentation`,
|
|
782
|
-
url:
|
|
766
|
+
url: absoluteUrl2(input.site, withBasePath(input.base, "/"))
|
|
783
767
|
};
|
|
784
768
|
}
|
|
785
769
|
return document;
|
|
@@ -801,7 +785,7 @@ var buildAskData = async (project) => {
|
|
|
801
785
|
route: doc.route,
|
|
802
786
|
title: doc.title
|
|
803
787
|
})),
|
|
804
|
-
site: project.config.deployment.site ?? null
|
|
788
|
+
site: project.config.deployment.options.site ?? null
|
|
805
789
|
};
|
|
806
790
|
};
|
|
807
791
|
|
|
@@ -885,271 +869,6 @@ var validateUsedComponents = (pages, extraTags, registryNames) => {
|
|
|
885
869
|
return diagnostics;
|
|
886
870
|
};
|
|
887
871
|
|
|
888
|
-
// src/core/component-overrides.ts
|
|
889
|
-
import { existsSync as existsSync2 } from "node:fs";
|
|
890
|
-
import { dirname as dirname4, extname, isAbsolute, resolve as resolve3 } from "pathe";
|
|
891
|
-
import ts from "typescript";
|
|
892
|
-
var GROUPS = ["mdx", "layout", "islands"];
|
|
893
|
-
var GROUP_SET = new Set(GROUPS);
|
|
894
|
-
var isGroup = (name) => GROUP_SET.has(name);
|
|
895
|
-
var FRAMEWORK_BY_EXT = new Map([
|
|
896
|
-
["jsx", "react"],
|
|
897
|
-
["svelte", "svelte"],
|
|
898
|
-
["tsx", "react"],
|
|
899
|
-
["vue", "vue"]
|
|
900
|
-
]);
|
|
901
|
-
var FRAMEWORK_LABEL = {
|
|
902
|
-
react: "React",
|
|
903
|
-
svelte: "Svelte",
|
|
904
|
-
vue: "Vue"
|
|
905
|
-
};
|
|
906
|
-
var COMPONENT_EXTS = [
|
|
907
|
-
"astro",
|
|
908
|
-
"tsx",
|
|
909
|
-
"ts",
|
|
910
|
-
"jsx",
|
|
911
|
-
"js",
|
|
912
|
-
"mjs",
|
|
913
|
-
"vue",
|
|
914
|
-
"svelte"
|
|
915
|
-
];
|
|
916
|
-
var HYDRATION_MODES = new Set([
|
|
917
|
-
"idle",
|
|
918
|
-
"load",
|
|
919
|
-
"media",
|
|
920
|
-
"only",
|
|
921
|
-
"visible"
|
|
922
|
-
]);
|
|
923
|
-
var isHydrationMode = (value) => HYDRATION_MODES.has(value);
|
|
924
|
-
var emptyAnalysis = () => ({
|
|
925
|
-
islands: [],
|
|
926
|
-
layout: [],
|
|
927
|
-
mdx: [],
|
|
928
|
-
warnings: []
|
|
929
|
-
});
|
|
930
|
-
var propName = (name) => ts.isIdentifier(name) || ts.isStringLiteral(name) ? name.text : undefined;
|
|
931
|
-
var addImportBindings = (map, statement) => {
|
|
932
|
-
if (!ts.isImportDeclaration(statement) || !ts.isStringLiteral(statement.moduleSpecifier)) {
|
|
933
|
-
return;
|
|
934
|
-
}
|
|
935
|
-
const specifier = statement.moduleSpecifier.text;
|
|
936
|
-
const clause = statement.importClause;
|
|
937
|
-
if (!clause) {
|
|
938
|
-
return;
|
|
939
|
-
}
|
|
940
|
-
if (clause.name) {
|
|
941
|
-
map.set(clause.name.text, { imported: "default", specifier });
|
|
942
|
-
}
|
|
943
|
-
const named = clause.namedBindings;
|
|
944
|
-
if (named && ts.isNamedImports(named)) {
|
|
945
|
-
for (const element of named.elements) {
|
|
946
|
-
map.set(element.name.text, {
|
|
947
|
-
imported: (element.propertyName ?? element.name).text,
|
|
948
|
-
specifier
|
|
949
|
-
});
|
|
950
|
-
}
|
|
951
|
-
}
|
|
952
|
-
};
|
|
953
|
-
var collectImports = (sourceFile) => {
|
|
954
|
-
const map = new Map;
|
|
955
|
-
for (const statement of sourceFile.statements) {
|
|
956
|
-
addImportBindings(map, statement);
|
|
957
|
-
}
|
|
958
|
-
return map;
|
|
959
|
-
};
|
|
960
|
-
var unwrapObject = (expression) => {
|
|
961
|
-
if (ts.isObjectLiteralExpression(expression)) {
|
|
962
|
-
return expression;
|
|
963
|
-
}
|
|
964
|
-
if (ts.isCallExpression(expression)) {
|
|
965
|
-
const [arg] = expression.arguments;
|
|
966
|
-
return arg && ts.isObjectLiteralExpression(arg) ? arg : undefined;
|
|
967
|
-
}
|
|
968
|
-
if (ts.isAsExpression(expression) || ts.isParenthesizedExpression(expression)) {
|
|
969
|
-
return unwrapObject(expression.expression);
|
|
970
|
-
}
|
|
971
|
-
return;
|
|
972
|
-
};
|
|
973
|
-
var findDefaultExportObject = (sourceFile) => {
|
|
974
|
-
for (const statement of sourceFile.statements) {
|
|
975
|
-
if (ts.isExportAssignment(statement) && !statement.isExportEquals) {
|
|
976
|
-
return unwrapObject(statement.expression);
|
|
977
|
-
}
|
|
978
|
-
}
|
|
979
|
-
return;
|
|
980
|
-
};
|
|
981
|
-
var probeExtension = (base) => {
|
|
982
|
-
for (const extension of COMPONENT_EXTS) {
|
|
983
|
-
const candidate = `${base}.${extension}`;
|
|
984
|
-
if (existsSync2(candidate)) {
|
|
985
|
-
return candidate;
|
|
986
|
-
}
|
|
987
|
-
}
|
|
988
|
-
return null;
|
|
989
|
-
};
|
|
990
|
-
var toImport = (specifier, imported, dir) => {
|
|
991
|
-
const relative = specifier.startsWith(".") || isAbsolute(specifier);
|
|
992
|
-
let path = specifier;
|
|
993
|
-
let extension = extname(specifier).slice(1).toLowerCase();
|
|
994
|
-
if (relative) {
|
|
995
|
-
const absolute = isAbsolute(specifier) ? specifier : resolve3(dir, specifier);
|
|
996
|
-
if (extension) {
|
|
997
|
-
path = absolute;
|
|
998
|
-
} else {
|
|
999
|
-
const probed = probeExtension(absolute);
|
|
1000
|
-
path = probed ?? absolute;
|
|
1001
|
-
extension = probed ? extname(probed).slice(1).toLowerCase() : "";
|
|
1002
|
-
}
|
|
1003
|
-
}
|
|
1004
|
-
return {
|
|
1005
|
-
framework: FRAMEWORK_BY_EXT.get(extension) ?? null,
|
|
1006
|
-
name: imported,
|
|
1007
|
-
path
|
|
1008
|
-
};
|
|
1009
|
-
};
|
|
1010
|
-
var resolveIdentifier = (name, imports, dir) => {
|
|
1011
|
-
const binding = imports.get(name);
|
|
1012
|
-
return binding ? toImport(binding.specifier, binding.imported, dir) : null;
|
|
1013
|
-
};
|
|
1014
|
-
var applyDescriptorProperty = (descriptor, property, imports, dir) => {
|
|
1015
|
-
if (ts.isShorthandPropertyAssignment(property)) {
|
|
1016
|
-
if (property.name.text === "component") {
|
|
1017
|
-
descriptor.hadComponent = true;
|
|
1018
|
-
descriptor.source = resolveIdentifier(property.name.text, imports, dir);
|
|
1019
|
-
}
|
|
1020
|
-
return;
|
|
1021
|
-
}
|
|
1022
|
-
if (!ts.isPropertyAssignment(property)) {
|
|
1023
|
-
return;
|
|
1024
|
-
}
|
|
1025
|
-
const name = propName(property.name);
|
|
1026
|
-
const init = property.initializer;
|
|
1027
|
-
if (name === "component") {
|
|
1028
|
-
descriptor.hadComponent = true;
|
|
1029
|
-
if (ts.isStringLiteral(init)) {
|
|
1030
|
-
descriptor.source = toImport(init.text, "default", dir);
|
|
1031
|
-
} else if (ts.isIdentifier(init)) {
|
|
1032
|
-
descriptor.source = resolveIdentifier(init.text, imports, dir);
|
|
1033
|
-
}
|
|
1034
|
-
} else if (name === "client" && ts.isStringLiteral(init) && isHydrationMode(init.text)) {
|
|
1035
|
-
descriptor.client = init.text;
|
|
1036
|
-
} else if (name === "media" && ts.isStringLiteral(init)) {
|
|
1037
|
-
descriptor.media = init.text;
|
|
1038
|
-
}
|
|
1039
|
-
};
|
|
1040
|
-
var readDescriptor = (object, imports, dir) => {
|
|
1041
|
-
const descriptor = { hadComponent: false, source: null };
|
|
1042
|
-
for (const property of object.properties) {
|
|
1043
|
-
applyDescriptorProperty(descriptor, property, imports, dir);
|
|
1044
|
-
}
|
|
1045
|
-
return descriptor;
|
|
1046
|
-
};
|
|
1047
|
-
var finalize = (key, group, descriptor, label, identifier, warnings) => {
|
|
1048
|
-
const { client, media, source } = descriptor;
|
|
1049
|
-
if (group === "islands") {
|
|
1050
|
-
if (!source) {
|
|
1051
|
-
warnings.push(`Island override "${key}" couldn't be resolved to a file. Reference it by an imported component or a path string with an extension.`);
|
|
1052
|
-
return null;
|
|
1053
|
-
}
|
|
1054
|
-
if (!source.framework) {
|
|
1055
|
-
warnings.push(`Island override "${key}" (${label}) is not a React, Vue, or Svelte component; only framework components can be islands.`);
|
|
1056
|
-
return null;
|
|
1057
|
-
}
|
|
1058
|
-
}
|
|
1059
|
-
if (client === "media" && !media) {
|
|
1060
|
-
warnings.push(`Override "${key}" uses client: "media" but no \`media\` query was given; it will hydrate as if \`client: "load"\`.`);
|
|
1061
|
-
}
|
|
1062
|
-
if (client === "only" && source && !source.framework) {
|
|
1063
|
-
warnings.push(`Override "${key}" uses client: "only" but its framework couldn't be inferred; reference a .tsx/.jsx/.vue/.svelte file.`);
|
|
1064
|
-
}
|
|
1065
|
-
if (!client && source?.framework) {
|
|
1066
|
-
warnings.push(`Override "${key}" points to a ${FRAMEWORK_LABEL[source.framework]} component (${label}) but has no hydration mode, so it renders as static HTML with no interactivity. Add one, e.g. \`${key}: { component: ${JSON.stringify(label)}, client: "load" }\`.`);
|
|
1067
|
-
}
|
|
1068
|
-
const normalized = { identifier, key, source };
|
|
1069
|
-
if (client) {
|
|
1070
|
-
normalized.client = client;
|
|
1071
|
-
}
|
|
1072
|
-
if (media) {
|
|
1073
|
-
normalized.media = media;
|
|
1074
|
-
}
|
|
1075
|
-
return normalized;
|
|
1076
|
-
};
|
|
1077
|
-
var normalizeEntry = (entry, group, imports, dir, warnings) => {
|
|
1078
|
-
const defaultClient = group === "islands" ? "visible" : undefined;
|
|
1079
|
-
if (ts.isShorthandPropertyAssignment(entry)) {
|
|
1080
|
-
const name = entry.name.text;
|
|
1081
|
-
return finalize(name, group, {
|
|
1082
|
-
client: defaultClient,
|
|
1083
|
-
hadComponent: true,
|
|
1084
|
-
source: resolveIdentifier(name, imports, dir)
|
|
1085
|
-
}, name, true, warnings);
|
|
1086
|
-
}
|
|
1087
|
-
if (!ts.isPropertyAssignment(entry)) {
|
|
1088
|
-
return null;
|
|
1089
|
-
}
|
|
1090
|
-
const key = propName(entry.name);
|
|
1091
|
-
if (!key) {
|
|
1092
|
-
return null;
|
|
1093
|
-
}
|
|
1094
|
-
const value = entry.initializer;
|
|
1095
|
-
if (ts.isIdentifier(value)) {
|
|
1096
|
-
return finalize(key, group, {
|
|
1097
|
-
client: defaultClient,
|
|
1098
|
-
hadComponent: true,
|
|
1099
|
-
source: resolveIdentifier(value.text, imports, dir)
|
|
1100
|
-
}, value.text, true, warnings);
|
|
1101
|
-
}
|
|
1102
|
-
if (ts.isStringLiteral(value)) {
|
|
1103
|
-
return finalize(key, group, {
|
|
1104
|
-
client: defaultClient,
|
|
1105
|
-
hadComponent: true,
|
|
1106
|
-
source: toImport(value.text, "default", dir)
|
|
1107
|
-
}, value.text, false, warnings);
|
|
1108
|
-
}
|
|
1109
|
-
if (ts.isObjectLiteralExpression(value)) {
|
|
1110
|
-
const descriptor = readDescriptor(value, imports, dir);
|
|
1111
|
-
if (!descriptor.hadComponent) {
|
|
1112
|
-
warnings.push(`Override "${key}" is an object without a \`component\` field; expected \`{ component, client }\`.`);
|
|
1113
|
-
return null;
|
|
1114
|
-
}
|
|
1115
|
-
if (!descriptor.source) {
|
|
1116
|
-
warnings.push(`Override "${key}"'s \`component\` couldn't be resolved to a file. Reference an imported component or a path string with an extension.`);
|
|
1117
|
-
return null;
|
|
1118
|
-
}
|
|
1119
|
-
return finalize(key, group, { ...descriptor, client: descriptor.client ?? defaultClient }, key, false, warnings);
|
|
1120
|
-
}
|
|
1121
|
-
return { identifier: false, key, source: null };
|
|
1122
|
-
};
|
|
1123
|
-
var collectGroupOverrides = (property, imports, dir, result) => {
|
|
1124
|
-
if (!ts.isPropertyAssignment(property)) {
|
|
1125
|
-
return;
|
|
1126
|
-
}
|
|
1127
|
-
const name = propName(property.name);
|
|
1128
|
-
if (!(name && isGroup(name)) || !ts.isObjectLiteralExpression(property.initializer)) {
|
|
1129
|
-
return;
|
|
1130
|
-
}
|
|
1131
|
-
for (const entry of property.initializer.properties) {
|
|
1132
|
-
const normalized = normalizeEntry(entry, name, imports, dir, result.warnings);
|
|
1133
|
-
if (normalized) {
|
|
1134
|
-
result[name].push(normalized);
|
|
1135
|
-
}
|
|
1136
|
-
}
|
|
1137
|
-
};
|
|
1138
|
-
var analyzeComponentOverrides = (source, filePath) => {
|
|
1139
|
-
const result = emptyAnalysis();
|
|
1140
|
-
const sourceFile = ts.createSourceFile(filePath, source, ts.ScriptTarget.Latest, true, filePath.endsWith("tsx") ? ts.ScriptKind.TSX : ts.ScriptKind.TS);
|
|
1141
|
-
const object = findDefaultExportObject(sourceFile);
|
|
1142
|
-
if (!object) {
|
|
1143
|
-
return result;
|
|
1144
|
-
}
|
|
1145
|
-
const imports = collectImports(sourceFile);
|
|
1146
|
-
const dir = dirname4(filePath);
|
|
1147
|
-
for (const property of object.properties) {
|
|
1148
|
-
collectGroupOverrides(property, imports, dir, result);
|
|
1149
|
-
}
|
|
1150
|
-
return result;
|
|
1151
|
-
};
|
|
1152
|
-
|
|
1153
872
|
// src/core/svg-dimensions.ts
|
|
1154
873
|
var ROOT = /<svg\s(?:[^>"']|"[^"]*"|'[^']*')*>/u;
|
|
1155
874
|
var WIDTH = /\swidth=(?<quote>['"])(?<value>[^%]+?)\k<quote>/u;
|
|
@@ -1214,14 +933,14 @@ var svgDimensions = (svg) => {
|
|
|
1214
933
|
};
|
|
1215
934
|
|
|
1216
935
|
// src/core/tsconfig-aliases.ts
|
|
1217
|
-
import { existsSync as
|
|
1218
|
-
import { dirname as
|
|
1219
|
-
import
|
|
936
|
+
import { existsSync as existsSync2 } from "node:fs";
|
|
937
|
+
import { dirname as dirname4, join as join5, resolve as resolve3 } from "pathe";
|
|
938
|
+
import ts from "typescript";
|
|
1220
939
|
var PARSE_HOST = {
|
|
1221
|
-
fileExists:
|
|
940
|
+
fileExists: ts.sys.fileExists,
|
|
1222
941
|
readDirectory: () => [],
|
|
1223
|
-
readFile:
|
|
1224
|
-
useCaseSensitiveFileNames:
|
|
942
|
+
readFile: ts.sys.readFile,
|
|
943
|
+
useCaseSensitiveFileNames: ts.sys.useCaseSensitiveFileNames
|
|
1225
944
|
};
|
|
1226
945
|
var isPathTarget = (target) => typeof target === "string";
|
|
1227
946
|
var toAlias = (key, value, baseDir) => {
|
|
@@ -1234,19 +953,19 @@ var toAlias = (key, value, baseDir) => {
|
|
|
1234
953
|
if (find === "" || find === "*") {
|
|
1235
954
|
return null;
|
|
1236
955
|
}
|
|
1237
|
-
return { find, replacement:
|
|
956
|
+
return { find, replacement: resolve3(baseDir, target) };
|
|
1238
957
|
};
|
|
1239
958
|
var resolveTsconfigAliases = (root) => {
|
|
1240
|
-
const entry = ["tsconfig.json", "jsconfig.json"].map((name) => join5(root, name)).find((file) =>
|
|
959
|
+
const entry = ["tsconfig.json", "jsconfig.json"].map((name) => join5(root, name)).find((file) => existsSync2(file));
|
|
1241
960
|
if (!entry) {
|
|
1242
961
|
return {};
|
|
1243
962
|
}
|
|
1244
|
-
const { config, error } =
|
|
963
|
+
const { config, error } = ts.readConfigFile(entry, ts.sys.readFile);
|
|
1245
964
|
if (error) {
|
|
1246
965
|
return {};
|
|
1247
966
|
}
|
|
1248
|
-
const configDir =
|
|
1249
|
-
const { options } =
|
|
967
|
+
const configDir = dirname4(entry);
|
|
968
|
+
const { options } = ts.parseJsonConfigFileContent(config, PARSE_HOST, configDir, undefined, entry);
|
|
1250
969
|
const { paths } = options;
|
|
1251
970
|
if (!paths) {
|
|
1252
971
|
return {};
|
|
@@ -1397,10 +1116,10 @@ var MERMAID_FENCE = /^[ \t]*(?:`{3,}|~{3,})[ \t]*mermaid\b/mu;
|
|
|
1397
1116
|
var hasMermaidFence = (text) => MERMAID_FENCE.test(text);
|
|
1398
1117
|
|
|
1399
1118
|
// src/og/derive.ts
|
|
1400
|
-
import { existsSync as
|
|
1401
|
-
import { isAbsolute
|
|
1119
|
+
import { existsSync as existsSync3 } from "node:fs";
|
|
1120
|
+
import { isAbsolute, join as join6 } from "pathe";
|
|
1402
1121
|
var CARD_WEIGHTS = [400, 600];
|
|
1403
|
-
var absoluteSrc = (root, src) =>
|
|
1122
|
+
var absoluteSrc = (root, src) => isAbsolute(src) ? src : join6(root, src);
|
|
1404
1123
|
var isNumericWeight = (weight) => typeof weight === "number";
|
|
1405
1124
|
var isRangeWeight = (weight) => typeof weight === "string";
|
|
1406
1125
|
var isFontName = (value) => typeof value === "string";
|
|
@@ -1501,11 +1220,11 @@ var missingFontFiles = (options, root) => {
|
|
|
1501
1220
|
sources.push(absoluteSrc(root, font.src));
|
|
1502
1221
|
}
|
|
1503
1222
|
}
|
|
1504
|
-
return [...new Set(sources)].filter((path) => !
|
|
1223
|
+
return [...new Set(sources)].filter((path) => !existsSync3(path));
|
|
1505
1224
|
};
|
|
1506
1225
|
|
|
1507
1226
|
// src/og/logo.ts
|
|
1508
|
-
import { existsSync as
|
|
1227
|
+
import { existsSync as existsSync4, readFileSync } from "node:fs";
|
|
1509
1228
|
import { join as join7 } from "pathe";
|
|
1510
1229
|
var resolveOgLogo = (project, source) => {
|
|
1511
1230
|
if (!source?.toLowerCase().endsWith(".svg")) {
|
|
@@ -1515,13 +1234,13 @@ var resolveOgLogo = (project, source) => {
|
|
|
1515
1234
|
const file = [
|
|
1516
1235
|
join7(project.context.root, "public", relative),
|
|
1517
1236
|
join7(project.context.root, relative)
|
|
1518
|
-
].find((path) =>
|
|
1237
|
+
].find((path) => existsSync4(path));
|
|
1519
1238
|
return file ? readFileSync(file, "utf-8") : undefined;
|
|
1520
1239
|
};
|
|
1521
1240
|
|
|
1522
1241
|
// src/openapi/scalar.ts
|
|
1523
1242
|
import { readFile as readFile2 } from "node:fs/promises";
|
|
1524
|
-
import { isAbsolute as
|
|
1243
|
+
import { isAbsolute as isAbsolute2, join as join8 } from "pathe";
|
|
1525
1244
|
|
|
1526
1245
|
// src/theme/palette.ts
|
|
1527
1246
|
var FALLBACK_ACCENT = "oklch(0.62 0.16 250)";
|
|
@@ -1617,7 +1336,7 @@ var specConfiguration = async (spec, root) => {
|
|
|
1617
1336
|
if (URL_SPEC.test(spec)) {
|
|
1618
1337
|
return { config: { url: spec } };
|
|
1619
1338
|
}
|
|
1620
|
-
const absolute =
|
|
1339
|
+
const absolute = isAbsolute2(spec) ? spec : join8(root, spec);
|
|
1621
1340
|
try {
|
|
1622
1341
|
return { config: { content: await readFile2(absolute, "utf-8") } };
|
|
1623
1342
|
} catch {
|
|
@@ -1628,7 +1347,7 @@ var specConfiguration = async (spec, root) => {
|
|
|
1628
1347
|
}
|
|
1629
1348
|
};
|
|
1630
1349
|
var acceptScalarReference = (ref, seen, contentRoutes, warnings) => {
|
|
1631
|
-
if (ref.
|
|
1350
|
+
if (ref.kind !== "scalar") {
|
|
1632
1351
|
return null;
|
|
1633
1352
|
}
|
|
1634
1353
|
if (seen.has(ref.route)) {
|
|
@@ -1663,12 +1382,13 @@ var buildReferenceFiles = async (options) => {
|
|
|
1663
1382
|
warnings.push(spec.warning);
|
|
1664
1383
|
}
|
|
1665
1384
|
const pagePath = referencePagePath(ref.route);
|
|
1385
|
+
const { theme, ...passthrough } = ref.scalar ?? {};
|
|
1666
1386
|
files.push({
|
|
1667
1387
|
content: scalarReferenceTemplate({
|
|
1668
1388
|
configuration: {
|
|
1669
1389
|
...spec.config,
|
|
1670
|
-
...themeConfiguration(config,
|
|
1671
|
-
...
|
|
1390
|
+
...themeConfiguration(config, theme),
|
|
1391
|
+
...passthrough
|
|
1672
1392
|
},
|
|
1673
1393
|
noindex: ref.noindex,
|
|
1674
1394
|
route: ref.route,
|
|
@@ -1697,6 +1417,7 @@ var CODE_PADDING_BLOCK_REM = 1;
|
|
|
1697
1417
|
|
|
1698
1418
|
// src/theme/entry.ts
|
|
1699
1419
|
var CODE_SCROLL_INSET_REM = 0.375;
|
|
1420
|
+
var EXTERNAL_LINK_MASK = `url("data:image/svg+xml,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="#000" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"><path d="M7 7h10v10M7 17L17 7"/></svg>')}")`;
|
|
1700
1421
|
var DARK_VARIANT = `/* Dark mode is driven by data-theme on the <html> element. */
|
|
1701
1422
|
@custom-variant dark (&:where([data-theme="dark"], [data-theme="dark"] *));`;
|
|
1702
1423
|
var COLOR_SCHEME_DEFAULTS = `:root {
|
|
@@ -1923,10 +1644,13 @@ ${THEME_MAPPING}
|
|
|
1923
1644
|
@apply -my-1 flex flex-1 items-center gap-1.5 rounded py-1 transition-colors aria-[current=page]:text-foreground aria-[current=page]:font-semibold;
|
|
1924
1645
|
}
|
|
1925
1646
|
@utility blume-nav-heading {
|
|
1926
|
-
@apply mb-
|
|
1647
|
+
@apply mb-1 flex items-center gap-1.5 px-2.5 py-1.5 font-medium text-foreground text-sm;
|
|
1927
1648
|
}
|
|
1649
|
+
/* The linked heading fills the heading's own box with negative margins, so
|
|
1650
|
+
its hover/active pill is the page row's exactly (same padding and radius)
|
|
1651
|
+
and an unlinked heading beside it keeps the same text position. */
|
|
1928
1652
|
@utility blume-nav-heading-link {
|
|
1929
|
-
@apply -
|
|
1653
|
+
@apply -mx-2.5 -my-1.5 flex flex-1 items-center gap-1.5 rounded-[0.65rem] px-2.5 py-1.5 text-foreground transition-colors hover:bg-muted aria-[current=page]:bg-muted;
|
|
1930
1654
|
}
|
|
1931
1655
|
|
|
1932
1656
|
/* Theme Tailwind Typography (prose) with Blume tokens. */
|
|
@@ -2062,6 +1786,22 @@ ${THEME_MAPPING}
|
|
|
2062
1786
|
text-decoration: none;
|
|
2063
1787
|
}
|
|
2064
1788
|
|
|
1789
|
+
/* External Markdown links (markdown.externalLinks) open in a new tab and trail
|
|
1790
|
+
the same Lucide arrow-up-right the featured sidebar links use, as a mask so it
|
|
1791
|
+
takes the link's color. A link wrapping only an image (a badge, a logo)
|
|
1792
|
+
skips the arrow. */
|
|
1793
|
+
.prose :where(a[data-blume-external]:not(:has(img, svg)))::after {
|
|
1794
|
+
background-color: currentColor;
|
|
1795
|
+
content: "";
|
|
1796
|
+
display: inline-block;
|
|
1797
|
+
height: 0.75em;
|
|
1798
|
+
margin-inline-start: 0.125em;
|
|
1799
|
+
-webkit-mask: ${EXTERNAL_LINK_MASK} center / contain no-repeat;
|
|
1800
|
+
mask: ${EXTERNAL_LINK_MASK} center / contain no-repeat;
|
|
1801
|
+
opacity: 0.6;
|
|
1802
|
+
width: 0.75em;
|
|
1803
|
+
}
|
|
1804
|
+
|
|
2065
1805
|
.prose :where(hr) {
|
|
2066
1806
|
margin: 2.5rem 0;
|
|
2067
1807
|
}
|
|
@@ -2590,15 +2330,15 @@ ${options.userCss}
|
|
|
2590
2330
|
`;
|
|
2591
2331
|
|
|
2592
2332
|
// src/theme/sources.ts
|
|
2593
|
-
import { dirname as
|
|
2333
|
+
import { dirname as dirname5, isAbsolute as isAbsolute3, relative as relative2, resolve as resolve4 } from "pathe";
|
|
2594
2334
|
var SOURCE_DIRECTIVE = /@source(?<not>\s+not)?\s+(?<quote>["'])(?<path>[^"']+)\k<quote>/gu;
|
|
2595
2335
|
var rebaseSourceDirectives = (css, options) => {
|
|
2596
|
-
const base =
|
|
2336
|
+
const base = dirname5(options.from);
|
|
2597
2337
|
return css.replace(SOURCE_DIRECTIVE, (directive, not, quote, path) => {
|
|
2598
|
-
if (
|
|
2338
|
+
if (isAbsolute3(path)) {
|
|
2599
2339
|
return directive;
|
|
2600
2340
|
}
|
|
2601
|
-
const rebased = relative2(options.to,
|
|
2341
|
+
const rebased = relative2(options.to, resolve4(base, path));
|
|
2602
2342
|
return `@source${not ?? ""} ${quote}${rebased}${quote}`;
|
|
2603
2343
|
});
|
|
2604
2344
|
};
|
|
@@ -2685,192 +2425,12 @@ var twoslashCss = () => {
|
|
|
2685
2425
|
${OVERRIDES}`;
|
|
2686
2426
|
};
|
|
2687
2427
|
|
|
2688
|
-
// src/astro/component-slots.ts
|
|
2689
|
-
var EMPTY_MODULE = `// Generated by Blume. Do not edit.
|
|
2690
|
-
import type { ComponentOverride } from "blume/core/define-components.ts";
|
|
2691
|
-
export const mdxComponents: Record<string, ComponentOverride> = {};
|
|
2692
|
-
export const layoutOverrides: Record<string, ComponentOverride> = {};
|
|
2693
|
-
`;
|
|
2694
|
-
var attributeValue = (value) => value.replaceAll(/["\n\r]/gu, " ").trim();
|
|
2695
|
-
var CLIENT_LOAD = "client:load";
|
|
2696
|
-
var directiveFor = (override) => {
|
|
2697
|
-
const framework = override.source?.framework;
|
|
2698
|
-
switch (override.client) {
|
|
2699
|
-
case "idle": {
|
|
2700
|
-
return "client:idle";
|
|
2701
|
-
}
|
|
2702
|
-
case "visible": {
|
|
2703
|
-
return "client:visible";
|
|
2704
|
-
}
|
|
2705
|
-
case "media": {
|
|
2706
|
-
return override.media ? `client:media="${attributeValue(override.media)}"` : CLIENT_LOAD;
|
|
2707
|
-
}
|
|
2708
|
-
case "only": {
|
|
2709
|
-
return framework ? `client:only="${attributeValue(framework)}"` : CLIENT_LOAD;
|
|
2710
|
-
}
|
|
2711
|
-
default: {
|
|
2712
|
-
return CLIENT_LOAD;
|
|
2713
|
-
}
|
|
2714
|
-
}
|
|
2715
|
-
};
|
|
2716
|
-
var importClause = (variable, name, path) => name === "default" ? `import ${variable} from ${JSON.stringify(path)};` : `import { ${name} as ${variable} } from ${JSON.stringify(path)};`;
|
|
2717
|
-
var wrapperContent = (override) => {
|
|
2718
|
-
const { name, path } = override.source;
|
|
2719
|
-
const clause = name === "default" ? `import Component from ${JSON.stringify(path)};` : `import { ${name} as Component } from ${JSON.stringify(path)};`;
|
|
2720
|
-
return `---
|
|
2721
|
-
// Generated by Blume. Do not edit.
|
|
2722
|
-
${clause}
|
|
2723
|
-
---
|
|
2724
|
-
<Component ${directiveFor(override)} {...Astro.props}><slot /></Component>
|
|
2725
|
-
`;
|
|
2726
|
-
};
|
|
2727
|
-
var sanitize = (value) => value.replaceAll(/[^A-Za-z0-9]/gu, (char) => `_${(char.codePointAt(0) ?? 0).toString(16)}_`);
|
|
2728
|
-
var planComponentSlots = (componentsFile, analysis) => {
|
|
2729
|
-
const frameworks = new Set;
|
|
2730
|
-
if (!componentsFile) {
|
|
2731
|
-
return { frameworks, module: EMPTY_MODULE, wrappers: [] };
|
|
2732
|
-
}
|
|
2733
|
-
if (!analysis) {
|
|
2734
|
-
return {
|
|
2735
|
-
frameworks,
|
|
2736
|
-
module: `// Generated by Blume. Do not edit.
|
|
2737
|
-
import overrides from ${JSON.stringify(componentsFile)};
|
|
2738
|
-
export const mdxComponents = overrides.mdx ?? {};
|
|
2739
|
-
export const layoutOverrides = overrides.layout ?? {};
|
|
2740
|
-
`,
|
|
2741
|
-
wrappers: []
|
|
2742
|
-
};
|
|
2743
|
-
}
|
|
2744
|
-
const wrappers = [];
|
|
2745
|
-
const importLines = [];
|
|
2746
|
-
const mdxEntries = [];
|
|
2747
|
-
const layoutEntries = [];
|
|
2748
|
-
let counter = 0;
|
|
2749
|
-
const mdxOverrides = [...analysis.mdx, ...analysis.islands];
|
|
2750
|
-
const plan = (override, group, entries) => {
|
|
2751
|
-
const { source } = override;
|
|
2752
|
-
if (source?.framework) {
|
|
2753
|
-
frameworks.add(source.framework);
|
|
2754
|
-
}
|
|
2755
|
-
if (override.identifier && !override.client) {
|
|
2756
|
-
return;
|
|
2757
|
-
}
|
|
2758
|
-
if (!source) {
|
|
2759
|
-
return;
|
|
2760
|
-
}
|
|
2761
|
-
const variable = `__blumeSlot${counter}`;
|
|
2762
|
-
counter += 1;
|
|
2763
|
-
if (override.client) {
|
|
2764
|
-
const name = `${group}-${sanitize(override.key)}`;
|
|
2765
|
-
wrappers.push({ content: wrapperContent(override), name });
|
|
2766
|
-
importLines.push(importClause(variable, "default", `./component-slots/${name}.astro`));
|
|
2767
|
-
} else {
|
|
2768
|
-
importLines.push(importClause(variable, source.name, source.path));
|
|
2769
|
-
}
|
|
2770
|
-
entries.push(`${JSON.stringify(override.key)}: ${variable}`);
|
|
2771
|
-
};
|
|
2772
|
-
for (const override of mdxOverrides) {
|
|
2773
|
-
plan(override, "mdx", mdxEntries);
|
|
2774
|
-
}
|
|
2775
|
-
for (const override of analysis.layout) {
|
|
2776
|
-
plan(override, "layout", layoutEntries);
|
|
2777
|
-
}
|
|
2778
|
-
const moduleSource = `// Generated by Blume. Do not edit.
|
|
2779
|
-
import overrides from ${JSON.stringify(componentsFile)};
|
|
2780
|
-
${importLines.join(`
|
|
2781
|
-
`)}${importLines.length ? `
|
|
2782
|
-
` : ""}export const mdxComponents = { ...(overrides.mdx ?? {})${mdxEntries.length ? `, ${mdxEntries.join(", ")}` : ""} };
|
|
2783
|
-
export const layoutOverrides = { ...(overrides.layout ?? {})${layoutEntries.length ? `, ${layoutEntries.join(", ")}` : ""} };
|
|
2784
|
-
`;
|
|
2785
|
-
return { frameworks, module: moduleSource, wrappers };
|
|
2786
|
-
};
|
|
2787
|
-
|
|
2788
2428
|
// src/astro/examples.ts
|
|
2789
|
-
import { readFile as readFile4 } from "node:fs/promises";
|
|
2790
|
-
import pMap2 from "p-map";
|
|
2791
|
-
import { isAbsolute as isAbsolute5, join as join10, relative as relative3 } from "pathe";
|
|
2792
|
-
import { glob as glob2 } from "tinyglobby";
|
|
2793
|
-
|
|
2794
|
-
// src/astro/islands.ts
|
|
2795
2429
|
import { readFile as readFile3 } from "node:fs/promises";
|
|
2796
2430
|
import pMap from "p-map";
|
|
2797
|
-
import {
|
|
2431
|
+
import { isAbsolute as isAbsolute4, join as join9, relative as relative3 } from "pathe";
|
|
2798
2432
|
import { glob } from "tinyglobby";
|
|
2799
|
-
var
|
|
2800
|
-
var READ_CONCURRENCY = 16;
|
|
2801
|
-
var VALID_MODES = new Set([
|
|
2802
|
-
"idle",
|
|
2803
|
-
"load",
|
|
2804
|
-
"only",
|
|
2805
|
-
"visible"
|
|
2806
|
-
]);
|
|
2807
|
-
var isClientMode = (mode) => VALID_MODES.has(mode);
|
|
2808
|
-
var FRAMEWORK_BY_EXT2 = new Map([
|
|
2809
|
-
["jsx", "react"],
|
|
2810
|
-
["svelte", "svelte"],
|
|
2811
|
-
["tsx", "react"],
|
|
2812
|
-
["vue", "vue"]
|
|
2813
|
-
]);
|
|
2814
|
-
var ISLAND_FILE = /\.(?<ext>jsx|svelte|tsx|vue)$/u;
|
|
2815
|
-
var CLIENT_EXPORT = /export\s+const\s+client\s*(?::[^=]+)?=\s*["'](?<mode>\w+)["']/u;
|
|
2816
|
-
var readClientMode = (source, file, warnings) => {
|
|
2817
|
-
const mode = source.match(CLIENT_EXPORT)?.groups?.mode;
|
|
2818
|
-
if (!mode) {
|
|
2819
|
-
return DEFAULT_CLIENT;
|
|
2820
|
-
}
|
|
2821
|
-
if (!isClientMode(mode)) {
|
|
2822
|
-
warnings.push(`Island "${file}" declares an unknown client mode "${mode}"; defaulting to "${DEFAULT_CLIENT}". Use "load", "idle", "visible", or "only".`);
|
|
2823
|
-
return DEFAULT_CLIENT;
|
|
2824
|
-
}
|
|
2825
|
-
return mode;
|
|
2826
|
-
};
|
|
2827
|
-
var discoverIslands = async (root) => {
|
|
2828
|
-
const dir = join9(root, "islands");
|
|
2829
|
-
const matches = await glob(["**/*"], {
|
|
2830
|
-
absolute: true,
|
|
2831
|
-
cwd: dir,
|
|
2832
|
-
onlyFiles: true
|
|
2833
|
-
});
|
|
2834
|
-
const files = matches.toSorted();
|
|
2835
|
-
const sources = await pMap(files, (file) => readFile3(file, "utf-8"), {
|
|
2836
|
-
concurrency: READ_CONCURRENCY
|
|
2837
|
-
});
|
|
2838
|
-
const islands = [];
|
|
2839
|
-
const warnings = [];
|
|
2840
|
-
const seen = new Map;
|
|
2841
|
-
const collectIsland = (file, source) => {
|
|
2842
|
-
const base = basename(file);
|
|
2843
|
-
const ext = base.match(ISLAND_FILE)?.groups?.ext;
|
|
2844
|
-
const framework = ext ? FRAMEWORK_BY_EXT2.get(ext) : undefined;
|
|
2845
|
-
if (!framework) {
|
|
2846
|
-
return;
|
|
2847
|
-
}
|
|
2848
|
-
const name = base.replace(ISLAND_FILE, "");
|
|
2849
|
-
if (!/^[A-Z][A-Za-z0-9_]*$/u.test(name)) {
|
|
2850
|
-
warnings.push(`Island "${file}" must have a PascalCase identifier filename to be used in MDX (letters, digits, and underscores only, e.g. Counter.tsx → <Counter />); skipping it.`);
|
|
2851
|
-
return;
|
|
2852
|
-
}
|
|
2853
|
-
const existing = seen.get(name);
|
|
2854
|
-
if (existing) {
|
|
2855
|
-
warnings.push(`Two islands both resolve to <${name}> ("${existing}" and "${file}"); ignoring the second. Give them distinct filenames.`);
|
|
2856
|
-
return;
|
|
2857
|
-
}
|
|
2858
|
-
seen.set(name, file);
|
|
2859
|
-
islands.push({
|
|
2860
|
-
client: readClientMode(source, file, warnings),
|
|
2861
|
-
file,
|
|
2862
|
-
framework,
|
|
2863
|
-
name
|
|
2864
|
-
});
|
|
2865
|
-
};
|
|
2866
|
-
for (const [index, file] of files.entries()) {
|
|
2867
|
-
collectIsland(file, sources[index] ?? "");
|
|
2868
|
-
}
|
|
2869
|
-
return { islands, warnings };
|
|
2870
|
-
};
|
|
2871
|
-
|
|
2872
|
-
// src/astro/examples.ts
|
|
2873
|
-
var FRAMEWORK_BY_EXT3 = {
|
|
2433
|
+
var FRAMEWORK_BY_EXT = {
|
|
2874
2434
|
astro: "astro",
|
|
2875
2435
|
jsx: "react",
|
|
2876
2436
|
svelte: "svelte",
|
|
@@ -2879,11 +2439,11 @@ var FRAMEWORK_BY_EXT3 = {
|
|
|
2879
2439
|
};
|
|
2880
2440
|
var EXAMPLE_FILE = /\.(?<ext>astro|jsx|svelte|tsx|vue)$/u;
|
|
2881
2441
|
var DEFAULT_EXAMPLE_GLOB = "**/*.{astro,jsx,svelte,tsx,vue}";
|
|
2882
|
-
var
|
|
2442
|
+
var READ_CONCURRENCY = 16;
|
|
2883
2443
|
var EXAMPLE_SCAN_GLOB = "**/*.{astro,jsx,svelte,ts,tsx,vue}";
|
|
2884
2444
|
var exampleScanRoots = (root, examplesDir) => {
|
|
2885
2445
|
const path = relative3(root, examplesDir);
|
|
2886
|
-
const outside = path.startsWith("..") ||
|
|
2446
|
+
const outside = path.startsWith("..") || isAbsolute4(path);
|
|
2887
2447
|
return outside ? [root, examplesDir] : [root];
|
|
2888
2448
|
};
|
|
2889
2449
|
var GLOB_MAGIC = /[!*?[\]{}]/u;
|
|
@@ -2897,22 +2457,22 @@ var splitGlobBase = (pattern) => {
|
|
|
2897
2457
|
};
|
|
2898
2458
|
var discoverExamples = async (root, pattern = "examples") => {
|
|
2899
2459
|
const { base, rest } = GLOB_MAGIC.test(pattern) ? splitGlobBase(pattern) : { base: pattern, rest: DEFAULT_EXAMPLE_GLOB };
|
|
2900
|
-
const dir =
|
|
2901
|
-
const matches = await
|
|
2460
|
+
const dir = join9(root, base);
|
|
2461
|
+
const matches = await glob([rest], {
|
|
2902
2462
|
absolute: true,
|
|
2903
2463
|
cwd: dir,
|
|
2904
2464
|
onlyFiles: true
|
|
2905
2465
|
});
|
|
2906
2466
|
const files = matches.toSorted();
|
|
2907
|
-
const sources = await
|
|
2908
|
-
concurrency:
|
|
2467
|
+
const sources = await pMap(files, (file) => readFile3(file, "utf-8"), {
|
|
2468
|
+
concurrency: READ_CONCURRENCY
|
|
2909
2469
|
});
|
|
2910
2470
|
const examples = [];
|
|
2911
2471
|
const warnings = [];
|
|
2912
2472
|
const seen = new Map;
|
|
2913
2473
|
const collectExample = (file, source) => {
|
|
2914
2474
|
const ext = file.match(EXAMPLE_FILE)?.groups?.ext;
|
|
2915
|
-
const framework = ext ?
|
|
2475
|
+
const framework = ext ? FRAMEWORK_BY_EXT[ext] : undefined;
|
|
2916
2476
|
if (!(ext && framework)) {
|
|
2917
2477
|
return;
|
|
2918
2478
|
}
|
|
@@ -2942,16 +2502,39 @@ var exampleMarkdownLookup = (examples) => Object.fromEntries(examples.map((examp
|
|
|
2942
2502
|
{ lang: example.lang, source: example.source }
|
|
2943
2503
|
]));
|
|
2944
2504
|
|
|
2945
|
-
// src/astro/
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2505
|
+
// src/astro/render-deps.ts
|
|
2506
|
+
import { existsSync as existsSync5, realpathSync } from "node:fs";
|
|
2507
|
+
import {
|
|
2508
|
+
basename,
|
|
2509
|
+
dirname as dirname6,
|
|
2510
|
+
isAbsolute as isAbsolute5,
|
|
2511
|
+
join as join10,
|
|
2512
|
+
normalize,
|
|
2513
|
+
relative as relative4,
|
|
2514
|
+
resolve as resolve5
|
|
2515
|
+
} from "pathe";
|
|
2516
|
+
var depsCandidates = (pkgDir) => [
|
|
2517
|
+
join10(pkgDir, "node_modules"),
|
|
2518
|
+
dirname6(pkgDir)
|
|
2519
|
+
];
|
|
2520
|
+
var candidateHolding = (pkgDir, ...segments) => depsCandidates(pkgDir).find((dir) => existsSync5(join10(dir, ...segments))) ?? null;
|
|
2521
|
+
var packageDirFrom = (name, fromDir) => {
|
|
2522
|
+
let dir = normalize(fromDir);
|
|
2523
|
+
while (true) {
|
|
2524
|
+
const candidate = join10(dir, "node_modules", name);
|
|
2525
|
+
if (existsSync5(join10(candidate, "package.json"))) {
|
|
2526
|
+
return normalize(realpathSync(candidate));
|
|
2527
|
+
}
|
|
2528
|
+
const parent = dirname6(dir);
|
|
2529
|
+
if (parent === dir) {
|
|
2530
|
+
return null;
|
|
2531
|
+
}
|
|
2532
|
+
dir = parent;
|
|
2953
2533
|
}
|
|
2954
2534
|
};
|
|
2535
|
+
|
|
2536
|
+
// src/astro/generate.ts
|
|
2537
|
+
var BLUME_SRC = join11(packageRoot(), "src");
|
|
2955
2538
|
var resolveReactCompiler = (config, needsReact, pkgDir = packageRoot()) => {
|
|
2956
2539
|
if (!(needsReact && config.react.compiler)) {
|
|
2957
2540
|
return null;
|
|
@@ -2967,13 +2550,13 @@ var reactCompilerWarnings = (config, needsReact, compilerPath) => needsReact &&
|
|
|
2967
2550
|
] : [];
|
|
2968
2551
|
var resolveAstroPackageJson = (modulesDir) => {
|
|
2969
2552
|
try {
|
|
2970
|
-
return
|
|
2553
|
+
return realpathSync2(join11(modulesDir, "astro", "package.json"));
|
|
2971
2554
|
} catch {
|
|
2972
2555
|
return null;
|
|
2973
2556
|
}
|
|
2974
2557
|
};
|
|
2975
2558
|
var resolvedAstroHit = (fromDir) => {
|
|
2976
|
-
let dir =
|
|
2559
|
+
let dir = normalize2(fromDir);
|
|
2977
2560
|
while (true) {
|
|
2978
2561
|
const modulesDir = join11(dir, "node_modules");
|
|
2979
2562
|
const pkg = resolveAstroPackageJson(modulesDir);
|
|
@@ -2989,16 +2572,11 @@ var resolvedAstroHit = (fromDir) => {
|
|
|
2989
2572
|
};
|
|
2990
2573
|
var sameRealDir = (a, b) => {
|
|
2991
2574
|
try {
|
|
2992
|
-
return
|
|
2575
|
+
return realpathSync2(a) === realpathSync2(b);
|
|
2993
2576
|
} catch {
|
|
2994
2577
|
return false;
|
|
2995
2578
|
}
|
|
2996
2579
|
};
|
|
2997
|
-
var depsCandidates = (pkgDir) => [
|
|
2998
|
-
join11(pkgDir, "node_modules"),
|
|
2999
|
-
dirname7(pkgDir)
|
|
3000
|
-
];
|
|
3001
|
-
var candidateHolding = (pkgDir, ...segments) => depsCandidates(pkgDir).find((dir) => existsSync6(join11(dir, ...segments))) ?? null;
|
|
3002
2580
|
var symlinkDir = async (target, link) => {
|
|
3003
2581
|
try {
|
|
3004
2582
|
await symlink(target, link, "dir");
|
|
@@ -3086,54 +2664,6 @@ var ensureDepsLink = async (outDir, pkgDir = packageRoot()) => {
|
|
|
3086
2664
|
}
|
|
3087
2665
|
return astroConflictWarning(blumeAstro, outDirHit?.pkg ?? null);
|
|
3088
2666
|
};
|
|
3089
|
-
var ISLAND_FRAMEWORK_DEPS = new Map([
|
|
3090
|
-
["svelte", "@astrojs/svelte"],
|
|
3091
|
-
["vue", "@astrojs/vue"]
|
|
3092
|
-
]);
|
|
3093
|
-
var DEPLOYMENT_ADAPTER_DEPS = new Map([
|
|
3094
|
-
["cloudflare", "@astrojs/cloudflare"],
|
|
3095
|
-
["netlify", "@astrojs/netlify"]
|
|
3096
|
-
]);
|
|
3097
|
-
var islandFrameworkWarnings = (frameworks, root) => {
|
|
3098
|
-
const warnings = [];
|
|
3099
|
-
for (const framework of frameworks) {
|
|
3100
|
-
const dep = ISLAND_FRAMEWORK_DEPS.get(framework);
|
|
3101
|
-
if (dep && !canResolveFrom(root, dep)) {
|
|
3102
|
-
warnings.push(`Islands use ${framework}, which needs "${dep}". Install it (e.g. \`npm install ${dep} ${framework}\`).`);
|
|
3103
|
-
}
|
|
3104
|
-
}
|
|
3105
|
-
return warnings;
|
|
3106
|
-
};
|
|
3107
|
-
var deploymentAdapterWarnings = (deployment, root, pkgDir = packageRoot()) => {
|
|
3108
|
-
const dep = deployment.output === "server" && deployment.adapter ? DEPLOYMENT_ADAPTER_DEPS.get(deployment.adapter) : undefined;
|
|
3109
|
-
if (dep && !(canResolveFrom(root, dep) || canResolveFrom(pkgDir, dep))) {
|
|
3110
|
-
return [
|
|
3111
|
-
`Deployment adapter "${deployment.adapter}" needs "${dep}", which isn't installed. Run \`npm install ${dep}\` (or your package manager's equivalent).`
|
|
3112
|
-
];
|
|
3113
|
-
}
|
|
3114
|
-
return [];
|
|
3115
|
-
};
|
|
3116
|
-
var searchProviderWarnings = (provider, root, pkgDir = packageRoot()) => {
|
|
3117
|
-
const warnings = [];
|
|
3118
|
-
for (const dep of searchProviderMeta(provider).runtimeDeps) {
|
|
3119
|
-
if (!(canResolveFrom(root, dep) || canResolveFrom(pkgDir, dep))) {
|
|
3120
|
-
warnings.push(`Search provider "${provider}" needs "${dep}", which isn't installed. Run \`npm install ${dep}\` (or your package manager's equivalent).`);
|
|
3121
|
-
}
|
|
3122
|
-
}
|
|
3123
|
-
return warnings;
|
|
3124
|
-
};
|
|
3125
|
-
var askProviderWarnings = (ask, root, pkgDir = packageRoot()) => {
|
|
3126
|
-
if (!ask?.enabled || ask.endpoint) {
|
|
3127
|
-
return [];
|
|
3128
|
-
}
|
|
3129
|
-
const dep = askBackendRuntimeDep(ask);
|
|
3130
|
-
if (!dep || canResolveFrom(root, dep) || canResolveFrom(pkgDir, dep)) {
|
|
3131
|
-
return [];
|
|
3132
|
-
}
|
|
3133
|
-
return [
|
|
3134
|
-
`Ask AI provider "${ask.provider}" needs "${dep}", which isn't installed. Run \`npm install ${dep}\` (or your package manager's equivalent).`
|
|
3135
|
-
];
|
|
3136
|
-
};
|
|
3137
2667
|
var examplesCssFile = (root, config) => config.examples.css ? join11(root, config.examples.css) : null;
|
|
3138
2668
|
var writeExamplesPreview = async (options) => {
|
|
3139
2669
|
const { config, hasExamples, root, srcDir, write } = options;
|
|
@@ -3150,7 +2680,7 @@ var readOptional = async (path) => {
|
|
|
3150
2680
|
return "";
|
|
3151
2681
|
}
|
|
3152
2682
|
try {
|
|
3153
|
-
return await
|
|
2683
|
+
return await readFile4(path, "utf-8");
|
|
3154
2684
|
} catch {
|
|
3155
2685
|
return "";
|
|
3156
2686
|
}
|
|
@@ -3160,7 +2690,7 @@ var readUserCss = async (file, outputDir) => {
|
|
|
3160
2690
|
return file ? rebaseSourceDirectives(css, { from: file, to: outputDir }) : css;
|
|
3161
2691
|
};
|
|
3162
2692
|
var detectNeedsReact = async (root) => {
|
|
3163
|
-
const matches = await
|
|
2693
|
+
const matches = await glob2(["**/*.{tsx,jsx}"], {
|
|
3164
2694
|
cwd: root,
|
|
3165
2695
|
ignore: ["**/node_modules/**", "**/.blume/**", "**/dist/**"],
|
|
3166
2696
|
onlyFiles: true
|
|
@@ -3168,15 +2698,15 @@ var detectNeedsReact = async (root) => {
|
|
|
3168
2698
|
return matches.length > 0;
|
|
3169
2699
|
};
|
|
3170
2700
|
var containsMath = (content) => content.includes("$$") || content.includes("<Math");
|
|
3171
|
-
var
|
|
2701
|
+
var READ_CONCURRENCY2 = 16;
|
|
3172
2702
|
var detectUsesMath = async (root, staged = []) => {
|
|
3173
|
-
const files = await
|
|
2703
|
+
const files = await glob2(["**/*.{md,mdx}"], {
|
|
3174
2704
|
cwd: root,
|
|
3175
2705
|
ignore: ["**/node_modules/**", "**/.blume/**", "**/dist/**"],
|
|
3176
2706
|
onlyFiles: true
|
|
3177
2707
|
});
|
|
3178
|
-
const contents = await
|
|
3179
|
-
concurrency:
|
|
2708
|
+
const contents = await pMap2(files, (file) => readOptional(join11(root, file)), {
|
|
2709
|
+
concurrency: READ_CONCURRENCY2
|
|
3180
2710
|
});
|
|
3181
2711
|
return [...contents, ...staged].some(containsMath);
|
|
3182
2712
|
};
|
|
@@ -3186,14 +2716,14 @@ var loadIntegrationBridge = async (config, context) => {
|
|
|
3186
2716
|
return;
|
|
3187
2717
|
}
|
|
3188
2718
|
return {
|
|
3189
|
-
configFile:
|
|
2719
|
+
configFile: relative5(context.outDir, context.configFile),
|
|
3190
2720
|
sourceHash: hashConfigSource(await readOptional(context.configFile))
|
|
3191
2721
|
};
|
|
3192
2722
|
};
|
|
3193
2723
|
var writeIfChanged = async (path, content) => {
|
|
3194
2724
|
let existing = null;
|
|
3195
2725
|
try {
|
|
3196
|
-
existing = await
|
|
2726
|
+
existing = await readFile4(path, "utf-8");
|
|
3197
2727
|
} catch {
|
|
3198
2728
|
existing = null;
|
|
3199
2729
|
}
|
|
@@ -3204,14 +2734,14 @@ var writeIfChanged = async (path, content) => {
|
|
|
3204
2734
|
return true;
|
|
3205
2735
|
};
|
|
3206
2736
|
var pruneOrphans = async (srcDir, written) => {
|
|
3207
|
-
const existing = await
|
|
2737
|
+
const existing = await glob2("**/*", {
|
|
3208
2738
|
absolute: true,
|
|
3209
2739
|
cwd: srcDir,
|
|
3210
2740
|
onlyFiles: true
|
|
3211
2741
|
});
|
|
3212
2742
|
const removals = [];
|
|
3213
2743
|
for (const path of existing) {
|
|
3214
|
-
const normalized =
|
|
2744
|
+
const normalized = normalize2(path);
|
|
3215
2745
|
if (!written.has(normalized)) {
|
|
3216
2746
|
removals.push(rm2(normalized, { force: true }));
|
|
3217
2747
|
}
|
|
@@ -3223,7 +2753,7 @@ var collectStaged = (project) => {
|
|
|
3223
2753
|
for (const page of project.graph.pages) {
|
|
3224
2754
|
if (page.collection === "staged" && page.entryId && page.body) {
|
|
3225
2755
|
const text = page.sourcePath ? rewriteRelativeImages({
|
|
3226
|
-
deployBase: project.config.deployment.base,
|
|
2756
|
+
deployBase: project.config.deployment.options.base,
|
|
3227
2757
|
projectRoot: project.context.root,
|
|
3228
2758
|
source: page.body.text,
|
|
3229
2759
|
sourcePath: page.sourcePath
|
|
@@ -3238,7 +2768,7 @@ var writeStagedContent = async (out, staged) => {
|
|
|
3238
2768
|
const written = new Set;
|
|
3239
2769
|
await Promise.all([...staged].map(async ([entryId, text]) => {
|
|
3240
2770
|
const path = join11(contentDir, entryId);
|
|
3241
|
-
written.add(
|
|
2771
|
+
written.add(normalize2(path));
|
|
3242
2772
|
await writeIfChanged(path, text);
|
|
3243
2773
|
}));
|
|
3244
2774
|
if (existsSync6(contentDir)) {
|
|
@@ -3395,7 +2925,7 @@ var resolveOgSite = (config) => {
|
|
|
3395
2925
|
if (configured !== undefined) {
|
|
3396
2926
|
return configured;
|
|
3397
2927
|
}
|
|
3398
|
-
return config.deployment.site ? `${new URL(config.deployment.site).host}${normalizeBasePath(config.deployment.base)}` : undefined;
|
|
2928
|
+
return config.deployment.options.site ? `${new URL(config.deployment.options.site).host}${normalizeBasePath(config.deployment.options.base)}` : undefined;
|
|
3399
2929
|
};
|
|
3400
2930
|
var resolveOgDescription = (config) => {
|
|
3401
2931
|
const configured = config.seo.og.description;
|
|
@@ -3421,9 +2951,9 @@ var buildRuntimeData = (project) => {
|
|
|
3421
2951
|
if (!(editBase && sourcePath)) {
|
|
3422
2952
|
return null;
|
|
3423
2953
|
}
|
|
3424
|
-
const rel =
|
|
2954
|
+
const rel = relative5(context.root, sourcePath).split("\\").join("/");
|
|
3425
2955
|
const editDir = trimChar(github?.dir ?? "", "/");
|
|
3426
|
-
const editPath =
|
|
2956
|
+
const editPath = normalize2(editDir ? join11(editDir, rel) : rel);
|
|
3427
2957
|
if (editPath.startsWith("..") || isAbsolute6(editPath)) {
|
|
3428
2958
|
return null;
|
|
3429
2959
|
}
|
|
@@ -3459,24 +2989,24 @@ var buildRuntimeData = (project) => {
|
|
|
3459
2989
|
])) : {};
|
|
3460
2990
|
const data = {
|
|
3461
2991
|
config: {
|
|
3462
|
-
analytics: config.analytics
|
|
2992
|
+
analytics: config.analytics,
|
|
3463
2993
|
appleIcon: resolveAppleIcon(project),
|
|
3464
|
-
|
|
3465
|
-
endpoint: config.ai.
|
|
3466
|
-
suggestions: config.ai.
|
|
2994
|
+
assistant: config.ai.assistant?.enabled ? {
|
|
2995
|
+
endpoint: config.ai.assistant.endpoint ?? null,
|
|
2996
|
+
suggestions: config.ai.assistant.suggestions
|
|
3467
2997
|
} : null,
|
|
3468
2998
|
banner: resolveBanner(config),
|
|
3469
2999
|
basePath: config.basePath,
|
|
3470
|
-
codeThemes: config.markdown.
|
|
3000
|
+
codeThemes: config.markdown.code.theme,
|
|
3471
3001
|
codeWrap: config.markdown.code.wrap,
|
|
3472
3002
|
dateFormat: config.dateFormat,
|
|
3473
3003
|
description: config.description,
|
|
3474
3004
|
discovery: {
|
|
3475
|
-
agentReadability: config.
|
|
3005
|
+
agentReadability: config.agents.agentReadability,
|
|
3476
3006
|
aiCatalog: hasAiCatalog(config),
|
|
3477
|
-
api: config.
|
|
3478
|
-
llmsTxt: config.
|
|
3479
|
-
sitemap: config.seo.sitemap && Boolean(config.deployment.site)
|
|
3007
|
+
api: config.agents.api,
|
|
3008
|
+
llmsTxt: config.agents.llmsTxt.enabled,
|
|
3009
|
+
sitemap: config.seo.sitemap && Boolean(config.deployment.options.site)
|
|
3480
3010
|
},
|
|
3481
3011
|
favicon: resolveFavicon(project),
|
|
3482
3012
|
feedback: config.feedback,
|
|
@@ -3497,9 +3027,9 @@ var buildRuntimeData = (project) => {
|
|
|
3497
3027
|
} : null,
|
|
3498
3028
|
imageZoom: config.markdown.imageZoom,
|
|
3499
3029
|
logo,
|
|
3500
|
-
mcp: config.
|
|
3501
|
-
name: config.
|
|
3502
|
-
route: config.
|
|
3030
|
+
mcp: config.agents.mcp.enabled ? {
|
|
3031
|
+
name: config.agents.mcp.name ?? config.title,
|
|
3032
|
+
route: config.agents.mcp.route
|
|
3503
3033
|
} : null,
|
|
3504
3034
|
og: {
|
|
3505
3035
|
description: resolveOgDescription(config),
|
|
@@ -3511,19 +3041,19 @@ var buildRuntimeData = (project) => {
|
|
|
3511
3041
|
openInChat: config.ai.openInChat,
|
|
3512
3042
|
repoUrl: repoUrl2,
|
|
3513
3043
|
search: {
|
|
3514
|
-
enabled: config.search.provider !== "none",
|
|
3044
|
+
enabled: config.search.provider.mode !== "none",
|
|
3515
3045
|
popular: resolveSearchPopular(config.search.popular, config.basePath),
|
|
3516
|
-
provider: config.search.provider
|
|
3046
|
+
provider: config.search.provider.kind
|
|
3517
3047
|
},
|
|
3518
|
-
site: config.deployment.site ?? null,
|
|
3048
|
+
site: config.deployment.options.site ?? null,
|
|
3519
3049
|
structuredData: config.seo.structuredData,
|
|
3520
3050
|
theme: config.theme,
|
|
3521
3051
|
title: config.title,
|
|
3522
3052
|
toc: config.toc,
|
|
3523
3053
|
versions: config.versions ?? null,
|
|
3524
3054
|
webmcp: {
|
|
3525
|
-
enabled: config.
|
|
3526
|
-
llms: config.
|
|
3055
|
+
enabled: config.agents.webmcp,
|
|
3056
|
+
llms: config.agents.llmsTxt.enabled
|
|
3527
3057
|
},
|
|
3528
3058
|
x: config.seo.x
|
|
3529
3059
|
},
|
|
@@ -3554,6 +3084,7 @@ var buildRuntimeData = (project) => {
|
|
|
3554
3084
|
indexable: route.indexable,
|
|
3555
3085
|
lastModified: route.lastModified ?? null,
|
|
3556
3086
|
locale: route.locale,
|
|
3087
|
+
monolingual: route.monolingual ?? false,
|
|
3557
3088
|
path: route.path,
|
|
3558
3089
|
title: route.title,
|
|
3559
3090
|
version: route.version,
|
|
@@ -3567,7 +3098,7 @@ var buildRuntimeData = (project) => {
|
|
|
3567
3098
|
};
|
|
3568
3099
|
var planMcp = (project, srcDir, userPages) => {
|
|
3569
3100
|
const { config } = project;
|
|
3570
|
-
const { route } = config.
|
|
3101
|
+
const { route } = config.agents.mcp;
|
|
3571
3102
|
const dir = join11(srcDir, "blume-mcp");
|
|
3572
3103
|
const base = {
|
|
3573
3104
|
dir,
|
|
@@ -3577,14 +3108,14 @@ var planMcp = (project, srcDir, userPages) => {
|
|
|
3577
3108
|
srcDir,
|
|
3578
3109
|
warnings: []
|
|
3579
3110
|
};
|
|
3580
|
-
if (!config.
|
|
3111
|
+
if (!config.agents.mcp.enabled) {
|
|
3581
3112
|
return base;
|
|
3582
3113
|
}
|
|
3583
3114
|
if (routeIsTaken(userPages, project.graph.pages, route)) {
|
|
3584
3115
|
return {
|
|
3585
3116
|
...base,
|
|
3586
3117
|
warnings: [
|
|
3587
|
-
`MCP server route "${route}" is already used by a content or custom page; the MCP server was not generated. Set a different "
|
|
3118
|
+
`MCP server route "${route}" is already used by a content or custom page; the MCP server was not generated. Set a different "agents.mcp.route" in blume.config.ts.`
|
|
3588
3119
|
]
|
|
3589
3120
|
};
|
|
3590
3121
|
}
|
|
@@ -3632,10 +3163,10 @@ var ownsApiRest = (page) => page.pattern.startsWith("/api/[");
|
|
|
3632
3163
|
var contentUnderApi = (page) => page.route === "/api" || page.route.startsWith("/api/");
|
|
3633
3164
|
var planApi = (project, srcDir, userPages) => {
|
|
3634
3165
|
const { config, context } = project;
|
|
3635
|
-
const server = config.deployment.output === "server";
|
|
3166
|
+
const server = config.deployment.options.output === "server";
|
|
3636
3167
|
return {
|
|
3637
3168
|
catchAll: server && !userPages.some(ownsApiRest) && !project.graph.pages.some(contentUnderApi),
|
|
3638
|
-
enabled: config.
|
|
3169
|
+
enabled: config.agents.api,
|
|
3639
3170
|
server,
|
|
3640
3171
|
spec: !routeIsTaken(userPages, project.graph.pages, OPENAPI_PATH) && !existsSync6(join11(context.root, "public", "openapi.json")),
|
|
3641
3172
|
srcDir
|
|
@@ -3661,10 +3192,10 @@ var writeApiFiles = async (project, plan, write, data, mcp) => {
|
|
|
3661
3192
|
}
|
|
3662
3193
|
if (plan.spec) {
|
|
3663
3194
|
writes.push(write(join11(plan.srcDir, "pages", "openapi.json.ts"), staticJsonEndpointTemplate(buildApiSpec({
|
|
3664
|
-
agentReadability: config.
|
|
3195
|
+
agentReadability: config.agents.agentReadability,
|
|
3665
3196
|
base: data.base,
|
|
3666
3197
|
description: config.description,
|
|
3667
|
-
llmsTxt: config.
|
|
3198
|
+
llmsTxt: config.agents.llmsTxt.enabled,
|
|
3668
3199
|
mcpRoute,
|
|
3669
3200
|
name: config.title,
|
|
3670
3201
|
search: plan.server,
|
|
@@ -3700,30 +3231,29 @@ var specOriginsOf = (spec) => {
|
|
|
3700
3231
|
};
|
|
3701
3232
|
var specOrigins = (data) => [...new Set(Object.values(data).flatMap(specOriginsOf))].toSorted();
|
|
3702
3233
|
var proxyAllowlistWarnings = (config, data) => {
|
|
3703
|
-
const
|
|
3234
|
+
const proxied = new Set(builtinProxyReferences(config).map((reference) => reference.slug));
|
|
3704
3235
|
const warnings = [];
|
|
3705
3236
|
for (const spec of Object.values(data)) {
|
|
3706
|
-
if (!
|
|
3237
|
+
if (!proxied.has(spec.slug) || specOriginsOf(spec).length > 0) {
|
|
3707
3238
|
continue;
|
|
3708
3239
|
}
|
|
3709
|
-
warnings.push(spec.kind === "graphql" ? `The "${spec.label}" GraphQL reference (${spec.route}) has playground.proxy: true, but no absolute endpoint is configured for it, so the built-in proxy has no origin to allow and will refuse every request its playground sends. Set the graphql
|
|
3240
|
+
warnings.push(spec.kind === "graphql" ? `The "${spec.label}" GraphQL reference (${spec.route}) has playground.proxy: true, but no absolute endpoint is configured for it, so the built-in proxy has no origin to allow and will refuse every request its playground sends. Set \`endpoint\` on the graphql() adapter (or the source) to the live GraphQL URL, or point playground.proxy at an external proxy URL.` : `The "${spec.label}" reference (${spec.route}) has playground.proxy: true, but its spec declares no absolute servers[].url (relative and templated URLs carry no origin), so the built-in proxy has no origin to allow and will refuse every request its playground sends. Add an absolute server URL to the spec, or point playground.proxy at an external proxy URL.`);
|
|
3710
3241
|
}
|
|
3711
3242
|
return warnings;
|
|
3712
3243
|
};
|
|
3713
3244
|
var writeAskFiles = async (project, srcDir, write, modules) => {
|
|
3714
|
-
const {
|
|
3715
|
-
if (!(
|
|
3245
|
+
const { assistant } = project.config.ai;
|
|
3246
|
+
if (!(assistant?.enabled && !assistant.endpoint)) {
|
|
3716
3247
|
return;
|
|
3717
3248
|
}
|
|
3718
|
-
const
|
|
3719
|
-
if (grounded) {
|
|
3249
|
+
const backend = resolveAskBackend(assistant.provider);
|
|
3250
|
+
if (backend.grounded) {
|
|
3720
3251
|
modules.set("blume:ask-data", JSON.stringify(await buildAskData(project)));
|
|
3721
3252
|
}
|
|
3722
|
-
await write(join11(srcDir, "pages", "api", "ask.ts"), askEndpointTemplate(
|
|
3723
|
-
cors:
|
|
3724
|
-
instructions:
|
|
3725
|
-
|
|
3726
|
-
retrieval: ask.retrieval
|
|
3253
|
+
await write(join11(srcDir, "pages", "api", "ask.ts"), askEndpointTemplate(backend, {
|
|
3254
|
+
cors: assistant.cors,
|
|
3255
|
+
instructions: assistant.instructions,
|
|
3256
|
+
retrieval: assistant.retrieval
|
|
3727
3257
|
}));
|
|
3728
3258
|
};
|
|
3729
3259
|
var writeNotFoundPage = async (write, srcDir, pages, contentPages) => {
|
|
@@ -3737,14 +3267,18 @@ var writeNotFoundPage = async (write, srcDir, pages, contentPages) => {
|
|
|
3737
3267
|
]);
|
|
3738
3268
|
};
|
|
3739
3269
|
var diagnosticWarning = (diagnostic) => diagnostic.suggestion ? `${diagnostic.message} ${diagnostic.suggestion}` : diagnostic.message;
|
|
3740
|
-
var
|
|
3741
|
-
const
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3270
|
+
var dependencyPreflight = async (project, frameworks) => {
|
|
3271
|
+
const build = project.mode === "build";
|
|
3272
|
+
const diagnostic = await missingDependencyDiagnostic(project.config, project.context.root, build ? "error" : "warning", frameworks);
|
|
3273
|
+
if (!diagnostic) {
|
|
3274
|
+
return [];
|
|
3275
|
+
}
|
|
3276
|
+
if (build) {
|
|
3277
|
+
throw new BlumeError(diagnostic);
|
|
3278
|
+
}
|
|
3279
|
+
return [diagnosticWarning(diagnostic)];
|
|
3747
3280
|
};
|
|
3281
|
+
var analyzeComponentsFile = async (componentsFile) => componentsFile ? analyzeComponentOverrides(await readFile4(componentsFile, "utf-8"), componentsFile) : emptyComponentOverrides();
|
|
3748
3282
|
var projectOgFonts = (project) => resolveOgFonts({
|
|
3749
3283
|
ogFonts: project.config.seo.og.fonts,
|
|
3750
3284
|
themeFonts: project.config.theme.fonts,
|
|
@@ -3787,14 +3321,14 @@ var generateRuntime = async (project) => {
|
|
|
3787
3321
|
const examplesThemePath = join11(srcDir, "generated", "examples.css");
|
|
3788
3322
|
const written = new Set;
|
|
3789
3323
|
const write = (path, content) => {
|
|
3790
|
-
written.add(
|
|
3324
|
+
written.add(normalize2(path));
|
|
3791
3325
|
return writeIfChanged(path, content);
|
|
3792
3326
|
};
|
|
3793
3327
|
const modules = new Map;
|
|
3794
3328
|
const depsLinkWarning = await ensureDepsLink(out);
|
|
3795
3329
|
const contentRoutes = markdownRoutePaths(project);
|
|
3796
3330
|
const homeLinkHeader = buildHomeLinkHeader(config, contentRoutes) ?? undefined;
|
|
3797
|
-
const
|
|
3331
|
+
const assistantEnabled = config.ai.assistant?.enabled ?? false;
|
|
3798
3332
|
const exportPdf = config.export.pdf;
|
|
3799
3333
|
const exportEpub = config.export.epub;
|
|
3800
3334
|
const rawMarkdown = await buildRawMarkdown(project);
|
|
@@ -3811,7 +3345,7 @@ var generateRuntime = async (project) => {
|
|
|
3811
3345
|
integrationBridge,
|
|
3812
3346
|
islandDiscovery,
|
|
3813
3347
|
exampleDiscovery,
|
|
3814
|
-
|
|
3348
|
+
overrideAnalysis
|
|
3815
3349
|
] = await Promise.all([
|
|
3816
3350
|
context.pagesRoot ? discoverPages(context.pagesRoot) : Promise.resolve([]),
|
|
3817
3351
|
detectNeedsReact(context.root),
|
|
@@ -3821,20 +3355,18 @@ var generateRuntime = async (project) => {
|
|
|
3821
3355
|
loadIntegrationBridge(config, context),
|
|
3822
3356
|
discoverIslands(context.root),
|
|
3823
3357
|
discoverExamples(context.root, config.examples.source),
|
|
3824
|
-
|
|
3358
|
+
analyzeComponentsFile(context.componentsFile)
|
|
3825
3359
|
]);
|
|
3826
|
-
const
|
|
3827
|
-
|
|
3828
|
-
tags: overrideTags,
|
|
3829
|
-
warnings: overrideWarnings
|
|
3830
|
-
} = componentSlots;
|
|
3360
|
+
const slotPlan = planComponentSlots(islandDiscovery.islands, overrideAnalysis);
|
|
3361
|
+
const overrideWarnings = overrideAnalysis.warnings;
|
|
3831
3362
|
project.examples = exampleMarkdownLookup(exampleDiscovery.examples);
|
|
3832
3363
|
const frameworks = new Set([
|
|
3833
3364
|
...islandDiscovery.islands.map((island) => island.framework),
|
|
3834
3365
|
...exampleDiscovery.examples.map((example) => example.framework),
|
|
3835
3366
|
...slotPlan.frameworks
|
|
3836
3367
|
]);
|
|
3837
|
-
const
|
|
3368
|
+
const dependencyWarnings = await dependencyPreflight(project, frameworks);
|
|
3369
|
+
const needsReact = detectedReact || assistantEnabled || frameworks.has("react");
|
|
3838
3370
|
const needsVue = frameworks.has("vue");
|
|
3839
3371
|
const needsSvelte = frameworks.has("svelte");
|
|
3840
3372
|
const reactCompilerPath = resolveReactCompiler(config, needsReact);
|
|
@@ -3856,7 +3388,7 @@ var generateRuntime = async (project) => {
|
|
|
3856
3388
|
const proxyOrigins = specOrigins(openApiData);
|
|
3857
3389
|
const hasStaged = staged.size > 0;
|
|
3858
3390
|
const hasFilesystemSource = project.sources.some((source) => !source.staged);
|
|
3859
|
-
const docsCollection = resolveDocsCollection(config, context);
|
|
3391
|
+
const docsCollection = resolveDocsCollection(config, context.root);
|
|
3860
3392
|
const [structural] = await Promise.all([
|
|
3861
3393
|
Promise.all([
|
|
3862
3394
|
write(join11(out, "astro.config.mjs"), astroConfigTemplate({
|
|
@@ -3896,9 +3428,8 @@ var generateRuntime = async (project) => {
|
|
|
3896
3428
|
needsReact
|
|
3897
3429
|
})),
|
|
3898
3430
|
writeNavFragments(write, srcDir, navFragments),
|
|
3899
|
-
write(askPath, askComponentTemplate(
|
|
3431
|
+
write(askPath, askComponentTemplate(assistantEnabled)),
|
|
3900
3432
|
write(join11(srcDir, "generated", "components.ts"), slotPlan.module),
|
|
3901
|
-
write(join11(srcDir, "generated", "islands.ts"), islandMapTemplate(islandDiscovery.islands)),
|
|
3902
3433
|
write(join11(srcDir, "generated", "examples.ts"), exampleMapTemplate(exampleDiscovery.examples, config.basePath)),
|
|
3903
3434
|
write(examplesThemePath, examplesEntryTemplate({
|
|
3904
3435
|
configTokens: buildThemeCss(config.theme),
|
|
@@ -3916,7 +3447,6 @@ var generateRuntime = async (project) => {
|
|
|
3916
3447
|
userTheme
|
|
3917
3448
|
}))
|
|
3918
3449
|
]),
|
|
3919
|
-
Promise.all(islandDiscovery.islands.map((island) => write(join11(srcDir, "generated", "islands", `${island.name}.astro`), islandWrapperTemplate(island)))),
|
|
3920
3450
|
Promise.all(slotPlan.wrappers.map((wrapper) => write(join11(srcDir, "generated", "component-slots", `${wrapper.name}.astro`), wrapper.content))),
|
|
3921
3451
|
Promise.all(exampleDiscovery.examples.map((example) => write(join11(srcDir, "generated", "examples", `${exampleSlug(example.path)}.astro`), exampleWrapperTemplate(example)))),
|
|
3922
3452
|
writeAskFiles(project, srcDir, write, modules),
|
|
@@ -3938,7 +3468,6 @@ var generateRuntime = async (project) => {
|
|
|
3938
3468
|
await write(join11(srcDir, "pages", "changelog.astro"), changelogIndexTemplate({
|
|
3939
3469
|
exportEpub,
|
|
3940
3470
|
exportPdf,
|
|
3941
|
-
mathEnabled: usesMath,
|
|
3942
3471
|
needsReact,
|
|
3943
3472
|
staged: hasStaged
|
|
3944
3473
|
}));
|
|
@@ -3955,13 +3484,14 @@ var generateRuntime = async (project) => {
|
|
|
3955
3484
|
write(searchClientPath, searchClientTemplate(config)),
|
|
3956
3485
|
write(featuresPath, featuresTemplate(clientFeatures))
|
|
3957
3486
|
]);
|
|
3958
|
-
|
|
3487
|
+
const searchAdapter = config.search.provider;
|
|
3488
|
+
if (searchAdapter.mode === "static") {
|
|
3959
3489
|
const documents = await buildSearchDocuments(project);
|
|
3960
3490
|
modules.set("blume:search-index", JSON.stringify(documents));
|
|
3961
3491
|
await write(join11(srcDir, "pages", "blume-search.json.ts"), searchEndpointTemplate());
|
|
3962
3492
|
}
|
|
3963
|
-
if (
|
|
3964
|
-
await write(join11(srcDir, "pages", "api", "search.ts"), mixedbreadSearchEndpointTemplate(
|
|
3493
|
+
if (searchAdapter.kind === "mixedbread") {
|
|
3494
|
+
await write(join11(srcDir, "pages", "api", "search.ts"), mixedbreadSearchEndpointTemplate(searchAdapter.options));
|
|
3965
3495
|
}
|
|
3966
3496
|
await write(join11(srcDir, "generated", "includes.json"), `${JSON.stringify(buildIncludeGraph(project.graph.pages))}
|
|
3967
3497
|
`);
|
|
@@ -4003,9 +3533,9 @@ var generateRuntime = async (project) => {
|
|
|
4003
3533
|
].map(diagnosticWarning));
|
|
4004
3534
|
const knownComponentTags = new Set([
|
|
4005
3535
|
...islandDiscovery.islands.map((island) => island.name),
|
|
4006
|
-
...
|
|
3536
|
+
...overrideAnalysis.mdx.map((entry) => entry.key)
|
|
4007
3537
|
]);
|
|
4008
|
-
warnings.push(...validateUsedComponents(project.graph.pages, knownComponentTags, new Set(registry.map((item) => item.name))).map(diagnosticWarning), ...
|
|
3538
|
+
warnings.push(...validateUsedComponents(project.graph.pages, knownComponentTags, new Set(registry.map((item) => item.name))).map(diagnosticWarning), ...dependencyWarnings);
|
|
4009
3539
|
if (hasScalarReferences(config)) {
|
|
4010
3540
|
const references = await buildReferenceFiles({
|
|
4011
3541
|
config,
|
|
@@ -4028,7 +3558,7 @@ var generateRuntime = async (project) => {
|
|
|
4028
3558
|
return { structuralChange: structural.some(Boolean), warnings };
|
|
4029
3559
|
};
|
|
4030
3560
|
|
|
4031
|
-
export {
|
|
3561
|
+
export { publishBuildProject, refreshBlumeContent, showBlumeErrorOverlay, ogCacheDir, pruneCardCache, cardCacheTally, buildAskData, buildThemeCss, buildReferenceFiles, tailwindEntryTemplate, examplesEntryTemplate, rebaseSourceDirectives, twoslashCss, EXAMPLE_SCAN_GLOB, exampleScanRoots, discoverExamples, exampleMarkdownLookup, packageDirFrom, detectNeedsReact, detectUsesMath, collectStaged, buildRuntimeData, analyzeComponentsFile, languageIconCssFor, clientFeaturesFor, generateRuntime };
|
|
4032
3562
|
|
|
4033
|
-
//# debugId=
|
|
4034
|
-
//# sourceMappingURL=chunk-
|
|
3563
|
+
//# debugId=35E2A04C63CD05BF64756E2164756E21
|
|
3564
|
+
//# sourceMappingURL=chunk-wgm7m9qk.js.map
|