Skip to content

Commit c9bcc00

Browse files
committed
Initialize SvelteKit site template
Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com>
0 parents  commit c9bcc00

19 files changed

Lines changed: 1910 additions & 0 deletions

‎.copier-answers.yaml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Changes here will be overwritten by Copier
2+
_commit: 690e994
3+
_src_path: https://github.com/python-project-templates/base.git
4+
add_extension: site-sveltekit
5+
brand_name: Example
6+
github: python-project-templates
7+
project_description: A fast, accessible SvelteKit website.
8+
project_name: javascript-template-site-sveltekit
9+
site_adapter: static
10+
site_url: https://example.com

‎.github/workflows/build.yaml‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Build Status
2+
3+
on:
4+
push:
5+
branches: [main]
6+
tags: [v*]
7+
pull_request:
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v7
18+
- uses: pnpm/action-setup@v6
19+
with:
20+
version: 11
21+
- uses: actions/setup-node@v7
22+
with:
23+
node-version: 22.x
24+
cache: pnpm
25+
- run: pnpm install
26+
- run: pnpm build
27+
- run: pnpm check
28+
- run: pnpm lint
29+
- run: pnpm exec playwright install --with-deps chromium
30+
- run: pnpm test:e2e
31+
env:
32+
CI: '1'

‎.gitignore‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
node_modules
2+
/.svelte-kit
3+
/build
4+
/coverage
5+
/playwright-report
6+
/test-results
7+
.env
8+
.env.*
9+
!.env.example
10+
.DS_Store

‎.oxfmtrc.json‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"$schema": "./node_modules/oxfmt/configuration_schema.json",
3+
"printWidth": 120,
4+
"semi": true,
5+
"singleQuote": true,
6+
"tabWidth": 2,
7+
"trailingComma": "none",
8+
"sortPackageJson": false,
9+
"svelte": true,
10+
"ignorePatterns": [
11+
".svelte-kit/**",
12+
".copier-answers.yaml",
13+
"build/**",
14+
"coverage/**",
15+
"playwright-report/**",
16+
"test-results/**"
17+
]
18+
}

‎.oxlintrc.json‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"$schema": "./node_modules/oxlint/configuration_schema.json",
3+
"env": {
4+
"browser": true,
5+
"es6": true,
6+
"node": true,
7+
"svelte": true
8+
}
9+
}

‎README.md‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Example
2+
3+
A fast, accessible SvelteKit website.
4+
5+
## Develop
6+
7+
```bash
8+
pnpm install
9+
pnpm dev
10+
```
11+
12+
## Verify
13+
14+
```bash
15+
pnpm check
16+
pnpm lint
17+
pnpm test
18+
pnpm build
19+
```
20+
21+
This site uses SvelteKit's `adapter-static` deployment adapter.

‎package.json‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "javascript-template-site-sveltekit",
3+
"version": "0.1.0",
4+
"description": "A fast, accessible SvelteKit website.",
5+
"private": true,
6+
"packageManager": "pnpm@11.9.0",
7+
"engines": {
8+
"node": ">=22"
9+
},
10+
"type": "module",
11+
"scripts": {
12+
"dev": "vite dev",
13+
"build": "vite build",
14+
"preview": "vite preview",
15+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
16+
"lint": "oxlint . && oxfmt --check .",
17+
"fix": "oxlint --fix . && oxfmt --write .",
18+
"test": "pnpm test:e2e",
19+
"test:e2e": "playwright test",
20+
"test:e2e:update": "playwright test --update-snapshots"
21+
},
22+
"devDependencies": {
23+
"@axe-core/playwright": "^4.12.1",
24+
"@playwright/test": "^1.60.0",
25+
"@sveltejs/adapter-static": "^3.0.10",
26+
"@sveltejs/kit": "^2.70.1",
27+
"@sveltejs/vite-plugin-svelte": "^7.1.2",
28+
"@tailwindcss/vite": "^4.3.3",
29+
"@types/node": "^24.0.0",
30+
"oxfmt": "^0.63.0",
31+
"oxlint": "^1.78.0",
32+
"svelte": "^5.56.0",
33+
"svelte-check": "^4.3.0",
34+
"tailwindcss": "^4.3.3",
35+
"typescript": "^5.9.3",
36+
"vite": "^8.1.5"
37+
}
38+
}

‎playwright.config.ts‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { defineConfig, devices } from '@playwright/test';
2+
3+
export default defineConfig({
4+
testDir: 'tests',
5+
fullyParallel: true,
6+
forbidOnly: !!process.env.CI,
7+
retries: process.env.CI ? 2 : 0,
8+
reporter: process.env.CI ? 'github' : 'list',
9+
use: {
10+
baseURL: 'http://127.0.0.1:4177',
11+
trace: 'retain-on-failure',
12+
screenshot: 'only-on-failure'
13+
},
14+
webServer: {
15+
command: 'vite build && vite preview --host 127.0.0.1 --port 4177 --strictPort',
16+
port: 4177,
17+
reuseExistingServer: !process.env.CI,
18+
timeout: 120_000
19+
},
20+
projects: [
21+
{
22+
name: 'desktop',
23+
use: { ...devices['Desktop Chrome'], viewport: { width: 1280, height: 800 } }
24+
}
25+
]
26+
});

0 commit comments

Comments
 (0)