my-durable 0.0.13 → 0.0.14

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/bin/update.d.mts CHANGED
@@ -22,3 +22,5 @@ export function daemonControl(
22
22
  dpiPath: string,
23
23
  port: number,
24
24
  ): { running: () => Promise<boolean>; stop: () => Promise<number>; start: () => Promise<number> };
25
+ /** Below this the app cannot run at all (node:sqlite). The only hard block. */
26
+ export const REQUIRED_NODE_FLOOR: string;
package/bin/update.mjs CHANGED
@@ -31,6 +31,12 @@ export function compareVersions(a, b) {
31
31
  return 0;
32
32
  }
33
33
 
34
+ /**
35
+ * The floor we KNOW breaks: below 22.5.0 there is no node:sqlite, and the
36
+ * device dies at boot. This — and only this — is a hard block.
37
+ */
38
+ export const REQUIRED_NODE_FLOOR = "22.5.0";
39
+
34
40
  /**
35
41
  * Does `current` satisfy `required` when required looks like ">=22.19.0" /
36
42
  * ">=22" / "22.x"? Only the forms our own package.json can carry are supported;
@@ -94,15 +100,22 @@ export async function runUpdate(deps) {
94
100
  return 0;
95
101
  }
96
102
 
97
- // Refuse before touching npm: a warned-about engine is a broken install later.
103
+ // pi's philosophy, which we follow: engines metadata is ADVICE. pi declares
104
+ // node >=22.19.0 too, npm only warns, and nothing enforces it at runtime —
105
+ // so an update proceeds with a visible warning. We hard-block ONLY below the
106
+ // floor we know is broken (no node:sqlite ⇒ the device cannot even boot).
98
107
  const required = pkg.engines?.node;
99
- if (required && !satisfiesEngine(deps.nodeVersion, required)) {
108
+ if (compareVersions(deps.nodeVersion, REQUIRED_NODE_FLOOR) < 0) {
100
109
  printErr(
101
- `dpi update: this release needs Node ${required}, you have ${deps.nodeVersion}.`,
110
+ `dpi update: Node ${deps.nodeVersion} is too old — durable needs Node >= ${REQUIRED_NODE_FLOOR} (node:sqlite).`,
102
111
  );
103
- printErr(" Upgrade Node first (nvm install --lts / winget upgrade OpenJS.NodeJS.LTS), then retry.");
112
+ printErr(" Upgrade Node (nvm install --lts / winget upgrade OpenJS.NodeJS.LTS) and retry.");
104
113
  return 1;
105
114
  }
115
+ if (required && !satisfiesEngine(deps.nodeVersion, required)) {
116
+ print(`note: this release declares Node ${required}, you have ${deps.nodeVersion}.`);
117
+ print(` like pi, it installs and runs anyway; upgrade Node if anything misbehaves.`);
118
+ }
106
119
 
107
120
  // Windows: the daemon (and a TUI) hold files inside the package folder, so npm
108
121
  // cannot rename it. Stop the daemon, install, then bring it back.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "my-durable",
3
- "version": "0.0.13",
3
+ "version": "0.0.14",
4
4
  "description": "Durable Pi \u2014 the durable agent network: hub web UI, device backend daemon, TUI admin and the shared SDK, packaged as one runnable monorepo install",
5
5
  "license": "MIT",
6
6
  "repository": {