coyotte508
commited on
Commit
·
89a36e7
1
Parent(s):
9bba09b
Sveltekit tempalte
Browse files- .gitignore +23 -0
- .npmrc +1 -0
- .prettierignore +6 -0
- .prettierrc +15 -0
- README.md +40 -1
- eslint.config.js +36 -0
- package.json +45 -0
- src/app.css +3 -0
- src/app.d.ts +13 -0
- src/app.html +12 -0
- src/lib/index.ts +1 -0
- src/routes/+layout.js +2 -0
- src/routes/+layout.svelte +7 -0
- src/routes/+page.svelte +2 -0
- static/favicon.png +0 -0
- svelte.config.js +18 -0
- tsconfig.json +19 -0
- vite.config.ts +7 -0
.gitignore
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
node_modules
|
2 |
+
|
3 |
+
# Output
|
4 |
+
.output
|
5 |
+
.vercel
|
6 |
+
.netlify
|
7 |
+
.wrangler
|
8 |
+
/.svelte-kit
|
9 |
+
/build
|
10 |
+
|
11 |
+
# OS
|
12 |
+
.DS_Store
|
13 |
+
Thumbs.db
|
14 |
+
|
15 |
+
# Env
|
16 |
+
.env
|
17 |
+
.env.*
|
18 |
+
!.env.example
|
19 |
+
!.env.test
|
20 |
+
|
21 |
+
# Vite
|
22 |
+
vite.config.js.timestamp-*
|
23 |
+
vite.config.ts.timestamp-*
|
.npmrc
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
engine-strict=true
|
.prettierignore
ADDED
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Package Managers
|
2 |
+
package-lock.json
|
3 |
+
pnpm-lock.yaml
|
4 |
+
yarn.lock
|
5 |
+
bun.lock
|
6 |
+
bun.lockb
|
.prettierrc
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"useTabs": true,
|
3 |
+
"singleQuote": true,
|
4 |
+
"trailingComma": "none",
|
5 |
+
"printWidth": 100,
|
6 |
+
"plugins": ["prettier-plugin-svelte", "prettier-plugin-tailwindcss"],
|
7 |
+
"overrides": [
|
8 |
+
{
|
9 |
+
"files": "*.svelte",
|
10 |
+
"options": {
|
11 |
+
"parser": "svelte"
|
12 |
+
}
|
13 |
+
}
|
14 |
+
]
|
15 |
+
}
|
README.md
CHANGED
@@ -5,6 +5,45 @@ colorFrom: yellow
|
|
5 |
colorTo: purple
|
6 |
sdk: static
|
7 |
pinned: false
|
|
|
|
|
8 |
---
|
9 |
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
colorTo: purple
|
6 |
sdk: static
|
7 |
pinned: false
|
8 |
+
app_build_command: npm run build
|
9 |
+
app_file: build/index.html
|
10 |
---
|
11 |
|
12 |
+
# sv
|
13 |
+
|
14 |
+
Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli).
|
15 |
+
|
16 |
+
## Creating a project
|
17 |
+
|
18 |
+
If you're seeing this, you've probably already done this step. Congrats!
|
19 |
+
|
20 |
+
```bash
|
21 |
+
# create a new project in the current directory
|
22 |
+
npx sv create
|
23 |
+
|
24 |
+
# create a new project in my-app
|
25 |
+
npx sv create my-app
|
26 |
+
```
|
27 |
+
|
28 |
+
## Developing
|
29 |
+
|
30 |
+
Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server:
|
31 |
+
|
32 |
+
```bash
|
33 |
+
npm run dev
|
34 |
+
|
35 |
+
# or start the server and open the app in a new browser tab
|
36 |
+
npm run dev -- --open
|
37 |
+
```
|
38 |
+
|
39 |
+
## Building
|
40 |
+
|
41 |
+
To create a production version of your app:
|
42 |
+
|
43 |
+
```bash
|
44 |
+
npm run build
|
45 |
+
```
|
46 |
+
|
47 |
+
You can preview the production build with `npm run preview`.
|
48 |
+
|
49 |
+
> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.
|
eslint.config.js
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import prettier from 'eslint-config-prettier';
|
2 |
+
import js from '@eslint/js';
|
3 |
+
import { includeIgnoreFile } from '@eslint/compat';
|
4 |
+
import svelte from 'eslint-plugin-svelte';
|
5 |
+
import globals from 'globals';
|
6 |
+
import { fileURLToPath } from 'node:url';
|
7 |
+
import ts from 'typescript-eslint';
|
8 |
+
import svelteConfig from './svelte.config.js';
|
9 |
+
|
10 |
+
const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url));
|
11 |
+
|
12 |
+
export default ts.config(
|
13 |
+
includeIgnoreFile(gitignorePath),
|
14 |
+
js.configs.recommended,
|
15 |
+
...ts.configs.recommended,
|
16 |
+
...svelte.configs.recommended,
|
17 |
+
prettier,
|
18 |
+
...svelte.configs.prettier,
|
19 |
+
{
|
20 |
+
languageOptions: {
|
21 |
+
globals: { ...globals.browser, ...globals.node }
|
22 |
+
},
|
23 |
+
rules: { 'no-undef': 'off' }
|
24 |
+
},
|
25 |
+
{
|
26 |
+
files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'],
|
27 |
+
languageOptions: {
|
28 |
+
parserOptions: {
|
29 |
+
projectService: true,
|
30 |
+
extraFileExtensions: ['.svelte'],
|
31 |
+
parser: ts.parser,
|
32 |
+
svelteConfig
|
33 |
+
}
|
34 |
+
}
|
35 |
+
}
|
36 |
+
);
|
package.json
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "sveltekit",
|
3 |
+
"private": true,
|
4 |
+
"version": "0.0.1",
|
5 |
+
"type": "module",
|
6 |
+
"scripts": {
|
7 |
+
"dev": "vite dev",
|
8 |
+
"build": "vite build",
|
9 |
+
"preview": "vite preview",
|
10 |
+
"prepare": "svelte-kit sync || echo ''",
|
11 |
+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
|
12 |
+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
|
13 |
+
"format": "prettier --write .",
|
14 |
+
"lint": "prettier --check . && eslint ."
|
15 |
+
},
|
16 |
+
"devDependencies": {
|
17 |
+
"@eslint/compat": "^1.2.5",
|
18 |
+
"@eslint/js": "^9.18.0",
|
19 |
+
"@sveltejs/adapter-static": "^3.0.8",
|
20 |
+
"@sveltejs/kit": "^2.16.0",
|
21 |
+
"@sveltejs/vite-plugin-svelte": "^5.0.0",
|
22 |
+
"@tailwindcss/forms": "^0.5.9",
|
23 |
+
"@tailwindcss/typography": "^0.5.15",
|
24 |
+
"@tailwindcss/vite": "^4.0.0",
|
25 |
+
"eslint": "^9.18.0",
|
26 |
+
"eslint-config-prettier": "^10.0.1",
|
27 |
+
"eslint-plugin-svelte": "^3.0.0",
|
28 |
+
"globals": "^16.0.0",
|
29 |
+
"prettier": "^3.4.2",
|
30 |
+
"prettier-plugin-svelte": "^3.3.3",
|
31 |
+
"prettier-plugin-tailwindcss": "^0.6.11",
|
32 |
+
"svelte": "^5.0.0",
|
33 |
+
"svelte-check": "^4.0.0",
|
34 |
+
"tailwindcss": "^4.0.0",
|
35 |
+
"typescript": "^5.0.0",
|
36 |
+
"typescript-eslint": "^8.20.0",
|
37 |
+
"vite": "^6.2.6"
|
38 |
+
},
|
39 |
+
"pnpm": {
|
40 |
+
"onlyBuiltDependencies": [
|
41 |
+
"esbuild"
|
42 |
+
]
|
43 |
+
},
|
44 |
+
"packageManager": "pnpm@10.10.0+sha512.d615db246fe70f25dcfea6d8d73dee782ce23e2245e3c4f6f888249fb568149318637dca73c2c5c8ef2a4ca0d5657fb9567188bfab47f566d1ee6ce987815c39"
|
45 |
+
}
|
src/app.css
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
@import 'tailwindcss';
|
2 |
+
@plugin '@tailwindcss/forms';
|
3 |
+
@plugin '@tailwindcss/typography';
|
src/app.d.ts
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
// See https://svelte.dev/docs/kit/types#app.d.ts
|
2 |
+
// for information about these interfaces
|
3 |
+
declare global {
|
4 |
+
namespace App {
|
5 |
+
// interface Error {}
|
6 |
+
// interface Locals {}
|
7 |
+
// interface PageData {}
|
8 |
+
// interface PageState {}
|
9 |
+
// interface Platform {}
|
10 |
+
}
|
11 |
+
}
|
12 |
+
|
13 |
+
export {};
|
src/app.html
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!doctype html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="utf-8" />
|
5 |
+
<link rel="icon" href="%sveltekit.assets%/favicon.png" />
|
6 |
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
7 |
+
%sveltekit.head%
|
8 |
+
</head>
|
9 |
+
<body data-sveltekit-preload-data="hover">
|
10 |
+
<div style="display: contents">%sveltekit.body%</div>
|
11 |
+
</body>
|
12 |
+
</html>
|
src/lib/index.ts
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
// place files you want to import through the `$lib` alias in this folder.
|
src/routes/+layout.js
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
export const ssr = false;
|
2 |
+
export const prerender = true;
|
src/routes/+layout.svelte
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<script lang="ts">
|
2 |
+
import '../app.css';
|
3 |
+
|
4 |
+
let { children } = $props();
|
5 |
+
</script>
|
6 |
+
|
7 |
+
{@render children()}
|
src/routes/+page.svelte
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
<h1>Welcome to SvelteKit</h1>
|
2 |
+
<p>Visit <a href="https://svelte.dev/docs/kit">svelte.dev/docs/kit</a> to read the documentation</p>
|
static/favicon.png
ADDED
![]() |
svelte.config.js
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import adapter from '@sveltejs/adapter-static';
|
2 |
+
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';
|
3 |
+
|
4 |
+
/** @type {import('@sveltejs/kit').Config} */
|
5 |
+
const config = {
|
6 |
+
// Consult https://svelte.dev/docs/kit/integrations
|
7 |
+
// for more information about preprocessors
|
8 |
+
preprocess: vitePreprocess(),
|
9 |
+
|
10 |
+
kit: {
|
11 |
+
// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
|
12 |
+
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
|
13 |
+
// See https://svelte.dev/docs/kit/adapters for more information about adapters.
|
14 |
+
adapter: adapter()
|
15 |
+
}
|
16 |
+
};
|
17 |
+
|
18 |
+
export default config;
|
tsconfig.json
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"extends": "./.svelte-kit/tsconfig.json",
|
3 |
+
"compilerOptions": {
|
4 |
+
"allowJs": true,
|
5 |
+
"checkJs": true,
|
6 |
+
"esModuleInterop": true,
|
7 |
+
"forceConsistentCasingInFileNames": true,
|
8 |
+
"resolveJsonModule": true,
|
9 |
+
"skipLibCheck": true,
|
10 |
+
"sourceMap": true,
|
11 |
+
"strict": true,
|
12 |
+
"moduleResolution": "bundler"
|
13 |
+
}
|
14 |
+
// Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
|
15 |
+
// except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
|
16 |
+
//
|
17 |
+
// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
|
18 |
+
// from the referenced tsconfig.json - TypeScript does not merge them in
|
19 |
+
}
|
vite.config.ts
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import tailwindcss from '@tailwindcss/vite';
|
2 |
+
import { sveltekit } from '@sveltejs/kit/vite';
|
3 |
+
import { defineConfig } from 'vite';
|
4 |
+
|
5 |
+
export default defineConfig({
|
6 |
+
plugins: [tailwindcss(), sveltekit()]
|
7 |
+
});
|