chore: automated housekeeping...

This commit is contained in:
Pieter Vander Vennet 2025-08-19 23:39:49 +02:00
parent b8847189c2
commit 8d782f1b9d
79 changed files with 2828 additions and 681 deletions

View file

@ -38,7 +38,10 @@ import { ValidateThemeAndLayers } from "../src/Models/ThemeConfig/Conversion/Val
import { ExtractImages } from "../src/Models/ThemeConfig/Conversion/FixImages"
import { TagRenderingConfigJson } from "../src/Models/ThemeConfig/Json/TagRenderingConfigJson"
import { Lists } from "../src/Utils/Lists"
import { LayerConfigDependencyGraph, LevelInfo } from "../src/Models/ThemeConfig/LayerConfigDependencyGraph"
import {
LayerConfigDependencyGraph,
LevelInfo,
} from "../src/Models/ThemeConfig/LayerConfigDependencyGraph"
import { AddContextToTranslations } from "../src/Models/ThemeConfig/Conversion/AddContextToTranslations"
// This scripts scans 'src/assets/layers/*.json' for layer definition files and 'src/assets/themes/*.json' for theme definition files.
@ -114,7 +117,10 @@ class AddIconSummary extends DesugaringStep<{ raw: LayerConfigJson; parsed: Laye
static singleton = new AddIconSummary()
constructor() {
super("AddIconSummary", "Adds an icon summary ('_layerIcon') for quick reference. This previews how the layer should be shown in e.g. the filter menu")
super(
"AddIconSummary",
"Adds an icon summary ('_layerIcon') for quick reference. This previews how the layer should be shown in e.g. the filter menu"
)
}
convert(json: { raw: LayerConfigJson; parsed: LayerConfig }) {
@ -699,11 +705,14 @@ class LayerOverviewUtils extends Script {
)
const path = "assets/layers/questions/questions.json"
const sharedQuestionsRaw: LayerConfigJson = this.parseLayer(doesImageExist, prepareLayer, path).raw
const sharedQuestions: LayerConfigJson = new AddContextToTranslations<LayerConfigJson>("").convertStrict(
sharedQuestionsRaw,
ConversionContext.construct(["layers:questions"], [])
)
const sharedQuestionsRaw: LayerConfigJson = this.parseLayer(
doesImageExist,
prepareLayer,
path
).raw
const sharedQuestions: LayerConfigJson = new AddContextToTranslations<LayerConfigJson>(
""
).convertStrict(sharedQuestionsRaw, ConversionContext.construct(["layers:questions"], []))
const dict = new Map<string, QuestionableTagRenderingConfigJson>()
for (const tr of sharedQuestions.tagRenderings) {

View file

@ -567,7 +567,7 @@ function MergeTranslation(source: any, target: any, language: string, context: s
const sourceV = source[key]
const targetV = target[keyRemapping?.get(key) ?? key]
if(targetV === undefined){
if (targetV === undefined) {
throw `Merging translations failed; targetV is undefined for context ${context}; but we are trying to add ${sourceV} (${key}) to it`
}