这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@YasushiKobayashi
Copy link
Owner

@YasushiKobayashi YasushiKobayashi commented Nov 1, 2025

概要

  • バイナリ形式のロックファイル (bun.lockb) からテキスト形式のロックファイル (bun.lock) へ移行し、バージョン管理と差分の可視性を向上
  • testing-libraryとstorybook用のESLintプラグイン設定を追加し、適切なルールを適用
  • Storybook設定ファイルとストーリーファイルを更新

変更内容

  • bun.lockbbun.lock (テキスト形式) に置き換え
  • テストファイル用のtesting-library ESLintプラグイン設定を追加
  • ストーリーファイル用のstorybook ESLintプラグイン設定を追加
  • package.jsonの依存関係を更新
  • Storybook設定とストーリーファイルを更新

テスト計画

  • ロックファイルが正しくフォーマットされていることを確認
  • 依存関係が正しく解決されることを確認
  • ESLintを実行し、設定が正しく動作することを確認
  • すべてのテストを実行し、破壊的変更がないことを確認

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Upgraded Storybook to v10, added new addons and moved Storybook tooling to top-level devDependencies
    • Enhanced ESLint with testing-library and storybook plugins and file-specific overrides
    • Updated test tooling (happy-dom, vitest-ci reporter change) and added @types/node
    • Migrated Storybook configs and stories to ESM/Next.js patterns
    • Added CI wait-for-server step, .claude and .mcp.json configs, and ignored test report output

Migrate from binary lockfile format (bun.lockb) to text-based lockfile (bun.lock) for better version control. Add proper ESLint plugin configurations for testing-library and storybook with specific rule enforcement.

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

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

coderabbitai bot commented Nov 1, 2025

Warning

Rate limit exceeded

@YasushiKobayashi has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 0 minutes and 32 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between d0e8d1d and 71e9556.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (6)
  • .claude/settings.json (1 hunks)
  • .mcp.json (1 hunks)
  • package.json (5 hunks)
  • src/next-sample/src/atoms/InputForm/InputForm.spec.tsx (1 hunks)
  • src/next-sample/src/templates/Top/Top.spec.tsx (1 hunks)
  • src/next-sample/tsconfig.json (1 hunks)

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Adds ESLint testing-library and storybook plugins; upgrades Storybook/related dependencies and migrates Storybook config and stories to ESM/Next.js package; introduces a GitHub Actions step to wait for the server; and updates .gitignore.

Changes

Cohort / File(s) Summary
ESLint plugin integration
eslint.config.mjs
Added testing-library and storybook plugins and two override blocks: one targeting test/spec files with testing-library rules set to error, and one targeting story files with a storybook default-export rule.
Dependencies
package.json
Replaced Storybook v8 addon set with Storybook v10 addons (@storybook/nextjs, @storybook/addon-docs, etc.), added eslint-plugin-storybook, eslint-plugin-testing-library, bumped Chromatic to ^4.1.2, upgraded happy-dom and other dev tooling, and added a top-level storybook devDependency.
Storybook config (main + preview)
src/next-sample/.storybook/main.ts,
src/next-sample/.storybook/preview.ts
Migrated main.ts to ESM-compatible format (adds __filename/__dirname shim, uses TsconfigPathsPlugin via require), updated addons (removed addon-essentials/interactions, added Chromatic and docs), removed autodocs docs block; preview.ts now imports Preview from @storybook/nextjs and adds tags: ['autodocs'].
Story files (types & test imports)
src/next-sample/src/atoms/InputForm/InputForm.story.tsx,
src/next-sample/src/templates/Top/Top.story.tsx
Updated Storybook type imports from @storybook/react@storybook/nextjs and switched test utility imports from @storybook/teststorybook/test (keeps runtime logic unchanged).
CI: e2e flow
.github/workflows/js_test.yml
Added a "wait for server" step in the e2e job that polls http://localhost:3000 (curl loop, 60s timeout) after starting the server to ensure readiness before running tests.
VCS ignore
.gitignore
Added test-report.junit.xml to ignored paths; no other functional changes to ignore rules.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant GH as GitHub Actions
  participant Runner as Workflow Runner
  participant Server as Local Dev Server (localhost:3000)
  Note over GH,Runner: e2e job start
  GH->>Runner: start server (background)
  Runner->>Server: HTTP GET / (loop)
  alt server responds within 60s
    Server-->>Runner: 200 OK
    Runner->>GH: proceed to run e2e tests
  else timeout or no response
    Runner-->>GH: fail job (server not ready)
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Areas needing careful review:
    • package.json: verify Storybook v10 addon compatibility, Chromatic upgrade, and happy-dom v20 impact.
    • src/next-sample/.storybook/main.ts: ESM shims, TsconfigPathsPlugin integration into webpackFinal, and addon list correctness.
    • eslint.config.mjs: ensure override globs and rule names are correct and do not conflict with existing rules.
    • CI step .github/workflows/js_test.yml: confirm polling logic and timeout work across runners.

