@bitmagic/cli 0.1.53-dev.4 → 0.1.53-dev.5

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/README.md CHANGED
@@ -49,6 +49,9 @@ npm install -g @bitmagic/cli
49
49
  bitmagic --version
50
50
  ```
51
51
 
52
+ That is the only time you need npm. From then on, `bitmagic self-update` updates the CLI — see
53
+ [Staying current](#staying-current) for why the npm line is the wrong tool for the second install.
54
+
52
55
  ### The dev line
53
56
 
54
57
  ```bash
@@ -61,9 +64,10 @@ installs the unreleased build the Bitmagic team and external testers run — a p
61
64
  production, so a CLI that uses them has to be installable before it is released. Pair it with
62
65
  `bitmagic login --env dev`.
63
66
 
64
- `npm install -g @bitmagic/cli` puts you back on the release at any time. One global install is a
65
- single `bitmagic` on your PATH, so `bitmagic --version` is how you tell which line you are on: a
66
- `-dev.N` suffix means the dev line. To have both at once, see below.
67
+ `bitmagic self-update --tag latest` puts you back on the release at any time, and `--tag dev` takes
68
+ you the other way. One global install is a single `bitmagic` on your PATH, so `bitmagic --version`
69
+ is how you tell which line you are on: a `-dev.N` suffix means the dev line. To have both at once,
70
+ see below.
67
71
 
68
72
  ### Running both lines side by side
69
73
 
@@ -113,6 +117,11 @@ env=local
113
117
  apiUrl=http://localhost:3102
114
118
  ```
115
119
 
120
+ `bitmagic self-update` works inside this setup unchanged: it reinstalls into the root the
121
+ `bitmagic` you just ran came from, with the same `--global-dir` and `--global-bin-dir`, so updating
122
+ from `dev-games/` cannot disturb the prod root. (Running `pnpm add -g` by hand would, unless you
123
+ repeat both flags.)
124
+
116
125
  `direnv allow` each, and both halves are right in each tree:
117
126
 
118
127
  ```
@@ -189,6 +198,7 @@ browser reloads itself on every change and the assets panel shows each generatio
189
198
  | `bitmagic verify [--timeout <ms>] [--renderer webgpu\|webgl] [--platform desktop\|mobile\|both] [--fast] [--watch]` | Build, boot the game in a headless browser, press the engine's Play button like a player would, and report what broke. A game without the button passes as long as gameplay starts by itself (auto-starting genres, custom start UIs); a run where gameplay never starts fails. The settle is adaptive: the run ends as soon as the live engine proves stable gameplay (state, rendered frames, no fresh errors, player standing), with `--timeout` as the cap. The verdict includes live engine state — actual GPU backend, fps, player position, physics body count, gameplay events (see **Gameplay events** below) — recorded in `result.json`. `--renderer` pins the pipeline (default `webgpu`, what players run; a silent WebGPU→WebGL2 fallback **fails** the run, and `--renderer webgl` is the deliberate escape hatch). A run failing on a lost WebGL context retries once on software rendering automatically. `--fast` skips the screenshot pipeline (then there is no thumbnail candidate from this run). `--watch` keeps everything warm — incremental `tsc --watch`, one vite, one browser — and re-verifies on file change in seconds; `--fast` is the watch default (`--no-fast` restores the screenshot). `--platform` picks what the run emulates — see **Verifying the mobile path** below. Every run also reports the engine's mobile-parity check: a desktop action with no touch button is a warning, and a **failure** when `game.json` declares `primaryPlatform: "mobile"`. Writes the artifacts the publish gate reads (see below). |
190
199
  | `bitmagic build` | Bundle the game into one self-contained `.bitmagic/build/index.html`. Rarely needs to be run by hand — `publish` builds automatically when the project changed. |
191
200
  | `bitmagic publish [--visibility public\|private] [--name <name>] [--description <desc>] [--force] [--no-qr]` | Verify-gate, build if needed, and upload straight to GCS. **Keeps the game's current visibility**; a new game is private until published with `--visibility public`. Draws the published URL as a QR code so you can scan it onto a phone; `--no-qr` skips that. |
