diff --git a/content/changelog/oath/en-US.yml b/content/changelog/oath/en-US.yml new file mode 100644 index 0000000..4772409 --- /dev/null +++ b/content/changelog/oath/en-US.yml @@ -0,0 +1,7 @@ +# YYYY-MM-DD + +- date: 2024-06-06 + text: > + Added FAQ entries to $link:Toll Roads$, $link:Wrestlers$, and $link:Vow of Poverty$. + + Changed the answer to "How does this work if I have Witch's Bargain?" for $link:Toll Roads$ from "Blah blah blah" to "Blah blah blah." We did this because of reasons. diff --git a/package.json b/package.json index 0ae7906..f657e51 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "build:meta-data": "ts-node scripts/build-meta-data", "build:i18n": "ts-node scripts/build-i18n", "build:faq": "ts-node scripts/build-faq", + "build:changelog": "ts-node scripts/build-changelog", "compress:card-images": "ts-node scripts/compress-card-images", "compress:card-symbols": "ts-node scripts/compress-card-symbols", "validate": "concurrently \"npm run validate:*\"", diff --git a/scripts/build-changelog.ts b/scripts/build-changelog.ts new file mode 100644 index 0000000..34730f1 --- /dev/null +++ b/scripts/build-changelog.ts @@ -0,0 +1,26 @@ +const path = require('path'); +const fs = require('fs-extra'); +const yaml = require('js-yaml'); +const readdir = require('recursive-readdir'); + +fs.ensureDirSync('./dist'); + +const readAllChangelogs = async () => { + const allChangelogFiles = await readdir('./content/changelog'); + + const allChangelogData = {}; + + allChangelogFiles.forEach((f) => { + const [, , game] = f.split(path.sep); + const locale = path.basename(f, '.yml'); + const changelogs = yaml.load(fs.readFileSync(f)); + + allChangelogData[game] ??= {}; + allChangelogData[game][locale] = changelogs; + }); + + fs.writeJsonSync(`dist/changelog.json`, allChangelogData); + console.log(`Got ${allChangelogFiles.length} changelog files!`); +}; + +readAllChangelogs(); diff --git a/scripts/build-faq.ts b/scripts/build-faq.ts index 80acf90..2b4b946 100644 --- a/scripts/build-faq.ts +++ b/scripts/build-faq.ts @@ -4,7 +4,6 @@ const yaml = require('js-yaml'); const readdir = require('recursive-readdir'); fs.ensureDirSync('./dist'); -fs.ensureDirSync('./dist/faq'); const readAllFAQ = async () => { const allFAQFiles = await readdir('./content/faq'); @@ -20,8 +19,8 @@ const readAllFAQ = async () => { allFAQData[game][locale] = faqs; }); - fs.writeJsonSync(`dist/faq.json`, allFAQData), - console.log(`Got ${allFAQFiles.length} FAQ files!`); + fs.writeJsonSync(`dist/faq.json`, allFAQData); + console.log(`Got ${allFAQFiles.length} FAQ files!`); }; readAllFAQ();