Skip to content

Commit 1432451

Browse files
jaysin586claude
andcommitted
feat!: migrate to SvelteKit 3
- 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>
1 parent c06879a commit 1432451

42 files changed

Lines changed: 69 additions & 86 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ the SVG there to preserve crisp branding. Name that import `logo` in new sites:
2020
```svelte
2121
<script lang="ts">
2222
import { RootLayout, HeaderV2 } from '@humanspeak/docs-kit'
23-
import logo from '$lib/assets/logo.svg'
24-
import { docsConfig } from '$lib/docs-config'
23+
import logo from '#lib/assets/logo.svg'
24+
import { docsConfig } from '#lib/docs-config'
2525
2626
const { children } = $props()
2727
</script>

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
"@humanspeak/svelte-markdown": ">=1.0.0",
8080
"@humanspeak/svelte-motion": ">=0.1.0",
8181
"@lucide/svelte": ">=0.400.0",
82-
"@sveltejs/kit": "^2.0.0",
82+
"@sveltejs/kit": "^3.0.0",
8383
"mode-watcher": "^1.0.0",
8484
"shiki": ">=3.0.0",
8585
"svelte": "^5.0.0"

‎src/lib/components/BlogLayoutV2.svelte‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
```svelte
1515
<script lang="ts">
1616
import { BlogLayoutV2 } from '@humanspeak/docs-kit/blog'
17-
import { docsConfig } from '$lib/docs-config'
18-
import { headerNav } from '$lib/docsNav'
19-
import favicon from '$lib/assets/logo.svg'
17+
import { docsConfig } from '#lib/docs-config'
18+
import { headerNav } from '#lib/docsNav'
19+
import favicon from '#lib/assets/logo.svg'
2020
import { version } from '../../../package.json'
2121
const { children } = $props()
2222
</script>

‎src/lib/components/BlogPostV2.svelte‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
```svelte
1313
<script lang="ts">
1414
import { BlogPostV2, type BlogPostMeta } from '@humanspeak/docs-kit/blog'
15-
import { docsConfig } from '$lib/docs-config'
15+
import { docsConfig } from '#lib/docs-config'
1616
const post: BlogPostMeta = { … }
1717
</script>
1818

‎src/lib/components/BreadcrumbContextProvider.svelte‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
import { type Snippet } from 'svelte'
33
import { type BreadcrumbContext, setBreadcrumbContext } from '../contexts/breadcrumb.js'
44
5-
const { children } = $props<{
5+
const { children }: {
66
children?: Snippet
7-
}>()
7+
} = $props()
88
99
const breadcrumbs = $state<BreadcrumbContext>({ breadcrumbs: [] })
1010

‎src/lib/components/BreadcrumbJsonLd.svelte‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import type { DocsKitConfig } from '../config.js'
33
import { getBreadcrumbContext } from '../contexts/breadcrumb.js'
44
5-
const { config } = $props<{ config: DocsKitConfig }>()
5+
const { config }: { config: DocsKitConfig } = $props()
66
77
const breadcrumbs = getBreadcrumbContext()
88
@@ -17,7 +17,7 @@
1717
'@type': 'ListItem',
1818
position: i + 2,
1919
name: b.title,
20-
...(b.href ? { item: `${config.url}${b.href}` } : {})
20+
...(b.href ? { item: `${config.url}${b.href}` }: {})
2121
}))
2222
]
2323
return `<${'script'} type="application/ld+json">${JSON.stringify({

‎src/lib/components/ComparisonPageV2.svelte‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
```svelte
1414
<script lang="ts">
1515
import { ComparisonPageV2 } from '@humanspeak/docs-kit'
16-
import { competitors, getCompetitor } from '$lib/compare-data'
16+
import { competitors, getCompetitor } from '#lib/compare-data'
1717
import type { PageData } from './$types'
1818
1919
const { data }: { data: PageData } = $props()
@@ -121,7 +121,7 @@
121121
'@type': 'SoftwareApplication',
122122
name: competitor.name,
123123
applicationCategory: 'DeveloperApplication',
124-
...(competitor.website ? { url: competitor.website } : {})
124+
...(competitor.website ? { url: competitor.website }: {})
125125
}
126126
],
127127
keywords: competitor.keywords

‎src/lib/components/ExampleV2.svelte‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@
169169
// split-shape object. The plain-string form becomes the accent span
170170
// with a trailing period — same default the homepage uses.
171171
const titleShape = $derived.by<TitleShape>(() =>
172-
typeof title === 'string' ? { accent: title, end: '.' } : { end: '.', ...title }
172+
typeof title === 'string' ? { accent: title, end: '.' }: { end: '.', ...title }
173173
)
174174
175175
// Derive the file name from the source URL when the consumer

‎src/lib/components/Footer.svelte‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
import HeartIcon from '@lucide/svelte/icons/heart'
44
import { MotionSpan } from '@humanspeak/svelte-motion'
55
6-
const { extra } = $props<{
6+
const { extra }: {
77
extra?: Snippet
8-
}>()
8+
} = $props()
99
</script>
1010

1111
<footer

‎src/lib/components/FooterV2.svelte‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
license = 'MIT',
1717
version,
1818
year = new Date().getFullYear()
19-
} = $props<{
19+
}: {
2020
extra?: Snippet
2121
license?: string
2222
version?: string
2323
year?: number
24-
}>()
24+
} = $props()
2525
</script>
2626

2727
<footer class="dk-footer-v2 border-t border-border bg-background text-foreground">

0 commit comments

Comments
 (0)