@andrew_l/app 0.3.7 → 0.3.8
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/vrun +30 -6
- package/package.json +3 -3
package/bin/vrun
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
2
|
|
|
3
|
-
ROOT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
ROOT_DIR="$(cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
|
|
4
|
+
PKG_DIR="$(cd -P -- "$ROOT_DIR/.." && pwd)"
|
|
5
|
+
SCRIPT_FILE="$PKG_DIR/dist/vrun.mjs"
|
|
6
6
|
DEV_MODE=0
|
|
7
7
|
WATCH_MODE=0
|
|
8
8
|
ARGS=()
|
|
@@ -18,12 +18,36 @@ for arg in "$@"; do
|
|
|
18
18
|
fi
|
|
19
19
|
done
|
|
20
20
|
|
|
21
|
+
resolve_tsx_cli() {
|
|
22
|
+
# pnpm peer layout: peer is a sibling of the package's parent scope dir.
|
|
23
|
+
local candidate="$PKG_DIR/../../tsx/dist/cli.mjs"
|
|
24
|
+
if [ -f "$candidate" ]; then
|
|
25
|
+
printf '%s\n' "$candidate"
|
|
26
|
+
return
|
|
27
|
+
fi
|
|
28
|
+
# Hoisted layout: walk up looking for node_modules/tsx.
|
|
29
|
+
local dir="$PKG_DIR"
|
|
30
|
+
while [ -n "$dir" ] && [ "$dir" != "/" ]; do
|
|
31
|
+
if [ -f "$dir/node_modules/tsx/dist/cli.mjs" ]; then
|
|
32
|
+
printf '%s\n' "$dir/node_modules/tsx/dist/cli.mjs"
|
|
33
|
+
return
|
|
34
|
+
fi
|
|
35
|
+
dir="${dir%/*}"
|
|
36
|
+
done
|
|
37
|
+
}
|
|
38
|
+
|
|
21
39
|
if [ $DEV_MODE -eq 1 ]; then
|
|
22
40
|
if [ $WATCH_MODE -eq 1 ]; then
|
|
23
|
-
|
|
41
|
+
echo "$PWD"
|
|
42
|
+
TSX_CLI="$(resolve_tsx_cli)"
|
|
43
|
+
if [ -z "$TSX_CLI" ]; then
|
|
44
|
+
echo "vrun: cannot resolve tsx peer dependency. Install tsx ^4.22.4." >&2
|
|
45
|
+
exit 1
|
|
46
|
+
fi
|
|
47
|
+
exec env VRUN=true VRUN_TS_MODE=tsx-register VRUN_WATCH=true node --watch "$SCRIPT_FILE" "${ARGS[@]}"
|
|
24
48
|
else
|
|
25
|
-
exec env VRUN=true VRUN_TS_MODE=tsx-register node $SCRIPT_FILE "$@"
|
|
49
|
+
exec env VRUN=true VRUN_TS_MODE=tsx-register node "$SCRIPT_FILE" "$@"
|
|
26
50
|
fi
|
|
27
51
|
else
|
|
28
|
-
exec env VRUN=true node $SCRIPT_FILE "$@"
|
|
52
|
+
exec env VRUN=true node "$SCRIPT_FILE" "$@"
|
|
29
53
|
fi
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@andrew_l/app",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.8",
|
|
4
4
|
"description": "Application runner.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"dotenv": "^17.4.2",
|
|
41
41
|
"ink": "^7.0.6",
|
|
42
42
|
"react": "^19.2.7",
|
|
43
|
-
"@andrew_l/
|
|
44
|
-
"@andrew_l/
|
|
43
|
+
"@andrew_l/graceful": "0.3.8",
|
|
44
|
+
"@andrew_l/toolkit": "0.3.8"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"tsx": "^4.22.4"
|