unoverse 0.1.161 → 0.1.162

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.
Files changed (2) hide show
  1. package/bin/unoverse.mjs +18 -1
  2. package/package.json +1 -1
package/bin/unoverse.mjs CHANGED
@@ -116,10 +116,27 @@ switch (cmd) {
116
116
  // Those two steps run via `_postupdate` in the NEWLY installed binary, not this
117
117
  // process: this file is being replaced mid-command, and copying the skill from the
118
118
  // old install would pin it one release behind forever.
119
- const r = spawnSync("npm", ["install", "-g", "unoverse@latest"], { stdio: "inherit" });
119
+ // THE REGISTRY IS THE TRUTH, asked directly. `npm install unoverse@latest` resolves
120
+ // `latest` from npm's CACHED metadata, and that cache lags real releases by minutes:
121
+ // three updates in a row can install the same stale version while the registry has
122
+ // long moved on (observed live 2026-08-21, 0.1.160 served repeatedly with 0.1.161
123
+ // published). So update asks the registry itself which version is latest and installs
124
+ // THAT version by exact number with --prefer-online, which is immune to every layer
125
+ // of metadata cache. The registry being unreachable falls back to npm's own idea of
126
+ // latest, which is never worse than before.
127
+ let want = "";
128
+ try {
129
+ const doc = await (await fetch("https://registry.npmjs.org/unoverse", { headers: { accept: "application/vnd.npm.install-v1+json" } })).json();
130
+ want = doc?.["dist-tags"]?.latest ?? "";
131
+ } catch { /* registry unreachable: npm's latest is the best available answer */ }
132
+ const spec = want ? `unoverse@${want}` : "unoverse@latest";
133
+ const r = spawnSync("npm", ["install", "-g", spec, "--prefer-online"], { stdio: "inherit" });
120
134
  if (r.status === 0) {
121
135
  const v = spawnSync("unoverse", ["-v"], { encoding: "utf8" }).stdout?.trim();
122
136
  console.log(`\n ✓ unoverse is now ${v || "up to date"}`);
137
+ if (want && v && v !== want) {
138
+ console.log(` ⚠ the registry's latest is ${want}; npm delivered ${v}. Re-run in a minute, or: npm install -g unoverse@${want}`);
139
+ }
123
140
  spawnSync("unoverse", ["_postupdate"], { stdio: "inherit" });
124
141
  } else {
125
142
  // DO NOT GUESS THE CAUSE. This used to say "(permissions?)" whatever happened, so a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unoverse",
3
- "version": "0.1.161",
3
+ "version": "0.1.162",
4
4
  "description": "The Unoverse front door — create a Studio project, a universe, or a client app, and launch Studio.",
5
5
  "license": "SEE LICENSE IN README.md",
6
6
  "type": "module",