docs-i18n 0.10.0 → 0.11.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 (249) hide show
  1. package/admin/app/lib/auth-client.ts +21 -0
  2. package/admin/app/lib/auth.server.ts +62 -0
  3. package/admin/app/routeTree.gen.ts +21 -3
  4. package/admin/app/routes/index.tsx +68 -8
  5. package/admin/app/routes/login.tsx +207 -0
  6. package/admin/app/server.ts +23 -0
  7. package/admin/app/styles.css +146 -0
  8. package/admin/app/worker.ts +18 -0
  9. package/admin/dist/client/assets/auth-client-DqJZaFZR.js +3 -0
  10. package/admin/dist/client/assets/login-CQjkiBAF.js +1 -0
  11. package/admin/dist/client/assets/main-bc5tcdGg.js +18 -0
  12. package/admin/dist/client/assets/routes-CTPOG_v1.js +3 -0
  13. package/admin/dist/client/assets/{styles-DJ6QEJmN.css → styles-zS0BbO7e.css} +1 -1
  14. package/admin/dist/client/assets/useNavigate-CEOVvMjz.js +1 -0
  15. package/admin/dist/server/assets/{react-dom-CpO9xk_L.js → __tanstack-start-server-fn-resolver-qK0Yfvti.js} +83 -507
  16. package/admin/dist/server/assets/_tanstack-start-manifest_v-BgMVPPt2.js +21 -0
  17. package/admin/dist/server/assets/adapter-DjXlUL1J.js +2253 -0
  18. package/admin/dist/server/assets/auth-client-CoUpyQIM.js +807 -0
  19. package/admin/dist/server/assets/auth-dSAIPjBw.js +72 -0
  20. package/admin/dist/server/assets/auth.server-BLVDnTCZ.js +31352 -0
  21. package/admin/dist/server/assets/bun-sqlite-dialect-C8OaCWSL-BNNY-FoT.js +154 -0
  22. package/admin/dist/server/assets/compiled-query-CnFG_BVV.js +6967 -0
  23. package/admin/dist/server/assets/d1-sqlite-dialect-sYHNqBte-Bjz-cybU.js +115 -0
  24. package/admin/dist/server/assets/dist-C3-e8E2B.js +215 -0
  25. package/admin/dist/server/assets/dist-CUzFWZag.js +6039 -0
  26. package/admin/dist/server/assets/{init-DJr2glb3.js → dist-DBv71kqn.js} +21 -381
  27. package/admin/dist/server/assets/error-CASJ5tIm.js +457 -0
  28. package/admin/dist/server/assets/error-codes-BhMTGvV6.js +1153 -0
  29. package/admin/dist/server/assets/init-CJJUsPDL.js +49 -0
  30. package/admin/dist/server/assets/job-manager-D9Ab9hgu.js +179 -0
  31. package/admin/dist/server/assets/{jobs-bQfYqSk7.js → jobs-DrEe9YOj.js} +18 -5
  32. package/admin/dist/server/assets/kysely-adapter-YC8RFPyc.js +2 -0
  33. package/admin/dist/server/assets/login-SqzTMYOZ.js +228 -0
  34. package/admin/dist/server/assets/migrator-ZpVZslbq.js +2926 -0
  35. package/admin/dist/server/assets/{misc-DOk3t9vs.js → misc-BSoYldBT.js} +22 -9
  36. package/admin/dist/server/assets/{models-CBb8Owe5.js → models-CoviNHUP.js} +1 -1
  37. package/admin/dist/server/assets/node-sqlite-dialect-BJIaP6lL.js +154 -0
  38. package/admin/dist/server/assets/{router-DlU_fGDK.js → router-D-82slI-.js} +23 -11
  39. package/admin/dist/server/assets/{routes-BcfX6iub.js → routes-B1pNmxF3.js} +43 -29
  40. package/admin/dist/server/assets/{routes-pIM0fgUO.js → routes-C9huiZHw.js} +56 -22
  41. package/admin/dist/server/assets/sqlite-adapter-CL2EidjD.js +69 -0
  42. package/admin/dist/server/assets/{start-BS52hm79.js → start-BiybVoR2.js} +1 -1
  43. package/admin/dist/server/assets/status-B1AGLvHn.js +162 -0
  44. package/admin/dist/server/assets/status-D7PU72hm.js +262 -0
  45. package/admin/dist/server/assets/string-B4XlckmJ.js +6 -0
  46. package/admin/dist/server/assets/useNavigate-0H08s_Q2.js +29 -0
  47. package/admin/dist/server/assets/useRouter-BXJvr8to.js +508 -0
  48. package/admin/dist/server/server.js +70 -90
  49. package/admin/package.json +6 -1
  50. package/admin/server/functions/auth.ts +89 -0
  51. package/admin/server/functions/jobs.ts +30 -2
  52. package/admin/server/functions/misc.ts +25 -5
  53. package/admin/server/functions/status.ts +52 -3
  54. package/admin/server/index.ts +1 -1
  55. package/admin/server/init.ts +21 -9
  56. package/admin/server/services/d1-status.ts +282 -0
  57. package/admin/vite.config.ts +29 -15
  58. package/admin/wrangler.jsonc +16 -0
  59. package/package.json +1 -1
  60. package/template/content/docs-i18n/en/cli.md +9 -5
  61. package/template/content/docs-i18n/en/deployment.md +85 -68
  62. package/template/dist/client/assets/{Doc-CbmLeLjl.js → Doc-BKO69_nz.js} +1 -1
  63. package/template/dist/client/assets/{DocsLayout-ERG7nrAc.js → DocsLayout-BGugXxEQ.js} +1 -1
  64. package/template/dist/client/assets/{FileTabs-CCynw0nL.js → FileTabs-4fZriOj4.js} +1 -1
  65. package/template/dist/client/assets/{Footer-l6Y8-ltB.js → Footer-DYh1AfWA.js} +1 -1
  66. package/template/dist/client/assets/{FrameworkContent-pNf68F7f.js → FrameworkContent-rVvjxASn.js} +1 -1
  67. package/template/dist/client/assets/{MarkdownHeadingContext-6I862CKH.js → MarkdownHeadingContext-CdvUDZFU.js} +4 -4
  68. package/template/dist/client/assets/{PostNotFound-ScC0039d.js → PostNotFound-WoSYGsGu.js} +1 -1
  69. package/template/dist/client/assets/{_basePickBy-B-GcvGxW.js → _basePickBy-Dd7GuR7A.js} +1 -1
  70. package/template/dist/client/assets/{_baseUniq-C1WySGZQ.js → _baseUniq-DMxQLGFI.js} +1 -1
  71. package/template/dist/client/assets/_lang-3AqGszEy.js +1 -0
  72. package/template/dist/client/assets/_lang._project-COkrIqzH.js +1 -0
  73. package/template/dist/client/assets/_lang._project._version-B8vRZczu.js +1 -0
  74. package/template/dist/client/assets/{_lang._project._version.docs-aw08dKvN.js → _lang._project._version.docs-DokNGgvU.js} +1 -1
  75. package/template/dist/client/assets/{_lang._project._version.docs._-B4Vb_S0V.js → _lang._project._version.docs._-CXCNZzOb.js} +1 -1
  76. package/template/dist/client/assets/_lang._project._version.docs._-DR0WSQEb.js +1 -0
  77. package/template/dist/client/assets/_lang._project._version.docs.framework._framework._-C_Grro8r.js +1 -0
  78. package/template/dist/client/assets/{_lang._project._version.docs.framework._framework.index-DInYPTXM.js → _lang._project._version.docs.framework._framework.index-DsYjXRdj.js} +1 -1
  79. package/template/dist/client/assets/{_lang._project._version.docs.framework.index-B7EvJmBI.js → _lang._project._version.docs.framework.index-DQX1lBi3.js} +1 -1
  80. package/template/dist/client/assets/{_lang._project.docs-4oX3ADgu.js → _lang._project.docs-DsYQj9jI.js} +1 -1
  81. package/template/dist/client/assets/_lang._project.docs._-DlM_D6DD.js +1 -0
  82. package/template/dist/client/assets/{_lang._project.docs._-emq0IsQw.js → _lang._project.docs._-l2tTjx80.js} +1 -1
  83. package/template/dist/client/assets/_lang.blog-CEwEtalL.js +1 -0
  84. package/template/dist/client/assets/_lang.blog-D6YGC3tK.js +1 -0
  85. package/template/dist/client/assets/_lang.blog._-DgHu4oLy.js +1 -0
  86. package/template/dist/client/assets/{_lang.blog._-DErizs7q.js → _lang.blog._-Umz18sQE.js} +1 -1
  87. package/template/dist/client/assets/_lang.blog.index-C8LKUFtD.js +1 -0
  88. package/template/dist/client/assets/{_lang.blog.index-DZDuDkQr.js → _lang.blog.index-DzUqpOBE.js} +1 -1
  89. package/template/dist/client/assets/{_lang.docs-CQK0rfqt.js → _lang.docs-CUh3R7DD.js} +1 -1
  90. package/template/dist/client/assets/{_lang.docs._-BiCvgeV1.js → _lang.docs._-DlgTPy3s.js} +1 -1
  91. package/template/dist/client/assets/_lang.docs._-DmaQE7lx.js +1 -0
  92. package/template/dist/client/assets/_lang.docs.framework._framework._-B4C4uDFp.js +1 -0
  93. package/template/dist/client/assets/{_lang.docs.framework._framework.index-Bu5p5Q_r.js → _lang.docs.framework._framework.index-DTg6Xd3p.js} +1 -1
  94. package/template/dist/client/assets/{_lang.docs.framework.index-uTDFLagP.js → _lang.docs.framework.index-BQ2enasl.js} +1 -1
  95. package/template/dist/client/assets/{arc-C16C7aa3.js → arc-DGPgC_QF.js} +1 -1
  96. package/template/dist/client/assets/{architectureDiagram-2XIMDMQ5-DgSSDH9Z.js → architectureDiagram-2XIMDMQ5-yI53_GAi.js} +1 -1
  97. package/template/dist/client/assets/{blockDiagram-WCTKOSBZ-Bs8e58Or.js → blockDiagram-WCTKOSBZ-C3tr24zy.js} +1 -1
  98. package/template/dist/client/assets/{c4Diagram-IC4MRINW-DsGaAPtm.js → c4Diagram-IC4MRINW-DOA-mowm.js} +1 -1
  99. package/template/dist/client/assets/channel-DzZD7dUQ.js +1 -0
  100. package/template/dist/client/assets/{chunk-4BX2VUAB-BQdq93Vq.js → chunk-4BX2VUAB-B6NSnNJJ.js} +1 -1
  101. package/template/dist/client/assets/{chunk-55IACEB6-zjp4uUiZ.js → chunk-55IACEB6-CWYwArBH.js} +1 -1
  102. package/template/dist/client/assets/{chunk-FMBD7UC4-CEdYlBOF.js → chunk-FMBD7UC4-DSyn2wIW.js} +1 -1
  103. package/template/dist/client/assets/{chunk-JSJVCQXG-CVkDw9ls.js → chunk-JSJVCQXG-D83nm5W0.js} +1 -1
  104. package/template/dist/client/assets/{chunk-KX2RTZJC--1vKv-mr.js → chunk-KX2RTZJC-DD7fN9e9.js} +1 -1
  105. package/template/dist/client/assets/{chunk-NQ4KR5QH-Cpo-W18l.js → chunk-NQ4KR5QH-C3YlYiU5.js} +1 -1
  106. package/template/dist/client/assets/{chunk-QZHKN3VN-BizWJuB4.js → chunk-QZHKN3VN-B7wBEuCG.js} +1 -1
  107. package/template/dist/client/assets/{chunk-WL4C6EOR-6lLYa9R1.js → chunk-WL4C6EOR-ByA1FloT.js} +1 -1
  108. package/template/dist/client/assets/classDiagram-VBA2DB6C-CRozKaUD.js +1 -0
  109. package/template/dist/client/assets/classDiagram-v2-RAHNMMFH-CRozKaUD.js +1 -0
  110. package/template/dist/client/assets/clone-CGnOEl4E.js +1 -0
  111. package/template/dist/client/assets/{cose-bilkent-S5V4N54A-CaD0EGPJ.js → cose-bilkent-S5V4N54A-nt_sXfWc.js} +1 -1
  112. package/template/dist/client/assets/{dagre-KLK3FWXG-h4F9WtDQ.js → dagre-KLK3FWXG-DUsyMTPd.js} +1 -1
  113. package/template/dist/client/assets/{diagram-E7M64L7V-CBUSWzH5.js → diagram-E7M64L7V-D5SAypX0.js} +1 -1
  114. package/template/dist/client/assets/{diagram-IFDJBPK2-C5oMubv0.js → diagram-IFDJBPK2-WhP5c8Vz.js} +1 -1
  115. package/template/dist/client/assets/{diagram-P4PSJMXO-DdPwwhHR.js → diagram-P4PSJMXO-AMrwIlhf.js} +1 -1
  116. package/template/dist/client/assets/{erDiagram-INFDFZHY-0U5A-RF0.js → erDiagram-INFDFZHY-BxifSpCV.js} +1 -1
  117. package/template/dist/client/assets/{flowDiagram-PKNHOUZH-CXN3pvSW.js → flowDiagram-PKNHOUZH-BMAowE9I.js} +1 -1
  118. package/template/dist/client/assets/{ganttDiagram-A5KZAMGK-DlovlSO7.js → ganttDiagram-A5KZAMGK-Bay-0iRq.js} +1 -1
  119. package/template/dist/client/assets/{gitGraphDiagram-K3NZZRJ6-Bo-Jjy7v.js → gitGraphDiagram-K3NZZRJ6-Va91W3gw.js} +1 -1
  120. package/template/dist/client/assets/{graph-C0TauvuO.js → graph-CbBYObK_.js} +1 -1
  121. package/template/dist/client/assets/{index-iATq4LEm.js → index-CF6qz2tX.js} +1 -1
  122. package/template/dist/client/assets/{infoDiagram-LFFYTUFH-BbvPzztn.js → infoDiagram-LFFYTUFH-Byd5C-4U.js} +1 -1
  123. package/template/dist/client/assets/{ishikawaDiagram-PHBUUO56-DKCMONMO.js → ishikawaDiagram-PHBUUO56-DxOKnE1v.js} +1 -1
  124. package/template/dist/client/assets/{journeyDiagram-4ABVD52K-D9NP_vvu.js → journeyDiagram-4ABVD52K-IRmt7RI4.js} +1 -1
  125. package/template/dist/client/assets/{kanban-definition-K7BYSVSG-X-u_nWxK.js → kanban-definition-K7BYSVSG-BjTVXn-R.js} +1 -1
  126. package/template/dist/client/assets/{layout-IeRzBrUX.js → layout-Bbx6A0bC.js} +1 -1
  127. package/template/dist/client/assets/{linear-DEzVUeiK.js → linear-Df2eAW4A.js} +1 -1
  128. package/template/dist/client/assets/{main-Csj9i19C.js → main-DqZtiCro.js} +2 -2
  129. package/template/dist/client/assets/{mermaid.core-CCnh2DG0.js → mermaid.core-BIoiBcAA.js} +4 -4
  130. package/template/dist/client/assets/{mindmap-definition-YRQLILUH-DgyN4Ft-.js → mindmap-definition-YRQLILUH-Btzz0iIP.js} +1 -1
  131. package/template/dist/client/assets/ordinal-Cboi1Yqb.js +1 -0
  132. package/template/dist/client/assets/{pieDiagram-SKSYHLDU-DDVqU_2Q.js → pieDiagram-SKSYHLDU-C2amrGtU.js} +1 -1
  133. package/template/dist/client/assets/{quadrantDiagram-337W2JSQ-BeUxMqle.js → quadrantDiagram-337W2JSQ-EVgH9VuN.js} +1 -1
  134. package/template/dist/client/assets/{react-os8EX6z1.js → react-qvbbiZob.js} +1 -1
  135. package/template/dist/client/assets/{requirementDiagram-Z7DCOOCP-CpzdlyEd.js → requirementDiagram-Z7DCOOCP-BkYPbRis.js} +1 -1
  136. package/template/dist/client/assets/{sankeyDiagram-WA2Y5GQK-CmSWF6XU.js → sankeyDiagram-WA2Y5GQK-B5EIaP-h.js} +1 -1
  137. package/template/dist/client/assets/{sequenceDiagram-2WXFIKYE-DarofLka.js → sequenceDiagram-2WXFIKYE-BC33VGOc.js} +1 -1
  138. package/template/dist/client/assets/{stateDiagram-RAJIS63D-CEio2h-7.js → stateDiagram-RAJIS63D-DiKvWUYb.js} +1 -1
  139. package/template/dist/client/assets/stateDiagram-v2-FVOUBMTO-DjKMPYGe.js +1 -0
  140. package/template/dist/client/assets/{timeline-definition-YZTLITO2-By_Wk6uc.js → timeline-definition-YZTLITO2-QiFlgbRA.js} +1 -1
  141. package/template/dist/client/assets/{treemap-KZPCXAKY-mKcaMbv9.js → treemap-KZPCXAKY-BOYbyS9G.js} +1 -1
  142. package/template/dist/client/assets/{vennDiagram-LZ73GAT5-Dx_Fh7nH.js → vennDiagram-LZ73GAT5-CqmW7j4r.js} +1 -1
  143. package/template/dist/client/assets/{xychartDiagram-JWTSCODW-DSAwWbBw.js → xychartDiagram-JWTSCODW-gj6oWX8l.js} +1 -1
  144. package/template/dist/server/assets/{Doc-B8TJBEmx.js → Doc-9tJiX5y6.js} +3 -3
  145. package/template/dist/server/assets/{DocsLayout-CnWgvk8u.js → DocsLayout-BTjhU_W5.js} +2 -2
  146. package/template/dist/server/assets/{Footer-WapWK45U.js → Footer-CefTi2yh.js} +1 -1
  147. package/template/dist/server/assets/{FrameworkContent-gzqT-Q1n.js → FrameworkContent-BkJvuP04.js} +2 -2
  148. package/template/dist/server/assets/{MarkdownHeadingContext-Iyk66Y4x.js → MarkdownHeadingContext-37oQpb36.js} +3 -3
  149. package/template/dist/server/assets/{PostNotFound-GKdNuzsX.js → PostNotFound-BqBZf83v.js} +1 -1
  150. package/template/dist/server/assets/{_basePickBy-DJ9gzwF8.js → _basePickBy-DZ3TPUta.js} +2 -2
  151. package/template/dist/server/assets/{_baseUniq-CezmbvU2.js → _baseUniq-DKicWTQT.js} +1 -1
  152. package/template/dist/server/assets/{_lang._project._version.docs-BOZ34yW7.js → _lang._project._version.docs-U-t4mk5_.js} +3 -3
  153. package/template/dist/server/assets/{_lang._project._version.docs._-5W2jN7Re.js → _lang._project._version.docs._-DMgnElWM.js} +5 -5
  154. package/template/dist/server/assets/{_lang._project._version.docs.framework._framework._-DeN_oA8l.js → _lang._project._version.docs.framework._framework._-kBw_9L-F.js} +5 -5
  155. package/template/dist/server/assets/{_lang._project._version.docs.framework._framework.index-jWKDCQSE.js → _lang._project._version.docs.framework._framework.index-Bsyj0DD5.js} +1 -1
  156. package/template/dist/server/assets/{_lang._project._version.docs.framework.index-DOT4MtjZ.js → _lang._project._version.docs.framework.index-CmLAP_Io.js} +1 -1
  157. package/template/dist/server/assets/{_lang._project.docs-r4V9TXuu.js → _lang._project.docs-Bb4ZZ_jr.js} +3 -3
  158. package/template/dist/server/assets/{_lang._project.docs._-Bge7JaYE.js → _lang._project.docs._-ChrpJ61j.js} +5 -5
  159. package/template/dist/server/assets/{_lang.blog-DJOfiyA8.js → _lang.blog-8j6IvzvQ.js} +2 -2
  160. package/template/dist/server/assets/{_lang.blog._-yJSqbX08.js → _lang.blog._-BPzP97Ac.js} +2 -2
  161. package/template/dist/server/assets/{_lang.blog._-C7iqMj9O.js → _lang.blog._-DNX8UglA.js} +2 -2
  162. package/template/dist/server/assets/{_lang.blog.index-Df_6_IKx.js → _lang.blog.index-CeZnMJBi.js} +1 -1
  163. package/template/dist/server/assets/{_lang.blog.index-CrdyROhK.js → _lang.blog.index-DzVKqoC4.js} +2 -2
  164. package/template/dist/server/assets/{_lang.docs-Jwt4deTW.js → _lang.docs-B4StnHMb.js} +3 -3
  165. package/template/dist/server/assets/{_lang.docs._-D_DdKLAV.js → _lang.docs._--c0In1AT.js} +5 -5
  166. package/template/dist/server/assets/{_lang.docs.framework._framework._-BkQaZ_1f.js → _lang.docs.framework._framework._-Be0U7cDg.js} +5 -5
  167. package/template/dist/server/assets/{_lang.docs.framework._framework.index-BLx8p8IS.js → _lang.docs.framework._framework.index-BZ512aSk.js} +1 -1
  168. package/template/dist/server/assets/{_lang.docs.framework.index-BytQ_q8T.js → _lang.docs.framework.index-U8z3j4kz.js} +1 -1
  169. package/template/dist/server/assets/{_tanstack-start-manifest_v-RX6ItZ5S.js → _tanstack-start-manifest_v-DXpQ8503.js} +1 -1
  170. package/template/dist/server/assets/{arc-BwftnT5H.js → arc-B4h6h_n6.js} +1 -1
  171. package/template/dist/server/assets/{architecture-PBZL5I3N-KbDVC6gM.js → architecture-PBZL5I3N-CUwqLXkR.js} +6 -6
  172. package/template/dist/server/assets/{architectureDiagram-2XIMDMQ5-BoLvWxb3.js → architectureDiagram-2XIMDMQ5-CuCoxdBe.js} +6 -6
  173. package/template/dist/server/assets/{blockDiagram-WCTKOSBZ-GPFcXs-f.js → blockDiagram-WCTKOSBZ-D5PsUOim.js} +6 -6
  174. package/template/dist/server/assets/{c4Diagram-IC4MRINW-EQwQCspo.js → c4Diagram-IC4MRINW-CXy5xO3o.js} +2 -2
  175. package/template/dist/server/assets/{channel-CxvwuPH7.js → channel-D0l-mWaF.js} +1 -1
  176. package/template/dist/server/assets/{chunk-4BX2VUAB-DUgcw5ei.js → chunk-4BX2VUAB-M7FVHMss.js} +1 -1
  177. package/template/dist/server/assets/{chunk-55IACEB6-Cn15uD91.js → chunk-55IACEB6-D_gDAje5.js} +1 -1
  178. package/template/dist/server/assets/{chunk-FMBD7UC4-Ck3iyLPu.js → chunk-FMBD7UC4-B5Bebx-Y.js} +1 -1
  179. package/template/dist/server/assets/{chunk-JSJVCQXG-VAT8yncE.js → chunk-JSJVCQXG-DxBkq-uB.js} +1 -1
  180. package/template/dist/server/assets/{chunk-KX2RTZJC-B1bd2VmA.js → chunk-KX2RTZJC-BMHm1EGi.js} +1 -1
  181. package/template/dist/server/assets/{chunk-NQ4KR5QH-CR67GG9C.js → chunk-NQ4KR5QH-Cp28pTwT.js} +3 -3
  182. package/template/dist/server/assets/{chunk-QZHKN3VN-B9SSazM4.js → chunk-QZHKN3VN-Bq5GZqaR.js} +1 -1
  183. package/template/dist/server/assets/{chunk-WL4C6EOR-DZ4Pjuao.js → chunk-WL4C6EOR-C9Nj5GdW.js} +5 -5
  184. package/template/dist/server/assets/{classDiagram-VBA2DB6C-CA6_4Wb2.js → classDiagram-VBA2DB6C-CUchv9T5.js} +6 -6
  185. package/template/dist/server/assets/{classDiagram-v2-RAHNMMFH-CA6_4Wb2.js → classDiagram-v2-RAHNMMFH-CUchv9T5.js} +6 -6
  186. package/template/dist/server/assets/{clone-DJHP_iVy.js → clone-CJcTi58S.js} +1 -1
  187. package/template/dist/server/assets/{cose-bilkent-S5V4N54A-DtU-cN6W.js → cose-bilkent-S5V4N54A-CxvCMhN_.js} +1 -1
  188. package/template/dist/server/assets/{dagre-KLK3FWXG-yZYrVU4p.js → dagre-KLK3FWXG-B5bQP7FL.js} +6 -6
  189. package/template/dist/server/assets/{diagram-E7M64L7V-8Yyz0aw0.js → diagram-E7M64L7V-NjHca90S.js} +8 -8
  190. package/template/dist/server/assets/{diagram-IFDJBPK2-DcxFYI3M.js → diagram-IFDJBPK2-CoTCfBKd.js} +6 -6
  191. package/template/dist/server/assets/{diagram-P4PSJMXO-CehxUcI0.js → diagram-P4PSJMXO-DHvGgYjH.js} +6 -6
  192. package/template/dist/server/assets/{erDiagram-INFDFZHY-Bu2p1_Pj.js → erDiagram-INFDFZHY-01crajKr.js} +4 -4
  193. package/template/dist/server/assets/{flowDiagram-PKNHOUZH-B_eKR7I0.js → flowDiagram-PKNHOUZH-BkUQ_vxg.js} +6 -6
  194. package/template/dist/server/assets/{ganttDiagram-A5KZAMGK-DP6YEZof.js → ganttDiagram-A5KZAMGK-DvrO-w2P.js} +2 -2
  195. package/template/dist/server/assets/{gitGraph-HDMCJU4V-Bt0qhVL4.js → gitGraph-HDMCJU4V-h9JNaxB7.js} +6 -6
  196. package/template/dist/server/assets/{gitGraphDiagram-K3NZZRJ6-DwvkdYrg.js → gitGraphDiagram-K3NZZRJ6-BoKm6Fm-.js} +7 -7
  197. package/template/dist/server/assets/{graph-BVFNe_k5.js → graph-BoxbfI7Z.js} +2 -2
  198. package/template/dist/server/assets/{index-DvBGSZeA.js → index-Jfzi6SZW.js} +2 -2
  199. package/template/dist/server/assets/{info-3K5VOQVL-CFejRnvB.js → info-3K5VOQVL-DgaSHqkS.js} +6 -6
  200. package/template/dist/server/assets/{infoDiagram-LFFYTUFH-D0v9uyXI.js → infoDiagram-LFFYTUFH-DgV5W8-I.js} +5 -5
  201. package/template/dist/server/assets/{ishikawaDiagram-PHBUUO56-DZumspL4.js → ishikawaDiagram-PHBUUO56-CqlMQ0Fq.js} +1 -1
  202. package/template/dist/server/assets/{journeyDiagram-4ABVD52K-nRp_-qZp.js → journeyDiagram-4ABVD52K-D6ySTub8.js} +4 -4
  203. package/template/dist/server/assets/{kanban-definition-K7BYSVSG-BMKyyzjt.js → kanban-definition-K7BYSVSG-BT8m7Cwk.js} +2 -2
  204. package/template/dist/server/assets/{layout-mpiN5R-5.js → layout-CkYcErfn.js} +4 -4
  205. package/template/dist/server/assets/{linear-CqNYgjEx.js → linear-F_0dWGZL.js} +1 -1
  206. package/template/dist/server/assets/{mermaid-parser.core-B8Uu3QZY.js → mermaid-parser.core-q5MdUJuo.js} +11 -11
  207. package/template/dist/server/assets/{mermaid.core-BI3nMhNO.js → mermaid.core-DOWTODR1.js} +31 -31
  208. package/template/dist/server/assets/{mindmap-definition-YRQLILUH-DCoFqLPh.js → mindmap-definition-YRQLILUH-BQxlQqn-.js} +3 -3
  209. package/template/dist/server/assets/{ordinal-Bcam90FY.js → ordinal-CxptdPJm.js} +1 -1
  210. package/template/dist/server/assets/{packet-RMMSAZCW-djgonfKN.js → packet-RMMSAZCW-D8FkLZuP.js} +6 -6
  211. package/template/dist/server/assets/{pie-UPGHQEXC-Dug2t-PE.js → pie-UPGHQEXC-Diw2fHLk.js} +6 -6
  212. package/template/dist/server/assets/{pieDiagram-SKSYHLDU-CS0_hW4w.js → pieDiagram-SKSYHLDU-B1J4UJZ7.js} +8 -8
  213. package/template/dist/server/assets/{quadrantDiagram-337W2JSQ-BpQNM0zu.js → quadrantDiagram-337W2JSQ-BvjKLapg.js} +2 -2
  214. package/template/dist/server/assets/{radar-KQ55EAFF-3ir2W9Wi.js → radar-KQ55EAFF-CcBdPU3n.js} +6 -6
  215. package/template/dist/server/assets/{requirementDiagram-Z7DCOOCP-D92RyjV4.js → requirementDiagram-Z7DCOOCP-Bgr_wnAs.js} +3 -3
  216. package/template/dist/server/assets/{router-DPPgDicW.js → router-DxwPl-Dc.js} +18 -18
  217. package/template/dist/server/assets/{sankeyDiagram-WA2Y5GQK-DCPRB-xO.js → sankeyDiagram-WA2Y5GQK-B0UwtyW3.js} +2 -2
  218. package/template/dist/server/assets/{sequenceDiagram-2WXFIKYE-C1ab2VvU.js → sequenceDiagram-2WXFIKYE-BbxQJHjO.js} +3 -3
  219. package/template/dist/server/assets/{stateDiagram-RAJIS63D-GhG1G3ff.js → stateDiagram-RAJIS63D-Cg-uJ_UO.js} +8 -8
  220. package/template/dist/server/assets/{stateDiagram-v2-FVOUBMTO-C-KtMadV.js → stateDiagram-v2-FVOUBMTO-BWVPrqfa.js} +4 -4
  221. package/template/dist/server/assets/{timeline-definition-YZTLITO2-DyfAQCd4.js → timeline-definition-YZTLITO2-DCSJT2WT.js} +2 -2
  222. package/template/dist/server/assets/{treemap-KZPCXAKY-Cn0Cw4Cl.js → treemap-KZPCXAKY-a0nhlKgx.js} +6 -6
  223. package/template/dist/server/assets/{vennDiagram-LZ73GAT5-D2Ak5JUa.js → vennDiagram-LZ73GAT5-Bk2HQEQq.js} +1 -1
  224. package/template/dist/server/assets/{xychartDiagram-JWTSCODW-DqoBOs1L.js → xychartDiagram-JWTSCODW-C4svHkt_.js} +3 -3
  225. package/template/dist/server/server.js +5 -5
  226. package/admin/dist/client/assets/main-CSFhgz4p.js +0 -17
  227. package/admin/dist/client/assets/routes-C6bCOSX-.js +0 -3
  228. package/admin/dist/server/assets/_tanstack-start-manifest_v-BE5XHVZ2.js +0 -17
  229. package/admin/dist/server/assets/redirect-DtfSYi2g.js +0 -51
  230. package/admin/dist/server/assets/status-CZz8Rs_7.js +0 -81
  231. package/template/dist/client/assets/_lang-B3tRf7os.js +0 -1
  232. package/template/dist/client/assets/_lang._project-CH0inpmY.js +0 -1
  233. package/template/dist/client/assets/_lang._project._version-CESvrqds.js +0 -1
  234. package/template/dist/client/assets/_lang._project._version.docs._-BexMyJr9.js +0 -1
  235. package/template/dist/client/assets/_lang._project._version.docs.framework._framework._-BbQgUWTH.js +0 -1
  236. package/template/dist/client/assets/_lang._project.docs._-R9bOn492.js +0 -1
  237. package/template/dist/client/assets/_lang.blog-BViCs72M.js +0 -1
  238. package/template/dist/client/assets/_lang.blog-DhVkwYEk.js +0 -1
  239. package/template/dist/client/assets/_lang.blog._-BHdaHDBU.js +0 -1
  240. package/template/dist/client/assets/_lang.blog.index-CELEUrkj.js +0 -1
  241. package/template/dist/client/assets/_lang.docs._-axvS_dfl.js +0 -1
  242. package/template/dist/client/assets/_lang.docs.framework._framework._-D2FAQ0gW.js +0 -1
  243. package/template/dist/client/assets/channel-Clrp6Lr4.js +0 -1
  244. package/template/dist/client/assets/classDiagram-VBA2DB6C-Beq6_jEy.js +0 -1
  245. package/template/dist/client/assets/classDiagram-v2-RAHNMMFH-Beq6_jEy.js +0 -1
  246. package/template/dist/client/assets/clone-BbBu6MzK.js +0 -1
  247. package/template/dist/client/assets/ordinal-BENe2yWM.js +0 -1
  248. package/template/dist/client/assets/stateDiagram-v2-FVOUBMTO-CbfK0_BD.js +0 -1
  249. /package/admin/dist/server/assets/{createServerRpc-DJq9yo-B.js → createServerRpc-Cyyxq9HQ.js} +0 -0
