@pikku/cli 0.12.152 → 0.12.154

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 (274) hide show
  1. package/console-app/assets/{HelpPanel-CxjgE40i.js → HelpPanel-BPFBvwZj.js} +1 -1
  2. package/console-app/assets/{abnfDiagram-VCTEODGH-UPW1PlxM.js → abnfDiagram-VCTEODGH-DDuocZ0S.js} +1 -1
  3. package/console-app/assets/architecture-7GRP2DOG-ClxOnHTX.js +1 -0
  4. package/console-app/assets/{architectureDiagram-5GKGNRK7-B3XFrvZk.js → architectureDiagram-5GKGNRK7-bFIt59Dq.js} +1 -1
  5. package/console-app/assets/{blockDiagram-I7D4REHJ-Ca0v9UJQ.js → blockDiagram-I7D4REHJ-Bge8309x.js} +1 -1
  6. package/console-app/assets/{c4Diagram-7LVT6UL2-CLewVsj_.js → c4Diagram-7LVT6UL2-BdJOmC5x.js} +1 -1
  7. package/console-app/assets/channel-c0xM4cPi.js +1 -0
  8. package/console-app/assets/{chunk-4HAMMTFA-BwhbhOD9.js → chunk-4HAMMTFA-Cenx-5I1.js} +1 -1
  9. package/console-app/assets/{chunk-75Z2AOVW-C7nAgNk0.js → chunk-75Z2AOVW-CAGQ08f_.js} +1 -1
  10. package/console-app/assets/{chunk-DU6HZSFF-D4yYAcHt.js → chunk-DU6HZSFF-Bhji7Bhy.js} +1 -1
  11. package/console-app/assets/{chunk-F27PBJKO-UHllOPps.js → chunk-F27PBJKO-D7gTX3dk.js} +1 -1
  12. package/console-app/assets/{chunk-GMAD6QVW-C0l_vm7T.js → chunk-GMAD6QVW-DkRx7Brv.js} +1 -1
  13. package/console-app/assets/{chunk-GVQU2GXP-h-H2Oird.js → chunk-GVQU2GXP-DEWdO9pP.js} +1 -1
  14. package/console-app/assets/{chunk-IMKFNOWR-DJ_W9CSg.js → chunk-IMKFNOWR-C1Vtain1.js} +1 -1
  15. package/console-app/assets/{chunk-L3NEJ4N5-Ce9oniwE.js → chunk-L3NEJ4N5-B_nm0es0.js} +1 -1
  16. package/console-app/assets/{chunk-OSK3NFVY-CdGE5qxS.js → chunk-OSK3NFVY-C0EPlVq0.js} +1 -1
  17. package/console-app/assets/{chunk-P2QGCYS3-DK1pHDdz.js → chunk-P2QGCYS3-qs_HwIoO.js} +1 -1
  18. package/console-app/assets/{chunk-POPQ4Y6H-DjevEFNo.js → chunk-POPQ4Y6H-CJWbAVy_.js} +1 -1
  19. package/console-app/assets/{chunk-PWAF6VOD-BVF5N1No.js → chunk-PWAF6VOD-CmyETkG4.js} +1 -1
  20. package/console-app/assets/{chunk-SHT3W25Y-BX8We-wN.js → chunk-SHT3W25Y-Coqn0qc9.js} +1 -1
  21. package/console-app/assets/{chunk-SVP7TREG-Cl0GgAPC.js → chunk-SVP7TREG-D1E3L3Ry.js} +1 -1
  22. package/console-app/assets/{chunk-TICWLB2K-IWZAWDhu.js → chunk-TICWLB2K-bsfeT6VF.js} +1 -1
  23. package/console-app/assets/chunk-XXDRQBXY-BkM8vXTQ.js +1 -0
  24. package/console-app/assets/classDiagram-ZZMXUADV-yCAU184A.js +1 -0
  25. package/console-app/assets/classDiagram-v2-VYDZK3BY-yCAU184A.js +1 -0
  26. package/console-app/assets/{cose-bilkent-JH36ORCC-GsQ0JAnL.js → cose-bilkent-JH36ORCC-H5-jGbyx.js} +1 -1
  27. package/console-app/assets/{cynefin-OW5HDTMX-hZsAZp_5.js → cynefin-OW5HDTMX-CljdWyve.js} +1 -1
  28. package/console-app/assets/{cynefinDiagram-5FMLGOSQ-CsyMovx1.js → cynefinDiagram-5FMLGOSQ-DmDd9Ruh.js} +1 -1
  29. package/console-app/assets/{dagre-BP8XEFz-.js → dagre-ChLSY7zR.js} +1 -1
  30. package/console-app/assets/{dagre-GXQ25YYZ-Jg5285rx.js → dagre-GXQ25YYZ-DT48xQuH.js} +1 -1
  31. package/console-app/assets/{diagram-S7CK7UJ4-n9JiR8HK.js → diagram-S7CK7UJ4-DKPk5LKU.js} +1 -1
  32. package/console-app/assets/{diagram-UQ7AKVKN-Cde-dgbI.js → diagram-UQ7AKVKN-BWnhjDbO.js} +1 -1
  33. package/console-app/assets/{diagram-VSXAHHWV-CPZUg4FP.js → diagram-VSXAHHWV-1XCGd7TX.js} +1 -1
  34. package/console-app/assets/{diagram-VX7I27RA-B2rCDWvn.js → diagram-VX7I27RA-8dIoEZIX.js} +1 -1
  35. package/console-app/assets/{diagram-Z3DM3KII-UwO0hte3.js → diagram-Z3DM3KII-CgFhlsHg.js} +1 -1
  36. package/console-app/assets/{ebnfDiagram-PWID7BFC-BGJ_PBlS.js → ebnfDiagram-PWID7BFC-j8nbgcPz.js} +1 -1
  37. package/console-app/assets/{erDiagram-RLTQ6QDP-CKsTScr3.js → erDiagram-RLTQ6QDP-fQNmZd6-.js} +1 -1
  38. package/console-app/assets/eventmodeling-NTZA5JFV-bHToGR6p.js +1 -0
  39. package/console-app/assets/flowDiagram-HODETNUW-Dd1RiDsS.js +1 -0
  40. package/console-app/assets/{ganttDiagram-EL5Y4UJY-koeTkIEA.js → ganttDiagram-EL5Y4UJY-D8pzapyN.js} +1 -1
  41. package/console-app/assets/{gitGraph-4MIJSDKK-DyRPbcM4.js → gitGraph-4MIJSDKK-BvRsGeLo.js} +1 -1
  42. package/console-app/assets/{gitGraphDiagram-WWUBYQGX-DSIejrYw.js → gitGraphDiagram-WWUBYQGX-C_qwjJL5.js} +1 -1
  43. package/console-app/assets/{graphlib-BpQ_697T.js → graphlib-9R2fmYel.js} +1 -1
  44. package/console-app/assets/{index-Du9_fRSw.js → index-DMQFSpKy.js} +147 -147
  45. package/console-app/assets/{info-A6RAGUB7-C63f9an_.js → info-A6RAGUB7-BIjzE3Zr.js} +1 -1
  46. package/console-app/assets/{infoDiagram-27XIBGKW-Dz5gMcUF.js → infoDiagram-27XIBGKW-DbFqdvGy.js} +1 -1
  47. package/console-app/assets/{ishikawaDiagram-5VMMS53U-m-nTAZTH.js → ishikawaDiagram-5VMMS53U-D5ei52Uz.js} +1 -1
  48. package/console-app/assets/{journeyDiagram-3NMN7TZE-C7mjFY7i.js → journeyDiagram-3NMN7TZE-DOVQGQxF.js} +1 -1
  49. package/console-app/assets/{kanban-definition-UXKFOSKX-Cm7PqOOP.js → kanban-definition-UXKFOSKX-D8cjrKvj.js} +1 -1
  50. package/console-app/assets/{line-RZNRGurC.js → line-S23S00r8.js} +1 -1
  51. package/console-app/assets/{linear-C2IGWMlF.js → linear-C2q7Mgrm.js} +1 -1
  52. package/console-app/assets/{mermaid-parser.core-DN1yDqgB.js → mermaid-parser.core-DFVvyiUd.js} +3 -3
  53. package/console-app/assets/{mermaid.core-DDRs3TbC.js → mermaid.core-C85pnBPI.js} +4 -4
  54. package/console-app/assets/{mindmap-definition-YA3MSWOX-o6riOwlF.js → mindmap-definition-YA3MSWOX-Bqn28yl9.js} +1 -1
  55. package/console-app/assets/{packet-AYTQ26CC-B89F6gXG.js → packet-AYTQ26CC-Cj1kD_Xa.js} +1 -1
  56. package/console-app/assets/{pegDiagram-XKGWAZYB-BQ1AAIaV.js → pegDiagram-XKGWAZYB-DJ12pyU4.js} +1 -1
  57. package/console-app/assets/{pie-WAS4IAKB-CzuwQlQz.js → pie-WAS4IAKB-BUmyuH7f.js} +1 -1
  58. package/console-app/assets/{pieDiagram-E7YTZNPT-DlcGHWGT.js → pieDiagram-E7YTZNPT-jTvMRCtY.js} +1 -1
  59. package/console-app/assets/{quadrantDiagram-AXDQQJYC-DdITwqw-.js → quadrantDiagram-AXDQQJYC-D826kpcV.js} +1 -1
  60. package/console-app/assets/{radar-RG4KPBEZ-DlJ29jAN.js → radar-RG4KPBEZ-CYbTAeXH.js} +1 -1
  61. package/console-app/assets/{railroad-74A4TZTK-BL49fdM8.js → railroad-74A4TZTK-mfMkjDWk.js} +1 -1
  62. package/console-app/assets/railroad-abnf-HS5TGJTU-nuNyByRg.js +1 -0
  63. package/console-app/assets/railroad-ebnf-LZEXJU2U-BztHKlS5.js +1 -0
  64. package/console-app/assets/railroad-peg-WCYAUIDC-Bw7jp-js.js +1 -0
  65. package/console-app/assets/{railroadDiagram-O6MQD6OU-BNgQGtF5.js → railroadDiagram-O6MQD6OU-CGlOEAk5.js} +1 -1
  66. package/console-app/assets/{requirementDiagram-BXWQKSXE-48lE_WeD.js → requirementDiagram-BXWQKSXE-DY_zQ4Qu.js} +1 -1
  67. package/console-app/assets/{sankeyDiagram-P5KCCOFB-WmTardCP.js → sankeyDiagram-P5KCCOFB-B4QJZukx.js} +1 -1
  68. package/console-app/assets/{sequenceDiagram-WJ2MYXX4-Bd5cHDMs.js → sequenceDiagram-WJ2MYXX4-DTERMwcf.js} +1 -1
  69. package/console-app/assets/{src-BTXg_NtK.js → src-CRoiE_Pf.js} +1 -1
  70. package/console-app/assets/{stateDiagram-D77RDMKH-DBoCkqGv.js → stateDiagram-D77RDMKH-BLnCP1RM.js} +1 -1
  71. package/console-app/assets/stateDiagram-v2-MP3YSRHH-Bv8nfhYK.js +1 -0
  72. package/console-app/assets/{swimlanes-42K2YHIH-lecUPBaK.js → swimlanes-42K2YHIH-CwYZgjxi.js} +1 -1
  73. package/console-app/assets/swimlanesDiagram-VR7AAH4N-BtAfsGDG.js +8 -0
  74. package/console-app/assets/{timeline-definition-24CTP7MA-CWq0OWm1.js → timeline-definition-24CTP7MA-BEv4uhRy.js} +1 -1
  75. package/console-app/assets/{treeView-Q6P3EWNA-C7lEeqUz.js → treeView-Q6P3EWNA-CHhQVPzu.js} +1 -1
  76. package/console-app/assets/{treemap-WGGIJYW6-Bkx2DAoI.js → treemap-WGGIJYW6-DSnq4EZT.js} +1 -1
  77. package/console-app/assets/{vennDiagram-4TSXK5OY-Bw_kGRL3.js → vennDiagram-4TSXK5OY-CHT6P8GK.js} +1 -1
  78. package/console-app/assets/{wardley-WFR3VGLG-V0zki2L0.js → wardley-WFR3VGLG-yPMtiazL.js} +1 -1
  79. package/console-app/assets/{wardleyDiagram-VM6X3IG4-C5vrwEHM.js → wardleyDiagram-VM6X3IG4-Df2U4u0X.js} +1 -1
  80. package/console-app/assets/{xychartDiagram-S5SC5T6Z-B9uA0moC.js → xychartDiagram-S5SC5T6Z-D4bRAEWS.js} +1 -1
  81. package/console-app/index.html +1 -1
  82. package/dist/.pikku/addon/index.d.ts +1 -1
  83. package/dist/.pikku/addon/index.js +1 -1
  84. package/dist/.pikku/addon/pikku-addon-types.gen.d.ts +1 -1
  85. package/dist/.pikku/addon/pikku-addon-types.gen.js +1 -1
  86. package/dist/.pikku/agent/index.d.ts +1 -1
  87. package/dist/.pikku/agent/index.js +1 -1
  88. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
  89. package/dist/.pikku/agent/pikku-model-aliases.gen.js +1 -1
  90. package/dist/.pikku/analytics/index.d.ts +1 -1
  91. package/dist/.pikku/analytics/index.js +1 -1
  92. package/dist/.pikku/analytics/pikku-analytics-types.gen.d.ts +1 -1
  93. package/dist/.pikku/analytics/pikku-analytics-types.gen.js +1 -1
  94. package/dist/.pikku/auth/index.d.ts +1 -1
  95. package/dist/.pikku/auth/index.js +1 -1
  96. package/dist/.pikku/auth/pikku-auth-types.gen.d.ts +1 -1
  97. package/dist/.pikku/auth/pikku-auth-types.gen.js +1 -1
  98. package/dist/.pikku/channel/index.d.ts +1 -1
  99. package/dist/.pikku/channel/index.js +1 -1
  100. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +1 -1
  101. package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
  102. package/dist/.pikku/cli/index.d.ts +1 -1
  103. package/dist/.pikku/cli/index.js +1 -1
  104. package/dist/.pikku/cli/pikku-cli-channel.js +16 -1
  105. package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +1 -1
  106. package/dist/.pikku/cli/pikku-cli-client.gen.js +1 -1
  107. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.d.ts +1 -1
  108. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.js +1 -1
  109. package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
  110. package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
  111. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +1 -1
  112. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +56 -0
  113. package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
  114. package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
  115. package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
  116. package/dist/.pikku/cli/pikku-cli.gen.js +1 -1
  117. package/dist/.pikku/error/index.d.ts +1 -1
  118. package/dist/.pikku/error/index.js +1 -1
  119. package/dist/.pikku/error/pikku-error-types.gen.d.ts +1 -1
  120. package/dist/.pikku/error/pikku-error-types.gen.js +1 -1
  121. package/dist/.pikku/function/index.d.ts +1 -1
  122. package/dist/.pikku/function/index.js +1 -1
  123. package/dist/.pikku/function/pikku-function-types.gen.d.ts +1 -1
  124. package/dist/.pikku/function/pikku-function-types.gen.js +1 -1
  125. package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
  126. package/dist/.pikku/function/pikku-functions-meta.gen.json +61 -4
  127. package/dist/.pikku/function/pikku-functions.gen.js +1 -1
  128. package/dist/.pikku/gateway/index.d.ts +1 -1
  129. package/dist/.pikku/gateway/index.js +1 -1
  130. package/dist/.pikku/gateway/pikku-gateway-types.gen.d.ts +1 -1
  131. package/dist/.pikku/gateway/pikku-gateway-types.gen.js +1 -1
  132. package/dist/.pikku/http/index.d.ts +1 -1
  133. package/dist/.pikku/http/index.js +1 -1
  134. package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
  135. package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
  136. package/dist/.pikku/mcp/index.d.ts +1 -1
  137. package/dist/.pikku/mcp/index.js +1 -1
  138. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
  139. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
  140. package/dist/.pikku/middleware/index.d.ts +1 -1
  141. package/dist/.pikku/middleware/index.js +1 -1
  142. package/dist/.pikku/middleware/pikku-middleware-types.gen.d.ts +1 -1
  143. package/dist/.pikku/middleware/pikku-middleware-types.gen.js +1 -1
  144. package/dist/.pikku/pikku-bootstrap-scenarios.gen.d.ts +1 -1
  145. package/dist/.pikku/pikku-bootstrap-scenarios.gen.js +1 -1
  146. package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -1
  147. package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
  148. package/dist/.pikku/pikku-services.gen.d.ts +1 -1
  149. package/dist/.pikku/queue/index.d.ts +1 -1
  150. package/dist/.pikku/queue/index.js +1 -1
  151. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
  152. package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
  153. package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +1 -1
  154. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
  155. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
  156. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
  157. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +3 -0
  158. package/dist/.pikku/scenarios/index.d.ts +1 -1
  159. package/dist/.pikku/scenarios/index.js +1 -1
  160. package/dist/.pikku/scenarios/pikku-personas.gen.js +1 -1
  161. package/dist/.pikku/scenarios/pikku-scenario-functions-meta.gen.js +1 -1
  162. package/dist/.pikku/scenarios/pikku-scenario-functions.gen.d.ts +1 -1
  163. package/dist/.pikku/scenarios/pikku-scenario-types.gen.d.ts +1 -1
  164. package/dist/.pikku/scenarios/pikku-scenario-wirings-meta.gen.js +1 -1
  165. package/dist/.pikku/scenarios/pikku-scenario-wirings.gen.d.ts +1 -1
  166. package/dist/.pikku/scenarios/schemas/register.gen.d.ts +1 -1
  167. package/dist/.pikku/scenarios/schemas/register.gen.js +1 -1
  168. package/dist/.pikku/scheduler/index.d.ts +1 -1
  169. package/dist/.pikku/scheduler/index.js +1 -1
  170. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
  171. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
  172. package/dist/.pikku/schemas/register.gen.js +13 -1
  173. package/dist/.pikku/schemas/schemas/ExamplesAddInput.schema.json +1 -0
  174. package/dist/.pikku/schemas/schemas/ExamplesAddOutput.schema.json +1 -0
  175. package/dist/.pikku/schemas/schemas/ExamplesListInput.schema.json +1 -0
  176. package/dist/.pikku/schemas/schemas/ExamplesListOutput.schema.json +1 -0
  177. package/dist/.pikku/schemas/schemas/ExamplesShowInput.schema.json +1 -0
  178. package/dist/.pikku/schemas/schemas/ExamplesShowOutput.schema.json +1 -0
  179. package/dist/.pikku/scopes/index.d.ts +1 -1
  180. package/dist/.pikku/scopes/index.js +1 -1
  181. package/dist/.pikku/scopes/pikku-flags.gen.d.ts +1 -1
  182. package/dist/.pikku/scopes/pikku-personas.gen.js +1 -1
  183. package/dist/.pikku/scopes/pikku-roles.gen.d.ts +1 -1
  184. package/dist/.pikku/scopes/pikku-scope-types.gen.d.ts +1 -1
  185. package/dist/.pikku/scopes/pikku-scope-types.gen.js +1 -1
  186. package/dist/.pikku/scopes/pikku-scopes.gen.d.ts +1 -1
  187. package/dist/.pikku/secrets/index.d.ts +1 -1
  188. package/dist/.pikku/secrets/index.js +1 -1
  189. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
  190. package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
  191. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
  192. package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
  193. package/dist/.pikku/services/pikku-meta-service.gen.d.ts +1 -1
  194. package/dist/.pikku/services/pikku-meta-service.gen.js +1 -1
  195. package/dist/.pikku/setup/index.d.ts +1 -1
  196. package/dist/.pikku/setup/index.js +1 -1
  197. package/dist/.pikku/setup/pikku-setup-types.gen.d.ts +1 -1
  198. package/dist/.pikku/setup/pikku-setup-types.gen.js +1 -1
  199. package/dist/.pikku/trigger/index.d.ts +1 -1
  200. package/dist/.pikku/trigger/index.js +1 -1
  201. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
  202. package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
  203. package/dist/.pikku/variables/index.d.ts +1 -1
  204. package/dist/.pikku/variables/index.js +1 -1
  205. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
  206. package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
  207. package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
  208. package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
  209. package/dist/.pikku/workflow/index.d.ts +1 -1
  210. package/dist/.pikku/workflow/index.js +1 -1
  211. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +1 -1
  212. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
  213. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
  214. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
  215. package/dist/bin/pikku-bin.mjs +2 -2
  216. package/dist/src/cli.wiring.js +51 -0
  217. package/dist/src/deploy/build-pipeline.d.ts +43 -0
  218. package/dist/src/deploy/build-pipeline.js +79 -30
  219. package/dist/src/examples.gen.d.ts +17 -0
  220. package/dist/src/examples.gen.js +7 -0
  221. package/dist/src/fabric/functions/validate.function.d.ts +34 -0
  222. package/dist/src/fabric/functions/validate.function.js +118 -0
  223. package/dist/src/fabric/lib/config.d.ts +1 -0
  224. package/dist/src/fabric/lib/config.js +1 -1
  225. package/dist/src/fabric/lib/report-environment.d.ts +5 -4
  226. package/dist/src/fabric/lib/report-environment.js +18 -4
  227. package/dist/src/functions/commands/deploy-apply.js +1 -0
  228. package/dist/src/functions/commands/deploy-plan.js +1 -0
  229. package/dist/src/functions/commands/dev-address.d.ts +27 -0
  230. package/dist/src/functions/commands/dev-address.js +45 -0
  231. package/dist/src/functions/commands/dev.js +6 -0
  232. package/dist/src/functions/commands/environment.d.ts +8 -0
  233. package/dist/src/functions/commands/environment.js +15 -0
  234. package/dist/src/functions/commands/examples.d.ts +170 -0
  235. package/dist/src/functions/commands/examples.js +28 -0
  236. package/dist/src/functions/commands/scenario.js +356 -273
  237. package/dist/src/functions/db/local-db.d.ts +12 -0
  238. package/dist/src/functions/db/local-db.js +1 -1
  239. package/dist/src/functions/db/postgres/scenario-baseline.d.ts +3 -0
  240. package/dist/src/functions/db/postgres/scenario-baseline.js +112 -0
  241. package/dist/src/functions/db/scenario-baseline.d.ts +51 -0
  242. package/dist/src/functions/db/scenario-baseline.js +60 -0
  243. package/dist/src/functions/db/sqlite/scenario-baseline.d.ts +3 -0
  244. package/dist/src/functions/db/sqlite/scenario-baseline.js +82 -0
  245. package/dist/src/functions/examples/command-schemas.d.ts +69 -0
  246. package/dist/src/functions/examples/command-schemas.js +15 -0
  247. package/dist/src/functions/examples/corpus.d.ts +115 -0
  248. package/dist/src/functions/examples/corpus.js +307 -0
  249. package/dist/src/functions/examples/project.d.ts +64 -0
  250. package/dist/src/functions/examples/project.js +363 -0
  251. package/dist/src/functions/examples/render.d.ts +4 -0
  252. package/dist/src/functions/examples/render.js +101 -0
  253. package/dist/src/functions/examples/run.d.ts +9 -0
  254. package/dist/src/functions/examples/run.js +242 -0
  255. package/dist/src/functions/examples/schemas.d.ts +65 -0
  256. package/dist/src/functions/examples/schemas.js +76 -0
  257. package/dist/src/functions/surface/render-surface-doc.js +32 -2
  258. package/dist/tsconfig.tsbuildinfo +1 -1
  259. package/package.json +8 -7
  260. package/snippets-meta.json +2 -0
  261. package/snippets.json +2 -0
  262. package/surface.json +1 -1
  263. package/console-app/assets/architecture-7GRP2DOG-BQN972Vc.js +0 -1
  264. package/console-app/assets/channel-B8xtOmL3.js +0 -1
  265. package/console-app/assets/chunk-XXDRQBXY-CGWcS5Ol.js +0 -1
  266. package/console-app/assets/classDiagram-ZZMXUADV-OGsmOlmO.js +0 -1
  267. package/console-app/assets/classDiagram-v2-VYDZK3BY-OGsmOlmO.js +0 -1
  268. package/console-app/assets/eventmodeling-NTZA5JFV-CnZOTLz3.js +0 -1
  269. package/console-app/assets/flowDiagram-HODETNUW-TYMCrte8.js +0 -1
  270. package/console-app/assets/railroad-abnf-HS5TGJTU-D9Ej_sin.js +0 -1
  271. package/console-app/assets/railroad-ebnf-LZEXJU2U-CjzlC3qv.js +0 -1
  272. package/console-app/assets/railroad-peg-WCYAUIDC-BPa6lIrj.js +0 -1
  273. package/console-app/assets/stateDiagram-v2-MP3YSRHH-BLbaZawL.js +0 -1
  274. package/console-app/assets/swimlanesDiagram-VR7AAH4N-CM_5HS_7.js +0 -8
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/scopes` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  /**
5
5
  * This file was generated by the @pikku/cli
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  /**
5
5
  * This file was generated by the @pikku/cli
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  /**
5
5
  * This file was generated by the @pikku/cli
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  export { defineScope } from '@pikku/core/scope';
5
5
  export { defineSystemRole } from '@pikku/core/role';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  export { defineScope } from '@pikku/core/scope';
5
5
  export { defineSystemRole } from '@pikku/core/role';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  /**
5
5
  * This file was generated by the @pikku/cli
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/secrets` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/secrets` resolves here.
@@ -1,4 +1,4 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  export { defineSecret } from '@pikku/core/secret';
@@ -1,4 +1,4 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  export { defineSecret } from '@pikku/core/secret';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  import { TypedSecretService as CoreTypedSecretService } from '@pikku/core/services';
5
5
  import type { SecretService } from '@pikku/core/services';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  import { TypedSecretService as CoreTypedSecretService } from '@pikku/core/services';
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  import { LocalMetaService } from '@pikku/core/services/local-meta';
5
5
  export declare class PikkuMetaService extends LocalMetaService {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  import { LocalMetaService } from '@pikku/core/services/local-meta';
5
5
  export class PikkuMetaService extends LocalMetaService {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/setup` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/setup` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  /**
5
5
  * Config and service factory definitions, declared once per application
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  /**
5
5
  * Config and service factory definitions, declared once per application
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/trigger` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/trigger` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  /**
5
5
  * Trigger-specific type definitions for tree-shaking optimization
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  /**
5
5
  * Trigger-specific type definitions for tree-shaking optimization
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/variables` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/variables` resolves here.
@@ -1,4 +1,4 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  export { defineVariable } from '@pikku/core/variable';
@@ -1,4 +1,4 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  export { defineVariable } from '@pikku/core/variable';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  import { TypedVariablesService as CoreTypedVariablesService } from '@pikku/core/services';
5
5
  import type { VariablesService } from '@pikku/core/services';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  import { TypedVariablesService as CoreTypedVariablesService, } from '@pikku/core/services';
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/workflow` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  /**
5
5
  * Subpath entry — `#pikku/workflow` resolves here.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  import { WorkflowCancelledException } from '@pikku/core/workflow';
5
5
  import type { PikkuWorkflowGraphConfig, PikkuWorkflowGraphResult } from '@pikku/core/workflow';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  import { WorkflowCancelledException } from '@pikku/core/workflow';
5
5
  import { pikkuWorkflowGraph as corePikkuWorkflowGraph } from '@pikku/core/workflow';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  import { pikkuState } from '@pikku/core/state';
5
5
  import allWorkflowMeta from './meta/allWorkflow.gen.json' with { type: 'json' };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.152
2
+ * This file was generated by @pikku/cli@0.12.154
3
3
  */
