Skip to content

fix: npm warnings and add BATS to Dockerfile - #556

Merged
keito4 merged 1 commit into
mainfrom
feat/comprehensive-quality-improvements
Mar 9, 2026
Merged

fix: npm warnings and add BATS to Dockerfile#556
keito4 merged 1 commit into
mainfrom
feat/comprehensive-quality-improvements

Conversation

@keito4

@keito4 keito4 commented Mar 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Comment out pnpm-specific settings in .npmrc to avoid npm warnings
  • Add bats package to Dockerfile for integration testing

Test plan

  • npm commands no longer show pnpm-related warnings
  • All pre-commit hooks pass
  • BATS is available in new DevContainer builds

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated development container and package manager configurations to optimize the development environment setup.

- Comment out pnpm-specific settings in .npmrc to avoid npm warnings
- Add bats package to Dockerfile for integration testing

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@keito4

keito4 commented Mar 9, 2026

Copy link
Copy Markdown
Owner Author

🔍 AI Code Review (Local Hook)

Models: Codex (default) / Gemini (default)

🤖 Codex Review

指摘事項はありません。

判定
patch is correct(変更は bats の追加と .npmrc のコメント整理のみで、明確な不具合やリスク増加は確認できませんでした)
信頼度: 0.58

✨ Gemini Review

MCP server 'supabase' requires authentication using: /mcp auth supabaseMCP server 'vercel' requires authentication using: /mcp auth vercelコードレビューありがとうございます。以下に発見事項をまとめました。

発見事項

  1. 問題: pnpmの重要な設定が無効化されており、依存関係の問題を引き起こす可能性があります。
    • ファイル: .npmrc
    • 行範囲: 9-19
    • 説明: このプロジェクトは pnpm-workspace.yaml を含んでおり、pnpmの使用が前提となっていると考えられます。この変更では strict-peer-dependenciesshamefully-hoist といった、依存関係の解決を厳格に管理するためのpnpmの重要な設定がコメントアウトされています。特に shamefully-hoist=false を無効化すると、pnpmの利点であるファントム依存(package.jsonに記載されていないパッケージが利用可能になる状態)の防止機能が働かなくなり、開発者の環境によって動作が異なるといった問題を引き起こすリスクがあります。もしnpmとpnpmの両方をサポートすることが目的であれば、設定を無効化するのではなく、プロジェクトのドキュメントでツールの使い分けについて説明する方が適切です。

全体的な判定

  • 判定: patch is incorrect
  • 理由: .npmrc ファイルの変更により、pnpmの重要な機能が無効化され、プロジェクトの依存関係の安定性が損なわれる可能性が非常に高いためです。この変更は意図しない副作用を引き起こすリスクがあります。
  • 信頼度: 0.95

⚠️ 修正が必要です

上記のレビューで問題が指摘されています。修正してからマージしてください。


🤖 Generated by post_pr_ai_review.py hook

@keito4

keito4 commented Mar 9, 2026

Copy link
Copy Markdown
Owner Author

🔍 AI Code Review (Local Hook)

Models: Codex (default) / Gemini (default)

🤖 Codex Review

指摘事項はありません。変更は bats の追加と .npmrc のpnpm向け設定コメントアウトで、現在のリポジトリ(package-lock.json が存在)に対して直接的な不具合やセキュリティ/性能/保守性の悪化を導入するものは確認できません。

判定: patch is correct(理由: 変更はいずれも既存挙動を壊す具体的リスクがなく、導入された問題が見当たらないため)
信頼度: 0.62

✨ Gemini Review

MCP server 'supabase' requires authentication using: /mcp auth supabaseMCP server 'vercel' requires authentication using: /mcp auth vercelはい、承知いたしました。コード変更のレビューを実施します。

発見事項

  1. 問題: 潜在的に意図しない依存関係の解決を引き起こす pnpm 設定の無効化
    • ファイル: .npmrc
    • 行範囲: 10-19
    • 説明: pnpm の重要な設定(strict-peer-dependencies, shamefully-hoist など)がコメントアウトされています。これにより、pnpm を使用した際の依存関係の解決方法がデフォルトの動作に戻り、ファントム依存の発生や peer dependency の競合見逃しといった、予期せぬ問題を引き起こす可能性があります。「pnpmが検出されたときに使われる設定」という趣旨のコメントが追加されていますが、設定自体はコメントアウトされているため、このコメントと実装が矛盾しています。

