gemi 0.172.0 → 0.174.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 (220) hide show
  1. package/dist/ai/index.js +2 -2
  2. package/dist/ai/index.js.map +1 -1
  3. package/dist/app/index.js +1 -1
  4. package/dist/bin/gemi.js +13 -2
  5. package/dist/bin/gemi.js.map +3 -3
  6. package/dist/bun/plugin.js +1 -1
  7. package/dist/bun/preload.js +1 -1
  8. package/dist/{chunk-thbs63gy.js → chunk-05k9gmr9.js} +1 -1
  9. package/dist/{chunk-fb77hwk0.js → chunk-0v46hne6.js} +3 -3
  10. package/dist/{chunk-fb77hwk0.js.map → chunk-0v46hne6.js.map} +1 -1
  11. package/dist/{chunk-njem61cd.js → chunk-1hhwqx50.js} +2 -2
  12. package/dist/{chunk-njem61cd.js.map → chunk-1hhwqx50.js.map} +1 -1
  13. package/dist/chunk-2mvz2pjr.js +5 -0
  14. package/dist/{chunk-f4nanvkm.js.map → chunk-2mvz2pjr.js.map} +1 -1
  15. package/dist/{chunk-q3511sb5.js → chunk-2p7zph5z.js} +2 -2
  16. package/dist/{chunk-q3511sb5.js.map → chunk-2p7zph5z.js.map} +1 -1
  17. package/dist/{chunk-c46vhvk4.js → chunk-3esnjxv9.js} +2 -2
  18. package/dist/{chunk-c46vhvk4.js.map → chunk-3esnjxv9.js.map} +1 -1
  19. package/dist/{chunk-f82m70ek.js → chunk-48pgk5j8.js} +2 -2
  20. package/dist/{chunk-f82m70ek.js.map → chunk-48pgk5j8.js.map} +1 -1
  21. package/dist/{chunk-5n21z4n8.js → chunk-4dnr1vg7.js} +2 -2
  22. package/dist/{chunk-5n21z4n8.js.map → chunk-4dnr1vg7.js.map} +1 -1
  23. package/dist/{chunk-z0bzca7f.js → chunk-4hhvaa7a.js} +2 -2
  24. package/dist/{chunk-z0bzca7f.js.map → chunk-4hhvaa7a.js.map} +1 -1
  25. package/dist/{chunk-df2zeevj.js → chunk-5yvy70d7.js} +2 -2
  26. package/dist/{chunk-df2zeevj.js.map → chunk-5yvy70d7.js.map} +1 -1
  27. package/dist/{chunk-31np60bx.js → chunk-6016sfy5.js} +2 -2
  28. package/dist/{chunk-31np60bx.js.map → chunk-6016sfy5.js.map} +1 -1
  29. package/dist/{chunk-sdn3dmpp.js → chunk-699j2epd.js} +4 -4
  30. package/dist/{chunk-sdn3dmpp.js.map → chunk-699j2epd.js.map} +1 -1
  31. package/dist/{chunk-gwphn604.js → chunk-6rh3brnr.js} +3 -3
  32. package/dist/{chunk-gwphn604.js.map → chunk-6rh3brnr.js.map} +1 -1
  33. package/dist/{chunk-s71e6k9m.js → chunk-6srzhv88.js} +3 -3
  34. package/dist/{chunk-s71e6k9m.js.map → chunk-6srzhv88.js.map} +1 -1
  35. package/dist/{chunk-0wet87jm.js → chunk-6vmc8eak.js} +2 -2
  36. package/dist/{chunk-0wet87jm.js.map → chunk-6vmc8eak.js.map} +1 -1
  37. package/dist/{chunk-rpdekb8t.js → chunk-7gc1jp2z.js} +2 -2
  38. package/dist/{chunk-rpdekb8t.js.map → chunk-7gc1jp2z.js.map} +1 -1
  39. package/dist/{chunk-y3s05q6b.js → chunk-7mp369vg.js} +2 -2
  40. package/dist/{chunk-y3s05q6b.js.map → chunk-7mp369vg.js.map} +1 -1
  41. package/dist/{chunk-44y62yav.js → chunk-8tzmat5s.js} +3 -3
  42. package/dist/{chunk-44y62yav.js.map → chunk-8tzmat5s.js.map} +1 -1
  43. package/dist/{chunk-sv86v56c.js → chunk-97aeny79.js} +3 -3
  44. package/dist/{chunk-sv86v56c.js.map → chunk-97aeny79.js.map} +1 -1
  45. package/dist/{chunk-978pc27j.js → chunk-9bcsfce4.js} +2 -2
  46. package/dist/{chunk-978pc27j.js.map → chunk-9bcsfce4.js.map} +1 -1
  47. package/dist/{chunk-4mtqbcc5.js → chunk-9r4rvyfr.js} +2 -2
  48. package/dist/{chunk-4mtqbcc5.js.map → chunk-9r4rvyfr.js.map} +1 -1
  49. package/dist/{chunk-vfvjfw5k.js → chunk-9zcsshgb.js} +2 -2
  50. package/dist/{chunk-vfvjfw5k.js.map → chunk-9zcsshgb.js.map} +1 -1
  51. package/dist/chunk-a8c7fe9s.js +10 -0
  52. package/dist/{chunk-qv2zapxa.js.map → chunk-a8c7fe9s.js.map} +3 -3
  53. package/dist/{chunk-krdq5s4y.js → chunk-b1grj1t0.js} +2 -2
  54. package/dist/{chunk-krdq5s4y.js.map → chunk-b1grj1t0.js.map} +1 -1
  55. package/dist/{chunk-q788x8pm.js → chunk-bs8mrewm.js} +2 -2
  56. package/dist/{chunk-q788x8pm.js.map → chunk-bs8mrewm.js.map} +1 -1
  57. package/dist/{chunk-8b9ks729.js → chunk-bsnp7h5w.js} +3 -3
  58. package/dist/{chunk-8b9ks729.js.map → chunk-bsnp7h5w.js.map} +1 -1
  59. package/dist/{chunk-z4dhd5pk.js → chunk-c9q856yk.js} +2 -2
  60. package/dist/{chunk-z4dhd5pk.js.map → chunk-c9q856yk.js.map} +1 -1
  61. package/dist/{chunk-2v7wq01w.js → chunk-cx05t002.js} +2 -2
  62. package/dist/{chunk-2v7wq01w.js.map → chunk-cx05t002.js.map} +1 -1
  63. package/dist/{chunk-p56zntmt.js → chunk-d084zwp9.js} +3 -3
  64. package/dist/{chunk-p56zntmt.js.map → chunk-d084zwp9.js.map} +1 -1
  65. package/dist/chunk-d6x90qty.js +117 -0
  66. package/dist/{chunk-mm5p3tvh.js.map → chunk-d6x90qty.js.map} +13 -9
  67. package/dist/{chunk-6t1t7h05.js → chunk-d7a79eqm.js} +2 -2
  68. package/dist/{chunk-6t1t7h05.js.map → chunk-d7a79eqm.js.map} +1 -1
  69. package/dist/{chunk-aj1jrwwh.js → chunk-df0nx9d6.js} +2 -2
  70. package/dist/{chunk-aj1jrwwh.js.map → chunk-df0nx9d6.js.map} +1 -1
  71. package/dist/{chunk-hwpp9b7f.js → chunk-dqj22m1r.js} +2 -2
  72. package/dist/{chunk-9wcv7e1a.js.map → chunk-dqj22m1r.js.map} +1 -1
  73. package/dist/{chunk-kbw6y0ag.js → chunk-erwawm84.js} +2 -2
  74. package/dist/{chunk-kbw6y0ag.js.map → chunk-erwawm84.js.map} +1 -1
  75. package/dist/{chunk-sp77zwpn.js → chunk-ewf24h4z.js} +14 -3
  76. package/dist/chunk-ewf24h4z.js.map +10 -0
  77. package/dist/{chunk-8hfyscnn.js → chunk-f1my4jah.js} +1 -1
  78. package/dist/{chunk-drwjwtmj.js → chunk-f4wkm07x.js} +2 -2
  79. package/dist/{chunk-drwjwtmj.js.map → chunk-f4wkm07x.js.map} +1 -1
  80. package/dist/{chunk-4tt14jnx.js → chunk-fqw81xgw.js} +2 -2
  81. package/dist/{chunk-4tt14jnx.js.map → chunk-fqw81xgw.js.map} +1 -1
  82. package/dist/{chunk-hgpvfhtp.js → chunk-g3m7t5zc.js} +1 -1
  83. package/dist/{chunk-0wk992a5.js → chunk-h041bq3j.js} +2 -2
  84. package/dist/{chunk-0wk992a5.js.map → chunk-h041bq3j.js.map} +1 -1
  85. package/dist/{chunk-sxf94q13.js → chunk-h3jb2g2g.js} +2 -2
  86. package/dist/{chunk-sxf94q13.js.map → chunk-h3jb2g2g.js.map} +1 -1
  87. package/dist/{chunk-vnk4vaer.js → chunk-hr9twa8v.js} +3 -3
  88. package/dist/{chunk-vnk4vaer.js.map → chunk-hr9twa8v.js.map} +1 -1
  89. package/dist/{chunk-zppfpg1m.js → chunk-hz37kkwy.js} +2 -2
  90. package/dist/{chunk-zppfpg1m.js.map → chunk-hz37kkwy.js.map} +1 -1
  91. package/dist/{chunk-21hppqtb.js → chunk-jhn1h70n.js} +2 -2
  92. package/dist/{chunk-21hppqtb.js.map → chunk-jhn1h70n.js.map} +1 -1
  93. package/dist/{chunk-wp9hw3we.js → chunk-jv48eg0a.js} +2 -2
  94. package/dist/{chunk-wp9hw3we.js.map → chunk-jv48eg0a.js.map} +1 -1
  95. package/dist/{chunk-5rzb2c9n.js → chunk-jy4hy8d4.js} +2 -2
  96. package/dist/{chunk-5rzb2c9n.js.map → chunk-jy4hy8d4.js.map} +1 -1
  97. package/dist/{chunk-3682hkq0.js → chunk-k9ndr16q.js} +2 -2
  98. package/dist/{chunk-3682hkq0.js.map → chunk-k9ndr16q.js.map} +1 -1
  99. package/dist/{chunk-4qpyz627.js → chunk-kknybxbv.js} +2 -2
  100. package/dist/{chunk-4qpyz627.js.map → chunk-kknybxbv.js.map} +1 -1
  101. package/dist/{chunk-a9frf7ym.js → chunk-ksgeqtcv.js} +2 -2
  102. package/dist/{chunk-a9frf7ym.js.map → chunk-ksgeqtcv.js.map} +1 -1
  103. package/dist/{chunk-ta2wsjz6.js → chunk-kxgxeead.js} +2 -2
  104. package/dist/{chunk-ta2wsjz6.js.map → chunk-kxgxeead.js.map} +1 -1
  105. package/dist/{chunk-xkas0yp8.js → chunk-m0nvysa5.js} +3 -3
  106. package/dist/{chunk-xkas0yp8.js.map → chunk-m0nvysa5.js.map} +1 -1
  107. package/dist/{chunk-fcbgshf5.js → chunk-m250ejpg.js} +2 -2
  108. package/dist/{chunk-fcbgshf5.js.map → chunk-m250ejpg.js.map} +1 -1
  109. package/dist/{chunk-embwksec.js → chunk-mbshptjq.js} +2 -2
  110. package/dist/{chunk-embwksec.js.map → chunk-mbshptjq.js.map} +1 -1
  111. package/dist/{chunk-m6sj1q1q.js → chunk-nfj6k1a6.js} +2 -2
  112. package/dist/{chunk-m6sj1q1q.js.map → chunk-nfj6k1a6.js.map} +1 -1
  113. package/dist/{chunk-yem48znp.js → chunk-pbc3w7mq.js} +2 -2
  114. package/dist/{chunk-yem48znp.js.map → chunk-pbc3w7mq.js.map} +1 -1
  115. package/dist/{chunk-9ft0ayhf.js → chunk-q1s9y4ce.js} +2 -2
  116. package/dist/{chunk-9ft0ayhf.js.map → chunk-q1s9y4ce.js.map} +1 -1
  117. package/dist/{chunk-777v6242.js → chunk-qfqn7rz8.js} +1 -1
  118. package/dist/{chunk-ktfc7jmg.js → chunk-r1n2fkfz.js} +2 -2
  119. package/dist/{chunk-ktfc7jmg.js.map → chunk-r1n2fkfz.js.map} +1 -1
  120. package/dist/{chunk-d54afkwy.js → chunk-r22svpab.js} +3 -3
  121. package/dist/{chunk-d54afkwy.js.map → chunk-r22svpab.js.map} +1 -1
  122. package/dist/{chunk-wt1yzzbw.js → chunk-r5wtc9fw.js} +1 -1
  123. package/dist/{chunk-jxx9mctk.js → chunk-rjsd8f8q.js} +2 -2
  124. package/dist/{chunk-jxx9mctk.js.map → chunk-rjsd8f8q.js.map} +1 -1
  125. package/dist/{chunk-k87tqe29.js → chunk-sgarq1q9.js} +2 -2
  126. package/dist/{chunk-k87tqe29.js.map → chunk-sgarq1q9.js.map} +1 -1
  127. package/dist/{chunk-jd079awh.js → chunk-sjg5g92s.js} +2 -2
  128. package/dist/{chunk-jd079awh.js.map → chunk-sjg5g92s.js.map} +1 -1
  129. package/dist/{chunk-3rp908gn.js → chunk-srvsz7vm.js} +1 -1
  130. package/dist/{chunk-gjwf07hy.js → chunk-tbf76adx.js} +2 -2
  131. package/dist/{chunk-gjwf07hy.js.map → chunk-tbf76adx.js.map} +1 -1
  132. package/dist/{chunk-17272ccy.js → chunk-tzne38pa.js} +3 -3
  133. package/dist/{chunk-17272ccy.js.map → chunk-tzne38pa.js.map} +1 -1
  134. package/dist/{chunk-m950vw4c.js → chunk-vpmbynke.js} +2 -2
  135. package/dist/{chunk-m950vw4c.js.map → chunk-vpmbynke.js.map} +1 -1
  136. package/dist/{chunk-s4fb4njt.js → chunk-vzz91xsm.js} +2 -2
  137. package/dist/{chunk-s4fb4njt.js.map → chunk-vzz91xsm.js.map} +1 -1
  138. package/dist/{chunk-5nz46dyw.js → chunk-w65gftzm.js} +2 -2
  139. package/dist/{chunk-5nz46dyw.js.map → chunk-w65gftzm.js.map} +1 -1
  140. package/dist/{chunk-g1jfc50d.js → chunk-w8hre8gz.js} +2 -2
  141. package/dist/{chunk-g1jfc50d.js.map → chunk-w8hre8gz.js.map} +1 -1
  142. package/dist/{chunk-9wcv7e1a.js → chunk-xe126csw.js} +2 -2
  143. package/dist/{chunk-hwpp9b7f.js.map → chunk-xe126csw.js.map} +1 -1
  144. package/dist/{chunk-0q65jzhv.js → chunk-xtj7cgsx.js} +2 -2
  145. package/dist/{chunk-0q65jzhv.js.map → chunk-xtj7cgsx.js.map} +1 -1
  146. package/dist/{chunk-9akefv1y.js → chunk-ykd2ayw8.js} +2 -2
  147. package/dist/{chunk-9akefv1y.js.map → chunk-ykd2ayw8.js.map} +1 -1
  148. package/dist/{chunk-z5g56ds0.js → chunk-ywcfezjq.js} +2 -2
  149. package/dist/{chunk-z5g56ds0.js.map → chunk-ywcfezjq.js.map} +1 -1
  150. package/dist/{chunk-ecdjbd2w.js → chunk-zdpxwpc3.js} +3 -3
  151. package/dist/{chunk-ecdjbd2w.js.map → chunk-zdpxwpc3.js.map} +1 -1
  152. package/dist/client/IslandI18nContext.d.ts +32 -0
  153. package/dist/client/IslandI18nContext.d.ts.map +1 -0
  154. package/dist/client/index.js +29 -4
  155. package/dist/client/index.js.map +1 -1
  156. package/dist/client/islands.d.ts +40 -2
  157. package/dist/client/islands.d.ts.map +1 -1
  158. package/dist/client/useDictionary.d.ts.map +1 -1
  159. package/dist/config/index.js +1 -1
  160. package/dist/console/run.js +2 -2
  161. package/dist/console/run.js.map +1 -1
  162. package/dist/container/index.js +2 -2
  163. package/dist/container/index.js.map +1 -1
  164. package/dist/database/index.js +2 -2
  165. package/dist/database/index.js.map +1 -1
  166. package/dist/email/index.js +2 -2
  167. package/dist/email/index.js.map +1 -1
  168. package/dist/facades/index.js +2 -2
  169. package/dist/facades/index.js.map +1 -1
  170. package/dist/foundation/index.js +2 -2
  171. package/dist/foundation/index.js.map +1 -1
  172. package/dist/http/contentDisposition.d.ts +1 -1
  173. package/dist/http/contentDisposition.d.ts.map +1 -1
  174. package/dist/http/index.js +2 -2
  175. package/dist/http/index.js.map +1 -1
  176. package/dist/i18n/dictionaryRuntime.js +2 -2
  177. package/dist/i18n/dictionaryRuntime.js.map +1 -1
  178. package/dist/i18n/index.js +2 -2
  179. package/dist/i18n/index.js.map +1 -1
  180. package/dist/internal/islandRuntime.d.ts +10 -2
  181. package/dist/internal/islandRuntime.d.ts.map +1 -1
  182. package/dist/kernel/index.js +2 -2
  183. package/dist/kernel/index.js.map +1 -1
  184. package/dist/orm/index.js +2 -2
  185. package/dist/orm/index.js.map +1 -1
  186. package/dist/probe/index.js +2 -2
  187. package/dist/probe/index.js.map +1 -1
  188. package/dist/server/index.js +2 -2
  189. package/dist/server/index.js.map +1 -1
  190. package/dist/services/index.js +2 -2
  191. package/dist/services/index.js.map +1 -1
  192. package/dist/services/queue/work.js +2 -2
  193. package/dist/services/queue/work.js.map +1 -1
  194. package/dist/services/router/ViewRouteDispatcher.d.ts +2 -0
  195. package/dist/services/router/ViewRouteDispatcher.d.ts.map +1 -1
  196. package/dist/services/router/config.d.ts +22 -3
  197. package/dist/services/router/config.d.ts.map +1 -1
  198. package/dist/services/router/globalMiddleware.d.ts.map +1 -1
  199. package/dist/services/router/staticCache.d.ts +8 -0
  200. package/dist/services/router/staticCache.d.ts.map +1 -1
  201. package/dist/services/router/staticDocument.d.ts +10 -0
  202. package/dist/services/router/staticDocument.d.ts.map +1 -1
  203. package/dist/stats/route-table.js +1 -1
  204. package/dist/support/index.js +2 -2
  205. package/dist/support/index.js.map +1 -1
  206. package/dist/testing/index.js +20 -1
  207. package/dist/testing/index.js.map +1 -1
  208. package/dist/vite/index.mjs +12 -1
  209. package/dist/vitest/index.js +1 -1
  210. package/package.json +1 -1
  211. package/dist/chunk-f4nanvkm.js +0 -5
  212. package/dist/chunk-mm5p3tvh.js +0 -117
  213. package/dist/chunk-qv2zapxa.js +0 -10
  214. package/dist/chunk-sp77zwpn.js.map +0 -10
  215. /package/dist/{chunk-thbs63gy.js.map → chunk-05k9gmr9.js.map} +0 -0
  216. /package/dist/{chunk-8hfyscnn.js.map → chunk-f1my4jah.js.map} +0 -0
  217. /package/dist/{chunk-hgpvfhtp.js.map → chunk-g3m7t5zc.js.map} +0 -0
  218. /package/dist/{chunk-777v6242.js.map → chunk-qfqn7rz8.js.map} +0 -0
  219. /package/dist/{chunk-wt1yzzbw.js.map → chunk-r5wtc9fw.js.map} +0 -0
  220. /package/dist/{chunk-3rp908gn.js.map → chunk-srvsz7vm.js.map} +0 -0
