@pikku/cli 0.12.54 → 0.12.56

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 (267) hide show
  1. package/cli.schema.json +1 -1
  2. package/console-app/assets/{index-DYnbceYg.js → index-xN8LW0II.js} +155 -155
  3. package/console-app/index.html +1 -1
  4. package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +1 -1
  5. package/dist/.pikku/channel/pikku-channel-types.gen.d.ts +3 -3
  6. package/dist/.pikku/channel/pikku-channel-types.gen.js +1 -1
  7. package/dist/.pikku/cli/pikku-cli-channel.d.ts +6 -6
  8. package/dist/.pikku/cli/pikku-cli-channel.js +11 -1
  9. package/dist/.pikku/cli/pikku-cli-client.gen.d.ts +1 -1
  10. package/dist/.pikku/cli/pikku-cli-client.gen.js +1 -1
  11. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.d.ts +1 -1
  12. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.js +1 -1
  13. package/dist/.pikku/cli/pikku-cli-contracts-meta.gen.json +14 -0
  14. package/dist/.pikku/cli/pikku-cli-types.gen.d.ts +1 -1
  15. package/dist/.pikku/cli/pikku-cli-types.gen.js +1 -1
  16. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.js +1 -1
  17. package/dist/.pikku/cli/pikku-cli-wirings-meta.gen.json +29 -0
  18. package/dist/.pikku/cli/pikku-cli-wirings.gen.d.ts +1 -1
  19. package/dist/.pikku/cli/pikku-cli-wirings.gen.js +1 -1
  20. package/dist/.pikku/cli/pikku-cli.gen.d.ts +1 -1
  21. package/dist/.pikku/cli/pikku-cli.gen.js +1 -1
  22. package/dist/.pikku/console/pikku-node-types.gen.d.ts +1 -1
  23. package/dist/.pikku/function/pikku-function-types.gen.d.ts +8 -31
  24. package/dist/.pikku/function/pikku-function-types.gen.js +1 -1
  25. package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
  26. package/dist/.pikku/function/pikku-functions-meta.gen.json +1420 -1384
  27. package/dist/.pikku/function/pikku-functions.gen.js +3 -1
  28. package/dist/.pikku/http/pikku-http-types.gen.d.ts +1 -1
  29. package/dist/.pikku/http/pikku-http-types.gen.js +1 -1
  30. package/dist/.pikku/http/pikku-http-wirings-meta.gen.js +1 -1
  31. package/dist/.pikku/http/pikku-http-wirings.gen.d.ts +1 -1
  32. package/dist/.pikku/http/pikku-http-wirings.gen.js +1 -1
  33. package/dist/.pikku/mcp/pikku-mcp-types.gen.d.ts +1 -1
  34. package/dist/.pikku/mcp/pikku-mcp-types.gen.js +1 -1
  35. package/dist/.pikku/pikku-bootstrap.gen.d.ts +1 -1
  36. package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
  37. package/dist/.pikku/pikku-meta-service.gen.d.ts +1 -1
  38. package/dist/.pikku/pikku-meta-service.gen.js +1 -1
  39. package/dist/.pikku/pikku-services.gen.d.ts +4 -2
  40. package/dist/.pikku/pikku-services.gen.js +2 -0
  41. package/dist/.pikku/pikku-types.gen.d.ts +1 -1
  42. package/dist/.pikku/pikku-types.gen.js +1 -1
  43. package/dist/.pikku/queue/pikku-queue-types.gen.d.ts +1 -1
  44. package/dist/.pikku/queue/pikku-queue-types.gen.js +1 -1
  45. package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.js +1 -1
  46. package/dist/.pikku/queue/pikku-queue-workers-wirings-meta.gen.json +0 -248
  47. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.d.ts +1 -1
  48. package/dist/.pikku/queue/pikku-queue-workers-wirings.gen.js +1 -1
  49. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.js +1 -1
  50. package/dist/.pikku/rpc/pikku-rpc-wirings-meta.internal.gen.json +69 -67
  51. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.d.ts +1 -1
  52. package/dist/.pikku/scheduler/pikku-scheduler-types.gen.js +1 -1
  53. package/dist/.pikku/schemas/register.gen.js +191 -185
  54. package/dist/.pikku/schemas/schemas/FabricAddonVerifyInput.schema.json +1 -0
  55. package/dist/.pikku/schemas/schemas/FabricAddonVerifyOutput.schema.json +1 -0
  56. package/dist/.pikku/schemas/schemas/PikkuAuthInput.schema.json +1 -0
  57. package/dist/.pikku/schemas/schemas/PikkuCLIConfig.schema.json +1 -1
  58. package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
  59. package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
  60. package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
  61. package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
  62. package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
  63. package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
  64. package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
  65. package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
  66. package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
  67. package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
  68. package/dist/.pikku/workflow/meta/allWorkflow.gen.json +9 -3
  69. package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +1 -1
  70. package/dist/.pikku/workflow/pikku-workflow-types.gen.js +1 -1
  71. package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
  72. package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
  73. package/dist/bin/pikku-bin.mjs +2 -2
  74. package/dist/src/cli.wiring.js +15 -1
  75. package/dist/src/deploy/analyzer/analyzer.d.ts +6 -0
  76. package/dist/src/deploy/analyzer/analyzer.js +5 -4
  77. package/dist/src/deploy/build-pipeline.d.ts +5 -1
  78. package/dist/src/deploy/build-pipeline.js +5 -5
  79. package/dist/src/deploy/bundler/bun-bundler.d.ts +14 -0
  80. package/dist/src/deploy/bundler/bun-bundler.js +121 -0
  81. package/dist/src/deploy/bundler/bundler.d.ts +25 -30
  82. package/dist/src/deploy/bundler/bundler.interface.d.ts +54 -0
  83. package/dist/src/deploy/bundler/bundler.interface.js +11 -0
  84. package/dist/src/deploy/bundler/bundler.js +120 -190
  85. package/dist/src/deploy/bundler/dep-extractor.d.ts +11 -3
  86. package/dist/src/deploy/bundler/dep-extractor.js +12 -6
  87. package/dist/src/deploy/bundler/index.d.ts +5 -2
  88. package/dist/src/deploy/bundler/index.js +4 -2
  89. package/dist/src/deploy/bundler/node-bundler.d.ts +13 -0
  90. package/dist/src/deploy/bundler/node-bundler.js +80 -0
  91. package/dist/src/deploy/provider-adapter.d.ts +11 -0
  92. package/dist/src/deploy/server-entry.js +3 -1
  93. package/dist/src/fabric/fabric-commands.d.ts +109 -72
  94. package/dist/src/fabric/fabric-commands.js +8 -0
  95. package/dist/src/fabric/functions/add.function.d.ts +3 -3
  96. package/dist/src/fabric/functions/addon-verify.function.d.ts +54 -0
  97. package/dist/src/fabric/functions/addon-verify.function.js +153 -0
  98. package/dist/src/fabric/functions/db-schema.function.d.ts +3 -3
  99. package/dist/src/fabric/functions/deploy-list.function.d.ts +3 -3
  100. package/dist/src/fabric/functions/deploy-units.function.d.ts +3 -3
  101. package/dist/src/fabric/functions/deploy.function.d.ts +6 -6
  102. package/dist/src/fabric/functions/domains-add.function.d.ts +3 -3
  103. package/dist/src/fabric/functions/domains-list.function.d.ts +3 -3
  104. package/dist/src/fabric/functions/domains-remove.function.d.ts +3 -3
  105. package/dist/src/fabric/functions/errors.function.d.ts +3 -3
  106. package/dist/src/fabric/functions/init.function.d.ts +3 -3
  107. package/dist/src/fabric/functions/link.function.d.ts +3 -3
  108. package/dist/src/fabric/functions/llm-key.function.d.ts +3 -3
  109. package/dist/src/fabric/functions/llm-key.function.js +1 -1
  110. package/dist/src/fabric/functions/login.function.d.ts +3 -3
  111. package/dist/src/fabric/functions/logs.function.d.ts +3 -3
  112. package/dist/src/fabric/functions/metrics.function.d.ts +3 -3
  113. package/dist/src/fabric/functions/publish.function.d.ts +3 -3
  114. package/dist/src/fabric/functions/publish.function.js +8 -3
  115. package/dist/src/fabric/functions/rollback.function.d.ts +3 -3
  116. package/dist/src/fabric/functions/secrets-list.function.d.ts +3 -3
  117. package/dist/src/fabric/functions/secrets-set.function.d.ts +3 -3
  118. package/dist/src/fabric/functions/smoke.function.d.ts +3 -3
  119. package/dist/src/fabric/functions/status.function.d.ts +3 -3
  120. package/dist/src/fabric/functions/trace.function.d.ts +3 -3
  121. package/dist/src/fabric/functions/validate.function.d.ts +3 -3
  122. package/dist/src/functions/commands/all.d.ts +1 -1
  123. package/dist/src/functions/commands/all.js +19 -2
  124. package/dist/src/functions/commands/binary.d.ts +3 -3
  125. package/dist/src/functions/commands/bootstrap.d.ts +1 -1
  126. package/dist/src/functions/commands/bootstrap.js +3 -0
  127. package/dist/src/functions/commands/console.d.ts +3 -3
  128. package/dist/src/functions/commands/db-audit.d.ts +1 -1
  129. package/dist/src/functions/commands/db-generate.d.ts +1 -1
  130. package/dist/src/functions/commands/db-migrate.d.ts +1 -1
  131. package/dist/src/functions/commands/db-reset.d.ts +1 -1
  132. package/dist/src/functions/commands/db-seed.d.ts +1 -1
  133. package/dist/src/functions/commands/deploy-apply.d.ts +3 -3
  134. package/dist/src/functions/commands/deploy-apply.js +32 -1
  135. package/dist/src/functions/commands/deploy-info.d.ts +1 -1
  136. package/dist/src/functions/commands/deploy-plan.d.ts +3 -3
  137. package/dist/src/functions/commands/deploy-plan.js +3 -1
  138. package/dist/src/functions/commands/dev.d.ts +3 -3
  139. package/dist/src/functions/commands/dev.js +17 -45
  140. package/dist/src/functions/commands/emails-init.d.ts +1 -1
  141. package/dist/src/functions/commands/enable.d.ts +6 -5
  142. package/dist/src/functions/commands/enable.js +4 -0
  143. package/dist/src/functions/commands/info.d.ts +4 -4
  144. package/dist/src/functions/commands/login.d.ts +7 -7
  145. package/dist/src/functions/commands/meta.d.ts +31 -31
  146. package/dist/src/functions/commands/new-addon.d.ts +3 -3
  147. package/dist/src/functions/commands/new-function.d.ts +3 -3
  148. package/dist/src/functions/commands/new-middleware.d.ts +3 -3
  149. package/dist/src/functions/commands/new-permission.d.ts +3 -3
  150. package/dist/src/functions/commands/new-wiring.d.ts +3 -3
  151. package/dist/src/functions/commands/pikku-command-bootstrap.d.ts +1 -1
  152. package/dist/src/functions/commands/pikku-command-summary.d.ts +1 -1
  153. package/dist/src/functions/commands/pikku-command-summary.js +6 -1
  154. package/dist/src/functions/commands/skills.d.ts +6 -6
  155. package/dist/src/functions/commands/tests-coverage.d.ts +3 -3
  156. package/dist/src/functions/commands/tests-init.d.ts +3 -3
  157. package/dist/src/functions/commands/versions-check.d.ts +1 -1
  158. package/dist/src/functions/commands/versions-init.d.ts +3 -3
  159. package/dist/src/functions/commands/versions-update.d.ts +1 -1
  160. package/dist/src/functions/commands/watch.d.ts +3 -3
  161. package/dist/src/functions/commands/workspace-validate.d.ts +3 -3
  162. package/dist/src/functions/db/db-codegen.js +14 -0
  163. package/dist/src/functions/db/sqlite/sqlite-runtime-bun.js +10 -0
  164. package/dist/src/functions/runtimes/fetch/index.d.ts +1 -1
  165. package/dist/src/functions/runtimes/nextjs/pikku-command-nextjs.d.ts +1 -1
  166. package/dist/src/functions/runtimes/tanstack-start/pikku-command-tanstack-start.d.ts +1 -1
  167. package/dist/src/functions/runtimes/websocket/pikku-command-websocket-typed.d.ts +1 -1
  168. package/dist/src/functions/wirings/ai-agent/pikku-command-ai-agent-types.d.ts +1 -1
  169. package/dist/src/functions/wirings/ai-agent/pikku-command-ai-agent.d.ts +1 -1
  170. package/dist/src/functions/wirings/ai-agent/pikku-command-public-agent.d.ts +1 -1
  171. package/dist/src/functions/wirings/auth/pikku-command-auth.d.ts +7 -1
  172. package/dist/src/functions/wirings/auth/pikku-command-auth.js +14 -2
  173. package/dist/src/functions/wirings/auth/serialize-auth-types.d.ts +10 -0
  174. package/dist/src/functions/wirings/auth/serialize-auth-types.js +15 -0
  175. package/dist/src/functions/wirings/channels/pikku-channels.d.ts +1 -1
  176. package/dist/src/functions/wirings/channels/pikku-command-channel-types.d.ts +1 -1
  177. package/dist/src/functions/wirings/channels/pikku-command-channels-map.d.ts +1 -1
  178. package/dist/src/functions/wirings/channels/pikku-command-channels.d.ts +1 -1
  179. package/dist/src/functions/wirings/cli/pikku-command-cli-entry.d.ts +1 -1
  180. package/dist/src/functions/wirings/cli/pikku-command-cli-types.d.ts +1 -1
  181. package/dist/src/functions/wirings/cli/pikku-command-cli.d.ts +1 -1
  182. package/dist/src/functions/wirings/console/pikku-command-console-functions.d.ts +1 -1
  183. package/dist/src/functions/wirings/console/pikku-command-node-types.d.ts +1 -1
  184. package/dist/src/functions/wirings/console/pikku-command-nodes-meta.d.ts +1 -1
  185. package/dist/src/functions/wirings/credentials/pikku-command-credentials.d.ts +1 -1
  186. package/dist/src/functions/wirings/emails/pikku-command-emails.d.ts +1 -1
  187. package/dist/src/functions/wirings/functions/pikku-command-addon-types.d.ts +1 -1
  188. package/dist/src/functions/wirings/functions/pikku-command-function-types-split.d.ts +3 -3
  189. package/dist/src/functions/wirings/functions/pikku-command-function-types.d.ts +3 -3
  190. package/dist/src/functions/wirings/functions/pikku-command-function-types.js +10 -3
  191. package/dist/src/functions/wirings/functions/pikku-command-functions.d.ts +1 -1
  192. package/dist/src/functions/wirings/functions/pikku-command-services.d.ts +1 -1
  193. package/dist/src/functions/wirings/functions/schemas.d.ts +1 -1
  194. package/dist/src/functions/wirings/functions/serialize-function-types.js +6 -29
  195. package/dist/src/functions/wirings/gateway/pikku-command-gateway.d.ts +1 -1
  196. package/dist/src/functions/wirings/http/pikku-command-http-map.d.ts +1 -1
  197. package/dist/src/functions/wirings/http/pikku-command-http-routes.d.ts +1 -1
  198. package/dist/src/functions/wirings/http/pikku-command-http-types.d.ts +1 -1
  199. package/dist/src/functions/wirings/http/pikku-command-openapi.d.ts +1 -1
  200. package/dist/src/functions/wirings/http/pikku-http-routes.d.ts +1 -1
  201. package/dist/src/functions/wirings/mcp/pikku-command-mcp-json.d.ts +1 -1
  202. package/dist/src/functions/wirings/mcp/pikku-command-mcp-types.d.ts +1 -1
  203. package/dist/src/functions/wirings/mcp/pikku-command-mcp.d.ts +1 -1
  204. package/dist/src/functions/wirings/middleware/pikku-command-middleware.d.ts +1 -1
  205. package/dist/src/functions/wirings/package/pikku-command-package-types.d.ts +2 -2
  206. package/dist/src/functions/wirings/package/pikku-command-package.d.ts +1 -1
  207. package/dist/src/functions/wirings/permissions/pikku-command-permissions.d.ts +1 -1
  208. package/dist/src/functions/wirings/queue/pikku-command-queue-map.d.ts +1 -1
  209. package/dist/src/functions/wirings/queue/pikku-command-queue-service.d.ts +1 -1
  210. package/dist/src/functions/wirings/queue/pikku-command-queue-types.d.ts +1 -1
  211. package/dist/src/functions/wirings/queue/pikku-command-queue.d.ts +1 -1
  212. package/dist/src/functions/wirings/queue/pikku-queue-map.d.ts +1 -1
  213. package/dist/src/functions/wirings/queue/pikku-queue.d.ts +1 -1
  214. package/dist/src/functions/wirings/realtime/pikku-command-events-scaffold.d.ts +1 -1
  215. package/dist/src/functions/wirings/realtime/pikku-command-realtime.d.ts +1 -1
  216. package/dist/src/functions/wirings/rpc/pikku-command-public-rpc.d.ts +1 -1
  217. package/dist/src/functions/wirings/rpc/pikku-command-react-query.d.ts +1 -1
  218. package/dist/src/functions/wirings/rpc/pikku-command-remote-rpc.d.ts +1 -1
  219. package/dist/src/functions/wirings/rpc/pikku-command-rpc-client.d.ts +1 -1
  220. package/dist/src/functions/wirings/rpc/pikku-command-rpc-map.d.ts +2 -2
  221. package/dist/src/functions/wirings/rpc/pikku-command-rpc.d.ts +1 -1
  222. package/dist/src/functions/wirings/scheduler/pikku-command-scheduler-types.d.ts +1 -1
  223. package/dist/src/functions/wirings/scheduler/pikku-command-scheduler.d.ts +1 -1
  224. package/dist/src/functions/wirings/secrets/pikku-command-secrets.d.ts +1 -1
  225. package/dist/src/functions/wirings/triggers/pikku-command-trigger-types.d.ts +3 -3
  226. package/dist/src/functions/wirings/triggers/pikku-command-trigger.d.ts +1 -1
  227. package/dist/src/functions/wirings/variables/pikku-command-variables.d.ts +1 -1
  228. package/dist/src/functions/wirings/workflow/pikku-command-workflow-routes.d.ts +1 -1
  229. package/dist/src/functions/wirings/workflow/pikku-command-workflow.d.ts +1 -1
  230. package/dist/src/functions/workflows/all.workflow.js +6 -1
  231. package/dist/src/scaffold/rpc-remote.gen.d.ts +3 -3
  232. package/dist/src/scaffold/rpc-remote.gen.js +1 -1
  233. package/dist/src/server/bun-server-runner.d.ts +17 -0
  234. package/dist/src/server/bun-server-runner.js +25 -0
  235. package/dist/src/server/dev-server-runner.interface.d.ts +31 -0
  236. package/dist/src/server/dev-server-runner.interface.js +11 -0
  237. package/dist/src/server/node-server-runner.d.ts +12 -0
  238. package/dist/src/server/node-server-runner.js +30 -0
  239. package/dist/src/services/cli-logger.service.js +7 -1
  240. package/dist/src/services.js +18 -0
  241. package/dist/src/utils/detect-better-auth.d.ts +7 -0
  242. package/dist/src/utils/detect-better-auth.js +29 -0
  243. package/dist/src/utils/parse-cli-filters.d.ts +1 -0
  244. package/dist/src/utils/parse-cli-filters.js +1 -0
  245. package/dist/src/utils/pikku-cli-config.js +1 -1
  246. package/dist/src/utils/serialize-schemas.js +5 -1
  247. package/dist/tsconfig.tsbuildinfo +1 -1
  248. package/package.json +4 -4
  249. package/skills/pikku-addon/SKILL.md +25 -117
  250. package/skills/pikku-addon/references/addon-package-manifest.md +63 -0
  251. package/skills/pikku-cli/SKILL.md +7 -93
  252. package/skills/pikku-cli/references/complete-example.md +82 -0
  253. package/skills/pikku-concepts/SKILL.md +17 -69
  254. package/skills/pikku-concepts/references/concept-mapping.md +37 -13
  255. package/skills/pikku-concepts/references/packages.md +29 -0
  256. package/skills/pikku-http/SKILL.md +14 -105
  257. package/skills/pikku-http/references/http-options.md +57 -0
  258. package/skills/pikku-middleware/SKILL.md +11 -68
  259. package/skills/pikku-middleware/references/middleware-patterns.md +61 -0
  260. package/skills/pikku-realtime/SKILL.md +56 -105
  261. package/skills/pikku-realtime/references/other-routes.md +23 -0
  262. package/skills/pikku-services/SKILL.md +25 -108
  263. package/skills/pikku-services/references/audit-wire-service.md +34 -0
  264. package/skills/pikku-testing/SKILL.md +51 -359
  265. package/skills/pikku-testing/references/cucumber-bdd-testing.md +176 -0
  266. package/skills/pikku-workflow/SKILL.md +93 -259
  267. package/skills/pikku-workflow/references/workflow-reference.md +63 -0
