blume 2.1.3 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +1 -1
- package/CHANGELOG.md +134 -0
- package/README.md +4 -4
- package/dist/cli/{chunk-y4msrwm9.js → chunk-080mfch6.js} +15 -15
- package/dist/cli/{chunk-gfc5fqvf.js → chunk-1ch3ct3r.js} +18 -18
- package/dist/cli/{chunk-gfc5fqvf.js.map → chunk-1ch3ct3r.js.map} +1 -1
- package/dist/cli/{chunk-32khwcb6.js → chunk-2ssh60qh.js} +42 -69
- package/dist/cli/{chunk-32khwcb6.js.map → chunk-2ssh60qh.js.map} +9 -10
- package/dist/cli/{chunk-9qzgg6mj.js → chunk-34wap3ed.js} +3 -3
- package/dist/cli/{chunk-k3gr1nm9.js → chunk-40vk8kgf.js} +13 -16
- package/dist/cli/{chunk-k3gr1nm9.js.map → chunk-40vk8kgf.js.map} +3 -3
- package/dist/cli/chunk-487b95qy.js +329 -0
- package/dist/cli/chunk-487b95qy.js.map +13 -0
- package/dist/cli/chunk-4zxh25hc.js +157 -0
- package/dist/cli/chunk-4zxh25hc.js.map +10 -0
- package/dist/cli/chunk-69rjf786.js +146 -0
- package/dist/cli/chunk-69rjf786.js.map +11 -0
- package/dist/cli/{chunk-dqhg54mr.js → chunk-9h8mh2tk.js} +3 -3
- package/dist/cli/{chunk-dqhg54mr.js.map → chunk-9h8mh2tk.js.map} +2 -2
- package/dist/cli/{chunk-bqxaqn5p.js → chunk-9jqmq5hv.js} +8 -8
- package/dist/cli/{chunk-bqxaqn5p.js.map → chunk-9jqmq5hv.js.map} +1 -1
- package/dist/cli/{chunk-dv2z0rzf.js → chunk-aafhwx74.js} +38 -13
- package/dist/cli/{chunk-dv2z0rzf.js.map → chunk-aafhwx74.js.map} +5 -4
- package/dist/cli/{chunk-desvm72z.js → chunk-b680sv30.js} +22 -26
- package/dist/cli/chunk-b680sv30.js.map +13 -0
- package/dist/cli/{chunk-0w6hs479.js → chunk-beb0z983.js} +30 -18
- package/dist/cli/chunk-beb0z983.js.map +10 -0
- package/dist/cli/{chunk-1f882900.js → chunk-c5bjxq8v.js} +2 -2
- package/dist/cli/chunk-e1n41w9m.js +155 -0
- package/dist/cli/chunk-e1n41w9m.js.map +11 -0
- package/dist/cli/{chunk-sc93apfs.js → chunk-etckvbrh.js} +17 -17
- package/dist/cli/{chunk-sc93apfs.js.map → chunk-etckvbrh.js.map} +2 -2
- package/dist/cli/{chunk-bxwhtvw8.js → chunk-f260jdrn.js} +5 -5
- package/dist/cli/{chunk-74wfhv79.js → chunk-fnxgtjeq.js} +1 -1
- package/dist/cli/{chunk-ms9z66nz.js → chunk-gwy55cx3.js} +2 -2
- package/dist/cli/{chunk-ms9z66nz.js.map → chunk-gwy55cx3.js.map} +2 -2
- package/dist/cli/{chunk-dhwtqnnd.js → chunk-gxhcf2hs.js} +2 -2
- package/dist/cli/{chunk-tfycddbt.js → chunk-h0qwdbem.js} +2 -2
- package/dist/cli/{chunk-nbyvgnnm.js → chunk-hktq4j5r.js} +109 -49
- package/dist/cli/chunk-hktq4j5r.js.map +36 -0
- package/dist/cli/{chunk-twy7psdz.js → chunk-hn3g2b89.js} +14 -10
- package/dist/cli/chunk-hn3g2b89.js.map +10 -0
- package/dist/cli/{chunk-j1x92mx9.js → chunk-j4nfgn2j.js} +1 -1
- package/dist/cli/{chunk-dpy8qdjf.js → chunk-k45sq16q.js} +74 -183
- package/dist/cli/chunk-k45sq16q.js.map +18 -0
- package/dist/cli/{chunk-5cmts6dv.js → chunk-kmswjxj9.js} +7 -7
- package/dist/cli/{chunk-5cmts6dv.js.map → chunk-kmswjxj9.js.map} +1 -1
- package/dist/cli/{chunk-36bxs9c7.js → chunk-nqna8dzp.js} +27 -23
- package/dist/cli/chunk-nqna8dzp.js.map +10 -0
- package/dist/cli/{chunk-a57yh0h9.js → chunk-p834rkcn.js} +7 -7
- package/dist/cli/{chunk-a57yh0h9.js.map → chunk-p834rkcn.js.map} +1 -1
- package/dist/cli/{chunk-60hz265r.js → chunk-ppa6mg4d.js} +24 -11
- package/dist/cli/chunk-ppa6mg4d.js.map +10 -0
- package/dist/cli/{chunk-s0bdnc7v.js → chunk-q1wwrxzw.js} +5 -4
- package/dist/cli/chunk-q1wwrxzw.js.map +10 -0
- package/dist/cli/{chunk-ave1wcbr.js → chunk-qcyxkj44.js} +1 -1
- package/dist/cli/{chunk-124fvmzq.js → chunk-r5nm9w0c.js} +11183 -8806
- package/dist/cli/{chunk-124fvmzq.js.map → chunk-r5nm9w0c.js.map} +82 -66
- package/dist/cli/{chunk-ckrcm08h.js → chunk-rtvgmg2j.js} +48 -62
- package/dist/cli/{chunk-ckrcm08h.js.map → chunk-rtvgmg2j.js.map} +4 -5
- package/dist/cli/{chunk-297ajdcv.js → chunk-t2h8pwy1.js} +6 -6
- package/dist/cli/{chunk-297ajdcv.js.map → chunk-t2h8pwy1.js.map} +3 -3
- package/dist/cli/{chunk-gxtg6ed2.js → chunk-x60e15st.js} +21 -21
- package/dist/cli/{chunk-gxtg6ed2.js.map → chunk-x60e15st.js.map} +3 -3
- package/dist/cli/{chunk-58bt3hag.js → chunk-x7bh6d9j.js} +4 -4
- package/dist/cli/{chunk-hvcxng5f.js → chunk-ydqzkhjn.js} +6 -6
- package/dist/cli/{chunk-kdpzw38a.js → chunk-yg8ckc3g.js} +95 -7
- package/dist/cli/chunk-yg8ckc3g.js.map +11 -0
- package/dist/cli/{chunk-0pmb4tr4.js → chunk-zxd5jrgx.js} +1205 -222
- package/dist/cli/chunk-zxd5jrgx.js.map +44 -0
- package/dist/cli/index.js +78 -42
- package/dist/cli/index.js.map +7 -6
- package/dist/types/ai/changelog-components.d.ts +18 -0
- package/dist/types/ai/changelog-markdown.d.ts +12 -0
- package/dist/types/ai/openapi-components.d.ts +7 -7
- package/dist/types/ai/operation-details.d.ts +39 -0
- package/dist/types/ai/relative-links.d.ts +3 -1
- package/dist/types/ai/serializers.d.ts +6 -4
- package/dist/types/analytics/head.d.ts +4 -2
- package/dist/types/analytics/script.d.ts +8 -2
- package/dist/types/components/content/youtube.d.ts +20 -0
- package/dist/types/components/layout/nav-utils.d.ts +8 -0
- package/dist/types/components/openapi/example-panels.d.ts +33 -0
- package/dist/types/components/openapi/helpers.d.ts +53 -11
- package/dist/types/components/openapi/snippets.d.ts +7 -1
- package/dist/types/core/alert-diagnostics.d.ts +10 -0
- package/dist/types/core/builtin-tags.d.ts +16 -0
- package/dist/types/core/changelog-list.d.ts +48 -0
- package/dist/types/core/closest-match.d.ts +6 -0
- package/dist/types/core/code-fence-diagnostics.d.ts +18 -0
- package/dist/types/core/code-fences.d.ts +8 -1
- package/dist/types/core/config-input.d.ts +38 -6
- package/dist/types/core/content-assets.d.ts +16 -18
- package/dist/types/core/data.d.ts +6 -2
- package/dist/types/core/diagnostics.d.ts +14 -0
- package/dist/types/core/directive-diagnostics.d.ts +22 -8
- package/dist/types/core/former-routes.d.ts +14 -0
- package/dist/types/core/github.d.ts +5 -4
- package/dist/types/core/heading-markers.d.ts +65 -2
- package/dist/types/core/hidden-pages.d.ts +3 -0
- package/dist/types/core/includes.d.ts +23 -0
- package/dist/types/core/last-modified.d.ts +18 -6
- package/dist/types/core/links.d.ts +42 -2
- package/dist/types/core/load-module.d.ts +19 -4
- package/dist/types/core/manifest.d.ts +14 -1
- package/dist/types/core/markdown-mirrors.d.ts +22 -0
- package/dist/types/core/mcp-clients.d.ts +47 -0
- package/dist/types/core/mdx-elements.d.ts +32 -0
- package/dist/types/core/mdx-syntax.d.ts +100 -0
- package/dist/types/core/meta-diagnostics.d.ts +7 -0
- package/dist/types/core/meta.d.ts +32 -5
- package/dist/types/core/nav-diagnostics.d.ts +16 -2
- package/dist/types/core/navigation.d.ts +13 -0
- package/dist/types/core/ordering-prefix.d.ts +6 -0
- package/dist/types/core/pinned-ids.d.ts +23 -0
- package/dist/types/core/project-graph.d.ts +9 -1
- package/dist/types/core/redirect-patterns.d.ts +18 -0
- package/dist/types/core/relative-files.d.ts +31 -0
- package/dist/types/core/schema.d.ts +322 -11
- package/dist/types/core/sources/normalize.d.ts +101 -9
- package/dist/types/core/sources/types.d.ts +16 -0
- package/dist/types/core/static-files.d.ts +10 -0
- package/dist/types/core/static-host.d.ts +42 -0
- package/dist/types/core/svg-images.d.ts +26 -0
- package/dist/types/core/syntax-diagnostics.d.ts +14 -0
- package/dist/types/core/types.d.ts +42 -1
- package/dist/types/deploy/generated-files.d.ts +41 -0
- package/dist/types/deploy/redirects.d.ts +21 -7
- package/dist/types/markdown/code-title.d.ts +9 -5
- package/dist/types/markdown/directives.d.ts +8 -0
- package/dist/types/markdown/fence-language.d.ts +51 -0
- package/dist/types/markdown/fence-meta.d.ts +5 -0
- package/dist/types/markdown/github-alerts.d.ts +35 -0
- package/dist/types/openapi/asyncapi.d.ts +6 -5
- package/dist/types/openapi/checks.d.ts +10 -5
- package/dist/types/openapi/model.d.ts +55 -8
- package/dist/types/openapi/parse.d.ts +4 -1
- package/dist/types/ratelimit/index.d.ts +2 -0
- package/dist/types/ratelimit/memory.d.ts +1 -1
- package/dist/types/ratelimit/schema.d.ts +40 -0
- package/dist/types/ratelimit/unkey.d.ts +48 -0
- package/dist/types/sources/filesystem.d.ts +14 -4
- package/dist/types/sources/mdx-remote.d.ts +6 -3
- package/dist/types/sources/registry.d.ts +3 -3
- package/dist/types/theme/color.d.ts +33 -0
- package/dist/types/theme/palette.d.ts +122 -0
- package/docs/01-quickstart.mdx +1 -1
- package/docs/02-deployment.mdx +24 -8
- package/docs/04-migrating.mdx +16 -4
- package/docs/advanced/changelog.mdx +27 -1
- package/docs/advanced/skills.mdx +1 -1
- package/docs/cli/audit.mdx +1 -1
- package/docs/cli/doctor.mdx +2 -2
- package/docs/cli/evals.mdx +1 -1
- package/docs/cli/index.mdx +4 -2
- package/docs/cli/validate.mdx +10 -7
- package/docs/configuration/analytics.mdx +2 -0
- package/docs/configuration/customization.mdx +3 -1
- package/docs/configuration/index.mdx +7 -6
- package/docs/configuration/rate-limiting.mdx +20 -1
- package/docs/configuration/theming.mdx +5 -1
- package/docs/content/components.mdx +26 -6
- package/docs/content/frontmatter.mdx +1 -1
- package/docs/content/i18n.mdx +1 -1
- package/docs/content/includes.mdx +6 -2
- package/docs/content/index.mdx +11 -1
- package/docs/content/islands.mdx +2 -0
- package/docs/content/meta.mdx +9 -3
- package/docs/content/navigation.mdx +14 -6
- package/docs/content/sources/obsidian.mdx +1 -1
- package/docs/content/sources/remote-mdx.mdx +3 -1
- package/docs/content/syntax.mdx +76 -8
- package/docs/content/variables.mdx +3 -1
- package/docs/discoverability/agent-discovery.mdx +1 -1
- package/docs/discoverability/json-api.mdx +1 -1
- package/docs/discoverability/llms-txt.mdx +1 -1
- package/docs/discoverability/markdown.mdx +2 -2
- package/docs/discoverability/mcp.mdx +40 -8
- package/docs/discoverability/open-graph.mdx +1 -1
- package/docs/discoverability/sitemap-and-robots.mdx +1 -1
- package/docs/references/graphql.mdx +2 -0
- package/docs/references/openapi.mdx +45 -7
- package/package.json +4 -4
- package/skills/blume/SKILL.md +2 -2
- package/skills/blume-migrate/SKILL.md +51 -29
- package/skills/blume-migrate/references/docsify.md +262 -0
- package/skills/blume-migrate/references/docus.md +298 -0
- package/skills/blume-migrate/references/docusaurus.md +5 -5
- package/skills/blume-migrate/references/fern.md +327 -0
- package/skills/blume-migrate/references/fumadocs.md +1 -1
- package/skills/blume-migrate/references/gitbook.md +267 -0
- package/skills/blume-migrate/references/github-wiki.md +259 -0
- package/skills/blume-migrate/references/jekyll.md +253 -0
- package/skills/blume-migrate/references/mdbook.md +256 -0
- package/skills/blume-migrate/references/mintlify.md +5 -5
- package/skills/blume-migrate/references/mkdocs.md +236 -0
- package/skills/blume-migrate/references/monorepo.md +20 -8
- package/skills/blume-migrate/references/nextra.md +5 -5
- package/skills/blume-migrate/references/readme.md +257 -0
- package/skills/blume-migrate/references/redocly.md +198 -0
- package/skills/blume-migrate/references/starlight.md +3 -3
- package/skills/blume-migrate/references/vitepress.md +204 -0
- package/skills/blume-migrate/references/vuepress.md +271 -0
- package/skills/blume-migrate/scripts/docsify-codemod.mjs +2387 -0
- package/skills/blume-migrate/scripts/docus-codemod.mjs +2542 -0
- package/skills/blume-migrate/scripts/fern-codemod.mjs +2633 -0
- package/skills/blume-migrate/scripts/github-wiki-codemod.mjs +2808 -0
- package/skills/blume-migrate/scripts/include-excerpts.mjs +649 -0
- package/skills/blume-migrate/scripts/jekyll-codemod.mjs +3649 -0
- package/skills/blume-migrate/scripts/mintlify-codemod.mjs +17 -13
- package/skills/blume-migrate/scripts/mkdocs-codemod.mjs +2526 -0
- package/skills/blume-migrate/scripts/operation-routes.mjs +508 -0
- package/skills/blume-migrate/scripts/pin-heading-ids.mjs +1049 -0
- package/skills/blume-migrate/scripts/readme-codemod.mjs +4139 -0
- package/skills/blume-migrate/scripts/vitepress-codemod.mjs +1511 -0
- package/src/ai/changelog-components.ts +24 -0
- package/src/ai/changelog-markdown.ts +45 -41
- package/src/ai/component-markdown.ts +22 -9
- package/src/ai/llms.ts +36 -5
- package/src/ai/markdown.ts +2 -2
- package/src/ai/openapi-components.ts +25 -9
- package/src/ai/operation-details.ts +208 -0
- package/src/ai/relative-links.ts +48 -8
- package/src/ai/serializers.ts +7 -6
- package/src/ai/site-skill.ts +6 -2
- package/src/analytics/head.ts +11 -5
- package/src/analytics/script.ts +13 -3
- package/src/astro/generate.ts +47 -11
- package/src/astro/index.ts +1 -0
- package/src/astro/integration.ts +27 -1
- package/src/astro/mdx-source-errors.ts +46 -0
- package/src/astro/templates.ts +93 -189
- package/src/audit/checks/redirects.ts +5 -1
- package/src/audit/redirects.ts +36 -19
- package/src/audit/report.ts +22 -9
- package/src/audit/run.ts +12 -28
- package/src/audit/terms.ts +23 -0
- package/src/audit/url.ts +2 -2
- package/src/cli/build-failure.ts +256 -7
- package/src/cli/command-meta.ts +1 -1
- package/src/cli/commands/audit.ts +1 -1
- package/src/cli/commands/build.ts +12 -3
- package/src/cli/commands/check.ts +13 -2
- package/src/cli/commands/dev.ts +1 -1
- package/src/cli/commands/doctor.ts +4 -2
- package/src/cli/commands/init.ts +3 -3
- package/src/cli/commands/preview.ts +17 -1
- package/src/cli/commands/validate.ts +22 -10
- package/src/cli/prepare.ts +1 -1
- package/src/cli/preview-pages.ts +161 -0
- package/src/cli/required-secrets.ts +0 -1
- package/src/cli/unknown-flags.ts +1 -42
- package/src/components/code-copy.ts +51 -0
- package/src/components/code-language.ts +75 -0
- package/src/components/content/AccordionItem.astro +16 -1
- package/src/components/content/Callout.astro +11 -1
- package/src/components/content/Changelog.astro +189 -0
- package/src/components/content/CodeBlock.astro +8 -11
- package/src/components/content/Tabs.astro +16 -2
- package/src/components/content/YouTube.astro +6 -4
- package/src/components/content/code-block.ts +33 -0
- package/src/components/content/content-strings.ts +5 -1
- package/src/components/content/inline-markdown.ts +35 -8
- package/src/components/content/youtube.ts +49 -7
- package/src/components/layout/Analytics.astro +5 -1
- package/src/components/layout/NavTree.astro +8 -3
- package/src/components/layout/PageActions.astro +81 -23
- package/src/components/layout/RootLayout.astro +35 -32
- package/src/components/layout/SiteFooter.astro +31 -8
- package/src/components/layout/nav-utils.ts +14 -0
- package/src/components/layout/search/pagefind.ts +2 -1
- package/src/components/openapi/Operation.astro +4 -0
- package/src/components/openapi/PanelTabs.astro +9 -3
- package/src/components/openapi/RequestBody.astro +42 -8
- package/src/components/openapi/RequestPanel.astro +34 -53
- package/src/components/openapi/example-panels.ts +110 -0
- package/src/components/openapi/helpers.ts +195 -20
- package/src/components/openapi/operation-model.ts +63 -26
- package/src/components/openapi/request.ts +13 -0
- package/src/components/openapi/snippets.ts +14 -2
- package/src/core/alert-diagnostics.ts +89 -0
- package/src/core/builtin-tags.ts +76 -0
- package/src/core/changelog-list.ts +87 -0
- package/src/core/closest-match.ts +41 -0
- package/src/core/code-fence-diagnostics.ts +267 -0
- package/src/core/code-fences.ts +43 -7
- package/src/core/component-diagnostics.ts +65 -12
- package/src/core/config-input.ts +39 -5
- package/src/core/config.ts +46 -1
- package/src/core/content-assets.ts +64 -144
- package/src/core/data.ts +10 -3
- package/src/core/diagnostics.ts +36 -3
- package/src/core/directive-diagnostics.ts +265 -47
- package/src/core/former-routes.ts +46 -0
- package/src/core/git-ignored.ts +53 -0
- package/src/core/github.ts +5 -4
- package/src/core/heading-markers.ts +156 -2
- package/src/core/hidden-pages.ts +64 -0
- package/src/core/includes.ts +181 -41
- package/src/core/last-modified.ts +47 -10
- package/src/core/links.ts +438 -83
- package/src/core/load-module.ts +98 -9
- package/src/core/manifest.ts +12 -9
- package/src/core/markdown-mirrors.ts +52 -0
- package/src/core/mcp-clients.ts +87 -0
- package/src/core/mdx-elements.ts +153 -0
- package/src/core/mdx-syntax.ts +377 -0
- package/src/core/meta-diagnostics.ts +134 -0
- package/src/core/meta.ts +154 -55
- package/src/core/nav-diagnostics.ts +41 -4
- package/src/core/navigation.ts +70 -10
- package/src/core/ordering-prefix.ts +22 -2
- package/src/core/pinned-ids.ts +141 -0
- package/src/core/project-graph.ts +221 -29
- package/src/core/redirect-patterns.ts +41 -0
- package/src/core/relative-files.ts +145 -0
- package/src/core/schema.ts +110 -6
- package/src/core/sources/mdx-remote.ts +75 -14
- package/src/core/sources/normalize.ts +885 -179
- package/src/core/sources/notion.ts +5 -4
- package/src/core/sources/obsidian.ts +2 -5
- package/src/core/sources/types.ts +17 -0
- package/src/core/static-files.ts +40 -0
- package/src/core/static-host.ts +125 -0
- package/src/core/svg-images.ts +98 -0
- package/src/core/syntax-diagnostics.ts +491 -0
- package/src/core/types.ts +43 -1
- package/src/deploy/artifacts.ts +2 -28
- package/src/deploy/generated-files.ts +128 -0
- package/src/deploy/platforms/vercel.ts +25 -1
- package/src/deploy/redirects.ts +43 -16
- package/src/deploy/sitemap.ts +2 -1
- package/src/markdown/base-links.ts +87 -6
- package/src/markdown/code-title.ts +29 -13
- package/src/markdown/content-assets.ts +210 -0
- package/src/markdown/directives.ts +69 -5
- package/src/markdown/fence-language.ts +106 -0
- package/src/markdown/fence-meta.ts +42 -0
- package/src/markdown/github-alerts.ts +172 -0
- package/src/markdown/heading-anchors.ts +265 -56
- package/src/markdown/include.ts +30 -3
- package/src/markdown/index.ts +145 -40
- package/src/markdown/prompt-text.ts +95 -0
- package/src/markdown/relative-links.ts +37 -2
- package/src/markdown/route-snapshot.ts +22 -12
- package/src/markdown/svg-fallback.ts +51 -0
- package/src/markdown/title-heading.ts +134 -0
- package/src/migrate/migrate.ts +127 -2
- package/src/og/card.ts +14 -4
- package/src/openapi/asyncapi.ts +14 -6
- package/src/openapi/checks.ts +160 -15
- package/src/openapi/model.ts +172 -33
- package/src/openapi/parse.ts +13 -4
- package/src/openapi/render-mdx.ts +55 -9
- package/src/openapi/source.ts +87 -6
- package/src/ratelimit/index.ts +2 -0
- package/src/ratelimit/memory.ts +1 -1
- package/src/ratelimit/runtime.ts +81 -0
- package/src/ratelimit/schema.ts +2 -0
- package/src/ratelimit/unkey.ts +61 -0
- package/src/registry/eject.ts +0 -1
- package/src/registry/registry.ts +1 -1
- package/src/search/documents.ts +10 -2
- package/src/sources/filesystem.ts +28 -3
- package/src/sources/mdx-remote.ts +7 -15
- package/src/theme/color.ts +14 -0
- package/src/theme/entry.ts +22 -1
- package/src/theme/palette.ts +74 -1
- package/dist/cli/chunk-0pmb4tr4.js.map +0 -35
- package/dist/cli/chunk-0w6hs479.js.map +0 -10
- package/dist/cli/chunk-150jk7km.js +0 -52
- package/dist/cli/chunk-150jk7km.js.map +0 -10
- package/dist/cli/chunk-36bxs9c7.js.map +0 -10
- package/dist/cli/chunk-53jqw8z0.js +0 -89
- package/dist/cli/chunk-53jqw8z0.js.map +0 -10
- package/dist/cli/chunk-60hz265r.js.map +0 -10
- package/dist/cli/chunk-desvm72z.js.map +0 -14
- package/dist/cli/chunk-dpy8qdjf.js.map +0 -17
- package/dist/cli/chunk-es8h0v3j.js +0 -441
- package/dist/cli/chunk-es8h0v3j.js.map +0 -11
- package/dist/cli/chunk-kdpzw38a.js.map +0 -11
- package/dist/cli/chunk-nbyvgnnm.js.map +0 -36
- package/dist/cli/chunk-s0bdnc7v.js.map +0 -10
- package/dist/cli/chunk-twy7psdz.js.map +0 -10
- package/dist/cli/chunk-ydp3065p.js +0 -64
- package/dist/cli/chunk-ydp3065p.js.map +0 -10
- /package/dist/cli/{chunk-y4msrwm9.js.map → chunk-080mfch6.js.map} +0 -0
- /package/dist/cli/{chunk-9qzgg6mj.js.map → chunk-34wap3ed.js.map} +0 -0
- /package/dist/cli/{chunk-1f882900.js.map → chunk-c5bjxq8v.js.map} +0 -0
- /package/dist/cli/{chunk-bxwhtvw8.js.map → chunk-f260jdrn.js.map} +0 -0
- /package/dist/cli/{chunk-74wfhv79.js.map → chunk-fnxgtjeq.js.map} +0 -0
- /package/dist/cli/{chunk-dhwtqnnd.js.map → chunk-gxhcf2hs.js.map} +0 -0
- /package/dist/cli/{chunk-tfycddbt.js.map → chunk-h0qwdbem.js.map} +0 -0
- /package/dist/cli/{chunk-j1x92mx9.js.map → chunk-j4nfgn2j.js.map} +0 -0
- /package/dist/cli/{chunk-ave1wcbr.js.map → chunk-qcyxkj44.js.map} +0 -0
- /package/dist/cli/{chunk-58bt3hag.js.map → chunk-x7bh6d9j.js.map} +0 -0
- /package/dist/cli/{chunk-hvcxng5f.js.map → chunk-ydqzkhjn.js.map} +0 -0
|
@@ -1,78 +1,64 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import {
|
|
3
|
+
BUILTIN_MDX_TAGS,
|
|
4
|
+
BUILTIN_CHILD_PROPS,
|
|
6
5
|
commandsFor,
|
|
7
6
|
detectProjectPackageManager
|
|
8
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-r5nm9w0c.js";
|
|
8
|
+
import {
|
|
9
|
+
packageRoot
|
|
10
|
+
} from "./index.js";
|
|
9
11
|
|
|
10
12
|
// src/core/component-diagnostics.ts
|
|
11
13
|
import { relative } from "pathe";
|
|
12
|
-
|
|
13
|
-
// src/core/builtin-tags.ts
|
|
14
|
-
var BUILTIN_MDX_TAGS = new Set([
|
|
15
|
-
"Accordion",
|
|
16
|
-
"AccordionItem",
|
|
17
|
-
"ApiOverview",
|
|
18
|
-
"ApiTagOperations",
|
|
19
|
-
"AutoTypeTable",
|
|
20
|
-
"Badge",
|
|
21
|
-
"Callout",
|
|
22
|
-
"Card",
|
|
23
|
-
"CardGroup",
|
|
24
|
-
"CodeBlock",
|
|
25
|
-
"CodeGroup",
|
|
26
|
-
"Color",
|
|
27
|
-
"Column",
|
|
28
|
-
"Columns",
|
|
29
|
-
"Component",
|
|
30
|
-
"Diff",
|
|
31
|
-
"Expandable",
|
|
32
|
-
"FileTree",
|
|
33
|
-
"Frame",
|
|
34
|
-
"GithubInfo",
|
|
35
|
-
"Icon",
|
|
36
|
-
"Math",
|
|
37
|
-
"Operation",
|
|
38
|
-
"Panel",
|
|
39
|
-
"ParamField",
|
|
40
|
-
"Prompt",
|
|
41
|
-
"RequestExample",
|
|
42
|
-
"ResponseExample",
|
|
43
|
-
"ResponseField",
|
|
44
|
-
"Step",
|
|
45
|
-
"Steps",
|
|
46
|
-
"Tab",
|
|
47
|
-
"Tabs",
|
|
48
|
-
"Tile",
|
|
49
|
-
"Tooltip",
|
|
50
|
-
"Tree",
|
|
51
|
-
"TypeTable",
|
|
52
|
-
"View",
|
|
53
|
-
"Visibility",
|
|
54
|
-
"YouTube"
|
|
55
|
-
]);
|
|
56
|
-
|
|
57
|
-
// src/core/component-diagnostics.ts
|
|
58
14
|
var toKebab = (tag) => tag.replaceAll(/(?<lower>[a-z0-9])(?<upper>[A-Z])/gu, "$<lower>-$<upper>").toLowerCase();
|
|
15
|
+
var LIST = new Intl.ListFormat("en", { type: "conjunction" });
|
|
59
16
|
var validateUsedComponents = (pages, extraTags, registryNames) => {
|
|
17
|
+
const users = new Map;
|
|
18
|
+
for (const page of pages) {
|
|
19
|
+
for (const tag of page.componentsUsed ?? []) {
|
|
20
|
+
if (!(BUILTIN_MDX_TAGS.has(tag) || extraTags.has(tag))) {
|
|
21
|
+
users.set(tag, [...users.get(tag) ?? [], page]);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return [...users].map(([tag, using]) => {
|
|
26
|
+
const name = toKebab(tag);
|
|
27
|
+
const suggestion = registryNames.has(name) ? `Run \`blume add ${name}\` to install it, or register <${tag}> in components.ts (mdx).` : `Register <${tag}> in components.ts (mdx), or add an islands/${tag}.tsx component.`;
|
|
28
|
+
const routes = using.map((page) => page.route);
|
|
29
|
+
const [first] = using;
|
|
30
|
+
return {
|
|
31
|
+
code: "BLUME_UNKNOWN_COMPONENT",
|
|
32
|
+
file: first?.sourcePath ?? first?.id,
|
|
33
|
+
message: routes.length === 1 ? `<${tag}> is used in ${LIST.format(routes)} but isn't a known component.` : `<${tag}> is used on ${routes.length} pages but isn't a known component: ${LIST.format(routes)}.`,
|
|
34
|
+
severity: "warning",
|
|
35
|
+
suggestion
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
var EITHER = new Intl.ListFormat("en", { type: "disjunction" });
|
|
40
|
+
var quoted = (names) => names.map((name) => `\`${name}\``);
|
|
41
|
+
var unknownPropDiagnostics = (pages, extraTags) => {
|
|
60
42
|
const diagnostics = [];
|
|
61
43
|
const seen = new Set;
|
|
62
44
|
for (const page of pages) {
|
|
63
|
-
for (const
|
|
64
|
-
|
|
45
|
+
for (const use of page.unknownProps ?? []) {
|
|
46
|
+
const file = use.file ?? page.sourcePath ?? page.id;
|
|
47
|
+
const key = `${file}:${use.line}:${use.column}`;
|
|
48
|
+
if (extraTags.has(use.tag) || seen.has(key)) {
|
|
65
49
|
continue;
|
|
66
50
|
}
|
|
67
|
-
seen.add(
|
|
68
|
-
const
|
|
69
|
-
const
|
|
51
|
+
seen.add(key);
|
|
52
|
+
const accepted = BUILTIN_CHILD_PROPS.get(use.tag) ?? [];
|
|
53
|
+
const takes = accepted.length > 0 ? `, and use the props ${use.tag} takes: ${LIST.format(quoted(accepted))}` : `; ${use.tag} takes no props`;
|
|
70
54
|
diagnostics.push({
|
|
71
|
-
code: "
|
|
72
|
-
|
|
73
|
-
|
|
55
|
+
code: "BLUME_UNKNOWN_PROP",
|
|
56
|
+
column: use.column,
|
|
57
|
+
file,
|
|
58
|
+
line: use.line,
|
|
59
|
+
message: `<${use.tag}> in ${page.route} has no children, and ${use.tag} doesn't take ${EITHER.format(quoted(use.props))}, so it renders without what ${use.props.length === 1 ? "that prop" : "those props"} meant to show.`,
|
|
74
60
|
severity: "warning",
|
|
75
|
-
suggestion
|
|
61
|
+
suggestion: `Put the content between the tags (<${use.tag}>…</${use.tag}>)${takes}.`
|
|
76
62
|
});
|
|
77
63
|
}
|
|
78
64
|
}
|
|
@@ -318,7 +304,7 @@ var missingDependencyDiagnostic = async (config, root, severity, frameworks = []
|
|
|
318
304
|
};
|
|
319
305
|
};
|
|
320
306
|
|
|
321
|
-
export { validateUsedComponents, missingExampleDiagnostics, discoverIslands, EXAMPLE_SCAN_GLOB, exampleScanRoots, discoverExamples, exampleMarkdownLookup, missingDependencyDiagnostic };
|
|
307
|
+
export { validateUsedComponents, unknownPropDiagnostics, missingExampleDiagnostics, discoverIslands, EXAMPLE_SCAN_GLOB, exampleScanRoots, discoverExamples, exampleMarkdownLookup, missingDependencyDiagnostic };
|
|
322
308
|
|
|
323
|
-
//# debugId=
|
|
324
|
-
//# sourceMappingURL=chunk-
|
|
309
|
+
//# debugId=01581CA3D72AB06264756E2164756E21
|
|
310
|
+
//# sourceMappingURL=chunk-rtvgmg2j.js.map
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/core/component-diagnostics.ts", "../src/
|
|
3
|
+
"sources": ["../src/core/component-diagnostics.ts", "../src/astro/islands.ts", "../src/astro/examples.ts", "../src/astro/runtime-deps.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import { relative } from \"pathe\";\n\nimport { BUILTIN_MDX_TAGS } from \"./builtin-tags.ts\";\nimport type { Diagnostic, PageRecord } from \"./types.ts\";\n\n/** `CardGroup` → `card-group`, matching registry item names. */\nconst toKebab = (tag: string): string =>\n tag\n .replaceAll(/(?<lower>[a-z0-9])(?<upper>[A-Z])/gu, \"$<lower>-$<upper>\")\n .toLowerCase();\n\n/**\n * Warn when an `.mdx` page uses a `<Component>` tag that resolves to nothing —\n * a built-in, an island, or a `components.ts` override — so a typo surfaces as a\n * friendly diagnostic (with a `blume add` hint where one exists) instead of a raw\n * MDX \"X is not defined\" build error. `extraTags` are the project's own known\n * components (islands + overrides); `registryNames` gates the install hint.\n */\nexport const validateUsedComponents = (\n pages: PageRecord[],\n extraTags: Set<string>,\n registryNames: Set<string>\n): Diagnostic[] => {\n const
|
|
6
|
-
"/**\n * The MDX component tags Blume ships (the keys of the catch-all's component map,\n * plus composed sub-parts like `Color.Item`/`Tree.File`). Used by the\n * missing-component diagnostic to tell an unknown `<Tag>` from a built-in. Keep\n * in sync with the component map in `astro/templates.ts`.\n */\nexport const BUILTIN_MDX_TAGS = new Set<string>([\n \"Accordion\",\n \"AccordionItem\",\n \"ApiOverview\",\n \"ApiTagOperations\",\n \"AutoTypeTable\",\n \"Badge\",\n \"Callout\",\n \"Card\",\n \"CardGroup\",\n \"CodeBlock\",\n \"CodeGroup\",\n \"Color\",\n \"Column\",\n \"Columns\",\n \"Component\",\n \"Diff\",\n \"Expandable\",\n \"FileTree\",\n \"Frame\",\n \"GithubInfo\",\n \"Icon\",\n // Conditionally imported by the catch-all, but `detectUsesMath` matches any\n // authored `<Math`, so it is always wired wherever it can appear.\n \"Math\",\n \"Operation\",\n \"Panel\",\n \"ParamField\",\n \"Prompt\",\n \"RequestExample\",\n \"ResponseExample\",\n \"ResponseField\",\n \"Step\",\n \"Steps\",\n \"Tab\",\n \"Tabs\",\n \"Tile\",\n \"Tooltip\",\n \"Tree\",\n \"TypeTable\",\n \"View\",\n \"Visibility\",\n \"YouTube\",\n]);\n",
|
|
5
|
+
"import { relative } from \"pathe\";\n\nimport { BUILTIN_CHILD_PROPS, BUILTIN_MDX_TAGS } from \"./builtin-tags.ts\";\nimport type { Diagnostic, PageRecord } from \"./types.ts\";\n\n/** `CardGroup` → `card-group`, matching registry item names. */\nconst toKebab = (tag: string): string =>\n tag\n .replaceAll(/(?<lower>[a-z0-9])(?<upper>[A-Z])/gu, \"$<lower>-$<upper>\")\n .toLowerCase();\n\nconst LIST = new Intl.ListFormat(\"en\", { type: \"conjunction\" });\n\n/**\n * Warn when an `.mdx` page uses a `<Component>` tag that resolves to nothing —\n * a built-in, an island, or a `components.ts` override — so a typo surfaces as a\n * friendly diagnostic (with a `blume add` hint where one exists) instead of a raw\n * MDX \"X is not defined\" build error. `extraTags` are the project's own known\n * components (islands + overrides); `registryNames` gates the install hint.\n * One warning per tag names every page that uses it, anchored to the first.\n */\nexport const validateUsedComponents = (\n pages: PageRecord[],\n extraTags: Set<string>,\n registryNames: Set<string>\n): Diagnostic[] => {\n const users = new Map<string, PageRecord[]>();\n for (const page of pages) {\n for (const tag of page.componentsUsed ?? []) {\n if (!(BUILTIN_MDX_TAGS.has(tag) || extraTags.has(tag))) {\n users.set(tag, [...(users.get(tag) ?? []), page]);\n }\n }\n }\n return [...users].map(([tag, using]) => {\n const name = toKebab(tag);\n const suggestion = registryNames.has(name)\n ? `Run \\`blume add ${name}\\` to install it, or register <${tag}> in components.ts (mdx).`\n : `Register <${tag}> in components.ts (mdx), or add an islands/${tag}.tsx component.`;\n const routes = using.map((page) => page.route);\n const [first] = using;\n return {\n code: \"BLUME_UNKNOWN_COMPONENT\",\n file: first?.sourcePath ?? first?.id,\n message:\n routes.length === 1\n ? `<${tag}> is used in ${LIST.format(routes)} but isn't a known component.`\n : `<${tag}> is used on ${routes.length} pages but isn't a known component: ${LIST.format(routes)}.`,\n severity: \"warning\",\n suggestion,\n };\n });\n};\n\nconst EITHER = new Intl.ListFormat(\"en\", { type: \"disjunction\" });\nconst quoted = (names: readonly string[]): string[] =>\n names.map((name) => `\\`${name}\\``);\n\n/**\n * Warn about each childless built-in in an `.mdx` page given props it doesn't\n * take (`<Badge type=\"tip\" text=\"beta\" />`, VitePress's Badge). Blume's\n * components ignore unknown props, so the element renders without the\n * content those props carried. `extraTags` are the project's own components\n * (islands + overrides): one that replaces a built-in takes its own props,\n * so its uses aren't checked. A file shared by several locales is reported\n * once.\n */\nexport const unknownPropDiagnostics = (\n pages: readonly PageRecord[],\n extraTags: ReadonlySet<string>\n): Diagnostic[] => {\n const diagnostics: Diagnostic[] = [];\n const seen = new Set<string>();\n for (const page of pages) {\n for (const use of page.unknownProps ?? []) {\n const file = use.file ?? page.sourcePath ?? page.id;\n const key = `${file}:${use.line}:${use.column}`;\n if (extraTags.has(use.tag) || seen.has(key)) {\n continue;\n }\n seen.add(key);\n const accepted = BUILTIN_CHILD_PROPS.get(use.tag) ?? [];\n const takes =\n accepted.length > 0\n ? `, and use the props ${use.tag} takes: ${LIST.format(quoted(accepted))}`\n : `; ${use.tag} takes no props`;\n diagnostics.push({\n code: \"BLUME_UNKNOWN_PROP\",\n column: use.column,\n file,\n line: use.line,\n message: `<${use.tag}> in ${page.route} has no children, and ${use.tag} doesn't take ${EITHER.format(quoted(use.props))}, so it renders without what ${use.props.length === 1 ? \"that prop\" : \"those props\"} meant to show.`,\n severity: \"warning\",\n suggestion: `Put the content between the tags (<${use.tag}>…</${use.tag}>)${takes}.`,\n });\n }\n }\n return diagnostics;\n};\n\n/** What example discovery found: where it looked, and each example's key. */\nexport interface ExampleKeys {\n /** Absolute directory the examples were discovered under. */\n dir: string;\n examples: readonly { path: string }[];\n}\n\n/**\n * Warn about each `<Component path>` in an `.mdx` page that names no\n * discovered example. The page still renders, with a \"No example found\" box\n * where the preview should be, so without this a typo or a moved example\n * ships silently. Reported at the `path` value, in the partial that holds it\n * when an `<include>` brought it in; a file shared by several locales is\n * reported once. `extraTags` are the project's own components (islands +\n * overrides), as for {@link validateUsedComponents}: one named `Component`\n * replaces the built-in and resolves `path` its own way, so none is checked.\n */\nexport const missingExampleDiagnostics = (\n pages: readonly PageRecord[],\n discovery: ExampleKeys,\n root: string,\n extraTags: ReadonlySet<string>\n): Diagnostic[] => {\n if (extraTags.has(\"Component\")) {\n return [];\n }\n const known = new Set(discovery.examples.map((example) => example.path));\n const dir = relative(root, discovery.dir) || \".\";\n const diagnostics: Diagnostic[] = [];\n const seen = new Set<string>();\n for (const page of pages) {\n for (const use of page.examplesUsed ?? []) {\n const file = use.file ?? page.sourcePath ?? page.id;\n const key = `${file}:${use.line}:${use.column}`;\n if (!(known.has(use.path) || seen.has(key))) {\n seen.add(key);\n diagnostics.push({\n code: \"BLUME_EXAMPLE_NOT_FOUND\",\n column: use.column,\n file,\n line: use.line,\n message: `<Component path=\"${use.path}\"> in ${page.route} names no example, so the page shows \"No example found\" in its place.`,\n severity: \"warning\",\n suggestion: `Fix the path, or add the example under ${dir}/: \\`path\\` is its location there, without the extension.`,\n });\n }\n }\n }\n return diagnostics;\n};\n",
|
|
7
6
|
"import { readFile } from \"node:fs/promises\";\n\nimport pMap from \"p-map\";\nimport { basename, join } from \"pathe\";\nimport { glob } from \"tinyglobby\";\n\n/** Astro hydration directives Blume applies to a convention island. */\nexport type IslandClientMode = \"idle\" | \"load\" | \"only\" | \"visible\";\n\n/** Client framework an island is authored in, inferred from its extension. */\nexport type IslandFramework = \"react\" | \"svelte\" | \"vue\";\n\n/** A discovered `islands/` component, ready to wrap and expose to MDX. */\nexport interface IslandSpec {\n /** Hydration directive, from `export const client` or the default. */\n client: IslandClientMode;\n /** Absolute path to the island source file. */\n file: string;\n /** Astro client framework, used to enable the renderer and for `client:only`. */\n framework: IslandFramework;\n /** Component name used in MDX — the file's basename without extension. */\n name: string;\n}\n\nexport interface IslandDiscovery {\n islands: IslandSpec[];\n warnings: string[];\n}\n\n/** Hydration mode used when an island doesn't declare one. */\nconst DEFAULT_CLIENT: IslandClientMode = \"visible\";\n\n/** Ceiling on concurrent island-file reads; unbounded fan-out risks EMFILE. */\nconst READ_CONCURRENCY = 16;\n\nconst VALID_MODES = new Set<IslandClientMode>([\n \"idle\",\n \"load\",\n \"only\",\n \"visible\",\n]);\n\n/** Whether a declared client mode is one Astro's directives support. */\nconst isClientMode = (mode: string): mode is IslandClientMode =>\n // SAFETY: `Set.has` only compares identity at runtime; the assertion widens\n // the lookup key so the narrower-typed set accepts it, and the `has` result\n // is exactly the predicate being claimed.\n VALID_MODES.has(mode as IslandClientMode);\n\n/** Island extensions mapped to the Astro renderer that handles them. */\nconst FRAMEWORK_BY_EXT = new Map<string, IslandFramework>([\n [\"jsx\", \"react\"],\n [\"svelte\", \"svelte\"],\n [\"tsx\", \"react\"],\n [\"vue\", \"vue\"],\n]);\n\n// Captures the extension so we can both strip it from the name and pick the\n// framework. Kept in sync with the glob below.\nconst ISLAND_FILE = /\\.(?<ext>jsx|svelte|tsx|vue)$/u;\n\n// Matches `export const client = \"load\"` (with optional type annotation and\n// either quote style). Read statically so we never execute island code in Node.\nconst CLIENT_EXPORT =\n /export\\s+const\\s+client\\s*(?::[^=]+)?=\\s*[\"'](?<mode>\\w+)[\"']/u;\n\nexport const readClientMode = (\n source: string,\n file: string,\n warnings: string[]\n): IslandClientMode => {\n const mode = source.match(CLIENT_EXPORT)?.groups?.mode;\n if (!mode) {\n return DEFAULT_CLIENT;\n }\n if (!isClientMode(mode)) {\n warnings.push(\n `Island \"${file}\" declares an unknown client mode \"${mode}\"; defaulting to \"${DEFAULT_CLIENT}\". Use \"load\", \"idle\", \"visible\", or \"only\".`\n );\n return DEFAULT_CLIENT;\n }\n return mode;\n};\n\n/**\n * Discover convention islands under `<root>/islands`. Every `.tsx`/`.jsx`/\n * `.vue`/`.svelte` file becomes a globally-available, hydrated MDX component\n * named after the file (which must be PascalCase to be usable as a JSX tag).\n * Hydration defaults to `client:visible`; a file opts out with `export const\n * client = \"load\" | \"idle\" | \"only\"`. Discovery is path-based (a glob), so no\n * user code is executed.\n */\nexport const discoverIslands = async (\n root: string\n): Promise<IslandDiscovery> => {\n const dir = join(root, \"islands\");\n // Enumerate everything and let ISLAND_FILE do the filtering below, so\n // unknown extensions take the skip guard instead of relying on a glob\n // pattern staying in sync with the regex and framework map.\n const matches = await glob([\"**/*\"], {\n absolute: true,\n cwd: dir,\n onlyFiles: true,\n });\n const files = matches.toSorted();\n const sources = await pMap(files, (file) => readFile(file, \"utf-8\"), {\n concurrency: READ_CONCURRENCY,\n });\n\n const islands: IslandSpec[] = [];\n const warnings: string[] = [];\n const seen = new Map<string, string>();\n\n // Extracted so the skip paths become early `return`s (one `continue` budget\n // per loop under the lint rule) instead of `continue` statements.\n const collectIsland = (file: string, source: string): void => {\n const base = basename(file);\n const ext = base.match(ISLAND_FILE)?.groups?.ext;\n const framework = ext ? FRAMEWORK_BY_EXT.get(ext) : undefined;\n if (!framework) {\n return;\n }\n const name = base.replace(ISLAND_FILE, \"\");\n // The name is used verbatim as both an MDX tag and an unquoted object key\n // in the generated island map, so it must be a plain PascalCase identifier\n // — a `-`, `.`, or space (e.g. `Time-Picker.tsx`) would otherwise emit a\n // syntax-error module and fail the whole build with no pointer to the file.\n if (!/^[A-Z][A-Za-z0-9_]*$/u.test(name)) {\n warnings.push(\n `Island \"${file}\" must have a PascalCase identifier filename to be used in MDX (letters, digits, and underscores only, e.g. Counter.tsx → <Counter />); skipping it.`\n );\n return;\n }\n const existing = seen.get(name);\n if (existing) {\n warnings.push(\n `Two islands both resolve to <${name}> (\"${existing}\" and \"${file}\"); ignoring the second. Give them distinct filenames.`\n );\n return;\n }\n seen.set(name, file);\n islands.push({\n client: readClientMode(source, file, warnings),\n file,\n framework,\n name,\n });\n };\n\n for (const [index, file] of files.entries()) {\n collectIsland(file, sources[index] ?? \"\");\n }\n\n return { islands, warnings };\n};\n",
|
|
8
7
|
"import { readFile } from \"node:fs/promises\";\n\nimport pMap from \"p-map\";\nimport { isAbsolute, join, relative } from \"pathe\";\nimport { glob } from \"tinyglobby\";\n\nimport type { ExampleLookup } from \"../core/types.ts\";\nimport type { IslandClientMode } from \"./islands.ts\";\nimport { readClientMode } from \"./islands.ts\";\n\n/** Framework an example is authored in, inferred from its extension. */\nexport type ExampleFramework = \"astro\" | \"react\" | \"svelte\" | \"vue\";\n\n/** A discovered `examples/` file, ready to wrap (live) and show (source). */\nexport interface ExampleSpec {\n /** Hydration directive for a framework example; `undefined` for `.astro`. */\n client?: IslandClientMode;\n /** Absolute path to the example source file. */\n file: string;\n /** Framework, or `astro` for a server-rendered (static) example. */\n framework: ExampleFramework;\n /** Shiki language for the source pane — the file extension. */\n lang: string;\n /** MDX-facing key: the path under `examples/`, sans extension, `/`-joined. */\n path: string;\n /** Raw source text shown in the code tab. */\n source: string;\n}\n\nexport interface ExampleDiscovery {\n /**\n * Absolute directory the examples were discovered under: the configured\n * `examples.source` (or a glob's static prefix) resolved against the root.\n */\n dir: string;\n examples: ExampleSpec[];\n warnings: string[];\n}\n\n/** Example extensions mapped to the framework that renders them. */\ninterface FrameworkByExtension {\n [extension: string]: ExampleFramework;\n}\n\nconst FRAMEWORK_BY_EXT: FrameworkByExtension = {\n astro: \"astro\",\n jsx: \"react\",\n svelte: \"svelte\",\n tsx: \"react\",\n vue: \"vue\",\n};\n\n// Captures the extension so we can strip it from the path key and pick the\n// framework. Kept in sync with the glob below — non-matching files a user glob\n// happens to sweep in (e.g. a registry's `.ts` sources) are dropped here.\nconst EXAMPLE_FILE = /\\.(?<ext>astro|jsx|svelte|tsx|vue)$/u;\n\n// Renderable example files when `examples` names a plain directory.\nconst DEFAULT_EXAMPLE_GLOB = \"**/*.{astro,jsx,svelte,tsx,vue}\";\n\n/** Ceiling on concurrent example-file reads; unbounded fan-out risks EMFILE. */\nconst READ_CONCURRENCY = 16;\n\n/**\n * Files the preview-frame Tailwind entry scans for utility classes, appended\n * to each directory from `exampleScanRoots`.\n */\nexport const EXAMPLE_SCAN_GLOB = \"**/*.{astro,jsx,svelte,ts,tsx,vue}\";\n\n/**\n * Directories the `<Component />` preview sheet scans for utility classes:\n * the project root, plus the examples directory when it lives outside the\n * root (a sibling workspace package, say). Tailwind's `@source` is a file\n * glob, not an import graph, so an out-of-root examples directory would\n * otherwise contribute no utilities and previews would render half-styled.\n */\nexport const exampleScanRoots = (\n root: string,\n examplesDir: string\n): string[] => {\n const path = relative(root, examplesDir);\n const outside = path.startsWith(\"..\") || isAbsolute(path);\n return outside ? [root, examplesDir] : [root];\n};\n\n// Glob magic that turns `examples` from a plain directory into a pattern. `()`,\n// `@`, and `+` are excluded so literal path segments (npm scopes, parens) keep\n// resolving as directories; the extglob leads `*?!` still trigger here.\nconst GLOB_MAGIC = /[!*?[\\]{}]/u;\n\n/**\n * Split a glob into its static directory prefix and the remaining pattern, so\n * discovered files can be keyed relative to that prefix (e.g.\n * `registry/x/**\\/examples/*` → `{ base: \"registry/x\", rest: \"**\\/examples/*\" }`).\n */\nconst splitGlobBase = (pattern: string) => {\n const segments = pattern.split(\"/\");\n // Only called when the pattern contains glob magic (see the caller), and `/`\n // is never magic, so the magic char always lands in a segment — `findIndex`\n // is never -1 here.\n const firstMagic = segments.findIndex((segment) => GLOB_MAGIC.test(segment));\n return {\n base: segments.slice(0, firstMagic).join(\"/\"),\n rest: segments.slice(firstMagic).join(\"/\"),\n };\n};\n\n/**\n * Discover preview examples for the `examples` config (default `examples`).\n * Every `.astro`/`.tsx`/`.jsx`/`.vue`/`.svelte` file becomes addressable by\n * `<Component path=\"...\">`, where the path is the file's location without its\n * extension (e.g. `forms/login.tsx` → `forms/login`).\n *\n * `pattern` is a directory by default, but may be a glob (anything with\n * `*`/`?`/`[]`/`{}`/`!`) — then only matching files are discovered and each\n * `<Component path>` key is relative to the glob's static prefix. This lets a\n * registry layout that colocates component sources with their examples be\n * targeted directly (e.g. `registry/<pkg>/**\\/examples/*`) without the sources —\n * which have no default export and so can't be wrapped — being swept in.\n *\n * Discovery is path-based (a glob), so no example code is executed. Framework\n * examples carry a hydration mode (default `client:visible`, overridable via\n * `export const client`); `.astro` examples render statically with no client\n * directive.\n */\nexport const discoverExamples = async (\n root: string,\n pattern = \"examples\"\n): Promise<ExampleDiscovery> => {\n const { base, rest } = GLOB_MAGIC.test(pattern)\n ? splitGlobBase(pattern)\n : { base: pattern, rest: DEFAULT_EXAMPLE_GLOB };\n const dir = join(root, base);\n const matches = await glob([rest], {\n absolute: true,\n cwd: dir,\n onlyFiles: true,\n });\n const files = matches.toSorted();\n const sources = await pMap(files, (file) => readFile(file, \"utf-8\"), {\n concurrency: READ_CONCURRENCY,\n });\n\n const examples: ExampleSpec[] = [];\n const warnings: string[] = [];\n const seen = new Map<string, string>();\n\n // Extracted so the two skip paths become early `return`s (one `continue`\n // budget per loop under the lint rule) instead of `continue` statements.\n const collectExample = (file: string, source: string): void => {\n const ext = file.match(EXAMPLE_FILE)?.groups?.ext;\n const framework = ext ? FRAMEWORK_BY_EXT[ext] : undefined;\n if (!(ext && framework)) {\n return;\n }\n // Strip the trailing `.<ext>` to form the `<Component path>` key.\n const path = relative(dir, file).slice(0, -(ext.length + 1));\n const existing = seen.get(path);\n if (existing) {\n warnings.push(\n `Two examples both resolve to \"${path}\" (\"${existing}\" and \"${file}\"); ignoring the second. Give them distinct paths.`\n );\n return;\n }\n seen.set(path, file);\n examples.push({\n client:\n framework === \"astro\"\n ? undefined\n : readClientMode(source, file, warnings),\n file,\n framework,\n lang: ext,\n path,\n source,\n });\n };\n\n for (const [index, file] of files.entries()) {\n collectExample(file, sources[index] ?? \"\");\n }\n\n return { dir, examples, warnings };\n};\n\n/**\n * Reduce discovered examples to the `<Component path>` → source lookup the\n * agent-facing Markdown downleveler needs (see {@link BlumeProject.examples}).\n */\nexport const exampleMarkdownLookup = (examples: ExampleSpec[]): ExampleLookup =>\n Object.fromEntries(\n examples.map((example) => [\n example.path,\n { lang: example.lang, source: example.source },\n ])\n );\n",
|
|
9
8
|
"import { createRequire } from \"node:module\";\nimport { pathToFileURL } from \"node:url\";\n\nimport { join } from \"pathe\";\n\nimport {\n commandsFor,\n detectProjectPackageManager,\n} from \"../cli/init/scaffold.ts\";\nimport { packageRoot } from \"../core/package-root.ts\";\nimport type { ResolvedConfig } from \"../core/schema.ts\";\nimport type { Diagnostic } from \"../core/types.ts\";\n\n/** Whether a module specifier resolves from a directory via node resolution. */\nexport const canResolveFrom = (fromDir: string, spec: string): boolean => {\n try {\n createRequire(pathToFileURL(join(fromDir, \"_.js\")).href).resolve(spec);\n return true;\n } catch {\n return false;\n }\n};\n\n/** A package a configured feature imports that the project can't resolve. */\nexport interface MissingDependency {\n /** The package whose absence was detected. */\n dep: string;\n /** Every package to install for the feature (a framework and its integration). */\n install: string[];\n /** What needs it, as the message names it: `Search adapter \"algolia\"`. */\n owner: string;\n}\n\n/**\n * The declared `deps` of one feature that resolve neither from the project\n * root nor from the Blume package itself. A dep is available when the project\n * installed it OR Blume ships it (the same set the `.blume` deps link exposes\n * to the build). Resolving from the project root alone falsely flagged a\n * shipped SDK like Orama (the default provider) as missing whenever it wasn't\n * hoisted into the project, e.g. under isolated linkers. Each package is\n * resolved from its real location rather than through the `.blume` junction,\n * which can't be traversed reliably for store-symlinked deps.\n */\nconst unresolved = (\n owner: string,\n deps: readonly string[],\n root: string,\n pkgDir: string\n): MissingDependency[] =>\n deps\n .filter(\n (dep) => !(canResolveFrom(root, dep) || canResolveFrom(pkgDir, dep))\n )\n .map((dep) => ({ dep, install: [dep], owner }));\n\n/**\n * The search adapter's SDK, when missing. Provider SDKs are optional peers,\n * so a hosted adapter's client import fails in Vite without one.\n */\nexport const searchProviderDependencies = (\n provider: ResolvedConfig[\"search\"][\"provider\"],\n root: string,\n pkgDir: string = packageRoot()\n): MissingDependency[] =>\n unresolved(\n `Search adapter \"${provider.kind}\"`,\n provider.runtimeDeps,\n root,\n pkgDir\n );\n\n/** Content source SDKs (`@notionhq/client`, `@sanity/client`), when missing. */\nexport const sourceAdapterDependencies = (\n sources: ResolvedConfig[\"content\"][\"sources\"],\n root: string,\n pkgDir: string = packageRoot()\n): MissingDependency[] =>\n sources.flatMap((source) =>\n unresolved(\n `Content source \"${source.kind}\"`,\n source.runtimeDeps,\n root,\n pkgDir\n )\n );\n\n/**\n * The assistant adapter's provider SDK, when missing — only `gateway` needs\n * nothing beyond the core `ai` package Blume ships. An external `endpoint`\n * means no generated route, so no SDK is imported.\n */\nexport const assistantProviderDependencies = (\n ask: ResolvedConfig[\"ai\"][\"assistant\"],\n root: string,\n pkgDir: string = packageRoot()\n): MissingDependency[] =>\n ask?.enabled && !ask.endpoint\n ? unresolved(\n `Assistant provider \"${ask.provider.kind}\"`,\n ask.provider.runtimeDeps,\n root,\n pkgDir\n )\n : [];\n\n/**\n * The narration provider's SDK, when missing: `openai()` speaks through\n * `@ai-sdk/openai`, which the build loads to generate the clips, while\n * `gateway()` needs nothing beyond the core `ai` package Blume ships.\n */\nexport const narrationProviderDependencies = (\n narration: ResolvedConfig[\"narration\"],\n root: string,\n pkgDir: string = packageRoot()\n): MissingDependency[] =>\n narration.enabled && narration.provider\n ? unresolved(\n `Narration provider \"${narration.provider.kind}\"`,\n narration.provider.runtimeDeps,\n root,\n pkgDir\n )\n : [];\n\n/**\n * The deployment adapter's package, when missing. Node and Vercel ship with\n * Blume, so theirs always resolve; Netlify and Cloudflare are optional peers.\n * The generated astro.config.mjs imports the package directly, so without it\n * the build dies with an opaque ERR_MODULE_NOT_FOUND from the hidden config.\n */\nexport const deploymentAdapterDependencies = (\n deployment: ResolvedConfig[\"deployment\"],\n root: string,\n pkgDir: string = packageRoot()\n): MissingDependency[] =>\n unresolved(\n `Deployment adapter \"${deployment.kind}\"`,\n deployment.runtimeDeps,\n root,\n pkgDir\n );\n\n/** Astro integration package each non-React island framework needs installed. */\nconst ISLAND_FRAMEWORK_DEPS = new Map([\n [\"svelte\", \"@astrojs/svelte\"],\n [\"vue\", \"@astrojs/vue\"],\n]);\n\n/**\n * A Vue/Svelte island's Astro integration, when missing — the generated config\n * imports it. React ships with Blume, so it never needs this. The framework\n * itself is installed alongside its integration.\n */\nexport const islandFrameworkDependencies = (\n frameworks: Iterable<string>,\n root: string\n): MissingDependency[] =>\n [...frameworks].flatMap((framework) => {\n const dep = ISLAND_FRAMEWORK_DEPS.get(framework);\n return dep && !canResolveFrom(root, dep)\n ? [\n {\n dep,\n install: [dep, framework],\n owner: `Island framework \"${framework}\"`,\n },\n ]\n : [];\n });\n\n/**\n * Every package the resolved config's adapters (and the given island\n * frameworks) import that isn't installed: the search SDK, content source\n * SDKs, the assistant and narration provider SDKs, the deployment adapter,\n * and island integrations. The adapters' `runtimeDeps` are the one place that\n * knows.\n */\nexport const missingRuntimeDependencies = (\n config: ResolvedConfig,\n root: string,\n frameworks: Iterable<string> = [],\n pkgDir: string = packageRoot()\n): MissingDependency[] => [\n ...searchProviderDependencies(config.search.provider, root, pkgDir),\n ...sourceAdapterDependencies(config.content.sources, root, pkgDir),\n ...assistantProviderDependencies(config.ai.assistant, root, pkgDir),\n ...narrationProviderDependencies(config.narration, root, pkgDir),\n ...deploymentAdapterDependencies(config.deployment, root, pkgDir),\n ...islandFrameworkDependencies(frameworks, root),\n];\n\n/**\n * One diagnostic for every package the config imports that isn't installed,\n * with the command that installs them all through the project's package\n * manager (`npm install`, `pnpm add`, …), or undefined when nothing is\n * missing. `blume build` raises it as an error and `blume dev` as a warning;\n * `blume doctor` reports it before a build ever runs.\n */\nexport const missingDependencyDiagnostic = async (\n config: ResolvedConfig,\n root: string,\n severity: Diagnostic[\"severity\"],\n frameworks: Iterable<string> = [],\n pkgDir: string = packageRoot()\n): Promise<Diagnostic | undefined> => {\n const missing = missingRuntimeDependencies(config, root, frameworks, pkgDir);\n if (missing.length === 0) {\n return undefined;\n }\n const { add } = commandsFor(await detectProjectPackageManager(root));\n const needs = missing.map(({ dep, owner }) => `${owner} needs \"${dep}\"`);\n const packages = [...new Set(missing.flatMap(({ install }) => install))];\n return {\n code: \"BLUME_DEPENDENCY_MISSING\",\n message:\n missing.length === 1\n ? `${needs[0]}, which isn't installed.`\n : `These packages aren't installed: ${needs.join(\"; \")}.`,\n severity,\n suggestion: `Install ${packages.length === 1 ? \"it\" : \"them\"}: \\`${add} ${packages.join(\" \")}\\`.`,\n };\n};\n"
|
|
10
9
|
],
|
|
11
|
-
"mappings": "
|
|
12
|
-
"debugId": "
|
|
10
|
+
"mappings": ";;;;;;;;;;;;AAAA;AAMA,IAAM,UAAU,CAAC,QACf,IACG,WAAW,uCAAuC,mBAAmB,EACrE,YAAY;AAEjB,IAAM,OAAO,IAAI,KAAK,WAAW,MAAM,EAAE,MAAM,cAAc,CAAC;AAUvD,IAAM,yBAAyB,CACpC,OACA,WACA,kBACiB;AAAA,EACjB,MAAM,QAAQ,IAAI;AAAA,EAClB,WAAW,QAAQ,OAAO;AAAA,IACxB,WAAW,OAAO,KAAK,kBAAkB,CAAC,GAAG;AAAA,MAC3C,IAAI,EAAE,iBAAiB,IAAI,GAAG,KAAK,UAAU,IAAI,GAAG,IAAI;AAAA,QACtD,MAAM,IAAI,KAAK,CAAC,GAAI,MAAM,IAAI,GAAG,KAAK,CAAC,GAAI,IAAI,CAAC;AAAA,MAClD;AAAA,IACF;AAAA,EACF;AAAA,EACA,OAAO,CAAC,GAAG,KAAK,EAAE,IAAI,EAAE,KAAK,WAAW;AAAA,IACtC,MAAM,OAAO,QAAQ,GAAG;AAAA,IACxB,MAAM,aAAa,cAAc,IAAI,IAAI,IACrC,mBAAmB,sCAAsC,iCACzD,aAAa,kDAAkD;AAAA,IACnE,MAAM,SAAS,MAAM,IAAI,CAAC,SAAS,KAAK,KAAK;AAAA,IAC7C,OAAO,SAAS;AAAA,IAChB,OAAO;AAAA,MACL,MAAM;AAAA,MACN,MAAM,OAAO,cAAc,OAAO;AAAA,MAClC,SACE,OAAO,WAAW,IACd,IAAI,mBAAmB,KAAK,OAAO,MAAM,mCACzC,IAAI,mBAAmB,OAAO,6CAA6C,KAAK,OAAO,MAAM;AAAA,MACnG,UAAU;AAAA,MACV;AAAA,IACF;AAAA,GACD;AAAA;AAGH,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,OAAO;AAAA,IACL,MAAM;AAAA,IACN,SACE,QAAQ,WAAW,IACf,GAAG,MAAM,+BACT,oCAAoC,MAAM,KAAK,IAAI;AAAA,IACzD;AAAA,IACA,YAAY,WAAW,SAAS,WAAW,IAAI,OAAO,aAAa,OAAO,SAAS,KAAK,GAAG;AAAA,EAC7F;AAAA;",
|
|
11
|
+
"debugId": "01581CA3D72AB06264756E2164756E21",
|
|
13
12
|
"names": []
|
|
14
13
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
packageDirFrom,
|
|
4
4
|
generateRuntime
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-hktq4j5r.js";
|
|
6
6
|
import {
|
|
7
7
|
loadEnvFiles,
|
|
8
8
|
reportInternalError,
|
|
@@ -13,11 +13,11 @@ import {
|
|
|
13
13
|
} from "./index.js";
|
|
14
14
|
import {
|
|
15
15
|
scanProject
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-zxd5jrgx.js";
|
|
17
17
|
import {
|
|
18
18
|
serverFeatures,
|
|
19
19
|
checkRequiredSecrets
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-gwy55cx3.js";
|
|
21
21
|
|
|
22
22
|
// src/cli/yarn-pnp.ts
|
|
23
23
|
import { existsSync } from "node:fs";
|
|
@@ -93,7 +93,7 @@ var prepareProject = async (options) => {
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
const hadErrors = reportDiagnostics(project.diagnostics, options.root);
|
|
96
|
-
const dropped = project.droppedPages > 0 ? `${project.droppedPages} page(s) failed
|
|
96
|
+
const dropped = project.droppedPages > 0 ? `${project.droppedPages} page(s) failed validation and were dropped from the site. ` : "";
|
|
97
97
|
const optIn = options.strictOptIn ?? options.mode === "dev";
|
|
98
98
|
if (hadErrors && options.strict) {
|
|
99
99
|
logger.error(`Aborting due to errors. ${dropped}Fix the diagnostics above, or ${optIn ? "drop --strict" : "pass --no-strict"} to continue despite them.`);
|
|
@@ -120,5 +120,5 @@ var prepareProject = async (options) => {
|
|
|
120
120
|
|
|
121
121
|
export { prepareProject };
|
|
122
122
|
|
|
123
|
-
//# debugId=
|
|
124
|
-
//# sourceMappingURL=chunk-
|
|
123
|
+
//# debugId=0B8AEED1A551B5FA64756E2164756E21
|
|
124
|
+
//# sourceMappingURL=chunk-t2h8pwy1.js.map
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
"sources": ["../src/cli/yarn-pnp.ts", "../src/cli/prepare.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"import { existsSync } from \"node:fs\";\n\nimport { dirname, join } from \"pathe\";\n\nimport { packageDirFrom } from \"../astro/render-deps.ts\";\nimport type { Diagnostic } from \"../core/types.ts\";\n\n/** Whether `root` or one of its ancestors holds a Yarn Plug'n'Play manifest. */\nconst hasPnpManifest = (root: string): boolean => {\n let dir = root;\n while (true) {\n if (existsSync(join(dir, \".pnp.cjs\")) || existsSync(join(dir, \".pnp.js\"))) {\n return true;\n }\n const parent = dirname(dir);\n if (parent === dir) {\n return false;\n }\n dir = parent;\n }\n};\n\n/**\n * The diagnostic for a project installed with Yarn Plug'n'Play, or null.\n *\n * Plug'n'Play installs no `node_modules`, and the Astro project Blume\n * generates in `.blume/` imports Astro and Blume's dependencies by name, which\n * only a `node_modules` tree resolves — so under PnP the build dies loading\n * `astro/config`, a failure that reads like a bug in Blume. Caught up front\n * instead: when the command runs under the PnP runtime (`process.versions.pnp`,\n * set by `yarn run`), or when a `.pnp.cjs` manifest sits in the project with no\n * `node_modules` copy of Blume beside it.\n */\nexport const yarnPnpDiagnostic = (\n root: string,\n pnpVersion: string | undefined = process.versions.pnp\n): Diagnostic | null => {\n const underPnp =\n pnpVersion !== undefined ||\n (hasPnpManifest(root) && packageDirFrom(\"blume\", root) === null);\n if (!underPnp) {\n return null;\n }\n return {\n code: \"BLUME_YARN_PNP\",\n message:\n \"Yarn Plug'n'Play isn't supported: the Astro project Blume generates in `.blume/` resolves Astro and Blume's dependencies from a `node_modules` folder, which Plug'n'Play doesn't create.\",\n severity: \"error\",\n suggestion:\n \"Add `nodeLinker: node-modules` to `.yarnrc.yml`, run `yarn install`, then run this command again.\",\n };\n};\n",
|
|
6
|
-
"import { generateRuntime } from \"../astro/generate.ts\";\nimport { BlumeError, hasErrors } from \"../core/diagnostics.ts\";\nimport { scanProject } from \"../core/project-graph.ts\";\nimport type {\n BlumeProject,\n BuildMode,\n ConfigOverrides,\n} from \"../core/project-graph.ts\";\nimport { serverFeatures } from \"../core/server-features.ts\";\nimport { loadEnvFiles } from \"./env.ts\";\nimport { reportInternalError } from \"./internal-error.ts\";\nimport { logger, reportDiagnostics } from \"./log.ts\";\nimport { checkRequiredSecrets } from \"./required-secrets.ts\";\nimport { yarnPnpDiagnostic } from \"./yarn-pnp.ts\";\n\nexport interface PrepareOptions {\n root: string;\n mode?: BuildMode;\n strict?: boolean;\n /**\n * Whether the command is strict only on request (`blume check --strict`),\n * which changes how the abort message says to continue. Defaults to true in\n * dev mode (`blume dev`, `blume sync`) and false otherwise, where strict is\n * the default a user turns off with `--no-strict` (`blume build`).\n */\n strictOptIn?: boolean;\n /** Local dev server URL, used as the `deployment.site` fallback (dev only). */\n devServerUrl?: string;\n /** Render drafts and fetch unpublished CMS content. */\n preview?: boolean;\n /** Force remote sources to re-fetch instead of serving the cached snapshot. */\n refresh?: boolean;\n /** CLI config overrides (e.g. `--output`, `--content-dir`). */\n overrides?: ConfigOverrides;\n /** Relocate the generated runtime (e.g. `.blume-verify` for `--isolated`). */\n runtimeDir?: string;\n}\n\n/**\n * Scan the project, surface diagnostics, and (re)generate the `.blume` runtime.\n * In strict mode, any error aborts. Returns the resolved project.\n */\nexport const prepareProject = async (\n options: PrepareOptions\n): Promise<BlumeProject> => {\n // Under Yarn Plug'n'Play the generated runtime can't resolve anything; say\n // so before scanning, instead of failing inside Astro's config load.\n const pnp = yarnPnpDiagnostic(options.root);\n if (pnp) {\n reportDiagnostics([pnp], options.root);\n process.exit(1);\n }\n\n // Load `.env` files from the project root before the scan: remote sources\n // read their tokens from `process.env` during `scanProject`, and\n // `loadEnvFiles` never overrides variables that are already set.\n loadEnvFiles(options.root);\n\n let project: BlumeProject;\n try {\n project = await scanProject(options.root, {\n // Fail-fast on missing secrets: warn now, not at the first request, and\n // before the sources fetch, so a source that can't authenticate on a\n // fresh build still gets its variable named.\n beforeSources: (config) => {\n reportDiagnostics(checkRequiredSecrets(config), options.root);\n },\n devServerUrl: options.devServerUrl,\n mode: options.mode,\n overrides: options.overrides,\n preview: options.preview,\n refresh: options.refresh,\n runtimeDir: options.runtimeDir,\n });\n } catch (error) {\n if (error instanceof BlumeError) {\n reportDiagnostics([error.diagnostic], options.root);\n } else {\n reportInternalError(error);\n }\n process.exit(1);\n }\n\n // Hard gate: server-only features cannot ship in a static build.\n if (\n options.mode === \"build\" &&\n project.config.deployment.options.output === \"static\"\n ) {\n const features = serverFeatures(project.config);\n if (features.length > 0) {\n // A host adapter already names the target, so only its\n // `output: \"static\"` stands in the way; otherwise name one.\n const { kind } = project.config.deployment;\n reportDiagnostics(\n [\n {\n code: \"BLUME_SERVER_FEATURE_REQUIRED\",\n message: `${features.join(\", \")} ${features.length === 1 ? \"requires\" : \"require\"} server output, but this is a static build.`,\n severity: \"error\",\n suggestion:\n kind === \"static\"\n ? 'Set deployment to a host adapter from \"blume/deploy\" in blume.config.ts, e.g. `deployment: vercel()`.'\n : `Drop \\`output: \"static\"\\` from \\`deployment: ${kind}()\\` in blume.config.ts to build for the server.`,\n },\n ],\n options.root\n );\n process.exit(1);\n }\n }\n\n const hadErrors = reportDiagnostics(project.diagnostics, options.root);\n const dropped =\n project.droppedPages > 0\n ? `${project.droppedPages} page(s) failed
|
|
6
|
+
"import { generateRuntime } from \"../astro/generate.ts\";\nimport { BlumeError, hasErrors } from \"../core/diagnostics.ts\";\nimport { scanProject } from \"../core/project-graph.ts\";\nimport type {\n BlumeProject,\n BuildMode,\n ConfigOverrides,\n} from \"../core/project-graph.ts\";\nimport { serverFeatures } from \"../core/server-features.ts\";\nimport { loadEnvFiles } from \"./env.ts\";\nimport { reportInternalError } from \"./internal-error.ts\";\nimport { logger, reportDiagnostics } from \"./log.ts\";\nimport { checkRequiredSecrets } from \"./required-secrets.ts\";\nimport { yarnPnpDiagnostic } from \"./yarn-pnp.ts\";\n\nexport interface PrepareOptions {\n root: string;\n mode?: BuildMode;\n strict?: boolean;\n /**\n * Whether the command is strict only on request (`blume check --strict`),\n * which changes how the abort message says to continue. Defaults to true in\n * dev mode (`blume dev`, `blume sync`) and false otherwise, where strict is\n * the default a user turns off with `--no-strict` (`blume build`).\n */\n strictOptIn?: boolean;\n /** Local dev server URL, used as the `deployment.site` fallback (dev only). */\n devServerUrl?: string;\n /** Render drafts and fetch unpublished CMS content. */\n preview?: boolean;\n /** Force remote sources to re-fetch instead of serving the cached snapshot. */\n refresh?: boolean;\n /** CLI config overrides (e.g. `--output`, `--content-dir`). */\n overrides?: ConfigOverrides;\n /** Relocate the generated runtime (e.g. `.blume-verify` for `--isolated`). */\n runtimeDir?: string;\n}\n\n/**\n * Scan the project, surface diagnostics, and (re)generate the `.blume` runtime.\n * In strict mode, any error aborts. Returns the resolved project.\n */\nexport const prepareProject = async (\n options: PrepareOptions\n): Promise<BlumeProject> => {\n // Under Yarn Plug'n'Play the generated runtime can't resolve anything; say\n // so before scanning, instead of failing inside Astro's config load.\n const pnp = yarnPnpDiagnostic(options.root);\n if (pnp) {\n reportDiagnostics([pnp], options.root);\n process.exit(1);\n }\n\n // Load `.env` files from the project root before the scan: remote sources\n // read their tokens from `process.env` during `scanProject`, and\n // `loadEnvFiles` never overrides variables that are already set.\n loadEnvFiles(options.root);\n\n let project: BlumeProject;\n try {\n project = await scanProject(options.root, {\n // Fail-fast on missing secrets: warn now, not at the first request, and\n // before the sources fetch, so a source that can't authenticate on a\n // fresh build still gets its variable named.\n beforeSources: (config) => {\n reportDiagnostics(checkRequiredSecrets(config), options.root);\n },\n devServerUrl: options.devServerUrl,\n mode: options.mode,\n overrides: options.overrides,\n preview: options.preview,\n refresh: options.refresh,\n runtimeDir: options.runtimeDir,\n });\n } catch (error) {\n if (error instanceof BlumeError) {\n reportDiagnostics([error.diagnostic], options.root);\n } else {\n reportInternalError(error);\n }\n process.exit(1);\n }\n\n // Hard gate: server-only features cannot ship in a static build.\n if (\n options.mode === \"build\" &&\n project.config.deployment.options.output === \"static\"\n ) {\n const features = serverFeatures(project.config);\n if (features.length > 0) {\n // A host adapter already names the target, so only its\n // `output: \"static\"` stands in the way; otherwise name one.\n const { kind } = project.config.deployment;\n reportDiagnostics(\n [\n {\n code: \"BLUME_SERVER_FEATURE_REQUIRED\",\n message: `${features.join(\", \")} ${features.length === 1 ? \"requires\" : \"require\"} server output, but this is a static build.`,\n severity: \"error\",\n suggestion:\n kind === \"static\"\n ? 'Set deployment to a host adapter from \"blume/deploy\" in blume.config.ts, e.g. `deployment: vercel()`.'\n : `Drop \\`output: \"static\"\\` from \\`deployment: ${kind}()\\` in blume.config.ts to build for the server.`,\n },\n ],\n options.root\n );\n process.exit(1);\n }\n }\n\n const hadErrors = reportDiagnostics(project.diagnostics, options.root);\n const dropped =\n project.droppedPages > 0\n ? `${project.droppedPages} page(s) failed validation and were dropped from the site. `\n : \"\";\n const optIn = options.strictOptIn ?? options.mode === \"dev\";\n if (hadErrors && options.strict) {\n logger.error(\n `Aborting due to errors. ${dropped}Fix the diagnostics above, or ${optIn ? \"drop --strict\" : \"pass --no-strict\"} to continue despite them.`\n );\n process.exit(1);\n }\n if (hasErrors(project.diagnostics) && !options.strict) {\n logger.warn(\n `Continuing despite errors. ${dropped}${optIn ? \"Pass --strict\" : \"Drop --no-strict\"} to fail instead.`\n );\n }\n\n let warnings: string[];\n try {\n ({ warnings } = await generateRuntime(project));\n } catch (error) {\n // A config error the generator raised (an unplannable `components.ts`\n // override, a missing font file) is the user's to fix, not an internal\n // failure: report the diagnostic and stop, like a scan-time error.\n if (error instanceof BlumeError) {\n reportDiagnostics([error.diagnostic], options.root);\n process.exit(1);\n }\n throw error;\n }\n for (const warning of warnings) {\n logger.warn(warning);\n }\n\n return project;\n};\n"
|
|
7
7
|
],
|
|
8
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AAMA,IAAM,iBAAiB,CAAC,SAA0B;AAAA,EAChD,IAAI,MAAM;AAAA,EACV,OAAO,MAAM;AAAA,IACX,IAAI,WAAW,KAAK,KAAK,UAAU,CAAC,KAAK,WAAW,KAAK,KAAK,SAAS,CAAC,GAAG;AAAA,MACzE,OAAO;AAAA,IACT;AAAA,IACA,MAAM,SAAS,QAAQ,GAAG;AAAA,IAC1B,IAAI,WAAW,KAAK;AAAA,MAClB,OAAO;AAAA,IACT;AAAA,IACA,MAAM;AAAA,EACR;AAAA;AAcK,IAAM,oBAAoB,CAC/B,MACA,aAAiC,QAAQ,SAAS,QAC5B;AAAA,EACtB,MAAM,WACJ,eAAe,aACd,eAAe,IAAI,KAAK,eAAe,SAAS,IAAI,MAAM;AAAA,EAC7D,IAAI,CAAC,UAAU;AAAA,IACb,OAAO;AAAA,EACT;AAAA,EACA,OAAO;AAAA,IACL,MAAM;AAAA,IACN,SACE;AAAA,IACF,UAAU;AAAA,IACV,YACE;AAAA,EACJ;AAAA;;;ACRK,IAAM,iBAAiB,OAC5B,YAC0B;AAAA,EAG1B,MAAM,MAAM,kBAAkB,QAAQ,IAAI;AAAA,EAC1C,IAAI,KAAK;AAAA,IACP,kBAAkB,CAAC,GAAG,GAAG,QAAQ,IAAI;AAAA,IACrC,QAAQ,KAAK,CAAC;AAAA,EAChB;AAAA,EAKA,aAAa,QAAQ,IAAI;AAAA,EAEzB,IAAI;AAAA,EACJ,IAAI;AAAA,IACF,UAAU,MAAM,YAAY,QAAQ,MAAM;AAAA,MAIxC,eAAe,CAAC,WAAW;AAAA,QACzB,kBAAkB,qBAAqB,MAAM,GAAG,QAAQ,IAAI;AAAA;AAAA,MAE9D,cAAc,QAAQ;A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"debugId": "0B8AEED1A551B5FA64756E2164756E21",
|
|
10
10
|
"names": []
|
|
11
11
|
}
|
|
@@ -3,12 +3,12 @@ import"./chunk-zccbjcj0.js";
|
|
|
3
3
|
import {
|
|
4
4
|
referenceSpecFiles,
|
|
5
5
|
resolveRuntimeDir
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-r5nm9w0c.js";
|
|
7
7
|
import {
|
|
8
8
|
refreshBlumeContent,
|
|
9
9
|
showBlumeErrorOverlay,
|
|
10
10
|
generateRuntime
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-hktq4j5r.js";
|
|
12
12
|
import {
|
|
13
13
|
commandMeta,
|
|
14
14
|
normalizeHost,
|
|
@@ -16,36 +16,36 @@ import {
|
|
|
16
16
|
logger,
|
|
17
17
|
reportDiagnostics
|
|
18
18
|
} from "./index.js";
|
|
19
|
-
import"./chunk-desvm72z.js";
|
|
20
19
|
import {
|
|
21
20
|
scanProject
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import"./chunk-
|
|
24
|
-
import"./chunk-
|
|
21
|
+
} from "./chunk-zxd5jrgx.js";
|
|
22
|
+
import"./chunk-b680sv30.js";
|
|
23
|
+
import"./chunk-rtvgmg2j.js";
|
|
24
|
+
import"./chunk-j4nfgn2j.js";
|
|
25
25
|
import"./chunk-jq5n4avg.js";
|
|
26
|
-
import"./chunk-
|
|
27
|
-
import"./chunk-
|
|
28
|
-
import"./chunk-
|
|
26
|
+
import"./chunk-487b95qy.js";
|
|
27
|
+
import"./chunk-k45sq16q.js";
|
|
28
|
+
import"./chunk-9h8mh2tk.js";
|
|
29
|
+
import {
|
|
30
|
+
refuseIfEjected
|
|
31
|
+
} from "./chunk-e1n41w9m.js";
|
|
29
32
|
import {
|
|
30
33
|
parsePort
|
|
31
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-fnxgtjeq.js";
|
|
32
35
|
import {
|
|
33
36
|
astroBuildDiagnostics
|
|
34
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-4zxh25hc.js";
|
|
35
38
|
import {
|
|
36
39
|
DevLockHeldError,
|
|
37
40
|
acquireDevLock,
|
|
38
41
|
updateDevLockPort,
|
|
39
42
|
describeDevLock
|
|
40
|
-
} from "./chunk-
|
|
41
|
-
import {
|
|
42
|
-
refuseIfEjected
|
|
43
|
-
} from "./chunk-53jqw8z0.js";
|
|
43
|
+
} from "./chunk-h0qwdbem.js";
|
|
44
44
|
import {
|
|
45
45
|
prepareProject
|
|
46
|
-
} from "./chunk-
|
|
47
|
-
import"./chunk-
|
|
48
|
-
import"./chunk-
|
|
46
|
+
} from "./chunk-t2h8pwy1.js";
|
|
47
|
+
import"./chunk-gwy55cx3.js";
|
|
48
|
+
import"./chunk-q1wwrxzw.js";
|
|
49
49
|
|
|
50
50
|
// src/cli/commands/dev.ts
|
|
51
51
|
import { dev } from "astro";
|
|
@@ -127,7 +127,7 @@ var devCommand = defineCommand({
|
|
|
127
127
|
if (error instanceof BlumeError || !(error instanceof Error)) {
|
|
128
128
|
throw error;
|
|
129
129
|
}
|
|
130
|
-
reportDiagnostics(astroBuildDiagnostics(error), root);
|
|
130
|
+
reportDiagnostics(await astroBuildDiagnostics(error, { root }), root);
|
|
131
131
|
process.exit(1);
|
|
132
132
|
}
|
|
133
133
|
const boundPort = boundPortOf(server, port);
|
|
@@ -199,5 +199,5 @@ export {
|
|
|
199
199
|
devCommand
|
|
200
200
|
};
|
|
201
201
|
|
|
202
|
-
//# debugId=
|
|
203
|
-
//# sourceMappingURL=chunk-
|
|
202
|
+
//# debugId=69D928DFB8AB7AAA64756E2164756E21
|
|
203
|
+
//# sourceMappingURL=chunk-x60e15st.js.map
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/cli/commands/dev.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
|
-
"import { dev } from \"astro\";\nimport { watch } from \"chokidar\";\nimport { defineCommand } from \"citty\";\nimport { debounce } from \"perfect-debounce\";\n\nimport { generateRuntime } from \"../../astro/generate.ts\";\nimport {\n refreshBlumeContent,\n showBlumeErrorOverlay,\n} from \"../../astro/integration.ts\";\nimport { BlumeError } from \"../../core/diagnostics.ts\";\nimport { scanProject } from \"../../core/project-graph.ts\";\nimport { resolveRuntimeDir } from \"../../core/project.ts\";\nimport { referenceSpecFiles } from \"../../openapi/references.ts\";\nimport { parsePort } from \"../args.ts\";\nimport { astroBuildDiagnostics } from \"../build-failure.ts\";\nimport { commandMeta } from \"../command-meta.ts\";\nimport {\n acquireDevLock,\n describeDevLock,\n DevLockHeldError,\n updateDevLockPort,\n} from \"../dev-lock.ts\";\nimport { refuseIfEjected } from \"../eject-scripts.ts\";\nimport { normalizeHost } from \"../host-args.ts\";\nimport { logger, reportDiagnostics } from \"../log.ts\";\nimport { prepareProject } from \"../prepare.ts\";\n\n/**\n * A fingerprint of the route set: the sorted `path entryId` pairs. It changes\n * when a page is added, removed, or renamed (a folder rename shifts many at\n * once) but stays equal across pure body edits — so the dev loop can tell a\n * \"structural\" change (needs a content re-sync) from a hot-reloadable one.\n */\nconst routeSignature = (\n routes: readonly { entryId: string; path: string }[]\n): string =>\n routes\n .map((route) => `${route.path} ${route.entryId}`)\n .toSorted()\n .join(\"\\n\");\n\n/**\n * The port the dev server actually bound. Astro snapshots `address` when the\n * server first listens, but a config restart that lands during startup leaves\n * that snapshot null: the `astro.config.mjs` written just before the server\n * started can reach Astro's watcher late, and Astro restarts in place before\n * it ever listens. The live resolved URLs follow the restarted server, so read\n * the port from those, then fall back to the one that was asked for.\n */\nconst boundPortOf = (\n server: Awaited<ReturnType<typeof dev>>,\n requested: number\n): number => {\n // SAFETY: Astro types `address` as always set, but it is null at runtime\n // when a restart replaced the server before its first listen (see above).\n const address = server.address as typeof server.address | null;\n if (address) {\n return address.port;\n }\n for (const url of server.resolvedUrls.local) {\n const port = Number(new URL(url).port);\n if (port > 0) {\n return port;\n }\n }\n return requested;\n};\n\nexport const devCommand = defineCommand({\n args: {\n \"content-dir\": {\n description: \"Content folder to scan, overriding config (content.root).\",\n type: \"string\",\n },\n debug: {\n description: \"Verbose Astro/Vite logging for troubleshooting.\",\n type: \"boolean\",\n },\n host: { description: \"Network host to bind.\", type: \"string\" },\n open: { description: \"Open the browser on start.\", type: \"boolean\" },\n port: { description: \"Port to listen on.\", type: \"string\" },\n preview: {\n description: \"Include drafts and unpublished CMS content.\",\n type: \"boolean\",\n },\n strict: { description: \"Fail on diagnostics.\", type: \"boolean\" },\n },\n meta: commandMeta.dev,\n async run({ args }) {\n const root = process.cwd();\n await refuseIfEjected(root, \"dev\");\n const preview = args.preview ?? false;\n const overrides = args[\"content-dir\"]\n ? { contentRoot: args[\"content-dir\"] }\n : undefined;\n // Astro's dev server defaults to 4321 when no port is passed. Feeding the\n // resolved URL in as the `deployment.site` fallback lets site-gated features\n // (OG images, canonicals, sitemap) work locally without configuring a site.\n const explicitPort = parsePort(args.port);\n const port = explicitPort ?? 4321;\n let devServerUrl = `http://localhost:${port}`;\n\n // Claim the shared `.blume` dir BEFORE preparing: `prepareProject`\n // regenerates the runtime, so even a refused second dev server would\n // otherwise clobber the running one's generated tree (with this\n // invocation's port baked in) on its way out. The claim is atomic, so two\n // simultaneous starts can't both win. Dev never relocates the runtime dir,\n // so the lock always lives at `<root>/.blume`.\n const outDir = resolveRuntimeDir(root);\n let releaseLock: () => void;\n try {\n releaseLock = acquireDevLock(outDir, port);\n } catch (error) {\n if (error instanceof DevLockHeldError) {\n logger.error(\n `A \\`blume dev\\` server is already running${describeDevLock(error.lock)} in this project. Reuse that server instead of starting a second one — two dev servers would corrupt the shared .blume dir. If it crashed, delete .blume/dev.lock.`\n );\n process.exit(1);\n }\n throw error;\n }\n process.on(\"exit\", releaseLock);\n\n const project = await prepareProject({\n devServerUrl,\n mode: \"dev\",\n overrides,\n preview,\n root,\n strict: args.strict,\n });\n\n // A factory so the regenerate loop can recreate the server when a\n // structural (route-set) change can't be re-synced in place (see below).\n // `open` is honored on first boot only — a restart must not reopen the\n // browser.\n const createServer = (listenPort: number | undefined, open: boolean) =>\n dev({\n logLevel: args.debug ? \"debug\" : \"info\",\n root: project.context.outDir,\n server: { host: normalizeHost(args.host), open, port: listenPort },\n });\n\n let server: Awaited<ReturnType<typeof createServer>>;\n try {\n server = await createServer(explicitPort, args.open ?? false);\n } catch (error) {\n // Astro's first content sync rejects on a page it can't load (front\n // matter that isn't valid YAML): report it at the file it names, as\n // `blume build` does, not as an internal error blaming Blume.\n if (error instanceof BlumeError || !(error instanceof Error)) {\n throw error;\n }\n reportDiagnostics(astroBuildDiagnostics(error), root);\n process.exit(1);\n }\n\n // Vite bumps to the next free port when the default is taken, so record\n // the port the server actually bound — the lock's URL is what a refused\n // second invocation tells its caller to reuse. The site fallback baked\n // into the runtime also carries the port, so it must follow suit (below,\n // once the regeneration closure exists).\n const boundPort = boundPortOf(server, port);\n if (boundPort !== port) {\n updateDevLockPort(outDir, boundPort);\n devServerUrl = `http://localhost:${boundPort}`;\n }\n\n // Mirror any initial diagnostics into the browser overlay now the server\n // (and its HMR channel) is up.\n showBlumeErrorOverlay(project.diagnostics);\n\n let lastSignature = routeSignature(project.manifest.routes);\n\n // Watch user inputs and regenerate the runtime data on change. A body edit\n // hot-reloads via Vite (fast path). A route-set change also needs Astro's\n // content store re-synced: its glob watcher misses directory renames, so a\n // renamed page would 404 (`getEntry` reads a stale store). Astro hands the\n // integration `refreshContent` for exactly that — a full loader run\n // against the live server, after which Astro's own store watcher clears\n // the route cache and reloads the browser. Only a server that registered\n // no refresh (none since Astro 5) falls back to a cold restart: stop,\n // then bring up a fresh container whose cold sync re-globs everything.\n // perfect-debounce both debounces the watch burst (80ms) and\n // single-flights the scan: a\n // trigger during a run never starts a second run, only marks one trailing\n // rerun after the current settles. Both halves are load-bearing — a plain\n // debounce once let bursts stack overlapping scans until the heap was\n // exhausted (observed as an OOM after minutes of looping). The contract is\n // pinned by test/dev-debounce.test.ts. The task must not reject (the\n // library re-invokes it from an unhandled .finally), so the body catches\n // its own errors and always resolves.\n const regenerate = debounce(async () => {\n try {\n const next = await scanProject(root, {\n devServerUrl,\n mode: \"dev\",\n overrides,\n preview,\n });\n const nextSignature = routeSignature(next.manifest.routes);\n const structural = nextSignature !== lastSignature;\n // Generate first: the new runtime data (and any staged remote content)\n // is on disk and published before the store re-syncs against it.\n await generateRuntime(next);\n if (structural && !(await refreshBlumeContent())) {\n await server.stop();\n server = await createServer(boundPort, false);\n }\n // Commit the signature only after the (re)generation succeeded. If the\n // re-sync or restart above throws mid-sequence, the signature stays\n // stale so the next watch event retries the structural path.\n lastSignature = nextSignature;\n // Surface any content/config errors in the terminal AND the browser\n // overlay. The terminal report is not redundant: the overlay only\n // shows once the browser has connected, and it clears on the next HMR\n // update.\n reportDiagnostics(next.diagnostics, root);\n showBlumeErrorOverlay(next.diagnostics);\n } catch (error) {\n // A config error the generator raised (an unplannable `components.ts`\n // override, a missing font file) is a diagnostic: report it in the\n // terminal and the browser overlay like a scan-time error, so the fix\n // is visible where the edit happened.\n if (error instanceof BlumeError) {\n reportDiagnostics([error.diagnostic], root);\n showBlumeErrorOverlay([error.diagnostic]);\n return;\n }\n // SAFETY: regeneration failures come from the generator and Astro's\n // server API, which raise Error instances; only the message is shown.\n logger.error(`Regeneration failed: ${(error as Error).message}`);\n }\n }, 80);\n\n // The runtime prepared above baked the *requested* port into the site\n // fallback; if Vite bumped it, regenerate so OG images, canonicals, and\n // other site-gated URLs point at the port actually serving.\n if (boundPort !== port) {\n void regenerate();\n }\n\n // Content is watched per source (filesystem uses fs.watch; remote sources\n // are frozen for the session). The remaining project inputs — user pages,\n // config, theme, component overrides, and the local specs and overlays API\n // references read — are watched directly.\n const dirTargets = [project.context.pagesRoot].filter(\n (target) => target !== null\n );\n const fileTargets = [\n project.context.configFile,\n project.context.themeFile,\n project.context.componentsFile,\n ...referenceSpecFiles(project.config, root),\n ].filter((target) => target !== null);\n\n // chokidar handles what raw fs.watch made us hand-roll: recursive\n // directory watching on every platform, and single files surviving a\n // rename-replace save (vim and most \"atomic save\" editors), which orphans\n // an inode-tracking fs.watch watcher after the first write.\n const projectWatcher = watch([...dirTargets, ...fileTargets], {\n ignoreInitial: true,\n }).on(\"all\", regenerate);\n const disposers = [\n ...project.sources.map((source) => source.watch?.(regenerate)),\n () => {\n void projectWatcher.close();\n },\n ].filter((dispose) => dispose !== undefined);\n\n const shutdown = async () => {\n for (const dispose of disposers) {\n dispose();\n }\n releaseLock();\n await server.stop();\n process.exit(0);\n };\n\n process.on(\"SIGINT\", shutdown);\n process.on(\"SIGTERM\", shutdown);\n },\n});\n"
|
|
5
|
+
"import { dev } from \"astro\";\nimport { watch } from \"chokidar\";\nimport { defineCommand } from \"citty\";\nimport { debounce } from \"perfect-debounce\";\n\nimport { generateRuntime } from \"../../astro/generate.ts\";\nimport {\n refreshBlumeContent,\n showBlumeErrorOverlay,\n} from \"../../astro/integration.ts\";\nimport { BlumeError } from \"../../core/diagnostics.ts\";\nimport { scanProject } from \"../../core/project-graph.ts\";\nimport { resolveRuntimeDir } from \"../../core/project.ts\";\nimport { referenceSpecFiles } from \"../../openapi/references.ts\";\nimport { parsePort } from \"../args.ts\";\nimport { astroBuildDiagnostics } from \"../build-failure.ts\";\nimport { commandMeta } from \"../command-meta.ts\";\nimport {\n acquireDevLock,\n describeDevLock,\n DevLockHeldError,\n updateDevLockPort,\n} from \"../dev-lock.ts\";\nimport { refuseIfEjected } from \"../eject-scripts.ts\";\nimport { normalizeHost } from \"../host-args.ts\";\nimport { logger, reportDiagnostics } from \"../log.ts\";\nimport { prepareProject } from \"../prepare.ts\";\n\n/**\n * A fingerprint of the route set: the sorted `path entryId` pairs. It changes\n * when a page is added, removed, or renamed (a folder rename shifts many at\n * once) but stays equal across pure body edits — so the dev loop can tell a\n * \"structural\" change (needs a content re-sync) from a hot-reloadable one.\n */\nconst routeSignature = (\n routes: readonly { entryId: string; path: string }[]\n): string =>\n routes\n .map((route) => `${route.path} ${route.entryId}`)\n .toSorted()\n .join(\"\\n\");\n\n/**\n * The port the dev server actually bound. Astro snapshots `address` when the\n * server first listens, but a config restart that lands during startup leaves\n * that snapshot null: the `astro.config.mjs` written just before the server\n * started can reach Astro's watcher late, and Astro restarts in place before\n * it ever listens. The live resolved URLs follow the restarted server, so read\n * the port from those, then fall back to the one that was asked for.\n */\nconst boundPortOf = (\n server: Awaited<ReturnType<typeof dev>>,\n requested: number\n): number => {\n // SAFETY: Astro types `address` as always set, but it is null at runtime\n // when a restart replaced the server before its first listen (see above).\n const address = server.address as typeof server.address | null;\n if (address) {\n return address.port;\n }\n for (const url of server.resolvedUrls.local) {\n const port = Number(new URL(url).port);\n if (port > 0) {\n return port;\n }\n }\n return requested;\n};\n\nexport const devCommand = defineCommand({\n args: {\n \"content-dir\": {\n description: \"Content folder to scan, overriding config (content.root).\",\n type: \"string\",\n },\n debug: {\n description: \"Verbose Astro/Vite logging for troubleshooting.\",\n type: \"boolean\",\n },\n host: { description: \"Network host to bind.\", type: \"string\" },\n open: { description: \"Open the browser on start.\", type: \"boolean\" },\n port: { description: \"Port to listen on.\", type: \"string\" },\n preview: {\n description: \"Include drafts and unpublished CMS content.\",\n type: \"boolean\",\n },\n strict: { description: \"Fail on diagnostics.\", type: \"boolean\" },\n },\n meta: commandMeta.dev,\n async run({ args }) {\n const root = process.cwd();\n await refuseIfEjected(root, \"dev\");\n const preview = args.preview ?? false;\n const overrides = args[\"content-dir\"]\n ? { contentRoot: args[\"content-dir\"] }\n : undefined;\n // Astro's dev server defaults to 4321 when no port is passed. Feeding the\n // resolved URL in as the `deployment.site` fallback lets site-gated features\n // (OG images, canonicals, sitemap) work locally without configuring a site.\n const explicitPort = parsePort(args.port);\n const port = explicitPort ?? 4321;\n let devServerUrl = `http://localhost:${port}`;\n\n // Claim the shared `.blume` dir BEFORE preparing: `prepareProject`\n // regenerates the runtime, so even a refused second dev server would\n // otherwise clobber the running one's generated tree (with this\n // invocation's port baked in) on its way out. The claim is atomic, so two\n // simultaneous starts can't both win. Dev never relocates the runtime dir,\n // so the lock always lives at `<root>/.blume`.\n const outDir = resolveRuntimeDir(root);\n let releaseLock: () => void;\n try {\n releaseLock = acquireDevLock(outDir, port);\n } catch (error) {\n if (error instanceof DevLockHeldError) {\n logger.error(\n `A \\`blume dev\\` server is already running${describeDevLock(error.lock)} in this project. Reuse that server instead of starting a second one — two dev servers would corrupt the shared .blume dir. If it crashed, delete .blume/dev.lock.`\n );\n process.exit(1);\n }\n throw error;\n }\n process.on(\"exit\", releaseLock);\n\n const project = await prepareProject({\n devServerUrl,\n mode: \"dev\",\n overrides,\n preview,\n root,\n strict: args.strict,\n });\n\n // A factory so the regenerate loop can recreate the server when a\n // structural (route-set) change can't be re-synced in place (see below).\n // `open` is honored on first boot only — a restart must not reopen the\n // browser.\n const createServer = (listenPort: number | undefined, open: boolean) =>\n dev({\n logLevel: args.debug ? \"debug\" : \"info\",\n root: project.context.outDir,\n server: { host: normalizeHost(args.host), open, port: listenPort },\n });\n\n let server: Awaited<ReturnType<typeof createServer>>;\n try {\n server = await createServer(explicitPort, args.open ?? false);\n } catch (error) {\n // Astro's first content sync rejects on a page it can't load (front\n // matter that isn't valid YAML): report it at the file it names, as\n // `blume build` does, not as an internal error blaming Blume.\n if (error instanceof BlumeError || !(error instanceof Error)) {\n throw error;\n }\n reportDiagnostics(await astroBuildDiagnostics(error, { root }), root);\n process.exit(1);\n }\n\n // Vite bumps to the next free port when the default is taken, so record\n // the port the server actually bound — the lock's URL is what a refused\n // second invocation tells its caller to reuse. The site fallback baked\n // into the runtime also carries the port, so it must follow suit (below,\n // once the regeneration closure exists).\n const boundPort = boundPortOf(server, port);\n if (boundPort !== port) {\n updateDevLockPort(outDir, boundPort);\n devServerUrl = `http://localhost:${boundPort}`;\n }\n\n // Mirror any initial diagnostics into the browser overlay now the server\n // (and its HMR channel) is up.\n showBlumeErrorOverlay(project.diagnostics);\n\n let lastSignature = routeSignature(project.manifest.routes);\n\n // Watch user inputs and regenerate the runtime data on change. A body edit\n // hot-reloads via Vite (fast path). A route-set change also needs Astro's\n // content store re-synced: its glob watcher misses directory renames, so a\n // renamed page would 404 (`getEntry` reads a stale store). Astro hands the\n // integration `refreshContent` for exactly that — a full loader run\n // against the live server, after which Astro's own store watcher clears\n // the route cache and reloads the browser. Only a server that registered\n // no refresh (none since Astro 5) falls back to a cold restart: stop,\n // then bring up a fresh container whose cold sync re-globs everything.\n // perfect-debounce both debounces the watch burst (80ms) and\n // single-flights the scan: a\n // trigger during a run never starts a second run, only marks one trailing\n // rerun after the current settles. Both halves are load-bearing — a plain\n // debounce once let bursts stack overlapping scans until the heap was\n // exhausted (observed as an OOM after minutes of looping). The contract is\n // pinned by test/dev-debounce.test.ts. The task must not reject (the\n // library re-invokes it from an unhandled .finally), so the body catches\n // its own errors and always resolves.\n const regenerate = debounce(async () => {\n try {\n const next = await scanProject(root, {\n devServerUrl,\n mode: \"dev\",\n overrides,\n preview,\n });\n const nextSignature = routeSignature(next.manifest.routes);\n const structural = nextSignature !== lastSignature;\n // Generate first: the new runtime data (and any staged remote content)\n // is on disk and published before the store re-syncs against it.\n await generateRuntime(next);\n if (structural && !(await refreshBlumeContent())) {\n await server.stop();\n server = await createServer(boundPort, false);\n }\n // Commit the signature only after the (re)generation succeeded. If the\n // re-sync or restart above throws mid-sequence, the signature stays\n // stale so the next watch event retries the structural path.\n lastSignature = nextSignature;\n // Surface any content/config errors in the terminal AND the browser\n // overlay. The terminal report is not redundant: the overlay only\n // shows once the browser has connected, and it clears on the next HMR\n // update.\n reportDiagnostics(next.diagnostics, root);\n showBlumeErrorOverlay(next.diagnostics);\n } catch (error) {\n // A config error the generator raised (an unplannable `components.ts`\n // override, a missing font file) is a diagnostic: report it in the\n // terminal and the browser overlay like a scan-time error, so the fix\n // is visible where the edit happened.\n if (error instanceof BlumeError) {\n reportDiagnostics([error.diagnostic], root);\n showBlumeErrorOverlay([error.diagnostic]);\n return;\n }\n // SAFETY: regeneration failures come from the generator and Astro's\n // server API, which raise Error instances; only the message is shown.\n logger.error(`Regeneration failed: ${(error as Error).message}`);\n }\n }, 80);\n\n // The runtime prepared above baked the *requested* port into the site\n // fallback; if Vite bumped it, regenerate so OG images, canonicals, and\n // other site-gated URLs point at the port actually serving.\n if (boundPort !== port) {\n void regenerate();\n }\n\n // Content is watched per source (filesystem uses fs.watch; remote sources\n // are frozen for the session). The remaining project inputs — user pages,\n // config, theme, component overrides, and the local specs and overlays API\n // references read — are watched directly.\n const dirTargets = [project.context.pagesRoot].filter(\n (target) => target !== null\n );\n const fileTargets = [\n project.context.configFile,\n project.context.themeFile,\n project.context.componentsFile,\n ...referenceSpecFiles(project.config, root),\n ].filter((target) => target !== null);\n\n // chokidar handles what raw fs.watch made us hand-roll: recursive\n // directory watching on every platform, and single files surviving a\n // rename-replace save (vim and most \"atomic save\" editors), which orphans\n // an inode-tracking fs.watch watcher after the first write.\n const projectWatcher = watch([...dirTargets, ...fileTargets], {\n ignoreInitial: true,\n }).on(\"all\", regenerate);\n const disposers = [\n ...project.sources.map((source) => source.watch?.(regenerate)),\n () => {\n void projectWatcher.close();\n },\n ].filter((dispose) => dispose !== undefined);\n\n const shutdown = async () => {\n for (const dispose of disposers) {\n dispose();\n }\n releaseLock();\n await server.stop();\n process.exit(0);\n };\n\n process.on(\"SIGINT\", shutdown);\n process.on(\"SIGTERM\", shutdown);\n },\n});\n"
|
|
6
6
|
],
|
|
7
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AA+BA,IAAM,iBAAiB,CACrB,WAEA,OACG,IAAI,CAAC,UAAU,GAAG,MAAM,QAAQ,MAAM,SAAS,EAC/C,SAAS,EACT,KAAK;AAAA,CAAI;AAUd,IAAM,cAAc,CAClB,QACA,cACW;AAAA,EAGX,MAAM,UAAU,OAAO;AAAA,EACvB,IAAI,SAAS;AAAA,IACX,OAAO,QAAQ;AAAA,EACjB;AAAA,EACA,WAAW,OAAO,OAAO,aAAa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|
|
8
|
+
"debugId": "69D928DFB8AB7AAA64756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
loadConfig
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-r5nm9w0c.js";
|
|
5
5
|
import"./chunk-zccbjcj0.js";
|
|
6
6
|
import {
|
|
7
7
|
commandMeta,
|
|
@@ -11,11 +11,11 @@ import {
|
|
|
11
11
|
reportDiagnostics
|
|
12
12
|
} from "./index.js";
|
|
13
13
|
import"./chunk-jq5n4avg.js";
|
|
14
|
-
import"./chunk-
|
|
14
|
+
import"./chunk-zxd5jrgx.js";
|
|
15
15
|
import {
|
|
16
16
|
CutError,
|
|
17
17
|
cutVersion
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-kmswjxj9.js";
|
|
19
19
|
|
|
20
20
|
// src/cli/commands/version.ts
|
|
21
21
|
import { defineCommand } from "citty";
|
|
@@ -88,4 +88,4 @@ export {
|
|
|
88
88
|
};
|
|
89
89
|
|
|
90
90
|
//# debugId=86F69482E9E3E55264756E2164756E21
|
|
91
|
-
//# sourceMappingURL=chunk-
|
|
91
|
+
//# sourceMappingURL=chunk-x7bh6d9j.js.map
|
|
@@ -10,12 +10,12 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
AGENTS,
|
|
12
12
|
launchInstalledAgent
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import"./chunk-
|
|
13
|
+
} from "./chunk-aafhwx74.js";
|
|
14
|
+
import"./chunk-j4nfgn2j.js";
|
|
15
15
|
import {
|
|
16
16
|
commandsFor,
|
|
17
17
|
detectProjectPackageManager
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-r5nm9w0c.js";
|
|
19
19
|
import"./chunk-zccbjcj0.js";
|
|
20
20
|
import {
|
|
21
21
|
UPGRADE_GUIDE_URL,
|
|
@@ -25,10 +25,10 @@ import {
|
|
|
25
25
|
isOutsideBlumeProject,
|
|
26
26
|
collectUpgradeFindings,
|
|
27
27
|
upgradePrompt
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-34wap3ed.js";
|
|
29
29
|
import {
|
|
30
30
|
installDependencies
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-gxhcf2hs.js";
|
|
32
32
|
|
|
33
33
|
// src/cli/commands/upgrade.ts
|
|
34
34
|
import { defineCommand } from "citty";
|
|
@@ -138,4 +138,4 @@ export {
|
|
|
138
138
|
};
|
|
139
139
|
|
|
140
140
|
//# debugId=38BC7BC8832D718964756E2164756E21
|
|
141
|
-
//# sourceMappingURL=chunk-
|
|
141
|
+
//# sourceMappingURL=chunk-ydqzkhjn.js.map
|