-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from tohjustin/development-v1.1.0
v1.1.0 Release
- Loading branch information
Showing
13 changed files
with
208 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/* eslint-disable no-undef */ | ||
const CACHE_NAME = 'pomodori-pwa' | ||
|
||
const urlsToCache = [ | ||
'/', | ||
'/sw.js', | ||
'/index.html', | ||
'/manifest.json', | ||
'/static/alarm.mp3', | ||
'/static/logo.png', | ||
'https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons', | ||
'https://fonts.gstatic.com/s/materialicons/v19/2fcrYFNaTjcS6g4U3t-Y5UEw0lE80llgEseQY3FEmqw.woff2' | ||
] | ||
|
||
let generatePrecacheList = (assetJson, urlArray) => { | ||
return urlArray.concat(Object.keys(assetJson).map(function (val) { return assetJson[val] })) | ||
} | ||
|
||
self.addEventListener('install', event => { | ||
console.log('Installed') | ||
|
||
event.waitUntil( | ||
caches.open(CACHE_NAME) | ||
.then(cache => | ||
fetch('asset-manifest.json') | ||
.then(response => response.json()) | ||
.then(assets => { | ||
cache.addAll(generatePrecacheList(assets, urlsToCache)) | ||
// let listOfItemsToCache = _.chain(assets).values().join(urlsToCache).uniq() | ||
// cache.addAll(listOfItemsToCache) | ||
// cache.addAll([ | ||
// '/', | ||
// '/sw.js', | ||
// '/index.html', | ||
// '/manifest.json', | ||
// '/static/alarm.mp3', | ||
// '/static/logo.png', | ||
// 'https://fonts.googleapis.com/css?family=Roboto:300,400,500,700|Material+Icons' | ||
// ]) | ||
}) | ||
.catch(response => { | ||
console.log('Fail to fetch asset-manifest.json!') | ||
console.log(response) | ||
}) | ||
).then(() => self.skipWaiting()) | ||
) | ||
}) | ||
|
||
self.addEventListener('activate', event => { | ||
event.waitUntil(self.clients.claim()) | ||
}) | ||
|
||
self.addEventListener('fetch', event => { | ||
// Don't intercept requests to google analytics | ||
if (event.request.url.startsWith('https://www.google-analytics.com/')) { | ||
return fetch(event.request) | ||
} else { | ||
// Return cached content if there's a cache hit | ||
event.respondWith( | ||
caches.open(CACHE_NAME) | ||
.then(cache => cacheableRequestFailingToCacheStrategy({ event, cache })) | ||
) | ||
} | ||
}) | ||
|
||
let cacheableRequestFailingToCacheStrategy = ({ event, cache }) => { | ||
return fetch(event.request) | ||
.then(throwOnError) // do not cache errors | ||
.then(response => { | ||
cache.put(event.request, response.clone()) | ||
return response | ||
}) | ||
.catch(() => cache.match(event.request)) | ||
} | ||
|
||
// Prevent cache being polluted with failure responses | ||
let throwOnError = response => { | ||
if (response.status < 200 || response.status >= 300) { | ||
throw new Error(response.statusText) | ||
} | ||
return response | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -207,6 +207,16 @@ assertion-error@^1.0.1: | |
version "1.0.2" | ||
resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.0.2.tgz#13ca515d86206da0bac66e834dd397d87581094c" | ||
|
||
assets-webpack-plugin@^3.5.0: | ||
version "3.5.0" | ||
resolved "https://registry.yarnpkg.com/assets-webpack-plugin/-/assets-webpack-plugin-3.5.0.tgz#933b16bf679c7510dd3475e4df9ba495d9dc0368" | ||
dependencies: | ||
camelcase "^1.2.1" | ||
escape-string-regexp "^1.0.3" | ||
lodash.assign "^3.2.0" | ||
lodash.merge "^3.3.2" | ||
mkdirp "^0.5.1" | ||
|
||
ast-traverse@~0.1.1: | ||
version "0.1.1" | ||
resolved "https://registry.yarnpkg.com/ast-traverse/-/ast-traverse-0.1.1.tgz#69cf2b8386f19dcda1bb1e05d68fe359d8897de6" | ||
|
@@ -894,6 +904,10 @@ block-stream@*: | |
dependencies: | ||
inherits "~2.0.0" | ||
|
||
bluebird@^2.10.2: | ||
version "2.11.0" | ||
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-2.11.0.tgz#534b9033c022c9579c56ba3b3e5a5caafbb650e1" | ||
|
||
bluebird@^3.0.5, bluebird@^3.1.1, bluebird@^3.3.0, bluebird@^3.4.6: | ||
version "3.4.6" | ||
resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.4.6.tgz#01da8d821d87813d158967e743d5fe6c62cf8c0f" | ||
|
@@ -1362,6 +1376,19 @@ [email protected]: | |
version "0.3.1" | ||
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb" | ||
|
||
copy-webpack-plugin@^4.0.1: | ||
version "4.0.1" | ||
resolved "https://registry.yarnpkg.com/copy-webpack-plugin/-/copy-webpack-plugin-4.0.1.tgz#9728e383b94316050d0c7463958f2b85c0aa8200" | ||
dependencies: | ||
bluebird "^2.10.2" | ||
fs-extra "^0.26.4" | ||
glob "^6.0.4" | ||
is-glob "^3.1.0" | ||
loader-utils "^0.2.15" | ||
lodash "^4.3.0" | ||
minimatch "^3.0.0" | ||
node-dir "^0.1.10" | ||
|
||
core-js@^2.2.0, core-js@^2.4.0: | ||
version "2.4.1" | ||
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e" | ||
|
@@ -1867,7 +1894,7 @@ [email protected]: | |
version "1.0.2" | ||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.2.tgz#4dbc2fe674e71949caf3fb2695ce7f2dc1d9a8d1" | ||
|
||
[email protected], escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: | ||
[email protected], escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.3, escape-string-regexp@^1.0.5: | ||
version "1.0.5" | ||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" | ||
|
||
|
@@ -2250,6 +2277,26 @@ [email protected]: | |
version "0.3.0" | ||
resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.3.0.tgz#651f838e22424e7566de161d8358caa199f83d4f" | ||
|
||
fs-extra@^0.26.4: | ||
version "0.26.7" | ||
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.26.7.tgz#9ae1fdd94897798edab76d0918cf42d0c3184fa9" | ||
dependencies: | ||
graceful-fs "^4.1.2" | ||
jsonfile "^2.1.0" | ||
klaw "^1.0.0" | ||
path-is-absolute "^1.0.0" | ||
rimraf "^2.2.8" | ||
|
||
fs-extra@^0.30.0: | ||
version "0.30.0" | ||
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-0.30.0.tgz#f233ffcc08d4da7d432daa449776989db1df93f0" | ||
dependencies: | ||
graceful-fs "^4.1.2" | ||
jsonfile "^2.1.0" | ||
klaw "^1.0.0" | ||
path-is-absolute "^1.0.0" | ||
rimraf "^2.2.8" | ||
|
||
fs-extra@~1.0.0: | ||
version "1.0.0" | ||
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-1.0.0.tgz#cd3ce5f7e7cb6145883fcae3191e9877f8587950" | ||
|
@@ -2408,6 +2455,16 @@ glob@^5.0.15: | |
once "^1.3.0" | ||
path-is-absolute "^1.0.0" | ||
|
||
glob@^6.0.4: | ||
version "6.0.4" | ||
resolved "https://registry.yarnpkg.com/glob/-/glob-6.0.4.tgz#0f08860f6a155127b2fadd4f9ce24b1aab6e4d22" | ||
dependencies: | ||
inflight "^1.0.4" | ||
inherits "2" | ||
minimatch "2 || 3" | ||
once "^1.3.0" | ||
path-is-absolute "^1.0.0" | ||
|
||
glob@^7.0.0, glob@^7.0.3, glob@^7.0.5, glob@~7.1.1: | ||
version "7.1.1" | ||
resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" | ||
|
@@ -3187,6 +3244,10 @@ kew@~0.7.0: | |
version "0.7.0" | ||
resolved "https://registry.yarnpkg.com/kew/-/kew-0.7.0.tgz#79d93d2d33363d6fdd2970b335d9141ad591d79b" | ||
|
||
keycode@^2.1.8: | ||
version "2.1.8" | ||
resolved "https://registry.yarnpkg.com/keycode/-/keycode-2.1.8.tgz#94d2b7098215eff0e8f9a8931d5a59076c4532fb" | ||
|
||
kind-of@^3.0.2: | ||
version "3.1.0" | ||
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.1.0.tgz#475d698a5e49ff5e53d14e3e732429dc8bf4cf47" | ||
|
@@ -3353,6 +3414,14 @@ lodash._root@^3.0.0: | |
version "3.0.1" | ||
resolved "https://registry.yarnpkg.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692" | ||
|
||
lodash.assign@^3.2.0: | ||
version "3.2.0" | ||
resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-3.2.0.tgz#3ce9f0234b4b2223e296b8fa0ac1fee8ebca64fa" | ||
dependencies: | ||
lodash._baseassign "^3.0.0" | ||
lodash._createassigner "^3.0.0" | ||
lodash.keys "^3.0.0" | ||
|
||
lodash.assign@^4.0.3, lodash.assign@^4.0.6, lodash.assign@^4.2.0: | ||
version "4.2.0" | ||
resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" | ||
|
@@ -3494,14 +3563,14 @@ lodash.words@^3.0.0: | |
dependencies: | ||
lodash._root "^3.0.0" | ||
|
||
"lodash@>=3.5 <5", lodash@^4.0.0, lodash@^4.0.1, lodash@^4.14.0, lodash@^4.16.4, lodash@^4.17.2, lodash@^4.2.0, lodash@^4.3.0, lodash@^4.5.0: | ||
version "4.17.2" | ||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.2.tgz#34a3055babe04ce42467b607d700072c7ff6bf42" | ||
|
||
lodash@^3.8.0: | ||
version "3.10.1" | ||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6" | ||
|
||
lodash@^4.0.0, lodash@^4.0.1, lodash@^4.14.0, lodash@^4.16.4, lodash@^4.17.2, lodash@^4.2.0, lodash@^4.3.0, lodash@^4.5.0: | ||
version "4.17.2" | ||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.2.tgz#34a3055babe04ce42467b607d700072c7ff6bf42" | ||
|
||
lodash@~4.16.4: | ||
version "4.16.6" | ||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.16.6.tgz#d22c9ac660288f3843e16ba7d2b5d06cca27d777" | ||
|
@@ -3809,6 +3878,12 @@ no-case@^2.2.0: | |
dependencies: | ||
lower-case "^1.1.1" | ||
|
||
node-dir@^0.1.10: | ||
version "0.1.16" | ||
resolved "https://registry.yarnpkg.com/node-dir/-/node-dir-0.1.16.tgz#d2ef583aa50b90d93db8cdd26fcea58353957fe4" | ||
dependencies: | ||
minimatch "^3.0.2" | ||
|
||
node-gyp@^3.3.1: | ||
version "3.4.0" | ||
resolved "https://registry.yarnpkg.com/node-gyp/-/node-gyp-3.4.0.tgz#dda558393b3ecbbe24c9e6b8703c71194c63fa36" | ||
|
@@ -5692,6 +5767,13 @@ webpack-hot-middleware@^2.12.2: | |
querystring "^0.2.0" | ||
strip-ansi "^3.0.0" | ||
|
||
webpack-manifest-plugin@^1.1.0: | ||
version "1.1.0" | ||
resolved "https://registry.yarnpkg.com/webpack-manifest-plugin/-/webpack-manifest-plugin-1.1.0.tgz#6b6c718aade8a2537995784b46bd2e9836057caa" | ||
dependencies: | ||
fs-extra "^0.30.0" | ||
lodash ">=3.5 <5" | ||
|
||
webpack-merge@^0.14.1: | ||
version "0.14.1" | ||
resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-0.14.1.tgz#d6bfe6d9360a024e1e7f8e6383ae735f1737cd23" | ||
|