From 89cfcc823b4d8179f9fd73d180dc2d9d4c89196b Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Sat, 1 Dec 2018 16:44:59 -0800 Subject: [PATCH 1/3] use service-worker-index.html in commented code --- src/service-worker.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/service-worker.js b/src/service-worker.js index 0851aae..a34fef8 100644 --- a/src/service-worker.js +++ b/src/service-worker.js @@ -48,12 +48,12 @@ self.addEventListener('fetch', event => { return; } - // for pages, you might want to serve a shell `index.html` file, + // for pages, you might want to serve a shell `service-worker-index.html` file, // which Sapper has generated for you. It's not right for every // app, but if it's right for yours then uncomment this section /* if (url.origin === self.origin && routes.find(route => route.pattern.test(url.pathname))) { - event.respondWith(caches.match('/index.html')); + event.respondWith(caches.match('/service-worker-index.html')); return; } */ From b888f6bf2434af6fd7fec1ae258a91173474cd85 Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Sun, 3 Feb 2019 09:29:55 -0500 Subject: [PATCH 2/3] spotted the flaw in my plan - it keeps kicking me back to master --- _template/build.sh | 28 ++++++---------------------- _template/create-branches.sh | 24 ++++++++++++++---------- 2 files changed, 20 insertions(+), 32 deletions(-) diff --git a/_template/build.sh b/_template/build.sh index a69d58c..70cac47 100755 --- a/_template/build.sh +++ b/_template/build.sh @@ -6,28 +6,12 @@ cd "$(dirname $0)"/.. echo "$SSH_KEY" > ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa -# make sure we're on master, and delete the rollup and webpack branches -git symbolic-ref HEAD refs/heads/master -git reset --hard -git branch -D rollup webpack +# branch names +DEFAULT=master +ROLLUP=rollup +WEBPACK=webpack -# create the rollup branch off the current master -git checkout -b rollup -node _template/build-pkg.js rollup -git rm -r --cached .travis.yml _template package_template.json webpack.config.js -git add package.json -git commit -m 'Sapper template for Rollup' -git symbolic-ref HEAD refs/heads/master -git reset --hard - -# create the webpack branch off the current master -git checkout -b webpack -node _template/build-pkg.js webpack -git rm -r --cached .travis.yml _template package_template.json rollup.config.js -git add package.json -git commit -m 'Sapper template for webpack' -git symbolic-ref HEAD refs/heads/master -git reset --hard +./create-branches.sh $DEFAULT $ROLLUP $WEBPACK # force push rollup and webpack branches -git push git@github.com:sveltejs/sapper-template.git rollup webpack -f +git push git@github.com:sveltejs/sapper-template.git $ROLLUP $WEBPACK -f diff --git a/_template/create-branches.sh b/_template/create-branches.sh index 45c0725..1d0422d 100755 --- a/_template/create-branches.sh +++ b/_template/create-branches.sh @@ -1,25 +1,29 @@ #!/bin/bash cd "$(dirname $0)"/.. -# make sure we're on master, and delete the rollup-v3 and webpack-v3 branches -git symbolic-ref HEAD refs/heads/master -git reset --hard -git branch -D rollup-v3 webpack-v3 +DEFAULT=$1 +ROLLUP=$2 +WEBPACK=$3 -# create the rollup-v3 branch off the current master -git checkout -b rollup-v3 +# make sure we're on master, and delete the $ROLLUP and $WEBPACK branches +git symbolic-ref HEAD "refs/heads/$DEFAULT" +git reset --hard +git branch -D $ROLLUP $WEBPACK + +# create the $ROLLUP branch off the current master +git checkout -b $ROLLUP node _template/build-pkg.js rollup git rm -r --cached .travis.yml _template package_template.json webpack.config.js git add package.json git commit -m 'Sapper template for Rollup' -git symbolic-ref HEAD refs/heads/master +git symbolic-ref HEAD "refs/heads/$DEFAULT" git reset --hard -# create the webpack-v3 branch off the current master -git checkout -b webpack-v3 +# create the $WEBPACK branch off the current master +git checkout -b $WEBPACK node _template/build-pkg.js webpack git rm -r --cached .travis.yml _template package_template.json rollup.config.js git add package.json git commit -m 'Sapper template for webpack' -git symbolic-ref HEAD refs/heads/master +git symbolic-ref HEAD "refs/heads/$DEFAULT" git reset --hard \ No newline at end of file From 9beeb742c6c9ecea8e2176155fa78745a82fa1ef Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Fri, 8 Feb 2019 16:26:29 -0500 Subject: [PATCH 3/3] add default branches so it doesnt go haywire and self-destruct (oops) --- _template/create-branches.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/_template/create-branches.sh b/_template/create-branches.sh index 1d0422d..1128578 100755 --- a/_template/create-branches.sh +++ b/_template/create-branches.sh @@ -1,9 +1,11 @@ #!/bin/bash cd "$(dirname $0)"/.. -DEFAULT=$1 -ROLLUP=$2 -WEBPACK=$3 +DEFAULT=${1:-master} +ROLLUP=${2:-rollup} +WEBPACK=${3:-webpack} + +echo "Creating $ROLLUP and $WEBPACK branches from $DEFAULT" # make sure we're on master, and delete the $ROLLUP and $WEBPACK branches git symbolic-ref HEAD "refs/heads/$DEFAULT"