Rewrite page in Svelte 5 #49

Merged
Neshura merged 94 commits from rewrite/svelte into main 2024-01-06 14:12:09 +00:00
14 changed files with 217 additions and 0 deletions
Showing only changes of commit 3cd2a0f5af - Show all commits

13
.eslintignore Normal file
View file

@ -0,0 +1,13 @@
.DS_Store
node_modules
/build
/.svelte-kit
/package
.env
.env.*
!.env.example
# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock

31
.eslintrc.cjs Normal file
View file

@ -0,0 +1,31 @@
/** @type { import("eslint").Linter.Config } */
module.exports = {
root: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:svelte/recommended',
'prettier'
],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
extraFileExtensions: ['.svelte']
},
env: {
browser: true,
es2017: true,
node: true
},
overrides: [
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser'
}
}
]
};

1
.npmrc Normal file
View file

@ -0,0 +1 @@
engine-strict=true

4
.prettierignore Normal file
View file

@ -0,0 +1,4 @@
# Ignore files for PNPM, NPM and YARN
pnpm-lock.yaml
package-lock.json
yarn.lock

15
.prettierrc Normal file
View file

@ -0,0 +1,15 @@
{
"useTabs": true,
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
"overrides": [
{
"files": "*.svelte",
"options": {
"parser": "svelte"
}
}
]
}

View file

@ -0,0 +1,3 @@
{
"type": "module"
}

13
src/app.d.ts vendored Normal file
View file

@ -0,0 +1,13 @@
// See https://kit.svelte.dev/docs/types#app
// for information about these interfaces
declare global {
namespace App {
// interface Error {}
// interface Locals {}
// interface PageData {}
// interface PageState {}
// interface Platform {}
}
}
export {};

16
src/app.html Normal file
View file

@ -0,0 +1,16 @@
<!doctype html>
<html lang="en" class="nordlys h-full">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%sveltekit.assets%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
%sveltekit.head%
</head>
<body
data-sveltekit-preload-data="hover"
style="background-image: url('https://images4.alphacoders.com/112/1123390.jpg')"
class="overflow-hidden h-screen"
>
<div style="display: contents">%sveltekit.body%</div>
</body>
</html>

View file

@ -0,0 +1,7 @@
<script>
import '../app.pcss';
import Header from "./Header.svelte";
</script>
<Header />
<slot />

86
src/routes/+page.svelte Normal file
View file

@ -0,0 +1,86 @@
<div class="overflow-auto h-full">
<h1>Welcome to SvelteKit</h1>
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
<p>gap</p>
</div>

View file

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

3
static/robots.txt Normal file
View file

@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:

19
svelte.config.js Normal file
View file

@ -0,0 +1,19 @@
import adapter from '@sveltejs/adapter-auto';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
import path from "path";
/** @type {import('@sveltejs/kit').Config} */
const config = {
// Consult https://kit.svelte.dev/docs/integrations#preprocessors
// for more information about preprocessors
preprocess: [vitePreprocess({})],
kit: {
// adapter-auto only supports some environments, see https://kit.svelte.dev/docs/adapter-auto for a list.
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
adapter: adapter(),
}
};
export default config;

6
vite.config.ts Normal file
View file

@ -0,0 +1,6 @@
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
export default defineConfig({
plugins: [sveltekit()]
});