mirror of
https://github.com/dsec-hub/dsec-notebook.git
synced 2026-09-22 15:43:58 +00:00
added as PWA
This commit is contained in:
parent
203dccda52
commit
2ff5b92bbc
8 changed files with 5435 additions and 2 deletions
5383
package-lock.json
generated
5383
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
|
@ -24,6 +24,8 @@
|
||||||
"@sveltejs/vite-plugin-svelte": "^7.1.2",
|
"@sveltejs/vite-plugin-svelte": "^7.1.2",
|
||||||
"@tailwindcss/vite": "^4.3.0",
|
"@tailwindcss/vite": "^4.3.0",
|
||||||
"@types/node": "^26.3.0",
|
"@types/node": "^26.3.0",
|
||||||
|
"@vite-pwa/assets-generator": "^1.0.2",
|
||||||
|
"@vite-pwa/sveltekit": "^1.1.0",
|
||||||
"@vitest/browser-playwright": "^4.1.8",
|
"@vitest/browser-playwright": "^4.1.8",
|
||||||
"oxfmt": "^0.65.0",
|
"oxfmt": "^0.65.0",
|
||||||
"playwright": "^1.60.0",
|
"playwright": "^1.60.0",
|
||||||
|
|
|
||||||
2
src/app.d.ts
vendored
2
src/app.d.ts
vendored
|
|
@ -1,3 +1,5 @@
|
||||||
|
/// <reference types="vite-plugin-pwa/client" />
|
||||||
|
|
||||||
export {};
|
export {};
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|
|
||||||
13
src/app.html
13
src/app.html
|
|
@ -3,7 +3,18 @@
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<meta name="text-scale" content="scale" />
|
<meta
|
||||||
|
name="description"
|
||||||
|
content="DSEC Notebook — a resource hub for Deakin University students. Shared study notes, questions and answers for SIT and Mathematics units."
|
||||||
|
/>
|
||||||
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||||
|
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
|
||||||
|
<meta name="apple-mobile-web-app-title" content="Notebook" />
|
||||||
|
<meta name="format-detection" content="telephone=no" />
|
||||||
|
<meta name="theme-color" content="#ffffff" />
|
||||||
|
<link rel="manifest" href="/manifest.webmanifest" />
|
||||||
|
<link rel="icon" href="/favicon.ico" sizes="any" />
|
||||||
|
<link rel="apple-touch-icon" href="/apple-touch-icon-180x180.png" />
|
||||||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||||||
<link
|
<link
|
||||||
|
|
|
||||||
|
|
@ -9,12 +9,21 @@
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
initAuth();
|
initAuth();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
onMount(async () => {
|
||||||
|
const { registerSW } = await import("virtual:pwa-register");
|
||||||
|
registerSW({
|
||||||
|
immediate: true,
|
||||||
|
onRegisterError(error) {
|
||||||
|
console.error("Service worker registration failed", error);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<link rel="icon" href="/favicon.svg" />
|
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|
||||||
<div class="flex min-h-screen flex-col bg-white">
|
<div class="flex min-h-screen flex-col bg-white">
|
||||||
|
|
|
||||||
BIN
static/dsec-logo.webp
Normal file
BIN
static/dsec-logo.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
BIN
static/favicon.ico
Normal file
BIN
static/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
|
|
@ -3,6 +3,7 @@ import { defineConfig } from "vitest/config";
|
||||||
import { playwright } from "@vitest/browser-playwright";
|
import { playwright } from "@vitest/browser-playwright";
|
||||||
import adapter from "@sveltejs/adapter-node";
|
import adapter from "@sveltejs/adapter-node";
|
||||||
import { sveltekit } from "@sveltejs/kit/vite";
|
import { sveltekit } from "@sveltejs/kit/vite";
|
||||||
|
import { SvelteKitPWA } from "@vite-pwa/sveltekit";
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [
|
plugins: [
|
||||||
|
|
@ -17,6 +18,31 @@ export default defineConfig({
|
||||||
// adapter-node is used because the app persists data to a local SQLite file on the server.
|
// adapter-node is used because the app persists data to a local SQLite file on the server.
|
||||||
adapter: adapter(),
|
adapter: adapter(),
|
||||||
}),
|
}),
|
||||||
|
SvelteKitPWA({
|
||||||
|
registerType: "autoUpdate",
|
||||||
|
devOptions: {
|
||||||
|
enabled: true,
|
||||||
|
type: "module",
|
||||||
|
},
|
||||||
|
manifest: {
|
||||||
|
name: "DSEC Notebook",
|
||||||
|
short_name: "Notebook",
|
||||||
|
description:
|
||||||
|
"A resource hub for Deakin University students: shared study notes, questions and answers for SIT and Mathematics units.",
|
||||||
|
start_url: "/",
|
||||||
|
scope: "/",
|
||||||
|
display: "standalone",
|
||||||
|
background_color: "#ffffff",
|
||||||
|
theme_color: "#ffffff",
|
||||||
|
lang: "en",
|
||||||
|
},
|
||||||
|
pwaAssets: {
|
||||||
|
image: "static/dsec-logo.webp",
|
||||||
|
preset: "minimal-2023",
|
||||||
|
includeHtmlHeadLinks: false,
|
||||||
|
injectThemeColor: false,
|
||||||
|
},
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
test: {
|
test: {
|
||||||
expect: { requireAssertions: true },
|
expect: { requireAssertions: true },
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue