next-typed-href: nuqs サンプルアプリを examples/ に追加#29
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Walkthroughexamples ディレクトリに Next.js App Router + nuqs を使った型安全な例アプリを追加し、ワークスペース設定・Turbo 設定・CI ステップ・README 参照および関連ファイル(レイアウト、ページ、typed href ヘルパー、searchParams)を導入しました。 Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 分 Possibly related PRs
Suggested reviewers
詩
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…artifacts Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
b9c7ff5 to
20a84d6
Compare
akameco
left a comment
There was a problem hiding this comment.
workspace:* で参照しているから、example を動かす前に pnpm --filter @plainbrew/next-typed-href build が必要。
npm scriptsのdevにbuildステップ入れるとか
"dev": "pnpm --filter @plainbrew/next-typed-href build && next dev"
| </Link> | ||
| </li> | ||
| <li> | ||
| <Link href={$href({ route: "/search", searchParams: { q: "typed", page: null } })}> |
There was a problem hiding this comment.
nullを許容しないので、型エラー。exampleもCIで型チェックした方がいいかも
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…r example Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
turbo.json (1)
4-7:build.outputsに Next.js の成果物も含めるとキャッシュ精度が上がります。現在は
dist/**のみなので、next buildを実行するパッケージでは成果物復元が不完全になりやすいです。".next/**"(必要なら!.next/cache/**除外)追加を推奨します。差分案
"tasks": { "build": { "dependsOn": ["^build"], - "outputs": ["dist/**"] + "outputs": ["dist/**", ".next/**", "!.next/cache/**"] },🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@turbo.json` around lines 4 - 7, build の outputs が "dist/**" のみで Next.js の成果物を含んでおらずキャッシュ復元が不完全になるため、turbo.json の "build" セクション(キー名: "build", プロパティ: "outputs")に Next.js の出力パターン ".next/**" を追加し、必要ならキャッシュを無視するために "!.next/cache/**" も追加して成果物を正しくキャッシュ・復元できるように修正してください。
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@examples/example-next-typed-href-nuqs/src/app/search/page.tsx`:
- Around line 17-23: input 要素(値を参照している q と onChange で setParams を呼ぶ箇所)が
placeholder のみでラベルがないため支援技術に不親切です。input に一意の id を追加し、その id と紐づく label
を追加してラベルテキスト(例: "Search query" または "検索クエリ")を設定してください。既存の value={q ?? ""} と
onChange={(e) => setParams({ q: e.target.value || null, page: 1 })}
のロジックはそのまま残して input の id と label の for/htmlFor を関連付けるように修正してください。
---
Nitpick comments:
In `@turbo.json`:
- Around line 4-7: build の outputs が "dist/**" のみで Next.js
の成果物を含んでおらずキャッシュ復元が不完全になるため、turbo.json の "build" セクション(キー名: "build", プロパティ:
"outputs")に Next.js の出力パターン ".next/**" を追加し、必要ならキャッシュを無視するために "!.next/cache/**"
も追加して成果物を正しくキャッシュ・復元できるように修正してください。
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 7dcc3a8d-3242-45ca-b5a6-38eb8d817778
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (12)
examples/example-next-typed-href-nuqs/.gitignoreexamples/example-next-typed-href-nuqs/next.config.tsexamples/example-next-typed-href-nuqs/package.jsonexamples/example-next-typed-href-nuqs/src/app/layout.tsxexamples/example-next-typed-href-nuqs/src/app/page.tsxexamples/example-next-typed-href-nuqs/src/app/search/page.tsxexamples/example-next-typed-href-nuqs/src/app/search/searchParams.tsexamples/example-next-typed-href-nuqs/src/lib/href.tsexamples/example-next-typed-href-nuqs/tsconfig.jsonpackage.jsonpnpm-workspace.yamlturbo.json
| <div> | ||
| <input | ||
| type="text" | ||
| placeholder="Search query" | ||
| value={q ?? ""} | ||
| onChange={(e) => setParams({ q: e.target.value || null, page: 1 })} | ||
| /> |
There was a problem hiding this comment.
入力欄に明示ラベルを付けてください。
Line 18 の input は placeholder のみで、支援技術利用時の識別が弱くなります。label と id の関連付けを追加してください。
修正案
<div>
+ <label htmlFor="search-query">Search query</label>
<input
+ id="search-query"
type="text"
placeholder="Search query"
value={q ?? ""}
onChange={(e) => setParams({ q: e.target.value || null, page: 1 })}
/>
</div>📝 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.
| <div> | |
| <input | |
| type="text" | |
| placeholder="Search query" | |
| value={q ?? ""} | |
| onChange={(e) => setParams({ q: e.target.value || null, page: 1 })} | |
| /> | |
| <div> | |
| <label htmlFor="search-query">Search query</label> | |
| <input | |
| id="search-query" | |
| type="text" | |
| placeholder="Search query" | |
| value={q ?? ""} | |
| onChange={(e) => setParams({ q: e.target.value || null, page: 1 })} | |
| /> | |
| </div> |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@examples/example-next-typed-href-nuqs/src/app/search/page.tsx` around lines
17 - 23, input 要素(値を参照している q と onChange で setParams を呼ぶ箇所)が placeholder
のみでラベルがないため支援技術に不親切です。input に一意の id を追加し、その id と紐づく label を追加してラベルテキスト(例:
"Search query" または "検索クエリ")を設定してください。既存の value={q ?? ""} と onChange={(e) =>
setParams({ q: e.target.value || null, page: 1 })} のロジックはそのまま残して input の id と
label の for/htmlFor を関連付けるように修正してください。
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@akameco 以下対応したので再レビューお願いします 🙏
|
Summary
fix https://linear.app/plainbrew/issue/PC-61/nextjs-%E3%82%B5%E3%83%B3%E3%83%97%E3%83%AB%E3%82%A2%E3%83%97%E3%83%AA%E3%81%AE%E4%BD%9C%E6%88%90
examples/example-next-typed-href-nuqs/— minimal Next.js App Router app demonstratingdefineTypedHrefWithNuqspnpm-workspace.yamlに"examples/*"を追加ParserBuilder<unknown>→ParserBuilder<any>に変更(DTS ビルドエラー・型推論エラーの修正)Structure
Start
Summary by CodeRabbit