sw-helpers 0,1 eslint travis-ci npm

Service Worker helper libraries

Build Status

Service Worker Helpers

A collection of libraries that help enhance your existing service worker by providing commonly-needed functionality.

A monorepo approach is used to manage multiple helper libraries, each of which is versioned and published to npm independently.

The Libraries

sw-appcache-behavior

A service worker implementation of the behavior defined in a page's App Cache manifest.

Install: npm install --save-dev sw-appcache-behavior

Learn More: AboutDemoAPI

sw-offline-google-analytics

A service worker helper library to retry offline Google Analytics requests when a connection is available.

Install: npm install --save-dev sw-offline-google-analytics

Learn More: AboutDemoAPI

Development

Existing Build Tasks

Tasks are run via gulp, and assume that you have a globally installed gulp binary (npm install -g gulp) as well as a locally installed set of node_module dependencies (npm install from within the top-level directory).

When running a task, an optional --project=project-name parameter can be used. For example, gulp build:watch --project=sw-appcache-behavior. By default the task will be run against all projects.

New Projects

New projects should be created as sub-directories of projects, following the basic layout of the existing projects. It's recommended that each library adopts the sw- prefix, for consistency.

Always include the following:

  • src/ - raw source files, with JSDoc-formatted comments.
  • build.js - Should export a function that performs all the steps needed to produce a ready-to-use library in local build/ directory.
  • test/*.js - One or more Mocha test suites.
  • package.json - The npm metadata for the library. Each library is versioned independently.

A demo/ directory is optional but encouraged. The project's README.md file will be automatically generated based on a template using the metadata found in the JSDoc comments.

External Contributions

Please read the guide to contributing prior to filing any pull requests.

License

Copyright 2016 Google, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Related Repositories

sw-precache

sw-precache

A node module to generate service worker code that will precache specific resour ...

sw-toolbox

sw-toolbox

A collection of service worker tools for offlining runtime requests ...

awesome-webpack

awesome-webpack

A curated list of awesome Webpack resources, libraries and tools ...

awesome-service-workers

awesome-service-workers

:nut_and_bolt: A collection of awesome resources for learning Service Workers ...

awesome-webpack

awesome-webpack

A curated list of awesome Webpack resources, libraries and tools ...


Top Contributors

jeffposnick addyosmani philipwalton

Dependencies

package version
idb ^2.0.0
mkdirp ^0.5.1
update-notifier ^2.1.0
dev babel-preset-babili 0.0.12
chai ^4.0.2
chromedriver ^2.30.1
clear-require ^2.0.0
cookie-parser ^1.4.3
depcheck ^0.6.7
error-stack-parser ^2.0.1
eslint-config-google ^0.9.1
express ^4.14.0
fs-extra ^3.0.1
geckodriver 1.6.1
glob ^7.1.0
gulp ^3.9.1
gulp-compile-handlebars ^0.6.1
gulp-eslint ^4.0.0
gulp-insert ^0.5.0
gulp-rename ^1.2.2
gulp-spawn-mocha ^3.1.0
handlebars ^4.0.6
jsdoc-strip-async-await ^0.1.0
lerna 2.0.0-rc.5
minimist ^1.2.0
mockdate ^2.0.1
path-to-regexp ^1.6.0
promisify-node ^0.4.0
proxyquire ^1.7.10
rollup ^0.41.6
rollup-plugin-babel ^2.6.1
rollup-plugin-commonjs ^8.0.2
rollup-plugin-multi-entry ^2.0.1
rollup-plugin-node-resolve ^3.0.0
rollup-plugin-replace ^1.1.1
run-sequence ^1.2.2
selenium-assistant ^5.1.0
serve-index ^1.8.0
serve-static ^1.11.1
sinon ^2.2.0
sw-testing-helpers ^1.0.2
tmp 0.0.31
uppercamelcase ^3.0.0
webpack ^2.6.0

Releases

-   sw-offline-google-an zip tar
-   sw-offline-google-an zip tar
-   sw-offline-analytics zip tar