@rebasepro/cli 0.13.0 → 0.13.1-canary.g18cfeb7

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.
@@ -31,7 +31,7 @@
31
31
  */
32
32
  export declare const TELEMETRY_SCHEMA_VERSION = 1;
33
33
  /** The events the CLI reports. Closed set — a name not listed cannot be sent. */
34
- export type TelemetryEventName = "cli.init" | "cli.dev" | "cli.deploy" | "cli.schema_generate" | "cli.db_push" | "cli.error";
34
+ export type TelemetryEventName = "cli.init" | "cli.dev" | "cli.deploy" | "cli.schema" | "cli.db" | "cli.error";
35
35
  /** A single non-free-text value. */
36
36
  export type TelemetryValue = string | number | boolean;
37
37
  export type TelemetryEvent = {
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Would `loadCollectionsFromDirectory` load this file?
3
+ *
4
+ * Mirrors that loader's own `isCollectionFile` plus its flat (non-recursive)
5
+ * scan. `relativePath` is relative to the collections directory, as `fs.watch`
6
+ * reports it.
7
+ */
8
+ export declare function isLoadedCollectionFile(relativePath: string): boolean;
9
+ /**
10
+ * Does this collection source declare anything a SQL toolchain would own?
11
+ *
12
+ * The fallback order matches `resolveDataSource`: an explicit `engine` wins,
13
+ * and a collection that only names a `dataSource` is resolved as if the key
14
+ * were the engine — which is what that function does when no registry is
15
+ * available, and the CLI has none. An engine nobody recognises counts as
16
+ * relational, for the reason `isRelationalCollection` gives.
17
+ *
18
+ * A file declaring several collections is SQL-affecting if *any* of them is.
19
+ */
20
+ export declare function declaresRelationalCollection(rawSource: string): boolean;
21
+ /**
22
+ * Can this edit have changed the generated SQL schema?
23
+ *
24
+ * Answers `true` when it cannot tell — an unreadable file is a reason to warn,
25
+ * not a reason to go quiet.
26
+ */
27
+ export declare function affectsSqlSchema(collectionsDir: string, relativePath: string): boolean;
@@ -34,6 +34,26 @@ export declare function findFrontendDir(projectRoot: string): string | null;
34
34
  * Find the .env file. Checks the project root first, then backend.
35
35
  */
36
36
  export declare function findEnvFile(projectRoot: string): string | null;
37
+ /**
38
+ * Read the project's `.env` into a plain object.
39
+ *
40
+ * One reader, because there were four: `dotenv` in `start`, a hand-rolled
41
+ * `indexOf("=")` loop in `api-keys`, a single-key regex in `auth`, and its own
42
+ * splitting in `cloud env`. `dotenv` is a declared dependency of this package,
43
+ * so the other three existed for no reason and disagreed with the correct one
44
+ * on the two things people actually write in a `.env`:
45
+ *
46
+ * - `export KEY=value`, which the hand-rolled parser keyed as
47
+ * `export KEY` — so the command reported the key as unset while it was
48
+ * right there in the file;
49
+ * - `KEY=value # comment`, whose comment travelled into the value and then
50
+ * into an `Authorization` header, coming back as a 401 with nothing
51
+ * pointing at the cause.
52
+ *
53
+ * Returns `{}` when the project has no `.env`, so callers can treat "absent"
54
+ * and "empty" alike.
55
+ */
56
+ export declare function readEnvFile(projectRoot: string): Record<string, string>;
37
57
  /**
38
58
  * Resolve a binary from the project's node_modules/.bin.
39
59
  * Checks backend, root, parent monorepo root, then falls back to PATH.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebasepro/cli",
3
- "version": "0.13.0",
3
+ "version": "0.13.1-canary.g18cfeb7",
4
4
  "description": "Developer tools for Rebase projects",
5
5
  "main": "./dist/index.es.js",
6
6
  "module": "./dist/index.es.js",
@@ -31,12 +31,12 @@
31
31
  "execa": "^9.6.1",
32
32
  "inquirer": "14.0.2",
33
33
  "jiti": "^2.7.0",
34
- "@rebasepro/agent-skills": "0.13.0",
35
- "@rebasepro/client": "0.13.0",
36
- "@rebasepro/codegen": "0.13.0",
37
- "@rebasepro/types": "0.13.0",
38
- "@rebasepro/server": "0.13.0",
39
- "@rebasepro/server-postgres": "0.13.0"
34
+ "@rebasepro/agent-skills": "0.13.1-canary.g18cfeb7",
35
+ "@rebasepro/client": "0.13.1-canary.g18cfeb7",
36
+ "@rebasepro/server": "0.13.1-canary.g18cfeb7",
37
+ "@rebasepro/server-postgres": "0.13.1-canary.g18cfeb7",
38
+ "@rebasepro/codegen": "0.13.1-canary.g18cfeb7",
39
+ "@rebasepro/types": "0.13.1-canary.g18cfeb7"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/node": "^26.1.2",
@@ -25,7 +25,7 @@ services:
25
25
  image: postgres:18-alpine
26
26
  restart: unless-stopped
27
27
  environment:
28
- POSTGRES_USER: rebase
28
+ POSTGRES_USER: rebase_app
29
29
  POSTGRES_PASSWORD: ${DATABASE_PASSWORD:-changeme}
30
30
  POSTGRES_DB: rebase
31
31
  ports:
@@ -33,7 +33,7 @@ services:
33
33
  volumes:
34
34
  - postgres_data:/var/lib/postgresql
35
35
  healthcheck:
36
- test: ["CMD-SHELL", "pg_isready -U rebase -d rebase"]
36
+ test: ["CMD-SHELL", "pg_isready -U rebase_app -d rebase"]
37
37
  interval: 5s
38
38
  timeout: 5s
39
39
  retries: 10
@@ -48,8 +48,8 @@ services:
48
48
  - "${PORT:-3001}:3001"
49
49
  env_file: .env
50
50
  environment:
51
- DATABASE_URL: postgresql://rebase:${DATABASE_PASSWORD:-changeme}@db:5432/rebase?options=-c%20search_path=public
52
- ADMIN_CONNECTION_STRING: postgresql://rebase:${DATABASE_PASSWORD:-changeme}@db:5432/rebase?options=-c%20search_path=public
51
+ DATABASE_URL: postgresql://rebase_app:${DATABASE_PASSWORD:-changeme}@db:5432/rebase?options=-c%20search_path=public
52
+ ADMIN_CONNECTION_STRING: postgresql://rebase_app:${DATABASE_PASSWORD:-changeme}@db:5432/rebase?options=-c%20search_path=public
53
53
  NODE_ENV: production
54
54
  PORT: "3001"
55
55
  # Your entrypoint serves the built frontend itself (see the `serveSPA`
@@ -10,7 +10,7 @@
10
10
  # sslmode=disable matches the local docker-compose database, which has no TLS;
11
11
  # schema tooling (atlas) would otherwise default to requiring SSL. Remove it
12
12
  # when pointing at a managed/cloud database.
13
- DATABASE_URL=postgresql://rebase:changeme@localhost:5432/rebase?options=-c%20search_path=public&sslmode=disable
13
+ DATABASE_URL=postgresql://rebase_app:changeme@localhost:5432/rebase?options=-c%20search_path=public&sslmode=disable
14
14
  # DATABASE_URL=mongodb://localhost:27017/rebase
15
15
  #
16
16
  # Seeing "SSL is not enabled on the server"? Something in your environment
@@ -22,7 +22,7 @@ DATABASE_URL=postgresql://rebase:changeme@localhost:5432/rebase?options=-c%20sea
22
22
  # downgrade SSL for you when you have asked for it, not even on localhost:
23
23
  # quietly ignoring a security setting is worse than a clear failure. To opt out
24
24
  # explicitly for a local database, say so:
25
- # DATABASE_URL=postgresql://rebase:changeme@localhost:5432/rebase?options=-c%20search_path=public&sslmode=disable
25
+ # DATABASE_URL=postgresql://rebase_app:changeme@localhost:5432/rebase?options=-c%20search_path=public&sslmode=disable
26
26
 
27
27
  # Separate admin connection string for migrations and schema operations (optional)
28
28
  # Falls back to DATABASE_URL if not set
@@ -16,6 +16,7 @@
16
16
  "@rebasepro/types": "workspace:*"
17
17
  },
18
18
  "devDependencies": {
19
+ "@types/node": "^20.19.41",
19
20
  "typescript": "^5.9.2"
20
21
  },
21
22
  "exports": {
@@ -33,7 +33,7 @@ services:
33
33
  image: postgres:18-alpine
34
34
  restart: unless-stopped
35
35
  environment:
36
- POSTGRES_USER: rebase
36
+ POSTGRES_USER: rebase_app
37
37
  POSTGRES_PASSWORD: ${DATABASE_PASSWORD:-changeme}
38
38
  POSTGRES_DB: rebase
39
39
  # Published so `rebase db push` can reach it from the host. Remove this
@@ -47,7 +47,7 @@ services:
47
47
  # The runtime must not start before the database can answer, or its first
48
48
  # boot fails on a connection refused and the container restarts for no
49
49
  # reason a reader would understand.
50
- test: ["CMD-SHELL", "pg_isready -U rebase -d rebase"]
50
+ test: ["CMD-SHELL", "pg_isready -U rebase_app -d rebase"]
51
51
  interval: 5s
52
52
  timeout: 5s
53
53
  retries: 10
@@ -75,8 +75,8 @@ services:
75
75
  ports:
76
76
  - "${PORT:-3001}:3001"
77
77
  environment:
78
- DATABASE_URL: postgresql://rebase:${DATABASE_PASSWORD:-changeme}@db:5432/rebase?options=-c%20search_path=public
79
- ADMIN_CONNECTION_STRING: postgresql://rebase:${DATABASE_PASSWORD:-changeme}@db:5432/rebase?options=-c%20search_path=public
78
+ DATABASE_URL: postgresql://rebase_app:${DATABASE_PASSWORD:-changeme}@db:5432/rebase?options=-c%20search_path=public
79
+ ADMIN_CONNECTION_STRING: postgresql://rebase_app:${DATABASE_PASSWORD:-changeme}@db:5432/rebase?options=-c%20search_path=public
80
80
  JWT_SECRET: ${JWT_SECRET:?set JWT_SECRET in .env — `rebase init` generates one}
81
81
  REBASE_SERVICE_KEY: ${REBASE_SERVICE_KEY:?set REBASE_SERVICE_KEY in .env — `rebase init` generates one}
82
82
  NODE_ENV: production