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) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016TEPwEpwMrUFN8Paa9Tb8r
This commit is contained in:
Christopher Monsanto
2026-08-21 18:11:20 -04:00
parent 0bbbc36053
commit bcabe6d37e
3 changed files with 20 additions and 11 deletions

View File

@@ -81,6 +81,21 @@ export const ITEM_ALIASES: Record<string, string[]> = {
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<string, string[]> = {
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`);

View File

@@ -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

View File

@@ -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 = '';