@@ -5,6 +5,6 @@
5
5
  "import { ormSupports } from \"../orm/dialect\";\nimport { ServiceProvider } from \"../support/ServiceProvider\";\nimport { withDefaults } from \"../support/withDefaults\";\nimport { databaseConfigDefaults, type DatabaseConfig } from \"./config\";\nimport { DatabaseManager } from \"./DatabaseManager\";\n\nexport class DatabaseServiceProvider extends ServiceProvider {\n register() {\n this.app.singleton(\n DatabaseManager,\n () => {\n const database = new DatabaseManager(\n withDefaults(\n databaseConfigDefaults(),\n this.app.config.get<DatabaseConfig>(\"database\", {}),\n ),\n );\n\n warnIfOrmUnavailable(database);\n return database;\n },\n );\n }\n\n /**\n * Closes every connection's pool. Registered early, so it runs late: after\n * the queue and the scheduler have waited for their jobs, which still need\n * it. Bun's `close()` lets a query already sent finish.\n *\n * On the way out of a production server this only tidies up before the\n * exit. Under `gemi dev` it is the whole point: a `bun --hot` reload boots\n * a new application with a new pool, and the replaced one's is closed here\n * rather than left holding its connections for the life of the process\n * (#652).\n */\n async shutdown() {\n // Resolving the manager now would open a pool only to close it.\n if (!this.app.resolved(DatabaseManager)) return;\n await this.app.make(DatabaseManager).close();\n }\n}\n\n/**\n * Say it at boot, not on the first model query.\n *\n * `DatabaseManager` connects to MySQL and MariaDB without complaint — Bun's\n * client speaks them — and the ORM's compiler has no dialect for either. So a\n * deploy pointed at one starts, passes a health check, serves whatever does not\n * touch a model, and raises `UnsupportedDialectError` on the first `findMany`.\n * That is the latest and most expensive moment to learn it.\n *\n * A **warning rather than a throw**, deliberately: raw SQL through `DB.query`\n * and `DB.sql` genuinely works on those dialects, and so do transactions.\n * Refusing to construct the manager would break code that is correct today to\n * pre-empt an error the ORM already raises clearly. The supported set is a\n * property of the query compiler, not of the connection.\n *\n * Development only, for the same reason the slow-transaction warning is: it is\n * a diagnostic aimed at whoever is choosing the database, and it should not\n * add noise to a production log every time the container starts.\n */\nfunction warnIfOrmUnavailable(database: DatabaseManager): void {\n if (process.env.NODE_ENV !== \"development\") return;\n\n // Every connection, not only the default one. A named connection is a whole\n // pool an application will run model queries on — `Model.on(\"analytics\")` —\n // so it can be pointed at MySQL exactly as the default can, and warning about\n // only one of them would make the check pass while the query that raises is\n // on the other.\n for (const name of database.connectionNames) {\n const connection = database.connection(name);\n if (ormSupports(connection.dialect)) continue;\n\n const source =\n name === database.name\n ? \"DATABASE_URL\"\n : `The \"${name}\" database connection`;\n\n console.warn(\n `[gemi] ${source} points at ${connection.dialect}, which the gemi ORM ` +\n `does not implement — only sqlite and postgres are. The connection ` +\n `works, so raw SQL through DB.query / DB.sql and transactions are ` +\n `fine, but every model operation will raise ` +\n `UnsupportedDialectError.\\n(development only)`,\n );\n }\n}\n"
