Merge branch 'beta' into fix/ditto-tm-gen

This commit is contained in:
Sirz Benjie 2025-09-15 23:17:14 -05:00 committed by GitHub
commit 062be85e71
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 17 deletions

View File

@ -254,16 +254,9 @@
}, },
// Overrides to prevent unused import removal inside `overrides.ts`, enums & `.d.ts` files (for TSDoc linkcodes), // Overrides to prevent unused import removal inside `overrides.ts`, enums & `.d.ts` files (for TSDoc linkcodes),
// as well as inside script boilerplate files. // as well as inside script boilerplate files (whose imports will _presumably_ be used in the generated file).
{ {
// TODO: Rename existing boilerplates in the folder and remove this last alias "includes": ["**/src/overrides.ts", "**/src/enums/**/*", "**/*.d.ts", "scripts/**/*.boilerplate.ts"],
"includes": [
"**/src/overrides.ts",
"**/src/enums/**/*",
"**/*.d.ts",
"scripts/**/*.boilerplate.ts",
"**/boilerplates/*.ts"
],
"linter": { "linter": {
"rules": { "rules": {
"correctness": { "correctness": {

View File

@ -47,6 +47,6 @@ describe("{{description}}", () => {
await game.toEndOfTurn(); await game.toEndOfTurn();
expect(feebas).toHaveUsedMove({ move: MoveId.SPLASH, result: MoveResult.SUCCESS }); expect(feebas).toHaveUsedMove({ move: MoveId.SPLASH, result: MoveResult.SUCCESS });
expect(game.textInterceptor.logs).toContain(i18next.t("moveTriggers:splash")); expect(game).toHaveShownMessage(i18next.t("moveTriggers:splash"));
}); });
}); });

View File

@ -102,9 +102,9 @@ async function promptFileName(selectedType) {
function getBoilerplatePath(choiceType) { function getBoilerplatePath(choiceType) {
switch (choiceType) { switch (choiceType) {
// case "Reward": // case "Reward":
// return path.join(__dirname, "boilerplates/reward.ts"); // return path.join(__dirname, "boilerplates/reward.boilerplate.ts");
default: default:
return path.join(__dirname, "boilerplates/default.ts"); return path.join(__dirname, "boilerplates/default.boilerplate.ts");
} }
} }

View File

@ -23,11 +23,13 @@ export function getCookie(cName: string): string {
} }
const name = `${cName}=`; const name = `${cName}=`;
const ca = document.cookie.split(";"); const ca = document.cookie.split(";");
// Check all cookies in the document and see if any of them match, grabbing the first one whose value lines up for (let c of ca) {
for (const c of ca) { // ⚠️ DO NOT REPLACE THIS WITH C = C.TRIM() - IT BREAKS IN NON-CHROMIUM BROWSERS ⚠️
const cTrimmed = c.trim(); while (c.charAt(0) === " ") {
if (cTrimmed.startsWith(name)) { c = c.substring(1);
return c.slice(name.length, c.length); }
if (c.indexOf(name) === 0) {
return c.substring(name.length, c.length);
} }
} }
return ""; return "";