Skip to content

chore: dist/ を main から外しリリース時ビルド方式へ#36

Merged
yk-lab merged 1 commit into
mainfrom
chore/dist-release-only
Jun 22, 2026
Merged

chore: dist/ を main から外しリリース時ビルド方式へ#36
yk-lab merged 1 commit into
mainfrom
chore/dist-release-only

Conversation

@yk-lab

@yk-lab yk-lab commented Jun 22, 2026

Copy link
Copy Markdown
Owner

概要

dist/main にコミットしない方式へ転換します。JS Action の dist/index.js は「利用者が参照するタグに存在」すればよく、source ブランチに置く必要はありません。

変更

  • .gitignore: dist/ を無視(「committed」ノートを撤回)。
  • dist/ を untrack(git rm --cached)。ローカルのビルド産物は残る。
  • ci.yml: dist 鮮度チェックを削除。pnpm run buildバンドルが compile することの確認として維持。
  • CLAUDE / CONTRIBUTING / README: dist 非コミット・タグ参照前提に更新。
  • TODO: リリース運用を「build→tag に dist commit」方式に更新。

効果

注意(利用契約の変更)

  • 消費は タグ参照uses: yk-lab/setup-task@v1)。@main は dist が無く動きません。
  • 現在タグ/リリースは未作成(消費者ゼロ)なので破壊的影響なし。使える dist はリリース自動化(次タスク)で初めて生成されます。

Closes #22

🤖 Generated with Claude Code


Summary by cubic

