@xtandard/kit 0.0.0-stage → 0.1.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 (402) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +71 -2
  3. package/bin/xtandard-kit.mjs +3 -0
  4. package/dist/base-path-BJugWLNO.cjs +42 -0
  5. package/dist/base-path-BJugWLNO.cjs.map +1 -0
  6. package/dist/base-path-CDb4In5E.mjs +31 -0
  7. package/dist/base-path-CDb4In5E.mjs.map +1 -0
  8. package/dist/basic-Qtriv0xS.mjs +176 -0
  9. package/dist/basic-Qtriv0xS.mjs.map +1 -0
  10. package/dist/basic-ZaO92-lB.cjs +199 -0
  11. package/dist/basic-ZaO92-lB.cjs.map +1 -0
  12. package/dist/bin.cjs +126 -0
  13. package/dist/bin.cjs.map +1 -0
  14. package/dist/bin.d.cts +20 -0
  15. package/dist/bin.d.mts +20 -0
  16. package/dist/bin.mjs +125 -0
  17. package/dist/bin.mjs.map +1 -0
  18. package/dist/cas-CuPSaXBV.cjs +23 -0
  19. package/dist/cas-CuPSaXBV.cjs.map +1 -0
  20. package/dist/cas-CzA-yECx.mjs +18 -0
  21. package/dist/cas-CzA-yECx.mjs.map +1 -0
  22. package/dist/chunk-DakpK96I.cjs +43 -0
  23. package/dist/contract-B3UPXXLx.d.cts +30 -0
  24. package/dist/contract-B3UPXXLx.d.mts +30 -0
  25. package/dist/contract-BDPNvjtp.d.mts +64 -0
  26. package/dist/contract-BEdfGTPs.mjs +85 -0
  27. package/dist/contract-BEdfGTPs.mjs.map +1 -0
  28. package/dist/contract-BIVzAn4f.d.cts +64 -0
  29. package/dist/contract-BvgtswLX.d.cts +75 -0
  30. package/dist/contract-BvgtswLX.d.mts +75 -0
  31. package/dist/contract-DUj9P3Vt.d.cts +72 -0
  32. package/dist/contract-DUj9P3Vt.d.mts +72 -0
  33. package/dist/contract-wAEMDmYG.cjs +132 -0
  34. package/dist/contract-wAEMDmYG.cjs.map +1 -0
  35. package/dist/drizzle-BElCHWri.d.mts +115 -0
  36. package/dist/drizzle-BXaQXCr0.cjs +232 -0
  37. package/dist/drizzle-BXaQXCr0.cjs.map +1 -0
  38. package/dist/drizzle-CEpahWQB.d.cts +115 -0
  39. package/dist/drizzle-DxnelsPT.mjs +197 -0
  40. package/dist/drizzle-DxnelsPT.mjs.map +1 -0
  41. package/dist/duration-7WpAK-xe.mjs +52 -0
  42. package/dist/duration-7WpAK-xe.mjs.map +1 -0
  43. package/dist/duration-DVA0Fzkx.cjs +63 -0
  44. package/dist/duration-DVA0Fzkx.cjs.map +1 -0
  45. package/dist/duration-FPwbmWIU.d.cts +35 -0
  46. package/dist/duration-FPwbmWIU.d.mts +35 -0
  47. package/dist/entry-adapters-bun.cjs +10 -0
  48. package/dist/entry-adapters-bun.cjs.map +1 -0
  49. package/dist/entry-adapters-bun.d.cts +10 -0
  50. package/dist/entry-adapters-bun.d.mts +10 -0
  51. package/dist/entry-adapters-bun.mjs +9 -0
  52. package/dist/entry-adapters-bun.mjs.map +1 -0
  53. package/dist/entry-adapters-elysia.cjs +54 -0
  54. package/dist/entry-adapters-elysia.cjs.map +1 -0
  55. package/dist/entry-adapters-elysia.d.cts +38 -0
  56. package/dist/entry-adapters-elysia.d.mts +38 -0
  57. package/dist/entry-adapters-elysia.mjs +53 -0
  58. package/dist/entry-adapters-elysia.mjs.map +1 -0
  59. package/dist/entry-adapters-express.cjs +27 -0
  60. package/dist/entry-adapters-express.cjs.map +1 -0
  61. package/dist/entry-adapters-express.d.cts +24 -0
  62. package/dist/entry-adapters-express.d.mts +24 -0
  63. package/dist/entry-adapters-express.mjs +26 -0
  64. package/dist/entry-adapters-express.mjs.map +1 -0
  65. package/dist/entry-adapters-hono.cjs +33 -0
  66. package/dist/entry-adapters-hono.cjs.map +1 -0
  67. package/dist/entry-adapters-hono.d.cts +36 -0
  68. package/dist/entry-adapters-hono.d.mts +36 -0
  69. package/dist/entry-adapters-hono.mjs +30 -0
  70. package/dist/entry-adapters-hono.mjs.map +1 -0
  71. package/dist/entry-adapters-next.cjs +19 -0
  72. package/dist/entry-adapters-next.cjs.map +1 -0
  73. package/dist/entry-adapters-next.d.cts +35 -0
  74. package/dist/entry-adapters-next.d.mts +35 -0
  75. package/dist/entry-adapters-next.mjs +18 -0
  76. package/dist/entry-adapters-next.mjs.map +1 -0
  77. package/dist/entry-adapters-node.cjs +7 -0
  78. package/dist/entry-adapters-node.d.cts +2 -0
  79. package/dist/entry-adapters-node.d.mts +2 -0
  80. package/dist/entry-adapters-node.mjs +2 -0
  81. package/dist/entry-auth-basic.cjs +5 -0
  82. package/dist/entry-auth-basic.d.cts +83 -0
  83. package/dist/entry-auth-basic.d.mts +83 -0
  84. package/dist/entry-auth-basic.mjs +2 -0
  85. package/dist/entry-auth-delegated.cjs +28 -0
  86. package/dist/entry-auth-delegated.cjs.map +1 -0
  87. package/dist/entry-auth-delegated.d.cts +36 -0
  88. package/dist/entry-auth-delegated.d.mts +36 -0
  89. package/dist/entry-auth-delegated.mjs +27 -0
  90. package/dist/entry-auth-delegated.mjs.map +1 -0
  91. package/dist/entry-auth-none.cjs +4 -0
  92. package/dist/entry-auth-none.d.cts +25 -0
  93. package/dist/entry-auth-none.d.mts +25 -0
  94. package/dist/entry-auth-none.mjs +2 -0
  95. package/dist/entry-auth.cjs +0 -0
  96. package/dist/entry-auth.d.cts +2 -0
  97. package/dist/entry-auth.d.mts +2 -0
  98. package/dist/entry-auth.mjs +1 -0
  99. package/dist/entry-authorization-delegated.cjs +27 -0
  100. package/dist/entry-authorization-delegated.cjs.map +1 -0
  101. package/dist/entry-authorization-delegated.d.cts +31 -0
  102. package/dist/entry-authorization-delegated.d.mts +31 -0
  103. package/dist/entry-authorization-delegated.mjs +26 -0
  104. package/dist/entry-authorization-delegated.mjs.map +1 -0
  105. package/dist/entry-authorization-none.cjs +3 -0
  106. package/dist/entry-authorization-none.d.cts +18 -0
  107. package/dist/entry-authorization-none.d.mts +18 -0
  108. package/dist/entry-authorization-none.mjs +2 -0
  109. package/dist/entry-authorization-roles.cjs +3 -0
  110. package/dist/entry-authorization-roles.d.cts +2 -0
  111. package/dist/entry-authorization-roles.d.mts +2 -0
  112. package/dist/entry-authorization-roles.mjs +2 -0
  113. package/dist/entry-authorization.cjs +35 -0
  114. package/dist/entry-authorization.cjs.map +1 -0
  115. package/dist/entry-authorization.d.cts +2 -0
  116. package/dist/entry-authorization.d.mts +2 -0
  117. package/dist/entry-authorization.mjs +34 -0
  118. package/dist/entry-authorization.mjs.map +1 -0
  119. package/dist/entry-build.cjs +481 -0
  120. package/dist/entry-build.cjs.map +1 -0
  121. package/dist/entry-build.d.cts +355 -0
  122. package/dist/entry-build.d.mts +355 -0
  123. package/dist/entry-build.mjs +460 -0
  124. package/dist/entry-build.mjs.map +1 -0
  125. package/dist/entry-cli.cjs +368 -0
  126. package/dist/entry-cli.cjs.map +1 -0
  127. package/dist/entry-cli.d.cts +275 -0
  128. package/dist/entry-cli.d.mts +275 -0
  129. package/dist/entry-cli.mjs +355 -0
  130. package/dist/entry-cli.mjs.map +1 -0
  131. package/dist/entry-drizzle-mysql.cjs +36 -0
  132. package/dist/entry-drizzle-mysql.cjs.map +1 -0
  133. package/dist/entry-drizzle-mysql.d.cts +55 -0
  134. package/dist/entry-drizzle-mysql.d.mts +55 -0
  135. package/dist/entry-drizzle-mysql.mjs +34 -0
  136. package/dist/entry-drizzle-mysql.mjs.map +1 -0
  137. package/dist/entry-drizzle-pg.cjs +38 -0
  138. package/dist/entry-drizzle-pg.cjs.map +1 -0
  139. package/dist/entry-drizzle-pg.d.cts +78 -0
  140. package/dist/entry-drizzle-pg.d.mts +78 -0
  141. package/dist/entry-drizzle-pg.mjs +36 -0
  142. package/dist/entry-drizzle-pg.mjs.map +1 -0
  143. package/dist/entry-drizzle-sqlite.cjs +20 -0
  144. package/dist/entry-drizzle-sqlite.cjs.map +1 -0
  145. package/dist/entry-drizzle-sqlite.d.cts +22 -0
  146. package/dist/entry-drizzle-sqlite.d.mts +22 -0
  147. package/dist/entry-drizzle-sqlite.mjs +19 -0
  148. package/dist/entry-drizzle-sqlite.mjs.map +1 -0
  149. package/dist/entry-hooks-log.cjs +32 -0
  150. package/dist/entry-hooks-log.cjs.map +1 -0
  151. package/dist/entry-hooks-log.d.cts +36 -0
  152. package/dist/entry-hooks-log.d.mts +36 -0
  153. package/dist/entry-hooks-log.mjs +31 -0
  154. package/dist/entry-hooks-log.mjs.map +1 -0
  155. package/dist/entry-hooks.cjs +10 -0
  156. package/dist/entry-hooks.d.cts +2 -0
  157. package/dist/entry-hooks.d.mts +2 -0
  158. package/dist/entry-hooks.mjs +2 -0
  159. package/dist/entry-server-router.cjs +235 -0
  160. package/dist/entry-server-router.cjs.map +1 -0
  161. package/dist/entry-server-router.d.cts +193 -0
  162. package/dist/entry-server-router.d.mts +193 -0
  163. package/dist/entry-server-router.mjs +228 -0
  164. package/dist/entry-server-router.mjs.map +1 -0
  165. package/dist/entry-server.cjs +344 -0
  166. package/dist/entry-server.cjs.map +1 -0
  167. package/dist/entry-server.d.cts +230 -0
  168. package/dist/entry-server.d.mts +230 -0
  169. package/dist/entry-server.mjs +322 -0
  170. package/dist/entry-server.mjs.map +1 -0
  171. package/dist/entry-site.cjs +1083 -0
  172. package/dist/entry-site.cjs.map +1 -0
  173. package/dist/entry-site.d.cts +336 -0
  174. package/dist/entry-site.d.mts +336 -0
  175. package/dist/entry-site.mjs +1060 -0
  176. package/dist/entry-site.mjs.map +1 -0
  177. package/dist/entry-storage-cloudflare-kv.cjs +51 -0
  178. package/dist/entry-storage-cloudflare-kv.cjs.map +1 -0
  179. package/dist/entry-storage-cloudflare-kv.d.cts +52 -0
  180. package/dist/entry-storage-cloudflare-kv.d.mts +52 -0
  181. package/dist/entry-storage-cloudflare-kv.mjs +50 -0
  182. package/dist/entry-storage-cloudflare-kv.mjs.map +1 -0
  183. package/dist/entry-storage-drizzle-internals.cjs +6 -0
  184. package/dist/entry-storage-drizzle-internals.d.cts +2 -0
  185. package/dist/entry-storage-drizzle-internals.d.mts +2 -0
  186. package/dist/entry-storage-drizzle-internals.mjs +2 -0
  187. package/dist/entry-storage-drizzle.cjs +4 -0
  188. package/dist/entry-storage-drizzle.d.cts +3 -0
  189. package/dist/entry-storage-drizzle.d.mts +3 -0
  190. package/dist/entry-storage-drizzle.mjs +2 -0
  191. package/dist/entry-storage-file.cjs +306 -0
  192. package/dist/entry-storage-file.cjs.map +1 -0
  193. package/dist/entry-storage-file.d.cts +76 -0
  194. package/dist/entry-storage-file.d.mts +76 -0
  195. package/dist/entry-storage-file.mjs +301 -0
  196. package/dist/entry-storage-file.mjs.map +1 -0
  197. package/dist/entry-storage-libsql-internals.cjs +7 -0
  198. package/dist/entry-storage-libsql-internals.d.cts +3 -0
  199. package/dist/entry-storage-libsql-internals.d.mts +3 -0
  200. package/dist/entry-storage-libsql-internals.mjs +3 -0
  201. package/dist/entry-storage-libsql.cjs +3 -0
  202. package/dist/entry-storage-libsql.d.cts +2 -0
  203. package/dist/entry-storage-libsql.d.mts +2 -0
  204. package/dist/entry-storage-libsql.mjs +2 -0
  205. package/dist/entry-storage-memory.cjs +78 -0
  206. package/dist/entry-storage-memory.cjs.map +1 -0
  207. package/dist/entry-storage-memory.d.cts +35 -0
  208. package/dist/entry-storage-memory.d.mts +35 -0
  209. package/dist/entry-storage-memory.mjs +77 -0
  210. package/dist/entry-storage-memory.mjs.map +1 -0
  211. package/dist/entry-storage-mongodb-internals.cjs +5 -0
  212. package/dist/entry-storage-mongodb-internals.d.cts +2 -0
  213. package/dist/entry-storage-mongodb-internals.d.mts +2 -0
  214. package/dist/entry-storage-mongodb-internals.mjs +2 -0
  215. package/dist/entry-storage-mongodb.cjs +3 -0
  216. package/dist/entry-storage-mongodb.d.cts +2 -0
  217. package/dist/entry-storage-mongodb.d.mts +2 -0
  218. package/dist/entry-storage-mongodb.mjs +2 -0
  219. package/dist/entry-storage-postgres-internals.cjs +6 -0
  220. package/dist/entry-storage-postgres-internals.d.cts +2 -0
  221. package/dist/entry-storage-postgres-internals.d.mts +2 -0
  222. package/dist/entry-storage-postgres-internals.mjs +2 -0
  223. package/dist/entry-storage-postgres.cjs +4 -0
  224. package/dist/entry-storage-postgres.d.cts +2 -0
  225. package/dist/entry-storage-postgres.d.mts +2 -0
  226. package/dist/entry-storage-postgres.mjs +2 -0
  227. package/dist/entry-storage-redis-internals.cjs +7 -0
  228. package/dist/entry-storage-redis-internals.d.cts +2 -0
  229. package/dist/entry-storage-redis-internals.d.mts +2 -0
  230. package/dist/entry-storage-redis-internals.mjs +2 -0
  231. package/dist/entry-storage-redis.cjs +4 -0
  232. package/dist/entry-storage-redis.d.cts +2 -0
  233. package/dist/entry-storage-redis.d.mts +2 -0
  234. package/dist/entry-storage-redis.mjs +2 -0
  235. package/dist/entry-storage-sqlite-internals.cjs +7 -0
  236. package/dist/entry-storage-sqlite-internals.d.cts +3 -0
  237. package/dist/entry-storage-sqlite-internals.d.mts +3 -0
  238. package/dist/entry-storage-sqlite-internals.mjs +3 -0
  239. package/dist/entry-storage-sqlite.cjs +3 -0
  240. package/dist/entry-storage-sqlite.d.cts +2 -0
  241. package/dist/entry-storage-sqlite.d.mts +2 -0
  242. package/dist/entry-storage-sqlite.mjs +2 -0
  243. package/dist/entry-storage-testing.cjs +801 -0
  244. package/dist/entry-storage-testing.cjs.map +1 -0
  245. package/dist/entry-storage-testing.d.cts +150 -0
  246. package/dist/entry-storage-testing.d.mts +150 -0
  247. package/dist/entry-storage-testing.mjs +790 -0
  248. package/dist/entry-storage-testing.mjs.map +1 -0
  249. package/dist/entry-storage-unstorage.cjs +78 -0
  250. package/dist/entry-storage-unstorage.cjs.map +1 -0
  251. package/dist/entry-storage-unstorage.d.cts +30 -0
  252. package/dist/entry-storage-unstorage.d.mts +30 -0
  253. package/dist/entry-storage-unstorage.mjs +77 -0
  254. package/dist/entry-storage-unstorage.mjs.map +1 -0
  255. package/dist/entry-storage.cjs +114 -0
  256. package/dist/entry-storage.cjs.map +1 -0
  257. package/dist/entry-storage.d.cts +152 -0
  258. package/dist/entry-storage.d.mts +152 -0
  259. package/dist/entry-storage.mjs +91 -0
  260. package/dist/entry-storage.mjs.map +1 -0
  261. package/dist/entry-testing.cjs +79 -0
  262. package/dist/entry-testing.cjs.map +1 -0
  263. package/dist/entry-testing.d.cts +55 -0
  264. package/dist/entry-testing.d.mts +55 -0
  265. package/dist/entry-testing.mjs +77 -0
  266. package/dist/entry-testing.mjs.map +1 -0
  267. package/dist/entry-tokens.cjs +4 -0
  268. package/dist/entry-tokens.d.cts +85 -0
  269. package/dist/entry-tokens.d.mts +85 -0
  270. package/dist/entry-tokens.mjs +2 -0
  271. package/dist/entry-ui-embed.cjs +131 -0
  272. package/dist/entry-ui-embed.cjs.map +1 -0
  273. package/dist/entry-ui-embed.d.cts +87 -0
  274. package/dist/entry-ui-embed.d.mts +87 -0
  275. package/dist/entry-ui-embed.mjs +127 -0
  276. package/dist/entry-ui-embed.mjs.map +1 -0
  277. package/dist/entry-ui.cjs +795 -0
  278. package/dist/entry-ui.cjs.map +1 -0
  279. package/dist/entry-ui.d.cts +574 -0
  280. package/dist/entry-ui.d.mts +574 -0
  281. package/dist/entry-ui.mjs +731 -0
  282. package/dist/entry-ui.mjs.map +1 -0
  283. package/dist/entry-util.cjs +145 -0
  284. package/dist/entry-util.cjs.map +1 -0
  285. package/dist/entry-util.d.cts +85 -0
  286. package/dist/entry-util.d.mts +85 -0
  287. package/dist/entry-util.mjs +130 -0
  288. package/dist/entry-util.mjs.map +1 -0
  289. package/dist/http-B_rTnLW9.cjs +235 -0
  290. package/dist/http-B_rTnLW9.cjs.map +1 -0
  291. package/dist/http-CxYM7kPT.d.mts +133 -0
  292. package/dist/http-DVdVI6kJ.mjs +164 -0
  293. package/dist/http-DVdVI6kJ.mjs.map +1 -0
  294. package/dist/http-XBVRk8uo.d.cts +133 -0
  295. package/dist/index.cjs +8 -0
  296. package/dist/index.cjs.map +1 -0
  297. package/dist/index.d.cts +6 -0
  298. package/dist/index.d.mts +6 -0
  299. package/dist/index.mjs +7 -0
  300. package/dist/index.mjs.map +1 -0
  301. package/dist/json-CCyzstIm.d.cts +44 -0
  302. package/dist/json-CCyzstIm.d.mts +44 -0
  303. package/dist/json-CM7TwYQ7.cjs +92 -0
  304. package/dist/json-CM7TwYQ7.cjs.map +1 -0
  305. package/dist/json-CmM1M5Kz.mjs +63 -0
  306. package/dist/json-CmM1M5Kz.mjs.map +1 -0
  307. package/dist/keys-Bwubabk0.mjs +73 -0
  308. package/dist/keys-Bwubabk0.mjs.map +1 -0
  309. package/dist/keys-DQrwxDKI.cjs +126 -0
  310. package/dist/keys-DQrwxDKI.cjs.map +1 -0
  311. package/dist/kv-sqlite-B6iTLOx2.d.cts +20 -0
  312. package/dist/kv-sqlite-CHOdIMJ-.cjs +77 -0
  313. package/dist/kv-sqlite-CHOdIMJ-.cjs.map +1 -0
  314. package/dist/kv-sqlite-DIIPfflJ.mjs +66 -0
  315. package/dist/kv-sqlite-DIIPfflJ.mjs.map +1 -0
  316. package/dist/kv-sqlite-Tx4UedJs.d.mts +20 -0
  317. package/dist/libsql-0160BubR.d.mts +65 -0
  318. package/dist/libsql-BZmRZIqt.d.cts +65 -0
  319. package/dist/libsql-CiBfVtbS.cjs +103 -0
  320. package/dist/libsql-CiBfVtbS.cjs.map +1 -0
  321. package/dist/libsql-CkOjQINi.mjs +86 -0
  322. package/dist/libsql-CkOjQINi.mjs.map +1 -0
  323. package/dist/mongodb--Cuj7V_9.cjs +150 -0
  324. package/dist/mongodb--Cuj7V_9.cjs.map +1 -0
  325. package/dist/mongodb-DGtsolQ2.d.cts +61 -0
  326. package/dist/mongodb-JMizy4Wg.mjs +127 -0
  327. package/dist/mongodb-JMizy4Wg.mjs.map +1 -0
  328. package/dist/mongodb-xGEU5Gwz.d.mts +61 -0
  329. package/dist/node-B1Djcwfi.d.cts +57 -0
  330. package/dist/node-B1Djcwfi.d.mts +57 -0
  331. package/dist/node-BYjocCbU.mjs +167 -0
  332. package/dist/node-BYjocCbU.mjs.map +1 -0
  333. package/dist/node-DFFqYRk-.cjs +201 -0
  334. package/dist/node-DFFqYRk-.cjs.map +1 -0
  335. package/dist/none-BEY7Kc_-.mjs +33 -0
  336. package/dist/none-BEY7Kc_-.mjs.map +1 -0
  337. package/dist/none-BoQ6-30P.cjs +33 -0
  338. package/dist/none-BoQ6-30P.cjs.map +1 -0
  339. package/dist/none-CHwVkQL-.cjs +49 -0
  340. package/dist/none-CHwVkQL-.cjs.map +1 -0
  341. package/dist/none-yu3qC47E.mjs +23 -0
  342. package/dist/none-yu3qC47E.mjs.map +1 -0
  343. package/dist/peer-BIjBFzwQ.cjs +56 -0
  344. package/dist/peer-BIjBFzwQ.cjs.map +1 -0
  345. package/dist/peer-CTHMzOdn.mjs +40 -0
  346. package/dist/peer-CTHMzOdn.mjs.map +1 -0
  347. package/dist/portal-container-CJIcau3B.mjs +610 -0
  348. package/dist/portal-container-CJIcau3B.mjs.map +1 -0
  349. package/dist/portal-container-Ca1NxrLE.cjs +774 -0
  350. package/dist/portal-container-Ca1NxrLE.cjs.map +1 -0
  351. package/dist/postgres-BJzxKBk0.d.cts +72 -0
  352. package/dist/postgres-CA8_XcAE.cjs +164 -0
  353. package/dist/postgres-CA8_XcAE.cjs.map +1 -0
  354. package/dist/postgres-RfQMgAsj.d.mts +72 -0
  355. package/dist/postgres-aDiBmNzr.mjs +135 -0
  356. package/dist/postgres-aDiBmNzr.mjs.map +1 -0
  357. package/dist/redis-B2AS4xAQ.cjs +259 -0
  358. package/dist/redis-B2AS4xAQ.cjs.map +1 -0
  359. package/dist/redis-B362ofBw.d.cts +159 -0
  360. package/dist/redis-CahNAVTW.d.mts +159 -0
  361. package/dist/redis-hdoKymfG.mjs +218 -0
  362. package/dist/redis-hdoKymfG.mjs.map +1 -0
  363. package/dist/roles-7JPrQXZa.mjs +46 -0
  364. package/dist/roles-7JPrQXZa.mjs.map +1 -0
  365. package/dist/roles-B_8QqJ3j.cjs +56 -0
  366. package/dist/roles-B_8QqJ3j.cjs.map +1 -0
  367. package/dist/roles-DLISB4T3.d.mts +41 -0
  368. package/dist/roles-DQbbtUPW.d.cts +41 -0
  369. package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
  370. package/dist/scope-css-BN3jf0ly.cjs +315 -0
  371. package/dist/scope-css-BN3jf0ly.cjs.map +1 -0
  372. package/dist/scope-css-BuJfRCsE.mjs +256 -0
  373. package/dist/scope-css-BuJfRCsE.mjs.map +1 -0
  374. package/dist/scoped-BRoE1W1x.cjs +175 -0
  375. package/dist/scoped-BRoE1W1x.cjs.map +1 -0
  376. package/dist/scoped-cFBbotCh.mjs +164 -0
  377. package/dist/scoped-cFBbotCh.mjs.map +1 -0
  378. package/dist/sqlite-B2g1JJz1.d.cts +47 -0
  379. package/dist/sqlite-BIPIlxfj.d.mts +47 -0
  380. package/dist/sqlite-BntoYaXZ.cjs +79 -0
  381. package/dist/sqlite-BntoYaXZ.cjs.map +1 -0
  382. package/dist/sqlite-DYJDcu7p.mjs +62 -0
  383. package/dist/sqlite-DYJDcu7p.mjs.map +1 -0
  384. package/dist/table-BrioFSra.d.cts +11 -0
  385. package/dist/table-BrioFSra.d.mts +11 -0
  386. package/dist/theme-context-DzZ1otaD.d.cts +270 -0
  387. package/dist/theme-context-J65pythD.d.mts +270 -0
  388. package/dist/ui/styles.css +239 -0
  389. package/dist/util-Dnj5T-yw.mjs +39 -0
  390. package/dist/util-Dnj5T-yw.mjs.map +1 -0
  391. package/dist/util-dAnTK9x-.cjs +74 -0
  392. package/dist/util-dAnTK9x-.cjs.map +1 -0
  393. package/dist/validation-B-atP968.mjs +191 -0
  394. package/dist/validation-B-atP968.mjs.map +1 -0
  395. package/dist/validation-BJifGoB2.d.mts +122 -0
  396. package/dist/validation-DLnzBVJr.cjs +258 -0
  397. package/dist/validation-DLnzBVJr.cjs.map +1 -0
  398. package/dist/validation-tfV2qhbD.d.cts +122 -0
  399. package/package.json +715 -4
  400. package/tsconfig/assets.d.ts +21 -0
  401. package/tsconfig/base.json +21 -0
  402. package/tsconfig/react.json +9 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entry-site.cjs","names":["yaml","posix","importPeer"],"sources":["../src/site/manifest.ts","../src/site/sync.ts","../src/site/resolve.ts","../src/site/typedoc-plugin.ts","../src/site/api-overviews.ts","../src/site/define-site.ts"],"sourcesContent":["/**\n * A docs site's information architecture: which repository Markdown becomes which page, and the\n * sidebar tree. `syncSite` reads it to write `src/content/docs/`, and `defineXtandardSite` reads it\n * to build the sidebar, so a page and its sidebar entry cannot drift.\n *\n * The Markdown in the repository (README.md, docs/*.md) stays the single source of truth: it is what\n * GitHub and npm render. A page is one of:\n *\n * - a whole repository file (`src`);\n * - some H2 sections of one (`src` + `sections`, optionally `intro` for the text above the first H2).\n * Every H2 of a split guide must land on exactly one page;\n * - a page written for the site only (`site`, relative to `site/content/`).\n *\n * A page marked `pending` is a guide that has not landed yet. While its `src` is missing it is left\n * out of the site, and links to it go to GitHub (with a warning) instead of failing the build.\n *\n * Plain Node APIs only: Astro loads this through Vite, and the sync step runs it directly.\n *\n * @module\n */\n\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\n\n/** One page of the site. */\nexport interface SitePage {\n /** Route without the base and without slashes; `\"\"` is the home page. */\n slug: string;\n /** Sidebar label; the page title when absent. */\n label?: string;\n /** Repository file the page is built from. */\n src?: string;\n /** Only these H2 sections of `src` (by heading text, in file order). */\n sections?: string[];\n /** With `sections`: also the H1 and the text above the first H2. */\n intro?: boolean;\n /** Page title when it does not come from the source's H1. */\n title?: string;\n /** Meta description when the first paragraph of the source does not make a good one. */\n description?: string;\n /** Site-only page in `site/content/` (`.md` or `.mdx`). */\n site?: string;\n /** Contributor-only material: a banner says so and search skips it. */\n internal?: boolean;\n /** A guide that has not landed yet: left out (links go to GitHub) until `src` exists. */\n pending?: boolean;\n}\n\n/** An external sidebar link. */\nexport interface SiteLink {\n label: string;\n link: string;\n}\n\n/** A sidebar group. */\nexport interface SiteGroup {\n label: string;\n collapsed?: boolean;\n items: SiteItem[];\n}\n\n/** A sidebar item. */\nexport type SiteItem = SitePage | SiteLink | SiteGroup;\n\n/** A public entry point: its API reference module, import specifier and source file. */\nexport interface ApiEntry {\n /** TypeDoc module name (its `@module` tag) and route under `/api/`: the subpath, or the root name. */\n name: string;\n /** `@xtandard/kit/storage`. */\n importPath: string;\n /** Repository-relative source file. */\n source: string;\n}\n\n/** Options for {@link defineSiteManifest}. */\nexport interface SiteManifestOptions {\n /** Absolute path of the repository root. */\n repoRoot: string;\n /** Absolute path of the site directory; `<repoRoot>/site` by default. */\n siteDir?: string;\n /** `owner/repo` on GitHub. */\n repoSlug: string;\n /** The npm package name (`@xtandard/flags`). */\n packageName: string;\n /** The API module name of the package root (its `@module` tag); the unscoped name by default. */\n rootModule?: string;\n /** Default branch; `\"main\"`. */\n branch?: string;\n /** Default site origin; overridden by `SITE_ORIGIN`. `https://me.xantiagoma.com` by default. */\n origin?: string;\n /** Default base path (`\"/xtandard-flags\"`); overridden by `SITE_BASE`. */\n base: string;\n /** The home page; `{ slug: \"\", site: \"index.mdx\" }` by default. */\n home?: SitePage;\n /** The sidebar tree, pending pages included. */\n sidebar: SiteItem[];\n /** `docs/` Markdown files that are not guides (skipped by the \"every guide is a page\" check). */\n ignoreDocs?: (path: string) => boolean;\n /** `docs/assets/` files served at the site root; favicons and the social card by default. */\n publicAssets?: string[];\n /** Environment to read `SITE_ORIGIN`/`SITE_BASE` from; `process.env` by default. */\n env?: Record<string, string | undefined>;\n}\n\n/** A resolved site manifest. */\nexport interface SiteManifest {\n repoRoot: string;\n siteDir: string;\n repoSlug: string;\n repoUrl: string;\n npmUrl: string;\n packageName: string;\n rootModule: string;\n branch: string;\n /** Always `https://` (configure-pages reports a custom domain as `http://`). */\n siteOrigin: string;\n /** No trailing slash. */\n siteBase: string;\n home: SitePage;\n /** The sidebar tree without the pending guides that have not landed yet. */\n sidebar: SiteItem[];\n publicAssets: string[];\n ignoreDocs: (path: string) => boolean;\n /** Every page, the home page first (pending guides only once they exist). */\n pages(): SitePage[];\n /** Pending guides whose source does not exist yet. */\n pendingPages(): SitePage[];\n /** Every public entry point, in `package.json` `exports` order. */\n apiEntries(): ApiEntry[];\n}\n\n/** Whether a sidebar item is a page. */\nexport const isPage = (i: SiteItem): i is SitePage => \"slug\" in i;\n/** Whether a sidebar item is a group. */\nexport const isGroup = (i: SiteItem): i is SiteGroup => \"items\" in i;\n\nfunction walk(items: SiteItem[], out: SitePage[] = []): SitePage[] {\n for (const i of items) {\n if (isPage(i)) out.push(i);\n else if (isGroup(i)) walk(i.items, out);\n }\n return out;\n}\n\n/**\n * Every public entry point of the package at `repoRoot`, in `exports` order. Skips stylesheets,\n * wildcards, JSON and `./package.json`. A subpath maps to `src/entry-<subpath with dashes>.ts` when\n * that file exists, otherwise to `src/<subpath>.ts(x)`; the root maps to `src/index.ts`.\n */\nexport function apiEntries(repoRoot: string, packageName: string, rootModule: string): ApiEntry[] {\n const pkg = JSON.parse(readFileSync(join(repoRoot, \"package.json\"), \"utf8\")) as {\n exports?: Record<string, unknown>;\n };\n return Object.keys(pkg.exports ?? {})\n .filter(\n (key) =>\n key !== \"./package.json\" &&\n !key.includes(\"*\") &&\n !key.endsWith(\".css\") &&\n !key.endsWith(\".json\"),\n )\n .map((key) => {\n const sub = key.replace(/^\\.\\/?/, \"\");\n const candidates =\n sub === \"\"\n ? [\"src/index.ts\"]\n : [`src/entry-${sub.replaceAll(\"/\", \"-\")}.ts`, `src/${sub}.ts`, `src/${sub}.tsx`];\n const source = candidates.find((f) => existsSync(join(repoRoot, f)));\n if (!source) throw new Error(`site manifest: no source file for the \"${key}\" export`);\n return {\n name: sub === \"\" ? rootModule : sub,\n importPath: sub === \"\" ? packageName : `${packageName}/${sub}`,\n source,\n };\n });\n}\n\nconst DEFAULT_ASSETS = [\"favicon.svg\", \"favicon.ico\", \"apple-touch-icon.png\", \"social.png\"];\n\n/** Resolve a site manifest from the product's options. */\nexport function defineSiteManifest(options: SiteManifestOptions): SiteManifest {\n const env = options.env ?? process.env;\n const repoRoot = options.repoRoot;\n const repoUrl = `https://github.com/${options.repoSlug}`;\n const rootModule = options.rootModule ?? options.packageName.replace(/^@[^/]+\\//, \"\");\n const home = options.home ?? { slug: \"\", site: \"index.mdx\" };\n const present = (p: SitePage) => !p.pending || !p.src || existsSync(join(repoRoot, p.src));\n const prune = (items: SiteItem[]): SiteItem[] =>\n items.flatMap((i): SiteItem[] => {\n if (isPage(i)) return present(i) ? [i] : [];\n if (isGroup(i)) {\n const kept = prune(i.items);\n return kept.length ? [{ ...i, items: kept }] : [];\n }\n return [i];\n });\n const sidebar = prune(options.sidebar);\n return {\n repoRoot,\n siteDir: options.siteDir ?? join(repoRoot, \"site\"),\n repoSlug: options.repoSlug,\n repoUrl,\n npmUrl: `https://www.npmjs.com/package/${options.packageName}`,\n packageName: options.packageName,\n rootModule,\n branch: options.branch ?? \"main\",\n siteOrigin: (env.SITE_ORIGIN || options.origin || \"https://me.xantiagoma.com\")\n .replace(/^http:\\/\\//, \"https://\")\n .replace(/\\/+$/, \"\"),\n siteBase: (env.SITE_BASE || options.base).replace(/\\/+$/, \"\"),\n home,\n sidebar,\n publicAssets: options.publicAssets ?? DEFAULT_ASSETS,\n ignoreDocs: options.ignoreDocs ?? (() => false),\n pages: () => [home, ...walk(sidebar)],\n pendingPages: () => walk(options.sidebar).filter((p) => !present(p)),\n apiEntries: () => apiEntries(repoRoot, options.packageName, rootModule),\n };\n}\n","/**\n * The docs site's pre-build step (`site/scripts/sync.ts` in every product): writes\n * `site/src/content/docs/` (generated, gitignored) from the repository's Markdown and the site-only\n * pages in `site/content/`. The repository files stay the single source of truth and keep rendering\n * on GitHub and npm; this step only adapts copies:\n *\n * - the title and description come from the source: the H1 (or the manifest's `title`) becomes\n * `title`, the first paragraph becomes `description`, and \"Edit page\" opens the source file;\n * - a long guide is split by its H2 sections into several pages (manifest `sections`); every H2\n * must land on exactly one page;\n * - relative links to files that are pages here (`./STORAGE.md#x`, `#anchor` in a split guide)\n * become site routes, pointing at whichever page holds the anchor;\n * - relative links to other repository files (`../src/x.ts`) become GitHub URLs;\n * - a link to a **pending** guide (one that has not landed yet) goes to GitHub, with a warning;\n * - a relative link to any other missing file fails the build;\n * - GitHub alerts (`> [!WARNING]`) become Starlight asides.\n *\n * It also copies the brand files the site serves as-is (favicons, the social card) from\n * `docs/assets/` into `site/public/` (generated, gitignored), so `docs/assets/` stays their only\n * copy. Fenced code blocks and inline code spans are never rewritten.\n *\n * @module\n */\n\nimport {\n copyFileSync,\n existsSync,\n mkdirSync,\n readdirSync,\n readFileSync,\n rmSync,\n statSync,\n writeFileSync,\n} from \"node:fs\";\nimport { dirname, join, posix } from \"node:path\";\nimport type { SiteManifest, SitePage } from \"./manifest.ts\";\n\n/**\n * GitHub's heading anchors (github-slugger): lowercase, punctuation and symbols removed, spaces to\n * `-`, repeats suffixed `-1`, `-2`…\n */\nexport class Slugger {\n private seen = new Map<string, number>();\n\n /** The anchor for `text`, unique within this slugger. */\n slug(text: string): string {\n const base = text\n .toLowerCase()\n .replace(/[^\\p{L}\\p{M}\\p{N}\\p{Pc} -]/gu, \"\")\n .replace(/ /g, \"-\");\n let slug = base;\n let n = this.seen.get(base) ?? 0;\n while (this.seen.has(slug)) slug = `${base}-${++n}`;\n this.seen.set(base, n);\n this.seen.set(slug, this.seen.get(slug) ?? 0);\n return slug;\n }\n}\n\n// ---- Markdown helpers -----------------------------------------------------------------------\n\nconst fence = /^ {0,3}(`{3,}|~{3,})/;\n\n/** Calls `fn` on each line outside fenced code blocks; code lines are kept as they are. */\nexport function mapProse(lines: string[], fn: (line: string) => string): string[] {\n let open: string | null = null;\n return lines.map((line) => {\n const f = fence.exec(line);\n if (open) {\n if (f && f[1]![0] === open[0] && f[1]!.length >= open.length && line.trim() === f[1])\n open = null;\n return line;\n }\n if (f) {\n open = f[1]!;\n return line;\n }\n return fn(line);\n });\n}\n\n/** Indexes of the lines outside fenced code blocks. */\nfunction proseLines(lines: string[]): boolean[] {\n const prose: boolean[] = [];\n let open: string | null = null;\n for (const line of lines) {\n const f = fence.exec(line);\n if (open) {\n prose.push(false);\n if (f && f[1]![0] === open[0] && f[1]!.length >= open.length && line.trim() === f[1])\n open = null;\n continue;\n }\n if (f) {\n open = f[1]!;\n prose.push(false);\n continue;\n }\n prose.push(true);\n }\n return prose;\n}\n\n/** Plain text of a Markdown inline string (titles, descriptions, heading slugs). */\nexport const plain = (s: string): string =>\n s\n .replace(/!\\[[^\\]]*\\]\\([^)]*\\)/g, \"\")\n .replace(/\\[([^\\]]*)\\]\\([^)]*\\)/g, \"$1\")\n .replace(/<[^>]+>/g, \"\")\n .replace(/[`*_]/g, \"\")\n .replace(/\\s+/g, \" \")\n .trim();\n\n/**\n * Replaces the inline code spans of a line with placeholders (CommonMark: a run of n backticks\n * opens a span that the next run of exactly n backticks closes; an unmatched run is literal).\n */\nfunction maskCode(line: string, spans: string[]): string {\n const runs = [...line.matchAll(/`+/g)].map((m) => ({ at: m.index, len: m[0].length }));\n let out = \"\";\n let pos = 0;\n for (let i = 0; i < runs.length; i++) {\n const open = runs[i]!;\n if (open.at < pos) continue;\n const close = runs.findIndex((r, j) => j > i && r.len === open.len);\n if (close < 0) continue;\n const end = runs[close]!.at + open.len;\n out += `${line.slice(pos, open.at)}\\uE000${spans.push(line.slice(open.at, end)) - 1}\\uE000`;\n pos = end;\n i = close;\n }\n return out + line.slice(pos);\n}\n\nconst alertKinds: Record<string, string> = {\n NOTE: \"note\",\n TIP: \"tip\",\n IMPORTANT: \"note\",\n WARNING: \"caution\",\n CAUTION: \"danger\",\n};\n\n/** GitHub alerts (`> [!WARNING]` + quoted lines) → Starlight asides (`:::caution`). */\nexport function alerts(lines: string[]): string[] {\n const out: string[] = [];\n for (let i = 0; i < lines.length; i++) {\n const m = /^> \\[!(NOTE|TIP|IMPORTANT|WARNING|CAUTION)\\]\\s*$/.exec(lines[i]!);\n if (!m) {\n out.push(lines[i]!);\n continue;\n }\n out.push(`:::${alertKinds[m[1]!]}`);\n while (i + 1 < lines.length && lines[i + 1]!.startsWith(\">\"))\n out.push(lines[++i]!.replace(/^> ?/, \"\"));\n out.push(\":::\");\n }\n return out;\n}\n\n/** The first paragraph of prose, as a meta description of at most ~200 characters. */\nexport function describeMarkdown(lines: string[]): string | undefined {\n const para: string[] = [];\n let inFence = false;\n for (const line of lines) {\n if (fence.test(line)) {\n inFence = !inFence;\n if (para.length) break;\n continue;\n }\n if (inFence) continue;\n if (line.trim() === \"\") {\n if (para.length) break;\n continue;\n }\n if (para.length === 0 && /^\\s*([#>|<:]|[-*+] |\\d+\\. |!\\[)/.test(line)) continue;\n // A thematic break (`---`) is not prose.\n if (para.length === 0 && /^\\s*([-*_])(\\s*\\1){2,}\\s*$/.test(line)) continue;\n para.push(line);\n }\n let d = plain(para.join(\" \"));\n if (!d) return undefined;\n if (d.length > 200) d = `${d.slice(0, 200).replace(/\\s+\\S*$/, \"\")}…`;\n return d;\n}\n\nconst yaml = (v: string) => JSON.stringify(v);\n\nfunction frontmatter(fields: Record<string, string | boolean | undefined>, extra = \"\"): string {\n const body = Object.entries(fields)\n .filter(([, v]) => v !== undefined)\n .map(([k, v]) => `${k}: ${typeof v === \"string\" ? yaml(v) : v}`)\n .join(\"\\n\");\n return `---\\n${body}${extra}\\n---\\n`;\n}\n\ntype Block = { heading: string | null; start: number; end: number; anchors: Set<string> };\ntype Doc = { lines: string[]; h1: number; title: string; blocks: Block[] };\n\n/** What {@link syncSite} did. */\nexport interface SyncResult {\n /** Pages written. */\n written: number;\n /** Problems that fail the build. */\n errors: string[];\n /** Links to pending guides, sent to GitHub for now. */\n warnings: string[];\n}\n\nconst isExternal = (t: string) => /^[a-z][a-z0-9+.-]*:/i.test(t) || t.startsWith(\"//\");\n\nfunction listMarkdown(dir: string, prefix: string): string[] {\n if (!existsSync(dir)) return [];\n return (readdirSync(dir, { recursive: true }) as string[])\n .filter((f) => f.endsWith(\".md\"))\n .map((f) => `${prefix}/${f.split(\"\\\\\").join(\"/\")}`)\n .sort();\n}\n\n/** Write `site/src/content/docs/` and `site/public/` from the manifest. */\nexport function syncSite(m: SiteManifest): SyncResult {\n const { repoRoot, siteDir, siteBase, repoUrl, repoSlug, branch } = m;\n const outDir = join(siteDir, \"src/content/docs\");\n const publicDir = join(siteDir, \"public\");\n const errors: string[] = [];\n const warnings: string[] = [];\n const fail = (msg: string) => errors.push(msg);\n const all = m.pages();\n const pending = new Set(m.pendingPages().flatMap((p) => (p.src ? [p.src] : [])));\n const route = (slug: string) => (slug === \"\" ? `${siteBase}/` : `${siteBase}/${slug}/`);\n\n const docs = new Map<string, Doc>();\n\n /** Reads a repository Markdown file into its intro block (null heading) and H2 blocks. */\n function loadDoc(src: string): Doc | undefined {\n const cached = docs.get(src);\n if (cached) return cached;\n const path = join(repoRoot, src);\n if (!existsSync(path)) {\n fail(`manifest: ${src} does not exist`);\n return undefined;\n }\n const lines = readFileSync(path, \"utf8\").replace(/\\r\\n/g, \"\\n\").split(\"\\n\");\n const prose = proseLines(lines);\n const slugger = new Slugger();\n let h1 = -1;\n const blocks: Block[] = [{ heading: null, start: 0, end: lines.length, anchors: new Set() }];\n lines.forEach((line, i) => {\n if (!prose[i]) return;\n const h = /^(#{1,6}) (.+?)\\s*#*\\s*$/.exec(line);\n if (!h) return;\n if (h[1] === \"#\" && h1 < 0) h1 = i;\n if (h[1] === \"##\") {\n blocks.at(-1)!.end = i;\n blocks.push({ heading: h[2]!, start: i, end: lines.length, anchors: new Set() });\n }\n blocks.at(-1)!.anchors.add(slugger.slug(plain(h[2]!)));\n });\n const doc: Doc = { lines, h1, title: h1 >= 0 ? plain(lines[h1]!.slice(2)) : \"\", blocks };\n docs.set(src, doc);\n return doc;\n }\n\n /** Which page (slug) holds each H2 block of each source file. */\n const blockPage = new Map<string, Map<Block, string>>();\n /** Whole-file pages: source → slug. */\n const filePage = new Map<string, string>();\n\n for (const p of all) {\n if (!p.src) continue;\n const doc = loadDoc(p.src);\n if (!doc) continue;\n if (!p.sections) {\n filePage.set(p.src, p.slug);\n continue;\n }\n const owners = blockPage.get(p.src) ?? new Map<Block, string>();\n blockPage.set(p.src, owners);\n if (p.intro) owners.set(doc.blocks[0]!, p.slug);\n for (const name of p.sections) {\n const block = doc.blocks.find((b) => b.heading === name);\n if (!block) fail(`${p.src}: no \"## ${name}\" section for /${p.slug}/`);\n else if (owners.has(block)) fail(`${p.src}: \"## ${name}\" is on two pages`);\n else owners.set(block, p.slug);\n }\n }\n\n // A split guide (one that is not README.md, whose other sections stay on GitHub) must place\n // every H2 on a page.\n for (const [src, owners] of blockPage) {\n if (src === \"README.md\" || filePage.has(src)) continue;\n const doc = loadDoc(src)!;\n for (const b of doc.blocks) {\n if (b.heading === null && !owners.has(b) && b.end - b.start > 0) {\n const text = doc.lines\n .slice(b.start, b.end)\n .filter((l, i) => b.start + i !== doc.h1 && l.trim());\n if (text.length)\n fail(`${src}: the text above the first H2 is on no page (set intro on one)`);\n } else if (b.heading !== null && !owners.has(b)) {\n fail(\n `${src}: \"## ${b.heading}\" is on no page (add it to a page's sections in the manifest)`,\n );\n }\n }\n }\n\n /** Pages made of one H2 section: their own H2 is dropped, since the title already says it. */\n const dropsH2 = new Set(\n all.filter((p) => p.sections && !p.intro && p.sections.length === 1).map((p) => p.slug),\n );\n\n /** The route of `anchor` (without #) in source `src`, or undefined when no page shows it. */\n function anchorRoute(src: string, anchor: string): string | undefined {\n const whole = filePage.get(src);\n if (whole !== undefined) return `${route(whole)}${anchor ? `#${anchor}` : \"\"}`;\n const owners = blockPage.get(src);\n const doc = docs.get(src);\n if (!owners || !doc) return undefined;\n if (!anchor) {\n const first = doc.blocks.find((b) => owners.has(b));\n return first ? route(owners.get(first)!) : undefined;\n }\n for (const [b, slug] of owners) {\n if (!b.anchors.has(anchor)) continue;\n // The section's own heading is the page title on a single-section page: link the page.\n const own = b.heading !== null && b.anchors.values().next().value === anchor;\n return own && dropsH2.has(slug) ? route(slug) : `${route(slug)}#${anchor}`;\n }\n return undefined;\n }\n\n /** Rewrites one link target found in `src`. `image` targets get a URL that serves the bytes. */\n function rewrite(target: string, src: string, image: boolean): string {\n if (target === \"\" || isExternal(target)) return target;\n if (target.startsWith(\"#\")) {\n // In a split guide the anchor may now live on a sibling page.\n if (!blockPage.has(src)) return target;\n return anchorRoute(src, target.slice(1)) ?? `${repoUrl}/blob/${branch}/${src}${target}`;\n }\n const parts = /^([^?#]*)(\\?[^#]*)?(#.*)?$/.exec(target)!;\n let path: string;\n try {\n path = decodeURIComponent(parts[1]!);\n } catch {\n fail(`${src}: malformed link ${target}`);\n return target;\n }\n const hash = parts[3] ?? \"\";\n const resolved = posix\n .normalize(path.startsWith(\"/\") ? path.slice(1) : posix.join(posix.dirname(src), path))\n .replace(/\\/$/, \"\");\n if (resolved.startsWith(\"..\")) {\n fail(`${src}: link ${target} leaves the repository`);\n return target;\n }\n const abs = join(repoRoot, resolved === \".\" ? \"\" : resolved);\n if (!existsSync(abs)) {\n if (pending.has(resolved)) {\n warnings.push(`${src}: ${target} is a pending guide; linking to GitHub until it lands`);\n return `${repoUrl}/blob/${branch}/${resolved}${parts[2] ?? \"\"}${hash}`;\n }\n fail(`${src}: broken link ${target} (${resolved} does not exist)`);\n return target;\n }\n if (image) return `https://raw.githubusercontent.com/${repoSlug}/${branch}/${resolved}`;\n const to = anchorRoute(resolved, hash.slice(1));\n if (to) return to;\n const kind = statSync(abs).isDirectory() ? \"tree\" : \"blob\";\n return `${repoUrl}/${kind}/${branch}/${resolved}${parts[2] ?? \"\"}${hash}`;\n }\n\n /** Rewrites the link targets on one prose line, leaving inline code spans alone. */\n function rewriteLine(line: string, src: string): string {\n const spans: string[] = [];\n let text = maskCode(line, spans);\n text = text.replace(\n /(!?)\\[((?:[^[\\]]|\\[[^\\]]*\\])*)\\]\\(\\s*(<[^>]*>|[^)\\s]+)((?:\\s+\"[^\"]*\")?\\s*)\\)/g,\n (_s, bang: string, label: string, t: string, title: string) => {\n const bare = t.startsWith(\"<\") ? t.slice(1, -1) : t;\n const out = rewrite(bare, src, bang === \"!\");\n return `${bang}[${label}](${t.startsWith(\"<\") ? `<${out}>` : out}${title})`;\n },\n );\n text = text.replace(\n /^( {0,3}\\[[^\\]]+\\]:\\s*)(\\S+)/,\n (_s, head: string, t: string) => head + rewrite(t, src, false),\n );\n text = text.replace(\n /\\b(href|src)=\"([^\"]*)\"/g,\n (_s, attr: string, t: string) => `${attr}=\"${rewrite(t, src, attr === \"src\")}\"`,\n );\n return text.replace(/\\uE000(\\d+)\\uE000/g, (_s, i: string) => spans[Number(i)]!);\n }\n\n const internalBanner = `\\nbanner:\\n content: ${yaml(\"Contributor documentation: how the project is built and released. Not needed to use the library.\")}`;\n\n function fromRepo(p: SitePage): string {\n const src = p.src!;\n const doc = loadDoc(src);\n if (!doc) return \"\";\n let body: string[];\n let title: string;\n if (p.sections) {\n const owners = blockPage.get(src)!;\n const mine = doc.blocks.filter((b) => owners.get(b) === p.slug);\n body = mine.flatMap((b) => {\n const lines = doc.lines.slice(b.start, b.end);\n // Drop the H1 (it becomes the title) and anything above it (a logo).\n return b.heading === null && doc.h1 >= 0 ? lines.slice(doc.h1 - b.start + 1) : lines;\n });\n title = p.title ?? (p.intro ? doc.title : (p.sections[0] ?? \"\"));\n // A single-section page drops its own H2: the title already says it.\n if (!p.intro && p.sections.length === 1) body = body.slice(1);\n } else {\n if (doc.h1 < 0) {\n fail(`${src}: no H1 to take the title from`);\n return \"\";\n }\n const pre = doc.lines.slice(0, doc.h1).filter((l) => l.trim() !== \"\");\n if (pre.some((l) => !/^\\s*(<|!\\[)/.test(l))) fail(`${src}: unexpected text before the H1`);\n title = p.title ?? doc.title;\n body = doc.lines.slice(doc.h1 + 1);\n }\n const description = p.description ?? describeMarkdown(body);\n const text = mapProse(alerts(body), (l) => rewriteLine(l, src)).join(\"\\n\");\n return (\n frontmatter(\n {\n title,\n description,\n editUrl: `${repoUrl}/edit/${branch}/${src}`,\n pagefind: p.internal ? false : undefined,\n },\n p.internal ? internalBanner : \"\",\n ) + text.replace(/^\\n+/, \"\\n\")\n );\n }\n\n function fromSite(p: SitePage): string {\n const path = join(siteDir, \"content\", p.site!);\n if (!existsSync(path)) {\n fail(`manifest: site/content/${p.site} does not exist`);\n return \"\";\n }\n let text = readFileSync(path, \"utf8\")\n .replaceAll(\"@BASE@\", siteBase)\n .replaceAll(\"@REPO@\", repoUrl)\n .replaceAll(\"@NPM@\", m.npmUrl);\n if (!/^---\\n[\\s\\S]*?\\neditUrl:/.test(text)) {\n text = text.replace(\n /^---\\n/,\n `---\\neditUrl: ${yaml(`${repoUrl}/edit/${branch}/site/content/${p.site}`)}\\n`,\n );\n }\n const left = /@[A-Z_]+@/.exec(text.replace(/```[\\s\\S]*?```/g, \"\"));\n if (left) fail(`site/content/${p.site}: unreplaced ${left[0]}`);\n return text;\n }\n\n rmSync(publicDir, { recursive: true, force: true });\n mkdirSync(publicDir, { recursive: true });\n for (const f of m.publicAssets) {\n const from = join(repoRoot, \"docs/assets\", f);\n if (existsSync(from)) copyFileSync(from, join(publicDir, f));\n else fail(`docs/assets/${f} does not exist (the site serves it)`);\n }\n\n rmSync(outDir, { recursive: true, force: true });\n let written = 0;\n for (const p of all) {\n const text = p.site ? fromSite(p) : fromRepo(p);\n if (!text) continue;\n const ext = p.site?.endsWith(\".mdx\") ? \"mdx\" : \"md\";\n const file = join(outDir, p.slug === \"\" ? `index.${ext}` : `${p.slug}.${ext}`);\n mkdirSync(dirname(file), { recursive: true });\n writeFileSync(file, text);\n written++;\n }\n\n // Every Markdown file under docs/ must be in the manifest, so a new guide is not forgotten.\n const covered = new Set(all.flatMap((p) => (p.src ? [p.src] : [])));\n for (const f of listMarkdown(join(repoRoot, \"docs\"), \"docs\")) {\n if (!covered.has(f) && !pending.has(f) && !m.ignoreDocs(f))\n fail(`${f} is not in the site manifest (add it to the sidebar)`);\n }\n\n return { written, errors, warnings };\n}\n\n/** Run {@link syncSite} and print the outcome; resolves to the exit code (the sync script's). */\nexport function runSync(\n m: SiteManifest,\n io: { log: (l: string) => void; error: (l: string) => void } = console,\n): number {\n const { written, errors, warnings } = syncSite(m);\n for (const w of warnings) io.log(`sync: warning: ${w}`);\n if (errors.length > 0) {\n for (const e of errors) io.error(`sync: ${e}`);\n io.error(`sync: ${errors.length} error(s)`);\n return 1;\n }\n io.log(`sync: ${written} pages in site/src/content/docs (base ${m.siteBase})`);\n return 0;\n}\n","/**\n * Load a docs-site peer from the **site's** install. The site has its own `package.json` and\n * `node_modules`, and the integrations must be the instances Astro and starlight-typedoc use there\n * (one `typedoc`, one `typescript`). Resolving from the kit's own location would find other\n * copies, or none, whenever the kit is not installed inside `site/node_modules`: a hoisted install,\n * or the kit's own site, whose `file:..` dependency is a tree of symlinks into the repo.\n *\n * @module\n */\n\nimport { existsSync, readFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { importPeer } from \"../internal/peer.ts\";\n\nconst SUBPATH = \"@xtandard/kit/site\";\n\ntype Conditions = string | null | { [key: string]: Conditions } | Conditions[];\n\nfunction pickEntry(value: Conditions | undefined): string | undefined {\n if (value === undefined || value === null) return undefined;\n if (typeof value === \"string\") return value;\n if (Array.isArray(value)) {\n for (const v of value) {\n const hit = pickEntry(v);\n if (hit) return hit;\n }\n return undefined;\n }\n for (const key of [\"import\", \"node\", \"default\"]) {\n const hit = pickEntry(value[key]);\n if (hit) return hit;\n }\n return undefined;\n}\n\n/**\n * The ESM entry file of package `name` as installed for `fromDir` (looking in `node_modules` from\n * `fromDir` upwards), or `undefined` when it isn't installed there.\n */\nexport function resolvePackageEntry(name: string, fromDir: string): string | undefined {\n let dir = fromDir;\n for (;;) {\n const pkgDir = join(dir, \"node_modules\", name);\n const pkgFile = join(pkgDir, \"package.json\");\n if (existsSync(pkgFile)) {\n const pkg = JSON.parse(readFileSync(pkgFile, \"utf8\")) as {\n exports?: Conditions | Record<string, Conditions>;\n module?: string;\n main?: string;\n };\n const exp = pkg.exports;\n const root =\n exp && typeof exp === \"object\" && !Array.isArray(exp) && \".\" in exp\n ? (exp as Record<string, Conditions>)[\".\"]\n : (exp as Conditions | undefined);\n const entry = pickEntry(root) ?? pkg.module ?? pkg.main ?? \"index.js\";\n return join(pkgDir, entry);\n }\n const parent = dirname(dir);\n if (parent === dir) return undefined;\n dir = parent;\n }\n}\n\n/**\n * Import package `name` as installed for the site at `siteDir`; when the site doesn't have it,\n * fall back to a plain `import()` from the kit (and a clear \"install it\" error when that fails).\n */\nexport async function importFromSite<T>(name: string, siteDir: string): Promise<T> {\n const entry = resolvePackageEntry(name, siteDir);\n if (entry) return (await import(pathToFileURL(entry).href)) as T;\n return importPeer(name, SUBPATH, () => import(/* @vite-ignore */ name) as Promise<T>);\n}\n","/**\n * The TypeDoc plugin for the API reference (passed to starlight-typedoc by `defineXtandardSite`):\n *\n * 1. A function whose return type is annotated with one of the package's own type aliases is\n * documented with that alias (`webhooksElysia(options): WebhooksElysiaPlugin`), as written.\n * TypeDoc otherwise prints the type the checker resolves the alias to — for the Elysia adapters,\n * the plugin's full inferred `Elysia<…, object & object & …>` generics.\n * 2. Each entry point's module is named after its subpath (`storage/redis`, the root module name\n * for `src/index.ts`), whatever its `@module` comment says, so the API routes match `exports`.\n * 3. A symbol several entry points export is documented once (see `apiOwners`); the others get a\n * reference. Those are recorded in `<site>/.astro/api-reexports.json` so `apiOverviews` can list\n * them on each re-exporting module's page.\n *\n * `typedoc` and `typescript` are loaded from the site's own install when the plugin runs (the\n * compiler instance that parsed the program).\n *\n * @module\n */\n\nimport { mkdirSync, readFileSync, existsSync, writeFileSync } from \"node:fs\";\nimport { dirname, join, resolve } from \"node:path\";\nimport type { Application, DeclarationReflection, ReferenceReflection } from \"typedoc\";\nimport { importFromSite } from \"./resolve.ts\";\n\n/**\n * A re-export: `name` in module `module` is documented in `owner` as the `kind` member `target`\n * (a different name for a renamed or `default` export).\n */\nexport interface Reexport {\n module: string;\n name: string;\n owner: string;\n kind: string;\n target: string;\n}\n\n/** Where the plugin writes, and `apiOverviews` reads, the re-exports of a site. */\nexport function reexportsFile(siteDir: string): string {\n return join(siteDir, \".astro/api-reexports.json\");\n}\n\n/** Read the re-exports the plugin recorded for a site (`[]` before the first API build). */\nexport function readReexports(siteDir: string): Reexport[] {\n const file = reexportsFile(siteDir);\n return existsSync(file) ? (JSON.parse(readFileSync(file, \"utf8\")) as Reexport[]) : [];\n}\n\n/** Import the site's `typedoc` and `typescript` (the instances starlight-typedoc uses). */\nexport async function loadSiteModules(\n siteDir: string,\n): Promise<{ typedoc: typeof import(\"typedoc\"); typescript: typeof import(\"typescript\") }> {\n const [typedoc, tsModule] = await Promise.all([\n importFromSite<typeof import(\"typedoc\")>(\"typedoc\", siteDir),\n importFromSite<typeof import(\"typescript\") & { default?: typeof import(\"typescript\") }>(\n \"typescript\",\n siteDir,\n ),\n ]);\n return { typedoc, typescript: tsModule.default ?? tsModule };\n}\n\n/** Options for {@link createTypedocPlugin}. */\nexport interface TypedocPluginOptions {\n /** Module name per entry file (absolute path → `storage/redis`); see `manifest.apiEntries()`. */\n moduleNames?: Record<string, string>;\n /**\n * The site's `typedoc` and `typescript` modules, already imported. `defineXtandardSite` passes\n * them, because a dynamic import inside the plugin can run after the loader that evaluated the\n * Astro config has closed. Without them, the plugin imports both from the site when it loads.\n */\n modules?: { typedoc: typeof import(\"typedoc\"); typescript: typeof import(\"typescript\") };\n}\n\n/**\n * Create the TypeDoc plugin for the site at `siteDir`. Pass the returned function in TypeDoc's\n * `plugin` option (TypeDoc 0.26+ accepts plugin functions and awaits them).\n */\nexport function createTypedocPlugin(\n siteDir: string,\n options: TypedocPluginOptions = {},\n): (app: Application) => Promise<void> {\n const moduleNames = new Map(\n Object.entries(options.moduleNames ?? {}).map(([file, name]) => [resolve(file), name]),\n );\n return async function load(app: Application): Promise<void> {\n // The site's typedoc and typescript: the program's nodes come from that compiler instance.\n const { typedoc, typescript: ts } = options.modules ?? (await loadSiteModules(siteDir));\n const { Converter, ReflectionKind } = typedoc;\n\n /** The generated folder for each member kind (typedoc-plugin-markdown's defaults). */\n const kindDirs: [number, string][] = [\n [ReflectionKind.Function, \"functions\"],\n [ReflectionKind.Class, \"classes\"],\n [ReflectionKind.Interface, \"interfaces\"],\n [ReflectionKind.TypeAlias, \"type-aliases\"],\n [ReflectionKind.Variable, \"variables\"],\n [ReflectionKind.Enum, \"enumerations\"],\n [ReflectionKind.Namespace, \"namespaces\"],\n ];\n\n app.converter.on(Converter.EVENT_CREATE_SIGNATURE, (context, signature, node) => {\n const typeNode = node && \"type\" in node ? node.type : undefined;\n if (!typeNode || !ts.isTypeReferenceNode(typeNode)) return;\n let symbol = context.checker.getSymbolAtLocation(typeNode.typeName);\n if (symbol && symbol.flags & ts.SymbolFlags.Alias)\n symbol = context.checker.getAliasedSymbol(symbol);\n const declaration = symbol?.declarations?.[0];\n if (\n !declaration ||\n !ts.isTypeAliasDeclaration(declaration) ||\n declaration.getSourceFile().fileName.includes(\"/node_modules/\")\n )\n return;\n signature.type = context.converter.convertType(context, typeNode);\n });\n\n // After TypeDoc applied `@module` names: a bare `@module` would leave the file name\n // (`entry-storage-redis`), which matches no route.\n app.converter.on(Converter.EVENT_RESOLVE_BEGIN, (context) => {\n if (moduleNames.size === 0) return;\n for (const module of context.project.getReflectionsByKind(ReflectionKind.Module)) {\n const symbol = context.getSymbolFromReflection(module);\n const file = symbol?.declarations\n ?.find((d) => ts.isSourceFile(d))\n ?.getSourceFile().fileName;\n const name = file && moduleNames.get(resolve(file));\n if (name) module.name = name;\n }\n });\n\n app.converter.on(Converter.EVENT_RESOLVE_END, (context) => {\n const reexports: Reexport[] = [];\n for (const ref of context.project.getReflectionsByKind(ReflectionKind.Reference)) {\n const module = ref.parent;\n const target = (ref as ReferenceReflection).tryGetTargetReflectionDeep() as\n | DeclarationReflection\n | undefined;\n const owner = target?.parent;\n const kind = target && kindDirs.find(([k]) => target.kindOf(k))?.[1];\n if (\n !module?.kindOf(ReflectionKind.Module) ||\n !owner?.kindOf(ReflectionKind.Module) ||\n !kind\n )\n continue;\n reexports.push({\n module: module.name,\n name: ref.name,\n owner: owner.name,\n kind,\n target: target.name,\n });\n }\n const file = reexportsFile(siteDir);\n mkdirSync(dirname(file), { recursive: true });\n writeFileSync(file, JSON.stringify(reexports, null, 2));\n });\n };\n}\n","/**\n * A Starlight plugin that runs after starlight-typedoc and writes the API reference's overview\n * pages, which the generator does not emit: `/api/` (every entry point, with its import path and\n * description) and `/api/<module>/` (that entry point's members, grouped by kind, with summaries).\n * The description is the `@module` doc comment at the top of each entry file, so it is written once,\n * next to the code. Modules are listed in `package.json` `exports` order (fl's version).\n *\n * @module\n */\n\nimport { existsSync, readdirSync, readFileSync, rmSync, writeFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport type { StarlightPlugin } from \"@astrojs/starlight/types\";\nimport type { ApiEntry, SiteManifest } from \"./manifest.ts\";\nimport { readReexports, type Reexport } from \"./typedoc-plugin.ts\";\n\nconst kinds = [\n [\"functions\", \"Functions\"],\n [\"classes\", \"Classes\"],\n [\"interfaces\", \"Interfaces\"],\n [\"type-aliases\", \"Type aliases\"],\n [\"variables\", \"Variables\"],\n [\"enumerations\", \"Enumerations\"],\n [\"namespaces\", \"Namespaces\"],\n] as const;\n\ntype Member = { name: string; route: string; summary: string };\ntype Module = {\n name: string;\n importPath: string;\n source: string;\n description: string;\n members: Map<string, Member[]>;\n};\n\nconst yaml = (v: string) => JSON.stringify(v);\n\n/** A module's leading doc comment, without the `Import from` line and the tags; `{@link}`s become code spans. */\nexport function moduleDescription(text: string): string {\n const m = /^\\/\\*\\*([\\s\\S]*?)\\*\\//.exec(text);\n if (!m) return \"\";\n return (\n m[1]!\n .split(\"\\n\")\n .map((l) => l.replace(/^\\s*\\* ?/, \"\"))\n .filter((l) => !l.startsWith(\"Import from \") && !l.startsWith(\"@\"))\n .join(\"\\n\")\n // `{@link ./validation}`, `{@link Foo | the foo}` → code spans: these pages are plain Markdown.\n .replace(\n /\\{@link(?:code|plain)?\\s+([^}|\\s]+)\\s*(?:\\|\\s*([^}]*))?\\}/g,\n (_s, target: string, label?: string) =>\n `\\`${label?.trim() || target.replace(/^.*[./]/, \"\")}\\``,\n )\n .trim()\n .replace(/\\n{3,}/g, \"\\n\\n\")\n );\n}\n\n/** A generated member page's title and the first prose paragraph after its \"Defined in\" line. */\nfunction member(file: string, route: string, fallbackName = \"\"): Member {\n const text = readFileSync(file, \"utf8\");\n const title = /^title: (.+)$/m.exec(text)?.[1];\n const name = title ? (JSON.parse(title) as string) : fallbackName;\n const lines = text.split(\"\\n\");\n const at = lines.findIndex((l) => l.startsWith(\"Defined in:\"));\n let summary = \"\";\n if (at >= 0) {\n const para: string[] = [];\n for (const l of lines.slice(at + 1)) {\n if (l.trim() === \"\") {\n if (para.length) break;\n continue;\n }\n if (/^(#|```|\\||:::|>)/.test(l)) break;\n para.push(l.trim());\n }\n summary = para.join(\" \");\n }\n return { name, route, summary };\n}\n\nfunction collect(ctx: Ctx, apiDir: string): Module[] {\n const { siteBase, packageName } = ctx;\n const modules: Module[] = [];\n const walk = (dir: string, name: string) => {\n const entries = readdirSync(dir, { withFileTypes: true }).filter((e) => e.isDirectory());\n const kindDirs = new Set<string>(kinds.map(([k]) => k));\n if (name && entries.some((e) => kindDirs.has(e.name))) {\n const entry = ctx.entries.find((e) => e.name === name);\n const source = entry?.source ?? \"\";\n const members = new Map<string, Member[]>();\n for (const [kind] of kinds) {\n const kdir = join(dir, kind);\n if (!existsSync(kdir)) continue;\n // A namespace is a folder with its own generated index.md; other members are files.\n const list = readdirSync(kdir, { withFileTypes: true })\n .map((e) =>\n e.isDirectory()\n ? existsSync(join(kdir, e.name, \"index.md\"))\n ? member(\n join(kdir, e.name, \"index.md\"),\n `${siteBase}/api/${name}/${kind}/${e.name}/`.toLowerCase(),\n e.name,\n )\n : undefined\n : e.name.endsWith(\".md\")\n ? member(\n join(kdir, e.name),\n `${siteBase}/api/${name}/${kind}/${e.name.slice(0, -3)}/`.toLowerCase(),\n )\n : undefined,\n )\n .filter((x): x is Member => x !== undefined)\n .sort((a, b) => a.name.localeCompare(b.name));\n if (list.length) members.set(kind, list);\n }\n modules.push({\n name,\n importPath: entry?.importPath ?? `${packageName}/${name}`,\n source,\n description: source\n ? moduleDescription(readFileSync(join(ctx.repoRoot, source), \"utf8\"))\n : \"\",\n members,\n });\n }\n for (const e of entries)\n if (!kindDirs.has(e.name)) walk(join(dir, e.name), name ? `${name}/${e.name}` : e.name);\n };\n walk(apiDir, \"\");\n // package.json `exports` order: the root first, then the subpaths as the package lists them.\n const order = ctx.entries.map((e) => e.name);\n const rank = (m: Module) => (order.includes(m.name) ? order.indexOf(m.name) : order.length);\n return modules.sort((a, b) => rank(a) - rank(b) || a.name.localeCompare(b.name));\n}\n\nconst firstSentence = (s: string) => {\n const flat = s.replace(/\\s+/g, \" \").trim();\n const m = /^(.+?\\.)(\\s|$)/.exec(flat);\n return m ? m[1]! : flat;\n};\n\nfunction modulePage(ctx: Ctx, m: Module, reexports: Reexport[]): string {\n const { siteBase, repoUrl, branch } = ctx;\n const out = [\n \"---\",\n `title: ${yaml(m.importPath)}`,\n `description: ${yaml(firstSentence(m.description) || `API reference for ${m.importPath}.`)}`,\n m.source ? `editUrl: ${yaml(`${repoUrl}/edit/${branch}/${m.source}`)}` : \"editUrl: false\",\n \"next: false\",\n \"prev: false\",\n \"---\",\n \"\",\n m.description,\n \"\",\n \"```ts\",\n `import { … } from \"${m.importPath}\";`,\n \"```\",\n \"\",\n ];\n // A symbol several entry points export is documented once, under the first (astro.config.ts\n // apiOwners); say which other entry points this one also re-exports from. Only `export … from`\n // statements count: an entry point that merely imports another one doesn't re-export it.\n // A generated module no entry point matches (no `source`) has nothing to scan.\n const from = new Set(\n m.source\n ? [\n ...readFileSync(join(ctx.repoRoot, m.source), \"utf8\").matchAll(\n /^export\\s[^;]*?\\bfrom\\s+\"\\.\\/([^\"]+)\"/gm,\n ),\n ].map((x) => `src/${x[1]}`)\n : [],\n );\n const others = ctx.entries.filter((e) => e.source !== m.source && from.has(e.source));\n if (others.length)\n out.push(\n `Also re-exports symbols of ${others\n .map((e) => `[\\`${e.importPath}\\`](${siteBase}/api/${e.name}/)`)\n .join(\", \")}, documented on those pages.`,\n \"\",\n );\n for (const [kind, label] of kinds) {\n const list = m.members.get(kind);\n if (!list) continue;\n out.push(`## ${label}`, \"\", \"| Name | Summary |\", \"| --- | --- |\");\n for (const x of list)\n out.push(`| [\\`${x.name}\\`](${x.route}) | ${x.summary.replaceAll(\"|\", \"\\\\|\")} |`);\n out.push(\"\");\n }\n // Re-exports of symbols documented on another module page the sentence above doesn't name\n // (e.g. the Elysia 2 adapter's `flagsPanel`, shared with and documented under the Elysia 1 one).\n const covered = new Set(others.map((e) => e.name));\n const listed = reexports\n .filter((r) => r.module === m.name && !covered.has(r.owner))\n .sort((a, b) => a.name.localeCompare(b.name));\n if (listed.length) {\n out.push(\"## Re-exports\", \"\", \"| Name | Documented on |\", \"| --- | --- |\");\n for (const r of listed) {\n const owner = ctx.entries.find((e) => e.name === r.owner)?.importPath ?? r.owner;\n const route = `${siteBase}/api/${r.owner}/${r.kind}/${r.target}/`.toLowerCase();\n const label = r.name === r.target ? `\\`${r.name}\\`` : `\\`${r.name}\\` (\\`${r.target}\\`)`;\n out.push(`| [${label}](${route}) | [\\`${owner}\\`](${siteBase}/api/${r.owner}/) |`);\n }\n out.push(\"\");\n }\n return out.join(\"\\n\");\n}\n\nfunction indexPage(ctx: Ctx, modules: Module[]): string {\n const { siteBase, packageName } = ctx;\n const out = [\n \"---\",\n 'title: \"API reference\"',\n `description: ${yaml(`Every entry point of ${packageName} and its exports, generated from the TypeScript source and its doc comments.`)}`,\n \"editUrl: false\",\n \"next: false\",\n \"prev: false\",\n \"---\",\n \"\",\n \"Generated from the source by [TypeDoc](https://typedoc.org/), so it always matches the published\",\n \"types. Each entry point is a separate import; its optional peer dependencies are listed in its\",\n ctx.entryPointsSlug\n ? `description and on [Entry points](${siteBase}/${ctx.entryPointsSlug}/).`\n : \"description.\",\n \"\",\n \"| Import | Exports | Description |\",\n \"| --- | --- | --- |\",\n ];\n for (const m of modules) {\n const count = [...m.members.values()].reduce((n, l) => n + l.length, 0);\n out.push(\n `| [\\`${m.importPath}\\`](${siteBase}/api/${m.name}/) | ${count} | ${firstSentence(m.description).replaceAll(\"|\", \"\\\\|\")} |`,\n );\n }\n out.push(\"\");\n return out.join(\"\\n\");\n}\n\n/** Options for {@link apiOverviews}. */\nexport interface ApiOverviewsOptions {\n /**\n * Slug of the site's \"Entry points\" page, linked from `/api/` (`\"entry-points\"`), or `false`\n * when the site has none. Default: `\"entry-points\"` when the manifest has that page.\n */\n entryPointsSlug?: string | false;\n}\n\ninterface Ctx {\n repoRoot: string;\n siteBase: string;\n repoUrl: string;\n branch: string;\n packageName: string;\n entries: ApiEntry[];\n entryPointsSlug: string | false;\n}\n\n/** The overview-pages plugin; add it after starlight-typedoc (plugins run in order). */\nexport function apiOverviews(\n manifest: SiteManifest,\n options: ApiOverviewsOptions = {},\n): StarlightPlugin {\n return {\n name: \"xtandard-api-overviews\",\n hooks: {\n \"config:setup\"({ astroConfig, command, logger }) {\n if (command === \"preview\") return;\n const apiDir = join(new URL(astroConfig.srcDir).pathname, \"content/docs/api\");\n if (!existsSync(apiDir)) {\n logger.warn(\"no generated API reference to index\");\n return;\n }\n logger.info(`API overviews: ${writeApiOverviews(manifest, apiDir, options)} modules`);\n },\n },\n };\n}\n\n/**\n * Write `index.md` for `/api/` and each `/api/<module>/` under `apiDir` (starlight-typedoc's\n * output). Resolves to the number of modules.\n */\nexport function writeApiOverviews(\n manifest: SiteManifest,\n apiDir: string,\n options: ApiOverviewsOptions = {},\n): number {\n const ctx: Ctx = {\n repoRoot: manifest.repoRoot,\n siteBase: manifest.siteBase,\n repoUrl: manifest.repoUrl,\n branch: manifest.branch,\n packageName: manifest.packageName,\n entries: manifest.apiEntries(),\n entryPointsSlug:\n options.entryPointsSlug ??\n (manifest.pages().some((p) => p.slug === \"entry-points\") ? \"entry-points\" : false),\n };\n const modules = collect(ctx, apiDir);\n const reexports = readReexports(manifest.siteDir);\n for (const m of modules)\n writeFileSync(join(apiDir, m.name, \"index.md\"), modulePage(ctx, m, reexports));\n writeFileSync(join(apiDir, \"index.md\"), indexPage(ctx, modules));\n // The generator's own root listing links to module pages it never emits; index.md replaces it.\n rmSync(join(apiDir, \"README.md\"), { force: true });\n return modules.length;\n}\n","/**\n * `defineXtandardSite` builds a product docs site's Astro config: Starlight over the synced\n * Markdown, the TypeDoc API reference (starlight-typedoc, with the kit's plugin and overview\n * pages), Mermaid diagrams, the links validator, and the family's head tags (favicons, social\n * card, theme colour). Products pass their copy, palette, API owners and dev port.\n *\n * The integrations are optional peers, loaded from the site's own install, so the function is\n * async: `export default await defineXtandardSite({ … })`.\n *\n * @module\n */\n\nimport { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport type { AstroUserConfig } from \"astro\";\nimport { apiOverviews } from \"./api-overviews.ts\";\nimport { isGroup, isPage, type SiteItem, type SiteManifest } from \"./manifest.ts\";\nimport { importFromSite } from \"./resolve.ts\";\nimport { createTypedocPlugin, loadSiteModules } from \"./typedoc-plugin.ts\";\n\ntype IntegrationFactory = (options: Record<string, unknown>) => unknown;\n\n/** A Starlight sidebar entry. */\nexport type StarlightSidebarItem =\n | { slug: string; label?: string }\n | { label: string; link: string }\n | { label: string; collapsed?: boolean; items: StarlightSidebarItem[] };\n\n/** The manifest's sidebar as Starlight sidebar entries. */\nexport function toStarlightSidebar(items: SiteItem[]): StarlightSidebarItem[] {\n return items.map((i) => {\n if (isPage(i)) return i.label ? { slug: i.slug, label: i.label } : { slug: i.slug };\n if (isGroup(i))\n return { label: i.label, collapsed: i.collapsed, items: toStarlightSidebar(i.items) };\n return { label: i.label, link: i.link };\n });\n}\n\n/**\n * The API entry files in documentation order: `apiOwners` first (a symbol exported by several\n * entry points is documented under the first one TypeDoc meets), then the rest alphabetically — a\n * fixed order, since a glob's order differs between file systems. Throws when an owner is not an\n * entry point.\n */\nexport function orderedEntryPoints(manifest: SiteManifest, apiOwners: string[] = []): string[] {\n const sources = manifest.apiEntries().map((e) => e.source);\n for (const o of apiOwners)\n if (!sources.includes(o)) throw new Error(`defineXtandardSite: ${o} is not an entry point`);\n return [...apiOwners, ...sources.filter((f) => !apiOwners.includes(f)).sort()];\n}\n\n/** Options for {@link defineXtandardSite}. */\nexport interface XtandardSiteOptions {\n /** The site manifest (`defineSiteManifest`), shared with the sync script. */\n manifest: SiteManifest;\n /** Meta description of the site. */\n description: string;\n /** The social card's tagline, for its alt text. */\n tagline: string;\n /** Entry files other entry points re-export from, in ownership order (`src/core.ts`…). */\n apiOwners?: string[];\n /** `astro dev` / `preview` port (wh 4323, fl 4322, au 4326, li 4331, en 4324). */\n devPort?: number;\n /** Palette stylesheet(s), relative to the site; `./src/styles/brand.css` by default. */\n brandCss?: string | string[];\n /** Site title; the package name by default. */\n title?: string;\n /**\n * The header lockups (relative to the site), or `false` for the text title. Defaults to\n * `../docs/assets/lockup-horizontal-{dark,light}.svg` when they exist.\n */\n logo?: { dark: string; light: string } | false;\n /** The TypeDoc tsconfig, relative to the site; `./typedoc.tsconfig.json` by default. */\n typedocTsconfig?: string;\n /** Extra TypeDoc options (merged over the defaults). */\n typeDoc?: Record<string, unknown>;\n /** Mermaid diagrams (`astro-mermaid`); default `true`. */\n mermaid?: boolean;\n /** `theme-color` meta; `#0f1215` by default. */\n themeColor?: string;\n /** Slug of the \"Entry points\" page linked from `/api/`; see `apiOverviews`. */\n entryPointsSlug?: string | false;\n /** Extra Starlight options, merged last. */\n starlight?: Record<string, unknown>;\n /**\n * Already-imported integrations, used instead of importing them (an unusual install layout,\n * tests). Each one left out is imported from the site's install.\n */\n peers?: Partial<SitePeers>;\n}\n\n/** The integrations {@link defineXtandardSite} uses. */\nexport interface SitePeers {\n starlight: (typeof import(\"@astrojs/starlight\"))[\"default\"];\n createStarlightTypeDocPlugin: (typeof import(\"starlight-typedoc\"))[\"createStarlightTypeDocPlugin\"];\n linksValidator: IntegrationFactory;\n mermaid: IntegrationFactory;\n /** The site's `typedoc` and `typescript`, for the TypeDoc plugin. */\n typedoc: { typedoc: typeof import(\"typedoc\"); typescript: typeof import(\"typescript\") };\n}\n\ntype Integration = NonNullable<AstroUserConfig[\"integrations\"]>[number];\n\n/** Build the site's Astro config. */\nexport async function defineXtandardSite(options: XtandardSiteOptions): Promise<AstroUserConfig> {\n const m = options.manifest;\n const peers = options.peers ?? {};\n // Resolved from the site's own install, so Astro, Starlight and TypeDoc are the site's instances.\n const fromSite = <T>(name: string) => importFromSite<T>(name, m.siteDir);\n const [starlight, createStarlightTypeDocPlugin, linksValidator] = await Promise.all([\n peers.starlight ??\n fromSite<typeof import(\"@astrojs/starlight\")>(\"@astrojs/starlight\").then(\n (mod) => mod.default,\n ),\n peers.createStarlightTypeDocPlugin ??\n fromSite<typeof import(\"starlight-typedoc\")>(\"starlight-typedoc\").then(\n (mod) => mod.createStarlightTypeDocPlugin,\n ),\n peers.linksValidator ??\n fromSite<{ default: IntegrationFactory }>(\"starlight-links-validator\").then(\n (mod) => mod.default,\n ),\n ]);\n // Loaded now, while the config is being evaluated (see TypedocPluginOptions.modules).\n const typedocModules = peers.typedoc ?? (await loadSiteModules(m.siteDir));\n const entryPoints = orderedEntryPoints(m, options.apiOwners);\n const title = options.title ?? m.packageName;\n const socialImage = `${m.siteOrigin}${m.siteBase}/social.png`;\n const serves = (asset: string) => m.publicAssets.includes(asset);\n const logo =\n options.logo === false\n ? undefined\n : (options.logo ??\n (existsSync(join(m.repoRoot, \"docs/assets/lockup-horizontal-dark.svg\")) &&\n existsSync(join(m.repoRoot, \"docs/assets/lockup-horizontal-light.svg\"))\n ? {\n dark: \"../docs/assets/lockup-horizontal-dark.svg\",\n light: \"../docs/assets/lockup-horizontal-light.svg\",\n }\n : undefined));\n const brandCss = options.brandCss ?? \"./src/styles/brand.css\";\n\n const [apiReference, apiSidebarGroup] = createStarlightTypeDocPlugin();\n const sidebar = toStarlightSidebar(m.sidebar);\n\n const integrations: Integration[] = [];\n if (options.mermaid !== false) {\n // Must come before Starlight.\n const mermaid =\n peers.mermaid ?? (await fromSite<{ default: IntegrationFactory }>(\"astro-mermaid\")).default;\n integrations.push(\n mermaid({ theme: \"neutral\", autoTheme: true, enableLog: false }) as Integration,\n );\n }\n integrations.push(\n starlight({\n title,\n description: options.description,\n ...(logo ? { logo: { ...logo, alt: title, replacesTitle: true } } : {}),\n // Only the brand files the site serves (manifest `publicAssets`, copied by the sync step).\n ...(serves(\"favicon.svg\") ? { favicon: \"/favicon.svg\" } : {}),\n head: [\n ...(serves(\"favicon.ico\")\n ? [\n {\n tag: \"link\" as const,\n attrs: {\n rel: \"icon\",\n href: `${m.siteBase}/favicon.ico`,\n sizes: \"16x16 32x32 48x48\",\n },\n },\n ]\n : []),\n ...(serves(\"apple-touch-icon.png\")\n ? [\n {\n tag: \"link\" as const,\n attrs: { rel: \"apple-touch-icon\", href: `${m.siteBase}/apple-touch-icon.png` },\n },\n ]\n : []),\n {\n tag: \"meta\" as const,\n attrs: { name: \"theme-color\", content: options.themeColor ?? \"#0f1215\" },\n },\n ...(serves(\"social.png\")\n ? (\n [\n { property: \"og:image\", content: socialImage },\n { property: \"og:image:width\", content: \"1280\" },\n { property: \"og:image:height\", content: \"640\" },\n { property: \"og:image:alt\", content: `${m.packageName} — ${options.tagline}` },\n { name: \"twitter:card\", content: \"summary_large_image\" },\n { name: \"twitter:image\", content: socialImage },\n ] as Record<string, string>[]\n ).map((attrs) => ({ tag: \"meta\" as const, attrs }))\n : []),\n ],\n social: [\n { icon: \"github\", label: \"GitHub\", href: m.repoUrl },\n { icon: \"npm\", label: \"npm\", href: m.npmUrl },\n ],\n editLink: { baseUrl: `${m.repoUrl}/edit/${m.branch}/` },\n lastUpdated: false,\n customCss: Array.isArray(brandCss) ? brandCss : [brandCss],\n tableOfContents: { minHeadingLevel: 2, maxHeadingLevel: 3 },\n // The API reference goes before the last group (the project group).\n sidebar: [...sidebar.slice(0, -1), apiSidebarGroup, ...sidebar.slice(-1)],\n plugins: [\n apiReference({\n entryPoints: entryPoints.map((f) => join(m.repoRoot, f)),\n tsconfig: options.typedocTsconfig ?? \"./typedoc.tsconfig.json\",\n output: \"api\",\n sidebar: { label: \"API reference\", collapsed: true },\n typeDoc: {\n // Named return types as written, and the re-export list on each module page.\n plugin: [\n \"typedoc-plugin-missing-exports\",\n createTypedocPlugin(m.siteDir, {\n modules: typedocModules,\n moduleNames: Object.fromEntries(\n m.apiEntries().map((e) => [join(m.repoRoot, e.source), e.name]),\n ),\n }),\n ],\n placeInternalsInOwningModule: true,\n excludePrivate: true,\n excludeInternal: true,\n excludeExternals: true,\n disableGit: true,\n // The project's own typecheck covers the program; TypeDoc only reads src/.\n skipErrorChecking: true,\n // {path} is relative to src/ (the entry points' common directory).\n sourceLinkTemplate: `${m.repoUrl}/blob/${m.branch}/src/{path}#L{line}`,\n useCodeBlocks: true,\n parametersFormat: \"table\",\n interfacePropertiesFormat: \"table\",\n classPropertiesFormat: \"table\",\n typeDeclarationFormat: \"table\",\n enumMembersFormat: \"table\",\n ...options.typeDoc,\n } as never,\n }),\n // After starlight-typedoc (plugins run in order): the /api/ and /api/<module>/ pages.\n apiOverviews(m, { entryPointsSlug: options.entryPointsSlug }),\n linksValidator({\n errorOnRelativeLinks: false,\n errorOnInvalidHashes: true,\n // The guides point at the local servers they start (http://localhost:3000).\n errorOnLocalLinks: false,\n }) as ReturnType<typeof apiOverviews>,\n ],\n ...options.starlight,\n }),\n );\n\n return {\n site: m.siteOrigin,\n base: m.siteBase,\n trailingSlash: \"ignore\",\n telemetry: false,\n ...(options.devPort ? { server: { port: options.devPort } } : {}),\n integrations,\n } as AstroUserConfig;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAoIA,MAAa,UAAU,MAA+B,UAAU;;AAEhE,MAAa,WAAW,MAAgC,WAAW;AAEnE,SAAS,KAAK,OAAmB,MAAkB,CAAC,GAAe;CACjE,KAAK,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C;IACvD,UAAU,QAAQ,mBAAmB;IACrC,QAAQ;IACR,SAAS;KAAE,OAAO;KAAiB,WAAW;IAAK;IACnD,SAAS;KAEP,QAAQ,CACN,kCACA,oBAAoB,EAAE,SAAS;MAC7B,SAAS;MACT,aAAa,OAAO,YAClB,EAAE,WAAW,EAAE,KAAK,MAAM,EAAA,GAAA,UAAA,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,EAAE,IAAI,CAAC,CAChE;KACF,CAAC,CACH;KACA,8BAA8B;KAC9B,gBAAgB;KAChB,iBAAiB;KACjB,kBAAkB;KAClB,YAAY;KAEZ,mBAAmB;KAEnB,oBAAoB,GAAG,EAAE,QAAQ,QAAQ,EAAE,OAAO;KAClD,eAAe;KACf,kBAAkB;KAClB,2BAA2B;KAC3B,uBAAuB;KACvB,uBAAuB;KACvB,mBAAmB;KACnB,GAAG,QAAQ;IACb;GACF,CAAC;GAED,aAAa,GAAG,EAAE,iBAAiB,QAAQ,gBAAgB,CAAC;GAC5D,eAAe;IACb,sBAAsB;IACtB,sBAAsB;IAEtB,mBAAmB;GACrB,CAAC;EACH;EACA,GAAG,QAAQ;CACb,CAAC,CACH;CAEA,OAAO;EACL,MAAM,EAAE;EACR,MAAM,EAAE;EACR,eAAe;EACf,WAAW;EACX,GAAI,QAAQ,UAAU,EAAE,QAAQ,EAAE,MAAM,QAAQ,QAAQ,EAAE,IAAI,CAAC;EAC/D;CACF;AACF"}
