aboutsummaryrefslogtreecommitdiffstats
path: root/code/app-web
diff options
context:
space:
mode:
authorivarlovlie <git@ivarlovlie.no>2022-11-14 07:50:31 +0100
committerivarlovlie <git@ivarlovlie.no>2022-11-14 07:50:31 +0100
commite60703aadca7d423c0fbfb189d5ef439fc1df072 (patch)
tree10ae5d3910c171918b7c2c6a8ddf77a6b3700513 /code/app-web
downloadstorage-e60703aadca7d423c0fbfb189d5ef439fc1df072.tar.xz
storage-e60703aadca7d423c0fbfb189d5ef439fc1df072.zip
feat: Initial commit
Diffstat (limited to 'code/app-web')
-rw-r--r--code/app-web/package.json25
-rw-r--r--code/app-web/playwright.config.ts10
-rw-r--r--code/app-web/src/app.d.ts9
-rw-r--r--code/app-web/src/app.html12
-rw-r--r--code/app-web/src/routes/+page.svelte2
-rw-r--r--code/app-web/static/favicon.pngbin0 -> 1571 bytes
-rw-r--r--code/app-web/svelte.config.js15
-rw-r--r--code/app-web/tests/test.ts6
-rw-r--r--code/app-web/tsconfig.json17
-rw-r--r--code/app-web/vite.config.ts8
10 files changed, 104 insertions, 0 deletions
diff --git a/code/app-web/package.json b/code/app-web/package.json
new file mode 100644
index 0000000..95e54e9
--- /dev/null
+++ b/code/app-web/package.json
@@ -0,0 +1,25 @@
+{
+ "name": "kit",
+ "version": "0.0.1",
+ "private": true,
+ "scripts": {
+ "dev": "vite dev",
+ "build": "vite build",
+ "preview": "vite preview",
+ "test": "playwright test",
+ "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
+ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch"
+ },
+ "devDependencies": {
+ "@playwright/test": "1.25.0",
+ "@sveltejs/adapter-auto": "next",
+ "@sveltejs/kit": "next",
+ "svelte": "^3.44.0",
+ "svelte-check": "^2.7.1",
+ "svelte-preprocess": "^4.10.6",
+ "tslib": "^2.3.1",
+ "typescript": "^4.7.4",
+ "vite": "^3.1.0"
+ },
+ "type": "module"
+}
diff --git a/code/app-web/playwright.config.ts b/code/app-web/playwright.config.ts
new file mode 100644
index 0000000..6ad3a7f
--- /dev/null
+++ b/code/app-web/playwright.config.ts
@@ -0,0 +1,10 @@
+import type { PlaywrightTestConfig } from '@playwright/test';
+
+const config: PlaywrightTestConfig = {
+ webServer: {
+ command: 'npm run build && npm run preview',
+ port: 4173
+ }
+};
+
+export default config;
diff --git a/code/app-web/src/app.d.ts b/code/app-web/src/app.d.ts
new file mode 100644
index 0000000..8f4d638
--- /dev/null
+++ b/code/app-web/src/app.d.ts
@@ -0,0 +1,9 @@
+// See https://kit.svelte.dev/docs/types#app
+// for information about these interfaces
+// and what to do when importing types
+declare namespace App {
+ // interface Locals {}
+ // interface PageData {}
+ // interface Error {}
+ // interface Platform {}
+}
diff --git a/code/app-web/src/app.html b/code/app-web/src/app.html
new file mode 100644
index 0000000..5b53ef7
--- /dev/null
+++ b/code/app-web/src/app.html
@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <link rel="icon" href="%sveltekit.assets%/favicon.png" />
+ <meta name="viewport" content="width=device-width" />
+ %sveltekit.head%
+ </head>
+ <body>
+ <div>%sveltekit.body%</div>
+ </body>
+</html>
diff --git a/code/app-web/src/routes/+page.svelte b/code/app-web/src/routes/+page.svelte
new file mode 100644
index 0000000..5982b0a
--- /dev/null
+++ b/code/app-web/src/routes/+page.svelte
@@ -0,0 +1,2 @@
+<h1>Welcome to SvelteKit</h1>
+<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p>
diff --git a/code/app-web/static/favicon.png b/code/app-web/static/favicon.png
new file mode 100644
index 0000000..825b9e6
--- /dev/null
+++ b/code/app-web/static/favicon.png
Binary files differ
diff --git a/code/app-web/svelte.config.js b/code/app-web/svelte.config.js
new file mode 100644
index 0000000..892f0c4
--- /dev/null
+++ b/code/app-web/svelte.config.js
@@ -0,0 +1,15 @@
+import adapter from '@sveltejs/adapter-auto';
+import preprocess from 'svelte-preprocess';
+
+/** @type {import('@sveltejs/kit').Config} */
+const config = {
+ // Consult https://github.com/sveltejs/svelte-preprocess
+ // for more information about preprocessors
+ preprocess: preprocess(),
+
+ kit: {
+ adapter: adapter()
+ }
+};
+
+export default config;
diff --git a/code/app-web/tests/test.ts b/code/app-web/tests/test.ts
new file mode 100644
index 0000000..4e57937
--- /dev/null
+++ b/code/app-web/tests/test.ts
@@ -0,0 +1,6 @@
+import { expect, test } from '@playwright/test';
+
+test('index page has expected h1', async ({ page }) => {
+ await page.goto('/');
+ expect(await page.textContent('h1')).toBe('Welcome to SvelteKit');
+});
diff --git a/code/app-web/tsconfig.json b/code/app-web/tsconfig.json
new file mode 100644
index 0000000..6ae0c8c
--- /dev/null
+++ b/code/app-web/tsconfig.json
@@ -0,0 +1,17 @@
+{
+ "extends": "./.svelte-kit/tsconfig.json",
+ "compilerOptions": {
+ "allowJs": true,
+ "checkJs": true,
+ "esModuleInterop": true,
+ "forceConsistentCasingInFileNames": true,
+ "resolveJsonModule": true,
+ "skipLibCheck": true,
+ "sourceMap": true,
+ "strict": true
+ }
+ // Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
+ //
+ // If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
+ // from the referenced tsconfig.json - TypeScript does not merge them in
+}
diff --git a/code/app-web/vite.config.ts b/code/app-web/vite.config.ts
new file mode 100644
index 0000000..1695034
--- /dev/null
+++ b/code/app-web/vite.config.ts
@@ -0,0 +1,8 @@
+import { sveltekit } from '@sveltejs/kit/vite';
+import type { UserConfig } from 'vite';
+
+const config: UserConfig = {
+ plugins: [sveltekit()]
+};
+
+export default config;