diff --git a/Makefile b/Makefile index 8a1d198..7e1f3a3 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ gen/mapPresets.conf gen/mapBattlePresets.conf &: gen/map_modoptions.validated.js ts-node scripts/js/src/gen_spads_map_presets.ts gen/mapPresets.conf gen/mapBattlePresets.conf # Tests on data -test: typecheck_scripts check_startboxes check_startpos check_photo_aspect_ratio check_archive_not_solid +test: typecheck_scripts check_startboxes check_startpos check_photo_aspect_ratio check_archive_not_solid check_uses_mapinfo_lua echo ok typecheck_scripts: gen/types/map_list.d.ts gen/types/live_maps.d.ts gen/types/cdn_maps.d.ts @@ -56,6 +56,9 @@ check_photo_aspect_ratio: gen/types/map_list.d.ts gen/map_list.validated.json check_archive_not_solid: gen/types/map_list.d.ts gen/map_list.validated.json ts-node scripts/js/src/check_archive_not_solid.ts +check_uses_mapinfo_lua: gen/types/map_list.d.ts gen/map_list.validated.json + ts-node scripts/js/src/check_uses_mapinfo_lua.ts + # Auxiliary build targets types: gen/types/map_list.d.ts gen/map_list.schema.json diff --git a/scripts/js/src/check_uses_mapinfo_lua.ts b/scripts/js/src/check_uses_mapinfo_lua.ts new file mode 100644 index 0000000..d6bfe6e --- /dev/null +++ b/scripts/js/src/check_uses_mapinfo_lua.ts @@ -0,0 +1,24 @@ +// Verifies all maps use mapinfo.lua and not older methods. + +import { readMapList, fetchMapsMetadata } from './maps_metadata.js'; + +const maps = await readMapList(); +const mapsMetadata = await fetchMapsMetadata(maps); + +const whitelist: Set = new Set(['Mescaline_V2']); + +let anyWithoutMapinfo = false; +for (const [rowyId, map] of Object.entries(maps)) { + const meta = mapsMetadata.get(rowyId); + if (!meta.mapInfo) { + if (whitelist.has(map.springName)) { + console.log(`${map.springName} doesn't use mapinfo.lua but whitelisted.`); + } else { + console.error(`ERROR: ${map.springName} doesn't use mapinfo.lua.`); + anyWithoutMapinfo = true; + } + } +} +if (anyWithoutMapinfo) { + process.exit(1); +}