@zthun/romulator-client 1.7.1 → 1.10.0
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 +137 -80
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +3 -1
- package/dist/index.js +136 -81
- package/dist/index.js.map +1 -1
- package/dist/system/system-content-type.d.mts +21 -0
- package/dist/system/{system-type.d.mts → system-hardware-type.d.mts} +2 -2
- package/dist/system/system-id.d.mts +0 -32
- package/dist/system/system-media-format-type.d.mts +23 -0
- package/dist/system/system.d.mts +83 -33
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ZMetadataBuilder } from '@zthun/helpful-query';
|
|
2
2
|
import { firstDefined } from '@zthun/helpful-fn';
|
|
3
|
-
import { castArray, omitBy, isUndefined, keyBy, kebabCase,
|
|
3
|
+
import { castArray, omitBy, isUndefined, keyBy, kebabCase, uniqBy, upperCase, get } from 'lodash-es';
|
|
4
4
|
import { sep, extname, basename } from 'node:path';
|
|
5
5
|
|
|
6
6
|
class ZRomulatorConfigGamesMetadata {
|
|
@@ -243,15 +243,12 @@ function isMediaType(candidate) {
|
|
|
243
243
|
*/ var ZRomulatorSystemId = /*#__PURE__*/ function(ZRomulatorSystemId) {
|
|
244
244
|
ZRomulatorSystemId["ThreeDo"] = "3do";
|
|
245
245
|
ZRomulatorSystemId["Adam"] = "adam";
|
|
246
|
-
ZRomulatorSystemId["AGS"] = "ags";
|
|
247
246
|
ZRomulatorSystemId["Amiga"] = "amiga";
|
|
248
247
|
ZRomulatorSystemId["Amiga1200"] = "amiga1200";
|
|
249
248
|
ZRomulatorSystemId["Amiga600"] = "amiga600";
|
|
250
249
|
ZRomulatorSystemId["AmigaCd32"] = "amigacd32";
|
|
251
250
|
ZRomulatorSystemId["AmstradCpc"] = "amstradcpc";
|
|
252
251
|
ZRomulatorSystemId["Android"] = "android";
|
|
253
|
-
ZRomulatorSystemId["AndroidApps"] = "androidapps";
|
|
254
|
-
ZRomulatorSystemId["AndroidGames"] = "androidgames";
|
|
255
252
|
ZRomulatorSystemId["Apple2"] = "apple2";
|
|
256
253
|
ZRomulatorSystemId["Apple2Gs"] = "apple2gs";
|
|
257
254
|
ZRomulatorSystemId["Arcade"] = "arcade";
|
|
@@ -267,37 +264,29 @@ function isMediaType(candidate) {
|
|
|
267
264
|
ZRomulatorSystemId["AtariJaguarCd"] = "atarijaguarcd";
|
|
268
265
|
ZRomulatorSystemId["AtariLynx"] = "atarilynx";
|
|
269
266
|
ZRomulatorSystemId["AtariSt"] = "atarist";
|
|
270
|
-
ZRomulatorSystemId["AtariXe"] = "atarixe";
|
|
271
267
|
ZRomulatorSystemId["Atomiswave"] = "atomiswave";
|
|
272
268
|
ZRomulatorSystemId["BbcMicro"] = "bbcmicro";
|
|
273
269
|
ZRomulatorSystemId["C64"] = "c64";
|
|
274
270
|
ZRomulatorSystemId["CdiMono1"] = "cdimono1";
|
|
275
271
|
ZRomulatorSystemId["Cdtv"] = "cdtv";
|
|
276
|
-
ZRomulatorSystemId["ChaiLove"] = "chailove";
|
|
277
272
|
ZRomulatorSystemId["ChannelF"] = "channelf";
|
|
278
273
|
ZRomulatorSystemId["Coco"] = "coco";
|
|
279
274
|
ZRomulatorSystemId["Colecovision"] = "colecovision";
|
|
280
|
-
ZRomulatorSystemId["ConsoleArcade"] = "consolearcade";
|
|
281
275
|
ZRomulatorSystemId["Cps"] = "cps";
|
|
282
276
|
ZRomulatorSystemId["Cps1"] = "cps1";
|
|
283
277
|
ZRomulatorSystemId["Cps2"] = "cps2";
|
|
284
278
|
ZRomulatorSystemId["Cps3"] = "cps3";
|
|
285
279
|
ZRomulatorSystemId["CrVision"] = "crvision";
|
|
286
280
|
ZRomulatorSystemId["Daphne"] = "daphne";
|
|
287
|
-
ZRomulatorSystemId["Desktop"] = "desktop";
|
|
288
|
-
ZRomulatorSystemId["Doom"] = "doom";
|
|
289
281
|
ZRomulatorSystemId["Dos"] = "dos";
|
|
290
282
|
ZRomulatorSystemId["Dragon32"] = "dragon32";
|
|
291
283
|
ZRomulatorSystemId["Dreamcast"] = "dreamcast";
|
|
292
284
|
ZRomulatorSystemId["EasyRpg"] = "easyrpg";
|
|
293
285
|
ZRomulatorSystemId["Electron"] = "electron";
|
|
294
|
-
ZRomulatorSystemId["Emulators"] = "emulators";
|
|
295
|
-
ZRomulatorSystemId["Epic"] = "epic";
|
|
296
286
|
ZRomulatorSystemId["Famicom"] = "famicom";
|
|
297
287
|
ZRomulatorSystemId["FBA"] = "fba";
|
|
298
288
|
ZRomulatorSystemId["FBNeo"] = "fbneo";
|
|
299
289
|
ZRomulatorSystemId["FDS"] = "fds";
|
|
300
|
-
ZRomulatorSystemId["Flash"] = "flash";
|
|
301
290
|
ZRomulatorSystemId["FM7"] = "fm7";
|
|
302
291
|
ZRomulatorSystemId["FMTowns"] = "fmtowns";
|
|
303
292
|
ZRomulatorSystemId["FPinball"] = "fpinball";
|
|
@@ -313,12 +302,7 @@ function isMediaType(candidate) {
|
|
|
313
302
|
ZRomulatorSystemId["GMaster"] = "gmaster";
|
|
314
303
|
ZRomulatorSystemId["GX4000"] = "gx4000";
|
|
315
304
|
ZRomulatorSystemId["Intellivision"] = "intellivision";
|
|
316
|
-
ZRomulatorSystemId["J2ME"] = "j2me";
|
|
317
|
-
ZRomulatorSystemId["Kodi"] = "kodi";
|
|
318
|
-
ZRomulatorSystemId["Laserdisc"] = "laserdisc";
|
|
319
|
-
ZRomulatorSystemId["LcdGames"] = "lcdgames";
|
|
320
305
|
ZRomulatorSystemId["LowResNx"] = "lowresnx";
|
|
321
|
-
ZRomulatorSystemId["Lutris"] = "lutris";
|
|
322
306
|
ZRomulatorSystemId["Lutro"] = "lutro";
|
|
323
307
|
ZRomulatorSystemId["Macintosh"] = "macintosh";
|
|
324
308
|
ZRomulatorSystemId["Mame"] = "mame";
|
|
@@ -326,20 +310,16 @@ function isMediaType(candidate) {
|
|
|
326
310
|
ZRomulatorSystemId["Mark3"] = "mark3";
|
|
327
311
|
ZRomulatorSystemId["MasterSystem"] = "mastersystem";
|
|
328
312
|
ZRomulatorSystemId["MegaCd"] = "megacd";
|
|
329
|
-
ZRomulatorSystemId["MegaCdJp"] = "megacdjp";
|
|
330
313
|
ZRomulatorSystemId["MegaDrive"] = "megadrive";
|
|
331
314
|
ZRomulatorSystemId["MegaDriveJp"] = "megadrivejp";
|
|
332
315
|
ZRomulatorSystemId["MegaDuck"] = "megaduck";
|
|
333
316
|
ZRomulatorSystemId["MESS"] = "mess";
|
|
334
317
|
ZRomulatorSystemId["Model2"] = "model2";
|
|
335
318
|
ZRomulatorSystemId["Model3"] = "model3";
|
|
336
|
-
ZRomulatorSystemId["Moto"] = "moto";
|
|
337
319
|
ZRomulatorSystemId["MSX"] = "msx";
|
|
338
320
|
ZRomulatorSystemId["MSX1"] = "msx1";
|
|
339
321
|
ZRomulatorSystemId["MSX2"] = "msx2";
|
|
340
322
|
ZRomulatorSystemId["MSXTurbor"] = "msxturbor";
|
|
341
|
-
ZRomulatorSystemId["Mugen"] = "mugen";
|
|
342
|
-
ZRomulatorSystemId["Multivision"] = "multivision";
|
|
343
323
|
ZRomulatorSystemId["N3DS"] = "n3ds";
|
|
344
324
|
ZRomulatorSystemId["Nintendo64"] = "n64";
|
|
345
325
|
ZRomulatorSystemId["N64DD"] = "n64dd";
|
|
@@ -361,14 +341,12 @@ function isMediaType(candidate) {
|
|
|
361
341
|
ZRomulatorSystemId["PC"] = "pc";
|
|
362
342
|
ZRomulatorSystemId["PC88"] = "pc88";
|
|
363
343
|
ZRomulatorSystemId["PC98"] = "pc98";
|
|
364
|
-
ZRomulatorSystemId["PcArcade"] = "pcarcade";
|
|
365
344
|
ZRomulatorSystemId["PcEngine"] = "pcengine";
|
|
366
345
|
ZRomulatorSystemId["PcEngineCd"] = "pcenginecd";
|
|
367
346
|
ZRomulatorSystemId["PCFx"] = "pcfx";
|
|
368
347
|
ZRomulatorSystemId["Pico8"] = "pico8";
|
|
369
348
|
ZRomulatorSystemId["Plus4"] = "plus4";
|
|
370
349
|
ZRomulatorSystemId["PokeMini"] = "pokemini";
|
|
371
|
-
ZRomulatorSystemId["Ports"] = "ports";
|
|
372
350
|
ZRomulatorSystemId["PS2"] = "ps2";
|
|
373
351
|
ZRomulatorSystemId["PS3"] = "ps3";
|
|
374
352
|
ZRomulatorSystemId["PS4"] = "ps4";
|
|
@@ -376,7 +354,6 @@ function isMediaType(candidate) {
|
|
|
376
354
|
ZRomulatorSystemId["PSVita"] = "psvita";
|
|
377
355
|
ZRomulatorSystemId["PSX"] = "psx";
|
|
378
356
|
ZRomulatorSystemId["PV1000"] = "pv1000";
|
|
379
|
-
ZRomulatorSystemId["Quake"] = "quake";
|
|
380
357
|
ZRomulatorSystemId["SamCoupe"] = "samcoupe";
|
|
381
358
|
ZRomulatorSystemId["Satellaview"] = "satellaview";
|
|
382
359
|
ZRomulatorSystemId["Saturn"] = "saturn";
|
|
@@ -384,31 +361,23 @@ function isMediaType(candidate) {
|
|
|
384
361
|
ZRomulatorSystemId["ScummVM"] = "scummvm";
|
|
385
362
|
ZRomulatorSystemId["SCV"] = "scv";
|
|
386
363
|
ZRomulatorSystemId["Sega32X"] = "sega32x";
|
|
387
|
-
ZRomulatorSystemId["Sega32XJp"] = "sega32xjp";
|
|
388
|
-
ZRomulatorSystemId["Sega32XNa"] = "sega32xna";
|
|
389
364
|
ZRomulatorSystemId["SegaCd"] = "segacd";
|
|
390
|
-
ZRomulatorSystemId["SFC"] = "sfc";
|
|
391
365
|
ZRomulatorSystemId["Sg1000"] = "sg-1000";
|
|
392
366
|
ZRomulatorSystemId["SGB"] = "sgb";
|
|
393
367
|
ZRomulatorSystemId["SuperNintendo"] = "snes";
|
|
394
|
-
ZRomulatorSystemId["SnesNa"] = "snesna";
|
|
395
368
|
ZRomulatorSystemId["Solarus"] = "solarus";
|
|
396
369
|
ZRomulatorSystemId["SpectraVideo"] = "spectravideo";
|
|
397
|
-
ZRomulatorSystemId["Steam"] = "steam";
|
|
398
370
|
ZRomulatorSystemId["STV"] = "stv";
|
|
399
371
|
ZRomulatorSystemId["Sufami"] = "sufami";
|
|
400
372
|
ZRomulatorSystemId["SuperGrafx"] = "supergrafx";
|
|
401
373
|
ZRomulatorSystemId["SuperVision"] = "supervision";
|
|
402
374
|
ZRomulatorSystemId["SupraCan"] = "supracan";
|
|
403
375
|
ZRomulatorSystemId["Switch"] = "switch";
|
|
404
|
-
ZRomulatorSystemId["Symbian"] = "symbian";
|
|
405
|
-
ZRomulatorSystemId["TanoDragon"] = "tanodragon";
|
|
406
376
|
ZRomulatorSystemId["TgCd"] = "tg-cd";
|
|
407
377
|
ZRomulatorSystemId["TG16"] = "tg16";
|
|
408
378
|
ZRomulatorSystemId["TI99"] = "ti99";
|
|
409
379
|
ZRomulatorSystemId["TIC80"] = "tic80";
|
|
410
380
|
ZRomulatorSystemId["TO8"] = "to8";
|
|
411
|
-
ZRomulatorSystemId["Triforce"] = "triforce";
|
|
412
381
|
ZRomulatorSystemId["TRS80"] = "trs-80";
|
|
413
382
|
ZRomulatorSystemId["TypeX"] = "type-x";
|
|
414
383
|
ZRomulatorSystemId["Uzebox"] = "uzebox";
|
|
@@ -434,7 +403,6 @@ function isMediaType(candidate) {
|
|
|
434
403
|
ZRomulatorSystemId["XboxOne"] = "xboxone";
|
|
435
404
|
ZRomulatorSystemId["ZMachine"] = "zmachine";
|
|
436
405
|
ZRomulatorSystemId["Zx81"] = "zx81";
|
|
437
|
-
ZRomulatorSystemId["ZxNext"] = "zxnext";
|
|
438
406
|
ZRomulatorSystemId["ZxSpectrum"] = "zxspectrum";
|
|
439
407
|
return ZRomulatorSystemId;
|
|
440
408
|
}({});
|
|
@@ -513,49 +481,92 @@ const ZRomulatorSystemIdMap = keyBy(Object.values(ZRomulatorSystemId));
|
|
|
513
481
|
}
|
|
514
482
|
|
|
515
483
|
/**
|
|
516
|
-
*
|
|
517
|
-
*/ var
|
|
484
|
+
* The type of media content for a system.
|
|
485
|
+
*/ var ZRomulatorSystemContentType = /*#__PURE__*/ function(ZRomulatorSystemContentType) {
|
|
486
|
+
/**
|
|
487
|
+
* Uses memory roms.
|
|
488
|
+
*/ ZRomulatorSystemContentType["ReadOnlyMemory"] = "rom";
|
|
489
|
+
/**
|
|
490
|
+
* Folder based game with a known structure.
|
|
491
|
+
*/ ZRomulatorSystemContentType["Folder"] = "folder";
|
|
492
|
+
/**
|
|
493
|
+
* Executable file.
|
|
494
|
+
*/ ZRomulatorSystemContentType["File"] = "file";
|
|
495
|
+
/**
|
|
496
|
+
* Spinning disk media.
|
|
497
|
+
*/ ZRomulatorSystemContentType["Disk"] = "iso";
|
|
498
|
+
return ZRomulatorSystemContentType;
|
|
499
|
+
}({});
|
|
500
|
+
|
|
501
|
+
/**
|
|
502
|
+
* Describes the type of hardware a system is.
|
|
503
|
+
*/ var ZRomulatorSystemHardwareType = /*#__PURE__*/ function(ZRomulatorSystemHardwareType) {
|
|
518
504
|
/**
|
|
519
505
|
* An accessory that attaches to another system.
|
|
520
|
-
*/
|
|
506
|
+
*/ ZRomulatorSystemHardwareType["Accessory"] = "accessory";
|
|
521
507
|
/**
|
|
522
508
|
* A cabinet system
|
|
523
|
-
*/
|
|
509
|
+
*/ ZRomulatorSystemHardwareType["Arcade"] = "arcade";
|
|
524
510
|
/**
|
|
525
511
|
* Known computer systems
|
|
526
|
-
*/
|
|
512
|
+
*/ ZRomulatorSystemHardwareType["Computer"] = "computer";
|
|
527
513
|
/**
|
|
528
514
|
* A console system.
|
|
529
|
-
*/
|
|
515
|
+
*/ ZRomulatorSystemHardwareType["Console"] = "console";
|
|
530
516
|
/**
|
|
531
517
|
* Pinball
|
|
532
|
-
*/
|
|
518
|
+
*/ ZRomulatorSystemHardwareType["Flipper"] = "flipper";
|
|
533
519
|
/**
|
|
534
520
|
* A handheld system
|
|
535
|
-
*/
|
|
521
|
+
*/ ZRomulatorSystemHardwareType["Handheld"] = "console-portable";
|
|
536
522
|
/**
|
|
537
523
|
* Script Creation Utility.
|
|
538
|
-
*/
|
|
524
|
+
*/ ZRomulatorSystemHardwareType["ScummVm"] = "scummvm";
|
|
539
525
|
/**
|
|
540
526
|
* Phone based system
|
|
541
|
-
*/
|
|
527
|
+
*/ ZRomulatorSystemHardwareType["Smartphone"] = "smartphone";
|
|
542
528
|
/**
|
|
543
529
|
* Virtual machine based system.
|
|
544
|
-
*/
|
|
545
|
-
return
|
|
530
|
+
*/ ZRomulatorSystemHardwareType["VirtualMachine"] = "virtual-machine";
|
|
531
|
+
return ZRomulatorSystemHardwareType;
|
|
532
|
+
}({});
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* The type of media a system supports.
|
|
536
|
+
*/ var ZRomulatorSystemMediaFormatType = /*#__PURE__*/ function(ZRomulatorSystemMediaFormatType) {
|
|
537
|
+
/**
|
|
538
|
+
* Cartridge based systems.
|
|
539
|
+
*/ ZRomulatorSystemMediaFormatType["Cartridge"] = "cartridge";
|
|
540
|
+
/**
|
|
541
|
+
* Motherboard based systems.
|
|
542
|
+
*
|
|
543
|
+
* Usually for arcades.
|
|
544
|
+
*/ ZRomulatorSystemMediaFormatType["Pcb"] = "pcb";
|
|
545
|
+
/**
|
|
546
|
+
* CD/DVD based systems.
|
|
547
|
+
*/ ZRomulatorSystemMediaFormatType["Cd"] = "cd";
|
|
548
|
+
/**
|
|
549
|
+
* Floppy disk based systems.
|
|
550
|
+
*/ ZRomulatorSystemMediaFormatType["FloppyDisk"] = "floppy-disk";
|
|
551
|
+
return ZRomulatorSystemMediaFormatType;
|
|
546
552
|
}({});
|
|
547
553
|
|
|
548
554
|
/**
|
|
549
555
|
* A builder for creating an IZRomulatorSystem.
|
|
550
556
|
*/ class ZRomulatorSystemBuilder {
|
|
551
557
|
_system = {
|
|
552
|
-
id: ZRomulatorSystemId.Nintendo
|
|
558
|
+
id: ZRomulatorSystemId.Nintendo,
|
|
559
|
+
extensions: [
|
|
560
|
+
"zip",
|
|
561
|
+
"7z"
|
|
562
|
+
]
|
|
553
563
|
};
|
|
554
564
|
/**
|
|
555
565
|
* Sets the id (slug) of the system.
|
|
556
566
|
*
|
|
557
567
|
* @param id -
|
|
558
568
|
* The unique identifier for the system.
|
|
569
|
+
*
|
|
559
570
|
* @returns
|
|
560
571
|
* This instance.
|
|
561
572
|
*/ id(id) {
|
|
@@ -567,6 +578,7 @@ const ZRomulatorSystemIdMap = keyBy(Object.values(ZRomulatorSystemId));
|
|
|
567
578
|
*
|
|
568
579
|
* @param name -
|
|
569
580
|
* The canonical name of the system.
|
|
581
|
+
*
|
|
570
582
|
* @returns
|
|
571
583
|
* This instance.
|
|
572
584
|
*/ name(name) {
|
|
@@ -574,73 +586,116 @@ const ZRomulatorSystemIdMap = keyBy(Object.values(ZRomulatorSystemId));
|
|
|
574
586
|
return this;
|
|
575
587
|
}
|
|
576
588
|
/**
|
|
577
|
-
* Sets the system
|
|
589
|
+
* Sets the company that published the system.
|
|
590
|
+
*
|
|
591
|
+
* @param name -
|
|
592
|
+
* The name of the company.
|
|
578
593
|
*
|
|
579
|
-
* @param type -
|
|
580
|
-
* The type of system.
|
|
581
594
|
* @returns
|
|
582
595
|
* This instance.
|
|
583
|
-
*/
|
|
584
|
-
this._system.
|
|
596
|
+
*/ company(name) {
|
|
597
|
+
this._system.company = name;
|
|
585
598
|
return this;
|
|
586
599
|
}
|
|
587
600
|
/**
|
|
588
|
-
* Sets the system type
|
|
601
|
+
* Sets the system hardware type.
|
|
589
602
|
*
|
|
590
|
-
* @
|
|
591
|
-
*
|
|
592
|
-
*/ console = this.type.bind(this, ZRomulatorSystemType.Console);
|
|
593
|
-
/**
|
|
594
|
-
* Sets the system type to handheld.
|
|
603
|
+
* @param type -
|
|
604
|
+
* The system hardware type.
|
|
595
605
|
*
|
|
596
606
|
* @returns
|
|
597
607
|
* This instance.
|
|
598
|
-
*/
|
|
608
|
+
*/ hardware(type) {
|
|
609
|
+
this._system.classification = firstDefined({}, this._system.classification);
|
|
610
|
+
this._system.classification.hardwareType = type;
|
|
611
|
+
return this;
|
|
612
|
+
}
|
|
599
613
|
/**
|
|
600
|
-
* Sets the system
|
|
614
|
+
* Sets the system media format.
|
|
601
615
|
*
|
|
602
|
-
* @
|
|
603
|
-
*
|
|
604
|
-
*/ arcade = this.type.bind(this, ZRomulatorSystemType.Arcade);
|
|
605
|
-
/**
|
|
606
|
-
* Sets the system type to computer.
|
|
616
|
+
* @param type -
|
|
617
|
+
* The system media format.
|
|
607
618
|
*
|
|
608
619
|
* @returns
|
|
609
620
|
* This instance.
|
|
610
|
-
*/
|
|
621
|
+
*/ mediaFormat(type) {
|
|
622
|
+
this._system.classification = firstDefined({}, this._system.classification);
|
|
623
|
+
this._system.classification.mediaFormat = type;
|
|
624
|
+
return this;
|
|
625
|
+
}
|
|
611
626
|
/**
|
|
612
|
-
* Sets the
|
|
627
|
+
* Sets the system content type.
|
|
628
|
+
*
|
|
629
|
+
* @param type -
|
|
630
|
+
* The system content type.
|
|
613
631
|
*
|
|
614
|
-
* @param generation -
|
|
615
|
-
* The generational index of the system.
|
|
616
632
|
* @returns
|
|
617
633
|
* This instance.
|
|
618
|
-
*/
|
|
619
|
-
this._system.
|
|
634
|
+
*/ contentType(type) {
|
|
635
|
+
this._system.classification = firstDefined({}, this._system.classification);
|
|
636
|
+
this._system.classification.contentType = type;
|
|
620
637
|
return this;
|
|
621
638
|
}
|
|
622
639
|
/**
|
|
623
|
-
*
|
|
640
|
+
* Sets the production run.
|
|
624
641
|
*
|
|
625
|
-
* @param
|
|
626
|
-
* The
|
|
642
|
+
* @param start -
|
|
643
|
+
* The starting year of production.
|
|
644
|
+
* @param end -
|
|
645
|
+
* The last year of production.
|
|
627
646
|
*
|
|
628
647
|
* @returns
|
|
629
648
|
* This object.
|
|
630
|
-
*/
|
|
631
|
-
this._system
|
|
632
|
-
|
|
633
|
-
|
|
649
|
+
*/ production(start, end) {
|
|
650
|
+
delete this._system.productionYears;
|
|
651
|
+
this._system.productionYears = {
|
|
652
|
+
start,
|
|
653
|
+
end
|
|
634
654
|
};
|
|
655
|
+
this._system.productionYears = omitBy(this._system.productionYears, isUndefined);
|
|
635
656
|
return this;
|
|
636
657
|
}
|
|
637
658
|
/**
|
|
638
|
-
*
|
|
639
|
-
|
|
640
|
-
|
|
659
|
+
* Adds to the extension list.
|
|
660
|
+
*
|
|
661
|
+
* @param extension -
|
|
662
|
+
* The extension or list of extensions to add.
|
|
663
|
+
*
|
|
664
|
+
* @returns
|
|
665
|
+
* This object.
|
|
666
|
+
*/ extension(extension) {
|
|
667
|
+
const extensions = firstDefined([], this._system.extensions);
|
|
668
|
+
this._system.extensions = uniqBy(extensions.concat(extension), upperCase).map((e)=>e.toLowerCase());
|
|
641
669
|
return this;
|
|
642
670
|
}
|
|
643
671
|
/**
|
|
672
|
+
* Parses an unknown object to try and build a system from it.
|
|
673
|
+
*
|
|
674
|
+
* @param candidate -
|
|
675
|
+
* The candidate to try and parse.
|
|
676
|
+
*
|
|
677
|
+
* @returns
|
|
678
|
+
* This object.
|
|
679
|
+
*/ parse(candidate) {
|
|
680
|
+
if (candidate == null || typeof candidate !== "object") {
|
|
681
|
+
return this;
|
|
682
|
+
}
|
|
683
|
+
const id = get(candidate, "id");
|
|
684
|
+
const name = get(candidate, "name");
|
|
685
|
+
const company = get(candidate, "company");
|
|
686
|
+
const extensions = castArray(get(candidate, "extensions")).filter((ext)=>ext != null).filter((ext)=>typeof ext === "string");
|
|
687
|
+
if (isSystemId(id)) {
|
|
688
|
+
this.id(id);
|
|
689
|
+
}
|
|
690
|
+
if (name != null && typeof name === "string") {
|
|
691
|
+
this.name(name);
|
|
692
|
+
}
|
|
693
|
+
if (company != null && typeof company === "string") {
|
|
694
|
+
this.company(company);
|
|
695
|
+
}
|
|
696
|
+
return this.extension(extensions);
|
|
697
|
+
}
|
|
698
|
+
/**
|
|
644
699
|
* Builds the system instance.
|
|
645
700
|
*
|
|
646
701
|
* @returns
|
|
@@ -651,5 +706,5 @@ const ZRomulatorSystemIdMap = keyBy(Object.values(ZRomulatorSystemId));
|
|
|
651
706
|
}
|
|
652
707
|
}
|
|
653
708
|
|
|
654
|
-
export { ZRomulatorConfigBuilder, ZRomulatorConfigGamesBuilder, ZRomulatorConfigGamesMetadata, ZRomulatorConfigId, ZRomulatorGameBuilder, ZRomulatorGameMediaType, ZRomulatorMediaBuilder, ZRomulatorSystemBuilder, ZRomulatorSystemId,
|
|
709
|
+
export { ZRomulatorConfigBuilder, ZRomulatorConfigGamesBuilder, ZRomulatorConfigGamesMetadata, ZRomulatorConfigId, ZRomulatorGameBuilder, ZRomulatorGameMediaType, ZRomulatorMediaBuilder, ZRomulatorSystemBuilder, ZRomulatorSystemContentType, ZRomulatorSystemHardwareType, ZRomulatorSystemId, ZRomulatorSystemMediaFormatType, ZRomulatorSystemMediaType, isGameMediaType, isMediaType, isSystemId, isSystemMediaType };
|
|
655
710
|
//# sourceMappingURL=index.js.map
|
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/game/game.mts","../src/media/media-type.mts","../src/system/system-id.mts","../src/media/media.mts","../src/system/system-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 { isUndefined, omitBy } from \"lodash-es\";\nimport type { 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/**\n * A builder for the IZRomulatorGame model.\n */\nexport class ZRomulatorGameBuilder {\n private _game: IZRomulatorGame = { id: \"\" };\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 * 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.png\",\n /**\n * A icon for the system.\n *\n * These are normally 32x32.\n */\n Icon = \"icon.png\",\n /**\n * An illustration of the system.\n */\n Illustration = \"illustration.png\",\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.png\",\n /**\n * A video trailer for the system.\n */\n Video = \"video.mp4\",\n /**\n * A wheel for a system.\n *\n * This is basically the logo.\n */\n Wheel = \"wheel.png\",\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 { keyBy } from \"lodash-es\";\n\n/**\n * Id slugs for supported systems.\n */\nexport enum ZRomulatorSystemId {\n ThreeDo = \"3do\",\n Adam = \"adam\",\n AGS = \"ags\",\n Amiga = \"amiga\",\n Amiga1200 = \"amiga1200\",\n Amiga600 = \"amiga600\",\n AmigaCd32 = \"amigacd32\",\n AmstradCpc = \"amstradcpc\",\n Android = \"android\",\n AndroidApps = \"androidapps\",\n AndroidGames = \"androidgames\",\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 AtariXe = \"atarixe\",\n Atomiswave = \"atomiswave\",\n BbcMicro = \"bbcmicro\",\n C64 = \"c64\",\n CdiMono1 = \"cdimono1\",\n Cdtv = \"cdtv\",\n ChaiLove = \"chailove\",\n ChannelF = \"channelf\",\n Coco = \"coco\",\n Colecovision = \"colecovision\",\n ConsoleArcade = \"consolearcade\",\n Cps = \"cps\",\n Cps1 = \"cps1\",\n Cps2 = \"cps2\",\n Cps3 = \"cps3\",\n CrVision = \"crvision\",\n Daphne = \"daphne\",\n Desktop = \"desktop\",\n Doom = \"doom\",\n Dos = \"dos\",\n Dragon32 = \"dragon32\",\n Dreamcast = \"dreamcast\",\n EasyRpg = \"easyrpg\",\n Electron = \"electron\",\n Emulators = \"emulators\",\n Epic = \"epic\",\n Famicom = \"famicom\",\n FBA = \"fba\",\n FBNeo = \"fbneo\",\n FDS = \"fds\",\n Flash = \"flash\",\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 J2ME = \"j2me\",\n Kodi = \"kodi\",\n Laserdisc = \"laserdisc\",\n LcdGames = \"lcdgames\",\n LowResNx = \"lowresnx\",\n Lutris = \"lutris\",\n Lutro = \"lutro\",\n Macintosh = \"macintosh\",\n Mame = \"mame\",\n MameAdvMame = \"mame-advmame\",\n Mark3 = \"mark3\",\n MasterSystem = \"mastersystem\",\n MegaCd = \"megacd\",\n MegaCdJp = \"megacdjp\",\n MegaDrive = \"megadrive\",\n MegaDriveJp = \"megadrivejp\",\n MegaDuck = \"megaduck\",\n MESS = \"mess\",\n Model2 = \"model2\",\n Model3 = \"model3\",\n Moto = \"moto\",\n MSX = \"msx\",\n MSX1 = \"msx1\",\n MSX2 = \"msx2\",\n MSXTurbor = \"msxturbor\",\n Mugen = \"mugen\",\n Multivision = \"multivision\",\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 PcArcade = \"pcarcade\",\n PcEngine = \"pcengine\",\n PcEngineCd = \"pcenginecd\",\n PCFx = \"pcfx\",\n Pico8 = \"pico8\",\n Plus4 = \"plus4\",\n PokeMini = \"pokemini\",\n Ports = \"ports\",\n PS2 = \"ps2\",\n PS3 = \"ps3\",\n PS4 = \"ps4\",\n PSP = \"psp\",\n PSVita = \"psvita\",\n PSX = \"psx\",\n PV1000 = \"pv1000\",\n Quake = \"quake\",\n SamCoupe = \"samcoupe\",\n Satellaview = \"satellaview\",\n Saturn = \"saturn\",\n SaturnJp = \"saturnjp\",\n ScummVM = \"scummvm\",\n SCV = \"scv\",\n Sega32X = \"sega32x\",\n Sega32XJp = \"sega32xjp\",\n Sega32XNa = \"sega32xna\",\n SegaCd = \"segacd\",\n SFC = \"sfc\",\n Sg1000 = \"sg-1000\",\n SGB = \"sgb\",\n SuperNintendo = \"snes\",\n SnesNa = \"snesna\",\n Solarus = \"solarus\",\n SpectraVideo = \"spectravideo\",\n Steam = \"steam\",\n STV = \"stv\",\n Sufami = \"sufami\",\n SuperGrafx = \"supergrafx\",\n SuperVision = \"supervision\",\n SupraCan = \"supracan\",\n Switch = \"switch\",\n Symbian = \"symbian\",\n TanoDragon = \"tanodragon\",\n TgCd = \"tg-cd\",\n TG16 = \"tg16\",\n TI99 = \"ti99\",\n TIC80 = \"tic80\",\n TO8 = \"to8\",\n Triforce = \"triforce\",\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 ZxNext = \"zxnext\",\n ZxSpectrum = \"zxspectrum\",\n}\n\nconst ZRomulatorSystemIdMap = keyBy(Object.values(ZRomulatorSystemId));\n\n/**\n * Gets whether a candidate string 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 { 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(fileName) && isSystemId(parent)) {\n // This is media for system hardware\n const id = `${parent}-${kebabCase(title)}`;\n return builder.id(id).system(parent).type(fileName).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","/**\n * Describes a type of system.\n */\nexport enum ZRomulatorSystemType {\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","import { pick } from \"lodash-es\";\nimport { ZRomulatorSystemId } from \"./system-id.mjs\";\nimport { ZRomulatorSystemType } from \"./system-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, for example, the id would map to\n * the name of the system directory.\n *\n * This is essentially a slug.\n */\n id: ZRomulatorSystemId;\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 * The generational index of the system.\n */\n generation?: number;\n /**\n * The type of system.\n */\n type?: ZRomulatorSystemType;\n}\n\n/**\n * A builder for creating an IZRomulatorSystem.\n */\nexport class ZRomulatorSystemBuilder {\n private _system: IZRomulatorSystem = {\n id: ZRomulatorSystemId.Nintendo,\n };\n\n /**\n * Sets the id (slug) of the system.\n *\n * @param id -\n * The unique identifier for the system.\n * @returns\n * This instance.\n */\n public id(id: ZRomulatorSystemId): this {\n this._system.id = id;\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 * @returns\n * This instance.\n */\n public name(name: string): this {\n this._system.name = name;\n return this;\n }\n\n /**\n * Sets the system type.\n *\n * @param type -\n * The type of system.\n * @returns\n * This instance.\n */\n public type(type: ZRomulatorSystemType): this {\n this._system.type = type;\n return this;\n }\n\n /**\n * Sets the system type to console.\n *\n * @returns\n * This instance.\n */\n public console = this.type.bind(this, ZRomulatorSystemType.Console);\n\n /**\n * Sets the system type to handheld.\n *\n * @returns\n * This instance.\n */\n public handheld = this.type.bind(this, ZRomulatorSystemType.Handheld);\n\n /**\n * Sets the system type to arcade.\n *\n * @returns\n * This instance.\n */\n public arcade = this.type.bind(this, ZRomulatorSystemType.Arcade);\n\n /**\n * Sets the system type to computer.\n *\n * @returns\n * This instance.\n */\n public computer = this.type.bind(this, ZRomulatorSystemType.Computer);\n\n /**\n * Sets the generational index of the system.\n *\n * @param generation -\n * The generational index of the system.\n * @returns\n * This instance.\n */\n public generation(generation: number): this {\n this._system.generation = generation;\n return this;\n }\n\n /**\n * Assigns system data to this system.\n *\n * @param system -\n * The partial system data to assign.\n *\n * @returns\n * This object.\n */\n public assign(system: Partial<IZRomulatorSystem>) {\n this._system = { ...this._system, ...system };\n return this;\n }\n\n /**\n * Removes anything that is not a valid property on this object.\n */\n public redact() {\n this._system = pick(this._system, \"id\", \"name\", \"generation\", \"type\");\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","_config","games","copy","other","structuredClone","assign","ZRomulatorConfigId","ZRomulatorConfigBuilder","avatar","description","contents","metadata","meta","firstDefined","concat","castArray","ZRomulatorGameBuilder","_game","system","clone","omitBy","isUndefined","ZRomulatorGameMediaType","ZRomulatorSystemMediaType","ZRomulatorSystemMediaTypeMap","keyBy","Object","values","ZRomulatorGameMediaTypeMap","isSystemMediaType","candidate","prototype","hasOwnProperty","call","isGameMediaType","isMediaType","ZRomulatorSystemId","ZRomulatorSystemIdMap","isSystemId","ZRomulatorMediaBuilder","_media","type","game","filename","fileName","url","from","hierarchy","split","sep","builder","length","parent","grandparent","ext","extname","title","basename","kebabCase","undefined","ZRomulatorSystemType","ZRomulatorSystemBuilder","_system","Nintendo","console","bind","Console","handheld","Handheld","arcade","Arcade","computer","Computer","generation","pick"],"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;AACHC,IAAAA,OAAAA,GAAkC,EAAG;AAEtCV,IAAAA,WAAAA,CAAYW,KAAa,EAAQ;AACtC,QAAA,IAAI,CAACD,OAAO,CAACV,WAAW,GAAGW,KAAAA;AAC3B,QAAA,OAAO,IAAI;AACb;AAEOC,IAAAA,IAAAA,CAAKC,KAA6B,EAAE;QACzC,IAAI,CAACH,OAAO,GAAGI,eAAgBD,CAAAA,KAAAA,CAAAA;AAC/B,QAAA,OAAO,IAAI;AACb;AAEOE,IAAAA,MAAAA,CAAOF,KAAsC,EA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CAAA;AACrC;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/config/config-games-metadata.mts","../src/config/config-games.mts","../src/config/config.mts","../src/game/game.mts","../src/media/media-type.mts","../src/system/system-id.mts","../src/media/media.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 { isUndefined, omitBy } from \"lodash-es\";\nimport type { 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/**\n * A builder for the IZRomulatorGame model.\n */\nexport class ZRomulatorGameBuilder {\n private _game: IZRomulatorGame = { id: \"\" };\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 * 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.png\",\n /**\n * A icon for the system.\n *\n * These are normally 32x32.\n */\n Icon = \"icon.png\",\n /**\n * An illustration of the system.\n */\n Illustration = \"illustration.png\",\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.png\",\n /**\n * A video trailer for the system.\n */\n Video = \"video.mp4\",\n /**\n * A wheel for a system.\n *\n * This is basically the logo.\n */\n Wheel = \"wheel.png\",\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 { 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 */\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 { 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(fileName) && isSystemId(parent)) {\n // This is media for system hardware\n const id = `${parent}-${kebabCase(title)}`;\n return builder.id(id).system(parent).type(fileName).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","/**\n * The type of media content for a system.\n */\nexport enum ZRomulatorSystemContentType {\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","/**\n * Describes the type of hardware a system is.\n */\nexport enum ZRomulatorSystemHardwareType {\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","/**\n * The type of media a system supports.\n */\nexport enum ZRomulatorSystemMediaFormatType {\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","import { firstDefined } from \"@zthun/helpful-fn\";\nimport {\n castArray,\n get,\n isUndefined,\n omitBy,\n uniqBy,\n upperCase,\n} from \"lodash-es\";\nimport type { ZRomulatorSystemContentType } from \"./system-content-type.mjs\";\nimport type { ZRomulatorSystemHardwareType } from \"./system-hardware-type.mjs\";\nimport { isSystemId, ZRomulatorSystemId } from \"./system-id.mjs\";\nimport type { ZRomulatorSystemMediaFormatType } 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 * 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 * 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?: ZRomulatorSystemMediaFormatType;\n\n /**\n * The digital format of the game media.\n */\n contentType?: ZRomulatorSystemContentType;\n };\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 start?: number;\n /**\n * The year when production stopped.\n */\n end?: number;\n };\n}\n\n/**\n * A builder for creating an IZRomulatorSystem.\n */\nexport class ZRomulatorSystemBuilder {\n private _system: IZRomulatorSystem = {\n id: ZRomulatorSystemId.Nintendo,\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 = firstDefined({}, this._system.classification);\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: ZRomulatorSystemMediaFormatType): this {\n this._system.classification = firstDefined({}, this._system.classification);\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 = firstDefined({}, this._system.classification);\n this._system.classification.contentType = type;\n return this;\n }\n\n /**\n * Sets the 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(start: number, end?: number) {\n delete this._system.productionYears;\n this._system.productionYears = {\n start,\n end,\n };\n this._system.productionYears = omitBy(\n this._system.productionYears,\n isUndefined,\n );\n\n return this;\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 extensions = firstDefined([], this._system.extensions);\n this._system.extensions = uniqBy<string>(\n extensions.concat(extension),\n upperCase,\n ).map((e) => e.toLowerCase());\n\n return 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 const id = get(candidate, \"id\");\n const name = get(candidate, \"name\");\n const company = get(candidate, \"company\");\n const extensions = castArray(get(candidate, \"extensions\"))\n .filter((ext) => ext != null)\n .filter((ext) => typeof ext === \"string\");\n\n if (isSystemId(id)) {\n this.id(id);\n }\n\n if (name != null && typeof name === \"string\") {\n this.name(name);\n }\n\n if (company != null && typeof company === \"string\") {\n this.company(company);\n }\n\n return this.extension(extensions);\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","_config","games","copy","other","structuredClone","assign","ZRomulatorConfigId","ZRomulatorConfigBuilder","avatar","description","contents","metadata","meta","firstDefined","concat","castArray","ZRomulatorGameBuilder","_game","system","clone","omitBy","isUndefined","ZRomulatorGameMediaType","ZRomulatorSystemMediaType","ZRomulatorSystemMediaTypeMap","keyBy","Object","values","ZRomulatorGameMediaTypeMap","isSystemMediaType","candidate","prototype","hasOwnProperty","call","isGameMediaType","isMediaType","ZRomulatorSystemId","ZRomulatorSystemIdMap","isSystemId","ZRomulatorMediaBuilder","_media","type","game","filename","fileName","url","from","hierarchy","split","sep","builder","length","parent","grandparent","ext","extname","title","basename","kebabCase","undefined","ZRomulatorSystemContentType","ZRomulatorSystemHardwareType","ZRomulatorSystemMediaFormatType","ZRomulatorSystemBuilder","_system","Nintendo","extensions","company","hardware","classification","hardwareType","mediaFormat","contentType","production","start","end","productionYears","extension","uniqBy","upperCase","map","e","toLowerCase","parse","get","filter"],"mappings":";;;;;AAEO,MAAeA,6BAAAA,CAAAA;AACpB,IAAA,OAAcC,GAAoB,GAAA;QAChC,OAAO;AAACD,YAAAA,6BAAAA,CAA8BE,WAAW;AAAG,SAAA;AACtD;AAEA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Q,IAAA,IAAA,IAAQ,OAAOA,IAAAA,KAAS,QAAU,EAAA;YAC5C,IAAI,CAACA,IAAI,CAACA,IAAAA,CAAAA;AACZ;AAEA,QAAA,IAAIyE,OAAW,IAAA,IAAA,IAAQ,OAAOA,OAAAA,KAAY,QAAU,EAAA;YAClD,IAAI,CAACA,OAAO,CAACA,OAAAA,CAAAA;AACf;QAEA,OAAO,IAAI,CAACU,SAAS,CAACX,UAAAA,CAAAA;AACxB;AAEA;;;;;;AAMC,MACD,KAAe,GAAA;QACb,OAAO9D,eAAAA,CAAgB,IAAI,CAAC4D,OAAO,CAAA;AACrC;AACF;;;;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The type of media content for a system.
|
|
3
|
+
*/
|
|
4
|
+
export declare enum ZRomulatorSystemContentType {
|
|
5
|
+
/**
|
|
6
|
+
* Uses memory roms.
|
|
7
|
+
*/
|
|
8
|
+
ReadOnlyMemory = "rom",
|
|
9
|
+
/**
|
|
10
|
+
* Folder based game with a known structure.
|
|
11
|
+
*/
|
|
12
|
+
Folder = "folder",
|
|
13
|
+
/**
|
|
14
|
+
* Executable file.
|
|
15
|
+
*/
|
|
16
|
+
File = "file",
|
|
17
|
+
/**
|
|
18
|
+
* Spinning disk media.
|
|
19
|
+
*/
|
|
20
|
+
Disk = "iso"
|
|
21
|
+
}
|