@lets-ship/site 0.0.0-stage → 0.0.0

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 (341) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +59 -2
  3. package/bin/ship-site.js +5 -0
  4. package/dist/badge/badge.d.ts +14 -0
  5. package/dist/badge/badge.d.ts.map +1 -0
  6. package/dist/badge/badge.js +16 -0
  7. package/dist/badge/badge.js.map +1 -0
  8. package/dist/blog/arrow.d.ts +6 -0
  9. package/dist/blog/arrow.d.ts.map +1 -0
  10. package/dist/blog/arrow.js +6 -0
  11. package/dist/blog/arrow.js.map +1 -0
  12. package/dist/blog/article-view.d.ts +20 -0
  13. package/dist/blog/article-view.d.ts.map +1 -0
  14. package/dist/blog/article-view.js +71 -0
  15. package/dist/blog/article-view.js.map +1 -0
  16. package/dist/blog/article.d.ts +72 -0
  17. package/dist/blog/article.d.ts.map +1 -0
  18. package/dist/blog/article.js +90 -0
  19. package/dist/blog/article.js.map +1 -0
  20. package/dist/blog/featured.d.ts +18 -0
  21. package/dist/blog/featured.d.ts.map +1 -0
  22. package/dist/blog/featured.js +19 -0
  23. package/dist/blog/featured.js.map +1 -0
  24. package/dist/blog/frontmatter.d.ts +155 -0
  25. package/dist/blog/frontmatter.d.ts.map +1 -0
  26. package/dist/blog/frontmatter.js +96 -0
  27. package/dist/blog/frontmatter.js.map +1 -0
  28. package/dist/blog/index-view.d.ts +21 -0
  29. package/dist/blog/index-view.d.ts.map +1 -0
  30. package/dist/blog/index-view.js +70 -0
  31. package/dist/blog/index-view.js.map +1 -0
  32. package/dist/blog/inline-markdown.d.ts +15 -0
  33. package/dist/blog/inline-markdown.d.ts.map +1 -0
  34. package/dist/blog/inline-markdown.js +44 -0
  35. package/dist/blog/inline-markdown.js.map +1 -0
  36. package/dist/blog/post-card.d.ts +37 -0
  37. package/dist/blog/post-card.d.ts.map +1 -0
  38. package/dist/blog/post-card.js +68 -0
  39. package/dist/blog/post-card.js.map +1 -0
  40. package/dist/blog/site.d.ts +57 -0
  41. package/dist/blog/site.d.ts.map +1 -0
  42. package/dist/blog/site.js +76 -0
  43. package/dist/blog/site.js.map +1 -0
  44. package/dist/blog/toc.d.ts +29 -0
  45. package/dist/blog/toc.d.ts.map +1 -0
  46. package/dist/blog/toc.js +42 -0
  47. package/dist/blog/toc.js.map +1 -0
  48. package/dist/config/context.d.ts +16 -0
  49. package/dist/config/context.d.ts.map +1 -0
  50. package/dist/config/context.js +11 -0
  51. package/dist/config/context.js.map +1 -0
  52. package/dist/config/identity.d.ts +41 -0
  53. package/dist/config/identity.d.ts.map +1 -0
  54. package/dist/config/identity.js +28 -0
  55. package/dist/config/identity.js.map +1 -0
  56. package/dist/config/json-schema.d.ts +11 -0
  57. package/dist/config/json-schema.d.ts.map +1 -0
  58. package/dist/config/json-schema.js +14 -0
  59. package/dist/config/json-schema.js.map +1 -0
  60. package/dist/config/site-config.d.ts +145 -0
  61. package/dist/config/site-config.d.ts.map +1 -0
  62. package/dist/config/site-config.js +130 -0
  63. package/dist/config/site-config.js.map +1 -0
  64. package/dist/docs/page-view.d.ts +21 -0
  65. package/dist/docs/page-view.d.ts.map +1 -0
  66. package/dist/docs/page-view.js +27 -0
  67. package/dist/docs/page-view.js.map +1 -0
  68. package/dist/feeds/feeds.d.ts +33 -0
  69. package/dist/feeds/feeds.d.ts.map +1 -0
  70. package/dist/feeds/feeds.js +122 -0
  71. package/dist/feeds/feeds.js.map +1 -0
  72. package/dist/format/dates.d.ts +5 -0
  73. package/dist/format/dates.d.ts.map +1 -0
  74. package/dist/format/dates.js +17 -0
  75. package/dist/format/dates.js.map +1 -0
  76. package/dist/format/node-text.d.ts +7 -0
  77. package/dist/format/node-text.d.ts.map +1 -0
  78. package/dist/format/node-text.js +15 -0
  79. package/dist/format/node-text.js.map +1 -0
  80. package/dist/format/toc-depth.d.ts +11 -0
  81. package/dist/format/toc-depth.d.ts.map +1 -0
  82. package/dist/format/toc-depth.js +14 -0
  83. package/dist/format/toc-depth.js.map +1 -0
  84. package/dist/i18n/fumadocs-keys.d.ts +13 -0
  85. package/dist/i18n/fumadocs-keys.d.ts.map +1 -0
  86. package/dist/i18n/fumadocs-keys.js +136 -0
  87. package/dist/i18n/fumadocs-keys.js.map +1 -0
  88. package/dist/i18n/strings.d.ts +19 -0
  89. package/dist/i18n/strings.d.ts.map +1 -0
  90. package/dist/i18n/strings.js +59 -0
  91. package/dist/i18n/strings.js.map +1 -0
  92. package/dist/i18n/tables/de.d.ts +3 -0
  93. package/dist/i18n/tables/de.d.ts.map +1 -0
  94. package/dist/i18n/tables/de.js +82 -0
  95. package/dist/i18n/tables/de.js.map +1 -0
  96. package/dist/i18n/tables/en.d.ts +3 -0
  97. package/dist/i18n/tables/en.d.ts.map +1 -0
  98. package/dist/i18n/tables/en.js +25 -0
  99. package/dist/i18n/tables/en.js.map +1 -0
  100. package/dist/i18n/tables/es.d.ts +3 -0
  101. package/dist/i18n/tables/es.d.ts.map +1 -0
  102. package/dist/i18n/tables/es.js +82 -0
  103. package/dist/i18n/tables/es.js.map +1 -0
  104. package/dist/i18n/tables/fr.d.ts +3 -0
  105. package/dist/i18n/tables/fr.d.ts.map +1 -0
  106. package/dist/i18n/tables/fr.js +82 -0
  107. package/dist/i18n/tables/fr.js.map +1 -0
  108. package/dist/i18n/tables/nl.d.ts +3 -0
  109. package/dist/i18n/tables/nl.d.ts.map +1 -0
  110. package/dist/i18n/tables/nl.js +82 -0
  111. package/dist/i18n/tables/nl.js.map +1 -0
  112. package/dist/i18n/tables/pt.d.ts +3 -0
  113. package/dist/i18n/tables/pt.d.ts.map +1 -0
  114. package/dist/i18n/tables/pt.js +82 -0
  115. package/dist/i18n/tables/pt.js.map +1 -0
  116. package/dist/i18n/tables/tr.d.ts +3 -0
  117. package/dist/i18n/tables/tr.d.ts.map +1 -0
  118. package/dist/i18n/tables/tr.js +82 -0
  119. package/dist/i18n/tables/tr.js.map +1 -0
  120. package/dist/i18n/types.d.ts +39 -0
  121. package/dist/i18n/types.d.ts.map +1 -0
  122. package/dist/i18n/types.js +2 -0
  123. package/dist/i18n/types.js.map +1 -0
  124. package/dist/layout/analytics.d.ts +9 -0
  125. package/dist/layout/analytics.d.ts.map +1 -0
  126. package/dist/layout/analytics.js +18 -0
  127. package/dist/layout/analytics.js.map +1 -0
  128. package/dist/layout/brand-files.d.ts +15 -0
  129. package/dist/layout/brand-files.d.ts.map +1 -0
  130. package/dist/layout/brand-files.js +15 -0
  131. package/dist/layout/brand-files.js.map +1 -0
  132. package/dist/layout/footer.d.ts +10 -0
  133. package/dist/layout/footer.d.ts.map +1 -0
  134. package/dist/layout/footer.js +21 -0
  135. package/dist/layout/footer.js.map +1 -0
  136. package/dist/layout/not-found.d.ts +7 -0
  137. package/dist/layout/not-found.d.ts.map +1 -0
  138. package/dist/layout/not-found.js +8 -0
  139. package/dist/layout/not-found.js.map +1 -0
  140. package/dist/layout/provider.d.ts +17 -0
  141. package/dist/layout/provider.d.ts.map +1 -0
  142. package/dist/layout/provider.js +14 -0
  143. package/dist/layout/provider.js.map +1 -0
  144. package/dist/layout/root.d.ts +17 -0
  145. package/dist/layout/root.d.ts.map +1 -0
  146. package/dist/layout/root.js +47 -0
  147. package/dist/layout/root.js.map +1 -0
  148. package/dist/lint/source.d.ts +19 -0
  149. package/dist/lint/source.d.ts.map +1 -0
  150. package/dist/lint/source.js +43 -0
  151. package/dist/lint/source.js.map +1 -0
  152. package/dist/llms/llms.d.ts +22 -0
  153. package/dist/llms/llms.d.ts.map +1 -0
  154. package/dist/llms/llms.js +24 -0
  155. package/dist/llms/llms.js.map +1 -0
  156. package/dist/markdown/article.d.ts +44 -0
  157. package/dist/markdown/article.d.ts.map +1 -0
  158. package/dist/markdown/article.js +108 -0
  159. package/dist/markdown/article.js.map +1 -0
  160. package/dist/markdown/inline.d.ts +40 -0
  161. package/dist/markdown/inline.d.ts.map +1 -0
  162. package/dist/markdown/inline.js +74 -0
  163. package/dist/markdown/inline.js.map +1 -0
  164. package/dist/markdown/page.d.ts +13 -0
  165. package/dist/markdown/page.d.ts.map +1 -0
  166. package/dist/markdown/page.js +21 -0
  167. package/dist/markdown/page.js.map +1 -0
  168. package/dist/marker.d.ts +37 -0
  169. package/dist/marker.d.ts.map +1 -0
  170. package/dist/marker.js +36 -0
  171. package/dist/marker.js.map +1 -0
  172. package/dist/mdx/allow-list.d.ts +23 -0
  173. package/dist/mdx/allow-list.d.ts.map +1 -0
  174. package/dist/mdx/allow-list.js +79 -0
  175. package/dist/mdx/allow-list.js.map +1 -0
  176. package/dist/mdx/components.d.ts +8 -0
  177. package/dist/mdx/components.d.ts.map +1 -0
  178. package/dist/mdx/components.js +68 -0
  179. package/dist/mdx/components.js.map +1 -0
  180. package/dist/mdx/remark-alerts.d.ts +4 -0
  181. package/dist/mdx/remark-alerts.d.ts.map +1 -0
  182. package/dist/mdx/remark-alerts.js +39 -0
  183. package/dist/mdx/remark-alerts.js.map +1 -0
  184. package/dist/next.d.ts +24 -0
  185. package/dist/next.d.ts.map +1 -0
  186. package/dist/next.js +55 -0
  187. package/dist/next.js.map +1 -0
  188. package/dist/node/bin.d.ts +3 -0
  189. package/dist/node/bin.d.ts.map +1 -0
  190. package/dist/node/bin.js +13 -0
  191. package/dist/node/bin.js.map +1 -0
  192. package/dist/node/brand.d.ts +13 -0
  193. package/dist/node/brand.d.ts.map +1 -0
  194. package/dist/node/brand.js +48 -0
  195. package/dist/node/brand.js.map +1 -0
  196. package/dist/node/build.d.ts +20 -0
  197. package/dist/node/build.d.ts.map +1 -0
  198. package/dist/node/build.js +133 -0
  199. package/dist/node/build.js.map +1 -0
  200. package/dist/node/cli.d.ts +11 -0
  201. package/dist/node/cli.d.ts.map +1 -0
  202. package/dist/node/cli.js +80 -0
  203. package/dist/node/cli.js.map +1 -0
  204. package/dist/node/config-file.d.ts +5 -0
  205. package/dist/node/config-file.d.ts.map +1 -0
  206. package/dist/node/config-file.js +31 -0
  207. package/dist/node/config-file.js.map +1 -0
  208. package/dist/node/content.d.ts +6 -0
  209. package/dist/node/content.d.ts.map +1 -0
  210. package/dist/node/content.js +36 -0
  211. package/dist/node/content.js.map +1 -0
  212. package/dist/node/errors.d.ts +26 -0
  213. package/dist/node/errors.d.ts.map +1 -0
  214. package/dist/node/errors.js +34 -0
  215. package/dist/node/errors.js.map +1 -0
  216. package/dist/node/files.d.ts +12 -0
  217. package/dist/node/files.d.ts.map +1 -0
  218. package/dist/node/files.js +43 -0
  219. package/dist/node/files.js.map +1 -0
  220. package/dist/node/marker.d.ts +24 -0
  221. package/dist/node/marker.d.ts.map +1 -0
  222. package/dist/node/marker.js +22 -0
  223. package/dist/node/marker.js.map +1 -0
  224. package/dist/node/og.d.ts +17 -0
  225. package/dist/node/og.d.ts.map +1 -0
  226. package/dist/node/og.js +43 -0
  227. package/dist/node/og.js.map +1 -0
  228. package/dist/node/project-root.d.ts +12 -0
  229. package/dist/node/project-root.d.ts.map +1 -0
  230. package/dist/node/project-root.js +27 -0
  231. package/dist/node/project-root.js.map +1 -0
  232. package/dist/node/serve.d.ts +32 -0
  233. package/dist/node/serve.d.ts.map +1 -0
  234. package/dist/node/serve.js +133 -0
  235. package/dist/node/serve.js.map +1 -0
  236. package/dist/node/theme.d.ts +15 -0
  237. package/dist/node/theme.d.ts.map +1 -0
  238. package/dist/node/theme.js +46 -0
  239. package/dist/node/theme.js.map +1 -0
  240. package/dist/search/dialog.d.ts +14 -0
  241. package/dist/search/dialog.d.ts.map +1 -0
  242. package/dist/search/dialog.js +17 -0
  243. package/dist/search/dialog.js.map +1 -0
  244. package/dist/search/language.d.ts +8 -0
  245. package/dist/search/language.d.ts.map +1 -0
  246. package/dist/search/language.js +30 -0
  247. package/dist/search/language.js.map +1 -0
  248. package/dist/search/route.d.ts +9 -0
  249. package/dist/search/route.d.ts.map +1 -0
  250. package/dist/search/route.js +11 -0
  251. package/dist/search/route.js.map +1 -0
  252. package/dist/seo/article.d.ts +84 -0
  253. package/dist/seo/article.d.ts.map +1 -0
  254. package/dist/seo/article.js +117 -0
  255. package/dist/seo/article.js.map +1 -0
  256. package/dist/seo/collection.d.ts +19 -0
  257. package/dist/seo/collection.d.ts.map +1 -0
  258. package/dist/seo/collection.js +30 -0
  259. package/dist/seo/collection.js.map +1 -0
  260. package/dist/seo/dataset.d.ts +31 -0
  261. package/dist/seo/dataset.d.ts.map +1 -0
  262. package/dist/seo/dataset.js +33 -0
  263. package/dist/seo/dataset.js.map +1 -0
  264. package/dist/seo/json-ld.d.ts +6 -0
  265. package/dist/seo/json-ld.d.ts.map +1 -0
  266. package/dist/seo/json-ld.js +8 -0
  267. package/dist/seo/json-ld.js.map +1 -0
  268. package/dist/seo/script-json.d.ts +8 -0
  269. package/dist/seo/script-json.d.ts.map +1 -0
  270. package/dist/seo/script-json.js +12 -0
  271. package/dist/seo/script-json.js.map +1 -0
  272. package/dist/seo/title.d.ts +11 -0
  273. package/dist/seo/title.d.ts.map +1 -0
  274. package/dist/seo/title.js +11 -0
  275. package/dist/seo/title.js.map +1 -0
  276. package/dist/seo/x-handle.d.ts +9 -0
  277. package/dist/seo/x-handle.d.ts.map +1 -0
  278. package/dist/seo/x-handle.js +21 -0
  279. package/dist/seo/x-handle.js.map +1 -0
  280. package/dist/site/app.d.ts +56 -0
  281. package/dist/site/app.d.ts.map +1 -0
  282. package/dist/site/app.js +79 -0
  283. package/dist/site/app.js.map +1 -0
  284. package/dist/site/features.d.ts +26 -0
  285. package/dist/site/features.d.ts.map +1 -0
  286. package/dist/site/features.js +46 -0
  287. package/dist/site/features.js.map +1 -0
  288. package/dist/site/metadata.d.ts +6 -0
  289. package/dist/site/metadata.d.ts.map +1 -0
  290. package/dist/site/metadata.js +78 -0
  291. package/dist/site/metadata.js.map +1 -0
  292. package/dist/site/outputs.d.ts +24 -0
  293. package/dist/site/outputs.d.ts.map +1 -0
  294. package/dist/site/outputs.js +113 -0
  295. package/dist/site/outputs.js.map +1 -0
  296. package/dist/site/posts.d.ts +6 -0
  297. package/dist/site/posts.d.ts.map +1 -0
  298. package/dist/site/posts.js +9 -0
  299. package/dist/site/posts.js.map +1 -0
  300. package/dist/site/routes.d.ts +43 -0
  301. package/dist/site/routes.d.ts.map +1 -0
  302. package/dist/site/routes.js +94 -0
  303. package/dist/site/routes.js.map +1 -0
  304. package/dist/site/site-page.d.ts +11 -0
  305. package/dist/site/site-page.d.ts.map +1 -0
  306. package/dist/site/site-page.js +70 -0
  307. package/dist/site/site-page.js.map +1 -0
  308. package/dist/site/sources.d.ts +58 -0
  309. package/dist/site/sources.d.ts.map +1 -0
  310. package/dist/site/sources.js +2 -0
  311. package/dist/site/sources.js.map +1 -0
  312. package/dist/site/url-style.d.ts +21 -0
  313. package/dist/site/url-style.d.ts.map +1 -0
  314. package/dist/site/url-style.js +18 -0
  315. package/dist/site/url-style.js.map +1 -0
  316. package/dist/website/blocks/commerce.d.ts +41 -0
  317. package/dist/website/blocks/commerce.d.ts.map +1 -0
  318. package/dist/website/blocks/commerce.js +26 -0
  319. package/dist/website/blocks/commerce.js.map +1 -0
  320. package/dist/website/blocks/content.d.ts +41 -0
  321. package/dist/website/blocks/content.d.ts.map +1 -0
  322. package/dist/website/blocks/content.js +25 -0
  323. package/dist/website/blocks/content.js.map +1 -0
  324. package/dist/website/blocks/marketing.d.ts +32 -0
  325. package/dist/website/blocks/marketing.d.ts.map +1 -0
  326. package/dist/website/blocks/marketing.js +23 -0
  327. package/dist/website/blocks/marketing.js.map +1 -0
  328. package/dist/website/blocks/parts.d.ts +26 -0
  329. package/dist/website/blocks/parts.d.ts.map +1 -0
  330. package/dist/website/blocks/parts.js +13 -0
  331. package/dist/website/blocks/parts.js.map +1 -0
  332. package/dist/website/page-view.d.ts +12 -0
  333. package/dist/website/page-view.d.ts.map +1 -0
  334. package/dist/website/page-view.js +10 -0
  335. package/dist/website/page-view.js.map +1 -0
  336. package/dist/zod.d.ts +8 -0
  337. package/dist/zod.d.ts.map +1 -0
  338. package/dist/zod.js +8 -0
  339. package/dist/zod.js.map +1 -0
  340. package/package.json +187 -3
  341. package/styles.css +326 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"article.js","sourceRoot":"","sources":["../../src/markdown/article.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAqBlD,MAAM,MAAM,GAAG,CAAC,IAAU,EAAU,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAEvE,MAAM,KAAK,GAAG,eAAe,CAAC;AAC9B,MAAM,SAAS,GAAG,sBAAsB,CAAC;AACzC,MAAM,gBAAgB,GAAG,SAAS,CAAC;AACnC,MAAM,UAAU,GAAG,+BAA+B,CAAC;AAEnD,kHAAkH;AAClH,SAAS,WAAW,CAAC,OAAe;IACnC,IAAI,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC,CAAC;IACxC,IAAI,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC;IACvE,OAAO,CAAC,CAAC;AACV,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAgB;IAClD,MAAM,GAAG,GAAa,EAAE,CAAC;IACzB,IAAI,OAAO,GAAG,KAAK,CAAC;IACpB,IAAI,KAAK,GAAG,KAAK,CAAC;IAClB,IAAI,QAAQ,GAAG,EAAE,CAAC;IAClB,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,IAAI,IAAI,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC;QACzC,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,OAAO,GAAG,CAAC,OAAO,CAAC;QACzC,IAAI,OAAO,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;YACjC,GAAG,CAAC,IAAI,C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AE,EAAE,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QACvF,CAAC,CAAC,EAAE,CAAC;IACN,OAAO;QACN,KAAK,mBAAmB,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;QACvC,EAAE;QACF,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,mBAAmB,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACjF,GAAG,KAAK;QACR,EAAE;QACF,eAAe,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE;QAC3E,EAAE;QACF,GAAG,SAAS;KACZ;SACC,IAAI,CAAC,IAAI,CAAC;SACV,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC;SAC1B,OAAO,EAAE;SACT,MAAM,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Inline markdown for frontmatter strings (a post's title and description).
3
+ *
4
+ * These strings are consumed two ways and both have to come from ONE parse.
5
+ * The reader sees them rendered (h1, standfirst, list card), while the
6
+ * document title, meta description, both OpenGraph fields, the JSON-LD
7
+ * headline, and the cover image's alt text all require plain text. Two
8
+ * independent implementations would drift and ship asterisks into a search
9
+ * result, so the renderer and the stripper share this tokenizer.
10
+ *
11
+ * Supported: strong, emphasis, code. Deliberately NOT supported:
12
+ *
13
+ * - Links. The list card wraps its whole body in a Link already, so an anchor
14
+ * produced here would nest inside it, and a link means nothing in a document
15
+ * title anyway.
16
+ * - Underscore emphasis. snake_case_identifiers are ordinary vocabulary in
17
+ * these posts and _case_ would silently italicise inside one. Asterisks
18
+ * carry emphasis; underscores stay literal.
19
+ * - Nesting. A title needs one emphasised span, not a tree. Markers inside an
20
+ * emphasised run stay literal.
21
+ */
22
+ export type InlineToken = {
23
+ readonly kind: "text";
24
+ readonly value: string;
25
+ } | {
26
+ readonly kind: "strong";
27
+ readonly value: string;
28
+ } | {
29
+ readonly kind: "em";
30
+ readonly value: string;
31
+ } | {
32
+ readonly kind: "code";
33
+ readonly value: string;
34
+ };
35
+ export declare function tokenizeInlineMarkdown(input: string): InlineToken[];
36
+ /** The reader-facing string with every marker resolved. Feed this to anything
37
+ * that must be plain text: document title, meta description, OpenGraph,
38
+ * JSON-LD, alt text. */
39
+ export declare function stripInlineMarkdown(input: string): string;
40
+ //# sourceMappingURL=inline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inline.d.ts","sourceRoot":"","sources":["../../src/markdown/inline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,MAAM,WAAW,GACpB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACjD;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACnD;IAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC/C;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAiBrD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,EAAE,CA8BnE;AAED;;yBAEyB;AACzB,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIzD"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * Inline markdown for frontmatter strings (a post's title and description).
3
+ *
4
+ * These strings are consumed two ways and both have to come from ONE parse.
5
+ * The reader sees them rendered (h1, standfirst, list card), while the
6
+ * document title, meta description, both OpenGraph fields, the JSON-LD
7
+ * headline, and the cover image's alt text all require plain text. Two
8
+ * independent implementations would drift and ship asterisks into a search
9
+ * result, so the renderer and the stripper share this tokenizer.
10
+ *
11
+ * Supported: strong, emphasis, code. Deliberately NOT supported:
12
+ *
13
+ * - Links. The list card wraps its whole body in a Link already, so an anchor
14
+ * produced here would nest inside it, and a link means nothing in a document
15
+ * title anyway.
16
+ * - Underscore emphasis. snake_case_identifiers are ordinary vocabulary in
17
+ * these posts and _case_ would silently italicise inside one. Asterisks
18
+ * carry emphasis; underscores stay literal.
19
+ * - Nesting. A title needs one emphasised span, not a tree. Markers inside an
20
+ * emphasised run stay literal.
21
+ */
22
+ /**
23
+ * Emphasis content must begin and end with a non-space, so arithmetic like
24
+ * "2 * 3 * 4" stays literal instead of italicising " 3 ". This is CommonMark's
25
+ * left/right-flanking rule reduced to the part that matters here, written
26
+ * without lookbehind so it does not depend on engine support.
27
+ */
28
+ const RUN = String.raw `[^\s*][^*]*[^\s*]|[^\s*]`;
29
+ /**
30
+ * Ordered alternation: an escape wins over everything, then code spans (which
31
+ * bind tighter than emphasis in markdown), then strong before emphasis so a
32
+ * double asterisk is never read as two singles.
33
+ */
34
+ const INLINE = new RegExp(String.raw `\\([\\*\`])|\`([^\`]+)\`|\*\*(${RUN})\*\*|\*(${RUN})\*`, "g");
35
+ export function tokenizeInlineMarkdown(input) {
36
+ const tokens = [];
37
+ let plain = "";
38
+ let cursor = 0;
39
+ const flush = () => {
40
+ if (plain.length > 0)
41
+ tokens.push({ kind: "text", value: plain });
42
+ plain = "";
43
+ };
44
+ for (const match of input.matchAll(INLINE)) {
45
+ const [full, escaped, code, strong, em] = match;
46
+ plain += input.slice(cursor, match.index);
47
+ cursor = match.index + full.length;
48
+ // An escaped marker is literal text, so it joins the run being built
49
+ // rather than closing it. "a \* b" is one text token, not three.
50
+ if (escaped !== undefined) {
51
+ plain += escaped;
52
+ continue;
53
+ }
54
+ flush();
55
+ if (code !== undefined)
56
+ tokens.push({ kind: "code", value: code });
57
+ else if (strong !== undefined)
58
+ tokens.push({ kind: "strong", value: strong });
59
+ else if (em !== undefined)
60
+ tokens.push({ kind: "em", value: em });
61
+ }
62
+ plain += input.slice(cursor);
63
+ flush();
64
+ return tokens;
65
+ }
66
+ /** The reader-facing string with every marker resolved. Feed this to anything
67
+ * that must be plain text: document title, meta description, OpenGraph,
68
+ * JSON-LD, alt text. */
69
+ export function stripInlineMarkdown(input) {
70
+ return tokenizeInlineMarkdown(input)
71
+ .map((token) => token.value)
72
+ .join("");
73
+ }
74
+ //# sourceMappingURL=inline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inline.js","sourceRoot":"","sources":["../../src/markdown/inline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAQH;;;;;GAKG;AACH,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAA,0BAA0B,CAAC;AAEjD;;;;GAIG;AACH,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,CAAA,iCAAiC,GAAG,YAAY,GAAG,KAAK,EAAE,GAAG,CAAC,CAAC;AAEnG,MAAM,UAAU,sBAAsB,CAAC,KAAa;IACnD,MAAM,MAAM,GAAkB,EAAE,CAAC;IACjC,IAAI,KAAK,GAAG,EAAE,CAAC;IACf,IAAI,MAAM,GAAG,CAAC,CAAC;IAEf,MAAM,KAAK,GAAG,GAAG,EAAE;QAClB,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;YAAE,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QAClE,KAAK,GAAG,EAAE,CAAC;IACZ,CAAC,CAAC;IAEF,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5C,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC;QAChD,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;QAC1C,MAAM,GAAG,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC;QAEnC,qEAAqE;QACrE,iEAAiE;QACjE,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;YAC3B,KAAK,IAAI,OAAO,CAAC;YACjB,SAAS;QACV,CAAC;QACD,KAAK,EAAE,CAAC;QACR,IAAI,IAAI,KAAK,SAAS;YAAE,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;aAC9D,IAAI,MAAM,KAAK,SAAS;YAAE,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;aACzE,IAAI,EAAE,KAAK,SAAS;YAAE,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IACnE,CAAC;IAED,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7B,KAAK,EAAE,CAAC;IACR,OAAO,MAAM,CAAC;AACf,CAAC;AAED;;yBAEyB;AACzB,MAAM,UAAU,mBAAmB,CAAC,KAAa;IAChD,OAAO,sBAAsB,CAAC,KAAK,CAAC;SAClC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC;SAC3B,IAAI,CAAC,EAAE,CAAC,CAAC;AACZ,CAAC"}
@@ -0,0 +1,13 @@
1
+ export interface PageMarkdownInput {
2
+ readonly title: string;
3
+ readonly description?: string;
4
+ readonly url: string;
5
+ /** The page body as processed Markdown. */
6
+ readonly body: string;
7
+ }
8
+ /**
9
+ * The plain-Markdown copy of a website or docs page, for agents: the title, the summary, the URL
10
+ * the copy stands for, then the body without the markup only the page renderer understands.
11
+ */
12
+ export declare function renderPageMarkdown(input: PageMarkdownInput): string;
13
+ //# sourceMappingURL=page.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../src/markdown/page.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,2CAA2C;IAC3C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,CAanE"}
@@ -0,0 +1,21 @@
1
+ import { absolutizeLinks, stripMdxOnlyMarkup } from "./article.js";
2
+ import { stripInlineMarkdown } from "./inline.js";
3
+ /**
4
+ * The plain-Markdown copy of a website or docs page, for agents: the title, the summary, the URL
5
+ * the copy stands for, then the body without the markup only the page renderer understands.
6
+ */
7
+ export function renderPageMarkdown(input) {
8
+ return [
9
+ `# ${stripInlineMarkdown(input.title)}`,
10
+ "",
11
+ ...(input.description ? [`> ${stripInlineMarkdown(input.description)}`, ""] : []),
12
+ `- URL: ${input.url}`,
13
+ "",
14
+ absolutizeLinks(stripMdxOnlyMarkup(input.body), new URL(input.url).origin).trim(),
15
+ ]
16
+ .join("\n")
17
+ .replace(/\n{3,}/g, "\n\n")
18
+ .trimEnd()
19
+ .concat("\n");
20
+ }
21
+ //# sourceMappingURL=page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page.js","sourceRoot":"","sources":["../../src/markdown/page.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAUlD;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAwB;IAC1D,OAAO;QACN,KAAK,mBAAmB,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;QACvC,EAAE;QACF,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,KAAK,mBAAmB,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACjF,UAAU,KAAK,CAAC,GAAG,EAAE;QACrB,EAAE;QACF,eAAe,CAAC,kBAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE;KACjF;SACC,IAAI,CAAC,IAAI,CAAC;SACV,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC;SAC1B,OAAO,EAAE;SACT,MAAM,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { z } from "zod";
2
+ /** The marker a build writes into its output (D36). Hosting reads it before it uploads anything. */
3
+ export declare const MARKER_FILE = ".ship-site.json";
4
+ export declare const SiteMarkerSchema: z.ZodObject<{
5
+ marker: z.ZodLiteral<"ship-site@1">;
6
+ origin: z.ZodString;
7
+ inputs: z.ZodObject<{
8
+ dna: z.ZodString;
9
+ config: z.ZodString;
10
+ content: z.ZodString;
11
+ source: z.ZodString;
12
+ }, z.core.$strict>;
13
+ versions: z.ZodObject<{
14
+ site: z.ZodString;
15
+ brandDna: z.ZodString;
16
+ next: z.ZodString;
17
+ }, z.core.$strict>;
18
+ buildId: z.ZodString;
19
+ badge: z.ZodBoolean;
20
+ output: z.ZodString;
21
+ }, z.core.$strict>;
22
+ export type SiteMarker = z.infer<typeof SiteMarkerSchema>;
23
+ export declare function markerJson(marker: SiteMarker): string;
24
+ /** The attribute the badge carries on every page, which the build and hosting both look for (D42). */
25
+ export declare const BADGE_ATTRIBUTE = "data-ship-badge";
26
+ /** One output file: its POSIX path relative to the output folder and the hex SHA-256 of its bytes. */
27
+ export type OutputFileDigest = {
28
+ readonly path: string;
29
+ readonly sha256: string;
30
+ };
31
+ /**
32
+ * What the output hash is the SHA-256 of: each file's path and digest in path order, without the
33
+ * marker. The build and hosting both call this, so a hash checks the same way on a laptop, in CI
34
+ * and in a Worker, whatever order the files arrive in.
35
+ */
36
+ export declare function outputHashInput(files: readonly OutputFileDigest[]): string;
37
+ //# sourceMappingURL=marker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"marker.d.ts","sourceRoot":"","sources":["../src/marker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,oGAAoG;AACpG,eAAO,MAAM,WAAW,oBAAoB,CAAC;AAI7C,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;kBAanB,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAErD;AAED,sGAAsG;AACtG,eAAO,MAAM,eAAe,oBAAoB,CAAC;AAEjD,sGAAsG;AACtG,MAAM,MAAM,gBAAgB,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAElF;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,gBAAgB,EAAE,GAAG,MAAM,CAM1E"}
package/dist/marker.js ADDED
@@ -0,0 +1,36 @@
1
+ import { z } from "zod";
2
+ /** The marker a build writes into its output (D36). Hosting reads it before it uploads anything. */
3
+ export const MARKER_FILE = ".ship-site.json";
4
+ const Hash = z.string().regex(/^sha256:[0-9a-f]{64}$/);
5
+ export const SiteMarkerSchema = z
6
+ .object({
7
+ marker: z.literal("ship-site@1"),
8
+ origin: z.string().url(),
9
+ /** Hash of the brand DNA, the site config file, the content and the site's own code. */
10
+ inputs: z.object({ dna: Hash, config: Hash, content: Hash, source: Hash }).strict(),
11
+ versions: z.object({ site: z.string(), brandDna: z.string(), next: z.string() }).strict(),
12
+ buildId: z.string().min(1),
13
+ /** Whether the site config keeps the badge on; the build checked every page has it. */
14
+ badge: z.boolean(),
15
+ /** Hash of everything in the output except this file. Hosting skips an upload that matches the live one. */
16
+ output: Hash,
17
+ })
18
+ .strict();
19
+ export function markerJson(marker) {
20
+ return `${JSON.stringify(SiteMarkerSchema.parse(marker), null, 2)}\n`;
21
+ }
22
+ /** The attribute the badge carries on every page, which the build and hosting both look for (D42). */
23
+ export const BADGE_ATTRIBUTE = "data-ship-badge";
24
+ /**
25
+ * What the output hash is the SHA-256 of: each file's path and digest in path order, without the
26
+ * marker. The build and hosting both call this, so a hash checks the same way on a laptop, in CI
27
+ * and in a Worker, whatever order the files arrive in.
28
+ */
29
+ export function outputHashInput(files) {
30
+ return files
31
+ .filter((file) => file.path !== MARKER_FILE)
32
+ .map((file) => `${file.path}\0${file.sha256}`)
33
+ .sort()
34
+ .join("\n");
35
+ }
36
+ //# sourceMappingURL=marker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"marker.js","sourceRoot":"","sources":["../src/marker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,oGAAoG;AACpG,MAAM,CAAC,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAE7C,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;AAEvD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC;KAC/B,MAAM,CAAC;IACP,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IAChC,MAAM,EAAE,CA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MPONENTS: readonly ["Callout", "Figure", "Image", "LinkCard", "Steps", "Step", "Tabs", "Tab", "Video", "CodeGroup"];
2
+ /** The section blocks of a website page (D21), usable in any MDX of the site. */
3
+ export declare const WEBSITE_BLOCKS: readonly ["Hero", "FeatureGrid", "Steps", "Pricing", "Testimonials", "LogoCloud", "Stats", "Faq", "CallToAction", "Team", "Contact"];
4
+ /** Every component the engine itself provides; a site's own come on top, from site.config.ts. */
5
+ export declare const ENGINE_COMPONENTS: readonly string[];
6
+ export type ContentFinding = {
7
+ readonly file: string;
8
+ readonly line: number;
9
+ readonly component: string;
10
+ };
11
+ /** An MDX file the parser refuses. The site build would refuse it too, so this names it first. */
12
+ export declare class MdxParseError extends Error {
13
+ readonly file: string;
14
+ readonly line: number;
15
+ constructor(file: string, line: number, detail: string);
16
+ }
17
+ /**
18
+ * Each component the MDX names that is not on the list. It checks capitalised JSX names, which
19
+ * is what a site's components are; lowercase tags are plain HTML, and MDX expressions, imports
20
+ * and exports are not components, so this check leaves them to the build.
21
+ */
22
+ export declare function unlistedComponents(file: string, mdx: string, allowed: ReadonlyArray<string>): ContentFinding[];
23
+ //# sourceMappingURL=allow-list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"allow-list.d.ts","sourceRoot":"","sources":["../../src/mdx/allow-list.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,iBAAiB,2GAWpB,CAAC;AAEX,iFAAiF;AACjF,eAAO,MAAM,cAAc,sIAYjB,CAAC;AAEX,iGAAiG;AACjG,eAAO,MAAM,iBAAiB,EAAE,SAAS,MAAM,EAA4D,CAAC;AAE5G,MAAM,MAAM,cAAc,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAI1G,kGAAkG;AAClG,qBAAa,aAAc,SAAQ,KAAK;IAEtC,QAAQ,CAAC,IAAI,EAAE,MAAM;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM;gBADZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACrB,MAAM,EAAE,MAAM;CAKf;AAoBD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,GAAG,cAAc,EAAE,CAW9G"}
@@ -0,0 +1,79 @@
1
+ import { remark } from "remark";
2
+ import remarkMdx from "remark-mdx";
3
+ import { visit } from "unist-util-visit";
4
+ export const COMMON_COMPONENTS = [
5
+ "Callout",
6
+ "Figure",
7
+ "Image",
8
+ "LinkCard",
9
+ "Steps",
10
+ "Step",
11
+ "Tabs",
12
+ "Tab",
13
+ "Video",
14
+ "CodeGroup",
15
+ ];
16
+ /** The section blocks of a website page (D21), usable in any MDX of the site. */
17
+ export const WEBSITE_BLOCKS = [
18
+ "Hero",
19
+ "FeatureGrid",
20
+ "Steps",
21
+ "Pricing",
22
+ "Testimonials",
23
+ "LogoCloud",
24
+ "Stats",
25
+ "Faq",
26
+ "CallToAction",
27
+ "Team",
28
+ "Contact",
29
+ ];
30
+ /** Every component the engine itself provides; a site's own come on top, from site.config.ts. */
31
+ export const ENGINE_COMPONENTS = [...new Set([...COMMON_COMPONENTS, ...WEBSITE_BLOCKS])];
32
+ /** An MDX file the parser refuses. The site build would refuse it too, so this names it first. */
33
+ export class MdxParseError extends Error {
34
+ file;
35
+ line;
36
+ constructor(file, line, detail) {
37
+ super(`${file}:${line}: ${detail}`);
38
+ this.file = file;
39
+ this.line = line;
40
+ this.name = "MdxParseError";
41
+ }
42
+ }
43
+ /**
44
+ * The frontmatter as blank lines. It is YAML, not MDX, and a `<` or `{` in a title is fine there;
45
+ * blanking keeps every line number the same.
46
+ */
47
+ function withoutFrontmatter(mdx) {
48
+ const match = /^---\r?\n[\s\S]*?\r?\n---(?:\r?\n|$)/.exec(mdx);
49
+ return match ? match[0].replace(/[^\n]/g, "") + mdx.slice(match[0].length) : mdx;
50
+ }
51
+ function parse(file, mdx) {
52
+ try {
53
+ return remark().use(remarkMdx).parse(withoutFrontmatter(mdx));
54
+ }
55
+ catch (error) {
56
+ const line = error.line ?? 0;
57
+ throw new MdxParseError(file, line, error instanceof Error ? error.message : String(error));
58
+ }
59
+ }
60
+ /**
61
+ * Each component the MDX names that is not on the list. It checks capitalised JSX names, which
62
+ * is what a site's components are; lowercase tags are plain HTML, and MDX expressions, imports
63
+ * and exports are not components, so this check leaves them to the build.
64
+ */
65
+ export function unlistedComponents(file, mdx, allowed) {
66
+ const tree = parse(file, mdx);
67
+ const findings = [];
68
+ const types = ["mdxJsxFlowElement", "mdxJsxTextElement"];
69
+ visit(tree, (node) => {
70
+ if (!types.includes(node.type))
71
+ return;
72
+ const { name, position } = node;
73
+ if (!name || !/^[A-Z]/.test(name) || allowed.includes(name))
74
+ return;
75
+ findings.push({ file, line: position?.start.line ?? 0, component: name });
76
+ });
77
+ return findings;
78
+ }
79
+ //# sourceMappingURL=allow-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"allow-list.js","sourceRoot":"","sources":["../../src/mdx/allow-list.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAEzC,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAChC,SAAS;IACT,QAAQ;IACR,OAAO;IACP,UAAU;IACV,OAAO;IACP,MAAM;IACN,MAAM;IACN,KAAK;IACL,OAAO;IACP,WAAW;CACF,CAAC;AAEX,iFAAiF;AACjF,MAAM,CAAC,MAAM,cAAc,GAAG;IAC7B,MAAM;IACN,aAAa;IACb,OAAO;IACP,SAAS;IACT,cAAc;IACd,WAAW;IACX,OAAO;IACP,KAAK;IACL,cAAc;IACd,MAAM;I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AC,CAAC;IAC7F,CAAC;AACF,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY,EAAE,GAAW,EAAE,OAA8B;IAC3F,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC9B,MAAM,QAAQ,GAAqB,EAAE,CAAC;IACtC,MAAM,KAAK,GAAG,CAAC,mBAAmB,EAAE,mBAAmB,CAAC,CAAC;IACzD,KAAK,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE;QACpB,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,OAAO;QACvC,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,IAA0B,CAAC;QACtD,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC;YAAE,OAAO;QACpE,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3E,CAAC,CAAC,CAAC;IACH,OAAO,QAAQ,CAAC;AACjB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { MDXComponents } from "mdx/types";
2
+ /**
3
+ * The MDX components of a site: fumadocs' defaults, the common allow-list and the website blocks
4
+ * (D31), and the site's own additions. A component outside the list fails the content check
5
+ * before it reaches here. `Steps` is the block's: with children it renders fumadocs' Steps.
6
+ */
7
+ export declare function siteMdxComponents(extra: MDXComponents): MDXComponents;
8
+ //# sourceMappingURL=components.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/mdx/components.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AA8D/C;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,aAAa,GAAG,aAAa,CA2BrE"}
@@ -0,0 +1,68 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Callout } from "fumadocs-ui/components/callout";
3
+ import { Card } from "fumadocs-ui/components/card";
4
+ import { ImageZoom } from "fumadocs-ui/components/image-zoom";
5
+ import { Step } from "fumadocs-ui/components/steps";
6
+ import { Tab, Tabs } from "fumadocs-ui/components/tabs";
7
+ import defaultMdxComponents from "fumadocs-ui/mdx";
8
+ import { Contact, Faq, Pricing } from "../website/blocks/commerce.js";
9
+ import { FeatureGrid, Steps, Team, Testimonials } from "../website/blocks/content.js";
10
+ import { CallToAction, Hero, LogoCloud, Stats } from "../website/blocks/marketing.js";
11
+ /** remarkAlerts' types, as fumadocs' callout types. */
12
+ const CALLOUT = {
13
+ note: "info",
14
+ tip: "idea",
15
+ important: "info",
16
+ warning: "warning",
17
+ caution: "error",
18
+ congrats: "success",
19
+ };
20
+ const isAlert = (value) => value !== undefined && Object.hasOwn(CALLOUT, value);
21
+ /** A `> [!TIP]` block, which remarkAlerts turns into a div with its type, as a callout. */
22
+ function Alert({ "data-alert-type": type, children, ...props }) {
23
+ if (isAlert(type))
24
+ return _jsx(Callout, { type: CALLOUT[type], children: children });
25
+ return (_jsx("div", { "data-alert-type": type, ...props, children: children }));
26
+ }
27
+ /** An image with a caption under it. */
28
+ function Figure({ src, alt, caption }) {
29
+ return (_jsxs("figure", { children: [_jsx(ImageZoom, { src: src, alt: alt, width: 1600, height: 900 }), caption ? _jsx("figcaption", { children: caption }) : null] }));
30
+ }
31
+ /** A video file from the site's content, with the browser's own controls. */
32
+ function Video({ src, poster, caption, }) {
33
+ return (_jsxs("figure", { children: [_jsx("video", { src: src, poster: poster, controls: true, preload: "metadata", playsInline: true, className: "w-full" }), caption ? _jsx("figcaption", { children: caption }) : null] }));
34
+ }
35
+ /**
36
+ * The MDX components of a site: fumadocs' defaults, the common allow-list and the website blocks
37
+ * (D31), and the site's own additions. A component outside the list fails the content check
38
+ * before it reaches here. `Steps` is the block's: with children it renders fumadocs' Steps.
39
+ */
40
+ export function siteMdxComponents(extra) {
41
+ return {
42
+ ...defaultMdxComponents,
43
+ div: Alert,
44
+ img: (props) => _jsx(ImageZoom, { ...props }),
45
+ Callout,
46
+ Figure,
47
+ Image: (props) => _jsx(ImageZoom, { ...props }),
48
+ LinkCard: Card,
49
+ Step,
50
+ Tabs,
51
+ Tab,
52
+ Video,
53
+ CodeGroup: Tabs,
54
+ Hero,
55
+ FeatureGrid,
56
+ Steps,
57
+ Pricing,
58
+ Testimonials,
59
+ LogoCloud,
60
+ Stats,
61
+ Faq,
62
+ CallToAction,
63
+ Team,
64
+ Contact,
65
+ ...extra,
66
+ };
67
+ }
68
+ //# sourceMappingURL=components.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components.js","sourceRoot":"","sources":["../../src/mdx/components.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACnD,OAAO,EAAE,SAAS,EAAuB,MAAM,mCAAmC,CAAC;AACnF,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,oBAAoB,MAAM,iBAAiB,CAAC;AAGnD,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,gCAAgC,CAAC;AAGtF,uDAAuD;AACvD,MAAM,OAAO,GAAyE;IACrF,IAAI,EAAE,MAAM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CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAoB;IACrD,OAAO;QACN,GAAG,oBAAoB;QACvB,GAAG,EAAE,KAAK;QACV,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAC,SAAS,OAAM,KAAwB,GAAI;QAC5D,OAAO;QACP,MAAM;QACN,KAAK,EAAE,CAAC,KAAqB,EAAE,EAAE,CAAC,KAAC,SAAS,OAAK,KAAK,GAAI;QAC1D,QAAQ,EAAE,IAAI;QACd,IAAI;QACJ,IAAI;QACJ,GAAG;QACH,KAAK;QACL,SAAS,EAAE,IAAI;QACf,IAAI;QACJ,WAAW;QACX,KAAK;QACL,OAAO;QACP,YAAY;QACZ,SAAS;QACT,KAAK;QACL,GAAG;QACH,YAAY;QACZ,IAAI;QACJ,OAAO;QACP,GAAG,KAAK;KACR,CAAC;AACH,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { Root } from "mdast";
2
+ export type AlertType = "note" | "tip" | "important" | "warning" | "caution" | "congrats";
3
+ export declare function remarkAlerts(): (tree: Root) => Root;
4
+ //# sourceMappingURL=remark-alerts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remark-alerts.d.ts","sourceRoot":"","sources":["../../src/mdx/remark-alerts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAyB,IAAI,EAAQ,MAAM,OAAO,CAAC;AAG/D,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;AAU1F,wBAAgB,YAAY,KACnB,MAAM,IAAI,UAwClB"}
@@ -0,0 +1,39 @@
1
+ import { visit } from "unist-util-visit";
2
+ const ALERT_PATTERN = /^\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION|CONGRATS)\]\s*/i;
3
+ export function remarkAlerts() {
4
+ return (tree) => {
5
+ visit(tree, "blockquote", (node, index, parent) => {
6
+ if (!parent || index === undefined)
7
+ return;
8
+ const firstParagraph = node.children[0];
9
+ if (firstParagraph?.type !== "paragraph")
10
+ return;
11
+ const firstText = firstParagraph.children[0];
12
+ if (firstText?.type !== "text")
13
+ return;
14
+ const paragraph = firstParagraph;
15
+ const textNode = firstText;
16
+ const match = textNode.value.match(ALERT_PATTERN);
17
+ if (!match)
18
+ return;
19
+ const type = (match[1] ?? "").toLowerCase();
20
+ textNode.value = textNode.value.slice(match[0].length).trimStart();
21
+ if (textNode.value === "") {
22
+ paragraph.children.shift();
23
+ }
24
+ if (paragraph.children.length === 0) {
25
+ node.children.shift();
26
+ }
27
+ const hints = {
28
+ hName: "div",
29
+ hProperties: {
30
+ "data-alert-type": type,
31
+ className: ["alert-container"],
32
+ },
33
+ };
34
+ node.data = hints;
35
+ });
36
+ return tree;
37
+ };
38
+ }
39
+ //# sourceMappingURL=remark-alerts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remark-alerts.js","sourceRoot":"","sources":["../../src/mdx/remark-alerts.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAUzC,MAAM,aAAa,GAAG,yDAAyD,CAAC;AAEhF,MAAM,UAAU,YAAY;IAC3B,OAAO,CAAC,IAAU,EAAE,EAAE;QACrB,KAAK,CAAC,IAAI,EAAE,YAAY,EAAE,CAAC,IAAgB,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE;YAC7D,IAAI,CAAC,MAAM,IAAI,KAAK,KAAK,SAAS;gBAAE,OAAO;YAE3C,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;YACxC,IAAI,cAAc,EAAE,IAAI,KAAK,WAAW;gBAAE,OAAO;YAEjD,MAAM,SAAS,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;YAC7C,IAAI,SAAS,EAAE,IAAI,KAAK,MAAM;gBAAE,OAAO;YAEvC,MAAM,SAAS,GAAG,cAA2B,CAAC;YAC9C,MAAM,QAAQ,GAAG,SAAiB,CAAC;YAEnC,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;YAClD,IAAI,CAAC,KAAK;gBAAE,OAAO;YAEnB,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,WAAW,EAAe,CAAC;YAEzD,QAAQ,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC;YAEnE,IAAI,QAAQ,CAAC,KAAK,KAAK,EAAE,EAAE,CAAC;gBAC3B,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;YAC5B,CAAC;YAED,IAAI,SAAS,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACrC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;YACvB,CAAC;YAED,MAAM,KAAK,GAAc;gBACxB,KAAK,EAAE,KAAK;gBACZ,WAAW,EAAE;oBACZ,iBAAiB,EAAE,IAAI;oBACvB,SAAS,EAAE,CAAC,iBAAiB,CAAC;iBAC9B;aACD,CAAC;YACF,IAAI,CAAC,IAAI,GAAG,KAA2B,CAAC;QACzC,CAAC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IACb,CAAC,CAAC;AACH,CAAC"}
package/dist/next.d.ts ADDED
@@ -0,0 +1,24 @@
1
+ import type { NextConfig } from "next";
2
+ /** The environment variable through which `ship-site build` hands Next its build id. */
3
+ export declare const BUILD_ID_ENV = "SHIP_SITE_BUILD_ID";
4
+ /** The environment variable through which `ship-site` hands Next the optional routes the config turns on. */
5
+ export declare const ROUTES_ENV = "SHIP_SITE_ROUTES";
6
+ /** The environment variable through which `ship-site` hands Next the project root (node/project-root.ts). */
7
+ export declare const ROOT_ENV = "SHIP_SITE_ROOT";
8
+ /** `next build` run directly, not through `ship-site build`, which supplies the build id. */
9
+ export declare class BuildIdError extends Error {
10
+ constructor();
11
+ }
12
+ /** Next run directly, not through `ship-site`, which reads the site and sets the variables Next needs. */
13
+ export declare class SiteEnvError extends Error {
14
+ constructor(variable: string);
15
+ }
16
+ /**
17
+ * A site's Next config: a static export with trailing slashes and no image server, as SHIP
18
+ * Sites hosting serves it; the optional routes the site config turns on (site/features.ts); the
19
+ * project root the bin found, so module paths in the output never depend on where the checkout
20
+ * sits; and a build id from the inputs, because Next's default is random and would change every
21
+ * file of every build.
22
+ */
23
+ export declare function withShipSite(config: NextConfig): NextConfig;
24
+ //# sourceMappingURL=next.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next.d.ts","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAGvC,wFAAwF;AACxF,eAAO,MAAM,YAAY,uBAAuB,CAAC;AAEjD,6GAA6G;AAC7G,eAAO,MAAM,UAAU,qBAAqB,CAAC;AAE7C,6GAA6G;AAC7G,eAAO,MAAM,QAAQ,mBAAmB,CAAC;AAEzC,6FAA6F;AAC7F,qBAAa,YAAa,SAAQ,KAAK;;CAKtC;AAED,0GAA0G;AAC1G,qBAAa,YAAa,SAAQ,KAAK;gBAC1B,QAAQ,EAAE,MAAM;CAM5B;AAUD;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAiB3D"}
package/dist/next.js ADDED
@@ -0,0 +1,55 @@
1
+ import { pageExtensions, parseFeatures } from "./site/features.js";
2
+ /** The environment variable through which `ship-site build` hands Next its build id. */
3
+ export const BUILD_ID_ENV = "SHIP_SITE_BUILD_ID";
4
+ /** The environment variable through which `ship-site` hands Next the optional routes the config turns on. */
5
+ export const ROUTES_ENV = "SHIP_SITE_ROUTES";
6
+ /** The environment variable through which `ship-site` hands Next the project root (node/project-root.ts). */
7
+ export const ROOT_ENV = "SHIP_SITE_ROOT";
8
+ /** `next build` run directly, not through `ship-site build`, which supplies the build id. */
9
+ export class BuildIdError extends Error {
10
+ constructor() {
11
+ super(`${BUILD_ID_ENV} is not set. Build with \`ship-site build\`, which sets it to the hash of the inputs (D36).`);
12
+ this.name = "BuildIdError";
13
+ }
14
+ }
15
+ /** Next run directly, not through `ship-site`, which reads the site and sets the variables Next needs. */
16
+ export class SiteEnvError extends Error {
17
+ constructor(variable) {
18
+ super(`${variable} is not set. Run the site with \`ship-site build\` or \`ship-site dev\`, which set it from the site.`);
19
+ this.name = "SiteEnvError";
20
+ }
21
+ }
22
+ function fromEnv(variable) {
23
+ const value = process.env[variable];
24
+ if (value === undefined)
25
+ throw new SiteEnvError(variable);
26
+ return value;
27
+ }
28
+ const routesFromEnv = () => parseFeatures(fromEnv(ROUTES_ENV));
29
+ /**
30
+ * A site's Next config: a static export with trailing slashes and no image server, as SHIP
31
+ * Sites hosting serves it; the optional routes the site config turns on (site/features.ts); the
32
+ * project root the bin found, so module paths in the output never depend on where the checkout
33
+ * sits; and a build id from the inputs, because Next's default is random and would change every
34
+ * file of every build.
35
+ */
36
+ export function withShipSite(config) {
37
+ const root = fromEnv(ROOT_ENV);
38
+ return {
39
+ ...config,
40
+ output: "export",
41
+ trailingSlash: true,
42
+ images: { ...config.images, unoptimized: true },
43
+ reactStrictMode: true,
44
+ pageExtensions: pageExtensions(routesFromEnv()),
45
+ turbopack: { ...config.turbopack, root },
46
+ outputFileTracingRoot: root,
47
+ generateBuildId: async () => {
48
+ const id = process.env[BUILD_ID_ENV];
49
+ if (!id)
50
+ throw new BuildIdError();
51
+ return id;
52
+ },
53
+ };
54
+ }
55
+ //# sourceMappingURL=next.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"next.js","sourceRoot":"","sources":["../src/next.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAqB,MAAM,oBAAoB,CAAC;AAEtF,wFAAwF;AACxF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E,IAAI,EAAE;QACxC,qBAAqB,EAAE,IAAI;QAC3B,eAAe,EAAE,KAAK,IAAI,EAAE;YAC3B,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;YACrC,IAAI,CAAC,EAAE;gBAAE,MAAM,IAAI,YAAY,EAAE,CAAC;YAClC,OAAO,EAAE,CAAC;QACX,CAAC;KACD,CAAC;AACH,CAAC"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=bin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../src/node/bin.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+ import { runCli } from "./cli.js";
3
+ const io = {
4
+ out: (line) => process.stdout.write(`${line}\n`),
5
+ err: (line) => process.stderr.write(`${line}\n`),
6
+ };
7
+ const code = await runCli(process.argv.slice(2), process.cwd(), io);
8
+ // `serve` keeps its server open; every other command ends here.
9
+ if (process.argv[2] !== "serve")
10
+ process.exit(code);
11
+ else if (code !== 0)
12
+ process.exit(code);
13
+ //# sourceMappingURL=bin.js.map