@tomorrowos/sdk 0.9.6 → 0.9.8

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
@@ -230,7 +230,7 @@ Allowed extras (optional): `"build-player": "tomorrowos build --platform tizen"`
230
230
  "node": ">=20"
231
231
  },
232
232
  "dependencies": {
233
- "@tomorrowos/sdk": "^0.9.6",
233
+ "@tomorrowos/sdk": "^0.9.8",
234
234
  "dotenv": "^17.2.3",
235
235
  "tsx": "^4.19.0"
236
236
  },
@@ -1 +1 @@
1
- {"version":3,"file":"server-status.d.ts","sourceRoot":"","sources":["../src/server-status.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAExD,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAEjE,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,cAAc,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,IAAI,GAAG,UAAU,GAAG,SAAS,CAAC;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,eAAe,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAA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B7B"}
@@ -7,20 +7,30 @@ function isReplitHost(env) {
7
7
  env.REPLIT_DEPLOYMENT ||
8
8
  env.REPL_SLUG);
9
9
  }
10
+ /** Replit Preview/dev often cannot resolve Supabase hosts — not a config error. */
11
+ function isReplitPreviewDnsFailure(message) {
12
+ const m = String(message || "").toLowerCase();
13
+ return (m.includes("enotfound") ||
14
+ m.includes("getaddrinfo") ||
15
+ m.includes("eai_again") ||
16
+ m.includes("can't be resolved") ||
17
+ m.includes("cannot resolve") ||
18
+ m.includes("name or service not known"));
19
+ }
10
20
  function resolveDatabaseProvider(env) {
11
21
  const driver = String(env.TOMORROWOS_STORE || "").trim().toLowerCase();
12
22
  const hasUrl = !!(env.SUPABASE_URL || env.DATABASE_URL);
13
23
  if (driver === "supabase" || (!driver && env.SUPABASE_URL)) {
14
24
  return {
15
25
  provider: "supabase",
16
- label: "Supabase",
26
+ label: "Database",
17
27
  configured: !!env.SUPABASE_URL || !!env.DATABASE_URL
18
28
  };
19
29
  }
20
30
  if (driver === "postgres" || (!driver && hasUrl && !env.SUPABASE_URL)) {
21
31
  return {
22
32
  provider: "postgres",
23
- label: "Postgres",
33
+ label: "Database",
24
34
  configured: hasUrl
25
35
  };
26
36
  }
@@ -93,6 +103,17 @@ async function probeDatabase(store, env, timeoutMs) {
93
103
  }
94
104
  catch (err) {
95
105
  const message = err instanceof Error ? err.message : String(err);
106
+ if (isReplitHost(env) &&
107
+ wantsRemote &&
108
+ isReplitPreviewDnsFailure(message)) {
109
+ return {
110
+ id: "database",
111
+ label: meta.label,
112
+ provider: meta.provider,
113
+ state: "warn",
114
+ detail: "Replit Preview cannot verify this connection (DNS ENOTFOUND to Supabase is common in preview). Secrets are configured — confirm on the published live URL after Publish, not in Preview."
115
+ };
116
+ }
96
117
  return {
97
118
  id: "database",
98
119
  label: meta.label,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomorrowos/sdk",
3
- "version": "0.9.6",
3
+ "version": "0.9.8",
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.9.6",
3
+ "version": "0.9.8",
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.9.6",
16
+ "@tomorrowos/sdk": "^0.9.8",
17
17
  "dotenv": "^17.2.3",
18
18
  "tsx": "^4.19.0"
19
19
  },