@tomorrowos/sdk 0.8.1 → 0.8.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/REPLIT_SETUP.md CHANGED
@@ -12,7 +12,7 @@ When a human pastes a prompt like this, **read this file and start Question 1 im
12
12
  ```text
13
13
  Follow @tomorrowos/sdk REPLIT_SETUP.md and set up my TomorrowOS CMS.
14
14
  Ask only the questions listed in REPLIT_SETUP.md, in order. Do not use LLM_PROMPT.md.
15
- After all setup questions are answered (including Cloudinary Secrets if you chose Cloudinary), configure and start — minimal verification only (Web app type + Preview at /). No Supabase or WebSocket tests.
15
+ After all setup questions are answered (including Cloudinary Secrets if you chose Cloudinary), configure and start — minimal verification only (Web app type + Preview at /). **Never test Supabase connection** — save `SUPABASE_URL` and move on. No Supabase or WebSocket tests.
16
16
  Do not skip steps.
17
17
  ```
18
18
 
@@ -63,6 +63,7 @@ Then ask **Question 1** — do not switch to `LLM_PROMPT.md`.
63
63
  6. **Never commit secrets** into git. Put credentials only in Replit **Secrets** (and optionally mirror non-secret flags in `.env` that reference env vars).
64
64
  7. After Q&A, **configure and start** — do **not** run a long test suite (see **Post-Q&A: minimal verification only**).
65
65
  8. **Follow the Runtime & Replit publish rules below exactly.** A project that cannot Deploy / Publish on Replit is incomplete.
66
+ 9. **Supabase: configure only — never test.** Save `SUPABASE_URL` + `TOMORROWOS_STORE=supabase` and proceed. **Do not** ping Postgres, run `psql`, start the server solely to verify DB connectivity, or treat log errors like `ENOTFOUND` / `database connection failure` in **Replit dev / Preview** as a failed setup. Supabase often works only after **Publish** (production networking), not in the dev shell.
66
67
 
67
68
  **Question order after Q1:**
68
69
 
@@ -200,7 +201,7 @@ Allowed extras (optional): `"build-player": "tomorrowos build --platform tizen"`
200
201
  "node": ">=20"
201
202
  },
202
203
  "dependencies": {
203
- "@tomorrowos/sdk": "^0.8.1",
204
+ "@tomorrowos/sdk": "^0.8.2",
204
205
  "dotenv": "^17.2.3",
205
206
  "tsx": "^4.19.0"
206
207
  },
