Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Update to SvelteKit 3

未关闭
#348 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
22/100
Issue 类型
重构
描述清晰度
基本清楚
活跃度
活跃
技术栈
typescript

调研方向

This is a full SvelteKit 3 migration, not a first-issue. After the listed TypeScript/Vite upgrades, run npx sv migrate sveltekit-3, then follow the checklists: move adapter and vitePreprocess into vite.config.ts, retarget tsconfig.json extends, and rename $lib/$app imports. Touch the named call sites for goto/invalidateAll/handleError in src/hooks.server.ts, storage pages, and src/lib/storage/*.svelte.ts, then update AGENTS.md and helm env docs. Done when the app builds, env/zod, OIDC redirects, and forms behave under the new APIs.

由索引模型根据 Issue 内容生成。

描述

[!CAUTION]
This is not a complete list
And we should also wait for a few svelte patches before migrating

Prerequisit upgrades

  • TypeScript 5 to 6+
  • Vite 7 to 8

Auto migration

  • Run npx sv migrate sveltekit-3

Configuration

  • Delete svelte.config.js and move adapter() and vitePreprocess()
    into the sveltekit({ ... }) plugin options in vite.config.ts
  • tsconfig.json: change "extends" from "./.svelte-kit/tsconfig.json" to "$app/tsconfig"

Module aliases and imports

  • $lib → #lib
  • $app/environment → $app/env — 15 refs on main, 25 on the S3 branch

Environment variables

  • Rework all ENV vars to conform to the new env convention
  • Add zod schemas for every env

Navigation, forms and errors

  • goto() option invalidateAll → refreshAll, replaceState → replace. Affected:
    src/routes/(app)/storage/[bucket]/[...prefix]/+page.svelte:28 on main; on the S3 branch also
    storage/browse/[connection]/[bucket]/[...prefix]/+page.svelte:61,84 and storage/+layout.svelte:53
  • Standalone invalidateAll() → refreshAll(): src/lib/storage/state.svelte.ts:188,337,359
    plus archive.svelte.ts:236 and other call sites
  • Rework handleError at src/hooks.server.ts:94 — it now receives all errors including
    expected error() throws, so every 404/403 would currently be logged at error level and have
    its message replaced with "An unexpected error occurred". Discriminate on kind.
  • Review use:enhance forms — cross-page action now navigates automatically, and enhanced
    responses use the fail() status instead of always 200
  • Check external redirects still work — they now need { external: true } or an origin allowlist
    (relevant to the OIDC flow in src/routes/auth/)
  • $app/paths: Pathnames no longer start with /, which affects the
    PUBLIC_PATHS prefix matching in src/hooks.server.ts:46-55

Documentation

  • Update AGENTS.md — it documents $lib paths, the $env/process.env logging setup and the
    superforms rule, all of which change
  • Update deploy/helm/cockpit README and any env-var documentation
主要语言
TypeScript
星标
1
派生
0
平均合并
4 天 6 小时
30 天内合并 PR
12

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

stackabletech/cockpit 的其他 Issue

查看 stackabletech/cockpit 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。