blume 1.7.3 → 2.0.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.
Files changed (690) hide show
  1. package/AGENTS.md +19 -0
  2. package/CHANGELOG.md +245 -0
  3. package/README.md +34 -21
  4. package/dist/cli/{chunk-vacwm2hv.js → chunk-27g6wdth.js} +2 -2
  5. package/dist/cli/{chunk-ps4m1xh4.js → chunk-2hn4b8z7.js} +513 -550
  6. package/dist/cli/chunk-2hn4b8z7.js.map +12 -0
  7. package/dist/cli/chunk-5shv93fd.js +39 -0
  8. package/dist/cli/chunk-5shv93fd.js.map +10 -0
  9. package/dist/cli/chunk-6crbhc3x.js +361 -0
  10. package/dist/cli/chunk-6crbhc3x.js.map +14 -0
  11. package/dist/cli/{chunk-8cjtbafj.js → chunk-6hsn950k.js} +109 -383
  12. package/dist/cli/chunk-6hsn950k.js.map +10 -0
  13. package/dist/cli/chunk-6vm74dry.js +148 -0
  14. package/dist/cli/chunk-6vm74dry.js.map +10 -0
  15. package/dist/cli/{chunk-yg63d42r.js → chunk-79jhk4py.js} +87 -58
  16. package/dist/cli/chunk-79jhk4py.js.map +35 -0
  17. package/dist/cli/chunk-82bbrxdn.js +51 -0
  18. package/dist/cli/chunk-82bbrxdn.js.map +10 -0
  19. package/dist/cli/chunk-abh8yjkn.js +31 -0
  20. package/dist/cli/chunk-abh8yjkn.js.map +10 -0
  21. package/dist/cli/chunk-ah61y8py.js +75 -0
  22. package/dist/cli/chunk-ah61y8py.js.map +11 -0
  23. package/dist/cli/{chunk-dwgcp5sm.js → chunk-ce574jw2.js} +1 -1
  24. package/dist/cli/chunk-ch6g3ar0.js +102 -0
  25. package/dist/cli/chunk-ch6g3ar0.js.map +10 -0
  26. package/dist/cli/chunk-dh8cwk36.js +279 -0
  27. package/dist/cli/chunk-dh8cwk36.js.map +10 -0
  28. package/dist/cli/{chunk-rqy0s5wh.js → chunk-epjnccmv.js} +17 -16
  29. package/dist/cli/{chunk-rqy0s5wh.js.map → chunk-epjnccmv.js.map} +3 -3
  30. package/dist/cli/chunk-f2z5v128.js +97 -0
  31. package/dist/cli/chunk-f2z5v128.js.map +10 -0
  32. package/dist/cli/{chunk-2z47ypj8.js → chunk-fa25z98p.js} +16 -3
  33. package/dist/cli/chunk-fa25z98p.js.map +11 -0
  34. package/dist/cli/{chunk-1jefwnfs.js → chunk-fs23ddbb.js} +1076 -2592
  35. package/dist/cli/chunk-fs23ddbb.js.map +35 -0
  36. package/dist/cli/{chunk-e7f42gdj.js → chunk-fxypxtvm.js} +2 -2
  37. package/dist/cli/{chunk-bvwwhd84.js → chunk-fz5wtpmh.js} +15 -15
  38. package/dist/cli/{chunk-bvwwhd84.js.map → chunk-fz5wtpmh.js.map} +1 -1
  39. package/dist/cli/chunk-hdpx1tax.js +91 -0
  40. package/dist/cli/chunk-hdpx1tax.js.map +10 -0
  41. package/dist/cli/{chunk-ct47dqpx.js → chunk-jts8mvcz.js} +67 -7
  42. package/dist/cli/{chunk-2mzebbbz.js.map → chunk-jts8mvcz.js.map} +6 -4
  43. package/dist/cli/{chunk-ahnw3kxw.js → chunk-jwyddg7y.js} +27 -22
  44. package/dist/cli/chunk-jwyddg7y.js.map +15 -0
  45. package/dist/cli/{chunk-cjtn640a.js → chunk-kdp5q7ke.js} +43 -20
  46. package/dist/cli/chunk-kdp5q7ke.js.map +10 -0
  47. package/dist/cli/{chunk-5g0w1e2c.js → chunk-kpf8rrjc.js} +28 -16
  48. package/dist/cli/{chunk-5g0w1e2c.js.map → chunk-kpf8rrjc.js.map} +4 -4
  49. package/dist/cli/chunk-m3vmjgmq.js +133 -0
  50. package/dist/cli/chunk-m3vmjgmq.js.map +10 -0
  51. package/dist/cli/{chunk-b27xqwn9.js → chunk-mb2919y2.js} +9 -5
  52. package/dist/cli/chunk-mb2919y2.js.map +10 -0
  53. package/dist/cli/{chunk-5qk08vmp.js → chunk-q5163e60.js} +133 -54
  54. package/dist/cli/chunk-q5163e60.js.map +11 -0
  55. package/dist/cli/chunk-qkqwkpte.js +12437 -0
  56. package/dist/cli/chunk-qkqwkpte.js.map +182 -0
  57. package/dist/cli/{chunk-4x36ddpw.js → chunk-qs4q5p4e.js} +81 -87
  58. package/dist/cli/chunk-qs4q5p4e.js.map +10 -0
  59. package/dist/cli/{chunk-0xjyb285.js → chunk-qwsrynx5.js} +15 -5
  60. package/dist/cli/{chunk-0xjyb285.js.map → chunk-qwsrynx5.js.map} +4 -4
  61. package/dist/cli/chunk-s1p84fyh.js +261 -0
  62. package/dist/cli/chunk-s1p84fyh.js.map +10 -0
  63. package/dist/cli/chunk-s6jhgk0q.js +176 -0
  64. package/dist/cli/chunk-s6jhgk0q.js.map +11 -0
  65. package/dist/cli/chunk-vtk4a6dg.js +374 -0
  66. package/dist/cli/chunk-vtk4a6dg.js.map +10 -0
  67. package/dist/cli/{chunk-k79xp7av.js → chunk-wgm7m9qk.js} +230 -700
  68. package/dist/cli/chunk-wgm7m9qk.js.map +36 -0
  69. package/dist/cli/chunk-wm7js3j9.js +145 -0
  70. package/dist/cli/chunk-wm7js3j9.js.map +11 -0
  71. package/dist/cli/chunk-yt5n7ppj.js +79 -0
  72. package/dist/cli/chunk-yt5n7ppj.js.map +10 -0
  73. package/dist/cli/{chunk-3r45185y.js → chunk-yw7dm696.js} +9 -11
  74. package/dist/cli/{chunk-3r45185y.js.map → chunk-yw7dm696.js.map} +3 -3
  75. package/dist/cli/{chunk-nn13znc2.js → chunk-zxcczpyx.js} +1 -1
  76. package/dist/cli/chunk-zxh4d9vy.js +122 -0
  77. package/dist/cli/chunk-zxh4d9vy.js.map +11 -0
  78. package/dist/cli/index.js +214 -57
  79. package/dist/cli/index.js.map +8 -7
  80. package/dist/types/ai/agent-readability.d.ts +52 -0
  81. package/dist/types/ai/ai-catalog.d.ts +42 -0
  82. package/dist/types/ai/api/paths.d.ts +17 -0
  83. package/dist/types/ai/api-catalog.d.ts +18 -0
  84. package/dist/types/ai/ask-context.d.ts +7 -7
  85. package/dist/types/ai/ask.d.ts +368 -0
  86. package/dist/types/ai/changelog-markdown.d.ts +2 -0
  87. package/dist/types/ai/component-markdown.d.ts +2 -2
  88. package/dist/types/ai/index.d.ts +24 -0
  89. package/dist/types/ai/link-headers.d.ts +24 -0
  90. package/dist/types/ai/llms.d.ts +25 -0
  91. package/dist/types/ai/markdown.d.ts +45 -0
  92. package/dist/types/ai/mcp/discovery.d.ts +68 -0
  93. package/dist/types/ai/mcp/tools.d.ts +16 -0
  94. package/dist/types/ai/openapi-components.d.ts +43 -0
  95. package/dist/types/ai/relative-links.d.ts +26 -0
  96. package/dist/types/ai/serializers.d.ts +15 -0
  97. package/dist/types/ai/skills.d.ts +42 -0
  98. package/dist/types/ai/tar.d.ts +25 -0
  99. package/dist/types/ai/visibility.d.ts +17 -0
  100. package/dist/types/ai/web-bot-auth.d.ts +16 -0
  101. package/dist/types/analytics/adobe.d.ts +35 -0
  102. package/dist/types/analytics/amplitude.d.ts +50 -0
  103. package/dist/types/analytics/clarity.d.ts +31 -0
  104. package/dist/types/analytics/clearbit.d.ts +29 -0
  105. package/dist/types/analytics/cloudflare.d.ts +41 -0
  106. package/dist/types/analytics/fathom.d.ts +41 -0
  107. package/dist/types/analytics/google-analytics.d.ts +44 -0
  108. package/dist/types/analytics/google-tag-manager.d.ts +40 -0
  109. package/dist/types/analytics/head.d.ts +30 -0
  110. package/dist/types/analytics/heap.d.ts +40 -0
  111. package/dist/types/analytics/hightouch.d.ts +44 -0
  112. package/dist/types/analytics/hotjar.d.ts +33 -0
  113. package/dist/types/analytics/index.d.ts +61 -0
  114. package/dist/types/analytics/inline.d.ts +17 -0
  115. package/dist/types/analytics/logrocket.d.ts +44 -0
  116. package/dist/types/analytics/mixpanel.d.ts +67 -0
  117. package/dist/types/analytics/pirsch.d.ts +42 -0
  118. package/dist/types/analytics/plausible.d.ts +56 -0
  119. package/dist/types/analytics/posthog.d.ts +45 -0
  120. package/dist/types/analytics/schema.d.ts +320 -0
  121. package/dist/types/analytics/script.d.ts +46 -0
  122. package/dist/types/analytics/segment.d.ts +50 -0
  123. package/dist/types/analytics/vercel.d.ts +48 -0
  124. package/dist/types/astro/integration.d.ts +76 -0
  125. package/dist/types/astro/markdown-negotiation.d.ts +23 -0
  126. package/dist/types/astro/module-types.d.ts +14 -0
  127. package/dist/types/astro/pages.d.ts +44 -0
  128. package/dist/types/cli/env.d.ts +12 -0
  129. package/dist/types/cli/init/scaffold.d.ts +154 -0
  130. package/dist/types/components/layout/nav-utils.d.ts +11 -0
  131. package/dist/types/core/adapter.d.ts +47 -0
  132. package/dist/types/core/api-name.d.ts +7 -0
  133. package/dist/types/core/changelog-index.d.ts +13 -0
  134. package/dist/types/core/config-input.d.ts +197 -526
  135. package/dist/types/core/config.d.ts +61 -35
  136. package/dist/types/core/content-assets.d.ts +76 -0
  137. package/dist/types/core/custom-pages.d.ts +33 -0
  138. package/dist/types/core/data.d.ts +30 -15
  139. package/dist/types/core/define-components.d.ts +12 -9
  140. package/dist/types/core/deployment-env.d.ts +6 -11
  141. package/dist/types/core/frontmatter.d.ts +10 -0
  142. package/dist/types/core/graph.d.ts +18 -0
  143. package/dist/types/core/heading-markers.d.ts +54 -0
  144. package/dist/types/core/i18n-ui.d.ts +12 -10
  145. package/dist/types/core/i18n.d.ts +87 -0
  146. package/dist/types/core/includes.d.ts +138 -0
  147. package/dist/types/core/last-modified.d.ts +47 -0
  148. package/dist/types/core/links.d.ts +95 -0
  149. package/dist/types/core/locale-links.d.ts +60 -0
  150. package/dist/types/core/manifest.d.ts +17 -0
  151. package/dist/types/core/meta.d.ts +38 -0
  152. package/dist/types/core/nav-diagnostics.d.ts +26 -0
  153. package/dist/types/core/navigation.d.ts +6 -0
  154. package/dist/types/core/node-require.d.ts +19 -0
  155. package/dist/types/core/package-json.d.ts +13 -0
  156. package/dist/types/core/probe.d.ts +42 -0
  157. package/dist/types/core/project-graph.d.ts +51 -0
  158. package/dist/types/core/project.d.ts +2 -0
  159. package/dist/types/core/safe-href.d.ts +2 -0
  160. package/dist/types/core/safe-links.d.ts +26 -0
  161. package/dist/types/core/schema.d.ts +2284 -454
  162. package/dist/types/core/site-url.d.ts +16 -0
  163. package/dist/types/core/sources/assets.d.ts +36 -0
  164. package/dist/types/core/sources/cache.d.ts +37 -0
  165. package/dist/types/core/sources/collection.d.ts +28 -0
  166. package/dist/types/core/sources/contentful-rich-text.d.ts +31 -0
  167. package/dist/types/core/sources/contentful.d.ts +40 -0
  168. package/dist/types/core/sources/filesystem.d.ts +24 -0
  169. package/dist/types/core/sources/github-releases.d.ts +31 -0
  170. package/dist/types/core/sources/json.d.ts +30 -0
  171. package/dist/types/core/sources/lexical.d.ts +19 -0
  172. package/dist/types/core/sources/lower.d.ts +75 -0
  173. package/dist/types/core/sources/mdx-remote.d.ts +28 -0
  174. package/dist/types/core/sources/normalize.d.ts +147 -0
  175. package/dist/types/core/sources/notion.d.ts +131 -0
  176. package/dist/types/core/sources/obsidian.d.ts +46 -0
  177. package/dist/types/core/sources/payload.d.ts +39 -0
  178. package/dist/types/core/sources/portable-text.d.ts +42 -0
  179. package/dist/types/core/sources/read.d.ts +23 -0
  180. package/dist/types/core/sources/remote.d.ts +74 -0
  181. package/dist/types/core/sources/resolve.d.ts +19 -0
  182. package/dist/types/core/sources/sanity.d.ts +43 -0
  183. package/dist/types/core/sources/strapi-blocks.d.ts +12 -0
  184. package/dist/types/core/sources/strapi.d.ts +33 -0
  185. package/dist/types/core/sources/types.d.ts +7 -0
  186. package/dist/types/core/sources/watch.d.ts +45 -0
  187. package/dist/types/core/text-width.d.ts +11 -0
  188. package/dist/types/core/types.d.ts +15 -1
  189. package/dist/types/core/unrecognized-keys.d.ts +7 -0
  190. package/dist/types/core/versions.d.ts +72 -0
  191. package/dist/types/core/yaml.d.ts +9 -0
  192. package/dist/types/deploy/adapter-output.d.ts +45 -0
  193. package/dist/types/deploy/adapters/cloudflare.d.ts +40 -0
  194. package/dist/types/deploy/adapters/index.d.ts +29 -0
  195. package/dist/types/deploy/adapters/netlify.d.ts +37 -0
  196. package/dist/types/deploy/adapters/node.d.ts +37 -0
  197. package/dist/types/deploy/adapters/registry.d.ts +133 -0
  198. package/dist/types/deploy/adapters/types.d.ts +71 -0
  199. package/dist/types/deploy/adapters/vercel.d.ts +38 -0
  200. package/dist/types/deploy/artifacts.d.ts +65 -0
  201. package/dist/types/deploy/cloudflare-negotiation.d.ts +196 -0
  202. package/dist/types/deploy/function-bundle.d.ts +80 -0
  203. package/dist/types/deploy/headers.d.ts +50 -0
  204. package/dist/types/deploy/node-headers.d.ts +42 -0
  205. package/dist/types/deploy/platforms/cloudflare.d.ts +40 -0
  206. package/dist/types/deploy/platforms/index.d.ts +18 -0
  207. package/dist/types/deploy/platforms/netlify.d.ts +13 -0
  208. package/dist/types/deploy/platforms/node.d.ts +11 -0
  209. package/dist/types/deploy/platforms/paths.d.ts +27 -0
  210. package/dist/types/deploy/platforms/static.d.ts +10 -0
  211. package/dist/types/deploy/platforms/types.d.ts +104 -0
  212. package/dist/types/deploy/platforms/vercel.d.ts +32 -0
  213. package/dist/types/deploy/redirects.d.ts +53 -0
  214. package/dist/types/deploy/robots.d.ts +8 -0
  215. package/dist/types/deploy/rss.d.ts +31 -0
  216. package/dist/types/deploy/sitemap.d.ts +21 -0
  217. package/dist/types/deploy/vercel-negotiation.d.ts +109 -0
  218. package/dist/types/markdown/code-title.d.ts +32 -0
  219. package/dist/types/markdown/fence-meta.d.ts +23 -0
  220. package/dist/types/markdown/themes.d.ts +3 -3
  221. package/dist/types/openapi/asyncapi.d.ts +129 -0
  222. package/dist/types/openapi/graphql-build.d.ts +8 -0
  223. package/dist/types/openapi/graphql.d.ts +122 -0
  224. package/dist/types/openapi/model.d.ts +158 -0
  225. package/dist/types/openapi/parse.d.ts +57 -0
  226. package/dist/types/openapi/references.d.ts +37 -25
  227. package/dist/types/openapi/render-mdx.d.ts +33 -0
  228. package/dist/types/openapi/sentence.d.ts +7 -0
  229. package/dist/types/openapi/signature.d.ts +10 -0
  230. package/dist/types/openapi/source.d.ts +22 -0
  231. package/dist/types/openapi/spec-dependency-error.d.ts +10 -0
  232. package/dist/types/reference/asyncapi.d.ts +166 -0
  233. package/dist/types/reference/graphql.d.ts +181 -0
  234. package/dist/types/reference/index.d.ts +32 -0
  235. package/dist/types/reference/openapi.d.ts +165 -0
  236. package/dist/types/reference/options.d.ts +157 -0
  237. package/dist/types/reference/scalar.d.ts +136 -0
  238. package/dist/types/reference/schema.d.ts +630 -0
  239. package/dist/types/search/adapters/algolia.d.ts +32 -0
  240. package/dist/types/search/adapters/flexsearch.d.ts +12 -0
  241. package/dist/types/search/adapters/index.d.ts +31 -0
  242. package/dist/types/search/adapters/mixedbread.d.ts +22 -0
  243. package/dist/types/search/adapters/orama-cloud.d.ts +33 -0
  244. package/dist/types/search/adapters/orama.d.ts +13 -0
  245. package/dist/types/search/adapters/pagefind.d.ts +12 -0
  246. package/dist/types/search/adapters/registry.d.ts +228 -0
  247. package/dist/types/search/adapters/types.d.ts +34 -0
  248. package/dist/types/search/adapters/typesense.d.ts +42 -0
  249. package/dist/types/search/build.d.ts +23 -0
  250. package/dist/types/search/documents.d.ts +90 -0
  251. package/dist/types/search/facets.d.ts +3 -0
  252. package/dist/types/search/orama-index.d.ts +1 -1
  253. package/dist/types/search/sync/algolia.d.ts +14 -0
  254. package/dist/types/search/sync/index.d.ts +14 -0
  255. package/dist/types/search/sync/orama-cloud.d.ts +10 -0
  256. package/dist/types/search/sync/typesense.d.ts +14 -0
  257. package/dist/types/sources/contentful.d.ts +68 -0
  258. package/dist/types/sources/custom.d.ts +20 -0
  259. package/dist/types/sources/filesystem.d.ts +42 -0
  260. package/dist/types/sources/github-releases.d.ts +46 -0
  261. package/dist/types/sources/index.d.ts +48 -0
  262. package/dist/types/sources/mdx-remote.d.ts +63 -0
  263. package/dist/types/sources/notion.d.ts +65 -0
  264. package/dist/types/sources/obsidian.d.ts +34 -0
  265. package/dist/types/sources/payload.d.ts +68 -0
  266. package/dist/types/sources/registry.d.ts +1414 -0
  267. package/dist/types/sources/sanity.d.ts +69 -0
  268. package/dist/types/sources/shared.d.ts +46 -0
  269. package/dist/types/sources/strapi.d.ts +66 -0
  270. package/dist/types/theme/icon-kind.d.ts +11 -0
  271. package/dist/types/theme/icons.d.ts +20 -0
  272. package/docs/01-quickstart.mdx +18 -18
  273. package/docs/02-deployment.mdx +52 -28
  274. package/docs/03-upgrading.mdx +364 -0
  275. package/docs/04-migrating.mdx +58 -0
  276. package/docs/08-faq.mdx +5 -5
  277. package/docs/advanced/blog.mdx +13 -6
  278. package/docs/advanced/changelog.mdx +23 -35
  279. package/docs/advanced/custom-pages.mdx +22 -10
  280. package/docs/advanced/meta.ts +1 -8
  281. package/docs/advanced/skills.mdx +8 -0
  282. package/docs/cli/audit.mdx +646 -0
  283. package/docs/cli/doctor.mdx +29 -0
  284. package/docs/{reference/eval.mdx → cli/evals.mdx} +12 -11
  285. package/docs/cli/index.mdx +105 -0
  286. package/docs/cli/meta.ts +7 -0
  287. package/docs/{reference → cli}/translate.mdx +9 -9
  288. package/docs/cli/validate.mdx +41 -0
  289. package/docs/cli/version.mdx +40 -0
  290. package/docs/configuration/analytics.mdx +350 -59
  291. package/docs/configuration/assistant.mdx +357 -0
  292. package/docs/configuration/customization.mdx +16 -10
  293. package/docs/configuration/index.mdx +50 -31
  294. package/docs/configuration/meta.ts +1 -1
  295. package/docs/configuration/search.mdx +76 -55
  296. package/docs/configuration/theming.mdx +24 -15
  297. package/docs/content/components.mdx +21 -5
  298. package/docs/{reference → content}/frontmatter.mdx +35 -1
  299. package/docs/content/i18n.mdx +9 -7
  300. package/docs/content/includes.mdx +2 -4
  301. package/docs/content/index.mdx +1 -1
  302. package/docs/content/islands.mdx +11 -6
  303. package/docs/content/meta.mdx +1 -1
  304. package/docs/content/meta.ts +1 -0
  305. package/docs/content/navigation.mdx +9 -7
  306. package/docs/content/sources.mdx +145 -50
  307. package/docs/content/syntax.mdx +16 -12
  308. package/docs/content/versioning.mdx +3 -3
  309. package/docs/discoverability/agent-discovery.mdx +12 -12
  310. package/docs/discoverability/index.mdx +4 -4
  311. package/docs/discoverability/json-api.mdx +4 -4
  312. package/docs/discoverability/llms-txt.mdx +6 -6
  313. package/docs/discoverability/markdown.mdx +4 -4
  314. package/docs/discoverability/mcp.mdx +11 -11
  315. package/docs/discoverability/sitemap-and-robots.mdx +3 -3
  316. package/docs/index.mdx +4 -4
  317. package/docs/references/asyncapi.mdx +59 -0
  318. package/docs/{advanced → references}/graphql.mdx +45 -32
  319. package/docs/{reference → references}/meta.ts +2 -2
  320. package/docs/references/openapi.mdx +171 -0
  321. package/docs/references/scalar.mdx +64 -0
  322. package/package.json +42 -8
  323. package/skills/blume/SKILL.md +23 -10
  324. package/skills/blume-migrate/SKILL.md +22 -21
  325. package/skills/blume-migrate/assets/oxfmt@0.67.0.patch +49 -0
  326. package/skills/blume-migrate/references/docusaurus.md +5 -4
  327. package/skills/blume-migrate/references/fumadocs.md +4 -4
  328. package/skills/blume-migrate/references/mintlify.md +23 -8
  329. package/skills/blume-migrate/references/monorepo.md +6 -6
  330. package/skills/blume-migrate/references/starlight.md +4 -4
  331. package/src/ai/agent-readability.ts +25 -26
  332. package/src/ai/ai-catalog.ts +50 -32
  333. package/src/ai/api/handlers.ts +46 -11
  334. package/src/ai/api/paths.ts +1 -1
  335. package/src/ai/api-catalog.ts +8 -8
  336. package/src/ai/ask-context.ts +7 -7
  337. package/src/ai/ask-data.ts +3 -3
  338. package/src/ai/ask.ts +637 -100
  339. package/src/ai/changelog-markdown.ts +91 -0
  340. package/src/ai/component-markdown.ts +328 -12
  341. package/src/ai/cors.ts +3 -3
  342. package/src/ai/index.ts +45 -0
  343. package/src/ai/link-headers.ts +7 -6
  344. package/src/ai/llms.ts +20 -15
  345. package/src/ai/markdown.ts +35 -5
  346. package/src/ai/mcp/data.ts +9 -5
  347. package/src/ai/openapi-components.ts +5 -2
  348. package/src/ai/relative-links.ts +170 -0
  349. package/src/ai/serializers.ts +3 -3
  350. package/src/ai/skills.ts +1 -1
  351. package/src/ai/visibility.ts +1 -1
  352. package/src/ai/web-bot-auth.ts +2 -2
  353. package/src/analytics/adobe.ts +46 -0
  354. package/src/analytics/amplitude.ts +79 -0
  355. package/src/analytics/clarity.ts +46 -0
  356. package/src/analytics/clearbit.ts +47 -0
  357. package/src/analytics/cloudflare.ts +67 -0
  358. package/src/analytics/fathom.ts +64 -0
  359. package/src/analytics/google-analytics.ts +84 -0
  360. package/src/analytics/google-tag-manager.ts +61 -0
  361. package/src/analytics/head.ts +130 -0
  362. package/src/analytics/heap.ts +65 -0
  363. package/src/analytics/hightouch.ts +77 -0
  364. package/src/analytics/hotjar.ts +47 -0
  365. package/src/analytics/index.ts +71 -0
  366. package/src/analytics/inline.ts +21 -0
  367. package/src/analytics/logrocket.ts +71 -0
  368. package/src/analytics/mixpanel.ts +92 -0
  369. package/src/analytics/pirsch.ts +66 -0
  370. package/src/analytics/plausible.ts +83 -0
  371. package/src/analytics/posthog.ts +78 -0
  372. package/src/analytics/schema.ts +60 -0
  373. package/src/analytics/script.ts +60 -0
  374. package/src/analytics/segment.ts +85 -0
  375. package/src/analytics/vercel.ts +50 -0
  376. package/src/astro/adapter-root.ts +7 -9
  377. package/src/astro/component-slots.ts +131 -91
  378. package/src/astro/generate.ts +129 -361
  379. package/src/astro/integration.ts +2 -6
  380. package/src/astro/module-types.ts +1 -1
  381. package/src/astro/pages.ts +13 -101
  382. package/src/astro/render-deps.ts +379 -0
  383. package/src/astro/runtime-deps.ts +201 -0
  384. package/src/astro/templates.ts +575 -562
  385. package/src/audit/agent.ts +24 -0
  386. package/src/audit/catalog.ts +2 -2
  387. package/src/audit/checks/assets.ts +2 -2
  388. package/src/audit/checks/dns-aid.ts +1 -1
  389. package/src/audit/checks/duplicates.ts +3 -1
  390. package/src/audit/checks/i18n.ts +1 -1
  391. package/src/audit/checks/indexability.ts +7 -7
  392. package/src/audit/checks/links.ts +2 -2
  393. package/src/audit/checks/llms.ts +6 -6
  394. package/src/audit/checks/network.ts +3 -3
  395. package/src/audit/checks/og-image.ts +2 -2
  396. package/src/audit/checks/robots.ts +1 -1
  397. package/src/audit/checks/sitemap.ts +2 -2
  398. package/src/audit/checks/social.ts +1 -1
  399. package/src/audit/run.ts +4 -3
  400. package/src/audit/terms.ts +31 -0
  401. package/src/audit/url.ts +13 -13
  402. package/src/blume-modules.d.ts +2 -2
  403. package/src/cli/command-meta.ts +10 -0
  404. package/src/cli/commands/audit.ts +40 -21
  405. package/src/cli/commands/build.ts +71 -316
  406. package/src/cli/commands/check.ts +1 -0
  407. package/src/cli/commands/dev.ts +40 -1
  408. package/src/cli/commands/doctor.ts +92 -14
  409. package/src/cli/commands/eject.ts +44 -7
  410. package/src/cli/commands/eval.ts +5 -5
  411. package/src/cli/commands/init.ts +161 -41
  412. package/src/cli/commands/migrate.ts +121 -0
  413. package/src/cli/commands/preview.ts +7 -1
  414. package/src/cli/commands/translate.ts +5 -5
  415. package/src/cli/commands/upgrade.ts +141 -0
  416. package/src/cli/commands/version.ts +57 -44
  417. package/src/cli/eject-scripts.ts +121 -6
  418. package/src/cli/index.ts +11 -1
  419. package/src/cli/init/install.ts +70 -0
  420. package/src/cli/init/questions.ts +7 -0
  421. package/src/cli/init/scaffold.ts +459 -75
  422. package/src/cli/lazy-command.ts +37 -1
  423. package/src/cli/prepare.ts +40 -6
  424. package/src/cli/required-secrets.ts +39 -12
  425. package/src/cli/unknown-flags.ts +266 -0
  426. package/src/cli/yarn-pnp.ts +52 -0
  427. package/src/components/content/AccordionItem.astro +7 -1
  428. package/src/components/content/Card.astro +4 -3
  429. package/src/components/content/ColorItem.astro +22 -4
  430. package/src/components/content/GithubInfo.astro +2 -2
  431. package/src/components/content/Prompt.astro +25 -25
  432. package/src/components/content/Tabs.astro +3 -1
  433. package/src/components/content/Tile.astro +2 -3
  434. package/src/components/content/Tooltip.astro +57 -9
  435. package/src/components/content/content-strings.ts +34 -0
  436. package/src/components/content/diff.ts +1 -1
  437. package/src/components/content/mermaid-element.ts +13 -2
  438. package/src/components/content/prompt-markdown.ts +292 -0
  439. package/src/components/content/tooltip-id.ts +41 -0
  440. package/src/components/copy-feedback.ts +1 -1
  441. package/src/components/islands/{AskAI.astro → Assistant.astro} +10 -10
  442. package/src/components/islands/{ask-ai.tsx → assistant.tsx} +23 -23
  443. package/src/components/islands/hooks.ts +36 -11
  444. package/src/components/layout/Analytics.astro +21 -79
  445. package/src/components/layout/Banner.astro +3 -1
  446. package/src/components/layout/DiscoveryLinks.astro +69 -0
  447. package/src/components/layout/Header.astro +93 -30
  448. package/src/components/layout/LanguageSwitcher.astro +4 -1
  449. package/src/components/layout/Logo.astro +23 -2
  450. package/src/components/layout/NavSelector.astro +13 -2
  451. package/src/components/layout/NavTree.astro +12 -3
  452. package/src/components/layout/NavTreeScript.astro +17 -3
  453. package/src/components/layout/PageActions.astro +3 -3
  454. package/src/components/layout/PageFeedback.astro +11 -1
  455. package/src/components/layout/PageLayout.astro +58 -11
  456. package/src/components/layout/Pagination.astro +7 -7
  457. package/src/components/layout/ReferenceLayout.astro +22 -13
  458. package/src/components/layout/RootLayout.astro +75 -72
  459. package/src/components/layout/Search.astro +43 -19
  460. package/src/components/layout/WebMcp.astro +1 -1
  461. package/src/components/layout/analytics-client.ts +73 -16
  462. package/src/components/layout/drawer-inert.ts +113 -15
  463. package/src/components/layout/dropdown-clamp.ts +105 -0
  464. package/src/components/layout/head-scripts.ts +15 -6
  465. package/src/components/layout/nav-utils.ts +17 -0
  466. package/src/components/layout/search/algolia.ts +8 -8
  467. package/src/components/layout/search/orama-cloud.ts +9 -7
  468. package/src/components/layout/search/typesense.ts +11 -17
  469. package/src/components/openapi/MessageComposer.astro +2 -2
  470. package/src/components/openapi/Playground.astro +2 -2
  471. package/src/components/openapi/description.ts +2 -2
  472. package/src/components/openapi/playground-client.ts +79 -10
  473. package/src/core/changelog-index.ts +24 -0
  474. package/src/core/code-fences.ts +1 -1
  475. package/src/core/component-overrides.ts +399 -154
  476. package/src/core/config-input.ts +201 -566
  477. package/src/core/config.ts +131 -42
  478. package/src/core/custom-pages.ts +105 -0
  479. package/src/core/data.ts +34 -15
  480. package/src/core/define-components.ts +12 -9
  481. package/src/core/deployment-env.ts +18 -74
  482. package/src/core/diagnostics.ts +14 -7
  483. package/src/core/graph.ts +69 -25
  484. package/src/core/i18n-ui.ts +41 -11
  485. package/src/core/i18n.ts +17 -0
  486. package/src/core/includes.ts +156 -38
  487. package/src/core/last-modified.ts +6 -11
  488. package/src/core/links.ts +166 -2
  489. package/src/core/manifest.ts +10 -3
  490. package/src/core/navigation.ts +115 -16
  491. package/src/core/new-tab.ts +35 -0
  492. package/src/core/node-require.ts +21 -0
  493. package/src/core/project-graph.ts +42 -26
  494. package/src/core/project.ts +9 -4
  495. package/src/core/request-body.ts +61 -0
  496. package/src/core/safe-href.ts +28 -0
  497. package/src/core/safe-links.ts +68 -0
  498. package/src/core/schema.ts +528 -745
  499. package/src/core/server-features.ts +10 -11
  500. package/src/core/sources/assets.ts +47 -11
  501. package/src/core/sources/collection.ts +67 -0
  502. package/src/core/sources/contentful-rich-text.ts +285 -0
  503. package/src/core/sources/contentful.ts +173 -0
  504. package/src/core/sources/github-releases.ts +51 -1
  505. package/src/core/sources/json.ts +71 -0
  506. package/src/core/sources/lexical.ts +195 -0
  507. package/src/core/sources/lower.ts +226 -0
  508. package/src/core/sources/normalize.ts +52 -2
  509. package/src/core/sources/notion.ts +39 -28
  510. package/src/core/sources/payload.ts +135 -0
  511. package/src/core/sources/portable-text.ts +11 -16
  512. package/src/core/sources/remote.ts +226 -0
  513. package/src/core/sources/resolve.ts +104 -166
  514. package/src/core/sources/sanity.ts +16 -49
  515. package/src/core/sources/strapi-blocks.ts +124 -0
  516. package/src/core/sources/strapi.ts +191 -0
  517. package/src/core/sources/types.ts +12 -1
  518. package/src/core/types.ts +15 -1
  519. package/src/core/ui-packs/ar.ts +10 -7
  520. package/src/core/ui-packs/bg.ts +10 -7
  521. package/src/core/ui-packs/bn.ts +10 -7
  522. package/src/core/ui-packs/ca.ts +7 -6
  523. package/src/core/ui-packs/cs.ts +10 -7
  524. package/src/core/ui-packs/da.ts +10 -7
  525. package/src/core/ui-packs/de.ts +10 -7
  526. package/src/core/ui-packs/el.ts +7 -6
  527. package/src/core/ui-packs/es.ts +7 -6
  528. package/src/core/ui-packs/fa.ts +10 -7
  529. package/src/core/ui-packs/fi.ts +10 -7
  530. package/src/core/ui-packs/fr.ts +7 -6
  531. package/src/core/ui-packs/he.ts +10 -7
  532. package/src/core/ui-packs/hi.ts +10 -7
  533. package/src/core/ui-packs/hr.ts +10 -7
  534. package/src/core/ui-packs/hu.ts +10 -7
  535. package/src/core/ui-packs/id.ts +10 -7
  536. package/src/core/ui-packs/it.ts +7 -6
  537. package/src/core/ui-packs/ja.ts +7 -6
  538. package/src/core/ui-packs/ko.ts +7 -6
  539. package/src/core/ui-packs/nl.ts +10 -7
  540. package/src/core/ui-packs/no.ts +10 -7
  541. package/src/core/ui-packs/pl.ts +10 -7
  542. package/src/core/ui-packs/pt-br.ts +7 -6
  543. package/src/core/ui-packs/pt.ts +7 -6
  544. package/src/core/ui-packs/ro.ts +10 -7
  545. package/src/core/ui-packs/ru.ts +10 -7
  546. package/src/core/ui-packs/sk.ts +10 -7
  547. package/src/core/ui-packs/sr.ts +10 -7
  548. package/src/core/ui-packs/sv.ts +10 -7
  549. package/src/core/ui-packs/th.ts +7 -6
  550. package/src/core/ui-packs/tr.ts +10 -7
  551. package/src/core/ui-packs/uk.ts +10 -7
  552. package/src/core/ui-packs/vi.ts +7 -6
  553. package/src/core/ui-packs/zh-tw.ts +7 -6
  554. package/src/core/ui-packs/zh.ts +7 -6
  555. package/src/core/unrecognized-keys.ts +10 -0
  556. package/src/core/version-cut.ts +116 -8
  557. package/src/deploy/adapter-output.ts +57 -97
  558. package/src/deploy/adapters/cloudflare.ts +39 -0
  559. package/src/deploy/adapters/index.ts +41 -0
  560. package/src/deploy/adapters/netlify.ts +34 -0
  561. package/src/deploy/adapters/node.ts +34 -0
  562. package/src/deploy/adapters/registry.ts +127 -0
  563. package/src/deploy/adapters/types.ts +92 -0
  564. package/src/deploy/adapters/vercel.ts +35 -0
  565. package/src/deploy/artifacts.ts +55 -27
  566. package/src/deploy/cloudflare-negotiation.ts +179 -100
  567. package/src/deploy/function-bundle.ts +18 -3
  568. package/src/deploy/headers.ts +124 -23
  569. package/src/deploy/node-headers.ts +198 -0
  570. package/src/deploy/platforms/cloudflare.ts +312 -0
  571. package/src/deploy/platforms/index.ts +67 -0
  572. package/src/deploy/platforms/netlify.ts +52 -0
  573. package/src/deploy/platforms/node.ts +40 -0
  574. package/src/deploy/platforms/paths.ts +42 -0
  575. package/src/deploy/platforms/static.ts +29 -0
  576. package/src/deploy/platforms/types.ts +112 -0
  577. package/src/deploy/platforms/vercel.ts +193 -0
  578. package/src/deploy/redirects.ts +30 -18
  579. package/src/deploy/robots.ts +3 -3
  580. package/src/deploy/rss.ts +2 -2
  581. package/src/deploy/sitemap.ts +2 -2
  582. package/src/deploy/vercel-negotiation.ts +2 -2
  583. package/src/eval/agents.ts +32 -1
  584. package/src/eval/findings.ts +19 -11
  585. package/src/eval/report.ts +10 -2
  586. package/src/markdown/external-links.ts +65 -0
  587. package/src/markdown/include.ts +45 -27
  588. package/src/markdown/index.ts +34 -9
  589. package/src/markdown/inline-code.ts +12 -6
  590. package/src/markdown/relative-links.ts +324 -0
  591. package/src/markdown/themes.ts +3 -3
  592. package/src/migrate/migrate.ts +149 -0
  593. package/src/openapi/parse.ts +64 -16
  594. package/src/openapi/proxy.ts +62 -10
  595. package/src/openapi/references.ts +147 -147
  596. package/src/openapi/render-mdx.ts +32 -10
  597. package/src/openapi/scalar.ts +15 -13
  598. package/src/openapi/sentence.ts +14 -0
  599. package/src/openapi/source.ts +37 -21
  600. package/src/openapi/spec-dependency-error.ts +15 -0
  601. package/src/reference/asyncapi.ts +83 -0
  602. package/src/reference/graphql.ts +89 -0
  603. package/src/reference/index.ts +40 -0
  604. package/src/reference/openapi.ts +83 -0
  605. package/src/reference/options.ts +201 -0
  606. package/src/reference/scalar.ts +136 -0
  607. package/src/reference/schema.ts +88 -0
  608. package/src/registry/eject.ts +109 -53
  609. package/src/search/adapters/algolia.ts +46 -0
  610. package/src/search/adapters/flexsearch.ts +29 -0
  611. package/src/search/adapters/index.ts +39 -0
  612. package/src/search/adapters/mixedbread.ts +39 -0
  613. package/src/search/adapters/orama-cloud.ts +51 -0
  614. package/src/search/adapters/orama.ts +24 -0
  615. package/src/search/adapters/pagefind.ts +27 -0
  616. package/src/search/adapters/registry.ts +131 -0
  617. package/src/search/adapters/types.ts +46 -0
  618. package/src/search/adapters/typesense.ts +57 -0
  619. package/src/search/build.ts +8 -4
  620. package/src/search/documents.ts +8 -2
  621. package/src/search/orama-index.ts +1 -1
  622. package/src/search/sync/algolia.ts +12 -11
  623. package/src/search/sync/index.ts +35 -20
  624. package/src/search/sync/orama-cloud.ts +12 -9
  625. package/src/search/sync/typesense.ts +15 -13
  626. package/src/sources/contentful.ts +63 -0
  627. package/src/sources/custom.ts +38 -0
  628. package/src/sources/filesystem.ts +51 -0
  629. package/src/sources/github-releases.ts +52 -0
  630. package/src/sources/index.ts +60 -0
  631. package/src/sources/mdx-remote.ts +76 -0
  632. package/src/sources/notion.ts +63 -0
  633. package/src/sources/obsidian.ts +38 -0
  634. package/src/sources/payload.ts +60 -0
  635. package/src/sources/registry.ts +182 -0
  636. package/src/sources/sanity.ts +66 -0
  637. package/src/sources/shared.ts +52 -0
  638. package/src/sources/strapi.ts +58 -0
  639. package/src/theme/entry.ts +24 -2
  640. package/src/translate/report.ts +40 -7
  641. package/src/upgrade/upgrade.ts +499 -0
  642. package/dist/cli/chunk-0qymqwzz.js +0 -164
  643. package/dist/cli/chunk-0qymqwzz.js.map +0 -15
  644. package/dist/cli/chunk-1jefwnfs.js.map +0 -48
  645. package/dist/cli/chunk-2mzebbbz.js +0 -69
  646. package/dist/cli/chunk-2z47ypj8.js.map +0 -11
  647. package/dist/cli/chunk-4x36ddpw.js.map +0 -11
  648. package/dist/cli/chunk-5093q3n7.js +0 -68
  649. package/dist/cli/chunk-5093q3n7.js.map +0 -10
  650. package/dist/cli/chunk-5qk08vmp.js.map +0 -11
  651. package/dist/cli/chunk-7s8hm3b6.js +0 -5347
  652. package/dist/cli/chunk-7s8hm3b6.js.map +0 -58
  653. package/dist/cli/chunk-8cjtbafj.js.map +0 -13
  654. package/dist/cli/chunk-97r59kpr.js +0 -381
  655. package/dist/cli/chunk-97r59kpr.js.map +0 -12
  656. package/dist/cli/chunk-ahnw3kxw.js.map +0 -15
  657. package/dist/cli/chunk-b27xqwn9.js.map +0 -10
  658. package/dist/cli/chunk-bf6bt1xt.js +0 -185
  659. package/dist/cli/chunk-bf6bt1xt.js.map +0 -11
  660. package/dist/cli/chunk-cjtn640a.js.map +0 -10
  661. package/dist/cli/chunk-ct47dqpx.js.map +0 -11
  662. package/dist/cli/chunk-esphfr8p.js +0 -107
  663. package/dist/cli/chunk-esphfr8p.js.map +0 -11
  664. package/dist/cli/chunk-ex56aa81.js +0 -1016
  665. package/dist/cli/chunk-ex56aa81.js.map +0 -13
  666. package/dist/cli/chunk-garjf5z9.js +0 -30
  667. package/dist/cli/chunk-garjf5z9.js.map +0 -10
  668. package/dist/cli/chunk-js7saxwm.js +0 -1045
  669. package/dist/cli/chunk-js7saxwm.js.map +0 -22
  670. package/dist/cli/chunk-k79xp7av.js.map +0 -39
  671. package/dist/cli/chunk-ps4m1xh4.js.map +0 -15
  672. package/dist/cli/chunk-q4rae3bg.js +0 -60
  673. package/dist/cli/chunk-q4rae3bg.js.map +0 -10
  674. package/dist/cli/chunk-rz9jmfhz.js +0 -108
  675. package/dist/cli/chunk-rz9jmfhz.js.map +0 -10
  676. package/dist/cli/chunk-vh9w1sgp.js +0 -73
  677. package/dist/cli/chunk-vh9w1sgp.js.map +0 -10
  678. package/dist/cli/chunk-vrfp10qk.js +0 -81
  679. package/dist/cli/chunk-vrfp10qk.js.map +0 -10
  680. package/dist/cli/chunk-yg63d42r.js.map +0 -34
  681. package/docs/advanced/api-reference.mdx +0 -240
  682. package/docs/configuration/ask-ai.mdx +0 -256
  683. package/docs/reference/cli.mdx +0 -197
  684. package/skills/blume-migrate/assets/oxfmt@0.55.0.patch +0 -20
  685. package/src/components/content/changelog-element.ts +0 -69
  686. package/src/search/providers.ts +0 -91
  687. /package/dist/cli/{chunk-vacwm2hv.js.map → chunk-27g6wdth.js.map} +0 -0
  688. /package/dist/cli/{chunk-dwgcp5sm.js.map → chunk-ce574jw2.js.map} +0 -0
  689. /package/dist/cli/{chunk-e7f42gdj.js.map → chunk-fxypxtvm.js.map} +0 -0
  690. /package/dist/cli/{chunk-nn13znc2.js.map → chunk-zxcczpyx.js.map} +0 -0