6
6
  ],
7
7
  "mappings": ";8LAMO,AAAM,IAAgC,LAAgB,CAC3D,QAAQ,EAAG,CACT,KAAK,IAAI,UACP,EACA,IAAM,CACJ,IAAM,EAAW,IAAI,EACnB,EACE,EAAuB,EACvB,KAAK,IAAI,OAAO,IAAoB,WAAY,CAAC,CAAC,CACpD,CACF,EAGA,OADA,EAAqB,CAAQ,EACtB,EAEX,OAcI,SAAQ,EAAG,CAEf,GAAI,CAAC,KAAK,IAAI,SAAS,CAAe,EAAG,OACzC,MAAM,KAAK,IAAI,KAAK,CAAe,EAAE,MAAM,EAE/C,CAqBA,SAAS,CAAoB,CAAC,EAAiC,CAC7D,GAAI,mBAAyB,cAAe,OAO5C,QAAW,KAAQ,EAAS,gBAAiB,CAC3C,IAAM,EAAa,EAAS,WAAW,CAAI,EAC3C,GAAI,EAAY,EAAW,OAAO,EAAG,SAErC,IAAM,EACJ,IAAS,EAAS,KACd,eACA,QAAQ,yBAEd,QAAQ,KACN,UAAU,eAAoB,EAAW,+BACvC,0EACA;AAAA,mBAGJ",
