unoverse 0.1.95 → 0.1.97

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.
@@ -1,7 +1,20 @@
1
1
  #!/usr/bin/env bash
2
2
  # Shared colors, helpers, and constants
3
3
 
4
- GRAVITY_VERSION="1.0.0"
4
+ # THE VERSION IS THE CLI'S, READ FROM IT. This was the literal "1.0.0", hardcoded when the
5
+ # operator was a script in a repo and never touched again — so `unoverse help` announced
6
+ # v1.0.0 while the published CLI was on 0.1.95, and the one number a developer uses to say
7
+ # which version they are running was wrong by two hundred releases.
8
+ #
9
+ # THE MONOREPO PATH IS TRIED FIRST, and the order matters. Two levels up from scripts/lib
10
+ # is the PLATFORM's package.json, which is genuinely 1.0.0 — so looking there first found a
11
+ # real version that was not this CLI's, and reported it confidently. packages/cli exists
12
+ # only in the monorepo; published, that path misses and the package's own is two levels up.
13
+ GRAVITY_VERSION=$(
14
+ node -p "require('$GRAVITY_LIB/../../packages/cli/package.json').version" 2>/dev/null \
15
+ || node -p "require('$GRAVITY_LIB/../../package.json').version" 2>/dev/null \
16
+ || echo "unknown"
17
+ )
5
18
  DOCR_REGISTRY="registry.digitalocean.com"
6
19
 
7
20
  # Colors
@@ -541,13 +541,30 @@ cmd_deploy() {
541
541
  # ── ONE FLOW ────────────────────────────────────────────────────────────────
542
542
  # Which ground, is it configured, plan it, apply it, ship it. In that order, every
543
543
  # time, whether this is the first deploy or the fiftieth.
544
- # A named ground wins; one configured ground is implied; two without a name is refused
545
- # (see _pick_ground). Nothing configured at all falls through to creating one below,
546
- # which is the first-run path and the only case where an empty answer is not a mistake.
547
- local cloud="" rc have=0
548
- [ -f "$ROOT/infra/digitalocean/terraform.tfvars" ] || [ -f "$ROOT/infra/aws/terraform.tfvars" ] && have=1
549
- if [ "$have" = "1" ]; then
550
- cloud=$(SELF_CMD="unoverse deploy" _pick_ground "${GROUND_ARG:-}") || exit 1
544
+ # NAMING A GROUND THAT DOES NOT EXIST YET MEANS BUILD IT THERE. `unoverse deploy aws` on a
545
+ # universe with only a DigitalOcean ground used to answer "No aws ground here. Run
546
+ # unoverse deploy aws to create one" the command just typed, refusing itself. Those
547
+ # words already say where this should go, so the only thing left to do is set it up.
548
+ #
549
+ # A named ground with no tfvars falls through to the create flow below and skips the
550
+ # "which cloud?" question, because it has been answered. An UNNAMED deploy still goes
551
+ # through _pick_ground, which refuses to guess between two configured grounds.
552
+ local cloud="" rc
553
+ case "${GROUND_ARG:-}" in
554
+ do|digitalocean) cloud="digitalocean" ;;
555
+ aws|amazon) cloud="aws" ;;
556
+ esac
557
+
558
+ if [ -n "$cloud" ]; then
559
+ # Named. Configured already? Then use it; otherwise create it below.
560
+ [ -f "$ROOT/infra/$cloud/terraform.tfvars" ] || { cmd_ground "$([ "$cloud" = "aws" ] && echo aws || echo do)" || {
561
+ echo ""
562
+ info "Once that is sorted, run ${BOLD}unoverse deploy $cloud${NC} again. It picks up right here."
563
+ echo ""
564
+ exit 1
565
+ }; }
566
+ elif [ -f "$ROOT/infra/digitalocean/terraform.tfvars" ] || [ -f "$ROOT/infra/aws/terraform.tfvars" ]; then
567
+ cloud=$(SELF_CMD="unoverse deploy" _pick_ground "") || exit 1
551
568
  fi
552
569
 
553
570
  if [ -z "$cloud" ]; then
@@ -25,8 +25,13 @@ cmd_help() {
25
25
  # THE ARGUMENT IS ON THE LINE, not in a footnote. It read as a special case for people
26
26
  # with two clouds; it is simply how the command is shaped. A cloud is optional when only
27
27
  # one ground exists and required when two do.
28
- echo -e " ${GREEN}deploy${NC} Ship it to a server ${DIM}· aws or digitalocean${NC}"
29
- echo -e " ${GREEN}destroy${NC} Take it down ${DIM}· aws or digitalocean, shows what goes and what stays${NC}"
28
+ # SHOW THE COMMAND, not a description of it. "aws or digitalocean" told a reader the
29
+ # clouds exist without telling them what to type, so the shape of the command still had
30
+ # to be guessed. Print the line they will actually run.
31
+ echo -e " ${GREEN}deploy${NC} Ship it to a server ${DIM}(first run asks which cloud)${NC}"
32
+ echo -e " ${DIM}unoverse deploy aws · unoverse deploy digitalocean${NC}"
33
+ echo -e " ${GREEN}destroy${NC} Take it down ${DIM}(shows what goes, and what stays)${NC}"
34
+ echo -e " ${DIM}unoverse destroy aws · unoverse destroy digitalocean${NC}"
30
35
  echo -e " ${GREEN}db-allow${NC} Let this machine reach the database ${DIM}(run it when you change network)${NC}"
31
36
  echo ""
32
37
  # Owner-only lane. Printed ONLY when publish.sh is present, so a starter kit never
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "unoverse",
3
- "version": "0.1.95",
3
+ "version": "0.1.97",
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",