Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jarena3 committed Feb 14, 2022
1 parent 7ed4a04 commit f84e0bd
Show file tree
Hide file tree
Showing 27 changed files with 335 additions and 39 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# COMP/CON Changelog
## [2.2.36a] (2021-12-10)
* **Global** Re-integrate serviceworker, which will re-enable C/C's use as a PWA [#1851](https://github.com/massif-press/compcon/issues/1851), [#1853](https://github.com/massif-press/compcon/issues/1853)

## [2.2.36] (2021-12-10)

Expand Down
18 changes: 0 additions & 18 deletions amplify/backend/function/ccSignupChallenge/src/index.js

This file was deleted.

File renamed without changes.
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "compcon",
"version": "2.2.36",
"description": "A digital toolkit for the LANCER TTRPG",
"license": "GPL-3.0-or-later",
"author": "Massif Press",
"scripts": {
"serve": "vue-cli-service serve",
Expand Down Expand Up @@ -41,6 +40,7 @@
"devDependencies": {
"@types/lodash": "^4.14.175",
"@vue/cli-plugin-babel": "~4.5.0",
"@vue/cli-plugin-pwa": "~4.5.0",
"@vue/cli-plugin-router": "~4.5.0",
"@vue/cli-plugin-typescript": "~4.5.0",
"@vue/cli-plugin-vuex": "~4.5.0",
Expand All @@ -53,12 +53,13 @@
"vue-cli-plugin-svg": "~0.2.1",
"vue-template-compiler": "^2.6.11"
},
"resolutions": {
"prosemirror-model": "1.8.2"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not dead"
]
}
],
"license": "GPL-3.0-or-later",
"resolutions": {
"prosemirror-model": "1.8.2"
}
}
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
Disallow:
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import 'vuetify/dist/vuetify.min.css'
import Vuetify from 'vuetify/lib'
import lancerData from 'lancer-data'

// import './registerServiceWorker'
import './registerServiceWorker'

import theme from './ui/theme'
import themes from '@/ui/style/themes'
Expand All @@ -36,7 +36,7 @@ Amplify.configure(aws_exports)

Object.defineProperty(Vue.prototype, '$_', { value: _ })

Vue.prototype.$appVersion = process.env.VUE_APP_VERSION_TAG
Vue.prototype.$appVersion = process.env.VUE_APP_VERSION_TAG || 'dev'
Vue.prototype.$lancerVersion = `${lancerData.info.version}`

// Preload theme
Expand Down
File renamed without changes.
File renamed without changes.
59 changes: 47 additions & 12 deletions src/registerServiceWorker.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,47 @@
// if ('serviceWorker' in navigator && process.env.VUE_APP_NODE_ENV === 'production') {
// window.addEventListener('load', () => {
// navigator.serviceWorker
// .register('/sw.js')
// .then(registration => {
// console.log('SW registered: ', registration)
// })
// .catch(registrationError => {
// console.log('SW registration failed: ', registrationError)
// })
// })
// }
/* eslint-disable no-console */

import { register } from 'register-service-worker'

if (process.env.VUE_APP_NODE_ENV === 'production') {
register(`${process.env.BASE_URL}service-worker.js`, {
ready() {
console.log(process.env.BASE_URL)
console.log(
'App is being served from cache by a service worker.\n' +
'For more details, visit https://goo.gl/AFskqB'
)
},
registered() {
console.info('Service worker has been registered.')
},
cached() {
console.info('Content has been cached for offline use.')
},
updatefound() {
console.info('New content is downloading.')
},
updated() {
console.info('New content is available; please refresh.')
},
offline() {
console.info('No internet connection found. App is running in offline mode.')
},
error(error) {
console.error('Error during service worker registration:', error)
}
})


if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker
.register('/sw.js')
.then(registration => {
console.log('SW registered: ', registration)
})
.catch(registrationError => {
console.log('SW registration failed: ', registrationError)
})
})
}
}
File renamed without changes.
9 changes: 9 additions & 0 deletions vue.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
const path = require('path')

module.exports = {
pwa: {
themeColor: '#991E2A',
iconPaths: {
favicon16: 'img/icons/favicon-16x16.png',
favicon32: 'img/icons/favicon-32x32.png',
appleTouchIcon: 'img/icons/apple-touch-iconpng',
msTileImage: 'img/icons/192x192.png'
}
},
lintOnSave: false,
transpileDependencies: ['vuetify'],
chainWebpack: config => {
Expand Down
Loading

0 comments on commit f84e0bd

Please sign in to comment.