Add new currency options in the config

Defaults to `$` and `en-US` for the currency symbol and country code respectively
This commit is contained in:
Lordmau5 2024-03-14 09:03:39 +01:00
parent f6837d1435
commit e5c993d5dc
4 changed files with 206 additions and 137 deletions

View File

@ -94,6 +94,22 @@
"fallbackTwitchTitle": {
"$comment": "Set the fallback Twitch title for this event; {{total}} and {{run}} can be used as placeholders (see source code).",
"type": "string"
},
"currency": {
"$comment": "Overrides for the currency symbol and country code used in various graphics",
"additionalProperties": false,
"properties": {
"symbol": {
"$comment": "The currency symbol (defaults to $)",
"type": "string",
"default": "$"
},
"countryCode": {
"$comment": "The country code (defaults to en-US)",
"type": "string",
"default": "en-US"
}
}
}
},
"required": [

61
package-lock.json generated
View File

@ -60,6 +60,7 @@
"globby": "^12.2.0",
"gsap": "^3.12.5",
"html-webpack-plugin": "^5.6.0",
"json-schema-to-typescript": "^13.1.2",
"mini-css-extract-plugin": "^2.7.7",
"nodecg-cli": "^8.6.8",
"npm-run-all": "^4.1.5",
@ -303,15 +304,21 @@
}
},
"node_modules/@bcherny/json-schema-ref-parser": {
"version": "9.0.9",
"resolved": "https://registry.npmjs.org/@bcherny/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz",
"integrity": "sha512-vmEmnJCfpkLdas++9OYg6riIezTYqTHpqUTODJzHLzs5UnXujbOJW9VwcVCnyo1mVRt32FRr23iXBx/sX8YbeQ==",
"version": "10.0.5-fork",
"resolved": "https://registry.npmjs.org/@bcherny/json-schema-ref-parser/-/json-schema-ref-parser-10.0.5-fork.tgz",
"integrity": "sha512-E/jKbPoca1tfUPj3iSbitDZTGnq6FUFjkH6L8U2oDwSuwK1WhnnVtCG7oFOTg/DDnyoXbQYUiUiGOibHqaGVnw==",
"dev": true,
"dependencies": {
"@jsdevtools/ono": "^7.1.3",
"@types/json-schema": "^7.0.6",
"call-me-maybe": "^1.0.1",
"js-yaml": "^4.1.0"
},
"engines": {
"node": ">= 16"
},
"funding": {
"url": "https://github.com/sponsors/philsturgeon"
}
},
"node_modules/@colors/colors": {
@ -6002,12 +6009,12 @@
}
},
"node_modules/json-schema-to-typescript": {
"version": "11.0.3",
"resolved": "https://registry.npmjs.org/json-schema-to-typescript/-/json-schema-to-typescript-11.0.3.tgz",
"integrity": "sha512-EaEE9Y4VZ8b9jW5zce5a9L3+p4C9AqgIRHbNVDJahfMnoKzcd4sDb98BLxLdQhJEuRAXyKLg4H66NKm80W8ilg==",
"version": "13.1.2",
"resolved": "https://registry.npmjs.org/json-schema-to-typescript/-/json-schema-to-typescript-13.1.2.tgz",
"integrity": "sha512-17G+mjx4nunvOpkPvcz7fdwUwYCEwyH8vR3Ym3rFiQ8uzAL3go+c1306Kk7iGRk8HuXBXqy+JJJmpYl0cvOllw==",
"dev": true,
"dependencies": {
"@bcherny/json-schema-ref-parser": "9.0.9",
"@bcherny/json-schema-ref-parser": "10.0.5-fork",
"@types/json-schema": "^7.0.11",
"@types/lodash": "^4.14.182",
"@types/prettier": "^2.6.1",
@ -6799,6 +6806,18 @@
"node": ">=8"
}
},
"node_modules/nodecg-cli/node_modules/@bcherny/json-schema-ref-parser": {
"version": "9.0.9",
"resolved": "https://registry.npmjs.org/@bcherny/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz",
"integrity": "sha512-vmEmnJCfpkLdas++9OYg6riIezTYqTHpqUTODJzHLzs5UnXujbOJW9VwcVCnyo1mVRt32FRr23iXBx/sX8YbeQ==",
"dev": true,
"dependencies": {
"@jsdevtools/ono": "^7.1.3",
"@types/json-schema": "^7.0.6",
"call-me-maybe": "^1.0.1",
"js-yaml": "^4.1.0"
}
},
"node_modules/nodecg-cli/node_modules/chalk": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz",
@ -6835,6 +6854,34 @@
"node": ">=6 <7 || >=8"
}
},
"node_modules/nodecg-cli/node_modules/json-schema-to-typescript": {
"version": "11.0.3",
"resolved": "https://registry.npmjs.org/json-schema-to-typescript/-/json-schema-to-typescript-11.0.3.tgz",
"integrity": "sha512-EaEE9Y4VZ8b9jW5zce5a9L3+p4C9AqgIRHbNVDJahfMnoKzcd4sDb98BLxLdQhJEuRAXyKLg4H66NKm80W8ilg==",
"dev": true,
"dependencies": {
"@bcherny/json-schema-ref-parser": "9.0.9",
"@types/json-schema": "^7.0.11",
"@types/lodash": "^4.14.182",
"@types/prettier": "^2.6.1",
"cli-color": "^2.0.2",
"get-stdin": "^8.0.0",
"glob": "^7.1.6",
"glob-promise": "^4.2.2",
"is-glob": "^4.0.3",
"lodash": "^4.17.21",
"minimist": "^1.2.6",
"mkdirp": "^1.0.4",
"mz": "^2.7.0",
"prettier": "^2.6.2"
},
"bin": {
"json2ts": "dist/src/cli.js"
},
"engines": {
"node": ">=12.0.0"
}
},
"node_modules/nodecg-cli/node_modules/jsonfile": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz",

View File

@ -28,7 +28,8 @@
"watch": "run-p watch:*",
"watch:browser": "webpack -w",
"watch:extension": "tsc -b tsconfig.extension.json -w",
"postinstall": "cd shared && node postinstall.js"
"postinstall": "cd shared && node postinstall.js",
"configschema": "json2ts --input configschema.json --output src/types/schemas/configschema.d.ts"
},
"dependencies": {
"@esamarathon/mq-events": "^1.0.1",
@ -81,6 +82,7 @@
"globby": "^12.2.0",
"gsap": "^3.12.5",
"html-webpack-plugin": "^5.6.0",
"json-schema-to-typescript": "^13.1.2",
"mini-css-extract-plugin": "^2.7.7",
"nodecg-cli": "^8.6.8",
"npm-run-all": "^4.1.5",

View File

@ -11,8 +11,12 @@ export interface Configschema {
theme?: string;
shorts: string | [string] | [string, string];
thisEvent: number;
online: boolean | ('partial' | 'full');
online: boolean | ("partial" | "full");
fallbackTwitchTitle?: string;
currency?: {
symbol?: string;
countryCode?: string;
};
};
omnibar: {
miniCredits: {