全体的な判定

  • 判定: patch is incorrect
  • 理由: .npmrc ファイルの変更が、pnpm 利用時の依存関係解決の振る舞いを意図せず変更し、プロジェクトの安定性を損なうリスクがあるため。変更の意図が不明確であり、ドキュメント(コメント)と実装の間に矛盾が生じています。
  • 信頼度: 0.9

⚠️ 修正が必要です

上記のレビューで問題が指摘されています。修正してからマージしてください。


🤖 Generated by post_pr_ai_review.py hook

@claude

claude Bot commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

PR レビュー: fix: npm warnings and add BATS to Dockerfile

概要

変更内容を確認しました。概ね方向性は正しいですが、いくつか懸念点があります。


Dockerfile の変更

bats の追加 — 問題なし

bats をインストールリストに追加する変更は適切です。シェルスクリプトのインテグレーションテストに必要なツールで、DevContainer 環境に含めることは妥当です。

テストプランの「BATS is available in new DevContainer builds」が未チェックです。実際にビルドして動作確認してからマージを検討することを推奨します。


.npmrc の変更

懸念点: コメントアウトしても pnpm では設定が有効にならない

+# ============================================================
+# pnpm-specific settings (ignored by npm, used when pnpm is detected)
+# ============================================================
+# strict-peer-dependencies=true
+# auto-install-peers=true
+# shamefully-hoist=false
+# verify-store-integrity=true

コメントヘッダーに「used when pnpm is detected」と記載されていますが、コメントアウトした設定は pnpm でも読み込まれません。つまり、npm の警告を抑制した代わりに、pnpm 使用時のセキュリティ設定が無効化されています。

以下の設定はセキュリティ・品質に関わる重要なものです:

設定 目的
strict-peer-dependencies=true peer dependency の競合でインストール失敗(セキュリティ強化)
shamefully-hoist=false ファントム依存を防ぐ
verify-store-integrity=true コンテンツ整合性の検証

推奨する対応:

pnpm 専用の設定ファイル .pnpmrc を作成し、そちらに pnpm 固有の設定を移す方法が最もクリーンです:

# .pnpmrc
strict-peer-dependencies=true
auto-install-peers=true
shamefully-hoist=false
verify-store-integrity=true

これにより npm の警告も消え、pnpm 使用時のセキュリティ設定も維持されます。


セキュリティ観点

CLAUDE.md のポリシー「SAST / 依存脆弱性: Critical検知でFail」に照らすと、verify-store-integrity=trueshamefully-hoist=false は依存関係のセキュリティ担保に直結するため、コメントアウトのままにしておくことは望ましくありません。


まとめ

項目 評価
Dockerfile への bats 追加 ✅ 問題なし(動作確認を推奨)
.npmrc の pnpm 設定コメントアウト ⚠️ セキュリティ設定が失われるため要修正
コメントの誤記載 ⚠️ 「used when pnpm is detected」は不正確

.pnpmrc ファイルに pnpm 固有設定を移す対応をお願いします。

🤖 Reviewed by Claude Code

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2db0cacd2c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .npmrc
# pnpm-specific settings (ignored by npm, used when pnpm is detected)
# ============================================================
# Strict peer dependency resolution - fail on conflicts
# strict-peer-dependencies=true

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep pnpm security flags enabled for pnpm installs

Commenting out strict-peer-dependencies (and related pnpm flags) removes those protections for pnpm as well, because commented .npmrc entries are never read by any package manager. In this repo we still execute pnpm commands (for example in .devcontainer/Dockerfile), so peer dependency conflicts that were previously blocked can now be silently accepted during dependency resolution, which weakens the intended supply-chain/consistency guardrails.

Useful? React with 👍 / 👎.

@coderabbitai

coderabbitai Bot commented Mar 9, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Added bats testing tool to the development container, and commented out strict pnpm peer dependency and store integrity verification settings in the npm configuration, reducing enforcement constraints.

Changes

Cohort / File(s) Summary
Development Container
.devcontainer/Dockerfile
Added bats package to apt-get install list for shell script testing support.
NPM Configuration
.npmrc
Commented out three pnpm configuration options: strict-peer-dependencies, auto-install-peers, and verify-store-integrity, disabling strict peer dependency enforcement and store verification.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested labels

size/XS

Poem

