Skip to content

Commit 785c3f5

Browse files
committed
chore(test): add npx shim for pnpm toolchain
1 parent d85fc95 commit 785c3f5

3 files changed

Lines changed: 42 additions & 5 deletions

File tree

packages/app/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
"build:app": "vite build --ssr src/app/main.ts",
1616
"dev": "vite build --watch --ssr src/app/main.ts",
1717
"prelint": "pnpm -C ../lib build",
18-
"lint": "npx @ton-ai-core/vibecode-linter src/",
19-
"lint:tests": "npx @ton-ai-core/vibecode-linter tests/",
20-
"lint:effect": "npx eslint --config eslint.effect-ts-check.config.mjs .",
18+
"lint": "PATH=../../scripts:$PATH vibecode-linter src/",
19+
"lint:tests": "PATH=../../scripts:$PATH vibecode-linter tests/",
20+
"lint:effect": "PATH=../../scripts:$PATH eslint --config eslint.effect-ts-check.config.mjs .",
2121
"prebuild:docker-git": "pnpm -C ../lib build",
2222
"build:docker-git": "tsc -p tsconfig.build.json",
2323
"check": "pnpm run typecheck",

packages/lib/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
"scripts": {
1111
"build": "tsc -p tsconfig.json",
1212
"dev": "tsc -p tsconfig.json --watch",
13-
"lint": "npx @ton-ai-core/vibecode-linter src/",
14-
"lint:effect": "npx eslint --config eslint.effect-ts-check.config.mjs .",
13+
"lint": "PATH=../../scripts:$PATH vibecode-linter src/",
14+
"lint:effect": "PATH=../../scripts:$PATH eslint --config eslint.effect-ts-check.config.mjs .",
1515
"typecheck": "tsc --noEmit -p tsconfig.json",
1616
"test": "vitest run --passWithNoTests"
1717
},

scripts/npx

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env sh
2+
set -eu
3+
4+
# CHANGE: provide a minimal npx shim for pnpm-managed workspaces
5+
# WHY: some tools (e.g. vibecode-linter) call `npx tsc` which may accidentally run the wrong `tsc` package instead of the local TypeScript compiler
6+
# QUOTE(ТЗ): n/a
7+
# REF: issue-27 (CI/test harness)
8+
# SOURCE: n/a
9+
# FORMAT THEOREM: ∀cmd,args: npx(cmd,args) -> pnpm_exec(cmd,args)
10+
# PURITY: SHELL
11+
# EFFECT: Effect<void, never, never>
12+
# INVARIANT: prefers local workspace binaries over downloading similarly-named packages
13+
# COMPLEXITY: O(1)
14+
15+
# Drop the common "yes/no-install" flags used in automation.
16+
while [ "${1-}" ]; do
17+
case "$1" in
18+
-y|--yes|--no|--no-install|--quiet|--silent)
19+
shift
20+
;;
21+
--)
22+
shift
23+
break
24+
;;
25+
*)
26+
break
27+
;;
28+
esac
29+
done
30+
31+
if [ "${1-}" = "" ]; then
32+
echo "npx shim: missing command" >&2
33+
exit 2
34+
fi
35+
36+
exec pnpm exec "$@"
37+

0 commit comments

Comments
 (0)