Configuration with more or less working scripts

This commit is contained in:
Pieter Vander Vennet 2023-01-17 02:00:57 +01:00
parent 3c345f43a3
commit 60583aa658
3 changed files with 10 additions and 2 deletions

View file

@ -6,7 +6,6 @@
"bugs": "https://github.com/pietervdvn/MapComplete/issues", "bugs": "https://github.com/pietervdvn/MapComplete/issues",
"homepage": "https://mapcomplete.osm.be", "homepage": "https://mapcomplete.osm.be",
"main": "index.js", "main": "index.js",
"type": "module",
"scripts": { "scripts": {
"vitedev": "vite", "vitedev": "vite",
"vitebuild": "tsc && vite build", "vitebuild": "tsc && vite build",

View file

@ -56,7 +56,7 @@ class StatsDownloader {
}.day.json` }.day.json`
writtenFiles.push(path) writtenFiles.push(path)
if (existsSync(path)) { if (existsSync(path)) {
let features = JSON.parse(readFileSync(path, "UTF-8")) let features = JSON.parse(readFileSync(path, { encoding: "utf-8" }))
features = features?.features ?? features features = features?.features ?? features
features.push(...features.features) // day-stats are generally a list already, but in some ad-hoc cases might be a geojson-collection too features.push(...features.features) // day-stats are generally a list already, but in some ad-hoc cases might be a geojson-collection too
console.log( console.log(

View file

@ -15,5 +15,14 @@
// "noImplicitReturns": true, // "noImplicitReturns": true,
"skipLibCheck": true "skipLibCheck": true
}, },
"ts-node": {
"compilerOptions": {
"isolatedModules": false,
"esModuleInterop": true,
"moduleResolution": "node",
"target": "ES5",
"module": "CommonJS"
}
},
"exclude": ["node_modules", "test", "scripts"] "exclude": ["node_modules", "test", "scripts"]
} }