Update dependency vite-plugin-pwa to v0.8.2 (#612)

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/612
Co-authored-by: renovate <renovatebot@kolaente.de>
Co-committed-by: renovate <renovatebot@kolaente.de>
This commit is contained in:
renovate 2021-07-26 20:26:53 +00:00 committed by konrad
parent bfc2d63b9a
commit a9f4d0dff9
8 changed files with 26 additions and 127 deletions

View file

@ -5,7 +5,8 @@
"scripts": { "scripts": {
"serve": "vite", "serve": "vite",
"serve:dist-dev": "node scripts/serve-dist.js", "serve:dist-dev": "node scripts/serve-dist.js",
"build": "vite build && rollup -c ./rollup.sw.js && workbox copyLibraries dist/", "serve:dist": "vite preview",
"build": "vite build && workbox copyLibraries dist/",
"build:dev": "vite build -m development --outDir dist-dev/", "build:dev": "vite build -m development --outDir dist-dev/",
"lint": "eslint --ignore-pattern '*.test.*' ./src --ext .vue,.js,.ts", "lint": "eslint --ignore-pattern '*.test.*' ./src --ext .vue,.js,.ts",
"cypress:open": "cypress open", "cypress:open": "cypress open",
@ -40,10 +41,6 @@
"@fortawesome/free-regular-svg-icons": "5.15.3", "@fortawesome/free-regular-svg-icons": "5.15.3",
"@fortawesome/free-solid-svg-icons": "5.15.3", "@fortawesome/free-solid-svg-icons": "5.15.3",
"@fortawesome/vue-fontawesome": "2.0.2", "@fortawesome/vue-fontawesome": "2.0.2",
"@rollup/plugin-babel": "5.3.0",
"@rollup/plugin-commonjs": "19.0.2",
"@rollup/plugin-node-resolve": "13.0.4",
"@rollup/plugin-replace": "3.0.0",
"@types/jest": "26.0.24", "@types/jest": "26.0.24",
"@typescript-eslint/eslint-plugin": "4.28.5", "@typescript-eslint/eslint-plugin": "4.28.5",
"@typescript-eslint/parser": "4.28.5", "@typescript-eslint/parser": "4.28.5",
@ -66,7 +63,7 @@
"ts-jest": "27.0.4", "ts-jest": "27.0.4",
"typescript": "4.3.5", "typescript": "4.3.5",
"vite": "2.4.3", "vite": "2.4.3",
"vite-plugin-pwa": "0.5.6", "vite-plugin-pwa": "0.8.2",
"vite-plugin-vue2": "1.7.3", "vite-plugin-vue2": "1.7.3",
"vue-flatpickr-component": "8.1.7", "vue-flatpickr-component": "8.1.7",
"vue-notification": "1.3.20", "vue-notification": "1.3.20",

View file

@ -1,43 +0,0 @@
import { nodeResolve } from '@rollup/plugin-node-resolve'
import babel from '@rollup/plugin-babel'
import commonjs from '@rollup/plugin-commonjs'
import { terser } from 'rollup-plugin-terser'
import replace from '@rollup/plugin-replace'
// Building the sw stuff ourselves to have more controle over it - see https://github.com/antfu/vite-plugin-pwa/issues/35#issuecomment-797942573
export default {
input: './dist/sw.js',
output: {
dir: 'dist',
format: 'esm',
},
plugins: [
replace({
'process.env.NODE_ENV': JSON.stringify('production'),
'preventAssignment': true,
}),
nodeResolve({
browser: true,
}),
commonjs(),
babel({
exclude: '**/node_modules/**',
extensions: ['js'],
babelHelpers: 'runtime',
presets: [
[
'@babel/preset-env',
{
corejs: 3,
useBuiltIns: 'entry',
targets: {
'esmodules': true,
},
modules: false,
},
],
],
}),
terser(),
],
}

View file

@ -1,3 +0,0 @@
{
"SW_UPDATED": "swUpdated"
}

View file

@ -8,8 +8,6 @@
</template> </template>
<script> <script>
import swEvents from '@/ServiceWorker/events.json'
export default { export default {
name: 'update', name: 'update',
data() { data() {
@ -20,7 +18,7 @@ export default {
} }
}, },
created() { created() {
document.addEventListener(swEvents.SW_UPDATED, this.showRefreshUI, {once: true}) document.addEventListener('swUpdated', this.showRefreshUI, {once: true})
if (navigator && navigator.serviceWorker) { if (navigator && navigator.serviceWorker) {
navigator.serviceWorker.addEventListener( navigator.serviceWorker.addEventListener(

View file

@ -1,7 +1,6 @@
/* eslint-disable no-console */ /* eslint-disable no-console */
import {register} from 'register-service-worker' import {register} from 'register-service-worker'
import swEvents from './ServiceWorker/events'
import {getToken} from './helpers/auth' import {getToken} from './helpers/auth'
if (import.meta.env.PROD) { if (import.meta.env.PROD) {
@ -22,7 +21,7 @@ if (import.meta.env.PROD) {
console.log('New content is available; please refresh.') console.log('New content is available; please refresh.')
// Send an event with the updated info // Send an event with the updated info
document.dispatchEvent( document.dispatchEvent(
new CustomEvent(swEvents.SW_UPDATED, {detail: registration}), new CustomEvent('swUpdated', {detail: registration}),
) )
}, },
offline() { offline() {

View file

@ -7,12 +7,11 @@ module.exports = {
plugins: [ plugins: [
createVuePlugin(), createVuePlugin(),
VitePWA({ VitePWA({
srcDir: 'src',
filename: 'sw.js',
base: '/',
strategies: 'injectManifest', strategies: 'injectManifest',
injectRegister: false, injectRegister: false,
injectManifest: {
swSrc: './src/ServiceWorker/sw.js',
swDest: './dist/sw.js',
},
manifest: { manifest: {
name: 'Vikunja', name: 'Vikunja',
short_name: 'Vikunja', short_name: 'Vikunja',

View file

@ -1306,7 +1306,7 @@
"@nodelib/fs.scandir" "2.1.5" "@nodelib/fs.scandir" "2.1.5"
fastq "^1.6.0" fastq "^1.6.0"
"@rollup/plugin-babel@5.3.0", "@rollup/plugin-babel@^5.2.0": "@rollup/plugin-babel@^5.2.0":
version "5.3.0" version "5.3.0"
resolved "https://registry.yarnpkg.com/@rollup/plugin-babel/-/plugin-babel-5.3.0.tgz#9cb1c5146ddd6a4968ad96f209c50c62f92f9879" resolved "https://registry.yarnpkg.com/@rollup/plugin-babel/-/plugin-babel-5.3.0.tgz#9cb1c5146ddd6a4968ad96f209c50c62f92f9879"
integrity sha512-9uIC8HZOnVLrLHxayq/PTzw+uS25E14KPUBh5ktF+18Mjo5yK0ToMMx6epY0uEgkjwJw0aBW4x2horYXh8juWw== integrity sha512-9uIC8HZOnVLrLHxayq/PTzw+uS25E14KPUBh5ktF+18Mjo5yK0ToMMx6epY0uEgkjwJw0aBW4x2horYXh8juWw==
@ -1314,31 +1314,6 @@
"@babel/helper-module-imports" "^7.10.4" "@babel/helper-module-imports" "^7.10.4"
"@rollup/pluginutils" "^3.1.0" "@rollup/pluginutils" "^3.1.0"
"@rollup/plugin-commonjs@19.0.2":
version "19.0.2"
resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-19.0.2.tgz#1ccc3d63878d1bc9846f8969f09dd3b3e4ecc244"
integrity sha512-gBjarfqlC7qs0AutpRW/hrFNm+cd2/QKxhwyFa+srbg1oX7rDsEU3l+W7LAUhsAp9mPJMAkXDhLbQaVwEaE8bA==
dependencies:
"@rollup/pluginutils" "^3.1.0"
commondir "^1.0.1"
estree-walker "^2.0.1"
glob "^7.1.6"
is-reference "^1.2.1"
magic-string "^0.25.7"
resolve "^1.17.0"
"@rollup/plugin-node-resolve@13.0.4":
version "13.0.4"
resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.0.4.tgz#b10222f4145a019740acb7738402130d848660c0"
integrity sha512-eYq4TFy40O8hjeDs+sIxEH/jc9lyuI2k9DM557WN6rO5OpnC2qXMBNj4IKH1oHrnAazL49C5p0tgP0/VpqJ+/w==
dependencies:
"@rollup/pluginutils" "^3.1.0"
"@types/resolve" "1.17.1"
builtin-modules "^3.1.0"
deepmerge "^4.2.2"
is-module "^1.0.0"
resolve "^1.19.0"
"@rollup/plugin-node-resolve@^11.2.1": "@rollup/plugin-node-resolve@^11.2.1":
version "11.2.1" version "11.2.1"
resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.1.tgz#82aa59397a29cd4e13248b106e6a4a1880362a60" resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.1.tgz#82aa59397a29cd4e13248b106e6a4a1880362a60"
@ -1351,14 +1326,6 @@
is-module "^1.0.0" is-module "^1.0.0"
resolve "^1.19.0" resolve "^1.19.0"
"@rollup/plugin-replace@3.0.0":
version "3.0.0"
resolved "https://registry.yarnpkg.com/@rollup/plugin-replace/-/plugin-replace-3.0.0.tgz#3a4c9665d4e7a4ce2c360cf021232784892f3fac"
integrity sha512-3c7JCbMuYXM4PbPWT4+m/4Y6U60SgsnDT/cCyAyUKwFHg7pTSfsSQzIpETha3a3ig6OdOKzZz87D9ZXIK3qsDg==
dependencies:
"@rollup/pluginutils" "^3.1.0"
magic-string "^0.25.7"
"@rollup/plugin-replace@^2.4.1": "@rollup/plugin-replace@^2.4.1":
version "2.4.2" version "2.4.2"
resolved "https://registry.yarnpkg.com/@rollup/plugin-replace/-/plugin-replace-2.4.2.tgz#a2d539314fbc77c244858faa523012825068510a" resolved "https://registry.yarnpkg.com/@rollup/plugin-replace/-/plugin-replace-2.4.2.tgz#a2d539314fbc77c244858faa523012825068510a"
@ -1540,9 +1507,9 @@
integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ== integrity sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==
"@types/node@*": "@types/node@*":
version "16.4.2" version "16.4.3"
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.4.2.tgz#0a95d7fd950cb1eaca0ce11031d72e8f680b775a" resolved "https://registry.yarnpkg.com/@types/node/-/node-16.4.3.tgz#c01c1a215721f6dec71b47d88b4687463601ba48"
integrity sha512-vxyhOzFCm+jC/T5KugbVsYy1DbQM0h3NCFUrVbu0+pYa/nr+heeucpqxpa8j4pUmIGLPYzboY9zIdOF0niFAjQ== integrity sha512-GKM4FLMkWDc0sfx7tXqPWkM6NBow1kge0fgQh0bOnlqo4iT1kvTvMEKE0c1RtUGnbLlGRXiAA8SumE//90uKAg==
"@types/node@^14.14.31": "@types/node@^14.14.31":
version "14.17.6" version "14.17.6"
@ -3229,11 +3196,6 @@ common-tags@^1.8.0:
resolved "https://registry.yarnpkg.com/common-tags/-/common-tags-1.8.0.tgz#8e3153e542d4a39e9b10554434afaaf98956a937" resolved "https://registry.yarnpkg.com/common-tags/-/common-tags-1.8.0.tgz#8e3153e542d4a39e9b10554434afaaf98956a937"
integrity sha512-6P6g0uetGpW/sdyUy/iQQCbFF0kWVMSIVSyYz7Zgjcgh8mgw8PQzDNZeyZ5DQ2gM7LBoZPHmnjz8rUthkBG5tw== integrity sha512-6P6g0uetGpW/sdyUy/iQQCbFF0kWVMSIVSyYz7Zgjcgh8mgw8PQzDNZeyZ5DQ2gM7LBoZPHmnjz8rUthkBG5tw==
commondir@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b"
integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=
component-emitter@^1.2.1: component-emitter@^1.2.1:
version "1.3.0" version "1.3.0"
resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0"
@ -3736,16 +3698,11 @@ error-ex@^1.3.1:
dependencies: dependencies:
is-arrayish "^0.2.1" is-arrayish "^0.2.1"
esbuild@0.12.16: esbuild@0.12.16, esbuild@^0.12.8:
version "0.12.16" version "0.12.16"
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.12.16.tgz#c397144ce13b445a6ead9c1f747da11f79ec5e67" resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.12.16.tgz#c397144ce13b445a6ead9c1f747da11f79ec5e67"
integrity sha512-XqI9cXP2bmQ6MREIqrYBb13KfYFSERsV1+e5jSVWps8dNlLZK+hln7d0mznzDIpfISsg/AgQW0DW3kSInXWhrg== integrity sha512-XqI9cXP2bmQ6MREIqrYBb13KfYFSERsV1+e5jSVWps8dNlLZK+hln7d0mznzDIpfISsg/AgQW0DW3kSInXWhrg==
esbuild@^0.12.8:
version "0.12.15"
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.12.15.tgz#9d99cf39aeb2188265c5983e983e236829f08af0"
integrity sha512-72V4JNd2+48eOVCXx49xoSWHgC3/cCy96e7mbXKY+WOWghN00cCmlGnwVLRhRHorvv0dgCyuMYBZlM2xDM5OQw==
escalade@^3.1.1: escalade@^3.1.1:
version "3.1.1" version "3.1.1"
resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40"
@ -5046,22 +5003,15 @@ is-potential-custom-element-name@^1.0.1:
resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5" resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5"
integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ== integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==
is-reference@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-1.2.1.tgz#8b2dac0b371f4bc994fdeaba9eb542d03002d0b7"
integrity sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==
dependencies:
"@types/estree" "*"
is-regexp@^1.0.0: is-regexp@^1.0.0:
version "1.0.0" version "1.0.0"
resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069" resolved "https://registry.yarnpkg.com/is-regexp/-/is-regexp-1.0.0.tgz#fd2d883545c46bac5a633e7b9a09e87fa2cb5069"
integrity sha1-/S2INUXEa6xaYz57mgnof6LLUGk= integrity sha1-/S2INUXEa6xaYz57mgnof6LLUGk=
is-stream@^2.0.0: is-stream@^2.0.0:
version "2.0.0" version "2.0.1"
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3" resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077"
integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==
is-typedarray@^1.0.0, is-typedarray@~1.0.0: is-typedarray@^1.0.0, is-typedarray@~1.0.0:
version "1.0.0" version "1.0.0"
@ -6998,7 +6948,7 @@ resolve-url@^0.2.1:
resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a"
integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=
resolve@^1.10.0, resolve@^1.12.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.19.0, resolve@^1.20.0: resolve@^1.10.0, resolve@^1.12.0, resolve@^1.14.2, resolve@^1.19.0, resolve@^1.20.0:
version "1.20.0" version "1.20.0"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975"
integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A==
@ -7058,7 +7008,7 @@ rollup-plugin-visualizer@5.5.2:
source-map "^0.7.3" source-map "^0.7.3"
yargs "^16.2.0" yargs "^16.2.0"
rollup@^2.35.1, rollup@^2.38.5, rollup@^2.43.1: rollup@^2.35.1, rollup@^2.38.5, rollup@^2.43.1, rollup@^2.51.2:
version "2.54.0" version "2.54.0"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.54.0.tgz#99ea816e8e9b1c6af3ab957a4e7a8f78dbd87773" resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.54.0.tgz#99ea816e8e9b1c6af3ab957a4e7a8f78dbd87773"
integrity sha512-RHzvstAVwm9A751NxWIbGPFXs3zL4qe/eYg+N7WwGtIXVLy1cK64MiU37+hXeFm1jqipK6DGgMi6Z2hhPuCC3A== integrity sha512-RHzvstAVwm9A751NxWIbGPFXs3zL4qe/eYg+N7WwGtIXVLy1cK64MiU37+hXeFm1jqipK6DGgMi6Z2hhPuCC3A==
@ -8078,15 +8028,17 @@ verte@0.0.12:
dependencies: dependencies:
color-fns "^0.0.10" color-fns "^0.0.10"
vite-plugin-pwa@0.5.6: vite-plugin-pwa@0.8.2:
version "0.5.6" version "0.8.2"
resolved "https://registry.yarnpkg.com/vite-plugin-pwa/-/vite-plugin-pwa-0.5.6.tgz#483267e83ff3a6f5a0adc97a7e06f841a353cf30" resolved "https://registry.yarnpkg.com/vite-plugin-pwa/-/vite-plugin-pwa-0.8.2.tgz#2789a157e2f71faf834d968945efc22eee9ad64a"
integrity sha512-CQjfKdSm0YMRRdMkfdI1RqJyrCjOFUl61+puGfMNAUMM5tex9rjF9gHxqDV5pN/2jFMQoTKkLLQ7HOYM0VbF2w== integrity sha512-DuhFaTTV+a7FczxtKMgBEsaCOifJT5Kpe1KhHL72exb2buPkJ3Na+hoy6akAFDp7T3JuAvH0CAO9kivwbp0MPQ==
dependencies: dependencies:
debug "^4.3.2" debug "^4.3.2"
fast-glob "^3.2.5" fast-glob "^3.2.5"
pretty-bytes "^5.6.0" pretty-bytes "^5.6.0"
workbox-build "^6.1.1" rollup "^2.51.2"
workbox-build "^6.1.5"
workbox-window "^6.1.5"
vite-plugin-vue2@1.7.3: vite-plugin-vue2@1.7.3:
version "1.7.3" version "1.7.3"
@ -8339,7 +8291,7 @@ workbox-broadcast-update@^6.1.5:
dependencies: dependencies:
workbox-core "^6.1.5" workbox-core "^6.1.5"
workbox-build@^6.1.1, workbox-build@^6.1.5: workbox-build@^6.1.5:
version "6.1.5" version "6.1.5"
resolved "https://registry.yarnpkg.com/workbox-build/-/workbox-build-6.1.5.tgz#31c3034a38527f1f7697335c15af9c5593168841" resolved "https://registry.yarnpkg.com/workbox-build/-/workbox-build-6.1.5.tgz#31c3034a38527f1f7697335c15af9c5593168841"
integrity sha512-P+fakR5QFVqJN9l9xHVXtmafga72gh9I+jM3A9HiB/6UNRmOAejXnDgD+RMegOHgQHPwnB44TalMToFaXKWIyA== integrity sha512-P+fakR5QFVqJN9l9xHVXtmafga72gh9I+jM3A9HiB/6UNRmOAejXnDgD+RMegOHgQHPwnB44TalMToFaXKWIyA==