Build formats.js

PS officially doesn't use this, but some bots used to read this
directly from GitHub, and building it is nontrivial, so this lets
bots read it from our webserver instead.

It's available at:

https://play.pokemonshowdown.com/data/formats.js

(And as usual, feel free to use HTTP if your language's HTTPS
implementation is hard to use.)
This commit is contained in:
Guangcong Luo
2020-06-13 14:41:33 -07:00
parent e493e87db1
commit 6aaee16be0

View File

@@ -1028,6 +1028,16 @@ process.stdout.write("Building `data/moves,items,abilities,typechart,learnsets.j
fs.writeFileSync('data/formats-data.js', buf);
}
/*********************************************************
* Build formats.js
*********************************************************/
{
const Formats = requireNoCache('../data/Pokemon-Showdown/.config-dist/formats.js').Formats;
const buf = 'exports.Formats = ' + es3stringify(Formats) + ';';
fs.writeFileSync('data/formats.js', buf);
}
/*********************************************************
* Build learnsets.js
*********************************************************/