@rebasepro/cli 0.30.1 → 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 (284) 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-DtADfWwn.js → cloud-CYMk92iG.js} +72 -71
  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/context.d.ts +1 -1
  62. package/dist/commands/cloud/init.d.ts +2 -2
  63. package/dist/commands/console.d.ts +1 -2
  64. package/dist/commands/db.d.ts +5 -6
  65. package/dist/commands/dev.d.ts +18 -17
  66. package/dist/commands/doctor.d.ts +4 -5
  67. package/dist/commands/eject.d.ts +17 -13
  68. package/dist/commands/generate-view.d.ts +20 -9
  69. package/dist/commands/generate_sdk.d.ts +27 -27
  70. package/dist/commands/init.d.ts +21 -8
  71. package/dist/commands/migrate.d.ts +24 -0
  72. package/dist/commands/schema-reconcile.d.ts +1 -1
  73. package/dist/commands/skills.d.ts +8 -0
  74. package/dist/commands/verify-cms.d.ts +28 -0
  75. package/dist/commands/verify.d.ts +14 -9
  76. package/dist/{consent-BD7F29T3.js → consent-BXLIrMl8.js} +2 -2
  77. package/dist/{consent-BD7F29T3.js.map → consent-BXLIrMl8.js.map} +1 -1
  78. package/dist/{console-CdwIYOMV.js → console-C1d3LwB7.js} +14 -14
  79. package/dist/console-C1d3LwB7.js.map +1 -0
  80. package/dist/{context-AXdAh-q8.js → context--JwaHaZp.js} +6 -5
  81. package/dist/context--JwaHaZp.js.map +1 -0
  82. package/dist/{daemon-Cp7oNXth.js → daemon-w30PsdwV.js} +2 -2
  83. package/dist/{daemon-Cp7oNXth.js.map → daemon-w30PsdwV.js.map} +1 -1
  84. package/dist/{db-DBbKpjYX.js → db-DQZK9n9c.js} +52 -51
  85. package/dist/db-DQZK9n9c.js.map +1 -0
  86. package/dist/{derive-ae9UOoOB.js → derive-C3ezmY-p.js} +105 -133
  87. package/dist/derive-C3ezmY-p.js.map +1 -0
  88. package/dist/{dev-C93d4QIv.js → dev-PY5h4O6u.js} +142 -84
  89. package/dist/dev-PY5h4O6u.js.map +1 -0
  90. package/dist/dev-db/attver.d.ts +32 -0
  91. package/dist/dev-db/pull.d.ts +15 -1
  92. package/dist/{dev-preflight-Cxv3TiD1.js → dev-preflight-DjvcV6SK.js} +5 -5
  93. package/dist/dev-preflight-DjvcV6SK.js.map +1 -0
  94. package/dist/{dev-server-OJsUGZEB.js → dev-server-BLxCbQEP.js} +2 -2
  95. package/dist/{dev-server-OJsUGZEB.js.map → dev-server-BLxCbQEP.js.map} +1 -1
  96. package/dist/{doctor-BBPQUO2g.js → doctor-CnUu8kpM.js} +39 -62
  97. package/dist/doctor-CnUu8kpM.js.map +1 -0
  98. package/dist/doctor-environment.d.ts +6 -6
  99. package/dist/{eject-DABcDnPN.js → eject-Bhzd6hgb.js} +25 -16
  100. package/dist/eject-Bhzd6hgb.js.map +1 -0
  101. package/dist/{fold-static-BWzxNn06.js → fold-static-CKewnAPX.js} +5 -3
  102. package/dist/fold-static-CKewnAPX.js.map +1 -0
  103. package/dist/{generate-view-IFwCADvb.js → generate-view-CTOluXvH.js} +160 -89
  104. package/dist/generate-view-CTOluXvH.js.map +1 -0
  105. package/dist/{generate_sdk-DNmNuFuW.js → generate_sdk-De-aLC1L.js} +120 -137
  106. package/dist/generate_sdk-De-aLC1L.js.map +1 -0
  107. package/dist/import-schema-module-Df67TIWj.js +51 -0
  108. package/dist/import-schema-module-Df67TIWj.js.map +1 -0
  109. package/dist/index.es.js +64 -51
  110. package/dist/index.es.js.map +1 -1
  111. package/dist/{init-vL1DWOeC.js → init-Dtl-IcXf.js} +83 -80
  112. package/dist/init-Dtl-IcXf.js.map +1 -0
  113. package/dist/last-dev-database-Dc8cP01o.js +2 -0
  114. package/dist/{manifest-BtzDy7KQ.js → manifest-C3uLDrrJ.js} +115 -40
  115. package/dist/manifest-C3uLDrrJ.js.map +1 -0
  116. package/dist/manifest.d.ts +79 -24
  117. package/dist/migrate-VrKoi3nB.js +138 -0
  118. package/dist/migrate-VrKoi3nB.js.map +1 -0
  119. package/dist/{normalize-imports-Bd5Y4yLp.js → normalize-imports-DwxqEMYq.js} +3 -3
  120. package/dist/{normalize-imports-Bd5Y4yLp.js.map → normalize-imports-DwxqEMYq.js.map} +1 -1
  121. package/dist/path-flags-7O5uPBcQ.js +139 -0
  122. package/dist/path-flags-7O5uPBcQ.js.map +1 -0
  123. package/dist/{prepare-CTw9NEkh.js → prepare-Ccxspoj-.js} +4 -4
  124. package/dist/{prepare-CTw9NEkh.js.map → prepare-Ccxspoj-.js.map} +1 -1
  125. package/dist/project-CLcF5i8c.js +360 -0
  126. package/dist/project-CLcF5i8c.js.map +1 -0
  127. package/dist/project-schema-CsSOG2gE.js +30 -0
  128. package/dist/project-schema-CsSOG2gE.js.map +1 -0
  129. package/dist/{pull-DDMpsZ5r.js → pull-DRWqBZp5.js} +327 -4
  130. package/dist/pull-DRWqBZp5.js.map +1 -0
  131. package/dist/resolve-BY7bSFRT.js +2 -0
  132. package/dist/resources/derive.d.ts +19 -13
  133. package/dist/{resources-CPSC5Kcu.js → resources-Dpfs2y8P.js} +5 -4
  134. package/dist/{resources-CPSC5Kcu.js.map → resources-Dpfs2y8P.js.map} +1 -1
  135. package/dist/{schema-DtLPsXbT.js → schema-CdDjv5zI.js} +41 -39
  136. package/dist/schema-CdDjv5zI.js.map +1 -0
  137. package/dist/schema-dir-Cd1kvYbf.js +98 -0
  138. package/dist/schema-dir-Cd1kvYbf.js.map +1 -0
  139. package/dist/schema-reconcile-BAupXfkd.js +2 -0
  140. package/dist/schema-text-CpNrsuMe.js +73 -0
  141. package/dist/schema-text-CpNrsuMe.js.map +1 -0
  142. package/dist/{skills-CbwV6vw_.js → skills-CXjA9TWw.js} +54 -10
  143. package/dist/skills-CXjA9TWw.js.map +1 -0
  144. package/dist/{start-YOr3X5Zm.js → start-Bwbtt2W5.js} +7 -10
  145. package/dist/{start-YOr3X5Zm.js.map → start-Bwbtt2W5.js.map} +1 -1
  146. package/dist/{status-BREvtzJm.js → status-D7XCGHu2.js} +12 -12
  147. package/dist/status-D7XCGHu2.js.map +1 -0
  148. package/dist/{storage-CO9ouK76.js → storage-iTqj5-Av.js} +12 -11
  149. package/dist/storage-iTqj5-Av.js.map +1 -0
  150. package/dist/{telemetry-DwK5RQJl.js → telemetry-BP_1Cl9r.js} +4 -4
  151. package/dist/{telemetry-DwK5RQJl.js.map → telemetry-BP_1Cl9r.js.map} +1 -1
  152. package/dist/{telemetry-CgwJPVMO.js → telemetry-M3HjlyhZ.js} +2 -2
  153. package/dist/{telemetry-CgwJPVMO.js.map → telemetry-M3HjlyhZ.js.map} +1 -1
  154. package/dist/{upgrade-B7sVwL8S.js → upgrade-oZzJ13jM.js} +5 -4
  155. package/dist/{upgrade-B7sVwL8S.js.map → upgrade-oZzJ13jM.js.map} +1 -1
  156. package/dist/utils/backend-guard.d.ts +47 -0
  157. package/dist/utils/cms-directories.d.ts +6 -0
  158. package/dist/utils/dev-preflight.d.ts +2 -2
  159. package/dist/utils/import-schema-module.d.ts +16 -0
  160. package/dist/utils/path-flags.d.ts +35 -16
  161. package/dist/utils/project-schema.d.ts +40 -0
  162. package/dist/utils/project.d.ts +8 -2
  163. package/dist/utils/schema-dir.d.ts +32 -0
  164. package/dist/utils/schema-drift.d.ts +6 -0
  165. package/dist/utils/schema-text.d.ts +24 -0
  166. package/dist/verify-5p_vaUG2.js +1160 -0
  167. package/dist/verify-5p_vaUG2.js.map +1 -0
  168. package/package.json +11 -8
  169. package/runtime/dev-server.mjs +5 -1
  170. package/templates/eject/Dockerfile +1 -4
  171. package/templates/eject/backend/src/env.ts +1 -1
  172. package/templates/eject/backend/src/index.ts +53 -40
  173. package/templates/eject/docker-compose.custom.yml +1 -1
  174. package/templates/overlays/baas/README.md +39 -12
  175. package/templates/overlays/baas/ai-instructions.md +8 -8
  176. package/templates/overlays/baas/{config → backend}/storage.ts +3 -4
  177. package/templates/overlays/baas/backend/tsconfig.json +10 -12
  178. package/templates/overlays/baas/package.json +1 -2
  179. package/templates/overlays/baas/pnpm-workspace.yaml +0 -1
  180. package/templates/presets/blank/backend/schema/index.ts +19 -0
  181. package/templates/presets/blank/frontend/src/App.tsx +56 -0
  182. package/templates/presets/ecommerce/backend/schema/categories.ts +12 -0
  183. package/templates/presets/ecommerce/backend/schema/index.ts +23 -0
  184. package/templates/presets/ecommerce/backend/schema/orders.ts +13 -0
  185. package/templates/presets/ecommerce/backend/schema/products.ts +18 -0
  186. package/templates/presets/ecommerce/frontend/src/App.tsx +59 -0
  187. package/templates/presets/ecommerce/frontend/src/cms/categories.tsx +12 -0
  188. package/templates/presets/ecommerce/frontend/src/cms/orders.tsx +38 -0
  189. package/templates/presets/ecommerce/frontend/src/cms/products.tsx +27 -0
  190. package/templates/resource-graphs/blank.json +2 -2
  191. package/templates/resource-graphs/blog.json +5 -5
  192. package/templates/resource-graphs/ecommerce.json +5 -5
  193. package/templates/resource-graphs/headless.json +1 -1
  194. package/templates/template/.claude/hooks/post-edit-collection.sh +27 -23
  195. package/templates/template/.cursorrules +2 -2
  196. package/templates/template/.env.example +6 -17
  197. package/templates/template/.github/copilot-instructions.md +2 -2
  198. package/templates/template/.windsurfrules +2 -2
  199. package/templates/template/AGENTS.md +2 -2
  200. package/templates/template/CLAUDE.md +2 -2
  201. package/templates/template/README.md +47 -13
  202. package/templates/template/ai-instructions.md +15 -14
  203. package/templates/template/backend/functions/hello.ts +1 -1
  204. package/templates/template/backend/package.json +0 -2
  205. package/templates/template/{config → backend}/resources.ts +3 -3
  206. package/templates/template/backend/schema/authors.ts +11 -0
  207. package/templates/template/backend/schema/index.ts +29 -0
  208. package/templates/template/backend/schema/posts.ts +29 -0
  209. package/templates/template/backend/schema/tags.ts +9 -0
  210. package/templates/template/backend/schema/users.ts +32 -0
  211. package/templates/template/{config → backend}/storage.ts +4 -4
  212. package/templates/template/backend/tsconfig.json +15 -20
  213. package/templates/template/docker-compose.yml +3 -3
  214. package/templates/template/frontend/package.json +0 -2
  215. package/templates/template/frontend/src/App.tsx +10 -4
  216. package/templates/template/frontend/src/cms/authors.tsx +7 -0
  217. package/templates/template/frontend/src/cms/posts.tsx +27 -0
  218. package/templates/template/frontend/src/cms/tags.tsx +11 -0
  219. package/templates/template/frontend/src/cms/ui-config.json +3 -0
  220. package/templates/template/frontend/src/cms/users.tsx +54 -0
  221. package/templates/template/frontend/src/{virtual.d.ts → vite-env.d.ts} +0 -4
  222. package/templates/template/frontend/vite.config.ts +6 -2
  223. package/templates/template/gitignore +1 -1
  224. package/templates/template/package.json +1 -2
  225. package/templates/template/pnpm-workspace.yaml +0 -1
  226. package/templates/template/scripts/example.ts +3 -3
  227. package/templates/template/tsconfig.json +1 -1
  228. package/templates/views/AppView.tsx.tmpl +4 -4
  229. package/templates/views/EntityView.tsx.tmpl +3 -4
  230. package/dist/api-keys-Dfw5-9s1.js.map +0 -1
  231. package/dist/apps-MKQbgDtN.js.map +0 -1
  232. package/dist/build-BuKTnec8.js.map +0 -1
  233. package/dist/bundle-BAH4FCju.js.map +0 -1
  234. package/dist/cloud-DtADfWwn.js.map +0 -1
  235. package/dist/collection-drift-BKj_BoMq.js +0 -106
  236. package/dist/collection-drift-BKj_BoMq.js.map +0 -1
  237. package/dist/collections-dir-DlvDhime.js +0 -69
  238. package/dist/collections-dir-DlvDhime.js.map +0 -1
  239. package/dist/console-CdwIYOMV.js.map +0 -1
  240. package/dist/context-AXdAh-q8.js.map +0 -1
  241. package/dist/db-DBbKpjYX.js.map +0 -1
  242. package/dist/derive-ae9UOoOB.js.map +0 -1
  243. package/dist/dev-C93d4QIv.js.map +0 -1
  244. package/dist/dev-preflight-Cxv3TiD1.js.map +0 -1
  245. package/dist/doctor-BBPQUO2g.js.map +0 -1
  246. package/dist/eject-DABcDnPN.js.map +0 -1
  247. package/dist/fold-static-BWzxNn06.js.map +0 -1
  248. package/dist/generate-view-IFwCADvb.js.map +0 -1
  249. package/dist/generate_sdk-DNmNuFuW.js.map +0 -1
  250. package/dist/init-vL1DWOeC.js.map +0 -1
  251. package/dist/last-dev-database-DpW5dfoX.js +0 -2
  252. package/dist/manifest-BtzDy7KQ.js.map +0 -1
  253. package/dist/path-flags-DNvtEi2-.js +0 -92
  254. package/dist/path-flags-DNvtEi2-.js.map +0 -1
  255. package/dist/project-CasK56vN.js.map +0 -1
  256. package/dist/pull-DDMpsZ5r.js.map +0 -1
  257. package/dist/resolve-D647F1LA.js +0 -2
  258. package/dist/schema-DtLPsXbT.js.map +0 -1
  259. package/dist/schema-reconcile-DkArN9jF.js +0 -2
  260. package/dist/skills-CbwV6vw_.js.map +0 -1
  261. package/dist/status-BREvtzJm.js.map +0 -1
  262. package/dist/storage-CO9ouK76.js.map +0 -1
  263. package/dist/utils/collection-drift.d.ts +0 -27
  264. package/dist/utils/collections-dir.d.ts +0 -14
  265. package/dist/verify-Y3rWSgfA.js +0 -730
  266. package/dist/verify-Y3rWSgfA.js.map +0 -1
  267. package/templates/overlays/baas/config/index.ts +0 -24
  268. package/templates/overlays/baas/config/package.json +0 -30
  269. package/templates/template/config/cms.d.ts +0 -15
  270. package/templates/template/config/collections/authors.ts +0 -47
  271. package/templates/template/config/collections/index.ts +0 -44
  272. package/templates/template/config/collections/posts.ts +0 -94
  273. package/templates/template/config/collections/presets/blank/index.ts +0 -5
  274. package/templates/template/config/collections/presets/ecommerce/categories.ts +0 -42
  275. package/templates/template/config/collections/presets/ecommerce/index.ts +0 -31
  276. package/templates/template/config/collections/presets/ecommerce/orders.ts +0 -78
  277. package/templates/template/config/collections/presets/ecommerce/products.ts +0 -73
  278. package/templates/template/config/collections/tags.ts +0 -27
  279. package/templates/template/config/collections/users.ts +0 -149
  280. package/templates/template/config/frontend-assets.d.ts +0 -17
  281. package/templates/template/config/index.ts +0 -12
  282. package/templates/template/config/package.json +0 -30
  283. package/templates/template/config/tsconfig.json +0 -35
  284. /package/templates/eject/{config → backend}/resources.ts +0 -0
@@ -1,8 +1,9 @@
1
- import { i as recordEvent } from "./telemetry-CgwJPVMO.js";
2
- import { C as switchOn, E as unknownCommand, O as redactConnectionPasswords, S as resolveSwitchValues, T as suggestCommand, _ as resolveTsxLoader, b as UsageError, f as requireBackendDir, g as resolveTsx, h as resolvePluginCliScript, l as getActiveBackendPlugin, n as dependenciesNotInstalled, o as findEnvFile, p as requireProjectRoot, x as parseCommandArgs } from "./project-CasK56vN.js";
3
- import { i as refuseMissingCollectionsPath, t as COLLECTIONS_FLAG_HELP } from "./path-flags-DNvtEi2-.js";
4
- import { collectionsDirArgs } from "./collections-dir-DlvDhime.js";
5
- import { DEV_DATABASE_KIND_ENV, devDatabaseKind } from "./prepare-CTw9NEkh.js";
1
+ import { i as recordEvent } from "./telemetry-M3HjlyhZ.js";
2
+ import { i as switchOn, l as redactConnectionPasswords, n as parseCommandArgs, o as suggestCommand, r as resolveSwitchValues, s as unknownCommand, t as UsageError } from "./args-CaCcrYE1.js";
3
+ import { _ as resolveTsxLoader, f as requireBackendDir, g as resolveTsx, h as resolvePluginCliScript, l as getActiveBackendPlugin, n as dependenciesNotInstalled, o as findEnvFile, p as requireProjectRoot } from "./project-CLcF5i8c.js";
4
+ import { r as schemaDirArgs } from "./schema-dir-Cd1kvYbf.js";
5
+ import { i as refuseMissingSchemaDir, n as SCHEMA_DIR_FLAG_HELP } from "./path-flags-7O5uPBcQ.js";
6
+ import { DEV_DATABASE_KIND_ENV, devDatabaseKind } from "./prepare-Ccxspoj-.js";
6
7
  import chalk from "chalk";