8
- "debugId": "A5022175C791EAF164756E2164756E21",
8
+ "debugId": "29C3F8D1B9BABF7864756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -1,5 +1,5 @@
1
1
  // @bun
2
- import{va as B,wa as C,ya as E}from"./chunk-mvd4mc8p.js";import{Hk as x,Jk as z,Kk as A}from"./chunk-978pc27j.js";function M(b,f={}){let j=B(b,f.sourceLocale);return G(E(b),j,(q)=>C(b,q,j))}function N(b,f){let j=Object.keys(f);return G(b,j,(q)=>{let v=f[q]??f[j[0]];if(!v)return{};return v().then((k)=>k.default)})}function G(b,f,j){let q={id:b,locales:f,load:j};x(q);let v=()=>x(q);return{id:b,locales:f,load:(k)=>{return v(),z(b,k)},loadForRender:(k)=>{return v(),A(b,k)},get:(k)=>{v();let w=z(b,k);if(w instanceof Promise){w.catch(()=>{});return}return w}}}
2
+ import{va as B,wa as C,ya as E}from"./chunk-mvd4mc8p.js";import{Ik as x,Kk as z,Lk as A}from"./chunk-9bcsfce4.js";function M(b,f={}){let j=B(b,f.sourceLocale);return G(E(b),j,(q)=>C(b,q,j))}function N(b,f){let j=Object.keys(f);return G(b,j,(q)=>{let v=f[q]??f[j[0]];if(!v)return{};return v().then((k)=>k.default)})}function G(b,f,j){let q={id:b,locales:f,load:j};x(q);let v=()=>x(q);return{id:b,locales:f,load:(k)=>{return v(),z(b,k)},loadForRender:(k)=>{return v(),A(b,k)},get:(k)=>{v();let w=z(b,k);if(w instanceof Promise){w.catch(()=>{});return}return w}}}
3
3
  export{M as da,N as ea};
