From f4c686c298ce35b9013fb84a1a81e39e7a1ba501 Mon Sep 17 00:00:00 2001 From: Dermot Duffy Date: Sat, 23 May 2026 08:52:39 -0700 Subject: [PATCH] chore: Allow parallel rollup instances (#2499) --- .vscode/run-once.sh | 46 --------------------------------------------- .vscode/tasks.json | 4 ++-- 2 files changed, 2 insertions(+), 48 deletions(-) delete mode 100755 .vscode/run-once.sh diff --git a/.vscode/run-once.sh b/.vscode/run-once.sh deleted file mode 100755 index 8ce94520..00000000 --- a/.vscode/run-once.sh +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env bash -# Ensures only one instance of a command runs at a time. If a previous -# instance is still running (e.g. orphaned after a VS Code crash), it is -# killed before starting the new one. -# -# Kills the entire process tree (not just the stored PID) because `yarn` -# spawns child processes (e.g. rollup/node) that hold the port. After -# killing, waits for the port to be released before starting the new -# instance. -# -# Usage: run-once.sh - -set -euo pipefail - -PIDFILE="$1"; shift -PORT="$1"; shift - -kill_tree() { - local pid="$1" - # Kill children first (depth-first), then the parent. - pkill -TERM -P "$pid" 2>/dev/null || true - kill "$pid" 2>/dev/null || true - tail --pid="$pid" -f /dev/null 2>/dev/null || true -} - -wait_for_port() { - local port="$1" - local attempts=0 - while ss -tlnp | grep -q ":${port} " && [ $attempts -lt 30 ]; do - sleep 0.2 - attempts=$((attempts + 1)) - done -} - -if [ -f "$PIDFILE" ]; then - OLD_PID=$(cat "$PIDFILE" 2>/dev/null || true) - if [ -n "$OLD_PID" ] && kill -0 "$OLD_PID" 2>/dev/null; then - kill_tree "$OLD_PID" - fi - rm -f "$PIDFILE" - wait_for_port "$PORT" -fi - -trap 'rm -f "$PIDFILE"' EXIT -echo $$ > "$PIDFILE" -exec "$@" diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 0d1f8767..8e49fdbe 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -4,8 +4,8 @@ { "label": "Rollup", "type": "shell", - "command": "${workspaceFolder}/.vscode/run-once.sh", - "args": ["/tmp/advanced-camera-card-rollup.pid", "10001", "yarn", "start"], + "command": "yarn", + "args": ["start"], "problemMatcher": { "pattern": [ {