forked from MapComplete/MapComplete
Themes(cafe_pub, toilets): add toilet information to pubs; forward wheelchair accessibility information to 'toilet_at_amenity'
This commit is contained in:
parent
7a0eed35e3
commit
455b2c641c
9 changed files with 75 additions and 118 deletions
|
@ -270,7 +270,7 @@ class LayerBuilder extends Conversion<object, Map<string, LayerConfigJson>> {
|
|||
|
||||
for (let i = 0; i < level.ids.length; i++) {
|
||||
const id = level.ids[i]
|
||||
ScriptUtils.erasableLog(`Building level ${level.level}: validating layer ${i + 1}/${level.ids.length}: ${id}`)
|
||||
ScriptUtils.erasableLog(`Building level ${i}: validating layer ${i + 1}/${level.ids.length}: ${id}`)
|
||||
if (id === "questions") {
|
||||
continue
|
||||
}
|
||||
|
@ -362,7 +362,6 @@ class LayerOverviewUtils extends Script {
|
|||
for (const path of sourcefile) {
|
||||
const hasChange = statSync(path).mtime > targetModified
|
||||
if (hasChange) {
|
||||
console.log("File ", targetfile, " should be updated as ", path, "has been changed")
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
@ -751,8 +750,13 @@ class LayerOverviewUtils extends Script {
|
|||
for (let i = 0; i < allPaths.length; i++) {
|
||||
const path = allPaths[i]
|
||||
ScriptUtils.erasableLog(`Parsing layerConfig ${i + 1}/${allPaths.length}: ${path} `)
|
||||
const data = JSON.parse(readFileSync(path, "utf8"))
|
||||
try {
|
||||
|
||||
const data = JSON.parse(readFileSync(path, "utf8"))
|
||||
results.push(data)
|
||||
} catch (e) {
|
||||
throw "Could not parse layer file " + path
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -776,7 +780,10 @@ class LayerOverviewUtils extends Script {
|
|||
const layerState = new Map<string, "clean" | "dirty" | "changed">()
|
||||
console.log("# BUILD PLAN\n\n")
|
||||
for (const levelInfo of levels) {
|
||||
console.log(`## LEVEL ${levelInfo.level}${levelInfo.loop ? " (LOOP)" : ""}`)
|
||||
if (levelInfo.loop) {
|
||||
console.log(`(LOOP)`)
|
||||
}
|
||||
let allClean = true
|
||||
for (const id of levelInfo.ids) {
|
||||
const deps = dependencyGraph.get(id) ?? []
|
||||
const dirtyDeps = deps.filter(dep => {
|
||||
|
@ -795,8 +802,6 @@ class LayerOverviewUtils extends Script {
|
|||
if (dirtyDeps.length > 0) {
|
||||
layerState.set(id, "dirty")
|
||||
} else {
|
||||
|
||||
|
||||
const sourcePath = `./assets/layers/${id}/${id}.json`
|
||||
const targetPath = `./public/assets/generated/layers/${id}.json`
|
||||
|
||||
|
@ -809,7 +814,13 @@ class LayerOverviewUtils extends Script {
|
|||
}
|
||||
}
|
||||
const state = layerState.get(id)
|
||||
if (state !== "clean") {
|
||||
allClean = false
|
||||
console.log(`- ${id} (${state}; ${dirtyDeps.map(dd => dd + "*").join(", ")})`)
|
||||
}
|
||||
}
|
||||
if (allClean) {
|
||||
console.log("\n")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue