@rebasepro/cli 0.30.0 → 0.31.0-canary.g902a0ce

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 (285) hide show
  1. package/README.md +8 -7
  2. package/dist/{agent-setup-0uyfC7VX.js → agent-setup-DqAcoDcn.js} +10 -5
  3. package/dist/{agent-setup-0uyfC7VX.js.map → agent-setup-DqAcoDcn.js.map} +1 -1
  4. package/dist/{api-keys-Dfw5-9s1.js → api-keys-eIUjMqWn.js} +8 -7
  5. package/dist/api-keys-eIUjMqWn.js.map +1 -0
  6. package/dist/{apps-MKQbgDtN.js → apps-DExO4PEl.js} +8 -7
  7. package/dist/apps-DExO4PEl.js.map +1 -0
  8. package/dist/{project-CasK56vN.js → args-CaCcrYE1.js} +2 -351
  9. package/dist/args-CaCcrYE1.js.map +1 -0
  10. package/dist/{atlas-dev-database-BODqdCWt.js → atlas-dev-database-DOCKk6ht.js} +2 -2
  11. package/dist/{atlas-dev-database-BODqdCWt.js.map → atlas-dev-database-DOCKk6ht.js.map} +1 -1
  12. package/dist/{auth-Bv0rTbQX.js → auth-CyADghFQ.js} +7 -6
  13. package/dist/{auth-Bv0rTbQX.js.map → auth-CyADghFQ.js.map} +1 -1
  14. package/dist/backend-guard-C0mVkXBw.js +162 -0
  15. package/dist/backend-guard-C0mVkXBw.js.map +1 -0
  16. package/dist/{branch-pointer-BQUF6lYa.js → branch-pointer-DMPyvZoK.js} +1 -1
  17. package/dist/{build-BuKTnec8.js → build-CA5R07tw.js} +29 -9
  18. package/dist/build-CA5R07tw.js.map +1 -0
  19. package/dist/{bundle-BAH4FCju.js → bundle-DgILeA5b.js} +112 -138
  20. package/dist/bundle-DgILeA5b.js.map +1 -0
  21. package/dist/bundle.d.ts +35 -12
  22. package/dist/cli.d.ts +2 -2
  23. package/dist/{cloud-Cj5ey3l_.js → cloud-CYMk92iG.js} +217 -104
  24. package/dist/cloud-CYMk92iG.js.map +1 -0
  25. package/dist/cms-directories-BK3vcswg.js +33 -0
  26. package/dist/cms-directories-BK3vcswg.js.map +1 -0
  27. package/dist/codemod/collections-to-tables/ast.d.ts +135 -0
  28. package/dist/codemod/collections-to-tables/backend.d.ts +38 -0
  29. package/dist/codemod/collections-to-tables/command.d.ts +35 -0
  30. package/dist/codemod/collections-to-tables/comments.d.ts +45 -0
  31. package/dist/codemod/collections-to-tables/customization.d.ts +47 -0
  32. package/dist/codemod/collections-to-tables/dynamic-props.d.ts +34 -0
  33. package/dist/codemod/collections-to-tables/export-changes.d.ts +83 -0
  34. package/dist/codemod/collections-to-tables/firestore.d.ts +11 -0
  35. package/dist/codemod/collections-to-tables/helper-hooks.d.ts +41 -0
  36. package/dist/codemod/collections-to-tables/hooks.d.ts +44 -0
  37. package/dist/codemod/collections-to-tables/journal.d.ts +10 -0
  38. package/dist/codemod/collections-to-tables/legacy-shims.d.ts +52 -0
  39. package/dist/codemod/collections-to-tables/load-legacy.d.ts +81 -0
  40. package/dist/codemod/collections-to-tables/migrate.d.ts +20 -0
  41. package/dist/codemod/collections-to-tables/modules.d.ts +127 -0
  42. package/dist/codemod/collections-to-tables/moved-imports.d.ts +70 -0
  43. package/dist/codemod/collections-to-tables/moved-symbols.generated.d.ts +12 -0
  44. package/dist/codemod/collections-to-tables/own.d.ts +10 -0
  45. package/dist/codemod/collections-to-tables/path-aliases.d.ts +26 -0
  46. package/dist/codemod/collections-to-tables/plan-context.d.ts +49 -0
  47. package/dist/codemod/collections-to-tables/print-js.d.ts +44 -0
  48. package/dist/codemod/collections-to-tables/project-files.d.ts +144 -0
  49. package/dist/codemod/collections-to-tables/repoint.d.ts +50 -0
  50. package/dist/codemod/collections-to-tables/row-hands.d.ts +7 -0
  51. package/dist/codemod/collections-to-tables/sdk-calls.d.ts +88 -0
  52. package/dist/codemod/collections-to-tables/skills-step.d.ts +13 -0
  53. package/dist/codemod/collections-to-tables/split-constants.d.ts +42 -0
  54. package/dist/codemod/collections-to-tables/storage-paths.d.ts +28 -0
  55. package/dist/codemod/collections-to-tables/types.d.ts +164 -0
  56. package/dist/codemod/collections-to-tables/verify.d.ts +27 -0
  57. package/dist/codemod/collections-to-tables/vocabulary.d.ts +40 -0
  58. package/dist/command-D5lhW_-B.js +9984 -0
  59. package/dist/command-D5lhW_-B.js.map +1 -0
  60. package/dist/commands/agent-setup.d.ts +6 -2
  61. package/dist/commands/cloud/auth.d.ts +2 -0
  62. package/dist/commands/cloud/context.d.ts +1 -1
  63. package/dist/commands/cloud/init.d.ts +2 -2
  64. package/dist/commands/cloud/login-flow.d.ts +30 -1
  65. package/dist/commands/console.d.ts +1 -2
  66. package/dist/commands/db.d.ts +5 -6
  67. package/dist/commands/dev.d.ts +18 -17
  68. package/dist/commands/doctor.d.ts +4 -5
  69. package/dist/commands/eject.d.ts +17 -13
  70. package/dist/commands/generate-view.d.ts +20 -9
  71. package/dist/commands/generate_sdk.d.ts +27 -27
  72. package/dist/commands/init.d.ts +21 -8
  73. package/dist/commands/migrate.d.ts +24 -0
  74. package/dist/commands/schema-reconcile.d.ts +1 -1
  75. package/dist/commands/skills.d.ts +8 -0
  76. package/dist/commands/verify-cms.d.ts +28 -0
  77. package/dist/commands/verify.d.ts +14 -9
  78. package/dist/{consent-BD7F29T3.js → consent-BXLIrMl8.js} +2 -2
  79. package/dist/{consent-BD7F29T3.js.map → consent-BXLIrMl8.js.map} +1 -1
  80. package/dist/{console-CdwIYOMV.js → console-CMjhgMUE.js} +14 -14
  81. package/dist/console-CMjhgMUE.js.map +1 -0
  82. package/dist/{context-AXdAh-q8.js → context--JwaHaZp.js} +6 -5
  83. package/dist/context--JwaHaZp.js.map +1 -0
  84. package/dist/{daemon-Cp7oNXth.js → daemon-w30PsdwV.js} +2 -2
  85. package/dist/{daemon-Cp7oNXth.js.map → daemon-w30PsdwV.js.map} +1 -1
  86. package/dist/{db-DBbKpjYX.js → db-A7XDCIIO.js} +51 -51
  87. package/dist/db-A7XDCIIO.js.map +1 -0
  88. package/dist/{derive-ae9UOoOB.js → derive-C3ezmY-p.js} +105 -133
  89. package/dist/derive-C3ezmY-p.js.map +1 -0
  90. package/dist/dev-db/attver.d.ts +11 -0
  91. package/dist/{dev-preflight-Cxv3TiD1.js → dev-preflight-DjvcV6SK.js} +5 -5
  92. package/dist/dev-preflight-DjvcV6SK.js.map +1 -0
  93. package/dist/{dev-server-OJsUGZEB.js → dev-server-BLxCbQEP.js} +2 -2
  94. package/dist/{dev-server-OJsUGZEB.js.map → dev-server-BLxCbQEP.js.map} +1 -1
  95. package/dist/{dev-C93d4QIv.js → dev-tWwPyWkQ.js} +142 -84
  96. package/dist/dev-tWwPyWkQ.js.map +1 -0
  97. package/dist/{doctor-BBPQUO2g.js → doctor-BBM0dWvZ.js} +39 -62
  98. package/dist/doctor-BBM0dWvZ.js.map +1 -0
  99. package/dist/doctor-environment.d.ts +6 -6
  100. package/dist/{eject-DABcDnPN.js → eject-Bhzd6hgb.js} +25 -16
  101. package/dist/eject-Bhzd6hgb.js.map +1 -0
  102. package/dist/{fold-static-BWzxNn06.js → fold-static-CKewnAPX.js} +5 -3
  103. package/dist/fold-static-CKewnAPX.js.map +1 -0
  104. package/dist/{generate-view-IFwCADvb.js → generate-view-CTOluXvH.js} +160 -89
  105. package/dist/generate-view-CTOluXvH.js.map +1 -0
  106. package/dist/{generate_sdk-DNmNuFuW.js → generate_sdk-De-aLC1L.js} +120 -137
  107. package/dist/generate_sdk-De-aLC1L.js.map +1 -0
  108. package/dist/import-schema-module-Df67TIWj.js +51 -0
  109. package/dist/import-schema-module-Df67TIWj.js.map +1 -0
  110. package/dist/index.es.js +64 -51
  111. package/dist/index.es.js.map +1 -1
  112. package/dist/{init-vL1DWOeC.js → init-Dtl-IcXf.js} +83 -80
  113. package/dist/init-Dtl-IcXf.js.map +1 -0
  114. package/dist/last-dev-database-Dc8cP01o.js +2 -0
  115. package/dist/{manifest-BtzDy7KQ.js → manifest-C3uLDrrJ.js} +115 -40
  116. package/dist/manifest-C3uLDrrJ.js.map +1 -0
  117. package/dist/manifest.d.ts +79 -24
  118. package/dist/migrate-VrKoi3nB.js +138 -0
  119. package/dist/migrate-VrKoi3nB.js.map +1 -0
  120. package/dist/{normalize-imports-Bd5Y4yLp.js → normalize-imports-DwxqEMYq.js} +3 -3
  121. package/dist/{normalize-imports-Bd5Y4yLp.js.map → normalize-imports-DwxqEMYq.js.map} +1 -1
  122. package/dist/path-flags-7O5uPBcQ.js +139 -0
  123. package/dist/path-flags-7O5uPBcQ.js.map +1 -0
  124. package/dist/{prepare-CTw9NEkh.js → prepare-Ccxspoj-.js} +4 -4
  125. package/dist/{prepare-CTw9NEkh.js.map → prepare-Ccxspoj-.js.map} +1 -1
  126. package/dist/project-CLcF5i8c.js +360 -0
  127. package/dist/project-CLcF5i8c.js.map +1 -0
  128. package/dist/project-schema-CsSOG2gE.js +30 -0
  129. package/dist/project-schema-CsSOG2gE.js.map +1 -0
  130. package/dist/{pull-DDMpsZ5r.js → pull-D9WvpDYY.js} +189 -1
  131. package/dist/pull-D9WvpDYY.js.map +1 -0
  132. package/dist/resolve-BY7bSFRT.js +2 -0
  133. package/dist/resources/derive.d.ts +19 -13
  134. package/dist/{resources-CPSC5Kcu.js → resources-Dpfs2y8P.js} +5 -4
  135. package/dist/{resources-CPSC5Kcu.js.map → resources-Dpfs2y8P.js.map} +1 -1
  136. package/dist/{schema-DtLPsXbT.js → schema-DwFDI1iU.js} +41 -39
  137. package/dist/schema-DwFDI1iU.js.map +1 -0
  138. package/dist/schema-dir-Cd1kvYbf.js +98 -0
  139. package/dist/schema-dir-Cd1kvYbf.js.map +1 -0
  140. package/dist/schema-reconcile-Tto54Qbv.js +2 -0
  141. package/dist/schema-text-CpNrsuMe.js +73 -0
  142. package/dist/schema-text-CpNrsuMe.js.map +1 -0
  143. package/dist/{skills-CbwV6vw_.js → skills-CXjA9TWw.js} +54 -10
  144. package/dist/skills-CXjA9TWw.js.map +1 -0
  145. package/dist/{start-YOr3X5Zm.js → start-Bwbtt2W5.js} +7 -10
  146. package/dist/{start-YOr3X5Zm.js.map → start-Bwbtt2W5.js.map} +1 -1
  147. package/dist/{status-BREvtzJm.js → status-DQ_PPz4C.js} +12 -12
  148. package/dist/status-DQ_PPz4C.js.map +1 -0
  149. package/dist/{storage-CO9ouK76.js → storage-iTqj5-Av.js} +12 -11
  150. package/dist/storage-iTqj5-Av.js.map +1 -0
  151. package/dist/{telemetry-DwK5RQJl.js → telemetry-BP_1Cl9r.js} +4 -4
  152. package/dist/{telemetry-DwK5RQJl.js.map → telemetry-BP_1Cl9r.js.map} +1 -1
  153. package/dist/{telemetry-CgwJPVMO.js → telemetry-M3HjlyhZ.js} +2 -2
  154. package/dist/{telemetry-CgwJPVMO.js.map → telemetry-M3HjlyhZ.js.map} +1 -1
  155. package/dist/{upgrade-B7sVwL8S.js → upgrade-oZzJ13jM.js} +5 -4
  156. package/dist/{upgrade-B7sVwL8S.js.map → upgrade-oZzJ13jM.js.map} +1 -1
  157. package/dist/utils/backend-guard.d.ts +47 -0
  158. package/dist/utils/cms-directories.d.ts +6 -0
  159. package/dist/utils/dev-preflight.d.ts +2 -2
  160. package/dist/utils/import-schema-module.d.ts +16 -0
  161. package/dist/utils/path-flags.d.ts +35 -16
  162. package/dist/utils/project-schema.d.ts +40 -0
  163. package/dist/utils/project.d.ts +8 -2
  164. package/dist/utils/schema-dir.d.ts +32 -0
  165. package/dist/utils/schema-drift.d.ts +6 -0
  166. package/dist/utils/schema-text.d.ts +24 -0
  167. package/dist/verify-DkJqhYPI.js +1160 -0
  168. package/dist/verify-DkJqhYPI.js.map +1 -0
  169. package/package.json +11 -8
  170. package/runtime/dev-server.mjs +5 -1
  171. package/templates/eject/Dockerfile +1 -4
  172. package/templates/eject/backend/src/env.ts +1 -1
  173. package/templates/eject/backend/src/index.ts +53 -40
  174. package/templates/eject/docker-compose.custom.yml +1 -1
  175. package/templates/overlays/baas/README.md +39 -12
  176. package/templates/overlays/baas/ai-instructions.md +8 -8
  177. package/templates/overlays/baas/{config → backend}/storage.ts +3 -4
  178. package/templates/overlays/baas/backend/tsconfig.json +10 -12
  179. package/templates/overlays/baas/package.json +1 -2
  180. package/templates/overlays/baas/pnpm-workspace.yaml +0 -1
  181. package/templates/presets/blank/backend/schema/index.ts +19 -0
  182. package/templates/presets/blank/frontend/src/App.tsx +56 -0
  183. package/templates/presets/ecommerce/backend/schema/categories.ts +12 -0
  184. package/templates/presets/ecommerce/backend/schema/index.ts +23 -0
  185. package/templates/presets/ecommerce/backend/schema/orders.ts +13 -0
  186. package/templates/presets/ecommerce/backend/schema/products.ts +18 -0
  187. package/templates/presets/ecommerce/frontend/src/App.tsx +59 -0
  188. package/templates/presets/ecommerce/frontend/src/cms/categories.tsx +12 -0
  189. package/templates/presets/ecommerce/frontend/src/cms/orders.tsx +38 -0
  190. package/templates/presets/ecommerce/frontend/src/cms/products.tsx +27 -0
  191. package/templates/resource-graphs/blank.json +2 -2
  192. package/templates/resource-graphs/blog.json +5 -5
  193. package/templates/resource-graphs/ecommerce.json +5 -5
  194. package/templates/resource-graphs/headless.json +1 -1
  195. package/templates/template/.claude/hooks/post-edit-collection.sh +27 -23
  196. package/templates/template/.cursorrules +2 -2
  197. package/templates/template/.env.example +6 -17
  198. package/templates/template/.github/copilot-instructions.md +2 -2
  199. package/templates/template/.windsurfrules +2 -2
  200. package/templates/template/AGENTS.md +2 -2
  201. package/templates/template/CLAUDE.md +2 -2
  202. package/templates/template/README.md +47 -13
  203. package/templates/template/ai-instructions.md +15 -14
  204. package/templates/template/backend/functions/hello.ts +1 -1
  205. package/templates/template/backend/package.json +0 -2
  206. package/templates/template/{config → backend}/resources.ts +3 -3
  207. package/templates/template/backend/schema/authors.ts +11 -0
  208. package/templates/template/backend/schema/index.ts +29 -0
  209. package/templates/template/backend/schema/posts.ts +29 -0
  210. package/templates/template/backend/schema/tags.ts +9 -0
  211. package/templates/template/backend/schema/users.ts +32 -0
  212. package/templates/template/{config → backend}/storage.ts +4 -4
  213. package/templates/template/backend/tsconfig.json +15 -20
  214. package/templates/template/docker-compose.yml +3 -3
  215. package/templates/template/frontend/package.json +0 -2
  216. package/templates/template/frontend/src/App.tsx +10 -4
  217. package/templates/template/frontend/src/cms/authors.tsx +7 -0
  218. package/templates/template/frontend/src/cms/posts.tsx +27 -0
  219. package/templates/template/frontend/src/cms/tags.tsx +11 -0
  220. package/templates/template/frontend/src/cms/ui-config.json +3 -0
  221. package/templates/template/frontend/src/cms/users.tsx +54 -0
  222. package/templates/template/frontend/src/{virtual.d.ts → vite-env.d.ts} +0 -4
  223. package/templates/template/frontend/vite.config.ts +6 -2
  224. package/templates/template/gitignore +1 -1
  225. package/templates/template/package.json +1 -2
  226. package/templates/template/pnpm-workspace.yaml +0 -1
  227. package/templates/template/scripts/example.ts +3 -3
  228. package/templates/template/tsconfig.json +1 -1
  229. package/templates/views/AppView.tsx.tmpl +4 -4
  230. package/templates/views/EntityView.tsx.tmpl +3 -4
  231. package/dist/api-keys-Dfw5-9s1.js.map +0 -1
  232. package/dist/apps-MKQbgDtN.js.map +0 -1
  233. package/dist/build-BuKTnec8.js.map +0 -1
  234. package/dist/bundle-BAH4FCju.js.map +0 -1
  235. package/dist/cloud-Cj5ey3l_.js.map +0 -1
  236. package/dist/collection-drift-BKj_BoMq.js +0 -106
  237. package/dist/collection-drift-BKj_BoMq.js.map +0 -1
  238. package/dist/collections-dir-DlvDhime.js +0 -69
  239. package/dist/collections-dir-DlvDhime.js.map +0 -1
  240. package/dist/console-CdwIYOMV.js.map +0 -1
  241. package/dist/context-AXdAh-q8.js.map +0 -1
  242. package/dist/db-DBbKpjYX.js.map +0 -1
  243. package/dist/derive-ae9UOoOB.js.map +0 -1
  244. package/dist/dev-C93d4QIv.js.map +0 -1
  245. package/dist/dev-preflight-Cxv3TiD1.js.map +0 -1
  246. package/dist/doctor-BBPQUO2g.js.map +0 -1
  247. package/dist/eject-DABcDnPN.js.map +0 -1
  248. package/dist/fold-static-BWzxNn06.js.map +0 -1
  249. package/dist/generate-view-IFwCADvb.js.map +0 -1
  250. package/dist/generate_sdk-DNmNuFuW.js.map +0 -1
  251. package/dist/init-vL1DWOeC.js.map +0 -1
  252. package/dist/last-dev-database-DpW5dfoX.js +0 -2
  253. package/dist/manifest-BtzDy7KQ.js.map +0 -1
  254. package/dist/path-flags-DNvtEi2-.js +0 -92
  255. package/dist/path-flags-DNvtEi2-.js.map +0 -1
  256. package/dist/project-CasK56vN.js.map +0 -1
  257. package/dist/pull-DDMpsZ5r.js.map +0 -1
  258. package/dist/resolve-D647F1LA.js +0 -2
  259. package/dist/schema-DtLPsXbT.js.map +0 -1
  260. package/dist/schema-reconcile-DkArN9jF.js +0 -2
  261. package/dist/skills-CbwV6vw_.js.map +0 -1
  262. package/dist/status-BREvtzJm.js.map +0 -1
  263. package/dist/storage-CO9ouK76.js.map +0 -1
  264. package/dist/utils/collection-drift.d.ts +0 -27
  265. package/dist/utils/collections-dir.d.ts +0 -14
  266. package/dist/verify-Y3rWSgfA.js +0 -730
  267. package/dist/verify-Y3rWSgfA.js.map +0 -1
  268. package/templates/overlays/baas/config/index.ts +0 -24
  269. package/templates/overlays/baas/config/package.json +0 -30
  270. package/templates/template/config/cms.d.ts +0 -15
  271. package/templates/template/config/collections/authors.ts +0 -47
  272. package/templates/template/config/collections/index.ts +0 -44
  273. package/templates/template/config/collections/posts.ts +0 -94
  274. package/templates/template/config/collections/presets/blank/index.ts +0 -5
  275. package/templates/template/config/collections/presets/ecommerce/categories.ts +0 -42
  276. package/templates/template/config/collections/presets/ecommerce/index.ts +0 -31
  277. package/templates/template/config/collections/presets/ecommerce/orders.ts +0 -78
  278. package/templates/template/config/collections/presets/ecommerce/products.ts +0 -73
  279. package/templates/template/config/collections/tags.ts +0 -27
  280. package/templates/template/config/collections/users.ts +0 -149
  281. package/templates/template/config/frontend-assets.d.ts +0 -17
  282. package/templates/template/config/index.ts +0 -12
  283. package/templates/template/config/package.json +0 -30
  284. package/templates/template/config/tsconfig.json +0 -35
  285. /package/templates/eject/{config → backend}/resources.ts +0 -0
@@ -1,14 +1,14 @@
1
- import { i as recordEvent, l as durationBucket } from "./telemetry-CgwJPVMO.js";
1
+ import { i as recordEvent, l as durationBucket } from "./telemetry-M3HjlyhZ.js";
2
2
  import { n as getPMCommands, t as detectPackageManager } from "./package-manager-DSEOwTqM.js";
3
- import { w as wantsHelp, x as parseCommandArgs } from "./project-CasK56vN.js";
3
+ import { a as wantsHelp, n as parseCommandArgs } from "./args-CaCcrYE1.js";
4
4
  import { n as cliVersion } from "./version-Buyyo1ut.js";
5
- import { AGENTS, AGENT_KEYS, reportRootPointers, resolveAgentNames, t as writeRootPointers } from "./skills-CbwV6vw_.js";
6
- import { configureAgents, printAgentSetup, promptForAgents, retargetScaffoldMcpConfig } from "./agent-setup-0uyfC7VX.js";
7
- import { $ as resolveCloudUrl, ct as writeLink } from "./context-AXdAh-q8.js";
5
+ import { c as reportRootPointers, d as writeRootPointers, l as resolveAgentNames, n as AGENT_KEYS, t as AGENTS } from "./skills-CXjA9TWw.js";
6
+ import { configureAgents, printAgentSetup, promptForAgents, retargetScaffoldMcpConfig } from "./agent-setup-DqAcoDcn.js";
7
+ import { $ as resolveCloudUrl, ct as writeLink } from "./context--JwaHaZp.js";
8
8
  import { t as Refusal } from "./refusal-ReeeGP8a.js";
