-
Notifications
You must be signed in to change notification settings - Fork 829
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The contents of v3, reconciled with master (#1357)
* The contents of v3, reconciled with master. * Remove a few stray files. * Another extra file. * Two more deletions. * Setting up for stable release * v3.0.0 * Updating CDN and versions * Doc repair for wf (#1358) * Changing doc structure to work with WF * Changing doc structure to work with WF
- Loading branch information
1 parent
5b97922
commit 07bef20
Showing
824 changed files
with
54,462 additions
and
30,097 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.js text eol=lf | ||
*.mjs text eol=lf |
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,14 @@ | ||
only_commits: | ||
files: | ||
- packages/workbox-cli/ | ||
- packages/workbox-build/ | ||
- test/ | ||
- appveyor.yml | ||
- .travis.yml | ||
- package.json | ||
cache: | ||
- node_modules | ||
|
||
install: | ||
- ps: Install-Product node Stable | ||
- npm install -g gulp | ||
- npm install | ||
- gulp lerna-bootstrap-scoped --project="workbox-cli" | ||
- npm install gulpjs/gulp-cli -g | ||
|
||
test_script: | ||
- node --version | ||
- npm --version | ||
- gulp test --project "workbox-cli" | ||
- gulp test | ||
|
||
build: off |
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,5 @@ | ||
{ | ||
"origin": "https://storage.googleapis.com", | ||
"bucketName": "workbox-cdn", | ||
"releasesDir": "releases" | ||
} |
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 @@ | ||
{"latestUrl":"https://storage.googleapis.com/workbox-cdn/releases/3.0.0"} |
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,104 @@ | ||
const functions = require('firebase-functions'); | ||
const express = require('express'); | ||
const exphbs = require('express-handlebars'); | ||
const path = require('path'); | ||
const fs = require('fs-extra'); | ||
|
||
const cdnDetails = require('./cdn-details.json'); | ||
|
||
const workboxModules = [ | ||
'workbox-background-sync', | ||
'workbox-broadcast-cache-update', | ||
'workbox-cache-expiration', | ||
'workbox-cacheable-response', | ||
'workbox-core', | ||
'workbox-google-analytics', | ||
'workbox-precaching', | ||
'workbox-range-requests', | ||
'workbox-routing', | ||
'workbox-strategies', | ||
'workbox-sw', | ||
]; | ||
|
||
const app = express(); | ||
app.engine('hbs', exphbs({defaultLayout: 'main', extname: '.hbs'})); | ||
app.set('view engine', 'hbs'); | ||
|
||
app.get('/', function(req, res) { | ||
let moduleData = workboxModules.map((moduleName) => { | ||
const docPath = path.join( | ||
__dirname, 'views', 'demo', `${moduleName}.hbs` | ||
); | ||
|
||
let exists = false; | ||
try { | ||
fs.accessSync(docPath); | ||
exists = true; | ||
} catch (err) { | ||
// NOOP | ||
} | ||
|
||
return { | ||
name: moduleName, | ||
hasDemo: exists, | ||
}; | ||
}); | ||
|
||
res.render('home', { | ||
title: 'Workbox V3', | ||
modules: moduleData, | ||
}); | ||
}); | ||
|
||
app.get('/api/is-response-cacheable', | ||
function(req, res) { | ||
if (req.headers['x-is-cacheable']) { | ||
const value = req.headers['x-is-cacheable']; | ||
res.set('X-Is-Cacheable', value); | ||
res.send(`This response has 'X-Is-Cacheable' header set to '${value}'`); | ||
} else { | ||
res.send(`This response has no 'X-Is-Cacheable' header`); | ||
} | ||
} | ||
); | ||
|
||
app.get('/demo/:moduleName', function(req, res) { | ||
res.render(`demo/${req.params.moduleName}`, { | ||
title: `${req.params.moduleName} Demo`, | ||
}); | ||
}); | ||
|
||
app.get('/demo/:moduleName/:swfile', function(req, res, next) { | ||
const swTemplate = path.basename( | ||
req.params.swfile, | ||
path.extname(req.params.swfile) | ||
); | ||
|
||
let cdnUrl = cdnDetails.latestUrl; | ||
let extraConfig = ''; | ||
if (process.env.WORKBOX_DEMO_ENV === 'local') { | ||
cdnUrl = `/local-builds`; | ||
extraConfig = `, | ||
modulePathPrefix: '${cdnUrl}'`; | ||
} | ||
|
||
const swImport = `importScripts('${cdnUrl}/workbox-sw.js'); | ||
workbox.setConfig({ | ||
debug: true${extraConfig} | ||
}); | ||
`; | ||
|
||
res.header('Content-Type', 'application/javascript'); | ||
res.header('Cache-Control', 'no-cache'); | ||
res.render(`demo/${req.params.moduleName}/${swTemplate}`, { | ||
title: `${req.params.moduleName} Demo`, | ||
CDN_URL: cdnUrl, | ||
WORKBOX_SW_IMPORT: swImport, | ||
layout: false, | ||
}); | ||
}); | ||
|
||
module.exports = { | ||
app: functions.https.onRequest(app), | ||
}; |
Oops, something went wrong.