Rename star-wars-unlimited to swu Slug Convention
| Date | 2026-03-31 |
| Status | Accepted |
| Decision Makers | @benjaminW78 |
Context and Problem Statement
All game files and directories in the CardNexus monorepo are named after the game’s slug — the short identifier used in SupportedGames. For example:
| Game | Slug | File pattern |
|---|---|---|
| Magic: The Gathering | mtg | mtg.game.ts, mtg-importer.ts |
| Flesh and Blood | fab | fab.game.ts, fab-importer.ts |
| One Piece | onepiece | onepiece.game.ts, onepiece-importer.ts |
| Pokemon | pokemon | pokemon.game.ts, pokemon-importer.ts |
Star Wars: Unlimited was the only game using its full hyphenated name (star-wars-unlimited) instead of its slug (swu) for file and directory naming. This created inconsistency across the codebase and made it harder to predict file locations by convention.
Decision Drivers
- Every other game uses the slug for file naming — SWU was the only exception
- Developers expect to find game files at
games/{slug}/by convention - Longer file names add noise to imports and git diffs
- Image assets (
game-logos/star-wars-unlimited.png) were also inconsistent with other games (game-logos/fab.png)
Considered Options
- Rename everything to
swu— Align with the convention used by all other games - Keep
star-wars-unlimited— Maintain the current naming, accept the inconsistency - Rename only new files — Use
swufor new files, leave existing files as-is
Decision Outcome
Chosen option: “Rename everything to swu”, because consistency across all games is more valuable than avoiding a large rename diff. The rename is mechanical and low-risk, and doing it all at once avoids a confusing mixed state.
Scope of Changes
Directories renamed
| Old path | New path |
|---|---|
packages/games/game-configuration/src/lib/games/star-wars-unlimited/ | packages/games/game-configuration/src/lib/games/swu/ |
packages/games/game-importer/src/star-wars-unlimited/ | packages/games/game-importer/src/swu/ |
apps/internal-doc/src/content/game-importers/star-wars-unlimited/ | apps/internal-doc/src/content/game-importers/swu/ |
Files renamed (examples)
| Old name | New name |
|---|---|
star-wars-unlimited.game.ts | swu.game.ts |
star-wars-unlimited.types.ts | swu.types.ts |
star-wars-unlimited-importer.ts | swu-importer.ts |
star-wars-unlimited.schema.ts | swu.schema.ts |
game-logos/star-wars-unlimited.png | game-logos/swu.png |
What was NOT renamed
- Class and type names —
StarWarsUnlimitedImporter,StarWarsUnlimitedFinish, etc. remain unchanged. These are internal identifiers, not file paths, and renaming them would add churn with no practical benefit. - Display names —
"Star Wars: Unlimited"in user-facing strings stays as-is. - External API identifiers — TCGPowertools game key
star-wars-unlimitedis an external identifier, not a file path. - Variable names —
starWarsUnlimitedFilters,starWarsUnlimitedSeoConfig, etc. remain unchanged.
Consequences
Positive
- All games now follow the same
{slug}naming convention for files and directories - Developers can reliably predict file locations:
games/{slug}/{slug}.game.ts - Image assets are consistent:
game-logos/{slug}.png - Internal doc routes are consistent:
/game-importers/{slug}/
Negative
- Large rename diff in one PR — git history for these files has a rename boundary
- GitHub links in existing documentation needed updating (handled in same PR)
- S3 bucket keys in LocalStack still contain old
star-wars-unlimited/prefix from previous imports (harmless, will be superseded byswu/keys)
More Information
- Convention established by existing games:
mtg,fab,onepiece,pokemon,lorcana,sorcery, etc. - The
SupportedGamesenum already usedswuas the slug — only file names were inconsistent
Last updated on