Skip to content

Commit 862dcaf

Browse files
authored
chore: align dev tooling with stage monorepo (#13)
- Upgrade Biome 1.9 -> 2.4 with stricter rules (noExplicitAny: error, noFocusedTests, noConsole allowing error/warn, useExportType) and tab indentation. Reformat all source files. - Add husky 9 + lint-staged pre-commit hook running biome check --write on staged files. - Add .github/workflows/ci.yml (drizzle drift, lint, typecheck, test, build) and PULL_REQUEST_TEMPLATE.md. - Switch package manager from npm to pnpm@10.24.0 with packageManager field and onlyBuiltDependencies for native deps. - Slim .gitignore from ~150 lines to 26 by removing patterns for frameworks/tools this repo does not use. - Update AGENTS.md, TESTING.md, and agent docs to reflect new style and pnpm commands.
1 parent 05eaf6e commit 862dcaf

55 files changed

Lines changed: 7828 additions & 10507 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.agents/agents/frontend-error-fixer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ You are an expert frontend debugging specialist with deep knowledge of modern we
4141
- Preserve existing functionality while fixing the issue
4242
- Add proper error handling where it's missing
4343
- Ensure TypeScript types are correct and explicit
44-
- Follow the project's established patterns (2-space indentation per Biome config, specific naming conventions)
44+
- Follow the project's established patterns (tabs for JS/TS, spaces for JSON, per Biome config; specific naming conventions)
4545

4646
5. **Verification**:
4747
- Confirm the error is resolved
4848
- Check for any new errors introduced by the fix
49-
- Ensure the build passes with `npm run build` (CLI) and `npm run build:web` (web UI), and that `npx tsc --noEmit` is clean
49+
- Ensure the build passes with `pnpm build` (CLI) and `pnpm build:web` (web UI), and that `pnpm typecheck` is clean
5050
- Test the affected functionality
5151

5252
**Common Error Patterns You Handle:**

.claude/agents/auto-error-resolver.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ You are a specialized TypeScript error resolution agent. Your primary job is to
1515

1616
2. **Reproduce locally**:
1717
- Run `npx tsc --noEmit` (root) and `npx tsc --noEmit -p web/tsconfig.json` (web UI)
18-
- For runtime errors during dev, run `npm run dev:web` and watch the Vite output
18+
- For runtime errors during dev, run `pnpm dev:web` and watch the Vite output
1919

2020
3. **Analyze the errors** systematically:
2121
- Group errors by type (missing imports, type mismatches, etc.)
@@ -80,7 +80,7 @@ npx tsc --noEmit -p web/tsconfig.json # web UI
8080

8181
## TypeScript Commands
8282

83-
This is a single npm package with two `tsconfig.json` files:
83+
This is a single Node package (managed with pnpm) with two `tsconfig.json` files:
8484
- **CLI / src**: `npx tsc --noEmit` (root tsconfig)
8585
- **Web UI**: `npx tsc --noEmit -p web/tsconfig.json`
8686

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## Summary
2+
<!-- What changed and why -->
3+
4+
## Changes
5+
-
6+
7+
## Testing
8+
<!-- How was this tested? -->
9+
10+
## Screenshots
11+
<!-- If applicable, delete otherwise -->

.github/workflows/ci.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
merge_group:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
ci:
16+
name: CI
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Install pnpm
24+
uses: pnpm/action-setup@v4
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version-file: .nvmrc
30+
cache: "pnpm"
31+
32+
- name: Install dependencies
33+
run: pnpm install --frozen-lockfile
34+
35+
- name: Check Drizzle migrations are up to date
36+
run: |
37+
pnpm db:generate
38+
git diff --exit-code drizzle/ || (echo "::error::Drizzle migrations are out of date. Run 'pnpm db:generate' and commit." && exit 1)
39+
40+
- name: Lint
41+
run: pnpm lint
42+
43+
- name: Type check
44+
run: pnpm typecheck
45+
46+
- name: Test
47+
run: pnpm test
48+
49+
- name: Build
50+
run: |
51+
pnpm build
52+
pnpm build:web

.gitignore

Lines changed: 19 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -1,150 +1,33 @@
1-
# Logs
2-
logs
3-
*.log
4-
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
7-
lerna-debug.log*
8-
9-
# Diagnostic reports (https://nodejs.org/api/report.html)
10-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11-
12-
# Runtime data
13-
pids
14-
*.pid
15-
*.seed
16-
*.pid.lock
17-
18-
# Directory for instrumented libs generated by jscoverage/JSCover
19-
lib-cov
20-
21-
# Coverage directory used by tools like istanbul
22-
coverage
23-
*.lcov
24-
25-
# nyc test coverage
26-
.nyc_output
27-
28-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29-
.grunt
30-
31-
# Bower dependency directory (https://bower.io/)
32-
bower_components
1+
# Dependencies
2+
node_modules
333

34-
# node-waf configuration
35-
.lock-wscript
36-
37-
# Compiled binary addons (https://nodejs.org/api/addons.html)
38-
build/Release
39-
40-
# Dependency directories
41-
node_modules/
42-
jspm_packages/
43-
44-
# Snowpack dependency directory (https://snowpack.dev/)
45-
web_modules/
4+
# Build output
5+
dist
6+
web-dist
467

47-
# TypeScript cache
8+
# TypeScript incremental builds
489
*.tsbuildinfo
4910

50-
# Optional npm cache directory
51-
.npm
52-
53-
# Optional eslint cache
54-
.eslintcache
11+
# Vite
12+
.vite
13+
vite.config.*.timestamp-*
5514

56-
# Optional stylelint cache
57-
.stylelintcache
58-
59-
# Optional REPL history
60-
.node_repl_history
61-
62-
# Output of 'npm pack'
63-
*.tgz
64-
65-
# Yarn Integrity file
66-
.yarn-integrity
15+
# Test coverage
16+
coverage
6717

68-
# dotenv environment variable files
18+
# Environment / secrets
6919
.env
7020
.env.*
7121
!.env.example
22+
*.pem
7223

73-
# parcel-bundler cache (https://parceljs.org/)
74-
.cache
75-
.parcel-cache
76-
77-
# Next.js build output
78-
.next
79-
out
80-
81-
# Nuxt.js build / generate output
82-
.nuxt
83-
dist
84-
.output
85-
86-
# Gatsby files
87-
.cache/
88-
# Comment in the public line in if your project uses Gatsby and not Next.js
89-
# https://nextjs.org/blog/next-9-1#public-directory-support
90-
# public
91-
92-
# vuepress build output
93-
.vuepress/dist
94-
95-
# vuepress v2.x temp directory
96-
.temp
97-
98-
# Sveltekit cache directory
99-
.svelte-kit/
100-
101-
# vitepress build output
102-
**/.vitepress/dist
103-
104-
# vitepress cache directory
105-
**/.vitepress/cache
106-
107-
# Docusaurus cache and generated files
108-
.docusaurus
109-
110-
# Serverless directories
111-
.serverless/
112-
113-
# FuseBox cache
114-
.fusebox/
115-
116-
# DynamoDB Local files
117-
.dynamodb/
118-
119-
# Firebase cache directory
120-
.firebase/
121-
122-
# TernJS port file
123-
.tern-port
124-
125-
# Stores VSCode versions used for testing VSCode extensions
126-
.vscode-test
127-
128-
# pnpm
129-
.pnpm-store
130-
131-
# yarn v3
132-
.pnp.*
133-
.yarn/*
134-
!.yarn/patches
135-
!.yarn/plugins
136-
!.yarn/releases
137-
!.yarn/sdks
138-
!.yarn/versions
139-
140-
# Vite files
141-
vite.config.js.timestamp-*
142-
vite.config.ts.timestamp-*
143-
.vite/
24+
# Logs
25+
*.log
26+
.pnpm-debug.log*
14427

145-
# Stage CLI SPA build output (shipped via npm `files`)
146-
web-dist/
28+
# OS
29+
.DS_Store
14730

148-
# claude
31+
# Claude Code
14932
.claude/scheduled_tasks.lock
15033
.claude/settings.local.json

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm exec lint-staged

AGENTS.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,23 @@ This file provides guidance to coding agents working in this repository, includi
55
## Build & Development Commands
66

77
```bash
8-
npm install # Install dependencies
9-
npm run dev:web # Start the web UI in Vite dev mode
10-
npm run build # Bundle the CLI with tsdown into dist/
11-
npm run build:web # Build the web UI with Vite into web-dist/
12-
npm run test # Run tests (Vitest)
13-
npm run lint # Biome linting
14-
npm run format # Format code with Biome
15-
npx tsc --noEmit # TypeScript checking (root tsconfig)
16-
npx tsc --noEmit -p web/tsconfig.json # TypeScript checking for the web app
8+
pnpm install # Install dependencies (also installs husky pre-commit hook)
9+
pnpm dev:web # Start the web UI in Vite dev mode
10+
pnpm build # Bundle the CLI with tsdown into dist/
11+
pnpm build:web # Build the web UI with Vite into web-dist/
12+
pnpm test # Run tests (Vitest)
13+
pnpm lint # Biome check (lint + format) — fails on warnings
14+
pnpm lint:fix # Biome check with auto-fix
15+
pnpm format # Format code with Biome
16+
pnpm typecheck # tsc --noEmit for both root and web tsconfigs
1717
```
1818

19+
The package manager is pinned via `packageManager` in `package.json`. Use `corepack enable` if pnpm isn't on your PATH.
20+
1921
### Database (Drizzle ORM + SQLite)
2022

2123
```bash
22-
npm run db:generate # Generate a new migration into drizzle/ from schema changes
24+
pnpm db:generate # Generate a new migration into drizzle/ from schema changes
2325
```
2426

2527
The CLI uses an embedded SQLite database via `better-sqlite3`. There is no separate dev database to start — `getDb()` opens (or creates) the local SQLite file and runs pending migrations on first use.
@@ -88,14 +90,16 @@ Vite app with React 19, Tailwind 4, and shadcn/ui (new-york style, zinc base, lu
8890

8991
## Code Style (Biome)
9092

91-
- Spaces for indentation (width 2)
93+
- Tabs for indentation (JS/TS), spaces for JSON
9294
- Line width: 100 characters
9395
- Double quotes, semicolons required, trailing commas everywhere
9496
- `noUnusedImports: error` / `noUnusedVariables: error`
95-
- `useImportType: error` — use type imports/exports
96-
- `noExplicitAny: warn` and `noNonNullAssertion: warn` — treat warnings as failures in PRs
97+
- `useImportType: error` / `useExportType: error` — use type imports/exports
98+
- `noExplicitAny: error` and `noFocusedTests: error`
99+
- `noConsole: warn` (allowing `console.error`/`console.warn`) — treat warnings as failures in PRs
100+
- `organizeImports` runs on save/format
97101

98-
There are no pre-commit hooks configured; run `npm run lint` and `npm run test` yourself before pushing.
102+
A `pre-commit` hook (husky + lint-staged) runs `biome check --write` against staged files. Run `pnpm lint`, `pnpm typecheck`, and `pnpm test` locally before pushing.
99103

100104
## Package Naming
101105

@@ -114,7 +118,7 @@ This is a single-package repo published as `stagereview`. The CLI binary is `sta
114118
## Git & Commit Workflow
115119

116120
- When executing a plan, commit incrementally — one logical unit of work per commit, not one giant commit at the end.
117-
- Before every push, run `npx tsc --noEmit && npm run lint && npm run test` locally and ensure all checks pass. Never push with failing CI.
121+
- Before every push, run `pnpm typecheck && pnpm lint && pnpm test` locally and ensure all checks pass. Never push with failing CI.
118122

119123
## Implementation Quality
120124

TESTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This is stage-cli's canonical testing policy. All testing decisions — by human
1313

1414
### 1. Static Analysis
1515

16-
TypeScript strict mode (`strict: true`, `noUncheckedIndexedAccess: true`, `verbatimModuleSyntax: true`) + Biome. Free. Run `npx tsc --noEmit` and `npm run lint` before pushing.
16+
TypeScript strict mode (`strict: true`, `noUncheckedIndexedAccess: true`, `verbatimModuleSyntax: true`) + Biome. Free. Run `pnpm typecheck` and `pnpm lint` before pushing.
1717

1818
### 2. Route / Server Integration Tests
1919

0 commit comments

Comments
 (0)