Skip to content

chore(deps): migrate @sveltejs/kit to v3 and sveltejs/adapter-vercel to v7 - #4193

Open
KATO-Hiro wants to merge 6 commits into
stagingfrom
#4192
Open

KATO-Hiro wants to merge 6 commits into
stagingfrom
#4192

Conversation

@KATO-Hiro

@KATO-Hiro KATO-Hiro commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

close #4192

Summary by CodeRabbit

  • ドキュメント
    • SvelteKit 3への移行に合わせ、リダイレクト、内部リンク、フォーム送信、サーバー専用コードの扱いに関するガイドを更新しました。
  • バグ修正
    • ワークブック一覧や管理画面のフィルター操作で、URLと画面状態が正しく連動するよう改善しました。
  • テスト
    • アカウント移行、エラーページ、ログイン、ワークブックの編集・並べ替え・一覧表示に関するE2Eテストを追加しました。

KATO-Hiro and others added 6 commits October 19, 2026 11:40
SvelteKit 3 no longer reads svelte.config.js, and adapter-vercel 7
requires Kit 3, so both are upgraded together.

- Pin @sveltejs/kit 3.1.0 and @sveltejs/adapter-vercel 7.0.1
- Move the svelte.config.js options into sveltekit() in vite.config.ts;
  pass dynamicCompileOptions directly because Kit 3 removed
  config.vitePlugin (the sv migrate output still nests it there)
- Extend $app/tsconfig, which provides the compiler options that were
  set by hand, and keep $app/types in the overridden "types"

build, unit tests and lint pass. svelte-check reports 20 errors that
belong to the next phase (type export moves, $app/environment,
$app/stores, resolve() typings, and generic Actions params).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fix the svelte-check errors left by the Kit 3 upgrade and move the
remaining Kit 2 APIs to their Kit 3 forms.

- Import Handle from @sveltejs/kit/hooks and SubmitFunction from
  $app/forms; import Actions from ./$types where params are used
- Replace $app/environment with $app/env, including the test mocks
- Move KanbanBoard from $app/stores to $app/state and from
  replaceState() to a shallow goto(), so filter changes keep the board's
  local state; widen the kanban URL helpers to accept the read-only
  page.url
- Type buildWorkbooksUrl() as a /workbooks route with search so
  resolve() accepts it, use { replace: true } instead of the deprecated
  replaceState option, and drop the @ts-expect-error comments that
  Kit 3's route types no longer need
- Add E2E tests for keeping the kanban state while replacing the filter
  URL and for restoring saved workbook filters without a history entry

svelte-check, lint, unit tests, build, and the related E2E specs pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pin the SvelteKit 3 behavior of form actions, logout, session cookies
and error pages before the release.

- signin: keep form values after a failed enhanced login, return the
  fail() status (400) for an enhanced submission, land on home when
  logging out without a session, and keep the session cookie attributes
- workbook_edit: keep the nested workbook tasks after a failed edit
- account_transfer: reject a non-admin user (page and direct POST) and
  show the validation message for identical account names
- error_pages: render the 404 and 403 error pages

The fail() status and logout tests fail on SvelteKit 2, so they detect
the Kit 3 behavior change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- workbook_edit: delete a task row before the failed submission, so the
  test fails if the table falls back to the workbook's original tasks
  (confirmed with a temporary onUpdate mutation)
- workbook_order: rename the shallow-routing test to what it checks
  (no data reload and no history entry)
- architecture.md: separate the filename and server/ directory rules for
  server-only modules, and split the subpath imports section into
  use / don't use / extensions with OK and NG examples

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The subpath imports section still assumed Kit 2, where lint was the only
guard against $lib. On Kit 3, $lib fails in every form (vi.mock included,
via module_removed_lib), while vi.mock('$features/...') is silently
ignored, which is why the rg sweep remains.

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

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: AtCoder-NoviSteps/AtCoderNoviSteps/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 6954e443-4f86-447b-bedd-0f904ca573ec
📥 Commits

Reviewing files that changed from the base of the PR and between e3d1145 and 444e4da.

⛔ Files ignored due to path filters: 1
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml, !pnpm-lock.yaml
📒 Files selected for processing: 40
  • AGENTS.md
  • CONTRIBUTING.md
  • docs/guides/agent-rules/auth.md
  • docs/guides/agent-rules/sveltekit.md
  • docs/guides/agent-rules/testing-e2e.md
  • docs/guides/agent-rules/testing.md
  • docs/guides/architecture.md
  • e2e/account_transfer.spec.ts
  • e2e/error_pages.spec.ts
  • e2e/signin.spec.ts
  • e2e/workbook_edit.spec.ts
  • e2e/workbook_order.spec.ts
  • e2e/workbooks_list.spec.ts
  • eslint.config.mjs
  • package.json
  • src/app.d.ts
  • src/features/auth/server/auth.test.ts
  • src/features/auth/server/auth.ts
  • src/features/tasks/stores/active_contest_type.svelte.test.ts
  • src/features/votes/components/VotableGrade.svelte
  • src/features/workbooks/stores/replenishment_workbook.svelte.ts
  • src/features/workbooks/stores/replenishment_workbook.test.ts
  • src/features/workbooks/utils/workbook_url_params.ts
  • src/hooks.server.ts
  • src/lib/actions/handle_dropdown.ts
  • src/lib/components/AuthForm.svelte
  • src/lib/components/TagForm.svelte
  • src/lib/stores/local_storage_helper.svelte.ts
  • src/routes/(admin)/tasks/+page.svelte
  • src/routes/(admin)/tasks/[task_id]/+page.server.ts
  • src/routes/(admin)/tasks/_components/TaskTableForImport.svelte
  • src/routes/(admin)/workbooks/order/_components/KanbanBoard.svelte
  • src/routes/(admin)/workbooks/order/_utils/kanban.ts
  • src/routes/users/[username]/+page.svelte
  • src/routes/votes/[slug]/+page.svelte
  • src/routes/workbooks/+page.svelte
  • src/test/lib/stores/active_problem_list_tab.svelte.test.ts
  • svelte.config.js
  • tsconfig.json
  • vite.config.ts
