Skip to content

Commit

Permalink
chore: upgrade SvelteKit to v2
Browse files Browse the repository at this point in the history
  • Loading branch information
Th1nkK1D committed Mar 6, 2024
1 parent ee23a94 commit a619a55
Show file tree
Hide file tree
Showing 7 changed files with 538 additions and 252 deletions.
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,17 @@
"@commitlint/config-conventional": "^17.7.0",
"@histoire/plugin-svelte": "^0.17.0",
"@melt-ui/svelte": "^0.70.0",
"@sveltejs/adapter-static": "^2.0.3",
"@sveltejs/kit": "^1.20.4",
"@sveltejs/adapter-static": "^3.0.0",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"@types/d3": "^7.4.1",
"@types/md5": "^2.3.5",
"@typescript-eslint/eslint-plugin": "^5.45.0",
"@typescript-eslint/parser": "^5.45.0",
"autoprefixer": "^10.4.14",
"carbon-components": "^10.58.10",
"carbon-components-svelte": "^0.79.0",
"carbon-icons-svelte": "^12.3.0",
"carbon-components-svelte": "^0.82.11",
"carbon-icons-svelte": "^12.5.0",
"doctoc": "^2.2.1",
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.5.0",
Expand All @@ -60,15 +61,15 @@
"prettier": "^2.8.0",
"prettier-plugin-svelte": "^2.10.1",
"sass": "^1.67.0",
"svelte": "^4.0.5",
"svelte-check": "^3.4.3",
"svelte": "^4.2.12",
"svelte-check": "^3.6.6",
"tailwind-merge": "^2.1.0",
"tailwindcss": "^3.3.3",
"tslib": "^2.4.1",
"tsx": "^4.7.0",
"typescript": "^5.0.0",
"vite": "^4.4.2",
"vitest": "^0.34.6",
"vite": "^5.0.0",
"vitest": "^1.0.0",
"zod": "^3.22.4"
},
"packageManager": "[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion src/lib/datasheets/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export async function fetchFromIdOr404<T extends { id: string }>(
const data = (await fetcher()).find((item) => item.id === id);

if (!data) {
throw error(404, { message: `id ${id} was not found with ${fetcher.name}` });
error(404, { message: `id ${id} was not found with ${fetcher.name}` });
}

return data;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/assemblies/[id]/members/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { AssemblyName, GroupByOption } from '$models/assembly.js';
export async function load({ params }) {
const assembly = await fetchFromIdOr404(fetchAssemblies, params.id);

throw redirect(
redirect(
307,
`members/${
assembly.name === AssemblyName.Senates ? GroupByOption.AppointmentMethod : GroupByOption.Party
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@ export async function load({ params }) {
})
};
} else {
throw error(404);
error(404);
}
}
6 changes: 1 addition & 5 deletions svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import adapter from '@sveltejs/adapter-static';
import { vitePreprocess } from '@sveltejs/kit/vite';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';

/** @type {import('@sveltejs/kit').Config} */
const config = {
Expand All @@ -11,10 +11,6 @@ const config = {
'$components/*': './src/components/*',
$models: './src/models',
'$models/*': './src/models/*'
},
prerender: {
// TODO: non-released route for internal testing without a public link from any page
entries: ['/bills', '/bills/1', '/bills/explore', '/legislative-process']
}
}
};
Expand Down
10 changes: 1 addition & 9 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,7 @@
"resolveJsonModule": true,
"skipLibCheck": true,
"sourceMap": true,
"strict": true,
"paths": {
"$lib": ["./src/lib"],
"$lib/*": ["./src/lib/*"],
"$components": ["./src/components"],
"$components/*": ["./src/components/*"],
"$models": ["./src/models"],
"$models/*": ["./src/models/*"]
}
"strict": true
}
// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
//
Expand Down
751 changes: 524 additions & 227 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit a619a55

Please sign in to comment.