4
4
  import { addWorkflow } from '@pikku/core/workflow';
5
5
  import './pikku-workflow-wirings-meta.gen.js';
@@ -11,8 +11,8 @@ async function checkForUpdate() {
11
11
  })
12
12
  if (!res.ok) return
13
13
  const { version: latest } = await res.json()
14
- if (latest !== '0.12.152') {
15
- process.stderr.write(`\n Update available 0.12.152 → ${latest}\n brew upgrade pikku or npm install -g @pikku/cli\n\n`)
14
+ if (latest !== '0.12.154') {
15
+ process.stderr.write(`\n Update available 0.12.154 → ${latest}\n brew upgrade pikku or npm install -g @pikku/cli\n\n`)
16
16
  }
17
17
  } catch {}
18
18
  }
@@ -33,6 +33,7 @@ import { pikkuAudit } from './functions/commands/audit.js';
33
33
  import { pikkuSemver } from './functions/commands/semver.js';
34
34
  import { renderSemver } from './functions/commands/semver-render.js';
35
35
  import { validate, renderValidate } from './functions/commands/validate.js';
36
+ import { examplesAdd, examplesList, examplesShow, renderExamplesAdd, renderExamplesList, renderExamplesShow, } from './functions/commands/examples.js';
36
37
  import { knowledgeValidate, renderKnowledgeValidate, } from './functions/commands/knowledge-validate.js';
