Skip to content

feat: ni (パッケージマネージャー自動選択ツール) を導入 - #82

Merged
susumutomita merged 1 commit into
mainfrom
feat/introduce-ni
Nov 30, 2025
Merged

susumutomita merged 1 commit into
mainfrom
feat/introduce-ni

Conversation

@susumutomita

@susumutomita susumutomita commented Nov 30, 2025 •

Copy link
Copy Markdown
Owner

概要

@antfu/ni を導入し、パッケージマネージャーに依存しないコマンド体系を確立する。

Closes #81

変更内容

  • @antfu/ni を devDependencies に追加
  • CLAUDE.md に ni コマンド対応表と推奨コマンド例を追加
  • カバレッジ計測セクションを ni コマンドに更新

ni コマンド対応表

ni コマンド bun 変換結果
ni bun install
nr dev bun run dev
nlx vitest bunx vitest
nci bun install --frozen-lockfile

利点

  • lock ファイル(bun.lockb)を検出して自動的に bun を使用
  • 新規参加者が「npm i in a bun project」のような間違いを防げる
  • CI/CD やドキュメントでパッケージマネージャーを統一できる

テスト計画

  • ni コマンドが正常に動作することを確認
  • textlint 通過

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Added documentation for a command-mapping workflow including conversion guidance and usage examples.
    • Updated coverage documentation with new command patterns.
  • Chores

    • Added new development dependencies for enhanced development tooling support.

✏️ Tip: You can customize this high-level summary in your review settings.

- @antfu/ni を devDependencies に追加
- CLAUDE.md に ni コマンド対応表と推奨コマンド例を追加
- カバレッジ計測セクションを ni コマンドに更新

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

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 30, 2025 •

Copy link
Copy Markdown

Walkthrough

The changes introduce the ni package manager auto-selector tool to the project by documenting its command-mapping workflow in CLAUDE.md and adding the ni package along with vitest coverage support to devDependencies in package.json.

Changes

Cohort / File(s) Summary
Documentation - ni integration guide
CLAUDE.md
Adds new sections documenting the ni command-mapping workflow with a conversion table showing equivalents (e.g., ni → bun install, nr dev → bun run dev). Updates coverage commands from npm/npx-based usage to nr-based usage.
Dependency updates
package.json
Adds @antfu/ni (^27.0.1) for package manager auto-selection and @vitest/coverage-v8 (^4.0.14) for coverage reporting. Retains existing @types/bun dependency.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Documentation additions are primarily informational with a straightforward mapping table
  • Dependency additions are straightforward version pins with no behavioral logic changes
  • No code logic modifications or complex interactions to evaluate

Possibly related PRs

  • update #33: Modifies CLAUDE.md developer workflow and coverage command guidance, sharing similar documentation update patterns.

Poem

🐰 A rabbit hops with glee today,
For ni tools now light the way!
No more confusion, no more strife,
One command rules them all with life! 📦✨
Bun or npm, the choice runs clear,
Package harmony is here! 🎉

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR partially fulfills issue #81 requirements: adds ni to devDependencies and updates CLAUDE.md with ni commands, but does not update README.md as required. Add ni usage documentation to README.md as specified in issue #81 completion criteria. Optionally implement Makefile updates.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: introducing ni (package manager auto-selection tool) as a new feature.
Out of Scope Changes check ✅ Passed All changes align with issue #81 objectives: ni package addition, CLAUDE.md updates with command mappings, and coverage command modernization.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/introduce-ni

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.

@claude

claude Bot commented Nov 30, 2025

Copy link
Copy Markdown

コードレビュー

✅ 良い点

  1. 明確な目的: @antfu/ni の導入により、パッケージマネージャーに依存しないコマンド体系を確立する意図が明確
  2. 包括的なドキュメント: CLAUDE.md に ni コマンド対応表と推奨コマンド例を詳細に記載
  3. 一貫性の向上: カバレッジ計測セクションを ni コマンドに更新し、プロジェクト全体の一貫性を向上
  4. 開発者体験の改善: lockfile 自動検出により、新規参加者のミスを防ぐ仕組み

🔍 改善提案

1. README.md の一貫性 (重要度: 中)

README.md に npm run dev の記述が残っています(203 行目)。CLAUDE.md と同様に ni コマンドへ統一することを推奨します。

現状:

npm run dev

推奨:

# ni を使用(推奨)
nr dev

# または直接実行
bun run dev

2. package.json のスクリプトとの整合性 (重要度: 低)

package.json では以下のように npm コマンドを使用しています。

"dev:control-plane": "npm run dev --workspace=frontend/control-plane",
"dev:admin": "npm run dev --workspace=frontend/admin-app",
"dev:participant": "npm run dev --workspace=frontend/participant-app",
"build:frontend": "npm run build --workspaces --if-present",

ni は workspace コマンドもサポートしているため、将来的にこれらも統一できる可能性があります(ただし、現時点では変更不要)。

3. @vitest/coverage-v8 の追加理由 (重要度: 低)

@vitest/coverage-v8 が devDependencies に追加されていますが、PR の説明に記載がありません。ni 導入に関連する変更であれば、その理由を PR 本文に追記することを推奨します。

📋 チェック項目

  • コードの品質とベストプラクティスに準拠
  • セキュリティ上の懸念なし
  • パフォーマンスへの影響なし
  • 型安全性の確保(TypeScript strict mode)
  • ドキュメントの一貫性(README.md の更新推奨)

🎯 推奨アクション

  1. README.md の 203 行目を ni コマンドに更新
  2. @vitest/coverage-v8 の追加理由を PR 本文に追記(関連する場合)

総合評価

LGTM with minor suggestions 🎉

ni の導入により開発者体験が大幅に向上します。上記の軽微な改善提案を対応いただければ、すぐにマージ可能です。


🤖 Generated with Claude Code

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 746cda0 and 427839d.

⛔ Files ignored due to path filters (1)
  • bun.lockb is excluded by !**/bun.lockb
📒 Files selected for processing (2)
  • CLAUDE.md (2 hunks)
  • package.json (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.md

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.md: 文末は「」で終わる。コロンや記号で文を終わらせない。日本語と半角英数字の間には半角スペースを入れる
技術用語・記号は原語を保ちつつ、日本語文脈に合わせて表記ゆれをなくす。例: 100% と表記する

Files:

  • CLAUDE.md
🧠 Learnings (3)
📚 Learning: 2025-11-24T23:43:51.686Z
Learnt from: CR
Repo: susumutomita/TenkaCloud PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T23:43:51.686Z
Learning: Refer to CLAUDE.md for coding standards and guidelines

Applied to files:

  • CLAUDE.md
📚 Learning: 2025-11-29T14:55:50.084Z
Learnt from: CR
Repo: susumutomita/TenkaCloud PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-29T14:55:50.084Z
Learning: Applies to **/*.{test,spec}.{ts,tsx} : すべてのコードパスを含めてテストカバレッジ 100% を達成する

Applied to files:

  • CLAUDE.md
📚 Learning: 2025-11-29T14:55:50.084Z
Learnt from: CR
Repo: susumutomita/TenkaCloud PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-29T14:55:50.084Z
Learning: Applies to **/*.{test,spec}.{ts,tsx} : テスト駆動開発 (TDD) を実践する。コードを書く前に失敗するテストを書く

Applied to files:

  • CLAUDE.md
🔇 Additional comments (5)
package.json (1)

41-41: @vitest/coverage-v8 version is current.

The pinned version (^4.0.14) matches the latest published release, which supports the coverage measurement updates in CLAUDE.md.

CLAUDE.md (4)

758-764: Coverage commands properly updated to use ni.

The coverage section appropriately transitions to ni commands (nr test:coverage) with a fallback to direct bun commands. This aligns well with the package.json changes introducing @vitest/coverage-v8.


878-880: Comprehensive ni documentation section added.

The new section provides clear positioning of ni in the project workflow, with a link to the upstream package and well-structured command reference. The introduction clearly states the rationale for ni adoption.


882-894: Command mapping table is comprehensive and accurate.

The table covers all essential ni commands with clear bun equivalents. Mapping aligns with ni's behavior of detecting lock files (including bun.lockb) and running corresponding commands.


897-915: Usage examples are clear and practical.

The recommended commands cover the essential workflows (install, dev, test, coverage, build, typecheck). Examples follow the concise format used elsewhere in CLAUDE.md.

Comment thread CLAUDE.md
Comment on lines +918 to +920
- lock ファイル(bun.lockb)を検出して自動的に bun を使用する
- 新規参加者が「npm i in a bun project」のような間違いを防げる
- CI/CD やドキュメントでパッケージマネージャーを統一できる

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add periods to bullet points to comply with documentation guidelines.

Per the coding guidelines, sentences should end with proper punctuation. The advantage bullet points currently end with verb forms (〜できる/〜する) rather than 「。」markers. Restructure these as complete sentences or add periods.

   ### 利点
   - lock ファイル(bun.lockb)を検出して自動的に bun を使用する
-  - 新規参加者が「npm i in a bun project」のような間違いを防げる
-  - CI/CD やドキュメントでパッケージマネージャーを統一できる
+  - lock ファイル(bun.lockb)を検出して自動的に bun を使用する。
+  - 新規参加者が「npm i in a bun project」のような間違いを防げる。
+  - CI/CD やドキュメントでパッケージマネージャーを統一できる。

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In CLAUDE.md around lines 918 to 920, the three bullet points lack terminal
punctuation; update each bullet to be a complete sentence by appending the
Japanese full stop "。" (or rephrase to a complete sentence) so they end with
"。", ensuring consistency with documentation guidelines.

Comment thread package.json
},
"devDependencies": {
"@types/bun": "latest"
"@antfu/ni": "^27.0.1",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Update @antfu/ni to the actual latest version (27.0.0).

The latest published version of @antfu/ni is 27.0.0, but the PR pins ^27.0.1, which doesn't exist yet. This can cause dependency resolution issues and breaks reproducibility. Update to "@antfu/ni": "^27.0.0" instead.

-    "@antfu/ni": "^27.0.1",
+    "@antfu/ni": "^27.0.0",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"@antfu/ni": "^27.0.1",
"@antfu/ni": "^27.0.0",
🤖 Prompt for AI Agents
In package.json around line 39, the dependency pins "@antfu/ni": "^27.0.1" which
does not exist; update the version string to the actual published version by
changing it to "@antfu/ni": "^27.0.0" to avoid dependency resolution failures
and ensure reproducible installs.

@susumutomita
susumutomita merged commit 08151b9 into main Nov 30, 2025
11 checks passed
@susumutomita
susumutomita deleted the feat/introduce-ni branch November 30, 2025 06:18
@coderabbitai coderabbitai Bot mentioned this pull request Nov 30, 2025
2 of 3 tasks
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.

ni (パッケージマネージャー自動選択ツール) の導入

1 participant