blume 2.1.0 → 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/CHANGELOG.md +94 -0
- package/dist/cli/{chunk-5cg2rzgf.js → chunk-073rdvgb.js} +19 -48
- package/dist/cli/{chunk-5cg2rzgf.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-rekqz4qg.js → chunk-313vnn40.js} +16 -15
- package/dist/cli/chunk-313vnn40.js.map +10 -0
- package/dist/cli/{chunk-gp84za0h.js → chunk-3v3ffbrj.js} +2 -2
- package/dist/cli/{chunk-9xr4dgee.js → chunk-3x6x3pph.js} +29 -16
- package/dist/cli/chunk-3x6x3pph.js.map +10 -0
- package/dist/cli/{chunk-0gz36akr.js → chunk-42t4jxdx.js} +21 -5
- package/dist/cli/chunk-42t4jxdx.js.map +12 -0
- package/dist/cli/{chunk-ta27feev.js → chunk-54ztw1nj.js} +21 -2
- package/dist/cli/chunk-54ztw1nj.js.map +10 -0
- package/dist/cli/{chunk-jnwj5kjj.js → chunk-5vjtgs6e.js} +20 -7
- package/dist/cli/{chunk-jnwj5kjj.js.map → chunk-5vjtgs6e.js.map} +3 -3
- package/dist/cli/chunk-66w9j7p6.js +322 -0
- package/dist/cli/chunk-66w9j7p6.js.map +14 -0
- package/dist/cli/{chunk-nd1821sk.js → chunk-7ppf1rva.js} +32 -18
- package/dist/cli/chunk-7ppf1rva.js.map +10 -0
- package/dist/cli/{chunk-p804f3pe.js → chunk-8y2kmjv8.js} +6 -6
- package/dist/cli/{chunk-2f7n4qzt.js → chunk-c1y538kd.js} +1 -1
- package/dist/cli/{chunk-1n228xqb.js → chunk-c887fj0s.js} +2 -2
- package/dist/cli/{chunk-y5h4r2y0.js → chunk-cfyg47zg.js} +15 -5
- package/dist/cli/chunk-cfyg47zg.js.map +10 -0
- package/dist/cli/{chunk-cmtcnh9f.js → chunk-dzwehpy7.js} +2 -2
- package/dist/cli/{chunk-h2a48yhd.js → chunk-e6atmn4h.js} +119 -15
- package/dist/cli/{chunk-h2a48yhd.js.map → chunk-e6atmn4h.js.map} +10 -10
- package/dist/cli/{chunk-5ffywsmb.js → chunk-e8xw9qkh.js} +8 -6
- package/dist/cli/{chunk-5ffywsmb.js.map → chunk-e8xw9qkh.js.map} +3 -3
- package/dist/cli/{chunk-ntv4qrt7.js → chunk-e9q7a2ak.js} +14 -14
- package/dist/cli/{chunk-xkz5xbtv.js → chunk-ehweg4fr.js} +2366 -1114
- package/dist/cli/chunk-ehweg4fr.js.map +218 -0
- package/dist/cli/{chunk-zf748avv.js → chunk-ep6nd0rn.js} +176 -281
- package/dist/cli/{chunk-zf748avv.js.map → chunk-ep6nd0rn.js.map} +11 -12
- package/dist/cli/{chunk-yxmk4pec.js → chunk-fdrkhpjy.js} +16 -15
- package/dist/cli/{chunk-yxmk4pec.js.map → chunk-fdrkhpjy.js.map} +3 -3
- package/dist/cli/{chunk-5wj2qwn2.js → chunk-ft9vfys6.js} +4 -4
- package/dist/cli/{chunk-4h8z9vv5.js → chunk-gb420vvz.js} +89 -46
- package/dist/cli/chunk-gb420vvz.js.map +17 -0
- package/dist/cli/{chunk-713mngdq.js → chunk-hebn0tpx.js} +76 -10
- package/dist/cli/chunk-hebn0tpx.js.map +14 -0
- package/dist/cli/{chunk-2n4ps1b3.js → chunk-htrwgabr.js} +40 -22
- package/dist/cli/chunk-htrwgabr.js.map +15 -0
- package/dist/cli/{chunk-zhvd6adm.js → chunk-hx3xqnk9.js} +13 -13
- package/dist/cli/chunk-j134vrp2.js +65 -0
- package/dist/cli/chunk-j134vrp2.js.map +10 -0
- package/dist/cli/{chunk-y4ykbark.js → chunk-kma9f6sf.js} +2 -2
- package/dist/cli/{chunk-py62fewh.js → chunk-mrcccgnh.js} +3 -3
- package/dist/cli/{chunk-2f3ndkpw.js → chunk-n0v7m8ry.js} +3 -3
- package/dist/cli/{chunk-43zcf4gz.js → chunk-ncj7w596.js} +522 -353
- package/dist/cli/chunk-ncj7w596.js.map +35 -0
- package/dist/cli/{chunk-9geymqns.js → chunk-nq1d20w2.js} +14 -14
- package/dist/cli/{chunk-g2z9x01v.js → chunk-nrns10mj.js} +3 -3
- package/dist/cli/{chunk-e7vvk5ya.js → chunk-sds923fa.js} +3 -3
- package/dist/cli/{chunk-cy5bm0j0.js → chunk-t2m5j4pr.js} +2 -2
- package/dist/cli/{chunk-cy5bm0j0.js.map → chunk-t2m5j4pr.js.map} +1 -1
- package/dist/cli/{chunk-yj17vs39.js → chunk-tdqhyxfz.js} +5 -5
- package/dist/cli/{chunk-q3wxxq39.js → chunk-tphac74f.js} +5 -5
- package/dist/cli/{chunk-6bm0xpgd.js → chunk-w1r4vase.js} +2 -2
- package/dist/cli/index.js +24 -19
- package/dist/cli/index.js.map +3 -3
- package/dist/types/ai/ask-context.d.ts +6 -2
- package/dist/types/ai/component-markdown.d.ts +2 -0
- package/dist/types/ai/openapi-components.d.ts +4 -1
- package/dist/types/astro/integration.d.ts +5 -4
- package/dist/types/astro/markdown-negotiation.d.ts +3 -0
- package/dist/types/astro/pages.d.ts +10 -0
- package/dist/types/cli/init/scaffold.d.ts +1 -1
- package/dist/types/components/content/api-field.d.ts +4 -1
- package/dist/types/components/content/api-page.d.ts +6 -1
- package/dist/types/components/openapi/code-samples.d.ts +29 -0
- package/dist/types/components/openapi/helpers.d.ts +22 -1
- package/dist/types/components/openapi/security.d.ts +10 -0
- package/dist/types/components/openapi/snippets.d.ts +60 -0
- package/dist/types/core/changelog-index.d.ts +8 -0
- package/dist/types/core/config-input.d.ts +30 -3
- package/dist/types/core/data.d.ts +4 -0
- package/dist/types/core/i18n-ui.d.ts +2 -0
- package/dist/types/core/links.d.ts +8 -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 +11 -3
- package/dist/types/core/schema.d.ts +119 -0
- 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/remote.d.ts +37 -10
- package/dist/types/core/sources/sanity.d.ts +1 -1
- package/dist/types/core/types.d.ts +17 -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/platforms/cloudflare.d.ts +10 -7
- 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 +20 -1
- package/dist/types/deploy/redirects.d.ts +17 -1
- package/dist/types/deploy/sitemap.d.ts +2 -1
- package/dist/types/deploy/vercel-negotiation.d.ts +42 -21
- 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 +15 -4
- package/dist/types/openapi/parse.d.ts +3 -0
- package/dist/types/openapi/references.d.ts +16 -0
- package/dist/types/ratelimit/index.d.ts +1 -1
- package/dist/types/ratelimit/schema.d.ts +8 -0
- package/dist/types/ratelimit/upstash.d.ts +39 -14
- package/dist/types/reference/graphql.d.ts +76 -1
- package/dist/types/reference/index.d.ts +1 -1
- package/dist/types/reference/openapi.d.ts +2 -2
- package/dist/types/reference/options.d.ts +37 -1
- package/dist/types/reference/schema.d.ts +84 -0
- 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/orama-index.d.ts +9 -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/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 +31 -13
- package/docs/advanced/changelog.mdx +11 -0
- package/docs/advanced/skills.mdx +1 -1
- package/docs/cli/audit.mdx +30 -7
- package/docs/cli/doctor.mdx +5 -1
- package/docs/cli/evals.mdx +4 -4
- package/docs/cli/translate.mdx +1 -0
- package/docs/cli/validate.mdx +4 -3
- package/docs/configuration/analytics.mdx +1 -1
- package/docs/configuration/assistant.mdx +6 -2
- package/docs/configuration/customization.mdx +4 -2
- package/docs/configuration/export.mdx +5 -3
- package/docs/configuration/index.mdx +3 -2
- package/docs/configuration/rate-limiting.mdx +23 -2
- package/docs/configuration/search.mdx +37 -14
- package/docs/content/components.mdx +2 -2
- package/docs/content/frontmatter.mdx +5 -3
- package/docs/content/i18n.mdx +2 -2
- package/docs/content/includes.mdx +1 -1
- package/docs/content/navigation.mdx +4 -4
- package/docs/content/sources/contentful.mdx +7 -4
- package/docs/content/sources/custom.mdx +7 -3
- package/docs/content/sources/github-releases.mdx +10 -2
- package/docs/content/sources/index.mdx +3 -3
- package/docs/content/sources/notion.mdx +1 -1
- package/docs/content/sources/obsidian.mdx +1 -1
- package/docs/content/sources/payload.mdx +3 -2
- package/docs/content/sources/remote-mdx.mdx +4 -0
- package/docs/content/sources/sanity.mdx +2 -2
- package/docs/content/sources/strapi.mdx +3 -2
- package/docs/content/syntax.mdx +2 -2
- package/docs/discoverability/agent-discovery.mdx +1 -1
- package/docs/discoverability/index.mdx +1 -1
- package/docs/discoverability/json-api.mdx +2 -0
- package/docs/discoverability/llms-txt.mdx +1 -1
- package/docs/discoverability/markdown.mdx +3 -1
- package/docs/discoverability/mcp.mdx +4 -0
- package/docs/discoverability/sitemap-and-robots.mdx +1 -1
- package/docs/references/api-pages.mdx +1 -1
- package/docs/references/asyncapi.mdx +3 -1
- package/docs/references/graphql.mdx +13 -1
- package/docs/references/openapi.mdx +50 -8
- package/package.json +9 -9
- package/skills/blume-migrate/SKILL.md +1 -1
- package/skills/blume-migrate/references/docusaurus.md +4 -4
- package/skills/blume-migrate/references/fumadocs.md +17 -13
- package/skills/blume-migrate/references/nextra.md +8 -5
- package/skills/blume-migrate/references/starlight.md +9 -7
- package/src/ai/ask-context.ts +33 -3
- package/src/ai/ask-limits.ts +13 -0
- package/src/ai/changelog-markdown.ts +11 -6
- package/src/ai/component-markdown.ts +1 -1
- package/src/ai/cors.ts +12 -3
- package/src/ai/mcp/query.ts +14 -6
- package/src/ai/openapi-components.ts +28 -4
- package/src/ai/relative-links.ts +4 -38
- package/src/astro/generate.ts +78 -48
- package/src/astro/integration.ts +16 -13
- package/src/astro/markdown-negotiation.ts +3 -0
- package/src/astro/module-types.ts +3 -1
- package/src/astro/pages.ts +23 -0
- package/src/astro/templates.ts +125 -80
- package/src/audit/catalog.ts +19 -3
- package/src/audit/checks/links.ts +14 -1
- 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/run.ts +3 -0
- package/src/audit/types.ts +2 -0
- package/src/audit/url.ts +14 -5
- package/src/blume-modules.d.ts +5 -1
- package/src/cli/args.ts +51 -0
- package/src/cli/build-failure.ts +23 -0
- package/src/cli/commands/audit.ts +10 -1
- package/src/cli/commands/dev.ts +18 -2
- package/src/cli/commands/doctor.ts +45 -12
- package/src/cli/commands/eval.ts +36 -4
- package/src/cli/commands/init.ts +6 -4
- package/src/cli/commands/validate.ts +10 -1
- package/src/cli/init/scaffold.ts +3 -3
- package/src/cli/prepare.ts +6 -3
- package/src/cli/required-secrets.ts +1 -1
- package/src/components/content/ApiPlayground.astro +6 -2
- package/src/components/content/api-field.ts +4 -1
- package/src/components/content/api-page.ts +31 -7
- package/src/components/content/mermaid-element.ts +15 -1
- package/src/components/islands/hooks.ts +27 -1
- package/src/components/layout/PageActions.astro +139 -24
- package/src/components/layout/RootLayout.astro +10 -2
- package/src/components/layout/Search.astro +17 -3
- package/src/components/layout/TableOfContents.astro +24 -17
- package/src/components/layout/head-scripts.ts +6 -1
- package/src/components/layout/search/algolia.ts +10 -1
- package/src/components/layout/search/analytics.ts +42 -14
- package/src/components/layout/search/endpoint.ts +48 -5
- package/src/components/layout/search/pagefind.ts +114 -5
- package/src/components/layout/search/types.ts +12 -0
- package/src/components/layout/search/typesense.ts +18 -6
- 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 +24 -1
- package/src/components/openapi/ParametersTable.astro +8 -4
- package/src/components/openapi/Playground.astro +7 -1
- package/src/components/openapi/RequestBody.astro +19 -2
- package/src/components/openapi/Responses.astro +1 -0
- package/src/components/openapi/SchemaTable.astro +15 -3
- package/src/components/openapi/async-snippets.ts +61 -5
- package/src/components/openapi/async.ts +123 -29
- 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 +10 -0
- package/src/components/openapi/snippets.ts +5 -3
- package/src/components/openapi/validate-json.ts +4 -3
- package/src/core/changelog-index.ts +31 -1
- package/src/core/component-diagnostics.ts +53 -0
- package/src/core/component-overrides.ts +32 -0
- package/src/core/config-input.ts +31 -3
- package/src/core/data.ts +2 -0
- package/src/core/diagnostics.ts +5 -0
- package/src/core/i18n-ui.ts +2 -0
- package/src/core/includes.ts +1 -1
- package/src/core/links.ts +47 -17
- package/src/core/probe.ts +26 -6
- package/src/core/project-graph.ts +59 -18
- package/src/core/redirect-patterns.ts +36 -7
- package/src/core/schema.ts +21 -2
- 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 +227 -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/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 +18 -0
- package/src/core/ui-packs/ar.ts +1 -0
- package/src/core/ui-packs/bg.ts +1 -0
- package/src/core/ui-packs/bn.ts +1 -0
- package/src/core/ui-packs/ca.ts +1 -0
- package/src/core/ui-packs/cs.ts +1 -0
- package/src/core/ui-packs/da.ts +1 -0
- package/src/core/ui-packs/de.ts +1 -0
- package/src/core/ui-packs/el.ts +1 -0
- package/src/core/ui-packs/es.ts +1 -0
- package/src/core/ui-packs/fa.ts +1 -0
- package/src/core/ui-packs/fi.ts +1 -0
- package/src/core/ui-packs/fr.ts +1 -0
- package/src/core/ui-packs/he.ts +1 -0
- package/src/core/ui-packs/hi.ts +1 -0
- package/src/core/ui-packs/hr.ts +1 -0
- package/src/core/ui-packs/hu.ts +1 -0
- package/src/core/ui-packs/id.ts +1 -0
- package/src/core/ui-packs/it.ts +1 -0
- package/src/core/ui-packs/ja.ts +1 -0
- package/src/core/ui-packs/ko.ts +1 -0
- package/src/core/ui-packs/nl.ts +1 -0
- package/src/core/ui-packs/no.ts +1 -0
- package/src/core/ui-packs/pl.ts +1 -0
- package/src/core/ui-packs/pt-br.ts +1 -0
- package/src/core/ui-packs/pt.ts +1 -0
- package/src/core/ui-packs/ro.ts +1 -0
- package/src/core/ui-packs/ru.ts +1 -0
- package/src/core/ui-packs/sk.ts +1 -0
- package/src/core/ui-packs/sr.ts +1 -0
- package/src/core/ui-packs/sv.ts +1 -0
- package/src/core/ui-packs/th.ts +1 -0
- package/src/core/ui-packs/tr.ts +1 -0
- package/src/core/ui-packs/uk.ts +1 -0
- package/src/core/ui-packs/vi.ts +1 -0
- package/src/core/ui-packs/zh-tw.ts +1 -0
- package/src/core/ui-packs/zh.ts +1 -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 +2 -1
- package/src/deploy/platforms/cloudflare.ts +13 -9
- package/src/deploy/platforms/netlify.ts +2 -1
- package/src/deploy/platforms/node.ts +12 -2
- package/src/deploy/platforms/types.ts +21 -7
- package/src/deploy/platforms/vercel.ts +113 -16
- package/src/deploy/redirects.ts +66 -6
- package/src/deploy/rss.ts +3 -1
- package/src/deploy/sitemap.ts +39 -5
- package/src/deploy/vercel-negotiation.ts +290 -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/relative-links.ts +3 -2
- 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 +15 -3
- package/src/openapi/parse.ts +127 -2
- package/src/openapi/references.ts +43 -3
- package/src/openapi/source.ts +39 -14
- package/src/ratelimit/index.ts +1 -1
- package/src/ratelimit/runtime.ts +37 -19
- package/src/ratelimit/upstash.ts +40 -10
- package/src/reference/graphql.ts +15 -1
- package/src/reference/index.ts +1 -0
- package/src/reference/openapi.ts +2 -2
- package/src/reference/options.ts +29 -1
- package/src/registry/eject.ts +3 -1
- 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/orama-index.ts +163 -31
- package/src/search/source-pages.ts +29 -0
- package/src/search/sync/algolia.ts +99 -9
- package/src/search/sync/index.ts +52 -13
- package/src/search/sync/typesense.ts +72 -27
- 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/entry.ts +29 -3
- package/src/translate/validate.ts +23 -1
- package/dist/cli/chunk-0gz36akr.js.map +0 -12
- package/dist/cli/chunk-2n4ps1b3.js.map +0 -15
- package/dist/cli/chunk-43zcf4gz.js.map +0 -36
- package/dist/cli/chunk-4ejxbzee.js +0 -39
- package/dist/cli/chunk-4ejxbzee.js.map +0 -10
- package/dist/cli/chunk-4h8z9vv5.js.map +0 -16
- package/dist/cli/chunk-713mngdq.js.map +0 -14
- package/dist/cli/chunk-9xr4dgee.js.map +0 -10
- package/dist/cli/chunk-amrb6hgh.js +0 -145
- package/dist/cli/chunk-amrb6hgh.js.map +0 -11
- package/dist/cli/chunk-nd1821sk.js.map +0 -10
- package/dist/cli/chunk-rekqz4qg.js.map +0 -10
- package/dist/cli/chunk-ta27feev.js.map +0 -10
- package/dist/cli/chunk-xkz5xbtv.js.map +0 -213
- package/dist/cli/chunk-y5h4r2y0.js.map +0 -10
- /package/dist/cli/{chunk-gp84za0h.js.map → chunk-3v3ffbrj.js.map} +0 -0
- /package/dist/cli/{chunk-p804f3pe.js.map → chunk-8y2kmjv8.js.map} +0 -0
- /package/dist/cli/{chunk-2f7n4qzt.js.map → chunk-c1y538kd.js.map} +0 -0
- /package/dist/cli/{chunk-1n228xqb.js.map → chunk-c887fj0s.js.map} +0 -0
- /package/dist/cli/{chunk-cmtcnh9f.js.map → chunk-dzwehpy7.js.map} +0 -0
- /package/dist/cli/{chunk-ntv4qrt7.js.map → chunk-e9q7a2ak.js.map} +0 -0
- /package/dist/cli/{chunk-5wj2qwn2.js.map → chunk-ft9vfys6.js.map} +0 -0
- /package/dist/cli/{chunk-zhvd6adm.js.map → chunk-hx3xqnk9.js.map} +0 -0
- /package/dist/cli/{chunk-y4ykbark.js.map → chunk-kma9f6sf.js.map} +0 -0
- /package/dist/cli/{chunk-py62fewh.js.map → chunk-mrcccgnh.js.map} +0 -0
- /package/dist/cli/{chunk-2f3ndkpw.js.map → chunk-n0v7m8ry.js.map} +0 -0
- /package/dist/cli/{chunk-9geymqns.js.map → chunk-nq1d20w2.js.map} +0 -0
- /package/dist/cli/{chunk-g2z9x01v.js.map → chunk-nrns10mj.js.map} +0 -0
- /package/dist/cli/{chunk-e7vvk5ya.js.map → chunk-sds923fa.js.map} +0 -0
- /package/dist/cli/{chunk-yj17vs39.js.map → chunk-tdqhyxfz.js.map} +0 -0
- /package/dist/cli/{chunk-q3wxxq39.js.map → chunk-tphac74f.js.map} +0 -0
- /package/dist/cli/{chunk-6bm0xpgd.js.map → chunk-w1r4vase.js.map} +0 -0
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { BlumeError } from "../diagnostics.ts";
|
|
2
|
+
import type { Diagnostic } from "../types.ts";
|
|
1
3
|
import type { JsonObject, JsonValue } from "./json.ts";
|
|
2
4
|
import type { ContentSource, SourceContext, SourceEntry } from "./types.ts";
|
|
3
5
|
/** What every REST-backed CMS source needs to be a staged, cached source. */
|
|
@@ -9,8 +11,13 @@ export interface RemoteSourceOptions {
|
|
|
9
11
|
* offline warning.
|
|
10
12
|
*/
|
|
11
13
|
assertConfigured?: () => void;
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Pull every entry from the API; called on refresh and on each poll.
|
|
16
|
+
* `warn` reports a problem with the content itself (an embed the API
|
|
17
|
+
* couldn't resolve, a node with no Markdown), which the load returns
|
|
18
|
+
* beside the entries; a load served from the snapshot repeats none.
|
|
19
|
+
*/
|
|
20
|
+
fetchEntries: (warn: (diagnostic: Diagnostic) => void) => Promise<SourceEntry[]>;
|
|
14
21
|
name: string;
|
|
15
22
|
/** Opt-in dev polling interval (seconds); omit to freeze for the session. */
|
|
16
23
|
pollInterval?: number;
|
|
@@ -29,6 +36,9 @@ export declare const remoteSource: (options: RemoteSourceOptions, ctx?: SourceCo
|
|
|
29
36
|
export interface RemoteFrontmatter {
|
|
30
37
|
description?: string;
|
|
31
38
|
draft?: boolean;
|
|
39
|
+
sidebar?: {
|
|
40
|
+
order: number;
|
|
41
|
+
};
|
|
32
42
|
title?: string;
|
|
33
43
|
}
|
|
34
44
|
/**
|
|
@@ -37,6 +47,13 @@ export interface RemoteFrontmatter {
|
|
|
37
47
|
* `writesMdx`).
|
|
38
48
|
*/
|
|
39
49
|
export declare const stagedEntry: (slug: string, data: RemoteFrontmatter, markdown: string, lastModified: string | undefined, format?: "md" | "mdx") => SourceEntry;
|
|
50
|
+
/**
|
|
51
|
+
* The error a source throws before its first request when the token its API
|
|
52
|
+
* always requires is unset (Notion, Contentful's Delivery API). Sent without
|
|
53
|
+
* one, the request could only fail, and the build would report the API's
|
|
54
|
+
* wording as a fetch failure instead of the variable to set.
|
|
55
|
+
*/
|
|
56
|
+
export declare const missingSecretError: (name: string, env: string) => BlumeError;
|
|
40
57
|
/** How a source calls its CMS: the API's auth headers and an injectable fetch. */
|
|
41
58
|
export interface RestClient {
|
|
42
59
|
/** Injected for tests; defaults to the global `fetch`. */
|
|
@@ -67,18 +84,28 @@ export interface RemoteFieldMap {
|
|
|
67
84
|
description?: string;
|
|
68
85
|
/** Field holding the last-modified ISO date. */
|
|
69
86
|
lastModified?: string;
|
|
87
|
+
/** Field holding the sidebar order (a number); no default. */
|
|
88
|
+
order?: string;
|
|
70
89
|
/** Field holding the route slug. */
|
|
71
90
|
slug?: string;
|
|
72
91
|
/** Field holding the page title. */
|
|
73
92
|
title?: string;
|
|
74
93
|
}
|
|
94
|
+
/** A field map with its defaults filled in; `order` is read only when set. */
|
|
95
|
+
export type RemoteFields = Required<Omit<RemoteFieldMap, "order">> & Pick<RemoteFieldMap, "order">;
|
|
96
|
+
/**
|
|
97
|
+
* The slug a document's staged entry is named by. It falls back to the
|
|
98
|
+
* document's id when the slug field is missing or slugifies to nothing (pure
|
|
99
|
+
* punctuation), so distinct documents never collapse onto one
|
|
100
|
+
* `untitled.md`; a slashed slug keeps its segments.
|
|
101
|
+
*/
|
|
102
|
+
export declare const documentSlug: (doc: JsonObject, slugField: string, id: string) => string;
|
|
75
103
|
/**
|
|
76
|
-
* Map a document to a staged entry
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
* when `lowersToMdx` (the source has serializers, see `writesMdx`).
|
|
104
|
+
* Map a document to a staged entry named by its {@link documentSlug}. A
|
|
105
|
+
* number in the `order` field, when one is mapped, becomes the page's
|
|
106
|
+
* sidebar order. A string body is Markdown and passes through as `.md`, its
|
|
107
|
+
* unsafe links reduced to their labels; any other shape goes to the CMS's
|
|
108
|
+
* lowerer, and is written as `.mdx` when `lowersToMdx` (the source has
|
|
109
|
+
* serializers, see `writesMdx`).
|
|
83
110
|
*/
|
|
84
|
-
export declare const documentEntry: (doc: JsonObject, fields:
|
|
111
|
+
export declare const documentEntry: (doc: JsonObject, fields: RemoteFields, id: string, lower: (body: JsonValue) => string, draft?: boolean, lowersToMdx?: boolean) => SourceEntry;
|
|
@@ -12,7 +12,7 @@ export interface SanityFieldMap {
|
|
|
12
12
|
description?: string;
|
|
13
13
|
/** Route slug (dot path); default `slug.current`. */
|
|
14
14
|
slug?: string;
|
|
15
|
-
/** Portable Text
|
|
15
|
+
/** Body field, Portable Text or a Markdown string; default `body`. */
|
|
16
16
|
body?: string;
|
|
17
17
|
/** Last-modified ISO date; default `_updatedAt`. */
|
|
18
18
|
lastModified?: string;
|
|
@@ -51,6 +51,10 @@ export interface PageLink {
|
|
|
51
51
|
* only those go through the image pipeline; a plain link to the same path
|
|
52
52
|
* resolves as a site route. */
|
|
53
53
|
image?: boolean;
|
|
54
|
+
/** Set when the target is a lowercase `<a href>`, which ships as written:
|
|
55
|
+
* the Markdown pipeline neither resolves its relative path file-style nor
|
|
56
|
+
* mounts the base path on it, so it's checked the way a browser reads it. */
|
|
57
|
+
raw?: boolean;
|
|
54
58
|
/** 1-based line number in the source file. */
|
|
55
59
|
line: number;
|
|
56
60
|
/** 1-based column of the target within the line. */
|
|
@@ -60,6 +64,17 @@ export interface PageLink {
|
|
|
60
64
|
* here so authors fix the partial, not the page that spliced it. */
|
|
61
65
|
file?: string;
|
|
62
66
|
}
|
|
67
|
+
/** A `<Component path="…">` in a page, located like a {@link PageLink}. */
|
|
68
|
+
export interface ExampleUse {
|
|
69
|
+
/** The example's key as written: its path under `examples/`, sans extension. */
|
|
70
|
+
path: string;
|
|
71
|
+
/** 1-based line number in the source file. */
|
|
72
|
+
line: number;
|
|
73
|
+
/** 1-based column of the `path` value within the line. */
|
|
74
|
+
column: number;
|
|
75
|
+
/** Absolute path of the included partial it was written in, if not the page. */
|
|
76
|
+
file?: string;
|
|
77
|
+
}
|
|
63
78
|
/**
|
|
64
79
|
* Resolved project paths. Computed once per CLI invocation and threaded
|
|
65
80
|
* through the core pipeline.
|
|
@@ -185,6 +200,8 @@ export interface PageRecord {
|
|
|
185
200
|
links: PageLink[];
|
|
186
201
|
/** Capitalized JSX component tags used in the body (`.mdx` only). */
|
|
187
202
|
componentsUsed?: string[];
|
|
203
|
+
/** The string `path` of each `<Component>` example in the body (`.mdx` only). */
|
|
204
|
+
examplesUsed?: ExampleUse[];
|
|
188
205
|
/** Resolved "last updated" ISO date, when the feature is enabled. */
|
|
189
206
|
lastModified?: string;
|
|
190
207
|
/** Absolute paths of files this page `<include>`s, transitively. Drives the
|
|
@@ -13,7 +13,8 @@ export declare const deployOutputDir: (config: ResolvedConfig, context: ProjectC
|
|
|
13
13
|
* served. A static build serves `dist/` wherever it lands; a server build
|
|
14
14
|
* serves what its platform declares — the Build Output tree's `static/` half
|
|
15
15
|
* on Vercel, Astro's `build.client` dir (`dist/client/`) on Node and
|
|
16
|
-
* Cloudflare, `dist/` on Netlify.
|
|
16
|
+
* Cloudflare, `dist/` on Netlify. On Vercel and Cloudflare that's its
|
|
17
|
+
* `<base>/` directory under `deployment.base`, where the files land.
|
|
17
18
|
*/
|
|
18
19
|
export declare const deployStaticDir: (config: ResolvedConfig, context: ProjectContext) => string;
|
|
19
20
|
/**
|
|
@@ -31,10 +31,12 @@ export declare const cloudflareAdapterSchema: import("zod").ZodObject<{
|
|
|
31
31
|
runtimeDeps: import("zod").ZodArray<import("zod").ZodString>;
|
|
32
32
|
}, import("zod/v4/core").$strict>;
|
|
33
33
|
/**
|
|
34
|
-
* Cloudflare
|
|
35
|
-
* `dist/server` (with a
|
|
36
|
-
* text/markdown`) and serves
|
|
37
|
-
*
|
|
38
|
-
* (`
|
|
34
|
+
* Cloudflare. A server build targets Workers only (`@astrojs/cloudflare`
|
|
35
|
+
* dropped Pages in v13): it emits a Worker into `dist/server` (with a
|
|
36
|
+
* generated wrapper that answers `Accept: text/markdown`) and serves
|
|
37
|
+
* `dist/client` through the ASSETS binding. A static build
|
|
38
|
+
* (`output: "static"`) never loads the adapter, and its `dist/` deploys to
|
|
39
|
+
* Pages or to Workers static assets. `@astrojs/cloudflare` is an optional
|
|
40
|
+
* peer: install it in the project (`npm install @astrojs/cloudflare`).
|
|
39
41
|
*/
|
|
40
42
|
export declare const cloudflare: (options?: CloudflareOptions) => CloudflareAdapter;
|
|
@@ -1,37 +1,72 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
1
2
|
import type { DeployAdapter, DeployOptions } from "./types.ts";
|
|
2
3
|
/** The Astro adapter package a Node server build imports. */
|
|
3
4
|
export declare const NODE_ADAPTER_PACKAGE = "@astrojs/node";
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* defaults `mode` to `"standalone"`; an option you pass wins. `host` and
|
|
8
|
-
* `port` are forwarded too, but `@astrojs/node` replaces both with Astro's
|
|
9
|
-
* own server settings, so the standalone server listens on `localhost:4321`
|
|
10
|
-
* unless the `HOST` and `PORT` environment variables are set when it starts.
|
|
6
|
+
* A host the server trusts forwarded headers for, in Astro's
|
|
7
|
+
* `security.allowedDomains` shape: each field set must match.
|
|
11
8
|
*/
|
|
12
|
-
export type
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
export type NodeAllowedDomain = {
|
|
10
|
+
/** The host, like `docs.example.com`; `*.example.com` matches subdomains. */
|
|
11
|
+
hostname?: string;
|
|
12
|
+
/** The port, as a string. */
|
|
13
|
+
port?: string;
|
|
14
|
+
/** The scheme, like `https`. */
|
|
15
|
+
protocol?: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Options for {@link node}: `output`, `site`, `base`, and `allowedDomains`,
|
|
19
|
+
* plus any option of `@astrojs/node` forwarded verbatim (`mode`,
|
|
20
|
+
* `staticHeaders`, …). Blume defaults `mode` to `"standalone"`; an option you
|
|
21
|
+
* pass wins. `host` and `port` are forwarded too, but `@astrojs/node`
|
|
22
|
+
* replaces both with Astro's own server settings, so the standalone server
|
|
23
|
+
* listens on `localhost:4321` unless the `HOST` and `PORT` environment
|
|
24
|
+
* variables are set when it starts.
|
|
25
|
+
*/
|
|
26
|
+
export type NodeOptions = DeployOptions & {
|
|
27
|
+
/**
|
|
28
|
+
* The hosts a reverse proxy in front of the server answers for, set as
|
|
29
|
+
* Astro's `security.allowedDomains`. A request whose `Host` (or
|
|
30
|
+
* `X-Forwarded-Host`) matches one is trusted to name the reader in
|
|
31
|
+
* `X-Forwarded-For`, which the rate limit counts by; otherwise every
|
|
32
|
+
* reader counts as the proxy's address. Only list them when a proxy sets
|
|
33
|
+
* that header on every request, since a reader could otherwise send their
|
|
34
|
+
* own.
|
|
35
|
+
*/
|
|
36
|
+
allowedDomains?: NodeAllowedDomain[];
|
|
37
|
+
};
|
|
38
|
+
export type NodeAdapter = DeployAdapter<"node", NodeOptions>;
|
|
39
|
+
export declare const nodeOptionsSchema: z.ZodObject<{
|
|
40
|
+
base: z.ZodOptional<z.ZodString>;
|
|
41
|
+
output: z.ZodOptional<z.ZodEnum<{
|
|
17
42
|
static: "static";
|
|
18
43
|
server: "server";
|
|
19
44
|
}>>;
|
|
20
|
-
site:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
45
|
+
site: z.ZodOptional<z.ZodURL>;
|
|
46
|
+
allowedDomains: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
47
|
+
hostname: z.ZodOptional<z.ZodString>;
|
|
48
|
+
port: z.ZodOptional<z.ZodString>;
|
|
49
|
+
protocol: z.ZodOptional<z.ZodString>;
|
|
50
|
+
}, z.core.$strict>>>;
|
|
51
|
+
}, z.core.$catchall<z.ZodJSONSchema>>;
|
|
52
|
+
export declare const nodeAdapterSchema: z.ZodObject<{
|
|
53
|
+
kind: z.ZodLiteral<"node">;
|
|
54
|
+
options: z.ZodObject<{
|
|
55
|
+
base: z.ZodOptional<z.ZodString>;
|
|
56
|
+
output: z.ZodOptional<z.ZodEnum<{
|
|
27
57
|
static: "static";
|
|
28
58
|
server: "server";
|
|
29
59
|
}>>;
|
|
30
|
-
site:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
60
|
+
site: z.ZodOptional<z.ZodURL>;
|
|
61
|
+
allowedDomains: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
62
|
+
hostname: z.ZodOptional<z.ZodString>;
|
|
63
|
+
port: z.ZodOptional<z.ZodString>;
|
|
64
|
+
protocol: z.ZodOptional<z.ZodString>;
|
|
65
|
+
}, z.core.$strict>>>;
|
|
66
|
+
}, z.core.$catchall<z.ZodJSONSchema>>;
|
|
67
|
+
requiredSecrets: z.ZodArray<z.ZodString>;
|
|
68
|
+
runtimeDeps: z.ZodArray<z.ZodString>;
|
|
69
|
+
}, z.core.$strict>;
|
|
35
70
|
/**
|
|
36
71
|
* A self-hosted Node server (containers, VMs). The standalone server in
|
|
37
72
|
* `dist/server/entry.mjs` serves `dist/client` itself. `@astrojs/node` is one
|
|
@@ -67,6 +67,11 @@ export declare const resolvedDeploymentSchema: z.ZodPipe<z.ZodDiscriminatedUnion
|
|
|
67
67
|
server: "server";
|
|
68
68
|
}>>;
|
|
69
69
|
site: z.ZodOptional<z.ZodURL>;
|
|
70
|
+
allowedDomains: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
71
|
+
hostname: z.ZodOptional<z.ZodString>;
|
|
72
|
+
port: z.ZodOptional<z.ZodString>;
|
|
73
|
+
protocol: z.ZodOptional<z.ZodString>;
|
|
74
|
+
}, z.core.$strict>>>;
|
|
70
75
|
}, z.core.$catchall<z.ZodJSONSchema>>;
|
|
71
76
|
requiredSecrets: z.ZodArray<z.ZodString>;
|
|
72
77
|
runtimeDeps: z.ZodArray<z.ZodString>;
|
|
@@ -113,6 +118,11 @@ export declare const resolvedDeploymentSchema: z.ZodPipe<z.ZodDiscriminatedUnion
|
|
|
113
118
|
base?: string | undefined;
|
|
114
119
|
output?: "static" | "server" | undefined;
|
|
115
120
|
site?: string | undefined;
|
|
121
|
+
allowedDomains?: {
|
|
122
|
+
hostname?: string | undefined;
|
|
123
|
+
port?: string | undefined;
|
|
124
|
+
protocol?: string | undefined;
|
|
125
|
+
}[] | undefined;
|
|
116
126
|
};
|
|
117
127
|
requiredSecrets: string[];
|
|
118
128
|
runtimeDeps: string[];
|
|
@@ -67,9 +67,10 @@ export declare const deployOptionsSchema: z.ZodObject<{
|
|
|
67
67
|
}, z.core.$catchall<z.ZodJSONSchema>>;
|
|
68
68
|
/**
|
|
69
69
|
* The options Blume does not name — what reaches the `@astrojs/*` adapter's
|
|
70
|
-
* constructor verbatim.
|
|
70
|
+
* constructor verbatim. `configOptions` are the ones a host adapter names
|
|
71
|
+
* itself, for the Astro config rather than the constructor.
|
|
71
72
|
*/
|
|
72
|
-
export declare const deployPassthrough: (options: DeployOptions) => Record<string, JsonValue>;
|
|
73
|
+
export declare const deployPassthrough: (options: DeployOptions, configOptions?: readonly string[]) => Record<string, JsonValue>;
|
|
73
74
|
/**
|
|
74
75
|
* The runtime dependency a host adapter declares: its `@astrojs/*` package,
|
|
75
76
|
* which the generated `astro.config.mjs` imports for a server build and
|
|
@@ -34,12 +34,15 @@ export declare const nameCloudflareWorker: (project: BlumeProject, log: BuildLog
|
|
|
34
34
|
*/
|
|
35
35
|
export declare const bindCloudflareRateLimit: (project: BlumeProject, log: BuildLog) => Promise<void>;
|
|
36
36
|
/**
|
|
37
|
-
* Cloudflare
|
|
38
|
-
* `dist/server` and serves
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
37
|
+
* Cloudflare. A server build targets Workers only (`@astrojs/cloudflare`
|
|
38
|
+
* dropped Pages in v13): it emits the Worker into `dist/server` and serves
|
|
39
|
+
* `dist/client` through the ASSETS binding, which honors `_headers` from that
|
|
40
|
+
* directory exactly as Pages does — so the file applies to both output modes
|
|
41
|
+
* here. A static build never loads the adapter; its `dist/` deploys to Pages,
|
|
42
|
+
* whose build environment `env` detects, or to Workers static assets (Workers
|
|
43
|
+
* Builds exposes no site URL to detect). Without a configured driver the
|
|
44
|
+
* adapter force-enables KV-backed sessions and declares a `SESSION` binding
|
|
45
|
+
* that `wrangler deploy` then demands a namespace for, even though Blume
|
|
46
|
+
* never reads `Astro.session`; `session: false` opts the project out.
|
|
44
47
|
*/
|
|
45
48
|
export declare const cloudflarePlatform: DeployPlatform;
|
|
@@ -7,6 +7,8 @@ import type { DeployPlatform } from "./types.ts";
|
|
|
7
7
|
* discovery files and downloaded SVGs need instead, and answers the
|
|
8
8
|
* configured redirects with their exact status, which Astro's own handler
|
|
9
9
|
* would default to 301 or 308. No platform env to detect: the site URL has to
|
|
10
|
-
* be configured.
|
|
10
|
+
* be configured. `allowedDomains` becomes Astro's `security.allowedDomains`,
|
|
11
|
+
* which a server behind a reverse proxy needs before Astro reads the reader's
|
|
12
|
+
* address from `X-Forwarded-For`.
|
|
11
13
|
*/
|
|
12
14
|
export declare const nodePlatform: DeployPlatform;
|
|
@@ -2,7 +2,7 @@ import type { JsonValue } from "../../core/adapter.ts";
|
|
|
2
2
|
import type { BlumeProject } from "../../core/project-graph.ts";
|
|
3
3
|
import type { ResolvedConfig } from "../../core/schema.ts";
|
|
4
4
|
import type { ProjectContext } from "../../core/types.ts";
|
|
5
|
-
import type { DeployAdapterKind } from "../adapters/registry.ts";
|
|
5
|
+
import type { DeployAdapterKind, ResolvedDeployOptions } from "../adapters/registry.ts";
|
|
6
6
|
import type { DeployOutput } from "../adapters/types.ts";
|
|
7
7
|
/**
|
|
8
8
|
* Everything Blume does differently per deployment target, keyed by the
|
|
@@ -13,8 +13,16 @@ import type { DeployOutput } from "../adapters/types.ts";
|
|
|
13
13
|
*/
|
|
14
14
|
/** How the generated `astro.config.mjs` constructs the `@astrojs/*` adapter. */
|
|
15
15
|
export interface AstroAdapterSpec {
|
|
16
|
-
/**
|
|
17
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Top-level `defineConfig` entries the adapter needs beside itself, some
|
|
18
|
+
* of them set from the deployment's own options.
|
|
19
|
+
*/
|
|
20
|
+
config: (options: ResolvedDeployOptions) => Record<string, JsonValue>;
|
|
21
|
+
/**
|
|
22
|
+
* The deployment options `config` reads, which therefore stay out of the
|
|
23
|
+
* passthrough to the `@astrojs/*` constructor.
|
|
24
|
+
*/
|
|
25
|
+
configOptions: string[];
|
|
18
26
|
/** Blume's own constructor options; the user's passthrough is spread over them. */
|
|
19
27
|
options: (context: ProjectContext) => Record<string, JsonValue>;
|
|
20
28
|
/** The package the config imports the adapter from. */
|
|
@@ -106,14 +114,17 @@ export interface DeployPlatform {
|
|
|
106
114
|
/**
|
|
107
115
|
* Whether the adapter moves a server build's client output under
|
|
108
116
|
* `deployment.base` (`dist/client/<base>/`, the directory Astro then hands
|
|
109
|
-
* `astro:build:done`) while the platform keeps serving `
|
|
110
|
-
*
|
|
117
|
+
* `astro:build:done`) while the platform keeps serving `dist/client` as
|
|
118
|
+
* the assets root. The files the platform reads there, like `_headers`,
|
|
111
119
|
* belong above the directory Astro reports.
|
|
112
120
|
*/
|
|
113
121
|
serverClientUnderBase: boolean;
|
|
114
122
|
/** Where a server build's deploy bundle lands. */
|
|
115
123
|
serverOutputDir: (context: ProjectContext) => string;
|
|
116
|
-
/**
|
|
117
|
-
|
|
124
|
+
/**
|
|
125
|
+
* The directory a server build serves as static files, given the normalized
|
|
126
|
+
* `deployment.base` for a platform that serves them from `<dir>/<base>/`.
|
|
127
|
+
*/
|
|
128
|
+
serverStaticDir: (context: ProjectContext, base: string) => string;
|
|
118
129
|
}
|
|
119
130
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { BlumeProject } from "../../core/project-graph.ts";
|
|
2
|
+
import type { ProjectContext } from "../../core/types.ts";
|
|
2
3
|
import type { BuildLog, DeployPlatform, RedirectFile } from "./types.ts";
|
|
3
4
|
/** `vercel.json` with a `redirects` array, for a static deploy of `dist/`. */
|
|
4
5
|
export declare const VERCEL_JSON_FILE: RedirectFile;
|
|
@@ -26,6 +27,22 @@ export declare const emitVercelNegotiation: (project: BlumeProject, log: BuildLo
|
|
|
26
27
|
* prerender a pattern's pages, so the adapter never sees these.
|
|
27
28
|
*/
|
|
28
29
|
export declare const emitVercelPatternRedirects: (project: BlumeProject, log: BuildLog) => Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Move a server build's static files under `deployment.base`.
|
|
32
|
+
* `@astrojs/vercel` copies them to the root of the Build Output tree's
|
|
33
|
+
* `static/`, while the pages request `<base>/_astro/…` and link to
|
|
34
|
+
* `<base>/…`, so nothing the site asks for would be found. Moved to
|
|
35
|
+
* `static/<base>/`, they're served at the base, as the routes that
|
|
36
|
+
* {@link rebaseVercelRoutes} moves there expect.
|
|
37
|
+
*/
|
|
38
|
+
export declare const moveStaticUnderBase: (context: ProjectContext, base: string) => Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Move the adapter's routing config under `deployment.base` to match the
|
|
41
|
+
* static files (see `rebaseAdapterRoutes`), its exact redirects rebuilt from
|
|
42
|
+
* the configured ones. Resolves to false when the config can't be read: the
|
|
43
|
+
* adapter's routes would then miss every path under the base.
|
|
44
|
+
*/
|
|
45
|
+
export declare const rebaseVercelRoutes: (project: BlumeProject, log: BuildLog) => Promise<boolean>;
|
|
29
46
|
/**
|
|
30
47
|
* Vercel. A server build's Build Output tree lands at `.vercel/output` — at
|
|
31
48
|
* the project root, because the adapter is handed that root up front: its
|
|
@@ -34,6 +51,8 @@ export declare const emitVercelPatternRedirects: (project: BlumeProject, log: Bu
|
|
|
34
51
|
* Static assets are served from the tree's `static/` half, so the deploy
|
|
35
52
|
* artifacts are written there; headers (the discovery files', the sandbox on
|
|
36
53
|
* downloaded SVGs) arrive through the routing config rather than a
|
|
37
|
-
* `_headers` file, which Vercel never reads.
|
|
54
|
+
* `_headers` file, which Vercel never reads. The adapter ignores
|
|
55
|
+
* `deployment.base`, so under one the build moves the static files and the
|
|
56
|
+
* routes beneath it.
|
|
38
57
|
*/
|
|
39
58
|
export declare const vercelPlatform: DeployPlatform;
|
|
@@ -41,9 +41,25 @@ export declare const applyBaseToAstroRedirects: (redirects: Redirect[], basePath
|
|
|
41
41
|
* public file (see {@link baseRedirectTarget}).
|
|
42
42
|
*/
|
|
43
43
|
export declare const applyBaseToPlatformRedirects: (redirects: Redirect[], basePath: string, deployBase: string, routes: RouteSet) => Redirect[];
|
|
44
|
+
/**
|
|
45
|
+
* Based `redirects`, each exact one that moves a page followed by the same
|
|
46
|
+
* redirect for the page's Markdown copies: from a path no page is served at
|
|
47
|
+
* to one a page is, `/old.md` goes to `/new.md` (and `.mdx` alike), where it
|
|
48
|
+
* would otherwise 404 for an agent still reading the old URL. A pattern gets
|
|
49
|
+
* none; one that carries its capture over (`/beta/:slug*` → `/v2/:slug*`)
|
|
50
|
+
* already moves `/beta/guide.md` along. `pages` are the served page routes
|
|
51
|
+
* (carrying `basePath`, not `deployment.base`), and `bases` the deployment
|
|
52
|
+
* base each end carries: Astro's config leaves it off `from` (see
|
|
53
|
+
* {@link applyBaseToAstroRedirects}).
|
|
54
|
+
*/
|
|
55
|
+
export declare const withMirrorRedirects: (redirects: Redirect[], pages: RouteSet, bases: {
|
|
56
|
+
from: string;
|
|
57
|
+
to: string;
|
|
58
|
+
}) => Redirect[];
|
|
44
59
|
/**
|
|
45
60
|
* The configured redirects as the host platform matches them, via
|
|
46
|
-
* {@link applyBaseToPlatformRedirects}
|
|
61
|
+
* {@link applyBaseToPlatformRedirects} plus the Markdown copies of each moved
|
|
62
|
+
* page ({@link withMirrorRedirects}), exact paths ahead of patterns: hosts
|
|
47
63
|
* try rules in order, and an exact redirect wins over a pattern that also
|
|
48
64
|
* covers its path. The one basing every consumer must share: the emitted
|
|
49
65
|
* redirect files and the server wrappers all compare these paths against
|
|
@@ -11,7 +11,8 @@ export declare const describeSitemapFiles: (files: readonly SitemapFile[]) => st
|
|
|
11
11
|
* can't see: custom `.astro` pages (most importantly a custom landing `/`) and
|
|
12
12
|
* the generated `/changelog` index. Returns null when the sitemap is disabled
|
|
13
13
|
* or no `site` is configured (absolute URLs are required for a valid sitemap).
|
|
14
|
-
* Drafts, hidden, and `noindex` pages are excluded
|
|
14
|
+
* Drafts, hidden, and `noindex` pages are excluded, and so is a page whose
|
|
15
|
+
* `seo.canonical` points elsewhere.
|
|
15
16
|
*
|
|
16
17
|
* Sites within the per-file URL cap get the single classic `sitemap.xml`;
|
|
17
18
|
* larger sites get `sitemap.xml` as a sitemap index over numbered
|
|
@@ -14,25 +14,31 @@
|
|
|
14
14
|
* prerendered Markdown 404 body with the 404 status, instead of the HTML
|
|
15
15
|
* shell, and one that prefers JSON (or asks for a `.json` URL) gets the
|
|
16
16
|
* prerendered problem-details 404.
|
|
17
|
+
*
|
|
18
|
+
* Under `deployment.base` every route here matches the served URL, base
|
|
19
|
+
* included, and names the files where Blume moves them (`static/<base>/`, see
|
|
20
|
+
* {@link rebaseAdapterRoutes}); `base` is the normalized base, `""` for none.
|
|
17
21
|
*/
|
|
18
|
-
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
/** One header condition on a Build Output route. */
|
|
23
|
+
export interface VercelCondition {
|
|
24
|
+
key?: string;
|
|
25
|
+
type: string;
|
|
26
|
+
value?: string;
|
|
27
|
+
}
|
|
28
|
+
/** The conditions of one route: all of `has`, none of `missing`. */
|
|
29
|
+
export interface AcceptConditions {
|
|
30
|
+
has: VercelCondition[];
|
|
31
|
+
missing?: VercelCondition[];
|
|
32
|
+
}
|
|
33
|
+
/** When a client prefers `text/markdown` (or `text/x-markdown`) over HTML. */
|
|
34
|
+
export declare const ACCEPT_MARKDOWN_CONDITIONS: AcceptConditions[];
|
|
29
35
|
/**
|
|
30
36
|
* The JSON counterpart, for the problem-details 404: `application/json` or
|
|
31
37
|
* `application/problem+json`. Browsers never send either on a navigation
|
|
32
38
|
* (the catch-all wildcard does not match), so ordinary page requests are
|
|
33
39
|
* unaffected.
|
|
34
40
|
*/
|
|
35
|
-
export declare const
|
|
41
|
+
export declare const ACCEPT_JSON_CONDITIONS: AcceptConditions[];
|
|
36
42
|
/**
|
|
37
43
|
* A Build Output API route — the subset these helpers read and write. Parsed
|
|
38
44
|
* routes keep whatever other fields they carry at runtime; only these are
|
|
@@ -42,12 +48,9 @@ export interface VercelRoute {
|
|
|
42
48
|
continue?: boolean;
|
|
43
49
|
dest?: string;
|
|
44
50
|
handle?: string;
|
|
45
|
-
has?:
|
|
46
|
-
key?: string;
|
|
47
|
-
type: string;
|
|
48
|
-
value?: string;
|
|
49
|
-
}[];
|
|
51
|
+
has?: VercelCondition[];
|
|
50
52
|
headers?: Record<string, string>;
|
|
53
|
+
missing?: VercelCondition[];
|
|
51
54
|
src?: string;
|
|
52
55
|
status?: number;
|
|
53
56
|
}
|
|
@@ -82,9 +85,10 @@ export interface NegotiationRoutes {
|
|
|
82
85
|
* rewrite also stamps `x-markdown-tokens` — the estimated token count of the
|
|
83
86
|
* homepage mirror (Cloudflare's Markdown for Agents convention). Only the home
|
|
84
87
|
* route can carry it: the other rewrites are chunked alternations spanning
|
|
85
|
-
* many pages, and a count is per-page.
|
|
88
|
+
* many pages, and a count is per-page. Under a `base`, each path is matched
|
|
89
|
+
* and rewritten where it's served (`/docs` → `/docs/index.md`).
|
|
86
90
|
*/
|
|
87
|
-
export declare const buildNegotiationRoutes: (routePaths: readonly string[], homeTokens?: number) => NegotiationRoutes;
|
|
91
|
+
export declare const buildNegotiationRoutes: (routePaths: readonly string[], homeTokens?: number, base?: string) => NegotiationRoutes;
|
|
88
92
|
/**
|
|
89
93
|
* Splice the negotiation routes into a Build Output `config.json`, plus — when
|
|
90
94
|
* given — a homepage `Link` header route for agent discovery (see
|
|
@@ -102,12 +106,14 @@ export declare const buildNegotiationRoutes: (routePaths: readonly string[], hom
|
|
|
102
106
|
* phase right before the adapter's `/404.html` fallback — and nowhere when
|
|
103
107
|
* that fallback is absent, since a `dest` with no file behind it would serve
|
|
104
108
|
* nothing. With `svgAssets`, a main-phase route also sandboxes the SVGs a
|
|
105
|
-
* content source downloaded (see {@link svgAssetRoute}).
|
|
109
|
+
* content source downloaded (see {@link svgAssetRoute}). Under a `base`, every
|
|
110
|
+
* route matches and names paths beneath it, and the fallback anchor is the
|
|
111
|
+
* one {@link rebaseAdapterRoutes} moved there. Returns the updated JSON
|
|
106
112
|
* text (tab-indented, like the adapter's own output), or `null` when there is
|
|
107
113
|
* nowhere safe to splice: an unparsable config, no `routes` array, or no
|
|
108
114
|
* `handle: "filesystem"` marker to anchor the splice.
|
|
109
115
|
*/
|
|
110
|
-
export declare const injectNegotiationRoutes: (configText: string, routePaths: readonly string[], homeLinkHeader?: string | null, contentTypeOverrides?: Record<string, string>, homeTokens?: number, notFound?: NotFoundVariants, corsPaths?: readonly string[], svgAssets?: boolean) => string | null;
|
|
116
|
+
export declare const injectNegotiationRoutes: (configText: string, routePaths: readonly string[], homeLinkHeader?: string | null, contentTypeOverrides?: Record<string, string>, homeTokens?: number, notFound?: NotFoundVariants, corsPaths?: readonly string[], svgAssets?: boolean, base?: string) => string | null;
|
|
111
117
|
/**
|
|
112
118
|
* Splice routes for the pattern redirects (see `vercelPatternRoutes`) into a
|
|
113
119
|
* Build Output `config.json`, in the main phase just ahead of
|
|
@@ -117,3 +123,18 @@ export declare const injectNegotiationRoutes: (configText: string, routePaths: r
|
|
|
117
123
|
* unparsable config, no `routes` array, or no `handle: "filesystem"` marker.
|
|
118
124
|
*/
|
|
119
125
|
export declare const injectRedirectRoutes: (configText: string, redirectRoutes: readonly VercelRoute[]) => string | null;
|
|
126
|
+
/**
|
|
127
|
+
* Move the adapter's routes under `deployment.base`, to match the static files
|
|
128
|
+
* Blume moves to `static/<base>/`. `@astrojs/vercel` routes a server build as
|
|
129
|
+
* if it were served from the root: its route patterns (the `_astro/` cache
|
|
130
|
+
* header, every server route) match base-less paths, its 404 fallback names
|
|
131
|
+
* `/404.html`, and it joins the base onto each redirect with no slash on the
|
|
132
|
+
* `from` side and a second time on the `to` side, which Astro hands it
|
|
133
|
+
* already based (`^/docsold$` → `/docs/docs/new`). Each pattern is
|
|
134
|
+
* re-anchored under the base and the fallback names the base's `404.html`;
|
|
135
|
+
* the adapter's redirects make way for `redirectRoutes`, the exact redirects
|
|
136
|
+
* as the host matches them. Returns the updated JSON text, or `null` when
|
|
137
|
+
* there is nowhere safe to splice: an unparsable config, no `routes` array,
|
|
138
|
+
* or no `handle: "filesystem"` marker.
|
|
139
|
+
*/
|
|
140
|
+
export declare const rebaseAdapterRoutes: (configText: string, base: string, redirectRoutes: readonly VercelRoute[]) => string | null;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ApiDocument } from "./model.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Targeted checks for spec mistakes that would otherwise render silently
|
|
4
|
+
* wrong. This is not a validator — a linter such as Spectral or oasdiff owns
|
|
5
|
+
* that — and a spec that fails one of these still renders. Each check names
|
|
6
|
+
* one mistake whose symptom on the page is quiet: a path placeholder sent
|
|
7
|
+
* as literal text, a Try it input whose value goes nowhere, an Authorization
|
|
8
|
+
* section with no scheme to describe. Each reports a warning with its own
|
|
9
|
+
* code, so a build says what's wrong instead of shipping it.
|
|
10
|
+
*/
|
|
11
|
+
/** One mistake a check found, before the source names the spec it's in. */
|
|
12
|
+
export interface SpecIssue {
|
|
13
|
+
code: string;
|
|
14
|
+
message: string;
|
|
15
|
+
suggestion: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* How a warning names an operation: `GET /pets`, or a webhook by its name
|
|
19
|
+
* (`Webhook "newPet" (POST)`), since a webhook has no path.
|
|
20
|
+
*/
|
|
21
|
+
export declare const operationLabel: (name: string, method: string, webhook: boolean) => string;
|
|
22
|
+
/**
|
|
23
|
+
* Check a parsed document for the mistakes above, and for the OpenAPI 3.2
|
|
24
|
+
* features Blume doesn't render yet. `$ref` path items are skipped: the
|
|
25
|
+
* extractor already reports them as missing from the reference.
|
|
26
|
+
*/
|
|
27
|
+
export declare const specIssues: (document: ApiDocument) => SpecIssue[];
|
|
@@ -37,6 +37,10 @@ export interface GraphqlTypeRef {
|
|
|
37
37
|
display: string;
|
|
38
38
|
name: string;
|
|
39
39
|
}
|
|
40
|
+
/** A GraphQL input value as JSON carries it in `variables` (enums by name). */
|
|
41
|
+
export type GraphqlJsonValue = string | number | boolean | null | GraphqlJsonValue[] | {
|
|
42
|
+
[key: string]: GraphqlJsonValue;
|
|
43
|
+
};
|
|
40
44
|
/** An argument or input-object field. */
|
|
41
45
|
export interface GraphqlInputValue {
|
|
42
46
|
name: string;
|
|
@@ -44,6 +48,8 @@ export interface GraphqlInputValue {
|
|
|
44
48
|
type: GraphqlTypeRef;
|
|
45
49
|
/** Default value printed as a GraphQL literal (`10`, `"asc"`, `[1, 2]`). */
|
|
46
50
|
default?: string;
|
|
51
|
+
/** The same default as JSON, for the example variables. */
|
|
52
|
+
defaultValue?: GraphqlJsonValue;
|
|
47
53
|
deprecationReason?: string;
|
|
48
54
|
}
|
|
49
55
|
/** An output field of an object or interface type (root fields included). */
|