Skip to content

Commit f23a85a

Browse files
committed
add bin/setup
1 parent 4722ed4 commit f23a85a

File tree

7 files changed

+44
-6
lines changed

7 files changed

+44
-6
lines changed

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ APPLE_TEAM_ID=
1616
APPLE_CODESIGN_CERT_BASE64=
1717
APPLE_CODESIGN_CERT_PASSWORD=
1818
APPLE_CODESIGN_KEYCHAIN_PASSWORD=
19+
20+
# Uncomment to use local @posthog/agent package
21+
# AGENT_PACKAGE_LOCATION=file:../agent

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ jobs:
9393
with:
9494
node-version: 22
9595
cache: "pnpm"
96+
- name: Setup workspace
97+
run: bin/setup
9698
- name: Install dependencies
9799
run: pnpm install --frozen-lockfile
98100
- name: Import code signing certificate

.github/workflows/typecheck.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
uses: actions/setup-node@v4
2020
with:
2121
cache: 'pnpm'
22+
- name: Setup workspace
23+
run: bin/setup
2224
- name: Install dependencies
2325
run: pnpm install --frozen-lockfile
2426
- name: Run type check

bin/setup

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
# Setup script for Array development environment
4+
# Run this after cloning or when changing AGENT_PACKAGE_LOCATION in .env
5+
6+
echo "🔧 Setting up Array development environment..."
7+
8+
# Load .env file if it exists
9+
if [ -f .env ]; then
10+
export $(grep -v '^#' .env | grep -v '^[[:space:]]*$' | xargs)
11+
fi
12+
13+
# Start with base workspace config
14+
cp pnpm-workspace.base.yaml pnpm-workspace.yaml
15+
16+
# If AGENT_PACKAGE_LOCATION is set, add the override
17+
if [ -n "$AGENT_PACKAGE_LOCATION" ]; then
18+
echo "✓ Using local @posthog/agent from: $AGENT_PACKAGE_LOCATION"
19+
cat >> pnpm-workspace.yaml <<EOF
20+
21+
overrides:
22+
"@posthog/agent": $AGENT_PACKAGE_LOCATION
23+
EOF
24+
else
25+
echo "✓ Using production @posthog/agent package"
26+
fi
27+
28+
echo "✓ Workspace configured"
29+
echo ""
30+
echo "Now run: pnpm install"

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
},
1111
"packageManager": "[email protected]",
1212
"scripts": {
13+
"setup": "bash bin/setup",
1314
"start": "electron-forge start",
1415
"package": "electron-forge package",
1516
"make": "electron-forge make",

pnpm-workspace.base.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
packages:
2+
- .
3+
4+
onlyBuiltDependencies:
5+
- electron
6+
- esbuild

pnpm-workspace.yaml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +0,0 @@
1-
packages:
2-
- .
3-
4-
onlyBuiltDependencies:
5-
- electron
6-
- esbuild

0 commit comments

Comments
 (0)