@rebasepro/cli 0.30.0 → 0.31.0-canary.g59cd6fd

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 (286) 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-D96QYgFR.js} +7 -6
  13. package/dist/{auth-Bv0rTbQX.js.map → auth-D96QYgFR.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-C1d3LwB7.js} +14 -14
  81. package/dist/console-C1d3LwB7.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-DQZK9n9c.js} +52 -51
  87. package/dist/db-DQZK9n9c.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-C93d4QIv.js → dev-PY5h4O6u.js} +142 -84
  91. package/dist/dev-PY5h4O6u.js.map +1 -0
  92. package/dist/dev-db/attver.d.ts +32 -0
  93. package/dist/dev-db/pull.d.ts +15 -1
  94. package/dist/{dev-preflight-Cxv3TiD1.js → dev-preflight-DjvcV6SK.js} +5 -5
  95. package/dist/dev-preflight-DjvcV6SK.js.map +1 -0
  96. package/dist/{dev-server-OJsUGZEB.js → dev-server-BLxCbQEP.js} +2 -2
  97. package/dist/{dev-server-OJsUGZEB.js.map → dev-server-BLxCbQEP.js.map} +1 -1
  98. package/dist/{doctor-BBPQUO2g.js → doctor-CnUu8kpM.js} +39 -62
  99. package/dist/doctor-CnUu8kpM.js.map +1 -0
  100. package/dist/doctor-environment.d.ts +6 -6
  101. package/dist/{eject-DABcDnPN.js → eject-Bhzd6hgb.js} +25 -16
  102. package/dist/eject-Bhzd6hgb.js.map +1 -0
  103. package/dist/{fold-static-BWzxNn06.js → fold-static-CKewnAPX.js} +5 -3
  104. package/dist/fold-static-CKewnAPX.js.map +1 -0
  105. package/dist/{generate-view-IFwCADvb.js → generate-view-CTOluXvH.js} +160 -89
  106. package/dist/generate-view-CTOluXvH.js.map +1 -0
  107. package/dist/{generate_sdk-DNmNuFuW.js → generate_sdk-De-aLC1L.js} +120 -137
  108. package/dist/generate_sdk-De-aLC1L.js.map +1 -0
  109. package/dist/import-schema-module-Df67TIWj.js +51 -0
  110. package/dist/import-schema-module-Df67TIWj.js.map +1 -0
  111. package/dist/index.es.js +64 -51
  112. package/dist/index.es.js.map +1 -1
  113. package/dist/{init-vL1DWOeC.js → init-Dtl-IcXf.js} +83 -80
  114. package/dist/init-Dtl-IcXf.js.map +1 -0
  115. package/dist/last-dev-database-Dc8cP01o.js +2 -0
  116. package/dist/{manifest-BtzDy7KQ.js → manifest-C3uLDrrJ.js} +115 -40
  117. package/dist/manifest-C3uLDrrJ.js.map +1 -0
  118. package/dist/manifest.d.ts +79 -24
  119. package/dist/migrate-VrKoi3nB.js +138 -0
  120. package/dist/migrate-VrKoi3nB.js.map +1 -0
  121. package/dist/{normalize-imports-Bd5Y4yLp.js → normalize-imports-DwxqEMYq.js} +3 -3
  122. package/dist/{normalize-imports-Bd5Y4yLp.js.map → normalize-imports-DwxqEMYq.js.map} +1 -1
  123. package/dist/path-flags-7O5uPBcQ.js +139 -0
  124. package/dist/path-flags-7O5uPBcQ.js.map +1 -0
  125. package/dist/{prepare-CTw9NEkh.js → prepare-Ccxspoj-.js} +4 -4
  126. package/dist/{prepare-CTw9NEkh.js.map → prepare-Ccxspoj-.js.map} +1 -1
  127. package/dist/project-CLcF5i8c.js +360 -0
  128. package/dist/project-CLcF5i8c.js.map +1 -0
  129. package/dist/project-schema-CsSOG2gE.js +30 -0
  130. package/dist/project-schema-CsSOG2gE.js.map +1 -0
  131. package/dist/{pull-DDMpsZ5r.js → pull-DRWqBZp5.js} +327 -4
  132. package/dist/pull-DRWqBZp5.js.map +1 -0
  133. package/dist/resolve-BY7bSFRT.js +2 -0
  134. package/dist/resources/derive.d.ts +19 -13
  135. package/dist/{resources-CPSC5Kcu.js → resources-Dpfs2y8P.js} +5 -4
  136. package/dist/{resources-CPSC5Kcu.js.map → resources-Dpfs2y8P.js.map} +1 -1
  137. package/dist/{schema-DtLPsXbT.js → schema-CdDjv5zI.js} +41 -39
  138. package/dist/schema-CdDjv5zI.js.map +1 -0
  139. package/dist/schema-dir-Cd1kvYbf.js +98 -0
  140. package/dist/schema-dir-Cd1kvYbf.js.map +1 -0
  141. package/dist/schema-reconcile-BAupXfkd.js +2 -0
  142. package/dist/schema-text-CpNrsuMe.js +73 -0
  143. package/dist/schema-text-CpNrsuMe.js.map +1 -0
  144. package/dist/{skills-CbwV6vw_.js → skills-CXjA9TWw.js} +54 -10
  145. package/dist/skills-CXjA9TWw.js.map +1 -0
  146. package/dist/{start-YOr3X5Zm.js → start-Bwbtt2W5.js} +7 -10
  147. package/dist/{start-YOr3X5Zm.js.map → start-Bwbtt2W5.js.map} +1 -1
  148. package/dist/{status-BREvtzJm.js → status-D7XCGHu2.js} +12 -12
  149. package/dist/status-D7XCGHu2.js.map +1 -0
  150. package/dist/{storage-CO9ouK76.js → storage-iTqj5-Av.js} +12 -11
  151. package/dist/storage-iTqj5-Av.js.map +1 -0
  152. package/dist/{telemetry-DwK5RQJl.js → telemetry-BP_1Cl9r.js} +4 -4
  153. package/dist/{telemetry-DwK5RQJl.js.map → telemetry-BP_1Cl9r.js.map} +1 -1
  154. package/dist/{telemetry-CgwJPVMO.js → telemetry-M3HjlyhZ.js} +2 -2
  155. package/dist/{telemetry-CgwJPVMO.js.map → telemetry-M3HjlyhZ.js.map} +1 -1
  156. package/dist/{upgrade-B7sVwL8S.js → upgrade-oZzJ13jM.js} +5 -4
  157. package/dist/{upgrade-B7sVwL8S.js.map → upgrade-oZzJ13jM.js.map} +1 -1
  158. package/dist/utils/backend-guard.d.ts +47 -0
  159. package/dist/utils/cms-directories.d.ts +6 -0
  160. package/dist/utils/dev-preflight.d.ts +2 -2
  161. package/dist/utils/import-schema-module.d.ts +16 -0
  162. package/dist/utils/path-flags.d.ts +35 -16
  163. package/dist/utils/project-schema.d.ts +40 -0
  164. package/dist/utils/project.d.ts +8 -2
  165. package/dist/utils/schema-dir.d.ts +32 -0
  166. package/dist/utils/schema-drift.d.ts +6 -0
  167. package/dist/utils/schema-text.d.ts +24 -0
  168. package/dist/verify-5p_vaUG2.js +1160 -0
  169. package/dist/verify-5p_vaUG2.js.map +1 -0
  170. package/package.json +11 -8
  171. package/runtime/dev-server.mjs +5 -1
  172. package/templates/eject/Dockerfile +1 -4
  173. package/templates/eject/backend/src/env.ts +1 -1
  174. package/templates/eject/backend/src/index.ts +53 -40
  175. package/templates/eject/docker-compose.custom.yml +1 -1
  176. package/templates/overlays/baas/README.md +39 -12
  177. package/templates/overlays/baas/ai-instructions.md +8 -8
  178. package/templates/overlays/baas/{config → backend}/storage.ts +3 -4
  179. package/templates/overlays/baas/backend/tsconfig.json +10 -12
  180. package/templates/overlays/baas/package.json +1 -2
  181. package/templates/overlays/baas/pnpm-workspace.yaml +0 -1
  182. package/templates/presets/blank/backend/schema/index.ts +19 -0
  183. package/templates/presets/blank/frontend/src/App.tsx +56 -0
  184. package/templates/presets/ecommerce/backend/schema/categories.ts +12 -0
  185. package/templates/presets/ecommerce/backend/schema/index.ts +23 -0
  186. package/templates/presets/ecommerce/backend/schema/orders.ts +13 -0
  187. package/templates/presets/ecommerce/backend/schema/products.ts +18 -0
  188. package/templates/presets/ecommerce/frontend/src/App.tsx +59 -0
  189. package/templates/presets/ecommerce/frontend/src/cms/categories.tsx +12 -0
  190. package/templates/presets/ecommerce/frontend/src/cms/orders.tsx +38 -0
  191. package/templates/presets/ecommerce/frontend/src/cms/products.tsx +27 -0
  192. package/templates/resource-graphs/blank.json +2 -2
  193. package/templates/resource-graphs/blog.json +5 -5
  194. package/templates/resource-graphs/ecommerce.json +5 -5
  195. package/templates/resource-graphs/headless.json +1 -1
  196. package/templates/template/.claude/hooks/post-edit-collection.sh +27 -23
  197. package/templates/template/.cursorrules +2 -2
  198. package/templates/template/.env.example +6 -17
  199. package/templates/template/.github/copilot-instructions.md +2 -2
  200. package/templates/template/.windsurfrules +2 -2
  201. package/templates/template/AGENTS.md +2 -2
  202. package/templates/template/CLAUDE.md +2 -2
  203. package/templates/template/README.md +47 -13
  204. package/templates/template/ai-instructions.md +15 -14
  205. package/templates/template/backend/functions/hello.ts +1 -1
  206. package/templates/template/backend/package.json +0 -2
  207. package/templates/template/{config → backend}/resources.ts +3 -3
  208. package/templates/template/backend/schema/authors.ts +11 -0
  209. package/templates/template/backend/schema/index.ts +29 -0
  210. package/templates/template/backend/schema/posts.ts +29 -0
  211. package/templates/template/backend/schema/tags.ts +9 -0
  212. package/templates/template/backend/schema/users.ts +32 -0
  213. package/templates/template/{config → backend}/storage.ts +4 -4
  214. package/templates/template/backend/tsconfig.json +15 -20
  215. package/templates/template/docker-compose.yml +3 -3
  216. package/templates/template/frontend/package.json +0 -2
  217. package/templates/template/frontend/src/App.tsx +10 -4
  218. package/templates/template/frontend/src/cms/authors.tsx +7 -0
  219. package/templates/template/frontend/src/cms/posts.tsx +27 -0
  220. package/templates/template/frontend/src/cms/tags.tsx +11 -0
  221. package/templates/template/frontend/src/cms/ui-config.json +3 -0
  222. package/templates/template/frontend/src/cms/users.tsx +54 -0
  223. package/templates/template/frontend/src/{virtual.d.ts → vite-env.d.ts} +0 -4
  224. package/templates/template/frontend/vite.config.ts +6 -2
  225. package/templates/template/gitignore +1 -1
  226. package/templates/template/package.json +1 -2
  227. package/templates/template/pnpm-workspace.yaml +0 -1
  228. package/templates/template/scripts/example.ts +3 -3
  229. package/templates/template/tsconfig.json +1 -1
  230. package/templates/views/AppView.tsx.tmpl +4 -4
  231. package/templates/views/EntityView.tsx.tmpl +3 -4
  232. package/dist/api-keys-Dfw5-9s1.js.map +0 -1
  233. package/dist/apps-MKQbgDtN.js.map +0 -1
  234. package/dist/build-BuKTnec8.js.map +0 -1
  235. package/dist/bundle-BAH4FCju.js.map +0 -1
  236. package/dist/cloud-Cj5ey3l_.js.map +0 -1
  237. package/dist/collection-drift-BKj_BoMq.js +0 -106
  238. package/dist/collection-drift-BKj_BoMq.js.map +0 -1
  239. package/dist/collections-dir-DlvDhime.js +0 -69
  240. package/dist/collections-dir-DlvDhime.js.map +0 -1
  241. package/dist/console-CdwIYOMV.js.map +0 -1
  242. package/dist/context-AXdAh-q8.js.map +0 -1
  243. package/dist/db-DBbKpjYX.js.map +0 -1
  244. package/dist/derive-ae9UOoOB.js.map +0 -1
  245. package/dist/dev-C93d4QIv.js.map +0 -1
  246. package/dist/dev-preflight-Cxv3TiD1.js.map +0 -1
  247. package/dist/doctor-BBPQUO2g.js.map +0 -1
  248. package/dist/eject-DABcDnPN.js.map +0 -1
  249. package/dist/fold-static-BWzxNn06.js.map +0 -1
  250. package/dist/generate-view-IFwCADvb.js.map +0 -1
  251. package/dist/generate_sdk-DNmNuFuW.js.map +0 -1
  252. package/dist/init-vL1DWOeC.js.map +0 -1
  253. package/dist/last-dev-database-DpW5dfoX.js +0 -2
  254. package/dist/manifest-BtzDy7KQ.js.map +0 -1
  255. package/dist/path-flags-DNvtEi2-.js +0 -92
  256. package/dist/path-flags-DNvtEi2-.js.map +0 -1
  257. package/dist/project-CasK56vN.js.map +0 -1
  258. package/dist/pull-DDMpsZ5r.js.map +0 -1
  259. package/dist/resolve-D647F1LA.js +0 -2
  260. package/dist/schema-DtLPsXbT.js.map +0 -1
  261. package/dist/schema-reconcile-DkArN9jF.js +0 -2
  262. package/dist/skills-CbwV6vw_.js.map +0 -1
  263. package/dist/status-BREvtzJm.js.map +0 -1
  264. package/dist/storage-CO9ouK76.js.map +0 -1
  265. package/dist/utils/collection-drift.d.ts +0 -27
  266. package/dist/utils/collections-dir.d.ts +0 -14
  267. package/dist/verify-Y3rWSgfA.js +0 -730
  268. package/dist/verify-Y3rWSgfA.js.map +0 -1
  269. package/templates/overlays/baas/config/index.ts +0 -24
  270. package/templates/overlays/baas/config/package.json +0 -30
  271. package/templates/template/config/cms.d.ts +0 -15
  272. package/templates/template/config/collections/authors.ts +0 -47
  273. package/templates/template/config/collections/index.ts +0 -44
  274. package/templates/template/config/collections/posts.ts +0 -94
  275. package/templates/template/config/collections/presets/blank/index.ts +0 -5
  276. package/templates/template/config/collections/presets/ecommerce/categories.ts +0 -42
  277. package/templates/template/config/collections/presets/ecommerce/index.ts +0 -31
  278. package/templates/template/config/collections/presets/ecommerce/orders.ts +0 -78
  279. package/templates/template/config/collections/presets/ecommerce/products.ts +0 -73
  280. package/templates/template/config/collections/tags.ts +0 -27
  281. package/templates/template/config/collections/users.ts +0 -149
  282. package/templates/template/config/frontend-assets.d.ts +0 -17
  283. package/templates/template/config/index.ts +0 -12
  284. package/templates/template/config/package.json +0 -30
  285. package/templates/template/config/tsconfig.json +0 -35
  286. /package/templates/eject/{config → backend}/resources.ts +0 -0
