blume 2.0.3 → 2.1.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 +1 -0
- package/CHANGELOG.md +142 -0
- package/README.md +1 -1
- package/dist/cli/{chunk-5f86nr5m.js → chunk-073rdvgb.js} +21 -48
- package/dist/cli/{chunk-5f86nr5m.js.map → chunk-073rdvgb.js.map} +4 -5
- package/dist/cli/{chunk-ga0pf4aj.js → chunk-0n9xkp3d.js} +12 -3
- package/dist/cli/{chunk-ga0pf4aj.js.map → chunk-0n9xkp3d.js.map} +3 -3
- package/dist/cli/chunk-150jk7km.js +52 -0
- package/dist/cli/chunk-150jk7km.js.map +10 -0
- package/dist/cli/{chunk-9t7a85s3.js → chunk-313vnn40.js} +30 -19
- package/dist/cli/chunk-313vnn40.js.map +10 -0
- package/dist/cli/{chunk-tkacnehg.js → chunk-3v3ffbrj.js} +2 -2
- package/dist/cli/{chunk-q58y5e6a.js → chunk-3x6x3pph.js} +46 -24
- package/dist/cli/chunk-3x6x3pph.js.map +10 -0
- package/dist/cli/{chunk-1d7ve1dm.js → chunk-42t4jxdx.js} +37 -5
- package/dist/cli/chunk-42t4jxdx.js.map +12 -0
- package/dist/cli/{chunk-8ktnccpt.js → chunk-54ztw1nj.js} +21 -2
- package/dist/cli/chunk-54ztw1nj.js.map +10 -0
- package/dist/cli/{chunk-hm3vjy5s.js → chunk-5vjtgs6e.js} +28 -10
- package/dist/cli/{chunk-hm3vjy5s.js.map → chunk-5vjtgs6e.js.map} +4 -4
- package/dist/cli/chunk-66w9j7p6.js +322 -0
- package/dist/cli/chunk-66w9j7p6.js.map +14 -0
- package/dist/cli/{chunk-2hsdwb9n.js → chunk-7ppf1rva.js} +34 -18
- package/dist/cli/chunk-7ppf1rva.js.map +10 -0
- package/dist/cli/{chunk-r9rcc4w7.js → chunk-8y2kmjv8.js} +7 -7
- package/dist/cli/{chunk-r20tn01b.js → chunk-c1y538kd.js} +8 -2
- package/dist/cli/{chunk-r20tn01b.js.map → chunk-c1y538kd.js.map} +3 -3
- package/dist/cli/{chunk-2eytanqx.js → chunk-c887fj0s.js} +2 -2
- package/dist/cli/{chunk-p3v96n38.js → chunk-cfyg47zg.js} +16 -6
- package/dist/cli/chunk-cfyg47zg.js.map +10 -0
- package/dist/cli/chunk-cm89scdv.js +443 -0
- package/dist/cli/chunk-cm89scdv.js.map +11 -0
- package/dist/cli/{chunk-akbpwfxc.js → chunk-dzwehpy7.js} +2 -2
- package/dist/cli/{chunk-wrr3j9w9.js → chunk-e6atmn4h.js} +299 -72
- package/dist/cli/chunk-e6atmn4h.js.map +36 -0
- package/dist/cli/{chunk-tzmab476.js → chunk-e8xw9qkh.js} +8 -6
- package/dist/cli/{chunk-tzmab476.js.map → chunk-e8xw9qkh.js.map} +3 -3
- package/dist/cli/{chunk-6dsbexzp.js → chunk-e9q7a2ak.js} +17 -15
- package/dist/cli/{chunk-6dsbexzp.js.map → chunk-e9q7a2ak.js.map} +2 -2
- package/dist/cli/{chunk-pv29h0wf.js → chunk-ehweg4fr.js} +5155 -1249
- package/dist/cli/chunk-ehweg4fr.js.map +218 -0
- package/dist/cli/{chunk-c8chx29p.js → chunk-ep6nd0rn.js} +390 -318
- package/dist/cli/chunk-ep6nd0rn.js.map +36 -0
- package/dist/cli/{chunk-p73c0m7w.js → chunk-fdrkhpjy.js} +18 -15
- package/dist/cli/{chunk-p73c0m7w.js.map → chunk-fdrkhpjy.js.map} +3 -3
- package/dist/cli/{chunk-2z928egk.js → chunk-ft9vfys6.js} +5 -5
- package/dist/cli/{chunk-5m5nmvyq.js → chunk-gb420vvz.js} +316 -79
- package/dist/cli/chunk-gb420vvz.js.map +17 -0
- package/dist/cli/{chunk-vg9r4eb9.js → chunk-hebn0tpx.js} +86 -13
- package/dist/cli/chunk-hebn0tpx.js.map +14 -0
- package/dist/cli/{chunk-35d4wj9f.js → chunk-htrwgabr.js} +41 -23
- package/dist/cli/chunk-htrwgabr.js.map +15 -0
- package/dist/cli/{chunk-g4hq16wv.js → chunk-hx3xqnk9.js} +16 -14
- package/dist/cli/{chunk-g4hq16wv.js.map → chunk-hx3xqnk9.js.map} +2 -2
- package/dist/cli/chunk-j134vrp2.js +65 -0
- package/dist/cli/chunk-j134vrp2.js.map +10 -0
- package/dist/cli/{chunk-a58773jm.js → chunk-kma9f6sf.js} +2 -2
- package/dist/cli/chunk-kwrg63tm.js +31 -0
- package/dist/cli/chunk-kwrg63tm.js.map +10 -0
- package/dist/cli/{chunk-ey84smr6.js → chunk-mrcccgnh.js} +6 -6
- package/dist/cli/{chunk-ey84smr6.js.map → chunk-mrcccgnh.js.map} +1 -1
- package/dist/cli/{chunk-yfyb25rh.js → chunk-n0v7m8ry.js} +24 -8
- package/dist/cli/chunk-n0v7m8ry.js.map +14 -0
- package/dist/cli/{chunk-j85vccga.js → chunk-ncj7w596.js} +576 -367
- package/dist/cli/chunk-ncj7w596.js.map +35 -0
- package/dist/cli/{chunk-5xvm6tfj.js → chunk-nq1d20w2.js} +17 -15
- package/dist/cli/{chunk-5xvm6tfj.js.map → chunk-nq1d20w2.js.map} +2 -2
- package/dist/cli/{chunk-pehfxfta.js → chunk-nrns10mj.js} +6 -98
- package/dist/cli/chunk-nrns10mj.js.map +10 -0
- package/dist/cli/{chunk-crgn1q09.js → chunk-sds923fa.js} +4 -4
- package/dist/cli/chunk-t2m5j4pr.js +104 -0
- package/dist/cli/chunk-t2m5j4pr.js.map +11 -0
- package/dist/cli/{chunk-acanzt5p.js → chunk-tdqhyxfz.js} +6 -6
- package/dist/cli/chunk-tphac74f.js +126 -0
- package/dist/cli/chunk-tphac74f.js.map +11 -0
- package/dist/cli/chunk-w1r4vase.js +18 -0
- package/dist/cli/chunk-w1r4vase.js.map +10 -0
- package/dist/cli/{chunk-3em5wd2y.js → chunk-zccbjcj0.js} +4 -3
- package/dist/cli/{chunk-3em5wd2y.js.map → chunk-zccbjcj0.js.map} +2 -2
- package/dist/cli/index.js +31 -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 +26 -0
- package/dist/types/ai/ask.d.ts +271 -58
- package/dist/types/ai/component-markdown.d.ts +2 -0
- package/dist/types/ai/index.d.ts +2 -2
- package/dist/types/ai/openapi-components.d.ts +4 -1
- package/dist/types/ai/site-skill.d.ts +26 -0
- package/dist/types/ai/skills.d.ts +16 -0
- package/dist/types/astro/integration.d.ts +9 -0
- package/dist/types/astro/markdown-negotiation.d.ts +3 -0
- package/dist/types/astro/pages.d.ts +10 -0
- 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/cli/init/scaffold.d.ts +1 -1
- package/dist/types/components/content/api-field.d.ts +62 -0
- package/dist/types/components/content/api-page.d.ts +100 -0
- package/dist/types/components/layout/nav-utils.d.ts +26 -0
- package/dist/types/components/openapi/code-samples.d.ts +29 -0
- package/dist/types/components/openapi/helpers.d.ts +158 -0
- package/dist/types/components/openapi/security.d.ts +95 -0
- package/dist/types/components/openapi/snippets.d.ts +60 -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/changelog-index.d.ts +8 -0
- package/dist/types/core/config-input.d.ts +217 -23
- package/dist/types/core/data.d.ts +53 -4
- package/dist/types/core/footer.d.ts +8 -0
- package/dist/types/core/i18n-ui.d.ts +88 -0
- package/dist/types/core/includes.d.ts +8 -2
- package/dist/types/core/links.d.ts +8 -0
- package/dist/types/core/localizable.d.ts +7 -0
- package/dist/types/core/page-modes.d.ts +29 -0
- package/dist/types/core/probe.d.ts +2 -0
- package/dist/types/core/project-graph.d.ts +6 -0
- package/dist/types/core/redirect-patterns.d.ts +152 -0
- package/dist/types/core/related.d.ts +40 -0
- package/dist/types/core/schema.d.ts +670 -56
- package/dist/types/core/sources/cache.d.ts +3 -0
- package/dist/types/core/sources/contentful-rich-text.d.ts +11 -2
- package/dist/types/core/sources/contentful.d.ts +17 -1
- package/dist/types/core/sources/lexical.d.ts +5 -0
- package/dist/types/core/sources/normalize.d.ts +20 -1
- package/dist/types/core/sources/read.d.ts +5 -0
- package/dist/types/core/sources/remote.d.ts +37 -10
- package/dist/types/core/sources/sanity.d.ts +1 -1
- package/dist/types/core/types.d.ts +18 -1
- package/dist/types/core/variables.d.ts +42 -0
- package/dist/types/deploy/adapter-output.d.ts +2 -1
- package/dist/types/deploy/adapters/cloudflare.d.ts +7 -5
- package/dist/types/deploy/adapters/node.d.ts +58 -23
- package/dist/types/deploy/adapters/registry.d.ts +10 -0
- package/dist/types/deploy/adapters/types.d.ts +3 -2
- package/dist/types/deploy/node-headers.d.ts +13 -2
- package/dist/types/deploy/platforms/cloudflare.d.ts +15 -7
- package/dist/types/deploy/platforms/netlify.d.ts +7 -0
- package/dist/types/deploy/platforms/node.d.ts +3 -1
- package/dist/types/deploy/platforms/types.d.ts +18 -7
- package/dist/types/deploy/platforms/vercel.d.ts +26 -1
- package/dist/types/deploy/redirects.d.ts +55 -11
- package/dist/types/deploy/sitemap.d.ts +2 -1
- package/dist/types/deploy/vercel-negotiation.d.ts +51 -21
- package/dist/types/markdown/code-title.d.ts +17 -0
- package/dist/types/markdown/features.d.ts +3 -2
- 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/checks.d.ts +27 -0
- package/dist/types/openapi/graphql.d.ts +6 -0
- package/dist/types/openapi/model.d.ts +27 -10
- package/dist/types/openapi/overlay.d.ts +54 -0
- package/dist/types/openapi/parse.d.ts +16 -0
- package/dist/types/openapi/references.d.ts +30 -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 +119 -0
- package/dist/types/ratelimit/upstash.d.ts +46 -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 +89 -11
- package/dist/types/reference/index.d.ts +1 -1
- package/dist/types/reference/openapi.d.ts +33 -12
- package/dist/types/reference/options.d.ts +82 -6
- package/dist/types/reference/scalar.d.ts +13 -0
- package/dist/types/reference/schema.d.ts +144 -36
- package/dist/types/search/adapters/registry.d.ts +3 -0
- package/dist/types/search/adapters/typesense.d.ts +14 -4
- package/dist/types/search/build.d.ts +3 -1
- package/dist/types/search/documents.d.ts +12 -1
- package/dist/types/search/orama-index.d.ts +13 -9
- package/dist/types/search/sync/algolia.d.ts +5 -2
- package/dist/types/search/sync/index.d.ts +3 -1
- package/dist/types/search/sync/typesense.d.ts +11 -7
- package/dist/types/seo/metatags.d.ts +20 -0
- package/dist/types/sources/contentful.d.ts +16 -0
- package/dist/types/sources/github-releases.d.ts +8 -1
- package/dist/types/sources/payload.d.ts +2 -0
- package/dist/types/sources/registry.d.ts +54 -0
- package/dist/types/sources/shared.d.ts +3 -0
- package/dist/types/sources/strapi.d.ts +2 -0
- package/docs/01-quickstart.mdx +4 -2
- package/docs/02-deployment.mdx +71 -17
- package/docs/03-upgrading.mdx +4 -4
- package/docs/04-migrating.mdx +1 -1
- package/docs/advanced/changelog.mdx +13 -2
- package/docs/advanced/skills.mdx +15 -1
- package/docs/cli/audit.mdx +51 -8
- package/docs/cli/doctor.mdx +5 -1
- package/docs/cli/evals.mdx +4 -4
- package/docs/cli/index.mdx +1 -0
- package/docs/cli/translate.mdx +1 -0
- package/docs/cli/validate.mdx +4 -3
- package/docs/configuration/analytics.mdx +3 -1
- package/docs/configuration/assistant.mdx +194 -38
- package/docs/configuration/consent.mdx +100 -0
- package/docs/configuration/customization.mdx +8 -6
- package/docs/configuration/export.mdx +5 -3
- package/docs/configuration/index.mdx +64 -5
- package/docs/configuration/meta.ts +3 -0
- package/docs/configuration/narration.mdx +119 -0
- package/docs/configuration/rate-limiting.mdx +90 -0
- package/docs/configuration/search.mdx +63 -12
- package/docs/configuration/theming.mdx +3 -1
- package/docs/content/components.mdx +108 -2
- package/docs/content/frontmatter.mdx +80 -2
- package/docs/content/i18n.mdx +39 -4
- package/docs/content/includes.mdx +16 -0
- package/docs/content/meta.mdx +1 -0
- package/docs/content/meta.ts +1 -0
- package/docs/content/navigation.mdx +32 -10
- package/docs/content/sources/contentful.mdx +35 -0
- package/docs/content/sources/custom.mdx +43 -0
- package/docs/content/sources/github-releases.mdx +39 -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 +31 -0
- package/docs/content/sources/remote-mdx.mdx +44 -0
- package/docs/content/sources/sanity.mdx +29 -0
- package/docs/content/sources/strapi.mdx +32 -0
- package/docs/content/syntax.mdx +69 -4
- package/docs/content/variables.mdx +41 -0
- package/docs/discoverability/agent-discovery.mdx +29 -2
- package/docs/discoverability/index.mdx +2 -2
- package/docs/discoverability/json-api.mdx +2 -0
- package/docs/discoverability/llms-txt.mdx +2 -2
- package/docs/discoverability/markdown.mdx +3 -1
- package/docs/discoverability/mcp.mdx +4 -0
- package/docs/discoverability/metadata.mdx +17 -0
- package/docs/discoverability/sitemap-and-robots.mdx +1 -1
- package/docs/references/api-pages.mdx +74 -0
- package/docs/references/asyncapi.mdx +4 -2
- package/docs/references/graphql.mdx +14 -2
- package/docs/references/meta.ts +1 -1
- package/docs/references/openapi.mdx +148 -7
- package/docs/references/scalar.mdx +3 -1
- package/package.json +43 -8
- package/skills/blume/SKILL.md +3 -0
- package/skills/blume-migrate/SKILL.md +6 -6
- package/skills/blume-migrate/references/docusaurus.md +7 -7
- package/skills/blume-migrate/references/fumadocs.md +17 -13
- package/skills/blume-migrate/references/mintlify.md +37 -19
- package/skills/blume-migrate/references/nextra.md +10 -7
- package/skills/blume-migrate/references/starlight.md +11 -8
- package/skills/blume-migrate/scripts/mintlify-codemod.mjs +60 -14
- package/skills/blume-write-skill/SKILL.md +82 -0
- package/src/ai/agent-readability.ts +2 -1
- package/src/ai/agent-surface.ts +9 -7
- package/src/ai/ai-catalog.ts +6 -3
- package/src/ai/ask-context.ts +103 -20
- package/src/ai/ask-data.ts +6 -0
- package/src/ai/ask-limits.ts +13 -0
- package/src/ai/ask-tools.ts +142 -0
- package/src/ai/ask.ts +354 -76
- package/src/ai/changelog-markdown.ts +11 -6
- package/src/ai/component-markdown.ts +76 -1
- package/src/ai/cors.ts +14 -3
- package/src/ai/index.ts +12 -0
- package/src/ai/llms.ts +6 -2
- package/src/ai/markdown.ts +2 -1
- package/src/ai/mcp/data.ts +6 -0
- package/src/ai/mcp/query.ts +14 -6
- package/src/ai/openapi-components.ts +36 -6
- package/src/ai/relative-links.ts +4 -38
- package/src/ai/site-skill.ts +274 -0
- package/src/ai/skills.ts +35 -2
- package/src/ai/write-skill.ts +97 -0
- package/src/astro/generate.ts +210 -66
- package/src/astro/index.ts +1 -0
- package/src/astro/integration.ts +42 -4
- package/src/astro/markdown-negotiation.ts +3 -0
- package/src/astro/module-types.ts +9 -1
- package/src/astro/pages.ts +23 -0
- package/src/astro/templates.ts +406 -108
- package/src/astro/variables.ts +31 -0
- package/src/audit/catalog.ts +38 -3
- 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 +19 -13
- package/src/audit/checks/network.ts +110 -6
- package/src/audit/checks/redirects.ts +6 -4
- package/src/audit/checks/robots.ts +58 -2
- package/src/audit/checks/sitemap.ts +2 -3
- package/src/audit/redirects.ts +46 -15
- package/src/audit/run.ts +5 -0
- package/src/audit/types.ts +4 -1
- package/src/audit/url.ts +14 -5
- package/src/blume-modules.d.ts +12 -1
- 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 +51 -0
- package/src/cli/build-failure.ts +23 -0
- package/src/cli/command-meta.ts +5 -0
- package/src/cli/commands/audit.ts +10 -1
- package/src/cli/commands/dev.ts +18 -2
- package/src/cli/commands/doctor.ts +67 -28
- package/src/cli/commands/eval.ts +36 -4
- package/src/cli/commands/init.ts +6 -4
- package/src/cli/commands/skill.ts +96 -0
- package/src/cli/commands/validate.ts +10 -1
- package/src/cli/index.ts +5 -0
- package/src/cli/init/scaffold.ts +3 -3
- package/src/cli/prepare.ts +6 -3
- package/src/cli/required-secrets.ts +72 -30
- package/src/components/BlumePage.astro +2 -0
- package/src/components/content/ApiEndpoint.astro +18 -0
- package/src/components/content/ApiField.astro +79 -0
- package/src/components/content/ApiPlayground.astro +66 -0
- package/src/components/content/ApiRail.astro +19 -0
- package/src/components/content/Color.astro +1 -0
- 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/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 +103 -0
- package/src/components/content/api-page.ts +248 -0
- package/src/components/content/mermaid-element.ts +15 -1
- 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 +104 -14
- package/src/components/islands/code-question.ts +62 -0
- package/src/components/islands/hooks.ts +136 -21
- package/src/components/islands/support-link.ts +68 -0
- package/src/components/layout/Analytics.astro +11 -2
- package/src/components/layout/Banner.astro +14 -10
- package/src/components/layout/Breadcrumbs.astro +6 -2
- 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/DrawerSwitchers.astro +51 -0
- package/src/components/layout/Empty.astro +2 -2
- package/src/components/layout/Header.astro +122 -80
- package/src/components/layout/LanguageSwitcher.astro +48 -15
- package/src/components/layout/NarrationPlayer.astro +1085 -0
- package/src/components/layout/NavSelector.astro +33 -7
- package/src/components/layout/PageActions.astro +139 -24
- package/src/components/layout/PageFeedback.astro +54 -49
- package/src/components/layout/PageLayout.astro +71 -3
- package/src/components/layout/ReferenceLayout.astro +17 -6
- package/src/components/layout/RelatedPages.astro +42 -0
- package/src/components/layout/RootLayout.astro +318 -47
- package/src/components/layout/Search.astro +47 -19
- package/src/components/layout/SiteFooter.astro +124 -0
- package/src/components/layout/SiteMetatags.astro +16 -0
- package/src/components/layout/TableOfContents.astro +24 -17
- 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/head-scripts.ts +6 -1
- 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/algolia.ts +10 -1
- package/src/components/layout/search/analytics.ts +126 -0
- package/src/components/layout/search/endpoint.ts +48 -5
- package/src/components/layout/search/flexsearch.ts +17 -5
- package/src/components/layout/search/orama-cloud.ts +26 -14
- package/src/components/layout/search/pagefind.ts +114 -5
- package/src/components/layout/search/types.ts +32 -0
- package/src/components/layout/search/typesense.ts +19 -3
- package/src/components/openapi/AsyncApiOperation.astro +14 -7
- package/src/components/openapi/Authorization.astro +10 -0
- package/src/components/openapi/GraphqlOperation.astro +5 -0
- package/src/components/openapi/Operation.astro +184 -13
- package/src/components/openapi/ParametersTable.astro +8 -4
- package/src/components/openapi/Playground.astro +7 -1
- package/src/components/openapi/RequestBody.astro +24 -5
- package/src/components/openapi/RequestPanel.astro +59 -7
- package/src/components/openapi/Responses.astro +7 -4
- package/src/components/openapi/SchemaTable.astro +15 -3
- package/src/components/openapi/async-snippets.ts +65 -9
- package/src/components/openapi/async.ts +123 -29
- package/src/components/openapi/code-samples.ts +97 -0
- package/src/components/openapi/graphql-helpers.ts +35 -12
- package/src/components/openapi/helpers.ts +36 -2
- package/src/components/openapi/message-model.ts +54 -11
- package/src/components/openapi/message.ts +14 -4
- package/src/components/openapi/operation-model.ts +16 -7
- package/src/components/openapi/playground-client.ts +24 -5
- package/src/components/openapi/playground-schema.ts +1 -1
- package/src/components/openapi/schema-tree.ts +44 -14
- package/src/components/openapi/security.ts +16 -3
- package/src/components/openapi/snippets.ts +873 -10
- package/src/components/openapi/validate-json.ts +4 -3
- 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/builtin-tags.ts +5 -0
- package/src/core/changelog-index.ts +31 -1
- package/src/core/client-address.ts +19 -0
- package/src/core/component-diagnostics.ts +53 -0
- package/src/core/component-overrides.ts +32 -0
- package/src/core/config-input.ts +225 -23
- package/src/core/data.ts +46 -4
- package/src/core/diagnostics.ts +8 -2
- package/src/core/footer.ts +26 -0
- package/src/core/graph.ts +39 -36
- package/src/core/i18n-ui.ts +84 -2
- package/src/core/includes.ts +21 -4
- package/src/core/links.ts +63 -19
- package/src/core/localizable.ts +26 -0
- package/src/core/navigation.ts +43 -12
- package/src/core/page-modes.ts +56 -0
- package/src/core/probe.ts +26 -6
- package/src/core/project-graph.ts +163 -16
- package/src/core/redirect-patterns.ts +520 -0
- package/src/core/related.ts +131 -0
- package/src/core/schema.ts +339 -66
- package/src/core/sources/cache.ts +6 -0
- package/src/core/sources/contentful-rich-text.ts +29 -6
- package/src/core/sources/contentful.ts +135 -25
- package/src/core/sources/filesystem.ts +26 -4
- package/src/core/sources/github-releases.ts +12 -1
- package/src/core/sources/lexical.ts +15 -10
- package/src/core/sources/mdx-remote.ts +62 -10
- package/src/core/sources/normalize.ts +228 -41
- package/src/core/sources/notion.ts +7 -1
- package/src/core/sources/obsidian.ts +16 -3
- package/src/core/sources/payload.ts +38 -15
- package/src/core/sources/read.ts +8 -3
- package/src/core/sources/remote.ts +72 -15
- package/src/core/sources/resolve.ts +11 -1
- package/src/core/sources/sanity.ts +43 -25
- package/src/core/sources/strapi.ts +2 -2
- package/src/core/types.ts +19 -1
- package/src/core/ui-packs/ar.ts +44 -0
- package/src/core/ui-packs/bg.ts +46 -0
- package/src/core/ui-packs/bn.ts +44 -0
- package/src/core/ui-packs/ca.ts +47 -0
- package/src/core/ui-packs/cs.ts +45 -0
- package/src/core/ui-packs/da.ts +46 -0
- package/src/core/ui-packs/de.ts +47 -0
- package/src/core/ui-packs/el.ts +46 -0
- package/src/core/ui-packs/es.ts +47 -0
- package/src/core/ui-packs/fa.ts +46 -0
- package/src/core/ui-packs/fi.ts +46 -0
- package/src/core/ui-packs/fr.ts +47 -0
- package/src/core/ui-packs/he.ts +44 -0
- package/src/core/ui-packs/hi.ts +45 -0
- package/src/core/ui-packs/hr.ts +46 -0
- package/src/core/ui-packs/hu.ts +45 -0
- package/src/core/ui-packs/id.ts +46 -0
- package/src/core/ui-packs/it.ts +46 -0
- package/src/core/ui-packs/ja.ts +46 -0
- package/src/core/ui-packs/ko.ts +45 -0
- package/src/core/ui-packs/nl.ts +47 -0
- package/src/core/ui-packs/no.ts +45 -0
- package/src/core/ui-packs/pl.ts +46 -0
- package/src/core/ui-packs/pt-br.ts +47 -0
- package/src/core/ui-packs/pt.ts +46 -0
- package/src/core/ui-packs/ro.ts +46 -0
- package/src/core/ui-packs/ru.ts +46 -0
- package/src/core/ui-packs/sk.ts +45 -0
- package/src/core/ui-packs/sr.ts +46 -0
- package/src/core/ui-packs/sv.ts +45 -0
- package/src/core/ui-packs/th.ts +44 -0
- package/src/core/ui-packs/tr.ts +46 -0
- package/src/core/ui-packs/uk.ts +46 -0
- package/src/core/ui-packs/vi.ts +46 -0
- package/src/core/ui-packs/zh-tw.ts +44 -0
- package/src/core/ui-packs/zh.ts +44 -0
- package/src/core/variables.ts +103 -0
- package/src/deploy/adapter-output.ts +7 -2
- package/src/deploy/adapters/cloudflare.ts +7 -5
- package/src/deploy/adapters/node.ts +47 -9
- package/src/deploy/adapters/types.ts +7 -3
- package/src/deploy/artifacts.ts +79 -9
- package/src/deploy/cloudflare-negotiation.ts +35 -5
- package/src/deploy/headers.ts +2 -1
- package/src/deploy/node-headers.ts +63 -9
- package/src/deploy/platforms/cloudflare.ts +45 -9
- package/src/deploy/platforms/netlify.ts +35 -2
- package/src/deploy/platforms/node.ts +12 -2
- package/src/deploy/platforms/types.ts +21 -7
- package/src/deploy/platforms/vercel.ts +149 -17
- package/src/deploy/redirects.ts +151 -24
- package/src/deploy/rss.ts +3 -1
- package/src/deploy/sitemap.ts +39 -5
- package/src/deploy/vercel-negotiation.ts +326 -102
- package/src/eval/agents.ts +18 -1
- package/src/eval/prompts.ts +6 -3
- package/src/eval/report.ts +34 -13
- package/src/eval/run.ts +5 -0
- package/src/markdown/api-rail.ts +259 -0
- package/src/markdown/code-title.ts +35 -9
- package/src/markdown/features.ts +3 -2
- package/src/markdown/fence-meta.ts +2 -0
- package/src/markdown/include.ts +11 -1
- package/src/markdown/index.ts +28 -5
- package/src/markdown/math.ts +4 -4
- package/src/markdown/relative-links.ts +3 -2
- 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 +7 -6
- package/src/openapi/checks.ts +273 -0
- package/src/openapi/graphql-build.ts +21 -0
- package/src/openapi/graphql.ts +11 -0
- package/src/openapi/model.ts +72 -27
- package/src/openapi/overlay.ts +256 -0
- package/src/openapi/parse.ts +182 -4
- package/src/openapi/references.ts +64 -8
- package/src/openapi/render-mdx.ts +5 -1
- package/src/openapi/scalar.ts +40 -6
- package/src/openapi/source.ts +40 -15
- 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 +247 -0
- package/src/ratelimit/schema.ts +28 -0
- package/src/ratelimit/upstash.ts +60 -0
- package/src/ratelimit/wrangler.ts +70 -0
- package/src/reference/asyncapi.ts +2 -2
- package/src/reference/graphql.ts +20 -3
- package/src/reference/index.ts +1 -0
- package/src/reference/openapi.ts +21 -7
- package/src/reference/options.ts +80 -8
- package/src/reference/scalar.ts +33 -8
- package/src/registry/eject.ts +23 -5
- package/src/registry/registry.ts +7 -0
- package/src/search/adapters/locale-scope.ts +30 -0
- package/src/search/adapters/typesense.ts +14 -4
- package/src/search/build.ts +21 -3
- package/src/search/documents.ts +26 -2
- package/src/search/orama-index.ts +191 -34
- package/src/search/pagefind-ranking.ts +39 -0
- package/src/search/source-pages.ts +29 -0
- package/src/search/sync/algolia.ts +111 -10
- package/src/search/sync/index.ts +52 -13
- package/src/search/sync/orama-cloud.ts +3 -0
- package/src/search/sync/typesense.ts +76 -26
- package/src/seo/metatags.ts +67 -0
- package/src/sources/contentful.ts +12 -0
- package/src/sources/github-releases.ts +7 -1
- package/src/sources/shared.ts +3 -0
- package/src/theme/chrome-icons.ts +1 -0
- package/src/theme/color.ts +500 -0
- package/src/theme/entry.ts +85 -6
- package/src/theme/palette.ts +121 -45
- package/src/translate/prompts.ts +1 -0
- package/src/translate/validate.ts +31 -3
- package/src/upgrade/upgrade.ts +4 -171
- package/dist/cli/chunk-1d7ve1dm.js.map +0 -12
- package/dist/cli/chunk-2hsdwb9n.js.map +0 -10
- package/dist/cli/chunk-35d4wj9f.js.map +0 -15
- package/dist/cli/chunk-364znk6q.js +0 -75
- package/dist/cli/chunk-364znk6q.js.map +0 -11
- package/dist/cli/chunk-5m5nmvyq.js.map +0 -13
- package/dist/cli/chunk-8ktnccpt.js.map +0 -10
- package/dist/cli/chunk-9t7a85s3.js.map +0 -10
- package/dist/cli/chunk-b07cmahc.js +0 -145
- package/dist/cli/chunk-b07cmahc.js.map +0 -11
- package/dist/cli/chunk-c8chx29p.js.map +0 -36
- package/dist/cli/chunk-e04dxsz1.js +0 -39
- package/dist/cli/chunk-e04dxsz1.js.map +0 -10
- package/dist/cli/chunk-j85vccga.js.map +0 -36
- package/dist/cli/chunk-p3v96n38.js.map +0 -10
- package/dist/cli/chunk-pehfxfta.js.map +0 -10
- package/dist/cli/chunk-pv29h0wf.js.map +0 -190
- package/dist/cli/chunk-q58y5e6a.js.map +0 -10
- package/dist/cli/chunk-vg9r4eb9.js.map +0 -14
- package/dist/cli/chunk-wrr3j9w9.js.map +0 -35
- package/dist/cli/chunk-yfyb25rh.js.map +0 -14
- package/docs/content/sources.mdx +0 -334
- /package/dist/cli/{chunk-tkacnehg.js.map → chunk-3v3ffbrj.js.map} +0 -0
- /package/dist/cli/{chunk-r9rcc4w7.js.map → chunk-8y2kmjv8.js.map} +0 -0
- /package/dist/cli/{chunk-2eytanqx.js.map → chunk-c887fj0s.js.map} +0 -0
- /package/dist/cli/{chunk-akbpwfxc.js.map → chunk-dzwehpy7.js.map} +0 -0
- /package/dist/cli/{chunk-2z928egk.js.map → chunk-ft9vfys6.js.map} +0 -0
- /package/dist/cli/{chunk-a58773jm.js.map → chunk-kma9f6sf.js.map} +0 -0
- /package/dist/cli/{chunk-crgn1q09.js.map → chunk-sds923fa.js.map} +0 -0
- /package/dist/cli/{chunk-acanzt5p.js.map → chunk-tdqhyxfz.js.map} +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/cli/commands/doctor.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { readFileSync } from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\n\nimport { defineCommand } from \"citty\";\nimport { join } from \"pathe\";\nimport { satisfies } from \"semver\";\n\nimport { discoverExamples } from \"../../astro/examples.ts\";\nimport { discoverIslands } from \"../../astro/islands.ts\";\nimport { discoverPages, navTargetRoutes } from \"../../astro/pages.ts\";\nimport { missingDependencyDiagnostic } from \"../../astro/runtime-deps.ts\";\nimport { missingExampleDiagnostics } from \"../../core/component-diagnostics.ts\";\nimport {\n analyzeComponentOverrides,\n ComponentOverridesError,\n} from \"../../core/component-overrides.ts\";\nimport { BlumeError } from \"../../core/diagnostics.ts\";\nimport { validateNavTargets } from \"../../core/nav-diagnostics.ts\";\nimport { packageRoot } from \"../../core/package-root.ts\";\nimport { scanProject } from \"../../core/project-graph.ts\";\nimport type { ResolvedConfig } from \"../../core/schema.ts\";\nimport { serverFeatures } from \"../../core/server-features.ts\";\nimport type { Diagnostic } from \"../../core/types.ts\";\nimport { unregisteredSnapshotDiagnostics } from \"../../core/version-cut.ts\";\nimport { commandMeta } from \"../command-meta.ts\";\nimport { loadEnvFiles } from \"../env.ts\";\nimport { reportInternalError } from \"../internal-error.ts\";\nimport {\n flushStdout,\n logger,\n reportDiagnostics,\n reportDiagnosticsJson,\n} from \"../log.ts\";\nimport { checkRequiredSecrets } from \"../required-secrets.ts\";\n\nconst FALLBACK_NODE_RANGE = \">=22.12.0\";\n\n/**\n * Plan `components.ts` the way `blume dev`/`build` do, reporting each override\n * that can't be planned — a non-static form, or an import of a file that\n * doesn't exist — with its own line. The scan alone never reads the file, so\n * without this doctor would pass a project whose build fails. Also returns\n * the MDX tags the file overrides.\n */\nconst componentsDiagnostics = async (\n componentsFile: string | null\n): Promise<{ issues: Diagnostic[]; mdx: string[] }> => {\n if (!componentsFile) {\n return { issues: [], mdx: [] };\n }\n try {\n const { mdx } = analyzeComponentOverrides(\n await readFile(componentsFile, \"utf-8\"),\n componentsFile\n );\n return { issues: [], mdx: mdx.map((entry) => entry.key) };\n } catch (error) {\n if (error instanceof ComponentOverridesError) {\n return { issues: error.issues, mdx: [] };\n }\n throw error;\n }\n};\n\n/** The supported Node range, read from the package's own `engines` field so\n * doctor can never drift from what the package actually declares. */\nconst supportedNodeRange = (): string => {\n try {\n // SAFETY: this parses blume's own package.json; the optional fields cover\n // an `engines` block going missing, and a bad read falls to the catch.\n const pkg = JSON.parse(\n readFileSync(join(packageRoot(), \"package.json\"), \"utf-8\")\n ) as { engines?: { node?: string } };\n return pkg.engines?.node || FALLBACK_NODE_RANGE;\n } catch {\n return FALLBACK_NODE_RANGE;\n }\n};\n\n/** The adapters a project runs, one line per kind, for the doctor summary. */\nconst integrationSummary = (config: ResolvedConfig): string[] => {\n const { assistant } = config.ai;\n let assistantSummary = \"off\";\n if (assistant?.enabled) {\n assistantSummary = assistant.endpoint\n ? \"external endpoint\"\n : assistant.provider.kind;\n }\n return [\n `References: ${config.reference.map((adapter) => adapter.kind).join(\", \") || \"none\"}`,\n `Analytics: ${config.analytics.map((adapter) => adapter.kind).join(\", \") || \"none\"}`,\n `Consent: ${config.consent?.kind ?? \"none\"}`,\n `Rate limiting: ${config.rateLimit?.kind ?? \"off\"}`,\n `Sources: ${config.content.sources.map((source) => source.kind).join(\", \")}`,\n `Assistant: ${assistantSummary}`,\n ];\n};\n\nexport const doctorCommand = defineCommand({\n args: {\n json: {\n description: \"Emit diagnostics as JSON on stdout (for CI/editors).\",\n type: \"boolean\",\n },\n },\n meta: commandMeta.doctor,\n async run({ args }) {\n const root = process.cwd();\n const diagnostics: Diagnostic[] = [];\n\n const nodeRange = supportedNodeRange();\n if (!satisfies(process.versions.node, nodeRange)) {\n diagnostics.push({\n code: \"BLUME_NODE_VERSION\",\n message: `Node ${process.versions.node} is outside the supported range (${nodeRange}).`,\n severity: \"warning\",\n });\n }\n\n // Read `.env` files first, as `blume dev`/`build` do: remote sources read\n // their tokens during the scan, and the secrets check below reads them too.\n loadEnvFiles(root);\n\n try {\n const project = await scanProject(root, {\n // A missing secret fails at the first request. Checked before the\n // sources fetch, so it's still reported when one of them fails the\n // scan for want of it.\n beforeSources: (config) => {\n diagnostics.push(...checkRequiredSecrets(config));\n },\n mode: \"build\",\n });\n // Tabs, selector items, and featured links can point at custom pages\n // and generated routes too, so they're checked against every route\n // the site serves, as `blume dev`/`build` check them.\n const userPages = project.context.pagesRoot\n ? await discoverPages(project.context.pagesRoot)\n : [];\n diagnostics.push(\n ...project.diagnostics,\n ...unregisteredSnapshotDiagnostics(project),\n ...validateNavTargets(\n project.graph.navigation,\n navTargetRoutes(project, userPages)\n )\n );\n\n const { config } = project;\n // The packages a build would need: an adapter's missing SDK fails the\n // build.\n const { islands } = await discoverIslands(root);\n const dependencies = await missingDependencyDiagnostic(\n config,\n root,\n \"error\",\n islands.map((island) => island.framework)\n );\n if (dependencies) {\n diagnostics.push(dependencies);\n }\n const overrides = await componentsDiagnostics(\n project.context.componentsFile\n );\n diagnostics.push(\n ...overrides.issues,\n // A `<Component path>` naming no example renders a \"No example\n // found\" box, which dev and build warn about too.\n ...missingExampleDiagnostics(\n project.graph.pages,\n await discoverExamples(root, config.examples.source),\n root,\n new Set([...islands.map((island) => island.name), ...overrides.mdx])\n )\n );\n const features = serverFeatures(config);\n if (\n features.length > 0 &&\n config.deployment.options.output === \"static\"\n ) {\n // A host adapter already names the target, so only its\n // `output: \"static\"` stands in the way; otherwise name one.\n const { kind } = config.deployment;\n diagnostics.push({\n code: \"BLUME_SERVER_FEATURE_REQUIRED\",\n message: `${features.join(\", \")} ${features.length === 1 ? \"requires\" : \"require\"} server output.`,\n severity: \"error\",\n suggestion:\n kind === \"static\"\n ? 'Set deployment to a host adapter from \"blume/deploy\" (e.g. `deployment: vercel()`).'\n : `Drop \\`output: \"static\"\\` from \\`deployment: ${kind}()\\` to build for the server.`,\n });\n }\n\n if (!args.json) {\n logger.info(`Pages: ${project.graph.pages.length}`);\n logger.info(`Output: ${config.deployment.options.output}`);\n logger.info(`Adapter: ${config.deployment.kind}`);\n logger.info(`Search: ${config.search.provider.kind}`);\n for (const line of integrationSummary(config)) {\n logger.info(line);\n }\n }\n } catch (error) {\n if (error instanceof BlumeError) {\n diagnostics.push(error.diagnostic);\n } else {\n reportInternalError(error);\n process.exit(1);\n }\n }\n\n if (args.json) {\n // Drain stdout before exiting non-zero: `process.exit` would otherwise\n // truncate the JSON payload mid-write when stdout is a pipe — exactly how\n // `--json` is consumed in CI/editors.\n if (reportDiagnosticsJson(diagnostics, root)) {\n await flushStdout();\n process.exit(1);\n }\n return;\n }\n\n const hadErrors = reportDiagnostics(diagnostics, root);\n if (diagnostics.length === 0) {\n logger.success(\"No problems found.\");\n }\n if (hadErrors) {\n // Set the code and return rather than `process.exit`, which doesn't wait\n // for a piped stderr: a long diagnostic list would be cut off.\n process.exitCode = 1;\n }\n },\n});\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAEA;AACA;AACA;AA8BA,IAAM,sBAAsB;AAS5B,IAAM,wBAAwB,OAC5B,mBACqD;AAAA,EACrD,IAAI,CAAC,gBAAgB;AAAA,IACnB,OAAO,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,EAAE;AAAA,EAC/B;AAAA,EACA,IAAI;AAAA,IACF,QAAQ,QAAQ,0BACd,MAAM,SAAS,gBAAgB,OAAO,GACtC,cACF;AAAA,IACA,OAAO,EAAE,QAAQ,CAAC,GAAG,KAAK,IAAI,IAAI,CAAC,UAAU,MAAM,GAAG,EAA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7 @@ var CHECKS = [
|
|
|
123
123
|
},
|
|
124
124
|
{
|
|
125
125
|
category: "duplicates",
|
|
126
|
-
fix: "Merge the pages, or
|
|
126
|
+
fix: "Merge the pages, or point `seo.canonical` on all but one at the page to index.",
|
|
127
127
|
id: "BLUME_AUDIT_DUPLICATE_CONTENT",
|
|
128
128
|
severity: "warning",
|
|
129
129
|
tier: "static",
|
|
@@ -315,7 +315,7 @@ var CHECKS = [
|
|
|
315
315
|
},
|
|
316
316
|
{
|
|
317
317
|
category: "redirects",
|
|
318
|
-
fix: "Remove the redirect, or delete the page it shadows —
|
|
318
|
+
fix: "Remove the redirect, or delete the page it shadows — a path can't be both, and which one readers get depends on the host.",
|
|
319
319
|
id: "BLUME_AUDIT_REDIRECT_SOURCE_IS_PAGE",
|
|
320
320
|
severity: "error",
|
|
321
321
|
tier: "static",
|
|
@@ -329,6 +329,14 @@ var CHECKS = [
|
|
|
329
329
|
tier: "network",
|
|
330
330
|
title: "HTTPS to HTTP redirect"
|
|
331
331
|
},
|
|
332
|
+
{
|
|
333
|
+
category: "redirects",
|
|
334
|
+
fix: "Deploy the redirect file your host reads (see Redirects in the deployment docs), or name the host in `deployment`.",
|
|
335
|
+
id: "BLUME_AUDIT_REDIRECT_NOT_SERVED",
|
|
336
|
+
severity: "error",
|
|
337
|
+
tier: "network",
|
|
338
|
+
title: "Live site doesn't redirect as configured"
|
|
339
|
+
},
|
|
332
340
|
{
|
|
333
341
|
category: "social",
|
|
334
342
|
fix: "Add a `description` — Blume fills the rest of the Open Graph tags for you.",
|
|
@@ -449,6 +457,22 @@ var CHECKS = [
|
|
|
449
457
|
tier: "static",
|
|
450
458
|
title: "Hreflang group has a language conflict"
|
|
451
459
|
},
|
|
460
|
+
{
|
|
461
|
+
category: "accessibility",
|
|
462
|
+
fix: "Pick a darker shade for light mode or a lighter one for dark mode, per mode with `theme.accent: { light, dark }`.",
|
|
463
|
+
id: "BLUME_AUDIT_THEME_CONTRAST_LOW",
|
|
464
|
+
severity: "warning",
|
|
465
|
+
tier: "static",
|
|
466
|
+
title: "Theme colors miss WCAG AA contrast"
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
category: "accessibility",
|
|
470
|
+
fix: "Write the color as hex, `rgb()`, `hsl()`, `hwb()`, `lab()`, `lch()`, `oklab()`, `oklch()`, or a named color so its contrast can be checked.",
|
|
471
|
+
id: "BLUME_AUDIT_THEME_COLOR_UNCHECKED",
|
|
472
|
+
severity: "info",
|
|
473
|
+
tier: "static",
|
|
474
|
+
title: "Theme color can't be checked for contrast"
|
|
475
|
+
},
|
|
452
476
|
{
|
|
453
477
|
category: "assets",
|
|
454
478
|
fix: 'Add descriptive `alt` text, or `alt=""` if the image is decorative.',
|
|
@@ -499,7 +523,7 @@ var CHECKS = [
|
|
|
499
523
|
},
|
|
500
524
|
{
|
|
501
525
|
category: "sitemap",
|
|
502
|
-
fix: "Remove `draft`/`hidden`/`noindex` from the page's frontmatter if it should be indexed.",
|
|
526
|
+
fix: "Remove `draft`/`hidden`/`noindex` from the page's frontmatter if it should be indexed. A `public/sitemap.xml` replaces the generated sitemap, so add the page there or delete that file.",
|
|
503
527
|
id: "BLUME_AUDIT_INDEXABLE_PAGE_NOT_IN_SITEMAP",
|
|
504
528
|
severity: "warning",
|
|
505
529
|
tier: "static",
|
|
@@ -593,6 +617,14 @@ var CHECKS = [
|
|
|
593
617
|
tier: "static",
|
|
594
618
|
title: "robots.txt disallows a page that is in the sitemap"
|
|
595
619
|
},
|
|
620
|
+
{
|
|
621
|
+
category: "robots",
|
|
622
|
+
fix: "Narrow or remove the rule in that crawler's `User-agent` group if it should read these pages. Blocking an AI crawler on purpose is fine; skip this check.",
|
|
623
|
+
id: "BLUME_AUDIT_ROBOTS_BLOCKS_CRAWLER",
|
|
624
|
+
severity: "warning",
|
|
625
|
+
tier: "static",
|
|
626
|
+
title: "robots.txt blocks one crawler from pages in the sitemap"
|
|
627
|
+
},
|
|
596
628
|
{
|
|
597
629
|
category: "robots",
|
|
598
630
|
fix: "Set `deployment.site` so robots.txt can reference the sitemap.",
|
|
@@ -977,5 +1009,5 @@ var launchInstalledAgent = async (bin, prompt, platform = process.platform) => {
|
|
|
977
1009
|
|
|
978
1010
|
export { CHECKS, finding, formatReport, reportJson, formatCatalog, AGENTS, writeAgentReport, fixPrompt, launchAgent, launchInstalledAgent };
|
|
979
1011
|
|
|
980
|
-
//# debugId=
|
|
981
|
-
//# sourceMappingURL=chunk-
|
|
1012
|
+
//# debugId=5656C1323785977064756E2164756E21
|
|
1013
|
+
//# sourceMappingURL=chunk-42t4jxdx.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/audit/report.ts", "../src/audit/catalog.ts", "../src/audit/agent.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { colors } from \"consola/utils\";\nimport type { ColorFunction } from \"consola/utils\";\nimport { relative } from \"pathe\";\n\nimport { countBySeverity } from \"../core/diagnostics.ts\";\nimport type { Diagnostic, DiagnosticSeverity } from \"../core/types.ts\";\nimport { CHECKS, checkMeta } from \"./catalog.ts\";\nimport type { CheckId } from \"./catalog.ts\";\nimport type { AuditResult } from \"./run.ts\";\nimport type { AuditCategory, AuditTier } from \"./types.ts\";\n\nconst SEVERITY_COLOR = {\n error: colors.red,\n info: colors.blue,\n warning: colors.yellow,\n} satisfies Record<DiagnosticSeverity, ColorFunction>;\n\nconst GLYPH = {\n error: \"✖\",\n info: \"ℹ\",\n warning: \"⚠\",\n} satisfies Record<DiagnosticSeverity, string>;\n\n/** How many affected pages to list before collapsing the rest. */\nconst PREVIEW = 3;\n\n/** The skippable tiers, each with the flag that runs it. */\nconst TIER_FLAGS: { tier: AuditTier; flag: string }[] = [\n { flag: \"--external\", tier: \"external\" },\n { flag: \"--url <origin>\", tier: \"network\" },\n];\n\ninterface CheckRollup {\n id: CheckId;\n count: number;\n /** Distinct affected URLs — one page can carry several findings. */\n pages: number;\n severity: DiagnosticSeverity;\n category: AuditCategory;\n title: string;\n findings: Diagnostic[];\n}\n\nconst SEVERITY_ORDER = {\n error: 0,\n info: 2,\n warning: 1,\n} satisfies Record<DiagnosticSeverity, number>;\n\n/**\n * The group's severity: the worst of its findings'. A check can downgrade a\n * finding at runtime (an external link answering 503 is a warning, not the\n * catalog's error), and the group's glyph must agree with the summary counts.\n */\nconst worstSeverity = (findings: Diagnostic[]): DiagnosticSeverity => {\n let worst: DiagnosticSeverity = \"info\";\n for (const finding of findings) {\n if (SEVERITY_ORDER[finding.severity] < SEVERITY_ORDER[worst]) {\n worst = finding.severity;\n }\n }\n return worst;\n};\n\n/** The first finding per affected URL, in report order. */\nconst firstPerPage = (findings: Diagnostic[]): Diagnostic[] => {\n const seen = new Set<string | undefined>();\n return findings.filter((finding) => {\n if (seen.has(finding.url)) {\n return false;\n }\n seen.add(finding.url);\n return true;\n });\n};\n\n/**\n * Group findings by check. This is the difference between a report people read\n * and one they close: 214 pages × 6 findings is an unreadable wall, but \"Meta\n * description missing — 12 pages\" is a to-do list.\n */\nexport const rollup = (diagnostics: Diagnostic[]): CheckRollup[] => {\n const groups = new Map<string, Diagnostic[]>();\n for (const diagnostic of diagnostics) {\n const group = groups.get(diagnostic.code);\n if (group) {\n group.push(diagnostic);\n } else {\n groups.set(diagnostic.code, [diagnostic]);\n }\n }\n\n const checks = [...groups.entries()].map(([id, findings]) => {\n // SAFETY: audit findings are only ever created through `finding()`, whose\n // codes are the check catalog's ids.\n const checkId = id as CheckId;\n const { category, title } = checkMeta(checkId);\n return {\n category,\n count: findings.length,\n findings,\n id: checkId,\n pages: firstPerPage(findings).length,\n severity: worstSeverity(findings),\n title,\n };\n });\n\n // Rank each category by the worst thing in it, so the categories that need\n // attention lead. Sorting on severity alone would interleave the categories\n // and print \"content\" three separate times.\n const worst = new Map<AuditCategory, number>();\n for (const check of checks) {\n const rank = SEVERITY_ORDER[check.severity];\n worst.set(\n check.category,\n Math.min(worst.get(check.category) ?? rank, rank)\n );\n }\n\n return checks.toSorted(\n (a, b) =>\n (worst.get(a.category) ?? 0) - (worst.get(b.category) ?? 0) ||\n a.category.localeCompare(b.category) ||\n SEVERITY_ORDER[a.severity] - SEVERITY_ORDER[b.severity] ||\n b.count - a.count\n );\n};\n\n/** Categories that had no findings but were never run, and the flag that runs them. */\nconst skippedTiers = (tiers: Record<AuditTier, boolean>): string[] =>\n TIER_FLAGS.filter(({ tier }) => !tiers[tier]).map(({ flag, tier }) => {\n const label = CHECKS.filter((check) => check.tier === tier).length;\n return ` ${colors.dim(`⊘ ${tier.padEnd(12)} skipped — pass ${flag} (${label} checks)`)}`;\n });\n\n/** How many checks actually ran, i.e. those whose tier was enabled. */\nconst activeChecks = (tiers: Record<AuditTier, boolean>): number =>\n CHECKS.filter((check) => tiers[check.tier]).length;\n\n/**\n * Individual checks performed: every rule that ran, against every page crawled.\n * The headline number — it's what makes \"39 warnings\" legible as a proportion\n * rather than a bare count.\n */\nexport const auditCount = (result: AuditResult): number =>\n activeChecks(result.tiers) * result.pages;\n\nconst summaryLine = (\n counts: Record<DiagnosticSeverity, number>,\n audits: number\n): string =>\n [\n `${audits.toLocaleString(\"en-US\")} audit${audits === 1 ? \"\" : \"s\"}`,\n `${counts.error} error${counts.error === 1 ? \"\" : \"s\"}`,\n `${counts.warning} warning${counts.warning === 1 ? \"\" : \"s\"}`,\n `${counts.info} note${counts.info === 1 ? \"\" : \"s\"}`,\n ].join(\" · \");\n\n/** One affected page: the URL, and the source file that fixes it. */\nconst findingLine = (diagnostic: Diagnostic, root: string): string => {\n const url = diagnostic.url ?? \"\";\n const source = diagnostic.file\n ? colors.dim(\n `${relative(root, diagnostic.file)}${\n diagnostic.line === undefined ? \"\" : `:${diagnostic.line}`\n }`\n )\n : \"\";\n // padEnd alone yields no gap once the URL reaches the column width.\n return ` ${url.padEnd(34)} ${source}`.trimEnd();\n};\n\n/**\n * Render the audit as a report grouped by check, with each check's affected\n * pages, the source file to edit, and the fix.\n */\nexport const formatReport = (\n result: AuditResult,\n root: string,\n options: { verbose?: boolean } = {}\n): string => {\n const counts = countBySeverity(result.diagnostics);\n const groups = rollup(result.diagnostics);\n const lines: string[] = [];\n\n const where = result.origin\n ? `${relative(root, result.staticDir) || \"dist\"} + ${result.origin}`\n : `${relative(root, result.staticDir) || \"dist\"} · offline`;\n lines.push(\n \"\",\n ` ${colors.bold(\"blume audit\")} ${colors.dim(`${result.pages} pages · ${where}`)}`,\n ` ${summaryLine(counts, auditCount(result))}`,\n \"\"\n );\n\n if (groups.length === 0) {\n lines.push(` ${colors.green(\"✔ No issues found.\")}`, \"\");\n }\n\n let category: AuditCategory | null = null;\n for (const group of groups) {\n const { category: next } = group;\n if (next !== category) {\n category = next;\n lines.push(` ${colors.bold(category)}`, \"\");\n }\n\n const color = SEVERITY_COLOR[group.severity];\n const pages = `${group.pages} page${group.pages === 1 ? \"\" : \"s\"}`;\n lines.push(\n ` ${color(`${GLYPH[group.severity]} ${group.title}`)} ${colors.dim(pages)}`\n );\n\n // The preview lists affected pages, each once; --verbose lists every\n // finding, since each one's message names a different specific.\n const shown = options.verbose\n ? group.findings\n : firstPerPage(group.findings).slice(0, PREVIEW);\n for (const diagnostic of shown) {\n lines.push(findingLine(diagnostic, root));\n // The message names the specifics the rolled-up line can't — which target\n // is broken, what the duplicate is — so --verbose prints it per finding.\n if (options.verbose) {\n lines.push(` ${colors.dim(diagnostic.message)}`);\n }\n }\n const hidden = options.verbose ? 0 : group.pages - shown.length;\n if (hidden > 0) {\n lines.push(` ${colors.dim(`… and ${hidden} more (--verbose)`)}`);\n }\n\n // Findings share the catalog's fix unless one overrode it (a navigation\n // entry, a page generated from an API spec), so each distinct fix is\n // printed once.\n const fixes = new Set(\n group.findings.flatMap((finding) =>\n finding.suggestion ? [finding.suggestion] : []\n )\n );\n for (const fix of fixes) {\n lines.push(` ${colors.cyan(`fix: ${fix}`)}`);\n }\n lines.push(\"\");\n }\n\n const skipped = skippedTiers(result.tiers);\n if (skipped.length > 0) {\n lines.push(...skipped, \"\");\n }\n\n return lines.join(\"\\n\");\n};\n\n/**\n * The machine-readable report. The existing `diagnostics` + `summary` shape is\n * preserved exactly — anything already parsing `blume validate --json` keeps\n * working — with the audit-specific rollup added alongside it.\n */\nexport const reportJson = (result: AuditResult, root: string): string => {\n const diagnostics = result.diagnostics.map((diagnostic) =>\n diagnostic.file\n ? { ...diagnostic, file: relative(root, diagnostic.file) }\n : diagnostic\n );\n return `${JSON.stringify(\n {\n audit: {\n /** Checks run × pages crawled — the total number of individual audits. */\n audits: auditCount(result),\n checks: rollup(result.diagnostics).map((group) => ({\n category: group.category,\n count: group.count,\n id: group.id,\n severity: group.severity,\n })),\n origin: result.origin,\n pages: result.pages,\n staticDir: relative(root, result.staticDir),\n tiers: result.tiers,\n },\n diagnostics,\n summary: countBySeverity(result.diagnostics),\n },\n null,\n 2\n )}\\n`;\n};\n\n/** `--list-checks`: the catalog, which is also the docs' source of truth. */\nexport const formatCatalog = (): string => {\n const lines: string[] = [\"\"];\n let category: AuditCategory | null = null;\n for (const check of [...CHECKS].toSorted((a, b) =>\n a.category.localeCompare(b.category)\n )) {\n const { category: next } = check;\n if (next !== category) {\n category = next;\n lines.push(` ${colors.bold(category)}`);\n }\n const tier =\n check.tier === \"static\" ? \"\" : ` ${colors.dim(`[${check.tier}]`)}`;\n lines.push(\n ` ${SEVERITY_COLOR[check.severity](GLYPH[check.severity])} ${check.id.replace(\"BLUME_AUDIT_\", \"\").toLowerCase().padEnd(34)} ${colors.dim(check.title)}${tier}`\n );\n }\n lines.push(\"\", ` ${CHECKS.length} checks.`, \"\");\n return lines.join(\"\\n\");\n};\n",
|
|
6
|
+
"import type { Diagnostic } from \"../core/types.ts\";\nimport type { CheckMeta } from \"./types.ts\";\n\n/**\n * Every check `blume audit` can report.\n *\n * This is deliberately ~76 checks, not the ~173 rows an Ahrefs site audit\n * lists. Ahrefs crawls the open web, so its list is padded with rows that are\n * structurally impossible for an Astro-built Blume site, and shipping those as\n * permanent zeroes teaches people to ignore the report. What was dropped, and\n * why:\n *\n * - **Every `nofollow` check** (~6 rows, including all four \"nofollow incoming\n * internal links\" variants). `RootLayout.astro` only ever emits `<meta\n * name=\"robots\" content=\"noindex\">`; Blume has no way to emit `nofollow`, so\n * they could never fire. Hand-written `rel=\"nofollow\"` in MDX is still caught\n * by `INTERNAL_LINK_NOFOLLOW`.\n * - **The whole JavaScript + CSS section** (~11 rows: \"JS redirects\", \"CSS\n * redirects\", \"page has redirected JS/CSS\", \"HTTPS page links to HTTP\n * JS/CSS\"…). Vite emits content-hashed, existent, non-redirecting bundles.\n * Collapsed into one `SUBRESOURCE_MISSING`.\n * - **Ahrefs' indexable/non-indexable duplicates** (~20 rows). Carried instead\n * by `PageSnapshot.indexable` on a single finding.\n * - **\"Only one dofollow incoming internal link\"** and **\"page has no outgoing\n * links\"**. Blume's sidebar links every page from every page, so these fire on\n * ~100% of pages. Pure noise.\n * - **\"3XX redirect\"** and **\"302 redirect\"**: having a redirect is inventory,\n * not a finding. **\"HTTP to HTTPS redirect\"** is correct behavior.\n * - **\"Font size too small\" / \"tap targets too close\" / \"content not sized\n * correctly\"**: properties of the theme, identical on every page. A regression\n * there is a Blume bug, not a user finding.\n * - **\"Document uses plugins\"** and **\"poor FID\"** (FID is deprecated; lab\n * Lighthouse cannot measure INP, so we report TBT and say so).\n * - **\"More than three parameters in URL\"**: a static docs site emits no query\n * strings in its own links.\n * - **\"Page in multiple sitemaps\"**: Blume emits exactly one sitemap.\n * - **Core Web Vitals** (LCP/CLS/INP): these need a real browser. Rather than\n * ship a `--lighthouse` flag that silently reports nothing, they are deferred\n * until Lighthouse is actually wired in. A tier the audit cannot run is worse\n * than one it openly doesn't have.\n *\n * Severity discipline: `error` means \"this is definitely broken\". Anything\n * advisory ships as `warning`/`info`. One noisy check and the whole command gets\n * switched off.\n */\nexport const CHECKS = [\n // Content\n {\n category: \"content\",\n fix: \"Add a `title` to the page's frontmatter.\",\n id: \"BLUME_AUDIT_TITLE_MISSING\",\n severity: \"error\",\n tier: \"static\",\n title: \"Title tag missing or empty\",\n },\n {\n category: \"content\",\n fix: \"Remove the extra <title> from the page's layout or MDX.\",\n id: \"BLUME_AUDIT_TITLE_MULTIPLE\",\n severity: \"error\",\n tier: \"static\",\n title: \"Multiple title tags\",\n },\n {\n category: \"content\",\n fix: \"Rewrite `title` in the frontmatter to fit the length range.\",\n id: \"BLUME_AUDIT_TITLE_LENGTH\",\n severity: \"warning\",\n tier: \"static\",\n title: \"Title too long or too short\",\n },\n {\n category: \"content\",\n fix: \"Add a `description` to the page's frontmatter.\",\n id: \"BLUME_AUDIT_DESCRIPTION_MISSING\",\n severity: \"warning\",\n tier: \"static\",\n title: \"Meta description missing or empty\",\n },\n {\n category: \"content\",\n fix: \"Remove the extra description <meta> from the page's layout or MDX.\",\n id: \"BLUME_AUDIT_DESCRIPTION_MULTIPLE\",\n severity: \"error\",\n tier: \"static\",\n title: \"Multiple meta description tags\",\n },\n {\n category: \"content\",\n fix: \"Rewrite `description` in the frontmatter to fit the length range.\",\n id: \"BLUME_AUDIT_DESCRIPTION_LENGTH\",\n severity: \"warning\",\n tier: \"static\",\n title: \"Meta description too long or too short\",\n },\n {\n category: \"content\",\n fix: \"Give the page a `title` — Blume renders it as the page's <h1>.\",\n id: \"BLUME_AUDIT_H1_MISSING\",\n severity: \"warning\",\n tier: \"static\",\n title: \"H1 tag missing or empty\",\n },\n {\n category: \"content\",\n fix: \"Demote the extra `# Heading` in the body to `##` — Blume already renders `title` as the h1.\",\n id: \"BLUME_AUDIT_H1_MULTIPLE\",\n severity: \"warning\",\n tier: \"static\",\n title: \"Multiple H1 tags\",\n },\n {\n category: \"content\",\n fix: \"Expand the page, or fold it into a larger one.\",\n id: \"BLUME_AUDIT_LOW_WORD_COUNT\",\n severity: \"info\",\n tier: \"static\",\n title: \"Low word count\",\n },\n {\n category: \"content\",\n fix: \"Adjust the heading to the next level down — skipped levels break table-of-contents nesting and screen-reader outlines.\",\n id: \"BLUME_AUDIT_HEADING_SKIP\",\n severity: \"info\",\n tier: \"static\",\n title: \"Heading levels skip (e.g. h2 to h4)\",\n },\n {\n category: \"content\",\n fix: \"Correct the `date`, or hold the page back until it is meant to be live.\",\n id: \"BLUME_AUDIT_FUTURE_DATED_PAGE\",\n severity: \"info\",\n tier: \"static\",\n title: \"Page is dated in the future\",\n },\n {\n category: \"content\",\n fix: \"Restore the viewport <meta> in your ejected layout.\",\n id: \"BLUME_AUDIT_VIEWPORT_MISSING\",\n severity: \"error\",\n tier: \"static\",\n title: \"Viewport not set\",\n },\n\n // Duplicates\n {\n category: \"duplicates\",\n fix: \"Give each page a distinct `title` — search engines show it as the result headline.\",\n id: \"BLUME_AUDIT_DUPLICATE_TITLE\",\n severity: \"warning\",\n tier: \"static\",\n title: \"Duplicate title\",\n },\n {\n category: \"duplicates\",\n fix: \"Give each page a distinct `description`.\",\n id: \"BLUME_AUDIT_DUPLICATE_DESCRIPTION\",\n severity: \"warning\",\n tier: \"static\",\n title: \"Duplicate meta description\",\n },\n {\n category: \"duplicates\",\n fix: \"Merge the pages, or point `seo.canonical` on all but one at the page to index.\",\n id: \"BLUME_AUDIT_DUPLICATE_CONTENT\",\n severity: \"warning\",\n tier: \"static\",\n title: \"Duplicate pages without canonical\",\n },\n\n // Indexability\n {\n category: \"indexability\",\n fix: \"Set `deployment.site` in blume.config.ts to the site's public URL.\",\n id: \"BLUME_AUDIT_SITE_NOT_SET\",\n severity: \"warning\",\n tier: \"static\",\n title: \"deployment.site is not set\",\n },\n {\n category: \"indexability\",\n fix: \"Audit a production-like build (e.g. `VERCEL=1 VERCEL_PROJECT_PRODUCTION_URL=<host> blume build`) or the deployment itself with `--url <origin>`. Do not hardcode `deployment.site` — the platform sets it on every deploy.\",\n id: \"BLUME_AUDIT_SITE_INFERRED_AT_DEPLOY\",\n severity: \"info\",\n tier: \"static\",\n title: \"deployment.site is inferred at deploy time\",\n },\n {\n category: \"indexability\",\n fix: \"Drop the canonical from noindex pages — Google treats the pairing as contradictory and may ignore one of the two.\",\n id: \"BLUME_AUDIT_CANONICAL_ON_NOINDEX\",\n severity: \"warning\",\n tier: \"static\",\n title: \"Page is noindex but declares a canonical\",\n },\n {\n category: \"indexability\",\n fix: \"Rebuild without `--preview` before deploying, or remove `draft: true` if the page is ready to ship.\",\n id: \"BLUME_AUDIT_DRAFT_PAGE_PUBLISHED\",\n severity: \"warning\",\n tier: \"static\",\n title: \"Draft page is in the build\",\n },\n {\n category: \"indexability\",\n fix: \"Set `deployment.site` so Blume can emit absolute canonical URLs.\",\n id: \"BLUME_AUDIT_CANONICAL_MISSING\",\n severity: \"warning\",\n tier: \"static\",\n title: \"Canonical URL missing\",\n },\n {\n category: \"indexability\",\n fix: \"Point `seo.canonical` at this page, or remove it to use the default self-canonical.\",\n id: \"BLUME_AUDIT_CANONICAL_NOT_SELF\",\n severity: \"info\",\n tier: \"static\",\n title: \"Non-canonical page\",\n },\n {\n category: \"indexability\",\n fix: \"Point `seo.canonical` at a page that exists and doesn't redirect.\",\n id: \"BLUME_AUDIT_CANONICAL_BAD_TARGET\",\n severity: \"error\",\n tier: \"static\",\n title: \"Canonical points to a broken or redirecting page\",\n },\n {\n category: \"indexability\",\n fix: \"Use the same protocol in `seo.canonical` as in `deployment.site`.\",\n id: \"BLUME_AUDIT_CANONICAL_PROTOCOL_MISMATCH\",\n severity: \"error\",\n tier: \"static\",\n title: \"Canonical protocol does not match the site\",\n },\n {\n category: \"indexability\",\n fix: \"Remove `noindex` from the page's frontmatter if it should be indexed.\",\n id: \"BLUME_AUDIT_ROBOTS_META_UNEXPECTED\",\n severity: \"info\",\n tier: \"static\",\n title: \"Page is not indexable\",\n },\n {\n category: \"indexability\",\n fix: \"Split the page — Googlebot stops reading an HTML document at 2 MB.\",\n id: \"BLUME_AUDIT_HTML_TOO_LARGE\",\n severity: \"error\",\n tier: \"static\",\n title: \"Page exceeds Googlebot's 2 MB crawl limit\",\n },\n {\n category: \"indexability\",\n fix: \"Remove the X-Robots-Tag header, or align it with the page's robots meta.\",\n id: \"BLUME_AUDIT_ROBOTS_HEADER_CONFLICT\",\n severity: \"error\",\n tier: \"network\",\n title: \"X-Robots-Tag header conflicts with the page's robots meta\",\n },\n\n // Links\n {\n category: \"links\",\n fix: \"Fix the link target, or create the page it points at.\",\n id: \"BLUME_AUDIT_LINK_TO_BROKEN\",\n severity: \"error\",\n tier: \"static\",\n title: \"Page has links to a broken page\",\n },\n {\n category: \"links\",\n fix: \"Link straight to the destination instead of through the redirect.\",\n id: \"BLUME_AUDIT_LINK_TO_REDIRECT\",\n severity: \"warning\",\n tier: \"static\",\n title: \"Page has links to a redirect\",\n },\n {\n category: \"links\",\n fix: \"Link to this page from the body of a related page.\",\n id: \"BLUME_AUDIT_ORPHAN_PAGE\",\n severity: \"warning\",\n tier: \"static\",\n title: \"Orphan page (only reachable from navigation)\",\n },\n {\n category: \"links\",\n fix: \"Use a root-relative path (`/docs/x`) so the link survives previews and `basePath`.\",\n id: \"BLUME_AUDIT_INTERNAL_LINK_ABSOLUTE\",\n severity: \"warning\",\n tier: \"static\",\n title: \"Internal link hardcodes the site's own origin\",\n },\n {\n category: \"links\",\n fix: 'Drop `rel=\"nofollow\"` — it stops this page passing authority internally.',\n id: \"BLUME_AUDIT_INTERNAL_LINK_NOFOLLOW\",\n severity: \"info\",\n tier: \"static\",\n title: \"Page has nofollow outgoing internal links\",\n },\n {\n category: \"links\",\n fix: \"Check `basePath` / `deployment.base` — a trailing slash there produces `//`.\",\n id: \"BLUME_AUDIT_DOUBLE_SLASH_URL\",\n severity: \"error\",\n tier: \"static\",\n title: \"Double slash in URL\",\n },\n {\n category: \"links\",\n fix: \"Point the fragment at a heading that exists on the target page, or fix the heading it meant.\",\n id: \"BLUME_AUDIT_ANCHOR_BROKEN\",\n severity: \"warning\",\n tier: \"static\",\n title: \"Link fragment matches no id on the target page\",\n },\n {\n category: \"links\",\n fix: \"Rename the source file to a lowercase, hyphenated slug — and add a redirect from the old URL if it was already published.\",\n id: \"BLUME_AUDIT_URL_STYLE\",\n severity: \"info\",\n tier: \"static\",\n title: \"URL contains uppercase, underscores, or spaces\",\n },\n\n // Redirects\n {\n category: \"redirects\",\n fix: \"Point the redirect at a page that exists.\",\n id: \"BLUME_AUDIT_REDIRECT_BROKEN\",\n severity: \"error\",\n tier: \"static\",\n title: \"Broken redirect\",\n },\n {\n category: \"redirects\",\n fix: \"Break the cycle in `redirects` — it never resolves.\",\n id: \"BLUME_AUDIT_REDIRECT_LOOP\",\n severity: \"error\",\n tier: \"static\",\n title: \"Redirect loop\",\n },\n {\n category: \"redirects\",\n fix: \"Point every hop straight at the final destination.\",\n id: \"BLUME_AUDIT_REDIRECT_CHAIN\",\n severity: \"warning\",\n tier: \"static\",\n title: \"Redirect chain\",\n },\n {\n category: \"redirects\",\n fix: \"Use a real redirect in `blume.config.ts` instead of a meta refresh.\",\n id: \"BLUME_AUDIT_META_REFRESH\",\n severity: \"warning\",\n tier: \"static\",\n title: \"Meta refresh redirect\",\n },\n {\n category: \"redirects\",\n fix: \"Remove the redirect, or delete the page it shadows — a path can't be both, and which one readers get depends on the host.\",\n id: \"BLUME_AUDIT_REDIRECT_SOURCE_IS_PAGE\",\n severity: \"error\",\n tier: \"static\",\n title: \"Redirect source is also a real page\",\n },\n {\n category: \"redirects\",\n fix: \"Redirect to the HTTPS URL.\",\n id: \"BLUME_AUDIT_REDIRECT_TO_HTTP\",\n severity: \"error\",\n tier: \"network\",\n title: \"HTTPS to HTTP redirect\",\n },\n {\n category: \"redirects\",\n fix: \"Deploy the redirect file your host reads (see Redirects in the deployment docs), or name the host in `deployment`.\",\n id: \"BLUME_AUDIT_REDIRECT_NOT_SERVED\",\n severity: \"error\",\n tier: \"network\",\n title: \"Live site doesn't redirect as configured\",\n },\n\n // Social\n {\n category: \"social\",\n fix: \"Add a `description` — Blume fills the rest of the Open Graph tags for you.\",\n id: \"BLUME_AUDIT_OG_INCOMPLETE\",\n severity: \"warning\",\n tier: \"static\",\n title: \"Open Graph tags missing or incomplete\",\n },\n {\n category: \"social\",\n fix: \"Set `deployment.site` to turn on generated OG images, or set `seo.image` on the page.\",\n id: \"BLUME_AUDIT_OG_IMAGE_MISSING\",\n severity: \"warning\",\n tier: \"static\",\n title: \"Open Graph image missing\",\n },\n {\n category: \"social\",\n fix: \"Point `seo.image` at a file that exists, or rebuild — a dead og:image renders as a blank card everywhere the page is shared.\",\n id: \"BLUME_AUDIT_OG_IMAGE_BROKEN\",\n severity: \"warning\",\n tier: \"static\",\n title: \"Open Graph image is not in the build\",\n },\n {\n category: \"social\",\n fix: \"Use an image of at least 1200×630 — smaller ones render blurry or get cropped into small-card layouts.\",\n id: \"BLUME_AUDIT_OG_IMAGE_SMALL\",\n severity: \"warning\",\n tier: \"static\",\n title: \"Open Graph image is too small for large cards\",\n },\n {\n category: \"social\",\n fix: \"Align `og:url` with the page's canonical URL.\",\n id: \"BLUME_AUDIT_OG_URL_MISMATCH\",\n severity: \"warning\",\n tier: \"static\",\n title: \"Open Graph URL not matching canonical\",\n },\n {\n category: \"social\",\n fix: \"Set `seo.x.handle` in blume.config.ts so X can attribute the card.\",\n id: \"BLUME_AUDIT_TWITTER_CARD_INCOMPLETE\",\n severity: \"warning\",\n tier: \"static\",\n title: \"X (Twitter) card missing or incomplete\",\n },\n\n // Localization\n {\n category: \"i18n\",\n fix: \"Restore the `lang` attribute on <html> in your ejected layout.\",\n id: \"BLUME_AUDIT_HTML_LANG_MISSING\",\n severity: \"error\",\n tier: \"static\",\n title: \"HTML lang attribute missing\",\n },\n {\n category: \"i18n\",\n fix: \"Use a valid BCP 47 tag (e.g. `en`, `en-GB`) for the locale.\",\n id: \"BLUME_AUDIT_HTML_LANG_INVALID\",\n severity: \"error\",\n tier: \"static\",\n title: \"HTML lang attribute invalid\",\n },\n {\n category: \"i18n\",\n fix: \"The page's <html lang> must match its own hreflang annotation.\",\n id: \"BLUME_AUDIT_HREFLANG_LANG_MISMATCH\",\n severity: \"error\",\n tier: \"static\",\n title: \"Hreflang and HTML lang mismatch\",\n },\n {\n category: \"i18n\",\n fix: \"Use a valid BCP 47 tag in the hreflang annotation.\",\n id: \"BLUME_AUDIT_HREFLANG_INVALID\",\n severity: \"error\",\n tier: \"static\",\n title: \"Hreflang annotation invalid\",\n },\n {\n category: \"i18n\",\n fix: \"A page's hreflang set must include a self-reference.\",\n id: \"BLUME_AUDIT_HREFLANG_SELF_MISSING\",\n severity: \"warning\",\n tier: \"static\",\n title: \"Self-reference hreflang annotation missing\",\n },\n {\n category: \"i18n\",\n fix: \"Add an `x-default` alternate pointing at the default-locale page.\",\n id: \"BLUME_AUDIT_HREFLANG_XDEFAULT_MISSING\",\n severity: \"info\",\n tier: \"static\",\n title: \"X-default hreflang annotation missing\",\n },\n {\n category: \"i18n\",\n fix: \"Every page in an hreflang group must link back to every other one.\",\n id: \"BLUME_AUDIT_HREFLANG_NO_RETURN_TAG\",\n severity: \"error\",\n tier: \"static\",\n title: \"Missing reciprocal hreflang (no return-tag)\",\n },\n {\n category: \"i18n\",\n fix: \"Point the hreflang alternate at a page that exists and is canonical.\",\n id: \"BLUME_AUDIT_HREFLANG_BAD_TARGET\",\n severity: \"error\",\n tier: \"static\",\n title: \"Hreflang points to a broken, redirecting, or non-canonical page\",\n },\n {\n category: \"i18n\",\n fix: \"Each language in an hreflang group must name exactly one page.\",\n id: \"BLUME_AUDIT_HREFLANG_CONFLICT\",\n severity: \"error\",\n tier: \"static\",\n title: \"Hreflang group has a language conflict\",\n },\n\n // Accessibility. Theme colors are one per site, not per page: these run\n // on the config, the way the build resolves it.\n {\n category: \"accessibility\",\n fix: \"Pick a darker shade for light mode or a lighter one for dark mode, per mode with `theme.accent: { light, dark }`.\",\n id: \"BLUME_AUDIT_THEME_CONTRAST_LOW\",\n severity: \"warning\",\n tier: \"static\",\n title: \"Theme colors miss WCAG AA contrast\",\n },\n {\n category: \"accessibility\",\n fix: \"Write the color as hex, `rgb()`, `hsl()`, `hwb()`, `lab()`, `lch()`, `oklab()`, `oklch()`, or a named color so its contrast can be checked.\",\n id: \"BLUME_AUDIT_THEME_COLOR_UNCHECKED\",\n severity: \"info\",\n tier: \"static\",\n title: \"Theme color can't be checked for contrast\",\n },\n\n // Assets\n {\n category: \"assets\",\n fix: 'Add descriptive `alt` text, or `alt=\"\"` if the image is decorative.',\n id: \"BLUME_AUDIT_IMAGE_ALT_MISSING\",\n severity: \"warning\",\n tier: \"static\",\n title: \"Missing alt text\",\n },\n {\n category: \"assets\",\n fix: \"Fix the image path, or add the file to public/.\",\n id: \"BLUME_AUDIT_IMAGE_BROKEN\",\n severity: \"error\",\n tier: \"static\",\n title: \"Image broken\",\n },\n {\n category: \"assets\",\n fix: \"Compress the asset, or serve a modern format (WebP/AVIF).\",\n id: \"BLUME_AUDIT_ASSET_TOO_LARGE\",\n severity: \"warning\",\n tier: \"static\",\n title: \"Asset file size too large\",\n },\n {\n category: \"assets\",\n fix: \"Set `width` and `height` so the browser can reserve space (avoids layout shift).\",\n id: \"BLUME_AUDIT_IMAGE_MISSING_DIMENSIONS\",\n severity: \"warning\",\n tier: \"static\",\n title: \"Image has no width/height\",\n },\n {\n category: \"assets\",\n fix: \"Fix the reference, or restore the missing file.\",\n id: \"BLUME_AUDIT_SUBRESOURCE_MISSING\",\n severity: \"error\",\n tier: \"static\",\n title: \"Referenced script, style, or asset is missing from the build\",\n },\n {\n category: \"assets\",\n fix: \"Load the subresource over HTTPS — browsers block mixed content.\",\n id: \"BLUME_AUDIT_MIXED_CONTENT\",\n severity: \"error\",\n tier: \"static\",\n title: \"HTTPS/HTTP mixed content\",\n },\n\n // Sitemap\n {\n category: \"sitemap\",\n fix: \"Remove `draft`/`hidden`/`noindex` from the page's frontmatter if it should be indexed. A `public/sitemap.xml` replaces the generated sitemap, so add the page there or delete that file.\",\n id: \"BLUME_AUDIT_INDEXABLE_PAGE_NOT_IN_SITEMAP\",\n severity: \"warning\",\n tier: \"static\",\n title: \"Indexable page not in sitemap\",\n },\n {\n category: \"sitemap\",\n fix: \"A noindex page should not be advertised in the sitemap.\",\n id: \"BLUME_AUDIT_NOINDEX_IN_SITEMAP\",\n severity: \"error\",\n tier: \"static\",\n title: \"Noindex page in sitemap\",\n },\n {\n category: \"sitemap\",\n fix: \"List only canonical URLs in the sitemap.\",\n id: \"BLUME_AUDIT_NON_CANONICAL_IN_SITEMAP\",\n severity: \"error\",\n tier: \"static\",\n title: \"Non-canonical page in sitemap\",\n },\n {\n category: \"sitemap\",\n fix: \"Remove the URL from the sitemap, or build the page it names.\",\n id: \"BLUME_AUDIT_SITEMAP_BAD_URL\",\n severity: \"error\",\n tier: \"static\",\n title: \"Sitemap names a page that does not exist or redirects\",\n },\n {\n category: \"sitemap\",\n fix: \"Sitemaps must be valid XML in the sitemaps.org urlset or sitemap index format.\",\n id: \"BLUME_AUDIT_SITEMAP_INVALID\",\n severity: \"error\",\n tier: \"static\",\n title: \"Sitemap has a syntax error or wrong format\",\n },\n {\n category: \"sitemap\",\n fix: \"Split the sitemap — the limits are 50 MB and 50,000 URLs.\",\n id: \"BLUME_AUDIT_SITEMAP_TOO_LARGE\",\n severity: \"error\",\n tier: \"static\",\n title: \"Sitemap exceeds 50 MB or 50,000 URLs\",\n },\n {\n category: \"sitemap\",\n fix: \"Use a real W3C date that is not in the future — search engines that catch a sitemap lying about freshness stop trusting its lastmod entirely.\",\n id: \"BLUME_AUDIT_SITEMAP_LASTMOD_INVALID\",\n severity: \"warning\",\n tier: \"static\",\n title: \"Sitemap lastmod is invalid or in the future\",\n },\n {\n category: \"sitemap\",\n fix: \"A sitemap may only list URLs on its own origin.\",\n id: \"BLUME_AUDIT_SITEMAP_OUT_OF_SCOPE\",\n severity: \"warning\",\n tier: \"static\",\n title: \"Sitemap includes URLs out of its scope\",\n },\n {\n category: \"sitemap\",\n fix: \"Make sitemap.xml reachable at the site root.\",\n id: \"BLUME_AUDIT_SITEMAP_NOT_ACCESSIBLE\",\n severity: \"error\",\n tier: \"network\",\n title: \"Sitemap is not accessible\",\n },\n\n // robots.txt\n {\n category: \"robots\",\n fix: \"Set `seo.robots: true` to generate robots.txt.\",\n id: \"BLUME_AUDIT_ROBOTS_MISSING\",\n severity: \"warning\",\n tier: \"static\",\n title: \"robots.txt missing\",\n },\n {\n category: \"robots\",\n fix: \"Every robots.txt line must be a `Field: value` directive or a comment.\",\n id: \"BLUME_AUDIT_ROBOTS_INVALID\",\n severity: \"error\",\n tier: \"static\",\n title: \"robots.txt has a syntax error\",\n },\n {\n category: \"robots\",\n fix: \"A page can't be both disallowed in robots.txt and advertised in the sitemap.\",\n id: \"BLUME_AUDIT_ROBOTS_DISALLOWS_INDEXABLE\",\n severity: \"error\",\n tier: \"static\",\n title: \"robots.txt disallows a page that is in the sitemap\",\n },\n {\n category: \"robots\",\n fix: \"Narrow or remove the rule in that crawler's `User-agent` group if it should read these pages. Blocking an AI crawler on purpose is fine; skip this check.\",\n id: \"BLUME_AUDIT_ROBOTS_BLOCKS_CRAWLER\",\n severity: \"warning\",\n tier: \"static\",\n title: \"robots.txt blocks one crawler from pages in the sitemap\",\n },\n {\n category: \"robots\",\n fix: \"Set `deployment.site` so robots.txt can reference the sitemap.\",\n id: \"BLUME_AUDIT_ROBOTS_SITEMAP_MISSING\",\n severity: \"info\",\n tier: \"static\",\n title: \"robots.txt does not reference the sitemap\",\n },\n {\n category: \"robots\",\n fix: \"Make robots.txt reachable at the site root.\",\n id: \"BLUME_AUDIT_ROBOTS_NOT_ACCESSIBLE\",\n severity: \"error\",\n tier: \"network\",\n title: \"robots.txt is not accessible\",\n },\n\n // AI discovery. `llms.txt` is the sitemap of the AI era, and no SEO crawler\n // audits it — they audit for Google. Blume emits it, so Blume checks it.\n {\n category: \"ai\",\n fix: \"Rebuild — `agents.llmsTxt` is enabled but the build has no llms.txt. If that's intentional, set `agents.llmsTxt: false`.\",\n id: \"BLUME_AUDIT_LLMS_TXT_MISSING\",\n severity: \"warning\",\n tier: \"static\",\n title: \"llms.txt missing from the build\",\n },\n {\n category: \"ai\",\n fix: \"Rebuild so llms.txt matches the site — a stale entry sends an AI agent to a page that is not there.\",\n id: \"BLUME_AUDIT_LLMS_TXT_STALE_ENTRY\",\n severity: \"warning\",\n tier: \"static\",\n title: \"llms.txt lists a page the build does not serve\",\n },\n {\n category: \"ai\",\n fix: \"Rebuild so llms.txt matches the site; if the page is deliberately excluded, set `ai.exclude: true` in its front matter.\",\n id: \"BLUME_AUDIT_LLMS_TXT_PAGE_MISSING\",\n severity: \"warning\",\n tier: \"static\",\n title: \"Indexable page missing from llms.txt\",\n },\n // DNS-AID (draft-mozleywilliams-dnsop-dnsaid) lives in the DNS zone, not the\n // build, so unlike the llms.txt checks these can only observe and advise —\n // hence `info`: publishing the records is a DNS-provider action Blume can't\n // take for you, and the draft is young enough that absence is the norm.\n {\n category: \"ai\",\n fix: \"Publish a ServiceMode SVCB or HTTPS record at `_index._agents.<host>` with your DNS provider so agents can discover the site via DNS (DNS-AID).\",\n id: \"BLUME_AUDIT_DNS_AID_MISSING\",\n severity: \"info\",\n tier: \"network\",\n title: \"No DNS-AID agent-discovery records\",\n },\n {\n category: \"ai\",\n fix: \"Enable DNSSEC for the zone so validating resolvers return authenticated DNS-AID answers; if your DNS provider doesn't support DNSSEC, the records still work unsigned.\",\n id: \"BLUME_AUDIT_DNS_AID_UNSIGNED\",\n severity: \"info\",\n tier: \"network\",\n title: \"DNS-AID records are not DNSSEC-authenticated\",\n },\n\n // Structured data. Note we validate only what Blume itself emits — we do not\n // claim Google-rich-results or full schema.org validation (the former is an\n // undocumented network API, the latter a vocabulary we don't bundle).\n {\n category: \"structured-data\",\n fix: \"The JSON-LD block must be valid JSON.\",\n id: \"BLUME_AUDIT_JSONLD_INVALID\",\n severity: \"error\",\n tier: \"static\",\n title: \"Structured data is not valid JSON\",\n },\n {\n category: \"structured-data\",\n fix: \"Every JSON-LD node needs `@context` and `@type`.\",\n id: \"BLUME_AUDIT_JSONLD_INCOMPLETE\",\n severity: \"warning\",\n tier: \"static\",\n title: \"Structured data is missing required properties\",\n },\n\n // Network (`--url`)\n {\n category: \"network\",\n fix: \"The page is linked or in the sitemap but the deployment 404s it.\",\n id: \"BLUME_AUDIT_HTTP_4XX\",\n severity: \"error\",\n tier: \"network\",\n title: \"4XX page\",\n },\n {\n category: \"network\",\n fix: \"The deployment is erroring on this page.\",\n id: \"BLUME_AUDIT_HTTP_5XX\",\n severity: \"error\",\n tier: \"network\",\n title: \"5XX page\",\n },\n {\n category: \"network\",\n fix: \"The page did not respond in time.\",\n id: \"BLUME_AUDIT_HTTP_TIMEOUT\",\n severity: \"error\",\n tier: \"network\",\n title: \"Timed out\",\n },\n {\n category: \"network\",\n fix: \"Enable gzip or brotli on the host.\",\n id: \"BLUME_AUDIT_NOT_COMPRESSED\",\n severity: \"warning\",\n tier: \"network\",\n title: \"Not compressed\",\n },\n {\n category: \"network\",\n fix: \"The page was slow to respond.\",\n id: \"BLUME_AUDIT_SLOW_RESPONSE\",\n severity: \"warning\",\n tier: \"network\",\n title: \"Slow page\",\n },\n\n // External (`--external`)\n {\n category: \"network\",\n fix: \"Fix or remove the outbound link.\",\n id: \"BLUME_AUDIT_EXTERNAL_LINK_BROKEN\",\n severity: \"error\",\n tier: \"external\",\n title: \"External link is broken\",\n },\n {\n category: \"network\",\n fix: \"Link straight to the destination.\",\n id: \"BLUME_AUDIT_EXTERNAL_LINK_REDIRECT\",\n severity: \"info\",\n tier: \"external\",\n title: \"External link redirects\",\n },\n] as const satisfies readonly CheckMeta[];\n\nexport type CheckId = (typeof CHECKS)[number][\"id\"];\n\nconst BY_ID = new Map<string, CheckMeta>(\n CHECKS.map((check) => [check.id, check])\n);\n\nexport const checkMeta = (id: CheckId): CheckMeta => {\n const meta = BY_ID.get(id);\n if (!meta) {\n throw new Error(`Unknown audit check: ${id}`);\n }\n return meta;\n};\n\nconst DOCS_BASE = \"https://useblume.dev/docs/cli/audit\";\n\n/** `BLUME_AUDIT_TITLE_TOO_LONG` -> `…/audit#title-too-long`. */\nexport const checkDocsUrl = (id: CheckId): string =>\n `${DOCS_BASE}#${id.replace(\"BLUME_AUDIT_\", \"\").toLowerCase().replaceAll(\"_\", \"-\")}`;\n\n/** Where a finding happened: the built URL, plus the source file that fixes it. */\nexport interface FindingSite {\n url: string;\n file?: string;\n line?: number;\n column?: number;\n}\n\n/**\n * Build a diagnostic for a check. Severity, remediation, and the docs anchor all\n * come from the catalog, so a check body only supplies what's specific to the\n * occurrence: where it happened and what was actually wrong.\n */\nexport const finding = (\n id: CheckId,\n site: FindingSite,\n detail: string,\n fix?: string\n): Diagnostic => {\n const meta = checkMeta(id);\n return {\n code: id,\n column: site.column,\n docsUrl: checkDocsUrl(id),\n file: site.file,\n line: site.line,\n message: detail,\n severity: meta.severity,\n suggestion: fix ?? meta.fix,\n url: site.url,\n };\n};\n",
|
|
7
|
+
"import { mkdtemp, writeFile } from \"node:fs/promises\";\nimport { tmpdir } from \"node:os\";\n\nimport spawn from \"cross-spawn\";\nimport { join } from \"pathe\";\n\nimport { reportJson } from \"./report.ts\";\nimport type { AuditResult } from \"./run.ts\";\n\n/** A coding agent CLI the audit can hand its findings to (`--claude`, `--codex`). */\nexport interface AgentCli {\n /** The executable to look up on PATH. */\n bin: string;\n /** How to install it, shown when the executable is missing. */\n install: string;\n /** Display name for messages. */\n name: string;\n}\n\nexport type AgentKind = \"claude\" | \"codex\";\n\nexport const AGENTS = {\n claude: {\n bin: \"claude\",\n install: \"npm install -g @anthropic-ai/claude-code\",\n name: \"Claude Code\",\n },\n codex: {\n bin: \"codex\",\n install: \"npm install -g @openai/codex\",\n name: \"Codex\",\n },\n} satisfies Record<AgentKind, AgentCli>;\n\n/**\n * Write the full JSON report where the agent can read it. A file rather than\n * inline prompt text: a large site's report can exceed the platform's argv\n * limit, and the JSON already carries every finding untruncated — the terminal\n * report previews three pages per check, the file never does.\n */\nexport const writeAgentReport = async (\n result: AuditResult,\n root: string\n): Promise<string> => {\n const dir = await mkdtemp(join(tmpdir(), \"blume-audit-\"));\n const path = join(dir, \"report.json\");\n await writeFile(path, reportJson(result, root));\n return path;\n};\n\n/** The handoff prompt: where the report is, how to read it, and the ground rules. */\nexport const fixPrompt = (reportPath: string): string =>\n `Fix the issues found by \\`blume audit\\` in this project.\n\nThe full audit report is at ${reportPath}. It is JSON: each entry in \\`diagnostics\\` is one finding, with the check \\`code\\`, a \\`message\\` explaining what is wrong, the affected page \\`url\\`, the source \\`file\\` to edit (relative to the current directory, with a \\`line\\` when the finding points at a specific front matter key), and a \\`suggestion\\` describing the fix.\n\nWork through every finding:\n1. Read the report and group the findings by \\`file\\`.\n2. Apply each finding's \\`suggestion\\` by editing the named source file — most fixes are front matter edits at the cited line.\n3. Never fix a finding by deleting a page, removing content, or hiding it from the audit; if a finding genuinely needs a human decision, leave it and say so in your summary.\n\nWhen you are done, run \\`blume build\\` and then \\`blume audit\\` to verify, and repeat until the audit reports no issues.`;\n\nconst spawnAgent = (bin: string, args: string[]): Promise<number> =>\n // oxlint-disable-next-line promise/avoid-new -- adapt spawn's event callbacks\n new Promise((resolve, reject) => {\n const child = spawn(bin, args, { stdio: \"inherit\" });\n child.once(\"error\", reject);\n child.once(\"close\", (code) => resolve(code ?? 1));\n });\n\n/**\n * Run the agent CLI interactively with the handoff prompt, inheriting the\n * terminal so the user watches and steers the fixes rather than granting a\n * headless process blanket write access. Resolves with the agent's exit code;\n * rejects when the executable isn't on PATH — on every platform, since\n * cross-spawn resolves npm's `.cmd` shims itself and escapes their arguments\n * (the old `shell: true` launch left quoting to a hand-built command line and\n * reported a missing executable as cmd.exe's exit code 9009).\n *\n * cmd.exe still cannot carry the multi-line prompt as an argument (a newline\n * ends the command), so on Windows the prompt is written to a file next to\n * the report and handed over via a one-line pointer.\n */\nexport const launchAgent = async (\n bin: string,\n prompt: string,\n platform: NodeJS.Platform = process.platform\n): Promise<number> => {\n if (platform !== \"win32\") {\n return await spawnAgent(bin, [prompt]);\n }\n const dir = await mkdtemp(join(tmpdir(), \"blume-audit-\"));\n const promptPath = join(dir, \"prompt.md\");\n await writeFile(promptPath, prompt);\n return await spawnAgent(bin, [\n `Read ${promptPath} and follow its instructions exactly.`,\n ]);\n};\n\n/**\n * {@link launchAgent}, but resolving `null` instead of rejecting when the\n * executable isn't on PATH, so each command can print its own install hint.\n * Only `ENOENT` means \"not installed\" — any other spawn failure (`EACCES`,\n * `EMFILE`, …) must surface as itself, not be masked by an irrelevant hint.\n */\nexport const launchInstalledAgent = async (\n bin: string,\n prompt: string,\n platform: NodeJS.Platform = process.platform\n): Promise<number | null> => {\n try {\n return await launchAgent(bin, prompt, platform);\n } catch (error) {\n // SAFETY: only the `code` tag is inspected; a spawn failure throws an\n // ErrnoException, and any other thrown value fails the comparison and\n // rethrows unchanged.\n if ((error as NodeJS.ErrnoException)?.code !== \"ENOENT\") {\n throw error;\n }\n return null;\n }\n};\n"
|
|
8
|
+
],
|
|
9
|
+
"mappings": ";;;;;;AAAA;AAEA;;;AC2CO,IAAM,SAAS;AAAA,EAEpB;AAAA,IACE,UAAU;AAAA,IACV,KAAK;AAAA,IACL,IAAI;AAAA,IACJ,UAAU;AAAA,IACV,MAAM;AAAA,IACN,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,UAAU;AAAA,IACV,KAAK;AAAA,IACL,IAAI;AAAA,IACJ,UAAU;AAAA,IACV,MAAM;AAAA,IACN,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,UAAU;AAAA,IACV,KAAK;AAAA,IACL,IAAI;AAAA,IACJ,UAAU;AAAA,IACV,MAAM;AAAA,IACN,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,UAAU;AAAA,IACV,KAAK;AAAA,IACL,IAAI;AAAA,IACJ,UAAU;AAAA,IACV,MAAM;AAAA,IACN,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,UAAU;AAAA,IACV,KAAK;AAAA,IACL,IAAI;AAAA,IACJ,UAAU;AAAA,IACV,MAAM;AAAA,IACN,OAAO;AAAA,EACT;AAAA,EACA;AAAA,IACE,UAAU;AAAA,IACV,KAAK;AAAA,IACL,IAA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AAQ,QAAQ,CAAC,CAAC;AAAA,CACjD;AAeI,IAAM,cAAc,OACzB,KACA,QACA,WAA4B,QAAQ,aAChB;AAAA,EACpB,IAAI,aAAa,SAAS;AAAA,IACxB,OAAO,MAAM,WAAW,KAAK,CAAC,MAAM,CAAC;AAAA,EACvC;AAAA,EACA,MAAM,MAAM,MAAM,QAAQ,KAAK,OAAO,GAAG,cAAc,CAAC;AAAA,EACxD,MAAM,aAAa,KAAK,KAAK,WAAW;AAAA,EACxC,MAAM,UAAU,YAAY,MAAM;AAAA,EAClC,OAAO,MAAM,WAAW,KAAK;AAAA,IAC3B,QAAQ;AAAA,EACV,CAAC;AAAA;AASI,IAAM,uBAAuB,OAClC,KACA,QACA,WAA4B,QAAQ,aACT;AAAA,EAC3B,IAAI;AAAA,IACF,OAAO,MAAM,YAAY,KAAK,QAAQ,QAAQ;AAAA,IAC9C,OAAO,OAAO;AAAA,IAId,IAAK,OAAiC,SAAS,UAAU;AAAA,MACvD,MAAM;AAAA,IACR;AAAA,IACA,OAAO;AAAA;AAAA;",
|
|
10
|
+
"debugId": "5656C1323785977064756E2164756E21",
|
|
11
|
+
"names": []
|
|
12
|
+
}
|
|
@@ -15,6 +15,22 @@ var emptyComponentOverrides = () => ({
|
|
|
15
15
|
var GROUPS = ["mdx", "layout"];
|
|
16
16
|
var GROUP_SET = new Set(GROUPS);
|
|
17
17
|
var isGroup = (name) => GROUP_SET.has(name);
|
|
18
|
+
var LAYOUT_SLOTS = [
|
|
19
|
+
"Layout",
|
|
20
|
+
"Header",
|
|
21
|
+
"Logo",
|
|
22
|
+
"Search",
|
|
23
|
+
"Sidebar",
|
|
24
|
+
"MobileNav",
|
|
25
|
+
"Breadcrumbs",
|
|
26
|
+
"TableOfContents",
|
|
27
|
+
"Pagination",
|
|
28
|
+
"Feedback",
|
|
29
|
+
"PageHeader",
|
|
30
|
+
"PageFooter",
|
|
31
|
+
"Footer"
|
|
32
|
+
];
|
|
33
|
+
var LAYOUT_SLOT_SET = new Set(LAYOUT_SLOTS);
|
|
18
34
|
var ACCEPTED_OVERRIDE_FORMS = "Each override must be an imported identifier, a path string, or a `{ component, client, media }` object literal whose `component` is an imported identifier or a path string.";
|
|
19
35
|
var FRAMEWORK_BY_EXT = new Map([
|
|
20
36
|
["jsx", "react"],
|
|
@@ -295,6 +311,9 @@ var collectGroupOverrides = (property, context, result) => {
|
|
|
295
311
|
if (normalized) {
|
|
296
312
|
result[name].push(normalized);
|
|
297
313
|
}
|
|
314
|
+
if (name === "layout" && normalized && !LAYOUT_SLOT_SET.has(normalized.key)) {
|
|
315
|
+
context.warnings.push(`Layout override "${normalized.key}" isn't a layout slot, so nothing renders it. Use one of: ${LAYOUT_SLOTS.join(", ")}.`);
|
|
316
|
+
}
|
|
298
317
|
}
|
|
299
318
|
};
|
|
300
319
|
|
|
@@ -370,5 +389,5 @@ var analyzeComponentOverrides = (source, filePath) => {
|
|
|
370
389
|
|
|
371
390
|
export { emptyComponentOverrides, ComponentOverridesError, analyzeComponentOverrides };
|
|
372
391
|
|
|
373
|
-
//# debugId=
|
|
374
|
-
//# sourceMappingURL=chunk-
|
|
392
|
+
//# debugId=59653B23465A56F364756E2164756E21
|
|
393
|
+
//# sourceMappingURL=chunk-54ztw1nj.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/core/component-overrides.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { existsSync } from \"node:fs\";\n\nimport { basename, dirname, extname, isAbsolute, join, resolve } from \"pathe\";\nimport ts from \"typescript\";\n\nimport { BlumeError } from \"./diagnostics.ts\";\nimport type { HydrationMode } from \"./schema.ts\";\nimport type { Diagnostic } from \"./types.ts\";\n\n/**\n * Static analysis of a user `components.ts`/`.tsx`.\n *\n * Astro can only hydrate a component it imports *statically by path*, so to honor\n * hydration on overrides Blume needs each override's source path and client mode\n * at generate time — before Vite compiles anything. We read that here by parsing\n * the file with the TypeScript compiler API (never executing it, so `.astro`/React\n * imports don't need a Node loader).\n *\n * Only statically-analyzable authoring is accepted: a default export that is an\n * object literal or a `defineComponents({ ... })` call, whose `mdx`/`layout`\n * groups are object literals with entries that are imported identifiers, path\n * strings, or `{ component, client, media }` object literals, and a relative\n * or absolute path must name a file that exists. Anything else is a config\n * error ({@link ComponentOverridesError}, `BLUME_COMPONENTS_INVALID`) naming the\n * entry, its line, and the accepted forms — there is no runtime fallback, so an\n * override that can't be planned never silently renders without hydration, and\n * a missing file never surfaces as a bundler error inside the generated runtime.\n */\n\nexport type OverrideFramework = \"react\" | \"svelte\" | \"vue\";\n\n/** How a wrapper should import an override's component. */\nexport interface OverrideImport {\n /** Framework inferred from the file extension, or null (e.g. `.astro`). */\n framework: OverrideFramework | null;\n /** Exported name to import: `\"default\"` or a named export. */\n name: string;\n /** Absolute path (for relative/absolute specifiers) or a bare specifier. */\n path: string;\n}\n\n/** A normalized override entry, keyed by its MDX tag / layout-slot name. */\nexport interface NormalizedOverride {\n /** Present when the override should hydrate; drives the `client:*` directive. */\n client?: HydrationMode;\n key: string;\n /** Media query for `client: \"media\"`. */\n media?: string;\n /** How to obtain the component. */\n source: OverrideImport;\n}\n\nexport interface ComponentOverrideAnalysis {\n layout: NormalizedOverride[];\n mdx: NormalizedOverride[];\n warnings: string[];\n}\n\n/** The analysis of a project with no `components.ts`. */\nexport const emptyComponentOverrides = (): ComponentOverrideAnalysis => ({\n layout: [],\n mdx: [],\n warnings: [],\n});\n\nconst GROUPS = [\"mdx\", \"layout\"] as const;\nconst GROUP_SET = new Set<string>(GROUPS);\ntype Group = (typeof GROUPS)[number];\n\nconst isGroup = (name: string): name is Group => GROUP_SET.has(name);\n\n/**\n * The `layout` keys the built-in chrome reads (`RootLayout.astro` and\n * `Header.astro`). Any other key is never rendered, so it's warned about\n * rather than silently dropped; a typo or wrong case would otherwise leave\n * the built-in in place with no sign why.\n */\nconst LAYOUT_SLOTS = [\n \"Layout\",\n \"Header\",\n \"Logo\",\n \"Search\",\n \"Sidebar\",\n \"MobileNav\",\n \"Breadcrumbs\",\n \"TableOfContents\",\n \"Pagination\",\n \"Feedback\",\n \"PageHeader\",\n \"PageFooter\",\n \"Footer\",\n];\nconst LAYOUT_SLOT_SET: ReadonlySet<string> = new Set(LAYOUT_SLOTS);\n\n/** The authoring forms an override accepts; the fix every rejection points at. */\nexport const ACCEPTED_OVERRIDE_FORMS =\n \"Each override must be an imported identifier, a path string, or a `{ component, client, media }` object literal whose `component` is an imported identifier or a path string.\";\n\nconst FRAMEWORK_BY_EXT = new Map<string, OverrideFramework>([\n [\"jsx\", \"react\"],\n [\"svelte\", \"svelte\"],\n [\"tsx\", \"react\"],\n [\"vue\", \"vue\"],\n]);\n\nconst FRAMEWORK_LABEL = {\n react: \"React\",\n svelte: \"Svelte\",\n vue: \"Vue\",\n} satisfies Record<OverrideFramework, string>;\n\n/** Extensions probed (in order) when a specifier omits one. */\nconst COMPONENT_EXTS = [\n \"astro\",\n \"tsx\",\n \"ts\",\n \"jsx\",\n \"js\",\n \"mjs\",\n \"vue\",\n \"svelte\",\n];\n\nconst HYDRATION_MODES: ReadonlySet<string> = new Set<HydrationMode>([\n \"idle\",\n \"load\",\n \"media\",\n \"only\",\n \"visible\",\n]);\n\nconst HYDRATION_MODE_LIST = '\"load\", \"idle\", \"visible\", \"media\", or \"only\"';\n\nconst isHydrationMode = (value: string): value is HydrationMode =>\n HYDRATION_MODES.has(value);\n\ninterface ImportBinding {\n /** Exported name: `\"default\"` or a named export. */\n imported: string;\n /** The import statement, where a missing file is reported. */\n node: ts.ImportDeclaration;\n specifier: string;\n}\n\n/** Why one entry was rejected, and the node it's about (for its line). */\ninterface Rejection {\n message: string;\n /** A path that names no file: the fix is the path, not the entry's form. */\n missingFile?: boolean;\n node?: ts.Node;\n}\n\n/** An override's declared component before framework/path resolution. */\ninterface RawDescriptor {\n client?: HydrationMode;\n media?: string;\n source: OverrideImport | null;\n}\n\n/** Everything one analysis pass needs to resolve and report an entry. */\ninterface AnalysisContext {\n dir: string;\n /** Rejections collected across the file; thrown together at the end. */\n errors: Rejection[];\n imports: Map<string, ImportBinding>;\n warnings: string[];\n}\n\nconst reject = (\n context: AnalysisContext,\n message: string,\n node?: ts.Node,\n missingFile?: boolean\n): void => {\n context.errors.push({ message, missingFile, node });\n};\n\nconst propName = (name: ts.PropertyName): string | undefined =>\n ts.isIdentifier(name) || ts.isStringLiteral(name) ? name.text : undefined;\n\n/** Record the bindings declared by one import statement into `map`. */\nconst addImportBindings = (\n map: Map<string, ImportBinding>,\n statement: ts.Statement\n): void => {\n if (\n !ts.isImportDeclaration(statement) ||\n !ts.isStringLiteral(statement.moduleSpecifier)\n ) {\n return;\n }\n const specifier = statement.moduleSpecifier.text;\n const clause = statement.importClause;\n if (!clause) {\n return;\n }\n if (clause.name) {\n map.set(clause.name.text, {\n imported: \"default\",\n node: statement,\n specifier,\n });\n }\n const named = clause.namedBindings;\n if (named && ts.isNamedImports(named)) {\n for (const element of named.elements) {\n map.set(element.name.text, {\n imported: (element.propertyName ?? element.name).text,\n node: statement,\n specifier,\n });\n }\n }\n};\n\n/** Map each local binding name to the module + exported name it came from. */\nconst collectImports = (\n sourceFile: ts.SourceFile\n): Map<string, ImportBinding> => {\n const map = new Map<string, ImportBinding>();\n for (const statement of sourceFile.statements) {\n addImportBindings(map, statement);\n }\n return map;\n};\n\n/** Unwrap `defineComponents({...})`, `({...})`, or `{...} as T` to the object. */\nconst unwrapObject = (\n expression: ts.Expression\n): ts.ObjectLiteralExpression | undefined => {\n if (ts.isObjectLiteralExpression(expression)) {\n return expression;\n }\n if (ts.isCallExpression(expression)) {\n const [arg] = expression.arguments;\n return arg && ts.isObjectLiteralExpression(arg) ? arg : undefined;\n }\n if (\n ts.isAsExpression(expression) ||\n ts.isParenthesizedExpression(expression)\n ) {\n return unwrapObject(expression.expression);\n }\n return undefined;\n};\n\nconst findDefaultExport = (\n sourceFile: ts.SourceFile\n): ts.ExportAssignment | undefined =>\n sourceFile.statements.find(\n (statement): statement is ts.ExportAssignment =>\n ts.isExportAssignment(statement) && !statement.isExportEquals\n );\n\nconst probeExtension = (base: string): string | null => {\n for (const extension of COMPONENT_EXTS) {\n const candidate = `${base}.${extension}`;\n if (existsSync(candidate)) {\n return candidate;\n }\n }\n return null;\n};\n\n// A `.js` specifier in a TypeScript file may name its `.ts`/`.tsx` source, as\n// Vite resolves it; the same holds for `.jsx` and `.mjs`.\nconst SCRIPT_EXT = /\\.(?:jsx?|mjs)$/u;\nconst TS_SOURCE_EXTS = [\"ts\", \"tsx\", \"mts\"];\n\n/**\n * Whether a local path names something the bundler can import: the file\n * itself, the file with a component extension added, a folder's `index`, or\n * the TypeScript source a `.js` specifier stands for.\n */\nconst resolvesLocally = (absolute: string): boolean => {\n if (existsSync(absolute) || probeExtension(absolute)) {\n return true;\n }\n if (probeExtension(join(absolute, \"index\"))) {\n return true;\n }\n const base = absolute.replace(SCRIPT_EXT, \"\");\n return (\n base !== absolute &&\n TS_SOURCE_EXTS.some((extension) => existsSync(`${base}.${extension}`))\n );\n};\n\n/** Resolve a module specifier to a wrapper-importable path + framework. */\nconst toImport = (\n specifier: string,\n imported: string,\n dir: string\n): OverrideImport => {\n const relative = specifier.startsWith(\".\") || isAbsolute(specifier);\n let path = specifier;\n let extension = extname(specifier).slice(1).toLowerCase();\n if (relative) {\n const absolute = isAbsolute(specifier)\n ? specifier\n : resolve(dir, specifier);\n if (extension) {\n path = absolute;\n } else {\n const probed = probeExtension(absolute);\n path = probed ?? absolute;\n extension = probed ? extname(probed).slice(1).toLowerCase() : \"\";\n }\n }\n return {\n framework: FRAMEWORK_BY_EXT.get(extension) ?? null,\n name: imported,\n path,\n };\n};\n\n/**\n * Resolve a specifier to its import, or record that the file it names doesn't\n * exist. A bare package specifier is left to the bundler.\n */\nconst sourceFor = (\n specifier: string,\n imported: string,\n label: string,\n node: ts.Node,\n context: AnalysisContext\n): OverrideImport | null => {\n const local = specifier.startsWith(\".\") || isAbsolute(specifier);\n if (local && !resolvesLocally(resolve(context.dir, specifier))) {\n reject(\n context,\n `${label} points at \"${specifier}\", but no file exists there; fix the path or restore the file.`,\n node,\n true\n );\n return null;\n }\n return toImport(specifier, imported, context.dir);\n};\n\n/**\n * Resolve an identifier to the import it names, or record why it can't be: a\n * local binding (a `const`, a function declared in the file) has no source path\n * a wrapper could import.\n */\nconst resolveIdentifier = (\n name: string,\n label: string,\n node: ts.Node,\n context: AnalysisContext\n): OverrideImport | null => {\n const binding = context.imports.get(name);\n if (binding) {\n return sourceFor(\n binding.specifier,\n binding.imported,\n label,\n binding.node,\n context\n );\n }\n reject(\n context,\n `${label} refers to \"${name}\", which isn't imported in this file; import the component from its file.`,\n node\n );\n return null;\n};\n\nconst ALLOWED_FIELDS =\n \"only `component`, `client`, and `media` are allowed in a descriptor.\";\n\n/** Fold one descriptor-object property into the accumulating descriptor. */\nconst applyDescriptorProperty = (\n descriptor: RawDescriptor,\n property: ts.ObjectLiteralElementLike,\n label: string,\n context: AnalysisContext\n): void => {\n if (ts.isShorthandPropertyAssignment(property)) {\n if (property.name.text === \"component\") {\n descriptor.source = resolveIdentifier(\n property.name.text,\n `${label}'s \\`component\\``,\n property,\n context\n );\n return;\n }\n const shorthand = property.name.text;\n if (shorthand === \"client\" || shorthand === \"media\") {\n reject(\n context,\n `${label} writes \\`${shorthand}\\` as a shorthand property; only \\`component\\` may be shorthand, \\`${shorthand}\\` must be a string literal.`,\n property\n );\n return;\n }\n reject(\n context,\n `${label} has a \\`${shorthand}\\` field; ${ALLOWED_FIELDS}`,\n property\n );\n return;\n }\n if (!ts.isPropertyAssignment(property)) {\n reject(\n context,\n `${label} contains a spread, method, or accessor; write it as a plain \\`{ component, client, media }\\` object literal.`,\n property\n );\n return;\n }\n const name = propName(property.name);\n const init = property.initializer;\n if (name === \"component\") {\n if (ts.isStringLiteral(init)) {\n descriptor.source = sourceFor(\n init.text,\n \"default\",\n `${label}'s \\`component\\``,\n init,\n context\n );\n } else if (ts.isIdentifier(init)) {\n descriptor.source = resolveIdentifier(\n init.text,\n `${label}'s \\`component\\``,\n init,\n context\n );\n } else {\n reject(\n context,\n `${label}'s \\`component\\` must be an imported identifier or a path string.`,\n init\n );\n }\n } else if (name === \"client\") {\n if (ts.isStringLiteral(init) && isHydrationMode(init.text)) {\n descriptor.client = init.text;\n } else {\n reject(\n context,\n `${label}'s \\`client\\` must be a string literal: ${HYDRATION_MODE_LIST}.`,\n init\n );\n }\n } else if (name === \"media\") {\n if (ts.isStringLiteral(init)) {\n descriptor.media = init.text;\n } else {\n reject(context, `${label}'s \\`media\\` must be a string literal.`, init);\n }\n } else {\n reject(\n context,\n `${label} has a \\`${name ?? property.name.getText()}\\` field; ${ALLOWED_FIELDS}`,\n property\n );\n }\n};\n\n/**\n * Read a `{ component, client, media }` descriptor. Returns null (after\n * recording the reason) when it can't be planned.\n */\nconst readDescriptor = (\n object: ts.ObjectLiteralExpression,\n label: string,\n context: AnalysisContext\n): RawDescriptor | null => {\n const descriptor: RawDescriptor = { source: null };\n const before = context.errors.length;\n let hadComponent = false;\n for (const property of object.properties) {\n if (property.name && propName(property.name) === \"component\") {\n hadComponent = true;\n }\n applyDescriptorProperty(descriptor, property, label, context);\n }\n if (!hadComponent) {\n reject(\n context,\n `${label} is an object literal without a \\`component\\` field.`,\n object\n );\n }\n return context.errors.length === before ? descriptor : null;\n};\n\n/** Apply cross-cutting validation and produce the final normalized override. */\nconst finalize = (\n key: string,\n descriptor: RawDescriptor,\n label: string,\n warnings: string[]\n): NormalizedOverride | null => {\n const { client, media, source } = descriptor;\n if (!source) {\n return null;\n }\n\n if (client === \"media\" && !media) {\n warnings.push(\n `Override \"${key}\" uses client: \"media\" but no \\`media\\` query was given; it will hydrate as if \\`client: \"load\"\\`.`\n );\n }\n\n if (client === \"only\" && !source.framework) {\n warnings.push(\n `Override \"${key}\" uses client: \"only\" but its framework couldn't be inferred; reference a .tsx/.jsx/.vue/.svelte file.`\n );\n }\n\n if (!client && source.framework) {\n warnings.push(\n `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\" }\\`.`\n );\n }\n\n const normalized: NormalizedOverride = { key, source };\n if (client) {\n normalized.client = client;\n }\n if (media) {\n normalized.media = media;\n }\n return normalized;\n};\n\n/** Normalize one `key: value` entry of a group, or record why it's rejected. */\nconst normalizeEntry = (\n entry: ts.ObjectLiteralElementLike,\n group: Group,\n context: AnalysisContext\n): NormalizedOverride | null => {\n const { warnings } = context;\n\n if (ts.isShorthandPropertyAssignment(entry)) {\n const name = entry.name.text;\n return finalize(\n name,\n { source: resolveIdentifier(name, `${group}.${name}`, entry, context) },\n name,\n warnings\n );\n }\n\n if (ts.isSpreadAssignment(entry)) {\n reject(\n context,\n `${group} contains a spread (\\`...${entry.expression.getText()}\\`); list each override explicitly.`,\n entry\n );\n return null;\n }\n const key = propName(entry.name);\n if (!key) {\n reject(\n context,\n `${group} has an entry with a computed key (\\`${entry.name.getText()}\\`); keys must be plain names.`,\n entry\n );\n return null;\n }\n const label = `${group}.${key}`;\n if (!ts.isPropertyAssignment(entry)) {\n reject(\n context,\n `${label} is a method or accessor, which Blume can't analyze statically.`,\n entry\n );\n return null;\n }\n const value = entry.initializer;\n\n if (ts.isIdentifier(value)) {\n return finalize(\n key,\n { source: resolveIdentifier(value.text, label, entry, context) },\n value.text,\n warnings\n );\n }\n if (ts.isStringLiteral(value)) {\n return finalize(\n key,\n { source: sourceFor(value.text, \"default\", label, value, context) },\n value.text,\n warnings\n );\n }\n if (ts.isObjectLiteralExpression(value)) {\n const descriptor = readDescriptor(value, label, context);\n return descriptor ? finalize(key, descriptor, key, warnings) : null;\n }\n\n reject(\n context,\n `${label} is an inline expression, which Blume can't analyze statically.`,\n entry\n );\n return null;\n};\n\n/** Normalize one top-level `{ mdx | layout }` group into `result`. */\nconst collectGroupOverrides = (\n property: ts.ObjectLiteralElementLike,\n context: AnalysisContext,\n result: ComponentOverrideAnalysis\n): void => {\n if (ts.isSpreadAssignment(property)) {\n reject(\n context,\n `The top-level object contains a spread (\\`...${property.expression.getText()}\\`); list \\`mdx\\` and \\`layout\\` explicitly.`,\n property\n );\n return;\n }\n const name = propName(property.name);\n if (name === \"islands\") {\n reject(\n context,\n 'The `islands` group was folded into `mdx`: move each entry there and give it a `client` mode, e.g. `mdx: { Counter: { component: Counter, client: \"visible\" } }`.',\n property\n );\n return;\n }\n if (!(name && isGroup(name))) {\n reject(\n context,\n `\\`${name ?? property.name.getText()}\\` isn't an override group; use \\`mdx\\` or \\`layout\\`.`,\n property\n );\n return;\n }\n if (\n !ts.isPropertyAssignment(property) ||\n !ts.isObjectLiteralExpression(property.initializer)\n ) {\n reject(\n context,\n `\\`${name}\\` must be an object literal of overrides.`,\n property\n );\n return;\n }\n for (const entry of property.initializer.properties) {\n const normalized = normalizeEntry(entry, name, context);\n if (normalized) {\n result[name].push(normalized);\n }\n if (\n name === \"layout\" &&\n normalized &&\n !LAYOUT_SLOT_SET.has(normalized.key)\n ) {\n context.warnings.push(\n `Layout override \"${normalized.key}\" isn't a layout slot, so nothing renders it. Use one of: ${LAYOUT_SLOTS.join(\", \")}.`\n );\n }\n }\n};\n\n/**\n * A `components.ts` Blume can't plan. The diagnostic lists every rejected entry\n * at once (at the first one's line); `issues` holds each on its own, with its\n * line, for a caller that reports them one by one (`blume upgrade`).\n */\nexport class ComponentOverridesError extends BlumeError {\n readonly issues: Diagnostic[];\n\n constructor(diagnostic: Diagnostic, issues: Diagnostic[]) {\n super(diagnostic);\n this.name = \"ComponentOverridesError\";\n this.issues = issues;\n }\n}\n\n/** A rejection as a diagnostic, at its node's line when it has one. */\nconst rejectionDiagnostic = (\n filePath: string,\n sourceFile: ts.SourceFile,\n rejection: Rejection\n): Diagnostic => {\n const position = rejection.node\n ? sourceFile.getLineAndCharacterOfPosition(\n rejection.node.getStart(sourceFile)\n )\n : undefined;\n return {\n code: \"BLUME_COMPONENTS_INVALID\",\n column: position && position.character + 1,\n file: filePath,\n line: position && position.line + 1,\n message: rejection.message,\n severity: \"error\",\n suggestion: rejection.missingFile ? undefined : ACCEPTED_OVERRIDE_FORMS,\n };\n};\n\nconst invalidOverrides = (\n filePath: string,\n sourceFile: ts.SourceFile,\n rejections: Rejection[]\n): ComponentOverridesError => {\n const issues = rejections.map((rejection) =>\n rejectionDiagnostic(filePath, sourceFile, rejection)\n );\n const first = issues.find((issue) => issue.line !== undefined);\n return new ComponentOverridesError(\n {\n code: \"BLUME_COMPONENTS_INVALID\",\n column: first?.column,\n file: filePath,\n line: first?.line,\n message: `${basename(filePath)} has ${rejections.length} override(s) Blume can't plan:\\n${rejections.map((rejection) => ` - ${rejection.message}`).join(\"\\n\")}`,\n severity: \"error\",\n suggestion: rejections.every((rejection) => rejection.missingFile)\n ? undefined\n : ACCEPTED_OVERRIDE_FORMS,\n },\n issues\n );\n};\n\n/**\n * Parse a user `components.ts`/`.tsx` and return its normalized overrides. Never\n * executes the file. Throws a `BLUME_COMPONENTS_INVALID`\n * {@link ComponentOverridesError} listing every entry that isn't one of the\n * accepted forms or points at a file that doesn't exist.\n */\nexport const analyzeComponentOverrides = (\n source: string,\n filePath: string\n): ComponentOverrideAnalysis => {\n const result = emptyComponentOverrides();\n const sourceFile = ts.createSourceFile(\n filePath,\n source,\n ts.ScriptTarget.Latest,\n true,\n filePath.endsWith(\"tsx\") ? ts.ScriptKind.TSX : ts.ScriptKind.TS\n );\n\n const exported = findDefaultExport(sourceFile);\n if (!exported) {\n throw invalidOverrides(filePath, sourceFile, [\n {\n message:\n \"No default export was found; export `defineComponents({ mdx, layout })` (or a plain object literal) as the default.\",\n },\n ]);\n }\n const object = unwrapObject(exported.expression);\n if (!object) {\n throw invalidOverrides(filePath, sourceFile, [\n {\n message:\n \"The default export isn't an object literal or a `defineComponents({ ... })` call.\",\n node: exported,\n },\n ]);\n }\n\n const context: AnalysisContext = {\n dir: dirname(filePath),\n errors: [],\n imports: collectImports(sourceFile),\n warnings: result.warnings,\n };\n\n for (const property of object.properties) {\n collectGroupOverrides(property, context, result);\n }\n\n if (context.errors.length > 0) {\n throw invalidOverrides(filePath, sourceFile, context.errors);\n }\n return result;\n};\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;;;AAAA;AAEA;AACA;AAwDO,IAAM,0BAA0B,OAAkC;AAAA,EACvE,QAAQ,CAAC;AAAA,EACT,KAAK,CAAC;AAAA,EACN,UAAU,CAAC;AACb;AAEA,IAAM,SAAS,CAAC,OAAO,QAAQ;AAC/B,IAAM,YAAY,IAAI,IAAY,MAAM;AAGxC,IAAM,UAAU,CAAC,SAAgC,UAAU,IAAI,IAAI;AAQnE,IAAM,eAAe;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AACA,IAAM,kBAAuC,IAAI,IAAI,YAAY;AAG1D,IAAM,0BACX;AAEF,IAAM,mBAAmB,IAAI,IAA+B;AAAA,EAC1D,CAAC,OAAO,OAAO;AAAA,EACf,CAAC,UAAU,QAAQ;AAAA,EACnB,CAAC,OAAO,OAAO;AAAA,EACf,CAAC,OAAO,KAAK;AACf,CAAC;AAED,IAAM,kBAAkB;AAAA,EACtB,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,KAAK;AACP;AAGA,IAAM,iBAAiB;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,IAAM,kBAAuC,IAAI,IAAmB;AAAA,EAClE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,IAAM,sBAAsB;AAE5B,IAAM,kBAAkB,CAAC,UACvB,gBAAgB,IAAI,KAAK;AAkC3B,IAAM,SAAS,CACb,SACA,SACA,MACA,gBACS;AAA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B,QAAQ,CAAC;AAAA,IACT,SAAS,eAAe,UAAU;AAAA,IAClC,UAAU,OAAO;AAAA,EACnB;AAAA,EAEA,WAAW,YAAY,OAAO,YAAY;AAAA,IACxC,sBAAsB,UAAU,SAAS,MAAM;AAAA,EACjD;AAAA,EAEA,IAAI,QAAQ,OAAO,SAAS,GAAG;AAAA,IAC7B,MAAM,iBAAiB,UAAU,YAAY,QAAQ,MAAM;AAAA,EAC7D;AAAA,EACA,OAAO;AAAA;",
|
|
8
|
+
"debugId": "59653B23465A56F364756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./index.js";
|
|
10
10
|
import {
|
|
11
11
|
AGENTS
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-42t4jxdx.js";
|
|
13
13
|
import {
|
|
14
14
|
i18nEnabled,
|
|
15
15
|
localeCodes,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
folderMetaSchema,
|
|
19
19
|
scanBody,
|
|
20
20
|
createModuleLoader
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-ehweg4fr.js";
|
|
22
22
|
import {
|
|
23
23
|
seconds,
|
|
24
24
|
money,
|
|
@@ -27,18 +27,18 @@ import {
|
|
|
27
27
|
runAgentHeadless,
|
|
28
28
|
CODEX_LOCKDOWN,
|
|
29
29
|
readAgentOutput
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-0n9xkp3d.js";
|
|
31
31
|
import {
|
|
32
32
|
writeTextAtomic
|
|
33
33
|
} from "./chunk-jq5n4avg.js";
|
|
34
34
|
import {
|
|
35
35
|
findFolderMetaFiles,
|
|
36
36
|
scanProject
|
|
37
|
-
} from "./chunk-
|
|
38
|
-
import"./chunk-
|
|
37
|
+
} from "./chunk-ncj7w596.js";
|
|
38
|
+
import"./chunk-zccbjcj0.js";
|
|
39
39
|
import {
|
|
40
40
|
parseTimeoutSeconds
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-j134vrp2.js";
|
|
42
42
|
|
|
43
43
|
// src/cli/commands/translate.ts
|
|
44
44
|
import { defineCommand } from "citty";
|
|
@@ -477,6 +477,7 @@ ${previousTranslation}`;
|
|
|
477
477
|
Rules:
|
|
478
478
|
- Translate the prose: headings, paragraphs, list items, table cells, admonitions, and image alt text.
|
|
479
479
|
- In the YAML frontmatter, translate ONLY the values of these keys: ${KEY_LIST}. Copy every other frontmatter key and value exactly as written.
|
|
480
|
+
- Keep the frontmatter valid YAML: if a translated value contains a colon followed by a space (\`: \`) or a space followed by \`#\`, or starts with a quote, a backtick, or another YAML indicator character, write it as a double-quoted string and escape any double quotes inside it.
|
|
480
481
|
- Never translate or alter: code blocks, inline code, import/export statements, JSX/MDX component names and their attributes, URLs, link targets, HTML tags, or frontmatter keys.
|
|
481
482
|
- A heading may end with anchor markers: \`[#some-id]\`, \`{#some-id}\` (also written \`\\{#some-id\\}\`), \`[!toc]\`, or \`[toc]\`. Copy every marker exactly as written, in the same position at the end of the translated heading — never translate, reorder, or drop a marker, and never change the id inside \`[#...]\` or \`{#...}\` (anchors must stay identical across languages).
|
|
482
483
|
|
|
@@ -573,6 +574,18 @@ var setPath = (data, path, value) => {
|
|
|
573
574
|
}
|
|
574
575
|
parent[path.at(-1)] = value;
|
|
575
576
|
};
|
|
577
|
+
var dropCanonical = (data) => {
|
|
578
|
+
const { seo } = data;
|
|
579
|
+
if (!isKeyedObject(seo) || !("canonical" in seo)) {
|
|
580
|
+
return;
|
|
581
|
+
}
|
|
582
|
+
const { canonical: _canonical, ...rest } = seo;
|
|
583
|
+
if (Object.keys(rest).length > 0) {
|
|
584
|
+
data.seo = rest;
|
|
585
|
+
} else {
|
|
586
|
+
delete data.seo;
|
|
587
|
+
}
|
|
588
|
+
};
|
|
576
589
|
var ensureTrailingNewline = (text) => text.endsWith(`
|
|
577
590
|
`) ? text : `${text}
|
|
578
591
|
`;
|
|
@@ -593,8 +606,12 @@ var validateTranslation = (sourceText, agentText) => {
|
|
|
593
606
|
let parsed;
|
|
594
607
|
try {
|
|
595
608
|
parsed = frontmatter_default(candidate);
|
|
596
|
-
} catch {
|
|
597
|
-
|
|
609
|
+
} catch (error) {
|
|
610
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
611
|
+
return {
|
|
612
|
+
ok: false,
|
|
613
|
+
reason: `frontmatter does not parse as YAML: ${message.replace(/\n[\s\S]*$/u, "")}`
|
|
614
|
+
};
|
|
598
615
|
}
|
|
599
616
|
const rawBody = ensureTrailingNewline(parsed.content.replace(/^\r?\n/u, ""));
|
|
600
617
|
if (rawBody.trim() === "") {
|
|
@@ -620,6 +637,7 @@ var validateTranslation = (sourceText, agentText) => {
|
|
|
620
637
|
setPath(data, path, translated);
|
|
621
638
|
}
|
|
622
639
|
}
|
|
640
|
+
dropCanonical(data);
|
|
623
641
|
return {
|
|
624
642
|
ok: true,
|
|
625
643
|
text: ensureTrailingNewline(frontmatter_default.stringify(body, data))
|
|
@@ -1193,5 +1211,5 @@ export {
|
|
|
1193
1211
|
translateCommand
|
|
1194
1212
|
};
|
|
1195
1213
|
|
|
1196
|
-
//# debugId=
|
|
1197
|
-
//# sourceMappingURL=chunk-
|
|
1214
|
+
//# debugId=7CBDF68DDB18B6AB64756E2164756E21
|
|
1215
|
+
//# sourceMappingURL=chunk-5vjtgs6e.js.map
|