Browse Source

Remove service worker; clean up metadata

ghorsington 3 years ago
parent
commit
f09848085d

File diff suppressed because it is too large
+ 0 - 85
web/README.md


+ 2 - 18
web/package.json

@@ -1,22 +1,6 @@
 {
-	"name": "sapper-typescript-graphql-template",
-	"description": "A template that includes Svelte with Sapper, TypeScript preprocessing, and a GraphQL server through TypeGraphQL",
-	"keywords": [
-		"sapper",
-		"typegraphql",
-		"typescript",
-		"eslint",
-		"svelte",
-		"apollo-server",
-		"graphql"
-	],
-	"homepage": "https://github.com/babichjacob/sapper-typescript-graphql-template",
-	"repository": {
-		"type": "git",
-		"url": "https://github.com/babichjacob/sapper-typescript-graphql-template.git"
-	},
-	"license": "MIT",
-	"version": "2020.06.05",
+	"name": "noctbot_web",
+	"description": "NoctBot web interface",
 	"scripts": {
 		"eslint": "eslint",
 		"eslint:fix": "eslint --fix ./*.js ./src/*.ts ./src/components/**/*.svelte ./src/graphql/**/*.ts ./src/routes/**/*.svelte ./src/routes/**/*.ts",

+ 0 - 18
web/rollup.config.js

@@ -130,22 +130,4 @@ export default {
         preserveEntrySignatures: "strict",
         onwarn,
     },
-
-    serviceworker: {
-        input: config.serviceworker.input().replace(/\.js$/, ".ts"),
-        output: config.serviceworker.output(),
-        plugins: [
-            resolve(),
-            replace({
-                "process.browser": true,
-                "process.env.NODE_ENV": JSON.stringify(mode),
-            }),
-            commonjs(),
-            typescript(),
-            !dev && terser(),
-        ],
-
-        preserveEntrySignatures: false,
-        onwarn,
-    },
 };

+ 0 - 89
web/src/service-worker.ts

@@ -1,89 +0,0 @@
-/* eslint-disable no-restricted-globals,@typescript-eslint/no-explicit-any */
-// @ts-ignore -- generated package
-import { timestamp, files, shell } from "@sapper/service-worker";
-
-const ASSETS = `cache${timestamp}`;
-
-// `shell` is an array of all the files generated by the bundler,
-// `files` is an array of everything in the `static` directory
-const toCache = (shell as string[]).concat(files as string[]);
-const cached = new Set(toCache);
-
-self.addEventListener("install", <EventType extends ExtendableEvent>(event: EventType) => {
-    event.waitUntil(
-        caches
-            .open(ASSETS)
-            .then((cache) => cache.addAll(toCache))
-            .then(() => {
-                (self as any as ServiceWorkerGlobalScope).skipWaiting();
-            }),
-    );
-});
-
-self.addEventListener("activate", <EventType extends ExtendableEvent>(event: EventType) => {
-    event.waitUntil(
-        caches.keys().then(async (keys) => {
-            // delete old caches
-            for (const key of keys) { // eslint-disable-line no-restricted-syntax
-                if (key !== ASSETS) {
-                    // eslint-disable-next-line no-await-in-loop
-                    await caches.delete(key);
-                }
-            }
-
-            (self as any as {clients: Clients}).clients.claim();
-        }),
-    );
-});
-
-self.addEventListener("fetch", <EventType extends FetchEvent>(event: EventType) => {
-    if (event.request.method !== "GET" || event.request.headers.has("range")) return;
-
-    const url = new URL(event.request.url);
-
-    // don't try to handle e.g. data: URIs
-    if (!url.protocol.startsWith("http")) return;
-
-    // ignore dev server requests
-    if (url.hostname === self.location.hostname && url.port !== self.location.port) return;
-
-    // always serve static files and bundler-generated assets from cache
-    if (url.host === self.location.host && cached.has(url.pathname)) {
-        caches.match(event.request).then((match): void => {
-            if (match) event.respondWith(match);
-        });
-        return;
-    }
-
-    // for pages, you might want to serve a shell `service-worker-index.html` file,
-    // which Sapper has generated for you. It's not right for every
-    // app, but if it's right for yours then uncomment this section
-    /*
-	if (url.origin === self.origin && routes.find(route => route.pattern.test(url.pathname))) {
-		event.respondWith(caches.match('/service-worker-index.html'));
-		return;
-	}
-	*/
-
-    if (event.request.cache === "only-if-cached") return;
-
-    // for everything else, try the network first, falling back to
-    // cache if the user is offline. (If the pages never change, you
-    // might prefer a cache-first approach to a network-first one.)
-    event.respondWith(
-        caches
-            .open(`offline${timestamp}`)
-            .then(async (cache) => {
-                try {
-                    const response = await fetch(event.request);
-                    cache.put(event.request, response.clone());
-                    return response;
-                } catch (err) {
-                    const response = await cache.match(event.request);
-                    if (response) return response;
-
-                    throw err;
-                }
-            }),
-    );
-});

BIN
web/static/apple-touch-icon-180.png


BIN
web/static/logo-192.png


BIN
web/static/logo-512.png


+ 0 - 38
web/static/manifest.json

@@ -1,38 +0,0 @@
-{
-	"short_name": "Sapper + TypeScript + GraphQL",
-	"name": "Sapper with TypeScript and GraphQL project base",
-	"description": "A template that includes Svelte with Sapper, TypeScript preprocessing, and a GraphQL server through TypeGraphQL",
-	"categories": ["personalization", "productivity"],
-	"lang": "en-US",
-	"dir": "ltr",
-	"icons": [
-		{
-			"src": "logo-192.png",
-			"sizes": "192x192",
-			"type": "image/png",
-			"purpose": "any maskable"
-		},
-		{
-			"src": "logo-512.png",
-			"sizes": "512x512",
-			"type": "image/png",
-			"purpose": "any maskable"
-		}
-	],
-	"start_url": "/",
-	"display": "minimal-ui",
-	"background_color": "#ffffff",
-	"theme_color": "#0096D1",
-	"screenshots": [
-		{
-			"src": "screenshot-1.png",
-			"sizes": "1280x720",
-			"type": "image/png"
-		},
-		{
-			"src": "screenshot-2.png",
-			"sizes": "1280x720",
-			"type": "image/png"
-		}
-	]
-}

BIN
web/static/screenshot-1.png


BIN
web/static/screenshot-2.png