201
+ | `bitmagic self-update [--tag latest\|dev]` | Update the **CLI itself** to the newest build of its line, installing into the place this CLI actually lives rather than wherever the `npm` on your `PATH` would put it — which under nvm is routinely somewhere else. Reads the project's line from `bitmagic.json` when there is one, so it also fixes a wrong-line install; `--tag` overrides. Verifies the version on disk moved, and refuses (naming the path) for an `npx` run, a source checkout, or an install shape it cannot recognise. Not to be confused with `upgrade`, which is about the project's engine. |
192
202
  | `bitmagic upgrade [--engine <version>] [--force]` | Refresh vendored platform files and the CLI's own skills to the currently published engine. Refuses a dirty git tree unless `--force`. Also records the project's `environment` in `bitmagic.json` if it has none yet — the engine it just vendored came from that api-server — and says so when it does. |
193
203
  | `bitmagic generate <skybox\|background\|block-type\|sound\|image\|character\|animation\|model\|prop\|vehicle> ...` | Generate one asset directly into `src/work/world.json`. Costs sparks. `model` mints a **new** 3D object from a prompt, `prop` upgrades an existing placeholder **in place**, `vehicle` adds a new drivable one, `animation` takes a parameter spec rather than a prompt, `block-type` registers a custom voxel block — see below. `skybox` and `background` write the **same** field: pick one. |
194
204
  | `bitmagic assets add <file> [--name <n>] [--asset-id <id>] [--keep-glb] [--voxel-size <m>] [--max-voxel-size <m>] [--height <m>] [--hollow\|--solid] [--force]` | Upload **your own** file — `.glb`, `.vxl`, `.png/.jpg/.webp`, `.opus/.ogg/.m4a/.mp3`, `.json` — into the game's assets and write its entry into `src/work/world.json`. A `.glb` is voxelized in a headless browser (Chrome + a free port in 3000–3199, like `prop`) unless `--keep-glb`. Free — no sparks. See **Adding your own assets** below. |
@@ -735,7 +745,7 @@ is, so shipping an update to a public game leaves it public. You only need `--vi
735
745
  want to *change* something: `public` to list it, `private` to take it out of service.
736
746
 
737
747
  **Managing a published game** — changing its visibility, or taking it down for good — happens on
738
- the web, at the **My games** page `publish` prints a link to (`bitmagic.ai/my-games.html`). It is
748
+ the web, at the **My games** page `publish` prints a link to (`bitmagic.ai/my-games/`). It is
739
749
  the same page web-lane creators use, so there is one place to manage a game regardless of how it
740
750
  was built. Withdrawing a game there unlists it and frees any custom `/play/` address; it does not
741
751
  touch your project, and you can publish it again afterwards.
@@ -904,7 +914,39 @@ no check was made — which is not the same as "no update"), and `legacyAssetsRe
904
914
 
905
915
  ## Staying current
906
916
 
