Skip to content

docs: アクセシビリティテストとバンドルサイズ監視を追加 - #528

Merged
keito4 merged 1 commit into
mainfrom
docs/add-qa-libraries
Mar 4, 2026
Merged

docs: アクセシビリティテストとバンドルサイズ監視を追加#528
keito4 merged 1 commit into
mainfrom
docs/add-qa-libraries

Conversation

@keito4

@keito4 keito4 commented Mar 4, 2026

Copy link
Copy Markdown
Owner

概要

品質保証の観点から、アクセシビリティテストとバンドルサイズ監視をNext.jsセットアップガイドに追加します。

変更内容

アクセシビリティテスト(E2E + ユニット)

  • @axe-core/playwright: 既存の Playwright テストに数行追加するだけで WCAG 違反を検出
    • tests/e2e/accessibility.spec.ts の実装例を追加
    • wcag2a / wcag2aa タグでの絞り込みパターンを記載
  • jest-axe: Testing Library と組み合わせてコンポーネント単位で a11y チェック
    • E2E はページ全体、ユニットはコンポーネント個別の責務として使い分けを明記

バンドルサイズ監視

  • @next/bundle-analyzer: next.config.ts の設定例を追加
    • ANALYZE=true npm run build でブラウザにバンドルツリーを表示
    • CI でのアーティファクト保存パターンを追加
    • 依存追加 PR 時に手動実行して確認する運用を推奨

CI/CD パイプライン

  • フロー図に a11ybundle check を追記

ツールカタログ

  • Web アプリ (Next.js) の依存リストに @axe-core/playwrightjest-axe@next/bundle-analyzer を追加

テスト

  • ✅ Format Check: 通過
  • ✅ Lint: 通過
  • ✅ Test: 101 tests 通過

🤖 Generated with Claude Code

## アクセシビリティテスト (web-app-nextjs.md)
- @axe-core/playwright: E2E での WCAG 違反検出、ページ単位のテスト例を追加
- jest-axe: ユニットテストでのコンポーネント単位 a11y チェック例を追加
- E2E とユニットの責務の使い分けを明記

## バンドルサイズ監視 (web-app-nextjs.md)
- @next/bundle-analyzer: next.config.ts の設定例を追加
- ANALYZE=true でブラウザにバンドルツリーを表示するスクリプトを追加
- CI でのアーティファクト保存パターンを追加

## CI/CD パイプライン (web-app-nextjs.md)
- フロー図に a11y と bundle チェックを追記

## ツールカタログ (tool-catalog.md)
- Web アプリ (Next.js) の依存リストに両ツールを追加

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

coderabbitai Bot commented Mar 4, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@keito4 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 20 minutes and 13 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.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8da8fa89-d386-4aa3-9758-e7419f545864

📥 Commits

Reviewing files that changed from the base of the PR and between 05f8b9f and 8d8877c.

📒 Files selected for processing (2)
  • docs/setup/web-app-nextjs.md
  • docs/tool-catalog.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch docs/add-qa-libraries

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.

@keito4
keito4 merged commit ebee715 into main Mar 4, 2026
3 checks passed

@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: 8d8877ca69

ℹ️ 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".


test.describe('アクセシビリティ', () => {
test('トップページに WCAG 違反がないこと', async ({ page }) => {
await page.goto('/');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Configure baseURL before using relative Playwright URLs

The new accessibility example navigates with page.goto('/'), but this guide’s playwright.config.ts snippet does not set use.baseURL, so copying this as-is causes the test to fail with an invalid URL instead of running axe checks. This breaks the documented a11y workflow for any project that follows the provided config verbatim.

Useful? React with 👍 / 👎.

Comment on lines +370 to +373
- name: Build and check bundle size
run: npm run build
env:
NEXT_TELEMETRY_DISABLED: 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.

P2 Badge Set ANALYZE=true in CI bundle-check example

This CI snippet runs npm run build without enabling ANALYZE, even though the preceding config enables @next/bundle-analyzer only when process.env.ANALYZE === 'true'. In that case .next/analyze/ is not generated, so the artifact upload does not provide the promised bundle report and the “bundle check” step is effectively a normal build.

Useful? React with 👍 / 👎.

@claude

claude Bot commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

Claude Code レビュー

PRをレビューしました。以下にフィードバックをまとめます。


全体評価

ドキュメント品質の向上という観点で価値ある変更です。アクセシビリティテストとバンドルサイズ監視の両方を実践的なコード例付きで解説しており、開発者がすぐに導入できる形になっています。


良い点

  • 具体的なコード例: インストールコマンドから設定ファイルまで一貫して実装例が示されており、コピーして使える品質
  • 責務の分離の説明: E2EとユニットテストでのA11yチェックの使い分けを明記している点は特に有用
  • CI/CDフロー図の更新: パイプラインへの追記が適切に反映されている
  • tool-catalog.md の更新: 依存リストの同期が取れている

改善提案

1. トップページのA11yテストで withTags を省略している

2つのテストで withTags の有無が異なります。意図的な差異なら理由を補足コメントで説明すると読者の混乱を防げます。推奨は .withTags(['wcag2a', 'wcag2aa']) で統一することです。

2. jest-axe の expect.extend はセットアップファイルで行う

サンプルコードでは各テストファイルに expect.extend(toHaveNoViolations) を記載しています。実際のプロジェクトでは jest.setup.ts などのセットアップファイルで1度だけ呼ぶパターンが一般的です。ドキュメントにその推奨パターンも補足すると実用度が上がります。

3. バンドルアナライザーのCIアーティファクトパスが不正確な可能性

path: .next/analyze/ と記載されていますが、@next/bundle-analyzer のデフォルト出力先は .next/analyze/ ではなく .next/ 直下の client.html / server.html です。enabled 時に生成されるパスを確認し、正確なパスを記載することを推奨します。

4. Windows環境でのenvコマンド非互換

ANALYZE=true npm run build の形式はWindows上では動作しません。クロスプラットフォーム対応として cross-env の使用を推奨するか、その限界を明示するとよいです。


セキュリティ・品質ゲート観点

特筆すべき問題はありません。サンプルコードに認証情報や機密値も含まれていません。


総括

ドキュメントとして実用的な内容で、マージに値する品質です。上記の改善提案は次のPR or Issue で対応いただければ十分です。

🤖 Reviewed with Claude Code

keito4 pushed a commit that referenced this pull request Mar 4, 2026
PR #527(標準ライブラリ追加)と PR #528(axe + bundle-analyzer)の
tool-catalog.md 変更をマージして統合。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.83.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions github-actions Bot added the released リリース済み label Mar 4, 2026
@keito4
keito4 deleted the docs/add-qa-libraries 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