blume 2.0.2 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +1 -0
- package/CHANGELOG.md +113 -0
- package/README.md +1 -1
- package/dist/cli/{chunk-6k4ftwze.js → chunk-0gz36akr.js} +18 -2
- package/dist/cli/{chunk-6k4ftwze.js.map → chunk-0gz36akr.js.map} +3 -3
- package/dist/cli/{chunk-zp79m0ts.js → chunk-1n228xqb.js} +2 -2
- package/dist/cli/{chunk-ddndchfr.js → chunk-2f3ndkpw.js} +57 -29
- package/dist/cli/chunk-2f3ndkpw.js.map +14 -0
- package/dist/cli/{chunk-fsmrqk8a.js → chunk-2f7n4qzt.js} +8 -2
- package/dist/cli/{chunk-fsmrqk8a.js.map → chunk-2f7n4qzt.js.map} +3 -3
- package/dist/cli/{chunk-ppzjqwx2.js → chunk-2n4ps1b3.js} +17 -18
- package/dist/cli/{chunk-ppzjqwx2.js.map → chunk-2n4ps1b3.js.map} +3 -3
- package/dist/cli/{chunk-5r8g91qn.js → chunk-43zcf4gz.js} +398 -159
- package/dist/cli/chunk-43zcf4gz.js.map +36 -0
- package/dist/cli/chunk-4ejxbzee.js +39 -0
- package/dist/cli/chunk-4ejxbzee.js.map +10 -0
- package/dist/cli/{chunk-hr8ne106.js → chunk-4h8z9vv5.js} +296 -77
- package/dist/cli/chunk-4h8z9vv5.js.map +16 -0
- package/dist/cli/{chunk-k7pj68a8.js → chunk-5cg2rzgf.js} +18 -16
- package/dist/cli/{chunk-k7pj68a8.js.map → chunk-5cg2rzgf.js.map} +2 -2
- package/dist/cli/{chunk-h2ez8dzb.js → chunk-5ffywsmb.js} +4 -4
- package/dist/cli/{chunk-g698a744.js → chunk-5wj2qwn2.js} +5 -5
- package/dist/cli/chunk-6bm0xpgd.js +18 -0
- package/dist/cli/chunk-6bm0xpgd.js.map +10 -0
- package/dist/cli/{chunk-3yce002v.js → chunk-713mngdq.js} +15 -8
- package/dist/cli/chunk-713mngdq.js.map +14 -0
- package/dist/cli/{chunk-91ws1n6j.js → chunk-9geymqns.js} +17 -15
- package/dist/cli/{chunk-91ws1n6j.js.map → chunk-9geymqns.js.map} +2 -2
- package/dist/cli/{chunk-6dtt0zfn.js → chunk-9xr4dgee.js} +27 -18
- package/dist/cli/chunk-9xr4dgee.js.map +10 -0
- package/dist/cli/{chunk-sqw4ekg1.js → chunk-amrb6hgh.js} +2 -2
- package/dist/cli/chunk-cm89scdv.js +443 -0
- package/dist/cli/chunk-cm89scdv.js.map +11 -0
- package/dist/cli/{chunk-wdrt2k2v.js → chunk-cmtcnh9f.js} +90 -26
- package/dist/cli/chunk-cmtcnh9f.js.map +10 -0
- package/dist/cli/chunk-cy5bm0j0.js +104 -0
- package/dist/cli/chunk-cy5bm0j0.js.map +11 -0
- package/dist/cli/{chunk-7mbqtmgb.js → chunk-e7vvk5ya.js} +21 -12
- package/dist/cli/chunk-e7vvk5ya.js.map +10 -0
- package/dist/cli/{chunk-qkb5a8sa.js → chunk-g2z9x01v.js} +6 -98
- package/dist/cli/chunk-g2z9x01v.js.map +10 -0
- package/dist/cli/{chunk-273ygyr4.js → chunk-ga0pf4aj.js} +7 -7
- package/dist/cli/{chunk-273ygyr4.js.map → chunk-ga0pf4aj.js.map} +3 -3
- package/dist/cli/{chunk-h7k3nq3v.js → chunk-gp84za0h.js} +2 -2
- package/dist/cli/{chunk-hqp2ajnh.js → chunk-h2a48yhd.js} +195 -73
- package/dist/cli/chunk-h2a48yhd.js.map +36 -0
- package/dist/cli/{chunk-pbg5a4s3.js → chunk-jnwj5kjj.js} +71 -47
- package/dist/cli/chunk-jnwj5kjj.js.map +19 -0
- package/dist/cli/chunk-kwrg63tm.js +31 -0
- package/dist/cli/chunk-kwrg63tm.js.map +10 -0
- package/dist/cli/{chunk-8g8ytmgx.js → chunk-nd1821sk.js} +21 -19
- package/dist/cli/{chunk-8g8ytmgx.js.map → chunk-nd1821sk.js.map} +2 -2
- package/dist/cli/{chunk-w4bxdvsa.js → chunk-ntv4qrt7.js} +17 -15
- package/dist/cli/{chunk-w4bxdvsa.js.map → chunk-ntv4qrt7.js.map} +2 -2
- package/dist/cli/{chunk-bfwp9vp6.js → chunk-p804f3pe.js} +7 -7
- package/dist/cli/{chunk-4e9b9ra6.js → chunk-py62fewh.js} +6 -6
- package/dist/cli/{chunk-4e9b9ra6.js.map → chunk-py62fewh.js.map} +1 -1
- package/dist/cli/chunk-q3wxxq39.js +126 -0
- package/dist/cli/chunk-q3wxxq39.js.map +11 -0
- package/dist/cli/{chunk-j85scx15.js → chunk-rekqz4qg.js} +142 -46
- package/dist/cli/chunk-rekqz4qg.js.map +10 -0
- package/dist/cli/{chunk-00gs3wqs.js → chunk-ta27feev.js} +1 -1
- package/dist/cli/{chunk-v6ya5kcb.js → chunk-xkz5xbtv.js} +4031 -1132
- package/dist/cli/chunk-xkz5xbtv.js.map +213 -0
- package/dist/cli/{chunk-bbnwccaz.js → chunk-y4ykbark.js} +2 -2
- package/dist/cli/{chunk-n1yg3tj3.js → chunk-y5h4r2y0.js} +6 -6
- package/dist/cli/{chunk-n1yg3tj3.js.map → chunk-y5h4r2y0.js.map} +3 -3
- package/dist/cli/{chunk-nfcyttvj.js → chunk-yj17vs39.js} +9 -9
- package/dist/cli/{chunk-nfcyttvj.js.map → chunk-yj17vs39.js.map} +1 -1
- package/dist/cli/{chunk-7vtckvaw.js → chunk-yxmk4pec.js} +16 -14
- package/dist/cli/{chunk-7vtckvaw.js.map → chunk-yxmk4pec.js.map} +2 -2
- package/dist/cli/{chunk-gs7r695n.js → chunk-zccbjcj0.js} +22 -8
- package/dist/cli/{chunk-gs7r695n.js.map → chunk-zccbjcj0.js.map} +3 -3
- package/dist/cli/{chunk-xh43dwgw.js → chunk-zf748avv.js} +415 -225
- package/dist/cli/chunk-zf748avv.js.map +37 -0
- package/dist/cli/{chunk-d1v5rhy0.js → chunk-zhvd6adm.js} +16 -14
- package/dist/cli/{chunk-d1v5rhy0.js.map → chunk-zhvd6adm.js.map} +2 -2
- package/dist/cli/index.js +28 -20
- package/dist/cli/index.js.map +5 -5
- package/dist/types/ai/agent-surface.d.ts +8 -7
- package/dist/types/ai/ai-catalog.d.ts +7 -0
- package/dist/types/ai/ask-context.d.ts +22 -0
- package/dist/types/ai/ask.d.ts +271 -58
- package/dist/types/ai/index.d.ts +2 -2
- package/dist/types/ai/link-headers.d.ts +8 -1
- package/dist/types/ai/openapi-components.d.ts +5 -2
- package/dist/types/ai/relative-links.d.ts +9 -7
- package/dist/types/ai/site-skill.d.ts +26 -0
- package/dist/types/ai/skills.d.ts +20 -1
- package/dist/types/ai/tar.d.ts +1 -3
- package/dist/types/analytics/index.d.ts +2 -0
- package/dist/types/analytics/one-dollar-stats.d.ts +48 -0
- package/dist/types/analytics/schema.d.ts +14 -0
- package/dist/types/astro/integration.d.ts +11 -2
- package/dist/types/captcha/hcaptcha.d.ts +27 -0
- package/dist/types/captcha/index.d.ts +28 -0
- package/dist/types/captcha/schema.d.ts +29 -0
- package/dist/types/captcha/turnstile.d.ts +28 -0
- package/dist/types/components/content/api-field.d.ts +59 -0
- package/dist/types/components/content/api-page.d.ts +95 -0
- package/dist/types/components/layout/nav-utils.d.ts +26 -0
- package/dist/types/components/openapi/helpers.d.ts +137 -0
- package/dist/types/components/openapi/security.d.ts +85 -0
- package/dist/types/consent/ethyca.d.ts +48 -0
- package/dist/types/consent/index.d.ts +37 -0
- package/dist/types/consent/native.d.ts +28 -0
- package/dist/types/consent/osano.d.ts +42 -0
- package/dist/types/consent/schema.d.ts +110 -0
- package/dist/types/core/base-path.d.ts +21 -7
- package/dist/types/core/config-input.d.ts +196 -27
- package/dist/types/core/data.d.ts +49 -4
- package/dist/types/core/directive-diagnostics.d.ts +12 -0
- package/dist/types/core/footer.d.ts +8 -0
- package/dist/types/core/heading-markers.d.ts +5 -7
- package/dist/types/core/i18n-ui.d.ts +86 -0
- package/dist/types/core/i18n.d.ts +2 -0
- package/dist/types/core/includes.d.ts +8 -2
- package/dist/types/core/last-modified.d.ts +10 -0
- package/dist/types/core/localizable.d.ts +7 -0
- package/dist/types/core/meta.d.ts +8 -0
- package/dist/types/core/page-modes.d.ts +29 -0
- package/dist/types/core/redirect-patterns.d.ts +144 -0
- package/dist/types/core/related.d.ts +40 -0
- package/dist/types/core/schema.d.ts +558 -56
- package/dist/types/core/sources/lower.d.ts +29 -16
- package/dist/types/core/sources/normalize.d.ts +13 -1
- package/dist/types/core/sources/read.d.ts +5 -0
- package/dist/types/core/sources/watch.d.ts +12 -5
- package/dist/types/core/standard-schema.d.ts +5 -0
- package/dist/types/core/types.d.ts +1 -1
- package/dist/types/core/variables.d.ts +42 -0
- package/dist/types/deploy/artifacts.d.ts +6 -4
- package/dist/types/deploy/headers.d.ts +5 -0
- package/dist/types/deploy/node-headers.d.ts +13 -2
- package/dist/types/deploy/platforms/cloudflare.d.ts +5 -0
- package/dist/types/deploy/platforms/netlify.d.ts +7 -0
- package/dist/types/deploy/platforms/types.d.ts +8 -0
- package/dist/types/deploy/platforms/vercel.d.ts +6 -0
- package/dist/types/deploy/redirects.d.ts +61 -22
- package/dist/types/deploy/vercel-negotiation.d.ts +9 -0
- package/dist/types/markdown/code-title.d.ts +17 -0
- package/dist/types/markdown/directives.d.ts +62 -0
- package/dist/types/markdown/features.d.ts +24 -2
- package/dist/types/markdown/mdast.d.ts +63 -0
- package/dist/types/narration/build.d.ts +70 -0
- package/dist/types/narration/provider.d.ts +26 -0
- package/dist/types/narration/script.d.ts +154 -0
- package/dist/types/openapi/asyncapi.d.ts +4 -2
- package/dist/types/openapi/model.d.ts +12 -6
- package/dist/types/openapi/overlay.d.ts +54 -0
- package/dist/types/openapi/parse.d.ts +13 -0
- package/dist/types/openapi/references.d.ts +14 -4
- package/dist/types/ratelimit/cloudflare.d.ts +39 -0
- package/dist/types/ratelimit/index.d.ts +27 -0
- package/dist/types/ratelimit/memory.d.ts +36 -0
- package/dist/types/ratelimit/schema.d.ts +111 -0
- package/dist/types/ratelimit/upstash.d.ts +21 -0
- package/dist/types/ratelimit/wrangler.d.ts +23 -0
- package/dist/types/reference/asyncapi.d.ts +10 -10
- package/dist/types/reference/graphql.d.ts +13 -10
- package/dist/types/reference/openapi.d.ts +33 -12
- package/dist/types/reference/options.d.ts +45 -5
- package/dist/types/reference/scalar.d.ts +13 -0
- package/dist/types/reference/schema.d.ts +60 -36
- package/dist/types/search/documents.d.ts +12 -1
- package/dist/types/search/orama-index.d.ts +4 -0
- package/dist/types/seo/metatags.d.ts +20 -0
- package/docs/02-deployment.mdx +44 -6
- package/docs/03-upgrading.mdx +4 -4
- package/docs/04-migrating.mdx +1 -1
- package/docs/08-faq.mdx +1 -1
- package/docs/advanced/changelog.mdx +2 -2
- package/docs/advanced/custom-pages.mdx +3 -3
- package/docs/advanced/skills.mdx +14 -0
- package/docs/cli/audit.mdx +38 -2
- package/docs/cli/evals.mdx +3 -3
- package/docs/cli/index.mdx +1 -0
- package/docs/cli/translate.mdx +3 -3
- package/docs/cli/version.mdx +1 -1
- package/docs/configuration/analytics.mdx +22 -1
- package/docs/configuration/assistant.mdx +188 -36
- package/docs/configuration/consent.mdx +100 -0
- package/docs/configuration/customization.mdx +6 -4
- package/docs/configuration/index.mdx +63 -5
- package/docs/configuration/meta.ts +3 -0
- package/docs/configuration/narration.mdx +119 -0
- package/docs/configuration/rate-limiting.mdx +69 -0
- package/docs/configuration/search.mdx +30 -2
- package/docs/configuration/theming.mdx +3 -1
- package/docs/content/components.mdx +107 -1
- package/docs/content/frontmatter.mdx +77 -1
- package/docs/content/i18n.mdx +40 -3
- package/docs/content/includes.mdx +16 -0
- package/docs/content/index.mdx +4 -2
- package/docs/content/islands.mdx +1 -1
- package/docs/content/meta.mdx +4 -1
- package/docs/content/meta.ts +1 -0
- package/docs/content/navigation.mdx +28 -6
- package/docs/content/sources/contentful.mdx +32 -0
- package/docs/content/sources/custom.mdx +39 -0
- package/docs/content/sources/github-releases.mdx +31 -0
- package/docs/content/sources/index.mdx +91 -0
- package/docs/content/sources/meta.ts +16 -0
- package/docs/content/sources/notion.mdx +32 -0
- package/docs/content/sources/obsidian.mdx +37 -0
- package/docs/content/sources/payload.mdx +30 -0
- package/docs/content/sources/remote-mdx.mdx +40 -0
- package/docs/content/sources/sanity.mdx +29 -0
- package/docs/content/sources/strapi.mdx +31 -0
- package/docs/content/syntax.mdx +81 -2
- package/docs/content/variables.mdx +41 -0
- package/docs/content/versioning.mdx +1 -1
- package/docs/discoverability/agent-discovery.mdx +30 -3
- package/docs/discoverability/index.mdx +3 -2
- package/docs/discoverability/llms-txt.mdx +1 -1
- package/docs/discoverability/markdown.mdx +2 -2
- package/docs/discoverability/metadata.mdx +17 -0
- package/docs/discoverability/open-graph.mdx +5 -3
- package/docs/discoverability/rss.mdx +1 -1
- package/docs/references/api-pages.mdx +74 -0
- package/docs/references/asyncapi.mdx +2 -2
- package/docs/references/graphql.mdx +3 -3
- package/docs/references/meta.ts +1 -1
- package/docs/references/openapi.mdx +106 -5
- package/docs/references/scalar.mdx +3 -1
- package/package.json +36 -1
- package/skills/blume/SKILL.md +3 -0
- package/skills/blume-migrate/SKILL.md +5 -5
- package/skills/blume-migrate/references/docusaurus.md +3 -3
- package/skills/blume-migrate/references/fumadocs.md +1 -1
- package/skills/blume-migrate/references/mintlify.md +37 -19
- package/skills/blume-migrate/references/nextra.md +3 -3
- package/skills/blume-migrate/references/starlight.md +2 -1
- package/skills/blume-migrate/scripts/mintlify-codemod.mjs +67 -16
- package/skills/blume-write-skill/SKILL.md +82 -0
- package/src/ai/agent-readability.ts +4 -3
- package/src/ai/agent-surface.ts +9 -7
- package/src/ai/ai-catalog.ts +12 -5
- package/src/ai/api/handlers.ts +2 -2
- package/src/ai/api/spec.ts +2 -2
- package/src/ai/api-catalog.ts +6 -2
- package/src/ai/ask-context.ts +73 -20
- package/src/ai/ask-data.ts +6 -0
- package/src/ai/ask-tools.ts +142 -0
- package/src/ai/ask.ts +354 -76
- package/src/ai/changelog-markdown.ts +2 -2
- package/src/ai/component-markdown.ts +75 -0
- package/src/ai/cors.ts +2 -0
- package/src/ai/index.ts +12 -0
- package/src/ai/link-headers.ts +14 -5
- package/src/ai/llms.ts +24 -9
- package/src/ai/markdown.ts +2 -1
- package/src/ai/mcp/data.ts +6 -0
- package/src/ai/mcp/discovery.ts +2 -2
- package/src/ai/mcp/query.ts +2 -2
- package/src/ai/mcp/server.ts +2 -2
- package/src/ai/openapi-components.ts +31 -9
- package/src/ai/relative-links.ts +42 -26
- package/src/ai/serializers.ts +2 -1
- package/src/ai/site-skill.ts +274 -0
- package/src/ai/skills.ts +49 -3
- package/src/ai/tar.ts +139 -12
- package/src/ai/write-skill.ts +97 -0
- package/src/analytics/head.ts +4 -0
- package/src/analytics/index.ts +5 -0
- package/src/analytics/one-dollar-stats.ts +86 -0
- package/src/analytics/schema.ts +2 -0
- package/src/astro/generate.ts +133 -19
- package/src/astro/include-hmr.ts +31 -12
- package/src/astro/include-refresh.ts +19 -8
- package/src/astro/index.ts +1 -0
- package/src/astro/integration.ts +143 -14
- package/src/astro/module-types.ts +6 -0
- package/src/astro/runtime-modules.ts +28 -13
- package/src/astro/templates.ts +364 -67
- package/src/astro/variables.ts +31 -0
- package/src/audit/catalog.ts +19 -0
- package/src/audit/checks/contrast.ts +183 -0
- package/src/audit/checks/i18n.ts +2 -3
- package/src/audit/checks/indexability.ts +2 -3
- package/src/audit/checks/links.ts +13 -13
- package/src/audit/checks/sitemap.ts +2 -3
- package/src/audit/graph.ts +3 -1
- package/src/audit/redirects.ts +46 -15
- package/src/audit/run.ts +14 -9
- package/src/audit/snapshot.ts +5 -0
- package/src/audit/types.ts +2 -1
- package/src/blume-modules.d.ts +7 -0
- package/src/captcha/client.ts +152 -0
- package/src/captcha/hcaptcha.ts +36 -0
- package/src/captcha/index.ts +28 -0
- package/src/captcha/schema.ts +32 -0
- package/src/captcha/turnstile.ts +38 -0
- package/src/captcha/verify.ts +71 -0
- package/src/cli/args.ts +32 -0
- package/src/cli/command-meta.ts +5 -0
- package/src/cli/commands/audit.ts +4 -1
- package/src/cli/commands/doctor.ts +25 -17
- package/src/cli/commands/eval.ts +19 -11
- package/src/cli/commands/skill.ts +96 -0
- package/src/cli/commands/translate.ts +9 -12
- package/src/cli/commands/validate.ts +3 -1
- package/src/cli/dev-lock.ts +157 -37
- package/src/cli/index.ts +5 -0
- package/src/cli/report-format.ts +11 -6
- package/src/cli/required-secrets.ts +71 -29
- package/src/components/BlumePage.astro +2 -0
- package/src/components/colors.ts +19 -0
- package/src/components/content/ApiEndpoint.astro +18 -0
- package/src/components/content/ApiField.astro +79 -0
- package/src/components/content/ApiPlayground.astro +62 -0
- package/src/components/content/ApiRail.astro +19 -0
- package/src/components/content/Badge.astro +5 -3
- package/src/components/content/Color.astro +1 -0
- package/src/components/content/Component.astro +2 -2
- package/src/components/content/FileTree.astro +1 -0
- package/src/components/content/GithubInfo.astro +1 -0
- package/src/components/content/Panel.astro +1 -0
- package/src/components/content/ParamField.astro +25 -0
- package/src/components/content/RequestExample.astro +17 -0
- package/src/components/content/ResponseExample.astro +17 -0
- package/src/components/content/ResponseField.astro +32 -0
- package/src/components/content/Step.astro +1 -0
- package/src/components/content/Tab.astro +0 -1
- package/src/components/content/Tabs.astro +4 -0
- package/src/components/content/Tile.astro +1 -0
- package/src/components/content/Tooltip.astro +1 -0
- package/src/components/content/Tree.astro +1 -0
- package/src/components/content/TypeTable.astro +4 -1
- package/src/components/content/View.astro +21 -0
- package/src/components/content/ViewSwitcher.astro +168 -0
- package/src/components/content/api-field.ts +100 -0
- package/src/components/content/api-page.ts +224 -0
- package/src/components/content/badge-color.ts +5 -2
- package/src/components/content/base-href.ts +13 -36
- package/src/components/content/view-switcher.ts +71 -0
- package/src/components/index.ts +2 -0
- package/src/components/islands/Assistant.astro +10 -1
- package/src/components/islands/assistant.tsx +125 -18
- package/src/components/islands/base-path.ts +47 -10
- package/src/components/islands/code-question.ts +62 -0
- package/src/components/islands/hooks.ts +145 -40
- package/src/components/islands/support-link.ts +68 -0
- package/src/components/islands/webmcp.ts +4 -2
- package/src/components/layout/Analytics.astro +11 -2
- package/src/components/layout/Banner.astro +14 -10
- package/src/components/layout/Breadcrumbs.astro +11 -4
- package/src/components/layout/ConsentBanner.astro +62 -0
- package/src/components/layout/ConsentHead.astro +38 -0
- package/src/components/layout/Directory.astro +94 -0
- package/src/components/layout/DiscoveryLinks.astro +9 -5
- package/src/components/layout/DrawerSwitchers.astro +51 -0
- package/src/components/layout/Empty.astro +2 -2
- package/src/components/layout/Header.astro +124 -82
- package/src/components/layout/LanguageSwitcher.astro +50 -17
- package/src/components/layout/NarrationPlayer.astro +1085 -0
- package/src/components/layout/NavSelector.astro +35 -9
- package/src/components/layout/NavTabMenu.astro +3 -3
- package/src/components/layout/NavTree.astro +16 -6
- package/src/components/layout/PageActions.astro +4 -3
- package/src/components/layout/PageFeedback.astro +54 -49
- package/src/components/layout/PageLayout.astro +78 -9
- package/src/components/layout/Pagination.astro +3 -3
- package/src/components/layout/ReferenceLayout.astro +17 -6
- package/src/components/layout/RelatedPages.astro +42 -0
- package/src/components/layout/RootLayout.astro +313 -50
- package/src/components/layout/Search.astro +64 -30
- package/src/components/layout/SiteFooter.astro +124 -0
- package/src/components/layout/SiteMetatags.astro +16 -0
- package/src/components/layout/VersionBanner.astro +2 -2
- package/src/components/layout/analytics-client.ts +12 -0
- package/src/components/layout/consent/native.ts +79 -0
- package/src/components/layout/consent/types.ts +37 -0
- package/src/components/layout/footer-links.ts +53 -0
- package/src/components/layout/footer-socials.ts +87 -0
- package/src/components/layout/locale-redirect.ts +107 -0
- package/src/components/layout/nav-utils.ts +83 -0
- package/src/components/layout/page-feedback.ts +96 -0
- package/src/components/layout/search/analytics.ts +98 -0
- package/src/components/layout/search/flexsearch.ts +17 -5
- package/src/components/layout/search/orama-cloud.ts +26 -14
- package/src/components/layout/search/types.ts +20 -0
- package/src/components/layout/search/typesense.ts +5 -1
- package/src/components/layout/toc-active.ts +41 -0
- package/src/components/layout/toc-element.ts +8 -14
- package/src/components/openapi/ApiTagOperations.astro +2 -2
- package/src/components/openapi/AsyncApiOperation.astro +7 -4
- package/src/components/openapi/GraphqlChip.astro +2 -2
- package/src/components/openapi/Operation.astro +163 -13
- package/src/components/openapi/Playground.astro +4 -4
- package/src/components/openapi/RequestBody.astro +6 -4
- package/src/components/openapi/RequestPanel.astro +63 -8
- package/src/components/openapi/Responses.astro +6 -4
- package/src/components/openapi/SchemaTable.astro +7 -0
- package/src/components/openapi/async-snippets.ts +4 -4
- package/src/components/openapi/async.ts +38 -6
- package/src/components/openapi/code-samples.ts +97 -0
- package/src/components/openapi/helpers.ts +19 -9
- package/src/components/openapi/message-composer.ts +6 -1
- package/src/components/openapi/message.ts +17 -2
- package/src/components/openapi/operation-model.ts +81 -11
- package/src/components/openapi/panel.ts +4 -2
- package/src/components/openapi/param-style.ts +181 -0
- package/src/components/openapi/playground-client.ts +73 -16
- package/src/components/openapi/request.ts +190 -26
- package/src/components/openapi/schema-tree.ts +30 -24
- package/src/components/openapi/security.ts +6 -3
- package/src/components/openapi/snippets.ts +953 -13
- package/src/components/openapi/ws-client.ts +18 -2
- package/src/components/props.ts +6 -0
- package/src/consent/client.ts +95 -0
- package/src/consent/clients.ts +19 -0
- package/src/consent/ethyca.ts +71 -0
- package/src/consent/head.ts +24 -0
- package/src/consent/index.ts +37 -0
- package/src/consent/init.ts +29 -0
- package/src/consent/native.ts +36 -0
- package/src/consent/osano.ts +59 -0
- package/src/consent/schema.ts +30 -0
- package/src/core/base-path.ts +62 -16
- package/src/core/builtin-tags.ts +5 -0
- package/src/core/client-address.ts +19 -0
- package/src/core/config-input.ts +203 -27
- package/src/core/data.ts +44 -4
- package/src/core/diagnostics.ts +5 -2
- package/src/core/directive-diagnostics.ts +99 -0
- package/src/core/footer.ts +26 -0
- package/src/core/frontmatter.ts +21 -18
- package/src/core/graph.ts +39 -36
- package/src/core/heading-markers.ts +5 -18
- package/src/core/i18n-ui.ts +82 -2
- package/src/core/i18n.ts +31 -3
- package/src/core/includes.ts +20 -3
- package/src/core/last-modified.ts +25 -3
- package/src/core/links.ts +16 -2
- package/src/core/locale-links.ts +5 -1
- package/src/core/localizable.ts +26 -0
- package/src/core/meta.ts +33 -19
- package/src/core/navigation.ts +71 -20
- package/src/core/page-modes.ts +56 -0
- package/src/core/project-graph.ts +138 -10
- package/src/core/redirect-patterns.ts +491 -0
- package/src/core/related.ts +131 -0
- package/src/core/schema.ts +342 -68
- package/src/core/sources/contentful-rich-text.ts +27 -20
- package/src/core/sources/filesystem.ts +20 -2
- package/src/core/sources/github-releases.ts +25 -6
- package/src/core/sources/lexical.ts +23 -18
- package/src/core/sources/lower.ts +201 -34
- package/src/core/sources/mdx-remote.ts +51 -16
- package/src/core/sources/normalize.ts +327 -91
- package/src/core/sources/notion.ts +52 -25
- package/src/core/sources/obsidian.ts +23 -6
- package/src/core/sources/portable-text.ts +38 -21
- package/src/core/sources/read.ts +8 -3
- package/src/core/sources/strapi-blocks.ts +20 -16
- package/src/core/sources/watch.ts +20 -7
- package/src/core/standard-schema.ts +10 -6
- package/src/core/types.ts +1 -1
- package/src/core/ui-packs/ar.ts +43 -0
- package/src/core/ui-packs/bg.ts +45 -0
- package/src/core/ui-packs/bn.ts +43 -0
- package/src/core/ui-packs/ca.ts +46 -0
- package/src/core/ui-packs/cs.ts +44 -0
- package/src/core/ui-packs/da.ts +45 -0
- package/src/core/ui-packs/de.ts +46 -0
- package/src/core/ui-packs/el.ts +45 -0
- package/src/core/ui-packs/es.ts +46 -0
- package/src/core/ui-packs/fa.ts +45 -0
- package/src/core/ui-packs/fi.ts +45 -0
- package/src/core/ui-packs/fr.ts +46 -0
- package/src/core/ui-packs/he.ts +43 -0
- package/src/core/ui-packs/hi.ts +44 -0
- package/src/core/ui-packs/hr.ts +45 -0
- package/src/core/ui-packs/hu.ts +44 -0
- package/src/core/ui-packs/id.ts +45 -0
- package/src/core/ui-packs/it.ts +45 -0
- package/src/core/ui-packs/ja.ts +45 -0
- package/src/core/ui-packs/ko.ts +44 -0
- package/src/core/ui-packs/nl.ts +46 -0
- package/src/core/ui-packs/no.ts +44 -0
- package/src/core/ui-packs/pl.ts +45 -0
- package/src/core/ui-packs/pt-br.ts +46 -0
- package/src/core/ui-packs/pt.ts +45 -0
- package/src/core/ui-packs/ro.ts +45 -0
- package/src/core/ui-packs/ru.ts +45 -0
- package/src/core/ui-packs/sk.ts +44 -0
- package/src/core/ui-packs/sr.ts +45 -0
- package/src/core/ui-packs/sv.ts +44 -0
- package/src/core/ui-packs/th.ts +43 -0
- package/src/core/ui-packs/tr.ts +45 -0
- package/src/core/ui-packs/uk.ts +45 -0
- package/src/core/ui-packs/vi.ts +45 -0
- package/src/core/ui-packs/zh-tw.ts +43 -0
- package/src/core/ui-packs/zh.ts +43 -0
- package/src/core/variables.ts +103 -0
- package/src/core/version-cut.ts +52 -15
- package/src/deploy/artifacts.ts +104 -14
- package/src/deploy/cloudflare-negotiation.ts +39 -17
- package/src/deploy/headers.ts +10 -5
- package/src/deploy/node-headers.ts +64 -10
- package/src/deploy/platforms/cloudflare.ts +44 -3
- package/src/deploy/platforms/netlify.ts +34 -1
- package/src/deploy/platforms/node.ts +1 -0
- package/src/deploy/platforms/static.ts +1 -0
- package/src/deploy/platforms/types.ts +8 -0
- package/src/deploy/platforms/vercel.ts +38 -2
- package/src/deploy/redirects.ts +139 -36
- package/src/deploy/robots.ts +2 -2
- package/src/deploy/rss.ts +4 -3
- package/src/deploy/sitemap.ts +7 -5
- package/src/deploy/vercel-negotiation.ts +36 -0
- package/src/markdown/api-rail.ts +259 -0
- package/src/markdown/base-links.ts +34 -36
- package/src/markdown/code-title.ts +35 -9
- package/src/markdown/directives.ts +242 -36
- package/src/markdown/features.ts +20 -2
- package/src/markdown/fence-meta.ts +2 -0
- package/src/markdown/include.ts +11 -1
- package/src/markdown/index.ts +35 -11
- package/src/markdown/math.ts +4 -4
- package/src/markdown/mdast.ts +5 -2
- package/src/markdown/relative-links.ts +12 -4
- package/src/markdown/variables.ts +56 -0
- package/src/markdown/views.ts +82 -0
- package/src/narration/build.ts +412 -0
- package/src/narration/player.ts +249 -0
- package/src/narration/provider.ts +29 -0
- package/src/narration/script.ts +592 -0
- package/src/og/card.ts +136 -11
- package/src/og/derive.ts +41 -31
- package/src/og/index.ts +1 -0
- package/src/openapi/asyncapi.ts +4 -2
- package/src/openapi/model.ts +77 -36
- package/src/openapi/overlay.ts +256 -0
- package/src/openapi/parse.ts +55 -2
- package/src/openapi/proxy.ts +63 -10
- package/src/openapi/references.ts +21 -5
- package/src/openapi/render-mdx.ts +46 -3
- package/src/openapi/scalar.ts +40 -6
- package/src/openapi/source.ts +1 -1
- package/src/ratelimit/cloudflare.ts +54 -0
- package/src/ratelimit/index.ts +30 -0
- package/src/ratelimit/memory.ts +45 -0
- package/src/ratelimit/runtime.ts +229 -0
- package/src/ratelimit/schema.ts +28 -0
- package/src/ratelimit/upstash.ts +30 -0
- package/src/ratelimit/wrangler.ts +70 -0
- package/src/reference/asyncapi.ts +2 -2
- package/src/reference/graphql.ts +5 -2
- package/src/reference/openapi.ts +21 -7
- package/src/reference/options.ts +51 -7
- package/src/reference/scalar.ts +33 -8
- package/src/registry/eject.ts +201 -28
- package/src/registry/registry.ts +7 -0
- package/src/search/adapters/version-scope.ts +30 -0
- package/src/search/documents.ts +93 -28
- package/src/search/orama-index.ts +28 -3
- package/src/search/pagefind-ranking.ts +39 -0
- package/src/search/popular.ts +2 -1
- package/src/search/sync/algolia.ts +15 -4
- package/src/search/sync/orama-cloud.ts +3 -0
- package/src/search/sync/typesense.ts +5 -0
- package/src/seo/jsonld.ts +7 -3
- package/src/seo/metatags.ts +67 -0
- package/src/theme/chrome-icons.ts +1 -0
- package/src/theme/color.ts +500 -0
- package/src/theme/entry.ts +56 -3
- package/src/theme/palette.ts +121 -45
- package/src/translate/meta.ts +68 -24
- package/src/translate/prompts.ts +1 -0
- package/src/translate/run.ts +3 -3
- package/src/translate/validate.ts +12 -3
- package/src/translate/work-list.ts +56 -17
- package/src/upgrade/upgrade.ts +4 -171
- package/dist/cli/chunk-3yce002v.js.map +0 -14
- package/dist/cli/chunk-5r8g91qn.js.map +0 -34
- package/dist/cli/chunk-6dtt0zfn.js.map +0 -10
- package/dist/cli/chunk-7mbqtmgb.js.map +0 -10
- package/dist/cli/chunk-ddndchfr.js.map +0 -14
- package/dist/cli/chunk-esh98wmb.js +0 -23
- package/dist/cli/chunk-esh98wmb.js.map +0 -10
- package/dist/cli/chunk-hqp2ajnh.js.map +0 -35
- package/dist/cli/chunk-hr8ne106.js.map +0 -13
- package/dist/cli/chunk-j85scx15.js.map +0 -10
- package/dist/cli/chunk-mqc662a6.js +0 -75
- package/dist/cli/chunk-mqc662a6.js.map +0 -11
- package/dist/cli/chunk-pbg5a4s3.js.map +0 -19
- package/dist/cli/chunk-qkb5a8sa.js.map +0 -10
- package/dist/cli/chunk-v6ya5kcb.js.map +0 -189
- package/dist/cli/chunk-wdrt2k2v.js.map +0 -10
- package/dist/cli/chunk-xh43dwgw.js.map +0 -36
- package/docs/content/sources.mdx +0 -338
- /package/dist/cli/{chunk-zp79m0ts.js.map → chunk-1n228xqb.js.map} +0 -0
- /package/dist/cli/{chunk-h2ez8dzb.js.map → chunk-5ffywsmb.js.map} +0 -0
- /package/dist/cli/{chunk-g698a744.js.map → chunk-5wj2qwn2.js.map} +0 -0
- /package/dist/cli/{chunk-sqw4ekg1.js.map → chunk-amrb6hgh.js.map} +0 -0
- /package/dist/cli/{chunk-h7k3nq3v.js.map → chunk-gp84za0h.js.map} +0 -0
- /package/dist/cli/{chunk-bfwp9vp6.js.map → chunk-p804f3pe.js.map} +0 -0
- /package/dist/cli/{chunk-00gs3wqs.js.map → chunk-ta27feev.js.map} +0 -0
- /package/dist/cli/{chunk-bbnwccaz.js.map → chunk-y4ykbark.js.map} +0 -0
package/src/astro/integration.ts
CHANGED
|
@@ -9,6 +9,11 @@ import type { CustomPageRoute } from "../core/custom-pages.ts";
|
|
|
9
9
|
import { enrichDiagnostic } from "../core/diagnostics.ts";
|
|
10
10
|
import { scanProject } from "../core/project-graph.ts";
|
|
11
11
|
import type { BlumeProject } from "../core/project-graph.ts";
|
|
12
|
+
import {
|
|
13
|
+
matchCompiledRedirect,
|
|
14
|
+
requestPath,
|
|
15
|
+
} from "../core/redirect-patterns.ts";
|
|
16
|
+
import type { CompiledRedirect } from "../core/redirect-patterns.ts";
|
|
12
17
|
import type { Diagnostic } from "../core/types.ts";
|
|
13
18
|
import { publishBuildArtifacts } from "../deploy/artifacts.ts";
|
|
14
19
|
import type { ArtifactLogger } from "../deploy/artifacts.ts";
|
|
@@ -28,13 +33,40 @@ interface OverlayErrorPayload {
|
|
|
28
33
|
|
|
29
34
|
/** The dev server's HMR channel — either `.ws` (Vite ≤5) or `.hot` (Vite 6+). */
|
|
30
35
|
interface OverlayChannel {
|
|
31
|
-
send: (payload: OverlayErrorPayload) => void;
|
|
36
|
+
send: (payload: OverlayErrorPayload | { type: "full-reload" }) => void;
|
|
32
37
|
}
|
|
33
|
-
|
|
38
|
+
|
|
39
|
+
/** A node in a Vite environment's module graph; only its identity matters. */
|
|
40
|
+
interface DevModuleNode {
|
|
41
|
+
id: string | null;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The dev-server slice the integration keeps: the overlay channel, and every
|
|
46
|
+
* Vite environment's module graph for the content re-sync (structurally
|
|
47
|
+
* typed, like every Blume-authored Vite plugin).
|
|
48
|
+
*/
|
|
49
|
+
interface DevServer {
|
|
50
|
+
environments: Record<
|
|
51
|
+
string,
|
|
52
|
+
{
|
|
53
|
+
moduleGraph: {
|
|
54
|
+
getModuleById: (id: string) => DevModuleNode | undefined;
|
|
55
|
+
invalidateModule: (mod: never) => void;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
>;
|
|
34
59
|
hot?: OverlayChannel;
|
|
35
60
|
ws?: OverlayChannel;
|
|
36
61
|
}
|
|
37
62
|
|
|
63
|
+
/** The dev server's file watcher, as far as the data-store watch uses it. */
|
|
64
|
+
interface WatchedServer {
|
|
65
|
+
watcher: {
|
|
66
|
+
on: (event: "add" | "change", listener: (path: string) => void) => void;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
38
70
|
/** The parameters Astro hands `astro:server:setup`. */
|
|
39
71
|
type ServerSetupParams = Parameters<
|
|
40
72
|
NonNullable<AstroIntegration["hooks"]["astro:server:setup"]>
|
|
@@ -74,7 +106,7 @@ interface DevNegotiation {
|
|
|
74
106
|
interface DevServerRegistry {
|
|
75
107
|
buildProject: BlumeProject | null;
|
|
76
108
|
negotiation: DevNegotiation | null;
|
|
77
|
-
overlay:
|
|
109
|
+
overlay: DevServer | null;
|
|
78
110
|
refreshContent: RefreshContent | null;
|
|
79
111
|
}
|
|
80
112
|
|
|
@@ -155,6 +187,64 @@ export const publishDevNegotiation = (
|
|
|
155
187
|
: null;
|
|
156
188
|
};
|
|
157
189
|
|
|
190
|
+
/** A dev server's HMR channel: `.ws`, or `.hot` where only that exists. */
|
|
191
|
+
const overlayChannelOf = (
|
|
192
|
+
server: DevServer | null
|
|
193
|
+
): OverlayChannel | undefined => server?.ws ?? server?.hot;
|
|
194
|
+
|
|
195
|
+
/** Astro's content-layer data store, a virtual module in each environment. */
|
|
196
|
+
const DATA_STORE_MODULE_ID = "\0astro:data-layer-content";
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Invalidate Astro's data store in every Vite environment, then reload the
|
|
200
|
+
* browser. Astro invalidates it after a sync in the `ssr` environment only,
|
|
201
|
+
* which is where pages render on most adapters. With `@astrojs/cloudflare`
|
|
202
|
+
* the `ssr` environment runs in workerd and the prerendered pages (every
|
|
203
|
+
* content page) render in the `prerender` environment, whose copy of the
|
|
204
|
+
* store then stayed at its startup snapshot: a page added in dev resolved
|
|
205
|
+
* its route but `getEntry` still missed it, so it 404ed until a restart.
|
|
206
|
+
*/
|
|
207
|
+
const invalidateDataStore = (server: DevServer): void => {
|
|
208
|
+
for (const { moduleGraph } of Object.values(server.environments)) {
|
|
209
|
+
const mod = moduleGraph.getModuleById(DATA_STORE_MODULE_ID);
|
|
210
|
+
if (mod) {
|
|
211
|
+
// SAFETY: the node came out of this same module graph; `never` only
|
|
212
|
+
// reflects that the structural slice doesn't model the node type.
|
|
213
|
+
moduleGraph.invalidateModule(mod as never);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
// Astro reloaded the browser when the store was written, which can land
|
|
217
|
+
// before the invalidation above; reload again so no page renders the
|
|
218
|
+
// stale copy.
|
|
219
|
+
overlayChannelOf(server)?.send({ type: "full-reload" });
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Where Astro keeps the dev content store: `data-store.json` in the root's
|
|
224
|
+
* `.astro/` directory. Astro reloads its virtual module from this file.
|
|
225
|
+
*/
|
|
226
|
+
const devDataStoreFile = (root: URL): string =>
|
|
227
|
+
fileURLToPath(new URL(".astro/data-store.json", root));
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Invalidate the data store in every environment whenever Astro rewrites it.
|
|
231
|
+
* Astro's own file watcher updates the store on a content edit — a `.md`
|
|
232
|
+
* page's rendered body lives in it — but invalidates the module in `ssr`
|
|
233
|
+
* only, so with `@astrojs/cloudflare` a body edit stayed stale in
|
|
234
|
+
* `prerender` until something structural re-synced it. Keyed on the store
|
|
235
|
+
* write rather than Blume's regeneration, which can finish first.
|
|
236
|
+
*/
|
|
237
|
+
const watchDataStore = (server: DevServer & WatchedServer, root: URL): void => {
|
|
238
|
+
const file = devDataStoreFile(root);
|
|
239
|
+
const onWrite = (path: string): void => {
|
|
240
|
+
if (path === file) {
|
|
241
|
+
invalidateDataStore(server);
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
server.watcher.on("add", onWrite);
|
|
245
|
+
server.watcher.on("change", onWrite);
|
|
246
|
+
};
|
|
247
|
+
|
|
158
248
|
/**
|
|
159
249
|
* Re-run Astro's content-layer loaders against the live dev server. Returns
|
|
160
250
|
* `false` when no server has registered one — before the first
|
|
@@ -165,20 +255,21 @@ export const publishDevNegotiation = (
|
|
|
165
255
|
* stale store and the moved page 404s.
|
|
166
256
|
*/
|
|
167
257
|
export const refreshBlumeContent = async (): Promise<boolean> => {
|
|
168
|
-
const { refreshContent } = registry();
|
|
258
|
+
const { overlay, refreshContent } = registry();
|
|
169
259
|
if (!refreshContent) {
|
|
170
260
|
return false;
|
|
171
261
|
}
|
|
172
262
|
// No loader filter: every collection re-syncs (the docs glob and any
|
|
173
263
|
// staged collection alike).
|
|
174
264
|
await refreshContent({});
|
|
265
|
+
if (overlay) {
|
|
266
|
+
invalidateDataStore(overlay);
|
|
267
|
+
}
|
|
175
268
|
return true;
|
|
176
269
|
};
|
|
177
270
|
|
|
178
|
-
const overlayChannel = (): OverlayChannel | undefined =>
|
|
179
|
-
|
|
180
|
-
return overlay?.ws ?? overlay?.hot;
|
|
181
|
-
};
|
|
271
|
+
const overlayChannel = (): OverlayChannel | undefined =>
|
|
272
|
+
overlayChannelOf(registry().overlay);
|
|
182
273
|
|
|
183
274
|
/**
|
|
184
275
|
* Surface Blume's own diagnostics (config/frontmatter/content errors) in the
|
|
@@ -237,8 +328,9 @@ export interface BlumeIntegrationOptions {
|
|
|
237
328
|
/**
|
|
238
329
|
* Homepage `Link` header value for agent discovery (see
|
|
239
330
|
* `ai/link-headers.ts`); the dev-server counterpart of the `_headers` /
|
|
240
|
-
* Vercel-config emission, so `curl -I` against `blume dev` shows
|
|
241
|
-
*
|
|
331
|
+
* Vercel-config emission, so `curl -I` against `blume dev` shows it too —
|
|
332
|
+
* built for the `"dev"` surface, which leaves out the targets only a build
|
|
333
|
+
* writes. Published the same way as `contentRoutes`.
|
|
242
334
|
*/
|
|
243
335
|
homeLinkHeader?: string;
|
|
244
336
|
/**
|
|
@@ -249,6 +341,13 @@ export interface BlumeIntegrationOptions {
|
|
|
249
341
|
* its already-scanned project instead.
|
|
250
342
|
*/
|
|
251
343
|
buildArtifactsRoot?: string;
|
|
344
|
+
/**
|
|
345
|
+
* The pattern redirects (`/beta/:slug*`), compiled against base-less
|
|
346
|
+
* request paths (see `core/redirect-patterns.ts`). Astro's own `redirects`
|
|
347
|
+
* carry only the exact ones, since it can't prerender a pattern's pages, so
|
|
348
|
+
* the dev server answers these itself.
|
|
349
|
+
*/
|
|
350
|
+
redirects?: CompiledRedirect[];
|
|
252
351
|
}
|
|
253
352
|
|
|
254
353
|
/**
|
|
@@ -279,7 +378,8 @@ const isHomeUrl = (rawUrl: string | undefined): boolean => {
|
|
|
279
378
|
* variant falls back to the synthesized llms.txt mirror when it's a landing
|
|
280
379
|
* page (see `markdownRoutePaths`). The same
|
|
281
380
|
* middleware also stamps the homepage agent-discovery `Link` header, mirroring
|
|
282
|
-
* what the deployed site sends via `_headers` / the Vercel routing config
|
|
381
|
+
* what the deployed site sends via `_headers` / the Vercel routing config
|
|
382
|
+
* minus the targets the dev server doesn't serve.
|
|
283
383
|
*
|
|
284
384
|
* Request URLs arrive base-less: Astro unshifts its own dev middlewares (base,
|
|
285
385
|
* trailing slash, route guard) ahead of this one from its post-`configureServer`
|
|
@@ -309,6 +409,23 @@ const negotiateMarkdown =
|
|
|
309
409
|
next();
|
|
310
410
|
};
|
|
311
411
|
|
|
412
|
+
/**
|
|
413
|
+
* Answer a pattern redirect in dev with its configured status, the way the
|
|
414
|
+
* server wrappers do in a build. Request URLs arrive base-less (see
|
|
415
|
+
* {@link negotiateMarkdown}), and the patterns were based to match.
|
|
416
|
+
*/
|
|
417
|
+
const answerPatternRedirects =
|
|
418
|
+
(redirects: readonly CompiledRedirect[]) =>
|
|
419
|
+
(req: IncomingMessage, res: ServerResponse, next: () => void): void => {
|
|
420
|
+
const answer = matchCompiledRedirect(redirects, requestPath(req.url ?? ""));
|
|
421
|
+
if (!answer) {
|
|
422
|
+
next();
|
|
423
|
+
return;
|
|
424
|
+
}
|
|
425
|
+
res.writeHead(answer[1], { Location: answer[0] });
|
|
426
|
+
res.end();
|
|
427
|
+
};
|
|
428
|
+
|
|
312
429
|
/** The `.d.ts` the integration injects for the `blume:*` virtual modules. */
|
|
313
430
|
const MODULE_TYPES_FILE = "modules.d.ts";
|
|
314
431
|
|
|
@@ -351,9 +468,11 @@ export const blumeIntegration = (
|
|
|
351
468
|
return;
|
|
352
469
|
}
|
|
353
470
|
// `dir` is what Astro reports as the client output — `dist/`, or
|
|
354
|
-
// `dist/client` for a server build
|
|
355
|
-
//
|
|
356
|
-
//
|
|
471
|
+
// `dist/client` for a server build (`dist/client/<base>/` once
|
|
472
|
+
// `@astrojs/cloudflare` moves it under the base, whose `_headers` the
|
|
473
|
+
// writer places at the root served above it) — which is what the
|
|
474
|
+
// platform serves (the Vercel adapter copies it into its Build Output
|
|
475
|
+
// static tree in a later hook).
|
|
357
476
|
await publishBuildArtifacts(project, fileURLToPath(dir), logger);
|
|
358
477
|
},
|
|
359
478
|
"astro:config:done": ({ config, injectTypes }) => {
|
|
@@ -399,6 +518,10 @@ export const blumeIntegration = (
|
|
|
399
518
|
const shared = registry();
|
|
400
519
|
shared.overlay = server;
|
|
401
520
|
shared.refreshContent = refreshContent ?? null;
|
|
521
|
+
// `astro:config:done` always runs first; the root locates the store.
|
|
522
|
+
if (astroRoot) {
|
|
523
|
+
watchDataStore(server, astroRoot);
|
|
524
|
+
}
|
|
402
525
|
// Prepend so the rewrite happens before Astro's own request handler,
|
|
403
526
|
// letting the rewritten URL resolve to the `.md` endpoint.
|
|
404
527
|
server.middlewares.stack.unshift({
|
|
@@ -408,6 +531,12 @@ export const blumeIntegration = (
|
|
|
408
531
|
}),
|
|
409
532
|
route: "",
|
|
410
533
|
});
|
|
534
|
+
if (options.redirects) {
|
|
535
|
+
server.middlewares.stack.unshift({
|
|
536
|
+
handle: answerPatternRedirects(options.redirects),
|
|
537
|
+
route: "",
|
|
538
|
+
});
|
|
539
|
+
}
|
|
411
540
|
},
|
|
412
541
|
},
|
|
413
542
|
name: "blume",
|
|
@@ -75,6 +75,12 @@ declare module "blume:features" {
|
|
|
75
75
|
| null;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
declare module "blume:consent-client" {
|
|
79
|
+
export const startConsentClient: (
|
|
80
|
+
consent: import("blume/components/layout/consent/types.ts").BlumeConsent
|
|
81
|
+
) => void;
|
|
82
|
+
}
|
|
83
|
+
|
|
78
84
|
declare module "blume:search-client" {
|
|
79
85
|
export const createSearch: () =>
|
|
80
86
|
| import("blume/components/layout/search/types.ts").SearchFn
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
* generated pages through aliases or relative paths. `generateRuntime` now
|
|
9
9
|
* publishes them here and `runtimeModulesPlugin` serves them to Vite as
|
|
10
10
|
* virtual modules, so a regeneration never round-trips the disk or waits on a
|
|
11
|
-
* file watcher: publishing invalidates the changed modules in every
|
|
12
|
-
* server (Vite walks the importers, so the
|
|
13
|
-
* on the next request) and asks the
|
|
14
|
-
*
|
|
15
|
-
* watch debounce.
|
|
11
|
+
* file watcher: publishing invalidates the changed modules in every Vite
|
|
12
|
+
* environment of every live dev server (Vite walks the importers, so the
|
|
13
|
+
* pages that render them re-evaluate on the next request) and asks the
|
|
14
|
+
* browser to reload — the same effect a JSON file change used to reach
|
|
15
|
+
* through the watcher, minus the write and the watch debounce.
|
|
16
16
|
*
|
|
17
17
|
* The registry hangs off `globalThis`, not module state. On a published
|
|
18
18
|
* install the CLI bundle (`dist/cli`) carries its own copy of this module,
|
|
@@ -61,18 +61,29 @@ interface RuntimeModuleNode {
|
|
|
61
61
|
id: string | null;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
+
/** One Vite environment's module graph, as far as the registry touches it. */
|
|
65
|
+
interface RuntimeModuleGraph {
|
|
66
|
+
getModuleById: (id: string) => RuntimeModuleNode | undefined;
|
|
67
|
+
invalidateModule: (mod: RuntimeModuleNode) => void;
|
|
68
|
+
}
|
|
69
|
+
|
|
64
70
|
/**
|
|
65
71
|
* The Vite dev-server slice the registry touches (structurally typed, like
|
|
66
72
|
* every Blume-authored Vite plugin — see `includeHmrPlugin`).
|
|
67
73
|
*/
|
|
68
74
|
export interface RuntimeModuleServer {
|
|
75
|
+
/**
|
|
76
|
+
* Every Vite environment, each with its own module graph. `moduleGraph` on
|
|
77
|
+
* the server itself is Vite's backward-compatible view of only `client`
|
|
78
|
+
* and `ssr`, and those are not the only environments that render: with
|
|
79
|
+
* `@astrojs/cloudflare` the `ssr` environment runs in workerd, so Astro
|
|
80
|
+
* renders the prerendered pages (every content page) in its `prerender`
|
|
81
|
+
* environment instead.
|
|
82
|
+
*/
|
|
83
|
+
environments: Record<string, { moduleGraph: RuntimeModuleGraph }>;
|
|
69
84
|
httpServer?: {
|
|
70
85
|
once: (event: "close", listener: () => void) => void;
|
|
71
86
|
} | null;
|
|
72
|
-
moduleGraph: {
|
|
73
|
-
getModuleById: (id: string) => RuntimeModuleNode | undefined;
|
|
74
|
-
invalidateModule: (mod: RuntimeModuleNode) => void;
|
|
75
|
-
};
|
|
76
87
|
ws: { send: (payload: { type: "full-reload" }) => void };
|
|
77
88
|
}
|
|
78
89
|
|
|
@@ -131,10 +142,14 @@ export const publishRuntimeModules = (
|
|
|
131
142
|
return changed;
|
|
132
143
|
}
|
|
133
144
|
for (const server of servers) {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
145
|
+
// Every environment that loaded a module holds its own copy, and any of
|
|
146
|
+
// them may be the one rendering pages on this adapter.
|
|
147
|
+
for (const { moduleGraph } of Object.values(server.environments)) {
|
|
148
|
+
for (const id of changed) {
|
|
149
|
+
const mod = moduleGraph.getModuleById(`${RESOLVED_PREFIX}${id}`);
|
|
150
|
+
if (mod) {
|
|
151
|
+
moduleGraph.invalidateModule(mod);
|
|
152
|
+
}
|
|
138
153
|
}
|
|
139
154
|
}
|
|
140
155
|
server.ws.send({ type: "full-reload" });
|