👽️ upgrade sveltekit

This commit is contained in:
James Walker 2022-11-12 20:58:29 -05:00
parent 97fccf5dab
commit 167022f587
Signed by: walkah
GPG Key ID: 3C127179D6086E93
9 changed files with 2395 additions and 4364 deletions

6691
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -2,11 +2,10 @@
"name": "scuff",
"version": "0.0.1",
"scripts": {
"dev": "svelte-kit dev",
"build": "svelte-kit build",
"package": "svelte-kit package",
"preview": "svelte-kit preview",
"prepare": "svelte-kit sync",
"dev": "vite dev",
"build": "vite build",
"package": "svelte-package",
"preview": "vite preview",
"test": "playwright test",
"check": "svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
@ -17,6 +16,7 @@
"@playwright/test": "^1.21.0",
"@sveltejs/adapter-auto": "next",
"@sveltejs/kit": "next",
"@sveltejs/package": "^1.0.0-next.5",
"@typescript-eslint/eslint-plugin": "^5.10.1",
"@typescript-eslint/parser": "^5.10.1",
"autoprefixer": "^10.4.5",
@ -31,7 +31,10 @@
"svelte-preprocess": "^4.10.1",
"tailwindcss": "^3.0.24",
"tslib": "^2.3.1",
"typescript": "~4.6.2"
"typescript": "~4.8.4"
},
"type": "module"
"type": "module",
"dependencies": {
"vite": "^3.2.3"
}
}

View File

@ -3,11 +3,11 @@
<head>
<meta charset="utf-8" />
<meta name="description" content="" />
<link rel="icon" href="%svelte.assets%/favicon.png" />
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
%svelte.head%
%sveltekit.head%
</head>
<body>
<div>%svelte.body%</div>
<body data-sveltekit-prefetch>
<div>%sveltekit.body%</div>
</body>
</html>

View File

@ -1,17 +1,16 @@
const verifyCredentials = async(instance: string, token: string) => {
const verifyCredentials = async (instance: string, token: string) => {
const url = `${instance}/api/v1/accounts/verify_credentials`;
const response = await fetch(url, {
headers: {
Authorization: `Bearer ${token}`
}
const response = await fetch(url, {
headers: {
Authorization: `Bearer ${token}`
}
});
return await response.json();
}
};
const user = {
verifyCredentials
verifyCredentials
};
export default user;

View File

@ -1,5 +1,5 @@
<script lang="ts">
import Login from '$components/Login.svelte';
import Login from '../components/Login.svelte';
</script>
<svelte:head>

View File

@ -1,6 +1,6 @@
import { writable } from 'svelte/store'
import type { Writable } from 'svelte/store'
import { writable } from 'svelte/store';
import type { Writable } from 'svelte/store';
export const userStore: Writable<object | null> = writable(null);
export const tokenStore: Writable<string | null> = writable(null);
export const tokenStore: Writable<string | null> = writable(null);

View File

@ -1,6 +1,5 @@
import adapter from '@sveltejs/adapter-auto';
import preprocess from 'svelte-preprocess';
import path from 'path';
/** @type {import('@sveltejs/kit').Config} */
const config = {
@ -9,14 +8,7 @@ const config = {
preprocess: preprocess(),
kit: {
adapter: adapter(),
vite: {
resolve: {
alias: {
$components: path.resolve('./src/components')
}
}
}
adapter: adapter()
}
};

8
vite.config.ts Normal file
View File

@ -0,0 +1,8 @@
import { sveltekit } from '@sveltejs/kit/vite';
import type { UserConfig } from 'vite';
const config: UserConfig = {
plugins: [sveltekit()]
};
export default config;