@supacloud/lite 0.35.2 → 0.37.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.37.0](https://github.com/vibeunion/supacloud/compare/supacloud-lite-v0.36.0...supacloud-lite-v0.37.0) (2026-11-01)
4
+
5
+
6
+ ### Features
7
+
8
+ * **lite:** add a local Supabase import and compatibility lab ([#2325](https://github.com/vibeunion/supacloud/issues/2325)) ([aa739cb](https://github.com/vibeunion/supacloud/commit/aa739cb0fe47811833294bcfbcb90fded4116b83))
9
+
10
+ ## [0.36.0](https://github.com/vibeunion/supacloud/compare/supacloud-lite-v0.35.2...supacloud-lite-v0.36.0) (2026-10-31)
11
+
12
+
13
+ ### ⚠ BREAKING CHANGES
14
+
15
+ * **lite:** new native databases and default physical snapshot restores target PostgreSQL 18. Existing PostgreSQL 17 state requires an explicitly selected PostgreSQL 17 installation until logical migration.
16
+
17
+ ### Features
18
+
19
+ * **lite:** upgrade default native PostgreSQL to 18 ([#2313](https://github.com/vibeunion/supacloud/issues/2313)) ([325ff75](https://github.com/vibeunion/supacloud/commit/325ff75bbc81249bc5fb4c1e8cf249185f1e6065))
20
+ * **web-console:** migrate applications page to svadmin ([#2320](https://github.com/vibeunion/supacloud/issues/2320)) ([b643a27](https://github.com/vibeunion/supacloud/commit/b643a279debe862c3feb71e4da10c7d65bdb8769))
21
+
22
+
23
+ ### Miscellaneous Chores
24
+
25
+ * **workspace:** replace Nx scheduling with Bun ([#2321](https://github.com/vibeunion/supacloud/issues/2321)) ([c2d5b27](https://github.com/vibeunion/supacloud/commit/c2d5b270ca0d0d8e04e4547f270c9750b44a0096))
26
+
3
27
  ## [0.35.2](https://github.com/vibeunion/supacloud/compare/supacloud-lite-v0.35.1...supacloud-lite-v0.35.2) (2026-10-31)
4
28
 
5
29
 
@@ -1,7 +1,7 @@
1
1
  PostgreSQL Database Management System
2
2
  (also known as Postgres, formerly known as Postgres95)
3
3
 
4
- Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
4
+ Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
5
5
 
6
6
  Portions Copyright (c) 1994, The Regents of the University of California
7
7
 
package/README.md CHANGED
@@ -13,7 +13,7 @@ V1 的目标不是复刻完整 Supabase 平台控制面,而是让现有应用
13
13
  ### 状态
14
14
 
15
15
  - 运行时:npm 包需要 Bun 1.4.4+;单二进制发行版已内嵌 Bun 和 PGlite 资源
16
- - 数据库:PGlite 0.5.10,或 native PostgreSQL
16
+ - 数据库:PGlite 0.5.10,或 native PostgreSQL 18(默认下载 Theseus 18.6.1)
17
17
  - 项目模型:单进程、单项目,内部 project ref 固定为 `local`
18
18
  - 客户端:直接使用官方 `@supabase/supabase-js`
19
19
  - 数据目录:`.supacloud-lite/db`
@@ -106,6 +106,7 @@ timeout_ms = 15000 # limits.timeout_ms
106
106
  max_request_body_bytes = 1048576 # limits.max_request_body_bytes
107
107
  max_response_body_bytes = 524288 # limits.max_response_body_bytes
108
108
  wait_until_timeout_ms = 2000 # limits.wait_until_timeout_ms
109
+ max_heap_bytes = 134217728 # limits.max_heap_bytes(校验,不强制隔离)
109
110
  outbound_hosts = ["api.example.com"] # capabilities.outbound_hosts
110
111
  secrets = ["OPENAI_API_KEY"] # capabilities.secrets
111
112
  background = true # capabilities.background
@@ -117,6 +118,7 @@ background = true # capabilities.background
117
118
  | `max_request_body_bytes` | integer | 请求体上限;content-length 超限返回 413,无长度声明的流式 body 超限则中断读取 | `limits.max_request_body_bytes` |
118
119
  | `max_response_body_bytes` | integer | 响应体上限;content-length 超限直接替换为 502,流式 body 超限则在传输中截断(状态行已提交,客户端看到流中断) | `limits.max_response_body_bytes` |
119
120
  | `wait_until_timeout_ms` | integer | 响应返回后等待 `EdgeRuntime.waitUntil` 后台任务的最长时间;超时不再等待(任务继续运行,记录警告) | `limits.wait_until_timeout_ms` |
121
+ | `max_heap_bytes` | integer | 1 字节到 512 MiB。strict 模式拒绝非法值。Lite 没有 Worker 隔离,不会按该值采样堆或回收进程 | `limits.max_heap_bytes` |
120
122
  | `outbound_hosts` | string[] | `fetch` 出站 host 白名单(精确匹配,不含端口);loopback(localhost/127.0.0.1/::1)始终放行,未声明的 host 直接抛错 | `capabilities.outbound_hosts` |
121
123
  | `secrets` | string[] | 函数可见的环境变量白名单:基础三键(`SUPABASE_URL`/`SUPABASE_ANON_KEY`/`SUPABASE_SERVICE_ROLE_KEY`)+ 声明的 key,同时约束 `Deno.env` 与 `ctx.env` | `capabilities.secrets` |
122
124
  | `background` | boolean | 是否允许 `EdgeRuntime.waitUntil`;设为 `false` 时调用抛出与生产一致的错误 | `capabilities.background` |
@@ -162,7 +164,7 @@ sso_domains = ["acme.example"]
162
164
 
163
165
  ### 新版应用兼容
164
166
 
165
- Lite 支持平铺 SQL 与 `时间戳目录/migration.sql`,执行前检查重复版本和已应用 SQL 的内容漂移;目标绑定复用 `@supacloud/db`,`migrate --json` 可输出不含参数值的校验记录。`--runtime-mode strict` 对齐函数默认限制并拒绝无效配置、缺失函数和未声明的后台任务。
167
+ Lite 支持平铺 SQL 与 `时间戳目录/migration.sql`,执行前检查重复版本和已应用 SQL 的内容漂移;目标绑定复用 `@supacloud/db`,`migrate --json` 可输出不含参数值的校验记录。`--runtime-mode strict` 对齐函数默认限制并拒绝无效配置、缺失函数和未声明的后台任务。`max_heap_bytes` 接受与生产 Edge Runtime 相同的 1 字节到 512 MiB 声明;strict 模式拒绝非法值。Lite 在进程内执行函数,不按该预算采样堆或回收进程。
166
168
 
167
169
  `/graphql/v1` 使用真正的 `pg_graphql` 扩展和调用者的数据库角色/RLS,不模拟扩展。默认 PGlite 和标准 native 下载包均不包含该扩展;native 可通过 `--postgres-dir` 选择已经安装匹配扩展的 PostgreSQL。配置 `[lite.graphql] enabled = true` 会在运行时启动前验证扩展,`doctor --json` 区分已支持、缺失与尚未验证。
168
170
 
@@ -203,9 +205,13 @@ supacloud-lite snapshot restore <backup.tar.gz> [--force]
203
205
  supacloud-lite upgrade [-o pre-upgrade.tar.gz]
204
206
  supacloud-lite inspect
205
207
  supacloud-lite doctor [--json] [--production]
208
+ supacloud-lite import --from <supabase-project> [--json]
209
+ supacloud-lite compat [--json]
206
210
  supacloud-lite version
207
211
  ```
208
212
 
213
+ `import` 把本地 Supabase 项目的 config、migrations、seed / `import/data.sql`、Auth 用户、Storage 对象和 Functions 导入 Lite,并打印验收清单。无法在本机核对的行保持未勾选并写明原因。这不是部署。详见 `docs/supabase-import-lab.md`。
214
+
209
215
  首次初始化或 state 目录不存在/为空时,先运行 `supacloud-lite migrate`。`db reset` 只接受已经初始化且保留有效 `secrets.json` 标记的 state;它不会为 reset 创建或覆盖项目 secrets。
210
216
 
211
217
  #### 创建本地 Auth 账号
@@ -437,6 +443,9 @@ supacloud-lite doctor --json
437
443
 
438
444
  ### PostgreSQL 扩展生态
439
445
 
446
+ 默认 native 下载包使用 PostgreSQL 18。已有 PostgreSQL 17 数据目录和物理快照须继续通过 `--postgres-dir` 选择原 17 安装,完成逻辑迁移后才能使用 18;不能直接替换二进制打开旧数据。
447
+ 完整步骤见 [PostgreSQL 17 → 18 迁移方案](../../docs/lite-postgres17-to18-migration.md)。
448
+
440
449
  Lite 默认把一组常用扩展打进 PGlite:`uuid-ossp`、`pgcrypto`、`citext`、
441
450
  `pg_trgm`、`ltree`、`hstore`、`fuzzystrmatch`、`pgvector`、
442
451
  `pg_textsearch`、PostGIS 和官方 `pgmq`。其中 PostGIS 是上游实验性包,
@@ -447,11 +456,11 @@ PostgreSQL 主版本、操作系统、CPU 架构和 ABI 匹配的 PostgreSQL 安
447
456
  ```bash
448
457
  supacloud-lite migrate \
449
458
  --engine native \
450
- --postgres-dir /opt/postgresql/17
459
+ --postgres-dir /opt/postgresql/18
451
460
 
452
461
  supacloud-lite doctor \
453
462
  --engine native \
454
- --postgres-dir /opt/postgresql/17 \
463
+ --postgres-dir /opt/postgresql/18 \
455
464
  --json
456
465
  ```
457
466
 
@@ -607,7 +616,7 @@ The goal of V1 is not to replicate the full Supabase platform control plane, but
607
616
  ### Status
608
617
 
609
618
  - Runtime: the npm package requires Bun 1.4.4+; the single-binary release embeds Bun and PGlite assets
610
- - Database: PGlite 0.5.10, or native PostgreSQL
619
+ - Database: PGlite 0.5.10, or native PostgreSQL 18 (Theseus 18.6.1 by default)
611
620
  - Project model: single process, single project, with an internal project ref fixed as `local`
612
621
  - Client: uses the official `@supabase/supabase-js` directly
613
622
  - Data directory: `.supacloud-lite/db`
@@ -722,9 +731,13 @@ supacloud-lite snapshot restore <backup.tar.gz> [--force]
722
731
  supacloud-lite upgrade [-o pre-upgrade.tar.gz]
723
732
  supacloud-lite inspect
724
733
  supacloud-lite doctor [--json] [--production]
734
+ supacloud-lite import --from <supabase-project> [--json]
735
+ supacloud-lite compat [--json]
725
736
  supacloud-lite version
726
737
  ```
727
738
 
739
+ `import` loads a local Supabase project's config, migrations, seed or `import/data.sql`, Auth users, Storage objects, and Functions into Lite, then prints a verify checklist. Rows that this machine cannot check stay unchecked with a blocker. This is not a deployment. See `docs/supabase-import-lab.md`.
740
+
728
741
  Run `supacloud-lite migrate` first when initializing a project or when the state directory is missing or empty. `db reset` only accepts initialized state with a valid `secrets.json` marker; it never creates or replaces project secrets for a reset.
729
742
 
730
743
  #### Create a Local Auth User
@@ -907,6 +920,9 @@ duplicate versions and applied SQL drift before pending migrations, and reuses
907
920
  `@supacloud/db` for reviewed target bindings. `migrate --json` emits a hash-only
908
921
  binding attestation. Strict mode enforces bounded function defaults and rejects
909
922
  invalid declarations, missing functions and undeclared background work.
923
+ `max_heap_bytes` accepts the production range of 1 byte through 512 MiB and
924
+ is rejected when invalid in strict mode. Lite does not sample or retire on
925
+ that budget, because functions run in-process.
910
926
 
911
927
  `/graphql/v1` requires real `pg_graphql` and uses the caller's role/RLS. Neither
912
928
  bundled PGlite nor stock native downloads include the extension. Native can use
@@ -1007,6 +1023,12 @@ It uses Realtime's `messages` envelope: at most 100 messages per request, each `
1007
1023
 
1008
1024
  ### PostgreSQL extension ecosystem
1009
1025
 
1026
+ The default native download uses PostgreSQL 18. Keep selecting the original
1027
+ PostgreSQL 17 installation with `--postgres-dir` for existing major 17 data
1028
+ directories and physical snapshots until a logical migration to 18 is complete.
1029
+ Replacing binaries cannot upgrade an existing data directory.
1030
+ See the [PostgreSQL 17 to 18 migration runbook (中文)](../../docs/lite-postgres17-to18-migration.md).
1031
+
1010
1032
  Lite ships a PostgreSQL-shaped default extension set in PGlite. New databases
1011
1033
  install `uuid-ossp`, `pgcrypto`, `citext`, `pg_trgm`, `ltree`, `hstore`,
1012
1034
  `fuzzystrmatch`, `pgvector`, `pg_textsearch`, PostGIS, and the official PGMQ
@@ -1022,11 +1044,11 @@ match the Lite process:
1022
1044
  ```bash
1023
1045
  supacloud-lite migrate \
1024
1046
  --engine native \
1025
- --postgres-dir /opt/postgresql/17
1047
+ --postgres-dir /opt/postgresql/18
1026
1048
 
1027
1049
  supacloud-lite doctor \
1028
1050
  --engine native \
1029
- --postgres-dir /opt/postgresql/17 \
1051
+ --postgres-dir /opt/postgresql/18 \
1030
1052
  --json
1031
1053
  ```
1032
1054
 
@@ -30,11 +30,11 @@ extension archives are embedded in the standalone binary.
30
30
 
31
31
  ## Native PostgreSQL binaries
32
32
 
33
- Linux/macOS 上的可选 native 引擎会按需下载 Theseus 发布的 PostgreSQL 17.7.0 预编译包;该二进制不会内嵌到 npm 包或 Lite 单文件发布物中。
33
+ Linux/macOS 上的可选 native 引擎会按需下载 Theseus 发布的 PostgreSQL 18.6.1 预编译包(PostgreSQL 18.6 的打包修订,包含传递运行库);该二进制不会内嵌到 npm 包或 Lite 单文件发布物中。
34
34
 
35
35
  - PostgreSQL license: PostgreSQL License
36
36
  - Binary source: `https://github.com/theseus-rs/postgresql-binaries`
37
- - PostgreSQL copyright copy: `LICENSES/POSTGRESQL-17-COPYRIGHT.txt`
37
+ - PostgreSQL copyright copy: `LICENSES/POSTGRESQL-18-COPYRIGHT.txt`
38
38
  - Theseus distribution license copy: `LICENSES/THESEUS-POSTGRESQL-LICENSE.txt`
39
39
  - Integrity: Lite 对默认版本的四个平台归档使用内置 SHA-256 固定校验和
40
40