magus-cli 7.10.3 → 7.10.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/package.json +4 -4
- package/src/__tests__/blackbox-convergence.test.ts +0 -1
- package/src/__tests__/blackbox-parity.test.ts +2 -2
- package/src/__tests__/blackbox-tool-state.test.ts +8 -18
- package/src/__tests__/blind/c14-cli-row-label.test.ts +8 -3
- package/src/__tests__/blind/c15-probe-ownership.test.ts +11 -11
- package/src/__tests__/blind/c16-probe-adopts-node-global.test.ts +16 -12
- package/src/__tests__/blind/c17-enter-label.test.ts +42 -7
- package/src/__tests__/blind/c18-probe-adopts-homebrew-keg.test.ts +36 -19
- package/src/__tests__/blind/c19-probe-owner-version-shadow.test.ts +38 -35
- package/src/__tests__/cli-tool-commands.test.ts +2 -2
- package/src/__tests__/cli-tool-external-row.test.tsx +112 -0
- package/src/__tests__/cli-tools-adapter.test.ts +32 -22
- package/src/__tests__/cli-update-view.test.ts +124 -51
- package/src/__tests__/fixtures/bins.ts +9 -2
- package/src/__tests__/npm-package-name.test.ts +3 -2
- package/src/__tests__/profile-worktree-include.test.ts +212 -0
- package/src/__tests__/tool-adopt-brew-owner.test.ts +167 -0
- package/src/__tests__/tool-probe.test.ts +231 -144
- package/src/__tests__/tool-rows-followups.test.ts +315 -0
- package/src/__tests__/tool-rows-reproduction.test.ts +630 -0
- package/src/__tests__/tool-versions.test.ts +164 -0
- package/src/__tests__/toolchain.test.ts +0 -2
- package/src/__tests__/update-plan.test.ts +40 -9
- package/src/cli/update-view.ts +180 -76
- package/src/cli/update.ts +44 -37
- package/src/data/cli-tools.ts +5 -10
- package/src/data/tool-versions.ts +137 -0
- package/src/services/cli-tool-commands.ts +1 -2
- package/src/services/cli-tool-version.ts +10 -88
- package/src/services/profile-activate.ts +9 -0
- package/src/services/profile-live.ts +26 -0
- package/src/services/profile-skills.ts +14 -4
- package/src/services/profile-state.ts +18 -0
- package/src/services/resolver.ts +9 -15
- package/src/services/tool-probe.ts +537 -691
- package/src/services/toolchain.ts +10 -4
- package/src/services/update-engine.ts +9 -15
- package/src/services/update-plan.ts +49 -21
- package/src/types/index.ts +0 -2
- package/src/ui/adapters/cliToolsAdapter.ts +31 -22
- package/src/ui/renderers/cliToolRenderers.tsx +15 -21
- package/src/ui/state/types.ts +0 -1
- package/src/__tests__/blind/c9-cli-tool-version.test.ts +0 -239
package/src/services/resolver.ts
CHANGED
|
@@ -13,6 +13,7 @@ import semver from "semver";
|
|
|
13
13
|
import { cliTools, isOwnedEntry } from "../data/cli-tools.js";
|
|
14
14
|
import { getMarketplaceByName } from "../data/marketplaces.js";
|
|
15
15
|
import { PREDEFINED_PROFILES } from "../data/predefined-profiles.js";
|
|
16
|
+
import { presenceArgv } from "../data/tool-versions.js";
|
|
16
17
|
import {
|
|
17
18
|
type InstallOption,
|
|
18
19
|
type Requirement,
|
|
@@ -258,13 +259,11 @@ export function pinOfBin(bin: SelectedBin): string | undefined {
|
|
|
258
259
|
return option && "version" in option ? option.version : undefined;
|
|
259
260
|
}
|
|
260
261
|
|
|
261
|
-
/** The catalogue's check line as argv: split once, here, never by a shell. */
|
|
262
|
-
const splitCheck = (line: string): string[] => line.trim().split(/\s+/);
|
|
263
|
-
|
|
264
262
|
/**
|
|
265
263
|
* Map a manifest cliTools entry (name -> version) onto a requirement: the
|
|
266
264
|
* catalogue's installer as one option (`npm`/`pip`/`go` are the profile-only
|
|
267
|
-
* kinds),
|
|
265
|
+
* kinds), magus's own version command as the check (`presenceArgv`), the pin
|
|
266
|
+
* carried in the option. A tool a plugin
|
|
268
267
|
* owns (`ownedBy`) is that plugin's declaration, passed in as `owned`, with
|
|
269
268
|
* the pin applied to its chosen option. An unknown tool installs with bun
|
|
270
269
|
* under its own name.
|
|
@@ -293,18 +292,13 @@ export function cliToolToBin(
|
|
|
293
292
|
: { ...owned, chosen: withPin(owned.chosen) };
|
|
294
293
|
}
|
|
295
294
|
const tool = cliTools.find((t) => t.name === name);
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
option =
|
|
301
|
-
tool.packageManager === "brew"
|
|
295
|
+
const check = presenceArgv(name);
|
|
296
|
+
const option: InstallOption =
|
|
297
|
+
tool && !isOwnedEntry(tool)
|
|
298
|
+
? tool.packageManager === "brew"
|
|
302
299
|
? { via: "brew", formula: tool.packageName }
|
|
303
|
-
: { via: tool.packageManager, package: tool.packageName }
|
|
304
|
-
|
|
305
|
-
check = [name, "--version"];
|
|
306
|
-
option = { via: "bun", package: name };
|
|
307
|
-
}
|
|
300
|
+
: { via: tool.packageManager, package: tool.packageName }
|
|
301
|
+
: { via: "bun", package: name };
|
|
308
302
|
const requirement: Requirement = { name, check, install: [withPin(option)] };
|
|
309
303
|
return (
|
|
310
304
|
selectBins([requirement], undefined)[0] ?? {
|