@@ -0,0 +1,282 @@
1
+ /**
2
+ * D1-backed status service for CF Workers deployment.
3
+ *
4
+ * Queries the same sources/source_files/translations tables as the local
5
+ * TranslationCache, but via D1 instead of better-sqlite3.
6
+ *
7
+ * This is read-only — the admin dashboard on CF Workers can view
8
+ * translation status but cannot run translate jobs or modify the cache.
9
+ */
10
+
11
+ function getD1(): D1Database | null {
12
+ try {
13
+ return (globalThis as any).__D1_DB ?? null;
14
+ } catch {
15
+ return null;
16
+ }
17
+ }
18
+
19
+ function requireD1(): D1Database {
20
+ const db = getD1();
21
+ if (!db) throw new Error('D1 database not available');
22
+ return db;
23
+ }
24
+
25
+ export async function d1GetVersions(): Promise<string[]> {
26
+ const db = requireD1();
27
+ const result = await db
28
+ .prepare('SELECT DISTINCT version FROM source_files ORDER BY version')
29
+ .all<{ version: string }>();
30
+ return result.results.map((r) => r.version);
31
+ }
32
+
33
+ export async function d1GetLangs(): Promise<string[]> {
34
+ const db = requireD1();
35
+ const result = await db
36
+ .prepare('SELECT DISTINCT lang FROM translations ORDER BY lang')
37
+ .all<{ lang: string }>();
38
+ return result.results.map((r) => r.lang);
39
+ }
40
+
41
+ export async function d1SectionStats(
42
+ version: string,
43
+ lang: string,
44
+ ): Promise<
45
+ {
46
+ section: string;
47
+ totalFiles: number;
48
+ translatedFiles: number;
49
+ totalNodes: number;
50
+ translatedNodes: number;
51
+ }[]
52
+ > {
53
+ const db = requireD1();
54
+ const result = await db
55
+ .prepare(
56
+ `
57
+ WITH file_coverage AS (
58
+ SELECT
59
+ sf.file,
60
+ CASE
61
+ WHEN sf.file LIKE 'docs/%' THEN 'docs'
62
+ WHEN sf.file LIKE 'blog/%' THEN 'blog'
63
+ WHEN sf.file LIKE 'learn/%' THEN 'learn'
64
+ ELSE 'other'
65
+ END as section,
66
+ COUNT(DISTINCT sf.key) as total_nodes,
67
+ COUNT(DISTINCT t.key) as translated_nodes
68
+ FROM source_files sf
69
+ LEFT JOIN translations t ON t.key = sf.key AND t.lang = ?
70
+ WHERE sf.version = ?
71
+ GROUP BY sf.file
72
+ )
73
+ SELECT
74
+ section,
75
+ COUNT(*) as totalFiles,
76
+ SUM(CASE WHEN translated_nodes = total_nodes THEN 1 ELSE 0 END) as translatedFiles,
77
+ SUM(total_nodes) as totalNodes,
78
+ SUM(translated_nodes) as translatedNodes
79
+ FROM file_coverage
80
+ GROUP BY section
81
+ ORDER BY section
82
+ `,
83
+ )
84
+ .bind(lang, version)
85
+ .all<{
86
+ section: string;
87
+ totalFiles: number;
88
+ translatedFiles: number;
89
+ totalNodes: number;
90
+ translatedNodes: number;
91
+ }>();
92
+ return result.results;
93
+ }
94
+
95
+ export async function d1SourceCount(version: string): Promise<number> {
96
+ const db = requireD1();
97
+ const result = await db
98
+ .prepare(
99
+ 'SELECT COUNT(DISTINCT key) as count FROM source_files WHERE version = ?',
100
+ )
101
+ .bind(version)
102
+ .first<{ count: number }>();
103
+ return result?.count ?? 0;
104
+ }
105
+
106
+ export async function d1FileCoverage(
107
+ version: string,
108
+ lang: string,
109
+ ): Promise<{ file: string; total: number; translated: number }[]> {
110
+ const db = requireD1();
111
+ const result = await db
112
+ .prepare(
113
+ `
114
+ SELECT
115
+ sf.file,
116
+ COUNT(DISTINCT sf.key) as total,
117
+ COUNT(DISTINCT t.key) as translated
118
+ FROM source_files sf
119
+ LEFT JOIN translations t ON t.key = sf.key AND t.lang = ?
120
+ WHERE sf.version = ?
121
+ GROUP BY sf.file
122
+ ORDER BY sf.file
123
+ `,
124
+ )
125
+ .bind(lang, version)
126
+ .all<{ file: string; total: number; translated: number }>();
127
+ return result.results;
128
+ }
129
+
130
+ export async function d1FileDetail(
131
+ version: string,
132
+ lang: string,
133
+ file: string,
134
+ ): Promise<
135
+ {
136
+ key: string;
137
+ source: string;
138
+ type: string;
139
+ translation: string | null;
140
+ line: number;
141
+ }[]
142
+ > {
143
+ const db = requireD1();
144
+ const result = await db
145
+ .prepare(
146
+ `
147
+ SELECT
148
+ s.key,
149
+ s.text as source,
150
+ s.type,
151
+ t.value as translation,
152
+ sf.line
153
+ FROM source_files sf
154
+ JOIN sources s ON s.key = sf.key
155
+ LEFT JOIN translations t ON t.key = sf.key AND t.lang = ?
156
+ WHERE sf.version = ? AND sf.file = ?
157
+ ORDER BY sf.line
158
+ `,
159
+ )
160
+ .bind(lang, version, file)
161
+ .all<{
162
+ key: string;
163
+ source: string;
164
+ type: string;
165
+ translation: string | null;
166
+ line: number;
167
+ }>();
168
+ return result.results;
169
+ }
170
+
171
+ export async function d1GetTranslation(
172
+ lang: string,
173
+ key: string,
174
+ ): Promise<string | null> {
175
+ const db = requireD1();
176
+ const result = await db
177
+ .prepare('SELECT value FROM translations WHERE lang = ? AND key = ?')
178
+ .bind(lang, key)
179
+ .first<{ value: string }>();
180
+ return result?.value ?? null;
181
+ }
182
+
183
+ export async function d1DeleteTranslation(
184
+ lang: string,
185
+ key: string,
186
+ ): Promise<boolean> {
187
+ const db = requireD1();
188
+ const result = await db
189
+ .prepare('DELETE FROM translations WHERE lang = ? AND key = ?')
190
+ .bind(lang, key)
191
+ .run();
192
+ return (result.meta?.changes ?? 0) > 0;
193
+ }
194
+
195
+ export async function d1GetOverview(
196
+ versions: string[],
197
+ langs: string[],
198
+ ): Promise<
199
+ Record<
200
+ string,
201
+ {
202
+ enFileCount: number;
203
+ langs: Record<
204
+ string,
205
+ {
206
+ sections: Record<string, any>;
207
+ totalFiles: number;
208
+ translatedFiles: number;
209
+ totalNodes: number;
210
+ translatedNodes: number;
211
+ }
212
+ >;
213
+ }
214
+ >
215
+ > {
216
+ const db = requireD1();
217
+ const result: Record<string, any> = {};
218
+
219
+ for (const version of versions) {
220
+ // Count unique files for this version
221
+ const fileCountResult = await db
222
+ .prepare(
223
+ 'SELECT COUNT(DISTINCT file) as count FROM source_files WHERE version = ?',
224
+ )
225
+ .bind(version)
226
+ .first<{ count: number }>();
227
+ const enFileCount = fileCountResult?.count ?? 0;
228
+
229
+ const langStats: Record<string, any> = {};
230
+ for (const lang of langs) {
231
+ const sections = await d1SectionStats(version, lang);
232
+ let totalFiles = 0,
233
+ translatedFiles = 0,
234
+ totalNodes = 0,
235
+ translatedNodes = 0;
236
+ const sectionMap: Record<string, any> = {};
237
+ for (const s of sections) {
238
+ sectionMap[s.section] = s;
239
+ totalFiles += s.totalFiles;
240
+ translatedFiles += s.translatedFiles;
241
+ totalNodes += s.totalNodes;
242
+ translatedNodes += s.translatedNodes;
243
+ }
244
+ langStats[lang] = {
245
+ sections: sectionMap,
246
+ totalFiles,
247
+ translatedFiles,
248
+ totalNodes,
249
+ translatedNodes,
250
+ };
251
+ }
252
+ result[version] = { enFileCount, langs: langStats };
253
+ }
254
+
255
+ return result;
256
+ }
257
+
258
+ /**
259
+ * Get file blocks from D1 — returns source nodes with their translations,
260
+ * in line order. Note: without filesystem access, we can only return
261
+ * translatable blocks (no gap/whitespace blocks between them).
262
+ */
263
+ export async function d1GetFileBlocks(
264
+ version: string,
265
+ lang: string,
266
+ file: string,
267
+ ): Promise<
268
+ {
269
+ md5: string | null;
270
+ type: string;
271
+ source: string;
272
+ translation: string | null;
273
+ }[]
274
+ > {
275
+ const detail = await d1FileDetail(version, lang, file);
276
+ return detail.map((row) => ({
277
+ md5: row.key,
278
+ type: row.type,
279
+ source: row.source,
280
+ translation: row.translation,
281
+ }));
282
+ }
@@ -3,24 +3,38 @@ import { defineConfig } from 'vite';
3
3
  import { tanstackStart } from '@tanstack/react-start/plugin/vite';
