@tomorrowos/sdk 0.7.6 → 0.7.7
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 +68 -17
- package/package.json +1 -1
- package/templates/cms-starter/package.json +2 -2
package/REPLIT_SETUP.md
CHANGED
|
@@ -70,7 +70,7 @@ Allowed extras (optional): `"build-player": "tomorrowos build --platform tizen"`
|
|
|
70
70
|
"node": ">=20"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@tomorrowos/sdk": "^0.7.
|
|
73
|
+
"@tomorrowos/sdk": "^0.7.7",
|
|
74
74
|
"dotenv": "^17.2.3",
|
|
75
75
|
"tsx": "^4.19.0"
|
|
76
76
|
},
|
|
@@ -112,17 +112,58 @@ If the workspace already has a `.replit`, **merge** these keys — do not wipe u
|
|
|
112
112
|
|
|
113
113
|
### Publish readiness checklist (before telling the user “done”)
|
|
114
114
|
|
|
115
|
-
1.
|
|
116
|
-
2. `
|
|
117
|
-
3.
|
|
118
|
-
4.
|
|
119
|
-
5.
|
|
120
|
-
6.
|
|
121
|
-
7.
|
|
122
|
-
8.
|
|
115
|
+
1. Replit project type is **Web** (not API)
|
|
116
|
+
2. `package.json` has `scripts.start` = `tsx server.ts`
|
|
117
|
+
3. `tsx` is listed under `dependencies` (runtime-safe for Deploy)
|
|
118
|
+
4. Dependency is `@tomorrowos/sdk` (not a fork or vendored rewrite)
|
|
119
|
+
5. `.replit` Run + `[deployment].run` use `npm run start`
|
|
120
|
+
6. Node is **20+**
|
|
121
|
+
7. Preview at `/` shows the TomorrowOS Control Panel (not Canvas, not another app)
|
|
122
|
+
8. Stale processes / port conflicts cleared before publish
|
|
123
|
+
9. `npm run start` prints `[TomorrowOS] listening on http://0.0.0.0:...`
|
|
124
|
+
10. Browser WebSocket test to `wss://<host>/` succeeds
|
|
125
|
+
11. Secrets required by the Q&A answers are set (`SUPABASE_URL`, Cloudinary, etc.)
|
|
123
126
|
|
|
124
127
|
If any item fails, fix it before finishing.
|
|
125
128
|
|
|
129
|
+
### Preview requirements (Replit workspace)
|
|
130
|
+
|
|
131
|
+
The Replit **Preview** must show the **TomorrowOS Control Panel** at `/` (root URL).
|
|
132
|
+
|
|
133
|
+
- `GET /` must serve the CMS Control Panel (`public/index.html` via `staticRoot: public`).
|
|
134
|
+
- **Do not** serve another app, API-only landing page, or placeholder at `/`.
|
|
135
|
+
- **Do not** use or rely on the **Canvas** preview for this CMS — use the normal **Web** preview in the browser.
|
|
136
|
+
- If the preview is **empty** or shows the wrong thing:
|
|
137
|
+
1. Confirm the Replit project type is **Web**, not **API**.
|
|
138
|
+
2. Confirm `npm run start` is running and logs show `[TomorrowOS] listening on http://0.0.0.0:...`
|
|
139
|
+
3. Confirm `server.ts` calls `tomorrowos.listen({ staticRoot: join(__dirname, "public"), ... })`
|
|
140
|
+
4. Open the preview URL directly (not Canvas) and hard-refresh.
|
|
141
|
+
|
|
142
|
+
### Before publishing / deploying
|
|
143
|
+
|
|
144
|
+
Do this **before** clicking Publish / Deploy:
|
|
145
|
+
|
|
146
|
+
1. **Stop** stale running processes (old `tsx` / `node` servers from prior attempts).
|
|
147
|
+
2. **Clear** old background tasks from previous failed projects (Replit Shell / Processes panel).
|
|
148
|
+
3. **Ensure no old process is holding the port** (`EADDRINUSE` in logs = something still bound to `PORT`).
|
|
149
|
+
4. **Restart the Replit workspace** if the port is stuck or preview still shows a ghost app.
|
|
150
|
+
5. Run `npm run start` once cleanly and confirm Control Panel loads at `/` in preview.
|
|
151
|
+
|
|
152
|
+
### After publishing / deploying
|
|
153
|
+
|
|
154
|
+
Tell the user their live CMS URLs:
|
|
155
|
+
|
|
156
|
+
- **Control Panel (browser):** `https://YOUR-REPLIT-DOMAIN`
|
|
157
|
+
- **TV / player CMS endpoint:** same HTTPS origin, e.g. `https://YOUR-REPLIT-DOMAIN/` (player converts `https://` → `wss://` for WebSocket)
|
|
158
|
+
|
|
159
|
+
Replace `YOUR-REPLIT-DOMAIN` with the actual published hostname (e.g. `my-cms.replit.app`).
|
|
160
|
+
|
|
161
|
+
Verify after publish:
|
|
162
|
+
|
|
163
|
+
1. `https://YOUR-REPLIT-DOMAIN/` shows the Control Panel (not empty, not API docs).
|
|
164
|
+
2. `https://YOUR-REPLIT-DOMAIN/brand.json` returns 200.
|
|
165
|
+
3. WebSocket to `wss://YOUR-REPLIT-DOMAIN/` succeeds.
|
|
166
|
+
|
|
126
167
|
---
|
|
127
168
|
|
|
128
169
|
## Question 1 — How many screens / devices?
|
|
@@ -365,6 +406,8 @@ run = ["sh", "-c", "npm run start"]
|
|
|
365
406
|
|
|
366
407
|
### E. Install and run
|
|
367
408
|
|
|
409
|
+
**Before starting:** stop stale processes, clear old background tasks, free the port if needed, restart workspace if stuck.
|
|
410
|
+
|
|
368
411
|
```bash
|
|
369
412
|
npm install
|
|
370
413
|
npm run start
|
|
@@ -378,11 +421,14 @@ Confirm logs contain something like:
|
|
|
378
421
|
[TomorrowOS] listening on http://0.0.0.0:<PORT>
|
|
379
422
|
```
|
|
380
423
|
|
|
424
|
+
Confirm the **Web preview** (not Canvas) shows the Control Panel at `/`.
|
|
425
|
+
|
|
381
426
|
### F. Verify before telling the user “done”
|
|
382
427
|
|
|
383
|
-
1.
|
|
384
|
-
2.
|
|
385
|
-
3.
|
|
428
|
+
1. Replit project type is **Web**; preview at `/` shows Control Panel (not empty, not Canvas-only).
|
|
429
|
+
2. Open the Control Panel URL.
|
|
430
|
+
3. `GET /brand.json` → 200 and correct `name` / colours.
|
|
431
|
+
4. In browser console on the Control Panel origin:
|
|
386
432
|
|
|
387
433
|
```javascript
|
|
388
434
|
const ws = new WebSocket(location.origin.replace(/^http/, "ws") + "/");
|
|
@@ -390,17 +436,18 @@ ws.onopen = () => console.log("WS OK");
|
|
|
390
436
|
ws.onerror = (e) => console.log("WS ERR", e);
|
|
391
437
|
```
|
|
392
438
|
|
|
393
|
-
|
|
439
|
+
5. Confirm the **Publish readiness checklist** in **Runtime & Replit publish rules**.
|
|
394
440
|
|
|
395
441
|
If WebSocket fails, fix Run command / process crash / sleep **before** asking the user to pair a TV.
|
|
396
442
|
|
|
397
443
|
### G. Tell the user next steps (no code)
|
|
398
444
|
|
|
399
445
|
1. Keep this Repl **running** (Always On if available).
|
|
400
|
-
2.
|
|
401
|
-
3.
|
|
402
|
-
4.
|
|
403
|
-
5.
|
|
446
|
+
2. **Published Control Panel URL:** `https://YOUR-REPLIT-DOMAIN`
|
|
447
|
+
3. On the TomorrowOS player, enter the CMS URL: `https://YOUR-REPLIT-DOMAIN/`
|
|
448
|
+
4. Enter the 6-character pairing code from the screen into the Control Panel.
|
|
449
|
+
5. Create a playlist, upload media, Publish to the device.
|
|
450
|
+
6. Point them at `PLAYER_INSTALL.md` in the SDK for player install details.
|
|
404
451
|
|
|
405
452
|
---
|
|
406
453
|
|
|
@@ -421,6 +468,8 @@ Do **not**:
|
|
|
421
468
|
- Skip Cloudinary recommendation without stating the persistence tradeoff
|
|
422
469
|
- Claim uploads are “permanent” on Replit local disk without Object Storage or Cloudinary
|
|
423
470
|
- Leave `tsx` only in `devDependencies` if the Deploy pipeline installs production deps only
|
|
471
|
+
- Use Canvas preview as the primary CMS verification surface
|
|
472
|
+
- Serve a different app or API-only response at `/` instead of the Control Panel
|
|
424
473
|
|
|
425
474
|
---
|
|
426
475
|
|
|
@@ -446,9 +495,11 @@ TOMORROWOS_STORE=sqlite
|
|
|
446
495
|
|
|
447
496
|
| Symptom | Likely cause | Fix |
|
|
448
497
|
|---------|--------------|-----|
|
|
498
|
+
| Preview empty / wrong app at `/` | Project type API, wrong staticRoot, or stale process | Set project to **Web**; confirm `staticRoot: public`; stop old servers; restart workspace |
|
|
449
499
|
| TV / browser: WebSocket handshake timeout | Node CMS not running or crash-loop | Fix Run → `npm run start`; check logs for `listening` |
|
|
450
500
|
| Deploy/Publish fails / `tsx: not found` | `tsx` only in devDependencies | Move `tsx` to `dependencies`, reinstall, keep `start`: `tsx server.ts` |
|
|
451
501
|
| Deploy runs wrong process | `.replit` / Deployment not `npm run start` | Set `run = "npm run start"` and `[deployment] run = ["sh", "-c", "npm run start"]` |
|
|
502
|
+
| `EADDRINUSE` on start | Old process holding port | Stop stale processes, clear background tasks, restart Repl |
|
|
452
503
|
| Upload: `storage.objects.create` denied | Replit Object Storage IAM | Fix Object Storage permissions **or** switch to Cloudinary |
|
|
453
504
|
| Upload OK then thumbnails vanish later | Non-persistent `public/uploads` | Object Storage or Cloudinary |
|
|
454
505
|
| Supabase connection errors | Wrong URL or using reserved `DATABASE_URL` | Use `SUPABASE_URL` + `TOMORROWOS_STORE=supabase` |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tomorrowos/sdk",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.7",
|
|
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.7.
|
|
3
|
+
"version": "0.7.7",
|
|
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.7.
|
|
16
|
+
"@tomorrowos/sdk": "^0.7.7",
|
|
17
17
|
"dotenv": "^17.2.3",
|
|
18
18
|
"tsx": "^4.19.0"
|
|
19
19
|
},
|