unoverse 0.1.20 → 0.1.22
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/unoverse.mjs +5 -3
- package/operator/lib/start.sh +9 -0
- package/operator/lib/update.sh +28 -1
- package/operator/operator.sh +1 -1
- package/package.json +1 -1
package/bin/unoverse.mjs
CHANGED
|
@@ -48,6 +48,11 @@ const UNIVERSE = findUniverse();
|
|
|
48
48
|
|
|
49
49
|
// Everything the operator half owns. Listed here so an unknown command can say so,
|
|
50
50
|
// rather than the two CLIs disagreeing about what exists.
|
|
51
|
+
// NOTE: `update` is deliberately ABSENT. It always updates this CLI, wherever you are.
|
|
52
|
+
// It used to mean the universe when you happened to be standing in one, which is the
|
|
53
|
+
// same word pointing at two different objects, decided by your working directory. You
|
|
54
|
+
// type it to update the CLI far more often than to refresh a local universe's images,
|
|
55
|
+
// and that refresh now belongs to `start --pull`.
|
|
51
56
|
const OPERATOR_COMMANDS = new Set([
|
|
52
57
|
"start", "stop", "check", "logs", "deploy",
|
|
53
58
|
// kept working, not advertised
|
|
@@ -94,9 +99,6 @@ switch (cmd) {
|
|
|
94
99
|
break;
|
|
95
100
|
|
|
96
101
|
case "update": {
|
|
97
|
-
// In a universe, "update" means THAT UNIVERSE (pull images, restart), not this CLI.
|
|
98
|
-
// Same word, different object, decided by where you are standing.
|
|
99
|
-
if (UNIVERSE) operator(UNIVERSE, ["update", ...args]);
|
|
100
102
|
const r = spawnSync("npm", ["install", "-g", "unoverse@latest"], { stdio: "inherit" });
|
|
101
103
|
if (r.status === 0) {
|
|
102
104
|
const v = spawnSync("unoverse", ["-v"], { encoding: "utf8" }).stdout?.trim();
|
package/operator/lib/start.sh
CHANGED
|
@@ -41,6 +41,15 @@ cmd_start() {
|
|
|
41
41
|
echo "$docr_token" | docker login registry.digitalocean.com -u "$docr_token" --password-stdin >/dev/null 2>&1 || true
|
|
42
42
|
fi
|
|
43
43
|
|
|
44
|
+
# `start --pull` refreshes the images first. This is where refreshing a LOCAL universe
|
|
45
|
+
# lives now: `update` is the CLI's word and means only the CLI, wherever you type it.
|
|
46
|
+
# A server is refreshed by `unoverse deploy` from your machine, not on the box.
|
|
47
|
+
if [ "${1:-}" = "--pull" ]; then
|
|
48
|
+
info "Pulling the latest images..."
|
|
49
|
+
docker compose -f "$ROOT/docker-compose.yml" pull || { fail "Image pull failed"; exit 1; }
|
|
50
|
+
echo ""
|
|
51
|
+
fi
|
|
52
|
+
|
|
44
53
|
check_docker_file_sharing || exit 1
|
|
45
54
|
check_first_run
|
|
46
55
|
banner "Starting Unoverse Platform"
|
package/operator/lib/update.sh
CHANGED
|
@@ -7,6 +7,21 @@ cmd_update() {
|
|
|
7
7
|
echo ""
|
|
8
8
|
timer_start
|
|
9
9
|
|
|
10
|
+
# ── Refuse before doing half the job ───────────────────────────────────────────
|
|
11
|
+
# This used to run against an unconfigured folder with Docker down: compose warned
|
|
12
|
+
# about thirty blank variables, then failed on the daemon, after reporting that the
|
|
13
|
+
# code had updated. Ask first.
|
|
14
|
+
if [ ! -f "$ROOT/.env" ]; then
|
|
15
|
+
fail "This universe is not configured yet"
|
|
16
|
+
info "Run ${BOLD}unoverse init${NC} first"
|
|
17
|
+
exit 1
|
|
18
|
+
fi
|
|
19
|
+
if ! docker info >/dev/null 2>&1; then
|
|
20
|
+
fail "Docker is not running. Update pulls images, so it needs the daemon"
|
|
21
|
+
info "Start Docker Desktop, then run ${BOLD}unoverse update${NC} again"
|
|
22
|
+
exit 1
|
|
23
|
+
fi
|
|
24
|
+
|
|
10
25
|
# ── Developer work is SAFE, by design ──────────────────────────────────────────
|
|
11
26
|
# `update` refreshes the PLATFORM (its own tracked files) and NEVER touches a developer's
|
|
12
27
|
# own work. Custom nodes live as UNTRACKED files (apps/unoverse/nodes/<yours>) — `git reset
|
|
@@ -27,7 +42,18 @@ cmd_update() {
|
|
|
27
42
|
exit 1
|
|
28
43
|
fi
|
|
29
44
|
|
|
30
|
-
# Step 1: Code — pull from customer's fork
|
|
45
|
+
# Step 1: Code — pull from customer's fork.
|
|
46
|
+
#
|
|
47
|
+
# NOT EVERY UNIVERSE IS A GIT CLONE. `unoverse create` extracts a tarball, so there is
|
|
48
|
+
# no remote to pull from and never was. That is not a failure: the images carry the
|
|
49
|
+
# platform, and the files here are yours. Skip the step and say which mode you are in,
|
|
50
|
+
# rather than running git commands that all fail and then reporting "Code updated".
|
|
51
|
+
if ! git -C "$ROOT" rev-parse --git-dir >/dev/null 2>&1; then
|
|
52
|
+
info "Not a git checkout, so there is no code to pull. Updating images only"
|
|
53
|
+
UNOVERSE_SKIP_GIT=1
|
|
54
|
+
fi
|
|
55
|
+
|
|
56
|
+
if [ "${UNOVERSE_SKIP_GIT:-}" != "1" ]; then
|
|
31
57
|
printf " ${DIM}●${NC} Pulling latest code..."
|
|
32
58
|
local git_ok=true
|
|
33
59
|
local git_log
|
|
@@ -89,6 +115,7 @@ cmd_update() {
|
|
|
89
115
|
exit 1
|
|
90
116
|
fi
|
|
91
117
|
fi
|
|
118
|
+
fi # UNOVERSE_SKIP_GIT
|
|
92
119
|
|
|
93
120
|
# Step 2: Images — login to registry if DOCR_TOKEN is set
|
|
94
121
|
local docr_token
|
package/operator/operator.sh
CHANGED
|
@@ -57,7 +57,7 @@ source "$GRAVITY_LIB/ground.sh"
|
|
|
57
57
|
# operate a universe. Studio is a separate app; authoring happens there.)
|
|
58
58
|
case "${1:-}" in
|
|
59
59
|
init) cmd_init ;;
|
|
60
|
-
start) cmd_start ;;
|
|
60
|
+
start) shift; cmd_start "$@" ;;
|
|
61
61
|
stop) cmd_stop ;;
|
|
62
62
|
status) cmd_check ;; # alias — status merged into check 2026-07-28
|
|
63
63
|
logs) cmd_logs "${2:-}" ;;
|
package/package.json
CHANGED