@maka/maka-cli 5.75.0 → 5.76.0

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 (34) hide show
  1. package/bundle/typescript/package.json +1 -1
  2. package/bundle/typescript/src/commands/game/sideQuest/commands/backlog.d.ts +7 -0
  3. package/bundle/typescript/src/commands/game/sideQuest/commands/backlog.js +36 -1
  4. package/bundle/typescript/src/commands/game/sideQuest/commands/backlog.js.map +1 -1
  5. package/bundle/typescript/src/commands/game/sideQuest/commands/move.js +28 -4
  6. package/bundle/typescript/src/commands/game/sideQuest/commands/move.js.map +1 -1
  7. package/bundle/typescript/src/commands/game/sideQuest/models/npc.d.ts +28 -0
  8. package/bundle/typescript/src/commands/game/sideQuest/models/npc.js +33 -5
  9. package/bundle/typescript/src/commands/game/sideQuest/models/npc.js.map +1 -1
  10. package/bundle/typescript/src/commands/game/sideQuest/types/repro.d.ts +27 -1
  11. package/bundle/typescript/src/commands/game/sideQuest/types/repro.js +28 -1
  12. package/bundle/typescript/src/commands/game/sideQuest/types/repro.js.map +1 -1
  13. package/bundle/typescript/src/commands/game/sideQuest/utilities/ar.js +7 -2
  14. package/bundle/typescript/src/commands/game/sideQuest/utilities/ar.js.map +1 -1
  15. package/bundle/typescript/src/commands/game/sideQuest/utilities/backlog-dump.js +19 -3
  16. package/bundle/typescript/src/commands/game/sideQuest/utilities/backlog-dump.js.map +1 -1
  17. package/bundle/typescript/src/commands/game/sideQuest/utilities/backlog-vocab.d.ts +13 -0
  18. package/bundle/typescript/src/commands/game/sideQuest/utilities/backlog-vocab.js +15 -0
  19. package/bundle/typescript/src/commands/game/sideQuest/utilities/backlog-vocab.js.map +1 -1
  20. package/bundle/typescript/src/commands/game/sideQuest/utilities/backlog.d.ts +8 -0
  21. package/bundle/typescript/src/commands/game/sideQuest/utilities/backlog.js.map +1 -1
  22. package/bundle/typescript/src/commands/game/sideQuest/utilities/grid-view.js +12 -2
  23. package/bundle/typescript/src/commands/game/sideQuest/utilities/grid-view.js.map +1 -1
  24. package/bundle/typescript/src/commands/game/sideQuest/utilities/repro-launch.d.ts +3 -1
  25. package/bundle/typescript/src/commands/game/sideQuest/utilities/repro-launch.js +13 -0
  26. package/bundle/typescript/src/commands/game/sideQuest/utilities/repro-launch.js.map +1 -1
  27. package/bundle/typescript/src/commands/game/sideQuest.sub.cmd.js +39 -1
  28. package/bundle/typescript/src/commands/game/sideQuest.sub.cmd.js.map +1 -1
  29. package/bundle/typescript/src/commands/update.js +6 -88
  30. package/bundle/typescript/src/commands/update.js.map +1 -1
  31. package/bundle/typescript/src/tools/self-update/update-maka.d.ts +15 -0
  32. package/bundle/typescript/src/tools/self-update/update-maka.js +107 -0
  33. package/bundle/typescript/src/tools/self-update/update-maka.js.map +1 -0
  34. package/package.json +1 -1
