Skip to content

Commit 9f43ae8

Browse files
authored
refactor: migrate app to svelte-kit (#38)
1 parent 6360ddc commit 9f43ae8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+1002
-244
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ dist
228228
# website: https://kit.svelte.dev/
229229

230230
.svelte-kit/
231+
test-results/
231232
package
232233

233234
public/

.husky/pre-push

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
pnpm lint
22
pnpm build
3+
pnpm test

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"importOrderSeparation": true,
55
"importOrderSortSpecifiers": true,
66
"importOrderParserPlugins": ["typescript", "decorators-legacy"],
7-
"importOrder": ["^~/(.*)$", "^[./]"],
7+
"importOrder": ["^$app/(.*)$", "^lib/(.*)$", "^~/(.*)$", "^[./]"],
88
"useTabs": false,
99
"singleQuote": true,
1010
"trailingComma": "all",

e2e/demo.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { expect, test } from '@playwright/test';
2+
3+
test('home page has expected span', async ({ page }) => {
4+
await page.goto('/');
5+
await expect(page.locator('span')).toBeVisible();
6+
});

eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ import svelteConfig from './svelte.config.js';
99
export default [
1010
{ files: ['src/**/*.{ts}'] },
1111
{ languageOptions: { globals: globals.browser } },
12-
{ ignores: ['commitlint.config.cjs'] },
1312

1413
pluginJs.configs.recommended,
1514
...tseslint.configs.recommended,
1615
...tseslint.configs.strict,
1716
eslintConfigPrettier,
1817
...svelte.configs.recommended,
18+
...svelte.configs.prettier,
1919

2020
{
2121
files: ['**/*.svelte', '**/*.svelte.ts', '**/*.svelte.js'],

index.html

Lines changed: 0 additions & 13 deletions
This file was deleted.

messages/en.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://inlang.com/schema/inlang-message-format",
3+
"hello_world": "Hello, {name} from en!"
4+
}

messages/fr.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://inlang.com/schema/inlang-message-format",
3+
"hello_world": "Hello, {name} from fr!"
4+
}

package.json

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,32 +38,40 @@
3838
"dev": "vite",
3939
"build": "vite build",
4040
"preview": "vite preview",
41-
"check": "svelte-check --tsconfig tsconfig.app.json && tsc -p tsconfig.node.json",
41+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
42+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
4243
"lint": "prettier --check . && eslint --format=pretty src",
4344
"format": "prettier --write . && eslint --fix --format=pretty src",
45+
"test": "pnpm run test:unit --run",
46+
"test:unit": "vitest",
47+
"test:e2e": "playwright test",
4448
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r . --include-path '.'",
4549
"release": "cliff-jumper",
4650
"prepare": "husky"
4751
},
48-
"dependencies": {
49-
"monaco-editor": "0.55.1"
50-
},
5152
"devDependencies": {
53+
"@alexanderniebuhr/prettier-plugin-unocss": "^0.0.4",
5254
"@commitlint/cli": "^19.8.0",
5355
"@commitlint/config-conventional": "^19.8.0",
5456
"@eslint/js": "^9.23.0",
5557
"@favware/cliff-jumper": "^6.0.0",
5658
"@iconify-json/ic": "^1.2.4",
5759
"@iconify-json/material-icon-theme": "^1.2.27",
5860
"@iconify-json/solar": "^1.2.4",
61+
"@inlang/paraglide-js": "^2.8.0",
5962
"@nanoforge-dev/actions": "^1.0.2",
63+
"@playwright/test": "^1.57.0",
64+
"@sveltejs/adapter-auto": "^7.0.0",
65+
"@sveltejs/kit": "^2.49.4",
6066
"@sveltejs/vite-plugin-svelte": "^5.0.3",
6167
"@trivago/prettier-plugin-sort-imports": "^5.2.2",
6268
"@tsconfig/svelte": "^5.0.4",
69+
"@unocss/extractor-svelte": "^66.5.12",
6370
"@unocss/preset-icons": "^66.5.1",
6471
"@unocss/preset-web-fonts": "66.1.0-beta.6",
6572
"@unocss/preset-wind4": "^66.5.1",
6673
"@unocss/svelte-scoped": "66.1.0-beta.6",
74+
"@vitest/browser-playwright": "^4.0.17",
6775
"eslint": "^9.23.0",
6876
"eslint-config-prettier": "^10.1.1",
6977
"eslint-formatter-pretty": "^7.0.0",
@@ -75,16 +83,19 @@
7583
"globals": "^16.0.0",
7684
"husky": "^9.1.7",
7785
"lint-staged": "^15.5.0",
86+
"monaco-editor": "^0.55.1",
87+
"playwright": "^1.57.0",
7888
"prettier": "^3.5.3",
7989
"prettier-plugin-svelte": "^3.3.3",
8090
"svelte": "^5.20.2",
8191
"svelte-check": "^4.1.4",
82-
"svelte-routing": "^2.13.0",
8392
"svelte-sonner": "^1.0.5",
8493
"typescript": "~5.7.2",
8594
"typescript-eslint": "^8.27.0",
8695
"unocss": "66.1.0-beta.6",
87-
"vite": "6.3.4"
96+
"vite": "6.3.4",
97+
"vitest": "^4.0.17",
98+
"vitest-browser-svelte": "^2.0.1"
8899
},
89100
"packageManager": "[email protected]",
90101
"engines": {

playwright.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { defineConfig } from '@playwright/test';
2+
3+
export default defineConfig({
4+
webServer: { command: 'npm run build && npm run preview', port: 4173 },
5+
testDir: 'e2e',
6+
});

0 commit comments

Comments
 (0)