@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
@@ -116,8 +116,12 @@ export declare function printAgentSetup({ results, skillsError, mcpDependency }:
116
116
  export declare function promptForAgents(home?: string): Promise<AgentKey[]>;
117
117
  /**
118
118
  * The guardrail every scaffold ships for Claude Code: a PostToolUse hook that
119
- * runs `rebase verify --quiet` after each edit under `config/collections/` and
120
- * hands any problem back to the agent (exit 2, the message on stderr).
119
+ * runs `rebase verify --quiet` after each edit under `backend/schema/` (or the
120
+ * `tables` directory rebase.json names) or `frontend/src/cms/`, and hands any
121
+ * problem back to the agent (exit 2, the message on stderr).
122
+ *
123
+ * The script keeps the file name it first shipped with: it is how
124
+ * {@link installAgentHooks} and the settings entry find a copy already installed.
121
125
  *
122
126
  * The files live in the template, under `.claude/`, so `rebase init` copies
123
127
  * them like everything else and `rebase skills --hooks` installs the very same
@@ -10,6 +10,8 @@ export declare const LOGIN_FLAGS: {
10
10
  readonly "--email": StringConstructor;
11
11
  readonly "--password": StringConstructor;
12
12
  readonly "--code": BooleanConstructor;
13
+ readonly "--web": BooleanConstructor;
14
+ readonly "--no-browser": BooleanConstructor;
13
15
  readonly "-e": "--email";
14
16
  };
15
17
  /**
@@ -749,7 +749,7 @@ export interface CloudRow {
749
749
  /**
750
750
  * Read the control plane's rows as a subcommand's row shape.
751
751
  *
752
- * `client.data.collection(...)` is typed against the *generated* schema of the
752
+ * `client.data.table(...)` is typed against the *generated* schema of the
753
753
  * project the SDK is pointed at, and the control-plane collections this CLI
754
754
  * reads are not in one — so every row arrives as an open
755
755
  * `Record<string, unknown>`. A declared `interface` gets no implicit index
@@ -121,12 +121,12 @@ export interface DeployOutcome {
121
121
  * `REBASE_TOKEN` outranks the stored grant (see `requireClient`), and a shell
122
122
  * or an MCP server that has one holds it for the person's other projects — it
123
123
  * has no scope on the project just provisioned, so the deploy was refused and
124
- * the project never got its collections. The project is deployed with its own
124
+ * the project never got its tables. The project is deployed with its own
125
125
  * token.
126
126
  */
127
127
  export declare function bundleDeployEnv(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
128
128
  /**
129
- * Push the local collections: `rebase cloud deploy --bundle`, as a child.
129
+ * Push the local tables: `rebase cloud deploy --bundle`, as a child.
130
130
  *
131
131
  * A child rather than a call, so this command still prints exactly one
132
132
  * result — a JSON caller gets the deploy's outcome folded into it — and still
@@ -26,12 +26,41 @@ export interface PendingSecondFactor {
26
26
  * could finish. The same reading the console's login view makes.
27
27
  */
28
28
  export declare function readMfaRequired(error: unknown): PendingSecondFactor | null;
29
+ type AuthConfig = Awaited<ReturnType<CloudAuth["getAuthConfig"]>>;
30
+ /**
31
+ * The control plane's `/auth/config`, or null when it cannot be read. Read
32
+ * once per login: it says both whether codes are mailed and whether device
33
+ * sign-in is offered.
34
+ */
35
+ export declare function readAuthConfig(auth: CloudAuth): Promise<AuthConfig | null>;
29
36
  /**
30
37
  * Whether the control plane mails sign-in codes, as its `/auth/config` says.
31
38
  * `false` when it cannot be asked: an older control plane has no such door,
32
39
  * and offering one that 404s is worse than not offering it.
33
40
  */
34
- export declare function offersSignInCodes(auth: CloudAuth): Promise<boolean>;
41
+ export declare function offersSignInCodes(config: AuthConfig | null): boolean;
42
+ /** Whether the control plane signs a terminal in through a browser, as its `/auth/config` says. */
43
+ export declare function offersBrowserSignIn(config: AuthConfig | null): boolean;
44
+ /** What the browser sign-in does outside this process. An object so tests can replace it. */
45
+ export declare const BROWSER_SIGN_IN_IO: {
46
+ sleep: (ms: number) => Promise<void>;
47
+ open: (url: string) => void;
48
+ };
49
+ /** What the approval page calls this terminal. */
50
+ export declare function browserSignInClientName(): string;
51
+ /**
52
+ * Sign in through a browser: ask for a pending sign-in, show its link and
53
+ * code, open the browser when there is a person at a terminal to look at it,
54
+ * and poll until it is approved, denied or expired.
55
+ *
56
+ * Without a terminal — piped, or `--json` — the link and code still go to
57
+ * stderr and the polling still happens: whoever runs this (an agent, a
58
+ * script with a person nearby) has what to open and is told what it is
59
+ * waiting for.
60
+ */
61
+ export declare function signInWithBrowser(auth: CloudAuth, options: {
62
+ openBrowser: boolean;
63
+ }): Promise<SignedIn>;
35
64
  /** Ask "password or code?" at a terminal. */
36
65
  export declare function askSignInMethod(): Promise<"password" | "code">;
37
66
  /** Refuse a code step with no terminal to type it at. Never returns when there is none. */
@@ -1,8 +1,7 @@
1
1
  export declare const CONSOLE_FLAGS: {
2
2
  readonly "--eval": StringConstructor;
3
3
  readonly "-e": "--eval";
4
- readonly "--collections": StringConstructor;
5
- readonly "-c": "--collections";
4
+ readonly "--schema-dir": StringConstructor;
6
5
  readonly "--database-url": StringConstructor;
7
6
  readonly "--docker": BooleanConstructor;
8
7
  };
@@ -27,9 +27,8 @@ export declare function databaseUrlOf(prepared: Pick<PreparedDatabase, "env" | "
27
27
  * absolutised once, so the one spelling the help page names was the one that
28
28
  * landed in `backend/` — and the success line still echoed the path as typed.
29
29
  *
30
- * And `--collections`, which was not absolutised at all: from the project root,
31
- * `rebase schema generate --collections ./config/collections` was "not found",
32
- * while the same spelling worked for `generate-sdk`. See `utils/path-flags.ts`.
30
+ * And `--schema-dir`, the schema directory: a path typed from the project root
31
+ * must not be read from `backend/`. See `utils/path-flags.ts`.
33
32
  */
34
33
  export declare const LOCAL_PATH_FLAGS: readonly string[];
35
34
  /**
@@ -155,7 +154,7 @@ export declare function refuseRestoreOnManagedDatabase(rawArgs: string[], kind:
155
154
  * Resolve the active driver's CLI and the environment it should run in.
156
155
  *
157
156
  * Shared by the two runners below. Deliberately does NOT resolve a database:
158
- * `schema generate` reads collection files and writes one file, and starting a
157
+ * `schema generate` reads the schema directory and writes one file, and starting a
159
158
  * database to run it would be a side effect nobody asked for.
160
159
  */
161
160
  export declare function resolveDriverCli(): Promise<{
@@ -172,7 +171,7 @@ export declare function resolveDriverCli(): Promise<{
172
171
  * shipped `dist/cli.js` all three quietly switched to plain `node`, and the
173
172
  * driver loads the PROJECT's TypeScript in process:
174
173
  *
175
- * - `schema stale` reads the collections, could not resolve `./authors` onto
174
+ * - `schema stale` reads the tables, could not resolve `./authors` onto
176
175
  * `authors.ts`, and answered "⏭ Not checked" while exiting 0;
177
176
  * - `db push` does the same in `ensureAuthTables`, so `rebase.users` was never
178
177
  * created and the push died at "Applying RLS policies" with
@@ -189,7 +188,7 @@ export declare function resolveDriverCli(): Promise<{
189
188
  * tsx's loader in one Node (`node --import`) rather than the `tsx` binary,
190
189
  * which is a shell shim and a relay Node in front of the same loader: one Node
191
190
  * start instead of two, ~50–100 ms on each of the driver runs every `rebase
192
- * dev` start and every collection save makes. The binary stays the fallback for
191
+ * dev` start and every schema save makes. The binary stays the fallback for
193
192
  * a tsx whose loader does not resolve as a package — a global install.
194
193
  */
195
194
  export declare function spawnDriverCli(resolved: {
@@ -84,8 +84,9 @@ export declare function backendWatchCommand(tsxBin: string, watchArgs: readonly
84
84
  * crons are not imported: the runtime scans their directories at boot. So
85
85
  * adding `backend/functions/new.ts` while `rebase dev` ran did nothing —
86
86
  * `GET /api/functions/new` stayed 404, and a new cron never registered — until
87
- * somebody restarted by hand. The same is true of `config/`, which is read as
88
- * data.
87
+ * somebody restarted by hand. The schema directory is imported, but it is
88
+ * excluded from tsx's own tracking (see {@link devWatchArgs}) and restarted
89
+ * through the trigger instead.
89
90
  *
90
91
  * `--include` is tsx's own answer to this, it takes a directory rather than a
91
92
  * glob, and it tolerates a directory that does not exist yet: a `crons/`
@@ -104,7 +105,7 @@ export declare function devWatchIncludes(projectRoot: string, paths: {
104
105
  * Watches the nearest directory above `target` that exists (no higher than
105
106
  * `root`), and follows the path down as each part of it appears — `fs.watch`
106
107
  * cannot watch a directory that is not there yet. A headless project has no
107
- * `config/collections` until `rebase schema introspect` writes one, and dev
108
+ * `backend/schema` until one is written, and dev
108
109
  * watched it only when it was there at start: the backend kept serving the
109
110
  * API it derived from the database, and edits to the new files did nothing,
110
111
  * until dev was restarted by hand.
@@ -118,32 +119,32 @@ export declare function whenDirectoryAppears(target: string, root: string, onApp
118
119
  * path with a dot-named segment (its built-in `**\/.*\/**`), so a trigger under
119
120
  * `.rebase/` — or under a TMPDIR inside a dot directory — would never fire; in
120
121
  * that case there is no trigger and {@link devWatchArgs} leaves the
121
- * collections to tsx, as before.
122
+ * schema directory to tsx, as before.
122
123
  */
123
124
  export declare function devRestartTrigger(projectRoot: string): string | null;
124
125
  /**
125
126
  * The `tsx watch` argument list for the backend (unquoted).
126
127
  *
127
- * One save of a collection file must restart the backend once. The runtime
128
- * `import()`s the collections, so tsx tracks them as dependencies and used to
128
+ * One save of a schema file must restart the backend once. The runtime
129
+ * `import()`s the schema, so tsx tracks it as a dependency and used to
129
130
  * restart the moment a file was saved — before dev had regenerated
130
131
  * `schema.generated.ts`. That boot warned "schema.generated.ts no longer
131
132
  * describes the database … Run `rebase schema generate`", telling the reader to
132
133
  * run what dev was running at that moment, and the regeneration then rewrote
133
134
  * the file and restarted the backend a second time. So tsx is told to leave the
134
- * collections directory alone (`--exclude` wins over its dependency tracking),
135
+ * schema directory alone (`--exclude` wins over its dependency tracking),
135
136
  * and dev restarts the backend itself, once, after the regeneration — through
136
137
  * `restartTrigger`, which tsx watches.
137
138
  *
138
139
  * Every included directory also gets tsx's own default ignores, made absolute.
139
140
  * tsx resolves those defaults (`**\/node_modules/**`, `**\/.*`, …) against its
140
- * cwd, which is `backend/`, so they never reached `config/`, a sibling: chokidar
141
- * walked `config/node_modules` — following symlinks — before tsx spawned the
141
+ * cwd, which is `backend/`, so they never reached a sibling directory: chokidar
142
+ * walked the old `config/node_modules` — following symlinks — before tsx spawned the
142
143
  * backend at all, and kept every file in it watched. In the monorepo's example
143
144
  * app that was 17 s before the first backend line and 1,400 open files, and any
144
145
  * install (or another checkout's Vite build writing `.vite-temp` deep inside
145
146
  * that tree) restarted the backend. A `.DS_Store` or an editor swap file in
146
- * `config/` restarted it too.
147
+ * an included directory restarted it too.
147
148
  */
148
149
  export declare function devWatchArgs(projectRoot: string, paths: {
149
150
  REBASE_DEV_FUNCTIONS?: string;
@@ -384,7 +385,7 @@ export type SchemaGeneration = "generated" | "skipped" | "failed";
384
385
  * backend boots.
385
386
  *
386
387
  * Not after a regeneration that succeeded: that wrote `schema.generated.ts`
387
- * from these collections with this driver, moments earlier, and `stale`
388
+ * from these tables with this driver, moments earlier, and `stale`
388
389
  * compares the file against the same generator — it can only answer "nothing
389
390
  * stale", and it cost a driver process (~0.6 s) on every start. The repair it
390
391
  * exists for, a library upgrade that changed what the generator derives, is
@@ -393,15 +394,15 @@ export type SchemaGeneration = "generated" | "skipped" | "failed";
393
394
  */
394
395
  export declare function needsStaleSchemaPreflight(generation: SchemaGeneration): boolean;
395
396
  /**
396
- * What dev prints once a collection edit's regeneration is done.
397
+ * What dev prints once a schema edit's regeneration is done.
397
398
  *
398
399
  * The green "regenerated" box only when neither half failed. It used to be
399
400
  * printed unconditionally, right under "⚠ Could not regenerate the database
400
401
  * schema … nothing was applied" — and then the backend refused to boot over
401
- * the same collection error, so the success line was the one wrong thing on
402
+ * the same schema error, so the success line was the one wrong thing on
402
403
  * the screen.
403
404
  */
404
- export declare function collectionChangeSummary(schema: SchemaGeneration, sdk: SchemaGeneration): string[];
405
+ export declare function schemaChangeSummary(schema: SchemaGeneration, sdk: SchemaGeneration): string[];
405
406
  /**
406
407
  * One variable's value out of `.env` text, or undefined when it has none.
407
408
  *
@@ -434,12 +435,12 @@ export declare function schemaPushArgv(databaseUrl: string | undefined): string[
434
435
  * Start-up's independent halves, overlapped rather than run one after another.
435
436
  *
436
437
  * `rebase dev` used to regenerate the schema and the SDK, then derive the
437
- * resource graph (every collection evaluated again, in this process), then
438
+ * resource graph (every table evaluated again, in this process), then
438
439
  * start the managed database and wait for it — about a second when it was not
439
440
  * already running — and only then spawn the backend. None of the three reads
440
- * what another writes: the generators read `config/` and write
441
+ * what another writes: the generators read `backend/schema` and write
441
442
  * `backend/src/schema.generated.ts` and `generated/sdk/`; the derivation reads
442
- * `config/resources.ts` and the collections; the database needs neither, and
443
+ * `backend/resources.ts` and the tables; the database needs neither, and
443
444
  * `schema generate` never connects to one. So `database` starts first and is
444
445
  * collected last.
445
446
  *
@@ -35,15 +35,15 @@ export declare function collectEnvironmentFindings(projectRoot: string, envFile:
35
35
  */
36
36
  export declare function readAtlasBinaryState(projectRoot: string): AtlasBinaryState | null;
37
37
  /**
38
- * Does this project declare its collections in code?
38
+ * Does this project declare its tables in code?
39
39
  *
40
- * `resolveBackendPaths` answers it against the manifest's own `config` path
40
+ * `resolveBackendPaths` answers it against the manifest's own `tables` path
41
41
  * rather than the convention, because a project may move the directory. A
42
42
  * project with no manifest, or one shaped differently, is treated as declaring
43
43
  * them: the wrong answer there would silently skip the drift report, which is
44
44
  * the reason the command exists.
45
45
  */
46
- export declare function hasDeclaredCollections(projectRoot: string): boolean;
46
+ export declare function hasDeclaredTables(projectRoot: string): boolean;
47
47
  /**
48
48
  * The flags `rebase doctor` takes, and what each is for.
49
49
  *
@@ -61,8 +61,7 @@ export declare function hasDeclaredCollections(projectRoot: string): boolean;
61
61
  export declare const DOCTOR_FLAGS: {
62
62
  readonly "--policies": BooleanConstructor;
63
63
  readonly "--database": BooleanConstructor;
64
- readonly "--collections": StringConstructor;
65
- readonly "-c": "--collections";
64
+ readonly "--schema-dir": StringConstructor;
66
65
  readonly "--schema": StringConstructor;
67
66
  readonly "-s": "--schema";
68
67
  readonly "--sdk": StringConstructor;
@@ -1,20 +1,24 @@
1
1
  /**
2
- * The two ways one project's payload differs from another's.
2
+ * The ways one project's payload differs from another's.
3
3
  *
4
- * Neither is a flag: both were decided at `rebase init` time. `--headless`
5
- * deletes `config/collections`, `backend/src/schema.generated.ts` and
6
- * `frontend/`, so a payload that assumes them emits an entrypoint importing
7
- * three files that are not there and a Dockerfile whose first `COPY` fails.
4
+ * None is a flag: each is read from the project. `--headless` has no
5
+ * `backend/schema`, no `backend/src/schema.generated.ts` and no `frontend/`,
6
+ * so a payload that assumes them emits an entrypoint importing files that are
7
+ * not there and a Dockerfile whose first `COPY` fails.
8
8
  */
9
9
  interface ProjectShape {
10
10
  /**
11
- * Collections declared in code, under `<config>/collections`. Without them
12
- * the server derives its API from the live database instead — the same
13
- * signal `rebase build` reads.
11
+ * Tables declared in code: the schema directory has an index. Without
12
+ * them the server derives its API from the live database instead — the
13
+ * same signal `rebase build` reads.
14
14
  */
15
- collections: boolean;
15
+ tables: boolean;
16
16
  /** A `frontend` workspace for the image to build and the entrypoint to serve. */
17
17
  frontend: boolean;
18
+ /** `backend/storage.ts`, exporting `storageAuthorize`. */
19
+ storage: boolean;
20
+ /** `backend/hooks.ts`, exporting the global table `hooks`. */
21
+ hooks: boolean;
18
22
  }
19
23
  /**
20
24
  * Render one payload file for this project.
@@ -26,12 +30,12 @@ interface ProjectShape {
26
30
  * job in an ejected project. So both branches live in the file, marked with
27
31
  * lines that are comments in TypeScript, YAML and Dockerfiles alike:
28
32
  *
29
- * // {{#collections}}
33
+ * // {{#tables}}
30
34
  * import { tables } from "./schema.generated.js";
31
- * // {{/collections}}
32
- * // {{^collections}}
35
+ * // {{/tables}}
36
+ * // {{^tables}}
33
37
  * // No schema module: this project introspects the database.
34
- * // {{/collections}}
38
+ * // {{/tables}}
35
39
  *
36
40
  * `{{#name}}` keeps its block when the flag is on, `{{^name}}` when it is off,
37
41
  * and the marker lines themselves never reach the user. The template stays
@@ -1,10 +1,10 @@
1
- import { resolveCollectionsDir } from "../utils/collections-dir.js";
1
+ import { resolveSchemaDir } from "../utils/schema-dir.js";
2
2
  /** What `rebase generate` dispatches. Read by `cli.ts` to name the subcommand. */
3
3
  export declare const GENERATE_SUBCOMMANDS: readonly ["view"];
4
4
  export interface GenerateViewOptions {
5
5
  projectRoot: string;
6
6
  slug: string;
7
- /** Register as a tab on this collection's records instead of as a screen. */
7
+ /** Register as a tab on this table's records (its slug) instead of as a screen. */
8
8
  collection?: string;
9
9
  /** The label in the sidebar or on the tab. Defaults to the slug in sentence case. */
10
10
  name?: string;
@@ -42,8 +42,8 @@ export declare function viewLabel(slug: string): string;
42
42
  export declare function maskCode(source: string): string;
43
43
  /** The admin's frontend directory: the static app that mounts the CMS, or `frontend/`. */
44
44
  export declare function resolveFrontendDir(projectRoot: string): string | undefined;
45
- /** `<config>/collections`, as the backend app declares it — one resolver for every command. */
46
- export { resolveCollectionsDir };
45
+ /** The tables directory, as the backend app declares it — one resolver for every command. */
46
+ export { resolveSchemaDir };
47
47
  type ViewTemplateOptions = {
48
48
  slug: string;
49
49
  componentName: string;
@@ -80,15 +80,26 @@ export declare function registerAppView(source: string, options: {
80
80
  */
81
81
  export declare function wireViewsIntoApp(source: string): string | "already" | undefined;
82
82
  /**
83
- * The collection file with a `{ key, name, Builder }` entry in the
84
- * `admin.entityViews` of the collection whose `slug:` is at `slugAt`;
85
- * `"already"` when that key is there; `undefined` when the shape cannot be read.
83
+ * The customization file with a `{ key, name, Builder }` entry in the
84
+ * `entityViews` of the `customizeTable(…)` options object whose `{` is at
85
+ * `optionsOpen`; `"already"` when that key is there; `undefined` when the
86
+ * shape cannot be read. The component's import is the caller's to add.
86
87
  *
87
88
  * Exported for its tests.
88
89
  */
89
- export declare function registerEntityView(source: string, slugAt: number, view: {
90
+ export declare function registerEntityView(source: string, optionsOpen: number, view: {
90
91
  key: string;
91
92
  name: string;
92
- builder: string;
93
+ componentName: string;
93
94
  }): string | "already" | undefined;
95
+ /**
96
+ * A source with `identifier` imported from `importPath` and appended to its
97
+ * list of table customizations — `export const tableCustomizations = [ … ]`
98
+ * (`cms/index.ts`) or `tableCustomizations={[ … ]}` on `<RebaseCMS>`
99
+ * (`App.tsx`); `"already"` when it is listed; `undefined` when the source has
100
+ * no such list.
101
+ *
102
+ * Exported for its tests.
103
+ */
104
+ export declare function listCustomization(source: string, identifier: string, importPath: string): string | "already" | undefined;
94
105
  export declare function generateCommand(subcommand: string | undefined, rawArgs?: string[]): Promise<void>;
@@ -1,14 +1,16 @@
1
1
  /**
2
2
  * CLI command: generate-sdk
3
3
  *
4
- * Reads every collection file in a directory (default: ./config/collections) —
5
- * the files the backend serves, not the barrel's list — generates a typed
6
- * TypeScript SDK, and writes it to the output directory (default: ./generated/sdk).
7
- *
8
- * Uses jiti for dynamic TypeScript import of collection files.
4
+ * Reads the project's tables — `backend/schema`, through the loader the
5
+ * backend boots from, so the SDK describes exactly the tables served — or,
6
+ * with `--from`, a running project's contract, and writes a typed TypeScript
7
+ * SDK to the output directory (default: ./generated/sdk).
9
8
  */
9
+ import { type TableDescriptor } from "@rebasepro/types";
10
+ import { type ModuleAliases } from "../utils/project-schema.js";
10
11
  interface GenerateSDKArgs {
11
- collectionsDir: string;
12
+ /** The schema directory: the one whose index exports the tables. */
13
+ schemaDir: string;
12
14
  output: string;
13
15
  cwd: string;
14
16
  /**
@@ -16,7 +18,7 @@ interface GenerateSDKArgs {
16
18
  *
17
19
  * `link` uses this checkout's linked project; anything else is treated as
18
20
  * the base URL of a Rebase backend. This is what lets a repository that
19
- * contains no collections — a separate frontend, a second web app — generate
21
+ * contains no tables — a separate frontend, a second web app — generate
20
22
  * a typed client from the project it talks to.
21
23
  */
22
24
  from?: string;
@@ -24,47 +26,45 @@ interface GenerateSDKArgs {
24
26
  token?: string;
25
27
  /**
26
28
  * Also register the generated `Database` for server-side code: write the
27
- * types and the `Register` augmentation into `config/generated/`. See
29
+ * types and the `Register` augmentation into `backend/generated/`. See
28
30
  * {@link writeRegistration}.
29
31
  */
30
32
  register?: boolean;
31
33
  /**
32
- * The directory holding `rebase.json`, where `--register` is remembered.
33
- * Found from `cwd` when not given.
34
+ * The directory holding `rebase.json`, where `--register` is remembered
35
+ * and under which `backend/generated/` is. Found from `cwd` when not given.
34
36
  */
35
37
  projectRoot?: string;
38
+ /** Module specifiers mapped to files when importing the schema (in-repo runs and tests). */
39
+ moduleAliases?: ModuleAliases;
36
40
  help?: boolean;
37
41
  }
38
42
  /** What `--register` writes, and what marks a project as having opted in. */
39
43
  export declare const REGISTER_FILE = "register.ts";
40
44
  /**
41
- * Where `--register` writes: `generated/` beside the collections directory,
42
- * which is `config/generated/` in a scaffolded project.
45
+ * Where `--register` writes: `backend/generated/` under the project root.
43
46
  *
44
- * Inside `config/` because that is the one directory both compiles of a
45
- * collection file include: the backend's program (it includes
46
- * `../config/**`) and the `config` package's own `tsc`. A registration
47
- * there that imported `../generated/sdk/database.types` pulled a file from
48
- * outside `config/` into that package's program, which TypeScript refuses
49
- * (the file is not under its `rootDir`) — so the types are copied in beside
50
- * the registration rather than imported from the SDK.
47
+ * Inside `backend/` because that is the program the hooks, functions and
48
+ * crons it types are compiled in. The types are copied in beside the
49
+ * registration rather than imported from `generated/sdk`, which is outside
50
+ * the backend's `rootDir`.
51
51
  */
52
- export declare function registrationDir(collectionsDir: string): string;
52
+ export declare function registrationDir(projectRoot: string): string;
53
53
  /**
54
- * Write the server-side registration from the collection files in
55
- * `collectionsDir`, exactly as `rebase generate-sdk` writes it, for a build.
54
+ * Write the server-side registration from the build's tables, exactly as
55
+ * `rebase generate-sdk` writes it.
56
56
  *
57
57
  * Only for a project that asked for it: `registerDatabase` in `rebase.json`,
58
58
  * or a registration an earlier `--register` left, which is kept current. The
59
- * registration lives in gitignored `config/generated/`, so a fresh clone (a CI
60
- * job) has none until something writes it, and a bundle compiled without it
61
- * types `context.data` as untyped rows: callbacks that read a typed column
62
- * fail to compile there while they compile locally.
59
+ * registration lives in gitignored `backend/generated/`, so a fresh clone (a
60
+ * CI job) has none until something writes it, and a bundle compiled without
61
+ * it types `context.data` as untyped rows: hooks that read a typed column fail
62
+ * to compile there while they compile locally.
63
63
  *
64
64
  * Returns the directory written, or null when there was nothing to do.
65
65
  * Throws when a `register.ts` there is not ours, as `generate-sdk` refuses.
66
66
  */
67
- export declare function writeRegistrationForBuild(collectionsDir: string, registerDatabase: boolean): Promise<string | null>;
67
+ export declare function writeRegistrationForBuild(projectRoot: string, tables: readonly TableDescriptor[], registerDatabase: boolean): Promise<string | null>;
68
68
  /**
69
69
  * The base URL to show in the printed usage example.
70
70
  *
@@ -31,7 +31,7 @@ export interface InitOptions {
31
31
  preset: TemplatePreset;
32
32
  /** Whether `preset` came from an explicit --template rather than the default. */
33
33
  explicitPreset?: boolean;
34
- /** Scaffold the backend alone, with no admin panel and no collections. */
34
+ /** Scaffold the backend alone, with no admin panel and no `backend/schema/`. */
35
35
  headless: boolean;
36
36
  /** Detected package manager (pnpm or npm). */
37
37
  pm: PackageManager;
@@ -163,7 +163,7 @@ export interface InitNextStepsInput {
163
163
  ownDatabase: boolean;
164
164
  /** Introspection was asked for. */
165
165
  introspect: boolean;
166
- /** Introspection ran and produced collections. */
166
+ /** Introspection ran and produced `backend/schema`. */
167
167
  introspected: boolean;
168
168
  /** Dependencies were installed. */
169
169
  installed: boolean;
@@ -224,6 +224,19 @@ export declare function scaffoldConflictMessage(projectName: string, displayPath
224
224
  * function created is pointed at `main`.
225
225
  */
226
226
  export declare function initGitRepository(targetDirectory: string): Promise<boolean>;
227
+ /**
228
+ * The blog preset's own files: the template ships the blog preset, and these
229
+ * are what another preset takes out before laying its own files over it.
230
+ * `users` — the table and its customization — is shared by every preset, and
231
+ * `backend/schema/index.ts` and `frontend/src/App.tsx` are replaced by the
232
+ * preset's copies.
233
+ *
234
+ * Exported for `check:templates` and the init tests, which materialise each
235
+ * preset exactly as this does.
236
+ */
237
+ export declare const BLOG_PRESET_FILES: readonly string[];
238
+ /** Where a non-blog preset's files ship: `templates/presets/<preset>/`, laid out as in a project. */
239
+ export declare function presetOverlayPath(preset: Exclude<TemplatePreset, "blog">): string;
227
240
  /**
228
241
  * Where the generated Drizzle schema for each preset ships, beside the template.
229
242
  *
@@ -236,12 +249,12 @@ export declare function initGitRepository(targetDirectory: string): Promise<bool
236
249
  * edit was refused with `SCHEMA_EDIT_DIRTY_TREE` before its owner had changed
237
250
  * a thing.
238
251
  *
239
- * The file cannot be generated here: generation loads the collection files,
240
- * and they import `@rebasepro/cms-types`, which the project does not have
252
+ * The file cannot be generated here: generation loads `backend/schema`, and
253
+ * its files import `@rebasepro/server/schema`, which the project does not have
241
254
  * until it is installed — `init --git` without `--install` commits first. So
242
255
  * each preset's output is generated in this repository and shipped, and
243
256
  * `init-generated-schema.test.ts` fails the moment one of them differs from
244
- * what the generator writes for that preset's collections.
257
+ * what the generator writes for that preset's tables.
245
258
  *
246
259
  * Outside `templates/template` on purpose: a preset's schema must not be
247
260
  * copied into a project that chose another preset.
@@ -253,15 +266,15 @@ export type ScaffoldShape = TemplatePreset | "headless";
253
266
  * Where each scaffold shape's `rebase.resources.json` ships, beside the template.
254
267
  *
255
268
  * `rebase resources --check` is the CI gate for that file, and a fresh
256
- * scaffold failed it before anything had changed: `config/resources.ts`
269
+ * scaffold failed it before anything had changed: `backend/resources.ts`
257
270
  * declares `main = database()`, `backend/functions/hello.ts` is a function,
258
271
  * and nothing had written the graph — `rebase build` does, on its first run.
259
272
  * So `init` writes it, and a fresh project starts consistent with its own
260
273
  * gate, with the file in its first commit.
261
274
  *
262
275
  * It cannot be derived here for the reason the schema cannot (see
263
- * `shippedSchemaPath`): deriving evaluates the collection files, which import
264
- * `@rebasepro/cms-types`, and the project has none until it is installed. So
276
+ * `shippedSchemaPath`): deriving evaluates `backend/schema`, which imports
277
+ * `@rebasepro/server/schema`, and the project has none until it is installed. So
265
278
  * each shape's graph is derived in this repository and shipped, and
266
279
  * `init-resource-graph.test.ts` fails the moment one differs from what
267
280
  * `rebase resources --write` writes for that shape.
@@ -0,0 +1,24 @@
1
+ /** The subcommands `rebase migrate` dispatches. The CLI's vocabulary and the docs verifier read this. */
2
+ export declare const MIGRATE_SUBCOMMANDS: readonly ["collections-to-tables", "sdk-calls"];
3
+ /** Every flag `rebase migrate collections-to-tables` accepts. Its help page and the docs verifier read this. */
4
+ export declare const COLLECTIONS_TO_TABLES_FLAGS: {
5
+ readonly "--check": BooleanConstructor;
6
+ readonly "--dry-run": BooleanConstructor;
7
+ readonly "--json": BooleanConstructor;
8
+ readonly "--force": BooleanConstructor;
9
+ readonly "--skip-sdk-calls": BooleanConstructor;
10
+ readonly "--accept-rule-changes": BooleanConstructor;
11
+ };
12
+ /** Every flag `rebase migrate sdk-calls` accepts. Its help page and the docs verifier read this. */
13
+ export declare const SDK_CALLS_FLAGS: {
14
+ readonly "--dry-run": BooleanConstructor;
15
+ readonly "--json": BooleanConstructor;
16
+ readonly "--force": BooleanConstructor;
17
+ };
18
+ /**
19
+ * Run `rebase migrate <subcommand>`.
20
+ *
21
+ * @param subcommand the word after `migrate`
22
+ * @param rawArgs the whole command line
23
+ */
24
+ export declare function migrateCommand(subcommand: string | undefined, rawArgs: string[]): Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import type { SchemaReconcilePlan } from "@rebasepro/types";
2
- export declare const RECONCILE_USAGE = "rebase schema reconcile [--drop <collection>.<column>]... [--yes]";
2
+ export declare const RECONCILE_USAGE = "rebase schema reconcile [--drop <table>.<column>]... [--yes]";
3
3
  export declare function parseReconcileArgs(rawArgs: string[]): {
4
4
  drop: string[];
5
5
  yes: boolean;
@@ -222,6 +222,14 @@ export declare function detectInstalledAgents(home?: string): InstalledAgent[];
222
222
  * as a rule.
223
223
  */
224
224
  export declare const SKILLS_MANIFEST = ".rebase-skills.json";
225
+ /**
226
+ * Skills the bundle once shipped under these names and no longer does. An
227
+ * install with a manifest removes them by its record; this list reaches the
228
+ * installs made before manifests existed, which recorded nothing.
229
+ * `rebase-collections` became `rebase-tables` when the schema moved to
230
+ * `defineTable` (0.31).
231
+ */
232
+ export declare const RETIRED_SKILLS: readonly string[];
225
233
  /** What one agent's install did. */
226
234
  export interface AgentInstallResult {
227
235
  skills: number;