Skip to content

Commit 589a36f

Browse files
feat(devex): Replace mprocs with phrocs (#1263)
Co-authored-by: Charles Vien <charles.v@posthog.com>
1 parent 23cf2cb commit 589a36f

File tree

7 files changed

+44
-29
lines changed

7 files changed

+44
-29
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ out/
88
.vite/
99
.turbo/
1010
storybook-static
11+
bin/
1112

1213
# Environment
1314
.env

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
## Commands
1515

1616
- `pnpm install` - Install all dependencies
17-
- `pnpm dev` - Run both agent (watch) and code app via mprocs
17+
- `pnpm dev` - Run both agent (watch) and code app via phrocs
1818
- `pnpm dev:agent` - Run agent package in watch mode only
1919
- `pnpm dev:code` - Run code desktop app only
2020
- `pnpm build` - Build all packages (turbo)

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ pnpm install
2727

2828
# Copy environment config
2929
cp .env.example .env
30+
31+
# phrocs is auto-installed on first `pnpm dev`
3032
```
3133

3234
### Running in Development

mprocs.yaml

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,20 @@
11
procs:
22
code:
3-
cmd: ["pnpm", "--filter", "code", "run", "start"]
4-
cwd: .
5-
color: blue
3+
shell: 'pnpm --filter code run start'
64
depends_on:
75
- agent
86
- git
97

108
agent:
11-
cmd: ["pnpm", "--filter", "agent", "run", "dev"]
12-
cwd: .
13-
color: magenta
14-
9+
shell: 'pnpm --filter agent run dev'
10+
1511
git:
16-
cmd: ["pnpm", "--filter", "@posthog/git", "run", "dev"]
17-
cwd: .
18-
color: yellow
12+
shell: 'pnpm --filter @posthog/git run dev'
1913

2014
storybook:
21-
cmd: ["pnpm", "--filter", "code", "run", "storybook"]
22-
cwd: .
23-
color: cyan
15+
shell: 'pnpm --filter code run storybook'
2416
autostart: false
2517

2618
mobile-ios:
27-
cmd: ["pnpm", "--filter", "@posthog/mobile", "run", "ios"]
28-
cwd: .
29-
color: green
19+
shell: 'pnpm --filter @posthog/mobile run ios'
3020
autostart: false

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"scripts": {
1111
"setup": "bash apps/code/bin/setup",
1212
"prepare": "husky",
13-
"dev": "pnpm build:deps && mprocs",
13+
"dev": "pnpm build:deps && bash scripts/ensure-phrocs.sh && bin/phrocs --config mprocs.yaml",
1414
"dev:agent": "pnpm --filter agent dev",
1515
"dev:git": "pnpm --filter @posthog/git dev",
1616
"dev:code": "pnpm --filter code start",
@@ -45,7 +45,6 @@
4545
"husky": "^9.1.7",
4646
"knip": "^5.66.3",
4747
"lint-staged": "^15.5.2",
48-
"mprocs": "^0.7.1",
4948
"turbo": "^2.6.2"
5049
},
5150
"lint-staged": {

pnpm-lock.yaml

Lines changed: 0 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/ensure-phrocs.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
PHROCS_BIN="bin/phrocs"
5+
6+
if [ -x "$PHROCS_BIN" ]; then
7+
exit 0
8+
fi
9+
10+
echo "phrocs not found, downloading..."
11+
12+
ARCH=$(uname -m)
13+
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
14+
15+
case "$ARCH" in
16+
arm64|aarch64) ARCH="arm64" ;;
17+
x86_64) ARCH="amd64" ;;
18+
*) echo "Unsupported architecture: $ARCH" >&2; exit 1 ;;
19+
esac
20+
21+
case "$OS" in
22+
darwin|linux) ;;
23+
*) echo "Unsupported OS: $OS" >&2; exit 1 ;;
24+
esac
25+
26+
BINARY="phrocs-${OS}-${ARCH}"
27+
URL="https://github.com/PostHog/posthog/releases/download/phrocs-latest/${BINARY}"
28+
29+
mkdir -p bin
30+
curl -fSL "$URL" -o "$PHROCS_BIN"
31+
chmod +x "$PHROCS_BIN"
32+
33+
echo "phrocs installed to $PHROCS_BIN"

0 commit comments

Comments
 (0)