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
let fdroid = t.downloadOnFDroid.current
let supportedVersions: { version: number, codename: string } = [
let supportedVersions: { version: number; codename: string } = [
{ version: 9, codename: "pie" },
{ version: 10, codename: "quince-tart" },
{ version: 11, codename: "red-velvet-cake" },
@ -56,11 +56,13 @@
{#each supportedVersions as v}
<a
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})
</a>
{/each}
</div>
</AccordionSingle>
@ -68,22 +70,27 @@
<Tr t={t.older} />
</a>
<div class="flex flex-col items-center my-4">
<div class="my-4 flex flex-col items-center">
<a href="https://f-droid.org/packages/org.mapcomplete">
<img src={`https://f-droid.org/badge/get-it-on-${$lng}.png`}
<img
src={`https://f-droid.org/badge/get-it-on-${$lng}.png`}
onerror="if (this.src !== 'fdroid.png') this.src = 'fdroid.png';"
alt={$fdroid}
style="width: 17rem">
style="width: 17rem"
/>
</a>
<a
rel="noopener"
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} />
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}
/>
</a>
</div>
</div>

View file

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

6
package-lock.json generated
View file

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

View file

@ -2,15 +2,16 @@
"#": "AUTOMATICALLY GENERATED! Do not edit.",
"version": 8,
"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": {
"protomaps": {
"attribution": "<a href=\"https://github.com/protomaps/basemaps\">Protomaps</a> © <a href=\"https://openstreetmap.org\">OpenStreetMap</a>",
"type": "vector",
"maxzoom": 15,
"tiles": [
"https://api.protomaps.com/tiles/v4/{z}/{x}/{y}.mvt?key=2af8b969a9e8b692"
]
],
"maxzoom": 15,
"minzoom": 0
}
},
"layers": [

View file

@ -2,13 +2,16 @@
"#": "AUTOMATICALLY GENERATED! Do not edit.",
"version": 8,
"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": {
"protomaps": {
"attribution": "<a href=\"https://github.com/protomaps/basemaps\">Protomaps</a> © <a href=\"https://openstreetmap.org\">OpenStreetMap</a>",
"type": "vector",
"url": "pmtiles://https://cache.mapcomplete.org/planet-latest.pmtiles",
"maxzoom": 15
"tiles": [
"pmtilesoffl://https://api.protomaps.com/tiles/v4/{z}/{x}/{y}.mvt?key=2af8b969a9e8b692"
],
"maxzoom": 15,
"minzoom": 0
}
},
"layers": [

View file

@ -199,14 +199,14 @@ class GenerateBuildDbScript extends Script {
if (allLayers.size === 0) {
throw "No layers found at all"
}
const notCountedCutoff = 100*1000*1000
const notCountedCutoff = 100 * 1000 * 1000
const notCounted: string[] = []
const allNeededLayers: Map<string, { tags: TagsFilter; foundInTheme: string[] }> = new Map<
string,
{ tags: TagsFilter; foundInTheme: string[] }
>()
const tagInfo = new TagInfo()
const layerTotals = new Map<string, number>();
const layerTotals = new Map<string, number>()
for (const key of allLayers.keys()) {
const layer = allLayers.get(key)
if (!layer.isCounted) {
@ -214,11 +214,16 @@ class GenerateBuildDbScript extends Script {
continue
}
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)
if (total > notCountedCutoff) {
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
}
allNeededLayers.set(key, layer)
@ -250,7 +255,7 @@ class GenerateBuildDbScript extends Script {
)
console.log("Layer totals (including non-indexed):")
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,7 +286,6 @@ class ReadIdPresets extends Script {
constructor() {
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]",
"Note that default arguments are used",
"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",
"",
"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")
)
}
@ -342,11 +341,11 @@ class ReadIdPresets extends Script {
)
const roentgenThief = new MakiThief(
gitReposRoot + "Roentgen/icons/",
targetDir+"roentgen-",
targetDir + "roentgen-",
{
authors: ["Roentgen icon set"],
license: "CC-BY 4.0 International",
sources: ["https://github.com/enzet/Roentgen?"]
sources: ["https://github.com/enzet/Roentgen?"],
},
"roentgen-"
)
@ -373,4 +372,3 @@ class ReadIdPresets extends Script {
}
new ReadIdPresets().run()

View file

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