7
8
  import fs from "fs";
8
9
  import os from "os";
@@ -152,16 +153,14 @@ var REMOTE_DESTINATION_RE = /^[a-z][a-z0-9+.-]*:\/\//i;
152
153
  * absolutised once, so the one spelling the help page names was the one that
153
154
  * landed in `backend/` — and the success line still echoed the path as typed.
154
155
  *
155
- * And `--collections`, which was not absolutised at all: from the project root,
156
- * `rebase schema generate --collections ./config/collections` was "not found",
157
- * while the same spelling worked for `generate-sdk`. See `utils/path-flags.ts`.
156
+ * And `--schema-dir`, the schema directory: a path typed from the project root
157
+ * must not be read from `backend/`. See `utils/path-flags.ts`.
158
158
  */
159
159
  var LOCAL_PATH_FLAGS = [
160
160
  "--out",
161
161
  "--output",
162
162
  "-o",
163
- "--collections",
164
- "-c"
163
+ "--schema-dir"
165
164
  ];
166
165
  /**
167
166
  * Rewrite local path arguments so they mean what the user typed.
@@ -388,7 +387,7 @@ var ATLAS_DEV_URL_ENV = "REBASE_ATLAS_DEV_URL";
388
387
  */
389
388
  var INVOCATION_CWD_ENV = "REBASE_INVOCATION_CWD";
