unoverse 0.1.3 → 0.1.4

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 -0
  2. package/package.json +1 -1
package/bin/unoverse.mjs CHANGED
@@ -19,6 +19,7 @@ const HELP = `
19
19
  unoverse create [name] What are you building? Studio project · universe · client app
20
20
  unoverse studio Launch Unoverse Studio (authoring: components, nodes, skills)
21
21
  unoverse urls Your deployed universe's addresses — probed live, not recited
22
+ unoverse update Update this CLI to the latest version
22
23
  unoverse help This
23
24
 
24
25
  Operating a running universe? That lives in your universe folder:
@@ -30,6 +31,23 @@ switch (cmd) {
30
31
  await create(args[0]);
31
32
  break;
32
33
 
34
+ case "update": {
35
+ // The command people type when the CLI is stale. Inside a universe folder,
36
+ // update means the OPERATOR kit — defer to it. Otherwise update this package.
37
+ if (existsSync("./unoverse")) {
38
+ console.log(`\n This folder is a universe — its own CLI owns updates:\n\n ./unoverse update\n`);
39
+ process.exit(1);
40
+ }
41
+ const r = spawnSync("npm", ["install", "-g", "unoverse@latest"], { stdio: "inherit" });
42
+ if (r.status === 0) {
43
+ const v = spawnSync("unoverse", ["-v"], { encoding: "utf8" }).stdout?.trim();
44
+ console.log(`\n ✓ unoverse is now ${v || "up to date"}\n`);
45
+ } else {
46
+ console.log(`\n ✗ global install failed (permissions?). Try:\n\n sudo npm install -g unoverse@latest\n npx unoverse@latest # or skip the global install entirely\n`);
47
+ }
48
+ process.exit(r.status ?? 0);
49
+ }
50
+
33
51
  case "urls": {
34
52
  const { urls } = await import("../lib/urls.mjs");
35
53
  await urls();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unoverse",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
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",