@rebasepro/cli 0.30.0 → 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-Cj5ey3l_.js → cloud-CYMk92iG.js} +217 -104
- 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/auth.d.ts +2 -0
- package/dist/commands/cloud/context.d.ts +1 -1
- package/dist/commands/cloud/init.d.ts +2 -2
- package/dist/commands/cloud/login-flow.d.ts +30 -1
- 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-Cj5ey3l_.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,32 +1,51 @@
|
|
|
1
1
|
/** The rule, as every help page and error states it. */
|
|
2
|
-
export declare const
|
|
3
|
-
/** The `--
|
|
4
|
-
export declare const
|
|
2
|
+
export declare const PATH_RESOLUTION_RULE = "relative paths are resolved from where you run the command";
|
|
3
|
+
/** The `--schema-dir` line of a help page. */
|
|
4
|
+
export declare const SCHEMA_DIR_FLAG_HELP: string;
|
|
5
5
|
/**
|
|
6
|
-
* What a refusal over a missing `--
|
|
6
|
+
* What a refusal over a missing `--schema-dir` path spared, by what the command
|
|
7
7
|
* would have done with it. Only a schema writer drops tables; a console or a
|
|
8
8
|
* doctor run over nothing does something else wrong, and says so.
|
|
9
9
|
*/
|
|
10
|
-
declare const
|
|
10
|
+
declare const MISSING_SCHEMA_DIR_CONSEQUENCE: {
|
|
11
11
|
readonly schema: readonly ["Nothing was generated and nothing was applied — a schema generated from a", "directory that is not there is an empty one, and applying it would drop", "every table it does not describe."];
|
|
12
|
-
readonly console: readonly ["Nothing was started — a console over a directory that is not there would", "load none of this project's
|
|
13
|
-
readonly doctor: readonly ["Nothing was checked — a directory that is not there
|
|
14
|
-
readonly verify: readonly ["Nothing was verified — a directory that is not there
|
|
12
|
+
readonly console: readonly ["Nothing was started — a console over a directory that is not there would", "load none of this project's tables."];
|
|
13
|
+
readonly doctor: readonly ["Nothing was checked — a directory that is not there declares no tables, so", "every table check would pass over it."];
|
|
14
|
+
readonly verify: readonly ["Nothing was verified — a directory that is not there declares no tables, so", "every step would pass over it and report 0 errors."];
|
|
15
15
|
};
|
|
16
|
-
/** What a command does with its `--
|
|
17
|
-
export type
|
|
16
|
+
/** What a command does with its `--schema-dir` path. */
|
|
17
|
+
export type SchemaDirUse = keyof typeof MISSING_SCHEMA_DIR_CONSEQUENCE;
|
|
18
18
|
/**
|
|
19
|
-
* The refusal for a `--
|
|
19
|
+
* The refusal for a `--schema-dir` path that does not exist, or `null`.
|
|
20
20
|
*
|
|
21
21
|
* Checked by the CLI, in the reader's terms, before the driver is spawned: the
|
|
22
22
|
* driver's own check runs in `backend/` and can only describe the path it was
|
|
23
23
|
* handed. A generator pointed at a directory that is not there writes an empty
|
|
24
24
|
* schema, and a push of an empty schema drops every table — so nothing runs.
|
|
25
25
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
26
|
+
* A path written from `backend/` (`--schema-dir schema`, run from the root)
|
|
27
|
+
* lands here, and the message says exactly what to change.
|
|
28
28
|
*/
|
|
29
|
-
export declare function
|
|
30
|
-
/**
|
|
31
|
-
|
|
29
|
+
export declare function missingSchemaDir(args: readonly string[], cwd: string, backendDir: string, use?: SchemaDirUse): string[] | null;
|
|
30
|
+
/**
|
|
31
|
+
* The sentence a typed `--collections` (or, on a command that had it, `-c`)
|
|
32
|
+
* is refused with, or `null` when the line has neither.
|
|
33
|
+
*
|
|
34
|
+
* The flag named a `config/collections` directory of `defineCollection` files,
|
|
35
|
+
* which nothing reads any more. Refused rather than ignored: reading the
|
|
36
|
+
* default directory instead of the one typed would check, generate or push a
|
|
37
|
+
* different schema than the one asked about. There is no short form of the
|
|
38
|
+
* replacement — `--schema-dir` is spelled out.
|
|
39
|
+
*
|
|
40
|
+
* Only the words before a `--` separator count: after it, the line belongs to
|
|
41
|
+
* whatever the command relays it to.
|
|
42
|
+
*/
|
|
43
|
+
export declare function removedCollectionsFlag(args: readonly string[], command: string): string | null;
|
|
44
|
+
/**
|
|
45
|
+
* Throw {@link removedCollectionsFlag}'s sentence as a {@link UsageError}, or
|
|
46
|
+
* return. Called before anything starts — no database, no driver.
|
|
47
|
+
*/
|
|
48
|
+
export declare function refuseRemovedCollectionsFlag(args: readonly string[], command: string): void;
|
|
49
|
+
/** Print {@link missingSchemaDir}'s refusal and exit 1, or return. */
|
|
50
|
+
export declare function refuseMissingSchemaDir(args: readonly string[], cwd: string, backendDir: string, use?: SchemaDirUse): void;
|
|
32
51
|
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The project's `backend/schema`, imported in this process — for the commands
|
|
3
|
+
* that read the tables themselves rather than through the driver: `rebase
|
|
4
|
+
* verify`, `rebase build`, `rebase resources`, `rebase generate-sdk`.
|
|
5
|
+
*
|
|
6
|
+
* Through `loadBackendSchema` from `@rebasepro/server`, the one definition of
|
|
7
|
+
* "the tables" that boot, the runtime and the driver also read, so a command
|
|
8
|
+
* here can never accept a schema the server refuses (or the reverse): a table
|
|
9
|
+
* with no `rls`, an index that does not export a sibling's table, a project
|
|
10
|
+
* still on the collections layout — each is the loader's error, word for word.
|
|
11
|
+
* Modules are imported with the CLI's one importer
|
|
12
|
+
* (`createSchemaModuleImporter`), so a file written earlier in the same
|
|
13
|
+
* process is read as it is now.
|
|
14
|
+
*/
|
|
15
|
+
import type { CompiledSchema, LoadedSchema } from "@rebasepro/server";
|
|
16
|
+
/** The project's schema, as the loader read it and as it compiles. */
|
|
17
|
+
export interface ProjectSchema {
|
|
18
|
+
loaded: LoadedSchema;
|
|
19
|
+
compiled: CompiledSchema;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Module specifiers mapped to files, for the importer. A user's project
|
|
23
|
+
* resolves through its own `node_modules` and passes none; tests and in-repo
|
|
24
|
+
* runs point `@rebasepro/*` at the workspace's source.
|
|
25
|
+
*/
|
|
26
|
+
export type ModuleAliases = Record<string, string>;
|
|
27
|
+
/**
|
|
28
|
+
* Import and compile a project's schema directory.
|
|
29
|
+
*
|
|
30
|
+
* Throws what the loader throws: `SchemaLoadError` (a module that does not
|
|
31
|
+
* import, the legacy layout, a definition the index does not export) or
|
|
32
|
+
* `SchemaDefinitionError` from `@rebasepro/common` (every problem with every
|
|
33
|
+
* definition, one per line). A directory that does not exist, or has no
|
|
34
|
+
* index, declares no tables: `descriptors` is empty.
|
|
35
|
+
*
|
|
36
|
+
* @param projectRoot the project root — where a leftover legacy collections
|
|
37
|
+
* directory would be, and what the importer is rooted at.
|
|
38
|
+
* @param schemaDir the schema directory, absolute.
|
|
39
|
+
*/
|
|
40
|
+
export declare function loadProjectSchema(projectRoot: string, schemaDir: string, aliases?: ModuleAliases): Promise<ProjectSchema>;
|
package/dist/utils/project.d.ts
CHANGED
|
@@ -4,8 +4,14 @@ export declare const MANIFEST_FILENAME = "rebase.json";
|
|
|
4
4
|
* Walk up from `startDir` to find the Rebase project root.
|
|
5
5
|
*
|
|
6
6
|
* A directory is the root when it holds a `rebase.json`, or when it holds a
|
|
7
|
-
* `package.json` that either lists `backend` as a workspace or sits beside
|
|
8
|
-
* `backend/`
|
|
7
|
+
* `package.json` that either lists `backend` as a workspace or sits beside a
|
|
8
|
+
* `backend/` directory.
|
|
9
|
+
*
|
|
10
|
+
* There is no `config/` requirement any more: the config package is gone (its
|
|
11
|
+
* collections became `backend/schema`, the rest moved into `backend/`), and a
|
|
12
|
+
* BaaS project is a `backend/` and nothing else. The `package.json` is still
|
|
13
|
+
* required beside it, so a stray `backend/` folder deep inside some unrelated
|
|
14
|
+
* tree does not make its parent a project.
|
|
9
15
|
*
|
|
10
16
|
* `rebase.json` is checked first and needs no `package.json` beside it, because
|
|
11
17
|
* the conventions below all describe a repository that *contains the backend*.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The flag that hands the driver CLI (`@rebasepro/server-postgres`) the schema
|
|
3
|
+
* directory, as an absolute path.
|
|
4
|
+
*
|
|
5
|
+
* The receiving end is the driver's own argument spec: when the driver slice
|
|
6
|
+
* renames its flag, this constant and {@link schemaDirFlag} are the only CLI
|
|
7
|
+
* lines that change.
|
|
8
|
+
*/
|
|
9
|
+
export declare const SCHEMA_DIR_FLAG = "--schema-dir";
|
|
10
|
+
/** The tables directory, relative to the project root, as the backend app declares it. */
|
|
11
|
+
export declare function resolveTablesDir(projectRoot: string): string;
|
|
12
|
+
/** The tables directory, absolute. */
|
|
13
|
+
export declare function resolveSchemaDir(projectRoot: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* The driver argv naming `dir` as the schema directory: `["--schema-dir", dir]`.
|
|
16
|
+
*
|
|
17
|
+
* The whole CLI → driver contract for this flag, in one function. `dir` is
|
|
18
|
+
* absolute — the driver runs with `cwd: backend/`, so a relative path would be
|
|
19
|
+
* resolved from a directory the user never typed it in.
|
|
20
|
+
*/
|
|
21
|
+
export declare function schemaDirFlag(dir: string): string[];
|
|
22
|
+
/**
|
|
23
|
+
* {@link schemaDirFlag} for a driver command line, or nothing.
|
|
24
|
+
*
|
|
25
|
+
* `driverArgs` is the line as the driver gets it (`["db", "push", …]`,
|
|
26
|
+
* `["doctor", …]`). Nothing for a command that does not read the schema,
|
|
27
|
+
* nothing when the line already names a directory, and nothing when the
|
|
28
|
+
* project keeps its tables at the default — the driver's own default is
|
|
29
|
+
* `backend/schema` (`schema` from its `cwd`), so a conventional project's
|
|
30
|
+
* command lines stay as short as they were.
|
|
31
|
+
*/
|
|
32
|
+
export declare function schemaDirArgs(projectRoot: string, driverArgs: readonly string[]): string[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** A table one schema file declares. */
|
|
2
|
+
export interface DeclaredTable {
|
|
3
|
+
/** The API slug: the definition's name, or its `slug: "…"` override. */
|
|
4
|
+
slug: string;
|
|
5
|
+
/** The file it is declared in, absolute. */
|
|
6
|
+
file: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Every module under the schema directory, depth first and sorted: what the
|
|
10
|
+
* loader would import. Tests, declaration files, dotfiles and `node_modules`
|
|
11
|
+
* are not modules of the schema.
|
|
12
|
+
*/
|
|
13
|
+
export declare function schemaModules(dir: string): string[];
|
|
14
|
+
/**
|
|
15
|
+
* The slug of every table one schema file's source declares.
|
|
16
|
+
*
|
|
17
|
+
* Each `defineTable("name", …)` / `defineAuthTable` / `defineView` call is a
|
|
18
|
+
* table whose slug is its name, unless a `slug: "…"` appears before the next
|
|
19
|
+
* definition. A computed name or slug is simply not seen, which is the right
|
|
20
|
+
* failure for checks that only ever report or refuse.
|
|
21
|
+
*/
|
|
22
|
+
export declare function declaredTableSlugs(source: string): string[];
|
|
23
|
+
/** Every table the schema directory's files declare, in file order. */
|
|
24
|
+
export declare function declaredTables(schemaDir: string): DeclaredTable[];
|