@mesh-tech/mesh-cli 0.12.0 → 0.12.2
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/dist/bin/mesh.js +79 -6
- package/dist/bin/mesh.js.map +2 -2
- package/dist/build-info.json +2 -2
- package/dist/src/commands/install-shim.d.ts +7 -0
- package/dist/src/commands/install-shim.d.ts.map +1 -1
- package/dist/src/commands/install-shim.js +63 -4
- package/dist/src/commands/install-shim.js.map +1 -1
- package/package.json +2 -2
package/dist/build-info.json
CHANGED
|
@@ -10,6 +10,13 @@ import { Command } from "commander";
|
|
|
10
10
|
* CLI from TypeScript source — so bare `mesh` always runs the LOCAL source of
|
|
11
11
|
* whatever worktree/app you are in, with no build and nothing global to keep in
|
|
12
12
|
* sync (MESH-2261). Run this once; it survives worktree switches and pulls.
|
|
13
|
+
*
|
|
14
|
+
* Outside any workspace it falls through to a globally installed CLI
|
|
15
|
+
* (MESH-2869). The shim sits in `~/.local/bin`, which is typically ahead of the
|
|
16
|
+
* npm global bin on PATH, so without that fall-through it *shadows*
|
|
17
|
+
* `npm i -g @mesh-tech/mesh-cli`: the new developer's very first commands —
|
|
18
|
+
* `mesh --version`, `mesh login mesh.dev`, run from `~` — die with "not inside a
|
|
19
|
+
* Mesh workspace" even though the CLI is installed and working.
|
|
13
20
|
*/
|
|
14
21
|
/** The cwd-aware resolver written to the PATH. Pure so it can be unit-tested. */
|
|
15
22
|
export declare function shimScript(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install-shim.d.ts","sourceRoot":"","sources":["../../../src/commands/install-shim.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC
|
|
1
|
+
{"version":3,"file":"install-shim.d.ts","sourceRoot":"","sources":["../../../src/commands/install-shim.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC;;;;;;;;;;;;;;;;;;GAkBG;AAEH,iFAAiF;AACjF,wBAAgB,UAAU,IAAI,MAAM,CAsEnC;AAED,6EAA6E;AAC7E,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,2DAA2D;AAC3D,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAG3E;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAmFjE"}
|
|
@@ -14,6 +14,13 @@ import { logError, logInfo, logSuccess, logWarn } from "../utils/log.js";
|
|
|
14
14
|
* CLI from TypeScript source — so bare `mesh` always runs the LOCAL source of
|
|
15
15
|
* whatever worktree/app you are in, with no build and nothing global to keep in
|
|
16
16
|
* sync (MESH-2261). Run this once; it survives worktree switches and pulls.
|
|
17
|
+
*
|
|
18
|
+
* Outside any workspace it falls through to a globally installed CLI
|
|
19
|
+
* (MESH-2869). The shim sits in `~/.local/bin`, which is typically ahead of the
|
|
20
|
+
* npm global bin on PATH, so without that fall-through it *shadows*
|
|
21
|
+
* `npm i -g @mesh-tech/mesh-cli`: the new developer's very first commands —
|
|
22
|
+
* `mesh --version`, `mesh login mesh.dev`, run from `~` — die with "not inside a
|
|
23
|
+
* Mesh workspace" even though the CLI is installed and working.
|
|
17
24
|
*/
|
|
18
25
|
/** The cwd-aware resolver written to the PATH. Pure so it can be unit-tested. */
|
|
19
26
|
export function shimScript() {
|
|
@@ -23,15 +30,67 @@ export function shimScript() {
|
|
|
23
30
|
# it. That resolves to bin/mesh.mjs, which runs the CLI from TypeScript source —
|
|
24
31
|
# so this always runs the LOCAL source of whatever worktree/app you are in, with
|
|
25
32
|
# no build step. Nothing here is version-pinned; do not edit by hand.
|
|
33
|
+
#
|
|
34
|
+
# Outside a workspace it hands off to a globally installed mesh CLI (MESH-2869).
|
|
35
|
+
# Without that hand-off the shim shadows \`npm i -g @mesh-tech/mesh-cli\` on the
|
|
36
|
+
# PATH and \`mesh login\` is unreachable from the home directory — which is the
|
|
37
|
+
# very first thing a new developer runs.
|
|
38
|
+
# True when $1 is another copy of this shim. Reads the marker line with the
|
|
39
|
+
# shell alone — no head/grep — so a stripped PATH cannot break the check.
|
|
40
|
+
_mesh_is_shim() {
|
|
41
|
+
_n=0
|
|
42
|
+
while [ "$_n" -lt 6 ] && IFS= read -r _line; do
|
|
43
|
+
case $_line in *"canonical launcher shim"*) return 0 ;; esac
|
|
44
|
+
_n=$((_n + 1))
|
|
45
|
+
done < "$1"
|
|
46
|
+
return 1
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
# Walk up to the nearest workspace CLI. Parameter expansion, not \`dirname\`:
|
|
50
|
+
# an unavailable dirname used to leave $dir empty and spin this loop forever.
|
|
26
51
|
dir=$(pwd)
|
|
27
|
-
while [ "$dir"
|
|
52
|
+
while [ -n "$dir" ]; do
|
|
28
53
|
if [ -x "$dir/node_modules/.bin/mesh" ]; then
|
|
29
54
|
exec "$dir/node_modules/.bin/mesh" "$@"
|
|
30
55
|
fi
|
|
31
|
-
|
|
56
|
+
[ "$dir" = "/" ] && break
|
|
57
|
+
parent=\${dir%/*}
|
|
58
|
+
[ -n "$parent" ] || parent=/
|
|
59
|
+
dir=$parent
|
|
60
|
+
done
|
|
61
|
+
|
|
62
|
+
# Not in a workspace: exec the next \`mesh\` on PATH that is not another copy of
|
|
63
|
+
# this shim (matched on the marker line above, so we can never exec ourselves).
|
|
64
|
+
self_dir=\${0%/*}
|
|
65
|
+
[ "$self_dir" = "$0" ] && self_dir=.
|
|
66
|
+
self_dir=$(CDPATH= cd -- "$self_dir" 2>/dev/null && pwd -P)
|
|
67
|
+
saved_ifs=$IFS
|
|
68
|
+
IFS=:
|
|
69
|
+
set -f
|
|
70
|
+
for entry in $PATH; do
|
|
71
|
+
IFS=$saved_ifs
|
|
72
|
+
set +f
|
|
73
|
+
[ -n "$entry" ] || entry=.
|
|
74
|
+
candidate=$entry/mesh
|
|
75
|
+
# -f as well as -x: [ -x ] is true for a DIRECTORY named mesh, which would be
|
|
76
|
+
# taken for the CLI and exec'd into a bare 126 without ever reaching the real
|
|
77
|
+
# one further down PATH. A shell's own PATH search skips directories.
|
|
78
|
+
if [ -f "$candidate" ] && [ -x "$candidate" ]; then
|
|
79
|
+
entry_dir=$(CDPATH= cd -- "$entry" 2>/dev/null && pwd -P)
|
|
80
|
+
if [ -n "$entry_dir" ] && [ "$entry_dir" != "$self_dir" ] && ! _mesh_is_shim "$candidate"; then
|
|
81
|
+
exec "$candidate" "$@"
|
|
82
|
+
fi
|
|
83
|
+
fi
|
|
84
|
+
IFS=:
|
|
85
|
+
set -f
|
|
32
86
|
done
|
|
33
|
-
|
|
34
|
-
|
|
87
|
+
IFS=$saved_ifs
|
|
88
|
+
set +f
|
|
89
|
+
|
|
90
|
+
echo "mesh: not inside a Mesh workspace (no node_modules/.bin/mesh found)," >&2
|
|
91
|
+
echo " and no global mesh CLI found on PATH." >&2
|
|
92
|
+
echo " Install it: npm i -g @mesh-tech/mesh-cli" >&2
|
|
93
|
+
echo " Or cd into your app/repo (after 'pnpm install') and use 'pnpm exec mesh'." >&2
|
|
35
94
|
exit 1
|
|
36
95
|
`;
|
|
37
96
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"install-shim.js","sourceRoot":"","sources":["../../../src/commands/install-shim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAEzE
|
|
1
|
+
{"version":3,"file":"install-shim.js","sourceRoot":"","sources":["../../../src/commands/install-shim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EA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,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACnC,CAAC;QAAC,MAAM,CAAC;YACP,iCAAiC;QACnC,CAAC;QAED,IAAI,EAAE,IAAI,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;YAC1C,UAAU,CAAC,8DAA8D,QAAQ,EAAE,CAAC,CAAC;QACvF,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,0BAA0B,MAAM,gCAAgC,CAAC,CAAC;YAC3E,QAAQ,CAAC,KAAK,QAAQ,EAAE,CAAC,CAAC;YAC1B,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;QACvB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mesh-tech/mesh-cli",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.2",
|
|
4
4
|
"description": "CLI for Mesh platform development utilities",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"./package.json": "./package.json"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@mesh-tech/tsconfig": "1.
|
|
36
|
+
"@mesh-tech/tsconfig": "1.18.0",
|
|
37
37
|
"@mesh-tech/workflow-viz": "0.2.1",
|
|
38
38
|
"@tanstack/intent": "^0.3.6",
|
|
39
39
|
"@types/node": "^20.0.0",
|