Fix link in docs, add 'localhost' and gitpod to non-caching version of serviceworkers
This commit is contained in:
parent
536840ba1c
commit
13579e6c97
3 changed files with 4 additions and 4 deletions
|
@ -322,7 +322,7 @@ Every field is documented in the source code itself - you can find them here:
|
|||
|
||||
- [The top level `LayoutConfig`](https://github.com/pietervdvn/MapComplete/blob/master/Models/ThemeConfig/Json/LayoutConfigJson.ts)
|
||||
- [A layer object `LayerConfig`](https://github.com/pietervdvn/MapComplete/blob/master/Models/ThemeConfig/Json/LayerConfigJson.ts)
|
||||
- [The `TagRendering`](https://github.com/pietervdvn/MapComplete/blob/master/Models/ThemeConfig/Json/TagRenderingConfigJson.ts)
|
||||
- [The `TagRendering`](https://github.com/pietervdvn/MapComplete/blob/master/Models/ThemeConfig/Json/QuestionableTagRenderingConfigJson.ts)
|
||||
- At last, the exact semantics of tags are documented [here](Tags_format.md)
|
||||
|
||||
A JSON schema file is available in `Docs/Schemas` - use `LayoutConfig.schema.json` to validate a theme file.
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
"generate:service-worker": "tsc service-worker.ts && git_hash=$(git rev-parse HEAD) && sed -i \"s/GITHUB-COMMIT/$git_hash/\" service-worker.js",
|
||||
"optimize-images": "cd assets/generated/ && find -name '*.png' -exec optipng '{}' \\; && echo 'PNGs are optimized'",
|
||||
"reset:layeroverview": "echo {\\\"layers\\\":[], \\\"themes\\\":[]} > ./assets/generated/known_layers_and_themes.json && echo {\\\"layers\\\": []} > ./assets/generated/known_layers.json",
|
||||
"generate": "mkdir -p ./assets/generated ; npm run reset:layeroverview ; npm run generate:images ; npm run generate:charging-stations ; npm run generate:translations ; npm run generate:licenses ; npm run generate:layeroverview ; npm run generate:service-worker",
|
||||
"generate": "mkdir -p ./assets/generated; npm run reset:layeroverview; npm run generate:images; npm run generate:charging-stations; npm run generate:translations; npm run generate:licenses; npm run generate:layeroverview; npm run generate:service-worker",
|
||||
"generate:charging-stations": "cd ./assets/layers/charging_station && ts-node csvToJson.ts && cd -",
|
||||
"prepare-deploy": "npm run generate:service-worker && ./scripts/build.sh",
|
||||
"gittag": "ts-node scripts/printVersion.ts | bash",
|
||||
|
@ -48,7 +48,7 @@
|
|||
"script": "ts-node",
|
||||
"weblate-merge": "./scripts/automerge-translations.sh",
|
||||
"weblate-add-upstream": "git remote add weblate-github git@github.com:weblate/MapComplete.git",
|
||||
"weblate-fix": "git remote update weblate-github ; git merge weblate-github/weblate-mapcomplete-core; git merge weblate-github/weblate-mapcomplete-layers ; git merge weblate-github/weblate-mapcomplete-layer-translations",
|
||||
"weblate-fix": "git remote update weblate-github; git merge weblate-github/weblate-mapcomplete-core; git merge weblate-github/weblate-mapcomplete-layers; git merge weblate-github/weblate-mapcomplete-layer-translations",
|
||||
"weblate-fix-heavy": "git remote rm weblate-layers; git remote add weblate-layers https://hosted.weblate.org/git/mapcomplete/layers/; git remote update weblate-layers; git merge weblate-layers/master",
|
||||
"housekeeping": "npm run generate && npm run generate:docs && npm run generate:contributor-list && git add Docs/* && git commit assets/ langs/ Docs/ -m 'Housekeeping...'",
|
||||
"parseSchools": "ts-node scripts/schools/amendSchoolData.ts",
|
||||
|
|
|
@ -71,7 +71,7 @@ self.addEventListener('fetch',
|
|||
event.respondWith(new Response(JSON.stringify({"service-worker-version": version})));
|
||||
return
|
||||
}
|
||||
const shouldBeCached = origin.host === requestUrl.host && origin.host !== "127.0.0.1:1234"
|
||||
const shouldBeCached = origin.host === requestUrl.host && origin.host !== "127.0.0.1:1234" && origin.host !== "localhost" && !origin.host.endsWith(".gitpod.io")
|
||||
if (!shouldBeCached) {
|
||||
console.log("Not intercepting ", requestUrl.toString(), origin.host, requestUrl.host)
|
||||
// We return _without_ calling event.respondWith, which signals the browser that it'll have to handle it himself
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue