blume 2.0.1 → 2.0.2
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 +82 -0
- package/dist/cli/{chunk-vtk4a6dg.js → chunk-00gs3wqs.js} +1 -1
- package/dist/cli/{chunk-fa25z98p.js → chunk-273ygyr4.js} +4 -3
- package/dist/cli/chunk-273ygyr4.js.map +11 -0
- package/dist/cli/{chunk-yw7dm696.js → chunk-3yce002v.js} +21 -8
- package/dist/cli/{chunk-yw7dm696.js.map → chunk-3yce002v.js.map} +3 -3
- package/dist/cli/{chunk-yt5n7ppj.js → chunk-4e9b9ra6.js} +17 -7
- package/dist/cli/chunk-4e9b9ra6.js.map +10 -0
- package/dist/cli/{chunk-fs23ddbb.js → chunk-5r8g91qn.js} +352 -676
- package/dist/cli/chunk-5r8g91qn.js.map +34 -0
- package/dist/cli/{chunk-6vm74dry.js → chunk-6dtt0zfn.js} +8 -8
- package/dist/cli/{chunk-qwsrynx5.js → chunk-6k4ftwze.js} +38 -19
- package/dist/cli/{chunk-qwsrynx5.js.map → chunk-6k4ftwze.js.map} +4 -4
- package/dist/cli/{chunk-qs4q5p4e.js → chunk-7mbqtmgb.js} +16 -7
- package/dist/cli/chunk-7mbqtmgb.js.map +10 -0
- package/dist/cli/{chunk-q5163e60.js → chunk-7vtckvaw.js} +21 -19
- package/dist/cli/chunk-7vtckvaw.js.map +11 -0
- package/dist/cli/{chunk-kdp5q7ke.js → chunk-8g8ytmgx.js} +17 -18
- package/dist/cli/{chunk-kdp5q7ke.js.map → chunk-8g8ytmgx.js.map} +2 -2
- package/dist/cli/{chunk-epjnccmv.js → chunk-91ws1n6j.js} +18 -15
- package/dist/cli/chunk-91ws1n6j.js.map +10 -0
- package/dist/cli/{chunk-fxypxtvm.js → chunk-bbnwccaz.js} +2 -2
- package/dist/cli/{chunk-m3vmjgmq.js → chunk-bfwp9vp6.js} +16 -8
- package/dist/cli/chunk-bfwp9vp6.js.map +10 -0
- package/dist/cli/{chunk-f2z5v128.js → chunk-d1v5rhy0.js} +14 -15
- package/dist/cli/{chunk-f2z5v128.js.map → chunk-d1v5rhy0.js.map} +2 -2
- package/dist/cli/{chunk-6crbhc3x.js → chunk-ddndchfr.js} +21 -6
- package/dist/cli/chunk-ddndchfr.js.map +14 -0
- package/dist/cli/{chunk-ce574jw2.js → chunk-esh98wmb.js} +1 -1
- package/dist/cli/{chunk-zxcczpyx.js → chunk-fsmrqk8a.js} +1 -1
- package/dist/cli/{chunk-hdpx1tax.js → chunk-g698a744.js} +5 -5
- package/dist/cli/{chunk-jts8mvcz.js → chunk-gs7r695n.js} +9 -3
- package/dist/cli/{chunk-jts8mvcz.js.map → chunk-gs7r695n.js.map} +3 -3
- package/dist/cli/{chunk-zxh4d9vy.js → chunk-h2ez8dzb.js} +4 -4
- package/dist/cli/{chunk-5shv93fd.js → chunk-h7k3nq3v.js} +2 -2
- package/dist/cli/{chunk-79jhk4py.js → chunk-hqp2ajnh.js} +251 -122
- package/dist/cli/chunk-hqp2ajnh.js.map +35 -0
- package/dist/cli/{chunk-2hn4b8z7.js → chunk-hr8ne106.js} +109 -40
- package/dist/cli/chunk-hr8ne106.js.map +13 -0
- package/dist/cli/{chunk-6hsn950k.js → chunk-j85scx15.js} +62 -18
- package/dist/cli/chunk-j85scx15.js.map +10 -0
- package/dist/cli/{chunk-s1p84fyh.js → chunk-k7pj68a8.js} +63 -22
- package/dist/cli/chunk-k7pj68a8.js.map +11 -0
- package/dist/cli/{chunk-ah61y8py.js → chunk-mqc662a6.js} +2 -2
- package/dist/cli/{chunk-ch6g3ar0.js → chunk-n1yg3tj3.js} +4 -4
- package/dist/cli/{chunk-mb2919y2.js → chunk-nfcyttvj.js} +17 -6
- package/dist/cli/chunk-nfcyttvj.js.map +10 -0
- package/dist/cli/{chunk-kpf8rrjc.js → chunk-pbg5a4s3.js} +56 -24
- package/dist/cli/chunk-pbg5a4s3.js.map +19 -0
- package/dist/cli/{chunk-jwyddg7y.js → chunk-ppzjqwx2.js} +21 -14
- package/dist/cli/{chunk-jwyddg7y.js.map → chunk-ppzjqwx2.js.map} +4 -4
- package/dist/cli/{chunk-dh8cwk36.js → chunk-qkb5a8sa.js} +24 -9
- package/dist/cli/chunk-qkb5a8sa.js.map +10 -0
- package/dist/cli/{chunk-wm7js3j9.js → chunk-sqw4ekg1.js} +2 -2
- package/dist/cli/{chunk-qkqwkpte.js → chunk-v6ya5kcb.js} +3083 -953
- package/dist/cli/chunk-v6ya5kcb.js.map +189 -0
- package/dist/cli/{chunk-fz5wtpmh.js → chunk-w4bxdvsa.js} +18 -15
- package/dist/cli/chunk-w4bxdvsa.js.map +10 -0
- package/dist/cli/{chunk-27g6wdth.js → chunk-wdrt2k2v.js} +2 -2
- package/dist/cli/{chunk-wgm7m9qk.js → chunk-xh43dwgw.js} +158 -43
- package/dist/cli/chunk-xh43dwgw.js.map +36 -0
- package/dist/cli/{chunk-s6jhgk0q.js → chunk-zp79m0ts.js} +2 -2
- package/dist/cli/index.js +160 -35
- package/dist/cli/index.js.map +4 -4
- package/dist/types/ai/agent-surface.d.ts +32 -0
- package/dist/types/ai/api-catalog.d.ts +7 -1
- package/dist/types/ai/ask-context.d.ts +7 -0
- package/dist/types/ai/component-markdown.d.ts +4 -4
- package/dist/types/ai/relative-links.d.ts +9 -4
- package/dist/types/ai/static-expression.d.ts +28 -0
- package/dist/types/analytics/databuddy.d.ts +43 -0
- package/dist/types/analytics/index.d.ts +2 -0
- package/dist/types/analytics/schema.d.ts +14 -0
- package/dist/types/cli/env.d.ts +5 -0
- package/dist/types/cli/init/scaffold.d.ts +19 -3
- package/dist/types/cli/init/starter-spec.d.ts +11 -0
- package/dist/types/core/base-path.d.ts +9 -0
- package/dist/types/core/config-input.d.ts +4 -4
- package/dist/types/core/config.d.ts +2 -2
- package/dist/types/core/graph.d.ts +2 -0
- package/dist/types/core/i18n-ui.d.ts +31 -0
- package/dist/types/core/i18n.d.ts +7 -1
- package/dist/types/core/links.d.ts +3 -1
- package/dist/types/core/load-module.d.ts +10 -0
- package/dist/types/core/locale-links.d.ts +12 -2
- package/dist/types/core/meta.d.ts +5 -1
- package/dist/types/core/nav-diagnostics.d.ts +10 -0
- package/dist/types/core/navigation.d.ts +38 -0
- package/dist/types/core/ordering-prefix.d.ts +4 -0
- package/dist/types/core/safe-links.d.ts +3 -1
- package/dist/types/core/schema.d.ts +52 -13
- package/dist/types/core/sources/github-releases.d.ts +5 -0
- package/dist/types/core/sources/lower.d.ts +14 -2
- package/dist/types/core/sources/normalize.d.ts +10 -1
- package/dist/types/core/sources/remote.d.ts +11 -1
- package/dist/types/core/sources/resolve.d.ts +12 -0
- package/dist/types/core/sources/types.d.ts +31 -0
- package/dist/types/core/types.d.ts +9 -0
- package/dist/types/deploy/adapters/node.d.ts +5 -2
- package/dist/types/deploy/adapters/types.d.ts +7 -0
- package/dist/types/deploy/cloudflare-negotiation.d.ts +3 -2
- package/dist/types/deploy/headers.d.ts +31 -7
- package/dist/types/deploy/node-headers.d.ts +43 -8
- package/dist/types/deploy/platforms/netlify.d.ts +27 -2
- package/dist/types/deploy/platforms/node.d.ts +6 -5
- package/dist/types/deploy/platforms/types.d.ts +7 -0
- package/dist/types/deploy/platforms/vercel.d.ts +3 -2
- package/dist/types/deploy/redirects.d.ts +7 -2
- package/dist/types/deploy/vercel-negotiation.d.ts +3 -2
- package/dist/types/openapi/model.d.ts +20 -6
- package/dist/types/search/sync/algolia.d.ts +3 -1
- package/docs/01-quickstart.mdx +3 -2
- package/docs/02-deployment.mdx +17 -8
- package/docs/08-faq.mdx +9 -2
- package/docs/advanced/changelog.mdx +1 -1
- package/docs/advanced/custom-pages.mdx +4 -2
- package/docs/cli/audit.mdx +2 -2
- package/docs/cli/doctor.mdx +2 -2
- package/docs/cli/evals.mdx +2 -2
- package/docs/cli/index.mdx +4 -1
- package/docs/cli/translate.mdx +1 -1
- package/docs/configuration/analytics.mdx +23 -2
- package/docs/configuration/assistant.mdx +1 -1
- package/docs/configuration/customization.mdx +4 -3
- package/docs/configuration/index.mdx +5 -3
- package/docs/configuration/search.mdx +1 -1
- package/docs/content/components.mdx +1 -1
- package/docs/content/frontmatter.mdx +5 -1
- package/docs/content/i18n.mdx +1 -1
- package/docs/content/index.mdx +4 -2
- package/docs/content/meta.mdx +5 -3
- package/docs/content/navigation.mdx +29 -4
- package/docs/content/sources.mdx +18 -12
- package/docs/content/versioning.mdx +1 -0
- package/docs/discoverability/agent-discovery.mdx +21 -7
- package/docs/discoverability/index.mdx +2 -2
- package/docs/discoverability/llms-txt.mdx +2 -5
- package/docs/discoverability/markdown.mdx +5 -3
- package/docs/discoverability/mcp.mdx +4 -0
- package/docs/discoverability/metadata.mdx +3 -2
- package/docs/discoverability/open-graph.mdx +6 -4
- package/docs/discoverability/rss.mdx +3 -1
- package/docs/references/asyncapi.mdx +1 -1
- package/docs/references/graphql.mdx +2 -2
- package/docs/references/openapi.mdx +3 -3
- package/package.json +1 -1
- package/skills/blume-migrate/SKILL.md +6 -6
- package/skills/blume-migrate/references/docusaurus.md +6 -6
- package/skills/blume-migrate/references/mintlify.md +3 -3
- package/skills/blume-migrate/references/monorepo.md +1 -1
- package/skills/blume-migrate/references/nextra.md +1 -1
- package/skills/blume-migrate/references/starlight.md +5 -5
- package/skills/blume-migrate/scripts/mintlify-codemod.mjs +2 -2
- package/skills/blume-update-docs/references/audit-checklist.md +1 -1
- package/src/ai/agent-surface.ts +56 -0
- package/src/ai/api/spec.ts +15 -2
- package/src/ai/api-catalog.ts +7 -1
- package/src/ai/ask-context.ts +14 -2
- package/src/ai/ask-data.ts +26 -12
- package/src/ai/component-markdown.ts +43 -37
- package/src/ai/link-headers.ts +8 -3
- package/src/ai/llms.ts +4 -3
- package/src/ai/markdown.ts +23 -11
- package/src/ai/mcp/server.ts +78 -7
- package/src/ai/relative-links.ts +78 -10
- package/src/ai/static-expression.ts +416 -0
- package/src/ai/visibility.ts +45 -14
- package/src/analytics/databuddy.ts +67 -0
- package/src/analytics/head.ts +4 -0
- package/src/analytics/index.ts +2 -0
- package/src/analytics/posthog.ts +21 -3
- package/src/analytics/schema.ts +2 -0
- package/src/astro/generate.ts +71 -27
- package/src/astro/templates.ts +61 -23
- package/src/audit/catalog.ts +2 -2
- package/src/audit/checks/assets.ts +25 -5
- package/src/audit/checks/content.ts +20 -2
- package/src/audit/checks/i18n.ts +46 -8
- package/src/audit/checks/indexability.ts +39 -19
- package/src/audit/checks/links.ts +14 -0
- package/src/audit/checks/llms.ts +6 -3
- package/src/audit/checks/network.ts +3 -1
- package/src/audit/checks/og-image.ts +10 -0
- package/src/audit/checks/robots.ts +6 -1
- package/src/audit/checks/sitemap.ts +56 -31
- package/src/audit/checks/social.ts +21 -2
- package/src/audit/crawl.ts +88 -15
- package/src/audit/report.ts +54 -17
- package/src/audit/run.ts +1 -0
- package/src/audit/types.ts +18 -0
- package/src/audit/url.ts +37 -6
- package/src/cli/build-failure.ts +50 -0
- package/src/cli/commands/audit.ts +7 -0
- package/src/cli/commands/build.ts +19 -5
- package/src/cli/commands/check.ts +2 -0
- package/src/cli/commands/eval.ts +1 -7
- package/src/cli/commands/init.ts +15 -5
- package/src/cli/commands/preview.ts +15 -0
- package/src/cli/commands/sync.ts +2 -0
- package/src/cli/commands/translate.ts +9 -6
- package/src/cli/commands/upgrade.ts +11 -0
- package/src/cli/eject-scripts.ts +32 -7
- package/src/cli/env.ts +12 -1
- package/src/cli/init/scaffold.ts +117 -11
- package/src/cli/init/starter-spec.ts +235 -0
- package/src/components/content/AccordionItem.astro +26 -22
- package/src/components/content/Badge.astro +2 -9
- package/src/components/content/Card.astro +2 -2
- package/src/components/content/Component.astro +9 -3
- package/src/components/content/Expandable.astro +5 -1
- package/src/components/content/Frame.astro +2 -7
- package/src/components/content/GithubInfo.astro +12 -2
- package/src/components/content/Prompt.astro +2 -7
- package/src/components/content/Tabs.astro +54 -5
- package/src/components/content/Tile.astro +1 -1
- package/src/components/content/Tooltip.astro +69 -7
- package/src/components/content/Tree.astro +7 -2
- package/src/components/content/TypeTable.astro +10 -5
- package/src/components/content/Update.astro +8 -2
- package/src/components/content/auto-type-table.ts +4 -1
- package/src/components/content/badge-color.ts +17 -0
- package/src/components/content/base-href.ts +18 -3
- package/src/components/content/inline-markdown.ts +27 -7
- package/src/components/copy-feedback.ts +35 -8
- package/src/components/islands/assistant.tsx +16 -2
- package/src/components/islands/hooks.ts +7 -2
- package/src/components/islands/webmcp.ts +12 -8
- package/src/components/layout/Banner.astro +23 -4
- package/src/components/layout/Header.astro +22 -9
- package/src/components/layout/Logo.astro +5 -0
- package/src/components/layout/NavSelector.astro +6 -1
- package/src/components/layout/NavTabMenu.astro +133 -0
- package/src/components/layout/NavTree.astro +15 -6
- package/src/components/layout/NavTreeCache.astro +5 -2
- package/src/components/layout/NavTreeScript.astro +45 -5
- package/src/components/layout/PageLayout.astro +22 -8
- package/src/components/layout/ReferenceLayout.astro +4 -1
- package/src/components/layout/RootLayout.astro +21 -8
- package/src/components/layout/Search.astro +5 -1
- package/src/components/layout/analytics-client.ts +2 -0
- package/src/components/openapi/GraphqlType.astro +11 -3
- package/src/components/openapi/MessageComposer.astro +1 -1
- package/src/components/openapi/Operation.astro +21 -5
- package/src/components/openapi/PanelTabs.astro +4 -1
- package/src/components/openapi/Playground.astro +8 -2
- package/src/components/openapi/RequestPanel.astro +9 -5
- package/src/components/openapi/SchemaProperty.astro +11 -33
- package/src/components/openapi/SchemaTable.astro +27 -52
- package/src/components/openapi/helpers.ts +90 -12
- package/src/components/openapi/message-composer.ts +8 -0
- package/src/components/openapi/message-model.ts +12 -2
- package/src/components/openapi/message.ts +4 -1
- package/src/components/openapi/operation-model.ts +40 -8
- package/src/components/openapi/panel.ts +29 -5
- package/src/components/openapi/playground-client.ts +37 -7
- package/src/components/openapi/playground-schema.ts +25 -6
- package/src/components/openapi/request.ts +2 -0
- package/src/components/openapi/schema-tree.ts +203 -0
- package/src/components/openapi/snippets.ts +30 -15
- package/src/components/openapi/validate-json.ts +1 -1
- package/src/core/base-path.ts +15 -0
- package/src/core/config-input.ts +4 -4
- package/src/core/config.ts +18 -4
- package/src/core/diagnostics.ts +217 -30
- package/src/core/graph.ts +120 -11
- package/src/core/i18n-ui.ts +39 -2
- package/src/core/i18n.ts +13 -2
- package/src/core/links.ts +7 -4
- package/src/core/load-module.ts +20 -0
- package/src/core/locale-links.ts +17 -17
- package/src/core/manifest.ts +3 -2
- package/src/core/meta.ts +69 -6
- package/src/core/nav-diagnostics.ts +56 -1
- package/src/core/navigation.ts +245 -76
- package/src/core/ordering-prefix.ts +27 -0
- package/src/core/project-graph.ts +23 -1
- package/src/core/safe-href.ts +53 -1
- package/src/core/safe-links.ts +11 -2
- package/src/core/schema.ts +70 -14
- package/src/core/sources/assets.ts +83 -41
- package/src/core/sources/contentful-rich-text.ts +3 -2
- package/src/core/sources/contentful.ts +25 -12
- package/src/core/sources/filesystem.ts +5 -1
- package/src/core/sources/github-releases.ts +106 -5
- package/src/core/sources/lexical.ts +9 -4
- package/src/core/sources/lower.ts +79 -26
- package/src/core/sources/mdx-remote.ts +1 -0
- package/src/core/sources/normalize.ts +132 -30
- package/src/core/sources/notion.ts +26 -10
- package/src/core/sources/obsidian.ts +17 -3
- package/src/core/sources/payload.ts +1 -0
- package/src/core/sources/portable-text.ts +63 -44
- package/src/core/sources/remote.ts +18 -2
- package/src/core/sources/resolve.ts +52 -33
- package/src/core/sources/sanity.ts +1 -0
- package/src/core/sources/strapi-blocks.ts +9 -4
- package/src/core/sources/strapi.ts +1 -0
- package/src/core/sources/types.ts +31 -0
- package/src/core/types.ts +9 -0
- package/src/core/ui-packs/ar.ts +13 -0
- package/src/core/ui-packs/bg.ts +13 -0
- package/src/core/ui-packs/bn.ts +13 -0
- package/src/core/ui-packs/ca.ts +13 -0
- package/src/core/ui-packs/cs.ts +13 -0
- package/src/core/ui-packs/da.ts +13 -0
- package/src/core/ui-packs/de.ts +13 -0
- package/src/core/ui-packs/el.ts +13 -0
- package/src/core/ui-packs/es.ts +13 -0
- package/src/core/ui-packs/fa.ts +13 -0
- package/src/core/ui-packs/fi.ts +13 -0
- package/src/core/ui-packs/fr.ts +13 -0
- package/src/core/ui-packs/he.ts +13 -0
- package/src/core/ui-packs/hi.ts +13 -0
- package/src/core/ui-packs/hr.ts +13 -0
- package/src/core/ui-packs/hu.ts +13 -0
- package/src/core/ui-packs/id.ts +13 -0
- package/src/core/ui-packs/it.ts +13 -0
- package/src/core/ui-packs/ja.ts +13 -0
- package/src/core/ui-packs/ko.ts +13 -0
- package/src/core/ui-packs/nl.ts +13 -0
- package/src/core/ui-packs/no.ts +13 -0
- package/src/core/ui-packs/pl.ts +13 -0
- package/src/core/ui-packs/pt-br.ts +13 -0
- package/src/core/ui-packs/pt.ts +13 -0
- package/src/core/ui-packs/ro.ts +13 -0
- package/src/core/ui-packs/ru.ts +13 -0
- package/src/core/ui-packs/sk.ts +13 -0
- package/src/core/ui-packs/sr.ts +13 -0
- package/src/core/ui-packs/sv.ts +13 -0
- package/src/core/ui-packs/th.ts +13 -0
- package/src/core/ui-packs/tr.ts +13 -0
- package/src/core/ui-packs/uk.ts +13 -0
- package/src/core/ui-packs/vi.ts +13 -0
- package/src/core/ui-packs/zh-tw.ts +13 -0
- package/src/core/ui-packs/zh.ts +13 -0
- package/src/core/version-cut.ts +17 -2
- package/src/core/versions.ts +4 -1
- package/src/deploy/adapters/node.ts +5 -2
- package/src/deploy/adapters/registry.ts +2 -1
- package/src/deploy/adapters/types.ts +13 -1
- package/src/deploy/artifacts.ts +25 -5
- package/src/deploy/cloudflare-negotiation.ts +23 -4
- package/src/deploy/headers.ts +67 -51
- package/src/deploy/node-headers.ts +148 -27
- package/src/deploy/platforms/cloudflare.ts +1 -0
- package/src/deploy/platforms/netlify.ts +82 -5
- package/src/deploy/platforms/node.ts +7 -5
- package/src/deploy/platforms/static.ts +1 -0
- package/src/deploy/platforms/types.ts +7 -0
- package/src/deploy/platforms/vercel.ts +9 -3
- package/src/deploy/redirects.ts +14 -3
- package/src/deploy/vercel-negotiation.ts +35 -3
- package/src/eval/agents.ts +10 -2
- package/src/eval/run.ts +25 -0
- package/src/markdown/base-links.ts +55 -8
- package/src/markdown/index.ts +6 -3
- package/src/markdown/relative-links.ts +3 -23
- package/src/markdown/route-snapshot.ts +37 -0
- package/src/og/card.ts +20 -4
- package/src/og/derive.ts +145 -4
- package/src/openapi/graphql-build.ts +28 -2
- package/src/openapi/model.ts +77 -13
- package/src/openapi/render-mdx.ts +10 -1
- package/src/registry/eject.ts +119 -22
- package/src/search/documents.ts +22 -1
- package/src/search/sync/algolia.ts +36 -2
- package/src/sources/registry.ts +5 -0
- package/src/theme/entry.ts +11 -4
- package/src/translate/agents.ts +6 -1
- package/src/translate/ledger.ts +26 -3
- package/src/translate/meta.ts +11 -3
- package/src/translate/run.ts +11 -5
- package/src/translate/validate.ts +10 -1
- package/src/translate/work-list.ts +36 -3
- package/src/upgrade/upgrade.ts +36 -4
- package/dist/cli/chunk-2hn4b8z7.js.map +0 -12
- package/dist/cli/chunk-6crbhc3x.js.map +0 -14
- package/dist/cli/chunk-6hsn950k.js.map +0 -10
- package/dist/cli/chunk-79jhk4py.js.map +0 -35
- package/dist/cli/chunk-82bbrxdn.js +0 -51
- package/dist/cli/chunk-82bbrxdn.js.map +0 -10
- package/dist/cli/chunk-abh8yjkn.js +0 -31
- package/dist/cli/chunk-abh8yjkn.js.map +0 -10
- package/dist/cli/chunk-dh8cwk36.js.map +0 -10
- package/dist/cli/chunk-epjnccmv.js.map +0 -10
- package/dist/cli/chunk-fa25z98p.js.map +0 -11
- package/dist/cli/chunk-fs23ddbb.js.map +0 -35
- package/dist/cli/chunk-fz5wtpmh.js.map +0 -10
- package/dist/cli/chunk-kpf8rrjc.js.map +0 -19
- package/dist/cli/chunk-m3vmjgmq.js.map +0 -10
- package/dist/cli/chunk-mb2919y2.js.map +0 -10
- package/dist/cli/chunk-q5163e60.js.map +0 -11
- package/dist/cli/chunk-qkqwkpte.js.map +0 -182
- package/dist/cli/chunk-qs4q5p4e.js.map +0 -10
- package/dist/cli/chunk-s1p84fyh.js.map +0 -10
- package/dist/cli/chunk-wgm7m9qk.js.map +0 -36
- package/dist/cli/chunk-yt5n7ppj.js.map +0 -10
- /package/dist/cli/{chunk-vtk4a6dg.js.map → chunk-00gs3wqs.js.map} +0 -0
- /package/dist/cli/{chunk-6vm74dry.js.map → chunk-6dtt0zfn.js.map} +0 -0
- /package/dist/cli/{chunk-fxypxtvm.js.map → chunk-bbnwccaz.js.map} +0 -0
- /package/dist/cli/{chunk-ce574jw2.js.map → chunk-esh98wmb.js.map} +0 -0
- /package/dist/cli/{chunk-zxcczpyx.js.map → chunk-fsmrqk8a.js.map} +0 -0
- /package/dist/cli/{chunk-hdpx1tax.js.map → chunk-g698a744.js.map} +0 -0
- /package/dist/cli/{chunk-zxh4d9vy.js.map → chunk-h2ez8dzb.js.map} +0 -0
- /package/dist/cli/{chunk-5shv93fd.js.map → chunk-h7k3nq3v.js.map} +0 -0
- /package/dist/cli/{chunk-ah61y8py.js.map → chunk-mqc662a6.js.map} +0 -0
- /package/dist/cli/{chunk-ch6g3ar0.js.map → chunk-n1yg3tj3.js.map} +0 -0
- /package/dist/cli/{chunk-wm7js3j9.js.map → chunk-sqw4ekg1.js.map} +0 -0
- /package/dist/cli/{chunk-27g6wdth.js.map → chunk-wdrt2k2v.js.map} +0 -0
- /package/dist/cli/{chunk-s6jhgk0q.js.map → chunk-zp79m0ts.js.map} +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
hasScalarReferences,
|
|
4
|
+
needsPlaygroundProxy,
|
|
4
5
|
buildMcpDiscovery,
|
|
5
6
|
buildMcpServerCard,
|
|
6
7
|
sourcesOfKind,
|
|
@@ -10,18 +11,19 @@ import {
|
|
|
10
11
|
customOgRoutes,
|
|
11
12
|
resolveAskBackend,
|
|
12
13
|
buildIncludeGraph,
|
|
14
|
+
collectContentAssets,
|
|
13
15
|
buildRssFeeds,
|
|
14
16
|
renderRssFeed,
|
|
15
17
|
isOpenApiSource,
|
|
16
18
|
buildRawMarkdown
|
|
17
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-v6ya5kcb.js";
|
|
18
20
|
import {
|
|
19
21
|
packageRoot
|
|
20
22
|
} from "./index.js";
|
|
21
23
|
import {
|
|
22
24
|
buildSearchDocuments,
|
|
23
25
|
buildMcpData
|
|
24
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-ddndchfr.js";
|
|
25
27
|
import {
|
|
26
28
|
planComponentSlots,
|
|
27
29
|
runtimeDependencies,
|
|
@@ -34,8 +36,10 @@ import {
|
|
|
34
36
|
searchClientTemplate,
|
|
35
37
|
mixedbreadSearchEndpointTemplate,
|
|
36
38
|
rawMarkdownEndpointTemplate,
|
|
39
|
+
contentAssetsEndpointTemplate,
|
|
37
40
|
mcpPageFile,
|
|
38
41
|
mcpEndpointTemplate,
|
|
42
|
+
playgroundProxyTemplate,
|
|
39
43
|
staticJsonEndpointTemplate,
|
|
40
44
|
rssEndpointTemplate,
|
|
41
45
|
ogEndpointTemplate,
|
|
@@ -47,10 +51,10 @@ import {
|
|
|
47
51
|
exampleMapTemplate,
|
|
48
52
|
examplesPageTemplate,
|
|
49
53
|
runtimeTsconfigTemplate
|
|
50
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-hr8ne106.js";
|
|
51
55
|
import {
|
|
52
56
|
discoverIslands
|
|
53
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-sqw4ekg1.js";
|
|
54
58
|
import {
|
|
55
59
|
buildAskData,
|
|
56
60
|
buildThemeCss,
|
|
@@ -67,13 +71,17 @@ import {
|
|
|
67
71
|
detectUsesMath,
|
|
68
72
|
collectStaged,
|
|
69
73
|
buildRuntimeData,
|
|
74
|
+
PLAYGROUND_PROXY_ENTRY,
|
|
75
|
+
playgroundProxyPattern,
|
|
76
|
+
specOrigins,
|
|
77
|
+
proxyAllowlistWarnings,
|
|
70
78
|
analyzeComponentsFile,
|
|
71
79
|
languageIconCssFor,
|
|
72
80
|
clientFeaturesFor
|
|
73
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-xh43dwgw.js";
|
|
74
82
|
import {
|
|
75
83
|
scanProject
|
|
76
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-5r8g91qn.js";
|
|
77
85
|
|
|
78
86
|
// src/registry/eject.ts
|
|
79
87
|
import { existsSync } from "node:fs";
|
|
@@ -141,6 +149,18 @@ var mcpDiscoveryPages = (project, userPages) => hostsMcp(project, userPages) ? [
|
|
|
141
149
|
pattern: "/.well-known/mcp/server-card.json"
|
|
142
150
|
}
|
|
143
151
|
] : [];
|
|
152
|
+
var playgroundProxyPages = (config) => needsPlaygroundProxy(config) ? [
|
|
153
|
+
{
|
|
154
|
+
entrypoint: toPosix(join("src", PLAYGROUND_PROXY_ENTRY)),
|
|
155
|
+
pattern: playgroundProxyPattern(config)
|
|
156
|
+
}
|
|
157
|
+
] : [];
|
|
158
|
+
var playgroundProxyFiles = (config, openApiData, srcDir) => needsPlaygroundProxy(config) ? [
|
|
159
|
+
{
|
|
160
|
+
content: playgroundProxyTemplate(specOrigins(openApiData)),
|
|
161
|
+
path: join(srcDir, PLAYGROUND_PROXY_ENTRY)
|
|
162
|
+
}
|
|
163
|
+
] : [];
|
|
144
164
|
var mcpFiles = async (project, userPages, srcDir, genDir) => {
|
|
145
165
|
if (!hostsMcp(project, userPages)) {
|
|
146
166
|
return [];
|
|
@@ -187,6 +207,24 @@ var changelogFiles = (project, userPages, srcDir, options) => {
|
|
|
187
207
|
}
|
|
188
208
|
];
|
|
189
209
|
};
|
|
210
|
+
var contentAssetFiles = async (project, root, srcDir, genDir) => {
|
|
211
|
+
const assets = await collectContentAssets(project);
|
|
212
|
+
const portable = Object.fromEntries(Object.entries(assets).map(([param, abs]) => [
|
|
213
|
+
param,
|
|
214
|
+
toPosix(relative(root, abs))
|
|
215
|
+
]));
|
|
216
|
+
return [
|
|
217
|
+
{
|
|
218
|
+
content: `${JSON.stringify(portable)}
|
|
219
|
+
`,
|
|
220
|
+
path: join(genDir, "content-assets.json")
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
content: contentAssetsEndpointTemplate(null),
|
|
224
|
+
path: join(srcDir, "pages", "blume-assets", "[...asset].ts")
|
|
225
|
+
}
|
|
226
|
+
];
|
|
227
|
+
};
|
|
190
228
|
var readUserCss = async (file, genDir) => {
|
|
191
229
|
if (!(file && existsSync(file))) {
|
|
192
230
|
return "";
|
|
@@ -206,6 +244,8 @@ var ejectDependencies = (options) => {
|
|
|
206
244
|
...new Set([
|
|
207
245
|
"astro",
|
|
208
246
|
"@tailwindcss/vite",
|
|
247
|
+
"tailwindcss",
|
|
248
|
+
"@tailwindcss/typography",
|
|
209
249
|
"blume",
|
|
210
250
|
...runtimeDependencies(options),
|
|
211
251
|
...options.needsReact ? ["react", "react-dom"] : [],
|
|
@@ -273,8 +313,10 @@ var eject = async (root) => {
|
|
|
273
313
|
entrypoint: toPosix(relative(root, page.entrypoint)),
|
|
274
314
|
pattern: page.pattern
|
|
275
315
|
})),
|
|
276
|
-
...mcpDiscoveryPages(project, pages)
|
|
316
|
+
...mcpDiscoveryPages(project, pages),
|
|
317
|
+
...playgroundProxyPages(config)
|
|
277
318
|
];
|
|
319
|
+
const openApiData = ejectOpenApiData(project);
|
|
278
320
|
const staged = collectStaged(project);
|
|
279
321
|
const hasStaged = staged.size > 0;
|
|
280
322
|
const stagedDir = "blume-staged";
|
|
@@ -362,7 +404,7 @@ var eject = async (root) => {
|
|
|
362
404
|
path: join(genDir, "Ask.astro")
|
|
363
405
|
},
|
|
364
406
|
{
|
|
365
|
-
content: `${JSON.stringify(
|
|
407
|
+
content: `${JSON.stringify(openApiData)}
|
|
366
408
|
`,
|
|
367
409
|
path: join(genDir, "openapi.json")
|
|
368
410
|
},
|
|
@@ -385,21 +427,23 @@ var eject = async (root) => {
|
|
|
385
427
|
path: join(srcDir, "pages", "[...slug].mdx.ts")
|
|
386
428
|
}
|
|
387
429
|
];
|
|
430
|
+
files.push(...await contentAssetFiles(project, root, srcDir, genDir));
|
|
388
431
|
if (assistantEnabled) {
|
|
389
432
|
files.push(...await askFiles(project, srcDir, genDir));
|
|
390
433
|
}
|
|
434
|
+
const changelog = changelogFiles(project, pages, srcDir, {
|
|
435
|
+
exportEpub,
|
|
436
|
+
exportPdf,
|
|
437
|
+
needsReact,
|
|
438
|
+
staged: hasStaged
|
|
439
|
+
});
|
|
391
440
|
if (config.seo.og.enabled) {
|
|
392
441
|
files.push({
|
|
393
|
-
content: ogEndpointTemplate(customOgRoutes(pages, config.title, config.seo.og.titles), { pageDescriptions: config.seo.og.description !== false }),
|
|
442
|
+
content: ogEndpointTemplate(customOgRoutes(pages, config.title, config.seo.og.titles), { pageDescriptions: config.seo.og.description !== false }, changelog.length > 0),
|
|
394
443
|
path: join(srcDir, "pages", "og", "[...slug].png.ts")
|
|
395
444
|
});
|
|
396
445
|
}
|
|
397
|
-
files.push(...await mcpFiles(project, pages, srcDir, genDir), ...
|
|
398
|
-
exportEpub,
|
|
399
|
-
exportPdf,
|
|
400
|
-
needsReact,
|
|
401
|
-
staged: hasStaged
|
|
402
|
-
}));
|
|
446
|
+
files.push(...await mcpFiles(project, pages, srcDir, genDir), ...changelog, ...playgroundProxyFiles(config, openApiData, srcDir));
|
|
403
447
|
if (!routeIsTaken(pages, project.graph.pages, "/404")) {
|
|
404
448
|
files.push({
|
|
405
449
|
content: notFoundPageTemplate(),
|
|
@@ -443,7 +487,7 @@ var eject = async (root) => {
|
|
|
443
487
|
path: join(srcDir, "pages", "[section]", "rss.xml.ts")
|
|
444
488
|
});
|
|
445
489
|
}
|
|
446
|
-
const warnings =
|
|
490
|
+
const warnings = proxyAllowlistWarnings(config, openApiData);
|
|
447
491
|
if (hasScalarReferences(config)) {
|
|
448
492
|
const references = await buildReferenceFiles({
|
|
449
493
|
config,
|
|
@@ -494,5 +538,5 @@ var eject = async (root) => {
|
|
|
494
538
|
|
|
495
539
|
export { eject };
|
|
496
540
|
|
|
497
|
-
//# debugId=
|
|
498
|
-
//# sourceMappingURL=chunk-
|
|
541
|
+
//# debugId=C71F2E51356BFBB664756E2164756E21
|
|
542
|
+
//# sourceMappingURL=chunk-j85scx15.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/registry/eject.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { existsSync } from \"node:fs\";\nimport { cp, mkdir, readFile, rm, writeFile } from \"node:fs/promises\";\n\nimport { join, relative } from \"pathe\";\n\nimport { buildAskData } from \"../ai/ask-data.ts\";\nimport { resolveAskBackend } from \"../ai/ask.ts\";\nimport { buildRawMarkdown } from \"../ai/markdown.ts\";\nimport { buildMcpData } from \"../ai/mcp/data.ts\";\nimport { buildMcpDiscovery, buildMcpServerCard } from \"../ai/mcp/discovery.ts\";\nimport { planComponentSlots } from \"../astro/component-slots.ts\";\nimport {\n EXAMPLE_SCAN_GLOB,\n discoverExamples,\n exampleMarkdownLookup,\n exampleScanRoots,\n} from \"../astro/examples.ts\";\nimport {\n analyzeComponentsFile,\n buildRuntimeData,\n clientFeaturesFor,\n collectStaged,\n detectNeedsReact,\n detectUsesMath,\n languageIconCssFor,\n PLAYGROUND_PROXY_ENTRY,\n playgroundProxyPattern,\n proxyAllowlistWarnings,\n specOrigins,\n} from \"../astro/generate.ts\";\nimport { discoverIslands } from \"../astro/islands.ts\";\nimport { customOgRoutes, discoverPages, routeIsTaken } from \"../astro/pages.ts\";\nimport {\n askComponentTemplate,\n askEndpointTemplate,\n astroConfigTemplate,\n catchAllPageTemplate,\n changelogIndexTemplate,\n contentAssetsEndpointTemplate,\n contentConfigTemplate,\n exampleMapTemplate,\n exampleSlug,\n examplesPageTemplate,\n exampleWrapperTemplate,\n featuresTemplate,\n mcpEndpointTemplate,\n mcpPageFile,\n mixedbreadSearchEndpointTemplate,\n notFoundPageTemplate,\n ogEndpointTemplate,\n playgroundProxyTemplate,\n rawMarkdownEndpointTemplate,\n rssEndpointTemplate,\n runtimeDependencies,\n runtimeTsconfigTemplate,\n searchClientTemplate,\n searchEndpointTemplate,\n staticJsonEndpointTemplate,\n} from \"../astro/templates.ts\";\nimport { collectContentAssets } from \"../core/content-assets.ts\";\nimport { buildIncludeGraph } from \"../core/includes.ts\";\nimport { packageRoot } from \"../core/package-root.ts\";\nimport { scanProject } from \"../core/project-graph.ts\";\nimport type { BlumeProject } from \"../core/project-graph.ts\";\nimport {\n resolveDocsCollection,\n sourcesOfKind,\n} from \"../core/sources/collection.ts\";\nimport type { ProjectContext } from \"../core/types.ts\";\nimport { buildRssFeeds, renderRssFeed } from \"../deploy/rss.ts\";\nimport type { OpenApiData } from \"../openapi/model.ts\";\nimport {\n hasScalarReferences,\n needsPlaygroundProxy,\n} from \"../openapi/references.ts\";\nimport { buildReferenceFiles } from \"../openapi/scalar.ts\";\nimport { isOpenApiSource } from \"../openapi/source.ts\";\nimport { buildSearchDocuments } from \"../search/documents.ts\";\nimport {\n examplesEntryTemplate,\n tailwindEntryTemplate,\n} from \"../theme/entry.ts\";\nimport { buildThemeCss } from \"../theme/palette.ts\";\nimport { rebaseSourceDirectives } from \"../theme/sources.ts\";\nimport { twoslashCss } from \"../theme/twoslash.ts\";\n\nconst toPosix = (path: string): string => path.split(\"\\\\\").join(\"/\");\n\n/** The portable `@source` guess: blume in the project's own node_modules. */\nconst LOCAL_BLUME_SOURCE = \"../../node_modules/blume/src/**/*.{astro,ts,tsx}\";\n\n/**\n * The `@source` glob pointing Tailwind at Blume's own source, relative to the\n * ejected `src/generated/app.css`. The project-local `node_modules/blume` is\n * preferred (portable, and under pnpm the symlink survives version bumps), but\n * hoisted installs (npm/yarn workspaces lift blume into the workspace root's\n * node_modules) would make that guess match nothing and silently drop utility\n * classes — so fall back to the package's real installed location, and when\n * even that fails, warn instead of failing silently.\n *\n * Exported for testing.\n */\nexport const blumeSourceGlob = (\n root: string,\n genDir: string,\n resolveBlumeRoot: () => string = packageRoot\n): string => {\n if (existsSync(join(root, \"node_modules\", \"blume\"))) {\n return LOCAL_BLUME_SOURCE;\n }\n try {\n const src = join(resolveBlumeRoot(), \"src\");\n return `${toPosix(relative(genDir, src))}/**/*.{astro,ts,tsx}`;\n } catch {\n console.warn(\n 'blume: could not locate the installed blume package; src/generated/app.css keeps its default `@source \"../../node_modules/blume/...\"` glob. If blume is hoisted elsewhere, point that glob at its install location or Blume\\'s utility classes will be missing.'\n );\n return LOCAL_BLUME_SOURCE;\n }\n};\n\n/** The `blume:openapi` payload for the ejected app (`{}` when none). */\nconst ejectOpenApiData = (project: BlumeProject): OpenApiData => {\n const source = project.sources.find(isOpenApiSource);\n return source ? source.openApiData() : {};\n};\n\n/**\n * The assistant endpoint plus, unless the backend runs its own retrieval (Inkeep),\n * its grounding snapshot. Empty when the assistant is disabled.\n */\nconst askFiles = async (\n project: BlumeProject,\n srcDir: string,\n genDir: string\n): Promise<{ content: string; path: string }[]> => {\n const { assistant } = project.config.ai;\n if (!(assistant?.enabled && !assistant.endpoint)) {\n const endpointPath = join(srcDir, \"pages\", \"api\", \"ask.ts\");\n if (existsSync(endpointPath)) {\n const content = await readFile(endpointPath, \"utf-8\");\n if (content.startsWith(\"// Generated by Blume. Do not edit.\")) {\n await rm(endpointPath, { force: true });\n }\n }\n await rm(join(genDir, \"ask-data.json\"), { force: true });\n return [];\n }\n const backend = resolveAskBackend(assistant.provider);\n const files = [\n {\n content: askEndpointTemplate(backend, {\n cors: assistant.cors,\n instructions: assistant.instructions,\n retrieval: assistant.retrieval,\n }),\n path: join(srcDir, \"pages\", \"api\", \"ask.ts\"),\n },\n ];\n if (backend.grounded) {\n files.push({\n content: `${JSON.stringify(await buildAskData(project))}\\n`,\n path: join(genDir, \"ask-data.json\"),\n });\n }\n return files;\n};\n\n/** Whether the ejected app hosts the MCP server (enabled and route free). */\nconst hostsMcp = (\n project: BlumeProject,\n userPages: { pattern: string }[]\n): boolean =>\n project.config.agents.mcp.enabled &&\n !routeIsTaken(\n userPages,\n project.graph.pages,\n project.config.agents.mcp.route\n );\n\n/**\n * The `.well-known` MCP discovery routes, injected as prerendered pages\n * alongside the user's own so the ejected Astro config wires them in. Empty\n * when the server is disabled or its route is already owned by a page.\n */\nconst mcpDiscoveryPages = (\n project: BlumeProject,\n userPages: { pattern: string }[]\n): { entrypoint: string; pattern: string }[] =>\n hostsMcp(project, userPages)\n ? [\n {\n entrypoint: \"src/blume-mcp/discovery.ts\",\n pattern: \"/.well-known/mcp.json\",\n },\n {\n entrypoint: \"src/blume-mcp/server-card.ts\",\n pattern: \"/.well-known/mcp/server-card.json\",\n },\n ]\n : [];\n\n/**\n * The playground's built-in CORS proxy route (`playground: { proxy: true }`),\n * mirroring `planPlaygroundProxy` in generate.ts: injected like the MCP\n * discovery routes, because Astro treats a `_`-prefixed page file as private,\n * and mounted under `basePath` at the URL the playground sends to. Empty when\n * no reference routes its playground through it.\n */\nconst playgroundProxyPages = (\n config: BlumeProject[\"config\"]\n): { entrypoint: string; pattern: string }[] =>\n needsPlaygroundProxy(config)\n ? [\n {\n entrypoint: toPosix(join(\"src\", PLAYGROUND_PROXY_ENTRY)),\n pattern: playgroundProxyPattern(config),\n },\n ]\n : [];\n\n/**\n * The proxy endpoint behind {@link playgroundProxyPages}, with the origin\n * allowlist baked in from the same parsed specs the reference pages render.\n */\nconst playgroundProxyFiles = (\n config: BlumeProject[\"config\"],\n openApiData: OpenApiData,\n srcDir: string\n): { content: string; path: string }[] =>\n needsPlaygroundProxy(config)\n ? [\n {\n content: playgroundProxyTemplate(specOrigins(openApiData)),\n path: join(srcDir, PLAYGROUND_PROXY_ENTRY),\n },\n ]\n : [];\n\n/**\n * The MCP data snapshot, server endpoint, and `.well-known` discovery\n * documents, mirroring `writeMcpFiles` in generate.ts. Empty when the server\n * is disabled or its route is already owned by a page.\n */\nconst mcpFiles = async (\n project: BlumeProject,\n userPages: { pattern: string }[],\n srcDir: string,\n genDir: string\n): Promise<{ content: string; path: string }[]> => {\n if (!hostsMcp(project, userPages)) {\n return [];\n }\n const { route } = project.config.agents.mcp;\n const data = await buildMcpData(project);\n const discoveryInput = {\n base: data.base,\n name: data.name,\n route,\n site: data.site,\n version: data.version,\n };\n return [\n {\n content: `${JSON.stringify(data)}\\n`,\n path: join(genDir, \"mcp-data.json\"),\n },\n {\n content: mcpEndpointTemplate(),\n path: join(srcDir, \"pages\", mcpPageFile(route)),\n },\n {\n content: staticJsonEndpointTemplate(buildMcpDiscovery(discoveryInput)),\n path: join(srcDir, \"blume-mcp\", \"discovery.ts\"),\n },\n {\n content: staticJsonEndpointTemplate(buildMcpServerCard(discoveryInput)),\n path: join(srcDir, \"blume-mcp\", \"server-card.ts\"),\n },\n ];\n};\n\n/**\n * The `/changelog` index page, mirroring `shouldGenerateChangelog` in\n * generate.ts: emitted when `type: changelog` entries or a release-backed\n * changelog source exist, unless a user page already owns the route.\n */\nconst changelogFiles = (\n project: BlumeProject,\n userPages: { pattern: string }[],\n srcDir: string,\n options: Parameters<typeof changelogIndexTemplate>[0]\n): { content: string; path: string }[] => {\n const hasChangelog = project.graph.pages.some(\n (page) =>\n page.contentType === \"changelog\" &&\n !(page.meta.draft || page.meta.sidebar.hidden)\n );\n const hasChangelogSource =\n sourcesOfKind(project.config, \"github-releases\").length > 0;\n if (\n !(hasChangelog || hasChangelogSource) ||\n routeIsTaken(userPages, project.graph.pages, \"/changelog\")\n ) {\n return [];\n }\n return [\n {\n content: changelogIndexTemplate(options),\n path: join(srcDir, \"pages\", \"changelog.astro\"),\n },\n ];\n};\n\n/**\n * The colocated-image map and the `/blume-assets/[...asset]` endpoint that\n * serves it, mirroring generate.ts: the ejected raw Markdown points\n * `` at `/blume-assets/content/…`, and the config aliases\n * `blume:content-assets` to the map. Each original's path is written relative\n * to the project root (the directory `astro dev`/`astro build` run from), so\n * the ejected app builds from any checkout. Remote-source images need no\n * endpoint: eject copies them into the project's own `public/blume-assets`.\n */\nconst contentAssetFiles = async (\n project: BlumeProject,\n root: string,\n srcDir: string,\n genDir: string\n): Promise<{ content: string; path: string }[]> => {\n const assets = await collectContentAssets(project);\n const portable = Object.fromEntries(\n Object.entries(assets).map(([param, abs]) => [\n param,\n toPosix(relative(root, abs)),\n ])\n );\n return [\n {\n content: `${JSON.stringify(portable)}\\n`,\n path: join(genDir, \"content-assets.json\"),\n },\n {\n content: contentAssetsEndpointTemplate(null),\n path: join(srcDir, \"pages\", \"blume-assets\", \"[...asset].ts\"),\n },\n ];\n};\n\n/** Contents of the configured `examples.css`, or `\"\"` when unset/absent. */\n/**\n * Read a user stylesheet that eject inlines into a generated entry under\n * `genDir`, re-rooting its relative `@source` paths from the user's file.\n * Resolves to an empty string when the file is unset or absent.\n */\nconst readUserCss = async (\n file: string | null,\n genDir: string\n): Promise<string> => {\n if (!(file && existsSync(file))) {\n return \"\";\n }\n const css = await readFile(file, \"utf-8\");\n return rebaseSourceDirectives(css, { from: file, to: genDir });\n};\n\n/**\n * The per-example preview route `<Component />` iframes embed, nested under\n * `basePath` so it stays reachable behind a proxy that only forwards the\n * base. Empty when the project has no examples.\n */\nconst examplesPreviewFiles = (\n srcDir: string,\n basePath: string,\n hasExamples: boolean\n): { content: string; path: string }[] =>\n hasExamples\n ? [\n {\n content: examplesPageTemplate(),\n path: join(\n srcDir,\n \"pages\",\n ...basePath.split(\"/\").filter(Boolean),\n \"blume-examples\",\n \"[...path].astro\"\n ),\n },\n ]\n : [];\n\n/**\n * The packages the ejected app imports by bare name: Astro, Tailwind's Vite\n * plugin, Tailwind and its typography plugin (which the generated `app.css`\n * and `examples.css` import by name), `blume` itself, the integrations the\n * config wires in, whatever the configured adapters declare, and React when\n * islands, examples, or the assistant render with it (Blume ships React, so\n * projects rarely list it). They have to be the project's own dependencies\n * after eject — under a strict linker such as pnpm nothing else makes them\n * resolvable, and `astro build` fails. The hidden runtime reaches the same\n * packages through its `node_modules` junction into Blume's own, so only\n * eject declares the ones its generated files import directly: the AI SDK the\n * assistant route streams through (unless `ai.assistant.endpoint` points\n * elsewhere, when no route is written) and the EPUB generator's browser bundle\n * `features.ts` loads (only named there when `export.epub` is on).\n */\nconst ejectDependencies = (\n options: Parameters<typeof runtimeDependencies>[0]\n): string[] => {\n const { assistant } = options.config.ai;\n return [\n ...new Set([\n \"astro\",\n \"@tailwindcss/vite\",\n \"tailwindcss\",\n \"@tailwindcss/typography\",\n \"blume\",\n ...runtimeDependencies(options),\n ...(options.needsReact ? [\"react\", \"react-dom\"] : []),\n ...(assistant?.enabled && !assistant.endpoint ? [\"ai\"] : []),\n ...(options.config.export.epub ? [\"epub-gen-memory\"] : []),\n ]),\n ];\n};\n\nconst ejectIntegrationBridge = (\n config: BlumeProject[\"config\"],\n root: string,\n configFile: string | null\n): Parameters<typeof astroConfigTemplate>[0][\"integrationBridge\"] =>\n config.integrations.length > 0 && configFile\n ? { configFile: toPosix(relative(root, configFile)) }\n : undefined;\n\n/**\n * Promote the generated runtime into the project as an owned Astro app. After\n * eject the project has a normal `astro.config.mjs` and `src/`, the `blume` CLI\n * is no longer required, and the `blume` package remains importable.\n *\n * Returns the written files plus non-fatal warnings, mirroring the generated\n * runtime (e.g. a Scalar reference spec that wasn't found, or a reference\n * route colliding with a content page), and the packages the ejected app\n * imports by bare name, for the caller to add to package.json.\n */\nexport const eject = async (\n root: string\n): Promise<{ dependencies: string[]; files: string[]; warnings: string[] }> => {\n const project = await scanProject(root, { mode: \"build\" });\n const { context, config } = project;\n\n const srcDir = join(root, \"src\");\n const genDir = join(srcDir, \"generated\");\n const assistantEnabled = config.ai.assistant?.enabled ?? false;\n const exportPdf = config.export.pdf;\n const exportEpub = config.export.epub;\n\n // Discover examples first and expose them on the project, so the agent-facing\n // Markdown built below (raw `.md`, MCP) downlevels `<Component>` to its source.\n const examples = await discoverExamples(root, config.examples.source);\n project.examples = exampleMarkdownLookup(examples.examples);\n\n const [\n pages,\n needsReactRaw,\n usesMath,\n userTheme,\n userExamplesCss,\n rawMarkdown,\n islands,\n overrideAnalysis,\n ] = await Promise.all([\n context.pagesRoot ? discoverPages(context.pagesRoot) : Promise.resolve([]),\n detectNeedsReact(root),\n detectUsesMath(root),\n readUserCss(context.themeFile, genDir),\n readUserCss(\n config.examples.css ? join(root, config.examples.css) : null,\n genDir\n ),\n buildRawMarkdown(project),\n discoverIslands(root),\n analyzeComponentsFile(context.componentsFile),\n ]);\n // The `islands/` convention and `components.ts` share the same static plan\n // the CLI uses, with every import written relative to its generated file so\n // the ejected app builds from any checkout (like the example wrappers below).\n const slotPlan = planComponentSlots(islands.islands, overrideAnalysis, {\n relativeTo: genDir,\n });\n // Island/example/override frameworks drive which Astro renderers the ejected\n // config wires in; React also switches on for project `.tsx`/`.jsx` and the assistant.\n const frameworks = new Set<string>([\n ...islands.islands.map((island) => island.framework),\n ...examples.examples.map((example) => example.framework),\n ...slotPlan.frameworks,\n ]);\n const needsReact =\n needsReactRaw || assistantEnabled || frameworks.has(\"react\");\n const needsVue = frameworks.has(\"vue\");\n const needsSvelte = frameworks.has(\"svelte\");\n\n // A project-relative context so generated files use portable paths.\n const relContext: ProjectContext = {\n ...context,\n contentRoot: toPosix(relative(root, context.contentRoot)),\n distDir: \"./dist\",\n outDir: \".\",\n pagesRoot: context.pagesRoot\n ? `./${toPosix(relative(root, context.pagesRoot))}`\n : null,\n root: \".\",\n };\n // The `docs` collection resolves its base against the real project root and\n // is then relativized like everything else, so the ejected content config\n // never bakes in the absolute path `eject` happened to run from.\n const docsCollection = resolveDocsCollection(config, root);\n const relCollection = {\n ...docsCollection,\n base: toPosix(relative(root, docsCollection.base)),\n };\n\n const relPages = [\n ...pages.map((page) => ({\n entrypoint: toPosix(relative(root, page.entrypoint)),\n pattern: page.pattern,\n })),\n ...mcpDiscoveryPages(project, pages),\n ...playgroundProxyPages(config),\n ];\n const openApiData = ejectOpenApiData(project);\n\n // Non-filesystem sources eject their materialized MDX into `<root>/blume-staged`\n // (a dedicated dir so it never clashes with a content root literally named\n // `content`; the relative `staged` collection points there).\n const staged = collectStaged(project);\n const hasStaged = staged.size > 0;\n const stagedDir = \"blume-staged\";\n const features = await clientFeaturesFor(project);\n const languageIcons = await languageIconCssFor(project);\n\n const files: {\n path: string;\n content: string;\n /** Don't overwrite a file the user already owns (e.g. a tuned tsconfig). */\n skipIfExists?: boolean;\n }[] = [\n {\n content: astroConfigTemplate({\n askPath: \"./src/generated/Ask.astro\",\n config,\n contentRoot: relContext.contentRoot,\n contentRoutes: project.manifest.routes.map((route) => route.path),\n context: relContext,\n examplesPath: \"./src/generated/examples.ts\",\n examplesThemePath: \"./src/generated/examples.css\",\n features,\n featuresPath: \"./src/generated/features.ts\",\n // No CLI publishes the runtime data modules in memory after eject, so\n // the config aliases each to the JSON snapshot written below.\n generatedModulesDir: \"./src/generated\",\n integrationBridge: ejectIntegrationBridge(\n config,\n root,\n context.configFile\n ),\n needsReact,\n needsSvelte,\n needsVue,\n pages: relPages,\n searchClientPath: \"./src/generated/search-client.ts\",\n themePath: \"./src/generated/app.css\",\n }),\n path: join(root, \"astro.config.mjs\"),\n },\n {\n content: runtimeTsconfigTemplate(),\n path: join(root, \"tsconfig.json\"),\n // Never clobber a hand-tuned tsconfig; only write ours if none exists.\n skipIfExists: true,\n },\n {\n content: contentConfigTemplate({\n collection: relCollection,\n config,\n context: relContext,\n staged: hasStaged,\n stagedBase: stagedDir,\n }),\n path: join(srcDir, \"content.config.ts\"),\n },\n {\n content: catchAllPageTemplate({\n exportEpub,\n exportPdf,\n mathEnabled: usesMath,\n needsReact,\n }),\n path: join(srcDir, \"pages\", \"[...slug].astro\"),\n },\n {\n content: slotPlan.module,\n path: join(genDir, \"components.ts\"),\n },\n // The example map the catch-all imports; written even when empty so the\n // `blume:examples` alias always resolves.\n {\n content: exampleMapTemplate(examples.examples, config.basePath),\n path: join(genDir, \"examples.ts\"),\n },\n {\n // The isolated Tailwind entry for `<Component />` preview frames.\n // Relative sources keep the ejected app portable.\n content: examplesEntryTemplate({\n configTokens: buildThemeCss(config.theme),\n sources: exampleScanRoots(root, examples.dir).map(\n (dir) => `${relative(genDir, dir)}/${EXAMPLE_SCAN_GLOB}`\n ),\n userCss: userExamplesCss,\n }),\n path: join(genDir, \"examples.css\"),\n },\n {\n content: tailwindEntryTemplate({\n configTokens: buildThemeCss(config.theme),\n languageIcons,\n // Relative paths from src/generated/app.css keep the ejected app\n // portable; the blume glob resolves the real install location when\n // the package is hoisted out of the project's own node_modules.\n sources: [\n blumeSourceGlob(root, genDir),\n \"../../**/*.{astro,mdx,ts,tsx}\",\n ],\n twoslashCss: twoslashCss(),\n userTheme,\n }),\n path: join(genDir, \"app.css\"),\n },\n { content: buildRuntimeData(project), path: join(genDir, \"data.json\") },\n // The header's Ask trigger behind the `blume:ask` alias. Always written — it\n // renders nothing when Ask is off — so the alias always resolves.\n {\n content: askComponentTemplate(assistantEnabled),\n path: join(genDir, \"Ask.astro\"),\n },\n {\n content: `${JSON.stringify(openApiData)}\\n`,\n path: join(genDir, \"openapi.json\"),\n },\n {\n content: `${JSON.stringify(rawMarkdown)}\\n`,\n path: join(genDir, \"raw-markdown.json\"),\n },\n {\n // The partial → including-pages map behind `includeHmrPlugin`, which the\n // ejected astro.config wires at this exact path — without the file every\n // hot update's read would silently no-op and partial edits would serve\n // stale pages. A snapshot like the rest of `src/generated`: the ejected\n // app owns (and may regenerate or prune) it.\n content: `${JSON.stringify(buildIncludeGraph(project.graph.pages))}\\n`,\n path: join(genDir, \"includes.json\"),\n },\n {\n content: rawMarkdownEndpointTemplate(\"md\"),\n path: join(srcDir, \"pages\", \"[...slug].md.ts\"),\n },\n {\n content: rawMarkdownEndpointTemplate(\"mdx\"),\n path: join(srcDir, \"pages\", \"[...slug].mdx.ts\"),\n },\n ];\n\n files.push(...(await contentAssetFiles(project, root, srcDir, genDir)));\n\n if (assistantEnabled) {\n files.push(...(await askFiles(project, srcDir, genDir)));\n }\n\n // The `/changelog` index, mirrored from the generated runtime (`[]` when\n // the project has no changelog). The OG endpoint below adds its card.\n const changelog = changelogFiles(project, pages, srcDir, {\n exportEpub,\n exportPdf,\n needsReact,\n staged: hasStaged,\n });\n\n if (config.seo.og.enabled) {\n files.push({\n content: ogEndpointTemplate(\n customOgRoutes(pages, config.title, config.seo.og.titles),\n { pageDescriptions: config.seo.og.description !== false },\n changelog.length > 0\n ),\n path: join(srcDir, \"pages\", \"og\", \"[...slug].png.ts\"),\n });\n }\n\n // The hosted MCP server and the playground's built-in proxy, mirrored from\n // the generated runtime (`[]` when each is off).\n files.push(\n ...(await mcpFiles(project, pages, srcDir, genDir)),\n ...changelog,\n ...playgroundProxyFiles(config, openApiData, srcDir)\n );\n\n // Default 404 page, unless the project already owns `/404` (a custom\n // `pages/404.astro` or a `404.md` content page). The ejected project owns the\n // file afterwards and can edit or remove it.\n if (!routeIsTaken(pages, project.graph.pages, \"/404\")) {\n files.push({\n content: notFoundPageTemplate(),\n path: join(srcDir, \"pages\", \"404.astro\"),\n });\n }\n\n // The client-feature loaders behind the `blume:features` alias, and the\n // provider-specific client loader behind `blume:search-client`.\n files.push(\n {\n content: featuresTemplate(features),\n path: join(genDir, \"features.ts\"),\n },\n {\n content: searchClientTemplate(config),\n path: join(genDir, \"search-client.ts\"),\n }\n );\n\n const searchAdapter = config.search.provider;\n if (searchAdapter.mode === \"static\") {\n const documents = await buildSearchDocuments(project);\n files.push(\n {\n content: `${JSON.stringify(documents)}\\n`,\n path: join(genDir, \"search.json\"),\n },\n {\n content: searchEndpointTemplate(),\n path: join(srcDir, \"pages\", \"blume-search.json.ts\"),\n }\n );\n }\n\n if (searchAdapter.kind === \"mixedbread\") {\n files.push({\n content: mixedbreadSearchEndpointTemplate(searchAdapter.options),\n path: join(srcDir, \"pages\", \"api\", \"search.ts\"),\n });\n }\n\n const feeds = buildRssFeeds(project);\n if (feeds.length > 0) {\n const feedXml = Object.fromEntries(\n feeds.map((feed) => [feed.type, renderRssFeed(feed)])\n );\n files.push(\n {\n content: `${JSON.stringify(feedXml)}\\n`,\n path: join(genDir, \"rss.json\"),\n },\n {\n content: rssEndpointTemplate(),\n path: join(srcDir, \"pages\", \"[section]\", \"rss.xml.ts\"),\n }\n );\n }\n\n // Scalar API/AsyncAPI reference pages, mirrored from the generated runtime so\n // the ejected app keeps its reference routes — including the warnings (a\n // missing spec file, a route collision), which the caller surfaces exactly\n // like the generated-runtime path does.\n // A proxied spec with no origin to allow gets the generated runtime's\n // diagnostic too.\n const warnings: string[] = proxyAllowlistWarnings(config, openApiData);\n if (hasScalarReferences(config)) {\n const references = await buildReferenceFiles({\n config,\n contentRoutes: new Set(project.graph.pages.map((page) => page.route)),\n root,\n });\n warnings.push(...references.warnings);\n for (const file of references.files) {\n files.push({\n content: file.content,\n path: join(srcDir, \"pages\", file.pagePath),\n });\n }\n }\n\n // Per-override and per-example live wrappers referenced by the maps above.\n files.push(\n ...slotPlan.wrappers.map((wrapper) => ({\n content: wrapper.content,\n path: join(genDir, \"component-slots\", `${wrapper.name}.astro`),\n })),\n ...examples.examples.map((example) => ({\n content: exampleWrapperTemplate(example, join(genDir, \"examples\")),\n path: join(genDir, \"examples\", `${exampleSlug(example.path)}.astro`),\n })),\n ...examplesPreviewFiles(\n srcDir,\n config.basePath,\n examples.examples.length > 0\n )\n );\n\n // Materialize staged source bodies under `<root>/blume-staged/<source>/<ref>`,\n // matching the relative `staged` collection base in the ejected config.\n for (const [entryId, content] of staged) {\n files.push({ content, path: join(root, stagedDir, entryId) });\n }\n\n const written = files.filter(\n (file) => !(file.skipIfExists && existsSync(file.path))\n );\n await Promise.all(\n written.map(async (file) => {\n await mkdir(join(file.path, \"..\"), { recursive: true });\n await writeFile(file.path, file.content, \"utf-8\");\n })\n );\n\n // Materialized source assets (e.g. downloaded Notion images) live under the\n // hidden runtime's public dir; copy them into the owned project's `public/`\n // so the staged content's `/blume-assets/…` references still resolve.\n const assetsSrc = join(context.outDir, \"public\", \"blume-assets\");\n if (existsSync(assetsSrc)) {\n await cp(assetsSrc, join(root, \"public\", \"blume-assets\"), {\n recursive: true,\n });\n }\n\n // The hidden runtime is no longer the source of truth.\n await rm(context.outDir, { force: true, recursive: true });\n\n return {\n dependencies: ejectDependencies({\n config,\n needsReact,\n needsSvelte,\n needsVue,\n }),\n files: written.map((file) => file.path),\n warnings,\n };\n};\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAEA;AAmFA,IAAM,UAAU,CAAC,SAAyB,KAAK,MAAM,IAAI,EAAE,KAAK,GAAG;AAGnE,IAAM,qBAAqB;AAapB,IAAM,kBAAkB,CAC7B,MACA,QACA,mBAAiC,gBACtB;AAAA,EACX,IAAI,WAAW,KAAK,MAAM,gBAAgB,OAAO,CAAC,GAAG;AAAA,IACnD,OAAO;AAAA,EACT;AAAA,EACA,IAAI;AAAA,IACF,MAAM,MAAM,KAAK,iBAAiB,GAAG,KAAK;AAAA,IAC1C,OAAO,GAAG,QAAQ,SAAS,QAAQ,GAAG,CAAC;AAAA,IACvC,MAAM;AAAA,IACN,QAAQ,KACN,iQACF;AAAA,IACA,OAAO;AAAA;AAAA;AAKX,IAAM,mBAAmB,CAAC,YAAuC;AAAA,EAC/D,MAAM,SAAS,QAAQ,QAAQ,KAAK,eAAe;AAAA,EACnD,OAAO,SAAS,OAAO,YAAY,IAAI,CAAC;AAAA;AAO1C,IAAM,WAAW,OACf,SACA,QACA,WACiD;AAAA,EACjD,QAAQ,cAAc,QAAQ,OAAO;AAAA,EACrC,IAAI,EAAE,WAAW,WAAW,CAAC,UAAU,WAAW;AAAA,IAChD,MAAM,eAAe,KAAK,QAAQ,SAAS,OAAO,QAAQ;AAAA,IAC1D,IAAI,WAAW,YAAY,GAAG;AAAA,MAC5B,MAAM,UAAU,MAAM,SAAS,cAAc,OAAO;AAAA,MACpD,IAAI,QAAQ,WAAW,qCAAqC,GAAG;AAAA,QAC7D,MAAM,GAAG,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W;AAAA,IACb,CAAC;AAAA,EACH;AAAA,EAGA,MAAM,GAAG,QAAQ,QAAQ,EAAE,OAAO,MAAM,WAAW,KAAK,CAAC;AAAA,EAEzD,OAAO;AAAA,IACL,cAAc,kBAAkB;AAAA,MAC9B;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AAAA,IACD,OAAO,QAAQ,IAAI,CAAC,SAAS,KAAK,IAAI;AAAA,IACtC;AAAA,EACF;AAAA;",
|
|
8
|
+
"debugId": "C71F2E51356BFBB664756E2164756E21",
|
|
9
|
+
"names": []
|
|
10
|
+
}
|
|
@@ -1,50 +1,51 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
commandMeta,
|
|
4
|
-
|
|
4
|
+
BlumeError,
|
|
5
|
+
logger,
|
|
6
|
+
reportDiagnostics
|
|
5
7
|
} from "./index.js";
|
|
6
8
|
import {
|
|
7
9
|
deployPlatform
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import"./chunk-
|
|
10
|
-
import"./chunk-
|
|
10
|
+
} from "./chunk-v6ya5kcb.js";
|
|
11
|
+
import"./chunk-gs7r695n.js";
|
|
12
|
+
import"./chunk-5r8g91qn.js";
|
|
11
13
|
import {
|
|
12
14
|
publishBuildProject,
|
|
13
15
|
ogCacheDir,
|
|
14
16
|
pruneCardCache,
|
|
15
17
|
cardCacheTally
|
|
16
|
-
} from "./chunk-
|
|
17
|
-
import"./chunk-
|
|
18
|
+
} from "./chunk-xh43dwgw.js";
|
|
19
|
+
import"./chunk-ddndchfr.js";
|
|
18
20
|
import {
|
|
19
21
|
deployOutputDir,
|
|
20
22
|
deployStaticDir,
|
|
21
23
|
surfaceAdapterOutput
|
|
22
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-hr8ne106.js";
|
|
23
25
|
import {
|
|
24
26
|
ensureGitignore
|
|
25
27
|
} from "./chunk-yzhm0j9q.js";
|
|
26
|
-
import"./chunk-
|
|
28
|
+
import"./chunk-00gs3wqs.js";
|
|
27
29
|
import {
|
|
28
30
|
removedBuildFlags,
|
|
29
31
|
flagList,
|
|
30
32
|
removedBuildFlagsAdvice
|
|
31
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-qkb5a8sa.js";
|
|
32
34
|
import {
|
|
33
35
|
refuseIfDevRunning
|
|
34
|
-
} from "./chunk-
|
|
35
|
-
import"./chunk-2hn4b8z7.js";
|
|
36
|
+
} from "./chunk-wdrt2k2v.js";
|
|
36
37
|
import {
|
|
37
38
|
refuseIfEjected
|
|
38
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-4e9b9ra6.js";
|
|
39
40
|
import"./chunk-jq5n4avg.js";
|
|
40
|
-
import"./chunk-
|
|
41
|
-
import"./chunk-
|
|
41
|
+
import"./chunk-fsmrqk8a.js";
|
|
42
|
+
import"./chunk-sqw4ekg1.js";
|
|
42
43
|
import {
|
|
43
44
|
prepareProject
|
|
44
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-h2ez8dzb.js";
|
|
45
46
|
import {
|
|
46
47
|
serverFeatures
|
|
47
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-mqc662a6.js";
|
|
48
49
|
|
|
49
50
|
// src/cli/commands/build.ts
|
|
50
51
|
import { existsSync } from "node:fs";
|
|
@@ -52,6 +53,38 @@ import { readdir, stat } from "node:fs/promises";
|
|
|
52
53
|
import { build } from "astro";
|
|
53
54
|
import { defineCommand } from "citty";
|
|
54
55
|
import { join } from "pathe";
|
|
56
|
+
|
|
57
|
+
// src/cli/build-failure.ts
|
|
58
|
+
import { z } from "zod";
|
|
59
|
+
var buildErrorSchema = z.looseObject({
|
|
60
|
+
errors: z.array(z.instanceof(Error)).optional(),
|
|
61
|
+
id: z.string().optional(),
|
|
62
|
+
loc: z.looseObject({
|
|
63
|
+
column: z.number().optional(),
|
|
64
|
+
file: z.string().optional(),
|
|
65
|
+
line: z.number().optional()
|
|
66
|
+
}).optional()
|
|
67
|
+
});
|
|
68
|
+
var failureDiagnostic = (error) => {
|
|
69
|
+
const parsed = buildErrorSchema.safeParse(error);
|
|
70
|
+
const { id, loc } = parsed.success ? parsed.data : {};
|
|
71
|
+
const name = error.name === "Error" ? "" : `${error.name}: `;
|
|
72
|
+
return {
|
|
73
|
+
code: "BLUME_BUILD_FAILED",
|
|
74
|
+
column: loc?.column,
|
|
75
|
+
file: loc?.file ?? id,
|
|
76
|
+
line: loc?.line,
|
|
77
|
+
message: `${name}${error.message}`,
|
|
78
|
+
severity: "error"
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
var astroBuildDiagnostics = (error) => {
|
|
82
|
+
const parsed = buildErrorSchema.safeParse(error);
|
|
83
|
+
const failures = parsed.success ? parsed.data.errors ?? [] : [];
|
|
84
|
+
return (failures.length > 0 ? failures : [error]).map(failureDiagnostic);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
// src/cli/commands/build.ts
|
|
55
88
|
var BUDGET_JS = "budget-js";
|
|
56
89
|
var BUDGET_CSS = "budget-css";
|
|
57
90
|
var validateBudgetFlags = (args) => {
|
|
@@ -221,10 +254,18 @@ var buildCommand = defineCommand({
|
|
|
221
254
|
if (!runtimeDir) {
|
|
222
255
|
publishBuildProject(project);
|
|
223
256
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
257
|
+
try {
|
|
258
|
+
await build({
|
|
259
|
+
logLevel: "info",
|
|
260
|
+
root: project.context.outDir
|
|
261
|
+
});
|
|
262
|
+
} catch (error) {
|
|
263
|
+
if (error instanceof BlumeError || !(error instanceof Error)) {
|
|
264
|
+
throw error;
|
|
265
|
+
}
|
|
266
|
+
reportDiagnostics(astroBuildDiagnostics(error), root);
|
|
267
|
+
process.exit(1);
|
|
268
|
+
}
|
|
228
269
|
await reportCardCache(project, !runtimeDir);
|
|
229
270
|
const { deployment } = project.config;
|
|
230
271
|
const platform = deployPlatform(deployment);
|
|
@@ -257,5 +298,5 @@ export {
|
|
|
257
298
|
runClientAssetChecks
|
|
258
299
|
};
|
|
259
300
|
|
|
260
|
-
//# debugId=
|
|
261
|
-
//# sourceMappingURL=chunk-
|
|
301
|
+
//# debugId=D6CABD020883D7E964756E2164756E21
|
|
302
|
+
//# sourceMappingURL=chunk-k7pj68a8.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/cli/commands/build.ts", "../src/cli/build-failure.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { existsSync } from \"node:fs\";\nimport { readdir, stat } from \"node:fs/promises\";\n\nimport { build } from \"astro\";\nimport { defineCommand } from \"citty\";\nimport { join } from \"pathe\";\n\nimport { publishBuildProject } from \"../../astro/integration.ts\";\nimport { BlumeError } from \"../../core/diagnostics.ts\";\nimport { ensureGitignore } from \"../../core/gitignore.ts\";\nimport type { BlumeProject } from \"../../core/project-graph.ts\";\nimport { serverFeatures } from \"../../core/server-features.ts\";\nimport {\n deployOutputDir,\n deployStaticDir,\n surfaceAdapterOutput,\n} from \"../../deploy/adapter-output.ts\";\nimport { deployPlatform } from \"../../deploy/platforms/index.ts\";\nimport { cardCacheTally, ogCacheDir, pruneCardCache } from \"../../og/cache.ts\";\nimport {\n flagList,\n removedBuildFlags,\n removedBuildFlagsAdvice,\n} from \"../../upgrade/upgrade.ts\";\nimport { astroBuildDiagnostics } from \"../build-failure.ts\";\nimport { commandMeta } from \"../command-meta.ts\";\nimport { refuseIfDevRunning } from \"../dev-lock.ts\";\nimport { refuseIfEjected } from \"../eject-scripts.ts\";\nimport { logger, reportDiagnostics } from \"../log.ts\";\nimport { prepareProject } from \"../prepare.ts\";\n\nconst BUDGET_JS = \"budget-js\";\nconst BUDGET_CSS = \"budget-css\";\n\ninterface BudgetArgs {\n \"budget-css\"?: string;\n \"budget-js\"?: string;\n}\n\n/**\n * Reject a non-numeric performance budget. `Number(\"250kb\")` is `NaN` and\n * `total > NaN` is always false, so a typo'd flag would silently pass the gate;\n * fail up front instead.\n */\nconst validateBudgetFlags = (args: BudgetArgs): void => {\n for (const flag of [BUDGET_JS, BUDGET_CSS] as const) {\n const value = args[flag];\n const parsed = Number(value);\n // Equivalent to `!(parsed > 0)` but without the inverted check: this must\n // also reject `NaN` (a typo'd flag like \"250kb\"), which `parsed <= 0` alone\n // would let through since `NaN <= 0` is false.\n if (value !== undefined && (Number.isNaN(parsed) || parsed <= 0)) {\n logger.error(\n `Invalid --${flag} \"${value}\" (expected a positive number of kB).`\n );\n process.exit(1);\n }\n }\n};\n\n/**\n * Report how many OG cards the build read back from the on-disk cache against\n * how many it rendered (the endpoint tallies both), so a warm rebuild shows\n * where the time went. With `prune`, also drop the cached cards this build\n * never asked for — renamed pages, edited descriptions, cards from an earlier\n * Blume version — so a persisted cache holds exactly the current site's cards.\n */\nconst reportCardCache = async (\n project: BlumeProject,\n prune: boolean\n): Promise<void> => {\n const cards = cardCacheTally();\n if (!cards) {\n return;\n }\n logger.info(\n `OG cards: ${cards.hits} reused from the cache, ${cards.misses} rendered`\n );\n if (prune) {\n await pruneCardCache(ogCacheDir(project.context));\n }\n};\n\nconst formatBytes = (bytes: number): string => {\n if (bytes < 1024) {\n return `${bytes} B`;\n }\n const digits = bytes < 1024 * 100 ? 1 : 0;\n return `${(bytes / 1024).toFixed(digits)} kB`;\n};\n\n/** Sizes of `dist/_astro/*.<ext>`, largest first (empty when none exist). */\nconst astroAssets = async (\n distDir: string,\n ext: string\n): Promise<{ name: string; size: number }[]> => {\n const astroDir = join(distDir, \"_astro\");\n if (!existsSync(astroDir)) {\n return [];\n }\n const entries = await readdir(astroDir);\n const files = entries.filter((name) => name.endsWith(`.${ext}`));\n const sized = await Promise.all(\n files.map(async (name) => {\n const info = await stat(join(astroDir, name));\n return { name, size: info.size };\n })\n );\n return sized.toSorted((a, b) => b.size - a.size);\n};\n\nconst totalSize = (assets: { size: number }[]): number =>\n assets.reduce((sum, asset) => sum + asset.size, 0);\n\n/**\n * Print the client JavaScript Astro shipped, largest first, plus the total. A\n * dependency-free bundle report — the interactive weight of a docs site is its\n * `_astro/*.js`, so this surfaces regressions without a visualizer.\n */\nconst reportBundleSizes = async (distDir: string): Promise<void> => {\n const sized = await astroAssets(distDir, \"js\");\n if (sized.length === 0) {\n logger.info(\"No client JavaScript emitted — the site ships zero JS.\");\n return;\n }\n const rows = sized\n .slice(0, 15)\n .map((file) => ` ${formatBytes(file.size).padStart(8)} ${file.name}`);\n logger.box(\n [\n `Client JavaScript — ${sized.length} file(s), ${formatBytes(totalSize(sized))} total`,\n \"\",\n ...rows,\n sized.length > 15 ? ` … and ${sized.length - 15} more` : null,\n ]\n .filter((line) => line !== null)\n .join(\"\\n\")\n );\n};\n\n/**\n * Enforce a performance budget on the built client assets: fail the build when\n * total `_astro/*.js` (or `*.css`) exceeds the given kB cap. Budgets that would\n * otherwise be \"documented, not measured\" become a real CI gate. Returns whether\n * every budget passed.\n */\nconst enforceBudget = async (\n distDir: string,\n args: BudgetArgs\n): Promise<\"fail\" | \"pass\" | \"skip\"> => {\n const checks: { ext: string; limitKb: number; name: string }[] = [\n ...(args[BUDGET_JS]\n ? [{ ext: \"js\", limitKb: Number(args[BUDGET_JS]), name: \"JavaScript\" }]\n : []),\n ...(args[BUDGET_CSS]\n ? [{ ext: \"css\", limitKb: Number(args[BUDGET_CSS]), name: \"CSS\" }]\n : []),\n ];\n if (checks.length === 0) {\n return \"skip\";\n }\n let passed = true;\n for (const check of checks) {\n // oxlint-disable-next-line no-await-in-loop -- a couple of sequential reads\n const total = totalSize(await astroAssets(distDir, check.ext));\n const limit = check.limitKb * 1024;\n if (total > limit) {\n passed = false;\n logger.error(\n `${check.name} budget exceeded: ${formatBytes(total)} > ${check.limitKb} kB`\n );\n } else {\n logger.success(\n `${check.name} budget: ${formatBytes(total)} / ${check.limitKb} kB`\n );\n }\n }\n return passed ? \"pass\" : \"fail\";\n};\n\n/**\n * Run the optional bundle report (`--analyze`) and performance-budget gate\n * against the directory whose `_astro/` client assets the deploy serves.\n * Shared by real and isolated builds — an isolated CI run passing\n * `--budget-js` must still fail on an exceeded budget rather than silently\n * skipping the check. Exits non-zero when a budget is exceeded.\n */\nexport const runClientAssetChecks = async (\n staticDir: string,\n args: { analyze?: boolean } & BudgetArgs\n): Promise<void> => {\n if (args.analyze) {\n await reportBundleSizes(staticDir);\n }\n if ((await enforceBudget(staticDir, args)) === \"fail\") {\n process.exit(1);\n }\n};\n\n/**\n * Print the build summary box and run the optional bundle report / budget\n * gate against the served static dir. The deploy artifacts themselves\n * (search index, llms.txt, sitemap, robots, redirect and header files, …)\n * were written by the integration's `astro:build:done` hook during\n * `build()` — see `deploy/artifacts.ts`. Exits non-zero if a budget is\n * exceeded.\n */\nconst reportBuild = async (\n project: BlumeProject,\n distDir: string,\n args: { analyze?: boolean } & BudgetArgs\n): Promise<void> => {\n const { config } = project;\n const features = serverFeatures(config);\n // The sitemap needs both the flag and a `site` (absolute URLs) — only the\n // latter deserves the remediation hint.\n const sitemapNote = config.seo.sitemap\n ? \"no (set deployment.site)\"\n : \"no (seo.sitemap is false)\";\n const rows: [label: string, value: string | number][] = [\n [\"Output\", config.deployment.options.output],\n [\"Adapter\", config.deployment.kind],\n [\"Site\", config.deployment.options.site ?? \"not set\"],\n [\"Search\", config.search.provider.kind],\n [\"Redirects\", config.redirects.length],\n [\n \"Sitemap\",\n config.deployment.options.site && config.seo.sitemap\n ? \"yes\"\n : sitemapNote,\n ],\n [\"Robots\", config.seo.robots ? \"yes\" : \"no\"],\n [\"Agent JSON\", config.agents.agentReadability ? \"yes\" : \"no\"],\n [\"LLM files\", config.agents.llmsTxt.enabled ? \"yes\" : \"no\"],\n [\"Server features\", features.length > 0 ? features.join(\", \") : \"none\"],\n ];\n // One label column for every row, sized by the longest label.\n const labelWidth = Math.max(...rows.map(([label]) => label.length)) + 2;\n logger.box(\n rows\n .map(([label, value]) => `${label.padEnd(labelWidth)}${value}`)\n .join(\"\\n\")\n );\n\n await runClientAssetChecks(distDir, args);\n\n // Only reachable with --no-strict (strict aborts earlier): repeat the missing\n // count next to the success banner so it can't scroll away unseen.\n if (project.droppedPages > 0) {\n logger.warn(\n `${project.droppedPages} page(s) failed frontmatter validation and are missing from this build.`\n );\n }\n logger.success(`Built to ${distDir}`);\n};\n\nexport const buildCommand = defineCommand({\n args: {\n analyze: {\n description: \"Report client JavaScript bundle sizes after the build.\",\n type: \"boolean\",\n },\n [BUDGET_CSS]: {\n description: \"Fail if total client CSS exceeds this many kB.\",\n type: \"string\",\n },\n [BUDGET_JS]: {\n description: \"Fail if total client JavaScript exceeds this many kB.\",\n type: \"string\",\n },\n isolated: {\n description:\n \"Build into an isolated .blume-verify runtime (and its own dist) so a running dev server and the real dist/ are untouched. For verifying changes while `blume dev` runs.\",\n type: \"boolean\",\n },\n preview: {\n description: \"Include drafts and unpublished CMS content.\",\n type: \"boolean\",\n },\n strict: {\n default: true,\n description:\n \"Fail on error diagnostics (default; pass --no-strict to build anyway, dropping pages that fail validation).\",\n type: \"boolean\",\n },\n },\n meta: commandMeta.build,\n async run({ args, rawArgs }) {\n const root = process.cwd();\n\n // citty accepts unknown flags, so a Blume 1 `--adapter vercel --output\n // server` would otherwise build a static site without a word.\n const removed = removedBuildFlags(rawArgs);\n if (removed.length > 0) {\n logger.error(\n `blume build no longer takes ${flagList(removed)}. ${removedBuildFlagsAdvice(removed)}`\n );\n process.exit(1);\n }\n await refuseIfEjected(root, \"build\");\n\n // `--isolated` (or BLUME_RUNTIME_DIR) relocates the whole runtime to a\n // sibling dir so this build never touches a live dev server's `.blume/` or\n // the user's real `dist/`. A non-default runtime dir has no dev lock, so the\n // refusal below lets it proceed; a plain build still refuses.\n const runtimeDir = args.isolated\n ? \".blume-verify\"\n : process.env.BLUME_RUNTIME_DIR;\n refuseIfDevRunning(root, \"building\", { isolatedHint: true, runtimeDir });\n if (args.isolated) {\n await ensureGitignore(root, [\".blume-verify/\"]);\n }\n\n validateBudgetFlags(args);\n\n const project = await prepareProject({\n mode: \"build\",\n preview: args.preview,\n root,\n runtimeDir,\n strict: args.strict,\n });\n\n logger.start(\n `Building ${project.graph.pages.length} page(s) (${project.config.deployment.options.output} output)`\n );\n\n // Hand the scanned project to the integration: its `astro:build:done`\n // hook writes the deploy artifacts (search index, llms.txt, sitemap, …)\n // into Astro's client output during the build. An isolated build is a\n // throwaway verify that only needs to confirm the site compiles and\n // renders, so it publishes nothing — no network post-steps (a hosted\n // search sync would push), no deploy artifacts.\n if (!runtimeDir) {\n publishBuildProject(project);\n }\n\n try {\n await build({\n logLevel: \"info\",\n root: project.context.outDir,\n });\n } catch (error) {\n // Astro rejects when the site fails to compile or render (MDX that\n // doesn't parse, a component that throws): report that as a build error\n // at the file it names, not as an internal error blaming Blume. A\n // BlumeError keeps its own diagnostic.\n if (error instanceof BlumeError || !(error instanceof Error)) {\n throw error;\n }\n reportDiagnostics(astroBuildDiagnostics(error), root);\n process.exit(1);\n }\n\n // A real build also prunes the cache; an isolated verify must not evict\n // cards a live dev server is still serving.\n await reportCardCache(project, !runtimeDir);\n\n // Everything the deploy target does differently after `astro build` comes\n // off its platform (see `deploy/platforms/*`): a server build's post-build\n // step (Vercel's function-bundle audit and negotiation routes, Cloudflare's\n // wrapper Worker), and where its bundle and static assets landed.\n const { deployment } = project.config;\n const platform = deployPlatform(deployment);\n const server = deployment.options.output === \"server\";\n const finalize = async (isolated: boolean): Promise<void> => {\n if (\n server &&\n platform.finalizeBuild &&\n !(await platform.finalizeBuild({ isolated, log: logger, project }))\n ) {\n process.exit(1);\n }\n };\n\n // The bundle report and budget gate still run for an isolated build —\n // `blume build --isolated --budget-js 100` exiting 0 without measuring\n // anything would be a silent false pass in CI. An isolated build never\n // surfaces the adapter bundle to the project root, so its output dirs\n // resolve under the relocated runtime.\n if (runtimeDir) {\n await finalize(true);\n await runClientAssetChecks(\n deployStaticDir(project.config, project.context),\n args\n );\n logger.success(\n `Isolated build OK — output at ${deployOutputDir(project.config, project.context)} (not published).`\n );\n return;\n }\n\n // A server adapter's deploy bundle is a build artifact — keep it out of\n // version control (Vercel's own CLI ignores `.vercel/` for the same reason).\n // Ignoring it is independent of whether the bundle had to be moved below:\n // Vercel writes straight to the project root, Netlify does not.\n const { ignoreDir } = platform.hiddenRuntime;\n if (server && ignoreDir) {\n await ensureGitignore(root, [ignoreDir]);\n }\n\n // Netlify writes its deploy bundle relative to the Astro root — which Blume\n // points at the hidden `.blume` runtime — so the bundle lands where the\n // deploy platform never looks. Surface it up to the project root before\n // publishing artifacts into the served static dir.\n const surfaced = await surfaceAdapterOutput(\n project.config,\n project.context\n );\n if (surfaced.moved) {\n logger.success(`Surfaced ${deployment.kind} output to ${surfaced.to}`);\n }\n\n await finalize(false);\n\n await reportBuild(\n project,\n deployStaticDir(project.config, project.context),\n args\n );\n },\n});\n",
|
|
6
|
+
"import { z } from \"zod\";\n\nimport type { Diagnostic } from \"../core/types.ts\";\n\n/**\n * The fields of an `astro build` rejection the report reads. Rolldown bundles\n * every plugin failure (an MDX compile error, say) into one error whose\n * `errors` holds each; a failure carries `loc` where the compiler pinned it,\n * or only `id`, the module that failed.\n */\nconst buildErrorSchema = z.looseObject({\n errors: z.array(z.instanceof(Error)).optional(),\n id: z.string().optional(),\n loc: z\n .looseObject({\n column: z.number().optional(),\n file: z.string().optional(),\n line: z.number().optional(),\n })\n .optional(),\n});\n\n/** One failure as a diagnostic at the file (and position) it names. */\nconst failureDiagnostic = (error: Error): Diagnostic => {\n const parsed = buildErrorSchema.safeParse(error);\n const { id, loc } = parsed.success ? parsed.data : {};\n // A named error (`MDXError`, `CompilerError`) says which step failed.\n const name = error.name === \"Error\" ? \"\" : `${error.name}: `;\n return {\n code: \"BLUME_BUILD_FAILED\",\n column: loc?.column,\n file: loc?.file ?? id,\n line: loc?.line,\n message: `${name}${error.message}`,\n severity: \"error\",\n };\n};\n\n/**\n * What `astro build` rejected with, as build diagnostics: one per failure\n * Rolldown collected, else the error itself. A page Blume's own checks pass\n * can still fail Astro's compile (MDX that doesn't parse) or render, and that\n * is a problem in the site, reported at its file, rather than an internal\n * error blaming Blume.\n */\nexport const astroBuildDiagnostics = (error: Error): Diagnostic[] => {\n const parsed = buildErrorSchema.safeParse(error);\n const failures = parsed.success ? (parsed.data.errors ?? []) : [];\n return (failures.length > 0 ? failures : [error]).map(failureDiagnostic);\n};\n"
|
|
7
|
+
],
|
|
8
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAEA;AACA;AACA;;;ACLA;AAUA,IAAM,mBAAmB,EAAE,YAAY;AAAA,EACrC,QAAQ,EAAE,MAAM,EAAE,WAAW,KAAK,CAAC,EAAE,SAAS;AAAA,EAC9C,IAAI,EAAE,OAAO,EAAE,SAAS;AAAA,EACxB,KAAK,EACF,YAAY;AAAA,IACX,QAAQ,EAAE,OAAO,EAAE,SAAS;AAAA,IAC5B,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,IAC1B,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,CAAC,EACA,SAAS;AACd,CAAC;AAGD,IAAM,oBAAoB,CAAC,UAA6B;AAAA,EACtD,MAAM,SAAS,iBAAiB,UAAU,KAAK;AAAA,EAC/C,QAAQ,IAAI,QAAQ,OAAO,UAAU,OAAO,OAAO,CAAC;AAAA,EAEpD,MAAM,OAAO,MAAM,SAAS,UAAU,KAAK,GAAG,MAAM;AAAA,EACpD,OAAO;AAAA,IACL,MAAM;AAAA,IACN,QAAQ,KAAK;AAAA,IACb,MAAM,KAAK,QAAQ;AAAA,IACnB,MAAM,KAAK;AAAA,IACX,SAAS,GAAG,OAAO,MAAM;AAAA,IACzB,UAAU;AAAA,EACZ;AAAA;AAUK,IAAM,wBAAwB,CAAC,UAA+B;AAAA,EACnE,MAAM,SAAS,iBAAiB,UAAU,KAAK;AAAA,EAC/C,MAAM,WAAW,OAAO,UAAW,OAAO,KAAK,UAAU,CAAC,IAAK,CAAC;AAAA,EAChE,QAAQ,SAAS,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A,QAAQ,KAAK,CAAC;AAAA,MAChB;AAAA;AAAA,IAQF,IAAI,YAAY;AAAA,MACd,MAAM,SAAS,IAAI;AAAA,MACnB,MAAM,qBACJ,gBAAgB,QAAQ,QAAQ,QAAQ,OAAO,GAC/C,IACF;AAAA,MACA,OAAO,QACL,iCAAiC,gBAAgB,QAAQ,QAAQ,QAAQ,OAAO,oBAClF;AAAA,MACA;AAAA,IACF;AAAA,IAMA,QAAQ,cAAc,SAAS;AAAA,IAC/B,IAAI,UAAU,WAAW;AAAA,MACvB,MAAM,gBAAgB,MAAM,CAAC,SAAS,CAAC;AAAA,IACzC;AAAA,IAMA,MAAM,WAAW,MAAM,qBACrB,QAAQ,QACR,QAAQ,OACV;AAAA,IACA,IAAI,SAAS,OAAO;AAAA,MAClB,OAAO,QAAQ,YAAY,WAAW,kBAAkB,SAAS,IAAI;AAAA,IACvE;AAAA,IAEA,MAAM,SAAS,KAAK;AAAA,IAEpB,MAAM,YACJ,SACA,gBAAgB,QAAQ,QAAQ,QAAQ,OAAO,GAC/C,IACF;AAAA;AAEJ,CAAC;",
|
|
9
|
+
"debugId": "D6CABD020883D7E964756E2164756E21",
|
|
10
|
+
"names": []
|
|
11
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
needsPlaygroundProxy,
|
|
4
4
|
resolveAskBackend
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-v6ya5kcb.js";
|
|
6
6
|
|
|
7
7
|
// src/core/server-features.ts
|
|
8
8
|
var serverFeatures = (config) => {
|
|
@@ -72,4 +72,4 @@ var checkRequiredSecrets = (config) => {
|
|
|
72
72
|
export { serverFeatures, checkRequiredSecrets };
|
|
73
73
|
|
|
74
74
|
//# debugId=26CFBC953FC234CC64756E2164756E21
|
|
75
|
-
//# sourceMappingURL=chunk-
|
|
75
|
+
//# sourceMappingURL=chunk-mqc662a6.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
customStaticRoutes,
|
|
5
5
|
hasGeneratedChangelog,
|
|
6
6
|
validateLinks
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-v6ya5kcb.js";
|
|
8
8
|
import {
|
|
9
9
|
commandMeta,
|
|
10
10
|
reportInternalError,
|
|
@@ -14,11 +14,11 @@ import {
|
|
|
14
14
|
reportDiagnosticsJson,
|
|
15
15
|
reportDiagnostics
|
|
16
16
|
} from "./index.js";
|
|
17
|
-
import"./chunk-
|
|
17
|
+
import"./chunk-gs7r695n.js";
|
|
18
18
|
import {
|
|
19
19
|
buildManifest,
|
|
20
20
|
scanProject
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-5r8g91qn.js";
|
|
22
22
|
|
|
23
23
|
// src/cli/commands/validate.ts
|
|
24
24
|
import { existsSync } from "node:fs";
|
|
@@ -99,4 +99,4 @@ export {
|
|
|
99
99
|
};
|
|
100
100
|
|
|
101
101
|
//# debugId=1EEBE4960D9C18F364756E2164756E21
|
|
102
|
-
//# sourceMappingURL=chunk-
|
|
102
|
+
//# sourceMappingURL=chunk-n1yg3tj3.js.map
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
+
deployPlatform,
|
|
3
4
|
resolveProjectContext,
|
|
4
5
|
loadConfig
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import"./chunk-
|
|
6
|
+
} from "./chunk-v6ya5kcb.js";
|
|
7
|
+
import"./chunk-gs7r695n.js";
|
|
7
8
|
import {
|
|
8
9
|
commandMeta,
|
|
9
10
|
normalizeHost,
|
|
@@ -11,10 +12,13 @@ import {
|
|
|
11
12
|
} from "./index.js";
|
|
12
13
|
import {
|
|
13
14
|
deployOutputDir
|
|
14
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-hr8ne106.js";
|
|
16
|
+
import {
|
|
17
|
+
refuseIfEjected
|
|
18
|
+
} from "./chunk-4e9b9ra6.js";
|
|
15
19
|
import {
|
|
16
20
|
parsePort
|
|
17
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-esh98wmb.js";
|
|
18
22
|
|
|
19
23
|
// src/cli/commands/preview.ts
|
|
20
24
|
import { existsSync } from "node:fs";
|
|
@@ -29,8 +33,15 @@ var previewCommand = defineCommand({
|
|
|
29
33
|
meta: commandMeta.preview,
|
|
30
34
|
async run({ args }) {
|
|
31
35
|
const root = process.cwd();
|
|
36
|
+
await refuseIfEjected(root, "preview");
|
|
32
37
|
const { config } = await loadConfig(root);
|
|
33
38
|
const context = resolveProjectContext(root, config);
|
|
39
|
+
const { deployment } = config;
|
|
40
|
+
const platform = deployPlatform(deployment);
|
|
41
|
+
if (deployment.options.output === "server" && platform.previewDeploy) {
|
|
42
|
+
logger.error(`\`blume preview\` can't serve a ${deployment.kind}() server build: ${platform.astro?.package} has no local preview server. Run \`blume dev\` to try the site locally, or deploy a preview with \`${platform.previewDeploy}\`.`);
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
34
45
|
if (!existsSync(join(context.outDir, "astro.config.mjs")) || !existsSync(deployOutputDir(config, context))) {
|
|
35
46
|
logger.error("No build found. Run `blume build` first.");
|
|
36
47
|
process.exit(1);
|
|
@@ -49,5 +60,5 @@ export {
|
|
|
49
60
|
previewCommand
|
|
50
61
|
};
|
|
51
62
|
|
|
52
|
-
//# debugId=
|
|
53
|
-
//# sourceMappingURL=chunk-
|
|
63
|
+
//# debugId=C7A2F5CE34388C8C64756E2164756E21
|
|
64
|
+
//# sourceMappingURL=chunk-nfcyttvj.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/cli/commands/preview.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import { existsSync } from \"node:fs\";\n\nimport { preview } from \"astro\";\nimport { defineCommand } from \"citty\";\nimport { join } from \"pathe\";\n\nimport { loadConfig } from \"../../core/config.ts\";\nimport { resolveProjectContext } from \"../../core/project.ts\";\nimport { deployOutputDir } from \"../../deploy/adapter-output.ts\";\nimport { deployPlatform } from \"../../deploy/platforms/index.ts\";\nimport { parsePort } from \"../args.ts\";\nimport { commandMeta } from \"../command-meta.ts\";\nimport { refuseIfEjected } from \"../eject-scripts.ts\";\nimport { normalizeHost } from \"../host-args.ts\";\nimport { logger } from \"../log.ts\";\n\nexport const previewCommand = defineCommand({\n args: {\n host: { description: \"Network host to bind.\", type: \"string\" },\n port: { description: \"Port to listen on.\", type: \"string\" },\n },\n meta: commandMeta.preview,\n async run({ args }) {\n const root = process.cwd();\n await refuseIfEjected(root, \"preview\");\n const { config } = await loadConfig(root);\n const context = resolveProjectContext(root, config);\n\n // Astro previews a server build through its adapter's preview entrypoint,\n // and the Vercel and Netlify adapters declare none, so Astro would throw\n // mid-command. Say so up front, with what to run instead.\n const { deployment } = config;\n const platform = deployPlatform(deployment);\n if (deployment.options.output === \"server\" && platform.previewDeploy) {\n logger.error(\n `\\`blume preview\\` can't serve a ${deployment.kind}() server build: ${platform.astro?.package} has no local preview server. Run \\`blume dev\\` to try the site locally, or deploy a preview with \\`${platform.previewDeploy}\\`.`\n );\n process.exit(1);\n }\n\n // `blume dev` writes `.blume/astro.config.mjs` too, so the runtime alone\n // doesn't mean there's anything to serve: the build output must exist.\n if (\n !existsSync(join(context.outDir, \"astro.config.mjs\")) ||\n !existsSync(deployOutputDir(config, context))\n ) {\n logger.error(\"No build found. Run `blume build` first.\");\n process.exit(1);\n }\n\n await preview({\n logLevel: \"info\",\n root: context.outDir,\n server: {\n // `normalizeHost` maps a bare `--host` (citty parses it as \"\") to\n // `true` so Vite binds all interfaces instead of the hostname \"\".\n host: normalizeHost(args.host),\n port: parsePort(args.port),\n },\n });\n },\n});\n"
|
|
6
|
+
],
|
|
7
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AACA;AAYO,IAAM,iBAAiB,cAAc;AAAA,EAC1C,MAAM;AAAA,IACJ,MA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