390
389
  /** Loaded only when a command needs one: PGlite is 25 MB of WASM. */
391
- var startAtlasDevDatabase = async () => (await import("./atlas-dev-database-BODqdCWt.js")).startAtlasDevDatabase();
390
+ var startAtlasDevDatabase = async () => (await import("./atlas-dev-database-DOCKk6ht.js")).startAtlasDevDatabase();
392
391
  /**
393
392
  * The empty database an Atlas-backed subcommand plans against, on the managed
394
393
  * development database.
@@ -429,7 +428,7 @@ async function atlasDevDatabaseFor(rawArgs, kind, env, start = startAtlasDevData
429
428
  chalk.gray(" Atlas plans every change against a second, empty database. On the managed"),
430
429
  chalk.gray(" database that is a throwaway PGlite, started for the command."),
431
430
  "",
432
- chalk.gray(` ${chalk.cyan("rebase dev")} still applies your collections at boot, additively. Otherwise,`),
431
+ chalk.gray(` ${chalk.cyan("rebase dev")} still applies your tables at boot, additively. Otherwise,`),
433
432
  chalk.gray(` set ${ATLAS_DEV_URL_ENV} to an empty Postgres database Atlas may fill and clear,`),
434
433
  chalk.gray(" or point the project at a real Postgres (uncomment DATABASE_URL in .env)."),
435
434
  ""
@@ -534,7 +533,7 @@ function refuseRestoreOnManagedDatabase(rawArgs, kind) {
534
533
  * Resolve the active driver's CLI and the environment it should run in.
535
534
  *
536
535
  * Shared by the two runners below. Deliberately does NOT resolve a database:
537
- * `schema generate` reads collection files and writes one file, and starting a
536
+ * `schema generate` reads the schema directory and writes one file, and starting a
538
537
  * database to run it would be a side effect nobody asked for.
539
538
  */
