Build JSON versions of the pokedex and moves tables

These are to ease third-party development done in languages other than
JS.

Their URLs are in WEB-API.md
This commit is contained in:
Guangcong Luo 2021-03-16 07:30:03 -04:00
parent 8e56a4dfcc
commit 0f3ec58174
2 changed files with 10 additions and 0 deletions

View File

@ -66,3 +66,11 @@ News
https://pokemonshowdown.com/news.json
https://pokemonshowdown.com/news/270.json
Dex resources
-------------
https://play.pokemonshowdown.com/data/pokedex.json
https://play.pokemonshowdown.com/data/moves.json

View File

@ -1076,6 +1076,7 @@ process.stdout.write("Building `data/pokedex.js`... ");
}
const buf = 'exports.BattlePokedex = ' + es3stringify(Pokedex) + ';';
fs.writeFileSync('data/pokedex.js', buf);
fs.writeFileSync('data/pokedex.json', JSON.stringify(Pokedex));
}
console.log("DONE");
@ -1095,6 +1096,7 @@ process.stdout.write("Building `data/moves,items,abilities,typechart,learnsets.j
}
const buf = 'exports.BattleMovedex = ' + es3stringify(Moves) + ';';
fs.writeFileSync('data/moves.js', buf);
fs.writeFileSync('data/moves.json', JSON.stringify(Moves));
}
/*********************************************************