Skip to content

Commit c3546f1

Browse files
authored
Merge pull request #4 from d3varaja/feat/v1-finalise
Rename CLI and update documentation for gh-wrapped-2025
2 parents 297930b + d0a5d88 commit c3546f1

File tree

9 files changed

+71
-957
lines changed

9 files changed

+71
-957
lines changed

.github/copilot-instructions.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ This file gives targeted, actionable guidance for an AI coding agent working on
77
**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).
88

99
**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`
1212
- **Key dirs/files:** `src/index.tsx`, `src/ui.tsx`, `src/github.ts`, `src/github-graphql*.ts`, `src/analytics.ts`, `src/export.ts`, `src/export-worker.mjs`, `src/types.ts`, `src/fonts/`
1313

1414
**Commands**
1515
- Install deps: `bun install` (or `npm install`)
1616
- Dev (hot reload with Bun): `bun run dev`
17-
- Build: `bun run build`
18-
- 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`
1920

2021
**Important runtime notes**
2122
- 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
4647
- Run app locally (recommended):
4748
- `bun install`
4849
- `bun run build`
49-
- `bun start`
50+
- `npm start` (or `node dist/index.js` - use Node, NOT Bun)
5051

5152
- Run export worker directly for debugging:
5253
- `node src/export-worker.mjs /path/to/input.json /path/to/output.json`
@@ -61,7 +62,8 @@ This file gives targeted, actionable guidance for an AI coding agent working on
6162
- `src/export.ts` + `src/export-worker.mjs` — the export orchestration and worker contract
6263

6364
**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.
6566
- 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.
6668

6769
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.

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,7 @@ test-results/
5757

5858
# Bun
5959
bun.lockb
60+
bunfig.toml
61+
62+
# Claude Code
63+
.claude/

README.md

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ A CLI tool that analyzes your GitHub activity for 2025 and generates beautiful s
1212

1313
### Using Bun (Recommended - 100x faster)
1414
```bash
15-
bunx github-wrapped-2025
15+
bunx gh-wrapped-2025
1616
```
1717

1818
### Using npm
1919
```bash
20-
npx github-wrapped-2025
20+
npx gh-wrapped-2025
2121
```
2222

2323
1. Enter your GitHub username
@@ -40,23 +40,23 @@ npx github-wrapped-2025
4040

4141
### Run with bunx (Recommended - 100x faster!)
4242
```bash
43-
bunx github-wrapped-2025
43+
bunx gh-wrapped-2025
4444
```
4545
No installation needed! Just run it once and the app handles everything.
4646

4747
### Run with npx (Also works)
4848
```bash
49-
npx github-wrapped-2025
49+
npx gh-wrapped-2025
5050
```
5151

5252
### Install Globally
5353
```bash
5454
# With Bun
55-
bun install -g github-wrapped-2025
55+
bun install -g gh-wrapped-2025
5656
github-wrapped
5757

5858
# With npm
59-
npm install -g github-wrapped-2025
59+
npm install -g gh-wrapped-2025
6060
github-wrapped
6161
```
6262

@@ -65,17 +65,20 @@ github-wrapped
6565
git clone https://github.com/d3varaja/gh-wrapped-cli.git
6666
cd gh-wrapped-cli
6767

68-
# Install with Bun (recommended)
69-
bun install
70-
bun run build
71-
bun start
68+
# Install dependencies
69+
bun install # or npm install
7270

73-
# Or with npm
74-
npm install
75-
npm run build
71+
# Build the project
72+
bun run build # or npm run build
73+
74+
# Run the built version (use Node, not Bun - see note below)
7675
npm start
76+
# or
77+
node dist/index.js
7778
```
7879

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+
7982
## How It Works
8083

8184
1. Fetches your public GitHub data via GitHub API
@@ -111,7 +114,7 @@ npm install
111114

112115
### Development mode
113116
```bash
114-
# With Bun (hot reload)
117+
# With Bun (recommended - hot reload)
115118
bun run dev
116119

117120
# Or with npm
@@ -120,13 +123,21 @@ npm run dev
120123

121124
### Build
122125
```bash
123-
# With Bun (faster)
126+
# With Bun (recommended - faster)
124127
bun run build
125128

126129
# Or with npm
127130
npm run build
128131
```
129132

133+
### Run built version
134+
```bash
135+
# IMPORTANT: Use Node, not Bun (Playwright compatibility)
136+
npm start
137+
# or
138+
node dist/index.js
139+
```
140+
130141
### Project Structure
131142
```
132143
src/
@@ -143,7 +154,7 @@ src/
143154
You can also use this as a library:
144155

145156
```typescript
146-
import { GitHubClient } from 'github-wrapped-2025';
157+
import { GitHubClient } from 'gh-wrapped-2025';
147158

148159
const client = new GitHubClient('username');
149160
const repos = await client.getRepositories();
@@ -188,7 +199,7 @@ If you're developing or running this locally, you can set a token beforehand:
188199

189200
```bash
190201
# Environment variable (one-time)
191-
GITHUB_TOKEN=your_token npx github-wrapped-2025
202+
GITHUB_TOKEN=your_token npx gh-wrapped-2025
192203

193204
# Or create .env file in project directory
194205
echo "GITHUB_TOKEN=your_token" > .env

bunfig.toml

Lines changed: 0 additions & 21 deletions
This file was deleted.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"name": "github-wrapped-2025",
2+
"name": "gh-wrapped-2025",
33
"version": "1.0.3",
44
"description": "Your GitHub year in review - in your terminal",
55
"main": "dist/index.js",
66
"bin": {
77
"github-wrapped": "./dist/index.js",
8-
"github-wrapped-2025": "./dist/index.js"
8+
"gh-wrapped-2025": "./dist/index.js"
99
},
1010
"type": "module",
1111
"files": [

0 commit comments

Comments
 (0)