feat: 初始化 SvelteKit 项目基础结构和示例组件

- 添加项目配置文件(.npmrc, pnpm-workspace.yaml, prettier 配置等)
- 设置基础路由和布局组件
- 实现示例组件展示 Svelte 5 新特性($state, $derived 等)
- 配置测试环境(单元测试和 E2E 测试)
- 添加静态资源和 favicon
This commit is contained in:
lirui
2026-01-14 17:39:00 +08:00
commit 39d8630e87
26 changed files with 2955 additions and 0 deletions

42
vite.config.ts Normal file
View File

@@ -0,0 +1,42 @@
import devtoolsJson from 'vite-plugin-devtools-json';
import { defineConfig } from 'vitest/config';
import { playwright } from '@vitest/browser-playwright';
import { sveltekit } from '@sveltejs/kit/vite';
export default defineConfig({
plugins: [sveltekit(), devtoolsJson()],
test: {
expect: { requireAssertions: true },
projects: [
{
extends: './vite.config.ts',
test: {
name: 'client',
browser: {
enabled: true,
provider: playwright(),
instances: [{ browser: 'chromium', headless: true }]
},
include: ['src/**/*.svelte.{test,spec}.{js,ts}'],
exclude: ['src/lib/server/**']
}
},
{
extends: './vite.config.ts',
test: {
name: 'server',
environment: 'node',
include: ['src/**/*.{test,spec}.{js,ts}'],
exclude: ['src/**/*.svelte.{test,spec}.{js,ts}']
}
}
]
}
});