Chore: housekeeping

This commit is contained in:
Pieter Vander Vennet 2025-08-13 23:09:49 +02:00
parent 69ab755f29
commit 7acddc7281
8 changed files with 84 additions and 88 deletions

View file

@ -10,7 +10,7 @@
const lng = Locale.language const lng = Locale.language
let fdroid = t.downloadOnFDroid.current let fdroid = t.downloadOnFDroid.current
let supportedVersions: { version: number, codename: string } = [ let supportedVersions: { version: number; codename: string } = [
{ version: 9, codename: "pie" }, { version: 9, codename: "pie" },
{ version: 10, codename: "quince-tart" }, { version: 10, codename: "quince-tart" },
{ version: 11, codename: "red-velvet-cake" }, { version: 11, codename: "red-velvet-cake" },
@ -56,11 +56,13 @@
{#each supportedVersions as v} {#each supportedVersions as v}
<a <a
class="button" class="button"
href={`https://builds.mapcomplete.org/apk/mapcomplete-latest-${v.version}-${v.codename.toUpperCase()}.apk`}> href={`https://builds.mapcomplete.org/apk/mapcomplete-latest-${
v.version
}-${v.codename.toUpperCase()}.apk`}
>
Android {v.version} ({v.codename}) Android {v.version} ({v.codename})
</a> </a>
{/each} {/each}
</div> </div>
</AccordionSingle> </AccordionSingle>
@ -68,22 +70,27 @@
<Tr t={t.older} /> <Tr t={t.older} />
</a> </a>
<div class="my-4 flex flex-col items-center">
<div class="flex flex-col items-center my-4">
<a href="https://f-droid.org/packages/org.mapcomplete"> <a href="https://f-droid.org/packages/org.mapcomplete">
<img src={`https://f-droid.org/badge/get-it-on-${$lng}.png`} <img
onerror="if (this.src !== 'fdroid.png') this.src = 'fdroid.png';" src={`https://f-droid.org/badge/get-it-on-${$lng}.png`}
alt={$fdroid} onerror="if (this.src !== 'fdroid.png') this.src = 'fdroid.png';"
style="width: 17rem"> alt={$fdroid}
style="width: 17rem"
/>
</a> </a>
<a <a
rel="noopener" rel="noopener"
href="https://apps.obtainium.imranr.dev/redirect?r=obtainium://add/https://source.mapcomplete.org/MapComplete/android-wrapper/releases"> href="https://apps.obtainium.imranr.dev/redirect?r=obtainium://add/https://source.mapcomplete.org/MapComplete/android-wrapper/releases"
<img style="width: 15rem" class="p-4" src="./badge_obtainium.png" alt="Get on obtainium" use:ariaLabel={t.getOnObtanium} /> >
<img
style="width: 15rem"
class="p-4"
src="./badge_obtainium.png"
alt="Get on obtainium"
use:ariaLabel={t.getOnObtanium}
/>
</a> </a>
</div> </div>
</div> </div>

View file

@ -1,11 +1,9 @@
import type { CapacitorConfig } from "@capacitor/cli"
import type { CapacitorConfig } from "@capacitor/cli";
const config: CapacitorConfig = { const config: CapacitorConfig = {
appId: "org.mapcomplete", appId: "org.mapcomplete",
appName: "MapComplete", appName: "MapComplete",
webDir: "dist-full" webDir: "dist-full",
}; }
export default config;
export default config

6
package-lock.json generated
View file

@ -13004,9 +13004,9 @@
} }
}, },
"node_modules/caniuse-lite": { "node_modules/caniuse-lite": {
"version": "1.0.30001726", "version": "1.0.30001734",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001726.tgz", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001734.tgz",
"integrity": "sha512-VQAUIUzBiZ/UnlM28fSp2CRF3ivUn1BWEvxMcVTNwpw91Py1pGbPIyIKtd+tzct9C3ouceCVdGAXxZOpZAsgdw==", "integrity": "sha512-uhE1Ye5vgqju6OI71HTQqcBCZrvHugk0MjLak7Q+HfoBgoq5Bi+5YnwjP4fjDgrtYr/l8MVRBvzz9dPD4KyK0A==",
"dev": true, "dev": true,
"funding": [ "funding": [
{ {

View file

@ -2,15 +2,16 @@
"#": "AUTOMATICALLY GENERATED! Do not edit.", "#": "AUTOMATICALLY GENERATED! Do not edit.",
"version": 8, "version": 8,
"name": "style@4.0.0-alpha.0 theme@sunny", "name": "style@4.0.0-alpha.0 theme@sunny",
"glyphs": "https://protomaps.github.io/basemaps-assets/fonts/{fontstack}/{range}.pbf", "glyphs": "./assets/fonts/{fontstack}/{range}.pbf",
"sources": { "sources": {
"protomaps": { "protomaps": {
"attribution": "<a href=\"https://github.com/protomaps/basemaps\">Protomaps</a> © <a href=\"https://openstreetmap.org\">OpenStreetMap</a>", "attribution": "<a href=\"https://github.com/protomaps/basemaps\">Protomaps</a> © <a href=\"https://openstreetmap.org\">OpenStreetMap</a>",
"type": "vector", "type": "vector",
"maxzoom": 15,
"tiles": [ "tiles": [
"https://api.protomaps.com/tiles/v4/{z}/{x}/{y}.mvt?key=2af8b969a9e8b692" "https://api.protomaps.com/tiles/v4/{z}/{x}/{y}.mvt?key=2af8b969a9e8b692"
] ],
"maxzoom": 15,
"minzoom": 0
} }
}, },
"layers": [ "layers": [

View file

@ -2,13 +2,16 @@
"#": "AUTOMATICALLY GENERATED! Do not edit.", "#": "AUTOMATICALLY GENERATED! Do not edit.",
"version": 8, "version": 8,
"name": "style@4.0.0-alpha.0 theme@sunny-unlabeled", "name": "style@4.0.0-alpha.0 theme@sunny-unlabeled",
"glyphs": "https://protomaps.github.io/basemaps-assets/fonts/{fontstack}/{range}.pbf", "glyphs": "./assets/fonts/{fontstack}/{range}.pbf",
"sources": { "sources": {
"protomaps": { "protomaps": {
"attribution": "<a href=\"https://github.com/protomaps/basemaps\">Protomaps</a> © <a href=\"https://openstreetmap.org\">OpenStreetMap</a>", "attribution": "<a href=\"https://github.com/protomaps/basemaps\">Protomaps</a> © <a href=\"https://openstreetmap.org\">OpenStreetMap</a>",
"type": "vector", "type": "vector",
"url": "pmtiles://https://cache.mapcomplete.org/planet-latest.pmtiles", "tiles": [
"maxzoom": 15 "pmtilesoffl://https://api.protomaps.com/tiles/v4/{z}/{x}/{y}.mvt?key=2af8b969a9e8b692"
],
"maxzoom": 15,
"minzoom": 0
} }
}, },
"layers": [ "layers": [

View file

@ -199,14 +199,14 @@ class GenerateBuildDbScript extends Script {
if (allLayers.size === 0) { if (allLayers.size === 0) {
throw "No layers found at all" throw "No layers found at all"
} }
const notCountedCutoff = 100*1000*1000 const notCountedCutoff = 100 * 1000 * 1000
const notCounted: string[] = [] const notCounted: string[] = []
const allNeededLayers: Map<string, { tags: TagsFilter; foundInTheme: string[] }> = new Map< const allNeededLayers: Map<string, { tags: TagsFilter; foundInTheme: string[] }> = new Map<
string, string,
{ tags: TagsFilter; foundInTheme: string[] } { tags: TagsFilter; foundInTheme: string[] }
>() >()
const tagInfo = new TagInfo() const tagInfo = new TagInfo()
const layerTotals = new Map<string, number>(); const layerTotals = new Map<string, number>()
for (const key of allLayers.keys()) { for (const key of allLayers.keys()) {
const layer = allLayers.get(key) const layer = allLayers.get(key)
if (!layer.isCounted) { if (!layer.isCounted) {
@ -214,11 +214,16 @@ class GenerateBuildDbScript extends Script {
continue continue
} }
let total = await tagInfo.getCountEstimateFor(layer.tags) let total = await tagInfo.getCountEstimateFor(layer.tags)
console.log("Keys " + layer.tags.asHumanString() + " might have up to " + total + " items") console.log(
"Keys " + layer.tags.asHumanString() + " might have up to " + total + " items"
)
layerTotals.set(key, total) layerTotals.set(key, total)
if (total > notCountedCutoff) { if (total > notCountedCutoff) {
notCounted.push(key) notCounted.push(key)
console.log("NOT indexing layer " + key + " as it exceeds the cutoff of", notCountedCutoff) console.log(
"NOT indexing layer " + key + " as it exceeds the cutoff of",
notCountedCutoff
)
continue continue
} }
allNeededLayers.set(key, layer) allNeededLayers.set(key, layer)
@ -250,7 +255,7 @@ class GenerateBuildDbScript extends Script {
) )
console.log("Layer totals (including non-indexed):") console.log("Layer totals (including non-indexed):")
for (const key of layerTotals.keys()) { for (const key of layerTotals.keys()) {
console.log(key,",\t",layerTotals.get(key), ",\t", allLayers.get(key).isCounted) console.log(key, ",\t", layerTotals.get(key), ",\t", allLayers.get(key).isCounted)
} }
} }

View file

@ -286,8 +286,7 @@ class ReadIdPresets extends Script {
constructor() { constructor() {
super( super(
[ [
"Reads the id-tagging-schema repository and steals the presets; which will be written into 'id_presets.json'\n\nArguments: [path-to-repository] [path-to-target]",
"Reads the id-tagging-schema repository and steals the presets; which will be written into 'id_presets.json'\n\nArguments: [path-to-repository] [path-to-target]",
"Note that default arguments are used", "Note that default arguments are used",
"Before running this script, you'll want to have the following file structure:", "Before running this script, you'll want to have the following file structure:",
"", "",
@ -299,7 +298,7 @@ class ReadIdPresets extends Script {
"cd ../id-tagging-schema && git pull && nvm use && npm ci && npm run build && npm run dist", "cd ../id-tagging-schema && git pull && nvm use && npm ci && npm run build && npm run dist",
"", "",
"Note: Font-Awesome has a 6.x and a 7.x branch; some icons are in one branch but not the other.", "Note: Font-Awesome has a 6.x and a 7.x branch; some icons are in one branch but not the other.",
"The source file is then loaded in ../id-tagging_schema/data/presets/shop/<various>.Json" "The source file is then loaded in ../id-tagging_schema/data/presets/shop/<various>.Json",
].join("\n") ].join("\n")
) )
} }
@ -342,11 +341,11 @@ class ReadIdPresets extends Script {
) )
const roentgenThief = new MakiThief( const roentgenThief = new MakiThief(
gitReposRoot + "Roentgen/icons/", gitReposRoot + "Roentgen/icons/",
targetDir+"roentgen-", targetDir + "roentgen-",
{ {
authors: ["Roentgen icon set"], authors: ["Roentgen icon set"],
license: "CC-BY 4.0 International", license: "CC-BY 4.0 International",
sources: ["https://github.com/enzet/Roentgen?"] sources: ["https://github.com/enzet/Roentgen?"],
}, },
"roentgen-" "roentgen-"
) )
@ -373,4 +372,3 @@ class ReadIdPresets extends Script {
} }
new ReadIdPresets().run() new ReadIdPresets().run()

View file

@ -3,59 +3,47 @@ import { describe, it } from "vitest"
import StaticFeatureSource from "../../../src/Logic/FeatureSource/Sources/StaticFeatureSource" import StaticFeatureSource from "../../../src/Logic/FeatureSource/Sources/StaticFeatureSource"
import { import {
ClusterGrouping, ClusterGrouping,
ClusteringFeatureSource ClusteringFeatureSource,
} from "../../../src/Logic/FeatureSource/TiledFeatureSource/ClusteringFeatureSource" } from "../../../src/Logic/FeatureSource/TiledFeatureSource/ClusteringFeatureSource"
import { UIEventSource } from "../../../src/Logic/UIEventSource" import { UIEventSource } from "../../../src/Logic/UIEventSource"
import { expect } from "chai" import { expect } from "chai"
const points: FeatureCollection<Point> = { const points: FeatureCollection<Point> = {
"type": "FeatureCollection", type: "FeatureCollection",
"features": [ features: [
{ {
"type": "Feature", type: "Feature",
"properties": {name: "a"}, properties: { name: "a" },
"geometry": { geometry: {
"coordinates": [ coordinates: [9.759318139161195, 55.56552169756637],
9.759318139161195, type: "Point",
55.56552169756637 },
],
"type": "Point"
}
}, },
{ {
"type": "Feature", type: "Feature",
"properties": {name: "b"}, properties: { name: "b" },
"geometry": { geometry: {
"coordinates": [ coordinates: [9.759768615515327, 55.56569930560951],
9.759768615515327, type: "Point",
55.56569930560951 },
],
"type": "Point"
}
}, },
{ {
"type": "Feature", type: "Feature",
"properties": {name: "c"}, properties: { name: "c" },
"geometry": { geometry: {
"coordinates": [ coordinates: [9.75879327221594, 55.56569229478089],
9.75879327221594, type: "Point",
55.56569229478089 },
],
"type": "Point"
}
}, },
{ {
"type": "Feature", type: "Feature",
"properties": {name: "d"}, properties: { name: "d" },
"geometry": { geometry: {
"coordinates": [ coordinates: [9.759380131319915, 55.56507066300628],
9.759380131319915, type: "Point",
55.56507066300628 },
], },
"type": "Point" ],
}
}
]
} }
describe("ClusteringFeatureSource", () => { describe("ClusteringFeatureSource", () => {
@ -65,7 +53,7 @@ describe("ClusteringFeatureSource", () => {
// On zoomlevel 19, all points are in a different tile // On zoomlevel 19, all points are in a different tile
const clusteringSource = new ClusteringFeatureSource(source, zoom, "test", { const clusteringSource = new ClusteringFeatureSource(source, zoom, "test", {
cutoff: 2, cutoff: 2,
dontClusterAboveZoom: 100 dontClusterAboveZoom: 100,
}) })
const allClusters = ClusterGrouping.singleton.features const allClusters = ClusterGrouping.singleton.features
expect(allClusters.data.length).to.eq(0) expect(allClusters.data.length).to.eq(0)
@ -76,9 +64,5 @@ describe("ClusteringFeatureSource", () => {
expect(allClusters.data.length).to.eq(1) expect(allClusters.data.length).to.eq(1)
expect(allClusters.data[0].properties["total_metric"]).to.eq("4") expect(allClusters.data[0].properties["total_metric"]).to.eq("4")
expect(clusteringSource.features.data.length).to.eq(0) expect(clusteringSource.features.data.length).to.eq(0)
}) })
}) })