Skip to content

feat!: migrate to SvelteKit 3 - #25

Merged
jaysin586 merged 2 commits into
mainfrom
chore/sveltekit-3
Oct 27, 2026
Merged

jaysin586 merged 2 commits into
mainfrom
chore/sveltekit-3

Conversation

@jaysin586

Copy link
Copy Markdown
Contributor

Summary

Moves docs-kit to SvelteKit 3 and sets its @sveltejs/kit peer range to ^3.0.0. The docs sites pin docs-kit by CalVer tag (github:humanspeak/docs-kit#2026.9.x), so sites still on Kit 2 aren't affected until they bump. Merging this creates the tag that each docs site's Kit 3 PR will point at.

Changes

📦 Dependencies

  • @sveltejs/kit 3.1.0, @sveltejs/package 3.0.1, @sveltejs/adapter-auto 8.0.0, svelte 5.57.2, @sentry/sveltekit 11.9.0, svelte-check 4.7.7
  • Peer @sveltejs/kit ^2.0.0 → ^3.0.0

🔧 Kit 3 migration

  • svelte.config.js removed. Its options now go to sveltekit() in vite.config.ts, because Kit 3 refuses to start when that file exists.
  • tsconfig.json extends $app/tsconfig, and its include keeps Kit 2's js/ts/svelte set. A bare "src" would also typecheck the untyped .mjs scripts and tests.
  • SeoHead: $app/stores → $app/state (the stores module is removed in Kit 3).
  • Handle / HandleClientError types now come from @sveltejs/kit/hooks.
  • Package-internal $lib imports (the ui/dropdown-menu components and the dev routes) are now relative paths, so the published dist/ never relies on a consumer-side #lib alias. Usage examples in doc comments and the README now show the Kit 3 form, #lib/....

🔧 svelte-check 4.7

  • $props<T>() → const { … }: T = $props(). svelte-check 4.7 rejects the generic form, which caused 16 errors even on Kit 2.

Verification

  • pnpm check: 0 errors, 0 warnings
  • pnpm test (svelte-package build + node tests): 29/29 pass
  • vite build of the dev app succeeds
  • dist/ contains no $lib, #lib, or $app/stores imports outside doc comments
  • trunk check: no new issues

Commits

  • c06879a chore(deps): bump toolchain to SvelteKit 3
  • 1432451 feat!: migrate to SvelteKit 3

🤖 Generated with Claude Code

jaysin586 and others added 2 commits October 27, 2026 12:37
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Move svelte.config.js options into the sveltekit() Vite plugin
- Extend $app/tsconfig, keeping Kit 2's js/ts/svelte include set
- Replace $app/stores with $app/state in SeoHead
- Import Handle types from @sveltejs/kit/hooks
- Use relative imports inside the package instead of $lib, so dist
  never depends on a consumer-side alias
- Convert $props<T>() to annotated $props(); svelte-check 4.7 rejects
  the generic form
- Peer @sveltejs/kit ^3.0.0; consumers on Kit 2 stay on earlier tags

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jaysin586 jaysin586 added enhancement Apply to new features or improvements to existing features breaking-change Apply to changes that break backward compatibility dependencies Pull requests that update a dependency file labels Oct 27, 2026
@jaysin586 jaysin586 self-assigned this Oct 27, 2026
@jaysin586
jaysin586 merged commit 1432451 into main Oct 27, 2026
4 checks passed
jaysin586 added a commit to humanspeak/svelte-markdown that referenced this pull request Oct 27, 2026
* chore(docs): migrate docs site to SvelteKit 3

- Kit 3.1 + adapter-cloudflare 8; svelte.config.js folded into vite.config.ts
- $lib -> #lib subpath imports (package.json "imports")
- $env/dynamic/public -> $app/env/public with src/env.ts declarations
- hooks.client handleError: sync, and only report unexpected errors
  (Kit 3 also routes expected 404/error() through the hook)
- tsconfig extends $app/tsconfig with Kit 2's include set
- mdsvex highlighter: treat a null fence language as 'text'
- docs-kit pinned to its Kit 3 commit (humanspeak/docs-kit#25)
- Scope the cookie CVE override to Kit 2 (library dev app); Kit 3
  depends on cookie v2

The library itself stays on Kit 2.

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

* chore(docs): drop manualChunks that Kit 3 ignores

Kit 3 sets its own codeSplitting for the client build, so the manual
chunk rules were dead config (and emitted a build warning). Kit 3's
default splitting already loads far less JS than the old manual chunks:
measured in Chrome, / drops from 5.7 MB to 0.98 MB of decoded JS and
/examples/shiki from 6.3 MB to 1.5 MB.

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

* chore(docs): pin docs-kit to the 2026.10.1 release

Same commit as before (the docs-kit SvelteKit 3 migration), now by tag.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
jaysin586 added a commit to humanspeak/svelte-motion that referenced this pull request Oct 27, 2026
* chore(docs): migrate docs site to SvelteKit 3

- Kit 3.1 + adapter-cloudflare 8 (adapter-auto 8); svelte.config.js folded
  into vite.config.ts, keeping the scoped-props preprocessor, mdsvex/shiki
  highlighter, paths.relative=false and the CSP directives
- $lib -> #lib subpath imports (package.json "imports"), incl. generated
  demo-loaders / registry-data modules; reader-facing code samples keep $lib
- $app/environment -> $app/env; $env/dynamic/public -> $app/env/public with
  src/env.ts declarations (posthog server client, hooks, sitemap, spec mock)
- hooks.client/hooks.server handleError: sync, and only report unexpected
  errors (Kit 3 also routes expected 404/error() through the hooks)
- tsconfig extends $app/tsconfig with Kit 2's include set
- mdsvex highlighter: treat a null fence language as 'text'
- generate-registry: rewrite #lib/shadcn/utils.js to $UTILS$ as well
- docs-kit pinned to its Kit 3 commit (humanspeak/docs-kit#25)
- Lockfile deduped so the workspace has a single svelte (5.57.2, required
  by Kit 3); avoids duplicate Snippet types between docs and the library

The library itself stays on Kit 2.

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

* chore(docs): pin docs-kit to the 2026.10.1 release

Same commit as before (the docs-kit SvelteKit 3 migration), now by tag.

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

* ci(trunk): build the library before syncing docs

Kit 3's `svelte-kit sync` evaluates docs/vite.config.ts (svelte.config.js
is gone), and that config imports the library's built
`@humanspeak/svelte-motion/vite` entry, so the docs sync failed on a
clean runner.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
jaysin586 added a commit to humanspeak/svelte-diff that referenced this pull request Oct 27, 2026
* chore(docs): migrate docs site to SvelteKit 3

- Kit 3.1 + adapter-cloudflare 8; svelte.config.js folded into vite.config.ts
  (mdsvex/shiki preprocess, .svx extensions, adapter and hash-mode CSP carried over)
- $lib -> #lib subpath imports (package.json "imports")
- $app/environment -> $app/env
- $env/dynamic/public -> $app/env/public with src/env.ts declarations
- hooks.client handleError: sync, and only report unexpected errors
  (Kit 3 also routes expected 404/error() through the hook)
- tsconfig extends $app/tsconfig with Kit 2's include set
- mdsvex highlighter: treat a null fence language as 'text'
- docs-kit pinned to its Kit 3 commit (humanspeak/docs-kit#25); allowBuilds
  tarball entry refreshed to match
- svelte ^5.57.1 in docs (Kit 3 peer) and as the root devDependency, so the
  workspace library and docs share one svelte copy (two copies break
  Snippet types in svelte-check)

The library itself stays on Kit 2.

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

* chore(docs): pin docs-kit to the 2026.10.1 release

Same commit as before (the docs-kit SvelteKit 3 migration), now by tag.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
jaysin586 added a commit to humanspeak/svelte-headless-table that referenced this pull request Oct 27, 2026
* chore(docs): migrate docs site to SvelteKit 3

- Kit 3.1 + adapter-cloudflare 8 (adapter-auto 8); svelte.config.js
  folded into vite.config.ts (mdsvex/shiki preprocess, rehypeKeepCase,
  .svx extension, hash-mode CSP carried over unchanged)
- $lib -> #lib subpath imports (package.json "imports"); the
  shadcn-svelte guide's code samples keep `$lib` since they describe the
  reader's own app
- $env/dynamic/public -> $app/env/public with src/env.ts declarations;
  $app/environment -> $app/env
- hooks.client handleError: sync, and only report unexpected errors
  (Kit 3 also routes expected 404/error() through the hook)
- tsconfig extends $app/tsconfig with Kit 2's include set
- mdsvex highlighter: treat a null fence language as 'text'
- docs-kit pinned to its Kit 3 commit (humanspeak/docs-kit#25)

The library itself stays on Kit 2.

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

* chore(docs): pin docs-kit to the 2026.10.1 release

Same commit as before (the docs-kit SvelteKit 3 migration), now by tag.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
jaysin586 added a commit to humanspeak/svelte-json-view-lite that referenced this pull request Oct 27, 2026
* chore(docs): migrate docs site to SvelteKit 3

- Kit 3.1 + adapter-cloudflare 8 (svelte ^5.57.1 per Kit 3 peer);
  svelte.config.js folded into vite.config.ts (mdsvex/shiki preprocess,
  .svx extension, adapter and hash-mode CSP carried over unchanged)
- $lib -> #lib subpath imports (package.json "imports"), including the
  generated #lib/demo-loaders.js
- $env/dynamic/public -> $app/env/public with src/env.ts declarations
  (PostHog token/host, PUBLIC_SITE_URL for the sitemap)
- hooks.client handleError: sync, and only report unexpected errors
  (Kit 3 also routes expected 404/error() through the hook)
- tsconfig extends $app/tsconfig with Kit 2's include set
- mdsvex highlighter: treat a null fence language as 'text'
- docs-kit pinned to its Kit 3 commit (humanspeak/docs-kit#25)
- Dedupe lockfile to a single svelte (5.57.2) so the workspace library
  and docs share Snippet types

The library itself stays on Kit 2.

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

* chore(docs): pin docs-kit to the 2026.10.1 release

Same commit as before (the docs-kit SvelteKit 3 migration), now by tag.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
jaysin586 added a commit to humanspeak/svelte-virtual-list that referenced this pull request Oct 27, 2026
* chore(docs): migrate docs site to SvelteKit 3

- Kit 3.1 + adapter-cloudflare 8 (+ adapter-auto 8); svelte.config.js
  folded into vite.config.ts (mdsvex/shiki preprocess, CSP, extensions)
- $lib -> #lib subpath imports (package.json "imports"); generated
  #lib/demo-loaders needs an explicit .js extension. Convex code samples
  in the docs content keep `$lib/...` (they are user-facing snippets)
- $env/dynamic/public -> $app/env/public with src/env.ts declarations
  (PostHog token/host + Sentry DSN, still runtime/dynamic)
- hooks.client handleError: sync, and only log/report unexpected errors
  (Kit 3 also routes expected 404/error() through the hook)
- Sentry: @sentry/sveltekit ^10.70 -> ^11; sentrySvelteKit now imported
  from @sentry/sveltekit/vite, org/project moved to top-level options
  (sourceMapsUploadOptions is gone in v11). The plugin stays before
  sveltekit() so Sentry's browser tracing uses $app/state on Kit 3.
  Client init now receives the DSN directly from $app/env/public
- tsconfig extends $app/tsconfig with Kit 2's include set
- mdsvex highlighter: treat a null fence language as 'text'
- docs-kit pinned to its Kit 3 commit (humanspeak/docs-kit#25)
- Drop the npm-style cookie override from docs/package.json (Kit 3
  needs cookie v2; pnpm ignored it anyway)
- Root devDependency svelte ^5.56.10 -> ^5.57.1 (Kit 3's peer floor) so
  the workspace resolves a single svelte; two copies broke Snippet types
- redirects test: Kit 3's resolve() must return a Promise

The library itself stays on Kit 2.

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

* chore(docs): pin docs-kit to the 2026.10.1 release

Same commit as before (the docs-kit SvelteKit 3 migration), now by tag.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
jaysin586 added a commit to humanspeak/svelte-virtual-chat that referenced this pull request Oct 27, 2026
* chore(docs): migrate docs site to SvelteKit 3

- Kit 3.1 + adapter-cloudflare 8; svelte.config.js folded into vite.config.ts
- $lib -> #lib subpath imports (package.json "imports"), including the
  generated #lib/demo-loaders.js
- $env/dynamic/public -> $app/env/public with src/env.ts declarations;
  $app/environment -> $app/env
- hooks.client handleError: sync, and only report unexpected errors
  (Kit 3 also routes expected 404/error() through the hook)
- tsconfig extends $app/tsconfig with Kit 2's include set
- mdsvex highlighter: treat a null fence language as 'text'
- Drop manualChunks, which Kit 3 ignores in favor of its own code splitting
- docs-kit pinned to its Kit 3 commit (humanspeak/docs-kit#25)
- svelte ^5.57.1 for docs; lockfile deduped to a single svelte copy

The library itself stays on Kit 2.

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

* chore(docs): pin docs-kit to the 2026.10.1 release

Same commit as before (the docs-kit SvelteKit 3 migration), now by tag.

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

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change Apply to changes that break backward compatibility dependencies Pull requests that update a dependency file enhancement Apply to new features or improvements to existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant