Skip to content

Commit

Permalink
chore: upgrade SvelteKit to latest version
Browse files Browse the repository at this point in the history
Due to a bug in Vite, we had to replace our dynamic import inside a group.
See vitejs/vite#11824 (comment)
  • Loading branch information
Devessier committed May 13, 2023
1 parent 7c6b9c3 commit 8e7eb82
Show file tree
Hide file tree
Showing 10 changed files with 2,957 additions and 2,739 deletions.
5,654 changes: 2,935 additions & 2,719 deletions package-lock.json

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
"devDependencies": {
"@commitlint/cli": "^16.2.3",
"@commitlint/config-conventional": "^16.2.1",
"@sveltejs/adapter-static": "next",
"@sveltejs/kit": "next",
"@sveltejs/adapter-static": "^2.0.2",
"@sveltejs/kit": "^1.5.0",
"@tailwindcss/typography": "^0.5.0",
"@types/react": "^18.0.5",
"@typescript-eslint/eslint-plugin": "^5.27.0",
"@typescript-eslint/parser": "^5.27.0",
"@xstate/react": "^3.0.0",
"autoprefixer": "^10.4.7",
"autoprefixer": "^10.4.14",
"eslint": "^8.16.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-svelte3": "^4.0.0",
Expand All @@ -33,7 +33,7 @@
"lint-staged": "^11.1.2",
"mdsvex": "^0.10.6",
"outdent": "^0.8.0",
"postcss": "^8.4.14",
"postcss": "^8.4.23",
"postcss-load-config": "^4.0.1",
"prettier": "^2.6.2",
"prettier-plugin-svelte": "^2.7.0",
Expand All @@ -43,13 +43,13 @@
"rehype-slug": "^5.0.0",
"shiki-twoslash": "^3.0.2",
"snipsync": "^1.8.0",
"svelte": "^3.44.0",
"svelte-check": "^2.7.1",
"svelte-preprocess": "^4.10.7",
"svelte": "^3.54.0",
"svelte-check": "^3.0.1",
"svelte-preprocess": "^5.0.3",
"tailwindcss": "^3.1.5",
"tslib": "^2.3.1",
"typescript": "^4.7.4",
"vite": "^3.1.0",
"tslib": "^2.4.1",
"typescript": "^5.0.0",
"vite": "^4.3.0",
"xstate": "^4.33.6"
},
"dependencies": {
Expand Down
1 change: 0 additions & 1 deletion src/routes/(portfolio)/+layout.ts

This file was deleted.

5 changes: 3 additions & 2 deletions src/routes/(portfolio)/note/[slug]/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ type GetResult = {
};

export const load: PageLoad<GetResult> = async ({ params: { slug } }) => {
const allNotes = import.meta.glob('../*.svx');
const {
metadata: { title, datetime },
default: content
}: {
} = (await allNotes[`../${slug}.svx`]()) as {
metadata: { title: string; datetime: string };
default: ComponentType;
} = await import(`../${slug}.svx`);
};

return {
title,
Expand Down
File renamed without changes.
5 changes: 3 additions & 2 deletions src/routes/(portfolio)/writing/[slug]/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ type GetResult = {
};

export const load: PageLoad<GetResult> = async ({ params: { slug } }) => {
const allWritings = import.meta.glob('../*.svx');
const {
metadata: { title, description, datetime, last_updated_datetime, tags },
default: content
}: {
} = (await allWritings[`../${slug}.svx`]()) as {
metadata: {
title: string;
description: string;
Expand All @@ -23,7 +24,7 @@ export const load: PageLoad<GetResult> = async ({ params: { slug } }) => {
tags: string[];
};
default: ComponentType;
} = await import(`../${slug}.svx`);
};

return {
title,
Expand Down
2 changes: 2 additions & 0 deletions src/routes/+layout.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const trailingSlash = 'always';
export const prerender = true;
2 changes: 1 addition & 1 deletion src/routes/state-of-xstate/survey/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import '../app.postcss';
import '../../../app.postcss';
</script>

<p>Hello</p>
7 changes: 3 additions & 4 deletions svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { mdsvex } from 'mdsvex';
import { vitePreprocess } from '@sveltejs/kit/vite';
import mdsvexConfig from './mdsvex.config.js';
import adapter from '@sveltejs/adapter-static';
import preprocess from 'svelte-preprocess';
Expand All @@ -10,6 +11,7 @@ const config = {
// Consult https://github.com/sveltejs/svelte-preprocess
// for more information about preprocessors
preprocess: [
vitePreprocess(),
preprocess({
postcss: true
}),
Expand All @@ -20,11 +22,8 @@ const config = {
adapter: adapter(),
prerender: {
crawl: true,
enabled: true,
onError: 'continue',
entries: ['*']
},
trailingSlash: 'always',
}
}
};

Expand Down

0 comments on commit 8e7eb82

Please sign in to comment.