@rebasepro/cli 0.29.0-canary.g0e3a0e7 → 0.29.1
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/dist/{auth-DifFaOyq.js → auth-Bv0rTbQX.js} +3 -3
- package/dist/{auth-DifFaOyq.js.map → auth-Bv0rTbQX.js.map} +1 -1
- package/dist/commands/doctor.d.ts +1 -0
- package/dist/{console-BXB6-8GT.js → console-CdwIYOMV.js} +2 -2
- package/dist/{console-BXB6-8GT.js.map → console-CdwIYOMV.js.map} +1 -1
- package/dist/{db-KzlqddGD.js → db-DBbKpjYX.js} +35 -6
- package/dist/{db-KzlqddGD.js.map → db-DBbKpjYX.js.map} +1 -1
- package/dist/{dev-CzOazEHW.js → dev-C93d4QIv.js} +2 -2
- package/dist/{dev-CzOazEHW.js.map → dev-C93d4QIv.js.map} +1 -1
- package/dist/{doctor-BuqSHNrd.js → doctor-BBPQUO2g.js} +12 -4
- package/dist/{doctor-BuqSHNrd.js.map → doctor-BBPQUO2g.js.map} +1 -1
- package/dist/index.es.js +10 -10
- package/dist/{schema-CApM25cs.js → schema-DtLPsXbT.js} +3 -3
- package/dist/{schema-CApM25cs.js.map → schema-DtLPsXbT.js.map} +1 -1
- package/dist/schema-reconcile-DkArN9jF.js +2 -0
- package/dist/{verify-D7UsV_qe.js → verify-Y3rWSgfA.js} +2 -2
- package/dist/{verify-D7UsV_qe.js.map → verify-Y3rWSgfA.js.map} +1 -1
- package/package.json +8 -8
- package/templates/overlays/baas/ai-instructions.md +1 -1
- package/templates/template/.cursorrules +1 -1
- package/templates/template/.github/copilot-instructions.md +1 -1
- package/templates/template/.windsurfrules +1 -1
- package/templates/template/AGENTS.md +1 -1
- package/templates/template/CLAUDE.md +1 -1
- package/templates/template/ai-instructions.md +1 -1
- package/templates/template/backend/functions/hello.ts +4 -3
- package/templates/template/frontend/vite.config.ts +5 -2
- package/dist/schema-reconcile-CX1_6Xqm.js +0 -2
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
## Never
|
|
24
24
|
|
|
25
|
-
- **Never create or change a table in code, and never write
|
|
25
|
+
- **Never create or change a table in code, and never write SQL as the database owner against application tables.** A table is a collection (core rule 1), and one that already exists gets its collection from `pnpm schema:introspect`. `rebase.sql()` runs as the owner — no row-level security, validation or hooks — so it is for server work that genuinely needs every row, and for reading a column marked `excludeFromApi`, which the API never returns; it logs a warning naming the fix when it is used to create, alter, drop or index a table. Prefer the SDK where it fits: `aggregate()` with `countDistinct`, `mode`, `percentile`, `distinct` and groups by `lower(…)`, `day(…)` or `unnest(tags)`; `fingerprint()` instead of hashing a table; `updateMany` with a value per row and `createMany` (one statement for the batch); `array-contains-all` / `array-contained-by` filters; a collection with `view: { query }` for a query worth naming. For anything else, write the SQL **as the caller**: `getSql(c)` in a function runs one statement in the caller's transaction under the same row-level security as the SDK, read-only unless `{ write: true }`. The query text is yours and every value goes in `params` (`$1`, `$2`, …) — never interpolate into the string. Columns the caller may not read (`excludeFromApi`, `access.read`) are dropped from what it returns when the query names them plainly, not when it computes from them; read hooks, validation and save hooks do not run.
|
|
26
26
|
- **Never deploy.** `pnpm deploy`, `rebase cloud deploy`, `firebase deploy`, `gcloud run deploy` — print the command and let the human run it, even when the task list ends in "deploy" and the tests are green.
|
|
27
27
|
- **Never edit `.env`.** It holds generated secrets and the connection string. Add a variable by asking, and document it in `.env.example`.
|
|
28
28
|
- **Never edit `backend/src/schema.generated.ts`.** It is overwritten by `pnpm schema:generate`; the collection file is the source.
|
|
@@ -61,9 +61,10 @@ import {
|
|
|
61
61
|
* `policy.serverContext()` is false for it (that arm means "no uid at all"),
|
|
62
62
|
* and anything an `admin` user can reach, it can reach too. For request-scoped
|
|
63
63
|
* data access use `getUser(c)` and `getDriver(c)`, which carry the caller's
|
|
64
|
-
* identity
|
|
65
|
-
*
|
|
66
|
-
*
|
|
64
|
+
* identity, and `getSql(c)` for SQL the SDK cannot express, run as the caller
|
|
65
|
+
* under the same policies. `rebase.sql()` is the real bypass — owner
|
|
66
|
+
* connection, no policies, and the one accessor that is Node-only. (`rebase`
|
|
67
|
+
* also exposes auth, storage, email.)
|
|
67
68
|
*
|
|
68
69
|
* Two habits worth keeping from the start, because both are free here and
|
|
69
70
|
* expensive to retrofit later:
|
|
@@ -3,7 +3,7 @@ import { defineConfig } from "vite";
|
|
|
3
3
|
import react from "@vitejs/plugin-react";
|
|
4
4
|
import svgr from "vite-plugin-svgr";
|
|
5
5
|
import tailwindcss from "@tailwindcss/vite";
|
|
6
|
-
import { rebaseCollectionsPlugin, rebaseManualChunks } from "@rebasepro/app/vitePlugin";
|
|
6
|
+
import { rebaseCollectionsPlugin, rebaseManualChunks, rebaseMcpViewPlugin } from "@rebasepro/app/vitePlugin";
|
|
7
7
|
|
|
8
8
|
export default defineConfig({
|
|
9
9
|
// `import.meta.dirname`, not `__dirname`: vite 8 warns that the latter is
|
|
@@ -60,6 +60,9 @@ export default defineConfig({
|
|
|
60
60
|
svgr(),
|
|
61
61
|
react({}),
|
|
62
62
|
tailwindcss(),
|
|
63
|
-
rebaseCollectionsPlugin({ collectionsDir: "../config/collections" })
|
|
63
|
+
rebaseCollectionsPlugin({ collectionsDir: "../config/collections" }),
|
|
64
|
+
// The view Claude shows this project's data in over MCP, built from
|
|
65
|
+
// this app so it draws your own fields, views and actions.
|
|
66
|
+
rebaseMcpViewPlugin()
|
|
64
67
|
]
|
|
65
68
|
});
|