Chore: housekeeping

This commit is contained in:
Pieter Vander Vennet 2024-07-21 12:30:29 +02:00
parent 4add2d1aff
commit adb2aee0f2
4 changed files with 30 additions and 39 deletions

16
package-lock.json generated
View file

@ -1,12 +1,12 @@
{ {
"name": "mapcomplete", "name": "mapcomplete",
"version": "0.44.4", "version": "0.44.11",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "mapcomplete", "name": "mapcomplete",
"version": "0.44.4", "version": "0.44.11",
"license": "GPL-3.0-or-later", "license": "GPL-3.0-or-later",
"dependencies": { "dependencies": {
"@comunica/core": "^3.0.1", "@comunica/core": "^3.0.1",
@ -7893,9 +7893,9 @@
} }
}, },
"node_modules/caniuse-lite": { "node_modules/caniuse-lite": {
"version": "1.0.30001640", "version": "1.0.30001642",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001640.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001642.tgz",
"integrity": "sha512-lA4VMpW0PSUrFnkmVuEKBUovSWKhj7puyCg8StBChgu298N1AtuF1sKWEvfDuimSEDbhlb/KqPKC3fs1HbuQUA==", "integrity": "sha512-3XQ0DoRgLijXJErLSl+bLnJ+Et4KqV1PY6JJBGAFlsNsz31zeAIncyeZfLCabHK/jtSh+671RM9YMldxjUPZtA==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {
@ -25250,9 +25250,9 @@
"version": "2.0.1" "version": "2.0.1"
}, },
"caniuse-lite": { "caniuse-lite": {
"version": "1.0.30001640", "version": "1.0.30001642",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001640.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001642.tgz",
"integrity": "sha512-lA4VMpW0PSUrFnkmVuEKBUovSWKhj7puyCg8StBChgu298N1AtuF1sKWEvfDuimSEDbhlb/KqPKC3fs1HbuQUA==", "integrity": "sha512-3XQ0DoRgLijXJErLSl+bLnJ+Et4KqV1PY6JJBGAFlsNsz31zeAIncyeZfLCabHK/jtSh+671RM9YMldxjUPZtA==",
"dev": true "dev": true
}, },
"canonicalize": { "canonicalize": {

View file

@ -35,7 +35,6 @@
"summary_server": "https://cache.mapcomplete.org/", "summary_server": "https://cache.mapcomplete.org/",
"geoip_server": "https://ipinfo.mapcomplete.org/", "geoip_server": "https://ipinfo.mapcomplete.org/",
"error_server": "https://report.mapcomplete.org/report", "error_server": "https://report.mapcomplete.org/report",
"api_keys": { "api_keys": {
"#": "Various API-keys for various services. Feel free to reuse those in another MapComplete-hosted version", "#": "Various API-keys for various services. Feel free to reuse those in another MapComplete-hosted version",
"imgur": "7070e7167f0a25a", "imgur": "7070e7167f0a25a",
@ -62,7 +61,6 @@
} }
}, },
"scripts": { "scripts": {
"init": "npm ci && npm run prep:layeroverview && npm run generate && npm run download:editor-layer-index && npm run generate:layouts && npm run clean && npm run weblate:add-upstream", "init": "npm ci && npm run prep:layeroverview && npm run generate && npm run download:editor-layer-index && npm run generate:layouts && npm run clean && npm run weblate:add-upstream",
"start": "npm run generate:layeroverview && npm run strt", "start": "npm run generate:layeroverview && npm run strt",
"#strt:https": "Start in HTTPS mode. Makes a few things a bit harder, but allows to debug on Android with logging in", "#strt:https": "Start in HTTPS mode. Makes a few things a bit harder, but allows to debug on Android with logging in",
@ -72,7 +70,6 @@
"build:single": "./scripts/single_build.sh", "build:single": "./scripts/single_build.sh",
"build:dbscript": "vite-node ./scripts/osm2pgsql/generateBuildDbScript.ts", "build:dbscript": "vite-node ./scripts/osm2pgsql/generateBuildDbScript.ts",
"prepare-deploy": "npm run generate:service-worker && ./scripts/prepare-build.sh && npm run build", "prepare-deploy": "npm run generate:service-worker && ./scripts/prepare-build.sh && npm run build",
"watch:css": "tailwindcss -i src/index.css -o public/css/index-tailwind-output.css --watch", "watch:css": "tailwindcss -i src/index.css -o public/css/index-tailwind-output.css --watch",
"generate:css": "tailwindcss -i src/index.css -o public/css/index-tailwind-output.css", "generate:css": "tailwindcss -i src/index.css -o public/css/index-tailwind-output.css",
"generate:doctests": "doctest-ts-improved . --ignore .*.spec.ts --ignore .*ConfigJson.ts", "generate:doctests": "doctest-ts-improved . --ignore .*.spec.ts --ignore .*ConfigJson.ts",
@ -91,58 +88,41 @@
"query:licenses": "vite-node scripts/generateLicenseInfo.ts -- --query", "query:licenses": "vite-node scripts/generateLicenseInfo.ts -- --query",
"generate:contributor-list": "vite-node scripts/generateContributors.ts", "generate:contributor-list": "vite-node scripts/generateContributors.ts",
"generate:service-worker": "tsc src/service-worker.ts --outFile public/service-worker.js && git_hash=$(git rev-parse HEAD) && sed -i.bak \"s/GITHUB-COMMIT/$git_hash/\" public/service-worker.js && rm public/service-worker.js.bak", "generate:service-worker": "tsc src/service-worker.ts --outFile public/service-worker.js && git_hash=$(git rev-parse HEAD) && sed -i.bak \"s/GITHUB-COMMIT/$git_hash/\" public/service-worker.js && rm public/service-worker.js.bak",
"reset:layeroverview": "npm run prep:layeroverview && npm run generate:layeroverview && npm run refresh:layeroverview", "reset:layeroverview": "npm run prep:layeroverview && npm run generate:layeroverview && npm run refresh:layeroverview",
"prep:layeroverview": "mkdir -p ./src/assets/generated/layers; echo {\\\"themes\\\":[]} > ./src/assets/generated/known_themes.json && echo {\\\"layers\\\": []} > ./src/assets/generated/known_layers.json && rm -f ./src/assets/generated/layers/*.json && rm -f ./src/assets/generated/themes/*.json && cp ./assets/layers/usersettings/usersettings.json ./src/assets/generated/layers/usersettings.json && echo '{}' > ./src/assets/generated/layers/favourite.json && echo '{}' > ./src/assets/generated/layers/summary.json && echo '{}' > ./src/assets/generated/layers/last_click.json", "prep:layeroverview": "mkdir -p ./src/assets/generated/layers; echo {\\\"themes\\\":[]} > ./src/assets/generated/known_themes.json && echo {\\\"layers\\\": []} > ./src/assets/generated/known_layers.json && rm -f ./src/assets/generated/layers/*.json && rm -f ./src/assets/generated/themes/*.json && cp ./assets/layers/usersettings/usersettings.json ./src/assets/generated/layers/usersettings.json && echo '{}' > ./src/assets/generated/layers/favourite.json && echo '{}' > ./src/assets/generated/layers/summary.json && echo '{}' > ./src/assets/generated/layers/last_click.json",
"generate": "npm run generate:licenses && npm run generate:images && npm run generate:charging-stations && npm run generate:translations && npm run refresh:layeroverview && npm run generate:service-worker", "generate": "npm run generate:licenses && npm run generate:images && npm run generate:charging-stations && npm run generate:translations && npm run refresh:layeroverview && npm run generate:service-worker",
"generate:charging-stations": "cd ./assets/layers/charging_station && vite-node csvToJson.ts && cd -", "generate:charging-stations": "cd ./assets/layers/charging_station && vite-node csvToJson.ts && cd -",
"clean:tests": "find . -type f -name \"*.doctest.ts\" | xargs -r rm", "clean:tests": "find . -type f -name \"*.doctest.ts\" | xargs -r rm",
"clean": "rm -rf .cache/ && (find *.html | grep -v \"^\\(404\\|index\\|land\\|privacy\\|test\\|studio\\|theme\\|style_test\\|statistics\\|status\\|leaderboard\\).html\" | xargs -r rm) && (ls | grep \"^index_[a-zA-Z_-]\\+\\.ts$\" | xargs -r rm)", "clean": "rm -rf .cache/ && (find *.html | grep -v \"^\\(404\\|index\\|land\\|privacy\\|test\\|studio\\|theme\\|style_test\\|statistics\\|status\\|leaderboard\\).html\" | xargs -r rm) && (ls | grep \"^index_[a-zA-Z_-]\\+\\.ts$\" | xargs -r rm)",
"generate:dependency-graph": "node_modules/.bin/depcruise --exclude \"^node_modules\" --output-type dot Logic/State/MapState.ts > dependencies.dot && dot dependencies.dot -T svg -o dependencies.svg && rm dependencies.dot", "generate:dependency-graph": "node_modules/.bin/depcruise --exclude \"^node_modules\" --output-type dot Logic/State/MapState.ts > dependencies.dot && dot dependencies.dot -T svg -o dependencies.svg && rm dependencies.dot",
"scrapeWebsites": "vite-node scripts/importscripts/compareWebsiteData.ts -- ~/Downloads/ShopsWithWebsiteNodes.csv ~/data/scraped_websites/", "scrapeWebsites": "vite-node scripts/importscripts/compareWebsiteData.ts -- ~/Downloads/ShopsWithWebsiteNodes.csv ~/data/scraped_websites/",
"### 0": "VELOPARK", "### 0": "VELOPARK",
"velopark:compare": "vite-node scripts/velopark/compare.ts -- velopark_nonsynced_.geojson ~/Projecten/OSM/Fietsberaad/2024-02-02\\ Fietsenstallingen_OSM_met_velopark_ref.geojson\n", "velopark:compare": "vite-node scripts/velopark/compare.ts -- velopark_nonsynced_.geojson ~/Projecten/OSM/Fietsberaad/2024-02-02\\ Fietsenstallingen_OSM_met_velopark_ref.geojson\n",
"velopark:download": "vite-node scripts/velopark/veloParkToGeojson.ts ", "velopark:download": "vite-node scripts/velopark/veloParkToGeojson.ts ",
"### 1": "CODE AND DATA MAINTAINENCE", "### 1": "CODE AND DATA MAINTAINENCE",
"download:nsi-logos": "vite-node scripts/downloadNsiLogos.ts || npm run downloadNsiLogos # This script crashes often without the possibility to correct - hence the auto retry with OR", "download:nsi-logos": "vite-node scripts/downloadNsiLogos.ts || npm run downloadNsiLogos # This script crashes often without the possibility to correct - hence the auto retry with OR",
"download:editor-layer-index": "vite-node scripts/downloadEli.ts", "download:editor-layer-index": "vite-node scripts/downloadEli.ts",
"download:stats": "vite-node scripts/GenerateSeries.ts", "download:stats": "vite-node scripts/GenerateSeries.ts",
"download:images": "vite-node scripts/generateImageAnalysis.ts -- ~/data/imgur-image-backup/", "download:images": "vite-node scripts/generateImageAnalysis.ts -- ~/data/imgur-image-backup/",
"weblate:add-upstream": "git remote add weblate-github git@github.com:weblate/MapComplete.git && git remote add weblate-hosted-core https://hosted.weblate.org/git/mapcomplete/core/ && git remote add weblate-hosted-layers https://hosted.weblate.org/git/mapcomplete/layers/", "weblate:add-upstream": "git remote add weblate-github git@github.com:weblate/MapComplete.git && git remote add weblate-hosted-core https://hosted.weblate.org/git/mapcomplete/core/ && git remote add weblate-hosted-layers https://hosted.weblate.org/git/mapcomplete/layers/",
"weblate:merge": "git remote update weblate-github; git merge weblate-github/weblate-mapcomplete-core weblate-github/weblate-mapcomplete-layers weblate-github/weblate-mapcomplete-layer-translations", "weblate:merge": "git remote update weblate-github; git merge weblate-github/weblate-mapcomplete-core weblate-github/weblate-mapcomplete-layers weblate-github/weblate-mapcomplete-layer-translations",
"weblate:merge-heavy": "git fetch weblate-hosted-layers; git fetch weblate-hosted-core; git merge weblate-hosted-layers/master weblate-hosted-core/master ", "weblate:merge-heavy": "git fetch weblate-hosted-layers; git fetch weblate-hosted-core; git merge weblate-hosted-layers/master weblate-hosted-core/master ",
"lint": "npm run lint:prettier && npm run lint:eslint && npm run lint:themes", "lint": "npm run lint:prettier && npm run lint:eslint && npm run lint:themes",
"lint:eslint": "eslint ./src", "lint:eslint": "eslint ./src",
"lint:prettier": "prettier --check '**/*.ts' '**/*.svelte'", "lint:prettier": "prettier --check '**/*.ts' '**/*.svelte'",
"lint:themes": "vite-node scripts/lint.ts", "lint:themes": "vite-node scripts/lint.ts",
"format": "prettier --write '**/*.ts' '**/*.svelte'", "format": "prettier --write '**/*.ts' '**/*.svelte'",
"optimize-images-png": "cd assets/generated/ && find -name '*.png' -exec optipng '{}' \\; && echo 'PNGs are optimized'", "optimize-images-png": "cd assets/generated/ && find -name '*.png' -exec optipng '{}' \\; && echo 'PNGs are optimized'",
"optimize-images-jpg": "cd assets/ && find . -regextype sed -regex \".*/.*.\\(jpg\\|JPG\\|JPEG\\|jpeg\\)\" -exec jpegoptim '{}' \\; && echo 'JPGs are optimized'", "optimize-images-jpg": "cd assets/ && find . -regextype sed -regex \".*/.*.\\(jpg\\|JPG\\|JPEG\\|jpeg\\)\" -exec jpegoptim '{}' \\; && echo 'JPGs are optimized'",
"optimize-images-scaledown-jpg": "cd assets/ && find . -regextype sed -regex \".*/.*.\\(jpg\\|JPG\\|JPEG\\|jpeg\\)\" -exec mogrify -resize 640x640\\> '{}' \\; && echo 'JPGs are optimized'", "optimize-images-scaledown-jpg": "cd assets/ && find . -regextype sed -regex \".*/.*.\\(jpg\\|JPG\\|JPEG\\|jpeg\\)\" -exec mogrify -resize 640x640\\> '{}' \\; && echo 'JPGs are optimized'",
"generate:schemas": "ts2json-schema -p src/Models/ThemeConfig/Json/ -o Docs/Schemas/ -t tsconfig.json -R . -m \".*ConfigJson\" && echo 'tsjson is done' && vite-node scripts/fixSchemas.ts ", "generate:schemas": "ts2json-schema -p src/Models/ThemeConfig/Json/ -o Docs/Schemas/ -t tsconfig.json -R . -m \".*ConfigJson\" && echo 'tsjson is done' && vite-node scripts/fixSchemas.ts ",
"reuse-compliance": "reuse lint", "reuse-compliance": "reuse lint",
"housekeeping": "git pull && npx update-browserslist-db@latest && npm run weblate:merge-heavy && npm run generate && npm run generate:docs && npm run generate:schemas && npm run generate:contributor-list && vite-node scripts/fetchLanguages.ts && vite-node scripts/generateSunnyUnlabeled.ts && npm run format && git add assets/ langs/ Docs/ **/*.ts Docs/* src/* && git commit -m 'chore: automated housekeeping...'", "housekeeping": "git pull && npx update-browserslist-db@latest && npm run weblate:merge-heavy && npm run generate && npm run generate:docs && npm run generate:schemas && npm run generate:contributor-list && vite-node scripts/fetchLanguages.ts && vite-node scripts/generateSunnyUnlabeled.ts && npm run format && git add assets/ langs/ Docs/ **/*.ts Docs/* src/* && git commit -m 'chore: automated housekeeping...'",
"###": "MICROSERVICES AND SERVER MAINTAINENCE", "###": "MICROSERVICES AND SERVER MAINTAINENCE",
"server:summary": "vite-node scripts/osm2pgsql/tilecountServer.ts", "server:summary": "vite-node scripts/osm2pgsql/tilecountServer.ts",
"server:ldjson": "vite-node scripts/serverLdScrape.ts", "server:ldjson": "vite-node scripts/serverLdScrape.ts",
"sever:studio": "vite-node scripts/studioServer -- /root/git/MapComplete/assets", "sever:studio": "vite-node scripts/studioServer -- /root/git/MapComplete/assets",
"server:errorreport": "vite-node scripts/serverErrorReport.ts -- /root/error_reports/", "server:errorreport": "vite-node scripts/serverErrorReport.ts -- /root/error_reports/",
"generate:buildDbScript": "vite-node scripts/osm2pgsql/generateBuildDbScript.ts", "generate:buildDbScript": "vite-node scripts/osm2pgsql/generateBuildDbScript.ts",
"generate:summaryCache": "vite-node scripts/generateSummaryTileCache.ts" "generate:summaryCache": "vite-node scripts/generateSummaryTileCache.ts"
}, },

