umadev 1.0.6 → 1.0.7
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/postinstall.js +67 -0
- package/package.json +11 -8
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
//
|
|
4
|
+
// Post-install PATH check — GLOBAL installs only.
|
|
5
|
+
//
|
|
6
|
+
// Some node setups (notably Homebrew's node) leave npm's global bin dir OFF
|
|
7
|
+
// $PATH. The package installs fine and the `umadev` command is linked, but it
|
|
8
|
+
// lands in a directory the shell doesn't search, so the user later sees a bare
|
|
9
|
+
// "command not found" with no clue why. We cannot change the user's PATH from
|
|
10
|
+
// here, but we can detect the situation and print exactly what happened + how
|
|
11
|
+
// to fix it.
|
|
12
|
+
//
|
|
13
|
+
// FAIL-OPEN BY CONTRACT: every path through this script ends with exit code 0,
|
|
14
|
+
// and the whole body is wrapped in try/catch. A cosmetic PATH check must NEVER
|
|
15
|
+
// break `npm install` — if anything is uncertain, we stay silent.
|
|
16
|
+
'use strict';
|
|
17
|
+
|
|
18
|
+
function main() {
|
|
19
|
+
// Only a global install (`npm i -g`) puts a command on PATH. For a local /
|
|
20
|
+
// dependency install the command is not meant to be on PATH — say nothing.
|
|
21
|
+
if (process.env.npm_config_global !== 'true') return;
|
|
22
|
+
|
|
23
|
+
const path = require('node:path');
|
|
24
|
+
|
|
25
|
+
// The prefix npm links global commands under. If npm didn't expose it we
|
|
26
|
+
// can't reason about PATH — stay quiet rather than risk a false warning.
|
|
27
|
+
const prefix = process.env.npm_config_prefix;
|
|
28
|
+
if (!prefix) return;
|
|
29
|
+
|
|
30
|
+
const isWin = process.platform === 'win32';
|
|
31
|
+
// npm links global commands into <prefix>/bin on unix, <prefix> on Windows.
|
|
32
|
+
const binDir = isWin ? prefix : path.join(prefix, 'bin');
|
|
33
|
+
|
|
34
|
+
const sep = isWin ? ';' : ':';
|
|
35
|
+
const strip = (p) => p.replace(/[\\/]+$/, '');
|
|
36
|
+
const fold = (p) => (isWin ? strip(p).toLowerCase() : strip(p));
|
|
37
|
+
const target = fold(binDir);
|
|
38
|
+
const onPath = (process.env.PATH || '')
|
|
39
|
+
.split(sep)
|
|
40
|
+
.filter(Boolean)
|
|
41
|
+
.some((p) => fold(p) === target);
|
|
42
|
+
|
|
43
|
+
// All good — the command will be found. Don't add noise to a clean install.
|
|
44
|
+
if (onPath) return;
|
|
45
|
+
|
|
46
|
+
const w = (s) => process.stderr.write(s + '\n');
|
|
47
|
+
w('');
|
|
48
|
+
w(' [warn] umadev installed OK, but its command directory is NOT on your PATH:');
|
|
49
|
+
w(' ' + binDir);
|
|
50
|
+
w(' so running `umadev` will say "command not found".');
|
|
51
|
+
w(' This is your npm/shell setup (common with Homebrew node), not a umadev bug.');
|
|
52
|
+
w(' umadev 已装好,但命令目录不在 PATH 上,所以敲 umadev 会提示找不到。');
|
|
53
|
+
w('');
|
|
54
|
+
w(' Fix — point npm at a prefix already on your PATH, then reinstall:');
|
|
55
|
+
w(' npm config set prefix ~/.npm-global');
|
|
56
|
+
w(' # ensure ~/.npm-global/bin is on your PATH, then:');
|
|
57
|
+
w(' npm i -g umadev@latest');
|
|
58
|
+
w(' …or just add the directory above to your PATH:');
|
|
59
|
+
w(' export PATH="' + binDir + (isWin ? ';%PATH%"' : ':$PATH"'));
|
|
60
|
+
w('');
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
try {
|
|
64
|
+
main();
|
|
65
|
+
} catch (_e) {
|
|
66
|
+
// Never fail the install over a cosmetic PATH check.
|
|
67
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "umadev",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "A project-director Agent for AI coding hosts — drives your logged-in Claude Code / Codex through a 9-phase commercial delivery pipeline with governance. No API key needed.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -30,16 +30,19 @@
|
|
|
30
30
|
"bin/",
|
|
31
31
|
"README.md"
|
|
32
32
|
],
|
|
33
|
+
"scripts": {
|
|
34
|
+
"postinstall": "node bin/postinstall.js"
|
|
35
|
+
},
|
|
33
36
|
"engines": {
|
|
34
37
|
"node": ">=18"
|
|
35
38
|
},
|
|
36
39
|
"optionalDependencies": {
|
|
37
|
-
"@umacloud/cli-darwin-arm64": "1.0.
|
|
38
|
-
"@umacloud/cli-darwin-x64": "1.0.
|
|
39
|
-
"@umacloud/cli-linux-x64": "1.0.
|
|
40
|
-
"@umacloud/cli-linux-arm64": "1.0.
|
|
41
|
-
"@umacloud/cli-win32-x64": "1.0.
|
|
42
|
-
"@umacloud/model-e5-small": "1.0.
|
|
43
|
-
"@umacloud/knowledge": "1.0.
|
|
40
|
+
"@umacloud/cli-darwin-arm64": "1.0.7",
|
|
41
|
+
"@umacloud/cli-darwin-x64": "1.0.7",
|
|
42
|
+
"@umacloud/cli-linux-x64": "1.0.7",
|
|
43
|
+
"@umacloud/cli-linux-arm64": "1.0.7",
|
|
44
|
+
"@umacloud/cli-win32-x64": "1.0.7",
|
|
45
|
+
"@umacloud/model-e5-small": "1.0.7",
|
|
46
|
+
"@umacloud/knowledge": "1.0.7"
|
|
44
47
|
}
|
|
45
48
|
}
|