@supatype/cli 0.9.1 → 0.9.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/CHANGELOG.md +303 -91
- package/bin/node-version.js +28 -0
- package/bin/supatype.js +8 -4
- package/dist/app/port-holder.d.ts +33 -0
- package/dist/app/port-holder.d.ts.map +1 -0
- package/dist/app/port-holder.js +66 -0
- package/dist/app/port-holder.js.map +1 -0
- package/dist/app/proxy-dev-app.d.ts +21 -3
- package/dist/app/proxy-dev-app.d.ts.map +1 -1
- package/dist/app/proxy-dev-app.js +84 -46
- package/dist/app/proxy-dev-app.js.map +1 -1
- package/dist/app/vite-dev-args.d.ts +20 -0
- package/dist/app/vite-dev-args.d.ts.map +1 -0
- package/dist/app/vite-dev-args.js +65 -0
- package/dist/app/vite-dev-args.js.map +1 -0
- package/dist/app-config.d.ts +2 -0
- package/dist/app-config.d.ts.map +1 -1
- package/dist/app-config.js +27 -8
- package/dist/app-config.js.map +1 -1
- package/dist/augmentation-generator.d.ts +2 -0
- package/dist/augmentation-generator.d.ts.map +1 -1
- package/dist/augmentation-generator.js +7 -3
- package/dist/augmentation-generator.js.map +1 -1
- package/dist/binary-download-lock.d.ts.map +1 -1
- package/dist/binary-download-lock.js +2 -10
- package/dist/binary-download-lock.js.map +1 -1
- package/dist/cache-provider.d.ts +17 -2
- package/dist/cache-provider.d.ts.map +1 -1
- package/dist/cache-provider.js +28 -3
- package/dist/cache-provider.js.map +1 -1
- package/dist/cli-version-embedded.js +1 -1
- package/dist/cli.d.ts +7 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +10 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/admin.js +5 -11
- package/dist/commands/admin.js.map +1 -1
- package/dist/commands/app.d.ts.map +1 -1
- package/dist/commands/app.js +22 -2
- package/dist/commands/app.js.map +1 -1
- package/dist/commands/dev.d.ts +21 -4
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +222 -68
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/doctor.js +1 -1
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/generate.d.ts.map +1 -1
- package/dist/commands/generate.js +3 -0
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/init.d.ts +6 -8
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +193 -114
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/link-helpers.js +1 -1
- package/dist/commands/link-helpers.js.map +1 -1
- package/dist/commands/push.d.ts.map +1 -1
- package/dist/commands/push.js +3 -1
- package/dist/commands/push.js.map +1 -1
- package/dist/commands/self-host.d.ts +3 -3
- package/dist/commands/self-host.d.ts.map +1 -1
- package/dist/commands/self-host.js +68 -269
- package/dist/commands/self-host.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +156 -63
- package/dist/commands/update.js.map +1 -1
- package/dist/compose-db-roles.d.ts.map +1 -1
- package/dist/compose-db-roles.js +3 -0
- package/dist/compose-db-roles.js.map +1 -1
- package/dist/compose-rename.d.ts.map +1 -1
- package/dist/compose-rename.js +5 -0
- package/dist/compose-rename.js.map +1 -1
- package/dist/compose-render-mode.d.ts +8 -3
- package/dist/compose-render-mode.d.ts.map +1 -1
- package/dist/compose-render-mode.js +13 -5
- package/dist/compose-render-mode.js.map +1 -1
- package/dist/compose-services.d.ts.map +1 -1
- package/dist/compose-services.js +3 -2
- package/dist/compose-services.js.map +1 -1
- package/dist/config-mailer-env.d.ts +6 -2
- package/dist/config-mailer-env.d.ts.map +1 -1
- package/dist/config-mailer-env.js +9 -11
- package/dist/config-mailer-env.js.map +1 -1
- package/dist/config-version-pin.d.ts +42 -0
- package/dist/config-version-pin.d.ts.map +1 -0
- package/dist/config-version-pin.js +64 -0
- package/dist/config-version-pin.js.map +1 -0
- package/dist/config.d.ts +4 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +6 -2
- package/dist/config.js.map +1 -1
- package/dist/dev-compose.d.ts +9 -4
- package/dist/dev-compose.d.ts.map +1 -1
- package/dist/dev-compose.js +87 -53
- package/dist/dev-compose.js.map +1 -1
- package/dist/dev-initial-push.d.ts.map +1 -1
- package/dist/dev-initial-push.js +6 -0
- package/dist/dev-initial-push.js.map +1 -1
- package/dist/dev-ports.d.ts +7 -2
- package/dist/dev-ports.d.ts.map +1 -1
- package/dist/dev-ports.js +44 -22
- package/dist/dev-ports.js.map +1 -1
- package/dist/dev-ready-panel.d.ts +26 -3
- package/dist/dev-ready-panel.d.ts.map +1 -1
- package/dist/dev-ready-panel.js +37 -5
- package/dist/dev-ready-panel.js.map +1 -1
- package/dist/dev-self-start.d.ts +16 -0
- package/dist/dev-self-start.d.ts.map +1 -0
- package/dist/dev-self-start.js +31 -0
- package/dist/dev-self-start.js.map +1 -0
- package/dist/dev-session-lock.d.ts +66 -2
- package/dist/dev-session-lock.d.ts.map +1 -1
- package/dist/dev-session-lock.js +104 -5
- package/dist/dev-session-lock.js.map +1 -1
- package/dist/dev-session.d.ts +6 -1
- package/dist/dev-session.d.ts.map +1 -1
- package/dist/dev-session.js +9 -3
- package/dist/dev-session.js.map +1 -1
- package/dist/dev-shutdown.d.ts +11 -2
- package/dist/dev-shutdown.d.ts.map +1 -1
- package/dist/dev-shutdown.js +23 -9
- package/dist/dev-shutdown.js.map +1 -1
- package/dist/docker-runtime.d.ts +31 -7
- package/dist/docker-runtime.d.ts.map +1 -1
- package/dist/docker-runtime.js +104 -36
- package/dist/docker-runtime.js.map +1 -1
- package/dist/engine-columns.d.ts +26 -0
- package/dist/engine-columns.d.ts.map +1 -0
- package/dist/engine-columns.js +67 -0
- package/dist/engine-columns.js.map +1 -0
- package/dist/env-file.d.ts +18 -3
- package/dist/env-file.d.ts.map +1 -1
- package/dist/env-file.js +23 -7
- package/dist/env-file.js.map +1 -1
- package/dist/frontend-env.d.ts +3 -2
- package/dist/frontend-env.d.ts.map +1 -1
- package/dist/frontend-env.js +1 -1
- package/dist/frontend-env.js.map +1 -1
- package/dist/functions-deno-types.d.ts.map +1 -1
- package/dist/functions-deno-types.js +5 -5
- package/dist/functions-deno-types.js.map +1 -1
- package/dist/functions-worker-files.d.ts.map +1 -1
- package/dist/functions-worker-files.js +2 -13
- package/dist/functions-worker-files.js.map +1 -1
- package/dist/generated/release-images.d.ts +6 -6
- package/dist/generated/release-images.js +3 -3
- package/dist/gitignore.d.ts +29 -2
- package/dist/gitignore.d.ts.map +1 -1
- package/dist/gitignore.js +86 -21
- package/dist/gitignore.js.map +1 -1
- package/dist/hooks-generator.d.ts.map +1 -1
- package/dist/hooks-generator.js +4 -2
- package/dist/hooks-generator.js.map +1 -1
- package/dist/host-database.d.ts +6 -2
- package/dist/host-database.d.ts.map +1 -1
- package/dist/host-database.js +10 -2
- package/dist/host-database.js.map +1 -1
- package/dist/init-dependency-versions.d.ts +2 -3
- package/dist/init-dependency-versions.d.ts.map +1 -1
- package/dist/init-dependency-versions.js +12 -9
- package/dist/init-dependency-versions.js.map +1 -1
- package/dist/init-example.d.ts.map +1 -1
- package/dist/init-example.js +13 -1
- package/dist/init-example.js.map +1 -1
- package/dist/init-expo-runtime-env.d.ts +25 -0
- package/dist/init-expo-runtime-env.d.ts.map +1 -0
- package/dist/init-expo-runtime-env.js +112 -0
- package/dist/init-expo-runtime-env.js.map +1 -0
- package/dist/init-next-runtime-env.d.ts +14 -1
- package/dist/init-next-runtime-env.d.ts.map +1 -1
- package/dist/init-next-runtime-env.js +116 -35
- package/dist/init-next-runtime-env.js.map +1 -1
- package/dist/init-package-json.d.ts +11 -3
- package/dist/init-package-json.d.ts.map +1 -1
- package/dist/init-package-json.js +20 -13
- package/dist/init-package-json.js.map +1 -1
- package/dist/init-port-registry.d.ts +19 -0
- package/dist/init-port-registry.d.ts.map +1 -0
- package/dist/init-port-registry.js +57 -0
- package/dist/init-port-registry.js.map +1 -0
- package/dist/init-project-detect.d.ts +20 -0
- package/dist/init-project-detect.d.ts.map +1 -1
- package/dist/init-project-detect.js +41 -8
- package/dist/init-project-detect.js.map +1 -1
- package/dist/init-vite-node.d.ts +21 -0
- package/dist/init-vite-node.d.ts.map +1 -0
- package/dist/init-vite-node.js +75 -0
- package/dist/init-vite-node.js.map +1 -0
- package/dist/jsx-first-child.d.ts +18 -0
- package/dist/jsx-first-child.d.ts.map +1 -0
- package/dist/jsx-first-child.js +53 -0
- package/dist/jsx-first-child.js.map +1 -0
- package/dist/keyspace-password-file.d.ts +46 -0
- package/dist/keyspace-password-file.d.ts.map +1 -0
- package/dist/keyspace-password-file.js +128 -0
- package/dist/keyspace-password-file.js.map +1 -0
- package/dist/kong-config.d.ts +1 -0
- package/dist/kong-config.d.ts.map +1 -1
- package/dist/kong-config.js +64 -20
- package/dist/kong-config.js.map +1 -1
- package/dist/local-gateway.d.ts +11 -3
- package/dist/local-gateway.d.ts.map +1 -1
- package/dist/local-gateway.js +16 -7
- package/dist/local-gateway.js.map +1 -1
- package/dist/local-secrets.d.ts +10 -0
- package/dist/local-secrets.d.ts.map +1 -1
- package/dist/local-secrets.js +13 -0
- package/dist/local-secrets.js.map +1 -1
- package/dist/local-stack-guard.d.ts.map +1 -1
- package/dist/local-stack-guard.js +3 -2
- package/dist/local-stack-guard.js.map +1 -1
- package/dist/local-stack.d.ts.map +1 -1
- package/dist/local-stack.js +7 -6
- package/dist/local-stack.js.map +1 -1
- package/dist/local-storage.d.ts +3 -5
- package/dist/local-storage.d.ts.map +1 -1
- package/dist/local-storage.js +10 -10
- package/dist/local-storage.js.map +1 -1
- package/dist/mailer-autoconfirm.d.ts +29 -24
- package/dist/mailer-autoconfirm.d.ts.map +1 -1
- package/dist/mailer-autoconfirm.js +47 -43
- package/dist/mailer-autoconfirm.js.map +1 -1
- package/dist/model-hooks.d.ts +4 -4
- package/dist/model-hooks.d.ts.map +1 -1
- package/dist/model-hooks.js +13 -7
- package/dist/model-hooks.js.map +1 -1
- package/dist/native-dev-env.d.ts +25 -2
- package/dist/native-dev-env.d.ts.map +1 -1
- package/dist/native-dev-env.js +39 -4
- package/dist/native-dev-env.js.map +1 -1
- package/dist/native-keyspace.d.ts +21 -6
- package/dist/native-keyspace.d.ts.map +1 -1
- package/dist/native-keyspace.js +48 -14
- package/dist/native-keyspace.js.map +1 -1
- package/dist/native-leftover-postgres.d.ts +23 -0
- package/dist/native-leftover-postgres.d.ts.map +1 -0
- package/dist/native-leftover-postgres.js +55 -0
- package/dist/native-leftover-postgres.js.map +1 -0
- package/dist/native-leftover-services.d.ts +17 -0
- package/dist/native-leftover-services.d.ts.map +1 -0
- package/dist/native-leftover-services.js +93 -0
- package/dist/native-leftover-services.js.map +1 -0
- package/dist/native-pg-auth.d.ts.map +1 -1
- package/dist/native-pg-auth.js +2 -1
- package/dist/native-pg-auth.js.map +1 -1
- package/dist/native-port-lock.d.ts +37 -0
- package/dist/native-port-lock.d.ts.map +1 -0
- package/dist/native-port-lock.js +78 -0
- package/dist/native-port-lock.js.map +1 -0
- package/dist/native-realtime.d.ts +6 -3
- package/dist/native-realtime.d.ts.map +1 -1
- package/dist/native-realtime.js +65 -24
- package/dist/native-realtime.js.map +1 -1
- package/dist/native-roles-sql.d.ts.map +1 -1
- package/dist/native-roles-sql.js +2 -1
- package/dist/native-roles-sql.js.map +1 -1
- package/dist/native-storage-import.d.ts.map +1 -1
- package/dist/native-storage-import.js +6 -5
- package/dist/native-storage-import.js.map +1 -1
- package/dist/native-storage.d.ts +42 -7
- package/dist/native-storage.d.ts.map +1 -1
- package/dist/native-storage.js +196 -50
- package/dist/native-storage.js.map +1 -1
- package/dist/parent-watch.d.ts.map +1 -1
- package/dist/parent-watch.js +4 -8
- package/dist/parent-watch.js.map +1 -1
- package/dist/postgres-ctl.d.ts +31 -5
- package/dist/postgres-ctl.d.ts.map +1 -1
- package/dist/postgres-ctl.js +49 -11
- package/dist/postgres-ctl.js.map +1 -1
- package/dist/postgres-image.d.ts +16 -0
- package/dist/postgres-image.d.ts.map +1 -1
- package/dist/postgres-image.js +34 -11
- package/dist/postgres-image.js.map +1 -1
- package/dist/process-info.d.ts +14 -0
- package/dist/process-info.d.ts.map +1 -0
- package/dist/process-info.js +41 -0
- package/dist/process-info.js.map +1 -0
- package/dist/process-manager.d.ts +73 -4
- package/dist/process-manager.d.ts.map +1 -1
- package/dist/process-manager.js +121 -45
- package/dist/process-manager.js.map +1 -1
- package/dist/process-tree.d.ts +48 -0
- package/dist/process-tree.d.ts.map +1 -0
- package/dist/process-tree.js +141 -0
- package/dist/process-tree.js.map +1 -0
- package/dist/project-config.d.ts +33 -4
- package/dist/project-config.d.ts.map +1 -1
- package/dist/project-config.js +5 -1
- package/dist/project-config.js.map +1 -1
- package/dist/required-host-components.d.ts.map +1 -1
- package/dist/required-host-components.js +3 -5
- package/dist/required-host-components.js.map +1 -1
- package/dist/route-manifest.d.ts +24 -0
- package/dist/route-manifest.d.ts.map +1 -1
- package/dist/route-manifest.js +60 -2
- package/dist/route-manifest.js.map +1 -1
- package/dist/run-captured.d.ts +3 -1
- package/dist/run-captured.d.ts.map +1 -1
- package/dist/run-captured.js.map +1 -1
- package/dist/run-until-stopped.d.ts +3 -0
- package/dist/run-until-stopped.d.ts.map +1 -1
- package/dist/run-until-stopped.js +25 -11
- package/dist/run-until-stopped.js.map +1 -1
- package/dist/runtime-routes.d.ts +5 -0
- package/dist/runtime-routes.d.ts.map +1 -1
- package/dist/runtime-routes.js +5 -1
- package/dist/runtime-routes.js.map +1 -1
- package/dist/secret-sql.d.ts +13 -0
- package/dist/secret-sql.d.ts.map +1 -0
- package/dist/secret-sql.js +13 -0
- package/dist/secret-sql.js.map +1 -0
- package/dist/seed-ir.d.ts +8 -1
- package/dist/seed-ir.d.ts.map +1 -1
- package/dist/seed-ir.js +92 -6
- package/dist/seed-ir.js.map +1 -1
- package/dist/seed.d.ts +15 -2
- package/dist/seed.d.ts.map +1 -1
- package/dist/self-host-compose.d.ts +15 -1
- package/dist/self-host-compose.d.ts.map +1 -1
- package/dist/self-host-compose.js +216 -51
- package/dist/self-host-compose.js.map +1 -1
- package/dist/stack-exit-watch.d.ts +15 -0
- package/dist/stack-exit-watch.d.ts.map +1 -1
- package/dist/stack-exit-watch.js +41 -13
- package/dist/stack-exit-watch.js.map +1 -1
- package/dist/stack-folder.d.ts +28 -0
- package/dist/stack-folder.d.ts.map +1 -0
- package/dist/stack-folder.js +123 -0
- package/dist/stack-folder.js.map +1 -0
- package/dist/stack-setting-warnings.d.ts +2 -1
- package/dist/stack-setting-warnings.d.ts.map +1 -1
- package/dist/stack-setting-warnings.js +6 -1
- package/dist/stack-setting-warnings.js.map +1 -1
- package/dist/storage-provision.d.ts +12 -2
- package/dist/storage-provision.d.ts.map +1 -1
- package/dist/storage-provision.js +36 -11
- package/dist/storage-provision.js.map +1 -1
- package/dist/type-extractor.d.ts.map +1 -1
- package/dist/type-extractor.js +27 -3
- package/dist/type-extractor.js.map +1 -1
- package/dist/ui/dev/DevReadyPanelView.js +1 -1
- package/dist/ui/dev/DevReadyPanelView.js.map +1 -1
- package/dist/valkey-sidecar.d.ts +24 -11
- package/dist/valkey-sidecar.d.ts.map +1 -1
- package/dist/valkey-sidecar.js +45 -25
- package/dist/valkey-sidecar.js.map +1 -1
- package/dist/windows-processes.d.ts +7 -0
- package/dist/windows-processes.d.ts.map +1 -0
- package/dist/windows-processes.js +31 -0
- package/dist/windows-processes.js.map +1 -0
- package/dist/write-if-changed.d.ts +12 -0
- package/dist/write-if-changed.d.ts.map +1 -0
- package/dist/write-if-changed.js +32 -0
- package/dist/write-if-changed.js.map +1 -0
- package/package.json +6 -4
- package/dist/systemd.d.ts +0 -26
- package/dist/systemd.d.ts.map +0 -1
- package/dist/systemd.js +0 -117
- package/dist/systemd.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,177 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 0.9.2 (2026-11-12)
|
|
4
|
+
|
|
5
|
+
### Breaking Changes
|
|
6
|
+
|
|
7
|
+
* **storage:** the storage service's S3 settings have no defaults that point somewhere. With
|
|
8
|
+
`STORAGE_BACKEND=s3` it used to fall back to `http://localhost:8333` and the SeaweedFS login
|
|
9
|
+
published in this repository for any setting left out. It now needs `S3_REGION` for AWS or
|
|
10
|
+
`S3_ENDPOINT` for another store, takes both keys or neither (neither uses the AWS SDK's own
|
|
11
|
+
credentials), and refuses to start otherwise, saying which setting is missing. The self-host
|
|
12
|
+
compose stack sets every one of them, so it is unaffected.
|
|
13
|
+
* **self-host:** the hidden `supatype self-host native` commands (`install-service`, `serve`,
|
|
14
|
+
`reload`, `status`, `logs`, `backup`) are removed. They were undocumented and untested, and
|
|
15
|
+
`serve` ran the server's built-in object store, which applies no storage read rules: anyone with
|
|
16
|
+
the anon key could read a private bucket. The systemd units `install-service` wrote started no
|
|
17
|
+
storage service either. Docker Compose (`supatype self-host compose`) is the self-host path; back
|
|
18
|
+
up a Compose stack with `pg_dump` against `DATABASE_URL`.
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* **storage:** single-bucket S3 mode, as Supabase Storage does with `GLOBAL_S3_BUCKET`. Set
|
|
23
|
+
`S3_BUCKET` and every Supatype bucket is a key prefix inside that one S3 bucket. The service never
|
|
24
|
+
creates an S3 bucket or puts a bucket policy, the S3 bucket stays private, and the keys need only
|
|
25
|
+
read, write, list and delete on it. Without `S3_BUCKET`, each Supatype bucket still gets an S3
|
|
26
|
+
bucket of its own, now named `S3_BUCKET_PREFIX` then the bucket's id. A bucket's `s3BucketPolicy`
|
|
27
|
+
is never applied in single-bucket mode, since it would cover every bucket at once. The storage
|
|
28
|
+
service refuses it with 400 on a bucket made or changed through its API.
|
|
29
|
+
* **self-host, dev, init:** `storage: { production: "s3" }` in supatype.config.ts (init writes it
|
|
30
|
+
from its "Production storage?" answer) makes `self-host compose` run the storage service against
|
|
31
|
+
your own S3 bucket, with no SeaweedFS in the stack. Native `dev` with `storage: { provider: "s3" }`
|
|
32
|
+
runs the storage service against the bucket in `.env`, so access rules apply there too.
|
|
33
|
+
* **auth:** `auth.email.enabled: false` in supatype.config.ts turns email-and-password sign-up and
|
|
34
|
+
sign-in off (with magic links and password recovery) on native dev, Docker dev and self-host; a
|
|
35
|
+
`SUPATYPE_EXTERNAL_EMAIL_ENABLED` in `.env` wins. Studio's auth Configuration page names the key
|
|
36
|
+
for it and for email confirmation.
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### Bug Fixes
|
|
43
|
+
|
|
44
|
+
* **dev:** a project's own running database on the default port keeps it when `.env` names no port,
|
|
45
|
+
instead of being moved to the next free port and saved there.
|
|
46
|
+
* **seed:** a plain `where` in `$if` takes bigints and compares decimal columns exactly, as an
|
|
47
|
+
upsert's `where` does, and says plainly that a reference cannot be compared there.
|
|
48
|
+
* **seed:** `$if` takes `where: { name: "x" }`, each column equal to its value like an upsert's
|
|
49
|
+
`where`, as well as `eq()` and the other predicates. The plain form failed with "not valid IR:
|
|
50
|
+
missing field type" (#303).
|
|
51
|
+
* **seed:** array columns can be seeded. `tags: ["a", "b"]` and `tags: []` failed with "expression is
|
|
52
|
+
of type text". Needs schema engine 0.10.1.
|
|
53
|
+
* **dev:** Ctrl+C while a Docker dev is still starting now says "Stopped during start.", takes the
|
|
54
|
+
stack down and exits 130, as native dev does. It said "Shutting down…" and exited 0.
|
|
55
|
+
* **dev, functions serve:** stopping dev or `functions serve` now ends everything Supatype's
|
|
56
|
+
processes started, including the Deno functions worker native dev's server runs and whatever
|
|
57
|
+
Deno itself starts, on Ctrl+C, SIGTERM, a forced quit or a crash, so the next run no longer finds
|
|
58
|
+
the functions port taken. Windows ends the whole process tree. Linux and macOS give each process a
|
|
59
|
+
process group and end the group.
|
|
60
|
+
* **dev:** a Vite app started by `supatype dev` now listens on the address and port the app proxy forwards
|
|
61
|
+
to (`--host 127.0.0.1 --port <upstream port> --strictPort`), and keeps its script's own flags. On Windows,
|
|
62
|
+
Vite listened on [::1] while the proxy dialled 127.0.0.1, so the App URL answered 502 or showed another
|
|
63
|
+
project's app. `init` now checks the Vite port is free on both loopbacks and offers the next free one.
|
|
64
|
+
* **dev:** before starting your app, `dev` now ends only a leftover process of this project's own. Another
|
|
65
|
+
program on the app's port is left running, and dev says `port 5173 is used by another program (pid X)`
|
|
66
|
+
instead of starting the app. Two projects on one port used to end each other's dev server every few
|
|
67
|
+
seconds, which showed as the app exiting with code 1 and no error.
|
|
68
|
+
* **dev and every command that checks Docker:** a Docker that is running but slow to answer is now
|
|
69
|
+
waited for, up to 60 seconds, with a "Waiting for Docker to answer" line, instead of being reported
|
|
70
|
+
as not running after 10 seconds. `SUPATYPE_DOCKER_TIMEOUT` changes the wait. A Docker that refuses
|
|
71
|
+
the connection or is paused still fails at once.
|
|
72
|
+
* **dev:** the "Services running" panel no longer prints the Postgres password or the full
|
|
73
|
+
service_role key, so neither lands in CI logs. The database URL is masked as `status` masks it,
|
|
74
|
+
and the key is shown as a fingerprint pointing at `SERVICE_ROLE_KEY` in `.env`. Native dev now
|
|
75
|
+
fills a blank or missing `SERVICE_ROLE_KEY` in `.env` with the key the stack runs with, as Docker
|
|
76
|
+
dev does, and never replaces one you set.
|
|
77
|
+
* **generate:** the client's types now include the columns the engine adds for `timestamps: true` and
|
|
78
|
+
`softDelete: true` (`created_at`, `updated_at`, `deleted_at`), filled by the database and so
|
|
79
|
+
optional on insert, so selecting `updated_at` no longer fails `tsc`. Hook row types include them too.
|
|
80
|
+
* **schema:** `WithPublishable<{ ... }>` now adds the nullable `published_at` column, as
|
|
81
|
+
`{ ... } & Publishable` already did. The wrapper used to drop it, so the two spellings of one type
|
|
82
|
+
built different tables. A `published_at` the model declares itself keeps its own shape.
|
|
83
|
+
* **client:** `single()` on a write no longer declares a `count` it never reads, so the client source
|
|
84
|
+
compiles under `noUnusedLocals`. The package now checks that flag itself.
|
|
85
|
+
* **client:** `.range()` now sends `offset` and `limit` like supabase-js, so `.limit(n).range(a, b)` and
|
|
86
|
+
`useQuery(..., { limit, offset })` no longer fail with 416, and a cached read of one page is no longer
|
|
87
|
+
served for another page. Whichever of `limit()` and `range()` is called last sets the page size.
|
|
88
|
+
* **vue, svelte, solid:** query options can be a ref or getter (Vue), a store (Svelte) or an accessor
|
|
89
|
+
(Solid), and the query runs again when they change. Before, sort, page and filter were read once.
|
|
90
|
+
* **react:** `useQuery` with an `offset` and no `limit` reads a page of 100 rows, as the Vue, Svelte
|
|
91
|
+
and Solid queries do, instead of ignoring the offset.
|
|
92
|
+
* **push:** a push to the Docker stack whose step after the schema fails (starting the stack, waiting
|
|
93
|
+
for the gateway, creating a bucket) now says the schema was applied but the push did not finish,
|
|
94
|
+
prints no success line, and exits 1, as native and linked pushes do. It printed "Schema pushed."
|
|
95
|
+
and exited 0, so pipelines passed with buckets missing (#301).
|
|
96
|
+
* **push:** a push with no `SUPATYPE_KONG_PORT` in `.env` no longer waits 120 seconds on the wrong
|
|
97
|
+
port. It took the project's own running gateway on 18473 for another program's, moved to 18481
|
|
98
|
+
where nothing listened, and silently skipped creating buckets.
|
|
99
|
+
* **schema:** a bucket's `s3BucketPolicy` that is not a JSON object is refused when the schema is
|
|
100
|
+
read, naming the bucket. A push writes the bucket through the engine, so the storage service's own
|
|
101
|
+
check never saw it and the bad policy was stored without being applied.
|
|
102
|
+
* **dev:** native dev no longer falls back to the server's built-in object store when the storage
|
|
103
|
+
service does not start. That store applied no storage read rules, so any token, the anon key
|
|
104
|
+
included, could read or sign any object in a private bucket. Storage is now off instead:
|
|
105
|
+
`/storage/v1` answers 503 "storage service is not running", dev says why and how to fix it, and
|
|
106
|
+
the stored files come back on the next start.
|
|
107
|
+
* **cli:** the npm package now installs on Node.js 18 and later, not only 22, and an older Node is
|
|
108
|
+
told which version to install. 0.8.0 to 0.9.1 asked for Node 22, which the package never needed,
|
|
109
|
+
so npm on Node 18 or 20 quietly installed 0.7.0 instead of the latest release.
|
|
110
|
+
* **self-host:** a self-hosted stack now sends a confirmation link with every new email sign-up
|
|
111
|
+
unless `auth.email.enableConfirmations` is `false`; it used to confirm every sign-up at once, so
|
|
112
|
+
anyone could sign up with an address they do not own. Local dev still confirms at once.
|
|
113
|
+
* **auth:** the CLI no longer writes `SUPATYPE_MAILER_AUTOCONFIRM` into `.env`, so a value you set
|
|
114
|
+
there and restart with is kept, as the auth docs say; before, every start rewrote it from the
|
|
115
|
+
config. The line an earlier CLI wrote is taken out once, with a message saying so, and `init`
|
|
116
|
+
marks new projects so their own line is never taken out.
|
|
117
|
+
* **examples:** kitchen-sink, supabucks, framework-parity and expo-auth's web export run from a
|
|
118
|
+
plain `vite build` / `expo export` again: the page loads `/supatype-env.js` and the client reads
|
|
119
|
+
the anon key from it, so a build no longer shows a blank page after `dev` or `keys`, and never
|
|
120
|
+
ships the local stack's key. Each example's `.gitignore` now ignores `.env.*.local`.
|
|
121
|
+
* **keys:** an anon key written with no API URL in `.env` goes to `.env.development.local`, not
|
|
122
|
+
`.env`, so a plain production build no longer bakes the local stack's key.
|
|
123
|
+
* **realtime:** realtime no longer makes Postgres log six lines every 100 ms while nothing is
|
|
124
|
+
changing. It reads the replication slot only once the WAL has moved past it, so an idle stack
|
|
125
|
+
stopped writing about 0.8 GB of database log a day.
|
|
126
|
+
* **self-host:** every container in the self-host and Docker dev compose file now rotates its log
|
|
127
|
+
(json-file, 10 MB x 5 files), so a Linux server's disk no longer fills with container logs. Set
|
|
128
|
+
`SUPATYPE_LOG_MAX_SIZE` and `SUPATYPE_LOG_MAX_FILE` in `.env` to change the sizes.
|
|
129
|
+
* **gateway:** Docker dev and self-host now answer 400 to an API or Studio request whose path has an
|
|
130
|
+
empty, `.` or `..` part (`%2E` too), as native does. Kong used to resolve these first, so `x/../a`
|
|
131
|
+
wrote the storage object `a` and `/studio/../auth/v1/...` reached auth. Your app's own paths are
|
|
132
|
+
not checked and reach it as before.
|
|
133
|
+
* **client:** `createClient` drops a trailing `/` from its URL, so `https://api.example.com/` no
|
|
134
|
+
longer builds `//rest/v1/...`, which the gateway now refuses and native never routed.
|
|
135
|
+
* **storage:** a private bucket no longer tells a caller its read rule refuses which file names
|
|
136
|
+
exist: download, authenticated download and signing answer 403 for a missing name exactly as for
|
|
137
|
+
one that exists, where they used to answer 404 "Object not found" for a missing name. A caller the
|
|
138
|
+
rule lets read the name still gets 404 for one that is not there.
|
|
139
|
+
* **init, generate:** the Next.js `/supatype-env.js` route works on a new create-next-app. Next 16
|
|
140
|
+
turns on `cacheComponents`, which refuses the route's `export const dynamic` with a 500; the route
|
|
141
|
+
is now only `export { GET } from "@supatype/ssr/next"`, and `GET` reads the request, which keeps it
|
|
142
|
+
rendered per request (not prerendered with the build machine's values) on Next 14, 15 and 16.
|
|
143
|
+
`supatype generate`, which `prepare` runs on install, replaces a route 0.9.1 wrote while it is
|
|
144
|
+
unchanged, warns about a changed one that still has the line, and warns when the installed
|
|
145
|
+
`@supatype/ssr` is older than 0.9.2. The docs' server helper awaits `connection()`, so Next 16 no
|
|
146
|
+
longer logs a `Date.now()` prerender error, and says where to put it with or without `src/`.
|
|
147
|
+
* **realtime:** `channel(name).on("postgres_changes", { table })` and `useSubscription` now watch
|
|
148
|
+
the `public` schema when no `schema` is given, as the docs say. A channel name with a colon, such
|
|
149
|
+
as `post:42`, was read as `schema:table` even when the listener named its table, so the
|
|
150
|
+
subscription reported SUBSCRIBED and delivered nothing. The realtime server reads a subscribe
|
|
151
|
+
message the same way. The name is still read as `schema:table` when no table is given.
|
|
152
|
+
* **react:** `useQuery`'s `refetch`, `useAuth`'s sign-in and sign-out methods, and
|
|
153
|
+
`usePasswordRecovery`'s `finish` now keep the same identity across renders, so an effect can list
|
|
154
|
+
them as dependencies. A new function on every render made `useEffect(() => refetch(), [refetch])`
|
|
155
|
+
loop, sending thousands of requests a second and ending in "Maximum update depth exceeded".
|
|
156
|
+
* **init, dev:** `supatype dev` no longer starts itself as the app. In 0.9.1, `init` with "Local dev
|
|
157
|
+
server" and the script prompt left at its default wrote `app.start: "dev"`, and in a new folder
|
|
158
|
+
`dev` is init's own `supatype dev`, so dev ran a second copy in its app pane that failed and was
|
|
159
|
+
restarted for ever. `init` now asks about Vite first: a Vite app runs the `vite` script at Vite's
|
|
160
|
+
URL, with nothing more to ask. Without Vite it offers the project's own `dev` or `start`, never one
|
|
161
|
+
that runs `supatype dev`, and refuses any script that runs it. `dev` refuses such a script too, saying to
|
|
162
|
+
set `app.start`, so a project 0.9.1 made needs only that one edit. A `supatype dev` reached some
|
|
163
|
+
other way (`npm run supatype:dev`, `concurrently`) stops at once with the same advice, and the app
|
|
164
|
+
pane leaves it stopped.
|
|
165
|
+
* **dev:** a service that keeps crashing as it starts is no longer restarted every 30 seconds for
|
|
166
|
+
ever. After 5 crashes in a row, each within 5 seconds of its start, dev says so once and retries
|
|
167
|
+
less often, the wait doubling past 30 seconds, so a fix to what it needs is still picked up. Once
|
|
168
|
+
the wait would reach 5 minutes, about 8 minutes in, dev leaves it stopped and says to fix the
|
|
169
|
+
error and restart `supatype dev`. This covers the app, Studio, and on a native project the server,
|
|
170
|
+
PostgREST, realtime and storage. Realtime stopped this way is switched off at the gateway, as it
|
|
171
|
+
already was after a clean exit. A run that lasts longer starts the count over, and the wait
|
|
172
|
+
before the next restart goes back to 1 second instead of staying at the longest it reached.
|
|
173
|
+
|
|
174
|
+
## 0.9.1 (2026-11-09)
|
|
4
175
|
|
|
5
176
|
### Breaking Changes
|
|
6
177
|
|
|
@@ -19,21 +190,46 @@
|
|
|
19
190
|
run, and exit 1. They reached the stopped stack's API and failed with `Cannot reach` or a
|
|
20
191
|
missing `SERVICE_ROLE_KEY`. An API address named by `SUPATYPE_URL` or `SUPATYPE_API_URL` in
|
|
21
192
|
`.env`, a linked project's `functions invoke`, and a native project are unaffected.
|
|
22
|
-
* **
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
193
|
+
* **client:** `SupatypeError` is a class, and the one error type every `{ data, error }` result
|
|
194
|
+
carries, so `error instanceof Error` holds and `String(error)` reads the message instead of
|
|
195
|
+
`[object Object]`. The class the SDK throws, which was called `SupatypeError`, is now
|
|
196
|
+
`SupatypeCodedError` (still with a required `code` and a `helpUrl`), and its `statusCode` is
|
|
197
|
+
`status`. `PostgrestError`'s `details` and `hint` are absent rather than `null` when the server
|
|
198
|
+
gave none. The full entry is in the `@supatype/client` changelog.
|
|
199
|
+
|
|
200
|
+
**How to move from 0.9.0.** Two changes need action.
|
|
201
|
+
|
|
202
|
+
The error class (`@supatype/client`). Code that catches the SDK's thrown errors by class, builds
|
|
203
|
+
one, or reads `statusCode`, renames the class and the field. Code that only reads a result's
|
|
204
|
+
`error.message`, `code`, `status`, `field`, `hint` or `details` needs no change. A test comparing a
|
|
205
|
+
result's error with `toEqual` against a plain object compares `{ ...error }` instead, and a check
|
|
206
|
+
for `details === null` or `hint === null` checks for `undefined`.
|
|
207
|
+
|
|
208
|
+
```ts
|
|
209
|
+
// 0.9.0
|
|
210
|
+
import { SupatypeError } from "@supatype/client"
|
|
211
|
+
|
|
212
|
+
function report(e: unknown): void {
|
|
213
|
+
if (e instanceof SupatypeError) console.error(e.code, e.statusCode, e.helpUrl)
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
// 0.9.1
|
|
217
|
+
import { SupatypeCodedError } from "@supatype/client"
|
|
218
|
+
|
|
219
|
+
function report(e: unknown): void {
|
|
220
|
+
if (e instanceof SupatypeCodedError) console.error(e.code, e.status, e.helpUrl)
|
|
221
|
+
}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
`instanceof SupatypeError` now holds for every error the SDK throws and every result's error, so
|
|
225
|
+
use `SupatypeCodedError` when the code relies on `code` always being there or on `helpUrl`.
|
|
226
|
+
|
|
227
|
+
The local stack. `push`, `diff`, `seed` and the other commands above no longer start a stopped
|
|
228
|
+
stack. Start it first: `supatype dev` on a development machine (in another terminal, or before the
|
|
229
|
+
command), or `supatype self-host compose up -d` on a server. A CI job that ran `supatype push`,
|
|
230
|
+
`diff` or `seed` against a fresh runner brings the stack up as its own step before them, and checks
|
|
231
|
+
`seed`'s exit code 2 as well as 1. A job that reaches a linked project, passes `--connection`, or
|
|
232
|
+
sets `connection` in the config is unaffected.
|
|
37
233
|
|
|
38
234
|
### Features
|
|
39
235
|
|
|
@@ -104,57 +300,10 @@
|
|
|
104
300
|
summary prints no block. Many-to-many junction tables are listed too, as `post_tags (link)`, and
|
|
105
301
|
a link whose end reads it through its own read rule says what it denies and why
|
|
106
302
|
(`none (read denied: an end's read rule reads this link table)`).
|
|
107
|
-
|
|
108
303
|
* **push:** prints the same access block before it applies or asks to confirm, in a terminal and
|
|
109
304
|
with `--yes` alike.
|
|
110
|
-
|
|
111
305
|
* **dev:** after a push applies, prints the access lines it changed (`question none -> read`),
|
|
112
306
|
and nothing when no line changed.
|
|
113
|
-
|
|
114
|
-
* **push:** `--run-hooks` fires after-hooks for the rows a push's own data migrations rewrite (column
|
|
115
|
-
conversions, block moves, kind changes). Without it they are skipped, as seeds are. Against an
|
|
116
|
-
engine whose capabilities do not list `run_hooks`, the push stops before anything is sent.
|
|
117
|
-
|
|
118
|
-
* **init:** `supatype init <dir> --example <name>` starts from `examples/<name>` of the release
|
|
119
|
-
matching the CLI (`v<version>` on GitHub), with every `workspace:` dependency pinned to
|
|
120
|
-
`^<version>`. An unknown name is refused with the list of examples in that release, and so is an
|
|
121
|
-
example holding a file named with `..`, a backslash, a NUL, a leading drive (`C:`) or an absolute
|
|
122
|
-
path, or one that resolves outside the directory; nothing is written then. A colon anywhere in a
|
|
123
|
-
name is refused too, since on Windows `docs/a:b.md` writes a hidden stream of a file `docs/a`.
|
|
124
|
-
Such a name elsewhere in the repository does not stop an example. Schema snapshots are restored
|
|
125
|
-
with the same checks, and `push` refuses a schema file named in a way restore would refuse.
|
|
126
|
-
`supatype dev` warns instead and pushes without a snapshot, so it does not stop on every save.
|
|
127
|
-
* **seed:** `authUser: { connect: { id } }` on a relation to the auth user (`RelatedTo<SupatypeAuthUser>`)
|
|
128
|
-
writes the relation's key column. It failed with "`supatype:user` is not a model in this schema".
|
|
129
|
-
The generated `...Create` type still offers the key column (`auth_user_id`) rather than `authUser`;
|
|
130
|
-
that comes from the engine.
|
|
131
|
-
* **schema:** `Geo<"polygon">` and `Geo<"linestring">` compile to `GEOGRAPHY(POLYGON, 4326)` and
|
|
132
|
-
`GEOGRAPHY(LINESTRING, 4326)`. Every `Geo` field was a point whatever it said; a bare `Geo` still is.
|
|
133
|
-
* **keys:** `supatype keys` writes into `.env` when there is one, filling only the blank keys, as
|
|
134
|
-
`--write` did. `--print` only prints. `--write` still works, so scripts and docs written for 0.7.0
|
|
135
|
-
keep running. With no `.env` the keys are printed, with a line saying how to have them written.
|
|
136
|
-
`--print` with no secret anywhere exits 1 rather than printing keys signed with one it made up and
|
|
137
|
-
kept nowhere. `--print` checks the secret as writing does, since printed keys end up in a `.env`
|
|
138
|
-
all the same: at least 32 characters, and for a given one, no whitespace, `#` or quotes.
|
|
139
|
-
* **keys, self-host, init, dev:** one rule for the `JWT_SECRET` keys are signed with. `.env`'s always
|
|
140
|
-
wins. A shell `JWT_SECRET` is used only when `.env` has none, and is then written into `.env`; one
|
|
141
|
-
that differs from `.env`'s gets a single warning line saying `.env`'s is used, and is never
|
|
142
|
-
refused. Only a `keys --secret` that differs from `.env`'s is refused. Docker Compose reads the
|
|
143
|
-
shell ahead of `.env`, so every compose command now runs without the shell's `JWT_SECRET`,
|
|
144
|
-
`ANON_KEY` and `SERVICE_ROLE_KEY` when `.env` defines that name, and without a shell key the stack
|
|
145
|
-
would not accept under `.env`'s `JWT_SECRET` (another secret, another role, or expired):
|
|
146
|
-
`supatype dev` on docker with a different shell `JWT_SECRET` started services that refused every
|
|
147
|
-
key with 401. A shell key the stack accepts still fills a blank one. `push`, `status` and the
|
|
148
|
-
other commands calling the local stack follow the same rule, and send `.env`'s `SERVICE_ROLE_KEY`,
|
|
149
|
-
the name the stack is started with, and never a `SUPATYPE_SERVICE_ROLE_KEY` there. When a
|
|
150
|
-
`JWT_SECRET` is newly written into `.env` (given or generated), `keys` and `self-host compose up`
|
|
151
|
-
sign both keys again and say so, since keys already there cannot verify against it. A secret is
|
|
152
|
-
checked before anything is written: at least 32 characters, and for one written into `.env`, no
|
|
153
|
-
whitespace, `#` or quotes. `compose up` used to write keys signed with a short secret and then
|
|
154
|
-
refuse it, leaving keys that were never re-signed once the secret was fixed. `init` warns and
|
|
155
|
-
generates a secret when the shell's is unusable, and never exits mid-wizard over the keys.
|
|
156
|
-
* **keys, dev:** `NEXT_PUBLIC_SUPATYPE_ANON_KEY` is written beside the `VITE_`, `PUBLIC_` and
|
|
157
|
-
`EXPO_PUBLIC_` copies, and `NEXT_PUBLIC_SUPATYPE_URL` wherever the other URL copies are.
|
|
158
307
|
* **build:** `supatype build [--env <name>] [--allow-local] [-- <command...>]` runs the app's
|
|
159
308
|
production build (the package.json `build` script through the project's package manager, or the
|
|
160
309
|
command after `--`) with the deployment's API URL and anon key under every front-end name
|
|
@@ -296,7 +445,6 @@
|
|
|
296
445
|
generated files written. It stayed at "Services running." through every save: the renderer took
|
|
297
446
|
the console over once the dashboard was drawn, and the pane's filter dropped the access lines
|
|
298
447
|
besides.
|
|
299
|
-
|
|
300
448
|
* **dev, push:** a stack service that exits while the CLI waits for the API gateway stops the wait.
|
|
301
449
|
With the server container exited on a fatal config error, `supatype dev` sat at `Waiting for API
|
|
302
450
|
gateway...` for 120 s, failed naming the gateway's health, and then removed the containers, so
|
|
@@ -398,7 +546,6 @@
|
|
|
398
546
|
anon key now stops before building, listing what it tried (`--allow-local` takes a local
|
|
399
547
|
address). The install and build steps run through cmd.exe on Windows, where `npm` and `pnpm` could
|
|
400
548
|
not be started without it.
|
|
401
|
-
|
|
402
549
|
* **init, dev:** Windows no longer asks to let `supatype` through its firewall. Checking whether a
|
|
403
550
|
port was free bound it on every address (`0.0.0.0`), which Windows treats as a program wanting
|
|
404
551
|
network access, and it remembers the answer per program file, so it asked again after every CLI
|
|
@@ -417,6 +564,34 @@
|
|
|
417
564
|
pushing. Native dev also pushes one save at a time, as docker dev already did: a save made during
|
|
418
565
|
a push is pushed once that push is done. Every command that runs the engine runs it the same
|
|
419
566
|
way, with the same results and errors.
|
|
567
|
+
* **push:** a Docker push that applied the schema exits 0 when a step after it fails on the running
|
|
568
|
+
stack (its `up -d`, the gateway wait, the buckets or the first admin), warning `The schema was
|
|
569
|
+
applied, but a step after it failed` with the reason. A start that failed on a port another
|
|
570
|
+
program held made push exit 1 with the schema in.
|
|
571
|
+
* **push, diff, adopt, pull:** on a running stack these no longer run `docker compose up -d db`
|
|
572
|
+
before they reach its database. Every layout already publishes Postgres on the port the host
|
|
573
|
+
engine connects to, so the call had nothing to start, and could recreate the database container
|
|
574
|
+
when its definition had changed; with `overrides.engine` on a dev stack it could also move the dev
|
|
575
|
+
database port under a running database first. A running stack whose `db`
|
|
576
|
+
container has stopped is now refused with the "local stack isn't running" message rather than
|
|
577
|
+
having its database started.
|
|
578
|
+
|
|
579
|
+
## 0.9.0 (2026-11-04)
|
|
580
|
+
|
|
581
|
+
### Breaking Changes
|
|
582
|
+
|
|
583
|
+
* **hooks:** `AfterDeleteContext` has no `filter`. After-hooks are fed from the database's change log,
|
|
584
|
+
which records the rows a write changed rather than the request that changed them, so there is no
|
|
585
|
+
filter to give. `ctx.old` replaces it: the deleted rows themselves, as they were. A handler reading
|
|
586
|
+
`ctx.filter` in an `afterDelete` no longer compiles; read `ctx.old` instead.
|
|
587
|
+
|
|
588
|
+
### Features
|
|
589
|
+
|
|
590
|
+
* **push:** `--run-hooks` fires after-hooks for the rows a push's own data migrations rewrite (column
|
|
591
|
+
conversions, block moves, kind changes). Without it they are skipped, as seeds are. Against an
|
|
592
|
+
engine whose capabilities do not list `run_hooks`, the push stops before anything is sent.
|
|
593
|
+
|
|
594
|
+
### Bug Fixes
|
|
420
595
|
|
|
421
596
|
* **npm:** the CLI works in an app that installs React 19. npm hoisted the CLI's `ink` into the
|
|
422
597
|
app's `node_modules`, where it loaded the app's React rather than the CLI's own React 18, and
|
|
@@ -465,6 +640,68 @@
|
|
|
465
640
|
* **init:** in an existing package.json, `@supatype/cli` and `@supatype/types` go in
|
|
466
641
|
`devDependencies` as they do for a new project, and the `seed` script runs `supatype seed`. It ran
|
|
467
642
|
`tsx seed.ts`, which loads the seed module without calling it.
|
|
643
|
+
|
|
644
|
+
## 0.8.0 (2026-11-02)
|
|
645
|
+
|
|
646
|
+
### Breaking Changes
|
|
647
|
+
|
|
648
|
+
* **schema:** a `?` on a model field (`due?: string`) is refused, naming `Model.field` and saying to
|
|
649
|
+
write `Optional<>`. It read as nullable but compiled to a `NOT NULL` column.
|
|
650
|
+
* **generate:** `supatype generate --connection` is refused as an unknown option. Generate writes the
|
|
651
|
+
types from the schema file and never opened a database, so the option was accepted and ignored.
|
|
652
|
+
* **seed:** a seed file's `export const config = { transaction: ... }` is refused, and `transaction`
|
|
653
|
+
is gone from `SeedConfig`. It was validated and never sent: every seed file runs in a transaction
|
|
654
|
+
of its own (all of them in one with `--atomic`), and the engine cannot run one outside it. Any
|
|
655
|
+
other key `config` does not have (a misspelt `runonce`, say) is refused too, rather than ignored.
|
|
656
|
+
* **realtime:** the service's process entry is `dist/main.js`; `dist/index.js` only exports and no
|
|
657
|
+
longer starts a server, so an `overrides.realtime` naming `packages/realtime/dist/index.js` exits
|
|
658
|
+
at once. Point it at `packages/realtime/dist/main.js`.
|
|
659
|
+
|
|
660
|
+
### Features
|
|
661
|
+
|
|
662
|
+
* **init:** `supatype init <dir> --example <name>` starts from `examples/<name>` of the release
|
|
663
|
+
matching the CLI (`v<version>` on GitHub), with every `workspace:` dependency pinned to
|
|
664
|
+
`^<version>`. An unknown name is refused with the list of examples in that release, and so is an
|
|
665
|
+
example holding a file named with `..`, a backslash, a NUL, a leading drive (`C:`) or an absolute
|
|
666
|
+
path, or one that resolves outside the directory; nothing is written then. A colon anywhere in a
|
|
667
|
+
name is refused too, since on Windows `docs/a:b.md` writes a hidden stream of a file `docs/a`.
|
|
668
|
+
Such a name elsewhere in the repository does not stop an example. Schema snapshots are restored
|
|
669
|
+
with the same checks, and `push` refuses a schema file named in a way restore would refuse.
|
|
670
|
+
`supatype dev` warns instead and pushes without a snapshot, so it does not stop on every save.
|
|
671
|
+
* **seed:** `authUser: { connect: { id } }` on a relation to the auth user (`RelatedTo<SupatypeAuthUser>`)
|
|
672
|
+
writes the relation's key column. It failed with "`supatype:user` is not a model in this schema".
|
|
673
|
+
The generated `...Create` type still offers the key column (`auth_user_id`) rather than `authUser`;
|
|
674
|
+
that comes from the engine.
|
|
675
|
+
* **schema:** `Geo<"polygon">` and `Geo<"linestring">` compile to `GEOGRAPHY(POLYGON, 4326)` and
|
|
676
|
+
`GEOGRAPHY(LINESTRING, 4326)`. Every `Geo` field was a point whatever it said; a bare `Geo` still is.
|
|
677
|
+
* **keys:** `supatype keys` writes into `.env` when there is one, filling only the blank keys, as
|
|
678
|
+
`--write` did. `--print` only prints. `--write` still works, so scripts and docs written for 0.7.0
|
|
679
|
+
keep running. With no `.env` the keys are printed, with a line saying how to have them written.
|
|
680
|
+
`--print` with no secret anywhere exits 1 rather than printing keys signed with one it made up and
|
|
681
|
+
kept nowhere. `--print` checks the secret as writing does, since printed keys end up in a `.env`
|
|
682
|
+
all the same: at least 32 characters, and for a given one, no whitespace, `#` or quotes.
|
|
683
|
+
* **keys, self-host, init, dev:** one rule for the `JWT_SECRET` keys are signed with. `.env`'s always
|
|
684
|
+
wins. A shell `JWT_SECRET` is used only when `.env` has none, and is then written into `.env`; one
|
|
685
|
+
that differs from `.env`'s gets a single warning line saying `.env`'s is used, and is never
|
|
686
|
+
refused. Only a `keys --secret` that differs from `.env`'s is refused. Docker Compose reads the
|
|
687
|
+
shell ahead of `.env`, so every compose command now runs without the shell's `JWT_SECRET`,
|
|
688
|
+
`ANON_KEY` and `SERVICE_ROLE_KEY` when `.env` defines that name, and without a shell key the stack
|
|
689
|
+
would not accept under `.env`'s `JWT_SECRET` (another secret, another role, or expired):
|
|
690
|
+
`supatype dev` on docker with a different shell `JWT_SECRET` started services that refused every
|
|
691
|
+
key with 401. A shell key the stack accepts still fills a blank one. `push`, `status` and the
|
|
692
|
+
other commands calling the local stack follow the same rule, and send `.env`'s `SERVICE_ROLE_KEY`,
|
|
693
|
+
the name the stack is started with, and never a `SUPATYPE_SERVICE_ROLE_KEY` there. When a
|
|
694
|
+
`JWT_SECRET` is newly written into `.env` (given or generated), `keys` and `self-host compose up`
|
|
695
|
+
sign both keys again and say so, since keys already there cannot verify against it. A secret is
|
|
696
|
+
checked before anything is written: at least 32 characters, and for one written into `.env`, no
|
|
697
|
+
whitespace, `#` or quotes. `compose up` used to write keys signed with a short secret and then
|
|
698
|
+
refuse it, leaving keys that were never re-signed once the secret was fixed. `init` warns and
|
|
699
|
+
generates a secret when the shell's is unusable, and never exits mid-wizard over the keys.
|
|
700
|
+
* **keys, dev:** `NEXT_PUBLIC_SUPATYPE_ANON_KEY` is written beside the `VITE_`, `PUBLIC_` and
|
|
701
|
+
`EXPO_PUBLIC_` copies, and `NEXT_PUBLIC_SUPATYPE_URL` wherever the other URL copies are.
|
|
702
|
+
|
|
703
|
+
### Bug Fixes
|
|
704
|
+
|
|
468
705
|
* **functions serve:** a project with `functions/.env.local` serves again. The file was handed to
|
|
469
706
|
Deno as `--env-file <path>`, two arguments, and Deno takes the value only after `=`, so it ran
|
|
470
707
|
`.env.local` as the script and served nothing. `functions new` creates that file, so every project
|
|
@@ -485,27 +722,22 @@
|
|
|
485
722
|
sets. `init` scaffolds `SUPATYPE_SMTP_HOST=`, `SUPATYPE_RESEND_API_KEY=` and the rest blank, and
|
|
486
723
|
native `dev` applied `.env` over the config, so a project with its SMTP host or Resend key in the
|
|
487
724
|
config got the noop mailer and sent nothing. A value in `.env` still wins over the config.
|
|
488
|
-
|
|
489
725
|
* **app, status, functions serve:** the local gateway address follows `.env`. `app add` printed the
|
|
490
726
|
app URL, `status` the API URL, and `functions serve` gave functions `SUPATYPE_URL`, all on the
|
|
491
727
|
default port 18473 whatever `SUPATYPE_KONG_PORT` said, so after `dev` moved Kong to another port
|
|
492
728
|
they pointed at whichever stack held 18473. They now use `.env`'s `API_EXTERNAL_URL`, else
|
|
493
729
|
`SUPATYPE_KONG_PORT`, as `ctx.publicUrl` already did.
|
|
494
|
-
|
|
495
730
|
* **pull:** a uuid `id` column is drafted as `UUID`. Every one was drafted as `SupatypeAuthUserId`,
|
|
496
731
|
which declares the key to be an auth user's id; telling the two apart needs the schema of a foreign
|
|
497
732
|
key's table, which the engine does not report yet. A drafted model also names its table
|
|
498
733
|
(`tableName`) when its model name would not map back to it, as `HTTPLog` or `Orders` do, so a push
|
|
499
734
|
of the draft does not create a second, empty table.
|
|
500
|
-
|
|
501
735
|
* **plugins:** `plugins add` and `plugins list` no longer claim a plugin is in use. `add` said
|
|
502
736
|
"installed and registered" and `list` showed every compatible plugin as "active", but nothing in
|
|
503
737
|
Supatype loads plugins yet. Both now say the plugin is installed and that it is not loaded.
|
|
504
|
-
|
|
505
738
|
* **functions:** the scaffolded `functions/_shared/context.ts` says where `ctx.env` comes from: the
|
|
506
739
|
functions directory's `.env.local` (or `SUPATYPE_SHARED_ENV_FILE`), then `.env.<function>.local`,
|
|
507
740
|
which wins. It said `.env`, which is never read for it.
|
|
508
|
-
|
|
509
741
|
* **dev, functions serve:** the local functions router loads and guards handlers as the deployed
|
|
510
742
|
worker does. It accepted only `export default`, so a function exporting a named `handler`, which the
|
|
511
743
|
worker serves, failed to load locally; a module with neither answers its own route with an error
|
|
@@ -518,7 +750,6 @@
|
|
|
518
750
|
the key until `dev` restarts. The router reads it from a file in `.supatype/`, readable by its owner
|
|
519
751
|
only, rather than from the environment it takes the key out of. The file is removed when `dev` or
|
|
520
752
|
`functions serve` stops, Ctrl+C included, and each `functions serve` has a file of its own.
|
|
521
|
-
|
|
522
753
|
* **dev, functions serve:** native `dev` and `functions serve` run the functions worker the deployed
|
|
523
754
|
image runs (packages/functions-worker), not a router the CLI generated to copy its rules, so the
|
|
524
755
|
two can no longer drift: the copy had already differed on which exports it took, who got the
|
|
@@ -526,11 +757,9 @@
|
|
|
526
757
|
`~/.supatype/cache/functions-worker/`. Native `dev` now also serves model hooks from `hooks/`, as
|
|
527
758
|
the compose stack does, including in a project with hooks and no functions, and picks up a hook
|
|
528
759
|
added while it runs; `functions serve` picks up a function added while it runs.
|
|
529
|
-
|
|
530
760
|
* **functions:** `ctx.env` reads `.env.local` and `.env.<function>.local` with the CLI's own dotenv
|
|
531
761
|
parser, so `KEY="value"` is `value`, an inline ` # comment` is dropped and `export KEY=` is read,
|
|
532
762
|
as the CLI and compose read a `.env`. The worker kept the quotes and the comment.
|
|
533
|
-
|
|
534
763
|
* **dev (native):** runs the storage service (packages/storage) on this machine instead of the
|
|
535
764
|
server's built-in object store, so bucket rules, `maxSize`, `accept`, `access_mode`, caller rules
|
|
536
765
|
and image transforms are the ones a deployment enforces. Its objects live under
|
|
@@ -543,14 +772,12 @@
|
|
|
543
772
|
from a per-platform archive on the CDN (`storage/v<version>/`, signed like every component), or
|
|
544
773
|
`overrides.storage`; its port is `SUPATYPE_STORAGE_PORT` (default 8002). When it cannot start, dev
|
|
545
774
|
says so and the server's store answers as before.
|
|
546
|
-
|
|
547
775
|
* **self-host:** the compose stack serves functions from `functions.path`. The functions worker, the
|
|
548
776
|
server and the control plane were all told `/project/functions` whatever the config said, so a
|
|
549
777
|
project keeping its functions elsewhere had every one answer 404; hooks were likewise fixed at
|
|
550
778
|
`/project/hooks` rather than following `supatype.root`. A `functions.path` or `supatype.root`
|
|
551
779
|
outside the project directory is refused with a message saying why, since the stack mounts only
|
|
552
780
|
the project. `functions deploy` names the real directory instead of a fixed `functions/`.
|
|
553
|
-
|
|
554
781
|
* **dev, self-host, init:** Resend and SES settings reach the auth server. Native `dev` sent them as
|
|
555
782
|
`RESEND_API_KEY`, `RESEND_FROM` and `SES_FROM`, which the server does not read, docker `dev` sent
|
|
556
783
|
none of them, and the self-host compose file had no way to pass them, so `email.provider: "resend"`
|
|
@@ -559,12 +786,10 @@
|
|
|
559
786
|
passes them through from `.env`. `init` scaffolds the email settings under those names too, and
|
|
560
787
|
SMTP's as `SUPATYPE_SMTP_*`; the unprefixed `SMTP_HOST` and the rest it used to write were never
|
|
561
788
|
read either. Rename any of these already in a project's `.env`.
|
|
562
|
-
|
|
563
789
|
* **dev:** magic-link, confirmation, invite and recovery links in native `dev` open the auth
|
|
564
790
|
server's verify endpoint. They pointed at `http://localhost:<port>/verify` and 404'd: the external
|
|
565
791
|
URL ends in `/auth/v1`, and the server's default `/verify` replaced that path rather than adding to
|
|
566
792
|
it. Native `dev` now sets the same `/auth/v1/verify` paths the compose file does.
|
|
567
|
-
|
|
568
793
|
* **migrate:** restoring a migration's schema sources refuses a file that lands beside the project
|
|
569
794
|
under a path starting with the project's own (`/srv/app2/x.ts` for `/srv/app`). The check compared
|
|
570
795
|
string prefixes, so it took that file for one inside the project. The snapshot is now read by the
|
|
@@ -573,7 +798,6 @@
|
|
|
573
798
|
root itself (`./`) is refused rather than failing on write, and a name that only starts with two
|
|
574
799
|
dots (`..notes/x.ts`) is restored rather than refused. The backup taken before a restore copies
|
|
575
800
|
the files the snapshot overwrites, not the paths its manifest lists, which were never checked.
|
|
576
|
-
|
|
577
801
|
* **schema:** an `id: SupatypeAuthUserId` primary key under `create: Owner<"id">` (also inside `Any`
|
|
578
802
|
or `All`) no longer gets a `gen_random_uuid()` default. A random id names no user, and the default
|
|
579
803
|
kept the engine from defaulting the column to the caller, so an insert leaving `id` out was
|
|
@@ -661,20 +885,8 @@
|
|
|
661
885
|
* **init:** `supatype init` uses an exported `SUPATYPE_KONG_PORT` as the project's gateway port, in
|
|
662
886
|
`.env` and in what it prints, and the wizard does not ask for one. It chose its own port, so `.env`
|
|
663
887
|
and the "API on" line named a port the stack, which binds the shell's, never listened on.
|
|
664
|
-
* **push:** a Docker push that applied the schema exits 0 when a step after it fails on the running
|
|
665
|
-
stack (its `up -d`, the gateway wait, the buckets or the first admin), warning `The schema was
|
|
666
|
-
applied, but a step after it failed` with the reason. A start that failed on a port another
|
|
667
|
-
program held made push exit 1 with the schema in.
|
|
668
|
-
* **push, diff, adopt, pull:** on a running stack these no longer run `docker compose up -d db`
|
|
669
|
-
before they reach its database. Every layout already publishes Postgres on the port the host
|
|
670
|
-
engine connects to, so the call had nothing to start, and could recreate the database container
|
|
671
|
-
when its definition had changed; with `overrides.engine` on a dev stack it could also move the dev
|
|
672
|
-
database port under a running database first. A running stack whose `db`
|
|
673
|
-
container has stopped is now refused with the "local stack isn't running" message rather than
|
|
674
|
-
having its database started.
|
|
675
|
-
|
|
676
888
|
|
|
677
|
-
## 0.7.0
|
|
889
|
+
## 0.7.0 (2026-10-27)
|
|
678
890
|
|
|
679
891
|
Highlights: `adopt` takes what a push refuses, with `--key`, `--release` and `--reclaim`, and
|
|
680
892
|
declares adopted columns in the schema; push asks before restoring access changed outside Supatype,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// The oldest Node the published package runs on, checked before anything else loads.
|
|
2
|
+
//
|
|
3
|
+
// bin/supatype.js imports this first, so it runs before the rest of the starter. Installed from
|
|
4
|
+
// npm, Node runs only the starter, which downloads the compiled program (with global `fetch`, which
|
|
5
|
+
// Node 16 lacks) and starts it. Below the floor that failed with a message about `fetch` or a
|
|
6
|
+
// missing built-in module; this says what to install instead. The syntax is kept to what any Node
|
|
7
|
+
// that can load an ES module parses, and the imports to none, so an old Node reaches this line.
|
|
8
|
+
//
|
|
9
|
+
// 0.9.1 release test (RB7): keep `engines.node` in package.json at this floor. A higher one makes
|
|
10
|
+
// npm quietly install an old release that declares none on the Nodes in between.
|
|
11
|
+
|
|
12
|
+
export const NODE_FLOOR = 18
|
|
13
|
+
|
|
14
|
+
/** The line to print when Node `version` (as process.versions.node gives it) is too old, or null. */
|
|
15
|
+
export function nodeVersionRefusal(version) {
|
|
16
|
+
const major = parseInt(String(version).split(".")[0], 10)
|
|
17
|
+
if (major >= NODE_FLOOR) return null
|
|
18
|
+
return (
|
|
19
|
+
"Supatype's CLI needs Node.js " + NODE_FLOOR + " or later; this is Node.js " + version + ". " +
|
|
20
|
+
"Install a newer Node from https://nodejs.org"
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const refusal = nodeVersionRefusal(process.versions.node)
|
|
25
|
+
if (refusal !== null) {
|
|
26
|
+
console.error(refusal)
|
|
27
|
+
process.exit(1)
|
|
28
|
+
}
|
package/bin/supatype.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
// First, so a Node older than the package supports is told so before anything else loads or fails.
|
|
3
|
+
// This file is kept to syntax that Node parses as far back as it loads ES modules, and to built-in
|
|
4
|
+
// names without the `node:` prefix (which Node 12 and early 14 refuse), so the check gets to run.
|
|
5
|
+
import "./node-version.js"
|
|
6
|
+
import { existsSync } from "fs"
|
|
7
|
+
import { fileURLToPath } from "url"
|
|
4
8
|
|
|
5
9
|
// Installed from npm, this file sits under a `node_modules` directory and starts the compiled
|
|
6
10
|
// program for this machine (dist/cli-launcher.js says why). In the monorepo it runs the CLI's
|
|
@@ -22,7 +26,7 @@ const cli = new URL(installed ? "../dist/cli-launcher.js" : "../dist/cli.js", im
|
|
|
22
26
|
// A fresh clone of the monorepo has no dist until its first build. Only that case gets the hint:
|
|
23
27
|
// a module missing from inside a built dist is reported as it is.
|
|
24
28
|
function unbuilt(e) {
|
|
25
|
-
return e
|
|
29
|
+
return e != null && e.code === "ERR_MODULE_NOT_FOUND" && !existsSync(fileURLToPath(cli))
|
|
26
30
|
}
|
|
27
31
|
|
|
28
32
|
import(cli.href)
|
|
@@ -36,6 +40,6 @@ import(cli.href)
|
|
|
36
40
|
})
|
|
37
41
|
.then((m) => m.run())
|
|
38
42
|
.catch((e) => {
|
|
39
|
-
console.error(e
|
|
43
|
+
console.error(e != null && e.message !== undefined ? e.message : e)
|
|
40
44
|
process.exit(1)
|
|
41
45
|
})
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Who a process is, so `supatype dev` ends only what belongs to this project.
|
|
3
|
+
*
|
|
4
|
+
* 0.9.1 release test (FF22): before each start of the app, dev force-killed every listener on the
|
|
5
|
+
* app's port. Two projects proxying the same port each ended the other's dev server before every
|
|
6
|
+
* restart, and each saw its own app exit with code 1 and no error, every few seconds.
|
|
7
|
+
*/
|
|
8
|
+
/** What a process says about itself: its command line, and its working directory where known. */
|
|
9
|
+
export interface ProcessIdentity {
|
|
10
|
+
commandLine: string;
|
|
11
|
+
/** Not available on Windows without native code; the command line has to do there. */
|
|
12
|
+
cwd?: string;
|
|
13
|
+
}
|
|
14
|
+
/** The app dev runs: its directory, and the command line it is started with. */
|
|
15
|
+
export interface AppIdentity {
|
|
16
|
+
dir: string;
|
|
17
|
+
command: string;
|
|
18
|
+
}
|
|
19
|
+
/** A path as compared here: resolved, and on Windows with one separator and one case. */
|
|
20
|
+
export declare function comparable(path: string, win32: boolean): string;
|
|
21
|
+
/**
|
|
22
|
+
* True when the process belongs to the app in `appDir`: its command line or working directory is
|
|
23
|
+
* in it (a Vite run straight from the app's node_modules, or one a package manager shim left behind),
|
|
24
|
+
* or its command line is the very command dev runs for this app (a shell around `npm run dev`).
|
|
25
|
+
*/
|
|
26
|
+
export declare function belongsToApp(identity: ProcessIdentity, app: AppIdentity, win32?: boolean): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Whether each of `pids` belongs to the app (see {@link belongsToApp}). A process that has ended, or
|
|
29
|
+
* whose command line cannot be read, is left out. All of them are looked up at once, and off Windows
|
|
30
|
+
* the working directory is read only for a process its command line does not already place in the app.
|
|
31
|
+
*/
|
|
32
|
+
export declare function appOwnership(pids: readonly number[], app: AppIdentity): Promise<Map<number, boolean>>;
|
|
33
|
+
//# sourceMappingURL=port-holder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"port-holder.d.ts","sourceRoot":"","sources":["../../src/app/port-holder.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,iGAAiG;AACjG,MAAM,WAAW,eAAe;IAC9B,WAAW,EAAE,MAAM,CAAA;IACnB,sFAAsF;IACtF,GAAG,CAAC,EAAE,MAAM,CAAA;CACb;AAED,gFAAgF;AAChF,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,yFAAyF;AACzF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAE/D;AAaD;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,eAAe,EACzB,GAAG,EAAE,WAAW,EAChB,KAAK,GAAE,OAAsC,GAC5C,OAAO,CAIT;AAQD;;;;GAIG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAiB3G"}
|