37
38
  import { knowledgeIndex, renderKnowledgeIndex, } from './functions/commands/knowledge-index.js';
38
39
  import { knowledgeReconcile, renderKnowledgeReconcile, } from './functions/commands/knowledge-reconcile.js';
@@ -507,6 +508,56 @@ wireCLI({
507
508
  }),
508
509
  },
509
510
  },
511
+ examples: {
512
+ description: 'Worked examples of the things that are easy to get wrong and hard to discover — read one, or write it into this project already named for your own entity',
513
+ subcommands: {
514
+ list: pikkuCLICommand({
515
+ func: examplesList,
516
+ render: renderExamplesList,
517
+ description: 'List every example, with what each one is for',
518
+ options: {
519
+ group: {
520
+ description: 'Only the examples whose name starts with this, e.g. `scenario`',
521
+ short: 'g',
522
+ },
523
+ },
524
+ }),
525
+ show: pikkuCLICommand({
526
+ func: examplesShow,
527
+ render: renderExamplesShow,
528
+ description: 'Print one example, renamed onto your own entity, with everything the recipe says about itself',
529
+ options: {
530
+ name: {
531
+ description: 'Which example',
532
+ short: 'n',
533
+ },
534
+ entity: {
535
+ description: "The domain symbol to rewrite the example's own onto",
536
+ short: 'e',
537
+ },
538
+ },
539
+ }),
540
+ add: pikkuCLICommand({
541
+ func: examplesAdd,
542
+ render: renderExamplesAdd,
543
+ description: 'Write one example into this project, or say what is in the way and write nothing',
544
+ options: {
545
+ name: {
546
+ description: 'Which example',
547
+ short: 'n',
548
+ },
549
+ entity: {
550
+ description: "The domain symbol to rename the example's own onto",
551
+ short: 'e',
552
+ },
553
+ app: {
554
+ description: 'Which frontend a screen belongs to, for a project with more than one',
555
+ short: 'a',
556
+ },
557
+ },
558
+ }),
559
+ },
560
+ },
510
561
  knowledge: {
511
562
  description: 'Inspect and maintain the knowledge base — what this app is, in the language its users use',
512
563
  subcommands: {
@@ -44,6 +44,44 @@ export declare class PikkuDeployBuildFailedError extends PikkuError {
44
44
  * when every unit was generated and bundled.
45
45
  */
46
46
  export declare function describeBuildFailure(result: Pick<BuildPipelineResult, 'bundleErrors' | 'codegenErrors'>): string | null;
47
+ /**
48
+ * The database a standalone bundle has to open for itself.
49
+ *
50
+ * Every other provider deploys onto a host that supplies `kysely` — `pikku dev`
51
+ * builds one, a Cloudflare deploy binds one — so `createSingletonServices` is
52
+ * written expecting it. A standalone artifact has no host, and shipped one that
53
+ * never got a connection at all: the app booted straight into whatever its
54
+ * services factory does when the database is missing, which for the generated
55
+ * templates is a throw.
56
+ *
57
+ * Engine is resolved the way every other pikku host resolves it: `createConfig`
58
+ * first, through the same `loadUserConfigForDb` the db commands use, and the
59
+ * `db/sqlite` / `db/postgres` conventions only as the fallback. Reading the
60
+ * directory alone left an app that declares its database in config and keeps no
61
+ * migrations getting a connection under `pikku dev` and none in its artifact —
62
+ * the same crash, reached a different way. A config that cannot be loaded falls
63
+ * back to the directories rather than failing the build, because a project with
64
+ * no database at all must still bundle.
65
+ *
66
+ * Both at once is refused rather than resolved, whether the two arrive as two
67
+ * migration directories or as `sqliteDb` beside `postgresUrl`. Picking one would
68
+ * be picking which database the deployed app talks to on the strength of
69
+ * directory order, and the failure — an app running happily against the wrong,
70
+ * fully valid schema — is invisible until someone reads the data.
71
+ *
72
+ * Only the engine travels. A configured SQLite path is a developer's local file
73
+ * and has no meaning on the target host, which names its own through
74
+ * `PIKKU_DATA_DIR`.
75
+ *
76
+ * The migrations are copied in beside the bundle under the same `db/<engine>/`
77
+ * path they have in the project, which is also where Fabric's build container
78
+ * stages them. Two producers writing the artifact cannot disagree about where
79
+ * the SQL lives, and `bundle.js db migrate` finds it either way.
80
+ */
81
+ export declare function resolveStandaloneDb(projectDir: string, pikkuDir: string, unitDir: string, srcDirectories: string[], logger: BuildLogger): Promise<{
82
+ engine: 'sqlite' | 'postgres';
83
+ coercionImportPath?: string;
84
+ } | undefined>;
47
85
  export declare function runBuildPipeline(options: {
48
86
  projectDir: string;
49
87
  projectId: string;
@@ -66,6 +104,11 @@ export declare function runBuildPipeline(options: {
66
104
  };
67
105
  deployDir?: string;
68
106
  outDir?: string;
107
+ /**
108
+ * The project's source roots, for finding the `createConfig` that declares
109
+ * which database a standalone artifact has to open.
110
+ */
111
+ srcDirectories?: string[];
69
112
  /** Emit sourcemaps + per-unit `metafile.json` (debug-only). Default false. */
70
113
  debugArtifacts?: boolean;
71
114
  logger: BuildLogger;
@@ -13,6 +13,7 @@ import { withoutScenarios } from '../functions/wirings/scenarios/scenario-partit
13
13
  import { generatePerUnitCodegen } from './codegen/per-unit-codegen.js';
14
14
  import { materializeFrontend } from './frontend-assets.js';
15
15
  import { assertFrontendBuilt } from '../utils/frontend.js';
16
+ import { loadUserConfigForDb, } from '../functions/commands/db-shared.js';
16
17
  import { generateServerEntrySource, SERVER_DOCKERFILE, SERVER_DOCKERIGNORE, } from './server-entry.js';
17
18
  /**
18
19
  * A unit that failed codegen or bundling is an expected build outcome (the
@@ -61,6 +62,44 @@ function findLockfile(projectDir) {
61
62
  }
62
63
  return null;
63
64
  }
65
+ /**
66
+ * The project's declared version, or nothing.
67
+ *
68
+ * Absent is a real answer — a project need not version itself — and is better
69
+ * reported as unknown than as a number this made up.
70
+ */
71
+ function resolveProjectVersion(projectDir) {
72
+ try {
73
+ const pkg = JSON.parse(readFileSync(join(projectDir, 'package.json'), 'utf-8'));
74
+ return typeof pkg.version === 'string' ? pkg.version : undefined;
75
+ }
76
+ catch {
77
+ return undefined;
78
+ }
79
+ }
80
+ /**
81
+ * The project's own database declaration, or nothing it could read.
82
+ *
83
+ * A config that throws, or names no `createConfig` at all, is reported as no
84
+ * declaration rather than as a build failure: it is only ever one of two
85
+ * signals here, and the directory conventions still answer for a project whose
86
+ * config needs an environment this build does not have.
87
+ */
88
+ async function loadConfiguredDb(projectDir, srcDirectories, logger) {
89
+ try {
90
+ return await loadUserConfigForDb({
91
+ config: { rootDir: projectDir, srcDirectories },
92
+ logger: {
93
+ error: (msg) => logger.debug(msg),
94
+ warn: (msg) => logger.debug(msg),
95
+ },
96
+ });
97
+ }
98
+ catch (error) {
99
+ logger.debug(`Could not read createConfig to resolve the deploy database: ${error?.message ?? error}`);
100
+ return null;
101
+ }
102
+ }
64
103
  /**
65
104
  * The database a standalone bundle has to open for itself.
66
105
  *
@@ -71,49 +110,59 @@ function findLockfile(projectDir) {
71
110
  * services factory does when the database is missing, which for the generated
72
111
  * templates is a throw.
73
112
  *
74
- * Engine comes from the migrations directory rather than the user config,
75
- * because that is the same signal `loadUserConfigForDb` falls back to and it
76
- * needs no module loading here. `db/sqlite` and `db/postgres` are the two
77
- * conventions the migrator already writes to, so a project declares its engine
78
- * by having written migrations for it.
113
+ * Engine is resolved the way every other pikku host resolves it: `createConfig`
114
+ * first, through the same `loadUserConfigForDb` the db commands use, and the
115
+ * `db/sqlite` / `db/postgres` conventions only as the fallback. Reading the
116
+ * directory alone left an app that declares its database in config and keeps no
117
+ * migrations getting a connection under `pikku dev` and none in its artifact —
118
+ * the same crash, reached a different way. A config that cannot be loaded falls
119
+ * back to the directories rather than failing the build, because a project with
120
+ * no database at all must still bundle.
121
+ *
122
+ * Both at once is refused rather than resolved, whether the two arrive as two
123
+ * migration directories or as `sqliteDb` beside `postgresUrl`. Picking one would
124
+ * be picking which database the deployed app talks to on the strength of
125
+ * directory order, and the failure — an app running happily against the wrong,
126
+ * fully valid schema — is invisible until someone reads the data.
79
127
  *
80
- * Both at once is refused rather than resolved. Picking one would be picking
81
- * which database the deployed app talks to on the strength of directory order,
82
- * and the failure — an app running happily against the wrong, fully valid
83
- * schema — is invisible until someone reads the data.
128
+ * Only the engine travels. A configured SQLite path is a developer's local file
129
+ * and has no meaning on the target host, which names its own through
130
+ * `PIKKU_DATA_DIR`.
84
131
  *
85
132
  * The migrations are copied in beside the bundle under the same `db/<engine>/`
86
133
  * path they have in the project, which is also where Fabric's build container
87
134
  * stages them. Two producers writing the artifact cannot disagree about where
88
135
  * the SQL lives, and `bundle.js db migrate` finds it either way.
89
136
  */
90
- /**
91
- * The project's declared version, or nothing.
92
- *
93
- * Absent is a real answer — a project need not version itself — and is better
94
- * reported as unknown than as a number this made up.
95
- */
96
- function resolveProjectVersion(projectDir) {
97
- try {
98
- const pkg = JSON.parse(readFileSync(join(projectDir, 'package.json'), 'utf-8'));
99
- return typeof pkg.version === 'string' ? pkg.version : undefined;
100
- }
101
- catch {
102
- return undefined;
103
- }
104
- }
105
- async function resolveStandaloneDb(projectDir, pikkuDir, unitDir) {
137
+ export async function resolveStandaloneDb(projectDir, pikkuDir, unitDir, srcDirectories, logger) {
106
138
  const hasSqlite = existsSync(join(projectDir, 'db', 'sqlite'));
107
139
  const hasPostgres = existsSync(join(projectDir, 'db', 'postgres'));
108
140
  if (hasSqlite && hasPostgres) {
109
141
  throw new Error('This project has both db/sqlite and db/postgres migrations, so a standalone build cannot tell which database the app is meant to open. Keep the one this app deploys against.');
110
142
  }
111
- const engine = hasSqlite ? 'sqlite' : hasPostgres ? 'postgres' : undefined;
143
+ const userConfig = await loadConfiguredDb(projectDir, srcDirectories, logger);
144
+ if (userConfig?.postgresUrl && userConfig?.sqliteDb) {
145
+ throw new Error('createConfig sets both postgresUrl and sqliteDb, so a standalone build cannot tell which database the app is meant to open. Configure exactly one database dialect.');
146
+ }
147
+ const engine = userConfig?.postgresUrl
148
+ ? 'postgres'
149
+ : userConfig?.sqliteDb
150
+ ? 'sqlite'
151
+ : hasSqlite
152
+ ? 'sqlite'
153
+ : hasPostgres
154
+ ? 'postgres'
155
+ : undefined;
112
156
  if (!engine)
113
157
  return undefined;
114
- await cp(join(projectDir, 'db', engine), join(unitDir, 'db', engine), {
115
- recursive: true,
116
- });
158
+ // Absent for a database whose schema is created outside the migrator, which
159
+ // is a database to connect to rather than a reason to hand the app none.
160
+ const migrationsDir = join(projectDir, 'db', engine);
161
+ if (existsSync(migrationsDir)) {
162
+ await cp(migrationsDir, join(unitDir, 'db', engine), {
163
+ recursive: true,
164
+ });
165
+ }
117
166
  // Absent for an app that annotates no columns, which is a database with
118
167
  // nothing to coerce rather than a reason to hand the app no database.
119
168
  const coercionFile = join(pikkuDir, 'db', 'coercion.gen.ts');
@@ -199,7 +248,7 @@ export async function runBuildPipeline(options) {
199
248
  ...getEntryContext(unitDir, pikkuDir, singleUnit, inspectorState),
200
249
  frontend: frontendMount,
201
250
  version: resolveProjectVersion(projectDir),
202
- db: await resolveStandaloneDb(projectDir, pikkuDir, unitDir),
251
+ db: await resolveStandaloneDb(projectDir, pikkuDir, unitDir, options.srcDirectories ?? ['src'], logger),
203
252
  lifecycle: resolveLifecycle(unitDir, inspectorState),
204
253
  };
205
254
  const source = provider.generateEntrySource(ctx);
@@ -0,0 +1,17 @@
1
+ export interface PikkuExample {
2
+ name: string;
3
+ title: string;
4
+ when: string;
5
+ lang: string;
6
+ /** The example domain symbol this recipe spells, which `--entity` renames. */
7
+ entity: string;
8
+ /** A precondition the recipe declares, refusing `add` until it holds. */
9
+ deferUntil: string;
10
+ requires: string[];
11
+ /** The follow-up the recipe cannot perform itself, carried to the caller verbatim. */
12
+ steps: string;
13
+ /** Where the recipe lives, repo-relative. */
14
+ source: string;
15
+ content: string;
16
+ }
17
+ export declare const EXAMPLES: PikkuExample[];