From cda047feb29e0359cca6cb97ce87d4d70ce54904 Mon Sep 17 00:00:00 2001 From: Mauricio Siu Date: Tue, 25 Aug 2026 01:20:10 -0600 Subject: [PATCH] chore: add install-worktree-deps.sh script for dependency installation --- .claude/settings.json | 7 +++++-- scripts/install-worktree-deps.sh | 17 +++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100755 scripts/install-worktree-deps.sh diff --git a/.claude/settings.json b/.claude/settings.json index 8955e7721..77f39858f 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -1,13 +1,16 @@ { "worktree": { - "baseRef": "fresh", - "symlinkDirectories": ["node_modules"] + "baseRef": "fresh" }, "hooks": { "PostToolUse": [ { "matcher": "EnterWorktree", "hooks": [ + { + "type": "command", + "command": "\"$CLAUDE_PROJECT_DIR/scripts/install-worktree-deps.sh\"" + }, { "type": "command", "command": "\"$CLAUDE_PROJECT_DIR/scripts/assign-worktree-port.sh\"" diff --git a/scripts/install-worktree-deps.sh b/scripts/install-worktree-deps.sh new file mode 100755 index 000000000..2d41f7458 --- /dev/null +++ b/scripts/install-worktree-deps.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +set -euo pipefail + +PAYLOAD=$(cat) +WORKTREE_PATH=$(echo "$PAYLOAD" | jq -r '.tool_response.worktreePath // empty') + +if [ -z "$WORKTREE_PATH" ]; then + exit 0 +fi + +# Turbopack refuses to resolve through anything outside its detected +# workspace root, so a symlinked node_modules (whole dir or per-entry) +# doesn't work for apps/dokploy. A real `pnpm install` is required, but +# since pnpm's global content-addressable store is already warm, this +# only links locally — no network fetch, a few seconds. +cd "$WORKTREE_PATH" +pnpm install --prefer-offline