File tree Expand file tree Collapse file tree 7 files changed +67
-1
lines changed Expand file tree Collapse file tree 7 files changed +67
-1
lines changed Original file line number Diff line number Diff line change @@ -16,3 +16,6 @@ APPLE_TEAM_ID=
1616APPLE_CODESIGN_CERT_BASE64 =
1717APPLE_CODESIGN_CERT_PASSWORD =
1818APPLE_CODESIGN_KEYCHAIN_PASSWORD =
19+
20+ # Uncomment to use local @posthog/agent package
21+ # AGENT_PACKAGE_LOCATION=file:../agent
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Load .env file if it exists
4+ if [ -f .env ]; then
5+ export $( grep -v ' ^#' .env | grep -v ' ^[[:space:]]*$' | xargs 2> /dev/null)
6+ fi
7+
8+ # Check if AGENT_PACKAGE_LOCATION is set and lockfile is being committed
9+ if [ -n " $AGENT_PACKAGE_LOCATION " ]; then
10+ if git diff --cached --name-only | grep -q " pnpm-lock.yaml" ; then
11+ echo " β Error: Cannot commit pnpm-lock.yaml when AGENT_PACKAGE_LOCATION is set"
12+ echo " You have a local agent override active in .env"
13+ echo " Either:"
14+ echo " - Comment out AGENT_PACKAGE_LOCATION in .env and run bin/setup"
15+ echo " - Unstage pnpm-lock.yaml: git reset pnpm-lock.yaml"
16+ exit 1
17+ fi
18+ fi
19+
120pnpm lint-staged
Original file line number Diff line number Diff line change 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 and build the agent
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+
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
35+ else
36+ echo " β Using production @posthog/agent package"
37+ fi
38+
39+ echo " β Workspace configured"
Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff line change @@ -3,4 +3,4 @@ packages:
33
44onlyBuiltDependencies :
55 - electron
6- - esbuild
6+ - esbuild
You canβt perform that action at this time.
0 commit comments