9
- import { r as dockerClaimedPorts } from "./dev-preflight-Cxv3TiD1.js";
9
+ import { r as dockerClaimedPorts } from "./dev-preflight-DjvcV6SK.js";
10
10
  import { t as invokedRebaseCommand } from "./invoked-command-CG_rIa_o.js";
11
- import { n as promptForConsent } from "./consent-BD7F29T3.js";
11
+ import { n as promptForConsent } from "./consent-BXLIrMl8.js";
12
12
  import chalk from "chalk";
13
13
  import fs from "fs";
14
14
  import path from "path";
@@ -53,7 +53,6 @@ var TEMPLATE_PLACEHOLDER_FILES = [
53
53
  "package.json",
54
54
  "frontend/package.json",
55
55
  "backend/package.json",
56
- "config/package.json",
57
56
  "frontend/index.html",
58
57
  "pnpm-workspace.yaml",
59
58
  "docker-compose.yml",
@@ -71,15 +70,16 @@ function validateProjectName(name) {
71
70
  * A boolean, not a named pair. It was `--flavor cms|baas`, and neither word
72
71
  * survived what they described: "cms" is a product category rather than a thing
73
72
  * this tool builds, and "baas" was the same value that used to appear as
74
- * `backend.mode` — which is now derived from whether collections are declared.
75
- * What is left is one question: does this project get an admin UI?
73
+ * `backend.mode` — which is now derived from whether tables are declared in
74
+ * `backend/schema/`. What is left is one question: does this project get an
75
+ * admin UI?
76
76
  */
77
77
  var HEADLESS_CHOICES = [{
78
- name: "Backend + admin — API plus an admin UI, driven by collections you define (like Payload/Directus)",
78
+ name: "Backend + admin — API plus an admin UI, over tables you define in backend/schema (like Payload/Directus)",
79
79
  value: false,
80
80
  short: "Backend + admin"
81
81
  }, {
82
- name: "Backend only — headless API over your database. No collections, no UI (like Supabase)",
82
+ name: "Backend only — headless API over your database. No schema files, no UI (like Supabase)",
83
83
  value: true,
84
84
  short: "Backend only"
85
85
  }];
@@ -177,7 +177,7 @@ function buildInitQuestions(params) {
177
177
  questions.push({
178
178
  type: "confirm",
179
179
  name: "introspect",
180
- message: "Would you like to introspect this database to automatically generate collections?",
180
+ message: "Would you like to introspect this database to generate backend/schema from its tables?",
181
181
  default: true,
182
182
  when: (answers) => !!answers.databaseUrl?.trim()
183
183
  });
@@ -206,7 +206,7 @@ ${chalk.bold("Usage")}
206
206
 
207
207
  ${chalk.bold("Options")}
208
208
  ${chalk.blue("-t, --template")} ${chalk.gray("<preset>")} blog | ecommerce | blank ${chalk.gray("(default: blog)")}
209
- ${chalk.blue("--headless")} Backend only — no admin panel, no collections
209
+ ${chalk.blue("--headless")} Backend only — no admin panel, no backend/schema
210
210
  ${chalk.blue("-y, --yes")} Never prompt ${chalk.gray("(required for CI / non-TTY)")}: take every default,
211
211
  ${chalk.gray("except that git init and the install are skipped unless")}
212
212
  ${chalk.gray("--git / --install is passed")}
@@ -216,7 +216,7 @@ ${chalk.bold("Options")}
216
216
  ${chalk.blue("-g, --git")} Initialize a git repository and make an initial commit.
217
217
  ${chalk.gray("Without it, init asks (default yes); under --yes, no repository")}
218
218
  ${chalk.blue("--database-url")} ${chalk.gray("<url>")} Use an existing database instead of the generated one
219
- ${chalk.blue("--introspect")} Generate collections from that database ${chalk.gray("(implies --template blank; needs --install)")}
219
+ ${chalk.blue("--introspect")} Generate backend/schema from that database ${chalk.gray("(implies --template blank; needs --install)")}
220
220
  ${chalk.blue("--project")} ${chalk.gray("<slug>")} Link the scaffold to a Rebase Cloud project
221
221
  ${chalk.blue("--setup-key")} ${chalk.gray("<key>")} One-time key authenticating the cloud link ${chalk.gray("(use with --project)")}
222
222
  ${chalk.blue("-a, --agent")} ${chalk.gray("<name>")} Set up an AI coding agent: Rebase skills + the MCP server.
@@ -225,9 +225,9 @@ ${chalk.bold("Options")}
225
225
  ${chalk.gray("machine; under --yes, none unless named.")}
226
226
 
227
227
  ${chalk.bold("What gets scaffolded")}
228
- ${chalk.gray("default")} Backend + an admin UI, driven by collections you define ${chalk.gray("(like Payload/Directus)")}
229
- ${chalk.blue("--headless")} Backend only, over your existing database ${chalk.gray("(like Supabase)")}
230
- ${chalk.gray("--template has no effect: there are no collections to seed.")}
228
+ ${chalk.gray("default")} backend/ (tables in backend/schema) + frontend/ (the admin UI) ${chalk.gray("(like Payload/Directus)")}
229
+ ${chalk.blue("--headless")} backend/ only, over your existing database ${chalk.gray("(like Supabase)")}
230
+ ${chalk.gray("--template has no effect: there are no tables to seed.")}
231
231
 
232
232
  ${chalk.bold("Examples")}
233
233
  ${chalk.gray("$")} rebase init my-shop --template ecommerce --install
@@ -506,7 +506,7 @@ async function linkScaffoldToCloud(options) {
506
506
  * new scaffold whose first `git status` is dirty invites the reader to conclude
507
507
  * the lockfile is deliberately ignored and never commit it at all.
508
508
  *
509
- * Introspection has the same shape: it generates `config/collections` and
509
+ * Introspection has the same shape: it generates `backend/schema` and
510
510
  * `schema.generated.ts`, which belong in the commit describing the scaffold that
511
511
  * produced them.
512
512
  *
@@ -560,7 +560,7 @@ function initNextSteps(input) {
560
560
  if (!installed) lines.push(cmd(pm.install));
561
561
  lines.push("");
562
562
  if (introspected) {
563
- lines.push(note("Database has been introspected & collections generated!"));
563
+ lines.push(note("Database introspected: its tables are in backend/schema."));
564
564
  lines.push(note(headless ? "Start the API over it:" : "Start the development server (frontend + backend):"));
565
565
  lines.push(runDev);
566
566
  } else if (introspect) {
@@ -606,7 +606,7 @@ function initNextSteps(input) {
606
606
  lines.push(note("In production (docker compose) that window is shut and the account named by"));
607
607
  lines.push(note("REBASE_ADMIN_EMAIL in .env is created at boot instead."));
608
608
  lines.push("");
609
- lines.push(headless ? introspected ? chalk.gray("This starts a headless API (Hono + PostgreSQL) over the collections just ") + chalk.gray("generated from your database in config/collections. Edit them to change what the ") + chalk.gray("API exposes; docs are at /api/swagger.") : chalk.gray("This starts a headless API (Hono + PostgreSQL). There are no collection files: ") + chalk.gray("the API is derived from your database schema. Once it serves a table, docs are at /api/swagger.") : chalk.gray("This starts both the backend (Hono + PostgreSQL)") + chalk.gray(" and the frontend (Vite + React) concurrently."));
609
+ lines.push(headless ? introspected ? chalk.gray("This starts a headless API (Hono + PostgreSQL) over the tables just ") + chalk.gray("generated from your database in backend/schema. Edit them to change what the ") + chalk.gray("API exposes; its OpenAPI document is /api/docs for signed-in callers (Swagger UI: set REBASE_ENABLE_SWAGGER=true).") : chalk.gray("This starts a headless API (Hono + PostgreSQL). There is no backend/schema: ") + chalk.gray("the API is derived from your database schema. Once it serves a table, its OpenAPI document is /api/docs for signed-in callers (Swagger UI: set REBASE_ENABLE_SWAGGER=true).") : chalk.gray("This starts both the backend (Hono + PostgreSQL)") + chalk.gray(" and the frontend (Vite + React) concurrently."));
610
610
  return lines;
611
611
  }
612
612
  /**
@@ -760,10 +760,10 @@ async function createProject(options) {
760
760
  const shipped = path.join(options.targetDirectory, from);
761
761
  if (fs.existsSync(shipped)) fs.renameSync(shipped, path.join(options.targetDirectory, to));
762
762
  }
763
- if (options.headless && options.explicitPreset) console.log(chalk.yellow(` Ignoring --template ${options.preset}: a headless project declares no collections.`));
763
+ if (options.headless && options.explicitPreset) console.log(chalk.yellow(` Ignoring --template ${options.preset}: a headless project declares no tables (no backend/schema).`));
764
764
  let applied = null;
765
765
  if (!options.headless) {
766
- if (options.introspect && options.preset !== "blank") console.log(chalk.gray(" Using the blank template: collections will come from your database."));
766
+ if (options.introspect && options.preset !== "blank") console.log(chalk.gray(" Using the blank template: backend/schema will come from your database."));
767
767
  applied = await applyPreset(options.targetDirectory, options.introspect ? "blank" : options.preset);
768
768
  writeShippedSchema(options.targetDirectory, applied);
769
769
  }
@@ -806,7 +806,7 @@ async function createProject(options) {
806
806
  if (options.introspect) {
807
807
  console.log("");
808
808
  if (options.installDeps) {
809
- console.log(chalk.gray(" Introspecting database and generating collections..."));
809
+ console.log(chalk.gray(" Introspecting the database into backend/schema..."));
810
810
  console.log("");
811
811
  try {
812
812
  await execa(execCmd[0], execCmd.slice(1), {
@@ -867,27 +867,22 @@ async function createProject(options) {
867
867
  if (await promptForConsent({ reAskDeclined: true })) await recordEvent("cli.init", initProperties, { projectRoot: options.targetDirectory });
868
868
  }
869
869
  /**
870
- * Apply a template preset by replacing the default collection files.
871
- *
872
- * The template ships with blog collections at the top level and
873
- * preset alternatives under `config/collections/presets/<name>/`.
874
- * This function swaps the active collection files and removes the
875
- * presets directory so the final project is clean.
876
- */
877
- /**
878
870
  * Reduce the scaffolded project to the chosen shape.
879
871
  *
880
- * The base template is the full triad. `--headless` drops the frontend and the
881
- * declared collections — there is nothing to define, since the server derives
882
- * its API from the database — and overlays the files that differ.
872
+ * The base template is Mode B: `backend/` and `frontend/`. `--headless` is
873
+ * Mode A: it drops `frontend/` and `backend/schema/` — there is nothing to
874
+ * declare, since the server derives its API from the database — and overlays
875
+ * the files that differ (`templates/overlays/baas/`).
883
876
  *
884
- * The config *package* stays, holding only `storageAuthorize`. Storage is not
885
- * under row-level security, so a deployment with file storage enabled and no
886
- * access model serves every user's files to every signed-in user; the server
887
- * refuses to boot in that state. Deleting the package outright would leave a
888
- * headless project with nowhere to put the hook, and the scaffold's own
889
- * docker-compose.yml enables storage — so the first `docker compose up` would
890
- * crash-loop.
877
+ * `backend/storage.ts` stays, replaced by the overlay's stricter default.
878
+ * Storage is not under row-level security, so a deployment with file storage
879
+ * enabled and no access model serves every user's files to every signed-in
880
+ * user; the server refuses to boot in that state, and the scaffold's own
881
+ * docker-compose.yml enables storage — without the hook the first
882
+ * `docker compose up` would crash-loop.
883
+ *
884
+ * Declaring tables later is one step: create `backend/schema/index.ts`. The
885
+ * overlay's README says so.
891
886
  */
892
887
  async function applyHeadless(targetDirectory, headless) {
893
888
  if (!headless) return;
@@ -895,15 +890,14 @@ async function applyHeadless(targetDirectory, headless) {
895
890
  recursive: true,
896
891
  force: true
897
892
  });
898
- fs.rmSync(path.join(targetDirectory, "config", "collections"), {
893
+ fs.rmSync(path.join(targetDirectory, "backend", "schema"), {
899
894
  recursive: true,
900
895
  force: true
901
896
  });
902
- for (const stray of ["cms.d.ts", "frontend-assets.d.ts"]) fs.rmSync(path.join(targetDirectory, "config", stray), { force: true });
903
897
  fs.rmSync(path.join(targetDirectory, "backend", "src", "schema.generated.ts"), { force: true });
904
898
  const overlayDir = path.resolve(cliRoot, "templates", "overlays", "baas");
905
899
  if (!fs.existsSync(overlayDir)) {
906
- console.error(`${chalk.red.bold("ERROR")} BaaS template overlay not found at ${overlayDir}`);
900
+ console.error(`${chalk.red.bold("ERROR")} Headless template overlay not found at ${overlayDir}`);
907
901
  process.exit(1);
908
902
  }
909
903
  await cp(overlayDir, targetDirectory, {
@@ -940,30 +934,45 @@ async function writeProjectPackageManagerIntoManifest(targetDirectory, pmCommand
940
934
  if (changed) fs.writeFileSync(manifestPath, `${JSON.stringify(manifest, null, 4)}\n`, "utf8");
941
935
  } catch {}
942
936
  }
943
- /** Swap in the preset's collection files. Returns the preset actually applied. */
937
+ /**
938
+ * The blog preset's own files: the template ships the blog preset, and these
939
+ * are what another preset takes out before laying its own files over it.
940
+ * `users` — the table and its customization — is shared by every preset, and
941
+ * `backend/schema/index.ts` and `frontend/src/App.tsx` are replaced by the
942
+ * preset's copies.
943
+ *
944
+ * Exported for `check:templates` and the init tests, which materialise each
945
+ * preset exactly as this does.
946
+ */
947
+ var BLOG_PRESET_FILES = [
948
+ "backend/schema/posts.ts",
949
+ "backend/schema/authors.ts",
950
+ "backend/schema/tags.ts",
951
+ "frontend/src/cms/posts.tsx",
952
+ "frontend/src/cms/authors.tsx",
953
+ "frontend/src/cms/tags.tsx"
954
+ ];
955
+ /** Where a non-blog preset's files ship: `templates/presets/<preset>/`, laid out as in a project. */
956
+ function presetOverlayPath(preset) {
957
+ return path.resolve(cliRoot, "templates", "presets", preset);
958
+ }
959
+ /**
960
+ * Lay the preset's tables and customizations over the blog preset the template
961
+ * ships. Returns the preset actually applied.
962
+ */
944
963
  async function applyPreset(targetDirectory, preset) {
945
- const collectionsDir = path.join(targetDirectory, "config", "collections");
946
- const presetsDir = path.join(collectionsDir, "presets");
947
- if (preset !== "blog") {
948
- const presetDir = path.join(presetsDir, preset);
949
- if (!fs.existsSync(presetDir)) {
950
- console.warn(chalk.yellow(` Warning: Preset "${preset}" not found, falling back to blog template.`));
951
- cleanupPresets(presetsDir);
952
- return "blog";
953
- }
954
- for (const file of [
955
- "posts.ts",
956
- "authors.ts",
957
- "tags.ts",
958
- "index.ts"
959
- ]) {
960
- const filePath = path.join(collectionsDir, file);
961
- if (fs.existsSync(filePath)) fs.unlinkSync(filePath);
962
- }
963
- const presetFiles = fs.readdirSync(presetDir).filter((f) => f.endsWith(".ts"));
964
- for (const file of presetFiles) fs.copyFileSync(path.join(presetDir, file), path.join(collectionsDir, file));
964
+ if (preset === "blog") return preset;
965
+ const presetDir = presetOverlayPath(preset);
966
+ if (!fs.existsSync(presetDir)) {
967
+ console.warn(chalk.yellow(` Warning: Preset "${preset}" not found, falling back to the blog template.`));
968
+ return "blog";
965
969
  }
966
- cleanupPresets(presetsDir);
970
+ for (const file of BLOG_PRESET_FILES) fs.rmSync(path.join(targetDirectory, file), { force: true });
971
+ await cp(presetDir, targetDirectory, {
972
+ recursive: true,
973
+ force: true,
974
+ filter: (source) => path.basename(source) !== ".DS_Store"
975
+ });
967
976
  return preset;
968
977
  }
969
978
  /**
@@ -978,12 +987,12 @@ async function applyPreset(targetDirectory, preset) {
978
987
  * edit was refused with `SCHEMA_EDIT_DIRTY_TREE` before its owner had changed
979
988
  * a thing.
980
989
  *
981
- * The file cannot be generated here: generation loads the collection files,
982
- * and they import `@rebasepro/cms-types`, which the project does not have
990
+ * The file cannot be generated here: generation loads `backend/schema`, and
991
+ * its files import `@rebasepro/server/schema`, which the project does not have
983
992
  * until it is installed — `init --git` without `--install` commits first. So
984
993
  * each preset's output is generated in this repository and shipped, and
985
994
  * `init-generated-schema.test.ts` fails the moment one of them differs from
986
- * what the generator writes for that preset's collections.
995
+ * what the generator writes for that preset's tables.
987
996
  *
988
997
  * Outside `templates/template` on purpose: a preset's schema must not be
989
998
  * copied into a project that chose another preset.
@@ -1001,15 +1010,15 @@ function writeShippedSchema(targetDirectory, preset) {
1001
1010
  * Where each scaffold shape's `rebase.resources.json` ships, beside the template.
1002
1011
  *
1003
1012
  * `rebase resources --check` is the CI gate for that file, and a fresh
1004
- * scaffold failed it before anything had changed: `config/resources.ts`
1013
+ * scaffold failed it before anything had changed: `backend/resources.ts`
1005
1014
  * declares `main = database()`, `backend/functions/hello.ts` is a function,
1006
1015
  * and nothing had written the graph — `rebase build` does, on its first run.
1007
1016
  * So `init` writes it, and a fresh project starts consistent with its own
1008
1017
  * gate, with the file in its first commit.
1009
1018
  *
1010
1019
  * It cannot be derived here for the reason the schema cannot (see
1011
- * `shippedSchemaPath`): deriving evaluates the collection files, which import
1012
- * `@rebasepro/cms-types`, and the project has none until it is installed. So
1020
+ * `shippedSchemaPath`): deriving evaluates `backend/schema`, which imports
1021
+ * `@rebasepro/server/schema`, and the project has none until it is installed. So
1013
1022
  * each shape's graph is derived in this repository and shipped, and
1014
1023
  * `init-resource-graph.test.ts` fails the moment one differs from what
1015
1024
  * `rebase resources --write` writes for that shape.
@@ -1021,12 +1030,6 @@ function shippedResourceGraphPath(shape) {
1021
1030
  function writeShippedResourceGraph(targetDirectory, shape) {
1022
1031
  fs.copyFileSync(shippedResourceGraphPath(shape), path.join(targetDirectory, "rebase.resources.json"));
1023
1032
  }
1024
- function cleanupPresets(presetsDir) {
1025
- if (fs.existsSync(presetsDir)) fs.rmSync(presetsDir, {
1026
- recursive: true,
1027
- force: true
1028
- });
1029
- }
1030
1033
  /** The package the probe asks about. Not the CLI: the CLI is what is running. */
1031
1034
  var RELEASE_PROBE_PACKAGE = "@rebasepro/server";
1032
1035
  async function probeRelease(version) {
@@ -1331,4 +1334,4 @@ async function configureEnvFile(targetDirectory, databaseUrl) {
1331
1334
  //#endregion
1332
1335
  export { createRebaseApp };
1333
1336
 
1334
- //# sourceMappingURL=init-vL1DWOeC.js.map
1337
+ //# sourceMappingURL=init-Dtl-IcXf.js.map