907
- Three nudges, all advisory — nothing is ever blocked because something is out of date.
917
+ ```bash
918
+ bitmagic self-update
919
+ ```
920
+
921
+ updates the CLI itself. Use it rather than `npm install -g @bitmagic/cli`, which is only for the
922
+ first install — see [Why self-update and not npm](#why-self-update-and-not-npm) below.
923
+
924
+ It installs into the exact place this CLI is already installed, on the line it is already on. Inside
925
+ a project it uses that project's line instead (`environment` in `bitmagic.json`), so running it in a
926
+ `dev` project from a release build crosses you over; `--tag dev` / `--tag latest` overrides both. It
927
+ reads back the version on disk afterwards and fails if it did not move, so a successful-looking
928
+ update that changed nothing is reported rather than believed.
929
+
930
+ It refuses, with the path it looked at, when there is nothing for it to do: a run through `npx`
931
+ (nothing is installed), a source checkout (`git pull` and rebuild), or an install shape it does not
932
+ recognise — it will not guess at where to write.
933
+
934
+ ### Why self-update and not npm
935
+
936
+ `npm install -g @bitmagic/cli` installs into whichever Node the `npm` on your `PATH` belongs to,
937
+ which is not necessarily the one this CLI is installed in. Under a version manager — nvm, fnm,
938
+ Volta — those two are routinely different, and a coding agent's non-interactive shell makes it
939
+ worse: it sources no profile, so nvm never loads and `npm` is whatever else is on the system path.
940
+ The install then succeeds, into a prefix nothing on your `PATH` points at, and `bitmagic --version`
941
+ never moves. The same applies to the two-root pnpm setup below, where a bare `npm i -g` writes to a
942
+ third place entirely.
943
+
944
+ `self-update` resolves its own install from the Node binary running it, so it cannot be aimed
945
+ anywhere else.
946
+
947
+ ### The nudges
948
+
949
+ Three, all advisory — nothing is ever blocked because something is out of date.
908
950
 
909
951
  - **The CLI itself.** Commands print a line when a newer `@bitmagic/cli` is on npm. The check reads
910
952
  a cache written by an earlier run, so it costs no time; the cache refreshes in the background at
@@ -912,15 +954,17 @@ Three nudges, all advisory — nothing is ever blocked because something is out
912
954
  every merge to `main` and can move several times an hour, so an older answer there is usually
913
955
  about a build several versions back. It asks about the line you are actually on — a build
914
956
  installed from `@dev` asks the `dev` dist-tag and hears about the next dev build, rather than
915
- being told the production release is "newer" and it names the install command for that line. An
916
- unreachable registry, a first-ever run, and a version with no recognisable numeric core all stay
917
- quiet.
957
+ being told the production release is "newer". An unreachable registry, a first-ever run, and a
958
+ version with no recognisable numeric core all stay quiet. `bitmagic dev` also shows it as a
959
+ banner in the browser, because that command runs for hours and the terminal line scrolls away.
918
960
  - **The CLI, after an engine bump.** When `bitmagic upgrade` actually moves the engine version, it
919
961
  asks npm there and then instead of trusting that cache — which can be a whole interval stale, and
920
962
  so silent about the CLI published alongside the engine you just vendored. The CLI and the engine
921
963
  ship together, so a newer engine can need build config or a command only the newer CLI has, and
922
- finding that out as a failed `bitmagic build` is worse than being told here. No request is made when the
923
- engine version did not change, and an unreachable registry costs the hint and nothing else.
964
+ finding that out as a failed `bitmagic build` is worse than being told here. It names the line the
965
+ *project* is on rather than the one you happen to be running, so it says `bitmagic self-update
966
+ --tag dev` where that is the crossing you need. No request is made when the engine version did not
967
+ change, and an unreachable registry costs the hint and nothing else.
924
968
  - **The vendored engine.** `bitmagic dev` and `bitmagic publish` say when a newer engine exists and
925
969
  suggest `bitmagic upgrade`. Publishing is never refused for an old engine — the prompt belongs
926
970
  where rebuilding is cheap, not at the moment you ship.
package/dist/cli.d.ts CHANGED
@@ -176,6 +176,16 @@ declare const rawCommands: {
176
176
  readonly description: "Print the result as JSON on stdout; all progress goes to stderr.";
177
177
  };
178
178
  }>;
179
+ 'self-update': CommandDef<{
180
+ readonly tag: {
181
+ readonly type: "string";
182
+ readonly description: string;
183
+ };
184
+ readonly json: {
185
+ readonly type: "boolean";
186
+ readonly description: "Print the result as JSON on stdout; all progress goes to stderr.";
187
+ };
188
+ }>;
179
189
  check: CommandDef<{
180
190
  readonly json: {
181
191
  readonly type: "boolean";
package/dist/cli.js CHANGED
@@ -13,6 +13,7 @@ import { allowanceCommand } from './commands/allowance.js';
13
13
  import { subscribeCommand } from './commands/subscribe.js';
14
14
  import { initCommand } from './commands/init.js';
15
15
  import { upgradeCommand } from './commands/upgrade.js';
16
+ import { selfUpdateCommand } from './commands/self-update.js';
16
17
  import { checkCommand } from './commands/check.js';
17
18
  import { devCommand } from './commands/dev.js';
18
19
  import { reloadCommand } from './commands/reload.js';
@@ -206,6 +207,7 @@ const rawCommands = {
206
207
  allowance: allowanceCommand,
207
208
  init: initCommand,
208
209
  upgrade: upgradeCommand,
210
+ 'self-update': selfUpdateCommand,
209
211
  check: checkCommand,
210
212
  dev: devCommand,
211
213
  reload: reloadCommand,
package/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CAAC;AAIF,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAC1C,MAAM,CAAC,OAAO,CAAC,WAAW,CAA+C,CAAC,GAAG,CAC5E,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,eAAe,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAC5D,CAC0C,CAAC;AAE9C,iGAAiG;AACjG,8FAA8F;AAC9F,uFAAuF;AACvF,4FAA4F;AAC5F,MAAM,CAAC,MAAM,IAAI,GAAG,aAAa,CAAC;IAChC,IAAI,EAAE;QACJ,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,gDAAgD;KAC9D;IACD,WAAW;CACZ,CAAC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { defineCommand } from 'citty';
2
- import { spawnSync } from 'child_process';
3
2
  import { createInterface } from 'readline/promises';
3
+ import { isUpdatable, managerFor, readInstalledVersion, realSpawnManager, resolveInstall, uninstallArgs, } from '../update/self-install.js';
4
4
  import { selectEnvironmentForCommand, resolveAuth0ClientId } from '../config/environments.js';
5
5
  import { clearCredentials } from '../config/credentials.js';
6
6
  import { getAccessToken } from '../auth/session.js';
@@ -16,16 +16,33 @@ async function askOnStdin(question) {
16
16
  }
17
17
  }
18
18
  /**
19
- * npm's output is CAPTURED, not inherited. Under `--json` this command's stdout
20
- * is contractually one JSON document (see output.ts), and a subprocess writing
21
- * its own progress there would corrupt it the exact hazard the Output seam
22
- * exists to prevent, reintroduced by spawning a process instead of calling
23
- * console.log. Nothing is printed unless it fails, and then it goes through
19
+ * Remove the global install the one this CLI is actually running from.
20
+ *
21
+ * This used to spawn a bare `npm`, and had exactly the bug `bitmagic self-update` was written to
22
+ * fix: on a machine using nvm, the `npm` a non-interactive shell resolves is not the one that owns
23
+ * this install, so the uninstall quietly removed nothing while the command went on to report that
24
+ * the reset had succeeded — leaving the creator with the old CLI and no sign of it. The location
25
+ * and the executable now come from the running process instead (see update/self-install.ts).
26
+ *
27
+ * npm's output is CAPTURED, not inherited. Under `--json` this command's stdout is contractually
28
+ * one JSON document (see output.ts), and a subprocess writing its own progress there would corrupt
29
+ * it — the exact hazard the Output seam exists to prevent, reintroduced by spawning a process
30
+ * instead of calling console.log. Nothing is printed unless it fails, and then it goes through
24
31
  * `output.info` like every other line.
25
32
  */
26
33
  function uninstallGlobally() {
27
- const result = spawnSync('npm', ['uninstall', '-g', '@bitmagic/cli'], { encoding: 'utf-8' });
28
- return !result.error && result.status === 0;
34
+ const location = resolveInstall(import.meta.url);
35
+ // An npx run, a checkout, or a shape this does not recognise: there is no install to remove, and
36
+ // guessing at one is how the old version got this wrong. Reported as "not uninstalled", which is
37
+ // the truth, and the command's existing warning then says so.
38
+ if (!isUpdatable(location))
39
+ return false;
40
+ const command = managerFor(location, process.execPath);
41
+ const outcome = realSpawnManager(command.command, [...command.leadingArgs, ...uninstallArgs(location)]);
42
+ if (outcome.error !== undefined || outcome.status !== 0)
43
+ return false;
44
+ // Same rule as the update: the manager saying it worked is not evidence that it did.
45
+ return readInstalledVersion(location.verifyDir) === null;
29
46
  }
30
47
  export const defaultResetDeps = {
31
48
  fetch: globalThis.fetch,
@@ -1 +1 @@
1
- {"version":3,"file":"reset-account.js","sourceRoot":"","sources":["../../src/commands/reset-account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,2BAA2B,EAAE,oBAAoB,EAAoB,MAAM,2BAA2B,CAAC;AAChH,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAe,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,M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M,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;QAChD,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;QAC1C,MAAM,MAAM,GAAG,MAAM,eAAe,CAClC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,KAAK,IAAI,EAAE,OAAO,EAAE,EAClD,MAAM,CACP,CAAC;QACF,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;QACrC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;QAEvC,IAAI,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC;YACvC,wEAAwE;YACxE,4DAA4D;YAC5D,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAChB,MAAM,CAAC,IAAI,CACT,4FAA4F;gBAC1F,kFAAkF,CACrF,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,67 @@
1
+ import { type Output } from '../output.js';
2
+ import { type UpdateCheckCache, type UpdateTag } from '../update/notice.js';
3
+ import { type EnvironmentName } from '../config/environments.js';
4
+ import { type Exists, type InstallLocation, type SpawnManager } from '../update/self-install.js';
5
+ /**
6
+ * Everything this command touches outside itself, in one place — including the two reads that look
7
+ * like constants (`currentVersion`, `pinned`) but are both facts about the machine it happens to be
8
+ * running on, and the cache write, which would otherwise reach into the real `~/.bitmagic` from a
9
+ * test run.
10
+ */
11
+ export interface SelfUpdateDeps {
12
+ currentVersion: () => string;
13
+ pinned: () => EnvironmentName | undefined;
14
+ resolve: () => InstallLocation;
15
+ fetchTag: (tag: UpdateTag) => Promise<string | null>;
16
+ spawn: SpawnManager;
17
+ readVersion: (dir: string) => string | null;
18
+ writable: (dir: string) => boolean;
19
+ /**
20
+ * Path probe used to locate the package manager. Injected for the same reason as everything else
21
+ * here: the tests describe machines that do not exist, and a real `existsSync` would answer for
22
+ * this one instead — silently dropping every case into the PATH fallback.
23
+ */
24
+ exists: Exists;
25
+ writeCache: (cache: UpdateCheckCache) => void;
26
+ sleep: (ms: number) => Promise<void>;
27
+ now: () => number;
28
+ execPath: string;
29
+ }
30
+ export declare const defaultSelfUpdateDeps: SelfUpdateDeps;
31
+ /**
32
+ * Which npm line to install from, and never a question put to the creator.
33
+ *
34
+ * The order is the same rule the startup nudge already applies, just acted on instead of printed:
35
+ * an explicit `--tag` is a deliberate override; otherwise a project's committed pin decides,
36
+ * because the project is where a wrong line actually bites (a prerelease against `prod` calls
37
+ * `/api/cli/v1` endpoints that are not deployed there yet); and outside a project the only honest
38
+ * answer is the line this build is already on.
39
+ *
40
+ * That middle case is what makes this command the fix for `cliLineMismatchNotice` too: run inside
41
+ * a project on the wrong line, it crosses over without being told to.
42
+ */
43
+ export declare function resolveTargetTag(explicit: string | undefined, pinned: 'dev' | 'prod' | 'local' | undefined, currentVersion: string): UpdateTag;
44
+ /** What `--json` reports, and what the human lines above it say in prose. */
45
+ export interface SelfUpdateResult {
46
+ ok: true;
47
+ /** The version that was running when the command started. */
48
+ from: string;
49
+ /** The version now on disk. Equal to `from` when there was nothing newer. */
50
+ to: string;
51
+ tag: UpdateTag;
52
+ /** True when an install actually ran. False when the CLI was already current. */
53
+ updated: boolean;
54
+ manager: 'npm' | 'pnpm';
55
+ packageDir: string;
56
+ }
57
+ export declare function runSelfUpdate(explicitTag: string | undefined, output: Output, deps?: SelfUpdateDeps): Promise<SelfUpdateResult>;
58
+ export declare const selfUpdateCommand: import("citty").CommandDef<{
59
+ readonly tag: {
60
+ readonly type: "string";
61
+ readonly description: string;
62
+ };
63
+ readonly json: {
64
+ readonly type: "boolean";
65
+ readonly description: "Print the result as JSON on stdout; all progress goes to stderr.";
66
+ };
67
+ }>;
@@ -0,0 +1,196 @@
1
+ /**
2
+ * `bitmagic self-update` — replace this CLI with the newest build of its own line.
3
+ *
4
+ * Why a command and not a printed instruction: see the header of `update/self-install.ts`. In
5
+ * short, a printed `npm i -g` is run by whatever `npm` the calling shell happens to resolve, which
6
+ * on an nvm machine is routinely not the one that owns this install — the update lands in a prefix
7
+ * nobody's PATH points at, npm reports success, and the next `bitmagic` is still the old build.
8
+ * This command asks the shell nothing.
9
+ *
10
+ * It is also what every update nudge now names, and that is safe by construction: the CLI printing
11
+ * the nudge is on that shell's PATH, because it just ran there.
12
+ */
13
+ import { defineCommand } from 'citty';
14
+ import { createOutput } from '../output.js';
15
+ import { CliError } from '../errors.js';
16
+ import { currentCliVersion } from '../update/cli-version.js';
17
+ import { fetchTagVersion, writeUpdateCache } from '../update/check.js';
18
+ import { describeUpdateTag, installCommandFor, updateTagFor, updateTagForEnvironment, } from '../update/notice.js';
19
+ import { readPinnedEnvironment } from '../config/environments.js';
20
+ import { isOlderSemverVersion } from '../project/version-compare.js';
21
+ import * as fs from 'fs';
22
+ import { PACKAGE_NAME, installArgs, isStalePackumentFailure, isUpdatable, isWritable, managerFor, readInstalledVersion, realSpawnManager, resolveInstall, } from '../update/self-install.js';
23
+ /** How long to wait before the single retry that a stale packument earns. */
24
+ const RETRY_DELAY_MS = 5000;
25
+ export const defaultSelfUpdateDeps = {
26
+ currentVersion: currentCliVersion,
27
+ pinned: () => readPinnedEnvironment(),
28
+ resolve: () => resolveInstall(import.meta.url),
29
+ fetchTag: (tag) => fetchTagVersion(tag),
30
+ spawn: realSpawnManager,
31
+ readVersion: (dir) => readInstalledVersion(dir),
32
+ writable: (dir) => isWritable(dir),
33
+ exists: (candidate) => fs.existsSync(candidate),
34
+ writeCache: (cache) => writeUpdateCache(cache),
35
+ sleep: (ms) => new Promise((resolve) => setTimeout(resolve, ms)),
36
+ now: Date.now,
37
+ execPath: process.execPath,
38
+ };
39
+ /**
40
+ * Which npm line to install from, and never a question put to the creator.
41
+ *
42
+ * The order is the same rule the startup nudge already applies, just acted on instead of printed:
43
+ * an explicit `--tag` is a deliberate override; otherwise a project's committed pin decides,
44
+ * because the project is where a wrong line actually bites (a prerelease against `prod` calls
45
+ * `/api/cli/v1` endpoints that are not deployed there yet); and outside a project the only honest
46
+ * answer is the line this build is already on.
47
+ *
48
+ * That middle case is what makes this command the fix for `cliLineMismatchNotice` too: run inside
49
+ * a project on the wrong line, it crosses over without being told to.
50
+ */
51
+ export function resolveTargetTag(explicit, pinned, currentVersion) {
52
+ if (explicit !== undefined) {
53
+ if (explicit !== 'latest' && explicit !== 'dev') {
54
+ throw new CliError(`--tag must be \`latest\` or \`dev\`, not \`${explicit}\`.`);
55
+ }
56
+ return explicit;
57
+ }
58
+ if (pinned !== undefined)
59
+ return updateTagForEnvironment(pinned);
60
+ return updateTagFor(currentVersion);
61
+ }
62
+ /**
63
+ * Turn a location this command cannot act on into the sentence that says why, and what to do
64
+ * instead.
65
+ *
66
+ * Every branch names the resolved directory. That is the point: the failure being replaced is one
67
+ * where nobody could tell WHERE the install went, so a refusal that does not say where it looked
68
+ * would be the same failure wearing a different message.
69
+ */
70
+ function refuse(location, tag) {
71
+ const manual = installCommandFor(tag);
72
+ if (location.kind === 'npx') {
73
+ return new CliError(`This CLI is running from an npx cache (${location.packageDir}), so there is no install to ` +
74
+ `update — npx fetches a fresh copy every time. To keep one, run \`${manual}\`.`);
75
+ }
76
+ if (location.kind === 'linked-dev') {
77
+ return new CliError(`This CLI is running from a source checkout (${location.packageDir}), not from an npm ` +
78
+ 'install. Update it with `git pull` and a rebuild (`pnpm run build` in `cli/`).');
79
+ }
80
+ return new CliError(`Could not recognise how this CLI is installed (${location.packageDir}), so it will not guess ` +
81
+ `at where to write. Update it the way you installed it — for a normal install that is ` +
82
+ `\`${manual}\`.`);
83
+ }
84
+ export async function runSelfUpdate(explicitTag, output, deps = defaultSelfUpdateDeps) {
85
+ const current = deps.currentVersion();
86
+ if (current === '') {
87
+ throw new CliError('Could not read this CLI\'s own version, so there is nothing to compare against.');
88
+ }
89
+ const tag = resolveTargetTag(explicitTag, deps.pinned(), current);
90
+ const target = await deps.fetchTag(tag);
91
+ if (target === null) {
92
+ throw new CliError(`Could not reach the npm registry to find the newest ${describeUpdateTag(tag)} build. ` +
93
+ 'Check your connection and try again.', 1, 'unreachable');
94
+ }
95
+ const location = deps.resolve();
96
+ if (!isUpdatable(location))
97
+ throw refuse(location, tag);
98
+ const manager = location.kind === 'npm-global' ? 'npm' : 'pnpm';
99
+ // Already current is reported before anything is spawned, but AFTER the location is resolved:
100
+ // being told "you are up to date" by a command that could not have updated you anyway is the
101
+ // kind of all-clear that hides a broken install until the day it matters.
102
+ if (target === current) {
103
+ output.info(`Already on the newest ${describeUpdateTag(tag)} build: ${current}.`);
104
+ // Recorded even though nothing changed: this run just asked npm the question the startup nudge
105
+ // caches an answer to, and throwing that away would leave the nudge free to contradict it.
106
+ deps.writeCache({ latest: target, tag, checkedAt: deps.now() });
107
+ return { ok: true, from: current, to: current, tag, updated: false, manager, packageDir: location.packageDir };
108
+ }
109
+ // A CLI ahead of the registry is a normal state on the dev line right after a release, and
110
+ // "updating" to it would be a downgrade nobody asked for. Asked before the two checks below,
111
+ // which are about whether an install COULD be performed: refusing over an unwritable prefix
112
+ // someone was never going to write to would replace a true answer with an irrelevant complaint.
113
+ if (isOlderSemverVersion(current, target) !== true) {
114
+ output.info(`Nothing newer on the ${describeUpdateTag(tag)} line: it is at ${target}, you have ${current}.`);
115
+ return { ok: true, from: current, to: current, tag, updated: false, manager, packageDir: location.packageDir };
116
+ }
117
+ if (location.kind === 'pnpm-global' && location.binDir === undefined) {
118
+ throw new CliError(`This CLI was installed with pnpm into ${location.globalDir}, but the matching global bin ` +
119
+ 'directory could not be found, and installing into a guessed one would put the update ' +
120
+ `somewhere your PATH does not look. Run \`pnpm add -g --global-dir ${location.globalDir} ` +
121
+ `--global-bin-dir <your bin dir> ${PACKAGE_NAME}@${target}\`.`);
122
+ }
123
+ if (!deps.writable(location.modulesRoot)) {
124
+ throw new CliError(`${location.modulesRoot} is not writable by this user, so the update cannot be installed ` +
125
+ 'there. Either fix its ownership, or reinstall the CLI into a prefix you own.');
126
+ }
127
+ const command = managerFor(location, deps.execPath, deps.exists);
128
+ const spec = `${PACKAGE_NAME}@${target}`;
129
+ const args = [...command.leadingArgs, ...installArgs(location, spec)];
130
+ output.info(`Updating ${PACKAGE_NAME} on the ${describeUpdateTag(tag)} line: ${current} -> ${target}`);
131
+ output.info(` into ${location.modulesRoot}`);
132
+ if (command.fromPath) {
133
+ output.info(` using \`${command.command}\` from PATH — no bundled ${manager} was found next to this node.`);
134
+ }
135
+ // Nothing below this line may need a module that has not been imported yet: the install replaces
136
+ // the very directory this process is executing out of, and a lazy import after it would resolve
137
+ // against a directory npm has already unlinked.
138
+ let outcome = deps.spawn(command.command, args);
139
+ if (outcome.status !== 0 && isStalePackumentFailure(outcome)) {
140
+ // The documented post-release window: the version IS published, but this machine's cached
141
+ // packument predates it. Retrying is the fix (docs/npm-publishing.md).
142
+ output.info(' npm has a stale package listing for a just-published version; retrying once…');
143
+ await deps.sleep(RETRY_DELAY_MS);
144
+ outcome = deps.spawn(command.command, args);
145
+ }
146
+ if (outcome.error !== undefined) {
147
+ throw new CliError(`Could not run \`${command.command}\`: ${outcome.error.message}. ` +
148
+ (command.fromPath
149
+ ? `It was not found next to this node installation and is not on PATH either.`
150
+ : 'The file exists but could not be executed.'));
151
+ }
152
+ if (outcome.status !== 0) {
153
+ const detail = (outcome.stderr.trim() || outcome.stdout.trim()).split('\n').slice(-8);
154
+ for (const line of detail)
155
+ output.info(` ${line}`);
156
+ throw new CliError(`\`${manager}\` exited ${outcome.status ?? 'without a status'}; the CLI was not updated.`);
157
+ }
158
+ // The check that makes a silent no-op impossible. The manager reporting success is not evidence
159
+ // that anything moved — that was precisely the old failure, where npm cheerfully installed into
160
+ // a prefix nobody's PATH pointed at and said so.
161
+ const installed = deps.readVersion(location.verifyDir);
162
+ if (installed !== target) {
163
+ throw new CliError(`\`${manager}\` reported success, but ${location.verifyDir} still holds ` +
164
+ `${installed ?? 'no readable version'} instead of ${target}. The update did not land where ` +
165
+ 'this CLI is installed; nothing has been changed.');
166
+ }
167
+ // Written so the startup nudge goes quiet on the very next command instead of at the end of its
168
+ // refresh interval — being told to update by the CLI you just updated reads as a failed update.
169
+ deps.writeCache({ latest: target, tag, checkedAt: deps.now() });
170
+ output.info(`Done. \`bitmagic --version\` now reports ${target}.`);
171
+ return { ok: true, from: current, to: target, tag, updated: true, manager, packageDir: location.packageDir };
172
+ }
173
+ export const selfUpdateCommand = defineCommand({
174
+ meta: {
175
+ name: 'self-update',
176
+ description: 'Update the bitmagic CLI itself to the newest build of its line, installing it where this ' +
177
+ 'CLI actually lives rather than wherever `npm` on your PATH would put it.',
178
+ },
179
+ args: {
180
+ tag: {
181
+ type: 'string',
182
+ description: "Which npm line to install: `latest` or `dev`. Defaults to the project's environment, or " +
183
+ 'to the line this build is already on.',
184
+ },
185
+ json: {
186
+ type: 'boolean',
187
+ description: 'Print the result as JSON on stdout; all progress goes to stderr.',
188
+ },
189
+ },
190
+ async run({ args }) {
191
+ const output = createOutput(args.json === true);
192
+ const result = await runSelfUpdate(typeof args.tag === 'string' ? args.tag : undefined, output);
193
+ output.result(result);
194
+ },
195
+ });
196
+ //# sourceMappingURL=self-update.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"self-update.js","sourceRoot":"","sources":["../../src/commands/self-update.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,YAAY,EAAe,MAAM,cAAc,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,u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kE;SAChF;KACF;IACD,KAAK,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE;QAChB,MAAM,MAAM,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;QAChD,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAChG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACxB,CAAC;CACF,CAAC,CAAC"}
@@ -16,7 +16,7 @@ import { loadProjectContext } from '../project/context.js';
16
16
  import { addCommand, detectPackageManager } from '../project/package-manager.js';
17
17
  import { isOlderSemverVersion } from '../project/version-compare.js';
18
18
  import { fetchTagVersion } from '../update/check.js';
19
- import { installCommandFor, updateTagFor, updateTagForEnvironment } from '../update/notice.js';
19
+ import { crossLineUpdateCommand, updateTagFor, updateTagForEnvironment } from '../update/notice.js';
20
20
  import { currentCliVersion } from '../update/cli-version.js';
21
21
  const deps = {
22
22
  fetch: globalThis.fetch,
@@ -223,7 +223,10 @@ fetchLatest = () => fetchTagVersion(tag)) {
223
223
  if (updateAvailable) {
224
224
  output.info('');
225
225
  output.info(`Your CLI is older than the engine you just vendored: ${latest} is on npm, you have ${version}.`);
226
- output.info(` Run \`${installCommandFor(tag)}\` before the next build.`);
226
+ // `--tag` is named because this call site passes the PROJECT's line, not the running build's:
227
+ // an upgrade run by a CLI from the other line must be told to cross over, and the bare command
228
+ // would only re-read the pin it is already standing in.
229
+ output.info(` Run \`${crossLineUpdateCommand(tag)}\` before the next build.`);
227
230
  output.info(' The CLI and the engine ship together, so a newer engine can need build config or a ' +
228
231
  'command only the newer CLI has.');
229
232
  }