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
5 changes: 5 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ pnpm exec vitest run tests/version.test.ts # run a single test file
pnpm exec vitest run -t "resolves a semver range" # run tests matching a name
```

A **lefthook `pre-push` hook** runs typecheck / lint / test / build in parallel so
CI failures surface locally first. `pnpm install` sets it up automatically
(lefthook's post-install is approved in `pnpm-workspace.yaml` `allowBuilds`); run
`pnpm exec lefthook install` if the hook ever goes missing.

## Critical: `dist/` is built at release time, NOT committed to source branches

GitHub Actions runs the bundled `dist/index.js` directly (see `action.yml` → `main: dist/index.js`), **not** the TypeScript source — so a consumed ref must contain `dist/`. This repo keeps `dist/` **out of `main`** (`.gitignore`d) and builds it at release time, committing it **only onto the release tag**. Consequences:
Expand Down
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

| # | 概要 | 優先度 | 参照 | 備考 |
|---|---|---|---|---|
| [#9](https://github.com/yk-lab/setup-task/issues/9) | `[chore]` lefthook で pre-push に `pnpm run all` を仕込む | `P3: low` | `ci` `chore` | stale dist / 未 lint コミット防止 |

### 未対応・進行中(リリース運用 / M3・M4)

Expand Down Expand Up @@ -82,3 +81,4 @@ v1.0.0 実装中に作成・解決済みの Issue(参考)。
| [#45](https://github.com/yk-lab/setup-task/issues/45) | `[chore]` Biome 導入を評価 → 一元化採用 | #70 |
| [#38](https://github.com/yk-lab/setup-task/issues/38) | `[docs]` README に arduino/setup-task からの移行ガイドを追加 | #72 |
| [#73](https://github.com/yk-lab/setup-task/issues/73) | `[docs]` セキュア路線へポジショニング見直し(arduino v3 を受けて) | #72 |
| [#9](https://github.com/yk-lab/setup-task/issues/9) | `[chore]` lefthook で pre-push に `pnpm run all` を仕込む | #71 |
15 changes: 15 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Pre-push gate: run the same checks CI does — in parallel, so every failure
# surfaces at once, locally, before a push spends CI minutes. `dist/` is built
# at release time and not committed, so there's nothing to diff; this just fails
# on typecheck / lint / test / build errors (#9).
pre-push:
parallel: true
jobs:
- name: typecheck
run: pnpm run typecheck
- name: lint
run: pnpm run lint
- name: test
run: pnpm run test
- name: build
run: pnpm run build
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"@types/semver": "^7.5.8",
"@vercel/ncc": "^0.44.0",
"@vitest/coverage-v8": "^4.1.9",
"lefthook": "^2.1.9",
"typescript": "^6.0.3",
"vitest": "^4.1.9"
},
Expand Down
100 changes: 100 additions & 0 deletions pnpm-lock.yaml

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

3 changes: 3 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# lefthook installs the git hooks (pre-push) via its postinstall.
allowBuilds:
lefthook: true
# Supply-chain hardening: don't install a dependency version until it has been
# public for at least 3 days (4320 minutes), giving time for a compromised
# release to be yanked. Applies when the lockfile is updated (local installs,
Expand Down
Loading