From bcabe6d37e978f1ef001c75d939b3ab738c6897c Mon Sep 17 00:00:00 2001 From: Christopher Monsanto Date: Fri, 21 Aug 2026 18:11:20 -0400 Subject: [PATCH] Publish Meowstic under the name the smogdex asks for PS calls the male Meowstic just "Meowstic" -- baseForme M, with Meowstic-F as the alt forme -- and every published name here falls out of the PS data, so the tree ships meowstic and meowstic-f. The smogdex splits the pair evenly and calls that entry Meowstic-M: dex-sync's getName renames it on import, and toAlias turns that into meowstic-m, which is what the page background, the sprite- sheet class, and the (minisprite:) embeds all ask for. Nothing produced that name, so the dex has been living off hand-placed leftovers under xy/ and xyicons/ that no build has touched in years and that rsync has no reason to delete. Give the smogon side an alias table, as the items already have, and publish the sprite under both names. Only that side gets it: PS asks for meowstic and the filename already says meowstic. This is the whole of the disagreement -- the other four renames in getName are a move, an accent, and two spaces that slug back to what we emit -- so one entry covers it. The sheet had its own copy of publishedName inline; it wants the aliases too, so it now calls the shared one. No name changes: the two agreed on every file in the tree, since none carries both -g and -f. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_016TEPwEpwMrUFN8Paa9Tb8r --- data/lib/index.ts | 15 +++++++++++++++ rules/publish.ts | 4 +++- tools/smogdexspritesheet/index.ts | 12 ++---------- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/data/lib/index.ts b/data/lib/index.ts index 963f9025..24774c5d 100644 --- a/data/lib/index.ts +++ b/data/lib/index.ts @@ -81,6 +81,21 @@ export const ITEM_ALIASES: Record = { sitrus_berry: ['gold_berry'], // Sitrus Berry / Gold Berry }; +// Species the smogdex names differently from PS, and so publishes twice. PS's +// Meowstic is the male -- baseForme M, with Meowstic-F the alt forme -- while +// the dex splits the pair evenly and calls that entry Meowstic-M. Keyed and +// valued in published smogon form, because only that side asks: PS wants +// `meowstic`, which is what the filename already says. +export const SPECIES_ALIASES: Record = { + meowstic: ['meowstic-m'], +}; + +// Every name a sprite answers to on the smogon side: its own, and any alias. +export function smogonNames(sn: SpriteFilename): string[] { + let name = publishedName(sn, smogon); + return [name, ...SPECIES_ALIASES[name] ?? []]; +} + export function parseFilename(s: string): SpriteFilename { if (s.length < 2) throw new Error(`Filename ${s} needs to be at least 2 characters`); diff --git a/rules/publish.ts b/rules/publish.ts index 02c8c809..f1383bad 100644 --- a/rules/publish.ts +++ b/rules/publish.ts @@ -82,7 +82,9 @@ export async function spritecopy(manifest: Manifest, f: Sprite, dest: Dest, throw new Error(`Not a specie sprite: ${f.name}`); } - await manifest.copy(f, dest, spritedata.publishedName(sn, spritedata.smogon)); + for (let name of spritedata.smogonNames(sn)) { + await manifest.copy(f, dest, name); + } } // TODO: merge with above diff --git a/tools/smogdexspritesheet/index.ts b/tools/smogdexspritesheet/index.ts index 8c8b1a54..fb3de739 100755 --- a/tools/smogdexspritesheet/index.ts +++ b/tools/smogdexspritesheet/index.ts @@ -33,17 +33,9 @@ for (let [filename, sprite] of Object.entries(result.coordinates)) { continue; } // TODO would like to use psid here, mess with it later. - let name = spritedata.smogon(parsed.name); - let forme = parsed.extra.get('o'); - if (forme) { - name += `-${spritedata.smogon(forme)}`; + for (let name of spritedata.smogonNames(parsed)) { + sprites.set(name, sprite); } - if (parsed.extra.has('g')) { - name += '-gmax'; - } else if (parsed.extra.has('f')) { - name += '-f'; - } - sprites.set(name, sprite); } let stylesheet = '';