@xyrlan/mnemo 0.15.0 → 0.17.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.
package/lib/bootstrap.js CHANGED
@@ -5,7 +5,7 @@ const { probeOnPath } = require("./detect");
5
5
  const { resolveMnemoBinary } = require("./runMnemo");
6
6
 
7
7
 
8
- const PIN_SPEC = "mnemo-claude>=0.15,<0.16";
8
+ const PIN_SPEC = "mnemo-claude>=0.17,<0.18";
9
9
 
10
10
 
11
11
  function buildInstallCmd(installer, spec = PIN_SPEC) {
package/lib/runInstall.js CHANGED
@@ -41,24 +41,56 @@ function parseFlags(argv, { warn = (msg) => process.stderr.write(`warning: ${msg
41
41
  }
42
42
 
43
43
 
44
+ // Decide what we need before installing anything.
45
+ //
46
+ // Installer first, Python second -- the reverse order bailed out on a machine
47
+ // that had uv but no system Python, which is precisely the case uv solves: it
48
+ // provisions its own CPython. The tool that would have worked was never
49
+ // reached, and the user was told to go install Python.
50
+ function resolveToolchain({ pickInstallerFn = pickInstaller, detectPythonFn = detectPython } = {}) {
51
+ const installer = pickInstallerFn();
52
+ const python = detectPythonFn();
53
+
54
+ if (installer === "uv") return { installer, python };
55
+
56
+ if (!installer) {
57
+ return {
58
+ error: python
59
+ ? `No Python installer (uv, pipx, or pip) found on PATH.\n → ${pep668InstallHint()}`
60
+ : "Neither a Python installer nor Python 3.8+ was found.\n" +
61
+ " → Install uv (https://docs.astral.sh/uv/) — it brings its own Python:\n" +
62
+ " curl -LsSf https://astral.sh/uv/install.sh | sh",
63
+ };
64
+ }
65
+
66
+ // pipx and pip both run on the system interpreter.
67
+ if (!python) {
68
+ return {
69
+ error:
70
+ `Python 3.8+ not found (required by ${installer}).\n` +
71
+ " → Install Python 3.8+ (https://www.python.org/downloads/), or install uv,\n" +
72
+ " which brings its own: curl -LsSf https://astral.sh/uv/install.sh | sh",
73
+ };
74
+ }
75
+
76
+ return { installer, python };
77
+ }
78
+
79
+
44
80
  async function runInstall(argv) {
45
81
  const flags = parseFlags(argv);
46
82
 
47
- const py = detectPython();
48
- if (!py) {
49
- m.err("Python 3.8+ not found.");
50
- m.plain(" → Install Python 3.8 or newer (https://www.python.org/downloads/) and retry.");
83
+ const { installer, python: py, error } = resolveToolchain();
84
+ if (error) {
85
+ const [first, ...rest] = error.split("\n");
86
+ m.err(first);
87
+ rest.forEach((line) => m.plain(line));
51
88
  return 1;
52
89
  }
53
- if (!flags.quiet) m.ok(`Python ${py.version.major}.${py.version.minor} detected`);
54
-
55
- const installer = pickInstaller();
56
- if (!installer) {
57
- m.err("No Python installer (uv, pipx, or pip) found on PATH.");
58
- m.plain(` → ${pep668InstallHint()}`);
59
- return 1;
90
+ if (!flags.quiet) {
91
+ if (py) m.ok(`Python ${py.version.major}.${py.version.minor} detected`);
92
+ m.ok(`installer: ${installer}`);
60
93
  }
61
- if (!flags.quiet) m.ok(`installer: ${installer}`);
62
94
 
63
95
  const installed = isAlreadyInstalled();
64
96
  if (installed && !flags.upgrade) {
@@ -100,4 +132,4 @@ async function runInstall(argv) {
100
132
  }
101
133
 
102
134
 
103
- module.exports = { runInstall, parseFlags };
135
+ module.exports = { runInstall, parseFlags, resolveToolchain };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyrlan/mnemo",
3
- "version": "0.15.0",
3
+ "version": "0.17.0",
4
4
  "description": "One-command installer for mnemo (the Obsidian that populates itself).",
5
5
  "bin": {
6
6
  "mnemo": "bin/mnemo.js"