Skip to content

Commit 3f22a6b

Browse files
committed
install agent package when linking
1 parent a0877d3 commit 3f22a6b

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

bin/setup

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,27 @@ fi
1313
# Start with base workspace config
1414
cp pnpm-workspace.base.yaml pnpm-workspace.yaml
1515

16-
# If AGENT_PACKAGE_LOCATION is set, add the override
16+
# If AGENT_PACKAGE_LOCATION is set, add the override and build the agent
1717
if [ -n "$AGENT_PACKAGE_LOCATION" ]; then
1818
echo "✓ Using local @posthog/agent from: $AGENT_PACKAGE_LOCATION"
1919
cat >> pnpm-workspace.yaml <<EOF
2020
2121
overrides:
2222
"@posthog/agent": $AGENT_PACKAGE_LOCATION
2323
EOF
24+
25+
# Extract the path from file:../agent format
26+
AGENT_PATH="${AGENT_PACKAGE_LOCATION#file:}"
27+
28+
if [ -d "$AGENT_PATH" ]; then
29+
echo "📦 Building @posthog/agent..."
30+
(cd "$AGENT_PATH" && pnpm install && pnpm build)
31+
echo "✓ @posthog/agent built successfully"
32+
else
33+
echo "⚠️ Warning: Agent path $AGENT_PATH does not exist"
34+
fi
2435
else
2536
echo "✓ Using production @posthog/agent package"
2637
fi
2738

2839
echo "✓ Workspace configured"
29-
echo ""
30-
echo "Now run: pnpm install"

0 commit comments

Comments
 (0)