Switch the JS Action to release-time bundling: dist/ is no longer committed to main; it is built and committed only on release tags. This removes noisy dist/ diffs and fixes stale bundle issues (closes #22).

  • Refactors

    • Add dist/ to .gitignore and untrack existing artifacts; remove committed files.
    • Remove the dist/ freshness check from .github/workflows/ci.yml; keep pnpm run build to ensure the bundle compiles.
    • Update docs (CLAUDE.md, CONTRIBUTING.md, README.md) and TODO.md for tag-based consumption and release automation.
  • Migration

    • Consume the action via a tag (e.g., yk-lab/setup-task@v1); @main won’t work because it has no dist/.
    • Ensure the release workflow builds and commits dist/ onto the tag and can move v1 if tag protection is enabled.

Written for commit 3a2f25b. Summary will update on new commits.

Review in cubic

JS Action の dist は「利用タグに存在」すればよく、main にコミットする必要はない。
dist/ を untrack + gitignore し、ci.yml の鮮度チェックを削除(pnpm run build は compile 確認として維持)。
これにより PR の dist churn・手動再ビルド・Dependabot×stale dist(#22)が構造的に消える。
利用は @main でなくタグ(@v1 等)参照前提。dist はリリース自動化で build→tag に commit する。

Closes #22

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 22, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ef3e7ead-334a-4286-8dae-80b0bf004327

📥 Commits

Reviewing files that changed from the base of the PR and between d7b43a0 and 3a2f25b.

⛔ Files ignored due to path filters (5)
  • .github/workflows/ci.yml is excluded by !**/*.yml
  • dist/index.js is excluded by !**/dist/**, !dist/**
  • dist/index.js.map is excluded by !**/dist/**, !**/*.map, !dist/**, !**/*.map
  • dist/licenses.txt is excluded by !**/dist/**, !dist/**
  • dist/sourcemap-register.js is excluded by !**/dist/**, !dist/**
📒 Files selected for processing (5)
  • .gitignore
  • CLAUDE.md
  • CONTRIBUTING.md
  • README.md
  • TODO.md

📝 Walkthrough

Summary by CodeRabbit

リリースノート

  • Documentation
    • ディストリビューションファイルの取り扱いに関する運用方針をドキュメント全体で統一しました。ソースブランチへのコミットではなく、リリース時のタグでの生成方式に変更されています。開発や運用に関する手順が明確化されました。

Walkthrough

.gitignoredist/ を追加してコミット対象外とし、CLAUDE.mdCONTRIBUTING.mdREADME.mdTODO.md の記述を「リリース時にビルドしてリリースタグへのみコミットする」方針へ更新した。旧来の「常に dist/ をコミット・CI で鮮度チェック」運用の説明はすべて削除された。

Changes

dist/ 方針変更の一括反映

Layer / File(s) Summary
.gitignore 変更とドキュメント一括更新
.gitignore, CLAUDE.md, CONTRIBUTING.md, README.md, TODO.md
dist/ をリポジトリコミット対象外(.gitignore)とし、各ドキュメントの dist/ 説明を「リリース時ビルド・リリースタグへのみコミット・利用はタグ参照」方式へ統一。TODO.md にはリリースフロー(v* push → install/build → dist commit → v1 追従 → Release 発行)とタグ保護 bypass の DoD 要件も追記。

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • yk-lab/setup-task#6: dist/ をコミットする前提で導入・文書化された PR であり、本 PR はその方針を逆転させるドキュメント変更を行っている。
  • yk-lab/setup-task#34: pnpm 移行に伴い dist/ の再ビルドを pnpm run build に更新しており、本 PR と同じ dist/ 方針に関するドキュメント変更が重なる。

Poem

🐇 dist/ よ、もう main には住まぬがいい
タグの世界でだけ輝きなさい
.gitignore に守られ、ソースは清潔
リリース時だけ、bunny がビルドを走らせる ✨
コミット不要、タグ参照でよし!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Linked Issues check ❓ Inconclusive Issue #22 の要件である dist/ 関連の Dependabot 問題は、本 PR の『dist/ を source ブランチから削除する構造的解決』により根本的に解消される。ただし ci.yml の変更が ignored_files で未確認のため、dist 鮮度チェック削除の詳細は検証不可。 ci.yml が ignored_files に含まれているため、dist 鮮度チェック削除と pnpm run build の確認維持について、該当ファイルの変更を確認してください。
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed PR タイトルは dist/ を main から除外し、リリース時ビルド方式へ転換するという主要な変更を明確に要約している。
Description check ✅ Passed PR 説明は変更内容、効果、注意点を詳しく記載し、テンプレートの主要セクションをカバーしている。テスト手順チェックリストは提示されていないが、本質的な説明は充分である。
Out of Scope Changes check ✅ Passed すべての変更(.gitignore、ドキュメント類、TODO.md)は dist/ の非コミット化とリリース時ビルド方式という単一の目的に関連し、スコープ外の変更は認められない。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/dist-release-only

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 10 files

Tip: cubic can generate docs of your entire codebase and keep them up to date. Try it here.

Re-trigger cubic

@yk-lab yk-lab merged commit c8d077c into main Jun 22, 2026
15 checks passed
@yk-lab yk-lab deleted the chore/dist-release-only branch June 22, 2026 15:30
yk-lab added a commit that referenced this pull request Jul 7, 2026
push 前に typecheck / lint / test / build をローカル実行し、失敗を CI より先に
検出する。lefthook で 4 チェックを並列実行(逐次より速く、どれが落ちたか一目)。

- lefthook.yml(新規): pre-push で typecheck/lint/test/build を parallel 実行
- package.json: lefthook を devDependencies に
- pnpm-workspace.yaml: allowBuilds で lefthook の postinstall を許可
  (`pnpm install` で pre-push hook が自動インストールされる)
- CLAUDE.md: pre-push hook の説明を追記
- TODO.md: #9 を解決済み(#71)へ

補足: 元 issue の「dist 差分で fail」は #36 で dist 未コミット化され前提消滅。
本 PR は残る価値(CI 判定のローカル再現)を実装。lefthook run --all-files で
4 ジョブ green を確認済み。

Closes #9

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AECzAv2vcdATecuvLjBSa6
yk-lab added a commit that referenced this pull request Jul 7, 2026
## 概要

push 前に typecheck / lint / test / build をローカル実行し、失敗を CI より先に(= CI
minutes を使う前に)検出する(#9)。lefthook で 4 チェックを **並列実行**(逐次より速く、どれが落ちたか一目)。

## 変更内容

- **`lefthook.yml`(新規)**: `pre-push` で typecheck / lint / test / build を
`parallel: true` 実行
- **`package.json`**: `lefthook` を devDependencies に
- **`pnpm-workspace.yaml`**: `allowBuilds` で lefthook の postinstall を許可
→ **`pnpm install` で pre-push hook が自動インストール**(postinstall が hook を
sync)
- **`CLAUDE.md`**: pre-push hook の説明を追記
- **`TODO.md`**: #9 を解決済みへ

## 補足(元 issue の前提更新)

元 issue の動機「dist 再ビルド忘れ → CI の dist 鮮度チェックで気づく」は **#36 で dist/
がリリース時ビルド・未コミット化され前提消滅**(鮮度チェックは存在しない)。本 PR は残る価値「CI と同じ判定をローカル再現」を実装。

## 検証

- `pnpm exec lefthook run pre-push --all-files` で 4 ジョブ green
- **本 PR の push 自体が pre-push hook を発火**し typecheck/lint/test/build
を通過(self-validating)
- `pnpm rebuild lefthook` で hook 自動再作成を確認(fresh clone でも `pnpm install`
で入る)
- codex セカンドオピニオン:correctness 問題なし

## 参照

- Closes #9

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated description by cubic. -->
---
## Summary by cubic
Add a `lefthook` pre-push hook that runs typecheck, lint, test, and
build in parallel so CI failures are caught locally before pushing. This
mirrors our CI checks and speeds feedback.

- **New Features**
- Pre-push hook runs `pnpm run typecheck`, `lint`, `test`, and `build`
in parallel.
- Auto-installed on `pnpm install` via `allowBuilds` in
`pnpm-workspace.yaml`; run `pnpm exec lefthook install` if missing.
- Added brief docs in `CLAUDE.md`; updated `TODO.md` to mark #9
resolved.

- **Dependencies**
  - Added `lefthook` to devDependencies.

<sup>Written for commit cf4f06a.
Summary will update on new commits.</sup>

<a
href="https://cubic.dev/pr/yk-lab/setup-task/pull/71?utm_source=github"
target="_blank" rel="noopener noreferrer"
data-no-image-dialog="true"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img
alt="Review in cubic"
src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a>

<!-- End of auto-generated description by cubic. -->

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ci] Dependabot PR で dist/ を自動再ビルドする

1 participant