probe-research 0.10.1 → 0.10.3
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/probe-research.js +38 -8
- package/package.json +1 -1
package/bin/probe-research.js
CHANGED
|
@@ -26,6 +26,19 @@ const { spawnSync } = require("node:child_process");
|
|
|
26
26
|
const os = require("node:os");
|
|
27
27
|
|
|
28
28
|
const DIST = "probe-research";
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The minimum CLI version this launcher needs — NOT this package's own version.
|
|
32
|
+
*
|
|
33
|
+
* npm and PyPI release INDEPENDENTLY. This package can take a launcher-only
|
|
34
|
+
* patch (as 0.10.1 did) with no corresponding CLI release, so pinning
|
|
35
|
+
* `probe-research==<our version>` resolves to a PyPI version that does not
|
|
36
|
+
* exist. That is exactly how 0.10.1 shipped broken.
|
|
37
|
+
*
|
|
38
|
+
* Bump this only when the launcher starts depending on a NEW CLI feature.
|
|
39
|
+
* 0.10.0 is the release that introduced `probe wizard`.
|
|
40
|
+
*/
|
|
41
|
+
const MIN_CLI = "0.10.0";
|
|
29
42
|
const UV_INSTALL = "curl -LsSf https://astral.sh/uv/install.sh | sh";
|
|
30
43
|
|
|
31
44
|
/** Compare dotted numeric versions. Returns true when `a` >= `b`. */
|
|
@@ -78,7 +91,7 @@ function main() {
|
|
|
78
91
|
// `npx probe-research` with no arguments runs the wizard — that is the entire
|
|
79
92
|
// reason this package exists, so it should not require remembering a verb.
|
|
80
93
|
const forwarded = args.length ? args : ["wizard"];
|
|
81
|
-
const wanted =
|
|
94
|
+
const wanted = MIN_CLI;
|
|
82
95
|
|
|
83
96
|
// Only hand off to an existing install if it is at least as new as this
|
|
84
97
|
// launcher. Otherwise fall through and let uv/pipx fetch a matching CLI.
|
|
@@ -87,14 +100,29 @@ function main() {
|
|
|
87
100
|
if (found && atLeast(found, wanted)) return run("probe", forwarded);
|
|
88
101
|
console.error(
|
|
89
102
|
`probe-research: installed probe ${found || "(unknown version)"} is older than ` +
|
|
90
|
-
`${wanted}; fetching
|
|
103
|
+
`${wanted}; fetching the latest…`,
|
|
91
104
|
);
|
|
92
105
|
}
|
|
93
|
-
//
|
|
94
|
-
// reuses an already-installed 0.8.2 tool
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
106
|
+
// A FLOOR, not an exact pin. Unpinned, `uv tool run --from probe-research`
|
|
107
|
+
// reuses an already-installed 0.8.2 tool; pinned exactly, it demands a PyPI
|
|
108
|
+
// version that may not exist. `>=` fixes both.
|
|
109
|
+
const spec = `${DIST}>=${wanted}`;
|
|
110
|
+
// REFRESH. uv caches the ENVIRONMENT it built for a requirement, so a range
|
|
111
|
+
// like `>=0.10.0` keeps serving whatever it resolved the FIRST time — every
|
|
112
|
+
// user frozen on the version they happened to run on day one, with the
|
|
113
|
+
// launcher silently never delivering another update.
|
|
114
|
+
//
|
|
115
|
+
// It has to be the full `--refresh`: `--refresh-package` only refreshes
|
|
116
|
+
// package METADATA and still reuses the built environment (measured — it
|
|
117
|
+
// kept returning 0.10.0 after 0.10.1 was published). The full refresh costs
|
|
118
|
+
// ~100ms, which is nothing for a command that only runs when there is no
|
|
119
|
+
// usable local install.
|
|
120
|
+
if (has("uv")) {
|
|
121
|
+
return run("uv", ["tool", "run", "--refresh", "--from", spec, "probe", ...forwarded]);
|
|
122
|
+
}
|
|
123
|
+
if (has("pipx")) {
|
|
124
|
+
return run("pipx", ["run", "--no-cache", "--spec", spec, "probe", ...forwarded]);
|
|
125
|
+
}
|
|
98
126
|
|
|
99
127
|
if (process.platform === "win32") {
|
|
100
128
|
console.error(
|
|
@@ -115,7 +143,9 @@ function main() {
|
|
|
115
143
|
// The installer drops uv in ~/.local/bin, which is not on THIS process's PATH
|
|
116
144
|
// because it was resolved before the install ran.
|
|
117
145
|
const uv = `${os.homedir()}/.local/bin/uv`;
|
|
118
|
-
return run(uv, [
|
|
146
|
+
return run(uv, [
|
|
147
|
+
"tool", "run", "--refresh", "--from", `${DIST}>=${wanted}`, "probe", ...forwarded,
|
|
148
|
+
]);
|
|
119
149
|
}
|
|
120
150
|
|
|
121
151
|
main();
|