@@ -0,0 +1,336 @@
1
+ import { Application } from "typedoc";
2
+ import { StarlightPlugin } from "@astrojs/starlight/types";
3
+ import { AstroUserConfig } from "astro";
4
+
5
+ //#region src/site/manifest.d.ts
6
+ /**
7
+ * A docs site's information architecture: which repository Markdown becomes which page, and the
8
+ * sidebar tree. `syncSite` reads it to write `src/content/docs/`, and `defineXtandardSite` reads it
9
+ * to build the sidebar, so a page and its sidebar entry cannot drift.
10
+ *
11
+ * The Markdown in the repository (README.md, docs/*.md) stays the single source of truth: it is what
12
+ * GitHub and npm render. A page is one of:
13
+ *
14
+ * - a whole repository file (`src`);
15
+ * - some H2 sections of one (`src` + `sections`, optionally `intro` for the text above the first H2).
16
+ * Every H2 of a split guide must land on exactly one page;
17
+ * - a page written for the site only (`site`, relative to `site/content/`).
18
+ *
19
+ * A page marked `pending` is a guide that has not landed yet. While its `src` is missing it is left
20
+ * out of the site, and links to it go to GitHub (with a warning) instead of failing the build.
21
+ *
22
+ * Plain Node APIs only: Astro loads this through Vite, and the sync step runs it directly.
23
+ *
24
+ * @module
25
+ */
26
+ /** One page of the site. */
27
+ interface SitePage {
28
+ /** Route without the base and without slashes; `""` is the home page. */
29
+ slug: string;
30
+ /** Sidebar label; the page title when absent. */
31
+ label?: string;
32
+ /** Repository file the page is built from. */
33
+ src?: string;
34
+ /** Only these H2 sections of `src` (by heading text, in file order). */
35
+ sections?: string[];
36
+ /** With `sections`: also the H1 and the text above the first H2. */
37
+ intro?: boolean;
38
+ /** Page title when it does not come from the source's H1. */
39
+ title?: string;
40
+ /** Meta description when the first paragraph of the source does not make a good one. */
41
+ description?: string;
42
+ /** Site-only page in `site/content/` (`.md` or `.mdx`). */
43
+ site?: string;
44
+ /** Contributor-only material: a banner says so and search skips it. */
45
+ internal?: boolean;
46
+ /** A guide that has not landed yet: left out (links go to GitHub) until `src` exists. */
47
+ pending?: boolean;
48
+ }
49
+ /** An external sidebar link. */
50
+ interface SiteLink {
51
+ label: string;
52
+ link: string;
53
+ }
54
+ /** A sidebar group. */
55
+ interface SiteGroup {
56
+ label: string;
57
+ collapsed?: boolean;
58
+ items: SiteItem[];
59
+ }
60
+ /** A sidebar item. */
61
+ type SiteItem = SitePage | SiteLink | SiteGroup;
62
+ /** A public entry point: its API reference module, import specifier and source file. */
63
+ interface ApiEntry {
64
+ /** TypeDoc module name (its `@module` tag) and route under `/api/`: the subpath, or the root name. */
65
+ name: string;
66
+ /** `@xtandard/kit/storage`. */
67
+ importPath: string;
68
+ /** Repository-relative source file. */
69
+ source: string;
70
+ }
71
+ /** Options for {@link defineSiteManifest}. */
72
+ interface SiteManifestOptions {
73
+ /** Absolute path of the repository root. */
74
+ repoRoot: string;
75
+ /** Absolute path of the site directory; `<repoRoot>/site` by default. */
76
+ siteDir?: string;
77
+ /** `owner/repo` on GitHub. */
78
+ repoSlug: string;
79
+ /** The npm package name (`@xtandard/flags`). */
80
+ packageName: string;
81
+ /** The API module name of the package root (its `@module` tag); the unscoped name by default. */
82
+ rootModule?: string;
83
+ /** Default branch; `"main"`. */
84
+ branch?: string;
85
+ /** Default site origin; overridden by `SITE_ORIGIN`. `https://me.xantiagoma.com` by default. */
86
+ origin?: string;
87
+ /** Default base path (`"/xtandard-flags"`); overridden by `SITE_BASE`. */
88
+ base: string;
89
+ /** The home page; `{ slug: "", site: "index.mdx" }` by default. */
90
+ home?: SitePage;
91
+ /** The sidebar tree, pending pages included. */
92
+ sidebar: SiteItem[];
93
+ /** `docs/` Markdown files that are not guides (skipped by the "every guide is a page" check). */
94
+ ignoreDocs?: (path: string) => boolean;
95
+ /** `docs/assets/` files served at the site root; favicons and the social card by default. */
96
+ publicAssets?: string[];
97
+ /** Environment to read `SITE_ORIGIN`/`SITE_BASE` from; `process.env` by default. */
98
+ env?: Record<string, string | undefined>;
99
+ }
100
+ /** A resolved site manifest. */
101
+ interface SiteManifest {
102
+ repoRoot: string;
103
+ siteDir: string;
104
+ repoSlug: string;
105
+ repoUrl: string;
106
+ npmUrl: string;
107
+ packageName: string;
108
+ rootModule: string;
109
+ branch: string;
110
+ /** Always `https://` (configure-pages reports a custom domain as `http://`). */
111
+ siteOrigin: string;
112
+ /** No trailing slash. */
113
+ siteBase: string;
114
+ home: SitePage;
115
+ /** The sidebar tree without the pending guides that have not landed yet. */
116
+ sidebar: SiteItem[];
117
+ publicAssets: string[];
118
+ ignoreDocs: (path: string) => boolean;
119
+ /** Every page, the home page first (pending guides only once they exist). */
120
+ pages(): SitePage[];
121
+ /** Pending guides whose source does not exist yet. */
122
+ pendingPages(): SitePage[];
123
+ /** Every public entry point, in `package.json` `exports` order. */
124
+ apiEntries(): ApiEntry[];
125
+ }
126
+ /** Whether a sidebar item is a page. */
127
+ declare const isPage: (i: SiteItem) => i is SitePage;
128
+ /** Whether a sidebar item is a group. */
129
+ declare const isGroup: (i: SiteItem) => i is SiteGroup;
130
+ /**
131
+ * Every public entry point of the package at `repoRoot`, in `exports` order. Skips stylesheets,
132
+ * wildcards, JSON and `./package.json`. A subpath maps to `src/entry-<subpath with dashes>.ts` when
133
+ * that file exists, otherwise to `src/<subpath>.ts(x)`; the root maps to `src/index.ts`.
134
+ */
135
+ declare function apiEntries(repoRoot: string, packageName: string, rootModule: string): ApiEntry[];
136
+ /** Resolve a site manifest from the product's options. */
137
+ declare function defineSiteManifest(options: SiteManifestOptions): SiteManifest;
138
+ //#endregion
139
+ //#region src/site/sync.d.ts
140
+ /**
141
+ * GitHub's heading anchors (github-slugger): lowercase, punctuation and symbols removed, spaces to
142
+ * `-`, repeats suffixed `-1`, `-2`…
143
+ */
144
+ declare class Slugger {
145
+ private seen;
146
+ /** The anchor for `text`, unique within this slugger. */
147
+ slug(text: string): string;
148
+ }
149
+ /** Calls `fn` on each line outside fenced code blocks; code lines are kept as they are. */
150
+ declare function mapProse(lines: string[], fn: (line: string) => string): string[];
151
+ /** Plain text of a Markdown inline string (titles, descriptions, heading slugs). */
152
+ declare const plain: (s: string) => string;
153
+ /** GitHub alerts (`> [!WARNING]` + quoted lines) → Starlight asides (`:::caution`). */
154
+ declare function alerts(lines: string[]): string[];
155
+ /** The first paragraph of prose, as a meta description of at most ~200 characters. */
156
+ declare function describeMarkdown(lines: string[]): string | undefined;
157
+ /** What {@link syncSite} did. */
158
+ interface SyncResult {
159
+ /** Pages written. */
160
+ written: number;
161
+ /** Problems that fail the build. */
162
+ errors: string[];
163
+ /** Links to pending guides, sent to GitHub for now. */
164
+ warnings: string[];
165
+ }
166
+ /** Write `site/src/content/docs/` and `site/public/` from the manifest. */
167
+ declare function syncSite(m: SiteManifest): SyncResult;
168
+ /** Run {@link syncSite} and print the outcome; resolves to the exit code (the sync script's). */
169
+ declare function runSync(m: SiteManifest, io?: {
170
+ log: (l: string) => void;
171
+ error: (l: string) => void;
172
+ }): number;
173
+ //#endregion
174
+ //#region src/site/typedoc-plugin.d.ts
175
+ /**
176
+ * A re-export: `name` in module `module` is documented in `owner` as the `kind` member `target`
177
+ * (a different name for a renamed or `default` export).
178
+ */
179
+ interface Reexport {
180
+ module: string;
181
+ name: string;
182
+ owner: string;
183
+ kind: string;
184
+ target: string;
185
+ }
186
+ /** Where the plugin writes, and `apiOverviews` reads, the re-exports of a site. */
187
+ declare function reexportsFile(siteDir: string): string;
188
+ /** Read the re-exports the plugin recorded for a site (`[]` before the first API build). */
189
+ declare function readReexports(siteDir: string): Reexport[];
190
+ /** Import the site's `typedoc` and `typescript` (the instances starlight-typedoc uses). */
191
+ declare function loadSiteModules(siteDir: string): Promise<{
192
+ typedoc: typeof import("typedoc");
193
+ typescript: typeof import("typescript");
194
+ }>;
195
+ /** Options for {@link createTypedocPlugin}. */
196
+ interface TypedocPluginOptions {
197
+ /** Module name per entry file (absolute path → `storage/redis`); see `manifest.apiEntries()`. */
198
+ moduleNames?: Record<string, string>;
199
+ /**
200
+ * The site's `typedoc` and `typescript` modules, already imported. `defineXtandardSite` passes
201
+ * them, because a dynamic import inside the plugin can run after the loader that evaluated the
202
+ * Astro config has closed. Without them, the plugin imports both from the site when it loads.
203
+ */
204
+ modules?: {
205
+ typedoc: typeof import("typedoc");
206
+ typescript: typeof import("typescript");
207
+ };
208
+ }
209
+ /**
210
+ * Create the TypeDoc plugin for the site at `siteDir`. Pass the returned function in TypeDoc's
211
+ * `plugin` option (TypeDoc 0.26+ accepts plugin functions and awaits them).
212
+ */
213
+ declare function createTypedocPlugin(siteDir: string, options?: TypedocPluginOptions): (app: Application) => Promise<void>;
214
+ //#endregion
215
+ //#region src/site/resolve.d.ts
216
+ /**
217
+ * Load a docs-site peer from the **site's** install. The site has its own `package.json` and
218
+ * `node_modules`, and the integrations must be the instances Astro and starlight-typedoc use there
219
+ * (one `typedoc`, one `typescript`). Resolving from the kit's own location would find other
220
+ * copies, or none, whenever the kit is not installed inside `site/node_modules`: a hoisted install,
221
+ * or the kit's own site, whose `file:..` dependency is a tree of symlinks into the repo.
222
+ *
223
+ * @module
224
+ */
225
+ /**
226
+ * The ESM entry file of package `name` as installed for `fromDir` (looking in `node_modules` from
227
+ * `fromDir` upwards), or `undefined` when it isn't installed there.
228
+ */
229
+ declare function resolvePackageEntry(name: string, fromDir: string): string | undefined;
230
+ /**
231
+ * Import package `name` as installed for the site at `siteDir`; when the site doesn't have it,
232
+ * fall back to a plain `import()` from the kit (and a clear "install it" error when that fails).
233
+ */
234
+ declare function importFromSite<T>(name: string, siteDir: string): Promise<T>;
235
+ //#endregion
236
+ //#region src/site/api-overviews.d.ts
237
+ /** A module's leading doc comment, without the `Import from` line and the tags; `{@link}`s become code spans. */
238
+ declare function moduleDescription(text: string): string;
239
+ /** Options for {@link apiOverviews}. */
240
+ interface ApiOverviewsOptions {
241
+ /**
242
+ * Slug of the site's "Entry points" page, linked from `/api/` (`"entry-points"`), or `false`
243
+ * when the site has none. Default: `"entry-points"` when the manifest has that page.
244
+ */
245
+ entryPointsSlug?: string | false;
246
+ }
247
+ /** The overview-pages plugin; add it after starlight-typedoc (plugins run in order). */
248
+ declare function apiOverviews(manifest: SiteManifest, options?: ApiOverviewsOptions): StarlightPlugin;
249
+ /**
250
+ * Write `index.md` for `/api/` and each `/api/<module>/` under `apiDir` (starlight-typedoc's
251
+ * output). Resolves to the number of modules.
252
+ */
253
+ declare function writeApiOverviews(manifest: SiteManifest, apiDir: string, options?: ApiOverviewsOptions): number;
254
+ //#endregion
255
+ //#region src/site/define-site.d.ts
256
+ type IntegrationFactory = (options: Record<string, unknown>) => unknown;
257
+ /** A Starlight sidebar entry. */
258
+ type StarlightSidebarItem = {
259
+ slug: string;
260
+ label?: string;
261
+ } | {
262
+ label: string;
263
+ link: string;
264
+ } | {
265
+ label: string;
266
+ collapsed?: boolean;
267
+ items: StarlightSidebarItem[];
268
+ };
269
+ /** The manifest's sidebar as Starlight sidebar entries. */
270
+ declare function toStarlightSidebar(items: SiteItem[]): StarlightSidebarItem[];
271
+ /**
272
+ * The API entry files in documentation order: `apiOwners` first (a symbol exported by several
273
+ * entry points is documented under the first one TypeDoc meets), then the rest alphabetically — a
274
+ * fixed order, since a glob's order differs between file systems. Throws when an owner is not an
275
+ * entry point.
276
+ */
277
+ declare function orderedEntryPoints(manifest: SiteManifest, apiOwners?: string[]): string[];
278
+ /** Options for {@link defineXtandardSite}. */
279
+ interface XtandardSiteOptions {
280
+ /** The site manifest (`defineSiteManifest`), shared with the sync script. */
281
+ manifest: SiteManifest;
282
+ /** Meta description of the site. */
283
+ description: string;
284
+ /** The social card's tagline, for its alt text. */
285
+ tagline: string;
286
+ /** Entry files other entry points re-export from, in ownership order (`src/core.ts`…). */
287
+ apiOwners?: string[];
288
+ /** `astro dev` / `preview` port (wh 4323, fl 4322, au 4326, li 4331, en 4324). */
289
+ devPort?: number;
290
+ /** Palette stylesheet(s), relative to the site; `./src/styles/brand.css` by default. */
291
+ brandCss?: string | string[];
292
+ /** Site title; the package name by default. */
293
+ title?: string;
294
+ /**
295
+ * The header lockups (relative to the site), or `false` for the text title. Defaults to
296
+ * `../docs/assets/lockup-horizontal-{dark,light}.svg` when they exist.
297
+ */
298
+ logo?: {
299
+ dark: string;
300
+ light: string;
301
+ } | false;
302
+ /** The TypeDoc tsconfig, relative to the site; `./typedoc.tsconfig.json` by default. */
303
+ typedocTsconfig?: string;
304
+ /** Extra TypeDoc options (merged over the defaults). */
305
+ typeDoc?: Record<string, unknown>;
306
+ /** Mermaid diagrams (`astro-mermaid`); default `true`. */
307
+ mermaid?: boolean;
308
+ /** `theme-color` meta; `#0f1215` by default. */
309
+ themeColor?: string;
310
+ /** Slug of the "Entry points" page linked from `/api/`; see `apiOverviews`. */
311
+ entryPointsSlug?: string | false;
312
+ /** Extra Starlight options, merged last. */
313
+ starlight?: Record<string, unknown>;
314
+ /**
315
+ * Already-imported integrations, used instead of importing them (an unusual install layout,
316
+ * tests). Each one left out is imported from the site's install.
317
+ */
318
+ peers?: Partial<SitePeers>;
319
+ }
320
+ /** The integrations {@link defineXtandardSite} uses. */
321
+ interface SitePeers {
322
+ starlight: (typeof import("@astrojs/starlight"))["default"];
323
+ createStarlightTypeDocPlugin: (typeof import("starlight-typedoc"))["createStarlightTypeDocPlugin"];
324
+ linksValidator: IntegrationFactory;
325
+ mermaid: IntegrationFactory;
326
+ /** The site's `typedoc` and `typescript`, for the TypeDoc plugin. */
327
+ typedoc: {
328
+ typedoc: typeof import("typedoc");
329
+ typescript: typeof import("typescript");
330
+ };
331
+ }
332
+ /** Build the site's Astro config. */
333
+ declare function defineXtandardSite(options: XtandardSiteOptions): Promise<AstroUserConfig>;
334
+ //#endregion
335
+ export { type ApiEntry, type ApiOverviewsOptions, type Reexport, type SiteGroup, type SiteItem, type SiteLink, type SiteManifest, type SiteManifestOptions, type SitePage, type SitePeers, Slugger, type StarlightSidebarItem, type SyncResult, type TypedocPluginOptions, type XtandardSiteOptions, alerts, apiEntries, apiOverviews, createTypedocPlugin, defineSiteManifest, defineXtandardSite, describeMarkdown, importFromSite, isGroup, isPage, loadSiteModules, mapProse, moduleDescription, orderedEntryPoints, plain, readReexports, reexportsFile, resolvePackageEntry, runSync, syncSite, toStarlightSidebar, writeApiOverviews };
336
+ //# sourceMappingURL=entry-site.d.cts.map