4
4
 
5
- //# debugId=2046FAABD0D46A9A64756E2164756E21
5
+ //# debugId=0DA37F81E7A11D6664756E2164756E21
@@ -5,6 +5,6 @@
5
5
  "import {\n dictionaryId,\n dictionaryLocales,\n localeStrings,\n type DictionaryTranslations,\n type LocaleStrings,\n} from \"./dictionaryShape\";\nimport {\n loadDictionary,\n loadDictionaryForRender,\n registerDictionary,\n type RenderThenable,\n} from \"./dictionaryRegistry\";\n\ndeclare const brand: unique symbol;\n\nexport interface DictionaryHandle<\n T extends DictionaryTranslations = DictionaryTranslations,\n> {\n readonly id: string;\n /** Locales this dictionary declares, source language first. */\n readonly locales: readonly string[];\n /**\n * Strings for `locale`. Synchronous when they are already in memory —\n * always, for an unbundled dictionary; after a preload or the SSR seed, for a\n * bundled one.\n */\n load(locale: string): LocaleStrings | Promise<LocaleStrings>;\n /**\n * `load`, but as the exact thing React's `use()` wants: never rejecting, so\n * a failed locale chunk degrades the component to rendering keys instead of\n * unmounting it into an error boundary; and always a thenable, even when the\n * strings are already in memory. The caller skips `use()` only for a\n * thenable built from strings already in hand, which carries them as\n * `inHand`; every thenable a render could have suspended on still goes\n * through it. `loadDictionaryForRender` has the whole reasoning.\n */\n loadForRender(locale: string): RenderThenable;\n get(locale: string): LocaleStrings | undefined;\n /** Type-only: carries the literal's shape through to `useDictionary`. */\n readonly [brand]?: T;\n}\n\n/**\n * Declare the strings a component needs, next to the component.\n *\n * ```ts\n * export const homeDict = defineDictionary({\n * title: { \"en-US\": \"Welcome {{name}}\", \"tr-TR\": \"Hoş geldin {{name}}\" },\n * });\n * ```\n *\n * As written this holds every locale. Under gemi's Vite plugin the call is\n * rewritten so each locale becomes its own chunk and a page downloads only the\n * one it renders in — but the plugin is strictly an optimization, and the\n * behaviour is identical without it (in `bun test`, and in server code that\n * does not go through the bundler).\n *\n * The first locale in the literal is the source language: a key missing from\n * another locale falls back to it rather than rendering as its own key.\n */\nexport interface DefineDictionaryOptions {\n /**\n * The locale this dictionary is authored in. Keys missing from another locale\n * fall back to it, and it is what renders when the app has no locale\n * configured.\n *\n * Optional, but worth setting on any dictionary that is not uniformly\n * translated: without it the source language is whichever locale appears\n * first in the literal, so adding a key at the top can re-point every\n * fallback in the dictionary.\n */\n sourceLocale?: string;\n}\n\nexport function defineDictionary<const T extends DictionaryTranslations>(\n translations: T,\n options: DefineDictionaryOptions = {},\n): DictionaryHandle<T> {\n const locales = dictionaryLocales(translations, options.sourceLocale);\n return createHandle(dictionaryId(translations), locales, (locale) =>\n localeStrings(translations, locale, locales),\n );\n}\n\n/**\n * The rewritten form of a `defineDictionary` call — emitted by\n * `packages/gemi/vite/dictionaryPlugin.ts`, never written by hand. `loaders`\n * holds one dynamic import per locale so the bundler emits one chunk per\n * locale and the untaken ones never reach the browser.\n */\nexport function __gemi_dict__<\n const T extends DictionaryTranslations = DictionaryTranslations,\n>(\n id: string,\n loaders: Record<string, () => Promise<{ default: LocaleStrings }>>,\n): DictionaryHandle<T> {\n const locales = Object.keys(loaders);\n return createHandle(id, locales, (locale) => {\n // An unknown locale falls back to the source language, matching what\n // `localeStrings` does per key on the unbundled path.\n const load = loaders[locale] ?? loaders[locales[0]];\n if (!load) {\n return {};\n }\n return load().then((mod) => mod.default);\n });\n}\n\nfunction createHandle<T extends DictionaryTranslations>(\n id: string,\n locales: string[],\n load: (locale: string) => LocaleStrings | Promise<LocaleStrings>,\n): DictionaryHandle<T> {\n const entry = { id, locales, load };\n registerDictionary(entry);\n\n // Re-asserted on every read rather than only at construction. A handle is\n // created once, at module scope, but the registry it delegates to can be\n // emptied under it — a test's `afterEach` reset, an HMR boundary — and the\n // handle would then be permanently orphaned, throwing \"Unknown dictionary\"\n // for a dictionary the caller is holding. `registerDictionary` is a no-op\n // when the id is already there, so this costs one Map lookup.\n const ensure = () => registerDictionary(entry);\n\n return {\n id,\n locales,\n // Routed through the registry rather than calling `load` directly so\n // concurrent readers share one in-flight import and results are cached.\n load: (locale: string) => {\n ensure();\n return loadDictionary(id, locale);\n },\n loadForRender: (locale: string) => {\n ensure();\n return loadDictionaryForRender(id, locale);\n },\n get: (locale: string) => {\n ensure();\n const strings = loadDictionary(id, locale);\n if (strings instanceof Promise) {\n // Nothing downstream awaits this one — `get` is the synchronous peek,\n // and the caller is about to discard it. An unattached rejection (a\n // locale chunk that 404s mid-deploy) would surface as an\n // `unhandledRejection`, which under Node's default handler takes the\n // process down over one missing translation file. The load itself is\n // still cached and still retried through `loadDictionary`.\n strings.catch(() => {});\n return undefined;\n }\n return strings;\n },\n };\n}\n\n"
