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
Switch runtime from Bun to Node + tsx; swap bun:sqlite → better-sqlite3
Vercel's serverless functions run on Node, so `bun:sqlite` imports in
lib/db.ts blocked deployment. Moves the codebase onto Node ≥20.9.0 as
the runtime of record while keeping Bun available locally as a fast
package manager (`bun install`, `bun run <script>`).
Runtime + deps:
- lib/db.ts now uses better-sqlite3 (12.9.0, pinned). Schema + prepared
statements unchanged; only the import and construction differ.
- package.json scripts invoke tsx directly (dev/build/start via next,
score/seed/init-db via tsx). Added tsx@4.21.0 + @types/better-sqlite3.
Scorer:
- Normalise matchedPath to repo-relative via new toRelative() in
scoring/scorer.ts so persisted/rendered paths never leak the
scanner's absolute FS layout.
Seeds:
- Add two entries to scripts/seed.ts (openclaw, TwoFac) — 28 total.
- seed.ts now calls `bun run score` rather than invoking the script
file directly, so the script path lives in one place (package.json).
Docs sync (same PR per CONTRIBUTING.md):
- AGENTS.md Stack + Run-anything + Layout updated for Node/tsx/
better-sqlite3 + 28 seeds. README Stack-rationale table, Quickstart,
and Layout mirror the same. CONTRIBUTING's Getting-started count
bumped. tasks/0.1.0/03-ci.md and tasks/0.2.0/01-tests.md switched to
`node --test`. tasks/0.2.0/02-self-score.md reflects self-seed.
Contributor docs:
- Add .github/PULL_REQUEST_TEMPLATE.md mirroring CONTRIBUTING's PR
description spec so new PRs auto-populate.
Cleanup:
- Trim comments that restated the code or documented stdlib behaviour
(Intl.NumberFormat, field-name JSDoc, a formula comment that
duplicated its own implementation). Kept WHY comments — shallow-clone
rationale, toRelative privacy note, SQL-whitelist invariant, the
changelog discipline, and the pass: number; // 0..1 range constraint.
Build artifact:
- .gitignore permits committing data/rank.db; DB file included here as
a seeded snapshot. WAL/SHM sidecars also present from local WAL-mode
runtime.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
<!-- Replace the italic hints below with your content. See CONTRIBUTING.md for the full rules. -->
2
+
3
+
## Summary
4
+
5
+
_1–3 bullets. What changed, in product/capability terms — not a log of work done._
6
+
7
+
## Motivation
8
+
9
+
_Why this change. Link to the roadmap item or `tasks/<file>.md`. If it's a roadmap item, quote the task's Goal line._
10
+
11
+
## Changes
12
+
13
+
_Bulleted list of what this PR modifies. Keep it scoped to the summary._
14
+
15
+
## Testing
16
+
17
+
_How you verified this. Commands run (`bun run score <url>`, `bun x tsc --noEmit`, manual pass of specific pages). For UI changes: mobile + desktop, light + dark._
18
+
19
+
## Screenshots / screencasts
20
+
21
+
_Required for any UI change. Drag-and-drop into this description._
22
+
23
+
## Docs + roadmap sync
24
+
25
+
_Confirm one of:_
26
+
27
+
-_"Ships a roadmap item — removed from `lib/roadmap.ts`, added to `lib/changelog.ts` under the current release bucket."_
28
+
-_"N/A — internal refactor / polish; no changelog entry."_
29
+
30
+
_Plus: "AGENTS.md / README.md updated if structure or conventions changed."_
31
+
32
+
## Risks / rollback
33
+
34
+
_What could break? How do we roll back? Leave blank if genuinely trivial._
Copy file name to clipboardExpand all lines: AGENTS.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,11 +16,11 @@ See `README.md` for the full product narrative. See `tasks/` for per-version wor
16
16
17
17
-**Next.js 16** (App Router) — web UI + API routes.
18
18
-**React 19** — server components by default; no client JS unless interactivity requires it.
19
-
-**Bun**runtime — native TS for scripts; Next.js itself runs via `bun --bun next dev`.
19
+
-**Node (≥20.9.0)**— runtime for Next.js and CLI scripts (via `tsx`). Matches Vercel's serverless runtime. Bun is supported as a faster local package manager (`bun install`) but not required.
20
20
-**TypeScript** — strict mode.
21
21
-**Tailwind CSS 4** — `@theme` tokens in `app/globals.css`; no `tailwind.config.*` file.
22
22
-**Phosphor Icons** (`@phosphor-icons/react`) — the only icon library. The `code-review` skill blocks non-Phosphor icons.
23
-
-**`bun:sqlite`** — built-in SQLite driver, single file at `data/rank.db`.
23
+
-**`better-sqlite3`** — Node-native SQLite driver, single file at `data/rank.db`. Swapped back from `bun:sqlite` because Vercel's serverless functions run on Node.
24
24
-**`git` CLI** — shallow clones (`--depth 1 --single-branch`) via `node:child_process`.
25
25
26
26
## Run anything
@@ -29,7 +29,7 @@ See `README.md` for the full product narrative. See `tasks/` for per-version wor
29
29
bun install
30
30
bun run prepare-hooks # once — installs lefthook git hooks (Biome + tsc on pre-commit)
31
31
bun run init-db # optional — auto-runs on first score
32
-
bun run seed # score the curated set (~27 repos) across GH / GL / BB
32
+
bun run seed # score the curated set (~28 repos) across GH / GL / BB
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ Read [AGENTS.md](./AGENTS.md) first — it's the source of truth for stack, conv
9
9
```bash
10
10
bun install
11
11
bun run prepare-hooks # once — installs lefthook pre-commit (Biome + tsc)
12
-
bun run seed # optional: populate the DB with the curated set (~27 public repos)
12
+
bun run seed # optional: populate the DB with the curated set (~28 public repos)
13
13
bun run dev # http://localhost:3000
14
14
```
15
15
@@ -53,7 +53,7 @@ Open against `main`. Keep the branch rebased; avoid merge commits from `main` in
53
53
54
54
### PR description — required sections
55
55
56
-
Every PR description must include:
56
+
New PRs auto-populate from [`.github/PULL_REQUEST_TEMPLATE.md`](./.github/PULL_REQUEST_TEMPLATE.md). The template mirrors the sections below; keep the two in sync when either changes. Every PR description must include:
|**Next.js 16 (App Router)**| Future features (filters, charts, auth, diff views) are React's territory. File-based routing + API routes replace hand-rolled HTTP cleanly. | Unlikely. The core scorer is stack-agnostic, only `app/` depends on this. |
116
-
|**Bun runtime**| Native TS, built-in SQLite, fast install + cold boot. Huge npm compat. Faster than Node; better Node-compat than Deno. | If a Bun-specific incompatibility surfaces that's not worth working around.|
116
+
|**Node runtime (with `tsx` for CLI scripts)**| Matches Vercel's serverless runtime — no Bun-only imports in prod. Bun still works locally as a fast package manager.| Unlikely — only if the deployment target changes.|
117
117
|**Tailwind CSS 4**| Zero-config via `@theme` tokens, no `tailwind.config.*` needed. Tight bundle output. | Would only leave for something with a stronger design-system story. |
118
-
|**`bun:sqlite`**| Zero deps, single file, inspectable. Avoids native-ABI drama (we tried `better-sqlite3` first and hit it). | Postgres when concurrent writers / access control arrive (`tasks/1.0.0/01-postgres-migration.md`). |
118
+
|**`better-sqlite3`**| Single file, inspectable, zero ops overhead. Node-native so Vercel's serverless runtime can load it directly.| Postgres when concurrent writers / access control arrive (`tasks/1.0.0/01-postgres-migration.md`). |
119
119
|**Server components + links, no client JS**| Cheap, fast, SEO-friendly. | When a feature genuinely needs interactivity — e.g. live filter combinators. |
120
120
|**Shallow git clones** (`--depth 1 --single-branch`) | Bandwidth + speed. Current signals don't need history. | History-aware signals → host APIs or `--filter=blob:none` partial clones. |
121
121
|**Exact-pinned deps**| Deterministic scoring across environments. | Never. |
0 commit comments