Skip to content

Commit

Permalink
Merge pull request #2116 from scpwiki/sveltekit-update
Browse files Browse the repository at this point in the history
Upgrade SvelteKit to v2
  • Loading branch information
emmiegit authored Oct 6, 2024
2 parents 0be2d3e + 212be2a commit a8012e0
Show file tree
Hide file tree
Showing 9 changed files with 482 additions and 350 deletions.
13 changes: 7 additions & 6 deletions framerail/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@
},
"devDependencies": {
"@playwright/test": "^1.47.1",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"@sveltejs/vite-plugin-svelte": "^3.1.2",
"@types/accept-language-parser": "^1.5.6",
"@types/node": "^22.7.4",
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-svelte": "^2.44.0",
Expand All @@ -36,17 +37,17 @@
"stylelint-config-recess-order": "^5.1.1",
"stylelint-order": "^6.0.4",
"stylelint-scss": "^6.7.0",
"typescript": "^5.5.4"
"typescript": "^5.6.2"
},
"dependencies": {
"@sveltejs/adapter-node": "next",
"@sveltejs/kit": "next",
"@sveltejs/adapter-node": "^5.2.5",
"@sveltejs/kit": "^2.6.1",
"accept-language-parser": "^1.5.0",
"json-rpc-2.0": "^1.7.0",
"svelte": "^4.2.19",
"svelte-check": "^4.0.2",
"svelte-preprocess": "^5.1.4",
"tslib": "^2.7.0",
"vite": "^4.5.3"
"vite": "^5.4.8"
}
}
790 changes: 461 additions & 329 deletions framerail/pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion framerail/src/lib/server/deepwell/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// TODO refactor into proper TS service

import { JSONRPCClient, JSONRPCRequest } from "json-rpc-2.0"
import { JSONRPCClient, type JSONRPCRequest } from "json-rpc-2.0"

export const DEEPWELL_HOST = process.env.DEEPWELL_HOST || "localhost"
export const DEEPWELL_PORT = 2747
Expand Down
2 changes: 1 addition & 1 deletion framerail/src/lib/server/load/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export async function loadAdminPage(request, cookies) {
viewData.internationalization = translated

if (errorStatus !== null) {
throw error(errorStatus, viewData)
error(errorStatus, viewData)
}

return viewData
Expand Down
4 changes: 2 additions & 2 deletions framerail/src/lib/server/load/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export async function loadPage(
viewData.internationalization = translated

if (errorStatus !== null) {
throw error(errorStatus, viewData)
error(errorStatus, viewData)
}

// TODO remove checkRedirect when errorStatus is fixed
Expand All @@ -171,7 +171,7 @@ function runRedirect(
const domain: string = viewData.redirectSite || originalDomain
const slug: Optional<string> = viewData.redirectPage || originalSlug
const route: string = buildRoute(slug, extra)
throw redirect(308, `https://${domain}/${route}`)
redirect(308, `https://${domain}/${route}`)
}

function buildRoute(slug: Optional<string>, extra: Optional<string>): string {
Expand Down
4 changes: 2 additions & 2 deletions framerail/src/lib/server/load/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export async function loadUser(username?: string, request, cookies) {
}

if (errorStatus === null && username && viewData.user.slug !== username) {
throw redirect(308, `/-/user/${viewData.user.slug}`)
redirect(308, `/-/user/${viewData.user.slug}`)
}

if (errorStatus !== null) {
Expand Down Expand Up @@ -93,7 +93,7 @@ export async function loadUser(username?: string, request, cookies) {
viewData.internationalization = translated

if (errorStatus !== null) {
throw error(errorStatus, viewData)
error(errorStatus, viewData)
}

return viewData
Expand Down
13 changes: 6 additions & 7 deletions framerail/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@
"extends": "./.svelte-kit/tsconfig.json",
"compilerOptions": {
"paths": {
"$lib": ["src/lib"],
"$lib/*": ["src/lib/*"],
"$static": ["static"],
"$static/*": ["static/*"],
"$assets": ["../assets", "src/assets"],
"$assets/*": ["../assets/*", "src/assets/*"]
"$lib": ["./src/lib"],
"$lib/*": ["./src/lib/*"],
"$static": ["./static"],
"$static/*": ["./static/*"],
"$assets": ["../assets", "./src/assets"],
"$assets/*": ["../assets/*", "./src/assets/*"]
},
"allowJs": true,
"checkJs": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"ignoreDeprecations": "5.0",
"verbatimModuleSyntax": true,
"resolveJsonModule": true,
"skipLibCheck": true,
Expand Down
2 changes: 1 addition & 1 deletion install/aws/prod/docker/web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Framerail build
#

FROM node:19-alpine
FROM node:20-alpine

# Install pnpm
RUN npm install -g pnpm
Expand Down
2 changes: 1 addition & 1 deletion install/dev/digitalocean/web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Framerail build
#

FROM node:19-alpine
FROM node:20-alpine

# Install pnpm
RUN npm install -g pnpm
Expand Down

0 comments on commit a8012e0

Please sign in to comment.