@@ -300,6 +301,22 @@ Replace `YOUR-REPLIT-DOMAIN` with the actual published hostname (e.g. `my-cms.re
300
301
 
301
302
  After Questions 1–4, **configure → `npm install` → `npm run start` → done.**
302
303
 
304
+ ### Supabase: never test in Replit dev (mandatory)
305
+
306
+ When the user chose Supabase (>5 screens), setup is **save credentials + wire `server.ts` + start** — **nothing else**.
307
+
308
+ **Forbidden after Q&A (and after Question 2):**
309
+
310
+ - ❌ “Testing Supabase connection…”
311
+ - ❌ `psql`, `pg`, Prisma `db pull`, or any one-off DB probe script
312
+ - ❌ Restarting / debugging the server **because** logs show `database connection failure`, `getaddrinfo ENOTFOUND`, or `db.*.supabase.co can't be resolved`
313
+ - ❌ Telling the user their Supabase URL is wrong **only** because dev Preview cannot resolve the host
314
+ - ❌ Blocking setup completion on Supabase connectivity
315
+
316
+ **Expected in Replit dev:** Supabase host may **not resolve** in the dev environment. That is **normal**. The Control Panel at `/` can still load. Mark setup **complete** when Web app type is correct and Preview shows the Control Panel — **even if** Supabase errors appear in logs.
317
+
318
+ **When Supabase actually gets validated:** after the user **Publishes** the Repl and uses the live URL — not during the setup wizard.
319
+
303
320
  ### Do (maximum)
304
321
 
305
322
  1. Confirm **Web app** artifact (not API) — **most important**.
@@ -310,7 +327,7 @@ After Questions 1–4, **configure → `npm install` → `npm run start` → don
310
327
 
311
328
  ### Do NOT run after setup (unless user asks or Publish fails)
312
329
 
313
- - ❌ **Supabase connection test** (no `psql`, no DB ping, no “testing Supabase connection…”)
330
+ - ❌ **Supabase connection test** — **never**, including after `npm run start` (no `psql`, no DB ping, no “verifying database…”, no retry loops for `ENOTFOUND`)
314
331
  - ❌ **Cloudinary upload test**
315
332
  - ❌ **`curl` / `fetch` on `/brand.json`** as a formal gate
316
333
  - ❌ **Browser WebSocket console snippet** as a formal gate
@@ -318,7 +335,7 @@ After Questions 1–4, **configure → `npm install` → `npm run start` → don
318
335
  - ❌ **Long troubleshooting loops** when Preview already shows the Control Panel
319
336
  - ❌ Re-running the full **Publish readiness checklist** item-by-item in chat
320
337
 
321
- If Preview shows the Control Panel and the project is **Web app** type, **stop testing** and give the user their URL and next steps.
338
+ If Preview shows the Control Panel and the project is **Web app** type, **stop testing** and give the user their URL and next steps — **even when using Supabase and dev logs show DB connection errors**.
322
339
 
323
340
  ### Only if Preview is empty or Publish fails
324
341
 
@@ -401,7 +418,7 @@ DATABASE_SSL=true
401
418
  ```
402
419
 
403
420
  5. **Do not** write the real password into committed files.
404
- 6. **Do not** test the Supabase connection after saving the Secret — configuration only.
421
+ 6. **Do not** test the Supabase connection after saving the Secret — **configuration only**. No probe, no `npm run start` just to verify DB, no fixing “connection failure” in dev. Saving `SUPABASE_URL` completes Question 2.
405
422
 
406
423
  If the user refuses Supabase but chose > 5 screens, warn them SQLite on Replit is fragile for fleets, then offer SQLite only after they confirm.
407
424
 
@@ -592,13 +609,13 @@ npm run start
592
609
 
593
610
  (Use `npm run dev` only for local edit/watch. **Publish / Deploy / Replit Run must use `npm run start`.**)
594
611
 
595
- **Minimal check:** logs contain `[TomorrowOS] listening on http://0.0.0.0:...` and Preview shows Control Panel at `/`. Then proceed to **G** — no further tests.
612
+ **Minimal check:** logs contain `[TomorrowOS] listening on http://0.0.0.0:...` and Preview shows Control Panel at `/`. Then proceed to **G** — no further tests. **Ignore** Supabase `ENOTFOUND` / `database connection failure` in dev logs; do not debug DB for that reason alone.
596
613
 
597
614
  ### F. Done — skip extended verification
598
615
 
599
616
  If the **three-item Publish readiness checklist** passes (especially **Web app, not API**), mark setup complete.
600
617
 
601
- **Do not** run WebSocket console tests, Supabase connection tests, or `brand.json` curl checks here.
618
+ **Do not** run WebSocket console tests, Supabase connection tests, or `brand.json` curl checks here. **Supabase `ENOTFOUND` in dev is not a setup failure** — tell the user DB will connect after Publish if needed.
602
619
 
603
620
  Only investigate further if Preview is empty, server crashed, or user reports Publish failure.
604
621
 
@@ -642,6 +659,7 @@ Do **not**:
642
659
  - Create the Repl as **API-only** or publish with **Static Deployment** only
643
660
  - Omit `[[ports]]` / `deploymentTarget` from `.replit` when setting up for Publish
644
661
  - Run **Supabase connection tests**, **WebSocket console tests**, or other post-setup smoke tests unless Preview fails or the user asks
662
+ - **Debug or “fix” Supabase** because dev logs show `getaddrinfo ENOTFOUND` or `database connection failure` — save config and finish setup instead
645
663
 
646
664
  ---
647
665
 
@@ -675,14 +693,17 @@ TOMORROWOS_STORE=sqlite
675
693
  | `EADDRINUSE` on start | Old process holding port | Stop stale processes, clear background tasks, restart Repl |
676
694
  | Upload: `storage.objects.create` denied | Replit Object Storage IAM | Fix Object Storage permissions **or** switch to Cloudinary |
677
695
  | Upload OK then thumbnails vanish later | Non-persistent `public/uploads` | Object Storage or Cloudinary |
678
- | Supabase connection errors | Wrong URL or using reserved `DATABASE_URL` | Use `SUPABASE_URL` + `TOMORROWOS_STORE=supabase` |
696
+ | Supabase `ENOTFOUND` / `can't be resolved` in **dev** logs after setup | Replit dev network cannot reach Supabase host | **Not a setup failure.** Finish wizard; user validates DB after **Publish** |
697
+ | Supabase connection errors on **published** URL | Wrong URL or using reserved `DATABASE_URL` | Use `SUPABASE_URL` + `TOMORROWOS_STORE=supabase`; pooler URL `*.pooler.supabase.com:6543` |
679
698
  | Pairing works on one Repl but not another | That Repl’s WS/backend only | Compare Run command and logs with a known-good Repl |
680
699
 
681
700
  ---
682
701
 
683
702
  ## Protocol version
684
703
 
685
- `replit-setup/1.5` — aligned with TomorrowOS protocol `1.0` and `@tomorrowos/sdk` store drivers `sqlite` | `supabase` | `postgres` | `memory`.
704
+ `replit-setup/1.6` — aligned with TomorrowOS protocol `1.0` and `@tomorrowos/sdk` store drivers `sqlite` | `supabase` | `postgres` | `memory`.
705
+
706
+ **Changelog 1.6:** **Never test Supabase** in Replit dev — `ENOTFOUND` / connection errors in Preview logs are expected; setup completes when Control Panel loads.
686
707
 
687
708
  **Changelog 1.5:** Cloudinary Secrets collected **inside Question 3** — no separate “3b” step; show Secrets form immediately when user picks Cloudinary.
688
709
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomorrowos/sdk",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
4
4
  "description": "TomorrowOS CMS server SDK - WebSocket transport, pairing, device commands, optional static CMS UI. Includes CLI (tomorrowos init / build) and starter templates.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "my-cms",
3
- "version": "0.8.1",
3
+ "version": "0.8.2",
4
4
  "description": "CMS server on @tomorrowos/sdk. Add your UI (React, static files, etc.) alongside this server.",
5
5
  "private": true,
6
6
  "type": "module",
@@ -13,7 +13,7 @@
13
13
  "build-player": "tomorrowos build --platform tizen"
14
14
  },
15
15
  "dependencies": {
16
- "@tomorrowos/sdk": "^0.8.1",
16
+ "@tomorrowos/sdk": "^0.8.2",
17
17
  "dotenv": "^17.2.3",
18
18
  "tsx": "^4.19.0"
19
19
  },