diff --git a/Docs/Development_deployment.md b/Docs/Development_deployment.md index 3f5abe7f4..09313fd7d 100644 --- a/Docs/Development_deployment.md +++ b/Docs/Development_deployment.md @@ -55,17 +55,24 @@ Raw installation To use the WSL in Visual Studio Code: -0. Make sure you have installed the [Remote - WSL]() extension and it's dependencies. -1. Open a remote WSL window using the button in the bottom left. -2. Make a fork and clone the repository. -3. Install `npm` using `sudo apt install npm`. -4. Run `npm run init` and generate some additional dependencies and generated files. Note that it'll install the +1. Install a WSL Distribution (e.g. Ubuntu) +2. Install basic dependencies `sudo apt install make g++` +3. Install NVM `wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash` +4. Use NVM to install node 16.x: `nvm install 16.9.1` +5. Activate the node version: `nvm use 16.9.1` +6. Install `npm` using `sudo apt install npm`. +7. Install the [Remote - WSL](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) extension and it's dependencies. +8. Open a remote WSL window using the button in the bottom left. +9. Make a fork and clone the repository. +10. Run `npm run init` and generate some additional dependencies and generated files. Note that it'll install the dependencies too -5. Run `npm run start` to host a local testversion at http://localhost:1234/index.html -6. By default, a landing page with available themes is served. In order to load a single theme, use `layout=themename` +11. Run `npm run start` to host a local testversion at http://localhost:1234/index.html +12. By default, a landing page with available themes is served. In order to load a single theme, use `layout=themename` or `userlayout=true#` as [Query parameter](URL_Parameters.md). Note that the shorter URLs ( e.g. `bookcases.html`, `aed.html`, ...) _don't_ exist on the development version. +To use WSL without Visual Studio Code you can replace steps 7 and 8 by opening up a WSL terminal + Automatic deployment -------------------- diff --git a/Docs/Making_Your_Own_Theme.md b/Docs/Making_Your_Own_Theme.md index 80c27a7f4..b7c2e349c 100644 --- a/Docs/Making_Your_Own_Theme.md +++ b/Docs/Making_Your_Own_Theme.md @@ -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. diff --git a/package.json b/package.json index 05c73c9a0..58c8dabfa 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/service-worker.ts b/service-worker.ts index 29b69697e..56e006a4e 100644 --- a/service-worker.ts +++ b/service-worker.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