Poem

🐰 I hopped through configs, lint, and tales,
Swapped addons, paths, and tiny rails.
ESM snug, tests kept bright,
CI waits for the server’s light—
A cheerful merge with floppy-eared trails! 🥕📚

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title Check ❓ Inconclusive The PR title states two main changes: "bun.lockへの移行" (migration to bun.lock) and "ESLint設定の更新" (ESLint configuration update). The raw_summary confirms that ESLint configuration changes are present (eslint.config.mjs includes new testing-library and storybook plugin configurations). However, the bun.lock migration, which appears to be the primary focus of the title, is not evident in the provided file summary. Additionally, the title does not capture other substantial changes shown in the raw_summary, including Storybook configuration migration to ESM, dependency updates (Storybook v8→v10.x, Chromatic, happy-dom), story file imports, and workflow improvements. The title is partially aligned with the changeset but does not comprehensively reflect the scope of changes. The title's primary claim (bun.lock migration) is not clearly present in the provided raw_summary of changed files, creating uncertainty about whether the title accurately represents the PR scope. Consider clarifying the title to emphasize the most visible changes such as "chore(deps): upgrade Storybook to v10 and add ESLint plugin configurations" or confirming that the lock file migration is indeed part of the changeset. Additionally, ensure the title captures the major theme of the changes—whether it's the dependency upgrades, ESLint/Storybook configuration updates, or the lock file format change.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @YasushiKobayashi, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

このプルリクエストは、開発環境の保守性と品質を向上させることを目的としています。Bunのロックファイルをテキスト形式に移行することで、変更履歴の追跡を容易にし、testing-libraryとStorybookに特化したESLintルールを導入することで、コードの一貫性と品質を確保します。また、Storybookの依存関係と設定を最新化し、開発ワークフローを最適化します。

Highlights

  • Bunロックファイルの移行: バイナリ形式のbun.lockbからテキスト形式のbun.lockへ移行し、バージョン管理と差分確認の可視性を向上させました。
  • ESLint設定の強化: testing-libraryとstorybook用のESLintプラグイン設定を追加し、テストファイルとストーリーファイルに適切なリンティングルールを適用しました。
  • Storybookの更新: Storybookの依存関係を最新バージョンに更新し、設定ファイルとストーリーファイルの記述を調整しました。
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@YasushiKobayashi YasushiKobayashi self-assigned this Nov 1, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

このプルリクエストは、bun.lockへの移行、ESLint設定の更新、および依存関係の更新を行うものです。ESLintにtesting-libraryとstorybookのプラグインを追加する対応は良いと思いますが、設定にいくつか問題が見られます。特に、package.jsonで指定されている依存関係のバージョンの多くが存在しないため、インストールが失敗する可能性が非常に高いです。また、Storybookの設定ファイルから重要なアドオンが削除されており、インタラクションテストが動作しなくなると思われます。これらの点について、具体的な修正案をコメントしましたのでご確認ください。