6
6
  ],
7
7
  "mappings": ";wHA2EO,GAAS,CAAwD,CACtE,EACA,EAAmC,CAAC,EACf,CACrB,IAAM,EAAU,EAAkB,EAAc,EAAQ,YAAY,EACpE,OAAO,EAAa,EAAa,CAAY,EAAG,EAAS,CAAC,IACxD,EAAc,EAAc,EAAQ,CAAO,CAC7C,EASK,SAAS,CAEf,CACC,EACA,EACqB,CACrB,IAAM,EAAU,OAAO,KAAK,CAAO,EACnC,OAAO,EAAa,EAAI,EAAS,CAAC,IAAW,CAG3C,IAAM,EAAO,EAAQ,IAAW,EAAQ,EAAQ,IAChD,GAAI,CAAC,EACH,MAAO,CAAC,EAEV,OAAO,EAAK,EAAE,KAAK,CAAC,IAAQ,EAAI,OAAO,EACxC,EAGH,SAAS,CAA8C,CACrD,EACA,EACA,EACqB,CACrB,IAAM,EAAQ,CAAE,KAAI,UAAS,MAAK,EAClC,EAAmB,CAAK,EAQxB,IAAM,EAAS,IAAM,EAAmB,CAAK,EAE7C,MAAO,CACL,KACA,UAGA,KAAM,CAAC,IAAmB,CAExB,OADA,EAAO,EACA,EAAe,EAAI,CAAM,GAElC,cAAe,CAAC,IAAmB,CAEjC,OADA,EAAO,EACA,EAAwB,EAAI,CAAM,GAE3C,IAAK,CAAC,IAAmB,CACvB,EAAO,EACP,IAAM,EAAU,EAAe,EAAI,CAAM,EACzC,GAAI,aAAmB,QAAS,CAO9B,EAAQ,MAAM,IAAM,EAAE,EACtB,OAEF,OAAO,EAEX",
8
- "debugId": "2046FAABD0D46A9A64756E2164756E21",
8
+ "debugId": "0DA37F81E7A11D6664756E2164756E21",
9
9
  "names": []
10
10
  }