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