Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
npm run build
npm test
7 changes: 7 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ as starting anchors, not exact addresses. Re-grep if a function moved.
6. **Run `npm test` after touching anything covered by tests** (lot engine,
compute, merge, fmt, addTrade/quickOutcome flows). CI gates on it.

A Husky pre-commit hook (`.husky/pre-commit`) enforces rules 1 and 6 locally
by running `npm run build` then `npm test` before every commit. Installed
automatically by `npm install` via the `prepare` script. No Prettier or
typecheck step — plain JS, no TS.

---

## Tests
Expand Down Expand Up @@ -111,6 +116,8 @@ as starting anchors, not exact addresses. Re-grep if a function moved.
stripping — the footer ships into `hyperwheel.html` and is harmless.
- **CI:** `.github/workflows/test.yml` runs `npm ci && npm test` separately from
the build job.
- **Pre-commit:** Husky runs `npm run build && npm test` before every commit.
Bypass with `--no-verify` only for WIP stashes — CI will still gate the push.

---

Expand Down
16 changes: 16 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,22 @@ Tests live under `test/`:

CI runs `npm test` on every push and PR via `.github/workflows/test.yml`.

## Pre-commit hook

Husky is installed as a dev dependency. After `npm install`, the `prepare`
script wires up `.husky/pre-commit`, which runs:

```bash
npm run build # python3 build.py --check
npm test # unit + jsdom integration tests
```

This gates every commit on the same checks CI runs. There is no Prettier or
typecheck step — the codebase is plain JS with no TypeScript, and formatting
is enforced by convention rather than tooling. If a commit needs to bypass
the hook (rare — e.g. a WIP stash), use `git commit --no-verify`, but don't
push past CI that way.

## Release labels (maintainers)

PRs can carry one of these labels to control the auto-release version bump:
Expand Down
17 changes: 17 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
"description": "Single-file wheel-strategy options tracker. Tests only — runtime ships zero dependencies.",
"scripts": {
"build": "python3 build.py --check",
"test": "node --test test/unit/*.test.js test/integration/*.test.js"
"test": "node --test test/unit/*.test.js test/integration/*.test.js",
"prepare": "husky"
},
"devDependencies": {
"husky": "^9.1.7",
"jsdom": "^24.1.0"
}
}
Loading