@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.
- package/README.md +8 -7
- package/dist/{agent-setup-0uyfC7VX.js → agent-setup-DqAcoDcn.js} +10 -5
- package/dist/{agent-setup-0uyfC7VX.js.map → agent-setup-DqAcoDcn.js.map} +1 -1
- package/dist/{api-keys-Dfw5-9s1.js → api-keys-eIUjMqWn.js} +8 -7
- package/dist/api-keys-eIUjMqWn.js.map +1 -0
- package/dist/{apps-MKQbgDtN.js → apps-DExO4PEl.js} +8 -7
- package/dist/apps-DExO4PEl.js.map +1 -0
- package/dist/{project-CasK56vN.js → args-CaCcrYE1.js} +2 -351
- package/dist/args-CaCcrYE1.js.map +1 -0
- package/dist/{atlas-dev-database-BODqdCWt.js → atlas-dev-database-DOCKk6ht.js} +2 -2
- package/dist/{atlas-dev-database-BODqdCWt.js.map → atlas-dev-database-DOCKk6ht.js.map} +1 -1
- package/dist/{auth-Bv0rTbQX.js → auth-D96QYgFR.js} +7 -6
- package/dist/{auth-Bv0rTbQX.js.map → auth-D96QYgFR.js.map} +1 -1
- package/dist/backend-guard-C0mVkXBw.js +162 -0
- package/dist/backend-guard-C0mVkXBw.js.map +1 -0
- package/dist/{branch-pointer-BQUF6lYa.js → branch-pointer-DMPyvZoK.js} +1 -1
- package/dist/{build-BuKTnec8.js → build-CA5R07tw.js} +29 -9
- package/dist/build-CA5R07tw.js.map +1 -0
- package/dist/{bundle-BAH4FCju.js → bundle-DgILeA5b.js} +112 -138
- package/dist/bundle-DgILeA5b.js.map +1 -0
- package/dist/bundle.d.ts +35 -12
- package/dist/cli.d.ts +2 -2
- package/dist/{cloud-DtADfWwn.js → cloud-CYMk92iG.js} +72 -71
- package/dist/cloud-CYMk92iG.js.map +1 -0
- package/dist/cms-directories-BK3vcswg.js +33 -0
- package/dist/cms-directories-BK3vcswg.js.map +1 -0
- package/dist/codemod/collections-to-tables/ast.d.ts +135 -0
- package/dist/codemod/collections-to-tables/backend.d.ts +38 -0
- package/dist/codemod/collections-to-tables/command.d.ts +35 -0
- package/dist/codemod/collections-to-tables/comments.d.ts +45 -0
- package/dist/codemod/collections-to-tables/customization.d.ts +47 -0
- package/dist/codemod/collections-to-tables/dynamic-props.d.ts +34 -0
- package/dist/codemod/collections-to-tables/export-changes.d.ts +83 -0
- package/dist/codemod/collections-to-tables/firestore.d.ts +11 -0
- package/dist/codemod/collections-to-tables/helper-hooks.d.ts +41 -0
- package/dist/codemod/collections-to-tables/hooks.d.ts +44 -0
- package/dist/codemod/collections-to-tables/journal.d.ts +10 -0
- package/dist/codemod/collections-to-tables/legacy-shims.d.ts +52 -0
- package/dist/codemod/collections-to-tables/load-legacy.d.ts +81 -0
- package/dist/codemod/collections-to-tables/migrate.d.ts +20 -0
- package/dist/codemod/collections-to-tables/modules.d.ts +127 -0
- package/dist/codemod/collections-to-tables/moved-imports.d.ts +70 -0
- package/dist/codemod/collections-to-tables/moved-symbols.generated.d.ts +12 -0
- package/dist/codemod/collections-to-tables/own.d.ts +10 -0
- package/dist/codemod/collections-to-tables/path-aliases.d.ts +26 -0
- package/dist/codemod/collections-to-tables/plan-context.d.ts +49 -0
- package/dist/codemod/collections-to-tables/print-js.d.ts +44 -0
- package/dist/codemod/collections-to-tables/project-files.d.ts +144 -0
- package/dist/codemod/collections-to-tables/repoint.d.ts +50 -0
- package/dist/codemod/collections-to-tables/row-hands.d.ts +7 -0
- package/dist/codemod/collections-to-tables/sdk-calls.d.ts +88 -0
- package/dist/codemod/collections-to-tables/skills-step.d.ts +13 -0
- package/dist/codemod/collections-to-tables/split-constants.d.ts +42 -0
- package/dist/codemod/collections-to-tables/storage-paths.d.ts +28 -0
- package/dist/codemod/collections-to-tables/types.d.ts +164 -0
- package/dist/codemod/collections-to-tables/verify.d.ts +27 -0
- package/dist/codemod/collections-to-tables/vocabulary.d.ts +40 -0
- package/dist/command-D5lhW_-B.js +9984 -0
- package/dist/command-D5lhW_-B.js.map +1 -0
- package/dist/commands/agent-setup.d.ts +6 -2
- package/dist/commands/cloud/context.d.ts +1 -1
- package/dist/commands/cloud/init.d.ts +2 -2
- package/dist/commands/console.d.ts +1 -2
- package/dist/commands/db.d.ts +5 -6
- package/dist/commands/dev.d.ts +18 -17
- package/dist/commands/doctor.d.ts +4 -5
- package/dist/commands/eject.d.ts +17 -13
- package/dist/commands/generate-view.d.ts +20 -9
- package/dist/commands/generate_sdk.d.ts +27 -27
- package/dist/commands/init.d.ts +21 -8
- package/dist/commands/migrate.d.ts +24 -0
- package/dist/commands/schema-reconcile.d.ts +1 -1
- package/dist/commands/skills.d.ts +8 -0
- package/dist/commands/verify-cms.d.ts +28 -0
- package/dist/commands/verify.d.ts +14 -9
- package/dist/{consent-BD7F29T3.js → consent-BXLIrMl8.js} +2 -2
- package/dist/{consent-BD7F29T3.js.map → consent-BXLIrMl8.js.map} +1 -1
- package/dist/{console-CdwIYOMV.js → console-C1d3LwB7.js} +14 -14
- package/dist/console-C1d3LwB7.js.map +1 -0
- package/dist/{context-AXdAh-q8.js → context--JwaHaZp.js} +6 -5
- package/dist/context--JwaHaZp.js.map +1 -0
- package/dist/{daemon-Cp7oNXth.js → daemon-w30PsdwV.js} +2 -2
- package/dist/{daemon-Cp7oNXth.js.map → daemon-w30PsdwV.js.map} +1 -1
- package/dist/{db-DBbKpjYX.js → db-DQZK9n9c.js} +52 -51
- package/dist/db-DQZK9n9c.js.map +1 -0
- package/dist/{derive-ae9UOoOB.js → derive-C3ezmY-p.js} +105 -133
- package/dist/derive-C3ezmY-p.js.map +1 -0
- package/dist/{dev-C93d4QIv.js → dev-PY5h4O6u.js} +142 -84
- package/dist/dev-PY5h4O6u.js.map +1 -0
- package/dist/dev-db/attver.d.ts +32 -0
- package/dist/dev-db/pull.d.ts +15 -1
- package/dist/{dev-preflight-Cxv3TiD1.js → dev-preflight-DjvcV6SK.js} +5 -5
- package/dist/dev-preflight-DjvcV6SK.js.map +1 -0
- package/dist/{dev-server-OJsUGZEB.js → dev-server-BLxCbQEP.js} +2 -2
- package/dist/{dev-server-OJsUGZEB.js.map → dev-server-BLxCbQEP.js.map} +1 -1
- package/dist/{doctor-BBPQUO2g.js → doctor-CnUu8kpM.js} +39 -62
- package/dist/doctor-CnUu8kpM.js.map +1 -0
- package/dist/doctor-environment.d.ts +6 -6
- package/dist/{eject-DABcDnPN.js → eject-Bhzd6hgb.js} +25 -16
- package/dist/eject-Bhzd6hgb.js.map +1 -0
- package/dist/{fold-static-BWzxNn06.js → fold-static-CKewnAPX.js} +5 -3
- package/dist/fold-static-CKewnAPX.js.map +1 -0
- package/dist/{generate-view-IFwCADvb.js → generate-view-CTOluXvH.js} +160 -89
- package/dist/generate-view-CTOluXvH.js.map +1 -0
- package/dist/{generate_sdk-DNmNuFuW.js → generate_sdk-De-aLC1L.js} +120 -137
- package/dist/generate_sdk-De-aLC1L.js.map +1 -0
- package/dist/import-schema-module-Df67TIWj.js +51 -0
- package/dist/import-schema-module-Df67TIWj.js.map +1 -0
- package/dist/index.es.js +64 -51
- package/dist/index.es.js.map +1 -1
- package/dist/{init-vL1DWOeC.js → init-Dtl-IcXf.js} +83 -80
- package/dist/init-Dtl-IcXf.js.map +1 -0
- package/dist/last-dev-database-Dc8cP01o.js +2 -0
- package/dist/{manifest-BtzDy7KQ.js → manifest-C3uLDrrJ.js} +115 -40
- package/dist/manifest-C3uLDrrJ.js.map +1 -0
- package/dist/manifest.d.ts +79 -24
- package/dist/migrate-VrKoi3nB.js +138 -0
- package/dist/migrate-VrKoi3nB.js.map +1 -0
- package/dist/{normalize-imports-Bd5Y4yLp.js → normalize-imports-DwxqEMYq.js} +3 -3
- package/dist/{normalize-imports-Bd5Y4yLp.js.map → normalize-imports-DwxqEMYq.js.map} +1 -1
- package/dist/path-flags-7O5uPBcQ.js +139 -0
- package/dist/path-flags-7O5uPBcQ.js.map +1 -0
- package/dist/{prepare-CTw9NEkh.js → prepare-Ccxspoj-.js} +4 -4
- package/dist/{prepare-CTw9NEkh.js.map → prepare-Ccxspoj-.js.map} +1 -1
- package/dist/project-CLcF5i8c.js +360 -0
- package/dist/project-CLcF5i8c.js.map +1 -0
- package/dist/project-schema-CsSOG2gE.js +30 -0
- package/dist/project-schema-CsSOG2gE.js.map +1 -0
- package/dist/{pull-DDMpsZ5r.js → pull-DRWqBZp5.js} +327 -4
- package/dist/pull-DRWqBZp5.js.map +1 -0
- package/dist/resolve-BY7bSFRT.js +2 -0
- package/dist/resources/derive.d.ts +19 -13
- package/dist/{resources-CPSC5Kcu.js → resources-Dpfs2y8P.js} +5 -4
- package/dist/{resources-CPSC5Kcu.js.map → resources-Dpfs2y8P.js.map} +1 -1
- package/dist/{schema-DtLPsXbT.js → schema-CdDjv5zI.js} +41 -39
- package/dist/schema-CdDjv5zI.js.map +1 -0
- package/dist/schema-dir-Cd1kvYbf.js +98 -0
- package/dist/schema-dir-Cd1kvYbf.js.map +1 -0
- package/dist/schema-reconcile-BAupXfkd.js +2 -0
- package/dist/schema-text-CpNrsuMe.js +73 -0
- package/dist/schema-text-CpNrsuMe.js.map +1 -0
- package/dist/{skills-CbwV6vw_.js → skills-CXjA9TWw.js} +54 -10
- package/dist/skills-CXjA9TWw.js.map +1 -0
- package/dist/{start-YOr3X5Zm.js → start-Bwbtt2W5.js} +7 -10
- package/dist/{start-YOr3X5Zm.js.map → start-Bwbtt2W5.js.map} +1 -1
- package/dist/{status-BREvtzJm.js → status-D7XCGHu2.js} +12 -12
- package/dist/status-D7XCGHu2.js.map +1 -0
- package/dist/{storage-CO9ouK76.js → storage-iTqj5-Av.js} +12 -11
- package/dist/storage-iTqj5-Av.js.map +1 -0
- package/dist/{telemetry-DwK5RQJl.js → telemetry-BP_1Cl9r.js} +4 -4
- package/dist/{telemetry-DwK5RQJl.js.map → telemetry-BP_1Cl9r.js.map} +1 -1
- package/dist/{telemetry-CgwJPVMO.js → telemetry-M3HjlyhZ.js} +2 -2
- package/dist/{telemetry-CgwJPVMO.js.map → telemetry-M3HjlyhZ.js.map} +1 -1
- package/dist/{upgrade-B7sVwL8S.js → upgrade-oZzJ13jM.js} +5 -4
- package/dist/{upgrade-B7sVwL8S.js.map → upgrade-oZzJ13jM.js.map} +1 -1
- package/dist/utils/backend-guard.d.ts +47 -0
- package/dist/utils/cms-directories.d.ts +6 -0
- package/dist/utils/dev-preflight.d.ts +2 -2
- package/dist/utils/import-schema-module.d.ts +16 -0
- package/dist/utils/path-flags.d.ts +35 -16
- package/dist/utils/project-schema.d.ts +40 -0
- package/dist/utils/project.d.ts +8 -2
- package/dist/utils/schema-dir.d.ts +32 -0
- package/dist/utils/schema-drift.d.ts +6 -0
- package/dist/utils/schema-text.d.ts +24 -0
- package/dist/verify-5p_vaUG2.js +1160 -0
- package/dist/verify-5p_vaUG2.js.map +1 -0
- package/package.json +11 -8
- package/runtime/dev-server.mjs +5 -1
- package/templates/eject/Dockerfile +1 -4
- package/templates/eject/backend/src/env.ts +1 -1
- package/templates/eject/backend/src/index.ts +53 -40
- package/templates/eject/docker-compose.custom.yml +1 -1
- package/templates/overlays/baas/README.md +39 -12
- package/templates/overlays/baas/ai-instructions.md +8 -8
- package/templates/overlays/baas/{config → backend}/storage.ts +3 -4
- package/templates/overlays/baas/backend/tsconfig.json +10 -12
- package/templates/overlays/baas/package.json +1 -2
- package/templates/overlays/baas/pnpm-workspace.yaml +0 -1
- package/templates/presets/blank/backend/schema/index.ts +19 -0
- package/templates/presets/blank/frontend/src/App.tsx +56 -0
- package/templates/presets/ecommerce/backend/schema/categories.ts +12 -0
- package/templates/presets/ecommerce/backend/schema/index.ts +23 -0
- package/templates/presets/ecommerce/backend/schema/orders.ts +13 -0
- package/templates/presets/ecommerce/backend/schema/products.ts +18 -0
- package/templates/presets/ecommerce/frontend/src/App.tsx +59 -0
- package/templates/presets/ecommerce/frontend/src/cms/categories.tsx +12 -0
- package/templates/presets/ecommerce/frontend/src/cms/orders.tsx +38 -0
- package/templates/presets/ecommerce/frontend/src/cms/products.tsx +27 -0
- package/templates/resource-graphs/blank.json +2 -2
- package/templates/resource-graphs/blog.json +5 -5
- package/templates/resource-graphs/ecommerce.json +5 -5
- package/templates/resource-graphs/headless.json +1 -1
- package/templates/template/.claude/hooks/post-edit-collection.sh +27 -23
- package/templates/template/.cursorrules +2 -2
- package/templates/template/.env.example +6 -17
- package/templates/template/.github/copilot-instructions.md +2 -2
- package/templates/template/.windsurfrules +2 -2
- package/templates/template/AGENTS.md +2 -2
- package/templates/template/CLAUDE.md +2 -2
- package/templates/template/README.md +47 -13
- package/templates/template/ai-instructions.md +15 -14
- package/templates/template/backend/functions/hello.ts +1 -1
- package/templates/template/backend/package.json +0 -2
- package/templates/template/{config → backend}/resources.ts +3 -3
- package/templates/template/backend/schema/authors.ts +11 -0
- package/templates/template/backend/schema/index.ts +29 -0
- package/templates/template/backend/schema/posts.ts +29 -0
- package/templates/template/backend/schema/tags.ts +9 -0
- package/templates/template/backend/schema/users.ts +32 -0
- package/templates/template/{config → backend}/storage.ts +4 -4
- package/templates/template/backend/tsconfig.json +15 -20
- package/templates/template/docker-compose.yml +3 -3
- package/templates/template/frontend/package.json +0 -2
- package/templates/template/frontend/src/App.tsx +10 -4
- package/templates/template/frontend/src/cms/authors.tsx +7 -0
- package/templates/template/frontend/src/cms/posts.tsx +27 -0
- package/templates/template/frontend/src/cms/tags.tsx +11 -0
- package/templates/template/frontend/src/cms/ui-config.json +3 -0
- package/templates/template/frontend/src/cms/users.tsx +54 -0
- package/templates/template/frontend/src/{virtual.d.ts → vite-env.d.ts} +0 -4
- package/templates/template/frontend/vite.config.ts +6 -2
- package/templates/template/gitignore +1 -1
- package/templates/template/package.json +1 -2
- package/templates/template/pnpm-workspace.yaml +0 -1
- package/templates/template/scripts/example.ts +3 -3
- package/templates/template/tsconfig.json +1 -1
- package/templates/views/AppView.tsx.tmpl +4 -4
- package/templates/views/EntityView.tsx.tmpl +3 -4
- package/dist/api-keys-Dfw5-9s1.js.map +0 -1
- package/dist/apps-MKQbgDtN.js.map +0 -1
- package/dist/build-BuKTnec8.js.map +0 -1
- package/dist/bundle-BAH4FCju.js.map +0 -1
- package/dist/cloud-DtADfWwn.js.map +0 -1
- package/dist/collection-drift-BKj_BoMq.js +0 -106
- package/dist/collection-drift-BKj_BoMq.js.map +0 -1
- package/dist/collections-dir-DlvDhime.js +0 -69
- package/dist/collections-dir-DlvDhime.js.map +0 -1
- package/dist/console-CdwIYOMV.js.map +0 -1
- package/dist/context-AXdAh-q8.js.map +0 -1
- package/dist/db-DBbKpjYX.js.map +0 -1
- package/dist/derive-ae9UOoOB.js.map +0 -1
- package/dist/dev-C93d4QIv.js.map +0 -1
- package/dist/dev-preflight-Cxv3TiD1.js.map +0 -1
- package/dist/doctor-BBPQUO2g.js.map +0 -1
- package/dist/eject-DABcDnPN.js.map +0 -1
- package/dist/fold-static-BWzxNn06.js.map +0 -1
- package/dist/generate-view-IFwCADvb.js.map +0 -1
- package/dist/generate_sdk-DNmNuFuW.js.map +0 -1
- package/dist/init-vL1DWOeC.js.map +0 -1
- package/dist/last-dev-database-DpW5dfoX.js +0 -2
- package/dist/manifest-BtzDy7KQ.js.map +0 -1
- package/dist/path-flags-DNvtEi2-.js +0 -92
- package/dist/path-flags-DNvtEi2-.js.map +0 -1
- package/dist/project-CasK56vN.js.map +0 -1
- package/dist/pull-DDMpsZ5r.js.map +0 -1
- package/dist/resolve-D647F1LA.js +0 -2
- package/dist/schema-DtLPsXbT.js.map +0 -1
- package/dist/schema-reconcile-DkArN9jF.js +0 -2
- package/dist/skills-CbwV6vw_.js.map +0 -1
- package/dist/status-BREvtzJm.js.map +0 -1
- package/dist/storage-CO9ouK76.js.map +0 -1
- package/dist/utils/collection-drift.d.ts +0 -27
- package/dist/utils/collections-dir.d.ts +0 -14
- package/dist/verify-Y3rWSgfA.js +0 -730
- package/dist/verify-Y3rWSgfA.js.map +0 -1
- package/templates/overlays/baas/config/index.ts +0 -24
- package/templates/overlays/baas/config/package.json +0 -30
- package/templates/template/config/cms.d.ts +0 -15
- package/templates/template/config/collections/authors.ts +0 -47
- package/templates/template/config/collections/index.ts +0 -44
- package/templates/template/config/collections/posts.ts +0 -94
- package/templates/template/config/collections/presets/blank/index.ts +0 -5
- package/templates/template/config/collections/presets/ecommerce/categories.ts +0 -42
- package/templates/template/config/collections/presets/ecommerce/index.ts +0 -31
- package/templates/template/config/collections/presets/ecommerce/orders.ts +0 -78
- package/templates/template/config/collections/presets/ecommerce/products.ts +0 -73
- package/templates/template/config/collections/tags.ts +0 -27
- package/templates/template/config/collections/users.ts +0 -149
- package/templates/template/config/frontend-assets.d.ts +0 -17
- package/templates/template/config/index.ts +0 -12
- package/templates/template/config/package.json +0 -30
- package/templates/template/config/tsconfig.json +0 -35
- /package/templates/eject/{config → backend}/resources.ts +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { i as recordEvent } from "./telemetry-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
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 `--
|
|
156
|
-
*
|
|
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
|
-
"--
|
|
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-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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, ...
|
|
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-
|
|
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-
|
|
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, ...
|
|
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
|
-
|
|
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-
|
|
771
|
-
const { readEnvFile } = await import("./project-
|
|
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-
|
|
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-
|
|
848
|
-
const { prepareDatabaseEnv } = await import("./prepare-
|
|
849
|
-
const { readEnvFile } = await import("./project-
|
|
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-
|
|
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-
|
|
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-
|
|
1069
|
-
const { resolveProjectDatabase } = await import("./prepare-
|
|
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
|
-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
1184
|
-
const { resolveDevDatabase } = await import("./resolve-
|
|
1185
|
-
const { resolveComposeUrl } = await import("./prepare-
|
|
1186
|
-
const { readLastDevDocker } = await import("./last-dev-database-
|
|
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-
|
|
1269
|
-
const { readEnvFile } = await import("./project-
|
|
1270
|
-
const { resolveDevDatabase } = await import("./resolve-
|
|
1271
|
-
const { resolveComposeUrl } = await import("./prepare-
|
|
1272
|
-
const { readLastDevDocker } = await import("./last-dev-database-
|
|
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 [--
|
|
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
|
-
`--
|
|
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 [--
|
|
1385
|
-
summary: "Generate the Drizzle schema, the Postgres DDL and a SQL migration file from the
|
|
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
|
-
`--
|
|
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
|
|
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-
|
|
1572
|
+
//# sourceMappingURL=db-DQZK9n9c.js.map
|