@rebasepro/cli 0.30.1 → 0.31.0-canary.g902a0ce
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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-CyADghFQ.js} +7 -6
- package/dist/{auth-Bv0rTbQX.js.map → auth-CyADghFQ.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-CMjhgMUE.js} +14 -14
- package/dist/console-CMjhgMUE.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-A7XDCIIO.js} +51 -51
- package/dist/db-A7XDCIIO.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-db/attver.d.ts +11 -0
- 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/{dev-C93d4QIv.js → dev-tWwPyWkQ.js} +142 -84
- package/dist/dev-tWwPyWkQ.js.map +1 -0
- package/dist/{doctor-BBPQUO2g.js → doctor-BBM0dWvZ.js} +39 -62
- package/dist/doctor-BBM0dWvZ.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-D9WvpDYY.js} +189 -1
- package/dist/pull-D9WvpDYY.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-DwFDI1iU.js} +41 -39
- package/dist/schema-DwFDI1iU.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-Tto54Qbv.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-DQ_PPz4C.js} +12 -12
- package/dist/status-DQ_PPz4C.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-DkJqhYPI.js +1160 -0
- package/dist/verify-DkJqhYPI.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,14 +1,14 @@
|
|
|
1
|
-
import { i as recordEvent, l as durationBucket } from "./telemetry-
|
|
1
|
+
import { i as recordEvent, l as durationBucket } from "./telemetry-M3HjlyhZ.js";
|
|
2
2
|
import { n as getPMCommands, t as detectPackageManager } from "./package-manager-DSEOwTqM.js";
|
|
3
|
-
import {
|
|
3
|
+
import { a as wantsHelp, n as parseCommandArgs } from "./args-CaCcrYE1.js";
|
|
4
4
|
import { n as cliVersion } from "./version-Buyyo1ut.js";
|
|
5
|
-
import {
|
|
6
|
-
import { configureAgents, printAgentSetup, promptForAgents, retargetScaffoldMcpConfig } from "./agent-setup-
|
|
7
|
-
import { $ as resolveCloudUrl, ct as writeLink } from "./context
|
|
5
|
+
import { c as reportRootPointers, d as writeRootPointers, l as resolveAgentNames, n as AGENT_KEYS, t as AGENTS } from "./skills-CXjA9TWw.js";
|
|
6
|
+
import { configureAgents, printAgentSetup, promptForAgents, retargetScaffoldMcpConfig } from "./agent-setup-DqAcoDcn.js";
|
|
7
|
+
import { $ as resolveCloudUrl, ct as writeLink } from "./context--JwaHaZp.js";
|
|
8
8
|
import { t as Refusal } from "./refusal-ReeeGP8a.js";
|
|
9
|
-
import { r as dockerClaimedPorts } from "./dev-preflight-
|
|
9
|
+
import { r as dockerClaimedPorts } from "./dev-preflight-DjvcV6SK.js";
|
|
10
10
|
import { t as invokedRebaseCommand } from "./invoked-command-CG_rIa_o.js";
|
|
11
|
-
import { n as promptForConsent } from "./consent-
|
|
11
|
+
import { n as promptForConsent } from "./consent-BXLIrMl8.js";
|
|
12
12
|
import chalk from "chalk";
|
|
13
13
|
import fs from "fs";
|
|
14
14
|
import path from "path";
|
|
@@ -53,7 +53,6 @@ var TEMPLATE_PLACEHOLDER_FILES = [
|
|
|
53
53
|
"package.json",
|
|
54
54
|
"frontend/package.json",
|
|
55
55
|
"backend/package.json",
|
|
56
|
-
"config/package.json",
|
|
57
56
|
"frontend/index.html",
|
|
58
57
|
"pnpm-workspace.yaml",
|
|
59
58
|
"docker-compose.yml",
|
|
@@ -71,15 +70,16 @@ function validateProjectName(name) {
|
|
|
71
70
|
* A boolean, not a named pair. It was `--flavor cms|baas`, and neither word
|
|
72
71
|
* survived what they described: "cms" is a product category rather than a thing
|
|
73
72
|
* this tool builds, and "baas" was the same value that used to appear as
|
|
74
|
-
* `backend.mode` — which is now derived from whether
|
|
75
|
-
* What is left is one question: does this project get an
|
|
73
|
+
* `backend.mode` — which is now derived from whether tables are declared in
|
|
74
|
+
* `backend/schema/`. What is left is one question: does this project get an
|
|
75
|
+
* admin UI?
|
|
76
76
|
*/
|
|
77
77
|
var HEADLESS_CHOICES = [{
|
|
78
|
-
name: "Backend + admin — API plus an admin UI,
|
|
78
|
+
name: "Backend + admin — API plus an admin UI, over tables you define in backend/schema (like Payload/Directus)",
|
|
79
79
|
value: false,
|
|
80
80
|
short: "Backend + admin"
|
|
81
81
|
}, {
|
|
82
|
-
name: "Backend only — headless API over your database. No
|
|
82
|
+
name: "Backend only — headless API over your database. No schema files, no UI (like Supabase)",
|
|
83
83
|
value: true,
|
|
84
84
|
short: "Backend only"
|
|
85
85
|
}];
|
|
@@ -177,7 +177,7 @@ function buildInitQuestions(params) {
|
|
|
177
177
|
questions.push({
|
|
178
178
|
type: "confirm",
|
|
179
179
|
name: "introspect",
|
|
180
|
-
message: "Would you like to introspect this database to
|
|
180
|
+
message: "Would you like to introspect this database to generate backend/schema from its tables?",
|
|
181
181
|
default: true,
|
|
182
182
|
when: (answers) => !!answers.databaseUrl?.trim()
|
|
183
183
|
});
|
|
@@ -206,7 +206,7 @@ ${chalk.bold("Usage")}
|
|
|
206
206
|
|
|
207
207
|
${chalk.bold("Options")}
|
|
208
208
|
${chalk.blue("-t, --template")} ${chalk.gray("<preset>")} blog | ecommerce | blank ${chalk.gray("(default: blog)")}
|
|
209
|
-
${chalk.blue("--headless")} Backend only — no admin panel, no
|
|
209
|
+
${chalk.blue("--headless")} Backend only — no admin panel, no backend/schema
|
|
210
210
|
${chalk.blue("-y, --yes")} Never prompt ${chalk.gray("(required for CI / non-TTY)")}: take every default,
|
|
211
211
|
${chalk.gray("except that git init and the install are skipped unless")}
|
|
212
212
|
${chalk.gray("--git / --install is passed")}
|
|
@@ -216,7 +216,7 @@ ${chalk.bold("Options")}
|
|
|
216
216
|
${chalk.blue("-g, --git")} Initialize a git repository and make an initial commit.
|
|
217
217
|
${chalk.gray("Without it, init asks (default yes); under --yes, no repository")}
|
|
218
218
|
${chalk.blue("--database-url")} ${chalk.gray("<url>")} Use an existing database instead of the generated one
|
|
219
|
-
${chalk.blue("--introspect")} Generate
|
|
219
|
+
${chalk.blue("--introspect")} Generate backend/schema from that database ${chalk.gray("(implies --template blank; needs --install)")}
|
|
220
220
|
${chalk.blue("--project")} ${chalk.gray("<slug>")} Link the scaffold to a Rebase Cloud project
|
|
221
221
|
${chalk.blue("--setup-key")} ${chalk.gray("<key>")} One-time key authenticating the cloud link ${chalk.gray("(use with --project)")}
|
|
222
222
|
${chalk.blue("-a, --agent")} ${chalk.gray("<name>")} Set up an AI coding agent: Rebase skills + the MCP server.
|
|
@@ -225,9 +225,9 @@ ${chalk.bold("Options")}
|
|
|
225
225
|
${chalk.gray("machine; under --yes, none unless named.")}
|
|
226
226
|
|
|
227
227
|
${chalk.bold("What gets scaffolded")}
|
|
228
|
-
${chalk.gray("default")}
|
|
229
|
-
${chalk.blue("--headless")}
|
|
230
|
-
${chalk.gray("--template has no effect: there are no
|
|
228
|
+
${chalk.gray("default")} backend/ (tables in backend/schema) + frontend/ (the admin UI) ${chalk.gray("(like Payload/Directus)")}
|
|
229
|
+
${chalk.blue("--headless")} backend/ only, over your existing database ${chalk.gray("(like Supabase)")}
|
|
230
|
+
${chalk.gray("--template has no effect: there are no tables to seed.")}
|
|
231
231
|
|
|
232
232
|
${chalk.bold("Examples")}
|
|
233
233
|
${chalk.gray("$")} rebase init my-shop --template ecommerce --install
|
|
@@ -506,7 +506,7 @@ async function linkScaffoldToCloud(options) {
|
|
|
506
506
|
* new scaffold whose first `git status` is dirty invites the reader to conclude
|
|
507
507
|
* the lockfile is deliberately ignored and never commit it at all.
|
|
508
508
|
*
|
|
509
|
-
* Introspection has the same shape: it generates `
|
|
509
|
+
* Introspection has the same shape: it generates `backend/schema` and
|
|
510
510
|
* `schema.generated.ts`, which belong in the commit describing the scaffold that
|
|
511
511
|
* produced them.
|
|
512
512
|
*
|
|
@@ -560,7 +560,7 @@ function initNextSteps(input) {
|
|
|
560
560
|
if (!installed) lines.push(cmd(pm.install));
|
|
561
561
|
lines.push("");
|
|
562
562
|
if (introspected) {
|
|
563
|
-
lines.push(note("Database
|
|
563
|
+
lines.push(note("Database introspected: its tables are in backend/schema."));
|
|
564
564
|
lines.push(note(headless ? "Start the API over it:" : "Start the development server (frontend + backend):"));
|
|
565
565
|
lines.push(runDev);
|
|
566
566
|
} else if (introspect) {
|
|
@@ -606,7 +606,7 @@ function initNextSteps(input) {
|
|
|
606
606
|
lines.push(note("In production (docker compose) that window is shut and the account named by"));
|
|
607
607
|
lines.push(note("REBASE_ADMIN_EMAIL in .env is created at boot instead."));
|
|
608
608
|
lines.push("");
|
|
609
|
-
lines.push(headless ? introspected ? chalk.gray("This starts a headless API (Hono + PostgreSQL) over the
|
|
609
|
+
lines.push(headless ? introspected ? chalk.gray("This starts a headless API (Hono + PostgreSQL) over the tables just ") + chalk.gray("generated from your database in backend/schema. Edit them to change what the ") + chalk.gray("API exposes; its OpenAPI document is /api/docs for signed-in callers (Swagger UI: set REBASE_ENABLE_SWAGGER=true).") : chalk.gray("This starts a headless API (Hono + PostgreSQL). There is no backend/schema: ") + chalk.gray("the API is derived from your database schema. Once it serves a table, its OpenAPI document is /api/docs for signed-in callers (Swagger UI: set REBASE_ENABLE_SWAGGER=true).") : chalk.gray("This starts both the backend (Hono + PostgreSQL)") + chalk.gray(" and the frontend (Vite + React) concurrently."));
|
|
610
610
|
return lines;
|
|
611
611
|
}
|
|
612
612
|
/**
|
|
@@ -760,10 +760,10 @@ async function createProject(options) {
|
|
|
760
760
|
const shipped = path.join(options.targetDirectory, from);
|
|
761
761
|
if (fs.existsSync(shipped)) fs.renameSync(shipped, path.join(options.targetDirectory, to));
|
|
762
762
|
}
|
|
763
|
-
if (options.headless && options.explicitPreset) console.log(chalk.yellow(` Ignoring --template ${options.preset}: a headless project declares no
|
|
763
|
+
if (options.headless && options.explicitPreset) console.log(chalk.yellow(` Ignoring --template ${options.preset}: a headless project declares no tables (no backend/schema).`));
|
|
764
764
|
let applied = null;
|
|
765
765
|
if (!options.headless) {
|
|
766
|
-
if (options.introspect && options.preset !== "blank") console.log(chalk.gray(" Using the blank template:
|
|
766
|
+
if (options.introspect && options.preset !== "blank") console.log(chalk.gray(" Using the blank template: backend/schema will come from your database."));
|
|
767
767
|
applied = await applyPreset(options.targetDirectory, options.introspect ? "blank" : options.preset);
|
|
768
768
|
writeShippedSchema(options.targetDirectory, applied);
|
|
769
769
|
}
|
|
@@ -806,7 +806,7 @@ async function createProject(options) {
|
|
|
806
806
|
if (options.introspect) {
|
|
807
807
|
console.log("");
|
|
808
808
|
if (options.installDeps) {
|
|
809
|
-
console.log(chalk.gray(" Introspecting database
|
|
809
|
+
console.log(chalk.gray(" Introspecting the database into backend/schema..."));
|
|
810
810
|
console.log("");
|
|
811
811
|
try {
|
|
812
812
|
await execa(execCmd[0], execCmd.slice(1), {
|
|
@@ -867,27 +867,22 @@ async function createProject(options) {
|
|
|
867
867
|
if (await promptForConsent({ reAskDeclined: true })) await recordEvent("cli.init", initProperties, { projectRoot: options.targetDirectory });
|
|
868
868
|
}
|
|
869
869
|
/**
|
|
870
|
-
* Apply a template preset by replacing the default collection files.
|
|
871
|
-
*
|
|
872
|
-
* The template ships with blog collections at the top level and
|
|
873
|
-
* preset alternatives under `config/collections/presets/<name>/`.
|
|
874
|
-
* This function swaps the active collection files and removes the
|
|
875
|
-
* presets directory so the final project is clean.
|
|
876
|
-
*/
|
|
877
|
-
/**
|
|
878
870
|
* Reduce the scaffolded project to the chosen shape.
|
|
879
871
|
*
|
|
880
|
-
* The base template is
|
|
881
|
-
*
|
|
882
|
-
* its API from the database — and overlays
|
|
872
|
+
* The base template is Mode B: `backend/` and `frontend/`. `--headless` is
|
|
873
|
+
* Mode A: it drops `frontend/` and `backend/schema/` — there is nothing to
|
|
874
|
+
* declare, since the server derives its API from the database — and overlays
|
|
875
|
+
* the files that differ (`templates/overlays/baas/`).
|
|
883
876
|
*
|
|
884
|
-
*
|
|
885
|
-
* under row-level security, so a deployment with file storage
|
|
886
|
-
* access model serves every user's files to every signed-in
|
|
887
|
-
* refuses to boot in that state
|
|
888
|
-
*
|
|
889
|
-
*
|
|
890
|
-
*
|
|
877
|
+
* `backend/storage.ts` stays, replaced by the overlay's stricter default.
|
|
878
|
+
* Storage is not under row-level security, so a deployment with file storage
|
|
879
|
+
* enabled and no access model serves every user's files to every signed-in
|
|
880
|
+
* user; the server refuses to boot in that state, and the scaffold's own
|
|
881
|
+
* docker-compose.yml enables storage — without the hook the first
|
|
882
|
+
* `docker compose up` would crash-loop.
|
|
883
|
+
*
|
|
884
|
+
* Declaring tables later is one step: create `backend/schema/index.ts`. The
|
|
885
|
+
* overlay's README says so.
|
|
891
886
|
*/
|
|
892
887
|
async function applyHeadless(targetDirectory, headless) {
|
|
893
888
|
if (!headless) return;
|
|
@@ -895,15 +890,14 @@ async function applyHeadless(targetDirectory, headless) {
|
|
|
895
890
|
recursive: true,
|
|
896
891
|
force: true
|
|
897
892
|
});
|
|
898
|
-
fs.rmSync(path.join(targetDirectory, "
|
|
893
|
+
fs.rmSync(path.join(targetDirectory, "backend", "schema"), {
|
|
899
894
|
recursive: true,
|
|
900
895
|
force: true
|
|
901
896
|
});
|
|
902
|
-
for (const stray of ["cms.d.ts", "frontend-assets.d.ts"]) fs.rmSync(path.join(targetDirectory, "config", stray), { force: true });
|
|
903
897
|
fs.rmSync(path.join(targetDirectory, "backend", "src", "schema.generated.ts"), { force: true });
|
|
904
898
|
const overlayDir = path.resolve(cliRoot, "templates", "overlays", "baas");
|
|
905
899
|
if (!fs.existsSync(overlayDir)) {
|
|
906
|
-
console.error(`${chalk.red.bold("ERROR")}
|
|
900
|
+
console.error(`${chalk.red.bold("ERROR")} Headless template overlay not found at ${overlayDir}`);
|
|
907
901
|
process.exit(1);
|
|
908
902
|
}
|
|
909
903
|
await cp(overlayDir, targetDirectory, {
|
|
@@ -940,30 +934,45 @@ async function writeProjectPackageManagerIntoManifest(targetDirectory, pmCommand
|
|
|
940
934
|
if (changed) fs.writeFileSync(manifestPath, `${JSON.stringify(manifest, null, 4)}\n`, "utf8");
|
|
941
935
|
} catch {}
|
|
942
936
|
}
|
|
943
|
-
/**
|
|
937
|
+
/**
|
|
938
|
+
* The blog preset's own files: the template ships the blog preset, and these
|
|
939
|
+
* are what another preset takes out before laying its own files over it.
|
|
940
|
+
* `users` — the table and its customization — is shared by every preset, and
|
|
941
|
+
* `backend/schema/index.ts` and `frontend/src/App.tsx` are replaced by the
|
|
942
|
+
* preset's copies.
|
|
943
|
+
*
|
|
944
|
+
* Exported for `check:templates` and the init tests, which materialise each
|
|
945
|
+
* preset exactly as this does.
|
|
946
|
+
*/
|
|
947
|
+
var BLOG_PRESET_FILES = [
|
|
948
|
+
"backend/schema/posts.ts",
|
|
949
|
+
"backend/schema/authors.ts",
|
|
950
|
+
"backend/schema/tags.ts",
|
|
951
|
+
"frontend/src/cms/posts.tsx",
|
|
952
|
+
"frontend/src/cms/authors.tsx",
|
|
953
|
+
"frontend/src/cms/tags.tsx"
|
|
954
|
+
];
|
|
955
|
+
/** Where a non-blog preset's files ship: `templates/presets/<preset>/`, laid out as in a project. */
|
|
956
|
+
function presetOverlayPath(preset) {
|
|
957
|
+
return path.resolve(cliRoot, "templates", "presets", preset);
|
|
958
|
+
}
|
|
959
|
+
/**
|
|
960
|
+
* Lay the preset's tables and customizations over the blog preset the template
|
|
961
|
+
* ships. Returns the preset actually applied.
|
|
962
|
+
*/
|
|
944
963
|
async function applyPreset(targetDirectory, preset) {
|
|
945
|
-
|
|
946
|
-
const
|
|
947
|
-
if (
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
console.warn(chalk.yellow(` Warning: Preset "${preset}" not found, falling back to blog template.`));
|
|
951
|
-
cleanupPresets(presetsDir);
|
|
952
|
-
return "blog";
|
|
953
|
-
}
|
|
954
|
-
for (const file of [
|
|
955
|
-
"posts.ts",
|
|
956
|
-
"authors.ts",
|
|
957
|
-
"tags.ts",
|
|
958
|
-
"index.ts"
|
|
959
|
-
]) {
|
|
960
|
-
const filePath = path.join(collectionsDir, file);
|
|
961
|
-
if (fs.existsSync(filePath)) fs.unlinkSync(filePath);
|
|
962
|
-
}
|
|
963
|
-
const presetFiles = fs.readdirSync(presetDir).filter((f) => f.endsWith(".ts"));
|
|
964
|
-
for (const file of presetFiles) fs.copyFileSync(path.join(presetDir, file), path.join(collectionsDir, file));
|
|
964
|
+
if (preset === "blog") return preset;
|
|
965
|
+
const presetDir = presetOverlayPath(preset);
|
|
966
|
+
if (!fs.existsSync(presetDir)) {
|
|
967
|
+
console.warn(chalk.yellow(` Warning: Preset "${preset}" not found, falling back to the blog template.`));
|
|
968
|
+
return "blog";
|
|
965
969
|
}
|
|
966
|
-
|
|
970
|
+
for (const file of BLOG_PRESET_FILES) fs.rmSync(path.join(targetDirectory, file), { force: true });
|
|
971
|
+
await cp(presetDir, targetDirectory, {
|
|
972
|
+
recursive: true,
|
|
973
|
+
force: true,
|
|
974
|
+
filter: (source) => path.basename(source) !== ".DS_Store"
|
|
975
|
+
});
|
|
967
976
|
return preset;
|
|
968
977
|
}
|
|
969
978
|
/**
|
|
@@ -978,12 +987,12 @@ async function applyPreset(targetDirectory, preset) {
|
|
|
978
987
|
* edit was refused with `SCHEMA_EDIT_DIRTY_TREE` before its owner had changed
|
|
979
988
|
* a thing.
|
|
980
989
|
*
|
|
981
|
-
* The file cannot be generated here: generation loads
|
|
982
|
-
*
|
|
990
|
+
* The file cannot be generated here: generation loads `backend/schema`, and
|
|
991
|
+
* its files import `@rebasepro/server/schema`, which the project does not have
|
|
983
992
|
* until it is installed — `init --git` without `--install` commits first. So
|
|
984
993
|
* each preset's output is generated in this repository and shipped, and
|
|
985
994
|
* `init-generated-schema.test.ts` fails the moment one of them differs from
|
|
986
|
-
* what the generator writes for that preset's
|
|
995
|
+
* what the generator writes for that preset's tables.
|
|
987
996
|
*
|
|
988
997
|
* Outside `templates/template` on purpose: a preset's schema must not be
|
|
989
998
|
* copied into a project that chose another preset.
|
|
@@ -1001,15 +1010,15 @@ function writeShippedSchema(targetDirectory, preset) {
|
|
|
1001
1010
|
* Where each scaffold shape's `rebase.resources.json` ships, beside the template.
|
|
1002
1011
|
*
|
|
1003
1012
|
* `rebase resources --check` is the CI gate for that file, and a fresh
|
|
1004
|
-
* scaffold failed it before anything had changed: `
|
|
1013
|
+
* scaffold failed it before anything had changed: `backend/resources.ts`
|
|
1005
1014
|
* declares `main = database()`, `backend/functions/hello.ts` is a function,
|
|
1006
1015
|
* and nothing had written the graph — `rebase build` does, on its first run.
|
|
1007
1016
|
* So `init` writes it, and a fresh project starts consistent with its own
|
|
1008
1017
|
* gate, with the file in its first commit.
|
|
1009
1018
|
*
|
|
1010
1019
|
* It cannot be derived here for the reason the schema cannot (see
|
|
1011
|
-
* `shippedSchemaPath`): deriving evaluates
|
|
1012
|
-
* `@rebasepro/
|
|
1020
|
+
* `shippedSchemaPath`): deriving evaluates `backend/schema`, which imports
|
|
1021
|
+
* `@rebasepro/server/schema`, and the project has none until it is installed. So
|
|
1013
1022
|
* each shape's graph is derived in this repository and shipped, and
|
|
1014
1023
|
* `init-resource-graph.test.ts` fails the moment one differs from what
|
|
1015
1024
|
* `rebase resources --write` writes for that shape.
|
|
@@ -1021,12 +1030,6 @@ function shippedResourceGraphPath(shape) {
|
|
|
1021
1030
|
function writeShippedResourceGraph(targetDirectory, shape) {
|
|
1022
1031
|
fs.copyFileSync(shippedResourceGraphPath(shape), path.join(targetDirectory, "rebase.resources.json"));
|
|
1023
1032
|
}
|
|
1024
|
-
function cleanupPresets(presetsDir) {
|
|
1025
|
-
if (fs.existsSync(presetsDir)) fs.rmSync(presetsDir, {
|
|
1026
|
-
recursive: true,
|
|
1027
|
-
force: true
|
|
1028
|
-
});
|
|
1029
|
-
}
|
|
1030
1033
|
/** The package the probe asks about. Not the CLI: the CLI is what is running. */
|
|
1031
1034
|
var RELEASE_PROBE_PACKAGE = "@rebasepro/server";
|
|
1032
1035
|
async function probeRelease(version) {
|
|
@@ -1331,4 +1334,4 @@ async function configureEnvFile(targetDirectory, databaseUrl) {
|
|
|
1331
1334
|
//#endregion
|
|
1332
1335
|
export { createRebaseApp };
|
|
1333
1336
|
|
|
1334
|
-
//# sourceMappingURL=init-
|
|
1337
|
+
//# sourceMappingURL=init-Dtl-IcXf.js.map
|