💤 Files with no reviewable changes: 4
  • src/features/votes/components/VotableGrade.svelte
  • src/routes/users/[username]/+page.svelte
  • src/lib/components/TagForm.svelte
  • svelte.config.js

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

SvelteKit と Vercel アダプターを更新し、設定を vite.config.ts に移しました。アプリケーションコードとテストを新しい API に合わせて変更し、ナビゲーション処理と E2E テストを更新しました。関連する開発者向け文書も変更しました。

Changes: SvelteKit 3 移行

Layer / File(s) Summary
SvelteKit 3 の設定
package.json, svelte.config.js, vite.config.ts, tsconfig.json, AGENTS.md, CONTRIBUTING.md, docs/guides/architecture.md, eslint.config.mjs, src/app.d.ts
SvelteKit を 3.1.0、Vercel アダプターを 7.0.1 に更新しました。設定を vite.config.ts に移し、tsconfig.json の継承元を変更しました。バージョン表記とアーキテクチャ文書も更新しました。
SvelteKit API と型の更新
docs/guides/agent-rules/*, src/features/..., src/hooks.server.ts, src/lib/..., src/routes/...
環境モジュール、型の import 元、resolve() の型注釈を更新しました。リダイレクト、server-only 判定、subpath import、モック方法の説明も変更しました。
ナビゲーションと URL 状態の更新
src/features/workbooks/utils/workbook_url_params.ts, src/routes/(admin)/workbooks/order/..., src/routes/workbooks/+page.svelte, e2e/workbook_order.spec.ts, e2e/workbooks_list.spec.ts
ワークブック URL の型と保存 URL の復元処理を変更しました。Kanban のフィルター更新に goto() を使い、shallow navigation と replace を指定します。関連する E2E テストを追加しました。
フォームとアクセス制御の E2E テスト
e2e/account_transfer.spec.ts, e2e/error_pages.spec.ts, e2e/signin.spec.ts, e2e/workbook_edit.spec.ts, docs/guides/agent-rules/testing-e2e.md
アカウント移行、404・403、ログイン、ワークブック編集の E2E テストを追加しました。アクション失敗時の HTTP ステータスと別ページ宛てフォームの遷移について文書を更新しました。

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Other

Merge Risk: ⚪ Minimal · up to 444e4

The account-transfer test can inspect the redirect response as written. No actionable merge-blocking risk remains after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 55.56% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 21 files. (15 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed タイトルはSvelteKit v3とVercelアダプターv7への移行を明確に示しており、変更内容の中心と一致しています。
Linked Issues check Passed 直接リンクされた #4192 は SvelteKit 2 から 3 への移行です。package.json は @sveltejs/kit を 3.1.0、@sveltejs/adapter-vercel を 7.0.1 に更新しています。vite.config.ts、tsconfig.json、src/hooks.server.ts、$app/env と `$…
Out of Scope Changes check Passed 変更は #4192 の移行に関連しています。依存関係、Vite と TypeScript 設定、Kit 3 API の呼び出し、ルート型、認証・フォーム・ナビゲーションの回帰テスト、移行後の開発者向け文書を更新しています。svelte.config.js の移行に伴う削除と Vercel 設定の vite.config.ts への移動も同じ目的に含まれます。無関係な機能追加または独立した修…
Full details: Linked Issues check

Explanation

直接リンクされた #4192 は SvelteKit 2 から 3 への移行です。package.json は @sveltejs/kit を 3.1.0、@sveltejs/adapter-vercel を 7.0.1 に更新しています。vite.config.ts、tsconfig.json、src/hooks.server.ts、$app/env と $app/state の利用、Kit 3 の型とルート API に合わせて実装を更新しています。移行後の svelte-check、lint、単体テスト、build、関連 E2E の成功も要約に示されています。E2E とドキュメントはフォーム、認証、エラーページ、ナビゲーションなどの Kit 3 回帰を検証します。

Full details: Out of Scope Changes check

Explanation

変更は #4192 の移行に関連しています。依存関係、Vite と TypeScript 設定、Kit 3 API の呼び出し、ルート型、認証・フォーム・ナビゲーションの回帰テスト、移行後の開発者向け文書を更新しています。svelte.config.js の移行に伴う削除と Vercel 設定の vite.config.ts への移動も同じ目的に含まれます。無関係な機能追加または独立した修正は、提供された変更要約から確認できません。

Full details: Docstring Coverage

Explanation

Docstring coverage is 55.56% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 21 files. (15 skipped: 15 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Warning

Some tools did not complete. Review the errors below.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install timed out. The project may have too many dependencies for the sandbox.

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.

This branch was successfully deployed

1 active deployment
preview — 444e4daf Deployed Oct 19, 2026 by KATO-Hiro via preview #9020
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.

deps: migrate kit from v2 to v3 and sveltejs/adapter-vercel v6 to v7

1 participant