540
539
  async function resolveDriverCli() {
@@ -563,7 +562,7 @@ async function resolveDriverCli() {
563
562
  * shipped `dist/cli.js` all three quietly switched to plain `node`, and the
564
563
  * driver loads the PROJECT's TypeScript in process:
565
564
  *
566
- * - `schema stale` reads the collections, could not resolve `./authors` onto
565
+ * - `schema stale` reads the tables, could not resolve `./authors` onto
567
566
  * `authors.ts`, and answered "⏭ Not checked" while exiting 0;
568
567
  * - `db push` does the same in `ensureAuthTables`, so `rebase.users` was never
569
568
  * created and the push died at "Applying RLS policies" with
@@ -580,7 +579,7 @@ async function resolveDriverCli() {
580
579
  * tsx's loader in one Node (`node --import`) rather than the `tsx` binary,
581
580
  * which is a shell shim and a relay Node in front of the same loader: one Node
582
581
  * start instead of two, ~50–100 ms on each of the driver runs every `rebase
583
- * dev` start and every collection save makes. The binary stays the fallback for
582
+ * dev` start and every schema save makes. The binary stays the fallback for
584
583
  * a tsx whose loader does not resolve as a package — a global install.
585
584
  */
586
585
  async function spawnDriverCli(resolved, childArgs, options = {}) {
@@ -617,7 +616,7 @@ var execDriverCli = spawnDriverCli;
617
616
  async function runDriverSchemaCommand(rawArgs, options = {}) {
618
617
  const resolved = await resolveDriverCli();
619
618
  const driverArgs = rawArgs.slice(2);
620
- await execDriverCli(resolved, [...driverArgs, ...collectionsDirArgs(resolved.projectRoot, driverArgs)], options);
619
+ await execDriverCli(resolved, [...driverArgs, ...schemaDirArgs(resolved.projectRoot, driverArgs)], options);
621
620
  }
622
621
  async function runDriverDbCommand(rawArgs, options = {}) {
623
622
  const projectRoot = requireProjectRoot();
@@ -630,14 +629,14 @@ async function runDriverDbCommand(rawArgs, options = {}) {
630
629
  const env = { ...process.env };
631
630
  if (envFile) env.DOTENV_CONFIG_PATH = envFile;
632
631
  env[DEV_DATABASE_KIND_ENV] = devDatabaseKind(projectRoot) ?? "";
633
- const { resolveProjectDatabase } = await import("./prepare-CTw9NEkh.js");
632
+ const { resolveProjectDatabase } = await import("./prepare-Ccxspoj-.js");
634
633
  const resolvedKind = resolveProjectDatabase(projectRoot, {
635
634
  flagUrl: readFlagValue(rawArgs, "--database-url"),
636
635
  flagDocker: switchOn(rawArgs, "--docker")
637
636
  }).kind;
638
637
  refuseBranchOnManagedDatabase(rawArgs, resolvedKind);
639
638
  refuseRestoreOnManagedDatabase(rawArgs, resolvedKind);
640
- const { prepareDatabaseEnv, managedNotices } = await import("./prepare-CTw9NEkh.js");
639
+ const { prepareDatabaseEnv, managedNotices } = await import("./prepare-Ccxspoj-.js");
641
640
  const prepared = await prepareDatabaseEnv(projectRoot, {
642
641
  flagUrl: readFlagValue(rawArgs, "--database-url"),
643
642
  flagDocker: switchOn(rawArgs, "--docker"),
@@ -653,7 +652,7 @@ async function runDriverDbCommand(rawArgs, options = {}) {
653
652
  if (atlasDev) env[ATLAS_DEV_URL_ENV] = atlasDev.url;
654
653
  env[INVOCATION_CWD_ENV] = process.cwd();
655
654
  const typedArgs = absolutizeLocalPathArgs(argsFromCommand(rawArgs, "db"), process.cwd());
656
- const childArgs = [...typedArgs, ...collectionsDirArgs(projectRoot, typedArgs)];
655
+ const childArgs = [...typedArgs, ...schemaDirArgs(projectRoot, typedArgs)];
657
656
  try {
658
657
  await spawnDriverCli({
659
658
  projectRoot,
@@ -693,7 +692,7 @@ async function dbCommand(subcommand, rawArgs) {
693
692
  if (subcommand === "branch" && commandWords(rawArgs, "db")[2] === "switch") assertSwitchFlags(rawArgs);
694
693
  else {
695
694
  await refuseDriverLineBeforeStarting(projectRoot, rawArgs);
696
- refuseMissingCollectionsPath(rawArgs, process.cwd(), requireBackendDir(projectRoot));
695
+ refuseMissingSchemaDir(rawArgs, process.cwd(), requireBackendDir(projectRoot));
697
696
  }
698
697
  await ensureDockerDatabase(projectRoot, rawArgs);
699
698
  if (subcommand === "branch" && commandWords(rawArgs, "db")[2] === "switch") {
@@ -767,8 +766,8 @@ async function refuseDriverLineBeforeStarting(projectRoot, rawArgs) {
767
766
  async function printDatabaseUrl(projectRoot, rawArgs) {
768
767
  const flags = parseUrlFlags(rawArgs);
769
768
  await ensureDockerDatabase(projectRoot, rawArgs);
770
- const { prepareDatabaseEnv } = await import("./prepare-CTw9NEkh.js");
771
- const { readEnvFile } = await import("./project-CasK56vN.js").then((n) => n.u);
769
+ const { prepareDatabaseEnv } = await import("./prepare-Ccxspoj-.js");
770
+ const { readEnvFile } = await import("./project-CLcF5i8c.js").then((n) => n.u);
772
771
  const url = databaseUrlOf(await prepareDatabaseEnv(projectRoot, {
773
772
  flagUrl: flags["--database-url"] ?? null,
774
773
  flagDocker: flags["--docker"] === true,
@@ -790,7 +789,7 @@ async function printDatabaseUrl(projectRoot, rawArgs) {
790
789
  * removing the directory cannot leave a half-dropped schema behind.
791
790
  */
792
791
  async function manageLocalDatabase(subcommand, projectRoot, rawArgs) {
793
- const { resetManagedDatabase, stopManagedDatabase, stoppedManagedDatabaseLines, findRunningDaemon } = await import("./daemon-Cp7oNXth.js").then((n) => n.t);
792
+ const { resetManagedDatabase, stopManagedDatabase, stoppedManagedDatabaseLines, findRunningDaemon } = await import("./daemon-w30PsdwV.js").then((n) => n.t);
794
793
  const { dataDir } = await import("./state-CYdBvnwA.js").then((n) => n.p);
795
794
  const nothingHere = () => {
796
795
  const kind = devDatabaseKind(projectRoot);
@@ -844,9 +843,9 @@ async function manageLocalDatabase(subcommand, projectRoot, rawArgs) {
844
843
  * and the wrong one here means overwriting production with a laptop.
845
844
  */
846
845
  async function pullIntoLocal(projectRoot, rawArgs) {
847
- const { describeRestoreFailure, describeTarget, dumpSource, findPgTool, restoreCopy, sourceProblem } = await import("./pull-DDMpsZ5r.js");
848
- const { prepareDatabaseEnv } = await import("./prepare-CTw9NEkh.js");
849
- const { readEnvFile } = await import("./project-CasK56vN.js").then((n) => n.u);
846
+ const { describeRestoreFailure, describeTarget, dumpSource, findPgTool, restoreCopy, sourceProblem } = await import("./pull-DRWqBZp5.js");
847
+ const { prepareDatabaseEnv } = await import("./prepare-Ccxspoj-.js");
848
+ const { readEnvFile } = await import("./project-CLcF5i8c.js").then((n) => n.u);
850
849
  const flags = parsePullFlags(rawArgs);
851
850
  const schemas = flags["--schema"] ?? [];
852
851
  const anonymize = flags["--anonymize"] === true;
@@ -936,6 +935,7 @@ async function pullIntoLocal(projectRoot, rawArgs) {
936
935
  try {
937
936
  console.log(chalk.gray(" Restoring…"));
938
937
  const restored = await restoreCopy(dumped.plan, dumpFile);
938
+ if (restored.notice) console.log(chalk.yellow(` ${restored.notice}`));
939
939
  failure = restored.failure ? describeRestoreFailure(restored, describeTarget(source)) : null;
940
940
  if (anonymize && restored.started) anonymizeFailure = await anonymizeTarget(target, describeTarget(source), prepared.database.kind);
941
941
  if (restored.started) await restoreAppRole(target);
@@ -977,7 +977,7 @@ async function pullIntoLocal(projectRoot, rawArgs) {
977
977
  */
978
978
  async function restoreAppRole(target) {
979
979
  const { Client } = await import("pg");
980
- const { provisionableSchemas } = await import("./pull-DDMpsZ5r.js");
980
+ const { provisionableSchemas } = await import("./pull-DRWqBZp5.js");
981
981
  const client = new Client({ connectionString: target });
982
982
  client.on("error", () => void 0);
983
983
  try {
@@ -1018,7 +1018,7 @@ async function restoreAppRole(target) {
1018
1018
  */
1019
1019
  async function anonymizeTarget(target, source, kind) {
1020
1020
  const { Client } = await import("pg");
1021
- const { anonymizeCopy } = await import("./pull-DDMpsZ5r.js");
1021
+ const { anonymizeCopy } = await import("./pull-DRWqBZp5.js");
1022
1022
  const deleteIt = kind === "managed" ? `Delete it now: ${chalk.cyan("rebase db reset --yes")}` : kind === "docker" ? `Delete it now: ${chalk.cyan("docker compose down -v")}` : "Delete it now: drop the restored tables, or the database, before anything else reads it.";
1023
1023
  const holdsRealData = (reason) => [
1024
1024
  chalk.red(`✗ The copy could not be anonymized: ${reason}`),
@@ -1065,8 +1065,8 @@ async function anonymizeTarget(target, source, kind) {
1065
1065
  * own connection error follows, which is the same contract `dev` keeps.
1066
1066
  */
1067
1067
  async function ensureDockerDatabase(projectRoot, rawArgs) {
1068
- const { ensureDevDatabase } = await import("./dev-preflight-Cxv3TiD1.js").then((n) => n.n);
1069
- const { resolveProjectDatabase } = await import("./prepare-CTw9NEkh.js");
1068
+ const { ensureDevDatabase } = await import("./dev-preflight-DjvcV6SK.js").then((n) => n.n);
1069
+ const { resolveProjectDatabase } = await import("./prepare-Ccxspoj-.js");
1070
1070
  const resolved = resolveProjectDatabase(projectRoot, {
1071
1071
  flagUrl: readFlagValue(rawArgs, "--database-url"),
1072
1072
  flagDocker: switchOn(rawArgs, "--docker")
@@ -1078,7 +1078,7 @@ async function ensureDockerDatabase(projectRoot, rawArgs) {
1078
1078
  projectRoot,
1079
1079
  databaseUrl: composeUrl,
1080
1080
  disabled: false,
1081
- hasCollections: false,
1081
+ hasTables: false,
1082
1082
  pushSchema: async () => void 0,
1083
1083
  log: (message) => console.error(message)
1084
1084
  });
@@ -1099,7 +1099,7 @@ async function ensureDockerDatabase(projectRoot, rawArgs) {
1099
1099
  async function refuseDeletingActiveBranch(projectRoot, rawArgs) {
1100
1100
  const [, , , name] = commandWords(rawArgs, "db");
1101
1101
  if (!name) return;
1102
- const { readActiveBranch } = await import("./branch-pointer-BQUF6lYa.js");
1102
+ const { readActiveBranch } = await import("./branch-pointer-DMPyvZoK.js");
1103
1103
  const active = readActiveBranch(projectRoot);
1104
1104
  if (active?.name !== name) return;
1105
1105
  const off = "rebase db branch switch --off";
@@ -1135,7 +1135,7 @@ var ACTIVE_BRANCH_DATABASE_ENV = "REBASE_ACTIVE_BRANCH_DATABASE";
1135
1135
  * the database in its environment.
1136
1136
  */
1137
1137
  async function tellDriverTheActiveBranch(projectRoot) {
1138
- const { readActiveBranch } = await import("./branch-pointer-BQUF6lYa.js");
1138
+ const { readActiveBranch } = await import("./branch-pointer-DMPyvZoK.js");
1139
1139
  const active = readActiveBranch(projectRoot);
1140
1140
  if (active) process.env[ACTIVE_BRANCH_DATABASE_ENV] = active.database;
1141
1141
  else delete process.env[ACTIVE_BRANCH_DATABASE_ENV];
@@ -1177,13 +1177,13 @@ var REGISTRY_ACTIONS = /* @__PURE__ */ new Set([
1177
1177
  */
1178
1178
  async function onParentDatabase(projectRoot, rawArgs, action) {
1179
1179
  if (readFlagValue(rawArgs, "--database-url") !== null) return rawArgs;
1180
- const { readActiveBranch } = await import("./branch-pointer-BQUF6lYa.js");
1180
+ const { readActiveBranch } = await import("./branch-pointer-DMPyvZoK.js");
1181
1181
  const active = readActiveBranch(projectRoot);
1182
1182
  if (!active) return rawArgs;
1183
- const { readEnvFile } = await import("./project-CasK56vN.js").then((n) => n.u);
1184
- const { resolveDevDatabase } = await import("./resolve-D647F1LA.js");
1185
- const { resolveComposeUrl } = await import("./prepare-CTw9NEkh.js");
1186
- const { readLastDevDocker } = await import("./last-dev-database-DpW5dfoX.js");
1183
+ const { readEnvFile } = await import("./project-CLcF5i8c.js").then((n) => n.u);
1184
+ const { resolveDevDatabase } = await import("./resolve-BY7bSFRT.js");
1185
+ const { resolveComposeUrl } = await import("./prepare-Ccxspoj-.js");
1186
+ const { readLastDevDocker } = await import("./last-dev-database-Dc8cP01o.js");
1187
1187
  const envFile = readEnvFile(projectRoot);
1188
1188
  const parent = resolveDevDatabase({
1189
1189
  flagDocker: switchOn(rawArgs, "--docker"),
@@ -1265,11 +1265,11 @@ var RUNNING_DEV_KEEPS_ITS_DATABASE = "A `rebase dev` that is already running kee
1265
1265
  */
1266
1266
  async function switchBranch(projectRoot, rawArgs) {
1267
1267
  assertSwitchFlags(rawArgs);
1268
- const { branchDatabaseName, clearActiveBranch, databaseNameOf, readActiveBranch, writeActiveBranch } = await import("./branch-pointer-BQUF6lYa.js");
1269
- const { readEnvFile } = await import("./project-CasK56vN.js").then((n) => n.u);
1270
- const { resolveDevDatabase } = await import("./resolve-D647F1LA.js");
1271
- const { resolveComposeUrl } = await import("./prepare-CTw9NEkh.js");
1272
- const { readLastDevDocker } = await import("./last-dev-database-DpW5dfoX.js");
1268
+ const { branchDatabaseName, clearActiveBranch, databaseNameOf, readActiveBranch, writeActiveBranch } = await import("./branch-pointer-DMPyvZoK.js");
1269
+ const { readEnvFile } = await import("./project-CLcF5i8c.js").then((n) => n.u);
1270
+ const { resolveDevDatabase } = await import("./resolve-BY7bSFRT.js");
1271
+ const { resolveComposeUrl } = await import("./prepare-Ccxspoj-.js");
1272
+ const { readLastDevDocker } = await import("./last-dev-database-Dc8cP01o.js");
1273
1273
  const goingOff = switchOn(rawArgs, "--off") || switchOn(rawArgs, "--main");
1274
1274
  const name = commandWords(rawArgs, "db")[3];
1275
1275
  const envFile = readEnvFile(projectRoot);
@@ -1370,33 +1370,34 @@ async function switchBranch(projectRoot, rawArgs) {
1370
1370
  var DATABASE_FLAGS_HELP = "--database-url <url> names the database; --docker uses the compose one, starting it if needed.";
1371
1371
  var DB_ACTION_HELP = {
1372
1372
  push: {
1373
- usage: "rebase db push [--collections <dir>] [--dry-run] [--allow-destructive] [--yes]",
1373
+ usage: "rebase db push [--schema-dir <dir>] [--dry-run] [--allow-destructive] [--yes]",
1374
1374
  summary: "Apply the schema straight to the database. Development only — it does not write a migration.",
1375
1375
  notes: [
1376
1376
  "--dry-run prints the SQL and applies nothing. Read it before you approve it.",
1377
1377
  "A change that drops data, or re-keys a table (every row gets a new id), needs --allow-destructive.",
1378
1378
  "--yes approves non-destructive pushes. It still approves destructive ones too in this release, with a deprecation warning; from the next release it will not — pass --allow-destructive for those.",
1379
- `--collections <dir>: ${COLLECTIONS_FLAG_HELP}.`,
1379
+ `--schema-dir <dir>: ${SCHEMA_DIR_FLAG_HELP}.`,
1380
1380
  DATABASE_FLAGS_HELP
1381
1381
  ]
1382
1382
  },
1383
1383
  generate: {
1384
- usage: "rebase db generate [--collections <dir>]",
1385
- summary: "Generate the Drizzle schema, the Postgres DDL and a SQL migration file from the collections.",
1384
+ usage: "rebase db generate [--schema-dir <dir>]",
1385
+ summary: "Generate the Drizzle schema, the Postgres DDL and a SQL migration file from the tables in backend/schema.",
1386
1386
  notes: [
1387
1387
  "A migration that drops or narrows data is named when it is written. It is still written.",
1388
- `--collections <dir>: ${COLLECTIONS_FLAG_HELP}.`,
1388
+ `--schema-dir <dir>: ${SCHEMA_DIR_FLAG_HELP}.`,
1389
1389
  DATABASE_FLAGS_HELP
1390
1390
  ]
1391
1391
  },
1392
1392
  migrate: {
1393
- usage: "rebase db migrate [--baseline <version>] [--refuse-destructive] [amount]",
1393
+ usage: "rebase db migrate [--schema-dir <dir>] [--baseline <version>] [--refuse-destructive] [amount]",
1394
1394
  summary: "Run the pending migration files against the database.",
1395
1395
  notes: [
1396
1396
  "--refuse-destructive dry-runs the pending files and applies nothing when one drops or narrows data.",
1397
1397
  "--baseline <version> records that version as already applied and starts from the next one.",
1398
1398
  "It is what a database Rebase has already booted against needs: boot ensures the schema, so the first migration would try to create tables that are already there.",
1399
1399
  "The version is the numeric prefix of a file in drizzle/migrations.",
1400
+ `--schema-dir <dir>: ${SCHEMA_DIR_FLAG_HELP} — read after applying, to stamp the policies the migration created.`,
1400
1401
  DATABASE_FLAGS_HELP
1401
1402
  ]
1402
1403
  },
@@ -1544,7 +1545,7 @@ ${dbExamples(devDatabaseKind())}
1544
1545
  function dbExamples(kind) {
1545
1546
  if (kind === "managed") return ` ${chalk.gray("# Quick development workflow (this project is on the managed database)")}
1546
1547
  rebase schema generate
1547
- rebase dev ${chalk.gray("# boot applies your collections to it, additively")}
1548
+ rebase dev ${chalk.gray("# boot applies your tables to it, additively")}
1548
1549
  rebase db push ${chalk.gray("# also drops, renames and narrows columns")}
1549
1550
 
1550
1551
  ${chalk.gray("# branch needs a Postgres of your own")}
@@ -1568,4 +1569,4 @@ function dbExamples(kind) {
1568
1569
  //#endregion
1569
1570
  export { DATABASE_SOURCE_ENV, DB_SUBCOMMANDS, absolutizeLocalPathArgs, databaseUrlOf, dbCommand, ensureDockerDatabase, argsFromCommand as n, resolveDriverCli, runDriverDbCommand, runDriverSchemaCommand, spawnDriverCli, reportSpawnFailure as t };
1570
1571
 
1571
- //# sourceMappingURL=db-DBbKpjYX.js.map
1572
+ //# sourceMappingURL=db-DQZK9n9c.js.map