dx: 'dist' won't include uncommitted code
Massimo Melina committed
Jul 5, 2025 at 13:06 UTC
a0a3b98b2f2b9cb83ad26e0cfd1f7299afe76d0a
1 file changed
+2
-1
package.json
+2
-1
@@ -22,7 +22,8 @@
22
"test-with-server": "rm -rf tests/work && (node dist/src --cwd tests/work --config tests & echo $! > .server_pid) && sleep 2 && node --import tsx --test tests/test.ts; _exit=$?; SERVER_PID=$(cat ./.server_pid); kill \"$SERVER_PID\" 2>/dev/null || true; rm -f ./.server_pid; exit $_exit",
23
"test-ui": "npx playwright test --ui",
24
"pub": "cd dist && npm publish",
25
- "dist": "npm run build-all && npx playwright test frontend && npx playwright test serial && npm run dist-bin",
25
+ "dist": "(git diff-index --quiet HEAD -- || git stash push -m 'dist') && (CI=1 npm run dist-uncommitted || (EXIT_CODE=$? && git stash pop || true && exit $EXIT_CODE)); git stash pop || true",
26
+ "dist-uncommitted": "npm run build-all && npx playwright test frontend && npx playwright test serial && npm run dist-bin",
27
"dist-bin": "npm run dist-modules && npm run dist-bin-win && npm run dist-bin-linux && npm run dist-bin-mac && npm run dist-bin-mac-arm",
28
"dist-modules": "cp package*.json central.json dist && cd dist && npm ci --omit=dev && cd .. && node prune_modules",
29
"dist-pre": "cd dist && rm -rf node_modules/@node-rs/crc32-*",