@@ -1,13 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/registry/eject.ts", "../src/cli/eject-scripts.ts", "../src/cli/init/scaffold.ts", "../src/core/package-json.ts"],
4
- "sourcesContent": [
5
- "import { existsSync } from \"node:fs\";\nimport { cp, mkdir, readFile, rm, writeFile } from \"node:fs/promises\";\n\nimport { join, relative } from \"pathe\";\n\nimport { buildAskData } from \"../ai/ask-data.ts\";\nimport { resolveAskBackend } from \"../ai/ask.ts\";\nimport { buildRawMarkdown } from \"../ai/markdown.ts\";\nimport { buildMcpData } from \"../ai/mcp/data.ts\";\nimport { buildMcpDiscovery, buildMcpServerCard } from \"../ai/mcp/discovery.ts\";\nimport { planComponentSlots } from \"../astro/component-slots.ts\";\nimport {\n EXAMPLE_SCAN_GLOB,\n discoverExamples,\n exampleMarkdownLookup,\n exampleScanRoots,\n} from \"../astro/examples.ts\";\nimport {\n buildRuntimeData,\n clientFeaturesFor,\n collectStaged,\n detectNeedsReact,\n detectUsesMath,\n languageIconCssFor,\n} from \"../astro/generate.ts\";\nimport { discoverIslands } from \"../astro/islands.ts\";\nimport { customOgRoutes, discoverPages, routeIsTaken } from \"../astro/pages.ts\";\nimport {\n askComponentTemplate,\n askEndpointTemplate,\n astroConfigTemplate,\n catchAllPageTemplate,\n changelogIndexTemplate,\n contentConfigTemplate,\n exampleMapTemplate,\n exampleSlug,\n examplesPageTemplate,\n exampleWrapperTemplate,\n featuresTemplate,\n islandMapTemplate,\n islandWrapperTemplate,\n mcpEndpointTemplate,\n mcpPageFile,\n mixedbreadSearchEndpointTemplate,\n notFoundPageTemplate,\n ogEndpointTemplate,\n rawMarkdownEndpointTemplate,\n rssEndpointTemplate,\n runtimeTsconfigTemplate,\n searchClientTemplate,\n searchEndpointTemplate,\n staticJsonEndpointTemplate,\n} from \"../astro/templates.ts\";\nimport { buildIncludeGraph } from \"../core/includes.ts\";\nimport { packageRoot } from \"../core/package-root.ts\";\nimport { scanProject } from \"../core/project-graph.ts\";\nimport type { BlumeProject } from \"../core/project-graph.ts\";\nimport type { ProjectContext } from \"../core/types.ts\";\nimport { buildRssFeeds, renderRssFeed } from \"../deploy/rss.ts\";\nimport type { OpenApiData } from \"../openapi/model.ts\";\nimport { hasScalarReferences } from \"../openapi/references.ts\";\nimport { buildReferenceFiles } from \"../openapi/scalar.ts\";\nimport { isOpenApiSource } from \"../openapi/source.ts\";\nimport { buildSearchDocuments } from \"../search/documents.ts\";\nimport { servesStaticIndex } from \"../search/providers.ts\";\nimport {\n examplesEntryTemplate,\n tailwindEntryTemplate,\n} from \"../theme/entry.ts\";\nimport { buildThemeCss } from \"../theme/palette.ts\";\nimport { rebaseSourceDirectives } from \"../theme/sources.ts\";\nimport { twoslashCss } from \"../theme/twoslash.ts\";\n\nconst toPosix = (path: string): string => path.split(\"\\\\\").join(\"/\");\n\n/** The portable `@source` guess: blume in the project's own node_modules. */\nconst LOCAL_BLUME_SOURCE = \"../../node_modules/blume/src/**/*.{astro,ts,tsx}\";\n\n/**\n * The `@source` glob pointing Tailwind at Blume's own source, relative to the\n * ejected `src/generated/app.css`. The project-local `node_modules/blume` is\n * preferred (portable, and under pnpm the symlink survives version bumps), but\n * hoisted installs (npm/yarn workspaces lift blume into the workspace root's\n * node_modules) would make that guess match nothing and silently drop utility\n * classes — so fall back to the package's real installed location, and when\n * even that fails, warn instead of failing silently.\n *\n * Exported for testing.\n */\nexport const blumeSourceGlob = (\n root: string,\n genDir: string,\n resolveBlumeRoot: () => string = packageRoot\n): string => {\n if (existsSync(join(root, \"node_modules\", \"blume\"))) {\n return LOCAL_BLUME_SOURCE;\n }\n try {\n const src = join(resolveBlumeRoot(), \"src\");\n return `${toPosix(relative(genDir, src))}/**/*.{astro,ts,tsx}`;\n } catch {\n console.warn(\n 'blume: could not locate the installed blume package; src/generated/app.css keeps its default `@source \"../../node_modules/blume/...\"` glob. If blume is hoisted elsewhere, point that glob at its install location or Blume\\'s utility classes will be missing.'\n );\n return LOCAL_BLUME_SOURCE;\n }\n};\n\n/** The `blume:openapi` payload for the ejected app (`{}` when none). */\nconst ejectOpenApiData = (project: BlumeProject): OpenApiData => {\n const source = project.sources.find(isOpenApiSource);\n return source ? source.openApiData() : {};\n};\n\n/**\n * The Ask AI endpoint plus, unless the backend runs its own retrieval (Inkeep),\n * its grounding snapshot. Empty when Ask AI is disabled.\n */\nconst askFiles = async (\n project: BlumeProject,\n srcDir: string,\n genDir: string\n): Promise<{ content: string; path: string }[]> => {\n const { ask } = project.config.ai;\n if (!(ask?.enabled && !ask.endpoint)) {\n const endpointPath = join(srcDir, \"pages\", \"api\", \"ask.ts\");\n if (existsSync(endpointPath)) {\n const content = await readFile(endpointPath, \"utf-8\");\n if (content.startsWith(\"// Generated by Blume. Do not edit.\")) {\n await rm(endpointPath, { force: true });\n }\n }\n await rm(join(genDir, \"ask-data.json\"), { force: true });\n return [];\n }\n const grounded = ask.provider !== \"inkeep\";\n const files = [\n {\n content: askEndpointTemplate(resolveAskBackend(ask), grounded, {\n cors: ask.cors,\n instructions: ask.instructions,\n reasoning: ask.reasoning,\n retrieval: ask.retrieval,\n }),\n path: join(srcDir, \"pages\", \"api\", \"ask.ts\"),\n },\n ];\n if (grounded) {\n files.push({\n content: `${JSON.stringify(await buildAskData(project))}\\n`,\n path: join(genDir, \"ask-data.json\"),\n });\n }\n return files;\n};\n\n/** Whether the ejected app hosts the MCP server (enabled and route free). */\nconst hostsMcp = (\n project: BlumeProject,\n userPages: { pattern: string }[]\n): boolean =>\n project.config.ai.mcp.enabled &&\n !routeIsTaken(userPages, project.graph.pages, project.config.ai.mcp.route);\n\n/**\n * The `.well-known` MCP discovery routes, injected as prerendered pages\n * alongside the user's own so the ejected Astro config wires them in. Empty\n * when the server is disabled or its route is already owned by a page.\n */\nconst mcpDiscoveryPages = (\n project: BlumeProject,\n userPages: { pattern: string }[]\n): { entrypoint: string; pattern: string }[] =>\n hostsMcp(project, userPages)\n ? [\n {\n entrypoint: \"src/blume-mcp/discovery.ts\",\n pattern: \"/.well-known/mcp.json\",\n },\n {\n entrypoint: \"src/blume-mcp/server-card.ts\",\n pattern: \"/.well-known/mcp/server-card.json\",\n },\n ]\n : [];\n\n/**\n * The MCP data snapshot, server endpoint, and `.well-known` discovery\n * documents, mirroring `writeMcpFiles` in generate.ts. Empty when the server\n * is disabled or its route is already owned by a page.\n */\nconst mcpFiles = async (\n project: BlumeProject,\n userPages: { pattern: string }[],\n srcDir: string,\n genDir: string\n): Promise<{ content: string; path: string }[]> => {\n if (!hostsMcp(project, userPages)) {\n return [];\n }\n const { route } = project.config.ai.mcp;\n const data = await buildMcpData(project);\n const discoveryInput = {\n base: data.base,\n name: data.name,\n route,\n site: data.site,\n version: data.version,\n };\n return [\n {\n content: `${JSON.stringify(data)}\\n`,\n path: join(genDir, \"mcp-data.json\"),\n },\n {\n content: mcpEndpointTemplate(),\n path: join(srcDir, \"pages\", mcpPageFile(route)),\n },\n {\n content: staticJsonEndpointTemplate(buildMcpDiscovery(discoveryInput)),\n path: join(srcDir, \"blume-mcp\", \"discovery.ts\"),\n },\n {\n content: staticJsonEndpointTemplate(buildMcpServerCard(discoveryInput)),\n path: join(srcDir, \"blume-mcp\", \"server-card.ts\"),\n },\n ];\n};\n\n/**\n * The `/changelog` index page, mirroring `shouldGenerateChangelog` in\n * generate.ts: emitted when `type: changelog` entries or a release-backed\n * changelog source exist, unless a user page already owns the route.\n */\nconst changelogFiles = (\n project: BlumeProject,\n userPages: { pattern: string }[],\n srcDir: string,\n options: Parameters<typeof changelogIndexTemplate>[0]\n): { content: string; path: string }[] => {\n const hasChangelog = project.graph.pages.some(\n (page) =>\n page.contentType === \"changelog\" &&\n !(page.meta.draft || page.meta.sidebar.hidden)\n );\n const hasChangelogSource = (project.config.content.sources ?? []).some(\n (source) => source.type === \"github-releases\"\n );\n if (\n !(hasChangelog || hasChangelogSource) ||\n routeIsTaken(userPages, project.graph.pages, \"/changelog\")\n ) {\n return [];\n }\n return [\n {\n content: changelogIndexTemplate(options),\n path: join(srcDir, \"pages\", \"changelog.astro\"),\n },\n ];\n};\n\n/** Contents of the configured `examples.css`, or `\"\"` when unset/absent. */\n/**\n * Read a user stylesheet that eject inlines into a generated entry under\n * `genDir`, re-rooting its relative `@source` paths from the user's file.\n * Resolves to an empty string when the file is unset or absent.\n */\nconst readUserCss = async (\n file: string | null,\n genDir: string\n): Promise<string> => {\n if (!(file && existsSync(file))) {\n return \"\";\n }\n const css = await readFile(file, \"utf-8\");\n return rebaseSourceDirectives(css, { from: file, to: genDir });\n};\n\n/**\n * The per-example preview route `<Component />` iframes embed, nested under\n * `basePath` so it stays reachable behind a proxy that only forwards the\n * base. Empty when the project has no examples.\n */\nconst examplesPreviewFiles = (\n srcDir: string,\n basePath: string,\n hasExamples: boolean\n): { content: string; path: string }[] =>\n hasExamples\n ? [\n {\n content: examplesPageTemplate(),\n path: join(\n srcDir,\n \"pages\",\n ...basePath.split(\"/\").filter(Boolean),\n \"blume-examples\",\n \"[...path].astro\"\n ),\n },\n ]\n : [];\n\nconst ejectIntegrationBridge = (\n config: BlumeProject[\"config\"],\n root: string,\n configFile: string | null\n): Parameters<typeof astroConfigTemplate>[0][\"integrationBridge\"] =>\n config.integrations.length > 0 && configFile\n ? { configFile: toPosix(relative(root, configFile)) }\n : undefined;\n\n/**\n * Promote the generated runtime into the project as an owned Astro app. After\n * eject the project has a normal `astro.config.mjs` and `src/`, the `blume` CLI\n * is no longer required, and the `blume` package remains importable.\n *\n * Returns the written files plus non-fatal warnings, mirroring the generated\n * runtime (e.g. a Scalar reference spec that wasn't found, or a reference\n * route colliding with a content page).\n */\nexport const eject = async (\n root: string\n): Promise<{ files: string[]; warnings: string[] }> => {\n const project = await scanProject(root, { mode: \"build\" });\n const { context, config } = project;\n\n const srcDir = join(root, \"src\");\n const genDir = join(srcDir, \"generated\");\n const askEnabled = config.ai.ask?.enabled ?? false;\n const exportPdf = config.export.pdf;\n const exportEpub = config.export.epub;\n\n // Discover examples first and expose them on the project, so the agent-facing\n // Markdown built below (raw `.md`, MCP) downlevels `<Component>` to its source.\n const examples = await discoverExamples(root, config.examples.source);\n project.examples = exampleMarkdownLookup(examples.examples);\n\n const [\n pages,\n needsReactRaw,\n usesMath,\n userTheme,\n userExamplesCss,\n rawMarkdown,\n islands,\n ] = await Promise.all([\n context.pagesRoot ? discoverPages(context.pagesRoot) : Promise.resolve([]),\n detectNeedsReact(root),\n detectUsesMath(root),\n readUserCss(context.themeFile, genDir),\n readUserCss(\n config.examples.css ? join(root, config.examples.css) : null,\n genDir\n ),\n buildRawMarkdown(project),\n discoverIslands(root),\n ]);\n // Island/example frameworks drive which Astro renderers the ejected config\n // wires in; React also switches on for project `.tsx`/`.jsx` and Ask AI.\n const frameworks = new Set<string>([\n ...islands.islands.map((island) => island.framework),\n ...examples.examples.map((example) => example.framework),\n ]);\n const needsReact = needsReactRaw || askEnabled || frameworks.has(\"react\");\n const needsVue = frameworks.has(\"vue\");\n const needsSvelte = frameworks.has(\"svelte\");\n\n // A project-relative context so generated files use portable paths.\n const relContext: ProjectContext = {\n ...context,\n contentRoot: toPosix(relative(root, context.contentRoot)),\n outDir: \".\",\n root: \".\",\n };\n\n const componentsImport = context.componentsFile\n ? `../../${toPosix(relative(root, context.componentsFile))}`\n : null;\n const relPages = [\n ...pages.map((page) => ({\n entrypoint: toPosix(relative(root, page.entrypoint)),\n pattern: page.pattern,\n })),\n ...mcpDiscoveryPages(project, pages),\n ];\n\n // Non-filesystem sources eject their materialized MDX into `<root>/blume-staged`\n // (a dedicated dir so it never clashes with a content root literally named\n // `content`; the relative `staged` collection points there).\n const staged = collectStaged(project);\n const hasStaged = staged.size > 0;\n const stagedDir = \"blume-staged\";\n const features = await clientFeaturesFor(project);\n const languageIcons = await languageIconCssFor(project);\n\n const files: {\n path: string;\n content: string;\n /** Don't overwrite a file the user already owns (e.g. a tuned tsconfig). */\n skipIfExists?: boolean;\n }[] = [\n {\n content: astroConfigTemplate({\n askPath: \"./src/generated/Ask.astro\",\n config,\n contentRoot: relContext.contentRoot,\n contentRoutes: project.manifest.routes.map((route) => route.path),\n context: relContext,\n examplesPath: \"./src/generated/examples.ts\",\n examplesThemePath: \"./src/generated/examples.css\",\n features,\n featuresPath: \"./src/generated/features.ts\",\n // No CLI publishes the runtime data modules in memory after eject, so\n // the config aliases each to the JSON snapshot written below.\n generatedModulesDir: \"./src/generated\",\n integrationBridge: ejectIntegrationBridge(\n config,\n root,\n context.configFile\n ),\n needsReact,\n needsSvelte,\n needsVue,\n pages: relPages,\n searchClientPath: \"./src/generated/search-client.ts\",\n themePath: \"./src/generated/app.css\",\n }),\n path: join(root, \"astro.config.mjs\"),\n },\n {\n content: runtimeTsconfigTemplate(),\n path: join(root, \"tsconfig.json\"),\n // Never clobber a hand-tuned tsconfig; only write ours if none exists.\n skipIfExists: true,\n },\n {\n content: contentConfigTemplate({\n config,\n context: relContext,\n staged: hasStaged,\n stagedBase: stagedDir,\n }),\n path: join(srcDir, \"content.config.ts\"),\n },\n {\n content: catchAllPageTemplate({\n exportEpub,\n exportPdf,\n mathEnabled: usesMath,\n needsReact,\n }),\n path: join(srcDir, \"pages\", \"[...slug].astro\"),\n },\n {\n // Eject keeps the portable re-export form (relative import to the user's\n // components file); hydration/island wrappers would need machine-specific\n // absolute paths, so the ejected app owns and wires those itself.\n content: planComponentSlots(componentsImport, null).module,\n path: join(genDir, \"components.ts\"),\n },\n // Island/example maps the catch-all imports; written even when empty so the\n // relative import and the `blume:examples` alias always resolve.\n {\n content: islandMapTemplate(islands.islands),\n path: join(genDir, \"islands.ts\"),\n },\n {\n content: exampleMapTemplate(examples.examples, config.basePath),\n path: join(genDir, \"examples.ts\"),\n },\n {\n // The isolated Tailwind entry for `<Component />` preview frames.\n // Relative sources keep the ejected app portable.\n content: examplesEntryTemplate({\n configTokens: buildThemeCss(config.theme),\n sources: exampleScanRoots(root, examples.dir).map(\n (dir) => `${relative(genDir, dir)}/${EXAMPLE_SCAN_GLOB}`\n ),\n userCss: userExamplesCss,\n }),\n path: join(genDir, \"examples.css\"),\n },\n {\n content: tailwindEntryTemplate({\n configTokens: buildThemeCss(config.theme),\n languageIcons,\n // Relative paths from src/generated/app.css keep the ejected app\n // portable; the blume glob resolves the real install location when\n // the package is hoisted out of the project's own node_modules.\n sources: [\n blumeSourceGlob(root, genDir),\n \"../../**/*.{astro,mdx,ts,tsx}\",\n ],\n twoslashCss: twoslashCss(),\n userTheme,\n }),\n path: join(genDir, \"app.css\"),\n },\n { content: buildRuntimeData(project), path: join(genDir, \"data.json\") },\n // The header's Ask trigger behind the `blume:ask` alias. Always written — it\n // renders nothing when Ask is off — so the alias always resolves.\n {\n content: askComponentTemplate(askEnabled),\n path: join(genDir, \"Ask.astro\"),\n },\n {\n content: `${JSON.stringify(ejectOpenApiData(project))}\\n`,\n path: join(genDir, \"openapi.json\"),\n },\n {\n content: `${JSON.stringify(rawMarkdown)}\\n`,\n path: join(genDir, \"raw-markdown.json\"),\n },\n {\n // The partial → including-pages map behind `includeHmrPlugin`, which the\n // ejected astro.config wires at this exact path — without the file every\n // hot update's read would silently no-op and partial edits would serve\n // stale pages. A snapshot like the rest of `src/generated`: the ejected\n // app owns (and may regenerate or prune) it.\n content: `${JSON.stringify(buildIncludeGraph(project.graph.pages))}\\n`,\n path: join(genDir, \"includes.json\"),\n },\n {\n content: rawMarkdownEndpointTemplate(\"md\"),\n path: join(srcDir, \"pages\", \"[...slug].md.ts\"),\n },\n {\n content: rawMarkdownEndpointTemplate(\"mdx\"),\n path: join(srcDir, \"pages\", \"[...slug].mdx.ts\"),\n },\n ];\n\n if (askEnabled) {\n files.push(...(await askFiles(project, srcDir, genDir)));\n }\n\n if (config.seo.og.enabled) {\n files.push({\n content: ogEndpointTemplate(\n customOgRoutes(pages, config.title, config.seo.og.titles),\n { pageDescriptions: config.seo.og.description !== false }\n ),\n path: join(srcDir, \"pages\", \"og\", \"[...slug].png.ts\"),\n });\n }\n\n // The hosted MCP server and the `/changelog` index, mirrored from the\n // generated runtime (each helper returns `[]` when its feature is off).\n files.push(\n ...(await mcpFiles(project, pages, srcDir, genDir)),\n ...changelogFiles(project, pages, srcDir, {\n exportEpub,\n exportPdf,\n mathEnabled: usesMath,\n needsReact,\n staged: hasStaged,\n })\n );\n\n // Default 404 page, unless the project already owns `/404` (a custom\n // `pages/404.astro` or a `404.md` content page). The ejected project owns the\n // file afterwards and can edit or remove it.\n if (!routeIsTaken(pages, project.graph.pages, \"/404\")) {\n files.push({\n content: notFoundPageTemplate(),\n path: join(srcDir, \"pages\", \"404.astro\"),\n });\n }\n\n // The client-feature loaders behind the `blume:features` alias, and the\n // provider-specific client loader behind `blume:search-client`.\n files.push(\n {\n content: featuresTemplate(features),\n path: join(genDir, \"features.ts\"),\n },\n {\n content: searchClientTemplate(config),\n path: join(genDir, \"search-client.ts\"),\n }\n );\n\n if (servesStaticIndex(config.search.provider)) {\n const documents = await buildSearchDocuments(project);\n files.push(\n {\n content: `${JSON.stringify(documents)}\\n`,\n path: join(genDir, \"search.json\"),\n },\n {\n content: searchEndpointTemplate(),\n path: join(srcDir, \"pages\", \"blume-search.json.ts\"),\n }\n );\n }\n\n if (config.search.provider === \"mixedbread\") {\n files.push({\n content: mixedbreadSearchEndpointTemplate(\n config.search.mixedbread?.storeId ?? \"\"\n ),\n path: join(srcDir, \"pages\", \"api\", \"search.ts\"),\n });\n }\n\n const feeds = buildRssFeeds(project);\n if (feeds.length > 0) {\n const feedXml = Object.fromEntries(\n feeds.map((feed) => [feed.type, renderRssFeed(feed)])\n );\n files.push(\n {\n content: `${JSON.stringify(feedXml)}\\n`,\n path: join(genDir, \"rss.json\"),\n },\n {\n content: rssEndpointTemplate(),\n path: join(srcDir, \"pages\", \"[section]\", \"rss.xml.ts\"),\n }\n );\n }\n\n // Scalar API/AsyncAPI reference pages, mirrored from the generated runtime so\n // the ejected app keeps its reference routes — including the warnings (a\n // missing spec file, a route collision), which the caller surfaces exactly\n // like the generated-runtime path does.\n const warnings: string[] = [];\n if (hasScalarReferences(config)) {\n const references = await buildReferenceFiles({\n config,\n contentRoutes: new Set(project.graph.pages.map((page) => page.route)),\n root,\n });\n warnings.push(...references.warnings);\n for (const file of references.files) {\n files.push({\n content: file.content,\n path: join(srcDir, \"pages\", file.pagePath),\n });\n }\n }\n\n // Per-island and per-example live wrappers referenced by the maps above.\n files.push(\n ...islands.islands.map((island) => ({\n content: islandWrapperTemplate(island),\n path: join(genDir, \"islands\", `${island.name}.astro`),\n })),\n ...examples.examples.map((example) => ({\n content: exampleWrapperTemplate(example),\n path: join(genDir, \"examples\", `${exampleSlug(example.path)}.astro`),\n })),\n ...examplesPreviewFiles(\n srcDir,\n config.basePath,\n examples.examples.length > 0\n )\n );\n\n // Materialize staged source bodies under `<root>/blume-staged/<source>/<ref>`,\n // matching the relative `staged` collection base in the ejected config.\n for (const [entryId, content] of staged) {\n files.push({ content, path: join(root, stagedDir, entryId) });\n }\n\n const written = files.filter(\n (file) => !(file.skipIfExists && existsSync(file.path))\n );\n await Promise.all(\n written.map(async (file) => {\n await mkdir(join(file.path, \"..\"), { recursive: true });\n await writeFile(file.path, file.content, \"utf-8\");\n })\n );\n\n // Materialized source assets (e.g. downloaded Notion images) live under the\n // hidden runtime's public dir; copy them into the owned project's `public/`\n // so the staged content's `/blume-assets/…` references still resolve.\n const assetsSrc = join(context.outDir, \"public\", \"blume-assets\");\n if (existsSync(assetsSrc)) {\n await cp(assetsSrc, join(root, \"public\", \"blume-assets\"), {\n recursive: true,\n });\n }\n\n // The hidden runtime is no longer the source of truth.\n await rm(context.outDir, { force: true, recursive: true });\n\n return { files: written.map((file) => file.path), warnings };\n};\n",
6
- "import { readFile, writeFile } from \"node:fs/promises\";\n\nimport { join } from \"pathe\";\n\n/** A JSON value, as `JSON.parse` of a manifest can return. */\ntype JsonValue =\n | string\n | number\n | boolean\n | null\n | JsonValue[]\n | { [key: string]: JsonValue };\n\n/** The slice of package.json the rewrite touches; the rest rides along. */\ninterface PackageManifest {\n [key: string]: JsonValue | undefined;\n scripts?: Record<string, string>;\n}\n\n/**\n * Rewrite the project's package.json scripts to run Astro directly. After an\n * eject the Blume CLI no longer manages the runtime, so scaffolded scripts like\n * `\"dev\": \"blume dev\"` would rebuild the removed `.blume` tree instead of\n * serving the ejected app. A missing or unreadable package.json is left alone.\n */\nexport const updatePackageScripts = async (root: string): Promise<void> => {\n const pkgPath = join(root, \"package.json\");\n let pkg: PackageManifest;\n try {\n pkg = JSON.parse(await readFile(pkgPath, \"utf-8\"));\n } catch {\n return;\n }\n const scripts = pkg.scripts ?? {};\n pkg.scripts = {\n ...scripts,\n build: \"astro build\",\n dev: \"astro dev\",\n preview: \"astro preview\",\n };\n await writeFile(pkgPath, `${JSON.stringify(pkg, null, 2)}\\n`, \"utf-8\");\n};\n",
7
- "import { existsSync } from \"node:fs\";\nimport { mkdir, writeFile } from \"node:fs/promises\";\n\nimport { detect } from \"package-manager-detector/detect\";\nimport { basename, dirname, isAbsolute, join, relative } from \"pathe\";\n\nimport { blumePackageJson, toPackageName } from \"../../core/package-json.ts\";\n\nexport const TEMPLATES = [\"docs\", \"api\", \"sdk\", \"changelog\"] as const;\nexport type Template = (typeof TEMPLATES)[number];\n\nexport const PACKAGE_MANAGERS = [\"npm\", \"pnpm\", \"yarn\", \"bun\"] as const;\nexport type PackageManager = (typeof PACKAGE_MANAGERS)[number];\n\n/** The content-source kinds `init` can scaffold a config block for. */\nexport const SOURCE_KINDS = [\n \"filesystem\",\n \"obsidian\",\n \"github-releases\",\n \"notion\",\n \"sanity\",\n \"mdx-remote\",\n] as const;\nexport type SourceKind = (typeof SOURCE_KINDS)[number];\n\n/** Everything the scaffolder needs, whether prompted or derived from flags. */\nexport interface InitAnswers {\n contentDir: string;\n /** Target directory as the user gave it (`.` = current directory). */\n directory: string;\n packageManager: PackageManager;\n sources: SourceKind[];\n template: Template;\n title: string;\n}\n\n/** One file the scaffold plan will write; `path` is absolute. */\nexport interface ScaffoldFile {\n content: string;\n path: string;\n}\n\n/** Log sink for scaffold output — satisfied by both consola and clack's `log`. */\nexport interface ScaffoldLog {\n info: (message: string) => void;\n success: (message: string) => void;\n}\n\n/** A starter: a config fragment plus seed content files (paths relative to root). */\ninterface Starter {\n configExtra: string;\n files: (contentDir: string) => { content: string; path: string }[];\n}\n\nconst page = (title: string, description: string, body: string): string =>\n `---\\ntitle: ${title}\\ndescription: ${description}\\n---\\n\\n${body}\\n`;\n\nexport const STARTERS = {\n api: {\n configExtra: `\n openapi: {\n enabled: true,\n route: \"/api\",\n sources: [\n {\n label: \"Petstore\",\n spec: \"https://petstore3.swagger.io/api/v3/openapi.json\",\n },\n ],\n },`,\n files: (dir) => [\n {\n content: page(\n \"API Reference\",\n \"Explore the API.\",\n \"# API Reference\\n\\nYour OpenAPI spec renders at [`/api`](/api). Point `openapi.sources` at your own spec in `blume.config.ts`.\"\n ),\n path: join(dir, \"index.mdx\"),\n },\n ],\n },\n changelog: {\n configExtra: `\n navigation: {\n tabs: [\n { label: \"Docs\", path: \"/\" },\n { label: \"Changelog\", path: \"/changelog\" },\n ],\n },`,\n files: (dir) => [\n {\n content: page(\n \"Introduction\",\n \"Welcome to your new Blume docs.\",\n \"# Introduction\\n\\nWrite your docs here, and log releases under `changelog/`.\"\n ),\n path: join(dir, \"index.mdx\"),\n },\n {\n content: `---\\ntitle: v1.0.0\\ntype: changelog\\ndate: 2026-01-01\\n---\\n\\nThe first release. Edit \\`${dir}/changelog/v1-0-0.mdx\\` or add new entries beside it.\\n`,\n path: join(dir, \"changelog\", \"v1-0-0.mdx\"),\n },\n ],\n },\n docs: {\n configExtra: \"\",\n files: (dir) => [\n {\n content: page(\n \"Introduction\",\n \"Welcome to your new Blume docs.\",\n `# Introduction\\n\\nWelcome to **Blume** — markdown-first docs powered by Astro and Vite.\\n\\nEdit \\`${dir}/index.mdx\\` to get started, then run \\`blume dev\\`.`\n ),\n path: join(dir, \"index.mdx\"),\n },\n ],\n },\n sdk: {\n configExtra: \"\",\n files: (dir) => [\n {\n content: page(\n \"Introduction\",\n \"Get started with the SDK.\",\n \"# Introduction\\n\\nInstall the SDK and make your first call. See [Installation](/installation).\"\n ),\n path: join(dir, \"index.mdx\"),\n },\n {\n content: page(\n \"Installation\",\n \"Install the SDK.\",\n \"# Installation\\n\\n```package-install\\nyour-sdk\\n```\"\n ),\n path: join(dir, \"installation.mdx\"),\n },\n ],\n },\n} satisfies Record<Template, Starter>;\n\n/**\n * Install + dev commands to print for the chosen package manager, plus the\n * prefix that runs a locally installed bin (`exec`, e.g. `npx blume eject`) —\n * dependency bins aren't on PATH, so a bare `blume …` hint would not run.\n */\nexport const commandsFor = (pm: PackageManager) => ({\n // `bun build` invokes Bun's bundler, not the package.json `build` script —\n // unlike `bun dev`, the script name is shadowed by a builtin subcommand.\n build: pm === \"npm\" || pm === \"bun\" ? `${pm} run build` : `${pm} build`,\n dev: pm === \"npm\" ? \"npm run dev\" : `${pm} dev`,\n exec: { bun: \"bunx\", npm: \"npx\", pnpm: \"pnpm exec\", yarn: \"yarn\" }[pm],\n install: `${pm} install`,\n});\n\nconst isPackageManager = (value: string): value is PackageManager =>\n PACKAGE_MANAGERS.some((pm) => pm === value);\n\n/**\n * Derive the package manager from an npm user-agent string (the first\n * `name/version` token of `npm_config_user_agent`), falling back to npm.\n * Right for `init`, where the project doesn't exist yet and the invoking\n * runner is the only signal.\n */\nexport const detectPackageManager = (userAgent?: string): PackageManager => {\n const name = userAgent?.split(\"/\")[0];\n return name !== undefined && isPackageManager(name) ? name : \"npm\";\n};\n\n/**\n * Detect an existing project's package manager from its lockfile /\n * `packageManager` field (package-manager-detector), falling back to the\n * user agent. Right for `eject`: the CLI is often run directly (`npx blume\n * eject`, a bare `blume eject`), where `npm_config_user_agent` is absent or\n * names the runner rather than the project's manager, and the old\n * user-agent-only detection silently printed npm hints for a pnpm project.\n */\nexport const detectProjectPackageManager = async (\n root: string\n): Promise<PackageManager> => {\n const detected = await detect({ cwd: root });\n const name = detected?.name;\n return name !== undefined && isPackageManager(name)\n ? name\n : detectPackageManager(process.env.npm_config_user_agent);\n};\n\n/**\n * The content dir is joined into every scaffolded file path, so an absolute or\n * `../`-escaping value would write outside the project. Returns an error\n * message, or `undefined` when the dir is safe.\n */\nexport const validateContentDir = (\n root: string,\n dir: string\n): string | undefined =>\n isAbsolute(dir) || relative(root, join(root, dir)).startsWith(\"..\")\n ? \"Must be a relative path inside the project.\"\n : undefined;\n\n/** Turn a directory name into a display title: `my-docs` → `My Docs`. */\nexport const titleize = (raw: string): string => {\n const words = raw\n .replaceAll(/[-_.]+/gu, \" \")\n .split(/\\s+/u)\n .filter(Boolean);\n return words.length === 0\n ? \"My Docs\"\n : words\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(\" \");\n};\n\n/**\n * True when any selected source needs an explicit `content.sources` array —\n * everything except `filesystem`, which is what the implicit default already\n * desugars to.\n */\nconst needsExplicitSources = (sources: SourceKind[]): boolean =>\n sources.some((source) => source !== \"filesystem\");\n\n/**\n * Config snippets for each remote source kind, with placeholder values to\n * replace and comments naming the env var each source authenticates with.\n */\nconst SOURCE_SNIPPETS = {\n \"github-releases\": ` // Changelog entries from GitHub Releases. Private repos read\n // GITHUB_TOKEN from the environment.\n {\n type: \"github-releases\",\n owner: \"your-org\",\n repo: \"your-repo\",\n prefix: \"changelog\",\n },`,\n \"mdx-remote\": ` // MDX fetched from a GitHub repo. Private repos read GITHUB_TOKEN\n // from the environment.\n {\n type: \"mdx-remote\",\n github: { owner: \"your-org\", repo: \"your-repo\", path: \"docs\" },\n prefix: \"remote\",\n },`,\n notion: ` // Pages from a Notion database. Reads NOTION_TOKEN from the environment.\n {\n type: \"notion\",\n database: \"your-database-id\",\n prefix: \"notion\",\n },`,\n obsidian: ` // An Obsidian vault, read in place. No export step, and no\n // generated notes in your repo. Point \\`vault\\` at your vault directory,\n // relative to this config file.\n {\n type: \"obsidian\",\n vault: \"vault\",\n prefix: \"notes\",\n },`,\n sanity: ` // Documents from a Sanity dataset. Private datasets read SANITY_TOKEN\n // from the environment.\n {\n type: \"sanity\",\n projectId: \"your-project-id\",\n dataset: \"production\",\n query: \\`*[_type == \"doc\"]\\`,\n prefix: \"sanity\",\n },`,\n} satisfies Record<Exclude<SourceKind, \"filesystem\">, string>;\n\n/**\n * The `content` block for the generated config, or an empty string when the\n * defaults (filesystem source, `docs` root) apply — keeping the default\n * scaffold byte-identical to a config with no `content` key at all.\n */\nconst contentBlockFor = (answers: InitAnswers): string => {\n const sources =\n answers.sources.length === 0 ? [\"filesystem\" as const] : answers.sources;\n if (!needsExplicitSources(sources)) {\n return answers.contentDir === \"docs\"\n ? \"\"\n : `\n content: {\n root: ${JSON.stringify(answers.contentDir)},\n },`;\n }\n // Explicit sources replace the implicit filesystem desugar, so the local\n // content dir must be listed alongside the other sources to stay included.\n const entries = SOURCE_KINDS.filter((kind) => sources.includes(kind)).map(\n (kind) =>\n kind === \"filesystem\"\n ? ` { type: \"filesystem\", root: ${JSON.stringify(answers.contentDir)} },`\n : SOURCE_SNIPPETS[kind]\n );\n return `\n content: {\n sources: [\n${entries.join(\"\\n\")}\n ],\n },`;\n};\n\n/** The full `blume.config.ts` text for the chosen answers. */\nexport const buildConfig = (\n answers: InitAnswers\n): string => `import { defineConfig } from \"blume\";\n\nexport default defineConfig({\n title: ${JSON.stringify(answers.title)},\n description: \"Documentation powered by Blume.\",${STARTERS[answers.template].configExtra}${contentBlockFor(answers)}\n});\n`;\n\n/** SDK dependencies required by the selected remote sources. */\nconst extraDepsFor = (sources: SourceKind[]) => {\n const deps: Record<string, string> = {};\n if (sources.includes(\"notion\")) {\n deps[\"@notionhq/client\"] = \"^2.2.15\";\n }\n if (sources.includes(\"sanity\")) {\n deps[\"@sanity/client\"] = \"^7.25.0\";\n }\n return deps;\n};\n\n/** Every file `init` should write for the given answers, package.json first. */\nexport const buildPlan = (\n root: string,\n answers: InitAnswers\n): ScaffoldFile[] => {\n const files: ScaffoldFile[] = [\n {\n content: blumePackageJson(\n toPackageName(basename(root)),\n extraDepsFor(answers.sources)\n ),\n path: join(root, \"package.json\"),\n },\n { content: buildConfig(answers), path: join(root, \"blume.config.ts\") },\n ];\n // Seed pages only make sense when a local filesystem source will read them.\n if (answers.sources.length === 0 || answers.sources.includes(\"filesystem\")) {\n files.push(\n ...STARTERS[answers.template]\n .files(answers.contentDir)\n .map((file) => ({ ...file, path: join(root, file.path) }))\n );\n }\n // The obsidian snippet points at `vault/`; seed the directory with a first\n // note so the scaffolded project passes the source's `validate()` and boots\n // before the user has opened Obsidian at all.\n if (answers.sources.includes(\"obsidian\")) {\n files.push({\n content:\n \"# Welcome\\n\\nThis folder is read by Blume's `obsidian` source. Open it as a vault in Obsidian and write notes — `[[Wikilinks]]` become site links.\\n\",\n path: join(root, \"vault\", \"Welcome.md\"),\n });\n }\n return files;\n};\n\nconst writeFileSafe = async (\n file: ScaffoldFile,\n log: ScaffoldLog\n): Promise<boolean> => {\n if (existsSync(file.path)) {\n log.info(`Skipped existing ${file.path}`);\n return false;\n }\n await mkdir(dirname(file.path), { recursive: true });\n await writeFile(file.path, file.content, \"utf-8\");\n log.success(`Created ${file.path}`);\n return true;\n};\n\n/**\n * Write the plan's files, skipping any that already exist. Reports whether a\n * `package.json` was newly created (it decides the install next-step).\n */\nexport const applyPlan = async (\n files: ScaffoldFile[],\n log: ScaffoldLog\n): Promise<{ createdPackage: boolean }> => {\n const created = await Promise.all(\n files.map((file) => writeFileSafe(file, log))\n );\n const createdPackage = files.some(\n (file, index) => created[index] && basename(file.path) === \"package.json\"\n );\n return { createdPackage };\n};\n\n/** Env vars the selected sources read, in a stable order. */\nconst envVarsFor = (sources: SourceKind[]): string[] =>\n [\n [\"GITHUB_TOKEN\", [\"github-releases\", \"mdx-remote\"]] as const,\n [\"NOTION_TOKEN\", [\"notion\"]] as const,\n [\"SANITY_TOKEN\", [\"sanity\"]] as const,\n ]\n .filter(([, kinds]) => kinds.some((kind) => sources.includes(kind)))\n .map(([envVar]) => envVar);\n\n/** The next-steps message: `cd` hint, install/dev commands, and token setup. */\nexport const nextSteps = (\n answers: InitAnswers,\n createdPackage: boolean\n): string => {\n const commands = commandsFor(answers.packageManager);\n const lines: string[] = [];\n if (answers.directory !== \".\") {\n lines.push(`cd ${answers.directory}`);\n }\n if (createdPackage) {\n lines.push(commands.install);\n }\n lines.push(commands.dev);\n const envVars = envVarsFor(answers.sources);\n const auth =\n envVars.length > 0\n ? `\\nSet ${envVars.join(\" and \")} in .env.local so your sources can authenticate.\\n`\n : \"\";\n return `Next steps:\\n\\n ${lines.join(\"\\n \")}\\n${auth}`;\n};\n",
8
- "import { getBlumeVersion } from \"./version.ts\";\n\n/**\n * Derive a valid npm package name from a directory name, falling back to\n * `docs` when nothing usable remains.\n */\nexport const toPackageName = (raw: string): string =>\n raw\n .toLowerCase()\n .replaceAll(/[^a-z0-9._-]+/gu, \"-\")\n .replaceAll(/^[-_.]+|[-_.]+$/gu, \"\") || \"docs\";\n\n/**\n * A minimal, runnable `package.json` body for a Blume project: the `blume`\n * dependency pinned to the installed version plus `dev`/`build`/`doctor`\n * scripts, so `npm install && npm run dev` works immediately. Shared by\n * `blume init` and the migrators, which scaffold one when a project has none.\n * `extraDeps` adds source SDKs (e.g. `@notionhq/client`) beside `blume`.\n */\nexport const blumePackageJson = (\n name: string,\n extraDeps: Record<string, string> = {}\n): string => {\n const dependencies = Object.entries({\n blume: `^${getBlumeVersion()}`,\n ...extraDeps,\n })\n .toSorted(([a], [b]) => (a < b ? -1 : 1))\n .map(\n ([dep, range]) => ` ${JSON.stringify(dep)}: ${JSON.stringify(range)}`\n )\n .join(\",\\n\");\n return `{\n \"name\": ${JSON.stringify(name)},\n \"private\": true,\n \"type\": \"module\",\n \"scripts\": {\n \"dev\": \"blume dev\",\n \"build\": \"blume build\",\n \"doctor\": \"blume doctor\"\n },\n \"dependencies\": {\n${dependencies}\n }\n}\n`;\n};\n"
9
- ],
10
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAEA;AAsEA,IAAM,UAAU,CAAC,SAAyB,KAAK,MAAM,IAAI,EAAE,KAAK,GAAG;AAGnE,IAAM,qBAAqB;AAapB,IAAM,kBAAkB,CAC7B,MACA,QACA,mBAAiC,gBACtB;AAAA,EACX,IAAI,WAAW,KAAK,MAAM,gBAAgB,OAAO,CAAC,GAAG;AAAA,IACnD,OAAO;AAAA,EACT;AAAA,EACA,IAAI;AAAA,IACF,MAAM,MAAM,KAAK,iBAAiB,GAAG,KAAK;AAAA,IAC1C,OAAO,GAAG,QAAQ,SAAS,QAAQ,GAAG,CAAC;AAAA,IACvC,MAAM;AAAA,IACN,QAAQ,KACN,iQACF;AAAA,IACA,OAAO;AAAA;AAAA;AAKX,IAAM,mBAAmB,CAAC,YAAuC;AAAA,EAC/D,MAAM,SAAS,QAAQ,QAAQ,KAAK,eAAe;AAAA,EACnD,OAAO,SAAS,OAAO,YAAY,IAAI,CAAC;AAAA;AAO1C,IAAM,WAAW,OACf,SACA,QACA,WACiD;AAAA,EACjD,QAAQ,QAAQ,QAAQ,OAAO;AAAA,EAC/B,IAAI,EAAE,KAAK,WAAW,CAAC,IAAI,WAAW;AAAA,IACpC,MAAM,eAAe,KAAK,QAAQ,SAAS,OAAO,QAAQ;AAAA,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AAC,mBAAmB,YAAY,CAAC;AAAA,EAClD,CAAC,gBAAgB,CAAC,QAAQ,CAAC;AAAA,EAC3B,CAAC,gBAAgB,CAAC,QAAQ,CAAC;AAC7B,EACG,OAAO,IAAI,WAAW,MAAM,KAAK,CAAC,SAAS,QAAQ,SAAS,IAAI,CAAC,CAAC,EAClE,IAAI,EAAE,YAAY,MAAM;AAGtB,IAAM,YAAY,CACvB,SACA,mBACW;AAAA,EACX,MAAM,WAAW,YAAY,QAAQ,cAAc;AAAA,EACnD,MAAM,QAAkB,CAAC;AAAA,EACzB,IAAI,QAAQ,cAAc,KAAK;AAAA,IAC7B,MAAM,KAAK,MAAM,QAAQ,WAAW;AAAA,EACtC;AAAA,EACA,IAAI,gBAAgB;AAAA,IAClB,MAAM,KAAK,SAAS,OAAO;AAAA,EAC7B;AAAA,EACA,MAAM,KAAK,SAAS,GAAG;AAAA,EACvB,MAAM,UAAU,WAAW,QAAQ,OAAO;AAAA,EAC1C,MAAM,OACJ,QAAQ,SAAS,IACb;AAAA,MAAS,QAAQ,KAAK,OAAO;AAAA,IAC7B;AAAA,EACN,OAAO;AAAA;AAAA,IAAoB,MAAM,KAAK;AAAA,GAAM;AAAA,EAAM;AAAA;",
11
- "debugId": "9855940EC5BAA3FC64756E2164756E21",
12
- "names": []
13
- }
@@ -1,381 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- discoverPages,
4
- customStaticRoutes,
5
- hasGeneratedChangelog
6
- } from "./chunk-vrfp10qk.js";
7
- import {
8
- commandMeta,
9
- reportInternalError,
10
- BlumeError,
11
- logger,
12
- flushStdout,
13
- reportDiagnosticsJson,
14
- reportDiagnostics
15
- } from "./index.js";
16
- import {
17
- localePrefix,
18
- localizeRoute,
19
- buildManifest,
20
- scanProject
21
- } from "./chunk-1jefwnfs.js";
22
- import"./chunk-7s8hm3b6.js";
23
- import {
24
- isRelativeImageTarget,
25
- resolveRelativeImage
26
- } from "./chunk-bf6bt1xt.js";
27
- import {
28
- gradeExternal,
29
- probeAll
30
- } from "./chunk-vh9w1sgp.js";
31
- import {
32
- normalizePath,
33
- withBasePath,
34
- stripBasePath
35
- } from "./chunk-2mzebbbz.js";
36
-
37
- // src/cli/commands/validate.ts
38
- import { existsSync as existsSync2 } from "node:fs";
39
- import { defineCommand } from "citty";
40
- import { join as join2 } from "pathe";
41
-
42
- // src/core/links.ts
43
- import { existsSync } from "node:fs";
44
- import { basename, dirname, join, relative, resolve } from "pathe";
45
-
46
- // src/core/locale-links.ts
47
- var decodePercent = (value) => {
48
- try {
49
- return decodeURIComponent(value);
50
- } catch {
51
- return value;
52
- }
53
- };
54
- var hasLocalePrefix = (path, i18n) => i18n.locales.some((locale) => {
55
- const prefix = localePrefix(locale.code, i18n);
56
- return prefix !== "" && (path === prefix || path.startsWith(`${prefix}/`));
57
- });
58
- var localizeLinkPath = (path, options) => {
59
- const { basePath, i18n, locale, routes } = options;
60
- if (localePrefix(locale, i18n) === "") {
61
- return path;
62
- }
63
- const rest = normalizePath(stripBasePath(basePath, path));
64
- if (hasLocalePrefix(rest, i18n)) {
65
- return path;
66
- }
67
- const localized = withBasePath(basePath, localizeRoute(rest, locale, i18n));
68
- return routes.has(localized) || routes.has(decodePercent(localized)) ? localized : path;
69
- };
70
- var routeSets = new WeakMap;
71
-
72
- // src/core/links.ts
73
- var HTTP = /^https?:\/\//iu;
74
- var PROTOCOL_RELATIVE = /^\/\//u;
75
- var SCHEME = /^[a-z][a-z0-9+.-]*:/iu;
76
- var decodePercent2 = (value) => {
77
- try {
78
- return decodeURIComponent(value);
79
- } catch {
80
- return value;
81
- }
82
- };
83
- var DOC_EXT = /\.(?:md|mdx)$/iu;
84
- var FILE_EXT = /\.[a-z0-9]+$/iu;
85
- var includedBySuffix = (link, page) => link.file ? ` (included by ${basename(page.sourcePath ?? page.id)})` : "";
86
- var authoredImageTarget = (target, pagePath, partialPath) => {
87
- const authored = relative(dirname(partialPath), resolve(dirname(pagePath), target));
88
- return authored.startsWith(".") ? authored : `./${authored}`;
89
- };
90
- var assetIsPresent = (resolved, ctx) => ctx.publicDir !== null && existsSync(join(ctx.publicDir, resolved));
91
- var NUMERIC_PREFIX = /^\d+[-_.]/u;
92
- var isIndexPage = (page) => /^index\.(?:md|mdx)$/iu.test(basename(page.navPath).replace(NUMERIC_PREFIX, ""));
93
- var applyRelativePart = (segments, part) => {
94
- if (part === "" || part === ".") {
95
- return;
96
- }
97
- if (part === "..") {
98
- segments.pop();
99
- return;
100
- }
101
- segments.push(part);
102
- };
103
- var resolveRelative = (pageRoute, target, isIndex) => {
104
- const segments = pageRoute.split("/").filter(Boolean);
105
- if (!isIndex) {
106
- segments.pop();
107
- }
108
- for (const part of target.split("/")) {
109
- applyRelativePart(segments, part);
110
- }
111
- return `/${segments.join("/")}`;
112
- };
113
- var toRoute = (path) => {
114
- let route = path.replace(DOC_EXT, "");
115
- if (route.endsWith("/index")) {
116
- route = route.slice(0, -"/index".length);
117
- }
118
- if (route.length > 1 && route.endsWith("/")) {
119
- route = route.slice(0, -1);
120
- }
121
- return route === "" ? "/" : route;
122
- };
123
- var buildAnchorIndex = (pages) => {
124
- const anchors = new Map;
125
- for (const page of pages) {
126
- anchors.set(page.route, new Set([
127
- ...page.headings.map((heading) => heading.slug),
128
- ...page.anchors
129
- ]));
130
- }
131
- return anchors;
132
- };
133
- var checkAnchor = (route, fragment, site, ctx, via = "") => {
134
- const anchors = ctx.anchors.get(route);
135
- if (anchors?.has(fragment) || anchors?.has(fragment.toLowerCase())) {
136
- return null;
137
- }
138
- return {
139
- ...site,
140
- code: "BLUME_BROKEN_ANCHOR",
141
- message: `No anchor target on ${route} matches #${fragment}${via}.`,
142
- severity: "warning"
143
- };
144
- };
145
- var servedRoute = (authored, page, ctx) => ctx.i18n ? localizeLinkPath(authored, {
146
- basePath: ctx.basePath,
147
- i18n: ctx.i18n,
148
- locale: page.locale,
149
- routes: {
150
- has: (route) => ctx.routes.has(route) || ctx.extraRoutes.has(route)
151
- }
152
- }) : authored;
153
- var checkPathLink = (resolved, fragment, page, link, site, ctx, via = "") => {
154
- const authoredRoute = toRoute(withBasePath(ctx.basePath, resolved));
155
- const route = servedRoute(authoredRoute, page, ctx);
156
- if (ctx.routes.has(route)) {
157
- return fragment ? checkAnchor(route, fragment, site, ctx, via) : null;
158
- }
159
- if (ctx.extraRoutes.has(route)) {
160
- return null;
161
- }
162
- if (ctx.redirects.has(route)) {
163
- return null;
164
- }
165
- const assetPath = stripBasePath(ctx.basePath, resolved);
166
- if (FILE_EXT.test(assetPath) && !DOC_EXT.test(assetPath)) {
167
- if (assetIsPresent(assetPath, ctx)) {
168
- return null;
169
- }
170
- if (link.image && page.sourcePath && isRelativeImageTarget(link.target)) {
171
- if (resolveRelativeImage(dirname(page.sourcePath), link.target)) {
172
- return null;
173
- }
174
- const authored = link.file ? authoredImageTarget(link.target, page.sourcePath, link.file) : link.target;
175
- return {
176
- ...site,
177
- code: "BLUME_BROKEN_ASSET",
178
- message: `Image ${authored} was not found next to ${basename(link.file ?? page.sourcePath)}.`,
179
- severity: "warning",
180
- suggestion: "Add the file next to the page source or fix the reference."
181
- };
182
- }
183
- if (ctx.publicDir === null) {
184
- return "asset-unchecked";
185
- }
186
- return {
187
- ...site,
188
- code: "BLUME_BROKEN_ASSET",
189
- message: `Asset ${assetPath} was not found in the public directory.`,
190
- severity: "warning",
191
- suggestion: `Add the file at public${assetPath} or fix the link.`
192
- };
193
- }
194
- return {
195
- ...site,
196
- code: "BLUME_BROKEN_LINK",
197
- message: `Broken link to ${link.target}${via}: no page resolves to ${route}.`,
198
- severity: "error",
199
- suggestion: "Check the path, or create the target page."
200
- };
201
- };
202
- var checkExternalLinks = async (refs) => {
203
- const results = await probeAll(refs.map((ref) => ref.url));
204
- const diagnostics = [];
205
- for (const ref of refs) {
206
- const result = results.get(ref.url);
207
- const grade = result ? gradeExternal(result) : null;
208
- if (grade) {
209
- diagnostics.push({
210
- code: "BLUME_DEAD_LINK",
211
- column: ref.column,
212
- file: ref.file,
213
- line: ref.line,
214
- message: `External link ${ref.url} is unreachable (${grade.detail}).`,
215
- severity: grade.severity
216
- });
217
- }
218
- }
219
- return diagnostics;
220
- };
221
- var classifyLink = (page, link, ctx, onExternal) => {
222
- const { target } = link;
223
- const site = {
224
- column: link.column,
225
- file: link.file ?? page.sourcePath ?? page.id,
226
- line: link.line
227
- };
228
- if (HTTP.test(target) || PROTOCOL_RELATIVE.test(target)) {
229
- onExternal({
230
- ...site,
231
- url: PROTOCOL_RELATIVE.test(target) ? `https:${target}` : target
232
- });
233
- return null;
234
- }
235
- if (SCHEME.test(target)) {
236
- return null;
237
- }
238
- const hashIndex = target.indexOf("#");
239
- const fragment = decodePercent2(hashIndex === -1 ? "" : target.slice(hashIndex + 1));
240
- let rawPath = hashIndex === -1 ? target : target.slice(0, hashIndex);
241
- const queryIndex = rawPath.indexOf("?");
242
- if (queryIndex !== -1) {
243
- rawPath = rawPath.slice(0, queryIndex);
244
- }
245
- rawPath = decodePercent2(rawPath);
246
- const via = rawPath.startsWith("/") ? "" : includedBySuffix(link, page);
247
- if (rawPath === "") {
248
- return fragment ? checkAnchor(page.route, fragment, site, ctx, via) : null;
249
- }
250
- const resolved = rawPath.startsWith("/") ? rawPath : resolveRelative(page.route, rawPath, isIndexPage(page));
251
- return checkPathLink(resolved, fragment, page, link, site, ctx, via);
252
- };
253
- var validateLinks = async (graph, options) => {
254
- const basePath = options.basePath ?? "";
255
- const ctx = {
256
- anchors: buildAnchorIndex(graph.pages),
257
- basePath,
258
- extraRoutes: new Set((options.extraRoutes ?? []).map(toRoute)),
259
- i18n: options.i18n ?? null,
260
- publicDir: options.publicDir,
261
- redirects: new Set((options.redirects ?? []).map((redirect) => toRoute(withBasePath(basePath, redirect.from)))),
262
- routes: new Set(graph.routes.keys())
263
- };
264
- const diagnostics = [];
265
- const external = [];
266
- let uncheckedAssets = 0;
267
- for (const page of graph.pages) {
268
- for (const link of page.links) {
269
- const result = classifyLink(page, link, ctx, (ref) => external.push(ref));
270
- if (result === "asset-unchecked") {
271
- uncheckedAssets += 1;
272
- } else if (result) {
273
- diagnostics.push(result);
274
- }
275
- }
276
- }
277
- if (uncheckedAssets > 0) {
278
- diagnostics.push({
279
- code: "BLUME_ASSETS_UNCHECKED",
280
- message: `${uncheckedAssets} asset link(s) not checked: no public/ directory found.`,
281
- severity: "info"
282
- });
283
- }
284
- if (options.checkExternal && external.length > 0) {
285
- diagnostics.push(...await checkExternalLinks(external));
286
- }
287
- const seen = new Set;
288
- return diagnostics.filter((diagnostic) => {
289
- const key = [
290
- diagnostic.code,
291
- diagnostic.file ?? "",
292
- diagnostic.line ?? "",
293
- diagnostic.column ?? "",
294
- diagnostic.message
295
- ].join(`
296
- `);
297
- if (seen.has(key)) {
298
- return false;
299
- }
300
- seen.add(key);
301
- return true;
302
- });
303
- };
304
-
305
- // src/cli/commands/validate.ts
306
- var validateCommand = defineCommand({
307
- args: {
308
- external: {
309
- description: "Check external (HTTP) links over the network.",
310
- type: "boolean"
311
- },
312
- json: {
313
- description: "Emit diagnostics as JSON on stdout (for CI/editors).",
314
- type: "boolean"
315
- },
316
- strict: {
317
- description: "Treat warnings as errors.",
318
- type: "boolean"
319
- }
320
- },
321
- meta: commandMeta.validate,
322
- async run({ args }) {
323
- const root = process.cwd();
324
- const diagnostics = [];
325
- try {
326
- const project = await scanProject(root, { mode: "build" });
327
- diagnostics.push(...project.diagnostics);
328
- const userPages = project.context.pagesRoot ? await discoverPages(project.context.pagesRoot) : [];
329
- const extraRoutes = customStaticRoutes(userPages);
330
- if (hasGeneratedChangelog(project, userPages)) {
331
- extraRoutes.push("/changelog");
332
- }
333
- if (project.config.i18n) {
334
- const manifest = buildManifest({
335
- config: project.config,
336
- context: project.context,
337
- graph: project.graph
338
- });
339
- extraRoutes.push(...manifest.routes.flatMap((route) => route.fallback ? [route.path] : []));
340
- }
341
- const publicDir = join2(root, "public");
342
- diagnostics.push(...await validateLinks(project.graph, {
343
- basePath: project.config.basePath,
344
- checkExternal: Boolean(args.external),
345
- extraRoutes,
346
- i18n: project.config.i18n,
347
- publicDir: existsSync2(publicDir) ? publicDir : null,
348
- redirects: project.config.redirects
349
- }));
350
- } catch (error) {
351
- if (error instanceof BlumeError) {
352
- diagnostics.push(error.diagnostic);
353
- } else {
354
- reportInternalError(error);
355
- process.exit(1);
356
- }
357
- }
358
- const strictFailure = Boolean(args.strict) && diagnostics.some((diagnostic) => diagnostic.severity !== "info");
359
- if (args.json) {
360
- const hadErrors = reportDiagnosticsJson(diagnostics, root);
361
- if (hadErrors || strictFailure) {
362
- await flushStdout();
363
- process.exit(1);
364
- }
365
- return;
366
- }
367
- const hadErrors = reportDiagnostics(diagnostics, root);
368
- if (diagnostics.length === 0) {
369
- logger.success("No broken links found.");
370
- }
371
- if (hadErrors || strictFailure) {
372
- process.exit(1);
373
- }
374
- }
375
- });
376
- export {
377
- validateCommand
378
- };
379
-
380
- //# debugId=129C7BB75B2906F164756E2164756E21
381
- //# sourceMappingURL=chunk-97r59kpr.js.map
@@ -1,12 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/cli/commands/validate.ts", "../src/core/links.ts", "../src/core/locale-links.ts"],
4
- "sourcesContent": [
5
- "import { existsSync } from \"node:fs\";\n\nimport { defineCommand } from \"citty\";\nimport { join } from \"pathe\";\n\nimport {\n customStaticRoutes,\n discoverPages,\n hasGeneratedChangelog,\n} from \"../../astro/pages.ts\";\nimport { BlumeError } from \"../../core/diagnostics.ts\";\nimport { validateLinks } from \"../../core/links.ts\";\nimport { buildManifest } from \"../../core/manifest.ts\";\nimport { scanProject } from \"../../core/project-graph.ts\";\nimport type { Diagnostic } from \"../../core/types.ts\";\nimport { commandMeta } from \"../command-meta.ts\";\nimport { reportInternalError } from \"../internal-error.ts\";\nimport {\n flushStdout,\n logger,\n reportDiagnostics,\n reportDiagnosticsJson,\n} from \"../log.ts\";\n\nexport const validateCommand = defineCommand({\n args: {\n external: {\n description: \"Check external (HTTP) links over the network.\",\n type: \"boolean\",\n },\n json: {\n description: \"Emit diagnostics as JSON on stdout (for CI/editors).\",\n type: \"boolean\",\n },\n strict: {\n description: \"Treat warnings as errors.\",\n type: \"boolean\",\n },\n },\n meta: commandMeta.validate,\n async run({ args }) {\n const root = process.cwd();\n const diagnostics: Diagnostic[] = [];\n\n try {\n const project = await scanProject(root, { mode: \"build\" });\n // Surface content/graph problems too: a page that fails to parse is a\n // link-validation blind spot, so silently passing would be misleading.\n diagnostics.push(...project.diagnostics);\n\n // Custom `.astro` pages and the generated changelog index are servable\n // routes the content graph can't see — without them, a docs link to e.g.\n // a custom landing page fails as BLUME_BROKEN_LINK.\n const userPages = project.context.pagesRoot\n ? await discoverPages(project.context.pagesRoot)\n : [];\n const extraRoutes = customStaticRoutes(userPages);\n if (hasGeneratedChangelog(project, userPages)) {\n extraRoutes.push(\"/changelog\");\n }\n\n // Fallback-materialized locale routes (an untranslated page prerendered\n // at its localized URL) are servable but absent from the content graph —\n // without them a link to an untranslated sibling under a non-default\n // locale fails as BLUME_BROKEN_LINK even though the built site serves it.\n if (project.config.i18n) {\n const manifest = buildManifest({\n config: project.config,\n context: project.context,\n graph: project.graph,\n });\n extraRoutes.push(\n ...manifest.routes.flatMap((route) =>\n route.fallback ? [route.path] : []\n )\n );\n }\n\n const publicDir = join(root, \"public\");\n diagnostics.push(\n ...(await validateLinks(project.graph, {\n basePath: project.config.basePath,\n checkExternal: Boolean(args.external),\n extraRoutes,\n i18n: project.config.i18n,\n publicDir: existsSync(publicDir) ? publicDir : null,\n redirects: project.config.redirects,\n }))\n );\n } catch (error) {\n if (error instanceof BlumeError) {\n diagnostics.push(error.diagnostic);\n } else {\n reportInternalError(error);\n process.exit(1);\n }\n }\n\n // `--strict` escalates warnings to failures; info-level notes (e.g.\n // BLUME_ASSETS_UNCHECKED when there is no public/ dir) stay advisory.\n const strictFailure =\n Boolean(args.strict) &&\n diagnostics.some((diagnostic) => diagnostic.severity !== \"info\");\n\n if (args.json) {\n // Drain stdout before exiting non-zero: `process.exit` would otherwise\n // truncate the JSON payload mid-write when stdout is a pipe — exactly how\n // `--json` is consumed in CI/editors.\n const hadErrors = reportDiagnosticsJson(diagnostics, root);\n if (hadErrors || strictFailure) {\n await flushStdout();\n process.exit(1);\n }\n return;\n }\n\n const hadErrors = reportDiagnostics(diagnostics, root);\n if (diagnostics.length === 0) {\n logger.success(\"No broken links found.\");\n }\n if (hadErrors || strictFailure) {\n process.exit(1);\n }\n },\n});\n",
6
- "import { existsSync } from \"node:fs\";\n\nimport { basename, dirname, join, relative, resolve } from \"pathe\";\n\nimport { stripBasePath, withBasePath } from \"./base-path.ts\";\nimport {\n isRelativeImageTarget,\n resolveRelativeImage,\n} from \"./content-assets.ts\";\nimport type { LocaleRouting } from \"./i18n.ts\";\nimport { localizeLinkPath } from \"./locale-links.ts\";\nimport { gradeExternal, probeAll } from \"./probe.ts\";\nimport type {\n ContentGraph,\n Diagnostic,\n PageLink,\n PageRecord,\n} from \"./types.ts\";\n\nconst HTTP = /^https?:\\/\\//iu;\nconst PROTOCOL_RELATIVE = /^\\/\\//u;\nconst SCHEME = /^[a-z][a-z0-9+.-]*:/iu;\n\n/** Percent-decode a link piece; malformed sequences stay verbatim. */\nconst decodePercent = (value: string): string => {\n try {\n return decodeURIComponent(value);\n } catch {\n return value;\n }\n};\nconst DOC_EXT = /\\.(?:md|mdx)$/iu;\nconst FILE_EXT = /\\.[a-z0-9]+$/iu;\n\n/** Source position shared by every diagnostic raised for a link. */\ninterface LinkSite {\n column: number;\n file: string;\n line: number;\n}\n\n/**\n * Message context for a link written inside an included partial whose verdict\n * depends on *which* page splices it (relative paths resolve against the\n * including page's route; bare anchors against its headings). Without it the\n * same partial line can be reported broken while being valid from another\n * includer — with no way to tell the reports apart.\n */\nconst includedBySuffix = (link: PageLink, page: PageRecord): string =>\n link.file ? ` (included by ${basename(page.sourcePath ?? page.id)})` : \"\";\n\n/**\n * Invert the include image rebase for display: expansion rewrote a partial's\n * relative image target into the including page's directory so it resolves,\n * but the diagnostic points at the partial — report the path the author\n * actually wrote there, not the rebased one they never typed.\n */\nconst authoredImageTarget = (\n target: string,\n pagePath: string,\n partialPath: string\n): string => {\n const authored = relative(\n dirname(partialPath),\n resolve(dirname(pagePath), target)\n );\n return authored.startsWith(\".\") ? authored : `./${authored}`;\n};\n\n/** An external link occurrence queued for a network probe. */\ninterface ExternalRef extends LinkSite {\n url: string;\n}\n\n/** Lookups derived once from the content graph. */\ninterface LinkContext {\n anchors: Map<string, Set<string>>;\n /** Site-wide route mount point (`\"\"` or `/seg`); routes carry it, assets don't. */\n basePath: string;\n /** Servable routes outside the graph (custom pages, generated routes); their\n * headings are unknown, so anchors there are accepted unchecked. */\n extraRoutes: Set<string>;\n /** Locale routing, when the site is multi-locale; drives served-route resolution. */\n i18n: LocaleRouting | null;\n publicDir: string | null;\n /** Normalized `redirect.from` paths — valid targets that resolve at runtime. */\n redirects: Set<string>;\n routes: Set<string>;\n}\n\n/** Whether a resolved asset path exists under `public/`. */\nconst assetIsPresent = (resolved: string, ctx: LinkContext): boolean =>\n ctx.publicDir !== null && existsSync(join(ctx.publicDir, resolved));\n\n/** Outcome of classifying one link target. */\ntype LinkResult = Diagnostic | \"asset-unchecked\" | null;\n\n// Mirrors the ordering-prefix strip in `sources/normalize.ts`: route mapping\n// drops the prefix before recognizing `index`, so `01-index.mdx` is an index.\nconst NUMERIC_PREFIX = /^\\d+[-_.]/u;\n\n/**\n * Whether a page is a directory index (`…/index.md(x)`, ordering prefix\n * ignored). Its route already *is* its directory, so a relative link must\n * resolve against the route itself, not its parent — otherwise `./sibling`\n * from `guides/index.mdx` (route `/guides`) would resolve to `/sibling` and be\n * falsely flagged as broken. Tested against `navPath` — the locale-stripped\n * path — so a dot-parser localized index (`index.fr.mdx`) and a shared\n * locale-agnostic one (`index.$.mdx`) count too, matching how route mapping\n * recognizes them.\n */\nconst isIndexPage = (page: PageRecord): boolean =>\n /^index\\.(?:md|mdx)$/iu.test(\n basename(page.navPath).replace(NUMERIC_PREFIX, \"\")\n );\n\n/** Apply one relative-path segment to the accumulated route segments. */\nconst applyRelativePart = (segments: string[], part: string): void => {\n if (part === \"\" || part === \".\") {\n return;\n }\n if (part === \"..\") {\n segments.pop();\n return;\n }\n segments.push(part);\n};\n\n/** Resolve a relative link target against the directory of a page route. */\nconst resolveRelative = (\n pageRoute: string,\n target: string,\n isIndex: boolean\n): string => {\n const segments = pageRoute.split(\"/\").filter(Boolean);\n // Drop a leaf page's own segment so links resolve against its parent\n // directory. An index page's route already is its directory, so keep it.\n if (!isIndex) {\n segments.pop();\n }\n for (const part of target.split(\"/\")) {\n applyRelativePart(segments, part);\n }\n return `/${segments.join(\"/\")}`;\n};\n\n/** Normalize an internal path to its canonical route form. */\nconst toRoute = (path: string): string => {\n let route = path.replace(DOC_EXT, \"\");\n if (route.endsWith(\"/index\")) {\n route = route.slice(0, -\"/index\".length);\n }\n if (route.length > 1 && route.endsWith(\"/\")) {\n route = route.slice(0, -1);\n }\n return route === \"\" ? \"/\" : route;\n};\n\n/** Build a map of route -> set of heading anchor slugs. */\nconst buildAnchorIndex = (pages: PageRecord[]): Map<string, Set<string>> => {\n const anchors = new Map<string, Set<string>>();\n for (const page of pages) {\n anchors.set(\n page.route,\n new Set([\n ...page.headings.map((heading) => heading.slug),\n ...page.anchors,\n ])\n );\n }\n return anchors;\n};\n\n/** Verify a fragment resolves to a heading on the target route. */\nconst checkAnchor = (\n route: string,\n fragment: string,\n site: LinkSite,\n ctx: LinkContext,\n via = \"\"\n): Diagnostic | null => {\n const anchors = ctx.anchors.get(route);\n // Exact first: a `[#custom-id]` pin may contain uppercase, which the\n // lowercase fallback (lenient matching for slugger-generated ids) would miss.\n if (anchors?.has(fragment) || anchors?.has(fragment.toLowerCase())) {\n return null;\n }\n return {\n ...site,\n code: \"BLUME_BROKEN_ANCHOR\",\n message: `No anchor target on ${route} matches #${fragment}${via}.`,\n severity: \"warning\",\n };\n};\n\n/**\n * The route a link on `page` actually lands on. Rendered under a prefixed\n * locale, a root-relative link moves into that locale when the localized route\n * is served — a real translation (whose own headings then answer the anchor\n * check) or a fallback page (accepted unchecked via `extraRoutes`) — exactly as\n * `LocaleLinks.astro` rewrites it at render time. Otherwise the authored route\n * stands.\n */\nconst servedRoute = (\n authored: string,\n page: PageRecord,\n ctx: LinkContext\n): string =>\n ctx.i18n\n ? localizeLinkPath(authored, {\n basePath: ctx.basePath,\n i18n: ctx.i18n,\n locale: page.locale,\n routes: {\n has: (route) => ctx.routes.has(route) || ctx.extraRoutes.has(route),\n },\n })\n : authored;\n\n/** Validate a resolved internal path: asset, route, then optional anchor. */\nconst checkPathLink = (\n resolved: string,\n fragment: string,\n page: PageRecord,\n link: PageLink,\n site: LinkSite,\n ctx: LinkContext,\n via = \"\"\n): LinkResult => {\n // Page routes carry the site-wide base; an absolute author path is written\n // as if mounted at root, so base it for the route lookup (idempotent — a\n // relative link already resolved against the based `page.route`). A real\n // route always wins over the asset-extension heuristic, so a dotted route\n // (e.g. `/releases/v1.0`) isn't misread as a missing asset.\n const authoredRoute = toRoute(withBasePath(ctx.basePath, resolved));\n const route = servedRoute(authoredRoute, page, ctx);\n if (ctx.routes.has(route)) {\n return fragment ? checkAnchor(route, fragment, site, ctx, via) : null;\n }\n // A custom `.astro` page or generated route serves this path, but its\n // headings aren't indexed — accept any fragment rather than false-flag it.\n if (ctx.extraRoutes.has(route)) {\n return null;\n }\n // A configured `redirect.from` resolves at runtime, so it's a valid target.\n // Its destination (and any anchor there) is validated on its own page, so we\n // don't follow the redirect to check the fragment here.\n if (ctx.redirects.has(route)) {\n return null;\n }\n\n // Assets live in `public/` at the site root, unaffected by the base, so strip\n // it back off before probing the filesystem.\n const assetPath = stripBasePath(ctx.basePath, resolved);\n if (FILE_EXT.test(assetPath) && !DOC_EXT.test(assetPath)) {\n if (assetIsPresent(assetPath, ctx)) {\n return null;\n }\n // A colocated image embed (`![](./diagram.png)`) is resolved from beside\n // the page source and emitted to `_astro/` by the image pipeline, so it\n // never lands in `public/`. The *raw* target goes through the same\n // resolver that decides what the `/blume-assets/content` endpoint serves,\n // so a reference the rewriter skips (a `?v=2` suffix, a double-encoded\n // name) is reported here, not accepted. Plain links to the same path stay\n // on the public-dir probe — an href resolves as a site route, and only\n // image nodes are rewritten.\n if (link.image && page.sourcePath && isRelativeImageTarget(link.target)) {\n if (resolveRelativeImage(dirname(page.sourcePath), link.target)) {\n return null;\n }\n // A partial-origin image was rebased into the page's directory for\n // resolution but reports against the partial — cite the path as\n // authored there, so file, path, and \"next to\" agree.\n const authored = link.file\n ? authoredImageTarget(link.target, page.sourcePath, link.file)\n : link.target;\n return {\n ...site,\n code: \"BLUME_BROKEN_ASSET\",\n message: `Image ${authored} was not found next to ${basename(link.file ?? page.sourcePath)}.`,\n severity: \"warning\",\n suggestion:\n \"Add the file next to the page source or fix the reference.\",\n };\n }\n // Nowhere to look: no `public/` directory.\n if (ctx.publicDir === null) {\n return \"asset-unchecked\";\n }\n return {\n ...site,\n code: \"BLUME_BROKEN_ASSET\",\n message: `Asset ${assetPath} was not found in the public directory.`,\n severity: \"warning\",\n suggestion: `Add the file at public${assetPath} or fix the link.`,\n };\n }\n\n return {\n ...site,\n code: \"BLUME_BROKEN_LINK\",\n message: `Broken link to ${link.target}${via}: no page resolves to ${route}.`,\n severity: \"error\",\n suggestion: \"Check the path, or create the target page.\",\n };\n};\n\n/** Probe queued external links with bounded concurrency. */\nconst checkExternalLinks = async (\n refs: ExternalRef[]\n): Promise<Diagnostic[]> => {\n const results = await probeAll(refs.map((ref) => ref.url));\n\n const diagnostics: Diagnostic[] = [];\n for (const ref of refs) {\n const result = results.get(ref.url);\n const grade = result ? gradeExternal(result) : null;\n if (grade) {\n diagnostics.push({\n code: \"BLUME_DEAD_LINK\",\n column: ref.column,\n file: ref.file,\n line: ref.line,\n message: `External link ${ref.url} is unreachable (${grade.detail}).`,\n severity: grade.severity,\n });\n }\n }\n return diagnostics;\n};\n\n/** Classify a single link, queueing external refs via `onExternal`. */\nconst classifyLink = (\n page: PageRecord,\n link: PageLink,\n ctx: LinkContext,\n onExternal: (ref: ExternalRef) => void\n): LinkResult => {\n const { target } = link;\n const site: LinkSite = {\n column: link.column,\n // A link written inside an included partial reports against the partial\n // file, so the author fixes it where it lives.\n file: link.file ?? page.sourcePath ?? page.id,\n line: link.line,\n };\n\n if (HTTP.test(target) || PROTOCOL_RELATIVE.test(target)) {\n onExternal({\n ...site,\n url: PROTOCOL_RELATIVE.test(target) ? `https:${target}` : target,\n });\n return null;\n }\n if (SCHEME.test(target)) {\n // mailto:, tel:, and other non-HTTP schemes are not validated.\n return null;\n }\n\n const hashIndex = target.indexOf(\"#\");\n // Browser-copied links arrive percent-encoded (`/caf%C3%A9`, `#caf%C3%A9`)\n // while routes and anchor slugs are stored decoded — decode before comparing\n // so valid links aren't reported broken.\n const fragment = decodePercent(\n hashIndex === -1 ? \"\" : target.slice(hashIndex + 1)\n );\n let rawPath = hashIndex === -1 ? target : target.slice(0, hashIndex);\n const queryIndex = rawPath.indexOf(\"?\");\n if (queryIndex !== -1) {\n rawPath = rawPath.slice(0, queryIndex);\n }\n rawPath = decodePercent(rawPath);\n\n // A relative path (or a bare anchor) means something different from every\n // including page; an absolute path means the same thing everywhere — so\n // only includer-dependent targets carry the \"included by\" context, and\n // identical absolute-target reports collapse in the final dedupe.\n const via = rawPath.startsWith(\"/\") ? \"\" : includedBySuffix(link, page);\n if (rawPath === \"\") {\n return fragment ? checkAnchor(page.route, fragment, site, ctx, via) : null;\n }\n\n const resolved = rawPath.startsWith(\"/\")\n ? rawPath\n : resolveRelative(page.route, rawPath, isIndexPage(page));\n return checkPathLink(resolved, fragment, page, link, site, ctx, via);\n};\n\n/**\n * Validate every link discovered in the content graph: internal page links and\n * anchors against the route map, asset links against the public dir, and\n * (opt-in) external links over the network.\n */\nexport const validateLinks = async (\n graph: ContentGraph,\n options: {\n /** Site-wide route mount point (`\"\"` or `/seg`); routes and redirects carry it. */\n basePath?: string;\n /**\n * Servable routes the graph can't know: custom `.astro` pages and generated\n * routes (e.g. the `/changelog` index). Mounted outside `basePath` (they're\n * injected at their pattern), so they are *not* based here — mirroring the\n * full-route-set resolution in `nav-diagnostics.ts`/`generateRuntime`.\n */\n extraRoutes?: string[];\n /** Locale routing when i18n is on; links then resolve into the page's locale. */\n i18n?: LocaleRouting | null;\n publicDir: string | null;\n checkExternal?: boolean;\n /** Configured redirects; their `from` paths count as valid link targets. */\n redirects?: { from: string }[];\n }\n): Promise<Diagnostic[]> => {\n const basePath = options.basePath ?? \"\";\n const ctx: LinkContext = {\n anchors: buildAnchorIndex(graph.pages),\n basePath,\n extraRoutes: new Set((options.extraRoutes ?? []).map(toRoute)),\n i18n: options.i18n ?? null,\n publicDir: options.publicDir,\n redirects: new Set(\n (options.redirects ?? []).map((redirect) =>\n toRoute(withBasePath(basePath, redirect.from))\n )\n ),\n routes: new Set(graph.routes.keys()),\n };\n const diagnostics: Diagnostic[] = [];\n const external: ExternalRef[] = [];\n let uncheckedAssets = 0;\n\n for (const page of graph.pages) {\n for (const link of page.links) {\n const result = classifyLink(page, link, ctx, (ref) => external.push(ref));\n if (result === \"asset-unchecked\") {\n uncheckedAssets += 1;\n } else if (result) {\n diagnostics.push(result);\n }\n }\n }\n\n if (uncheckedAssets > 0) {\n diagnostics.push({\n code: \"BLUME_ASSETS_UNCHECKED\",\n message: `${uncheckedAssets} asset link(s) not checked: no public/ directory found.`,\n severity: \"info\",\n });\n }\n\n if (options.checkExternal && external.length > 0) {\n diagnostics.push(...(await checkExternalLinks(external)));\n }\n\n // A partial spliced into several pages (or every locale of one) yields the\n // same diagnostic once per including page record; byte-identical reports\n // add noise without information, so only the first of each survives.\n const seen = new Set<string>();\n return diagnostics.filter((diagnostic) => {\n const key = [\n diagnostic.code,\n diagnostic.file ?? \"\",\n diagnostic.line ?? \"\",\n diagnostic.column ?? \"\",\n diagnostic.message,\n ].join(\"\\n\");\n if (seen.has(key)) {\n return false;\n }\n seen.add(key);\n return true;\n });\n};\n",
7
- "import {\n isInternalPath,\n normalizePath,\n stripBasePath,\n withBasePath,\n} from \"./base-path.ts\";\nimport { localePrefix, localizeRoute } from \"./i18n.ts\";\nimport type { LocaleRouting } from \"./i18n.ts\";\n\n/**\n * Locale-aware resolution of content links.\n *\n * Authors write internal links as if mounted at the default locale's root\n * (`[x](/guide)`, `<Card href=\"/guide\">`), and translated pages are usually\n * copies of the source with the same links — so read on `/fr/…`, a link would\n * otherwise drop the reader back into the default language. These helpers move\n * such a link to the reader's locale (`/fr/guide`) when that route is served\n * (a real translation or a materialized fallback page), and leave it alone\n * otherwise: an explicit cross-locale link (`/de/guide`), a custom `.astro`\n * page or generated route that has no per-locale variant, or a missing\n * translation on a site with fallbacks disabled all keep their authored\n * target rather than pointing at a 404.\n *\n * The rewrite runs at render time (`components/layout/LocaleLinks.astro`)\n * because content is compiled once per file but served per route: a fallback\n * route renders the fallback locale's file under the missing locale's URL, and\n * a shared `page.$.mdx` renders under every locale. The link checker applies\n * the same resolution so anchors are validated against the page a reader lands\n * on.\n */\n\n/** A route set, as the runtime (`Set`) or the checker (a predicate) sees it. */\nexport interface RouteSet {\n has: (route: string) => boolean;\n}\n\nexport interface LocalizeLinkOptions {\n /** Site-wide route mount point (`\"\"` or `/seg`); routes carry it. */\n basePath: string;\n i18n: LocaleRouting;\n /** Locale of the page the link is rendered on. */\n locale: string;\n /** Every served route, base-prefixed like `path` (no `deployment.base`). */\n routes: RouteSet;\n}\n\n/**\n * Mirrors the asset heuristic in `markdown/base-links.ts`: a path whose final\n * segment carries a file extension is a `public/` asset (or a raw `.md` twin),\n * served at the site root and never localized.\n */\nconst ASSET_PATH = /\\.[a-z0-9]+$/iu;\n\n/** Decode a percent-encoded path for a route lookup; leave junk as-is. */\nconst decodePercent = (value: string): string => {\n try {\n return decodeURIComponent(value);\n } catch {\n return value;\n }\n};\n\n/** Whether `path` (base-stripped) already sits under some locale's prefix. */\nconst hasLocalePrefix = (path: string, i18n: LocaleRouting): boolean =>\n i18n.locales.some((locale) => {\n const prefix = localePrefix(locale.code, i18n);\n return prefix !== \"\" && (path === prefix || path.startsWith(`${prefix}/`));\n });\n\n/**\n * Move a base-prefixed, fragment-less internal path into `locale` when that\n * route is served, else return it unchanged. Idempotent: a path already under\n * any configured locale prefix is never re-prefixed.\n */\nexport const localizeLinkPath = (\n path: string,\n options: LocalizeLinkOptions\n): string => {\n const { basePath, i18n, locale, routes } = options;\n if (localePrefix(locale, i18n) === \"\") {\n return path;\n }\n const rest = normalizePath(stripBasePath(basePath, path));\n if (hasLocalePrefix(rest, i18n)) {\n return path;\n }\n const localized = withBasePath(basePath, localizeRoute(rest, locale, i18n));\n // Routes are stored decoded; a browser-copied `/caf%C3%A9` must still find\n // its translation, but the emitted href keeps the author's encoding.\n return routes.has(localized) || routes.has(decodePercent(localized))\n ? localized\n : path;\n};\n\nexport interface LocalizeHrefOptions extends LocalizeLinkOptions {\n /** `deployment.base` (Astro's `BASE_URL`), layered over `basePath` in hrefs. */\n deployBase: string;\n}\n\n/**\n * Localize a rendered `href`: external URLs, relative paths, bare fragments, and\n * asset links pass through; a root-relative page link keeps its `?query` and\n * `#fragment` and its `deployment.base` layer around the localized path.\n */\nexport const localizeHref = (\n href: string,\n options: LocalizeHrefOptions\n): string => {\n if (!isInternalPath(href)) {\n return href;\n }\n const suffixAt = href.search(/[#?]/u);\n const path = suffixAt === -1 ? href : href.slice(0, suffixAt);\n const suffix = suffixAt === -1 ? \"\" : href.slice(suffixAt);\n if (ASSET_PATH.test(path)) {\n return href;\n }\n const based = stripBasePath(options.deployBase, path);\n const localized = localizeLinkPath(based, options);\n if (localized === based) {\n return href;\n }\n return `${withBasePath(options.deployBase, localized)}${suffix}`;\n};\n\n/** Every `<a …>` opening tag; `\\s` keeps `<abbr>`/`<astro-island>` out. */\nconst ANCHOR_TAG = /<a\\s[^>]*>/giu;\n/** The tag's `href` attribute, double- or single-quoted. */\nconst HREF_ATTR = /(?<attr>\\shref=)(?:\"(?<dq>[^\"]*)\"|'(?<sq>[^']*)')/iu;\n\n/**\n * Rewrite every `<a href>` in rendered content HTML through `rewrite`. Code\n * blocks are HTML-escaped (`&lt;a`), and island props live on\n * `<astro-island>`, so neither is touched.\n */\nexport const localizeContentLinks = (\n html: string,\n rewrite: (href: string) => string\n): string =>\n html.replace(ANCHOR_TAG, (tag) =>\n tag.replace(HREF_ATTR, (_match, attr: string, dq?: string, sq?: string) => {\n const quote = dq === undefined ? \"'\" : '\"';\n return `${attr}${quote}${rewrite(dq ?? sq ?? \"\")}${quote}`;\n })\n );\n\n/**\n * The served route set for `blume:data`'s routes, built once per routes array\n * (the virtual module is evaluated once, so every page render shares it).\n */\nconst routeSets = new WeakMap<readonly { path: string }[], Set<string>>();\n\nexport const routeSetFor = (\n routes: readonly { path: string }[]\n): Set<string> => {\n const cached = routeSets.get(routes);\n if (cached) {\n return cached;\n }\n const built = new Set(routes.map((route) => route.path));\n routeSets.set(routes, built);\n return built;\n};\n"
8
- ],
9
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uBAAS;AAET;AACA,iBAAS;;;ACHT;AAEA;;;ACoDA,IAAM,gBAAgB,CAAC,UAA0B;AAAA,EAC/C,IAAI;AAAA,IACF,OAAO,mBAAmB,KAAK;AAAA,IAC/B,MAAM;AAAA,IACN,OAAO;AAAA;AAAA;AAKX,IAAM,kBAAkB,CAAC,MAAc,SACrC,KAAK,QAAQ,KAAK,CAAC,WAAW;AAAA,EAC5B,MAAM,SAAS,aAAa,OAAO,MAAM,IAAI;AAAA,EAC7C,OAAO,WAAW,OAAO,SAAS,UAAU,KAAK,WAAW,GAAG,SAAS;AAAA,CACzE;AAOI,IAAM,mBAAmB,CAC9B,MACA,YACW;AAAA,EACX,QAAQ,UAAU,MAAM,QAAQ,WAAW;AAAA,EAC3C,IAAI,aAAa,QAAQ,IAAI,MAAM,IAAI;AAAA,IACrC,OAAO;AAAA,EACT;AAAA,EACA,MAAM,OAAO,cAAc,cAAc,UAAU,IAAI,CAAC;AAAA,EACxD,IAAI,gBAAgB,MA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