@@ -1,32 +1,51 @@
1
1
  /** The rule, as every help page and error states it. */
2
- export declare const COLLECTIONS_PATH_RULE = "relative paths are resolved from where you run the command";
3
- /** The `--collections` line of a help page. */
4
- export declare const COLLECTIONS_FLAG_HELP = "Collections directory (default: config/collections, or <config>/collections when rebase.json moves the backend's config); relative paths are resolved from where you run the command";
2
+ export declare const PATH_RESOLUTION_RULE = "relative paths are resolved from where you run the command";
3
+ /** The `--schema-dir` line of a help page. */
4
+ export declare const SCHEMA_DIR_FLAG_HELP: string;
5
5
  /**
6
- * What a refusal over a missing `--collections` path spared, by what the command
6
+ * What a refusal over a missing `--schema-dir` path spared, by what the command
7
7
  * would have done with it. Only a schema writer drops tables; a console or a
8
8
  * doctor run over nothing does something else wrong, and says so.
9
9
  */
10
- declare const MISSING_COLLECTIONS_CONSEQUENCE: {
10
+ declare const MISSING_SCHEMA_DIR_CONSEQUENCE: {
11
11
  readonly schema: readonly ["Nothing was generated and nothing was applied — a schema generated from a", "directory that is not there is an empty one, and applying it would drop", "every table it does not describe."];
12
- readonly console: readonly ["Nothing was started — a console over a directory that is not there would", "load none of this project's collections."];
13
- readonly doctor: readonly ["Nothing was checked — a directory that is not there has no collections, so", "every collection check would pass over it."];
14
- readonly verify: readonly ["Nothing was verified — a directory that is not there has no collections, so", "every step would pass over it and report 0 errors."];
12
+ readonly console: readonly ["Nothing was started — a console over a directory that is not there would", "load none of this project's tables."];
13
+ readonly doctor: readonly ["Nothing was checked — a directory that is not there declares no tables, so", "every table check would pass over it."];
14
+ readonly verify: readonly ["Nothing was verified — a directory that is not there declares no tables, so", "every step would pass over it and report 0 errors."];
15
15
  };
16
- /** What a command does with its `--collections` path. */
17
- export type CollectionsPathUse = keyof typeof MISSING_COLLECTIONS_CONSEQUENCE;
16
+ /** What a command does with its `--schema-dir` path. */
17
+ export type SchemaDirUse = keyof typeof MISSING_SCHEMA_DIR_CONSEQUENCE;
18
18
  /**
19
- * The refusal for a `--collections` path that does not exist, or `null`.
19
+ * The refusal for a `--schema-dir` path that does not exist, or `null`.
20
20
  *
21
21
  * Checked by the CLI, in the reader's terms, before the driver is spawned: the
22
22
  * driver's own check runs in `backend/` and can only describe the path it was
23
23
  * handed. A generator pointed at a directory that is not there writes an empty
24
24
  * schema, and a push of an empty schema drops every table — so nothing runs.
25
25
  *
26
- * Scripts written for the old rule (`--collections ../config/collections`,
27
- * run from the root) land here, and the message says exactly what to change.
26
+ * A path written from `backend/` (`--schema-dir schema`, run from the root)
27
+ * lands here, and the message says exactly what to change.
28
28
  */
29
- export declare function missingCollectionsPath(args: readonly string[], cwd: string, backendDir: string, use?: CollectionsPathUse): string[] | null;
30
- /** Print {@link missingCollectionsPath}'s refusal and exit 1, or return. */
31
- export declare function refuseMissingCollectionsPath(args: readonly string[], cwd: string, backendDir: string, use?: CollectionsPathUse): void;
29
+ export declare function missingSchemaDir(args: readonly string[], cwd: string, backendDir: string, use?: SchemaDirUse): string[] | null;
30
+ /**
31
+ * The sentence a typed `--collections` (or, on a command that had it, `-c`)
32
+ * is refused with, or `null` when the line has neither.
33
+ *
34
+ * The flag named a `config/collections` directory of `defineCollection` files,
35
+ * which nothing reads any more. Refused rather than ignored: reading the
36
+ * default directory instead of the one typed would check, generate or push a
37
+ * different schema than the one asked about. There is no short form of the
38
+ * replacement — `--schema-dir` is spelled out.
39
+ *
40
+ * Only the words before a `--` separator count: after it, the line belongs to
41
+ * whatever the command relays it to.
42
+ */
43
+ export declare function removedCollectionsFlag(args: readonly string[], command: string): string | null;
44
+ /**
45
+ * Throw {@link removedCollectionsFlag}'s sentence as a {@link UsageError}, or
46
+ * return. Called before anything starts — no database, no driver.
47
+ */
48
+ export declare function refuseRemovedCollectionsFlag(args: readonly string[], command: string): void;
49
+ /** Print {@link missingSchemaDir}'s refusal and exit 1, or return. */
50
+ export declare function refuseMissingSchemaDir(args: readonly string[], cwd: string, backendDir: string, use?: SchemaDirUse): void;
32
51
  export {};
@@ -0,0 +1,40 @@
1
+ /**
2
+ * The project's `backend/schema`, imported in this process — for the commands
3
+ * that read the tables themselves rather than through the driver: `rebase
4
+ * verify`, `rebase build`, `rebase resources`, `rebase generate-sdk`.
5
+ *
6
+ * Through `loadBackendSchema` from `@rebasepro/server`, the one definition of
7
+ * "the tables" that boot, the runtime and the driver also read, so a command
8
+ * here can never accept a schema the server refuses (or the reverse): a table
9
+ * with no `rls`, an index that does not export a sibling's table, a project
10
+ * still on the collections layout — each is the loader's error, word for word.
11
+ * Modules are imported with the CLI's one importer
12
+ * (`createSchemaModuleImporter`), so a file written earlier in the same
13
+ * process is read as it is now.
14
+ */
15
+ import type { CompiledSchema, LoadedSchema } from "@rebasepro/server";
16
+ /** The project's schema, as the loader read it and as it compiles. */
17
+ export interface ProjectSchema {
18
+ loaded: LoadedSchema;
19
+ compiled: CompiledSchema;
20
+ }
21
+ /**
22
+ * Module specifiers mapped to files, for the importer. A user's project
23
+ * resolves through its own `node_modules` and passes none; tests and in-repo
24
+ * runs point `@rebasepro/*` at the workspace's source.
25
+ */
26
+ export type ModuleAliases = Record<string, string>;
27
+ /**
28
+ * Import and compile a project's schema directory.
29
+ *
30
+ * Throws what the loader throws: `SchemaLoadError` (a module that does not
31
+ * import, the legacy layout, a definition the index does not export) or
32
+ * `SchemaDefinitionError` from `@rebasepro/common` (every problem with every
33
+ * definition, one per line). A directory that does not exist, or has no
34
+ * index, declares no tables: `descriptors` is empty.
35
+ *
36
+ * @param projectRoot the project root — where a leftover legacy collections
37
+ * directory would be, and what the importer is rooted at.
38
+ * @param schemaDir the schema directory, absolute.
39
+ */
40
+ export declare function loadProjectSchema(projectRoot: string, schemaDir: string, aliases?: ModuleAliases): Promise<ProjectSchema>;
@@ -4,8 +4,14 @@ export declare const MANIFEST_FILENAME = "rebase.json";
4
4
  * Walk up from `startDir` to find the Rebase project root.
5
5
  *
6
6
  * A directory is the root when it holds a `rebase.json`, or when it holds a
7
- * `package.json` that either lists `backend` as a workspace or sits beside both
8
- * `backend/` and `config/`.
7
+ * `package.json` that either lists `backend` as a workspace or sits beside a
8
+ * `backend/` directory.
9
+ *
10
+ * There is no `config/` requirement any more: the config package is gone (its
11
+ * collections became `backend/schema`, the rest moved into `backend/`), and a
12
+ * BaaS project is a `backend/` and nothing else. The `package.json` is still
13
+ * required beside it, so a stray `backend/` folder deep inside some unrelated
14
+ * tree does not make its parent a project.
9
15
  *
10
16
  * `rebase.json` is checked first and needs no `package.json` beside it, because
11
17
  * the conventions below all describe a repository that *contains the backend*.
@@ -0,0 +1,32 @@
1
+ /**
2
+ * The flag that hands the driver CLI (`@rebasepro/server-postgres`) the schema
3
+ * directory, as an absolute path.
4
+ *
5
+ * The receiving end is the driver's own argument spec: when the driver slice
6
+ * renames its flag, this constant and {@link schemaDirFlag} are the only CLI
7
+ * lines that change.
8
+ */
9
+ export declare const SCHEMA_DIR_FLAG = "--schema-dir";
10
+ /** The tables directory, relative to the project root, as the backend app declares it. */
11
+ export declare function resolveTablesDir(projectRoot: string): string;
12
+ /** The tables directory, absolute. */
13
+ export declare function resolveSchemaDir(projectRoot: string): string;
14
+ /**
15
+ * The driver argv naming `dir` as the schema directory: `["--schema-dir", dir]`.
16
+ *
17
+ * The whole CLI → driver contract for this flag, in one function. `dir` is
18
+ * absolute — the driver runs with `cwd: backend/`, so a relative path would be
19
+ * resolved from a directory the user never typed it in.
20
+ */
21
+ export declare function schemaDirFlag(dir: string): string[];
22
+ /**
23
+ * {@link schemaDirFlag} for a driver command line, or nothing.
24
+ *
25
+ * `driverArgs` is the line as the driver gets it (`["db", "push", …]`,
26
+ * `["doctor", …]`). Nothing for a command that does not read the schema,
27
+ * nothing when the line already names a directory, and nothing when the
28
+ * project keeps its tables at the default — the driver's own default is
29
+ * `backend/schema` (`schema` from its `cwd`), so a conventional project's
30
+ * command lines stay as short as they were.
31
+ */
32
+ export declare function schemaDirArgs(projectRoot: string, driverArgs: readonly string[]): string[];
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Can an edit to this file have changed the generated SQL schema?
3
+ *
4
+ * `relativePath` is relative to the tables directory, as `fs.watch` reports it.
5
+ */
6
+ export declare function isSchemaSourceFile(relativePath: string): boolean;
@@ -0,0 +1,24 @@
1
+ /** A table one schema file declares. */
2
+ export interface DeclaredTable {
3
+ /** The API slug: the definition's name, or its `slug: "…"` override. */
4
+ slug: string;
5
+ /** The file it is declared in, absolute. */
6
+ file: string;
7
+ }
8
+ /**
9
+ * Every module under the schema directory, depth first and sorted: what the
10
+ * loader would import. Tests, declaration files, dotfiles and `node_modules`
11
+ * are not modules of the schema.
12
+ */
13
+ export declare function schemaModules(dir: string): string[];
14
+ /**
15
+ * The slug of every table one schema file's source declares.
16
+ *
17
+ * Each `defineTable("name", …)` / `defineAuthTable` / `defineView` call is a
18
+ * table whose slug is its name, unless a `slug: "…"` appears before the next
19
+ * definition. A computed name or slug is simply not seen, which is the right
20
+ * failure for checks that only ever report or refuse.
21
+ */
22
+ export declare function declaredTableSlugs(source: string): string[];
23
+ /** Every table the schema directory's files declare, in file order. */
24
+ export declare function declaredTables(schemaDir: string): DeclaredTable[];