4
4
  import react from '@vitejs/plugin-react';
5
5
 
6
+ // CF Workers deploy mode: DOCS_I18N_CF=1 enables @cloudflare/vite-plugin
7
+ const isCfBuild = process.env.DOCS_I18N_CF === '1';
8
+
9
+ const plugins: any[] = [
10
+ tanstackStart({
11
+ srcDirectory: 'app',
12
+ }),
13
+ react(),
14
+ ];
15
+
16
+ // Add Cloudflare plugin for CF Workers builds
17
+ if (isCfBuild) {
18
+ const { cloudflare } = await import('@cloudflare/vite-plugin');
19
+ plugins.unshift(cloudflare({ viteEnvironment: { name: 'ssr' } }));
20
+ }
21
+
6
22
  export default defineConfig({
7
- plugins: [
8
- tanstackStart({
9
- srcDirectory: 'app',
10
- }),
11
- react(),
12
- ],
23
+ plugins,
13
24
  // Bundle all deps into server build so it can run without node_modules
14
- environments: {
15
- ssr: {
16
- build: {
17
- rollupOptions: {
18
- external: ['node:*'],
25
+ // (Only for non-CF builds; CF plugin manages its own SSR environment)
26
+ ...(!isCfBuild && {
27
+ environments: {
28
+ ssr: {
29
+ build: {
30
+ rollupOptions: {
31
+ external: [/^node:/, 'better-sqlite3'],
32
+ },
33
+ },
34
+ resolve: {
35
+ noExternal: true,
19
36
  },
20
- },
21
- resolve: {
22
- noExternal: true,
23
37
  },
24
38
  },
25
- },
39
+ }),
26
40
  });
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "docs-i18n-admin",
3
+ "compatibility_date": "2025-01-01",
4
+ "compatibility_flags": ["nodejs_compat_v2"],
5
+ "main": "./app/worker.ts",
6
+ "assets": {
7
+ "directory": "dist/client"
8
+ },
9
+ "d1_databases": [
10
+ {
11
+ "binding": "DB",
12
+ "database_name": "docs-i18n-db",
13
+ "database_id": "597ff8e0-36fd-4bd5-a3fd-8f9e5bd14662"
14
+ }
15
+ ]
16
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docs-i18n",
3
- "version": "0.10.0",
3
+ "version": "0.11.0",
4
4
  "description": "Universal documentation translation engine — parse, translate, cache, assemble, manage.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -226,7 +226,7 @@ docs-i18n site [subcommand] [options]
226
226
 
227
227
  | Subcommand | Description |
228
228
  | --- | --- |
229
- | `dev` (default) | Start the Vite dev server with hot reload |
229
+ | `dev` (default) | Start the site server (pre-built or Vite dev) |
230
230
  | `build` | Build the site for production |
231
231
  | `upload` | Upload content and translations to Cloudflare D1 |
232
232
  | `deploy` | Deploy to Cloudflare Workers |
@@ -236,16 +236,20 @@ docs-i18n site [subcommand] [options]
236
236
  | Flag | Default | Description |
237
237
  | --- | --- | --- |
238
238
  | `--port <n>` | 3000 | Port for the dev server |
239
+ | `--custom` | false | Force Vite dev mode (skip pre-built server) |
239
240
  | `--db <name>` | `docs-i18n-db` | D1 database name (for `upload`) |
240
241
 
241
242
  **Examples:**
242
243
 
243
244
  ```bash
244
- # Start dev server
245
+ # Start site (uses pre-built server for instant startup)
245
246
  docs-i18n site
246
247
 
247
248
  # Start on custom port
248
- docs-i18n site dev --port 4000
249
+ docs-i18n site --port 4000
250
+
251
+ # Force Vite dev mode (HMR, custom components)
252
+ docs-i18n site --custom
249
253
 
250
254
  # Build for production
251
255
  docs-i18n site build
@@ -259,9 +263,9 @@ docs-i18n site deploy
259
263
 
260
264
  **How it works:**
261
265
 
262
- The `site` command does not require a `docs-i18n.config.ts`. It reads the `site.config.ts` file from your project root to configure the documentation site (project names, colors, locales, etc.).
266
+ The `site` command reads `site.config.ts` from your project root to configure the documentation site (project names, colors, locales, etc.).
263
267
 
264
- On first run, the template's dependencies are automatically installed. The dev server uses Vite with the consumer's `site.config.ts` aliased into the template for customization.
268
+ By default, the site starts instantly using the pre-built Node.js server (no `npm install` needed). The pre-built server uses `jiti` to load your `site.config.ts` at runtime. Use `--custom` to fall back to Vite dev mode with hot reload when you need custom React components or live editing.
265
269
 
266
270
  For non-English languages, the site automatically loads translations from the `.cache/translations.db` SQLite cache and assembles them at runtime.
267
271
 
@@ -107,22 +107,31 @@ jobs:
107
107
  │ Development (local) │
108
108
  │ │
109
109
  │ docs-i18n admin ──→ Pre-built Node.js server (port 3456)│
110
- │ docs-i18n site ──→ Vite dev server (port 3000)
110
+ │ docs-i18n site ──→ Pre-built Node.js server (port 3000)│
111
+ │ docs-i18n site --custom ──→ Vite dev server (port 3000) │
111
112
  │ ↕ reads content/ + .cache/ │
112
113
  └──────────────────────────────────────────────────────────┘
113
114
 
114
115
  ┌──────────────────────────────────────────────────────────┐
115
116
  │ Production (Cloudflare Workers) │
116
117
  │ │
117
- │ docs-i18n site build ──→ .output/
118
- docs-i18n site upload ──→ D1 (translations)
119
- docs-i18n site deploy ──→ CF Workers (SSR)
118
+ │ docs-i18n site upload ──→ D1 (content + translations)
119
+ DOCS_I18N_CF=1 vite build ──→ CF Workers bundle
120
+ wrangler deploy ──→ CF Workers (SSR + D1)
120
121
  │ │
121
- │ Request → Worker → fetch EN content → D1 translate
122
- SSR render response
122
+ │ Request → Worker → D1 content → SSR render → response
123
+ CF Assets serves static files
123
124
  └──────────────────────────────────────────────────────────┘
124
125
  ```
125
126
 
127
+ ### Site startup modes
128
+
129
+ | Mode | Command | Speed | Use case |
130
+ | --- | --- | --- | --- |
131
+ | Pre-built | `docs-i18n site` | Instant (<1s) | Default for local dev, reads filesystem |
132
+ | Custom/dev | `docs-i18n site --custom` | ~3s | When you need Vite HMR or custom components |
133
+ | CF Workers | `DOCS_I18N_CF=1 vite build` + `wrangler deploy` | Production | SSR on the edge with D1 |
134
+
126
135
  ## Admin Dashboard
127
136
 
128
137
  The admin dashboard is pre-built and requires no additional dependencies. It runs as a local Node.js server.
@@ -135,88 +144,96 @@ npx docs-i18n admin --port 4000
135
144
 
136
145
  It reads your `docs-i18n.config.ts` to discover projects, versions, and languages.
137
146
 
138
- ## Runtime Translation with D1
147
+ ## Deploying to Cloudflare Workers
139
148
 
140
- For SSR sites that fetch markdown at runtime (e.g., TanStack Start on Cloudflare Workers), docs-i18n provides a lightweight runtime translator that queries Cloudflare D1 for cached translations.
149
+ The documentation site can be deployed to Cloudflare Workers for production SSR with edge performance. Content is served from D1, static assets from CF Assets.
141
150
 
142
- ### How it works
151
+ ### Step-by-step deployment
143
152
 
144
- The `createTranslator` function from `docs-i18n/serve` creates a translator instance. When `translate()` is called:
153
+ #### 1. Create a D1 database
145
154
 
146
- 1. The markdown is parsed into AST nodes using the same parser as the CLI.
147
- 2. Translatable nodes' MD5 keys are collected.
148
- 3. A batch query is sent to D1 to look up all translations for the given language.
149
- 4. The content is reassembled: translated nodes use the D1 cache value, untranslated nodes fall back to the original English text.
150
-
151
- ### Setup
155
+ ```bash
156
+ wrangler d1 create docs-i18n-db
157
+ ```
152
158
 
153
- #### 1. Export translations to D1
159
+ Note the `database_id` from the output.
160
+
161
+ #### 2. Create `wrangler.jsonc` in your project root
162
+
163
+ ```jsonc
164
+ {
165
+ "name": "my-docs-site",
166
+ "compatibility_date": "2025-01-01",
167
+ "compatibility_flags": ["nodejs_compat_v2"],
168
+ "main": "./app/worker.ts",
169
+ "assets": {
170
+ "directory": "dist/client"
171
+ },
172
+ "d1_databases": [
173
+ {
174
+ "binding": "DB",
175
+ "database_name": "docs-i18n-db",
176
+ "database_id": "your-database-id-here"
177
+ }
178
+ ]
179
+ }
180
+ ```
154
181
 
155
- First, translate your content using the CLI as normal. Then export the SQLite cache to D1. You can use Wrangler to create a D1 database and import the translations:
182
+ #### 3. Upload content to D1
156
183
 
157
184
  ```bash
158
- # Create a D1 database
159
- wrangler d1 create docs-translations
185
+ docs-i18n site upload --db docs-i18n-db
186
+ ```
160
187
 
161
- # Export the translations table from your local SQLite
162
- sqlite3 .cache/translations.db ".dump translations" > translations.sql
188
+ This walks your `content/` directory and inserts all markdown files + config into the D1 database.
163
189
 
164
- # Import into D1
165
- wrangler d1 execute docs-translations --file=translations.sql
190
+ #### 4. Build for CF Workers
191
+
192
+ ```bash
193
+ DOCS_I18N_CF=1 docs-i18n site build
166
194
  ```
167
195
 
168
- Make sure the D1 database has the same `translations` table schema:
169
-
170
- ```sql
171
- CREATE TABLE IF NOT EXISTS translations (
172
- lang TEXT NOT NULL,
173
- key TEXT NOT NULL,
174
- value TEXT NOT NULL,
175
- created_at INTEGER NOT NULL DEFAULT (unixepoch()),
176
- updated_at INTEGER NOT NULL DEFAULT (unixepoch()),
177
- PRIMARY KEY (lang, key)
178
- );
196
+ The `DOCS_I18N_CF=1` flag enables the `@cloudflare/vite-plugin`, producing a CF Workers-compatible bundle instead of a Node.js one.
197
+
198
+ #### 5. Deploy
199
+
200
+ ```bash
201
+ wrangler deploy
179
202
  ```
180
203
 
181
- #### 2. Use the translator in your Worker
204
+ Your site is now live on `https://your-worker.workers.dev`.
182
205
 
183
- ```ts
184
- import { createTranslator } from 'docs-i18n/serve';
206
+ ### How it works
185
207
 
186
- const translator = createTranslator();
208
+ - **Worker entry** (`app/worker.ts`): Receives requests, injects the D1 binding into `globalThis.__D1_DB`, then delegates to TanStack Start's server entry for SSR.
209
+ - **Content loading**: The server auto-detects D1 via `globalThis.__D1_DB`. When available, it uses `createD1Loader` instead of the filesystem loader.
210
+ - **Static assets**: CSS, JS, fonts, and images are served directly by CF Assets from `dist/client/`.
211
+ - **SSR**: Full server-side rendering with streamed HTML responses. The markdown rendering uses `dangerouslySetInnerHTML` as a fallback on CF Workers (since `html-react-parser`'s DOM-based parser isn't available), with full client-side hydration.
187
212
 
188
- // In your request handler (e.g., TanStack Start server function):
189
- export async function getTranslatedDoc(
190
- repo: string,
191
- branch: string,
192
- filePath: string,
193
- lang: string,
194
- env: { DB: D1Database },
195
- ) {
196
- // Fetch the English markdown from GitHub
197
- const enMarkdown = await fetchFromGitHub(repo, branch, filePath);
213
+ ### Performance
198
214
 
199
- // If the requested language is English, return as-is
200
- if (lang === 'en') return enMarkdown;
215
+ - D1 content queries typically complete in <10ms.
216
+ - Worker startup time is ~15-20ms (cold start).
217
+ - Static assets are served from CF's edge CDN with long cache headers.
218
+ - SSR responses include full HTML content for SEO and fast initial render.
201
219
 
202
- // Translate using D1 cache
203
- const translated = await translator.translate(enMarkdown, lang, env.DB);
204
- return translated;
205
- }
206
- ```
220
+ ## Runtime Translation with D1
207
221
 
208
- #### 3. Bind D1 in wrangler.toml
222
+ For non-English content, docs-i18n provides runtime translation assembly. The site loads English source from D1, then assembles translated content by looking up cached translations.
209
223
 
210
- ```toml
211
- [[d1_databases]]
212
- binding = "DB"
213
- database_name = "docs-translations"
214
- database_id = "your-database-id"
215
- ```
224
+ ### How it works
225
+
226
+ 1. The English markdown is loaded from the D1 `content` table.
227
+ 2. For non-English requests, the `assemble()` function from `docs-i18n` parses the markdown into nodes and looks up translations by MD5 key in the `translations` table.
228
+ 3. Translated nodes use the cached value; untranslated nodes fall back to the original English text.
229
+ 4. The assembled content is rendered via SSR.
230
+
231
+ ### Uploading translations
216
232
 
217
- ### Performance considerations
233
+ After running `docs-i18n translate` locally, upload the translation cache to D1:
234
+
235
+ ```bash
236
+ docs-i18n site upload --db docs-i18n-db
237
+ ```
218
238
 
219
- - The translator uses a single batch query to D1, so latency scales with the number of translatable nodes (typically under 50ms for a standard documentation page).
220
- - English content (`lang === 'en'`) short-circuits immediately without parsing or querying.
221
- - The parser runs on every request since the English source is fetched at runtime. For heavy traffic, consider caching the translated output at the edge.
222
- - Untranslated nodes gracefully fall back to English, so partial translations work without errors.
239
+ This uploads both content files and the translation cache (sources + translations tables).
@@ -1 +1 @@
1
- import{z as C,o as E,j as e,r as l,s as W,t as A}from"./main-Csj9i19C.js";import{u as S,a as L,b as T}from"./DocsLayout-ERG7nrAc.js";import{B as O,r as U,F as $,M as V,a as _}from"./MarkdownHeadingContext-6I862CKH.js";const G=C("FoldHorizontal",[["path",{d:"M2 12h6",key:"1wqiqv"}],["path",{d:"M22 12h-6",key:"1eg9hc"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m19 9-3 3 3 3",key:"12ol22"}],["path",{d:"m5 15 3-3-3-3",key:"1kdhjc"}]]);const J=C("UnfoldHorizontal",[["path",{d:"M16 12h6",key:"15xry1"}],["path",{d:"M8 12H2",key:"1jqql6"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m19 15 3-3-3-3",key:"wjy7rq"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}]]);function K(i,n){for(const t of i.sections){for(const r of t.children)if(r.to===n)return t.label;if(t.frameworks){for(const r of t.frameworks)for(const o of r.children)if(o.to===n)return t.label}}return null}function P({config:i,headings:n}){const{_splat:t,framework:r}=E({strict:!1}),o=r?`framework/${r}/${t}`:t,h=o?K(i,o):null;return h?e.jsx(O,{section:h,headings:n,tocHiddenBreakpoint:"lg"}):null}function ee({title:i,content:n,repo:t,branch:r,filePath:o,shouldRenderToc:h=!0,colorFrom:H,colorTo:N,textColor:q,config:w,footer:B,framework:g,isFallback:D=!1,locale:y}){const{headings:u,markup:R}=l.useMemo(()=>U(n),[n]),{framework:v}=E({strict:!1}),j=S(),M=l.useMemo(()=>{const s=g||v||j.currentFramework||"react";return typeof s=="string"?s.toLowerCase():s},[g,v,j.currentFramework]),f=h&&u.length>1,b=l.useRef(null),[z,I]=l.useState([]),m=l.useRef({});let c=!1,k;try{const s=L();c=s.isFullWidth,k=s.setIsFullWidth}catch{}return l.useEffect(()=>{const s=x=>{m.current=x.reduce((a,d)=>(a[d.target.id]=d,a),m.current);const p=[];Object.keys(m.current).forEach(a=>{const d=m.current[a];d.isIntersecting&&p.push(d)}),p.length>=1&&I(p.map(a=>a.target.id))},F=new IntersectionObserver(s,{rootMargin:"0px",threshold:.2});return Array.from(b.current?.querySelectorAll("h2[id], h3[id], h4[id], h5[id], h6[id]")??[]).forEach(x=>F.observe(x)),()=>F.disconnect()},[u]),e.jsxs("div",{className:"flex-1 min-h-0 flex flex-col pt-4 lg:pt-6 xl:pt-8",children:[D&&y&&e.jsx($,{locale:y}),e.jsxs("div",{className:A("w-full flex mx-auto max-w-[768px]",(f||c)&&"max-w-full"),children:[e.jsxs("div",{className:"flex flex-col w-full min-w-0",children:[w&&e.jsx("div",{className:"mb-3",children:e.jsx(P,{config:w,headings:f?u:void 0})}),e.jsx(V,{title:i,repo:t,branch:r,filePath:o,htmlMarkup:R,containerRef:b,currentFramework:M,customComponents:W.components,titleBarActions:k?e.jsx("button",{onClick:()=>k(!c),className:"p-2 mr-4 text-gray-600 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors shrink-0 hidden [@media(min-width:1535px)]:inline-flex",title:c?"Constrain width":"Expand width",children:c?e.jsx(G,{className:"w-4 h-4"}):e.jsx(J,{className:"w-4 h-4"})}):null}),B??e.jsx(T,{})]}),f&&e.jsx("div",{className:"pl-4 w-32 lg:w-36 xl:w-44 2xl:w-56 3xl:w-64 shrink-0 hidden lg:block transition-all",children:e.jsx(_,{headings:u,activeHeadings:z,colorFrom:H,colorTo:N,textColor:q,currentFramework:M})})]})]})}export{ee as D};
1
+ import{z as C,o as E,j as e,r as l,s as W,t as A}from"./main-DqZtiCro.js";import{u as S,a as L,b as T}from"./DocsLayout-BGugXxEQ.js";import{B as O,r as U,F as $,M as V,a as _}from"./MarkdownHeadingContext-CdvUDZFU.js";const G=C("FoldHorizontal",[["path",{d:"M2 12h6",key:"1wqiqv"}],["path",{d:"M22 12h-6",key:"1eg9hc"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m19 9-3 3 3 3",key:"12ol22"}],["path",{d:"m5 15 3-3-3-3",key:"1kdhjc"}]]);const J=C("UnfoldHorizontal",[["path",{d:"M16 12h6",key:"15xry1"}],["path",{d:"M8 12H2",key:"1jqql6"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 8v2",key:"1woqiv"}],["path",{d:"M12 14v2",key:"8jcxud"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m19 15 3-3-3-3",key:"wjy7rq"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}]]);function K(i,n){for(const t of i.sections){for(const r of t.children)if(r.to===n)return t.label;if(t.frameworks){for(const r of t.frameworks)for(const o of r.children)if(o.to===n)return t.label}}return null}function P({config:i,headings:n}){const{_splat:t,framework:r}=E({strict:!1}),o=r?`framework/${r}/${t}`:t,h=o?K(i,o):null;return h?e.jsx(O,{section:h,headings:n,tocHiddenBreakpoint:"lg"}):null}function ee({title:i,content:n,repo:t,branch:r,filePath:o,shouldRenderToc:h=!0,colorFrom:H,colorTo:N,textColor:q,config:w,footer:B,framework:g,isFallback:D=!1,locale:y}){const{headings:u,markup:R}=l.useMemo(()=>U(n),[n]),{framework:v}=E({strict:!1}),j=S(),M=l.useMemo(()=>{const s=g||v||j.currentFramework||"react";return typeof s=="string"?s.toLowerCase():s},[g,v,j.currentFramework]),f=h&&u.length>1,b=l.useRef(null),[z,I]=l.useState([]),m=l.useRef({});let c=!1,k;try{const s=L();c=s.isFullWidth,k=s.setIsFullWidth}catch{}return l.useEffect(()=>{const s=x=>{m.current=x.reduce((a,d)=>(a[d.target.id]=d,a),m.current);const p=[];Object.keys(m.current).forEach(a=>{const d=m.current[a];d.isIntersecting&&p.push(d)}),p.length>=1&&I(p.map(a=>a.target.id))},F=new IntersectionObserver(s,{rootMargin:"0px",threshold:.2});return Array.from(b.current?.querySelectorAll("h2[id], h3[id], h4[id], h5[id], h6[id]")??[]).forEach(x=>F.observe(x)),()=>F.disconnect()},[u]),e.jsxs("div",{className:"flex-1 min-h-0 flex flex-col pt-4 lg:pt-6 xl:pt-8",children:[D&&y&&e.jsx($,{locale:y}),e.jsxs("div",{className:A("w-full flex mx-auto max-w-[768px]",(f||c)&&"max-w-full"),children:[e.jsxs("div",{className:"flex flex-col w-full min-w-0",children:[w&&e.jsx("div",{className:"mb-3",children:e.jsx(P,{config:w,headings:f?u:void 0})}),e.jsx(V,{title:i,repo:t,branch:r,filePath:o,htmlMarkup:R,containerRef:b,currentFramework:M,customComponents:W.components,titleBarActions:k?e.jsx("button",{onClick:()=>k(!c),className:"p-2 mr-4 text-gray-600 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors shrink-0 hidden [@media(min-width:1535px)]:inline-flex",title:c?"Constrain width":"Expand width",children:c?e.jsx(G,{className:"w-4 h-4"}):e.jsx(J,{className:"w-4 h-4"})}):null}),B??e.jsx(T,{})]}),f&&e.jsx("div",{className:"pl-4 w-32 lg:w-36 xl:w-44 2xl:w-56 3xl:w-64 shrink-0 hidden lg:block transition-all",children:e.jsx(_,{headings:u,activeHeadings:z,colorFrom:H,colorTo:N,textColor:q,currentFramework:M})})]})]})}export{ee as D};