You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/copilot-instructions.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,15 +7,16 @@ This file gives targeted, actionable guidance for an AI coding agent working on
7
7
**Why this matters:** the app is a CLI + image-exporter that fetches GitHub data, analyzes it, renders a terminal UI (Ink) and optionally exports images (Satori → Sharp/Resvg). Many behaviors are implemented by coordinating multiple files (data fetch → analysis → UI → export worker).
8
8
9
9
**Quick facts**
10
-
-**Runtime:** ESM + TypeScript (built to run under Bun; Node used for the export worker)
11
-
-**Preferred runner:**`bun`(recommended in `README.md`) — use `bun install`, `bun run build`, `bun run dev`, `bun start`
10
+
-**Runtime:** ESM + TypeScript (built with Bun; Node required for running due to Playwright)
11
+
-**Preferred workflow:**`bun`for dev/build, `node` for running — use `bun install`, `bun run build`, `bun run dev`, then `npm start` or `node dist/index.js`
- Run locally: `bun start` or `bunx github-wrapped-2025`
17
+
- Build: `bun run build` (use Bun - faster)
18
+
- Run built version: `npm start` or `node dist/index.js` (IMPORTANT: use Node, not Bun - Playwright compatibility)
19
+
- Run without installing: `bunx gh-wrapped-2025` or `npx gh-wrapped-2025`
19
20
20
21
**Important runtime notes**
21
22
- Exports use a Node worker (`src/export-worker.mjs`) invoked via file-based IPC (temp JSON files). This is intentional to avoid Bun + WASM and Windows pipe issues — do not replace this with a naive child pipe without handling the Windows case.
@@ -46,7 +47,7 @@ This file gives targeted, actionable guidance for an AI coding agent working on
46
47
- Run app locally (recommended):
47
48
-`bun install`
48
49
-`bun run build`
49
-
-`bun start`
50
+
-`npm start` (or `node dist/index.js` - use Node, NOT Bun)
@@ -61,7 +62,8 @@ This file gives targeted, actionable guidance for an AI coding agent working on
61
62
-`src/export.ts` + `src/export-worker.mjs` — the export orchestration and worker contract
62
63
63
64
**Testing & verification guidance**
64
-
- Use `bun run dev` for iterating UI changes (fast). Use `bun run build` then `bun start` to replicate production behavior.
65
+
- Use `bun run dev` for iterating UI changes (fast). Use `bun run build` then `npm start` (or `node dist/index.js`) to replicate production behavior.
65
66
- For export changes, run the worker directly with `node` and a synthetic `input.json` containing a minimal `WrappedStats` object to validate Satori → Sharp rendering.
67
+
-**IMPORTANT:** Never test with `bun start` - Playwright has compatibility issues with Bun runtime. Always use Node for running the built version.
66
68
67
69
If anything in this guidance is unclear or you want more detail for a specific area (e.g., GraphQL queries, export fonts, or how achievements are calculated), tell me which part and I will expand or update this file.
# Run the built version (use Node, not Bun - see note below)
76
75
npm start
76
+
# or
77
+
node dist/index.js
77
78
```
78
79
80
+
**⚠️ Important:** Always use **Node** to run the built version (`npm start` or `node dist/index.js`), not `bun start`. The image export feature uses Playwright which has known compatibility issues with Bun's runtime, especially on Windows. Bun is great for development and building, but Node is required for running the final output.
81
+
79
82
## How It Works
80
83
81
84
1. Fetches your public GitHub data via GitHub API
@@ -111,7 +114,7 @@ npm install
111
114
112
115
### Development mode
113
116
```bash
114
-
# With Bun (hot reload)
117
+
# With Bun (recommended - hot reload)
115
118
bun run dev
116
119
117
120
# Or with npm
@@ -120,13 +123,21 @@ npm run dev
120
123
121
124
### Build
122
125
```bash
123
-
# With Bun (faster)
126
+
# With Bun (recommended - faster)
124
127
bun run build
125
128
126
129
# Or with npm
127
130
npm run build
128
131
```
129
132
133
+
### Run built version
134
+
```bash
135
+
# IMPORTANT: Use Node, not Bun (Playwright compatibility)
0 commit comments