@@ -1 +1 @@
1
- { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "configFile": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "wires": { "type": "array", "items": { "type": "string" } }, "excludeWires": { "type": "array", "items": { "type": "string" } }, "userSessionType": { "type": "string" }, "singletonServicesFactoryType": { "type": "string" }, "wireServicesFactoryType": { "type": "string" }, "outDir": { "type": "string" }, "schemaDirectory": { "type": "string" }, "typesDeclarationFile": { "type": "string" }, "functionsFile": { "type": "string" }, "functionsMetaFile": { "type": "string" }, "functionsMetaJsonFile": { "type": "string" }, "functionTypesFile": { "type": "string" }, "httpWiringsFile": { "type": "string" }, "httpWiringMetaFile": { "type": "string" }, "httpWiringMetaJsonFile": { "type": "string" }, "httpContractsMetaJsonFile": { "type": "string" }, "httpContractsMetaFile": { "type": "string" }, "httpMapDeclarationFile": { "type": "string" }, "httpTypesFile": { "type": "string" }, "gatewaysWiringFile": { "type": "string" }, "gatewaysWiringMetaFile": { "type": "string" }, "gatewaysWiringMetaJsonFile": { "type": "string" }, "channelsWiringFile": { "type": "string" }, "channelsWiringMetaFile": { "type": "string" }, "channelsWiringMetaJsonFile": { "type": "string" }, "channelContractsMetaJsonFile": { "type": "string" }, "channelContractsMetaFile": { "type": "string" }, "channelsMapDeclarationFile": { "type": "string" }, "channelsTypesFile": { "type": "string" }, "rpcInternalWiringMetaFile": { "type": "string" }, "rpcInternalWiringMetaJsonFile": { "type": "string" }, "rpcInternalMapDeclarationFile": { "type": "string" }, "rpcMapDeclarationFile": { "type": "string" }, "remoteRpcWorkersFile": { "type": "string" }, "publicRpcFile": { "type": "string" }, "publicAgentFile": { "type": "string" }, "consoleFunctionsFile": { "type": "string" }, "workflowRoutesFile": { "type": "string" }, "eventsChannelFile": { "type": "string" }, "triggersTypesFile": { "type": "string" }, "triggersWiringFile": { "type": "string" }, "triggersWiringMetaFile": { "type": "string" }, "triggersWiringMetaJsonFile": { "type": "string" }, "triggerSourcesMetaFile": { "type": "string" }, "triggerSourcesMetaJsonFile": { "type": "string" }, "schedulersWiringFile": { "type": "string" }, "schedulersWiringMetaFile": { "type": "string" }, "schedulersWiringMetaJsonFile": { "type": "string" }, "schedulersTypesFile": { "type": "string" }, "queueWorkersWiringFile": { "type": "string" }, "queueWorkersWiringMetaFile": { "type": "string" }, "queueWorkersWiringMetaJsonFile": { "type": "string" }, "queueMapDeclarationFile": { "type": "string" }, "queueTypesFile": { "type": "string" }, "workflowsWiringFile": { "type": "string" }, "workflowsWiringMetaFile": { "type": "string" }, "workflowsWorkersFile": { "type": "string" }, "workflowMapDeclarationFile": { "type": "string" }, "workflowTypesFile": { "type": "string" }, "workflowMetaDir": { "type": "string" }, "mcpWiringsFile": { "type": "string" }, "mcpWiringsMetaFile": { "type": "string" }, "mcpWiringsMetaJsonFile": { "type": "string" }, "mcpTypesFile": { "type": "string" }, "mcpJsonFile": { "type": "string" }, "agentWiringsFile": { "type": "string" }, "agentWiringMetaFile": { "type": "string" }, "agentWiringMetaJsonFile": { "type": "string" }, "agentTypesFile": { "type": "string" }, "agentMapDeclarationFile": { "type": "string" }, "cliWiringsFile": { "type": "string" }, "cliWiringMetaFile": { "type": "string" }, "cliWiringMetaJsonFile": { "type": "string" }, "cliContractsMetaJsonFile": { "type": "string" }, "cliContractsMetaFile": { "type": "string" }, "cliBootstrapFile": { "type": "string" }, "cliTypesFile": { "type": "string" }, "servicesFile": { "type": "string" }, "middlewareFile": { "type": "string" }, "middlewareGroupsMetaJsonFile": { "type": "string" }, "permissionsFile": { "type": "string" }, "permissionsGroupsMetaJsonFile": { "type": "string" }, "bootstrapFile": { "type": "string" }, "packageFile": { "type": "string" }, "addonTypesFile": { "type": "string" }, "nodeTypesFile": { "type": "string" }, "secretTypesFile": { "type": "string" }, "secretsFile": { "type": "string" }, "secretsMetaJsonFile": { "type": "string" }, "credentialsFile": { "type": "string" }, "credentialsMetaJsonFile": { "type": "string" }, "variableTypesFile": { "type": "string" }, "variablesFile": { "type": "string" }, "variablesMetaJsonFile": { "type": "string" }, "$schema": { "type": "string" }, "extends": { "type": "string" }, "rootDir": { "type": "string" }, "runtimeDir": { "type": "string", "description": "Runtime artifacts directory (dev.db, content, tmp). Resolved relative to rootDir. Defaults to <rootDir>/.pikku-runtime." }, "srcDirectories": { "type": "array", "items": { "type": "string" } }, "ignoreFiles": { "type": "array", "items": { "type": "string" } }, "packageMappings": { "type": "object", "additionalProperties": { "type": "string" } }, "addon": { "anyOf": [{ "type": "boolean" }, { "type": "object", "properties": { "categories": { "type": "array", "items": { "type": "string" } }, "icon": { "type": "string" }, "displayName": { "type": "string" }, "description": { "type": "string" }, "openapi": { "type": "object", "properties": { "version": { "type": "string" }, "hash": { "type": "string" } }, "required": ["version", "hash"], "additionalProperties": false } }, "additionalProperties": false }] }, "addonName": { "type": "string" }, "configDir": { "type": "string" }, "tsconfig": { "type": "string" }, "clientFiles": { "type": "object", "properties": { "fetchFile": { "type": "string" }, "websocketFile": { "type": "string" }, "rpcWiringsFile": { "type": "string" }, "reactQueryFile": { "type": "string" }, "realtimeFile": { "type": "string" }, "realtimeEventHubTopicsImport": { "type": "string", "description": "Optional import for the EventHubTopics type so the realtime client is fully typed. Format: `<path>#<TypeName>` resolved relative to `realtimeFile`. Example: `../types/eventhub-topics.js#EventHubTopics`. If unset, the generated client treats topics as `Record<string, unknown>`." }, "queueWiringsFile": { "type": "string" }, "mcpJsonFile": { "type": "string" }, "nextBackendFile": { "type": "string" }, "nextHTTPFile": { "type": "string" }, "nextBackendTransport": { "type": "string", "enum": ["local", "worker-rpc", "http"], "description": "Transport used by the generated nextBackendFile wrapper.\n- `'local'` (default): function code is loaded in-process via bootstrap + createSingletonServices. Required for Node/dev runs.\n- `'worker-rpc'`: SSR dispatches every call through an injected `Fetcher` ({ fetch(req): Promise<Response> }). Function code is NOT bundled into the SSR worker. Pair with `nextBackendFetcherImport` to point at your resolver module.\n- `'http'`: SSR dispatches every call through the generated `PikkuFetch` client. Use this when your Next app should call a separately running local/server API instead of importing function code in-process." }, "nextBackendFetcherImport": { "type": "string", "description": "Module that exports a `fetcher: Fetcher` (or default export) used by the worker-RPC variant of the next backend wrapper. Resolved relative to `nextBackendFile`. Required when `nextBackendTransport === 'worker-rpc'`." }, "startServerFnsFile": { "type": "string", "description": "Emit a TanStack Start server-function shim into this file. The shim exports `makeApi(): PikkuRPC` — a typed caller over the generated RPC map for use in Start loaders, actions and components. It reads the API base URL from `import.meta.env.VITE_API_URL` (throws if unset). Requires `rpcWiringsFile` (where the `PikkuRPC` class is generated)." } }, "additionalProperties": false }, "emailTemplatesDir": { "type": "string", "description": "Directory containing email templates, locales, partials, and theme.json." }, "authFile": { "type": "string", "description": "Path to write the generated Better Auth wiring file (auth.gen.ts). Must be within srcDirectories so wireSecret calls are picked up by the inspector. Example: \"src/auth.gen.ts\"" }, "authTypesFile": { "type": "string", "description": "Path to write the generated typed `pikkuBetterAuth` re-export (auth.types.ts). Defaults to `{outDir}/auth/auth.types.ts`. Re-exported from `#pikku` so user code can `import { pikkuBetterAuth } from '#pikku'` with project-typed services." }, "authMetaJsonFile": { "type": "string", "description": "Path to write the generated Better Auth metadata (auth-meta.gen.json) — the enabled social providers and plugins the console SSO page reads via getAuthProviders. Defaults to `{outDir}/auth/pikku-auth-meta.gen.json`." }, "openAPI": { "type": "object", "properties": { "outputFile": { "type": "string" }, "additionalInfo": { "$ref": "#/definitions/OpenAPISpecInfo" } }, "required": ["outputFile", "additionalInfo"], "additionalProperties": false }, "schema": { "type": "object", "properties": { "additionalProperties": { "type": "boolean" }, "supportsImportAttributes": { "type": "boolean" } }, "additionalProperties": false }, "db": { "type": "object", "properties": { "engine": { "type": "string", "enum": ["sqlite", "postgres"] }, "pgVersion": { "type": "number" } }, "additionalProperties": false }, "cli": { "type": "object", "properties": { "entrypoints": { "type": "object", "additionalProperties": { "anyOf": [{ "type": "string" }, { "type": "object", "properties": { "type": { "type": "string", "const": "local" }, "path": { "type": "string" } }, "required": ["type", "path"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "channel" }, "name": { "type": "string" }, "route": { "type": "string" }, "wirePath": { "type": "string" }, "path": { "type": "string" } }, "required": ["type", "wirePath"], "additionalProperties": false }, { "type": "array", "items": { "anyOf": [{ "type": "string" }, { "type": "object", "properties": { "type": { "type": "string", "const": "local" }, "path": { "type": "string" } }, "required": ["type", "path"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "channel" }, "name": { "type": "string" }, "route": { "type": "string" }, "wirePath": { "type": "string" }, "path": { "type": "string" } }, "required": ["type", "wirePath"], "additionalProperties": false }] } }] } } }, "additionalProperties": false }, "workflows": { "type": "object", "properties": { "orchestratorQueue": { "type": "string" }, "workerQueue": { "type": "string" } }, "additionalProperties": false }, "scaffold": { "type": "object", "properties": { "addonDir": { "type": "string" }, "functionDir": { "type": "string" }, "wiringDir": { "type": "string" }, "middlewareDir": { "type": "string" }, "permissionDir": { "type": "string" }, "pikkuDir": { "type": "string" }, "rpc": { "$ref": "#/definitions/PikkuScaffoldFeature" }, "console": { "$ref": "#/definitions/PikkuScaffoldFeature" }, "agent": { "$ref": "#/definitions/PikkuScaffoldFeature" }, "workflow": { "$ref": "#/definitions/PikkuScaffoldFeature" }, "events": { "$ref": "#/definitions/PikkuScaffoldFeature" } }, "additionalProperties": false }, "addons": { "type": "object", "properties": { "addonDir": { "type": "string" } }, "additionalProperties": false, "description": "Community-registry addons installed via `pikku fabric addon add`. The source is copied into the project shadcn-style; each lands in `<addonDir>/<name>/` and the dir is registered as a yarn workspace so `wireAddon({ package })` resolves it by name. `addonDir` defaults to `addons` (top-level, outside the app's TS scan). Install provenance is tracked in pikku-addons.json." }, "tests": { "type": "object", "properties": { "outputDir": { "type": "string" } }, "additionalProperties": false }, "forceRequiredServices": { "type": "array", "items": { "type": "string" } }, "schemasFromTypes": { "type": "array", "items": { "type": "string" } }, "stateOutput": { "type": "string" }, "stateInput": { "type": "string" }, "verboseMeta": { "type": "boolean" }, "lint": { "type": "object", "properties": { "servicesNotDestructured": { "type": "string", "enum": ["off", "warn", "error"] }, "wiresNotDestructured": { "type": "string", "enum": ["off", "warn", "error"] } }, "additionalProperties": false }, "addonMetaJsonFile": { "type": "string" }, "globalHTTPPrefix": { "type": "string" }, "binary": { "type": "object", "properties": { "entrypoint": { "type": "string" }, "output": { "type": "string" }, "targets": { "type": "array", "items": { "type": "string" } } }, "required": ["entrypoint", "output"], "additionalProperties": false }, "deploy": { "type": "object", "properties": { "providers": { "type": "object", "additionalProperties": { "type": "string" } }, "defaultProvider": { "type": "string" }, "serverlessIncompatible": { "type": "array", "items": { "type": "string" } } }, "required": ["providers"], "additionalProperties": false }, "namedFilters": { "type": "object", "additionalProperties": { "$ref": "#/definitions/InspectorFilters" }, "description": "Named filter presets keyed by name, used via CLI --filter <name>." }, "filters": { "$ref": "#/definitions/InspectorFilters" } }, "required": ["addonTypesFile", "agentMapDeclarationFile", "agentTypesFile", "agentWiringMetaFile", "agentWiringMetaJsonFile", "agentWiringsFile", "bootstrapFile", "channelContractsMetaFile", "channelContractsMetaJsonFile", "channelsMapDeclarationFile", "channelsTypesFile", "channelsWiringFile", "channelsWiringMetaFile", "channelsWiringMetaJsonFile", "cliBootstrapFile", "cliContractsMetaFile", "cliContractsMetaJsonFile", "cliTypesFile", "cliWiringMetaFile", "cliWiringMetaJsonFile", "cliWiringsFile", "configDir", "consoleFunctionsFile", "credentialsFile", "credentialsMetaJsonFile", "eventsChannelFile", "filters", "functionTypesFile", "functionsFile", "functionsMetaFile", "functionsMetaJsonFile", "gatewaysWiringFile", "gatewaysWiringMetaFile", "gatewaysWiringMetaJsonFile", "httpContractsMetaFile", "httpContractsMetaJsonFile", "httpMapDeclarationFile", "httpTypesFile", "httpWiringMetaFile", "httpWiringMetaJsonFile", "httpWiringsFile", "mcpJsonFile", "mcpTypesFile", "mcpWiringsFile", "mcpWiringsMetaFile", "mcpWiringsMetaJsonFile", "middlewareFile", "middlewareGroupsMetaJsonFile", "nodeTypesFile", "outDir", "packageFile", "packageMappings", "permissionsFile", "permissionsGroupsMetaJsonFile", "publicAgentFile", "publicRpcFile", "queueMapDeclarationFile", "queueTypesFile", "queueWorkersWiringFile", "queueWorkersWiringMetaFile", "queueWorkersWiringMetaJsonFile", "remoteRpcWorkersFile", "rootDir", "rpcInternalMapDeclarationFile", "rpcInternalWiringMetaFile", "rpcInternalWiringMetaJsonFile", "rpcMapDeclarationFile", "schedulersTypesFile", "schedulersWiringFile", "schedulersWiringMetaFile", "schedulersWiringMetaJsonFile", "schemaDirectory", "secretTypesFile", "secretsFile", "secretsMetaJsonFile", "servicesFile", "srcDirectories", "triggerSourcesMetaFile", "triggerSourcesMetaJsonFile", "triggersTypesFile", "triggersWiringFile", "triggersWiringMetaFile", "triggersWiringMetaJsonFile", "tsconfig", "typesDeclarationFile", "variableTypesFile", "variablesFile", "variablesMetaJsonFile", "workflowMapDeclarationFile", "workflowMetaDir", "workflowRoutesFile", "workflowTypesFile", "workflowsWiringFile", "workflowsWiringMetaFile", "workflowsWorkersFile"], "definitions": { "OpenAPISpecInfo": { "type": "object", "properties": { "info": { "type": "object", "properties": { "title": { "type": "string" }, "version": { "type": "string" }, "description": { "type": "string" }, "termsOfService": { "type": "string" }, "contact": { "type": "object", "properties": { "name": { "type": "string" }, "url": { "type": "string" }, "email": { "type": "string" } }, "additionalProperties": false }, "license": { "type": "object", "properties": { "name": { "type": "string" }, "url": { "type": "string" } }, "required": ["name"], "additionalProperties": false } }, "required": ["title", "version", "description"], "additionalProperties": false }, "servers": { "type": "array", "items": { "type": "object", "properties": { "url": { "type": "string" }, "description": { "type": "string" } }, "required": ["url"], "additionalProperties": false } }, "tags": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" } }, "required": ["name"], "additionalProperties": false } }, "externalDocs": { "type": "object", "properties": { "description": { "type": "string" }, "url": { "type": "string" } }, "required": ["url"], "additionalProperties": false }, "securitySchemes": { "type": "object" }, "security": { "type": "array", "items": { "type": "object", "additionalProperties": { "type": "array", "items": {} } } } }, "required": ["info", "servers"], "additionalProperties": false }, "PikkuScaffoldFeature": { "type": ["string", "boolean"], "enum": ["auth", "no-auth", false] }, "InspectorFilters": { "type": "object", "properties": { "names": { "type": "array", "items": { "type": "string" } }, "tags": { "type": "array", "items": { "type": "string" } }, "wires": { "type": "array", "items": { "type": "string" } }, "directories": { "type": "array", "items": { "type": "string" } }, "httpRoutes": { "type": "array", "items": { "type": "string" } }, "httpMethods": { "type": "array", "items": { "type": "string" } }, "excludeNames": { "type": "array", "items": { "type": "string" } }, "excludeTags": { "type": "array", "items": { "type": "string" } }, "excludeWires": { "type": "array", "items": { "type": "string" } }, "excludeDirectories": { "type": "array", "items": { "type": "string" } }, "excludeHttpRoutes": { "type": "array", "items": { "type": "string" } }, "excludeHttpMethods": { "type": "array", "items": { "type": "string" } }, "target": { "type": "array", "items": { "type": "string", "enum": ["serverless", "server"] } }, "excludeTarget": { "type": "array", "items": { "type": "string", "enum": ["serverless", "server"] } }, "serverlessIncompatible": { "type": "array", "items": { "type": "string" } } }, "additionalProperties": false } } }
1
+ { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "configFile": { "type": "string" }, "tags": { "type": "array", "items": { "type": "string" } }, "wires": { "type": "array", "items": { "type": "string" } }, "excludeWires": { "type": "array", "items": { "type": "string" } }, "userSessionType": { "type": "string" }, "singletonServicesFactoryType": { "type": "string" }, "wireServicesFactoryType": { "type": "string" }, "outDir": { "type": "string" }, "schemaDirectory": { "type": "string" }, "typesDeclarationFile": { "type": "string" }, "functionsFile": { "type": "string" }, "functionsMetaFile": { "type": "string" }, "functionsMetaJsonFile": { "type": "string" }, "functionTypesFile": { "type": "string" }, "httpWiringsFile": { "type": "string" }, "httpWiringMetaFile": { "type": "string" }, "httpWiringMetaJsonFile": { "type": "string" }, "httpContractsMetaJsonFile": { "type": "string" }, "httpContractsMetaFile": { "type": "string" }, "httpMapDeclarationFile": { "type": "string" }, "httpTypesFile": { "type": "string" }, "gatewaysWiringFile": { "type": "string" }, "gatewaysWiringMetaFile": { "type": "string" }, "gatewaysWiringMetaJsonFile": { "type": "string" }, "channelsWiringFile": { "type": "string" }, "channelsWiringMetaFile": { "type": "string" }, "channelsWiringMetaJsonFile": { "type": "string" }, "channelContractsMetaJsonFile": { "type": "string" }, "channelContractsMetaFile": { "type": "string" }, "channelsMapDeclarationFile": { "type": "string" }, "channelsTypesFile": { "type": "string" }, "rpcInternalWiringMetaFile": { "type": "string" }, "rpcInternalWiringMetaJsonFile": { "type": "string" }, "rpcInternalMapDeclarationFile": { "type": "string" }, "rpcMapDeclarationFile": { "type": "string" }, "remoteRpcWorkersFile": { "type": "string" }, "publicRpcFile": { "type": "string" }, "publicAgentFile": { "type": "string" }, "consoleFunctionsFile": { "type": "string" }, "workflowRoutesFile": { "type": "string" }, "eventsChannelFile": { "type": "string" }, "triggersTypesFile": { "type": "string" }, "triggersWiringFile": { "type": "string" }, "triggersWiringMetaFile": { "type": "string" }, "triggersWiringMetaJsonFile": { "type": "string" }, "triggerSourcesMetaFile": { "type": "string" }, "triggerSourcesMetaJsonFile": { "type": "string" }, "schedulersWiringFile": { "type": "string" }, "schedulersWiringMetaFile": { "type": "string" }, "schedulersWiringMetaJsonFile": { "type": "string" }, "schedulersTypesFile": { "type": "string" }, "queueWorkersWiringFile": { "type": "string" }, "queueWorkersWiringMetaFile": { "type": "string" }, "queueWorkersWiringMetaJsonFile": { "type": "string" }, "queueMapDeclarationFile": { "type": "string" }, "queueTypesFile": { "type": "string" }, "workflowsWiringFile": { "type": "string" }, "workflowsWiringMetaFile": { "type": "string" }, "workflowsWorkersFile": { "type": "string" }, "workflowMapDeclarationFile": { "type": "string" }, "workflowTypesFile": { "type": "string" }, "workflowMetaDir": { "type": "string" }, "mcpWiringsFile": { "type": "string" }, "mcpWiringsMetaFile": { "type": "string" }, "mcpWiringsMetaJsonFile": { "type": "string" }, "mcpTypesFile": { "type": "string" }, "mcpJsonFile": { "type": "string" }, "agentWiringsFile": { "type": "string" }, "agentWiringMetaFile": { "type": "string" }, "agentWiringMetaJsonFile": { "type": "string" }, "agentTypesFile": { "type": "string" }, "agentMapDeclarationFile": { "type": "string" }, "cliWiringsFile": { "type": "string" }, "cliWiringMetaFile": { "type": "string" }, "cliWiringMetaJsonFile": { "type": "string" }, "cliContractsMetaJsonFile": { "type": "string" }, "cliContractsMetaFile": { "type": "string" }, "cliBootstrapFile": { "type": "string" }, "cliTypesFile": { "type": "string" }, "servicesFile": { "type": "string" }, "middlewareFile": { "type": "string" }, "middlewareGroupsMetaJsonFile": { "type": "string" }, "permissionsFile": { "type": "string" }, "permissionsGroupsMetaJsonFile": { "type": "string" }, "bootstrapFile": { "type": "string" }, "packageFile": { "type": "string" }, "addonTypesFile": { "type": "string" }, "nodeTypesFile": { "type": "string" }, "secretTypesFile": { "type": "string" }, "secretsFile": { "type": "string" }, "secretsMetaJsonFile": { "type": "string" }, "credentialsFile": { "type": "string" }, "credentialsMetaJsonFile": { "type": "string" }, "variableTypesFile": { "type": "string" }, "variablesFile": { "type": "string" }, "variablesMetaJsonFile": { "type": "string" }, "$schema": { "type": "string" }, "extends": { "type": "string" }, "rootDir": { "type": "string" }, "runtimeDir": { "type": "string", "description": "Runtime artifacts directory (dev.db, content, tmp). Resolved relative to rootDir. Defaults to <rootDir>/.pikku-runtime." }, "srcDirectories": { "type": "array", "items": { "type": "string" } }, "ignoreFiles": { "type": "array", "items": { "type": "string" } }, "packageMappings": { "type": "object", "additionalProperties": { "type": "string" } }, "addon": { "anyOf": [{ "type": "boolean" }, { "type": "object", "properties": { "categories": { "type": "array", "items": { "type": "string" } }, "icon": { "type": "string" }, "displayName": { "type": "string" }, "description": { "type": "string" }, "openapi": { "type": "object", "properties": { "version": { "type": "string" }, "hash": { "type": "string" } }, "required": ["version", "hash"], "additionalProperties": false } }, "additionalProperties": false }] }, "addonName": { "type": "string" }, "configDir": { "type": "string" }, "tsconfig": { "type": "string" }, "clientFiles": { "type": "object", "properties": { "fetchFile": { "type": "string" }, "websocketFile": { "type": "string" }, "rpcWiringsFile": { "type": "string" }, "reactQueryFile": { "type": "string" }, "realtimeFile": { "type": "string" }, "realtimeEventHubTopicsImport": { "type": "string", "description": "Optional import for the EventHubTopics type so the realtime client is fully typed. Format: `<path>#<TypeName>` resolved relative to `realtimeFile`. Example: `../types/eventhub-topics.js#EventHubTopics`. If unset, the generated client treats topics as `Record<string, unknown>`." }, "queueWiringsFile": { "type": "string" }, "mcpJsonFile": { "type": "string" }, "nextBackendFile": { "type": "string" }, "nextHTTPFile": { "type": "string" }, "nextBackendTransport": { "type": "string", "enum": ["local", "worker-rpc", "http"], "description": "Transport used by the generated nextBackendFile wrapper.\n- `'local'` (default): function code is loaded in-process via bootstrap + createSingletonServices. Required for Node/dev runs.\n- `'worker-rpc'`: SSR dispatches every call through an injected `Fetcher` ({ fetch(req): Promise<Response> }). Function code is NOT bundled into the SSR worker. Pair with `nextBackendFetcherImport` to point at your resolver module.\n- `'http'`: SSR dispatches every call through the generated `PikkuFetch` client. Use this when your Next app should call a separately running local/server API instead of importing function code in-process." }, "nextBackendFetcherImport": { "type": "string", "description": "Module that exports a `fetcher: Fetcher` (or default export) used by the worker-RPC variant of the next backend wrapper. Resolved relative to `nextBackendFile`. Required when `nextBackendTransport === 'worker-rpc'`." }, "startServerFnsFile": { "type": "string", "description": "Emit a TanStack Start server-function shim into this file. The shim exports `makeApi(): PikkuRPC` — a typed caller over the generated RPC map for use in Start loaders, actions and components. It reads the API base URL from `import.meta.env.VITE_API_URL` (throws if unset). Requires `rpcWiringsFile` (where the `PikkuRPC` class is generated)." } }, "additionalProperties": false }, "emailTemplatesDir": { "type": "string", "description": "Directory containing email templates, locales, partials, and theme.json." }, "authFile": { "type": "string", "description": "Path to write the generated Better Auth wiring file (auth.gen.ts). Must be within srcDirectories so wireSecret calls are picked up by the inspector. Example: \"src/auth.gen.ts\"" }, "authTypesFile": { "type": "string", "description": "Path to write the generated typed `pikkuBetterAuth` re-export (auth.types.ts). Defaults to `{outDir}/auth/auth.types.ts`. Re-exported from `#pikku` so user code can `import { pikkuBetterAuth } from '#pikku'` with project-typed services." }, "authMetaJsonFile": { "type": "string", "description": "Path to write the generated Better Auth metadata (auth-meta.gen.json) — the enabled social providers and plugins the console SSO page reads via getAuthProviders. Defaults to `{outDir}/auth/pikku-auth-meta.gen.json`." }, "openAPI": { "type": "object", "properties": { "outputFile": { "type": "string" }, "additionalInfo": { "$ref": "#/definitions/OpenAPISpecInfo" } }, "required": ["outputFile", "additionalInfo"], "additionalProperties": false }, "schema": { "type": "object", "properties": { "additionalProperties": { "type": "boolean" }, "supportsImportAttributes": { "type": "boolean" } }, "additionalProperties": false }, "db": { "type": "object", "properties": { "engine": { "type": "string", "enum": ["sqlite", "postgres"] }, "pgVersion": { "type": "number" } }, "additionalProperties": false }, "cli": { "type": "object", "properties": { "entrypoints": { "type": "object", "additionalProperties": { "anyOf": [{ "type": "string" }, { "type": "object", "properties": { "type": { "type": "string", "const": "local" }, "path": { "type": "string" } }, "required": ["type", "path"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "channel" }, "name": { "type": "string" }, "route": { "type": "string" }, "wirePath": { "type": "string" }, "path": { "type": "string" } }, "required": ["type", "wirePath"], "additionalProperties": false }, { "type": "array", "items": { "anyOf": [{ "type": "string" }, { "type": "object", "properties": { "type": { "type": "string", "const": "local" }, "path": { "type": "string" } }, "required": ["type", "path"], "additionalProperties": false }, { "type": "object", "properties": { "type": { "type": "string", "const": "channel" }, "name": { "type": "string" }, "route": { "type": "string" }, "wirePath": { "type": "string" }, "path": { "type": "string" } }, "required": ["type", "wirePath"], "additionalProperties": false }] } }] } } }, "additionalProperties": false }, "workflows": { "type": "object", "properties": { "orchestratorQueue": { "type": "string" }, "workerQueue": { "type": "string" } }, "additionalProperties": false }, "scaffold": { "type": "object", "properties": { "addonDir": { "type": "string" }, "functionDir": { "type": "string" }, "wiringDir": { "type": "string" }, "middlewareDir": { "type": "string" }, "permissionDir": { "type": "string" }, "pikkuDir": { "type": "string" }, "rpc": { "$ref": "#/definitions/PikkuScaffoldFeature" }, "console": { "$ref": "#/definitions/PikkuScaffoldFeature" }, "agent": { "$ref": "#/definitions/PikkuScaffoldFeature" }, "workflow": { "$ref": "#/definitions/PikkuScaffoldFeature" }, "events": { "$ref": "#/definitions/PikkuScaffoldFeature" }, "remoteRpc": { "$ref": "#/definitions/PikkuScaffoldFeature" } }, "additionalProperties": false }, "addons": { "type": "object", "properties": { "addonDir": { "type": "string" } }, "additionalProperties": false, "description": "Community-registry addons installed via `pikku fabric addon add`. The source is copied into the project shadcn-style; each lands in `<addonDir>/<name>/` and the dir is registered as a yarn workspace so `wireAddon({ package })` resolves it by name. `addonDir` defaults to `addons` (top-level, outside the app's TS scan). Install provenance is tracked in pikku-addons.json." }, "tests": { "type": "object", "properties": { "outputDir": { "type": "string" } }, "additionalProperties": false }, "forceRequiredServices": { "type": "array", "items": { "type": "string" } }, "schemasFromTypes": { "type": "array", "items": { "type": "string" } }, "stateOutput": { "type": "string" }, "stateInput": { "type": "string" }, "verboseMeta": { "type": "boolean" }, "security": { "type": "boolean", "description": "Run the data-classification security lint (scans function return types for Private/Pii/Secret leaks). Off by default — it forces expensive return-type inference on every function and is not part of codegen. Enable here to always run it, or per-invocation via `pikku all --security`. Pair with `failOnError` to gate a build/CI on leaks." }, "lint": { "type": "object", "properties": { "servicesNotDestructured": { "type": "string", "enum": ["off", "warn", "error"] }, "wiresNotDestructured": { "type": "string", "enum": ["off", "warn", "error"] } }, "additionalProperties": false }, "addonMetaJsonFile": { "type": "string" }, "globalHTTPPrefix": { "type": "string" }, "binary": { "type": "object", "properties": { "entrypoint": { "type": "string" }, "output": { "type": "string" }, "targets": { "type": "array", "items": { "type": "string" } } }, "required": ["entrypoint", "output"], "additionalProperties": false }, "deploy": { "type": "object", "properties": { "providers": { "type": "object", "additionalProperties": { "type": "string" } }, "defaultProvider": { "type": "string" }, "serverlessIncompatible": { "type": "array", "items": { "type": "string" } }, "defaultTarget": { "type": "string", "enum": ["serverless", "server"], "description": "Default deploy target for functions that don't declare an explicit `deploy` flag and don't use a serverless-incompatible service. Defaults to 'serverless'." } }, "required": ["providers"], "additionalProperties": false }, "namedFilters": { "type": "object", "additionalProperties": { "$ref": "#/definitions/InspectorFilters" }, "description": "Named filter presets keyed by name, used via CLI --filter <name>." }, "filters": { "$ref": "#/definitions/InspectorFilters" } }, "required": ["addonTypesFile", "agentMapDeclarationFile", "agentTypesFile", "agentWiringMetaFile", "agentWiringMetaJsonFile", "agentWiringsFile", "bootstrapFile", "channelContractsMetaFile", "channelContractsMetaJsonFile", "channelsMapDeclarationFile", "channelsTypesFile", "channelsWiringFile", "channelsWiringMetaFile", "channelsWiringMetaJsonFile", "cliBootstrapFile", "cliContractsMetaFile", "cliContractsMetaJsonFile", "cliTypesFile", "cliWiringMetaFile", "cliWiringMetaJsonFile", "cliWiringsFile", "configDir", "consoleFunctionsFile", "credentialsFile", "credentialsMetaJsonFile", "eventsChannelFile", "filters", "functionTypesFile", "functionsFile", "functionsMetaFile", "functionsMetaJsonFile", "gatewaysWiringFile", "gatewaysWiringMetaFile", "gatewaysWiringMetaJsonFile", "httpContractsMetaFile", "httpContractsMetaJsonFile", "httpMapDeclarationFile", "httpTypesFile", "httpWiringMetaFile", "httpWiringMetaJsonFile", "httpWiringsFile", "mcpJsonFile", "mcpTypesFile", "mcpWiringsFile", "mcpWiringsMetaFile", "mcpWiringsMetaJsonFile", "middlewareFile", "middlewareGroupsMetaJsonFile", "nodeTypesFile", "outDir", "packageFile", "packageMappings", "permissionsFile", "permissionsGroupsMetaJsonFile", "publicAgentFile", "publicRpcFile", "queueMapDeclarationFile", "queueTypesFile", "queueWorkersWiringFile", "queueWorkersWiringMetaFile", "queueWorkersWiringMetaJsonFile", "rootDir", "rpcInternalMapDeclarationFile", "rpcInternalWiringMetaFile", "rpcInternalWiringMetaJsonFile", "rpcMapDeclarationFile", "schedulersTypesFile", "schedulersWiringFile", "schedulersWiringMetaFile", "schedulersWiringMetaJsonFile", "schemaDirectory", "secretTypesFile", "secretsFile", "secretsMetaJsonFile", "servicesFile", "srcDirectories", "triggerSourcesMetaFile", "triggerSourcesMetaJsonFile", "triggersTypesFile", "triggersWiringFile", "triggersWiringMetaFile", "triggersWiringMetaJsonFile", "tsconfig", "typesDeclarationFile", "variableTypesFile", "variablesFile", "variablesMetaJsonFile", "workflowMapDeclarationFile", "workflowMetaDir", "workflowRoutesFile", "workflowTypesFile", "workflowsWiringFile", "workflowsWiringMetaFile", "workflowsWorkersFile"], "definitions": { "OpenAPISpecInfo": { "type": "object", "properties": { "info": { "type": "object", "properties": { "title": { "type": "string" }, "version": { "type": "string" }, "description": { "type": "string" }, "termsOfService": { "type": "string" }, "contact": { "type": "object", "properties": { "name": { "type": "string" }, "url": { "type": "string" }, "email": { "type": "string" } }, "additionalProperties": false }, "license": { "type": "object", "properties": { "name": { "type": "string" }, "url": { "type": "string" } }, "required": ["name"], "additionalProperties": false } }, "required": ["title", "version", "description"], "additionalProperties": false }, "servers": { "type": "array", "items": { "type": "object", "properties": { "url": { "type": "string" }, "description": { "type": "string" } }, "required": ["url"], "additionalProperties": false } }, "tags": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" } }, "required": ["name"], "additionalProperties": false } }, "externalDocs": { "type": "object", "properties": { "description": { "type": "string" }, "url": { "type": "string" } }, "required": ["url"], "additionalProperties": false }, "securitySchemes": { "type": "object" }, "security": { "type": "array", "items": { "type": "object", "additionalProperties": { "type": "array", "items": {} } } } }, "required": ["info", "servers"], "additionalProperties": false }, "PikkuScaffoldFeature": { "type": ["string", "boolean"], "enum": ["auth", "no-auth", false] }, "InspectorFilters": { "type": "object", "properties": { "names": { "type": "array", "items": { "type": "string" } }, "tags": { "type": "array", "items": { "type": "string" } }, "wires": { "type": "array", "items": { "type": "string" } }, "directories": { "type": "array", "items": { "type": "string" } }, "httpRoutes": { "type": "array", "items": { "type": "string" } }, "httpMethods": { "type": "array", "items": { "type": "string" } }, "excludeNames": { "type": "array", "items": { "type": "string" } }, "excludeTags": { "type": "array", "items": { "type": "string" } }, "excludeWires": { "type": "array", "items": { "type": "string" } }, "excludeDirectories": { "type": "array", "items": { "type": "string" } }, "excludeHttpRoutes": { "type": "array", "items": { "type": "string" } }, "excludeHttpMethods": { "type": "array", "items": { "type": "string" } }, "target": { "type": "array", "items": { "type": "string", "enum": ["serverless", "server"] } }, "excludeTarget": { "type": "array", "items": { "type": "string", "enum": ["serverless", "server"] } }, "serverlessIncompatible": { "type": "array", "items": { "type": "string" } }, "defaultTarget": { "type": "string", "enum": ["serverless", "server"] } }, "additionalProperties": false } } }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.54
2
+ * This file was generated by @pikku/cli@0.12.56
3
3
  */
4
4
  export { wireSecret } from '@pikku/core/secret';
5
5
  export type { CoreSecret, SecretDefinitionMeta, SecretDefinitionsMeta } from '@pikku/core/secret';
@@ -1,4 +1,4 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.54
2
+ * This file was generated by @pikku/cli@0.12.56
3
3
  */
4
4
  export { wireSecret } from '@pikku/core/secret';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.54
2
+ * This file was generated by @pikku/cli@0.12.56
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.54
2
+ * This file was generated by @pikku/cli@0.12.56
3
3
  */
4
4
  import { TypedSecretService as CoreTypedSecretService } from '@pikku/core/services';
5
5
  const CREDENTIALS_META = {};
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.54
2
+ * This file was generated by @pikku/cli@0.12.56
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.54
2
+ * This file was generated by @pikku/cli@0.12.56
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.54
2
+ * This file was generated by @pikku/cli@0.12.56
3
3
  */
4
4
  export { wireVariable } from '@pikku/core/variable';
5
5
  export type { CoreVariable, VariableDefinitionMeta, VariableDefinitionsMeta } from '@pikku/core/variable';
@@ -1,4 +1,4 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.54
2
+ * This file was generated by @pikku/cli@0.12.56
3
3
  */
4
4
  export { wireVariable } from '@pikku/core/variable';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.54
2
+ * This file was generated by @pikku/cli@0.12.56
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.54
2
+ * This file was generated by @pikku/cli@0.12.56
3
3
  */
4
4
  import { TypedVariablesService as CoreTypedVariablesService } from '@pikku/core/services';
5
5
  const VARIABLES_META = {};
@@ -11,9 +11,15 @@
11
11
  "Bootstrap function types split": {
12
12
  "nodeId": "Bootstrap function types split",
13
13
  "rpcName": "pikkuFunctionTypesSplit",
14
- "next": "Bootstrap function types",
14
+ "next": "Bootstrap auth types",
15
15
  "stepHash": "124dd3d429c4"
16
16
  },
17
+ "Bootstrap auth types": {
18
+ "nodeId": "Bootstrap auth types",
19
+ "rpcName": "pikkuAuth",
20
+ "next": "Bootstrap function types",
21
+ "stepHash": "7448f14a2363"
22
+ },
17
23
  "Bootstrap function types": {
18
24
  "nodeId": "Bootstrap function types",
19
25
  "rpcName": "pikkuFunctionTypes",
@@ -244,7 +250,7 @@
244
250
  "nodeId": "Auth",
245
251
  "rpcName": "pikkuAuth",
246
252
  "next": "Secrets",
247
- "stepHash": "8c3f969be6b5"
253
+ "stepHash": "ebbac18854f3"
248
254
  },
249
255
  "Secrets": {
250
256
  "nodeId": "Secrets",
@@ -545,5 +551,5 @@
545
551
  "entryNodeIds": [
546
552
  "Bootstrap inspect"
547
553
  ],
548
- "graphHash": "e6e8c0ae99f8"
554
+ "graphHash": "7b64c5235ba0"
549
555
  }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.54
2
+ * This file was generated by @pikku/cli@0.12.56
3
3
  */
4
4
  import { WorkflowCancelledException } from '@pikku/core/workflow';
5
5
  import { template } from '@pikku/core/workflow';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.54
2
+ * This file was generated by @pikku/cli@0.12.56
3
3
  */
4
4
  import { WorkflowCancelledException } from '@pikku/core/workflow';
5
5
  import { template } from '@pikku/core/workflow';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * This file was generated by @pikku/cli@0.12.54
2
+ * This file was generated by @pikku/cli@0.12.56
3
3
  */
4
4
  import { pikkuState } from '@pikku/core/internal';
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.54
2
+ * This file was generated by @pikku/cli@0.12.56
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.54') {
15
- process.stderr.write(`\n Update available 0.12.54 → ${latest}\n brew upgrade pikku or npm install -g @pikku/cli\n\n`)
14
+ if (latest !== '0.12.56') {
15
+ process.stderr.write(`\n Update available 0.12.56 → ${latest}\n brew upgrade pikku or npm install -g @pikku/cli\n\n`)
16
16
  }
17
17
  } catch {}
18
18
  }
@@ -34,7 +34,7 @@ import { pikkuNewMiddleware } from './functions/commands/new-middleware.js';
34
34
  import { pikkuNewPermission } from './functions/commands/new-permission.js';
35
35
  import { pikkuNewAddon } from './functions/commands/new-addon.js';
36
36
  import { pikkuInfoFunctions, pikkuInfoTags, pikkuInfoMiddleware, pikkuInfoPermissions, } from './functions/commands/info.js';
37
- import { enableRpc, enableConsole, enableAgent, enableWorkflow, enableEvents, } from './functions/commands/enable.js';
37
+ import { enableRpc, enableConsole, enableAgent, enableWorkflow, enableEvents, enableRemoteRpc, } from './functions/commands/enable.js';
38
38
  import { pikkuRealtime } from './functions/wirings/realtime/pikku-command-realtime.js';
39
39
  import { binary } from './functions/commands/binary.js';
40
40
  import { deployPlan } from './functions/commands/deploy-plan.js';
@@ -67,6 +67,10 @@ wireCLI({
67
67
  default: false,
68
68
  short: 'j',
69
69
  },
70
+ security: {
71
+ description: 'Run the data-classification security lint (scans function return types for Private/Pii/Secret leaks). Off by default — it forces expensive return-type inference on every function. Combine with --fail-on-error to gate a build/CI.',
72
+ default: false,
73
+ },
70
74
  failOnError: {
71
75
  description: 'Fail the build on error-severity diagnostics (e.g. data-classification leaks). Default: only critical diagnostics fail.',
72
76
  default: false,
@@ -402,6 +406,16 @@ wireCLI({
402
406
  },
403
407
  },
404
408
  }),
409
+ 'remote-rpc': pikkuCLICommand({
410
+ func: enableRemoteRpc,
411
+ description: 'Enable the remote internal RPC queue worker + HTTP endpoint (scaffolds rpc-remote.gen.ts)',
412
+ options: {
413
+ noAuth: {
414
+ description: 'Disable auth requirement',
415
+ default: false,
416
+ },
417
+ },
418
+ }),
405
419
  },
406
420
  },
407
421
  new: {
@@ -12,6 +12,12 @@ export interface AnalyzerOptions {
12
12
  projectId: string;
13
13
  /** Services that can't run serverless — functions using them get target: 'server' */
14
14
  serverlessIncompatible?: string[];
15
+ /**
16
+ * Default deploy target for functions without an explicit `deploy` flag
17
+ * and no serverless-incompatible service. Sourced from `pikku.config.json`
18
+ * → `deploy.defaultTarget`. Defaults to 'serverless'.
19
+ */
20
+ defaultTarget?: 'serverless' | 'server';
15
21
  /**
16
22
  * When `true` (default), the analyzer synthesizes a per-workflow
17
23
  * orchestrator queue + a per-step queue, plus the matching producer
@@ -9,6 +9,7 @@
9
9
  import { resolveDeployTarget, } from '@pikku/inspector';
10
10
  export function analyzeDeployment(state, options) {
11
11
  const serverlessIncompatible = new Set(options.serverlessIncompatible ?? []);
12
+ const defaultTarget = options.defaultTarget ?? 'serverless';
12
13
  const workflowQueues = options.workflowQueues ?? true;
13
14
  const units = [];
14
15
  const queues = [];
@@ -118,7 +119,7 @@ export function analyzeDeployment(state, options) {
118
119
  units.push({
119
120
  name: toSafeKebab(funcId),
120
121
  role: 'function',
121
- target: resolveDeployTarget(funcMeta, serverlessIncompatible, funcId),
122
+ target: resolveDeployTarget(funcMeta, serverlessIncompatible, funcId, defaultTarget),
122
123
  functionIds: [funcId],
123
124
  services: collectServicesForFunction(funcMeta),
124
125
  dependsOn: [],
@@ -263,7 +264,7 @@ export function analyzeDeployment(state, options) {
263
264
  units.push({
264
265
  name: dep,
265
266
  role: 'function',
266
- target: resolveDeployTarget(funcMeta, serverlessIncompatible, funcId),
267
+ target: resolveDeployTarget(funcMeta, serverlessIncompatible, funcId, defaultTarget),
267
268
  functionIds: [funcId],
268
269
  services: collectServicesForFunction(funcMeta),
269
270
  dependsOn: [],
@@ -372,10 +373,10 @@ function buildWorkflows(graphMeta, functionsMeta, rpcMeta, _httpMeta, units, wor
372
373
  continue;
373
374
  const stepUnitName = toSafeKebab(node.rpcName);
374
375
  // Step dispatch is decided per-function: a step runs inline unless its
375
- // function opts out with `inline: false` (then it dispatches via queue).
376
+ // function is marked `workflowQueued: true` (then it dispatches via queue).
376
377
  const stepFuncId = rpcMeta[node.rpcName] ?? node.rpcName;
377
378
  const stepFuncMeta = functionsMeta[stepFuncId] ?? functionsMeta[node.rpcName];
378
- const isInline = stepFuncMeta?.inline !== false;
379
+ const isInline = stepFuncMeta?.workflowQueued !== true;
379
380
  steps.push({
380
381
  name: node.stepName ?? nodeId,
381
382
  inline: isInline,
@@ -6,7 +6,8 @@
6
6
  */
7
7
  import type { InspectorState } from '@pikku/inspector';
8
8
  import type { DeploymentManifest } from './analyzer/manifest.js';
9
- import type { BundleResult } from './bundler/index.js';
9
+ import type { Bundler } from './bundler/bundler.interface.js';
10
+ import type { BundleResult } from './bundler/types.js';
10
11
  import type { ProviderAdapter } from './provider-adapter.js';
11
12
  export interface BuildLogger {
12
13
  info(msg: string): void;
@@ -35,10 +36,13 @@ export declare function runBuildPipeline(options: {
35
36
  provider: ProviderAdapter;
36
37
  inspectorState: InspectorState;
37
38
  serverlessIncompatible?: string[];
39
+ defaultTarget?: 'serverless' | 'server';
38
40
  getEntryContext: (unitDir: string, pikkuDir: string, unit: DeploymentManifest['units'][0], state: InspectorState) => unknown;
39
41
  deployDir?: string;
40
42
  outDir?: string;
41
43
  /** Emit sourcemaps + per-unit `metafile.json` (debug-only). Default false. */
42
44
  debugArtifacts?: boolean;
43
45
  logger: BuildLogger;
46
+ /** Runtime-specific bundler (esbuild for node, Bun.build for bun). */
47
+ bundler: Bundler;
44
48
  }): Promise<BuildPipelineResult>;
@@ -9,7 +9,6 @@ import { existsSync } from 'node:fs';
9
9
  import { mkdir, writeFile, copyFile } from 'node:fs/promises';
10
10
  import { analyzeDeployment } from './analyzer/index.js';
11
11
  import { generatePerUnitCodegen } from './codegen/per-unit-codegen.js';
12
- import { bundleUnits } from './bundler/index.js';
13
12
  import { generateServerEntrySource, SERVER_DOCKERFILE, SERVER_DOCKERIGNORE, } from './server-entry.js';
14
13
  const MERGED_SERVER_UNIT_NAME = 'pikku-server-container';
15
14
  const UNITS_DIR_NAME = 'units';
@@ -38,7 +37,7 @@ function findLockfile(projectDir) {
38
37
  return null;
39
38
  }
40
39
  export async function runBuildPipeline(options) {
41
- const { projectDir, projectId, provider, inspectorState, getEntryContext, debugArtifacts, logger, } = options;
40
+ const { projectDir, projectId, provider, inspectorState, getEntryContext, debugArtifacts, logger, bundler, } = options;
42
41
  const deployDir = options.deployDir ?? join(projectDir, '.deploy');
43
42
  const providerDir = join(deployDir, provider.deployDirName);
44
43
  // Step 1: Analyze
@@ -46,6 +45,7 @@ export async function runBuildPipeline(options) {
46
45
  const manifest = analyzeDeployment(inspectorState, {
47
46
  projectId,
48
47
  serverlessIncompatible: options.serverlessIncompatible,
48
+ defaultTarget: options.defaultTarget,
49
49
  workflowQueues,
50
50
  });
51
51
  let bundled = [];
@@ -79,7 +79,7 @@ export async function runBuildPipeline(options) {
79
79
  await writeFile(entryPath, source, 'utf-8');
80
80
  const entryFiles = new Map();
81
81
  entryFiles.set(unitName, entryPath);
82
- const bundleResult = await bundleUnits(projectDir, manifest, entryFiles, providerDir, {
82
+ const bundleResult = await bundler.bundleUnits(projectDir, manifest, entryFiles, providerDir, {
83
83
  externals: provider.getExternals?.(),
84
84
  stubModules: provider.getStubModules?.(),
85
85
  aliases: provider.getAliases?.(),
@@ -206,7 +206,7 @@ export async function runBuildPipeline(options) {
206
206
  ...manifest,
207
207
  units: manifest.units.filter((u) => u.target !== 'server'),
208
208
  };
209
- const result = await bundleUnits(projectDir, serverlessManifestForBundle, serverlessEntryFiles, providerDir, {
209
+ const result = await bundler.bundleUnits(projectDir, serverlessManifestForBundle, serverlessEntryFiles, providerDir, {
210
210
  externals: provider.getExternals?.(),
211
211
  stubModules: provider.getStubModules?.(),
212
212
  aliases: provider.getAliases?.(),
@@ -231,7 +231,7 @@ export async function runBuildPipeline(options) {
231
231
  ...manifest,
232
232
  units: manifest.units.filter((u) => u.target === 'server'),
233
233
  };
234
- const result = await bundleUnits(projectDir, serverManifestForBundle, serverEntryFiles, providerDir, {
234
+ const result = await bundler.bundleUnits(projectDir, serverManifestForBundle, serverEntryFiles, providerDir, {
235
235
  externals: ['node:*'],
236
236
  aliases: undefined,
237
237
  define: undefined,
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Bun (Bun.build) bundler backend.
3
+ *
4
+ * Used when the CLI runs under Bun (bun projects). Bun resolves its own `.bun`
5
+ * store / per-workspace symlinks natively — esbuild's `nodePaths` walk assumes a
6
+ * hoisted root and can't — so no esbuild dependency is needed. Bun's metafile
7
+ * does NOT record external imports, so externals are captured via the resolve
8
+ * plugin instead (that capture drives per-unit dependency extraction).
9
+ */
10
+ import { BaseBundler } from './bundler.js';
11
+ import type { CompileInput, CompileResult } from './bundler.interface.js';
12
+ export declare class BunBundler extends BaseBundler {
13
+ protected compile(input: CompileInput): Promise<CompileResult>;
14
+ }
@@ -0,0 +1,121 @@
1
+ /**
2
+ * Bun (Bun.build) bundler backend.
3
+ *
4
+ * Used when the CLI runs under Bun (bun projects). Bun resolves its own `.bun`
5
+ * store / per-workspace symlinks natively — esbuild's `nodePaths` walk assumes a
6
+ * hoisted root and can't — so no esbuild dependency is needed. Bun's metafile
7
+ * does NOT record external imports, so externals are captured via the resolve
8
+ * plugin instead (that capture drives per-unit dependency extraction).
9
+ */
10
+ import { writeFile } from 'node:fs/promises';
11
+ import { BaseBundler } from './bundler.js';
12
+ function getBun() {
13
+ const bun = globalThis.Bun;
14
+ if (!bun) {
15
+ throw new Error('BunBundler used outside the Bun runtime');
16
+ }
17
+ return bun;
18
+ }
19
+ const pkgHead = (spec) => spec.startsWith('@')
20
+ ? spec.split('/').slice(0, 2).join('/')
21
+ : spec.split('/')[0];
22
+ /**
23
+ * Unified resolve plugin. Bun resolves its `.bun` store natively, so this plugin
24
+ * only replicates the option-driven behaviour the esbuild backend gets for free:
25
+ * - `aliases`: rewrite bare builtins to their `node:`-prefixed form (CF's
26
+ * nodejs_compat_v2 only resolves prefixed imports).
27
+ * - stub patterns (dead services + provider `stubModules`): empty module.
28
+ * - `externals`: keep external (node:*, cloudflare:*, declared npm deps) and
29
+ * CAPTURE the real npm package names — Bun's metafile omits external
30
+ * imports, so capture is how per-unit dependency extraction works.
31
+ */
32
+ function createBunResolvePlugin(opts) {
33
+ const { aliases, externals, stubPatterns, captured } = opts;
34
+ const externalMatchers = externals.map((pat) => {
35
+ if (pat.endsWith('*')) {
36
+ const prefix = pat.slice(0, -1);
37
+ return (s) => s.startsWith(prefix);
38
+ }
39
+ return (s) => s === pat || s.startsWith(pat + '/');
40
+ });
41
+ return {
42
+ name: 'pikku-bun-resolve',
43
+ setup(build) {
44
+ build.onResolve({ filter: /.*/ }, (args) => {
45
+ let path = args.path;
46
+ // Relative / absolute → let Bun resolve natively.
47
+ if (path.startsWith('.') || path.startsWith('/'))
48
+ return;
49
+ // Builtin alias (e.g. crypto → node:crypto).
50
+ if (aliases && aliases[path])
51
+ path = aliases[path];
52
+ // Dead/stubbed modules → empty module.
53
+ if (stubPatterns.some((re) => re.test(path))) {
54
+ return { path, namespace: 'pikku-stub' };
55
+ }
56
+ // node: builtins are always external (covers aliased builtins on CF).
57
+ if (path.startsWith('node:'))
58
+ return { path, external: true };
59
+ // Provider externals (cloudflare:*, declared npm deps).
60
+ if (externalMatchers.some((m) => m(path))) {
61
+ // Only real npm packages are install-time deps (skip scheme imports).
62
+ if (!path.includes(':'))
63
+ captured.add(pkgHead(path));
64
+ return { path, external: true };
65
+ }
66
+ // Everything else → Bun bundles it (resolving the .bun store natively).
67
+ return;
68
+ });
69
+ build.onLoad({ filter: /.*/, namespace: 'pikku-stub' }, () => ({
70
+ contents: 'export {}',
71
+ loader: 'js',
72
+ }));
73
+ },
74
+ };
75
+ }
76
+ export class BunBundler extends BaseBundler {
77
+ async compile(input) {
78
+ const captured = new Set();
79
+ const result = await getBun().build({
80
+ entrypoints: [input.entryPath],
81
+ target: input.platform === 'node' ? 'node' : 'browser',
82
+ format: input.format === 'cjs' ? 'cjs' : 'esm',
83
+ // identifiers:true is safe — pikku's only name-based reflection
84
+ // (error→status mapping) compares a class against an instance of the SAME
85
+ // (consistently-renamed) class, and workflow exceptions hardcode their
86
+ // `.name` string. So full minification preserves correctness.
87
+ minify: { whitespace: true, syntax: true, identifiers: true },
88
+ sourcemap: input.sourcemap ? 'external' : 'none',
89
+ define: input.define,
90
+ banner: input.bannerJs,
91
+ external: input.externals,
92
+ metafile: input.emitMetafile,
93
+ plugins: [
94
+ createBunResolvePlugin({
95
+ aliases: input.aliases,
96
+ externals: input.externals,
97
+ stubPatterns: input.deadPatterns,
98
+ captured,
99
+ }),
100
+ ],
101
+ });
102
+ if (!result.success) {
103
+ throw new Error(`Bun.build failed for unit "${input.unitName}":\n` +
104
+ result.logs.map((l) => String(l)).join('\n'));
105
+ }
106
+ const entryArtifact = result.outputs.find((o) => o.kind === 'entry-point') ?? result.outputs[0];
107
+ await writeFile(input.bundlePath, await entryArtifact.text(), 'utf-8');
108
+ if (input.sourcemap) {
109
+ const mapArtifact = result.outputs.find((o) => o.kind === 'sourcemap');
110
+ if (mapArtifact) {
111
+ await writeFile(`${input.bundlePath}.map`, await mapArtifact.text(), 'utf-8');
112
+ }
113
+ }
114
+ return {
115
+ externalPackages: captured,
116
+ metafileJson: input.emitMetafile && result.metafile
117
+ ? JSON.stringify(result.metafile, null, 2)
118
+ : undefined,
119
+ };
120
+ }
121
+ }