@protobase/cli 0.110.1 → 0.110.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.
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "0.110.1";
2
+ var version = "0.110.2";
3
3
  //#endregion
4
4
  export { version };
@@ -11,9 +11,8 @@ const projectMailer = async (config) => (await config.authFiles?.module("auth/ma
11
11
  * The app's sign-in, built from `auth` with the app's URL, secrets, signing key rotation and name, the hooks of its
12
12
  * auth/hooks.ts and the app's mailer when it has them; none without `auth`.
13
13
  */
14
- const projectAuth = async (config, { db, pool }, workflows) => {
14
+ const projectAuth = async (config, { db }, workflows) => {
15
15
  if (!config.auth) return void 0;
16
- if (!pool) throw new Error("auth needs the app's pool, which its store shares");
17
16
  const { url, secret, previousSecrets, signingKeyDays, signingKeyGraceDays, name } = config;
18
17
  if (!url) throw new Error("Sign-in needs the app's public URL: set PROTOBASE_URL, such as https://admin.example.com, or url in protobase.config.ts");
19
18
  if (!secret) throw new Error("Sign-in needs the app's secret: set PROTOBASE_SECRET to the output of `openssl rand -base64 32`, or secret in protobase.config.ts");
@@ -27,7 +26,6 @@ const projectAuth = async (config, { db, pool }, workflows) => {
27
26
  ...signingKeyGraceDays !== void 0 && { signingKeyGraceDays },
28
27
  ...name && { appName: name }
29
28
  }, {
30
- pool,
31
29
  db,
32
30
  ...hooks && { hooks },
33
31
  ...mailer && { mailer },
@@ -6,7 +6,7 @@ import { appPool, longQueryPool } from "@protobase/server/internal";
6
6
  import { Kysely, PostgresDialect } from "kysely";
7
7
  //#region src/project/pg-db.ts
8
8
  const createPgDb = (pg, url, max = readDbConnections(process.env)) => openAppDatabase(pg, url, max).db;
9
- /** Kysely over the app's pool, as `createPgDb` makes it, and the pool itself, which the app's Better Auth store shares. */
9
+ /** Kysely over the app's pool, as `createPgDb` makes it. */
10
10
  const openAppDatabase = (pg, url, max = readDbConnections(process.env)) => {
11
11
  const pool = appPool(pg, url, max);
12
12
  const long = longQueryPool(pg, url);
@@ -19,10 +19,7 @@ const openAppDatabase = (pg, url, max = readDbConnections(process.env)) => {
19
19
  await Promise.all([pool.end(), long.end()]);
20
20
  }
21
21
  };
22
- return {
23
- db: new Kysely({ dialect: new PostgresDialect({ pool: gateBackgroundWork(routed, Math.max(1, max - 1)) }) }),
24
- pool
25
- };
22
+ return { db: new Kysely({ dialect: new PostgresDialect({ pool: gateBackgroundWork(routed, Math.max(1, max - 1)) }) }) };
26
23
  };
27
24
  //#endregion
28
25
  export { createPgDb, openAppDatabase };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/cli",
3
- "version": "0.110.1",
3
+ "version": "0.110.2",
4
4
  "description": "The protobase command: scaffold, doctor, dev, build and serve a Protobase project.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -43,13 +43,13 @@
43
43
  "dependencies": {
44
44
  "@better-auth/core": "^1.7.12",
45
45
  "@hono/node-server": "^2.1.3",
46
- "@protobase/config": "0.110.1",
47
- "@protobase/layout": "0.110.1",
48
- "@protobase/query": "0.110.1",
49
- "@protobase/schema": "0.110.1",
50
- "@protobase/server": "0.110.1",
51
- "@protobase/ui": "0.110.1",
52
- "@protobase/workflows": "0.110.1",
46
+ "@protobase/config": "0.110.2",
47
+ "@protobase/layout": "0.110.2",
48
+ "@protobase/query": "0.110.2",
49
+ "@protobase/schema": "0.110.2",
50
+ "@protobase/server": "0.110.2",
51
+ "@protobase/ui": "0.110.2",
52
+ "@protobase/workflows": "0.110.2",
53
53
  "@react-email/render": "^2.1.0",
54
54
  "@scalar/hono-api-reference": "^0.12.10",
55
55
  "@sentry/vite-plugin": "^11.10.0",
@@ -22,7 +22,7 @@ export default defineConfig({
22
22
 
23
23
  ## Admin store
24
24
 
25
- Users, sessions and signing keys stay apart from the application's tables, in a schema of the app's own database, `auth` by default (`auth: { schema: 'accounts' }` names another), so a host that gives an application one database (and a role that cannot create databases) is enough. The store shares the app's one pool on `DATABASE_URL`, which `protobase dev` and `serve` open, so it opens no connections beyond [`PROTOBASE_DB_CONNECTIONS`](cli.md#serve), and a database restart is printed instead of stopping the app.
25
+ Users, sessions and signing keys stay apart from the application's tables, in a schema of the app's own database, `auth` by default (`auth: { schema: 'accounts' }` names another), so a host that gives an application one database (and a role that cannot create databases) is enough. Sign-in, sessions, tokens and organization memberships run through the app's own query layer, on its one pool on `DATABASE_URL`, which `protobase dev` and `serve` open, so the store opens no connections beyond [`PROTOBASE_DB_CONNECTIONS`](cli.md#serve), and a database restart is printed instead of stopping the app.
26
26
 
27
27
  ### Migrations
28
28