sv-utils: generate the supported Handle import for Kit 2
メンテナーはふだん 4 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 85/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
packages/sv-utils/src/tooling/js/kit.ts の addHooksHandle から始め、生成される TypeScript の import と JSDoc アノテーションの両方を確認してください。プロジェクトの通常のチェック、または issue に記載されている簡略化した型チェックを、サポート対象のすべての Kit メジャーバージョンで実行してください。生成された hook が有効な Handle エクスポートを使用し、両方の形式で型チェックが通れば完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary
Adding Better Auth to a supported SvelteKit 2 project emits Handle imports from @sveltejs/kit/hooks. Kit 2 declares that type in @sveltejs/kit and does not export it from the hooks module. The generated hook fails type checking independently of the default Kit 3/Better Auth peer conflict.
Steps to reproduce
Start with a working TypeScript SvelteKit 2.70.3 project and use sv 1.0.1 to add the integrations:
npx --yes [email protected] add drizzle=database:sqlite+client:libsql better-auth=demo:password --no-install --no-git-check
Inspect src/hooks.server.ts. The generated import is:
import type { Handle } from '@sveltejs/kit/hooks';
Run the project's normal check. A minimized type check with the published Kit 2.70.3 declarations and TypeScript 6.0.3 also reproduces the error using only this import and export type ConsumerHandle = Handle.
Expected behavior
The hook generator uses the type export provided by the installed Kit major. Kit 2 projects remain supported by the add-on's setup contract and generated hook imports type-check.
Actual behavior
TypeScript reports:
TS2459: Module '"@sveltejs/kit/hooks"' declares 'Handle' locally, but it is not exported.
Changing only the type import to @sveltejs/kit removes that diagnostic. The minimized type check exits 2 before the correction and 0 afterward.
Affected area
packages/sv-utils/src/tooling/js/kit.ts, specifically addHooksHandle, used by the Better Auth add-on. The helper also writes the hooks-module import in JSDoc annotations.
Runtime or environment
sv 1.0.1, SvelteKit 2.70.3, TypeScript 6.0.3, Better Auth 1.7.7, Svelte 5.57.1, Node.js 22.23.2, npm 12.0.2 on macOS ARM64.
Evidence
Current helper at revision 7ff52c0955e1f07b8719029d60afac1ee634ad69 always sources Handle from @sveltejs/kit/hooks. Kit 2.70.3 type declarations import Handle locally in that module but do not export it. An isolated check against those exact declarations confirms the failing and corrected imports.
Impact
Using a Kit 2 dependency graph to satisfy Better Auth's peer requirements still leaves an independently invalid generated hook. The regression condition is that the helper's output type-checks for each supported Kit major, including its TypeScript and JSDoc forms.
- 主要言語
- TypeScript
- スター
- 513
- フォーク
- 110
- 平均マージ
- 5日 1時間
- マージ済み PR(30日)
- 24
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
sveltejs/cli のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 4 日以内に返信
-
[bug] Better Auth addon generates legacy D1 binding access with SvelteKit 3 and Cloudflare adapter 8オープンbug pkg:add
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
sveltejs/cli#1450 · コメント 2 件 ·
メンテナーはふだん 4 日以内に返信
-
pkg:add
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
sveltejs/cli#1399 · コメント 2 件 ·
メンテナーはふだん 4 日以内に返信
-
pkg:migrate
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
sveltejs/cli#1461 · コメント 2 件 ·
メンテナーはふだん 4 日以内に返信
-
enhancement pkg:migrate
難易度 3/5 1〜2日 初心者へのやさしさ 53/100
sveltejs/cli#1440 · コメント 3 件 · リアクション 1 件 ·
メンテナーはふだん 4 日以内に返信
似ている issue
-
[analytics-core] getQueryParams does not decode `+` as space and truncates values containing `=`オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
amplitude/Amplitude-TypeScript#2179 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
ci good first issue severity: low
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
TMHSDigital/GH-Arcade#111 ·
-
AsnIntegerConverter.toASN coerces strings with +value, rounding integers outside safe-integer rangeオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
PeculiarVentures/asn1-schema#189 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
anaisbetts/spawn-rx#38 ·