Skip to content

Commit 6af98c1

Browse files
authored
fix: Fix pnpm clean, add troubleshooting docs and reorganize docs/ (#973)
1 parent 5a27510 commit 6af98c1

13 files changed

Lines changed: 11885 additions & 11381 deletions

File tree

README.md

Lines changed: 14 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ pnpm dev:agent # Run agent in watch mode
4040
pnpm dev:twig # Run twig app
4141
```
4242

43+
> **Want to connect to a local PostHog instance?** See [docs/LOCAL-DEVELOPMENT.md](./docs/LOCAL-DEVELOPMENT.md) for OAuth setup and connecting to localhost:8010.
44+
4345
### Utility Scripts
4446

4547
Scripts in `scripts/` for development and debugging:
@@ -54,59 +56,29 @@ Scripts in `scripts/` for development and debugging:
5456
```
5557
twig/
5658
├── apps/
57-
│ ├── twig/ # Electron desktop app (React, Vite)
58-
│ ├── mobile/ # React Native mobile app (Expo)
59-
│ └── cli/ # CLI for stacked PRs
59+
│ ├── twig/ # Electron desktop app (React, Vite)
60+
│ ├── mobile/ # React Native mobile app (Expo)
61+
│ └── cli/ # CLI for stacked PRs
6062
├── packages/
61-
│ ├── agent/ # TypeScript agent framework
62-
│ ├── core/ # Shared business logic
63-
│ ├── electron-trpc/ # tRPC for Electron IPC
64-
│ └── shared/ # Shared utilities (Saga pattern, etc.)
63+
│ ├── agent/ # TypeScript agent framework
64+
│ ├── core/ # Shared business logic
65+
│ ├── electron-trpc/ # tRPC for Electron IPC
66+
│ └── shared/ # Shared utilities (Saga pattern, etc.)
6567
```
6668

6769
## Documentation
6870

6971
| File | Description |
7072
|------|-------------|
71-
| [CLAUDE.md](./CLAUDE.md) | Code style, patterns, and testing guidelines |
72-
| [UPDATES.md](./UPDATES.md) | Release versioning and git tagging |
7373
| [apps/twig/README.md](./apps/twig/README.md) | Desktop app: building, signing, distribution, and workspace configuration |
7474
| [apps/twig/ARCHITECTURE.md](./apps/twig/ARCHITECTURE.md) | Desktop app: dependency injection, tRPC, state management, and events |
7575
| [apps/mobile/README.md](./apps/mobile/README.md) | Mobile app: Expo setup, EAS builds, and TestFlight deployment |
7676
| [apps/cli/README.md](./apps/cli/README.md) | CLI: stacked PR management with Jujutsu |
77+
| [CLAUDE.md](./CLAUDE.md) | Code style, patterns, and testing guidelines |
78+
| [docs/LOCAL-DEVELOPMENT.md](./docs/LOCAL-DEVELOPMENT.md) | Connecting Twig to a local PostHog instance |
79+
| [docs/UPDATES.md](./docs/UPDATES.md) | Release versioning and git tagging |
80+
| [docs/TROUBLESHOOTING.md](./docs/TROUBLESHOOTING.md) | Common issues and fixes |
7781

7882
## Troubleshooting
7983

80-
### Electron failed to install correctly
81-
82-
If you see this error when running `pnpm dev`:
83-
84-
```
85-
Error: Electron failed to install correctly, please delete node_modules/electron and try installing again
86-
```
87-
88-
The electron binary didn't download during install. Fix it by running the install script manually:
89-
90-
```bash
91-
cd node_modules/electron && node install.js
92-
```
93-
94-
Or nuke it and reinstall:
95-
96-
```bash
97-
rm -rf node_modules/electron && pnpm install && cd node_modules/electron && node install.js
98-
```
99-
100-
### Native module crash (libc++abi / Napi::Error)
101-
102-
If the app crashes with something like:
103-
104-
```
105-
libc++abi: terminating due to uncaught exception of type Napi::Error
106-
```
107-
108-
Native modules (like node-pty) need to be rebuilt for your Electron version:
109-
110-
```bash
111-
pnpm --filter twig exec electron-rebuild
112-
```
84+
See [docs/TROUBLESHOOTING.md](./docs/TROUBLESHOOTING.md) for common issues (black screen, Electron install failures, native module crashes, etc.).

apps/mobile/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"prebuild": "expo prebuild",
1111
"lint": "biome check .",
1212
"lint:fix": "biome check --write .",
13-
"format": "biome format --write ."
13+
"format": "biome format --write .",
14+
"clean": "rm -rf .turbo .expo"
1415
},
1516
"dependencies": {
1617
"@expo/ui": "0.2.0-beta.9",

apps/twig/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
"test:e2e:headed": "playwright test --config=tests/e2e/playwright.config.ts --headed",
2828
"postinstall": "cd ../.. && npx @electron/rebuild -f -m node_modules/node-pty || true && bash apps/twig/scripts/patch-electron-name.sh && node apps/twig/scripts/download-binaries.mjs",
2929
"storybook": "storybook dev -p 6006",
30-
"build-storybook": "storybook build"
30+
"build-storybook": "storybook build",
31+
"clean": "rm -rf .vite .turbo out node_modules/.vite"
3132
},
3233
"keywords": [
3334
"posthog",

apps/twig/scripts/update-openapi-client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if (!POSTHOG_API_HOST) {
1414

1515
const SCHEMA_URL = `${POSTHOG_API_HOST}/api/schema/`;
1616
const TEMP_SCHEMA_PATH = "temp-openapi.yaml";
17-
const OUTPUT_PATH = "src/api/generated.ts";
17+
const OUTPUT_PATH = "src/renderer/api/generated.ts";
1818

1919
const INCLUDED_ENDPOINT_PREFIXES = [
2020
"/api/projects/{project_id}/tasks",

0 commit comments

Comments
 (0)