@zthun/romulator-client 1.18.2 → 1.18.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +10 -9
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../src/config/config-games-metadata.mts","../src/config/config-games.mts","../src/config/config.mts","../src/players/players.mts","../src/system/system-id.mts","../src/game/game.mts","../src/media/media-type.mts","../src/media/media.mts","../src/players/players-serialize.mts","../src/system/system-content-type.mts","../src/system/system-hardware-type.mts","../src/system/system-media-format-type.mts","../src/system/system.mts"],"sourcesContent":["import { ZMetadataBuilder, type IZMetadata } from \"@zthun/helpful-query\";\n\nexport abstract class ZRomulatorConfigGamesMetadata {\n public static all(): IZMetadata[] {\n return [ZRomulatorConfigGamesMetadata.gamesFolder()];\n }\n\n public static gamesFolder(): IZMetadata {\n return new ZMetadataBuilder()\n .id(\"games-folder\")\n .path(\"gamesFolder\")\n .name(\"Games Folder\")\n .fallback(\"${HOME}/Games\")\n .editable()\n .file()\n .build();\n }\n}\n","export interface IZRomulatorConfigGames {\n gamesFolder?: string;\n}\n\nexport class ZRomulatorConfigGamesBuilder {\n private _config: IZRomulatorConfigGames = {};\n\n public gamesFolder(games: string): this {\n this._config.gamesFolder = games;\n return this;\n }\n\n public copy(other: IZRomulatorConfigGames) {\n this._config = structuredClone(other);\n return this;\n }\n\n public assign(other: Partial<IZRomulatorConfigGames>) {\n this._config = { ...this._config, ...other };\n return this;\n }\n\n public build(): IZRomulatorConfigGames {\n return structuredClone(this._config);\n }\n}\n","import { firstDefined } from \"@zthun/helpful-fn\";\nimport type { IZMetadata } from \"@zthun/helpful-query\";\nimport { castArray } from \"lodash-es\";\n\n/**\n * Represents a list of known config ids\n */\nexport enum ZRomulatorConfigId {\n /**\n * Config for games.\n */\n Games = \"games\",\n\n /**\n * Config id for media.\n */\n Media = \"media\",\n}\n\nexport interface IZRomulatorConfig<T = any> {\n id: ZRomulatorConfigId;\n name: string;\n\n avatar?: string;\n contents?: T;\n description?: string;\n file: string;\n metadata?: IZMetadata[];\n}\n\nexport class ZRomulatorConfigBuilder<T = any> {\n private _config: IZRomulatorConfig<T> = {\n id: ZRomulatorConfigId.Games,\n name: \"\",\n file: \"\",\n };\n\n public id(id: ZRomulatorConfigId) {\n this._config.id = id;\n return this;\n }\n\n public avatar(id: string) {\n this._config.avatar = id;\n return this;\n }\n\n public name(name: string) {\n this._config.name = name;\n return this;\n }\n\n public description(description: string) {\n this._config.description = description;\n return this;\n }\n\n public file(path: string) {\n this._config.file = path;\n return this;\n }\n\n public contents(contents?: T) {\n this._config.contents = contents;\n return this;\n }\n\n public metadata(meta: IZMetadata | IZMetadata[]) {\n const metadata = firstDefined([], this._config.metadata);\n this._config.metadata = metadata.concat(castArray(meta));\n return this;\n }\n\n public copy(other: IZRomulatorConfig<T>) {\n this._config = structuredClone(other);\n return this;\n }\n\n public build() {\n return structuredClone(this._config);\n }\n}\n","import { get } from \"lodash-es\";\n\n/**\n * Represents a player range for a game.\n */\nexport interface IZRomulatorPlayers {\n /**\n * The minimum number of players.\n *\n * This is almost always (read 99.99%)\n * 1.\n */\n min: number;\n /**\n * The maximum number of players.\n */\n max: number;\n}\n\n/**\n * Creates player range instances\n */\nexport class ZRomulatorPlayersBuilder {\n private _players: IZRomulatorPlayers = { min: 1, max: 1 };\n\n /**\n * Sets the minimum supported players.\n *\n * @param players -\n * Minimum number of players.\n *\n * @returns\n * This object.\n */\n public min(players: number) {\n this._players.min = players;\n return this;\n }\n\n /**\n * Sets the maximum supported players.\n *\n * @param players -\n * Maximum number of players.\n *\n * @returns\n * This object.\n */\n public max(players: number) {\n this._players.max = players;\n return this;\n }\n\n private range(min: number, max: number) {\n return this.min(min).max(max);\n }\n\n /**\n * Sets the player count to 1 player for both min and max.\n *\n * @returns\n * This object.\n */\n public singlePlayer = this.range.bind(this, 1, 1);\n\n /**\n * Sets the player count to 2 for max and 1 for min.\n *\n * @returns\n * This object.\n */\n public twoPlayer = this.range.bind(this, 1, 2);\n\n /**\n * Sets the player count to 4 for max and 1 for min.\n *\n * @returns\n * This object.\n */\n public fourPlayer = this.range.bind(this, 1, 4);\n\n /**\n * Sets the player count to 8 for max and 1 for min.\n *\n * @returns\n * This object.\n */\n public eightPlayer = this.range.bind(this, 1, 8);\n\n private parseMax(candidate: object) {\n const max = get(candidate, \"max\");\n\n return typeof max === \"number\" ? this.max(max) : this;\n }\n\n private parseMin(candidate: object) {\n const min = get(candidate, \"min\");\n\n return typeof min === \"number\" ? this.min(min) : this;\n }\n\n /**\n * Attempts to read player range values from an arbitrary candidate.\n *\n * @param candidate -\n * Source object to inspect.\n *\n * @returns\n * This object.\n */\n public parse(candidate: unknown) {\n if (candidate == null || typeof candidate !== \"object\") {\n return this;\n }\n\n return this.parseMin(candidate).parseMax(candidate);\n }\n\n /**\n * Copies an existing player range into this builder.\n *\n * @param other -\n * Players object to duplicate.\n *\n * @returns\n * This object\n */\n public copy(other: IZRomulatorPlayers) {\n this._players = structuredClone(other);\n return this;\n }\n\n /**\n * Creates the final player range instance.\n *\n * @returns\n * A cloned IZRomulatorPlayers instance.\n */\n public build() {\n return structuredClone(this._players);\n }\n}\n","import { keyBy } from \"lodash-es\";\n\n/**\n * Id slugs for supported systems.\n */\nexport enum ZRomulatorSystemId {\n ThreeDo = \"3do\",\n Adam = \"adam\",\n Amiga = \"amiga\",\n Amiga1200 = \"amiga1200\",\n Amiga600 = \"amiga600\",\n AmigaCd32 = \"amigacd32\",\n AmstradCpc = \"amstradcpc\",\n Android = \"android\",\n Apple2 = \"apple2\",\n Apple2Gs = \"apple2gs\",\n Arcade = \"arcade\",\n Arcadia = \"arcadia\",\n Archimedes = \"archimedes\",\n Arduboy = \"arduboy\",\n Astrocde = \"astrocde\",\n Atari2600 = \"atari2600\",\n Atari5200 = \"atari5200\",\n Atari7800 = \"atari7800\",\n Atari800 = \"atari800\",\n AtariJaguar = \"atarijaguar\",\n AtariJaguarCd = \"atarijaguarcd\",\n AtariLynx = \"atarilynx\",\n AtariSt = \"atarist\",\n Atomiswave = \"atomiswave\",\n BbcMicro = \"bbcmicro\",\n C64 = \"c64\",\n CdiMono1 = \"cdimono1\",\n Cdtv = \"cdtv\",\n ChannelF = \"channelf\",\n Coco = \"coco\",\n Colecovision = \"colecovision\",\n Cps = \"cps\",\n Cps1 = \"cps1\",\n Cps2 = \"cps2\",\n Cps3 = \"cps3\",\n CrVision = \"crvision\",\n Daphne = \"daphne\",\n Dos = \"dos\",\n Dragon32 = \"dragon32\",\n Dreamcast = \"dreamcast\",\n EasyRpg = \"easyrpg\",\n Electron = \"electron\",\n Famicom = \"famicom\",\n FBA = \"fba\",\n FBNeo = \"fbneo\",\n FDS = \"fds\",\n FM7 = \"fm7\",\n FMTowns = \"fmtowns\",\n FPinball = \"fpinball\",\n Gamate = \"gamate\",\n GameAndWatch = \"gameandwatch\",\n GameCom = \"gamecom\",\n GameGear = \"gamegear\",\n GB = \"gb\",\n GBA = \"gba\",\n GBC = \"gbc\",\n GameCube = \"gc\",\n Genesis = \"genesis\",\n GMaster = \"gmaster\",\n GX4000 = \"gx4000\",\n Intellivision = \"intellivision\",\n LowResNx = \"lowresnx\",\n Lutro = \"lutro\",\n Macintosh = \"macintosh\",\n Mame = \"mame\",\n MameAdvMame = \"mame-advmame\",\n Mark3 = \"mark3\",\n MasterSystem = \"mastersystem\",\n MegaCd = \"megacd\",\n MegaDrive = \"megadrive\",\n MegaDriveJp = \"megadrivejp\",\n MegaDuck = \"megaduck\",\n MESS = \"mess\",\n Model2 = \"model2\",\n Model3 = \"model3\",\n MSX = \"msx\",\n MSX1 = \"msx1\",\n MSX2 = \"msx2\",\n MSXTurbor = \"msxturbor\",\n N3DS = \"n3ds\",\n Nintendo64 = \"n64\",\n N64DD = \"n64dd\",\n Naomi = \"naomi\",\n Naomi2 = \"naomi2\",\n NaomiGd = \"naomigd\",\n NDS = \"nds\",\n NeoGeo = \"neogeo\",\n NeoGeoCd = \"neogeocd\",\n NeoGeoCdJp = \"neogeocdjp\",\n Nintendo = \"nes\",\n NGage = \"ngage\",\n NeoGeoPocket = \"ngp\",\n NeoGeoPocketColor = \"ngpc\",\n Odyssey2 = \"odyssey2\",\n OpenBor = \"openbor\",\n Oric = \"oric\",\n Palm = \"palm\",\n PC = \"pc\",\n PC88 = \"pc88\",\n PC98 = \"pc98\",\n PcEngine = \"pcengine\",\n PcEngineCd = \"pcenginecd\",\n PCFx = \"pcfx\",\n Pico8 = \"pico8\",\n Plus4 = \"plus4\",\n PokeMini = \"pokemini\",\n PS2 = \"ps2\",\n PS3 = \"ps3\",\n PS4 = \"ps4\",\n PSP = \"psp\",\n PSVita = \"psvita\",\n PSX = \"psx\",\n PV1000 = \"pv1000\",\n SamCoupe = \"samcoupe\",\n Satellaview = \"satellaview\",\n Saturn = \"saturn\",\n SaturnJp = \"saturnjp\",\n ScummVM = \"scummvm\",\n SCV = \"scv\",\n Sega32X = \"sega32x\",\n SegaCd = \"segacd\",\n Sg1000 = \"sg-1000\",\n SGB = \"sgb\",\n SuperNintendo = \"snes\",\n Solarus = \"solarus\",\n SpectraVideo = \"spectravideo\",\n STV = \"stv\",\n Sufami = \"sufami\",\n SuperGrafx = \"supergrafx\",\n SuperVision = \"supervision\",\n SupraCan = \"supracan\",\n Switch = \"switch\",\n TgCd = \"tg-cd\",\n TG16 = \"tg16\",\n TI99 = \"ti99\",\n TIC80 = \"tic80\",\n TO8 = \"to8\",\n TRS80 = \"trs-80\",\n TypeX = \"type-x\",\n Uzebox = \"uzebox\",\n Vectrex = \"vectrex\",\n Vic20 = \"vic20\",\n VideoPac = \"videopac\",\n Vircon32 = \"vircon32\",\n VirtualBoy = \"virtualboy\",\n VPinball = \"vpinball\",\n VSmile = \"vsmile\",\n Wasm4 = \"wasm4\",\n Wii = \"wii\",\n WiiU = \"wiiu\",\n Windows = \"windows\",\n Windows3X = \"windows3x\",\n Windows9X = \"windows9x\",\n WonderSwan = \"wonderswan\",\n WonderSwanColor = \"wonderswancolor\",\n X1 = \"x1\",\n X68000 = \"x68000\",\n Xbox = \"xbox\",\n Xbox360 = \"xbox360\",\n XboxOne = \"xboxone\",\n ZMachine = \"zmachine\",\n Zx81 = \"zx81\",\n ZxSpectrum = \"zxspectrum\",\n}\n\nconst ZRomulatorSystemIdMap = keyBy(Object.values(ZRomulatorSystemId));\n\n/**\n * Gets whether a candidate string represents a system id.\n *\n * This check is case sensitive.\n *\n * @param candidate -\n * The candidate to check.\n *\n * @returns\n * True if candidate is a string that represents a system id.\n */\nexport function isSystemId(candidate: any): candidate is ZRomulatorSystemId {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(ZRomulatorSystemIdMap, candidate)\n );\n}\n","import { get, isUndefined, omitBy } from \"lodash-es\";\nimport {\n ZRomulatorPlayersBuilder,\n type IZRomulatorPlayers,\n} from \"../players/players.mjs\";\nimport { ZRomulatorSystemId } from \"../system/system-id.mjs\";\n\n/**\n * Represents a rom file or image.\n */\nexport interface IZRomulatorGame {\n /**\n * The id of the game.\n *\n * This is unique across all games and all systems.\n */\n id: string;\n\n /**\n * The name of the game.\n *\n * This is not unique across systems. For example,\n * Battletoads and Double Dragon has the same name\n * across 3 different systems.\n */\n name: string;\n\n /**\n * The fully qualified path to the game file.\n */\n file: string;\n\n /**\n * The system id that this game belongs to.\n */\n system: ZRomulatorSystemId;\n\n /**\n * The date the game was released.\n */\n release: string;\n\n /**\n * The developer studio.\n */\n developer: string;\n\n /**\n * The publisher studio.\n */\n publisher: string;\n\n /**\n * The game description.\n */\n description: string;\n\n /**\n * The player information.\n */\n players: IZRomulatorPlayers;\n}\n\n/**\n * A builder for the IZRomulatorGame model.\n */\nexport class ZRomulatorGameBuilder {\n private _game: IZRomulatorGame = {\n id: \"\",\n name: \"\",\n file: \"\",\n system: ZRomulatorSystemId.Adam,\n release: \"\",\n description: \"\",\n developer: \"\",\n publisher: \"\",\n players: new ZRomulatorPlayersBuilder().build(),\n };\n\n /**\n * Sets the unique id for the game.\n *\n * @param id -\n * The unique identifier across all games and systems.\n * @returns\n * This instance.\n */\n public id(id: string): this {\n this._game.id = id;\n return this;\n }\n\n /**\n * Sets the display name for the game.\n *\n * @param name -\n * The canonical display name for the game.\n * @returns\n * This instance.\n */\n public name(name: string): this {\n this._game.name = name;\n return this;\n }\n\n /**\n * Sets the file path for the rom.\n *\n * @param path -\n * The fully qualified path to the game file.\n * @returns\n * This instance.\n */\n public file(path: string): this {\n this._game.file = path;\n return this;\n }\n\n /**\n * Sets the system the game belongs to.\n *\n * @param system -\n * The owning system id.\n * @returns\n * This instance.\n */\n public system(system: ZRomulatorSystemId): this {\n this._game.system = system;\n return this;\n }\n\n /**\n * Sets the release date for the game.\n *\n * @param release -\n * The release information for the game.\n * @returns\n * This instance.\n */\n public release(release: string): this {\n this._game.release = release;\n return this;\n }\n\n /**\n * Sets the developer studio for the game.\n *\n * @param developer -\n * The developer name.\n * @returns\n * This instance.\n */\n public developer(developer: string): this {\n this._game.developer = developer;\n return this;\n }\n\n /**\n * Sets the publisher studio for the game.\n *\n * @param publisher -\n * The publisher name.\n * @returns\n * This instance.\n */\n public publisher(publisher: string): this {\n this._game.publisher = publisher;\n return this;\n }\n\n /**\n * Sets the description for the game.\n *\n * @param description -\n * The game description.\n * @returns\n * This instance.\n */\n public description(description: string): this {\n this._game.description = description;\n return this;\n }\n\n /**\n * Sets the player configuration for the game.\n *\n * @param players -\n * The player configuration.\n * @returns\n * This instance.\n */\n public players(players: IZRomulatorPlayers): this {\n this._game.players = new ZRomulatorPlayersBuilder().copy(players).build();\n return this;\n }\n\n private parseDeveloper(candidate: object): this {\n const developer = get(candidate, \"developer\");\n\n return typeof developer === \"string\" ? this.developer(developer) : this;\n }\n\n private parsePublisher(candidate: object): this {\n const publisher = get(candidate, \"publisher\");\n\n return typeof publisher === \"string\" ? this.publisher(publisher) : this;\n }\n\n private parseReleaseDate(candidate: object): this {\n const release = get(candidate, \"release\");\n\n return typeof release == \"string\" ? this.release(release) : this;\n }\n\n private parsePlayers(candidate: object): this {\n const players = get(candidate, \"players\");\n\n return this.players(\n new ZRomulatorPlayersBuilder()\n .copy(this._game.players)\n .parse(players)\n .build(),\n );\n }\n\n private parseDescription(candidate: object): this {\n const description = get(candidate, \"description\");\n\n return typeof description === \"string\"\n ? this.description(description)\n : this;\n }\n\n private parseName(candidate: object): this {\n const name = get(candidate, \"name\");\n\n return typeof name === \"string\" ? this.name(name) : this;\n }\n\n /**\n * Attempts to parse a game from a game entry in a system.json game\n * list.\n *\n * @param candidate -\n * The candidate to parse.\n *\n * @returns\n * This object.\n */\n public parse(candidate: unknown): this {\n if (candidate == null || typeof candidate !== \"object\") {\n return this;\n }\n\n return this.parseName(candidate)\n .parseDescription(candidate)\n .parsePlayers(candidate)\n .parseReleaseDate(candidate)\n .parseDeveloper(candidate)\n .parsePublisher(candidate);\n }\n\n /**\n * Copies an existing game into this builder.\n *\n * @param other -\n * The other game to copy.\n * @returns\n * This instance.\n */\n public copy(other: IZRomulatorGame): this {\n this._game = structuredClone(other);\n return this;\n }\n\n /**\n * Builds the game instance.\n *\n * @returns\n * A structured clone of the current game with undefined properties removed.\n */\n public build() {\n const clone = structuredClone(this._game);\n return omitBy(clone, isUndefined) as IZRomulatorGame;\n }\n}\n","import { keyBy } from \"lodash-es\";\n\nexport enum ZRomulatorGameMediaType {\n /**\n * A 3d representation of the box art.\n */\n Box3d = \"3dboxes\",\n /**\n * Back of the game box.\n */\n BackCover = \"backcovers\",\n /**\n * Front of the game box.\n */\n Cover = \"covers\",\n /**\n * Fan art.\n */\n FanArt = \"fanart\",\n /**\n * Game manual.\n */\n Manual = \"manuals\",\n /**\n * A marquee of a game.\n */\n Marquee = \"marquees\",\n /**\n * The cartridge or disc label.\n */\n PhysicalMedia = \"physicalmedia\",\n /**\n * An in game screenshot showcasing gameplay.\n */\n Screenshot = \"screenshots\",\n /**\n * An in game screenshot of the title screen.\n */\n Title = \"titlescreens\",\n /**\n * A video showcasing the game.\n */\n Video = \"videos\",\n}\n\n/**\n * Media type for a system.\n */\nexport enum ZRomulatorSystemMediaType {\n /**\n * An image of a system's controller.\n */\n Controller = \"controller\",\n /**\n * A picture of the system.\n *\n * These are real life looking photos of what\n * a system looks like.\n */\n Picture = \"picture\",\n /**\n * A wheel for a system.\n *\n * This is basically the logo.\n */\n Wheel = \"wheel\",\n}\n\n/**\n * Describes what a specific piece of media represents.\n */\nexport type ZRomulatorMediaType =\n | ZRomulatorSystemMediaType\n | ZRomulatorGameMediaType;\n\nconst ZRomulatorSystemMediaTypeMap = keyBy(\n Object.values(ZRomulatorSystemMediaType),\n);\nconst ZRomulatorGameMediaTypeMap = keyBy(\n Object.values(ZRomulatorGameMediaType),\n);\n\nexport function isSystemMediaType(\n candidate: any,\n): candidate is ZRomulatorSystemMediaType {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(\n ZRomulatorSystemMediaTypeMap,\n candidate,\n )\n );\n}\n\nexport function isGameMediaType(\n candidate: any,\n): candidate is ZRomulatorGameMediaType {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(ZRomulatorGameMediaTypeMap, candidate)\n );\n}\n\nexport function isMediaType(candidate: any): candidate is ZRomulatorMediaType {\n return isSystemMediaType(candidate) || isGameMediaType(candidate);\n}\n","import { isUndefined, kebabCase, omitBy } from \"lodash-es\";\nimport { basename, extname, sep } from \"node:path\";\nimport type { ZRomulatorSystemId } from \"../system/system-id.mjs\";\nimport { isSystemId } from \"../system/system-id.mjs\";\nimport {\n isGameMediaType,\n isSystemMediaType,\n type ZRomulatorMediaType,\n} from \"./media-type.mjs\";\n\n/**\n * Represents a piece of media for a game or system.\n */\nexport interface IZRomulatorMedia {\n /**\n * The id of the media.\n */\n id?: string;\n\n /**\n * The id of the system that the media maps to.\n */\n system?: ZRomulatorSystemId;\n\n /**\n * The type of media this represents.\n */\n type?: ZRomulatorMediaType;\n\n /**\n * The id slug of the game if this media represents game media.\n */\n game?: string;\n\n /**\n * The name of the file.\n */\n fileName?: string;\n\n /**\n * The full url path for the media.\n */\n url?: string;\n}\n\n/**\n * A builder for the media object.\n */\nexport class ZRomulatorMediaBuilder {\n private _media: IZRomulatorMedia = {};\n\n public id(id: string) {\n this._media.id = id;\n return this;\n }\n\n public type(type: ZRomulatorMediaType) {\n this._media.type = type;\n return this;\n }\n\n public system(system: ZRomulatorSystemId) {\n this._media.system = system;\n return this;\n }\n\n public game(game: string | undefined) {\n this._media.game = game;\n return this;\n }\n\n public filename(name: string) {\n this._media.fileName = name;\n return this;\n }\n\n public url(url: string) {\n this._media.url = url;\n return this;\n }\n\n public from(path: string) {\n const hierarchy = path.split(sep);\n let builder = this.url(path);\n\n // The media structure is split into 2 or 3 parts\n // fileName = game file name or system media type name\n // parent = media type for games or system type for systems\n // grandparent = system type for games.\n\n const fileName = hierarchy[hierarchy.length - 1];\n const parent = hierarchy[hierarchy.length - 2];\n const grandparent = hierarchy[hierarchy.length - 3];\n\n if (!fileName) {\n // If we don't even have a file name - then this\n // isn't even media at all.\n return builder;\n }\n\n builder = builder.filename(fileName);\n const ext = extname(fileName);\n const title = basename(fileName, ext);\n\n if (isSystemMediaType(title) && isSystemId(parent)) {\n // This is media for system hardware\n const id = `${parent}-${kebabCase(title)}`;\n return builder.id(id).system(parent).type(title).game(undefined);\n }\n\n if (fileName && isGameMediaType(parent) && isSystemId(grandparent)) {\n // This is media for a game that is supported. The id for a game\n // is the system id followed by the kebab case of the title, followed\n // by the media type.\n const game = kebabCase(title);\n const id = `${grandparent}-${game}-${parent}`;\n return builder.id(id).system(grandparent).type(parent).game(game);\n }\n\n return builder;\n }\n\n public build() {\n const clone = structuredClone(this._media);\n return omitBy(clone, isUndefined) as IZRomulatorMedia;\n }\n}\n","import type { IZSerialize, ZOptional } from \"@zthun/helpful-fn\";\nimport type { IZRomulatorPlayers } from \"./players.mjs\";\n\n/**\n * Represents a serializer for a players object.\n *\n * The serialized form of players is a single digit if min and max are equal, or\n * a range string of #min-#max if they are different.\n */\nexport class ZRomulatorPlayersSerialize\n implements IZSerialize<IZRomulatorPlayers>\n{\n public serialize(\n candidate: ZOptional<IZRomulatorPlayers>,\n ): string | undefined {\n if (candidate == null) {\n return undefined;\n }\n\n const { min, max } = candidate;\n\n return min === max ? `${min}` : `${min}-${max}`;\n }\n}\n","import { keyBy } from \"lodash-es\";\n\n/**\n * The type of media content for a system.\n */\nexport enum ZRomulatorSystemContentType {\n /**\n * No idea\n */\n Unknown = \"unknown\",\n /**\n * Uses memory roms.\n */\n ReadOnlyMemory = \"rom\",\n /**\n * Folder based game with a known structure.\n */\n Folder = \"folder\",\n /**\n * Executable file.\n */\n File = \"file\",\n /**\n * Spinning disk media.\n */\n Disk = \"iso\",\n}\n\nconst ZRomulatorSystemContentTypeMap = keyBy(\n Object.values(ZRomulatorSystemContentType),\n);\n\n/**\n * Gets whether a candidate string represents a system content type.\n *\n * This check is case sensitive.\n *\n * @param candidate -\n * The candidate to check.\n *\n * @returns\n * True if candidate is a string that represents a system content type.\n */\nexport function isSystemContentType(\n candidate: any,\n): candidate is ZRomulatorSystemContentType {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(\n ZRomulatorSystemContentTypeMap,\n candidate,\n )\n );\n}\n","import { keyBy } from \"lodash-es\";\n\n/**\n * Describes the type of hardware a system is.\n */\nexport enum ZRomulatorSystemHardwareType {\n /**\n * No idea what this is.\n */\n Unknown = \"unknown\",\n /**\n * An accessory that attaches to another system.\n */\n Accessory = \"accessory\",\n\n /**\n * A cabinet system\n */\n Arcade = \"arcade\",\n\n /**\n * Known computer systems\n */\n Computer = \"computer\",\n\n /**\n * A console system.\n */\n Console = \"console\",\n\n /**\n * Pinball\n */\n Flipper = \"flipper\",\n\n /**\n * A handheld system\n */\n Handheld = \"console-portable\",\n\n /**\n * Script Creation Utility.\n */\n ScummVm = \"scummvm\",\n\n /**\n * Phone based system\n */\n Smartphone = \"smartphone\",\n\n /**\n * Virtual machine based system.\n */\n VirtualMachine = \"virtual-machine\",\n}\n\nconst ZRomulatorSystemHardwareTypeMap = keyBy(\n Object.values(ZRomulatorSystemHardwareType),\n);\n\n/**\n * Gets whether a candidate string represents a system hardware type.\n *\n * This check is case sensitive.\n *\n * @param candidate -\n * The candidate to check.\n *\n * @returns\n * True if candidate is a string that represents a system hardware type.\n */\nexport function isSystemHardwareType(\n candidate: any,\n): candidate is ZRomulatorSystemHardwareType {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(\n ZRomulatorSystemHardwareTypeMap,\n candidate,\n )\n );\n}\n","import { keyBy } from \"lodash-es\";\n\n/**\n * The type of media a system supports.\n */\nexport enum ZRomulatorSystemMediaFormat {\n /**\n * No idea\n */\n Unknown = \"unknown\",\n /**\n * Cartridge based systems.\n */\n Cartridge = \"cartridge\",\n\n /**\n * Motherboard based systems.\n *\n * Usually for arcades.\n */\n Pcb = \"pcb\",\n\n /**\n * CD/DVD based systems.\n */\n Cd = \"cd\",\n\n /**\n * Floppy disk based systems.\n */\n FloppyDisk = \"floppy-disk\",\n}\n\nconst ZRomulatorSystemMediaFormatMap = keyBy(\n Object.values(ZRomulatorSystemMediaFormat),\n);\n\n/**\n * Gets whether a candidate string represents a system media format.\n *\n * This check is case sensitive.\n *\n * @param candidate -\n * The candidate to check.\n *\n * @returns\n * True if candidate is a string that represents a system media format.\n */\nexport function isSystemMediaFormat(\n candidate: any,\n): candidate is ZRomulatorSystemMediaFormat {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(\n ZRomulatorSystemMediaFormatMap,\n candidate,\n )\n );\n}\n","import { castExtension } from \"@zthun/helpful-fn\";\nimport { castArray, get, lowerCase, uniqBy } from \"lodash-es\";\nimport {\n isSystemContentType,\n ZRomulatorSystemContentType,\n} from \"./system-content-type.mjs\";\nimport {\n isSystemHardwareType,\n ZRomulatorSystemHardwareType,\n} from \"./system-hardware-type.mjs\";\nimport { isSystemId, ZRomulatorSystemId } from \"./system-id.mjs\";\nimport {\n isSystemMediaFormat,\n ZRomulatorSystemMediaFormat,\n} from \"./system-media-format-type.mjs\";\n\n/**\n * Represents a system in romulator.\n *\n * These are detected by the file system.\n * See ES-DE for the standard directory\n * structure.\n */\nexport interface IZRomulatorSystem {\n /**\n * Unique identifier for the system.\n *\n * If you think about the directory structure\n * for ES-DE or retro-pie, for example, the id\n * would map to the name of the system directory.\n *\n * This is essentially a slug.\n */\n id: ZRomulatorSystemId;\n\n /**\n * The list of file extensions that system supports.\n *\n * Extensions, zip and 7z, should always be in this list.\n */\n extensions: string[];\n\n /**\n * Type classifications for the system.\n */\n classification: {\n /**\n * What type of system the hardware is.\n *\n * @example 'console'\n */\n hardwareType: ZRomulatorSystemHardwareType;\n\n /**\n * The type of media format.\n */\n mediaFormat: ZRomulatorSystemMediaFormat;\n\n /**\n * The digital format of the game media.\n */\n contentType: ZRomulatorSystemContentType;\n };\n\n /**\n * The canonical name of the system.\n *\n * This is the most globally recognized name,\n * not the historical accurate name for each\n * and every region.\n */\n name: string;\n\n /**\n * The company that published the system.\n */\n company: string;\n\n /**\n * The years the system was in production until.\n */\n productionYears: {\n /**\n * The first year the system went into production.\n *\n * Uses ? if we are not sure.\n */\n start: number | \"?\";\n /**\n * The year when production stopped.\n *\n * Current implies that production is still happening.\n */\n end: number | \"current\";\n };\n}\n\n/**\n * A builder for creating an IZRomulatorSystem.\n */\nexport class ZRomulatorSystemBuilder {\n private _system: IZRomulatorSystem = {\n id: ZRomulatorSystemId.Nintendo,\n name: \"\",\n\n classification: {\n hardwareType: ZRomulatorSystemHardwareType.Unknown,\n mediaFormat: ZRomulatorSystemMediaFormat.Unknown,\n contentType: ZRomulatorSystemContentType.Unknown,\n },\n\n company: \"\",\n\n productionYears: {\n start: \"?\",\n end: \"current\",\n },\n\n extensions: [\".zip\", \".7z\"],\n };\n\n /**\n * Sets the id (slug) of the system.\n *\n * @param id -\n * The unique identifier for the system.\n *\n * @returns\n * This instance.\n */\n public id(id: ZRomulatorSystemId): this {\n this._system.id = id;\n\n return this;\n }\n\n /**\n * Sets the canonical name of the system.\n *\n * @param name -\n * The canonical name of the system.\n *\n * @returns\n * This instance.\n */\n public name(name: string): this {\n this._system.name = name;\n\n return this;\n }\n\n /**\n * Sets the company that published the system.\n *\n * @param name -\n * The name of the company.\n *\n * @returns\n * This instance.\n */\n public company(name: string): this {\n this._system.company = name;\n\n return this;\n }\n\n /**\n * Sets the system hardware type.\n *\n * @param type -\n * The system hardware type.\n *\n * @returns\n * This instance.\n */\n public hardware(type: ZRomulatorSystemHardwareType): this {\n this._system.classification.hardwareType = type;\n\n return this;\n }\n\n /**\n * Sets the system media format.\n *\n * @param type -\n * The system media format.\n *\n * @returns\n * This instance.\n */\n public mediaFormat(type: ZRomulatorSystemMediaFormat): this {\n this._system.classification.mediaFormat = type;\n\n return this;\n }\n\n /**\n * Sets the system content type.\n *\n * @param type -\n * The system content type.\n *\n * @returns\n * This instance.\n */\n public contentType(type: ZRomulatorSystemContentType): this {\n this._system.classification.contentType = type;\n return this;\n }\n\n /**\n * Sets the production start value.\n *\n * @param start -\n * The year the system was released into production.\n * Use '?' if you do not know this information.\n *\n * @returns\n * This object.\n */\n public productionStart(start: number | \"?\") {\n this._system.productionYears.start = start;\n\n return this;\n }\n\n /**\n * Sets the production end of life value.\n *\n * @param end -\n * The end of life year. Set to current\n * to mark no end of life.\n *\n * @returns\n * This object.\n */\n public productionEnd(end: number | \"current\") {\n this._system.productionYears.end = end;\n\n return this;\n }\n\n /**\n * Sets the full production run.\n *\n * @param start -\n * The starting year of production.\n * @param end -\n * The last year of production.\n *\n * @returns\n * This object.\n */\n public production(\n start: number | \"?\" = \"?\",\n end: number | \"current\" = \"current\",\n ) {\n return this.productionStart(start).productionEnd(end);\n }\n\n /**\n * Adds to the extension list.\n *\n * @param extension -\n * The extension or list of extensions to add.\n *\n * @returns\n * This object.\n */\n public extension(extension: string | string[]) {\n const current = this._system.extensions.slice();\n const extensions = castArray(extension).map((e) => castExtension(e));\n const unique = uniqBy(current.concat(extensions), lowerCase);\n\n this._system.extensions = unique\n .filter((e) => e != null)\n .map((e) => e?.toLowerCase());\n\n return this;\n }\n\n private parseId(candidate: object) {\n const id = get(candidate, \"id\");\n\n return isSystemId(id) ? this.id(id) : this;\n }\n\n private parseName(candidate: object) {\n const name = get(candidate, \"name\");\n\n return name != null && typeof name === \"string\" ? this.name(name) : this;\n }\n\n private parseCompany(candidate: object) {\n const company = get(candidate, \"company\");\n\n return company != null && typeof company === \"string\"\n ? this.company(company)\n : this;\n }\n\n private parseExtensions(candidate: object) {\n const extensions = castArray(get(candidate, \"extensions\"))\n .filter((ext) => ext != null)\n .filter((ext) => typeof ext === \"string\")\n .map((ext) => castExtension(ext));\n\n return this.extension(extensions);\n }\n\n private parseHardwareType(classification: object) {\n const hardwareType = get(classification, \"hardwareType\");\n\n return isSystemHardwareType(hardwareType)\n ? this.hardware(hardwareType)\n : this;\n }\n\n private parseMediaFormat(classification: object) {\n const mediaFormat = get(classification, \"mediaFormat\");\n\n return isSystemMediaFormat(mediaFormat)\n ? this.mediaFormat(mediaFormat)\n : this;\n }\n\n private parseContentType(classification: object) {\n const contentType = get(classification, \"contentType\");\n\n return isSystemContentType(contentType)\n ? this.contentType(contentType)\n : this;\n }\n\n private parseClassification(candidate: object) {\n const classification = get(candidate, \"classification\");\n\n return classification != null && typeof classification === \"object\"\n ? this.parseHardwareType(classification)\n .parseMediaFormat(classification)\n .parseContentType(classification)\n : this;\n }\n\n private parseProductionStart(productionYears: object) {\n const start = get(productionYears, \"start\");\n\n return typeof start === \"number\" || start === \"?\"\n ? this.productionStart(start)\n : this;\n }\n\n private parseProductionEnd(productionYears: object) {\n const end = get(productionYears, \"end\");\n\n return typeof end === \"number\" || end === \"current\"\n ? this.productionEnd(end)\n : this;\n }\n\n private parseProductionYears(candidate: object) {\n const production = get(candidate, \"productionYears\");\n\n return production != null && typeof production === \"object\"\n ? this.parseProductionStart(production).parseProductionEnd(production)\n : this;\n }\n\n /**\n * Parses an unknown object to try and build a system from it.\n *\n * @param candidate -\n * The candidate to try and parse.\n *\n * @returns\n * This object.\n */\n public parse(candidate: unknown) {\n if (candidate == null || typeof candidate !== \"object\") {\n return this;\n }\n\n this.parseId(candidate)\n .parseName(candidate)\n .parseCompany(candidate)\n .parseExtensions(candidate)\n .parseClassification(candidate)\n .parseProductionYears(candidate);\n\n return this;\n }\n\n /**\n * Builds the system instance.\n *\n * @returns\n * A structured clone of the current system\n * that has been built.\n */\n public build() {\n return structuredClone(this._system);\n }\n}\n"],"names":["ZRomulatorConfigGamesMetadata","all","gamesFolder","ZMetadataBuilder","id","path","name","fallback","editable","file","build","ZRomulatorConfigGamesBuilder","games","_config","copy","other","structuredClone","assign","_define_property","ZRomulatorConfigId","ZRomulatorConfigBuilder","avatar","description","contents","metadata","meta","firstDefined","concat","castArray","ZRomulatorPlayersBuilder","min","players","_players","max","range","parseMax","candidate","get","parseMin","parse","singlePlayer","bind","twoPlayer","fourPlayer","eightPlayer","ZRomulatorSystemId","ZRomulatorSystemIdMap","keyBy","Object","values","isSystemId","prototype","hasOwnProperty","call","ZRomulatorGameBuilder","_game","system","release","developer","publisher","parseDeveloper","parsePublisher","parseReleaseDate","parsePlayers","parseDescription","parseName","clone","omitBy","isUndefined","Adam","ZRomulatorGameMediaType","ZRomulatorSystemMediaType","ZRomulatorSystemMediaTypeMap","ZRomulatorGameMediaTypeMap","isSystemMediaType","isGameMediaType","isMediaType","ZRomulatorMediaBuilder","_media","type","game","filename","fileName","url","from","hierarchy","split","sep","builder","length","parent","grandparent","ext","extname","title","basename","kebabCase","undefined","ZRomulatorPlayersSerialize","serialize","ZRomulatorSystemContentType","ZRomulatorSystemContentTypeMap","isSystemContentType","ZRomulatorSystemHardwareType","ZRomulatorSystemHardwareTypeMap","isSystemHardwareType","ZRomulatorSystemMediaFormat","ZRomulatorSystemMediaFormatMap","isSystemMediaFormat","ZRomulatorSystemBuilder","_system","company","hardware","classification","hardwareType","mediaFormat","contentType","productionStart","start","productionYears","productionEnd","end","extension","current","extensions","slice","map","e","castExtension","unique","uniqBy","lowerCase","filter","toLowerCase","parseId","parseCompany","parseExtensions","parseHardwareType","parseMediaFormat","parseContentType","parseClassification","parseProductionStart","parseProductionEnd","parseProductionYears","production","Nintendo","Unknown"],"mappings":";;;;;;;;;AAEO,MAAeA,6BAAAA,CAAAA;AACpB,IAAA,OAAcC,GAAoB,GAAA;QAChC,OAAO;AAACD,YAAAA,6BAAAA,CAA8BE,WAAW;AAAG,SAAA;AACtD;AAEA,IAAA,OAAcA,WAA0B,GAAA;AACtC,QAAA,OAAO,IAAIC,6BACRC,EAAAA,CAAAA,EAAE,CAAC,cACHC,CAAAA,CAAAA,IAAI,CAAC,aACLC,CAAAA,CAAAA,IAAI,CAAC,cAAA,CAAA,CACLC,QAAQ,CAAC,eAAA,CAAA,CACTC,QAAQ,EACRC,CAAAA,IAAI,GACJC,KAAK,EAAA;AACV;AACF;;;;;;;;;;;;;;;ACbO,MAAMC,4BAAAA,CAAAA;AAGJT,IAAAA,WAAAA,CAAYU,KAAa,EAAQ;AACtC,QAAA,IAAI,CAACC,OAAO,CAACX,WAAW,GAAGU,KAAAA;AAC3B,QAAA,OAAO,IAAI;AACb;AAEOE,IAAAA,IAAAA,CAAKC,KAA6B,EAAE;QACzC,IAAI,CAACF,OAAO,GAAGG,eAAgBD,CAAAA,KAAAA,CAAAA;AAC/B,QAAA,OAAO,IAAI;AACb;AAEOE,IAAAA,MAAAA,CAAOF,KAAsC,EAAE;QACpD,IAAI,CAACF,OAAO,GAAG;YAAE,GAAG,IAAI,CAACA,OAAO;AAAE,YAAA,GAAGE;AAAM,SAAA;AAC3C,QAAA,OAAO,IAAI;AACb;IAEOL,KAAgC,GAAA;QACrC,OAAOM,eAAAA,CAAgB,IAAI,CAACH,OAAO,CAAA;AACrC;;AAnBA,QAAAK,kBAAA,CAAA,IAAA,EAAQL,WAAkC,EAAC,CAAA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CAAC7B,SACVmG,CAAAA,CAAAA,YAAY,CAACnG,SAAAA,CAAAA,CACboG,eAAe,CAACpG,SAAAA,CAAAA,CAChBwG,mBAAmB,CAACxG,SAAAA,CAAAA,CACpB2G,oBAAoB,CAAC3G,SAAAA,CAAAA;AAExB,QAAA,OAAO,IAAI;AACb;AAEA;;;;;;AAMC,MACD,KAAe,GAAA;QACb,OAAOpB,eAAAA,CAAgB,IAAI,CAAC8F,OAAO,CAAA;AACrC;;AA5SA,QAAA,gBAAA,CAAA,IAAA,EAAQA,SAA6B,EAAA;AACnC1G,YAAAA,EAAAA,EAAIyC,mBAAmBoG,QAAQ;YAC/B3I,IAAM,EAAA,EAAA;YAEN2G,cAAgB,EAAA;AACdC,gBAAAA,YAAAA,EAAcX,6BAA6B2C,OAAO;AAClD/B,gBAAAA,WAAAA,EAAaT,4BAA4BwC,OAAO;AAChD9B,gBAAAA,WAAAA,EAAahB,4BAA4B8C;AAC3C,aAAA;YAEAnC,OAAS,EAAA,EAAA;YAETQ,eAAiB,EAAA;gBACfD,KAAO,EAAA,GAAA;gBACPG,GAAK,EAAA;AACP,aAAA;YAEAG,UAAY,EAAA;AAAC,gBAAA,MAAA;AAAQ,gBAAA;AAAM;AAC7B,SAAA,CAAA;;AA2RF;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/config/config-games-metadata.mts","../src/config/config-games.mts","../src/config/config.mts","../src/players/players.mts","../src/system/system-id.mts","../src/game/game.mts","../src/media/media-type.mts","../src/media/media.mts","../src/players/players-serialize.mts","../src/system/system-content-type.mts","../src/system/system-hardware-type.mts","../src/system/system-media-format-type.mts","../src/system/system.mts"],"sourcesContent":["import { ZMetadataBuilder, type IZMetadata } from \"@zthun/helpful-query\";\n\nexport abstract class ZRomulatorConfigGamesMetadata {\n public static all(): IZMetadata[] {\n return [ZRomulatorConfigGamesMetadata.gamesFolder()];\n }\n\n public static gamesFolder(): IZMetadata {\n return new ZMetadataBuilder()\n .id(\"games-folder\")\n .path(\"gamesFolder\")\n .name(\"Games Folder\")\n .fallback(\"${HOME}/Games\")\n .editable()\n .file()\n .build();\n }\n}\n","export interface IZRomulatorConfigGames {\n gamesFolder?: string;\n}\n\nexport class ZRomulatorConfigGamesBuilder {\n private _config: IZRomulatorConfigGames = {};\n\n public gamesFolder(games: string): this {\n this._config.gamesFolder = games;\n return this;\n }\n\n public copy(other: IZRomulatorConfigGames) {\n this._config = structuredClone(other);\n return this;\n }\n\n public assign(other: Partial<IZRomulatorConfigGames>) {\n this._config = { ...this._config, ...other };\n return this;\n }\n\n public build(): IZRomulatorConfigGames {\n return structuredClone(this._config);\n }\n}\n","import { firstDefined } from \"@zthun/helpful-fn\";\nimport type { IZMetadata } from \"@zthun/helpful-query\";\nimport { castArray } from \"lodash-es\";\n\n/**\n * Represents a list of known config ids\n */\nexport enum ZRomulatorConfigId {\n /**\n * Config for games.\n */\n Games = \"games\",\n\n /**\n * Config id for media.\n */\n Media = \"media\",\n}\n\nexport interface IZRomulatorConfig<T = any> {\n id: ZRomulatorConfigId;\n name: string;\n\n avatar?: string;\n contents?: T;\n description?: string;\n file: string;\n metadata?: IZMetadata[];\n}\n\nexport class ZRomulatorConfigBuilder<T = any> {\n private _config: IZRomulatorConfig<T> = {\n id: ZRomulatorConfigId.Games,\n name: \"\",\n file: \"\",\n };\n\n public id(id: ZRomulatorConfigId) {\n this._config.id = id;\n return this;\n }\n\n public avatar(id: string) {\n this._config.avatar = id;\n return this;\n }\n\n public name(name: string) {\n this._config.name = name;\n return this;\n }\n\n public description(description: string) {\n this._config.description = description;\n return this;\n }\n\n public file(path: string) {\n this._config.file = path;\n return this;\n }\n\n public contents(contents?: T) {\n this._config.contents = contents;\n return this;\n }\n\n public metadata(meta: IZMetadata | IZMetadata[]) {\n const metadata = firstDefined([], this._config.metadata);\n this._config.metadata = metadata.concat(castArray(meta));\n return this;\n }\n\n public copy(other: IZRomulatorConfig<T>) {\n this._config = structuredClone(other);\n return this;\n }\n\n public build() {\n return structuredClone(this._config);\n }\n}\n","import { get } from \"lodash-es\";\n\n/**\n * Represents a player range for a game.\n */\nexport interface IZRomulatorPlayers {\n /**\n * The minimum number of players.\n *\n * This is almost always (read 99.99%)\n * 1.\n */\n min: number;\n /**\n * The maximum number of players.\n */\n max: number;\n}\n\n/**\n * Creates player range instances\n */\nexport class ZRomulatorPlayersBuilder {\n private _players: IZRomulatorPlayers = { min: 1, max: 1 };\n\n /**\n * Sets the minimum supported players.\n *\n * @param players -\n * Minimum number of players.\n *\n * @returns\n * This object.\n */\n public min(players: number) {\n this._players.min = players;\n return this;\n }\n\n /**\n * Sets the maximum supported players.\n *\n * @param players -\n * Maximum number of players.\n *\n * @returns\n * This object.\n */\n public max(players: number) {\n this._players.max = players;\n return this;\n }\n\n private range(min: number, max: number) {\n return this.min(min).max(max);\n }\n\n /**\n * Sets the player count to 1 player for both min and max.\n *\n * @returns\n * This object.\n */\n public singlePlayer = this.range.bind(this, 1, 1);\n\n /**\n * Sets the player count to 2 for max and 1 for min.\n *\n * @returns\n * This object.\n */\n public twoPlayer = this.range.bind(this, 1, 2);\n\n /**\n * Sets the player count to 4 for max and 1 for min.\n *\n * @returns\n * This object.\n */\n public fourPlayer = this.range.bind(this, 1, 4);\n\n /**\n * Sets the player count to 8 for max and 1 for min.\n *\n * @returns\n * This object.\n */\n public eightPlayer = this.range.bind(this, 1, 8);\n\n private parseMax(candidate: object) {\n const max = get(candidate, \"max\");\n\n return typeof max === \"number\" ? this.max(max) : this;\n }\n\n private parseMin(candidate: object) {\n const min = get(candidate, \"min\");\n\n return typeof min === \"number\" ? this.min(min) : this;\n }\n\n /**\n * Attempts to read player range values from an arbitrary candidate.\n *\n * @param candidate -\n * Source object to inspect.\n *\n * @returns\n * This object.\n */\n public parse(candidate: unknown) {\n if (candidate == null || typeof candidate !== \"object\") {\n return this;\n }\n\n return this.parseMin(candidate).parseMax(candidate);\n }\n\n /**\n * Copies an existing player range into this builder.\n *\n * @param other -\n * Players object to duplicate.\n *\n * @returns\n * This object\n */\n public copy(other: IZRomulatorPlayers) {\n this._players = structuredClone(other);\n return this;\n }\n\n /**\n * Creates the final player range instance.\n *\n * @returns\n * A cloned IZRomulatorPlayers instance.\n */\n public build() {\n return structuredClone(this._players);\n }\n}\n","import { keyBy } from \"lodash-es\";\n\n/**\n * Id slugs for supported systems.\n */\nexport enum ZRomulatorSystemId {\n ThreeDo = \"3do\",\n Adam = \"adam\",\n Amiga = \"amiga\",\n Amiga1200 = \"amiga1200\",\n Amiga600 = \"amiga600\",\n AmigaCd32 = \"amigacd32\",\n AmstradCpc = \"amstradcpc\",\n Android = \"android\",\n Apple2 = \"apple2\",\n Apple2Gs = \"apple2gs\",\n Arcade = \"arcade\",\n Arcadia = \"arcadia\",\n Archimedes = \"archimedes\",\n Arduboy = \"arduboy\",\n Astrocde = \"astrocde\",\n Atari2600 = \"atari2600\",\n Atari5200 = \"atari5200\",\n Atari7800 = \"atari7800\",\n Atari800 = \"atari800\",\n AtariJaguar = \"atarijaguar\",\n AtariJaguarCd = \"atarijaguarcd\",\n AtariLynx = \"atarilynx\",\n AtariSt = \"atarist\",\n Atomiswave = \"atomiswave\",\n BbcMicro = \"bbcmicro\",\n C64 = \"c64\",\n CdiMono1 = \"cdimono1\",\n Cdtv = \"cdtv\",\n ChannelF = \"channelf\",\n Coco = \"coco\",\n Colecovision = \"colecovision\",\n Cps = \"cps\",\n Cps1 = \"cps1\",\n Cps2 = \"cps2\",\n Cps3 = \"cps3\",\n CrVision = \"crvision\",\n Daphne = \"daphne\",\n Dos = \"dos\",\n Dragon32 = \"dragon32\",\n Dreamcast = \"dreamcast\",\n EasyRpg = \"easyrpg\",\n Electron = \"electron\",\n Famicom = \"famicom\",\n FBA = \"fba\",\n FBNeo = \"fbneo\",\n FDS = \"fds\",\n FM7 = \"fm7\",\n FMTowns = \"fmtowns\",\n FPinball = \"fpinball\",\n Gamate = \"gamate\",\n GameAndWatch = \"gameandwatch\",\n GameCom = \"gamecom\",\n GameGear = \"gamegear\",\n GB = \"gb\",\n GBA = \"gba\",\n GBC = \"gbc\",\n GameCube = \"gc\",\n Genesis = \"genesis\",\n GMaster = \"gmaster\",\n GX4000 = \"gx4000\",\n Intellivision = \"intellivision\",\n LowResNx = \"lowresnx\",\n Lutro = \"lutro\",\n Macintosh = \"macintosh\",\n Mame = \"mame\",\n MameAdvMame = \"mame-advmame\",\n Mark3 = \"mark3\",\n MasterSystem = \"mastersystem\",\n MegaCd = \"megacd\",\n MegaDrive = \"megadrive\",\n MegaDriveJp = \"megadrivejp\",\n MegaDuck = \"megaduck\",\n MESS = \"mess\",\n Model2 = \"model2\",\n Model3 = \"model3\",\n MSX = \"msx\",\n MSX1 = \"msx1\",\n MSX2 = \"msx2\",\n MSXTurbor = \"msxturbor\",\n N3DS = \"n3ds\",\n Nintendo64 = \"n64\",\n N64DD = \"n64dd\",\n Naomi = \"naomi\",\n Naomi2 = \"naomi2\",\n NaomiGd = \"naomigd\",\n NDS = \"nds\",\n NeoGeo = \"neogeo\",\n NeoGeoCd = \"neogeocd\",\n NeoGeoCdJp = \"neogeocdjp\",\n Nintendo = \"nes\",\n NGage = \"ngage\",\n NeoGeoPocket = \"ngp\",\n NeoGeoPocketColor = \"ngpc\",\n Odyssey2 = \"odyssey2\",\n OpenBor = \"openbor\",\n Oric = \"oric\",\n Palm = \"palm\",\n PC = \"pc\",\n PC88 = \"pc88\",\n PC98 = \"pc98\",\n PcEngine = \"pcengine\",\n PcEngineCd = \"pcenginecd\",\n PCFx = \"pcfx\",\n Pico8 = \"pico8\",\n Plus4 = \"plus4\",\n PokeMini = \"pokemini\",\n PS2 = \"ps2\",\n PS3 = \"ps3\",\n PS4 = \"ps4\",\n PSP = \"psp\",\n PSVita = \"psvita\",\n PSX = \"psx\",\n PV1000 = \"pv1000\",\n SamCoupe = \"samcoupe\",\n Satellaview = \"satellaview\",\n Saturn = \"saturn\",\n SaturnJp = \"saturnjp\",\n ScummVM = \"scummvm\",\n SCV = \"scv\",\n Sega32X = \"sega32x\",\n SegaCd = \"segacd\",\n Sg1000 = \"sg-1000\",\n SGB = \"sgb\",\n SuperNintendo = \"snes\",\n Solarus = \"solarus\",\n SpectraVideo = \"spectravideo\",\n STV = \"stv\",\n Sufami = \"sufami\",\n SuperGrafx = \"supergrafx\",\n SuperVision = \"supervision\",\n SupraCan = \"supracan\",\n Switch = \"switch\",\n TgCd = \"tg-cd\",\n TG16 = \"tg16\",\n TI99 = \"ti99\",\n TIC80 = \"tic80\",\n TO8 = \"to8\",\n TRS80 = \"trs-80\",\n TypeX = \"type-x\",\n Uzebox = \"uzebox\",\n Vectrex = \"vectrex\",\n Vic20 = \"vic20\",\n VideoPac = \"videopac\",\n Vircon32 = \"vircon32\",\n VirtualBoy = \"virtualboy\",\n VPinball = \"vpinball\",\n VSmile = \"vsmile\",\n Wasm4 = \"wasm4\",\n Wii = \"wii\",\n WiiU = \"wiiu\",\n Windows = \"windows\",\n Windows3X = \"windows3x\",\n Windows9X = \"windows9x\",\n WonderSwan = \"wonderswan\",\n WonderSwanColor = \"wonderswancolor\",\n X1 = \"x1\",\n X68000 = \"x68000\",\n Xbox = \"xbox\",\n Xbox360 = \"xbox360\",\n XboxOne = \"xboxone\",\n ZMachine = \"zmachine\",\n Zx81 = \"zx81\",\n ZxSpectrum = \"zxspectrum\",\n}\n\nconst ZRomulatorSystemIdMap = keyBy(Object.values(ZRomulatorSystemId));\n\n/**\n * Gets whether a candidate string represents a system id.\n *\n * This check is case sensitive.\n *\n * @param candidate -\n * The candidate to check.\n *\n * @returns\n * True if candidate is a string that represents a system id.\n */\nexport function isSystemId(candidate: any): candidate is ZRomulatorSystemId {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(ZRomulatorSystemIdMap, candidate)\n );\n}\n","import { get, isUndefined, omitBy } from \"lodash-es\";\nimport {\n ZRomulatorPlayersBuilder,\n type IZRomulatorPlayers,\n} from \"../players/players.mjs\";\nimport { ZRomulatorSystemId } from \"../system/system-id.mjs\";\n\n/**\n * Represents a rom file or image.\n */\nexport interface IZRomulatorGame {\n /**\n * The id of the game.\n *\n * This is unique across all games and all systems.\n */\n id: string;\n\n /**\n * The name of the game.\n *\n * This is not unique across systems. For example,\n * Battletoads and Double Dragon has the same name\n * across 3 different systems.\n */\n name: string;\n\n /**\n * The fully qualified path to the game file.\n */\n file: string;\n\n /**\n * The system id that this game belongs to.\n */\n system: ZRomulatorSystemId;\n\n /**\n * The date the game was released.\n */\n release: string;\n\n /**\n * The developer studio.\n */\n developer: string;\n\n /**\n * The publisher studio.\n */\n publisher: string;\n\n /**\n * The game description.\n */\n description: string;\n\n /**\n * The player information.\n */\n players: IZRomulatorPlayers;\n}\n\n/**\n * A builder for the IZRomulatorGame model.\n */\nexport class ZRomulatorGameBuilder {\n private _game: IZRomulatorGame = {\n id: \"\",\n name: \"\",\n file: \"\",\n system: ZRomulatorSystemId.Adam,\n release: \"\",\n description: \"\",\n developer: \"\",\n publisher: \"\",\n players: new ZRomulatorPlayersBuilder().build(),\n };\n\n /**\n * Sets the unique id for the game.\n *\n * @param id -\n * The unique identifier across all games and systems.\n * @returns\n * This instance.\n */\n public id(id: string): this {\n this._game.id = id;\n return this;\n }\n\n /**\n * Sets the display name for the game.\n *\n * @param name -\n * The canonical display name for the game.\n * @returns\n * This instance.\n */\n public name(name: string): this {\n this._game.name = name;\n return this;\n }\n\n /**\n * Sets the file path for the rom.\n *\n * @param path -\n * The fully qualified path to the game file.\n * @returns\n * This instance.\n */\n public file(path: string): this {\n this._game.file = path;\n return this;\n }\n\n /**\n * Sets the system the game belongs to.\n *\n * @param system -\n * The owning system id.\n * @returns\n * This instance.\n */\n public system(system: ZRomulatorSystemId): this {\n this._game.system = system;\n return this;\n }\n\n /**\n * Sets the release date for the game.\n *\n * @param release -\n * The release information for the game.\n * @returns\n * This instance.\n */\n public release(release: string): this {\n this._game.release = release;\n return this;\n }\n\n /**\n * Sets the developer studio for the game.\n *\n * @param developer -\n * The developer name.\n * @returns\n * This instance.\n */\n public developer(developer: string): this {\n this._game.developer = developer;\n return this;\n }\n\n /**\n * Sets the publisher studio for the game.\n *\n * @param publisher -\n * The publisher name.\n * @returns\n * This instance.\n */\n public publisher(publisher: string): this {\n this._game.publisher = publisher;\n return this;\n }\n\n /**\n * Sets the description for the game.\n *\n * @param description -\n * The game description.\n * @returns\n * This instance.\n */\n public description(description: string): this {\n this._game.description = description;\n return this;\n }\n\n /**\n * Sets the player configuration for the game.\n *\n * @param players -\n * The player configuration.\n * @returns\n * This instance.\n */\n public players(players: IZRomulatorPlayers): this {\n this._game.players = new ZRomulatorPlayersBuilder().copy(players).build();\n return this;\n }\n\n private parseDeveloper(candidate: object): this {\n const developer = get(candidate, \"developer\");\n\n return typeof developer === \"string\" ? this.developer(developer) : this;\n }\n\n private parsePublisher(candidate: object): this {\n const publisher = get(candidate, \"publisher\");\n\n return typeof publisher === \"string\" ? this.publisher(publisher) : this;\n }\n\n private parseReleaseDate(candidate: object): this {\n const release = get(candidate, \"release\");\n\n return typeof release == \"string\" ? this.release(release) : this;\n }\n\n private parsePlayers(candidate: object): this {\n const players = get(candidate, \"players\");\n\n return this.players(\n new ZRomulatorPlayersBuilder()\n .copy(this._game.players)\n .parse(players)\n .build(),\n );\n }\n\n private parseDescription(candidate: object): this {\n const description = get(candidate, \"description\");\n\n return typeof description === \"string\"\n ? this.description(description)\n : this;\n }\n\n private parseName(candidate: object): this {\n const name = get(candidate, \"name\");\n\n return typeof name === \"string\" ? this.name(name) : this;\n }\n\n /**\n * Attempts to parse a game from a game entry in a system.json game\n * list.\n *\n * @param candidate -\n * The candidate to parse.\n *\n * @returns\n * This object.\n */\n public parse(candidate: unknown): this {\n if (candidate == null || typeof candidate !== \"object\") {\n return this;\n }\n\n return this.parseName(candidate)\n .parseDescription(candidate)\n .parsePlayers(candidate)\n .parseReleaseDate(candidate)\n .parseDeveloper(candidate)\n .parsePublisher(candidate);\n }\n\n /**\n * Copies an existing game into this builder.\n *\n * @param other -\n * The other game to copy.\n * @returns\n * This instance.\n */\n public copy(other: IZRomulatorGame): this {\n this._game = structuredClone(other);\n return this;\n }\n\n /**\n * Builds the game instance.\n *\n * @returns\n * A structured clone of the current game with undefined properties removed.\n */\n public build() {\n const clone = structuredClone(this._game);\n return omitBy(clone, isUndefined) as IZRomulatorGame;\n }\n}\n","import { keyBy } from \"lodash-es\";\n\nexport enum ZRomulatorGameMediaType {\n /**\n * A 3d representation of the box art.\n */\n Box3d = \"3dboxes\",\n /**\n * Back of the game box.\n */\n BackCover = \"backcovers\",\n /**\n * Front of the game box.\n */\n Cover = \"covers\",\n /**\n * Fan art.\n */\n FanArt = \"fanart\",\n /**\n * Game manual.\n */\n Manual = \"manuals\",\n /**\n * A marquee of a game.\n */\n Marquee = \"marquees\",\n /**\n * The cartridge or disc label.\n */\n PhysicalMedia = \"physicalmedia\",\n /**\n * An in game screenshot showcasing gameplay.\n */\n Screenshot = \"screenshots\",\n /**\n * An in game screenshot of the title screen.\n */\n Title = \"titlescreens\",\n /**\n * A video showcasing the game.\n */\n Video = \"videos\",\n}\n\n/**\n * Media type for a system.\n */\nexport enum ZRomulatorSystemMediaType {\n /**\n * An image of a system's controller.\n */\n Controller = \"controller\",\n /**\n * A picture of the system.\n *\n * These are real life looking photos of what\n * a system looks like.\n */\n Picture = \"picture\",\n /**\n * A wheel for a system.\n *\n * This is basically the logo.\n */\n Wheel = \"wheel\",\n}\n\n/**\n * Describes what a specific piece of media represents.\n */\nexport type ZRomulatorMediaType =\n | ZRomulatorSystemMediaType\n | ZRomulatorGameMediaType;\n\nconst ZRomulatorSystemMediaTypeMap = keyBy(\n Object.values(ZRomulatorSystemMediaType),\n);\nconst ZRomulatorGameMediaTypeMap = keyBy(\n Object.values(ZRomulatorGameMediaType),\n);\n\nexport function isSystemMediaType(\n candidate: any,\n): candidate is ZRomulatorSystemMediaType {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(\n ZRomulatorSystemMediaTypeMap,\n candidate,\n )\n );\n}\n\nexport function isGameMediaType(\n candidate: any,\n): candidate is ZRomulatorGameMediaType {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(ZRomulatorGameMediaTypeMap, candidate)\n );\n}\n\nexport function isMediaType(candidate: any): candidate is ZRomulatorMediaType {\n return isSystemMediaType(candidate) || isGameMediaType(candidate);\n}\n","import { isUndefined, kebabCase, omitBy } from \"lodash-es\";\nimport { basename, extname, sep } from \"node:path\";\nimport type { ZRomulatorSystemId } from \"../system/system-id.mjs\";\nimport { isSystemId } from \"../system/system-id.mjs\";\nimport {\n isGameMediaType,\n isSystemMediaType,\n type ZRomulatorMediaType,\n} from \"./media-type.mjs\";\n\n/**\n * Represents a piece of media for a game or system.\n */\nexport interface IZRomulatorMedia {\n /**\n * The id of the media.\n */\n id?: string;\n\n /**\n * The id of the system that the media maps to.\n */\n system?: ZRomulatorSystemId;\n\n /**\n * The type of media this represents.\n */\n type?: ZRomulatorMediaType;\n\n /**\n * The id slug of the game if this media represents game media.\n */\n game?: string;\n\n /**\n * The name of the file.\n */\n fileName?: string;\n\n /**\n * The full url path for the media.\n */\n url?: string;\n}\n\n/**\n * A builder for the media object.\n */\nexport class ZRomulatorMediaBuilder {\n private _media: IZRomulatorMedia = {};\n\n public id(id: string) {\n this._media.id = id;\n return this;\n }\n\n public type(type: ZRomulatorMediaType) {\n this._media.type = type;\n return this;\n }\n\n public system(system: ZRomulatorSystemId) {\n this._media.system = system;\n return this;\n }\n\n public game(game: string | undefined) {\n this._media.game = game;\n return this;\n }\n\n public filename(name: string) {\n this._media.fileName = name;\n return this;\n }\n\n public url(url: string) {\n this._media.url = url;\n return this;\n }\n\n public from(path: string) {\n const hierarchy = path.split(sep);\n let builder = this.url(path);\n\n // The media structure is split into 2 or 3 parts\n // fileName = game file name or system media type name\n // parent = media type for games or system type for systems\n // grandparent = system type for games.\n\n const fileName = hierarchy[hierarchy.length - 1];\n const parent = hierarchy[hierarchy.length - 2];\n const grandparent = hierarchy[hierarchy.length - 3];\n\n if (!fileName) {\n // If we don't even have a file name - then this\n // isn't even media at all.\n return builder;\n }\n\n builder = builder.filename(fileName);\n const ext = extname(fileName);\n const title = basename(fileName, ext);\n\n if (isSystemMediaType(title) && isSystemId(parent)) {\n // This is media for system hardware\n const id = `${parent}-${kebabCase(title)}`;\n return builder.id(id).system(parent).type(title).game(undefined);\n }\n\n if (fileName && isGameMediaType(parent) && isSystemId(grandparent)) {\n // This is media for a game that is supported. The id for a game\n // is the system id followed by the kebab case of the title, followed\n // by the media type.\n const game = kebabCase(title);\n const id = `${grandparent}-${game}-${parent}`;\n return builder.id(id).system(grandparent).type(parent).game(game);\n }\n\n return builder;\n }\n\n public build() {\n const clone = structuredClone(this._media);\n return omitBy(clone, isUndefined) as IZRomulatorMedia;\n }\n}\n","import type { IZSerialize, ZOptional } from \"@zthun/helpful-fn\";\nimport type { IZRomulatorPlayers } from \"./players.mjs\";\n\n/**\n * Represents a serializer for a players object.\n *\n * The serialized form of players is a single digit if min and max are equal, or\n * a range string of #min-#max if they are different.\n */\nexport class ZRomulatorPlayersSerialize implements IZSerialize<IZRomulatorPlayers> {\n public serialize(\n candidate: ZOptional<IZRomulatorPlayers>,\n ): string | undefined {\n if (candidate == null) {\n return undefined;\n }\n\n const { min, max } = candidate;\n\n return min === max ? `${min}` : `${min}-${max}`;\n }\n}\n","import { keyBy } from \"lodash-es\";\n\n/**\n * The type of media content for a system.\n */\nexport enum ZRomulatorSystemContentType {\n /**\n * No idea\n */\n Unknown = \"unknown\",\n /**\n * Uses memory roms.\n */\n ReadOnlyMemory = \"rom\",\n /**\n * Folder based game with a known structure.\n */\n Folder = \"folder\",\n /**\n * Executable file.\n */\n File = \"file\",\n /**\n * Spinning disk media.\n */\n Disk = \"iso\",\n}\n\nconst ZRomulatorSystemContentTypeMap = keyBy(\n Object.values(ZRomulatorSystemContentType),\n);\n\n/**\n * Gets whether a candidate string represents a system content type.\n *\n * This check is case sensitive.\n *\n * @param candidate -\n * The candidate to check.\n *\n * @returns\n * True if candidate is a string that represents a system content type.\n */\nexport function isSystemContentType(\n candidate: any,\n): candidate is ZRomulatorSystemContentType {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(\n ZRomulatorSystemContentTypeMap,\n candidate,\n )\n );\n}\n","import { keyBy } from \"lodash-es\";\n\n/**\n * Describes the type of hardware a system is.\n */\nexport enum ZRomulatorSystemHardwareType {\n /**\n * No idea what this is.\n */\n Unknown = \"unknown\",\n /**\n * An accessory that attaches to another system.\n */\n Accessory = \"accessory\",\n\n /**\n * A cabinet system\n */\n Arcade = \"arcade\",\n\n /**\n * Known computer systems\n */\n Computer = \"computer\",\n\n /**\n * A console system.\n */\n Console = \"console\",\n\n /**\n * Pinball\n */\n Flipper = \"flipper\",\n\n /**\n * A handheld system\n */\n Handheld = \"console-portable\",\n\n /**\n * Script Creation Utility.\n */\n ScummVm = \"scummvm\",\n\n /**\n * Phone based system\n */\n Smartphone = \"smartphone\",\n\n /**\n * Virtual machine based system.\n */\n VirtualMachine = \"virtual-machine\",\n}\n\nconst ZRomulatorSystemHardwareTypeMap = keyBy(\n Object.values(ZRomulatorSystemHardwareType),\n);\n\n/**\n * Gets whether a candidate string represents a system hardware type.\n *\n * This check is case sensitive.\n *\n * @param candidate -\n * The candidate to check.\n *\n * @returns\n * True if candidate is a string that represents a system hardware type.\n */\nexport function isSystemHardwareType(\n candidate: any,\n): candidate is ZRomulatorSystemHardwareType {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(\n ZRomulatorSystemHardwareTypeMap,\n candidate,\n )\n );\n}\n","import { keyBy } from \"lodash-es\";\n\n/**\n * The type of media a system supports.\n */\nexport enum ZRomulatorSystemMediaFormat {\n /**\n * No idea\n */\n Unknown = \"unknown\",\n /**\n * Cartridge based systems.\n */\n Cartridge = \"cartridge\",\n\n /**\n * Motherboard based systems.\n *\n * Usually for arcades.\n */\n Pcb = \"pcb\",\n\n /**\n * CD/DVD based systems.\n */\n Cd = \"cd\",\n\n /**\n * Floppy disk based systems.\n */\n FloppyDisk = \"floppy-disk\",\n}\n\nconst ZRomulatorSystemMediaFormatMap = keyBy(\n Object.values(ZRomulatorSystemMediaFormat),\n);\n\n/**\n * Gets whether a candidate string represents a system media format.\n *\n * This check is case sensitive.\n *\n * @param candidate -\n * The candidate to check.\n *\n * @returns\n * True if candidate is a string that represents a system media format.\n */\nexport function isSystemMediaFormat(\n candidate: any,\n): candidate is ZRomulatorSystemMediaFormat {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(\n ZRomulatorSystemMediaFormatMap,\n candidate,\n )\n );\n}\n","import { castExtension } from \"@zthun/helpful-fn\";\nimport { castArray, get, lowerCase, uniqBy } from \"lodash-es\";\nimport {\n isSystemContentType,\n ZRomulatorSystemContentType,\n} from \"./system-content-type.mjs\";\nimport {\n isSystemHardwareType,\n ZRomulatorSystemHardwareType,\n} from \"./system-hardware-type.mjs\";\nimport { isSystemId, ZRomulatorSystemId } from \"./system-id.mjs\";\nimport {\n isSystemMediaFormat,\n ZRomulatorSystemMediaFormat,\n} from \"./system-media-format-type.mjs\";\n\n/**\n * Represents a system in romulator.\n *\n * These are detected by the file system.\n * See ES-DE for the standard directory\n * structure.\n */\nexport interface IZRomulatorSystem {\n /**\n * Unique identifier for the system.\n *\n * If you think about the directory structure\n * for ES-DE or retro-pie, for example, the id\n * would map to the name of the system directory.\n *\n * This is essentially a slug.\n */\n id: ZRomulatorSystemId;\n\n /**\n * The list of file extensions that system supports.\n *\n * Extensions, zip and 7z, should always be in this list.\n */\n extensions: string[];\n\n /**\n * Type classifications for the system.\n */\n classification: {\n /**\n * What type of system the hardware is.\n *\n * @example 'console'\n */\n hardwareType: ZRomulatorSystemHardwareType;\n\n /**\n * The type of media format.\n */\n mediaFormat: ZRomulatorSystemMediaFormat;\n\n /**\n * The digital format of the game media.\n */\n contentType: ZRomulatorSystemContentType;\n };\n\n /**\n * The canonical name of the system.\n *\n * This is the most globally recognized name,\n * not the historical accurate name for each\n * and every region.\n */\n name: string;\n\n /**\n * The company that published the system.\n */\n company: string;\n\n /**\n * The years the system was in production until.\n */\n productionYears: {\n /**\n * The first year the system went into production.\n *\n * Uses ? if we are not sure.\n */\n start: number | \"?\";\n /**\n * The year when production stopped.\n *\n * Current implies that production is still happening.\n */\n end: number | \"current\";\n };\n}\n\n/**\n * A builder for creating an IZRomulatorSystem.\n */\nexport class ZRomulatorSystemBuilder {\n private _system: IZRomulatorSystem = {\n id: ZRomulatorSystemId.Nintendo,\n name: \"\",\n\n classification: {\n hardwareType: ZRomulatorSystemHardwareType.Unknown,\n mediaFormat: ZRomulatorSystemMediaFormat.Unknown,\n contentType: ZRomulatorSystemContentType.Unknown,\n },\n\n company: \"\",\n\n productionYears: {\n start: \"?\",\n end: \"current\",\n },\n\n extensions: [\".zip\", \".7z\"],\n };\n\n /**\n * Sets the id (slug) of the system.\n *\n * @param id -\n * The unique identifier for the system.\n *\n * @returns\n * This instance.\n */\n public id(id: ZRomulatorSystemId): this {\n this._system.id = id;\n\n return this;\n }\n\n /**\n * Sets the canonical name of the system.\n *\n * @param name -\n * The canonical name of the system.\n *\n * @returns\n * This instance.\n */\n public name(name: string): this {\n this._system.name = name;\n\n return this;\n }\n\n /**\n * Sets the company that published the system.\n *\n * @param name -\n * The name of the company.\n *\n * @returns\n * This instance.\n */\n public company(name: string): this {\n this._system.company = name;\n\n return this;\n }\n\n /**\n * Sets the system hardware type.\n *\n * @param type -\n * The system hardware type.\n *\n * @returns\n * This instance.\n */\n public hardware(type: ZRomulatorSystemHardwareType): this {\n this._system.classification.hardwareType = type;\n\n return this;\n }\n\n /**\n * Sets the system media format.\n *\n * @param type -\n * The system media format.\n *\n * @returns\n * This instance.\n */\n public mediaFormat(type: ZRomulatorSystemMediaFormat): this {\n this._system.classification.mediaFormat = type;\n\n return this;\n }\n\n /**\n * Sets the system content type.\n *\n * @param type -\n * The system content type.\n *\n * @returns\n * This instance.\n */\n public contentType(type: ZRomulatorSystemContentType): this {\n this._system.classification.contentType = type;\n return this;\n }\n\n /**\n * Sets the production start value.\n *\n * @param start -\n * The year the system was released into production.\n * Use '?' if you do not know this information.\n *\n * @returns\n * This object.\n */\n public productionStart(start: number | \"?\") {\n this._system.productionYears.start = start;\n\n return this;\n }\n\n /**\n * Sets the production end of life value.\n *\n * @param end -\n * The end of life year. Set to current\n * to mark no end of life.\n *\n * @returns\n * This object.\n */\n public productionEnd(end: number | \"current\") {\n this._system.productionYears.end = end;\n\n return this;\n }\n\n /**\n * Sets the full production run.\n *\n * @param start -\n * The starting year of production.\n * @param end -\n * The last year of production.\n *\n * @returns\n * This object.\n */\n public production(\n start: number | \"?\" = \"?\",\n end: number | \"current\" = \"current\",\n ) {\n return this.productionStart(start).productionEnd(end);\n }\n\n /**\n * Adds to the extension list.\n *\n * @param extension -\n * The extension or list of extensions to add.\n *\n * @returns\n * This object.\n */\n public extension(extension: string | string[]) {\n const current = this._system.extensions.slice();\n const extensions = castArray(extension).map((e) => castExtension(e));\n const unique = uniqBy(current.concat(extensions), lowerCase);\n\n this._system.extensions = unique\n .filter((e) => e != null)\n .map((e) => e?.toLowerCase());\n\n return this;\n }\n\n private parseId(candidate: object) {\n const id = get(candidate, \"id\");\n\n return isSystemId(id) ? this.id(id) : this;\n }\n\n private parseName(candidate: object) {\n const name = get(candidate, \"name\");\n\n return name != null && typeof name === \"string\" ? this.name(name) : this;\n }\n\n private parseCompany(candidate: object) {\n const company = get(candidate, \"company\");\n\n return company != null && typeof company === \"string\"\n ? this.company(company)\n : this;\n }\n\n private parseExtensions(candidate: object) {\n const extensions = castArray(get(candidate, \"extensions\"))\n .filter((ext) => ext != null)\n .filter((ext) => typeof ext === \"string\")\n .map((ext) => castExtension(ext));\n\n return this.extension(extensions);\n }\n\n private parseHardwareType(classification: object) {\n const hardwareType = get(classification, \"hardwareType\");\n\n return isSystemHardwareType(hardwareType)\n ? this.hardware(hardwareType)\n : this;\n }\n\n private parseMediaFormat(classification: object) {\n const mediaFormat = get(classification, \"mediaFormat\");\n\n return isSystemMediaFormat(mediaFormat)\n ? this.mediaFormat(mediaFormat)\n : this;\n }\n\n private parseContentType(classification: object) {\n const contentType = get(classification, \"contentType\");\n\n return isSystemContentType(contentType)\n ? this.contentType(contentType)\n : this;\n }\n\n private parseClassification(candidate: object) {\n const classification = get(candidate, \"classification\");\n\n return classification != null && typeof classification === \"object\"\n ? this.parseHardwareType(classification)\n .parseMediaFormat(classification)\n .parseContentType(classification)\n : this;\n }\n\n private parseProductionStart(productionYears: object) {\n const start = get(productionYears, \"start\");\n\n return typeof start === \"number\" || start === \"?\"\n ? this.productionStart(start)\n : this;\n }\n\n private parseProductionEnd(productionYears: object) {\n const end = get(productionYears, \"end\");\n\n return typeof end === \"number\" || end === \"current\"\n ? this.productionEnd(end)\n : this;\n }\n\n private parseProductionYears(candidate: object) {\n const production = get(candidate, \"productionYears\");\n\n return production != null && typeof production === \"object\"\n ? this.parseProductionStart(production).parseProductionEnd(production)\n : this;\n }\n\n /**\n * Parses an unknown object to try and build a system from it.\n *\n * @param candidate -\n * The candidate to try and parse.\n *\n * @returns\n * This object.\n */\n public parse(candidate: unknown) {\n if (candidate == null || typeof candidate !== \"object\") {\n return this;\n }\n\n this.parseId(candidate)\n .parseName(candidate)\n .parseCompany(candidate)\n .parseExtensions(candidate)\n .parseClassification(candidate)\n .parseProductionYears(candidate);\n\n return this;\n }\n\n /**\n * Builds the system instance.\n *\n * @returns\n * A structured clone of the current system\n * that has been built.\n */\n public build() {\n return structuredClone(this._system);\n }\n}\n"],"names":["ZRomulatorConfigGamesMetadata","all","gamesFolder","ZMetadataBuilder","id","path","name","fallback","editable","file","build","ZRomulatorConfigGamesBuilder","games","_config","copy","other","structuredClone","assign","_define_property","ZRomulatorConfigId","ZRomulatorConfigBuilder","avatar","description","contents","metadata","meta","firstDefined","concat","castArray","ZRomulatorPlayersBuilder","min","players","_players","max","range","parseMax","candidate","get","parseMin","parse","singlePlayer","bind","twoPlayer","fourPlayer","eightPlayer","ZRomulatorSystemId","ZRomulatorSystemIdMap","keyBy","Object","values","isSystemId","prototype","hasOwnProperty","call","ZRomulatorGameBuilder","_game","system","release","developer","publisher","parseDeveloper","parsePublisher","parseReleaseDate","parsePlayers","parseDescription","parseName","clone","omitBy","isUndefined","Adam","ZRomulatorGameMediaType","ZRomulatorSystemMediaType","ZRomulatorSystemMediaTypeMap","ZRomulatorGameMediaTypeMap","isSystemMediaType","isGameMediaType","isMediaType","ZRomulatorMediaBuilder","_media","type","game","filename","fileName","url","from","hierarchy","split","sep","builder","length","parent","grandparent","ext","extname","title","basename","kebabCase","undefined","ZRomulatorPlayersSerialize","serialize","ZRomulatorSystemContentType","ZRomulatorSystemContentTypeMap","isSystemContentType","ZRomulatorSystemHardwareType","ZRomulatorSystemHardwareTypeMap","isSystemHardwareType","ZRomulatorSystemMediaFormat","ZRomulatorSystemMediaFormatMap","isSystemMediaFormat","ZRomulatorSystemBuilder","_system","company","hardware","classification","hardwareType","mediaFormat","contentType","productionStart","start","productionYears","productionEnd","end","extension","current","extensions","slice","map","e","castExtension","unique","uniqBy","lowerCase","filter","toLowerCase","parseId","parseCompany","parseExtensions","parseHardwareType","parseMediaFormat","parseContentType","parseClassification","parseProductionStart","parseProductionEnd","parseProductionYears","production","Nintendo","Unknown"],"mappings":";;;;;;;;;AAEO,MAAeA,6BAAAA,CAAAA;AACpB,IAAA,OAAcC,GAAoB,GAAA;QAChC,OAAO;AAACD,YAAAA,6BAAAA,CAA8BE,WAAW;AAAG,SAAA;AACtD;AAEA,IAAA,OAAcA,WAA0B,GAAA;AACtC,QAAA,OAAO,IAAIC,6BACRC,EAAAA,CAAAA,EAAE,CAAC,cACHC,CAAAA,CAAAA,IAAI,CAAC,aACLC,CAAAA,CAAAA,IAAI,CAAC,cAAA,CAAA,CACLC,QAAQ,CAAC,eAAA,CAAA,CACTC,QAAQ,EACRC,CAAAA,IAAI,GACJC,KAAK,EAAA;AACV;AACF;;;;;;;;;;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B,EAAA;gBACfD,KAAO,EAAA,GAAA;gBACPG,GAAK,EAAA;AACP,aAAA;YAEAG,UAAY,EAAA;AAAC,gBAAA,MAAA;AAAQ,gBAAA;AAAM;AAC7B,SAAA,CAAA;;AA2RF;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/config/config-games-metadata.mts","../src/config/config-games.mts","../src/config/config.mts","../src/players/players.mts","../src/system/system-id.mts","../src/game/game.mts","../src/media/media-type.mts","../src/media/media.mts","../src/players/players-serialize.mts","../src/system/system-content-type.mts","../src/system/system-hardware-type.mts","../src/system/system-media-format-type.mts","../src/system/system.mts"],"sourcesContent":["import { ZMetadataBuilder, type IZMetadata } from \"@zthun/helpful-query\";\n\nexport abstract class ZRomulatorConfigGamesMetadata {\n public static all(): IZMetadata[] {\n return [ZRomulatorConfigGamesMetadata.gamesFolder()];\n }\n\n public static gamesFolder(): IZMetadata {\n return new ZMetadataBuilder()\n .id(\"games-folder\")\n .path(\"gamesFolder\")\n .name(\"Games Folder\")\n .fallback(\"${HOME}/Games\")\n .editable()\n .file()\n .build();\n }\n}\n","export interface IZRomulatorConfigGames {\n gamesFolder?: string;\n}\n\nexport class ZRomulatorConfigGamesBuilder {\n private _config: IZRomulatorConfigGames = {};\n\n public gamesFolder(games: string): this {\n this._config.gamesFolder = games;\n return this;\n }\n\n public copy(other: IZRomulatorConfigGames) {\n this._config = structuredClone(other);\n return this;\n }\n\n public assign(other: Partial<IZRomulatorConfigGames>) {\n this._config = { ...this._config, ...other };\n return this;\n }\n\n public build(): IZRomulatorConfigGames {\n return structuredClone(this._config);\n }\n}\n","import { firstDefined } from \"@zthun/helpful-fn\";\nimport type { IZMetadata } from \"@zthun/helpful-query\";\nimport { castArray } from \"lodash-es\";\n\n/**\n * Represents a list of known config ids\n */\nexport enum ZRomulatorConfigId {\n /**\n * Config for games.\n */\n Games = \"games\",\n\n /**\n * Config id for media.\n */\n Media = \"media\",\n}\n\nexport interface IZRomulatorConfig<T = any> {\n id: ZRomulatorConfigId;\n name: string;\n\n avatar?: string;\n contents?: T;\n description?: string;\n file: string;\n metadata?: IZMetadata[];\n}\n\nexport class ZRomulatorConfigBuilder<T = any> {\n private _config: IZRomulatorConfig<T> = {\n id: ZRomulatorConfigId.Games,\n name: \"\",\n file: \"\",\n };\n\n public id(id: ZRomulatorConfigId) {\n this._config.id = id;\n return this;\n }\n\n public avatar(id: string) {\n this._config.avatar = id;\n return this;\n }\n\n public name(name: string) {\n this._config.name = name;\n return this;\n }\n\n public description(description: string) {\n this._config.description = description;\n return this;\n }\n\n public file(path: string) {\n this._config.file = path;\n return this;\n }\n\n public contents(contents?: T) {\n this._config.contents = contents;\n return this;\n }\n\n public metadata(meta: IZMetadata | IZMetadata[]) {\n const metadata = firstDefined([], this._config.metadata);\n this._config.metadata = metadata.concat(castArray(meta));\n return this;\n }\n\n public copy(other: IZRomulatorConfig<T>) {\n this._config = structuredClone(other);\n return this;\n }\n\n public build() {\n return structuredClone(this._config);\n }\n}\n","import { get } from \"lodash-es\";\n\n/**\n * Represents a player range for a game.\n */\nexport interface IZRomulatorPlayers {\n /**\n * The minimum number of players.\n *\n * This is almost always (read 99.99%)\n * 1.\n */\n min: number;\n /**\n * The maximum number of players.\n */\n max: number;\n}\n\n/**\n * Creates player range instances\n */\nexport class ZRomulatorPlayersBuilder {\n private _players: IZRomulatorPlayers = { min: 1, max: 1 };\n\n /**\n * Sets the minimum supported players.\n *\n * @param players -\n * Minimum number of players.\n *\n * @returns\n * This object.\n */\n public min(players: number) {\n this._players.min = players;\n return this;\n }\n\n /**\n * Sets the maximum supported players.\n *\n * @param players -\n * Maximum number of players.\n *\n * @returns\n * This object.\n */\n public max(players: number) {\n this._players.max = players;\n return this;\n }\n\n private range(min: number, max: number) {\n return this.min(min).max(max);\n }\n\n /**\n * Sets the player count to 1 player for both min and max.\n *\n * @returns\n * This object.\n */\n public singlePlayer = this.range.bind(this, 1, 1);\n\n /**\n * Sets the player count to 2 for max and 1 for min.\n *\n * @returns\n * This object.\n */\n public twoPlayer = this.range.bind(this, 1, 2);\n\n /**\n * Sets the player count to 4 for max and 1 for min.\n *\n * @returns\n * This object.\n */\n public fourPlayer = this.range.bind(this, 1, 4);\n\n /**\n * Sets the player count to 8 for max and 1 for min.\n *\n * @returns\n * This object.\n */\n public eightPlayer = this.range.bind(this, 1, 8);\n\n private parseMax(candidate: object) {\n const max = get(candidate, \"max\");\n\n return typeof max === \"number\" ? this.max(max) : this;\n }\n\n private parseMin(candidate: object) {\n const min = get(candidate, \"min\");\n\n return typeof min === \"number\" ? this.min(min) : this;\n }\n\n /**\n * Attempts to read player range values from an arbitrary candidate.\n *\n * @param candidate -\n * Source object to inspect.\n *\n * @returns\n * This object.\n */\n public parse(candidate: unknown) {\n if (candidate == null || typeof candidate !== \"object\") {\n return this;\n }\n\n return this.parseMin(candidate).parseMax(candidate);\n }\n\n /**\n * Copies an existing player range into this builder.\n *\n * @param other -\n * Players object to duplicate.\n *\n * @returns\n * This object\n */\n public copy(other: IZRomulatorPlayers) {\n this._players = structuredClone(other);\n return this;\n }\n\n /**\n * Creates the final player range instance.\n *\n * @returns\n * A cloned IZRomulatorPlayers instance.\n */\n public build() {\n return structuredClone(this._players);\n }\n}\n","import { keyBy } from \"lodash-es\";\n\n/**\n * Id slugs for supported systems.\n */\nexport enum ZRomulatorSystemId {\n ThreeDo = \"3do\",\n Adam = \"adam\",\n Amiga = \"amiga\",\n Amiga1200 = \"amiga1200\",\n Amiga600 = \"amiga600\",\n AmigaCd32 = \"amigacd32\",\n AmstradCpc = \"amstradcpc\",\n Android = \"android\",\n Apple2 = \"apple2\",\n Apple2Gs = \"apple2gs\",\n Arcade = \"arcade\",\n Arcadia = \"arcadia\",\n Archimedes = \"archimedes\",\n Arduboy = \"arduboy\",\n Astrocde = \"astrocde\",\n Atari2600 = \"atari2600\",\n Atari5200 = \"atari5200\",\n Atari7800 = \"atari7800\",\n Atari800 = \"atari800\",\n AtariJaguar = \"atarijaguar\",\n AtariJaguarCd = \"atarijaguarcd\",\n AtariLynx = \"atarilynx\",\n AtariSt = \"atarist\",\n Atomiswave = \"atomiswave\",\n BbcMicro = \"bbcmicro\",\n C64 = \"c64\",\n CdiMono1 = \"cdimono1\",\n Cdtv = \"cdtv\",\n ChannelF = \"channelf\",\n Coco = \"coco\",\n Colecovision = \"colecovision\",\n Cps = \"cps\",\n Cps1 = \"cps1\",\n Cps2 = \"cps2\",\n Cps3 = \"cps3\",\n CrVision = \"crvision\",\n Daphne = \"daphne\",\n Dos = \"dos\",\n Dragon32 = \"dragon32\",\n Dreamcast = \"dreamcast\",\n EasyRpg = \"easyrpg\",\n Electron = \"electron\",\n Famicom = \"famicom\",\n FBA = \"fba\",\n FBNeo = \"fbneo\",\n FDS = \"fds\",\n FM7 = \"fm7\",\n FMTowns = \"fmtowns\",\n FPinball = \"fpinball\",\n Gamate = \"gamate\",\n GameAndWatch = \"gameandwatch\",\n GameCom = \"gamecom\",\n GameGear = \"gamegear\",\n GB = \"gb\",\n GBA = \"gba\",\n GBC = \"gbc\",\n GameCube = \"gc\",\n Genesis = \"genesis\",\n GMaster = \"gmaster\",\n GX4000 = \"gx4000\",\n Intellivision = \"intellivision\",\n LowResNx = \"lowresnx\",\n Lutro = \"lutro\",\n Macintosh = \"macintosh\",\n Mame = \"mame\",\n MameAdvMame = \"mame-advmame\",\n Mark3 = \"mark3\",\n MasterSystem = \"mastersystem\",\n MegaCd = \"megacd\",\n MegaDrive = \"megadrive\",\n MegaDriveJp = \"megadrivejp\",\n MegaDuck = \"megaduck\",\n MESS = \"mess\",\n Model2 = \"model2\",\n Model3 = \"model3\",\n MSX = \"msx\",\n MSX1 = \"msx1\",\n MSX2 = \"msx2\",\n MSXTurbor = \"msxturbor\",\n N3DS = \"n3ds\",\n Nintendo64 = \"n64\",\n N64DD = \"n64dd\",\n Naomi = \"naomi\",\n Naomi2 = \"naomi2\",\n NaomiGd = \"naomigd\",\n NDS = \"nds\",\n NeoGeo = \"neogeo\",\n NeoGeoCd = \"neogeocd\",\n NeoGeoCdJp = \"neogeocdjp\",\n Nintendo = \"nes\",\n NGage = \"ngage\",\n NeoGeoPocket = \"ngp\",\n NeoGeoPocketColor = \"ngpc\",\n Odyssey2 = \"odyssey2\",\n OpenBor = \"openbor\",\n Oric = \"oric\",\n Palm = \"palm\",\n PC = \"pc\",\n PC88 = \"pc88\",\n PC98 = \"pc98\",\n PcEngine = \"pcengine\",\n PcEngineCd = \"pcenginecd\",\n PCFx = \"pcfx\",\n Pico8 = \"pico8\",\n Plus4 = \"plus4\",\n PokeMini = \"pokemini\",\n PS2 = \"ps2\",\n PS3 = \"ps3\",\n PS4 = \"ps4\",\n PSP = \"psp\",\n PSVita = \"psvita\",\n PSX = \"psx\",\n PV1000 = \"pv1000\",\n SamCoupe = \"samcoupe\",\n Satellaview = \"satellaview\",\n Saturn = \"saturn\",\n SaturnJp = \"saturnjp\",\n ScummVM = \"scummvm\",\n SCV = \"scv\",\n Sega32X = \"sega32x\",\n SegaCd = \"segacd\",\n Sg1000 = \"sg-1000\",\n SGB = \"sgb\",\n SuperNintendo = \"snes\",\n Solarus = \"solarus\",\n SpectraVideo = \"spectravideo\",\n STV = \"stv\",\n Sufami = \"sufami\",\n SuperGrafx = \"supergrafx\",\n SuperVision = \"supervision\",\n SupraCan = \"supracan\",\n Switch = \"switch\",\n TgCd = \"tg-cd\",\n TG16 = \"tg16\",\n TI99 = \"ti99\",\n TIC80 = \"tic80\",\n TO8 = \"to8\",\n TRS80 = \"trs-80\",\n TypeX = \"type-x\",\n Uzebox = \"uzebox\",\n Vectrex = \"vectrex\",\n Vic20 = \"vic20\",\n VideoPac = \"videopac\",\n Vircon32 = \"vircon32\",\n VirtualBoy = \"virtualboy\",\n VPinball = \"vpinball\",\n VSmile = \"vsmile\",\n Wasm4 = \"wasm4\",\n Wii = \"wii\",\n WiiU = \"wiiu\",\n Windows = \"windows\",\n Windows3X = \"windows3x\",\n Windows9X = \"windows9x\",\n WonderSwan = \"wonderswan\",\n WonderSwanColor = \"wonderswancolor\",\n X1 = \"x1\",\n X68000 = \"x68000\",\n Xbox = \"xbox\",\n Xbox360 = \"xbox360\",\n XboxOne = \"xboxone\",\n ZMachine = \"zmachine\",\n Zx81 = \"zx81\",\n ZxSpectrum = \"zxspectrum\",\n}\n\nconst ZRomulatorSystemIdMap = keyBy(Object.values(ZRomulatorSystemId));\n\n/**\n * Gets whether a candidate string represents a system id.\n *\n * This check is case sensitive.\n *\n * @param candidate -\n * The candidate to check.\n *\n * @returns\n * True if candidate is a string that represents a system id.\n */\nexport function isSystemId(candidate: any): candidate is ZRomulatorSystemId {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(ZRomulatorSystemIdMap, candidate)\n );\n}\n","import { get, isUndefined, omitBy } from \"lodash-es\";\nimport {\n ZRomulatorPlayersBuilder,\n type IZRomulatorPlayers,\n} from \"../players/players.mjs\";\nimport { ZRomulatorSystemId } from \"../system/system-id.mjs\";\n\n/**\n * Represents a rom file or image.\n */\nexport interface IZRomulatorGame {\n /**\n * The id of the game.\n *\n * This is unique across all games and all systems.\n */\n id: string;\n\n /**\n * The name of the game.\n *\n * This is not unique across systems. For example,\n * Battletoads and Double Dragon has the same name\n * across 3 different systems.\n */\n name: string;\n\n /**\n * The fully qualified path to the game file.\n */\n file: string;\n\n /**\n * The system id that this game belongs to.\n */\n system: ZRomulatorSystemId;\n\n /**\n * The date the game was released.\n */\n release: string;\n\n /**\n * The developer studio.\n */\n developer: string;\n\n /**\n * The publisher studio.\n */\n publisher: string;\n\n /**\n * The game description.\n */\n description: string;\n\n /**\n * The player information.\n */\n players: IZRomulatorPlayers;\n}\n\n/**\n * A builder for the IZRomulatorGame model.\n */\nexport class ZRomulatorGameBuilder {\n private _game: IZRomulatorGame = {\n id: \"\",\n name: \"\",\n file: \"\",\n system: ZRomulatorSystemId.Adam,\n release: \"\",\n description: \"\",\n developer: \"\",\n publisher: \"\",\n players: new ZRomulatorPlayersBuilder().build(),\n };\n\n /**\n * Sets the unique id for the game.\n *\n * @param id -\n * The unique identifier across all games and systems.\n * @returns\n * This instance.\n */\n public id(id: string): this {\n this._game.id = id;\n return this;\n }\n\n /**\n * Sets the display name for the game.\n *\n * @param name -\n * The canonical display name for the game.\n * @returns\n * This instance.\n */\n public name(name: string): this {\n this._game.name = name;\n return this;\n }\n\n /**\n * Sets the file path for the rom.\n *\n * @param path -\n * The fully qualified path to the game file.\n * @returns\n * This instance.\n */\n public file(path: string): this {\n this._game.file = path;\n return this;\n }\n\n /**\n * Sets the system the game belongs to.\n *\n * @param system -\n * The owning system id.\n * @returns\n * This instance.\n */\n public system(system: ZRomulatorSystemId): this {\n this._game.system = system;\n return this;\n }\n\n /**\n * Sets the release date for the game.\n *\n * @param release -\n * The release information for the game.\n * @returns\n * This instance.\n */\n public release(release: string): this {\n this._game.release = release;\n return this;\n }\n\n /**\n * Sets the developer studio for the game.\n *\n * @param developer -\n * The developer name.\n * @returns\n * This instance.\n */\n public developer(developer: string): this {\n this._game.developer = developer;\n return this;\n }\n\n /**\n * Sets the publisher studio for the game.\n *\n * @param publisher -\n * The publisher name.\n * @returns\n * This instance.\n */\n public publisher(publisher: string): this {\n this._game.publisher = publisher;\n return this;\n }\n\n /**\n * Sets the description for the game.\n *\n * @param description -\n * The game description.\n * @returns\n * This instance.\n */\n public description(description: string): this {\n this._game.description = description;\n return this;\n }\n\n /**\n * Sets the player configuration for the game.\n *\n * @param players -\n * The player configuration.\n * @returns\n * This instance.\n */\n public players(players: IZRomulatorPlayers): this {\n this._game.players = new ZRomulatorPlayersBuilder().copy(players).build();\n return this;\n }\n\n private parseDeveloper(candidate: object): this {\n const developer = get(candidate, \"developer\");\n\n return typeof developer === \"string\" ? this.developer(developer) : this;\n }\n\n private parsePublisher(candidate: object): this {\n const publisher = get(candidate, \"publisher\");\n\n return typeof publisher === \"string\" ? this.publisher(publisher) : this;\n }\n\n private parseReleaseDate(candidate: object): this {\n const release = get(candidate, \"release\");\n\n return typeof release == \"string\" ? this.release(release) : this;\n }\n\n private parsePlayers(candidate: object): this {\n const players = get(candidate, \"players\");\n\n return this.players(\n new ZRomulatorPlayersBuilder()\n .copy(this._game.players)\n .parse(players)\n .build(),\n );\n }\n\n private parseDescription(candidate: object): this {\n const description = get(candidate, \"description\");\n\n return typeof description === \"string\"\n ? this.description(description)\n : this;\n }\n\n private parseName(candidate: object): this {\n const name = get(candidate, \"name\");\n\n return typeof name === \"string\" ? this.name(name) : this;\n }\n\n /**\n * Attempts to parse a game from a game entry in a system.json game\n * list.\n *\n * @param candidate -\n * The candidate to parse.\n *\n * @returns\n * This object.\n */\n public parse(candidate: unknown): this {\n if (candidate == null || typeof candidate !== \"object\") {\n return this;\n }\n\n return this.parseName(candidate)\n .parseDescription(candidate)\n .parsePlayers(candidate)\n .parseReleaseDate(candidate)\n .parseDeveloper(candidate)\n .parsePublisher(candidate);\n }\n\n /**\n * Copies an existing game into this builder.\n *\n * @param other -\n * The other game to copy.\n * @returns\n * This instance.\n */\n public copy(other: IZRomulatorGame): this {\n this._game = structuredClone(other);\n return this;\n }\n\n /**\n * Builds the game instance.\n *\n * @returns\n * A structured clone of the current game with undefined properties removed.\n */\n public build() {\n const clone = structuredClone(this._game);\n return omitBy(clone, isUndefined) as IZRomulatorGame;\n }\n}\n","import { keyBy } from \"lodash-es\";\n\nexport enum ZRomulatorGameMediaType {\n /**\n * A 3d representation of the box art.\n */\n Box3d = \"3dboxes\",\n /**\n * Back of the game box.\n */\n BackCover = \"backcovers\",\n /**\n * Front of the game box.\n */\n Cover = \"covers\",\n /**\n * Fan art.\n */\n FanArt = \"fanart\",\n /**\n * Game manual.\n */\n Manual = \"manuals\",\n /**\n * A marquee of a game.\n */\n Marquee = \"marquees\",\n /**\n * The cartridge or disc label.\n */\n PhysicalMedia = \"physicalmedia\",\n /**\n * An in game screenshot showcasing gameplay.\n */\n Screenshot = \"screenshots\",\n /**\n * An in game screenshot of the title screen.\n */\n Title = \"titlescreens\",\n /**\n * A video showcasing the game.\n */\n Video = \"videos\",\n}\n\n/**\n * Media type for a system.\n */\nexport enum ZRomulatorSystemMediaType {\n /**\n * An image of a system's controller.\n */\n Controller = \"controller\",\n /**\n * A picture of the system.\n *\n * These are real life looking photos of what\n * a system looks like.\n */\n Picture = \"picture\",\n /**\n * A wheel for a system.\n *\n * This is basically the logo.\n */\n Wheel = \"wheel\",\n}\n\n/**\n * Describes what a specific piece of media represents.\n */\nexport type ZRomulatorMediaType =\n | ZRomulatorSystemMediaType\n | ZRomulatorGameMediaType;\n\nconst ZRomulatorSystemMediaTypeMap = keyBy(\n Object.values(ZRomulatorSystemMediaType),\n);\nconst ZRomulatorGameMediaTypeMap = keyBy(\n Object.values(ZRomulatorGameMediaType),\n);\n\nexport function isSystemMediaType(\n candidate: any,\n): candidate is ZRomulatorSystemMediaType {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(\n ZRomulatorSystemMediaTypeMap,\n candidate,\n )\n );\n}\n\nexport function isGameMediaType(\n candidate: any,\n): candidate is ZRomulatorGameMediaType {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(ZRomulatorGameMediaTypeMap, candidate)\n );\n}\n\nexport function isMediaType(candidate: any): candidate is ZRomulatorMediaType {\n return isSystemMediaType(candidate) || isGameMediaType(candidate);\n}\n","import { isUndefined, kebabCase, omitBy } from \"lodash-es\";\nimport { basename, extname, sep } from \"node:path\";\nimport type { ZRomulatorSystemId } from \"../system/system-id.mjs\";\nimport { isSystemId } from \"../system/system-id.mjs\";\nimport {\n isGameMediaType,\n isSystemMediaType,\n type ZRomulatorMediaType,\n} from \"./media-type.mjs\";\n\n/**\n * Represents a piece of media for a game or system.\n */\nexport interface IZRomulatorMedia {\n /**\n * The id of the media.\n */\n id?: string;\n\n /**\n * The id of the system that the media maps to.\n */\n system?: ZRomulatorSystemId;\n\n /**\n * The type of media this represents.\n */\n type?: ZRomulatorMediaType;\n\n /**\n * The id slug of the game if this media represents game media.\n */\n game?: string;\n\n /**\n * The name of the file.\n */\n fileName?: string;\n\n /**\n * The full url path for the media.\n */\n url?: string;\n}\n\n/**\n * A builder for the media object.\n */\nexport class ZRomulatorMediaBuilder {\n private _media: IZRomulatorMedia = {};\n\n public id(id: string) {\n this._media.id = id;\n return this;\n }\n\n public type(type: ZRomulatorMediaType) {\n this._media.type = type;\n return this;\n }\n\n public system(system: ZRomulatorSystemId) {\n this._media.system = system;\n return this;\n }\n\n public game(game: string | undefined) {\n this._media.game = game;\n return this;\n }\n\n public filename(name: string) {\n this._media.fileName = name;\n return this;\n }\n\n public url(url: string) {\n this._media.url = url;\n return this;\n }\n\n public from(path: string) {\n const hierarchy = path.split(sep);\n let builder = this.url(path);\n\n // The media structure is split into 2 or 3 parts\n // fileName = game file name or system media type name\n // parent = media type for games or system type for systems\n // grandparent = system type for games.\n\n const fileName = hierarchy[hierarchy.length - 1];\n const parent = hierarchy[hierarchy.length - 2];\n const grandparent = hierarchy[hierarchy.length - 3];\n\n if (!fileName) {\n // If we don't even have a file name - then this\n // isn't even media at all.\n return builder;\n }\n\n builder = builder.filename(fileName);\n const ext = extname(fileName);\n const title = basename(fileName, ext);\n\n if (isSystemMediaType(title) && isSystemId(parent)) {\n // This is media for system hardware\n const id = `${parent}-${kebabCase(title)}`;\n return builder.id(id).system(parent).type(title).game(undefined);\n }\n\n if (fileName && isGameMediaType(parent) && isSystemId(grandparent)) {\n // This is media for a game that is supported. The id for a game\n // is the system id followed by the kebab case of the title, followed\n // by the media type.\n const game = kebabCase(title);\n const id = `${grandparent}-${game}-${parent}`;\n return builder.id(id).system(grandparent).type(parent).game(game);\n }\n\n return builder;\n }\n\n public build() {\n const clone = structuredClone(this._media);\n return omitBy(clone, isUndefined) as IZRomulatorMedia;\n }\n}\n","import type { IZSerialize, ZOptional } from \"@zthun/helpful-fn\";\nimport type { IZRomulatorPlayers } from \"./players.mjs\";\n\n/**\n * Represents a serializer for a players object.\n *\n * The serialized form of players is a single digit if min and max are equal, or\n * a range string of #min-#max if they are different.\n */\nexport class ZRomulatorPlayersSerialize\n implements IZSerialize<IZRomulatorPlayers>\n{\n public serialize(\n candidate: ZOptional<IZRomulatorPlayers>,\n ): string | undefined {\n if (candidate == null) {\n return undefined;\n }\n\n const { min, max } = candidate;\n\n return min === max ? `${min}` : `${min}-${max}`;\n }\n}\n","import { keyBy } from \"lodash-es\";\n\n/**\n * The type of media content for a system.\n */\nexport enum ZRomulatorSystemContentType {\n /**\n * No idea\n */\n Unknown = \"unknown\",\n /**\n * Uses memory roms.\n */\n ReadOnlyMemory = \"rom\",\n /**\n * Folder based game with a known structure.\n */\n Folder = \"folder\",\n /**\n * Executable file.\n */\n File = \"file\",\n /**\n * Spinning disk media.\n */\n Disk = \"iso\",\n}\n\nconst ZRomulatorSystemContentTypeMap = keyBy(\n Object.values(ZRomulatorSystemContentType),\n);\n\n/**\n * Gets whether a candidate string represents a system content type.\n *\n * This check is case sensitive.\n *\n * @param candidate -\n * The candidate to check.\n *\n * @returns\n * True if candidate is a string that represents a system content type.\n */\nexport function isSystemContentType(\n candidate: any,\n): candidate is ZRomulatorSystemContentType {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(\n ZRomulatorSystemContentTypeMap,\n candidate,\n )\n );\n}\n","import { keyBy } from \"lodash-es\";\n\n/**\n * Describes the type of hardware a system is.\n */\nexport enum ZRomulatorSystemHardwareType {\n /**\n * No idea what this is.\n */\n Unknown = \"unknown\",\n /**\n * An accessory that attaches to another system.\n */\n Accessory = \"accessory\",\n\n /**\n * A cabinet system\n */\n Arcade = \"arcade\",\n\n /**\n * Known computer systems\n */\n Computer = \"computer\",\n\n /**\n * A console system.\n */\n Console = \"console\",\n\n /**\n * Pinball\n */\n Flipper = \"flipper\",\n\n /**\n * A handheld system\n */\n Handheld = \"console-portable\",\n\n /**\n * Script Creation Utility.\n */\n ScummVm = \"scummvm\",\n\n /**\n * Phone based system\n */\n Smartphone = \"smartphone\",\n\n /**\n * Virtual machine based system.\n */\n VirtualMachine = \"virtual-machine\",\n}\n\nconst ZRomulatorSystemHardwareTypeMap = keyBy(\n Object.values(ZRomulatorSystemHardwareType),\n);\n\n/**\n * Gets whether a candidate string represents a system hardware type.\n *\n * This check is case sensitive.\n *\n * @param candidate -\n * The candidate to check.\n *\n * @returns\n * True if candidate is a string that represents a system hardware type.\n */\nexport function isSystemHardwareType(\n candidate: any,\n): candidate is ZRomulatorSystemHardwareType {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(\n ZRomulatorSystemHardwareTypeMap,\n candidate,\n )\n );\n}\n","import { keyBy } from \"lodash-es\";\n\n/**\n * The type of media a system supports.\n */\nexport enum ZRomulatorSystemMediaFormat {\n /**\n * No idea\n */\n Unknown = \"unknown\",\n /**\n * Cartridge based systems.\n */\n Cartridge = \"cartridge\",\n\n /**\n * Motherboard based systems.\n *\n * Usually for arcades.\n */\n Pcb = \"pcb\",\n\n /**\n * CD/DVD based systems.\n */\n Cd = \"cd\",\n\n /**\n * Floppy disk based systems.\n */\n FloppyDisk = \"floppy-disk\",\n}\n\nconst ZRomulatorSystemMediaFormatMap = keyBy(\n Object.values(ZRomulatorSystemMediaFormat),\n);\n\n/**\n * Gets whether a candidate string represents a system media format.\n *\n * This check is case sensitive.\n *\n * @param candidate -\n * The candidate to check.\n *\n * @returns\n * True if candidate is a string that represents a system media format.\n */\nexport function isSystemMediaFormat(\n candidate: any,\n): candidate is ZRomulatorSystemMediaFormat {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(\n ZRomulatorSystemMediaFormatMap,\n candidate,\n )\n );\n}\n","import { castExtension } from \"@zthun/helpful-fn\";\nimport { castArray, get, lowerCase, uniqBy } from \"lodash-es\";\nimport {\n isSystemContentType,\n ZRomulatorSystemContentType,\n} from \"./system-content-type.mjs\";\nimport {\n isSystemHardwareType,\n ZRomulatorSystemHardwareType,\n} from \"./system-hardware-type.mjs\";\nimport { isSystemId, ZRomulatorSystemId } from \"./system-id.mjs\";\nimport {\n isSystemMediaFormat,\n ZRomulatorSystemMediaFormat,\n} from \"./system-media-format-type.mjs\";\n\n/**\n * Represents a system in romulator.\n *\n * These are detected by the file system.\n * See ES-DE for the standard directory\n * structure.\n */\nexport interface IZRomulatorSystem {\n /**\n * Unique identifier for the system.\n *\n * If you think about the directory structure\n * for ES-DE or retro-pie, for example, the id\n * would map to the name of the system directory.\n *\n * This is essentially a slug.\n */\n id: ZRomulatorSystemId;\n\n /**\n * The list of file extensions that system supports.\n *\n * Extensions, zip and 7z, should always be in this list.\n */\n extensions: string[];\n\n /**\n * Type classifications for the system.\n */\n classification: {\n /**\n * What type of system the hardware is.\n *\n * @example 'console'\n */\n hardwareType: ZRomulatorSystemHardwareType;\n\n /**\n * The type of media format.\n */\n mediaFormat: ZRomulatorSystemMediaFormat;\n\n /**\n * The digital format of the game media.\n */\n contentType: ZRomulatorSystemContentType;\n };\n\n /**\n * The canonical name of the system.\n *\n * This is the most globally recognized name,\n * not the historical accurate name for each\n * and every region.\n */\n name: string;\n\n /**\n * The company that published the system.\n */\n company: string;\n\n /**\n * The years the system was in production until.\n */\n productionYears: {\n /**\n * The first year the system went into production.\n *\n * Uses ? if we are not sure.\n */\n start: number | \"?\";\n /**\n * The year when production stopped.\n *\n * Current implies that production is still happening.\n */\n end: number | \"current\";\n };\n}\n\n/**\n * A builder for creating an IZRomulatorSystem.\n */\nexport class ZRomulatorSystemBuilder {\n private _system: IZRomulatorSystem = {\n id: ZRomulatorSystemId.Nintendo,\n name: \"\",\n\n classification: {\n hardwareType: ZRomulatorSystemHardwareType.Unknown,\n mediaFormat: ZRomulatorSystemMediaFormat.Unknown,\n contentType: ZRomulatorSystemContentType.Unknown,\n },\n\n company: \"\",\n\n productionYears: {\n start: \"?\",\n end: \"current\",\n },\n\n extensions: [\".zip\", \".7z\"],\n };\n\n /**\n * Sets the id (slug) of the system.\n *\n * @param id -\n * The unique identifier for the system.\n *\n * @returns\n * This instance.\n */\n public id(id: ZRomulatorSystemId): this {\n this._system.id = id;\n\n return this;\n }\n\n /**\n * Sets the canonical name of the system.\n *\n * @param name -\n * The canonical name of the system.\n *\n * @returns\n * This instance.\n */\n public name(name: string): this {\n this._system.name = name;\n\n return this;\n }\n\n /**\n * Sets the company that published the system.\n *\n * @param name -\n * The name of the company.\n *\n * @returns\n * This instance.\n */\n public company(name: string): this {\n this._system.company = name;\n\n return this;\n }\n\n /**\n * Sets the system hardware type.\n *\n * @param type -\n * The system hardware type.\n *\n * @returns\n * This instance.\n */\n public hardware(type: ZRomulatorSystemHardwareType): this {\n this._system.classification.hardwareType = type;\n\n return this;\n }\n\n /**\n * Sets the system media format.\n *\n * @param type -\n * The system media format.\n *\n * @returns\n * This instance.\n */\n public mediaFormat(type: ZRomulatorSystemMediaFormat): this {\n this._system.classification.mediaFormat = type;\n\n return this;\n }\n\n /**\n * Sets the system content type.\n *\n * @param type -\n * The system content type.\n *\n * @returns\n * This instance.\n */\n public contentType(type: ZRomulatorSystemContentType): this {\n this._system.classification.contentType = type;\n return this;\n }\n\n /**\n * Sets the production start value.\n *\n * @param start -\n * The year the system was released into production.\n * Use '?' if you do not know this information.\n *\n * @returns\n * This object.\n */\n public productionStart(start: number | \"?\") {\n this._system.productionYears.start = start;\n\n return this;\n }\n\n /**\n * Sets the production end of life value.\n *\n * @param end -\n * The end of life year. Set to current\n * to mark no end of life.\n *\n * @returns\n * This object.\n */\n public productionEnd(end: number | \"current\") {\n this._system.productionYears.end = end;\n\n return this;\n }\n\n /**\n * Sets the full production run.\n *\n * @param start -\n * The starting year of production.\n * @param end -\n * The last year of production.\n *\n * @returns\n * This object.\n */\n public production(\n start: number | \"?\" = \"?\",\n end: number | \"current\" = \"current\",\n ) {\n return this.productionStart(start).productionEnd(end);\n }\n\n /**\n * Adds to the extension list.\n *\n * @param extension -\n * The extension or list of extensions to add.\n *\n * @returns\n * This object.\n */\n public extension(extension: string | string[]) {\n const current = this._system.extensions.slice();\n const extensions = castArray(extension).map((e) => castExtension(e));\n const unique = uniqBy(current.concat(extensions), lowerCase);\n\n this._system.extensions = unique\n .filter((e) => e != null)\n .map((e) => e?.toLowerCase());\n\n return this;\n }\n\n private parseId(candidate: object) {\n const id = get(candidate, \"id\");\n\n return isSystemId(id) ? this.id(id) : this;\n }\n\n private parseName(candidate: object) {\n const name = get(candidate, \"name\");\n\n return name != null && typeof name === \"string\" ? this.name(name) : this;\n }\n\n private parseCompany(candidate: object) {\n const company = get(candidate, \"company\");\n\n return company != null && typeof company === \"string\"\n ? this.company(company)\n : this;\n }\n\n private parseExtensions(candidate: object) {\n const extensions = castArray(get(candidate, \"extensions\"))\n .filter((ext) => ext != null)\n .filter((ext) => typeof ext === \"string\")\n .map((ext) => castExtension(ext));\n\n return this.extension(extensions);\n }\n\n private parseHardwareType(classification: object) {\n const hardwareType = get(classification, \"hardwareType\");\n\n return isSystemHardwareType(hardwareType)\n ? this.hardware(hardwareType)\n : this;\n }\n\n private parseMediaFormat(classification: object) {\n const mediaFormat = get(classification, \"mediaFormat\");\n\n return isSystemMediaFormat(mediaFormat)\n ? this.mediaFormat(mediaFormat)\n : this;\n }\n\n private parseContentType(classification: object) {\n const contentType = get(classification, \"contentType\");\n\n return isSystemContentType(contentType)\n ? this.contentType(contentType)\n : this;\n }\n\n private parseClassification(candidate: object) {\n const classification = get(candidate, \"classification\");\n\n return classification != null && typeof classification === \"object\"\n ? this.parseHardwareType(classification)\n .parseMediaFormat(classification)\n .parseContentType(classification)\n : this;\n }\n\n private parseProductionStart(productionYears: object) {\n const start = get(productionYears, \"start\");\n\n return typeof start === \"number\" || start === \"?\"\n ? this.productionStart(start)\n : this;\n }\n\n private parseProductionEnd(productionYears: object) {\n const end = get(productionYears, \"end\");\n\n return typeof end === \"number\" || end === \"current\"\n ? this.productionEnd(end)\n : this;\n }\n\n private parseProductionYears(candidate: object) {\n const production = get(candidate, \"productionYears\");\n\n return production != null && typeof production === \"object\"\n ? this.parseProductionStart(production).parseProductionEnd(production)\n : this;\n }\n\n /**\n * Parses an unknown object to try and build a system from it.\n *\n * @param candidate -\n * The candidate to try and parse.\n *\n * @returns\n * This object.\n */\n public parse(candidate: unknown) {\n if (candidate == null || typeof candidate !== \"object\") {\n return this;\n }\n\n this.parseId(candidate)\n .parseName(candidate)\n .parseCompany(candidate)\n .parseExtensions(candidate)\n .parseClassification(candidate)\n .parseProductionYears(candidate);\n\n return this;\n }\n\n /**\n * Builds the system instance.\n *\n * @returns\n * A structured clone of the current system\n * that has been built.\n */\n public build() {\n return structuredClone(this._system);\n }\n}\n"],"names":["ZRomulatorConfigGamesMetadata","all","gamesFolder","ZMetadataBuilder","id","path","name","fallback","editable","file","build","ZRomulatorConfigGamesBuilder","games","_config","copy","other","structuredClone","assign","_define_property","ZRomulatorConfigId","ZRomulatorConfigBuilder","avatar","description","contents","metadata","meta","firstDefined","concat","castArray","ZRomulatorPlayersBuilder","min","players","_players","max","range","parseMax","candidate","get","parseMin","parse","singlePlayer","bind","twoPlayer","fourPlayer","eightPlayer","ZRomulatorSystemId","ZRomulatorSystemIdMap","keyBy","Object","values","isSystemId","prototype","hasOwnProperty","call","ZRomulatorGameBuilder","_game","system","release","developer","publisher","parseDeveloper","parsePublisher","parseReleaseDate","parsePlayers","parseDescription","parseName","clone","omitBy","isUndefined","Adam","ZRomulatorGameMediaType","ZRomulatorSystemMediaType","ZRomulatorSystemMediaTypeMap","ZRomulatorGameMediaTypeMap","isSystemMediaType","isGameMediaType","isMediaType","ZRomulatorMediaBuilder","_media","type","game","filename","fileName","url","from","hierarchy","split","sep","builder","length","parent","grandparent","ext","extname","title","basename","kebabCase","undefined","ZRomulatorPlayersSerialize","serialize","ZRomulatorSystemContentType","ZRomulatorSystemContentTypeMap","isSystemContentType","ZRomulatorSystemHardwareType","ZRomulatorSystemHardwareTypeMap","isSystemHardwareType","ZRomulatorSystemMediaFormat","ZRomulatorSystemMediaFormatMap","isSystemMediaFormat","ZRomulatorSystemBuilder","_system","company","hardware","classification","hardwareType","mediaFormat","contentType","productionStart","start","productionYears","productionEnd","end","extension","current","extensions","slice","map","e","castExtension","unique","uniqBy","lowerCase","filter","toLowerCase","parseId","parseCompany","parseExtensions","parseHardwareType","parseMediaFormat","parseContentType","parseClassification","parseProductionStart","parseProductionEnd","parseProductionYears","production","Nintendo","Unknown"],"mappings":";;;;;AAEO,MAAeA,6BAAAA,CAAAA;AACpB,IAAA,OAAcC,GAAoB,GAAA;QAChC,OAAO;AAACD,YAAAA,6BAAAA,CAA8BE,WAAW;AAAG,SAAA;AACtD;AAEA,IAAA,OAAcA,WAA0B,GAAA;AACtC,QAAA,OAAO,IAAIC,gBACRC,EAAAA,CAAAA,EAAE,CAAC,cACHC,CAAAA,CAAAA,IAAI,CAAC,aACLC,CAAAA,CAAAA,IAAI,CAAC,cAAA,CAAA,CACLC,QAAQ,CAAC,eAAA,CAAA,CACTC,QAAQ,EACRC,CAAAA,IAAI,GACJC,KAAK,EAAA;AACV;AACF;;;;;;;;;;;;;;;ACbO,MAAMC,4BAAAA,CAAAA;AAGJT,IAAAA,WAAAA,CAAYU,KAAa,EAAQ;AACtC,QAAA,IAAI,CAACC,OAAO,CAACX,WAAW,GAAGU,KAAAA;AAC3B,QAAA,OAAO,IAAI;AACb;AAEOE,IAAAA,IAAAA,CAAKC,KAA6B,EAAE;QACzC,IAAI,CAACF,OAAO,GAAGG,eAAgBD,CAAAA,KAAAA,CAAAA;AAC/B,QAAA,OAAO,IAAI;AACb;AAEOE,IAAAA,MAAAA,CAAOF,KAAsC,EAAE;QACpD,IAAI,CAACF,OAAO,GAAG;YAAE,GAAG,IAAI,CAACA,OAAO;AAAE,YAAA,GAAGE;AAAM,SAAA;AAC3C,QAAA,OAAO,IAAI;AACb;IAEOL,KAAgC,GAAA;QACrC,OAAOM,eAAAA,CAAgB,IAAI,CAACH,OAAO,CAAA;AACrC;;AAnBA,QAAAK,kBAAA,CAAA,IAAA,EAAQL,WAAkC,EAAC,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G,CAAAA,CAAAA,YAAY,CAACnG,SAAAA,CAAAA,CACboG,eAAe,CAACpG,SAAAA,CAAAA,CAChBwG,mBAAmB,CAACxG,SAAAA,CAAAA,CACpB2G,oBAAoB,CAAC3G,SAAAA,CAAAA;AAExB,QAAA,OAAO,IAAI;AACb;AAEA;;;;;;AAMC,MACD,KAAe,GAAA;QACb,OAAOpB,eAAAA,CAAgB,IAAI,CAAC8F,OAAO,CAAA;AACrC;;AA5SA,QAAA,gBAAA,CAAA,IAAA,EAAQA,SAA6B,EAAA;AACnC1G,YAAAA,EAAAA,EAAIyC,mBAAmBoG,QAAQ;YAC/B3I,IAAM,EAAA,EAAA;YAEN2G,cAAgB,EAAA;AACdC,gBAAAA,YAAAA,EAAcX,6BAA6B2C,OAAO;AAClD/B,gBAAAA,WAAAA,EAAaT,4BAA4BwC,OAAO;AAChD9B,gBAAAA,WAAAA,EAAahB,4BAA4B8C;AAC3C,aAAA;YAEAnC,OAAS,EAAA,EAAA;YAETQ,eAAiB,EAAA;gBACfD,KAAO,EAAA,GAAA;gBACPG,GAAK,EAAA;AACP,aAAA;YAEAG,UAAY,EAAA;AAAC,gBAAA,MAAA;AAAQ,gBAAA;AAAM;AAC7B,SAAA,CAAA;;AA2RF;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/config/config-games-metadata.mts","../src/config/config-games.mts","../src/config/config.mts","../src/players/players.mts","../src/system/system-id.mts","../src/game/game.mts","../src/media/media-type.mts","../src/media/media.mts","../src/players/players-serialize.mts","../src/system/system-content-type.mts","../src/system/system-hardware-type.mts","../src/system/system-media-format-type.mts","../src/system/system.mts"],"sourcesContent":["import { ZMetadataBuilder, type IZMetadata } from \"@zthun/helpful-query\";\n\nexport abstract class ZRomulatorConfigGamesMetadata {\n public static all(): IZMetadata[] {\n return [ZRomulatorConfigGamesMetadata.gamesFolder()];\n }\n\n public static gamesFolder(): IZMetadata {\n return new ZMetadataBuilder()\n .id(\"games-folder\")\n .path(\"gamesFolder\")\n .name(\"Games Folder\")\n .fallback(\"${HOME}/Games\")\n .editable()\n .file()\n .build();\n }\n}\n","export interface IZRomulatorConfigGames {\n gamesFolder?: string;\n}\n\nexport class ZRomulatorConfigGamesBuilder {\n private _config: IZRomulatorConfigGames = {};\n\n public gamesFolder(games: string): this {\n this._config.gamesFolder = games;\n return this;\n }\n\n public copy(other: IZRomulatorConfigGames) {\n this._config = structuredClone(other);\n return this;\n }\n\n public assign(other: Partial<IZRomulatorConfigGames>) {\n this._config = { ...this._config, ...other };\n return this;\n }\n\n public build(): IZRomulatorConfigGames {\n return structuredClone(this._config);\n }\n}\n","import { firstDefined } from \"@zthun/helpful-fn\";\nimport type { IZMetadata } from \"@zthun/helpful-query\";\nimport { castArray } from \"lodash-es\";\n\n/**\n * Represents a list of known config ids\n */\nexport enum ZRomulatorConfigId {\n /**\n * Config for games.\n */\n Games = \"games\",\n\n /**\n * Config id for media.\n */\n Media = \"media\",\n}\n\nexport interface IZRomulatorConfig<T = any> {\n id: ZRomulatorConfigId;\n name: string;\n\n avatar?: string;\n contents?: T;\n description?: string;\n file: string;\n metadata?: IZMetadata[];\n}\n\nexport class ZRomulatorConfigBuilder<T = any> {\n private _config: IZRomulatorConfig<T> = {\n id: ZRomulatorConfigId.Games,\n name: \"\",\n file: \"\",\n };\n\n public id(id: ZRomulatorConfigId) {\n this._config.id = id;\n return this;\n }\n\n public avatar(id: string) {\n this._config.avatar = id;\n return this;\n }\n\n public name(name: string) {\n this._config.name = name;\n return this;\n }\n\n public description(description: string) {\n this._config.description = description;\n return this;\n }\n\n public file(path: string) {\n this._config.file = path;\n return this;\n }\n\n public contents(contents?: T) {\n this._config.contents = contents;\n return this;\n }\n\n public metadata(meta: IZMetadata | IZMetadata[]) {\n const metadata = firstDefined([], this._config.metadata);\n this._config.metadata = metadata.concat(castArray(meta));\n return this;\n }\n\n public copy(other: IZRomulatorConfig<T>) {\n this._config = structuredClone(other);\n return this;\n }\n\n public build() {\n return structuredClone(this._config);\n }\n}\n","import { get } from \"lodash-es\";\n\n/**\n * Represents a player range for a game.\n */\nexport interface IZRomulatorPlayers {\n /**\n * The minimum number of players.\n *\n * This is almost always (read 99.99%)\n * 1.\n */\n min: number;\n /**\n * The maximum number of players.\n */\n max: number;\n}\n\n/**\n * Creates player range instances\n */\nexport class ZRomulatorPlayersBuilder {\n private _players: IZRomulatorPlayers = { min: 1, max: 1 };\n\n /**\n * Sets the minimum supported players.\n *\n * @param players -\n * Minimum number of players.\n *\n * @returns\n * This object.\n */\n public min(players: number) {\n this._players.min = players;\n return this;\n }\n\n /**\n * Sets the maximum supported players.\n *\n * @param players -\n * Maximum number of players.\n *\n * @returns\n * This object.\n */\n public max(players: number) {\n this._players.max = players;\n return this;\n }\n\n private range(min: number, max: number) {\n return this.min(min).max(max);\n }\n\n /**\n * Sets the player count to 1 player for both min and max.\n *\n * @returns\n * This object.\n */\n public singlePlayer = this.range.bind(this, 1, 1);\n\n /**\n * Sets the player count to 2 for max and 1 for min.\n *\n * @returns\n * This object.\n */\n public twoPlayer = this.range.bind(this, 1, 2);\n\n /**\n * Sets the player count to 4 for max and 1 for min.\n *\n * @returns\n * This object.\n */\n public fourPlayer = this.range.bind(this, 1, 4);\n\n /**\n * Sets the player count to 8 for max and 1 for min.\n *\n * @returns\n * This object.\n */\n public eightPlayer = this.range.bind(this, 1, 8);\n\n private parseMax(candidate: object) {\n const max = get(candidate, \"max\");\n\n return typeof max === \"number\" ? this.max(max) : this;\n }\n\n private parseMin(candidate: object) {\n const min = get(candidate, \"min\");\n\n return typeof min === \"number\" ? this.min(min) : this;\n }\n\n /**\n * Attempts to read player range values from an arbitrary candidate.\n *\n * @param candidate -\n * Source object to inspect.\n *\n * @returns\n * This object.\n */\n public parse(candidate: unknown) {\n if (candidate == null || typeof candidate !== \"object\") {\n return this;\n }\n\n return this.parseMin(candidate).parseMax(candidate);\n }\n\n /**\n * Copies an existing player range into this builder.\n *\n * @param other -\n * Players object to duplicate.\n *\n * @returns\n * This object\n */\n public copy(other: IZRomulatorPlayers) {\n this._players = structuredClone(other);\n return this;\n }\n\n /**\n * Creates the final player range instance.\n *\n * @returns\n * A cloned IZRomulatorPlayers instance.\n */\n public build() {\n return structuredClone(this._players);\n }\n}\n","import { keyBy } from \"lodash-es\";\n\n/**\n * Id slugs for supported systems.\n */\nexport enum ZRomulatorSystemId {\n ThreeDo = \"3do\",\n Adam = \"adam\",\n Amiga = \"amiga\",\n Amiga1200 = \"amiga1200\",\n Amiga600 = \"amiga600\",\n AmigaCd32 = \"amigacd32\",\n AmstradCpc = \"amstradcpc\",\n Android = \"android\",\n Apple2 = \"apple2\",\n Apple2Gs = \"apple2gs\",\n Arcade = \"arcade\",\n Arcadia = \"arcadia\",\n Archimedes = \"archimedes\",\n Arduboy = \"arduboy\",\n Astrocde = \"astrocde\",\n Atari2600 = \"atari2600\",\n Atari5200 = \"atari5200\",\n Atari7800 = \"atari7800\",\n Atari800 = \"atari800\",\n AtariJaguar = \"atarijaguar\",\n AtariJaguarCd = \"atarijaguarcd\",\n AtariLynx = \"atarilynx\",\n AtariSt = \"atarist\",\n Atomiswave = \"atomiswave\",\n BbcMicro = \"bbcmicro\",\n C64 = \"c64\",\n CdiMono1 = \"cdimono1\",\n Cdtv = \"cdtv\",\n ChannelF = \"channelf\",\n Coco = \"coco\",\n Colecovision = \"colecovision\",\n Cps = \"cps\",\n Cps1 = \"cps1\",\n Cps2 = \"cps2\",\n Cps3 = \"cps3\",\n CrVision = \"crvision\",\n Daphne = \"daphne\",\n Dos = \"dos\",\n Dragon32 = \"dragon32\",\n Dreamcast = \"dreamcast\",\n EasyRpg = \"easyrpg\",\n Electron = \"electron\",\n Famicom = \"famicom\",\n FBA = \"fba\",\n FBNeo = \"fbneo\",\n FDS = \"fds\",\n FM7 = \"fm7\",\n FMTowns = \"fmtowns\",\n FPinball = \"fpinball\",\n Gamate = \"gamate\",\n GameAndWatch = \"gameandwatch\",\n GameCom = \"gamecom\",\n GameGear = \"gamegear\",\n GB = \"gb\",\n GBA = \"gba\",\n GBC = \"gbc\",\n GameCube = \"gc\",\n Genesis = \"genesis\",\n GMaster = \"gmaster\",\n GX4000 = \"gx4000\",\n Intellivision = \"intellivision\",\n LowResNx = \"lowresnx\",\n Lutro = \"lutro\",\n Macintosh = \"macintosh\",\n Mame = \"mame\",\n MameAdvMame = \"mame-advmame\",\n Mark3 = \"mark3\",\n MasterSystem = \"mastersystem\",\n MegaCd = \"megacd\",\n MegaDrive = \"megadrive\",\n MegaDriveJp = \"megadrivejp\",\n MegaDuck = \"megaduck\",\n MESS = \"mess\",\n Model2 = \"model2\",\n Model3 = \"model3\",\n MSX = \"msx\",\n MSX1 = \"msx1\",\n MSX2 = \"msx2\",\n MSXTurbor = \"msxturbor\",\n N3DS = \"n3ds\",\n Nintendo64 = \"n64\",\n N64DD = \"n64dd\",\n Naomi = \"naomi\",\n Naomi2 = \"naomi2\",\n NaomiGd = \"naomigd\",\n NDS = \"nds\",\n NeoGeo = \"neogeo\",\n NeoGeoCd = \"neogeocd\",\n NeoGeoCdJp = \"neogeocdjp\",\n Nintendo = \"nes\",\n NGage = \"ngage\",\n NeoGeoPocket = \"ngp\",\n NeoGeoPocketColor = \"ngpc\",\n Odyssey2 = \"odyssey2\",\n OpenBor = \"openbor\",\n Oric = \"oric\",\n Palm = \"palm\",\n PC = \"pc\",\n PC88 = \"pc88\",\n PC98 = \"pc98\",\n PcEngine = \"pcengine\",\n PcEngineCd = \"pcenginecd\",\n PCFx = \"pcfx\",\n Pico8 = \"pico8\",\n Plus4 = \"plus4\",\n PokeMini = \"pokemini\",\n PS2 = \"ps2\",\n PS3 = \"ps3\",\n PS4 = \"ps4\",\n PSP = \"psp\",\n PSVita = \"psvita\",\n PSX = \"psx\",\n PV1000 = \"pv1000\",\n SamCoupe = \"samcoupe\",\n Satellaview = \"satellaview\",\n Saturn = \"saturn\",\n SaturnJp = \"saturnjp\",\n ScummVM = \"scummvm\",\n SCV = \"scv\",\n Sega32X = \"sega32x\",\n SegaCd = \"segacd\",\n Sg1000 = \"sg-1000\",\n SGB = \"sgb\",\n SuperNintendo = \"snes\",\n Solarus = \"solarus\",\n SpectraVideo = \"spectravideo\",\n STV = \"stv\",\n Sufami = \"sufami\",\n SuperGrafx = \"supergrafx\",\n SuperVision = \"supervision\",\n SupraCan = \"supracan\",\n Switch = \"switch\",\n TgCd = \"tg-cd\",\n TG16 = \"tg16\",\n TI99 = \"ti99\",\n TIC80 = \"tic80\",\n TO8 = \"to8\",\n TRS80 = \"trs-80\",\n TypeX = \"type-x\",\n Uzebox = \"uzebox\",\n Vectrex = \"vectrex\",\n Vic20 = \"vic20\",\n VideoPac = \"videopac\",\n Vircon32 = \"vircon32\",\n VirtualBoy = \"virtualboy\",\n VPinball = \"vpinball\",\n VSmile = \"vsmile\",\n Wasm4 = \"wasm4\",\n Wii = \"wii\",\n WiiU = \"wiiu\",\n Windows = \"windows\",\n Windows3X = \"windows3x\",\n Windows9X = \"windows9x\",\n WonderSwan = \"wonderswan\",\n WonderSwanColor = \"wonderswancolor\",\n X1 = \"x1\",\n X68000 = \"x68000\",\n Xbox = \"xbox\",\n Xbox360 = \"xbox360\",\n XboxOne = \"xboxone\",\n ZMachine = \"zmachine\",\n Zx81 = \"zx81\",\n ZxSpectrum = \"zxspectrum\",\n}\n\nconst ZRomulatorSystemIdMap = keyBy(Object.values(ZRomulatorSystemId));\n\n/**\n * Gets whether a candidate string represents a system id.\n *\n * This check is case sensitive.\n *\n * @param candidate -\n * The candidate to check.\n *\n * @returns\n * True if candidate is a string that represents a system id.\n */\nexport function isSystemId(candidate: any): candidate is ZRomulatorSystemId {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(ZRomulatorSystemIdMap, candidate)\n );\n}\n","import { get, isUndefined, omitBy } from \"lodash-es\";\nimport {\n ZRomulatorPlayersBuilder,\n type IZRomulatorPlayers,\n} from \"../players/players.mjs\";\nimport { ZRomulatorSystemId } from \"../system/system-id.mjs\";\n\n/**\n * Represents a rom file or image.\n */\nexport interface IZRomulatorGame {\n /**\n * The id of the game.\n *\n * This is unique across all games and all systems.\n */\n id: string;\n\n /**\n * The name of the game.\n *\n * This is not unique across systems. For example,\n * Battletoads and Double Dragon has the same name\n * across 3 different systems.\n */\n name: string;\n\n /**\n * The fully qualified path to the game file.\n */\n file: string;\n\n /**\n * The system id that this game belongs to.\n */\n system: ZRomulatorSystemId;\n\n /**\n * The date the game was released.\n */\n release: string;\n\n /**\n * The developer studio.\n */\n developer: string;\n\n /**\n * The publisher studio.\n */\n publisher: string;\n\n /**\n * The game description.\n */\n description: string;\n\n /**\n * The player information.\n */\n players: IZRomulatorPlayers;\n}\n\n/**\n * A builder for the IZRomulatorGame model.\n */\nexport class ZRomulatorGameBuilder {\n private _game: IZRomulatorGame = {\n id: \"\",\n name: \"\",\n file: \"\",\n system: ZRomulatorSystemId.Adam,\n release: \"\",\n description: \"\",\n developer: \"\",\n publisher: \"\",\n players: new ZRomulatorPlayersBuilder().build(),\n };\n\n /**\n * Sets the unique id for the game.\n *\n * @param id -\n * The unique identifier across all games and systems.\n * @returns\n * This instance.\n */\n public id(id: string): this {\n this._game.id = id;\n return this;\n }\n\n /**\n * Sets the display name for the game.\n *\n * @param name -\n * The canonical display name for the game.\n * @returns\n * This instance.\n */\n public name(name: string): this {\n this._game.name = name;\n return this;\n }\n\n /**\n * Sets the file path for the rom.\n *\n * @param path -\n * The fully qualified path to the game file.\n * @returns\n * This instance.\n */\n public file(path: string): this {\n this._game.file = path;\n return this;\n }\n\n /**\n * Sets the system the game belongs to.\n *\n * @param system -\n * The owning system id.\n * @returns\n * This instance.\n */\n public system(system: ZRomulatorSystemId): this {\n this._game.system = system;\n return this;\n }\n\n /**\n * Sets the release date for the game.\n *\n * @param release -\n * The release information for the game.\n * @returns\n * This instance.\n */\n public release(release: string): this {\n this._game.release = release;\n return this;\n }\n\n /**\n * Sets the developer studio for the game.\n *\n * @param developer -\n * The developer name.\n * @returns\n * This instance.\n */\n public developer(developer: string): this {\n this._game.developer = developer;\n return this;\n }\n\n /**\n * Sets the publisher studio for the game.\n *\n * @param publisher -\n * The publisher name.\n * @returns\n * This instance.\n */\n public publisher(publisher: string): this {\n this._game.publisher = publisher;\n return this;\n }\n\n /**\n * Sets the description for the game.\n *\n * @param description -\n * The game description.\n * @returns\n * This instance.\n */\n public description(description: string): this {\n this._game.description = description;\n return this;\n }\n\n /**\n * Sets the player configuration for the game.\n *\n * @param players -\n * The player configuration.\n * @returns\n * This instance.\n */\n public players(players: IZRomulatorPlayers): this {\n this._game.players = new ZRomulatorPlayersBuilder().copy(players).build();\n return this;\n }\n\n private parseDeveloper(candidate: object): this {\n const developer = get(candidate, \"developer\");\n\n return typeof developer === \"string\" ? this.developer(developer) : this;\n }\n\n private parsePublisher(candidate: object): this {\n const publisher = get(candidate, \"publisher\");\n\n return typeof publisher === \"string\" ? this.publisher(publisher) : this;\n }\n\n private parseReleaseDate(candidate: object): this {\n const release = get(candidate, \"release\");\n\n return typeof release == \"string\" ? this.release(release) : this;\n }\n\n private parsePlayers(candidate: object): this {\n const players = get(candidate, \"players\");\n\n return this.players(\n new ZRomulatorPlayersBuilder()\n .copy(this._game.players)\n .parse(players)\n .build(),\n );\n }\n\n private parseDescription(candidate: object): this {\n const description = get(candidate, \"description\");\n\n return typeof description === \"string\"\n ? this.description(description)\n : this;\n }\n\n private parseName(candidate: object): this {\n const name = get(candidate, \"name\");\n\n return typeof name === \"string\" ? this.name(name) : this;\n }\n\n /**\n * Attempts to parse a game from a game entry in a system.json game\n * list.\n *\n * @param candidate -\n * The candidate to parse.\n *\n * @returns\n * This object.\n */\n public parse(candidate: unknown): this {\n if (candidate == null || typeof candidate !== \"object\") {\n return this;\n }\n\n return this.parseName(candidate)\n .parseDescription(candidate)\n .parsePlayers(candidate)\n .parseReleaseDate(candidate)\n .parseDeveloper(candidate)\n .parsePublisher(candidate);\n }\n\n /**\n * Copies an existing game into this builder.\n *\n * @param other -\n * The other game to copy.\n * @returns\n * This instance.\n */\n public copy(other: IZRomulatorGame): this {\n this._game = structuredClone(other);\n return this;\n }\n\n /**\n * Builds the game instance.\n *\n * @returns\n * A structured clone of the current game with undefined properties removed.\n */\n public build() {\n const clone = structuredClone(this._game);\n return omitBy(clone, isUndefined) as IZRomulatorGame;\n }\n}\n","import { keyBy } from \"lodash-es\";\n\nexport enum ZRomulatorGameMediaType {\n /**\n * A 3d representation of the box art.\n */\n Box3d = \"3dboxes\",\n /**\n * Back of the game box.\n */\n BackCover = \"backcovers\",\n /**\n * Front of the game box.\n */\n Cover = \"covers\",\n /**\n * Fan art.\n */\n FanArt = \"fanart\",\n /**\n * Game manual.\n */\n Manual = \"manuals\",\n /**\n * A marquee of a game.\n */\n Marquee = \"marquees\",\n /**\n * The cartridge or disc label.\n */\n PhysicalMedia = \"physicalmedia\",\n /**\n * An in game screenshot showcasing gameplay.\n */\n Screenshot = \"screenshots\",\n /**\n * An in game screenshot of the title screen.\n */\n Title = \"titlescreens\",\n /**\n * A video showcasing the game.\n */\n Video = \"videos\",\n}\n\n/**\n * Media type for a system.\n */\nexport enum ZRomulatorSystemMediaType {\n /**\n * An image of a system's controller.\n */\n Controller = \"controller\",\n /**\n * A picture of the system.\n *\n * These are real life looking photos of what\n * a system looks like.\n */\n Picture = \"picture\",\n /**\n * A wheel for a system.\n *\n * This is basically the logo.\n */\n Wheel = \"wheel\",\n}\n\n/**\n * Describes what a specific piece of media represents.\n */\nexport type ZRomulatorMediaType =\n | ZRomulatorSystemMediaType\n | ZRomulatorGameMediaType;\n\nconst ZRomulatorSystemMediaTypeMap = keyBy(\n Object.values(ZRomulatorSystemMediaType),\n);\nconst ZRomulatorGameMediaTypeMap = keyBy(\n Object.values(ZRomulatorGameMediaType),\n);\n\nexport function isSystemMediaType(\n candidate: any,\n): candidate is ZRomulatorSystemMediaType {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(\n ZRomulatorSystemMediaTypeMap,\n candidate,\n )\n );\n}\n\nexport function isGameMediaType(\n candidate: any,\n): candidate is ZRomulatorGameMediaType {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(ZRomulatorGameMediaTypeMap, candidate)\n );\n}\n\nexport function isMediaType(candidate: any): candidate is ZRomulatorMediaType {\n return isSystemMediaType(candidate) || isGameMediaType(candidate);\n}\n","import { isUndefined, kebabCase, omitBy } from \"lodash-es\";\nimport { basename, extname, sep } from \"node:path\";\nimport type { ZRomulatorSystemId } from \"../system/system-id.mjs\";\nimport { isSystemId } from \"../system/system-id.mjs\";\nimport {\n isGameMediaType,\n isSystemMediaType,\n type ZRomulatorMediaType,\n} from \"./media-type.mjs\";\n\n/**\n * Represents a piece of media for a game or system.\n */\nexport interface IZRomulatorMedia {\n /**\n * The id of the media.\n */\n id?: string;\n\n /**\n * The id of the system that the media maps to.\n */\n system?: ZRomulatorSystemId;\n\n /**\n * The type of media this represents.\n */\n type?: ZRomulatorMediaType;\n\n /**\n * The id slug of the game if this media represents game media.\n */\n game?: string;\n\n /**\n * The name of the file.\n */\n fileName?: string;\n\n /**\n * The full url path for the media.\n */\n url?: string;\n}\n\n/**\n * A builder for the media object.\n */\nexport class ZRomulatorMediaBuilder {\n private _media: IZRomulatorMedia = {};\n\n public id(id: string) {\n this._media.id = id;\n return this;\n }\n\n public type(type: ZRomulatorMediaType) {\n this._media.type = type;\n return this;\n }\n\n public system(system: ZRomulatorSystemId) {\n this._media.system = system;\n return this;\n }\n\n public game(game: string | undefined) {\n this._media.game = game;\n return this;\n }\n\n public filename(name: string) {\n this._media.fileName = name;\n return this;\n }\n\n public url(url: string) {\n this._media.url = url;\n return this;\n }\n\n public from(path: string) {\n const hierarchy = path.split(sep);\n let builder = this.url(path);\n\n // The media structure is split into 2 or 3 parts\n // fileName = game file name or system media type name\n // parent = media type for games or system type for systems\n // grandparent = system type for games.\n\n const fileName = hierarchy[hierarchy.length - 1];\n const parent = hierarchy[hierarchy.length - 2];\n const grandparent = hierarchy[hierarchy.length - 3];\n\n if (!fileName) {\n // If we don't even have a file name - then this\n // isn't even media at all.\n return builder;\n }\n\n builder = builder.filename(fileName);\n const ext = extname(fileName);\n const title = basename(fileName, ext);\n\n if (isSystemMediaType(title) && isSystemId(parent)) {\n // This is media for system hardware\n const id = `${parent}-${kebabCase(title)}`;\n return builder.id(id).system(parent).type(title).game(undefined);\n }\n\n if (fileName && isGameMediaType(parent) && isSystemId(grandparent)) {\n // This is media for a game that is supported. The id for a game\n // is the system id followed by the kebab case of the title, followed\n // by the media type.\n const game = kebabCase(title);\n const id = `${grandparent}-${game}-${parent}`;\n return builder.id(id).system(grandparent).type(parent).game(game);\n }\n\n return builder;\n }\n\n public build() {\n const clone = structuredClone(this._media);\n return omitBy(clone, isUndefined) as IZRomulatorMedia;\n }\n}\n","import type { IZSerialize, ZOptional } from \"@zthun/helpful-fn\";\nimport type { IZRomulatorPlayers } from \"./players.mjs\";\n\n/**\n * Represents a serializer for a players object.\n *\n * The serialized form of players is a single digit if min and max are equal, or\n * a range string of #min-#max if they are different.\n */\nexport class ZRomulatorPlayersSerialize implements IZSerialize<IZRomulatorPlayers> {\n public serialize(\n candidate: ZOptional<IZRomulatorPlayers>,\n ): string | undefined {\n if (candidate == null) {\n return undefined;\n }\n\n const { min, max } = candidate;\n\n return min === max ? `${min}` : `${min}-${max}`;\n }\n}\n","import { keyBy } from \"lodash-es\";\n\n/**\n * The type of media content for a system.\n */\nexport enum ZRomulatorSystemContentType {\n /**\n * No idea\n */\n Unknown = \"unknown\",\n /**\n * Uses memory roms.\n */\n ReadOnlyMemory = \"rom\",\n /**\n * Folder based game with a known structure.\n */\n Folder = \"folder\",\n /**\n * Executable file.\n */\n File = \"file\",\n /**\n * Spinning disk media.\n */\n Disk = \"iso\",\n}\n\nconst ZRomulatorSystemContentTypeMap = keyBy(\n Object.values(ZRomulatorSystemContentType),\n);\n\n/**\n * Gets whether a candidate string represents a system content type.\n *\n * This check is case sensitive.\n *\n * @param candidate -\n * The candidate to check.\n *\n * @returns\n * True if candidate is a string that represents a system content type.\n */\nexport function isSystemContentType(\n candidate: any,\n): candidate is ZRomulatorSystemContentType {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(\n ZRomulatorSystemContentTypeMap,\n candidate,\n )\n );\n}\n","import { keyBy } from \"lodash-es\";\n\n/**\n * Describes the type of hardware a system is.\n */\nexport enum ZRomulatorSystemHardwareType {\n /**\n * No idea what this is.\n */\n Unknown = \"unknown\",\n /**\n * An accessory that attaches to another system.\n */\n Accessory = \"accessory\",\n\n /**\n * A cabinet system\n */\n Arcade = \"arcade\",\n\n /**\n * Known computer systems\n */\n Computer = \"computer\",\n\n /**\n * A console system.\n */\n Console = \"console\",\n\n /**\n * Pinball\n */\n Flipper = \"flipper\",\n\n /**\n * A handheld system\n */\n Handheld = \"console-portable\",\n\n /**\n * Script Creation Utility.\n */\n ScummVm = \"scummvm\",\n\n /**\n * Phone based system\n */\n Smartphone = \"smartphone\",\n\n /**\n * Virtual machine based system.\n */\n VirtualMachine = \"virtual-machine\",\n}\n\nconst ZRomulatorSystemHardwareTypeMap = keyBy(\n Object.values(ZRomulatorSystemHardwareType),\n);\n\n/**\n * Gets whether a candidate string represents a system hardware type.\n *\n * This check is case sensitive.\n *\n * @param candidate -\n * The candidate to check.\n *\n * @returns\n * True if candidate is a string that represents a system hardware type.\n */\nexport function isSystemHardwareType(\n candidate: any,\n): candidate is ZRomulatorSystemHardwareType {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(\n ZRomulatorSystemHardwareTypeMap,\n candidate,\n )\n );\n}\n","import { keyBy } from \"lodash-es\";\n\n/**\n * The type of media a system supports.\n */\nexport enum ZRomulatorSystemMediaFormat {\n /**\n * No idea\n */\n Unknown = \"unknown\",\n /**\n * Cartridge based systems.\n */\n Cartridge = \"cartridge\",\n\n /**\n * Motherboard based systems.\n *\n * Usually for arcades.\n */\n Pcb = \"pcb\",\n\n /**\n * CD/DVD based systems.\n */\n Cd = \"cd\",\n\n /**\n * Floppy disk based systems.\n */\n FloppyDisk = \"floppy-disk\",\n}\n\nconst ZRomulatorSystemMediaFormatMap = keyBy(\n Object.values(ZRomulatorSystemMediaFormat),\n);\n\n/**\n * Gets whether a candidate string represents a system media format.\n *\n * This check is case sensitive.\n *\n * @param candidate -\n * The candidate to check.\n *\n * @returns\n * True if candidate is a string that represents a system media format.\n */\nexport function isSystemMediaFormat(\n candidate: any,\n): candidate is ZRomulatorSystemMediaFormat {\n return (\n typeof candidate === \"string\" &&\n Object.prototype.hasOwnProperty.call(\n ZRomulatorSystemMediaFormatMap,\n candidate,\n )\n );\n}\n","import { castExtension } from \"@zthun/helpful-fn\";\nimport { castArray, get, lowerCase, uniqBy } from \"lodash-es\";\nimport {\n isSystemContentType,\n ZRomulatorSystemContentType,\n} from \"./system-content-type.mjs\";\nimport {\n isSystemHardwareType,\n ZRomulatorSystemHardwareType,\n} from \"./system-hardware-type.mjs\";\nimport { isSystemId, ZRomulatorSystemId } from \"./system-id.mjs\";\nimport {\n isSystemMediaFormat,\n ZRomulatorSystemMediaFormat,\n} from \"./system-media-format-type.mjs\";\n\n/**\n * Represents a system in romulator.\n *\n * These are detected by the file system.\n * See ES-DE for the standard directory\n * structure.\n */\nexport interface IZRomulatorSystem {\n /**\n * Unique identifier for the system.\n *\n * If you think about the directory structure\n * for ES-DE or retro-pie, for example, the id\n * would map to the name of the system directory.\n *\n * This is essentially a slug.\n */\n id: ZRomulatorSystemId;\n\n /**\n * The list of file extensions that system supports.\n *\n * Extensions, zip and 7z, should always be in this list.\n */\n extensions: string[];\n\n /**\n * Type classifications for the system.\n */\n classification: {\n /**\n * What type of system the hardware is.\n *\n * @example 'console'\n */\n hardwareType: ZRomulatorSystemHardwareType;\n\n /**\n * The type of media format.\n */\n mediaFormat: ZRomulatorSystemMediaFormat;\n\n /**\n * The digital format of the game media.\n */\n contentType: ZRomulatorSystemContentType;\n };\n\n /**\n * The canonical name of the system.\n *\n * This is the most globally recognized name,\n * not the historical accurate name for each\n * and every region.\n */\n name: string;\n\n /**\n * The company that published the system.\n */\n company: string;\n\n /**\n * The years the system was in production until.\n */\n productionYears: {\n /**\n * The first year the system went into production.\n *\n * Uses ? if we are not sure.\n */\n start: number | \"?\";\n /**\n * The year when production stopped.\n *\n * Current implies that production is still happening.\n */\n end: number | \"current\";\n };\n}\n\n/**\n * A builder for creating an IZRomulatorSystem.\n */\nexport class ZRomulatorSystemBuilder {\n private _system: IZRomulatorSystem = {\n id: ZRomulatorSystemId.Nintendo,\n name: \"\",\n\n classification: {\n hardwareType: ZRomulatorSystemHardwareType.Unknown,\n mediaFormat: ZRomulatorSystemMediaFormat.Unknown,\n contentType: ZRomulatorSystemContentType.Unknown,\n },\n\n company: \"\",\n\n productionYears: {\n start: \"?\",\n end: \"current\",\n },\n\n extensions: [\".zip\", \".7z\"],\n };\n\n /**\n * Sets the id (slug) of the system.\n *\n * @param id -\n * The unique identifier for the system.\n *\n * @returns\n * This instance.\n */\n public id(id: ZRomulatorSystemId): this {\n this._system.id = id;\n\n return this;\n }\n\n /**\n * Sets the canonical name of the system.\n *\n * @param name -\n * The canonical name of the system.\n *\n * @returns\n * This instance.\n */\n public name(name: string): this {\n this._system.name = name;\n\n return this;\n }\n\n /**\n * Sets the company that published the system.\n *\n * @param name -\n * The name of the company.\n *\n * @returns\n * This instance.\n */\n public company(name: string): this {\n this._system.company = name;\n\n return this;\n }\n\n /**\n * Sets the system hardware type.\n *\n * @param type -\n * The system hardware type.\n *\n * @returns\n * This instance.\n */\n public hardware(type: ZRomulatorSystemHardwareType): this {\n this._system.classification.hardwareType = type;\n\n return this;\n }\n\n /**\n * Sets the system media format.\n *\n * @param type -\n * The system media format.\n *\n * @returns\n * This instance.\n */\n public mediaFormat(type: ZRomulatorSystemMediaFormat): this {\n this._system.classification.mediaFormat = type;\n\n return this;\n }\n\n /**\n * Sets the system content type.\n *\n * @param type -\n * The system content type.\n *\n * @returns\n * This instance.\n */\n public contentType(type: ZRomulatorSystemContentType): this {\n this._system.classification.contentType = type;\n return this;\n }\n\n /**\n * Sets the production start value.\n *\n * @param start -\n * The year the system was released into production.\n * Use '?' if you do not know this information.\n *\n * @returns\n * This object.\n */\n public productionStart(start: number | \"?\") {\n this._system.productionYears.start = start;\n\n return this;\n }\n\n /**\n * Sets the production end of life value.\n *\n * @param end -\n * The end of life year. Set to current\n * to mark no end of life.\n *\n * @returns\n * This object.\n */\n public productionEnd(end: number | \"current\") {\n this._system.productionYears.end = end;\n\n return this;\n }\n\n /**\n * Sets the full production run.\n *\n * @param start -\n * The starting year of production.\n * @param end -\n * The last year of production.\n *\n * @returns\n * This object.\n */\n public production(\n start: number | \"?\" = \"?\",\n end: number | \"current\" = \"current\",\n ) {\n return this.productionStart(start).productionEnd(end);\n }\n\n /**\n * Adds to the extension list.\n *\n * @param extension -\n * The extension or list of extensions to add.\n *\n * @returns\n * This object.\n */\n public extension(extension: string | string[]) {\n const current = this._system.extensions.slice();\n const extensions = castArray(extension).map((e) => castExtension(e));\n const unique = uniqBy(current.concat(extensions), lowerCase);\n\n this._system.extensions = unique\n .filter((e) => e != null)\n .map((e) => e?.toLowerCase());\n\n return this;\n }\n\n private parseId(candidate: object) {\n const id = get(candidate, \"id\");\n\n return isSystemId(id) ? this.id(id) : this;\n }\n\n private parseName(candidate: object) {\n const name = get(candidate, \"name\");\n\n return name != null && typeof name === \"string\" ? this.name(name) : this;\n }\n\n private parseCompany(candidate: object) {\n const company = get(candidate, \"company\");\n\n return company != null && typeof company === \"string\"\n ? this.company(company)\n : this;\n }\n\n private parseExtensions(candidate: object) {\n const extensions = castArray(get(candidate, \"extensions\"))\n .filter((ext) => ext != null)\n .filter((ext) => typeof ext === \"string\")\n .map((ext) => castExtension(ext));\n\n return this.extension(extensions);\n }\n\n private parseHardwareType(classification: object) {\n const hardwareType = get(classification, \"hardwareType\");\n\n return isSystemHardwareType(hardwareType)\n ? this.hardware(hardwareType)\n : this;\n }\n\n private parseMediaFormat(classification: object) {\n const mediaFormat = get(classification, \"mediaFormat\");\n\n return isSystemMediaFormat(mediaFormat)\n ? this.mediaFormat(mediaFormat)\n : this;\n }\n\n private parseContentType(classification: object) {\n const contentType = get(classification, \"contentType\");\n\n return isSystemContentType(contentType)\n ? this.contentType(contentType)\n : this;\n }\n\n private parseClassification(candidate: object) {\n const classification = get(candidate, \"classification\");\n\n return classification != null && typeof classification === \"object\"\n ? this.parseHardwareType(classification)\n .parseMediaFormat(classification)\n .parseContentType(classification)\n : this;\n }\n\n private parseProductionStart(productionYears: object) {\n const start = get(productionYears, \"start\");\n\n return typeof start === \"number\" || start === \"?\"\n ? this.productionStart(start)\n : this;\n }\n\n private parseProductionEnd(productionYears: object) {\n const end = get(productionYears, \"end\");\n\n return typeof end === \"number\" || end === \"current\"\n ? this.productionEnd(end)\n : this;\n }\n\n private parseProductionYears(candidate: object) {\n const production = get(candidate, \"productionYears\");\n\n return production != null && typeof production === \"object\"\n ? this.parseProductionStart(production).parseProductionEnd(production)\n : this;\n }\n\n /**\n * Parses an unknown object to try and build a system from it.\n *\n * @param candidate -\n * The candidate to try and parse.\n *\n * @returns\n * This object.\n */\n public parse(candidate: unknown) {\n if (candidate == null || typeof candidate !== \"object\") {\n return this;\n }\n\n this.parseId(candidate)\n .parseName(candidate)\n .parseCompany(candidate)\n .parseExtensions(candidate)\n .parseClassification(candidate)\n .parseProductionYears(candidate);\n\n return this;\n }\n\n /**\n * Builds the system instance.\n *\n * @returns\n * A structured clone of the current system\n * that has been built.\n */\n public build() {\n return structuredClone(this._system);\n }\n}\n"],"names":["ZRomulatorConfigGamesMetadata","all","gamesFolder","ZMetadataBuilder","id","path","name","fallback","editable","file","build","ZRomulatorConfigGamesBuilder","games","_config","copy","other","structuredClone","assign","_define_property","ZRomulatorConfigId","ZRomulatorConfigBuilder","avatar","description","contents","metadata","meta","firstDefined","concat","castArray","ZRomulatorPlayersBuilder","min","players","_players","max","range","parseMax","candidate","get","parseMin","parse","singlePlayer","bind","twoPlayer","fourPlayer","eightPlayer","ZRomulatorSystemId","ZRomulatorSystemIdMap","keyBy","Object","values","isSystemId","prototype","hasOwnProperty","call","ZRomulatorGameBuilder","_game","system","release","developer","publisher","parseDeveloper","parsePublisher","parseReleaseDate","parsePlayers","parseDescription","parseName","clone","omitBy","isUndefined","Adam","ZRomulatorGameMediaType","ZRomulatorSystemMediaType","ZRomulatorSystemMediaTypeMap","ZRomulatorGameMediaTypeMap","isSystemMediaType","isGameMediaType","isMediaType","ZRomulatorMediaBuilder","_media","type","game","filename","fileName","url","from","hierarchy","split","sep","builder","length","parent","grandparent","ext","extname","title","basename","kebabCase","undefined","ZRomulatorPlayersSerialize","serialize","ZRomulatorSystemContentType","ZRomulatorSystemContentTypeMap","isSystemContentType","ZRomulatorSystemHardwareType","ZRomulatorSystemHardwareTypeMap","isSystemHardwareType","ZRomulatorSystemMediaFormat","ZRomulatorSystemMediaFormatMap","isSystemMediaFormat","ZRomulatorSystemBuilder","_system","company","hardware","classification","hardwareType","mediaFormat","contentType","productionStart","start","productionYears","productionEnd","end","extension","current","extensions","slice","map","e","castExtension","unique","uniqBy","lowerCase","filter","toLowerCase","parseId","parseCompany","parseExtensions","parseHardwareType","parseMediaFormat","parseContentType","parseClassification","parseProductionStart","parseProductionEnd","parseProductionYears","production","Nintendo","Unknown"],"mappings":";;;;;AAEO,MAAeA,6BAAAA,CAAAA;AACpB,IAAA,OAAcC,GAAoB,GAAA;QAChC,OAAO;AAACD,YAAAA,6BAAAA,CAA8BE,WAAW;AAAG,SAAA;AACtD;AAEA,IAAA,OAAcA,WAA0B,GAAA;AACtC,QAAA,OAAO,IAAIC,gBACRC,EAAAA,CAAAA,EAAE,CAAC,cACHC,CAAAA,CAAAA,IAAI,CAAC,aACLC,CAAAA,CAAAA,IAAI,CAAC,cAAA,CAAA,CACLC,QAAQ,CAAC,eAAA,CAAA,CACTC,QAAQ,EACRC,CAAAA,IAAI,GACJC,KAAK,EAAA;AACV;AACF;;;;;;;;;;;;;;;ACbO,MAAMC,4BAAAA,CAAAA;AAGJT,IAA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YAEAG,UAAY,EAAA;AAAC,gBAAA,MAAA;AAAQ,gBAAA;AAAM;AAC7B,SAAA,CAAA;;AA2RF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zthun/romulator-client",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.4",
|
|
4
4
|
"description": "A client for declaring models and invoking the romulator api",
|
|
5
5
|
"author": "Anthony Bonta",
|
|
6
6
|
"license": "MIT",
|
|
@@ -25,21 +25,22 @@
|
|
|
25
25
|
"access": "public"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@zthun/helpful-fn": "^9.11.
|
|
29
|
-
"@zthun/helpful-query": "^9.11.
|
|
30
|
-
"lodash-es": "^4.17.
|
|
28
|
+
"@zthun/helpful-fn": "^9.11.4",
|
|
29
|
+
"@zthun/helpful-query": "^9.11.4",
|
|
30
|
+
"lodash-es": "^4.17.23"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/lodash-es": "^4.17.12",
|
|
34
|
-
"@zthun/janitor-build-config": "^19.
|
|
35
|
-
"
|
|
34
|
+
"@zthun/janitor-build-config": "^19.5.6",
|
|
35
|
+
"@zthun/janitor-ts-config": "^19.5.3",
|
|
36
|
+
"tsx": "^4.21.0",
|
|
36
37
|
"typescript": "^5.9.3",
|
|
37
|
-
"vite": "^7.
|
|
38
|
-
"vitest": "^4.0.
|
|
38
|
+
"vite": "^7.3.1",
|
|
39
|
+
"vitest": "^4.0.18"
|
|
39
40
|
},
|
|
40
41
|
"files": [
|
|
41
42
|
"dist"
|
|
42
43
|
],
|
|
43
44
|
"sideEffects": false,
|
|
44
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "e3f4de76344181d22641550c8d562f50f0498d94"
|
|
45
46
|
}
|