@backifydev/cli 0.4.0 → 0.4.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backifydev/cli",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "Command-line setup and diagnostics for Backify applications",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,7 +1,7 @@
1
1
  import { defineConfig } from "@backifydev/sdk/config";
2
2
 
3
3
  export default defineConfig({
4
- instructionVersion: 18,
4
+ instructionVersion: 19,
5
5
  app: { name: "{{name}}" },
6
6
  kind: "api",
7
7
  server: { entry: "server/index.ts" },
@@ -4,7 +4,7 @@ This app runs on Backify. Keep to these rules when changing it.
4
4
 
5
5
  - **Declare, don't wire.** Routes go on `api` in `server/index.ts` (`api.get/post/...`), background work uses `defineJob`, recurring work `schedule`, reactions `on("event", job)`. Declarations must be at module top level with literal names.
6
6
  - **Every route states who may call it.** The default is a signed-in user; use `auth: "public"`, `{ role }` or `{ permission }` deliberately. Validate input with zod (`params`, `query`, `body`).
7
- - **Data:** PostgreSQL through `database()` / `transaction()`. Change the schema only with a new file in `db/migrations` (never edit an applied one). Publish events inside the transaction that writes the data.
7
+ - **Data:** PostgreSQL through `database()` / `transaction()`. Change the schema only with a new file in `db/migrations` (never edit an applied one). Add indexes for the columns you filter, join and sort on in the same migration that creates the table; to find missing ones later, run `backify database insights --environment <UUID>` (slow queries and tables read by full scans) and add the index in a new migration. Publish events inside the transaction that writes the data.
8
8
  - **Platform services** come from `@backifydev/sdk/app`: `storage.bucket()`, `ai`, `mail`, `http.fetch` (allowed hosts in `backify.config.ts`), `secret()`, `config()`. Never import cloud SDKs or put credentials in code or config.
9
9
  - **Config:** `backify.config.ts` holds buckets, auth providers, secret names, allowed hosts and literal `app.id` / `instructionVersion` metadata. Use init/sync deliberately to update agent instructions. Secret values are set per environment in the portal.
10
10
  - **Before committing:** run `npx backify check` (typecheck, lint, tests, build, lockfile). Commit `backify.lock.json`.
@@ -1,7 +1,7 @@
1
1
  import { defineConfig } from "@backifydev/sdk/config";
2
2
 
3
3
  export default defineConfig({
4
- instructionVersion: 18,
4
+ instructionVersion: 19,
5
5
  app: { name: "{{name}}" },
6
6
  kind: "web",
7
7
  server: { entry: "server/index.ts" },
@@ -1,7 +1,7 @@
1
1
  import { defineConfig } from "@backifydev/sdk/config";
2
2
 
3
3
  export default defineConfig({
4
- instructionVersion: 18,
4
+ instructionVersion: 19,
5
5
  app: { name: "{{name}}" },
6
6
  kind: "worker",
7
7
  server: { entry: "server/index.ts" },