View file

@ -14,15 +14,27 @@ describe("Changes", () => {
const osmConnection = new OsmConnection({ dryRun }) const osmConnection = new OsmConnection({ dryRun })
const changes = new Changes({ osmConnection, dryRun }) const changes = new Changes({ osmConnection, dryRun })
const id = "node/42" const id = "node/42"
const tags = new UIEventSource({ id, "amenity": "shop" }) const tags = new UIEventSource({ id, amenity: "shop" })
const addImage = new LinkImageAction(id, "image", "https://example.org/uploaded_image", tags, { const addImage = new LinkImageAction(
id,
"image",
"https://example.org/uploaded_image",
tags,
{
theme: "test", theme: "test",
changeType: "add-image", changeType: "add-image",
}) }
const linkImage = new LinkImageAction(id, "image", "https://example.org/image_to_link", tags, { )
const linkImage = new LinkImageAction(
id,
"image",
"https://example.org/image_to_link",
tags,
{
theme: "test", theme: "test",
changeType: "link-image", changeType: "link-image",
}) }
)
await changes.applyAction(linkImage) await changes.applyAction(linkImage)
await changes.applyAction(addImage) await changes.applyAction(addImage)
@ -40,6 +52,5 @@ describe("Changes", () => {
const change1 = pending[1].tags[0] const change1 = pending[1].tags[0]
expect(change1.k).toBe("image:0") expect(change1.k).toBe("image:0")
expect(change1.v).toBe("https://example.org/uploaded_image") expect(change1.v).toBe("https://example.org/uploaded_image")
}) })
}) })