🐰 A tiny hop, a testing leap,
With bats now installed, tests run deep,
And peer dependencies set free,
The config's rules now lighter be!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the two main changes in the pull request: fixing npm warnings by commenting out pnpm settings in .npmrc and adding the bats package to the Dockerfile.
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
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/comprehensive-quality-improvements

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.

@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: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.npmrc:
- Around line 6-19: Remove the commented pnpm settings from .npmrc and re-add
them in pnpm-workspace.yaml using pnpm-workspace's camelCase keys:
strictPeerDependencies: true, autoInstallPeers: true, shamefullyHoist: false,
and verifyStoreIntegrity: true; ensure the four keys are top-level in
pnpm-workspace.yaml so pnpm installs and CI workflows (which expect these
safeguards) honor them and npm no longer emits warnings from the .npmrc
comments.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f443fdf9-97ec-413e-8825-89fa0be95eea

📥 Commits

Reviewing files that changed from the base of the PR and between d06afa5 and 2db0cac.

📒 Files selected for processing (2)
  • .devcontainer/Dockerfile
  • .npmrc

Comment thread .npmrc
Comment on lines +6 to +19
# ============================================================
# pnpm-specific settings (ignored by npm, used when pnpm is detected)
# ============================================================
# Strict peer dependency resolution - fail on conflicts
# strict-peer-dependencies=true

# Auto-install missing peer dependencies
# auto-install-peers=true

# Prevent phantom dependencies (packages hoisting to root node_modules)
shamefully-hoist=false
# shamefully-hoist=false

# Use content-addressable storage (pnpm default - integrity verification)
verify-store-integrity=true
# verify-store-integrity=true

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 | 🟠 Major

🧩 Analysis chain

🌐 Web query:

What is pnpm's recommended way to keep strict-peer-dependencies, auto-install-peers, shamefully-hoist, and verify-store-integrityenabled for pnpm without npm warning about unknown.npmrc settings?

💡 Result:

pnpm’s recommended way to avoid npm warnings about pnpm-only config keys is to move those settings out of the project .npmrc and into the project-level pnpm-workspace.yaml, which pnpm reads for configuration but npm does not. pnpm explicitly supports reading config from pnpm-workspace.yaml in addition to .npmrc. [1]

Example pnpm-workspace.yaml:

# pnpm-workspace.yaml
strictPeerDependencies: true
autoInstallPeers: true
shamefullyHoist: true
verifyStoreIntegrity: true

These exact settings are documented as supported pnpm-workspace.yaml keys (note the camelCase names). [1]


🏁 Script executed:

# Check if pnpm-workspace.yaml exists
fd -t f "pnpm-workspace.yaml" .

Repository: keito4/config

Length of output: 78


🏁 Script executed:

# Check the .npmrc file to see the exact settings
cat -n .npmrc

Repository: keito4/config

Length of output: 833


🏁 Script executed:

# Check the pnpm-workspace.yaml file
cat -n pnpm-workspace.yaml

Repository: keito4/config

Length of output: 381


Migrate pnpm safeguards from .npmrc to pnpm-workspace.yaml instead of disabling them.

Commenting out Lines 10, 13, 16, and 19 disables pnpm's peer-dependency, hoisting, and store-integrity checks. The repo still provisions pnpm in .devcontainer/Dockerfile and workflows rely on these settings (.github/workflows/templates/unified-ci.yml:84-89), so weakening them affects all pnpm installs.

Rather than comment them out, move these settings to pnpm-workspace.yaml using the camelCase format that pnpm-workspace supports:

  • strictPeerDependencies: true
  • autoInstallPeers: true
  • shamefullyHoist: false
  • verifyStoreIntegrity: true

This avoids npm warnings while keeping pnpm safeguards active across the repo.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.npmrc around lines 6 - 19, Remove the commented pnpm settings from .npmrc
and re-add them in pnpm-workspace.yaml using pnpm-workspace's camelCase keys:
strictPeerDependencies: true, autoInstallPeers: true, shamefullyHoist: false,
and verifyStoreIntegrity: true; ensure the four keys are top-level in
pnpm-workspace.yaml so pnpm installs and CI workflows (which expect these
safeguards) honor them and npm no longer emits warnings from the .npmrc
comments.

@keito4
keito4 merged commit 6702178 into main Mar 9, 2026
11 checks passed
@github-actions

github-actions Bot commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.93.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions github-actions Bot added the released リリース済み label Mar 9, 2026
@keito4
keito4 deleted the feat/comprehensive-quality-improvements branch March 20, 2026 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released リリース済み

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant