hacer npm run más rápido

This commit is contained in:
Cat /dev/Nulo 2023-02-20 15:27:58 -03:00
parent 8104a7d4eb
commit b9ee26ef81
2 changed files with 13 additions and 6 deletions

10
npmrun Executable file
View file

@ -0,0 +1,10 @@
#!/bin/sh
script="$1"
if test -z "$script"; then
echo "No script set"
exit 1
fi
run="$(jq -r ".scripts[\"${script}\"]" < package.json)"
echo "> $run"
PATH="./node_modules/.bin:$PATH" sh -c "$run"

View file

@ -7,9 +7,9 @@
"scripts": { "scripts": {
"build": "esbuild --log-level=warning --target=node18 --platform=node --sourcemap --outdir=build-javascript --format=esm --bundle index.ts", "build": "esbuild --log-level=warning --target=node18 --platform=node --sourcemap --outdir=build-javascript --format=esm --bundle index.ts",
"build:qemu": "esbuild --log-level=warning --target=node18 --platform=node --sourcemap --outdir=build-javascript --format=esm --bundle qemu.ts", "build:qemu": "esbuild --log-level=warning --target=node18 --platform=node --sourcemap --outdir=build-javascript --format=esm --bundle qemu.ts",
"build-image": "pnpm build && doas node --enable-source-maps build-javascript/index.js", "build-image": "./npmrun build && doas node --enable-source-maps build-javascript/index.js",
"run": "pnpm build-image && pnpm build:qemu && node --enable-source-maps build-javascript/qemu.js", "run": "./npmrun build-image && ./npmrun build:qemu && node --enable-source-maps build-javascript/qemu.js",
"//test": "pnpm build && node --enable-source-maps build-javascript/**/*.test.js", "//test": "./npmrun build && node --enable-source-maps build-javascript/**/*.test.js",
"tsc:check": "tsc --noEmit" "tsc:check": "tsc --noEmit"
}, },
"keywords": [], "keywords": [],
@ -19,8 +19,5 @@
"@types/node": "^18.11.18", "@types/node": "^18.11.18",
"esbuild": "^0.17.0", "esbuild": "^0.17.0",
"typescript": "^4.9.4" "typescript": "^4.9.4"
},
"dependencies": {
"nanoid": "^4.0.1"
} }
} }