Comment on lines +259 to +267
files: ['**/*.spec.{ts,tsx}', '**/*.test.{ts,tsx}'],
plugins: { 'testing-library': testingLibraryPlugin },
rules: {
'testing-library/await-async-events': 2,
'testing-library/await-async-queries': 2,
'testing-library/await-async-utils': 2,
'testing-library/no-await-sync-events': 2,
'testing-library/no-await-sync-queries': 2,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

high

このtesting-library用の設定は素晴らしいですが、現在の設定では意図した通りに動作しない可能性があります。
ファイルの先頭にあるignores設定で、テストファイル(src/**/*.spec.{ts,tsx}, src/**/*.test.{ts,tsx})が除外されているため、このルールブロックが適用されません。

この設定を有効にするには、ignores配列から該当のパターンを削除する修正が別途必要になります。

サーバーの起動完了を待ってからe2eテストを実行するように修正

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

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

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
.github/workflows/js_test.yml (1)

91-93: Well-placed server readiness check with sound implementation.

The "wait for server" step properly ensures the dev server is ready before running E2E tests, preventing race conditions. The polling mechanism using curl -f with retry loop and 60-second timeout is a solid approach that's standard in CI workflows.

Optional improvement: Consider polling a dedicated health endpoint if available. The current approach polls any endpoint and accepts any HTTP response. If the dev server exposes a health check endpoint (e.g., /api/health), polling that could provide stronger confidence that the server is fully initialized:

-        run: |
-          timeout 60 bash -c 'until curl -f http://localhost:3000 > /dev/null 2>&1; do sleep 1; done'
+        run: |
+          timeout 60 bash -c 'until curl -f http://localhost:3000/api/health > /dev/null 2>&1; do sleep 1; done'

Only apply this if such an endpoint exists and is appropriate for your Next.js sample application.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b301c00 and d0e8d1d.

📒 Files selected for processing (2)
  • .github/workflows/js_test.yml (1 hunks)
  • .gitignore (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
.github/workflows/**

📄 CodeRabbit inference engine (.cursor/rules/all.mdc)

Run automated tests via GitHub Actions workflows

Files:

  • .github/workflows/js_test.yml
.github/workflows/*.y?(a)ml

📄 CodeRabbit inference engine (CLAUDE.md)

Configure GitHub Actions to run lint, type-check, unit tests, E2E tests, upload coverage to Codecov, and run Chromatic/Launchable on push to master and PRs

Files:

  • .github/workflows/js_test.yml
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
Repo: YasushiKobayashi/samples PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-09-21T20:10:03.369Z
Learning: Applies to .github/workflows/*.y?(a)ml : Configure GitHub Actions to run lint, type-check, unit tests, E2E tests, upload coverage to Codecov, and run Chromatic/Launchable on push to master and PRs
📚 Learning: 2025-09-21T20:10:03.369Z
Learnt from: CR
Repo: YasushiKobayashi/samples PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-09-21T20:10:03.369Z
Learning: Applies to src/playwright-sample/** : Keep Playwright E2E tests within the src/playwright-sample workspace and execute them from there

Applied to files:

  • .github/workflows/js_test.yml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: e2e
🔇 Additional comments (1)
.gitignore (1)

60-61: LGTM!

Both additions are well-motivated and aligned with the PR objectives:

  • Line 60: settings.local.json is a standard pattern for local configuration files that should not be committed.
  • Line 61: test-report.junit.xml aligns with the test tooling changes (eslint-plugin-testing-library and related test setups) mentioned in the PR, and complements the existing test-report ignores at lines 46 and 59.

No issues identified.

YasushiKobayashi and others added 5 commits November 1, 2025 13:22
vitest-ciコマンドにdefaultレポーターを追加し、
失敗したテストの詳細がコンソールに表示されるように修正

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

Co-Authored-By: Claude <noreply@anthropic.com>
Storybook portable storiesのcomposeStoriesをVitestで使用すると
Next.jsモジュールの解決に問題が発生するため、
テストを直接コンポーネントをインポートする方式に書き換え

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

Co-Authored-By: Claude <noreply@anthropic.com>
@testing-library/user-eventが依存関係に含まれていないため、
@testing-library/reactのfireEventを使用するように変更

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

Co-Authored-By: Claude <noreply@anthropic.com>
Storybook 10の型定義を正しく解決するため、
tsconfig.jsonのmoduleResolutionをbundlerに設定

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

Co-Authored-By: Claude <noreply@anthropic.com>
@YasushiKobayashi YasushiKobayashi merged commit 2757247 into master Nov 1, 2025
6 checks passed
@YasushiKobayashi YasushiKobayashi deleted the feature/update-lib branch November 1, 2025 05:04
@coderabbitai coderabbitai bot mentioned this pull request Nov 1, 2025
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.

2 participants