Skip to content

Commit 0498d1e

Browse files
committed
add sveltekit 2 app with v7
1 parent 9a86c12 commit 0498d1e

36 files changed

+3399
-61
lines changed

.prettierignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
utils/event-proxy-server/payload-files/**/*.json
1+
utils/event-proxy-server/payload-files/**/*.json
2+
payload-files/**/*.json

apps/sveltekit-2/.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.DS_Store
2+
node_modules
3+
/build
4+
/.svelte-kit
5+
/package
6+
.env
7+
.env.*
8+
!.env.example
9+
.vercel
10+
.output
11+
vite.config.js.timestamp-*
12+
vite.config.ts.timestamp-*

apps/sveltekit-2/.prettierrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"useTabs": true,
3+
"singleQuote": true,
4+
"trailingComma": "none",
5+
"printWidth": 100,
6+
"plugins": ["prettier-plugin-svelte"],
7+
"overrides": [{ "files": "*.svelte", "options": { "parser": "svelte" } }]
8+
}

apps/sveltekit-2/package.json

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"name": "sveltekit-2-test-application",
3+
"version": "0.0.1",
4+
"scripts": {
5+
"dev": "vite dev",
6+
"build": "vite build",
7+
"preview": "vite preview",
8+
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
9+
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
10+
"lint": "prettier --check . && eslint .",
11+
"format": "prettier --write ."
12+
},
13+
"dependencies": {
14+
"@sentry/sveltekit": "7.110.1"
15+
},
16+
"devDependencies": {
17+
"@sveltejs/adapter-auto": "^3.0.0",
18+
"@sveltejs/kit": "^2.0.0",
19+
"@sveltejs/vite-plugin-svelte": "^3.0.0",
20+
"@types/eslint": "^8.56.0",
21+
"@typescript-eslint/eslint-plugin": "^7.0.0",
22+
"@typescript-eslint/parser": "^7.0.0",
23+
"eslint": "^8.56.0",
24+
"eslint-config-prettier": "^9.1.0",
25+
"eslint-plugin-svelte": "^2.35.1",
26+
"prettier": "^3.1.1",
27+
"prettier-plugin-svelte": "^3.1.2",
28+
"svelte": "^4.2.7",
29+
"svelte-check": "^3.6.0",
30+
"tslib": "^2.4.1",
31+
"typescript": "^5.0.0",
32+
"vite": "^5.0.3"
33+
},
34+
"type": "module",
35+
"volta": {
36+
"extends": "../../package.json"
37+
}
38+
}

apps/sveltekit-2/src/app.d.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// See https://kit.svelte.dev/docs/types#app
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 {};

apps/sveltekit-2/src/app.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { env } from '$env/dynamic/public';
2+
import * as Sentry from '@sentry/sveltekit';
3+
4+
Sentry.init({
5+
environment: 'qa', // dynamic sampling bias to keep transactions
6+
dsn: 'https://3b6c388182fb435097f41d181be2b2ba@o4504321058471936.ingest.sentry.io/4504321066008576',
7+
includeLocalVariables: true,
8+
tunnel: `http://localhost:3031/`, // proxy server
9+
tracesSampleRate: 1
10+
});
11+
12+
const myErrorHandler = ({ error, event }: any) => {
13+
console.error('An error occurred on the client side:', error, event);
14+
};
15+
16+
export const handleError = Sentry.handleErrorWithSentry(myErrorHandler);
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { env } from '$env/dynamic/public';
2+
import * as Sentry from '@sentry/sveltekit';
3+
4+
Sentry.init({
5+
environment: 'qa', // dynamic sampling bias to keep transactions
6+
dsn: 'https://3b6c388182fb435097f41d181be2b2ba@o4504321058471936.ingest.sentry.io/4504321066008576',
7+
includeLocalVariables: true,
8+
tunnel: `http://localhost:3031/`, // proxy server
9+
tracesSampleRate: 1
10+
});
11+
12+
// not logging anything to console to avoid noise in the test output
13+
export const handleError = Sentry.handleErrorWithSentry(() => {});
14+
15+
export const handle = Sentry.sentryHandle();
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<script lang="ts">
2+
import './styles.css';
3+
</script>
4+
5+
<slot />
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<main>
2+
<ul>
3+
<li>
4+
<a href={'/test-route-handlers'}>Test Route Handlers</a>
5+
</li>
6+
</ul>
7+
</main>

0 commit comments

Comments
 (0)