diff --git a/app/client.imba b/app/client.imba index 9218d58..e293ba2 100644 --- a/app/client.imba +++ b/app/client.imba @@ -1,5 +1,8 @@ let p = console.log +import sw from './sw.imba?serviceworker' +navigator..serviceWorker..register(sw).then! do |reg| reg.update! + import { orderBy, omit } from 'lodash' import pkg from '../package.json' let version = pkg.version diff --git a/app/index.html b/app/index.html index acbdf37..e18eca8 100644 --- a/app/index.html +++ b/app/index.html @@ -7,13 +7,6 @@ - diff --git a/sw.imba b/app/sw.imba similarity index 88% rename from sw.imba rename to app/sw.imba index abfe0ad..d46bfc6 100644 --- a/sw.imba +++ b/app/sw.imba @@ -1,15 +1,12 @@ const app_name = "fuzzyhome" -import { version } from './package.json' +import { version } from '../package.json' const app_prefix = "{app_name}_cache" const cache_name = "sw-{app_prefix}-{version}" let p = do |s| console.log "{cache_name} {s}" p "loaded" let urls = [ - './', - './__assets__/all.css' - './__assets__/app/client.js' - './__assets__/app/client.css' + './' ] self.addEventListener('fetch') do |e| diff --git a/package-lock.json b/package-lock.json index 09df251..3fe66fa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "dexie-export-import": "^1.0.3", "downloadjs": "^1.4.7", "fzi": "^1.0.0", - "imba": "^2.0.0-alpha.218", + "imba": "^2.0.0-alpha.219", "lodash": "^4.17.21", "mathjs": "^11.1.0", "nanoid": "^4.0.0" @@ -532,9 +532,9 @@ } }, "node_modules/imba": { - "version": "2.0.0-alpha.218", - "resolved": "https://registry.npmjs.org/imba/-/imba-2.0.0-alpha.218.tgz", - "integrity": "sha512-qWu5mcTYbZH7eVs8UY4OVYoWgm0m3L3NTPEDdOeDSkxvBQG2AFxgQDIAIQjodH46pDFDTvkVm2L8SQ7Do8lHNQ==", + "version": "2.0.0-alpha.219", + "resolved": "https://registry.npmjs.org/imba/-/imba-2.0.0-alpha.219.tgz", + "integrity": "sha512-5BIUK9DBNDvprJ/hPezfg4dk6w96j/yOCWU35O/CKpLx8ce+k/u534HYrdQNGZqfTY7ImSA5uRduVbp1zKi9Wg==", "dependencies": { "chokidar": "^3.4.3", "esbuild": "^0.15.2" @@ -958,9 +958,9 @@ } }, "imba": { - "version": "2.0.0-alpha.218", - "resolved": "https://registry.npmjs.org/imba/-/imba-2.0.0-alpha.218.tgz", - "integrity": "sha512-qWu5mcTYbZH7eVs8UY4OVYoWgm0m3L3NTPEDdOeDSkxvBQG2AFxgQDIAIQjodH46pDFDTvkVm2L8SQ7Do8lHNQ==", + "version": "2.0.0-alpha.219", + "resolved": "https://registry.npmjs.org/imba/-/imba-2.0.0-alpha.219.tgz", + "integrity": "sha512-5BIUK9DBNDvprJ/hPezfg4dk6w96j/yOCWU35O/CKpLx8ce+k/u534HYrdQNGZqfTY7ImSA5uRduVbp1zKi9Wg==", "requires": { "chokidar": "^3.4.3", "esbuild": "^0.15.2" diff --git a/package.json b/package.json index 75fb5ba..a55888d 100644 --- a/package.json +++ b/package.json @@ -2,9 +2,7 @@ "name": "fuzzyhome", "version": "0.1.42", "scripts": { - "build-app": "imba build app/index.html", - "build-sw": "imba build -k sw.imba -o dist", - "build": "npm run build-app && npm run build-sw", + "build": "imba build app/index.html", "publish-preview": "npx gh-pages --no-history --dotfiles --dist dist/ --branch preview", "publish-release": "npx gh-pages --no-history --dotfiles --dist dist/ --branch release", "start": "imba -w app/index.html", @@ -17,7 +15,7 @@ "dexie-export-import": "^1.0.3", "downloadjs": "^1.4.7", "fzi": "^1.0.0", - "imba": "^2.0.0-alpha.218", + "imba": "^2.0.0-alpha.219", "lodash": "^4.17.21", "mathjs": "^11.1.0", "nanoid": "^4.0.0"