@@ -0,0 +1,107 @@
1
+ import fs from 'fs';
2
+ import os from 'os';
3
+ import path from 'path';
4
+ import { Log } from '../log/log.class.js';
5
+ import { cliVersion } from '../version/cli-version.js';
6
+ /**
7
+ * THE WHOLE `maka update maka` FLOW, callable from anywhere that has a
8
+ * reason to update the CLI mid-task -- extracted from commands/update.ts
9
+ * when repro benches gained a version lock, so "this bench needs 5.76.0,
10
+ * update now?" can act on a yes instead of printing a command to retype.
11
+ *
12
+ * Exit semantics are the command's own and deliberately kept: failures
13
+ * process.exit(1), and a caller must treat a successful return as "the
14
+ * NEXT process is the new version" -- the running one is unchanged, so
15
+ * after an update the only honest continuation is to tell the user to
16
+ * re-run and exit.
17
+ *
18
+ * Returns true when an update was installed, false when already latest.
19
+ */
20
+ export async function updateMakaCli() {
21
+ const current = cliVersion();
22
+ const { fetchLatestRelease, updateAvailable, tagToVersion, assetNameFor, downloadAsset, sha256Hex, digestMatches, extractArchive, swapPlanFor, executeSwapPlan, } = await import('./self-update.js');
23
+ Log.header(`Checking the latest maka release...`);
24
+ const release = await fetchLatestRelease();
25
+ const latest = tagToVersion(release.tag_name);
26
+ if (!updateAvailable(current, release.tag_name)) {
27
+ Log.success(`maka ${current} is already the latest.`);
28
+ return false;
29
+ }
30
+ Log.notice(`Update available: ${current} -> ${latest}`);
31
+ const { isPackaged } = await import('../sdk-loader/sdk-loader.class.js');
32
+ if (!isPackaged()) {
33
+ // npm owns this install's layout (bin shims, prefix); replacing the
34
+ // files underneath it would leave npm's book-keeping describing a
35
+ // binary it no longer manages. Let npm do its own job.
36
+ Log.notice('This maka is installed through npm -- updating via npm.');
37
+ const { default: spawn } = await import('cross-spawn');
38
+ const out = spawn.sync('npm', ['i', '-g', '@maka/maka-cli@latest'], { stdio: 'inherit' });
39
+ if (out.status !== 0) {
40
+ Log.error(`npm exited with ${out.status ?? 'a spawn failure'} -- maka was not updated.`);
41
+ process.exit(1);
42
+ }
43
+ Log.success(`maka updated to ${latest}.`);
44
+ return true;
45
+ }
46
+ const assetName = assetNameFor(process.platform, process.arch);
47
+ if (!assetName) {
48
+ Log.error(`No prebuilt maka binary exists for ${process.platform}/${process.arch}.`);
49
+ Log.notice('Built targets: linux x64/arm64, macOS x64/arm64, Windows x64.');
50
+ process.exit(1);
51
+ }
52
+ const asset = release.assets.find(a => a.name === assetName);
53
+ if (!asset) {
54
+ // The dist repo prunes binaries off older releases, but the LATEST
55
+ // release always carries a full set -- an absent asset here means the
56
+ // publish is mid-flight or failed, not that the target is unsupported.
57
+ Log.error(`The ${release.tag_name} release has no ${assetName} yet. Try again in a few minutes.`);
58
+ process.exit(1);
59
+ }
60
+ const exePath = process.execPath;
61
+ // Staging lives NEXT TO the executable so the final rename cannot cross
62
+ // a filesystem; it also surfaces a permissions problem before any
63
+ // download time is spent.
64
+ const stageDir = path.join(path.dirname(exePath), '.maka-update-stage');
65
+ try {
66
+ fs.rmSync(stageDir, { recursive: true, force: true });
67
+ fs.mkdirSync(stageDir, { recursive: true });
68
+ }
69
+ catch (e) {
70
+ Log.error(`Cannot write next to the maka executable (${path.dirname(exePath)}): ${e.message}`);
71
+ Log.notice('Re-run with the permissions the install location requires.');
72
+ process.exit(1);
73
+ }
74
+ const archivePath = path.join(os.tmpdir(), assetName);
75
+ Log.notice(`Downloading ${assetName} (${Math.round(asset.size / 1024 / 1024)}MB)...`);
76
+ await downloadAsset(asset, archivePath);
77
+ const verdict = digestMatches(asset.digest, sha256Hex(archivePath));
78
+ if (verdict === false) {
79
+ Log.error('Checksum mismatch: the downloaded file does not match the release digest. Not installing it.');
80
+ process.exit(1);
81
+ }
82
+ if (verdict === null) {
83
+ // Absent digest is GitHub's field missing, not tampering evidence --
84
+ // but unverified must never read as verified.
85
+ Log.warn('The release publishes no digest for this asset; installing UNVERIFIED (downloaded over TLS from github.com).');
86
+ }
87
+ else {
88
+ Log.notice('Checksum verified.');
89
+ }
90
+ const stagedBinary = await extractArchive(archivePath, stageDir);
91
+ if (!fs.existsSync(stagedBinary) || fs.statSync(stagedBinary).size < 10 * 1024 * 1024) {
92
+ Log.error(`The extracted binary at ${stagedBinary} is missing or implausibly small. Not installing it.`);
93
+ process.exit(1);
94
+ }
95
+ executeSwapPlan(swapPlanFor(process.platform, exePath, stagedBinary));
96
+ try {
97
+ fs.rmSync(stageDir, { recursive: true, force: true });
98
+ fs.rmSync(archivePath, { force: true });
99
+ }
100
+ catch { /* cosmetic -- the update itself is done */ }
101
+ Log.success(`maka updated: ${current} -> ${latest}. The new version runs from your next command.`);
102
+ if (process.platform === 'win32') {
103
+ Log.notice(`Windows keeps the running executable as ${path.basename(exePath)}.old until the next update clears it.`);
104
+ }
105
+ return true;
106
+ }
107
+ //# sourceMappingURL=update-maka.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update-maka.js","sourceRoot":"","sources":["../../../../../src/tools/self-update/update-maka.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAE,UAAU,EA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,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,IAAI,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,EAAE,CAAC;QACtF,GAAG,CAAC,KAAK,CAAC,2BAA2B,YAAY,sDAAsD,CAAC,CAAC;QACzG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,eAAe,CAAC,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;IAEtE,IAAI,CAAC;QACH,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACtD,EAAE,CAAC,MAAM,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1C,CAAC;IAAC,MAAM,CAAC,CAAC,2CAA2C,CAAC,CAAC;IAEvD,GAAG,CAAC,OAAO,CAAC,iBAAiB,OAAO,OAAO,MAAM,gDAAgD,CAAC,CAAC;IACnG,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QACjC,GAAG,CAAC,MAAM,CAAC,2CAA2C,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,uCAAuC,CAAC,CAAC;IACvH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maka/maka-cli",
3
- "version": "5.75.0",
3
+ "version": "5.76.0",
4
4
  "type": "module",
5
5
  "summary": "A command line tool for scaffolding Meteor 2.x applications using either React.",
6
6
  "description": "A command line tool for scaffolding Meteor 2.x applications using React.",