From 6bfd068ec17710e5b699680810e08102a7797c13 Mon Sep 17 00:00:00 2001 From: Christian Emmer <10749361+emmercm@users.noreply.github.com> Date: Fri, 30 Aug 2024 16:49:17 -0700 Subject: [PATCH] Refactor: sort modules into groups --- src/igir.ts | 38 +++++++-------- .../candidateArchiveFileHasher.ts | 18 +++---- .../{ => candidates}/candidateCombiner.ts | 18 +++---- .../candidateExtensionCorrector.ts | 26 +++++----- .../{ => candidates}/candidateGenerator.ts | 40 ++++++++-------- .../candidateMergeSplitValidator.ts | 18 +++---- .../candidatePatchGenerator.ts | 24 +++++----- .../candidatePostProcessor.ts | 16 +++---- .../{ => candidates}/candidatePreferer.ts | 14 +++--- .../{ => candidates}/candidateValidator.ts | 12 ++--- .../{ => candidates}/candidateWriter.ts | 30 ++++++------ src/modules/{ => dats}/datCombiner.ts | 14 +++--- src/modules/{ => dats}/datFilter.ts | 14 +++--- src/modules/{ => dats}/datGameInferrer.ts | 26 +++++----- src/modules/{ => dats}/datMergerSplitter.ts | 20 ++++---- src/modules/{ => dats}/datParentInferrer.ts | 14 +++--- src/modules/{ => dats}/datScanner.ts | 44 ++++++++--------- src/modules/{ => roms}/romHeaderProcessor.ts | 16 +++---- src/modules/{ => roms}/romIndexer.ts | 26 +++++----- src/modules/{ => roms}/romScanner.ts | 12 ++--- test/igir.test.ts | 2 +- .../candidateArchiveFileHasher.test.ts | 0 .../candidateCombiner.test.ts | 26 +++++----- .../candidateExtensionCorrector.test.ts | 32 ++++++------- .../candidateGenerator.test.ts | 48 +++++++++---------- .../candidateMergeSplitValidator.test.ts | 26 +++++----- .../candidatePatchGenerator.test.ts | 36 +++++++------- .../candidatePostProcessor.test.ts | 20 ++++---- .../candidatePreferer.test.ts | 22 ++++----- .../candidateValidator.test.ts | 20 ++++---- .../{ => candidates}/candidateWriter.test.ts | 46 +++++++++--------- test/modules/{ => dats}/datCombiner.test.ts | 12 ++--- test/modules/{ => dats}/datFilter.test.ts | 16 +++---- .../{ => dats}/datGameInferrer.test.ts | 12 ++--- .../{ => dats}/datMergerSplitter.test.ts | 20 ++++---- .../{ => dats}/datParentInferrer.test.ts | 14 +++--- test/modules/{ => dats}/datScanner.test.ts | 10 ++-- test/modules/dir2DatCreator.test.ts | 10 ++-- test/modules/fixdatCreator.test.ts | 2 +- test/modules/movedRomDeleter.test.ts | 6 +-- .../{ => roms}/romHeaderProcessor.test.ts | 18 +++---- test/modules/{ => roms}/romIndexer.test.ts | 0 test/modules/{ => roms}/romScanner.test.ts | 20 ++++---- test/modules/statusGenerator.test.ts | 2 +- .../types/files/archives/archiveEntry.test.ts | 2 +- test/types/files/archives/zip.test.ts | 2 +- test/types/files/file.test.ts | 2 +- test/types/files/romHeader.test.ts | 2 +- 48 files changed, 434 insertions(+), 434 deletions(-) rename src/modules/{ => candidates}/candidateArchiveFileHasher.ts (91%) rename src/modules/{ => candidates}/candidateCombiner.ts (87%) rename src/modules/{ => candidates}/candidateExtensionCorrector.ts (90%) rename src/modules/{ => candidates}/candidateGenerator.ts (96%) rename src/modules/{ => candidates}/candidateMergeSplitValidator.ts (88%) rename src/modules/{ => candidates}/candidatePatchGenerator.ts (92%) rename src/modules/{ => candidates}/candidatePostProcessor.ts (88%) rename src/modules/{ => candidates}/candidatePreferer.ts (95%) rename src/modules/{ => candidates}/candidateValidator.ts (88%) rename src/modules/{ => candidates}/candidateWriter.ts (97%) rename src/modules/{ => dats}/datCombiner.ts (77%) rename src/modules/{ => dats}/datFilter.ts (92%) rename src/modules/{ => dats}/datGameInferrer.ts (94%) rename src/modules/{ => dats}/datMergerSplitter.ts (93%) rename src/modules/{ => dats}/datParentInferrer.ts (96%) rename src/modules/{ => dats}/datScanner.ts (93%) rename src/modules/{ => roms}/romHeaderProcessor.ts (89%) rename src/modules/{ => roms}/romIndexer.ts (84%) rename src/modules/{ => roms}/romScanner.ts (79%) rename test/modules/{ => candidates}/candidateArchiveFileHasher.test.ts (100%) rename test/modules/{ => candidates}/candidateCombiner.test.ts (72%) rename test/modules/{ => candidates}/candidateExtensionCorrector.test.ts (87%) rename test/modules/{ => candidates}/candidateGenerator.test.ts (95%) rename test/modules/{ => candidates}/candidateMergeSplitValidator.test.ts (82%) rename test/modules/{ => candidates}/candidatePatchGenerator.test.ts (78%) rename test/modules/{ => candidates}/candidatePostProcessor.test.ts (95%) rename test/modules/{ => candidates}/candidatePreferer.test.ts (98%) rename test/modules/{ => candidates}/candidateValidator.test.ts (82%) rename test/modules/{ => candidates}/candidateWriter.test.ts (97%) rename test/modules/{ => dats}/datCombiner.test.ts (74%) rename test/modules/{ => dats}/datFilter.test.ts (98%) rename test/modules/{ => dats}/datGameInferrer.test.ts (78%) rename test/modules/{ => dats}/datMergerSplitter.test.ts (99%) rename test/modules/{ => dats}/datParentInferrer.test.ts (96%) rename test/modules/{ => dats}/datScanner.test.ts (95%) rename test/modules/{ => roms}/romHeaderProcessor.test.ts (90%) rename test/modules/{ => roms}/romIndexer.test.ts (100%) rename test/modules/{ => roms}/romScanner.test.ts (94%) diff --git a/src/igir.ts b/src/igir.ts index 31de035d3..861ed7e8e 100644 --- a/src/igir.ts +++ b/src/igir.ts @@ -10,31 +10,31 @@ import ProgressBar, { ProgressBarSymbol } from './console/progressBar.js'; import ProgressBarCLI from './console/progressBarCli.js'; import Package from './globals/package.js'; import Temp from './globals/temp.js'; -import CandidateArchiveFileHasher from './modules/candidateArchiveFileHasher.js'; -import CandidateCombiner from './modules/candidateCombiner.js'; -import CandidateExtensionCorrector from './modules/candidateExtensionCorrector.js'; -import CandidateGenerator from './modules/candidateGenerator.js'; -import CandidateMergeSplitValidator from './modules/candidateMergeSplitValidator.js'; -import CandidatePatchGenerator from './modules/candidatePatchGenerator.js'; -import CandidatePostProcessor from './modules/candidatePostProcessor.js'; -import CandidatePreferer from './modules/candidatePreferer.js'; -import CandidateValidator from './modules/candidateValidator.js'; -import CandidateWriter from './modules/candidateWriter.js'; -import DATCombiner from './modules/datCombiner.js'; -import DATFilter from './modules/datFilter.js'; -import DATGameInferrer from './modules/datGameInferrer.js'; -import DATMergerSplitter from './modules/datMergerSplitter.js'; -import DATParentInferrer from './modules/datParentInferrer.js'; -import DATScanner from './modules/datScanner.js'; +import CandidateArchiveFileHasher from './modules/candidates/candidateArchiveFileHasher.js'; +import CandidateCombiner from './modules/candidates/candidateCombiner.js'; +import CandidateExtensionCorrector from './modules/candidates/candidateExtensionCorrector.js'; +import CandidateGenerator from './modules/candidates/candidateGenerator.js'; +import CandidateMergeSplitValidator from './modules/candidates/candidateMergeSplitValidator.js'; +import CandidatePatchGenerator from './modules/candidates/candidatePatchGenerator.js'; +import CandidatePostProcessor from './modules/candidates/candidatePostProcessor.js'; +import CandidatePreferer from './modules/candidates/candidatePreferer.js'; +import CandidateValidator from './modules/candidates/candidateValidator.js'; +import CandidateWriter from './modules/candidates/candidateWriter.js'; +import DATCombiner from './modules/dats/datCombiner.js'; +import DATFilter from './modules/dats/datFilter.js'; +import DATGameInferrer from './modules/dats/datGameInferrer.js'; +import DATMergerSplitter from './modules/dats/datMergerSplitter.js'; +import DATParentInferrer from './modules/dats/datParentInferrer.js'; +import DATScanner from './modules/dats/datScanner.js'; import Dir2DatCreator from './modules/dir2DatCreator.js'; import DirectoryCleaner from './modules/directoryCleaner.js'; import FixdatCreator from './modules/fixdatCreator.js'; import MovedROMDeleter from './modules/movedRomDeleter.js'; import PatchScanner from './modules/patchScanner.js'; import ReportGenerator from './modules/reportGenerator.js'; -import ROMHeaderProcessor from './modules/romHeaderProcessor.js'; -import ROMIndexer from './modules/romIndexer.js'; -import ROMScanner from './modules/romScanner.js'; +import ROMHeaderProcessor from './modules/roms/romHeaderProcessor.js'; +import ROMIndexer from './modules/roms/romIndexer.js'; +import ROMScanner from './modules/roms/romScanner.js'; import StatusGenerator from './modules/statusGenerator.js'; import ArrayPoly from './polyfill/arrayPoly.js'; import FsPoly from './polyfill/fsPoly.js'; diff --git a/src/modules/candidateArchiveFileHasher.ts b/src/modules/candidates/candidateArchiveFileHasher.ts similarity index 91% rename from src/modules/candidateArchiveFileHasher.ts rename to src/modules/candidates/candidateArchiveFileHasher.ts index 9cf68fc82..a7844f7b3 100644 --- a/src/modules/candidateArchiveFileHasher.ts +++ b/src/modules/candidates/candidateArchiveFileHasher.ts @@ -1,12 +1,12 @@ -import ProgressBar, { ProgressBarSymbol } from '../console/progressBar.js'; -import DriveSemaphore from '../driveSemaphore.js'; -import DAT from '../types/dats/dat.js'; -import Parent from '../types/dats/parent.js'; -import ArchiveFile from '../types/files/archives/archiveFile.js'; -import FileFactory from '../types/files/fileFactory.js'; -import Options from '../types/options.js'; -import ReleaseCandidate from '../types/releaseCandidate.js'; -import Module from './module.js'; +import ProgressBar, { ProgressBarSymbol } from '../../console/progressBar.js'; +import DriveSemaphore from '../../driveSemaphore.js'; +import DAT from '../../types/dats/dat.js'; +import Parent from '../../types/dats/parent.js'; +import ArchiveFile from '../../types/files/archives/archiveFile.js'; +import FileFactory from '../../types/files/fileFactory.js'; +import Options from '../../types/options.js'; +import ReleaseCandidate from '../../types/releaseCandidate.js'; +import Module from '../module.js'; /** * Calculate checksums for {@link ArchiveFile}s (which were skipped in {@link CandidateGenerator}). diff --git a/src/modules/candidateCombiner.ts b/src/modules/candidates/candidateCombiner.ts similarity index 87% rename from src/modules/candidateCombiner.ts rename to src/modules/candidates/candidateCombiner.ts index 96e9c3f1a..ef4455971 100644 --- a/src/modules/candidateCombiner.ts +++ b/src/modules/candidates/candidateCombiner.ts @@ -1,14 +1,14 @@ import path from 'node:path'; -import ProgressBar, { ProgressBarSymbol } from '../console/progressBar.js'; -import DAT from '../types/dats/dat.js'; -import Game from '../types/dats/game.js'; -import Parent from '../types/dats/parent.js'; -import ROM from '../types/dats/rom.js'; -import ArchiveEntry from '../types/files/archives/archiveEntry.js'; -import Options from '../types/options.js'; -import ReleaseCandidate from '../types/releaseCandidate.js'; -import Module from './module.js'; +import ProgressBar, { ProgressBarSymbol } from '../../console/progressBar.js'; +import DAT from '../../types/dats/dat.js'; +import Game from '../../types/dats/game.js'; +import Parent from '../../types/dats/parent.js'; +import ROM from '../../types/dats/rom.js'; +import ArchiveEntry from '../../types/files/archives/archiveEntry.js'; +import Options from '../../types/options.js'; +import ReleaseCandidate from '../../types/releaseCandidate.js'; +import Module from '../module.js'; /** * Combine every {@link Parent} and its {@link ReleaseCandidate}s for a {@link DAT} into a single diff --git a/src/modules/candidateExtensionCorrector.ts b/src/modules/candidates/candidateExtensionCorrector.ts similarity index 90% rename from src/modules/candidateExtensionCorrector.ts rename to src/modules/candidates/candidateExtensionCorrector.ts index 5ecf88617..f93ec060d 100644 --- a/src/modules/candidateExtensionCorrector.ts +++ b/src/modules/candidates/candidateExtensionCorrector.ts @@ -2,19 +2,19 @@ import path from 'node:path'; import { Semaphore } from 'async-mutex'; -import ProgressBar, { ProgressBarSymbol } from '../console/progressBar.js'; -import DAT from '../types/dats/dat.js'; -import Parent from '../types/dats/parent.js'; -import ROM from '../types/dats/rom.js'; -import ArchiveEntry from '../types/files/archives/archiveEntry.js'; -import Chd from '../types/files/archives/chd/chd.js'; -import FileFactory from '../types/files/fileFactory.js'; -import FileSignature from '../types/files/fileSignature.js'; -import Options, { FixExtension } from '../types/options.js'; -import OutputFactory from '../types/outputFactory.js'; -import ReleaseCandidate from '../types/releaseCandidate.js'; -import ROMWithFiles from '../types/romWithFiles.js'; -import Module from './module.js'; +import ProgressBar, { ProgressBarSymbol } from '../../console/progressBar.js'; +import DAT from '../../types/dats/dat.js'; +import Parent from '../../types/dats/parent.js'; +import ROM from '../../types/dats/rom.js'; +import ArchiveEntry from '../../types/files/archives/archiveEntry.js'; +import Chd from '../../types/files/archives/chd/chd.js'; +import FileFactory from '../../types/files/fileFactory.js'; +import FileSignature from '../../types/files/fileSignature.js'; +import Options, { FixExtension } from '../../types/options.js'; +import OutputFactory from '../../types/outputFactory.js'; +import ReleaseCandidate from '../../types/releaseCandidate.js'; +import ROMWithFiles from '../../types/romWithFiles.js'; +import Module from '../module.js'; /** * Correct the extensions of output {@link File}s when: diff --git a/src/modules/candidateGenerator.ts b/src/modules/candidates/candidateGenerator.ts similarity index 96% rename from src/modules/candidateGenerator.ts rename to src/modules/candidates/candidateGenerator.ts index e6dd20d83..4fb306911 100644 --- a/src/modules/candidateGenerator.ts +++ b/src/modules/candidates/candidateGenerator.ts @@ -2,26 +2,26 @@ import path from 'node:path'; import { Semaphore } from 'async-mutex'; -import ProgressBar, { ProgressBarSymbol } from '../console/progressBar.js'; -import ArrayPoly from '../polyfill/arrayPoly.js'; -import fsPoly from '../polyfill/fsPoly.js'; -import DAT from '../types/dats/dat.js'; -import Game from '../types/dats/game.js'; -import Parent from '../types/dats/parent.js'; -import Release from '../types/dats/release.js'; -import ROM from '../types/dats/rom.js'; -import Archive from '../types/files/archives/archive.js'; -import ArchiveEntry from '../types/files/archives/archiveEntry.js'; -import ArchiveFile from '../types/files/archives/archiveFile.js'; -import Chd from '../types/files/archives/chd/chd.js'; -import Zip from '../types/files/archives/zip.js'; -import File from '../types/files/file.js'; -import IndexedFiles from '../types/indexedFiles.js'; -import Options from '../types/options.js'; -import OutputFactory, { OutputPath } from '../types/outputFactory.js'; -import ReleaseCandidate from '../types/releaseCandidate.js'; -import ROMWithFiles from '../types/romWithFiles.js'; -import Module from './module.js'; +import ProgressBar, { ProgressBarSymbol } from '../../console/progressBar.js'; +import ArrayPoly from '../../polyfill/arrayPoly.js'; +import fsPoly from '../../polyfill/fsPoly.js'; +import DAT from '../../types/dats/dat.js'; +import Game from '../../types/dats/game.js'; +import Parent from '../../types/dats/parent.js'; +import Release from '../../types/dats/release.js'; +import ROM from '../../types/dats/rom.js'; +import Archive from '../../types/files/archives/archive.js'; +import ArchiveEntry from '../../types/files/archives/archiveEntry.js'; +import ArchiveFile from '../../types/files/archives/archiveFile.js'; +import Chd from '../../types/files/archives/chd/chd.js'; +import Zip from '../../types/files/archives/zip.js'; +import File from '../../types/files/file.js'; +import IndexedFiles from '../../types/indexedFiles.js'; +import Options from '../../types/options.js'; +import OutputFactory, { OutputPath } from '../../types/outputFactory.js'; +import ReleaseCandidate from '../../types/releaseCandidate.js'; +import ROMWithFiles from '../../types/romWithFiles.js'; +import Module from '../module.js'; /** * For every {@link Parent} in the {@link DAT}, look for its {@link ROM}s in the scanned ROM list, diff --git a/src/modules/candidateMergeSplitValidator.ts b/src/modules/candidates/candidateMergeSplitValidator.ts similarity index 88% rename from src/modules/candidateMergeSplitValidator.ts rename to src/modules/candidates/candidateMergeSplitValidator.ts index 233664a0f..64f6abe3d 100644 --- a/src/modules/candidateMergeSplitValidator.ts +++ b/src/modules/candidates/candidateMergeSplitValidator.ts @@ -1,12 +1,12 @@ -import ProgressBar, { ProgressBarSymbol } from '../console/progressBar.js'; -import ArrayPoly from '../polyfill/arrayPoly.js'; -import DAT from '../types/dats/dat.js'; -import Game from '../types/dats/game.js'; -import Machine from '../types/dats/mame/machine.js'; -import Parent from '../types/dats/parent.js'; -import Options, { MergeMode } from '../types/options.js'; -import ReleaseCandidate from '../types/releaseCandidate.js'; -import Module from './module.js'; +import ProgressBar, { ProgressBarSymbol } from '../../console/progressBar.js'; +import ArrayPoly from '../../polyfill/arrayPoly.js'; +import DAT from '../../types/dats/dat.js'; +import Game from '../../types/dats/game.js'; +import Machine from '../../types/dats/mame/machine.js'; +import Parent from '../../types/dats/parent.js'; +import Options, { MergeMode } from '../../types/options.js'; +import ReleaseCandidate from '../../types/releaseCandidate.js'; +import Module from '../module.js'; /** * Validate un-merged, split, and merged ROM sets for playability after all generation and filtering diff --git a/src/modules/candidatePatchGenerator.ts b/src/modules/candidates/candidatePatchGenerator.ts similarity index 92% rename from src/modules/candidatePatchGenerator.ts rename to src/modules/candidates/candidatePatchGenerator.ts index 10db0bca6..c37ca7621 100644 --- a/src/modules/candidatePatchGenerator.ts +++ b/src/modules/candidates/candidatePatchGenerator.ts @@ -1,17 +1,17 @@ import path from 'node:path'; -import ProgressBar, { ProgressBarSymbol } from '../console/progressBar.js'; -import DAT from '../types/dats/dat.js'; -import Game from '../types/dats/game.js'; -import Parent from '../types/dats/parent.js'; -import Release from '../types/dats/release.js'; -import ROM from '../types/dats/rom.js'; -import ArchiveEntry from '../types/files/archives/archiveEntry.js'; -import File from '../types/files/file.js'; -import Patch from '../types/patches/patch.js'; -import ReleaseCandidate from '../types/releaseCandidate.js'; -import ROMWithFiles from '../types/romWithFiles.js'; -import Module from './module.js'; +import ProgressBar, { ProgressBarSymbol } from '../../console/progressBar.js'; +import DAT from '../../types/dats/dat.js'; +import Game from '../../types/dats/game.js'; +import Parent from '../../types/dats/parent.js'; +import Release from '../../types/dats/release.js'; +import ROM from '../../types/dats/rom.js'; +import ArchiveEntry from '../../types/files/archives/archiveEntry.js'; +import File from '../../types/files/file.js'; +import Patch from '../../types/patches/patch.js'; +import ReleaseCandidate from '../../types/releaseCandidate.js'; +import ROMWithFiles from '../../types/romWithFiles.js'; +import Module from '../module.js'; /** * For each {@link Patch} that matches a {@link ROM}, generate a new {@link Parent} and diff --git a/src/modules/candidatePostProcessor.ts b/src/modules/candidates/candidatePostProcessor.ts similarity index 88% rename from src/modules/candidatePostProcessor.ts rename to src/modules/candidates/candidatePostProcessor.ts index 47e4790bb..03aba86f0 100644 --- a/src/modules/candidatePostProcessor.ts +++ b/src/modules/candidates/candidatePostProcessor.ts @@ -1,11 +1,11 @@ -import ProgressBar, { ProgressBarSymbol } from '../console/progressBar.js'; -import DAT from '../types/dats/dat.js'; -import Parent from '../types/dats/parent.js'; -import Options from '../types/options.js'; -import OutputFactory from '../types/outputFactory.js'; -import ReleaseCandidate from '../types/releaseCandidate.js'; -import ROMWithFiles from '../types/romWithFiles.js'; -import Module from './module.js'; +import ProgressBar, { ProgressBarSymbol } from '../../console/progressBar.js'; +import DAT from '../../types/dats/dat.js'; +import Parent from '../../types/dats/parent.js'; +import Options from '../../types/options.js'; +import OutputFactory from '../../types/outputFactory.js'; +import ReleaseCandidate from '../../types/releaseCandidate.js'; +import ROMWithFiles from '../../types/romWithFiles.js'; +import Module from '../module.js'; /** * Perform any {@link Parent} and {@link ReleaseCandidate} manipulations needed after candidates diff --git a/src/modules/candidatePreferer.ts b/src/modules/candidates/candidatePreferer.ts similarity index 95% rename from src/modules/candidatePreferer.ts rename to src/modules/candidates/candidatePreferer.ts index 18da63c39..775a7b1f2 100644 --- a/src/modules/candidatePreferer.ts +++ b/src/modules/candidates/candidatePreferer.ts @@ -1,10 +1,10 @@ -import ProgressBar, { ProgressBarSymbol } from '../console/progressBar.js'; -import fsPoly from '../polyfill/fsPoly.js'; -import DAT from '../types/dats/dat.js'; -import Parent from '../types/dats/parent.js'; -import Options, { PreferRevision } from '../types/options.js'; -import ReleaseCandidate from '../types/releaseCandidate.js'; -import Module from './module.js'; +import ProgressBar, { ProgressBarSymbol } from '../../console/progressBar.js'; +import fsPoly from '../../polyfill/fsPoly.js'; +import DAT from '../../types/dats/dat.js'; +import Parent from '../../types/dats/parent.js'; +import Options, { PreferRevision } from '../../types/options.js'; +import ReleaseCandidate from '../../types/releaseCandidate.js'; +import Module from '../module.js'; /** * Apply any specified preference options to the {@link ReleaseCandidate}s for each diff --git a/src/modules/candidateValidator.ts b/src/modules/candidates/candidateValidator.ts similarity index 88% rename from src/modules/candidateValidator.ts rename to src/modules/candidates/candidateValidator.ts index f7b432293..7f63ee8ff 100644 --- a/src/modules/candidateValidator.ts +++ b/src/modules/candidates/candidateValidator.ts @@ -1,9 +1,9 @@ -import ProgressBar, { ProgressBarSymbol } from '../console/progressBar.js'; -import ArrayPoly from '../polyfill/arrayPoly.js'; -import DAT from '../types/dats/dat.js'; -import Parent from '../types/dats/parent.js'; -import ReleaseCandidate from '../types/releaseCandidate.js'; -import Module from './module.js'; +import ProgressBar, { ProgressBarSymbol } from '../../console/progressBar.js'; +import ArrayPoly from '../../polyfill/arrayPoly.js'; +import DAT from '../../types/dats/dat.js'; +import Parent from '../../types/dats/parent.js'; +import ReleaseCandidate from '../../types/releaseCandidate.js'; +import Module from '../module.js'; /** * Validate candidates for write-ability after all generation and filtering has happened. diff --git a/src/modules/candidateWriter.ts b/src/modules/candidates/candidateWriter.ts similarity index 97% rename from src/modules/candidateWriter.ts rename to src/modules/candidates/candidateWriter.ts index 7fe0e47a2..4092daa2d 100644 --- a/src/modules/candidateWriter.ts +++ b/src/modules/candidates/candidateWriter.ts @@ -2,21 +2,21 @@ import path from 'node:path'; import { Semaphore } from 'async-mutex'; -import ProgressBar, { ProgressBarSymbol } from '../console/progressBar.js'; -import ElasticSemaphore from '../elasticSemaphore.js'; -import Defaults from '../globals/defaults.js'; -import KeyedMutex from '../keyedMutex.js'; -import ArrayPoly from '../polyfill/arrayPoly.js'; -import fsPoly from '../polyfill/fsPoly.js'; -import DAT from '../types/dats/dat.js'; -import Parent from '../types/dats/parent.js'; -import ArchiveEntry from '../types/files/archives/archiveEntry.js'; -import Zip from '../types/files/archives/zip.js'; -import File from '../types/files/file.js'; -import { ChecksumBitmask } from '../types/files/fileChecksums.js'; -import Options from '../types/options.js'; -import ReleaseCandidate from '../types/releaseCandidate.js'; -import Module from './module.js'; +import ProgressBar, { ProgressBarSymbol } from '../../console/progressBar.js'; +import ElasticSemaphore from '../../elasticSemaphore.js'; +import Defaults from '../../globals/defaults.js'; +import KeyedMutex from '../../keyedMutex.js'; +import ArrayPoly from '../../polyfill/arrayPoly.js'; +import fsPoly from '../../polyfill/fsPoly.js'; +import DAT from '../../types/dats/dat.js'; +import Parent from '../../types/dats/parent.js'; +import ArchiveEntry from '../../types/files/archives/archiveEntry.js'; +import Zip from '../../types/files/archives/zip.js'; +import File from '../../types/files/file.js'; +import { ChecksumBitmask } from '../../types/files/fileChecksums.js'; +import Options from '../../types/options.js'; +import ReleaseCandidate from '../../types/releaseCandidate.js'; +import Module from '../module.js'; export interface CandidateWriterResults { wrote: File[]; diff --git a/src/modules/datCombiner.ts b/src/modules/dats/datCombiner.ts similarity index 77% rename from src/modules/datCombiner.ts rename to src/modules/dats/datCombiner.ts index b8048f119..703122872 100644 --- a/src/modules/datCombiner.ts +++ b/src/modules/dats/datCombiner.ts @@ -1,12 +1,12 @@ import moment from 'moment'; -import ProgressBar from '../console/progressBar.js'; -import Package from '../globals/package.js'; -import ArrayPoly from '../polyfill/arrayPoly.js'; -import DAT from '../types/dats/dat.js'; -import Header from '../types/dats/logiqx/header.js'; -import LogiqxDAT from '../types/dats/logiqx/logiqxDat.js'; -import Module from './module.js'; +import ProgressBar from '../../console/progressBar.js'; +import Package from '../../globals/package.js'; +import ArrayPoly from '../../polyfill/arrayPoly.js'; +import DAT from '../../types/dats/dat.js'; +import Header from '../../types/dats/logiqx/header.js'; +import LogiqxDAT from '../../types/dats/logiqx/logiqxDat.js'; +import Module from '../module.js'; /** * Combine every {@link DAT} into a single {@link DAT}. diff --git a/src/modules/datFilter.ts b/src/modules/dats/datFilter.ts similarity index 92% rename from src/modules/datFilter.ts rename to src/modules/dats/datFilter.ts index 1ad274acc..4f7b8175d 100644 --- a/src/modules/datFilter.ts +++ b/src/modules/dats/datFilter.ts @@ -1,10 +1,10 @@ -import ProgressBar, { ProgressBarSymbol } from '../console/progressBar.js'; -import fsPoly from '../polyfill/fsPoly.js'; -import DAT from '../types/dats/dat.js'; -import Game from '../types/dats/game.js'; -import LogiqxDAT from '../types/dats/logiqx/logiqxDat.js'; -import Options from '../types/options.js'; -import Module from './module.js'; +import ProgressBar, { ProgressBarSymbol } from '../../console/progressBar.js'; +import fsPoly from '../../polyfill/fsPoly.js'; +import DAT from '../../types/dats/dat.js'; +import Game from '../../types/dats/game.js'; +import LogiqxDAT from '../../types/dats/logiqx/logiqxDat.js'; +import Options from '../../types/options.js'; +import Module from '../module.js'; /** * Apply any specified filter options to the {@link Game}s in a {@link DAT}. diff --git a/src/modules/datGameInferrer.ts b/src/modules/dats/datGameInferrer.ts similarity index 94% rename from src/modules/datGameInferrer.ts rename to src/modules/dats/datGameInferrer.ts index a339ea19a..3f70b3f11 100644 --- a/src/modules/datGameInferrer.ts +++ b/src/modules/dats/datGameInferrer.ts @@ -5,19 +5,19 @@ import util from 'node:util'; import { parse } from '@gplane/cue'; import moment from 'moment'; -import ProgressBar from '../console/progressBar.js'; -import Package from '../globals/package.js'; -import ArrayPoly from '../polyfill/arrayPoly.js'; -import DAT from '../types/dats/dat.js'; -import Game from '../types/dats/game.js'; -import Header from '../types/dats/logiqx/header.js'; -import LogiqxDAT from '../types/dats/logiqx/logiqxDat.js'; -import ROM from '../types/dats/rom.js'; -import Archive from '../types/files/archives/archive.js'; -import ArchiveEntry from '../types/files/archives/archiveEntry.js'; -import File from '../types/files/file.js'; -import Options from '../types/options.js'; -import Module from './module.js'; +import ProgressBar from '../../console/progressBar.js'; +import Package from '../../globals/package.js'; +import ArrayPoly from '../../polyfill/arrayPoly.js'; +import DAT from '../../types/dats/dat.js'; +import Game from '../../types/dats/game.js'; +import Header from '../../types/dats/logiqx/header.js'; +import LogiqxDAT from '../../types/dats/logiqx/logiqxDat.js'; +import ROM from '../../types/dats/rom.js'; +import Archive from '../../types/files/archives/archive.js'; +import ArchiveEntry from '../../types/files/archives/archiveEntry.js'; +import File from '../../types/files/file.js'; +import Options from '../../types/options.js'; +import Module from '../module.js'; /** * If no {@link DAT}s are provided, implicitly create some. A {@link DAT} will be created for every diff --git a/src/modules/datMergerSplitter.ts b/src/modules/dats/datMergerSplitter.ts similarity index 93% rename from src/modules/datMergerSplitter.ts rename to src/modules/dats/datMergerSplitter.ts index 8ca26c9c8..5c71a14fd 100644 --- a/src/modules/datMergerSplitter.ts +++ b/src/modules/dats/datMergerSplitter.ts @@ -1,13 +1,13 @@ -import ProgressBar, { ProgressBarSymbol } from '../console/progressBar.js'; -import ArrayPoly from '../polyfill/arrayPoly.js'; -import DAT from '../types/dats/dat.js'; -import Game from '../types/dats/game.js'; -import LogiqxDAT from '../types/dats/logiqx/logiqxDat.js'; -import Machine from '../types/dats/mame/machine.js'; -import Parent from '../types/dats/parent.js'; -import ROM from '../types/dats/rom.js'; -import Options, { MergeMode } from '../types/options.js'; -import Module from './module.js'; +import ProgressBar, { ProgressBarSymbol } from '../../console/progressBar.js'; +import ArrayPoly from '../../polyfill/arrayPoly.js'; +import DAT from '../../types/dats/dat.js'; +import Game from '../../types/dats/game.js'; +import LogiqxDAT from '../../types/dats/logiqx/logiqxDat.js'; +import Machine from '../../types/dats/mame/machine.js'; +import Parent from '../../types/dats/parent.js'; +import ROM from '../../types/dats/rom.js'; +import Options, { MergeMode } from '../../types/options.js'; +import Module from '../module.js'; /** * Process a {@link DAT} with the ROM merge mode specified. diff --git a/src/modules/datParentInferrer.ts b/src/modules/dats/datParentInferrer.ts similarity index 96% rename from src/modules/datParentInferrer.ts rename to src/modules/dats/datParentInferrer.ts index 610600172..626b72a42 100644 --- a/src/modules/datParentInferrer.ts +++ b/src/modules/dats/datParentInferrer.ts @@ -1,10 +1,10 @@ -import ProgressBar, { ProgressBarSymbol } from '../console/progressBar.js'; -import DAT from '../types/dats/dat.js'; -import Game from '../types/dats/game.js'; -import LogiqxDAT from '../types/dats/logiqx/logiqxDat.js'; -import Internationalization from '../types/internationalization.js'; -import Options from '../types/options.js'; -import Module from './module.js'; +import ProgressBar, { ProgressBarSymbol } from '../../console/progressBar.js'; +import DAT from '../../types/dats/dat.js'; +import Game from '../../types/dats/game.js'; +import LogiqxDAT from '../../types/dats/logiqx/logiqxDat.js'; +import Internationalization from '../../types/internationalization.js'; +import Options from '../../types/options.js'; +import Module from '../module.js'; /** * Infer {@link Parent}s for all {@link DAT}s, even those that already have some parents. diff --git a/src/modules/datScanner.ts b/src/modules/dats/datScanner.ts similarity index 93% rename from src/modules/datScanner.ts rename to src/modules/dats/datScanner.ts index a352af7ff..19ab4700b 100644 --- a/src/modules/datScanner.ts +++ b/src/modules/dats/datScanner.ts @@ -3,33 +3,33 @@ import path from 'node:path'; import { parse } from '@fast-csv/parse'; -import ProgressBar, { ProgressBarSymbol } from '../console/progressBar.js'; -import DriveSemaphore from '../driveSemaphore.js'; -import bufferPoly from '../polyfill/bufferPoly.js'; -import fsPoly from '../polyfill/fsPoly.js'; +import ProgressBar, { ProgressBarSymbol } from '../../console/progressBar.js'; +import DriveSemaphore from '../../driveSemaphore.js'; +import bufferPoly from '../../polyfill/bufferPoly.js'; +import fsPoly from '../../polyfill/fsPoly.js'; import CMProParser, { DATProps, DiskProps, GameProps, ROMProps, -} from '../types/dats/cmpro/cmProParser.js'; -import DAT from '../types/dats/dat.js'; -import DATObject, { DATObjectProps } from '../types/dats/datObject.js'; -import Disk from '../types/dats/disk.js'; -import Game from '../types/dats/game.js'; -import Header from '../types/dats/logiqx/header.js'; -import LogiqxDAT from '../types/dats/logiqx/logiqxDat.js'; -import MameDAT from '../types/dats/mame/mameDat.js'; -import ROM from '../types/dats/rom.js'; -import SoftwareListDAT from '../types/dats/softwarelist/softwareListDat.js'; -import SoftwareListsDAT from '../types/dats/softwarelist/softwareListsDat.js'; -import ExpectedError from '../types/expectedError.js'; -import ArchiveEntry from '../types/files/archives/archiveEntry.js'; -import File from '../types/files/file.js'; -import { ChecksumBitmask } from '../types/files/fileChecksums.js'; -import FileFactory from '../types/files/fileFactory.js'; -import Options from '../types/options.js'; -import Scanner from './scanner.js'; +} from '../../types/dats/cmpro/cmProParser.js'; +import DAT from '../../types/dats/dat.js'; +import DATObject, { DATObjectProps } from '../../types/dats/datObject.js'; +import Disk from '../../types/dats/disk.js'; +import Game from '../../types/dats/game.js'; +import Header from '../../types/dats/logiqx/header.js'; +import LogiqxDAT from '../../types/dats/logiqx/logiqxDat.js'; +import MameDAT from '../../types/dats/mame/mameDat.js'; +import ROM from '../../types/dats/rom.js'; +import SoftwareListDAT from '../../types/dats/softwarelist/softwareListDat.js'; +import SoftwareListsDAT from '../../types/dats/softwarelist/softwareListsDat.js'; +import ExpectedError from '../../types/expectedError.js'; +import ArchiveEntry from '../../types/files/archives/archiveEntry.js'; +import File from '../../types/files/file.js'; +import { ChecksumBitmask } from '../../types/files/fileChecksums.js'; +import FileFactory from '../../types/files/fileFactory.js'; +import Options from '../../types/options.js'; +import Scanner from '../scanner.js'; type SmdbRow = { sha256: string; diff --git a/src/modules/romHeaderProcessor.ts b/src/modules/roms/romHeaderProcessor.ts similarity index 89% rename from src/modules/romHeaderProcessor.ts rename to src/modules/roms/romHeaderProcessor.ts index 2c184d626..70317a1cf 100644 --- a/src/modules/romHeaderProcessor.ts +++ b/src/modules/roms/romHeaderProcessor.ts @@ -1,11 +1,11 @@ -import ProgressBar, { ProgressBarSymbol } from '../console/progressBar.js'; -import DriveSemaphore from '../driveSemaphore.js'; -import ArchiveEntry from '../types/files/archives/archiveEntry.js'; -import File from '../types/files/file.js'; -import FileFactory from '../types/files/fileFactory.js'; -import ROMHeader from '../types/files/romHeader.js'; -import Options from '../types/options.js'; -import Module from './module.js'; +import ProgressBar, { ProgressBarSymbol } from '../../console/progressBar.js'; +import DriveSemaphore from '../../driveSemaphore.js'; +import ArchiveEntry from '../../types/files/archives/archiveEntry.js'; +import File from '../../types/files/file.js'; +import FileFactory from '../../types/files/fileFactory.js'; +import ROMHeader from '../../types/files/romHeader.js'; +import Options from '../../types/options.js'; +import Module from '../module.js'; /** * For every input {@link ROM} file found, attempt to find a matching {@link Header} and resolve its diff --git a/src/modules/romIndexer.ts b/src/modules/roms/romIndexer.ts similarity index 84% rename from src/modules/romIndexer.ts rename to src/modules/roms/romIndexer.ts index b68e1c3d7..7251c944b 100644 --- a/src/modules/romIndexer.ts +++ b/src/modules/roms/romIndexer.ts @@ -1,18 +1,18 @@ import path from 'node:path'; -import ProgressBar, { ProgressBarSymbol } from '../console/progressBar.js'; -import FsPoly from '../polyfill/fsPoly.js'; -import ArchiveEntry from '../types/files/archives/archiveEntry.js'; -import Chd from '../types/files/archives/chd/chd.js'; -import Maxcso from '../types/files/archives/maxcso/maxcso.js'; -import Rar from '../types/files/archives/rar.js'; -import SevenZip from '../types/files/archives/sevenZip/sevenZip.js'; -import Tar from '../types/files/archives/tar.js'; -import Zip from '../types/files/archives/zip.js'; -import File from '../types/files/file.js'; -import IndexedFiles, { AllChecksums, ChecksumsToFiles } from '../types/indexedFiles.js'; -import Options from '../types/options.js'; -import Module from './module.js'; +import ProgressBar, { ProgressBarSymbol } from '../../console/progressBar.js'; +import FsPoly from '../../polyfill/fsPoly.js'; +import ArchiveEntry from '../../types/files/archives/archiveEntry.js'; +import Chd from '../../types/files/archives/chd/chd.js'; +import Maxcso from '../../types/files/archives/maxcso/maxcso.js'; +import Rar from '../../types/files/archives/rar.js'; +import SevenZip from '../../types/files/archives/sevenZip/sevenZip.js'; +import Tar from '../../types/files/archives/tar.js'; +import Zip from '../../types/files/archives/zip.js'; +import File from '../../types/files/file.js'; +import IndexedFiles, { AllChecksums, ChecksumsToFiles } from '../../types/indexedFiles.js'; +import Options from '../../types/options.js'; +import Module from '../module.js'; /** * This class indexes {@link File}s by their {@link File.hashCode}, and sorts duplicate files by a diff --git a/src/modules/romScanner.ts b/src/modules/roms/romScanner.ts similarity index 79% rename from src/modules/romScanner.ts rename to src/modules/roms/romScanner.ts index 69fa45524..024691784 100644 --- a/src/modules/romScanner.ts +++ b/src/modules/roms/romScanner.ts @@ -1,9 +1,9 @@ -import ProgressBar, { ProgressBarSymbol } from '../console/progressBar.js'; -import File from '../types/files/file.js'; -import { ChecksumBitmask } from '../types/files/fileChecksums.js'; -import FileFactory from '../types/files/fileFactory.js'; -import Options from '../types/options.js'; -import Scanner from './scanner.js'; +import ProgressBar, { ProgressBarSymbol } from '../../console/progressBar.js'; +import File from '../../types/files/file.js'; +import { ChecksumBitmask } from '../../types/files/fileChecksums.js'; +import FileFactory from '../../types/files/fileFactory.js'; +import Options from '../../types/options.js'; +import Scanner from '../scanner.js'; /** * Scan the {@link OptionsProps.input} input directory for ROM files and return the internal model diff --git a/test/igir.test.ts b/test/igir.test.ts index f4f736948..6b89647d7 100644 --- a/test/igir.test.ts +++ b/test/igir.test.ts @@ -5,7 +5,7 @@ import Logger from '../src/console/logger.js'; import LogLevel from '../src/console/logLevel.js'; import Temp from '../src/globals/temp.js'; import Igir from '../src/igir.js'; -import DATScanner from '../src/modules/datScanner.js'; +import DATScanner from '../src/modules/dats/datScanner.js'; import ArrayPoly from '../src/polyfill/arrayPoly.js'; import fsPoly from '../src/polyfill/fsPoly.js'; import FileCache from '../src/types/files/fileCache.js'; diff --git a/test/modules/candidateArchiveFileHasher.test.ts b/test/modules/candidates/candidateArchiveFileHasher.test.ts similarity index 100% rename from test/modules/candidateArchiveFileHasher.test.ts rename to test/modules/candidates/candidateArchiveFileHasher.test.ts diff --git a/test/modules/candidateCombiner.test.ts b/test/modules/candidates/candidateCombiner.test.ts similarity index 72% rename from test/modules/candidateCombiner.test.ts rename to test/modules/candidates/candidateCombiner.test.ts index 4179bd1f9..56cc51f1c 100644 --- a/test/modules/candidateCombiner.test.ts +++ b/test/modules/candidates/candidateCombiner.test.ts @@ -1,18 +1,18 @@ import path from 'node:path'; -import CandidateCombiner from '../../src/modules/candidateCombiner.js'; -import CandidateGenerator from '../../src/modules/candidateGenerator.js'; -import DATCombiner from '../../src/modules/datCombiner.js'; -import DATGameInferrer from '../../src/modules/datGameInferrer.js'; -import ROMIndexer from '../../src/modules/romIndexer.js'; -import ROMScanner from '../../src/modules/romScanner.js'; -import Parent from '../../src/types/dats/parent.js'; -import File from '../../src/types/files/file.js'; -import FileCache from '../../src/types/files/fileCache.js'; -import FileFactory from '../../src/types/files/fileFactory.js'; -import Options from '../../src/types/options.js'; -import ReleaseCandidate from '../../src/types/releaseCandidate.js'; -import ProgressBarFake from '../console/progressBarFake.js'; +import CandidateCombiner from '../../../src/modules/candidates/candidateCombiner.js'; +import CandidateGenerator from '../../../src/modules/candidates/candidateGenerator.js'; +import DATCombiner from '../../../src/modules/dats/datCombiner.js'; +import DATGameInferrer from '../../../src/modules/dats/datGameInferrer.js'; +import ROMIndexer from '../../../src/modules/roms/romIndexer.js'; +import ROMScanner from '../../../src/modules/roms/romScanner.js'; +import Parent from '../../../src/types/dats/parent.js'; +import File from '../../../src/types/files/file.js'; +import FileCache from '../../../src/types/files/fileCache.js'; +import FileFactory from '../../../src/types/files/fileFactory.js'; +import Options from '../../../src/types/options.js'; +import ReleaseCandidate from '../../../src/types/releaseCandidate.js'; +import ProgressBarFake from '../../console/progressBarFake.js'; async function runCombinedCandidateGenerator( options: Options, diff --git a/test/modules/candidateExtensionCorrector.test.ts b/test/modules/candidates/candidateExtensionCorrector.test.ts similarity index 87% rename from test/modules/candidateExtensionCorrector.test.ts rename to test/modules/candidates/candidateExtensionCorrector.test.ts index 624972f25..d3d520f81 100644 --- a/test/modules/candidateExtensionCorrector.test.ts +++ b/test/modules/candidates/candidateExtensionCorrector.test.ts @@ -2,22 +2,22 @@ import 'jest-extended'; import path from 'node:path'; -import Temp from '../../src/globals/temp.js'; -import CandidateExtensionCorrector from '../../src/modules/candidateExtensionCorrector.js'; -import ROMScanner from '../../src/modules/romScanner.js'; -import FsPoly from '../../src/polyfill/fsPoly.js'; -import Game from '../../src/types/dats/game.js'; -import Header from '../../src/types/dats/logiqx/header.js'; -import LogiqxDAT from '../../src/types/dats/logiqx/logiqxDat.js'; -import Parent from '../../src/types/dats/parent.js'; -import ROM from '../../src/types/dats/rom.js'; -import File from '../../src/types/files/file.js'; -import FileCache from '../../src/types/files/fileCache.js'; -import FileFactory from '../../src/types/files/fileFactory.js'; -import Options, { FixExtension } from '../../src/types/options.js'; -import ReleaseCandidate from '../../src/types/releaseCandidate.js'; -import ROMWithFiles from '../../src/types/romWithFiles.js'; -import ProgressBarFake from '../console/progressBarFake.js'; +import Temp from '../../../src/globals/temp.js'; +import CandidateExtensionCorrector from '../../../src/modules/candidates/candidateExtensionCorrector.js'; +import ROMScanner from '../../../src/modules/roms/romScanner.js'; +import FsPoly from '../../../src/polyfill/fsPoly.js'; +import Game from '../../../src/types/dats/game.js'; +import Header from '../../../src/types/dats/logiqx/header.js'; +import LogiqxDAT from '../../../src/types/dats/logiqx/logiqxDat.js'; +import Parent from '../../../src/types/dats/parent.js'; +import ROM from '../../../src/types/dats/rom.js'; +import File from '../../../src/types/files/file.js'; +import FileCache from '../../../src/types/files/fileCache.js'; +import FileFactory from '../../../src/types/files/fileFactory.js'; +import Options, { FixExtension } from '../../../src/types/options.js'; +import ReleaseCandidate from '../../../src/types/releaseCandidate.js'; +import ROMWithFiles from '../../../src/types/romWithFiles.js'; +import ProgressBarFake from '../../console/progressBarFake.js'; it('should do nothing with no parents', async () => { const options = new Options(); diff --git a/test/modules/candidateGenerator.test.ts b/test/modules/candidates/candidateGenerator.test.ts similarity index 95% rename from test/modules/candidateGenerator.test.ts rename to test/modules/candidates/candidateGenerator.test.ts index 7533cce53..620448838 100644 --- a/test/modules/candidateGenerator.test.ts +++ b/test/modules/candidates/candidateGenerator.test.ts @@ -1,29 +1,29 @@ import path from 'node:path'; -import CandidateGenerator from '../../src/modules/candidateGenerator.js'; -import ROMIndexer from '../../src/modules/romIndexer.js'; -import ArrayPoly from '../../src/polyfill/arrayPoly.js'; -import DAT from '../../src/types/dats/dat.js'; -import Disk from '../../src/types/dats/disk.js'; -import Game from '../../src/types/dats/game.js'; -import Header from '../../src/types/dats/logiqx/header.js'; -import LogiqxDAT from '../../src/types/dats/logiqx/logiqxDat.js'; -import Machine from '../../src/types/dats/mame/machine.js'; -import MameDAT from '../../src/types/dats/mame/mameDat.js'; -import Parent from '../../src/types/dats/parent.js'; -import Release from '../../src/types/dats/release.js'; -import ROM from '../../src/types/dats/rom.js'; -import ArchiveEntry from '../../src/types/files/archives/archiveEntry.js'; -import Rar from '../../src/types/files/archives/rar.js'; -import SevenZip from '../../src/types/files/archives/sevenZip/sevenZip.js'; -import Tar from '../../src/types/files/archives/tar.js'; -import Zip from '../../src/types/files/archives/zip.js'; -import File from '../../src/types/files/file.js'; -import ROMHeader from '../../src/types/files/romHeader.js'; -import IndexedFiles from '../../src/types/indexedFiles.js'; -import Options, { GameSubdirMode } from '../../src/types/options.js'; -import ReleaseCandidate from '../../src/types/releaseCandidate.js'; -import ProgressBarFake from '../console/progressBarFake.js'; +import CandidateGenerator from '../../../src/modules/candidates/candidateGenerator.js'; +import ROMIndexer from '../../../src/modules/roms/romIndexer.js'; +import ArrayPoly from '../../../src/polyfill/arrayPoly.js'; +import DAT from '../../../src/types/dats/dat.js'; +import Disk from '../../../src/types/dats/disk.js'; +import Game from '../../../src/types/dats/game.js'; +import Header from '../../../src/types/dats/logiqx/header.js'; +import LogiqxDAT from '../../../src/types/dats/logiqx/logiqxDat.js'; +import Machine from '../../../src/types/dats/mame/machine.js'; +import MameDAT from '../../../src/types/dats/mame/mameDat.js'; +import Parent from '../../../src/types/dats/parent.js'; +import Release from '../../../src/types/dats/release.js'; +import ROM from '../../../src/types/dats/rom.js'; +import ArchiveEntry from '../../../src/types/files/archives/archiveEntry.js'; +import Rar from '../../../src/types/files/archives/rar.js'; +import SevenZip from '../../../src/types/files/archives/sevenZip/sevenZip.js'; +import Tar from '../../../src/types/files/archives/tar.js'; +import Zip from '../../../src/types/files/archives/zip.js'; +import File from '../../../src/types/files/file.js'; +import ROMHeader from '../../../src/types/files/romHeader.js'; +import IndexedFiles from '../../../src/types/indexedFiles.js'; +import Options, { GameSubdirMode } from '../../../src/types/options.js'; +import ReleaseCandidate from '../../../src/types/releaseCandidate.js'; +import ProgressBarFake from '../../console/progressBarFake.js'; const gameWithNoRoms = new Game({ name: 'game with no ROMs', diff --git a/test/modules/candidateMergeSplitValidator.test.ts b/test/modules/candidates/candidateMergeSplitValidator.test.ts similarity index 82% rename from test/modules/candidateMergeSplitValidator.test.ts rename to test/modules/candidates/candidateMergeSplitValidator.test.ts index 99efad6fa..399b6d8d6 100644 --- a/test/modules/candidateMergeSplitValidator.test.ts +++ b/test/modules/candidates/candidateMergeSplitValidator.test.ts @@ -1,16 +1,16 @@ -import CandidateMergeSplitValidator from '../../src/modules/candidateMergeSplitValidator.js'; -import DAT from '../../src/types/dats/dat.js'; -import Header from '../../src/types/dats/logiqx/header.js'; -import LogiqxDAT from '../../src/types/dats/logiqx/logiqxDat.js'; -import DeviceRef from '../../src/types/dats/mame/deviceRef.js'; -import Machine from '../../src/types/dats/mame/machine.js'; -import Parent from '../../src/types/dats/parent.js'; -import ROM from '../../src/types/dats/rom.js'; -import File from '../../src/types/files/file.js'; -import Options, { MergeMode } from '../../src/types/options.js'; -import ReleaseCandidate from '../../src/types/releaseCandidate.js'; -import ROMWithFiles from '../../src/types/romWithFiles.js'; -import ProgressBarFake from '../console/progressBarFake.js'; +import CandidateMergeSplitValidator from '../../../src/modules/candidates/candidateMergeSplitValidator.js'; +import DAT from '../../../src/types/dats/dat.js'; +import Header from '../../../src/types/dats/logiqx/header.js'; +import LogiqxDAT from '../../../src/types/dats/logiqx/logiqxDat.js'; +import DeviceRef from '../../../src/types/dats/mame/deviceRef.js'; +import Machine from '../../../src/types/dats/mame/machine.js'; +import Parent from '../../../src/types/dats/parent.js'; +import ROM from '../../../src/types/dats/rom.js'; +import File from '../../../src/types/files/file.js'; +import Options, { MergeMode } from '../../../src/types/options.js'; +import ReleaseCandidate from '../../../src/types/releaseCandidate.js'; +import ROMWithFiles from '../../../src/types/romWithFiles.js'; +import ProgressBarFake from '../../console/progressBarFake.js'; async function datToCandidates(dat: DAT): Promise> { const dummyFile = await File.fileOf({ filePath: '' }); diff --git a/test/modules/candidatePatchGenerator.test.ts b/test/modules/candidates/candidatePatchGenerator.test.ts similarity index 78% rename from test/modules/candidatePatchGenerator.test.ts rename to test/modules/candidates/candidatePatchGenerator.test.ts index 1a47e332e..af8c9a4aa 100644 --- a/test/modules/candidatePatchGenerator.test.ts +++ b/test/modules/candidates/candidatePatchGenerator.test.ts @@ -1,23 +1,23 @@ import path from 'node:path'; -import CandidateGenerator from '../../src/modules/candidateGenerator.js'; -import CandidatePatchGenerator from '../../src/modules/candidatePatchGenerator.js'; -import DATCombiner from '../../src/modules/datCombiner.js'; -import DATGameInferrer from '../../src/modules/datGameInferrer.js'; -import DATScanner from '../../src/modules/datScanner.js'; -import PatchScanner from '../../src/modules/patchScanner.js'; -import ROMIndexer from '../../src/modules/romIndexer.js'; -import ROMScanner from '../../src/modules/romScanner.js'; -import DAT from '../../src/types/dats/dat.js'; -import Header from '../../src/types/dats/logiqx/header.js'; -import LogiqxDAT from '../../src/types/dats/logiqx/logiqxDat.js'; -import Parent from '../../src/types/dats/parent.js'; -import File from '../../src/types/files/file.js'; -import FileCache from '../../src/types/files/fileCache.js'; -import FileFactory from '../../src/types/files/fileFactory.js'; -import Options from '../../src/types/options.js'; -import ReleaseCandidate from '../../src/types/releaseCandidate.js'; -import ProgressBarFake from '../console/progressBarFake.js'; +import CandidateGenerator from '../../../src/modules/candidates/candidateGenerator.js'; +import CandidatePatchGenerator from '../../../src/modules/candidates/candidatePatchGenerator.js'; +import DATCombiner from '../../../src/modules/dats/datCombiner.js'; +import DATGameInferrer from '../../../src/modules/dats/datGameInferrer.js'; +import DATScanner from '../../../src/modules/dats/datScanner.js'; +import PatchScanner from '../../../src/modules/patchScanner.js'; +import ROMIndexer from '../../../src/modules/roms/romIndexer.js'; +import ROMScanner from '../../../src/modules/roms/romScanner.js'; +import DAT from '../../../src/types/dats/dat.js'; +import Header from '../../../src/types/dats/logiqx/header.js'; +import LogiqxDAT from '../../../src/types/dats/logiqx/logiqxDat.js'; +import Parent from '../../../src/types/dats/parent.js'; +import File from '../../../src/types/files/file.js'; +import FileCache from '../../../src/types/files/fileCache.js'; +import FileFactory from '../../../src/types/files/fileFactory.js'; +import Options from '../../../src/types/options.js'; +import ReleaseCandidate from '../../../src/types/releaseCandidate.js'; +import ProgressBarFake from '../../console/progressBarFake.js'; // Run DATGameInferrer, but condense all DATs down to one async function buildInferredDat(options: Options, romFiles: File[]): Promise { diff --git a/test/modules/candidatePostProcessor.test.ts b/test/modules/candidates/candidatePostProcessor.test.ts similarity index 95% rename from test/modules/candidatePostProcessor.test.ts rename to test/modules/candidates/candidatePostProcessor.test.ts index fbad26d3e..ec8214c7a 100644 --- a/test/modules/candidatePostProcessor.test.ts +++ b/test/modules/candidates/candidatePostProcessor.test.ts @@ -1,15 +1,15 @@ import path from 'node:path'; -import CandidatePostProcessor from '../../src/modules/candidatePostProcessor.js'; -import Game from '../../src/types/dats/game.js'; -import Header from '../../src/types/dats/logiqx/header.js'; -import LogiqxDAT from '../../src/types/dats/logiqx/logiqxDat.js'; -import Parent from '../../src/types/dats/parent.js'; -import ROM from '../../src/types/dats/rom.js'; -import Options, { GameSubdirMode } from '../../src/types/options.js'; -import ReleaseCandidate from '../../src/types/releaseCandidate.js'; -import ROMWithFiles from '../../src/types/romWithFiles.js'; -import ProgressBarFake from '../console/progressBarFake.js'; +import CandidatePostProcessor from '../../../src/modules/candidates/candidatePostProcessor.js'; +import Game from '../../../src/types/dats/game.js'; +import Header from '../../../src/types/dats/logiqx/header.js'; +import LogiqxDAT from '../../../src/types/dats/logiqx/logiqxDat.js'; +import Parent from '../../../src/types/dats/parent.js'; +import ROM from '../../../src/types/dats/rom.js'; +import Options, { GameSubdirMode } from '../../../src/types/options.js'; +import ReleaseCandidate from '../../../src/types/releaseCandidate.js'; +import ROMWithFiles from '../../../src/types/romWithFiles.js'; +import ProgressBarFake from '../../console/progressBarFake.js'; const singleRomGames = [ 'Admirable', diff --git a/test/modules/candidatePreferer.test.ts b/test/modules/candidates/candidatePreferer.test.ts similarity index 98% rename from test/modules/candidatePreferer.test.ts rename to test/modules/candidates/candidatePreferer.test.ts index bd449ac5e..d247d38f9 100644 --- a/test/modules/candidatePreferer.test.ts +++ b/test/modules/candidates/candidatePreferer.test.ts @@ -1,14 +1,14 @@ -import CandidatePreferer from '../../src/modules/candidatePreferer.js'; -import Game, { GameProps } from '../../src/types/dats/game.js'; -import Header from '../../src/types/dats/logiqx/header.js'; -import LogiqxDAT from '../../src/types/dats/logiqx/logiqxDat.js'; -import Parent from '../../src/types/dats/parent.js'; -import Release from '../../src/types/dats/release.js'; -import ROM from '../../src/types/dats/rom.js'; -import Options, { OptionsProps, PreferRevision } from '../../src/types/options.js'; -import ReleaseCandidate from '../../src/types/releaseCandidate.js'; -import ROMWithFiles from '../../src/types/romWithFiles.js'; -import ProgressBarFake from '../console/progressBarFake.js'; +import CandidatePreferer from '../../../src/modules/candidates/candidatePreferer.js'; +import Game, { GameProps } from '../../../src/types/dats/game.js'; +import Header from '../../../src/types/dats/logiqx/header.js'; +import LogiqxDAT from '../../../src/types/dats/logiqx/logiqxDat.js'; +import Parent from '../../../src/types/dats/parent.js'; +import Release from '../../../src/types/dats/release.js'; +import ROM from '../../../src/types/dats/rom.js'; +import Options, { OptionsProps, PreferRevision } from '../../../src/types/options.js'; +import ReleaseCandidate from '../../../src/types/releaseCandidate.js'; +import ROMWithFiles from '../../../src/types/romWithFiles.js'; +import ProgressBarFake from '../../console/progressBarFake.js'; function buildCandidateFilter(options: OptionsProps = {}): CandidatePreferer { return new CandidatePreferer(new Options(options), new ProgressBarFake()); diff --git a/test/modules/candidateValidator.test.ts b/test/modules/candidates/candidateValidator.test.ts similarity index 82% rename from test/modules/candidateValidator.test.ts rename to test/modules/candidates/candidateValidator.test.ts index f2915a78e..8e82a36be 100644 --- a/test/modules/candidateValidator.test.ts +++ b/test/modules/candidates/candidateValidator.test.ts @@ -1,13 +1,13 @@ -import CandidateValidator from '../../src/modules/candidateValidator.js'; -import DAT from '../../src/types/dats/dat.js'; -import Game from '../../src/types/dats/game.js'; -import Header from '../../src/types/dats/logiqx/header.js'; -import LogiqxDAT from '../../src/types/dats/logiqx/logiqxDat.js'; -import Parent from '../../src/types/dats/parent.js'; -import ROM from '../../src/types/dats/rom.js'; -import ReleaseCandidate from '../../src/types/releaseCandidate.js'; -import ROMWithFiles from '../../src/types/romWithFiles.js'; -import ProgressBarFake from '../console/progressBarFake.js'; +import CandidateValidator from '../../../src/modules/candidates/candidateValidator.js'; +import DAT from '../../../src/types/dats/dat.js'; +import Game from '../../../src/types/dats/game.js'; +import Header from '../../../src/types/dats/logiqx/header.js'; +import LogiqxDAT from '../../../src/types/dats/logiqx/logiqxDat.js'; +import Parent from '../../../src/types/dats/parent.js'; +import ROM from '../../../src/types/dats/rom.js'; +import ReleaseCandidate from '../../../src/types/releaseCandidate.js'; +import ROMWithFiles from '../../../src/types/romWithFiles.js'; +import ProgressBarFake from '../../console/progressBarFake.js'; async function datToCandidates(dat: DAT): Promise> { const map = new Map(); diff --git a/test/modules/candidateWriter.test.ts b/test/modules/candidates/candidateWriter.test.ts similarity index 97% rename from test/modules/candidateWriter.test.ts rename to test/modules/candidates/candidateWriter.test.ts index 5608ea207..0103c603c 100644 --- a/test/modules/candidateWriter.test.ts +++ b/test/modules/candidates/candidateWriter.test.ts @@ -4,29 +4,29 @@ import fs, { Stats } from 'node:fs'; import os from 'node:os'; import path from 'node:path'; -import Temp from '../../src/globals/temp.js'; -import CandidateCombiner from '../../src/modules/candidateCombiner.js'; -import CandidateExtensionCorrector from '../../src/modules/candidateExtensionCorrector.js'; -import CandidateGenerator from '../../src/modules/candidateGenerator.js'; -import CandidatePatchGenerator from '../../src/modules/candidatePatchGenerator.js'; -import CandidateWriter from '../../src/modules/candidateWriter.js'; -import DATGameInferrer from '../../src/modules/datGameInferrer.js'; -import PatchScanner from '../../src/modules/patchScanner.js'; -import ROMHeaderProcessor from '../../src/modules/romHeaderProcessor.js'; -import ROMIndexer from '../../src/modules/romIndexer.js'; -import ROMScanner from '../../src/modules/romScanner.js'; -import fsPoly from '../../src/polyfill/fsPoly.js'; -import DAT from '../../src/types/dats/dat.js'; -import Header from '../../src/types/dats/logiqx/header.js'; -import LogiqxDAT from '../../src/types/dats/logiqx/logiqxDat.js'; -import Archive from '../../src/types/files/archives/archive.js'; -import ArchiveEntry from '../../src/types/files/archives/archiveEntry.js'; -import File from '../../src/types/files/file.js'; -import FileCache from '../../src/types/files/fileCache.js'; -import { ChecksumBitmask } from '../../src/types/files/fileChecksums.js'; -import FileFactory from '../../src/types/files/fileFactory.js'; -import Options, { GameSubdirMode, OptionsProps } from '../../src/types/options.js'; -import ProgressBarFake from '../console/progressBarFake.js'; +import Temp from '../../../src/globals/temp.js'; +import CandidateCombiner from '../../../src/modules/candidates/candidateCombiner.js'; +import CandidateExtensionCorrector from '../../../src/modules/candidates/candidateExtensionCorrector.js'; +import CandidateGenerator from '../../../src/modules/candidates/candidateGenerator.js'; +import CandidatePatchGenerator from '../../../src/modules/candidates/candidatePatchGenerator.js'; +import CandidateWriter from '../../../src/modules/candidates/candidateWriter.js'; +import DATGameInferrer from '../../../src/modules/dats/datGameInferrer.js'; +import PatchScanner from '../../../src/modules/patchScanner.js'; +import ROMHeaderProcessor from '../../../src/modules/roms/romHeaderProcessor.js'; +import ROMIndexer from '../../../src/modules/roms/romIndexer.js'; +import ROMScanner from '../../../src/modules/roms/romScanner.js'; +import fsPoly from '../../../src/polyfill/fsPoly.js'; +import DAT from '../../../src/types/dats/dat.js'; +import Header from '../../../src/types/dats/logiqx/header.js'; +import LogiqxDAT from '../../../src/types/dats/logiqx/logiqxDat.js'; +import Archive from '../../../src/types/files/archives/archive.js'; +import ArchiveEntry from '../../../src/types/files/archives/archiveEntry.js'; +import File from '../../../src/types/files/file.js'; +import FileCache from '../../../src/types/files/fileCache.js'; +import { ChecksumBitmask } from '../../../src/types/files/fileChecksums.js'; +import FileFactory from '../../../src/types/files/fileFactory.js'; +import Options, { GameSubdirMode, OptionsProps } from '../../../src/types/options.js'; +import ProgressBarFake from '../../console/progressBarFake.js'; async function copyFixturesToTemp( callback: (input: string, output: string) => void | Promise, diff --git a/test/modules/datCombiner.test.ts b/test/modules/dats/datCombiner.test.ts similarity index 74% rename from test/modules/datCombiner.test.ts rename to test/modules/dats/datCombiner.test.ts index 5a2699ef5..c31ea574f 100644 --- a/test/modules/datCombiner.test.ts +++ b/test/modules/dats/datCombiner.test.ts @@ -1,11 +1,11 @@ import 'jest-extended'; -import DATCombiner from '../../src/modules/datCombiner.js'; -import DAT from '../../src/types/dats/dat.js'; -import Game from '../../src/types/dats/game.js'; -import Header from '../../src/types/dats/logiqx/header.js'; -import LogiqxDAT from '../../src/types/dats/logiqx/logiqxDat.js'; -import ProgressBarFake from '../console/progressBarFake.js'; +import DATCombiner from '../../../src/modules/dats/datCombiner.js'; +import DAT from '../../../src/types/dats/dat.js'; +import Game from '../../../src/types/dats/game.js'; +import Header from '../../../src/types/dats/logiqx/header.js'; +import LogiqxDAT from '../../../src/types/dats/logiqx/logiqxDat.js'; +import ProgressBarFake from '../../console/progressBarFake.js'; const GAME_COUNT = 100; diff --git a/test/modules/datFilter.test.ts b/test/modules/dats/datFilter.test.ts similarity index 98% rename from test/modules/datFilter.test.ts rename to test/modules/dats/datFilter.test.ts index 0dfa04de0..c80985518 100644 --- a/test/modules/datFilter.test.ts +++ b/test/modules/dats/datFilter.test.ts @@ -1,11 +1,11 @@ -import DATFilter from '../../src/modules/datFilter.js'; -import Game, { GameProps } from '../../src/types/dats/game.js'; -import Header from '../../src/types/dats/logiqx/header.js'; -import LogiqxDAT from '../../src/types/dats/logiqx/logiqxDat.js'; -import Release from '../../src/types/dats/release.js'; -import ROM from '../../src/types/dats/rom.js'; -import Options, { OptionsProps } from '../../src/types/options.js'; -import ProgressBarFake from '../console/progressBarFake.js'; +import DATFilter from '../../../src/modules/dats/datFilter.js'; +import Game, { GameProps } from '../../../src/types/dats/game.js'; +import Header from '../../../src/types/dats/logiqx/header.js'; +import LogiqxDAT from '../../../src/types/dats/logiqx/logiqxDat.js'; +import Release from '../../../src/types/dats/release.js'; +import ROM from '../../../src/types/dats/rom.js'; +import Options, { OptionsProps } from '../../../src/types/options.js'; +import ProgressBarFake from '../../console/progressBarFake.js'; function buildDATFilter(options: OptionsProps = {}): DATFilter { return new DATFilter(new Options(options), new ProgressBarFake()); diff --git a/test/modules/datGameInferrer.test.ts b/test/modules/dats/datGameInferrer.test.ts similarity index 78% rename from test/modules/datGameInferrer.test.ts rename to test/modules/dats/datGameInferrer.test.ts index af01c2fe3..f09d32949 100644 --- a/test/modules/datGameInferrer.test.ts +++ b/test/modules/dats/datGameInferrer.test.ts @@ -1,9 +1,9 @@ -import DATGameInferrer from '../../src/modules/datGameInferrer.js'; -import ROMScanner from '../../src/modules/romScanner.js'; -import FileCache from '../../src/types/files/fileCache.js'; -import FileFactory from '../../src/types/files/fileFactory.js'; -import Options from '../../src/types/options.js'; -import ProgressBarFake from '../console/progressBarFake.js'; +import DATGameInferrer from '../../../src/modules/dats/datGameInferrer.js'; +import ROMScanner from '../../../src/modules/roms/romScanner.js'; +import FileCache from '../../../src/types/files/fileCache.js'; +import FileFactory from '../../../src/types/files/fileFactory.js'; +import Options from '../../../src/types/options.js'; +import ProgressBarFake from '../../console/progressBarFake.js'; test.each([ // One input path diff --git a/test/modules/datMergerSplitter.test.ts b/test/modules/dats/datMergerSplitter.test.ts similarity index 99% rename from test/modules/datMergerSplitter.test.ts rename to test/modules/dats/datMergerSplitter.test.ts index 76df94153..2edde3fb9 100644 --- a/test/modules/datMergerSplitter.test.ts +++ b/test/modules/dats/datMergerSplitter.test.ts @@ -1,15 +1,15 @@ import 'jest-extended'; -import DATMergerSplitter from '../../src/modules/datMergerSplitter.js'; -import Disk from '../../src/types/dats/disk.js'; -import Game from '../../src/types/dats/game.js'; -import Header from '../../src/types/dats/logiqx/header.js'; -import LogiqxDAT from '../../src/types/dats/logiqx/logiqxDat.js'; -import DeviceRef from '../../src/types/dats/mame/deviceRef.js'; -import Machine from '../../src/types/dats/mame/machine.js'; -import ROM from '../../src/types/dats/rom.js'; -import Options, { MergeMode } from '../../src/types/options.js'; -import ProgressBarFake from '../console/progressBarFake.js'; +import DATMergerSplitter from '../../../src/modules/dats/datMergerSplitter.js'; +import Disk from '../../../src/types/dats/disk.js'; +import Game from '../../../src/types/dats/game.js'; +import Header from '../../../src/types/dats/logiqx/header.js'; +import LogiqxDAT from '../../../src/types/dats/logiqx/logiqxDat.js'; +import DeviceRef from '../../../src/types/dats/mame/deviceRef.js'; +import Machine from '../../../src/types/dats/mame/machine.js'; +import ROM from '../../../src/types/dats/rom.js'; +import Options, { MergeMode } from '../../../src/types/options.js'; +import ProgressBarFake from '../../console/progressBarFake.js'; it('should do nothing if no parent/clone info is present', () => { // Given diff --git a/test/modules/datParentInferrer.test.ts b/test/modules/dats/datParentInferrer.test.ts similarity index 96% rename from test/modules/datParentInferrer.test.ts rename to test/modules/dats/datParentInferrer.test.ts index 65d3b8496..0063e9fea 100644 --- a/test/modules/datParentInferrer.test.ts +++ b/test/modules/dats/datParentInferrer.test.ts @@ -1,10 +1,10 @@ -import DATParentInferrer from '../../src/modules/datParentInferrer.js'; -import DAT from '../../src/types/dats/dat.js'; -import Game from '../../src/types/dats/game.js'; -import Header from '../../src/types/dats/logiqx/header.js'; -import LogiqxDAT from '../../src/types/dats/logiqx/logiqxDat.js'; -import Options from '../../src/types/options.js'; -import ProgressBarFake from '../console/progressBarFake.js'; +import DATParentInferrer from '../../../src/modules/dats/datParentInferrer.js'; +import DAT from '../../../src/types/dats/dat.js'; +import Game from '../../../src/types/dats/game.js'; +import Header from '../../../src/types/dats/logiqx/header.js'; +import LogiqxDAT from '../../../src/types/dats/logiqx/logiqxDat.js'; +import Options from '../../../src/types/options.js'; +import ProgressBarFake from '../../console/progressBarFake.js'; function buildDat(gameNames: string[]): DAT { return new LogiqxDAT( diff --git a/test/modules/datScanner.test.ts b/test/modules/dats/datScanner.test.ts similarity index 95% rename from test/modules/datScanner.test.ts rename to test/modules/dats/datScanner.test.ts index bf850a919..5c9441bec 100644 --- a/test/modules/datScanner.test.ts +++ b/test/modules/dats/datScanner.test.ts @@ -3,11 +3,11 @@ import path from 'node:path'; import which from 'which'; -import DATScanner from '../../src/modules/datScanner.js'; -import FileCache from '../../src/types/files/fileCache.js'; -import FileFactory from '../../src/types/files/fileFactory.js'; -import Options, { OptionsProps } from '../../src/types/options.js'; -import ProgressBarFake from '../console/progressBarFake.js'; +import DATScanner from '../../../src/modules/dats/datScanner.js'; +import FileCache from '../../../src/types/files/fileCache.js'; +import FileFactory from '../../../src/types/files/fileFactory.js'; +import Options, { OptionsProps } from '../../../src/types/options.js'; +import ProgressBarFake from '../../console/progressBarFake.js'; function createDatScanner(props: OptionsProps): DATScanner { return new DATScanner( diff --git a/test/modules/dir2DatCreator.test.ts b/test/modules/dir2DatCreator.test.ts index d591003fb..c0153b99c 100644 --- a/test/modules/dir2DatCreator.test.ts +++ b/test/modules/dir2DatCreator.test.ts @@ -2,12 +2,12 @@ import 'jest-extended'; import path from 'node:path'; -import CandidateGenerator from '../../src/modules/candidateGenerator.js'; -import DATGameInferrer from '../../src/modules/datGameInferrer.js'; -import DATScanner from '../../src/modules/datScanner.js'; +import CandidateGenerator from '../../src/modules/candidates/candidateGenerator.js'; +import DATGameInferrer from '../../src/modules/dats/datGameInferrer.js'; +import DATScanner from '../../src/modules/dats/datScanner.js'; import Dir2DatCreator from '../../src/modules/dir2DatCreator.js'; -import ROMIndexer from '../../src/modules/romIndexer.js'; -import ROMScanner from '../../src/modules/romScanner.js'; +import ROMIndexer from '../../src/modules/roms/romIndexer.js'; +import ROMScanner from '../../src/modules/roms/romScanner.js'; import FsPoly from '../../src/polyfill/fsPoly.js'; import DAT from '../../src/types/dats/dat.js'; import FileCache from '../../src/types/files/fileCache.js'; diff --git a/test/modules/fixdatCreator.test.ts b/test/modules/fixdatCreator.test.ts index fcde072c4..99d430e81 100644 --- a/test/modules/fixdatCreator.test.ts +++ b/test/modules/fixdatCreator.test.ts @@ -1,4 +1,4 @@ -import DATScanner from '../../src/modules/datScanner.js'; +import DATScanner from '../../src/modules/dats/datScanner.js'; import FixdatCreator from '../../src/modules/fixdatCreator.js'; import fsPoly from '../../src/polyfill/fsPoly.js'; import DAT from '../../src/types/dats/dat.js'; diff --git a/test/modules/movedRomDeleter.test.ts b/test/modules/movedRomDeleter.test.ts index 5c256ca8e..051b16c38 100644 --- a/test/modules/movedRomDeleter.test.ts +++ b/test/modules/movedRomDeleter.test.ts @@ -1,10 +1,10 @@ import path from 'node:path'; import Temp from '../../src/globals/temp.js'; -import CandidateGenerator from '../../src/modules/candidateGenerator.js'; +import CandidateGenerator from '../../src/modules/candidates/candidateGenerator.js'; import MovedROMDeleter from '../../src/modules/movedRomDeleter.js'; -import ROMIndexer from '../../src/modules/romIndexer.js'; -import ROMScanner from '../../src/modules/romScanner.js'; +import ROMIndexer from '../../src/modules/roms/romIndexer.js'; +import ROMScanner from '../../src/modules/roms/romScanner.js'; import fsPoly from '../../src/polyfill/fsPoly.js'; import Game from '../../src/types/dats/game.js'; import Header from '../../src/types/dats/logiqx/header.js'; diff --git a/test/modules/romHeaderProcessor.test.ts b/test/modules/roms/romHeaderProcessor.test.ts similarity index 90% rename from test/modules/romHeaderProcessor.test.ts rename to test/modules/roms/romHeaderProcessor.test.ts index 6b9e31fc9..85821b557 100644 --- a/test/modules/romHeaderProcessor.test.ts +++ b/test/modules/roms/romHeaderProcessor.test.ts @@ -1,14 +1,14 @@ import path from 'node:path'; -import Temp from '../../src/globals/temp.js'; -import ROMHeaderProcessor from '../../src/modules/romHeaderProcessor.js'; -import ROMScanner from '../../src/modules/romScanner.js'; -import FsPoly from '../../src/polyfill/fsPoly.js'; -import File from '../../src/types/files/file.js'; -import FileCache from '../../src/types/files/fileCache.js'; -import FileFactory from '../../src/types/files/fileFactory.js'; -import Options from '../../src/types/options.js'; -import ProgressBarFake from '../console/progressBarFake.js'; +import Temp from '../../../src/globals/temp.js'; +import ROMHeaderProcessor from '../../../src/modules/roms/romHeaderProcessor.js'; +import ROMScanner from '../../../src/modules/roms/romScanner.js'; +import FsPoly from '../../../src/polyfill/fsPoly.js'; +import File from '../../../src/types/files/file.js'; +import FileCache from '../../../src/types/files/fileCache.js'; +import FileFactory from '../../../src/types/files/fileFactory.js'; +import Options from '../../../src/types/options.js'; +import ProgressBarFake from '../../console/progressBarFake.js'; describe('extension has possible header', () => { it('should do nothing if extension not found', async () => { diff --git a/test/modules/romIndexer.test.ts b/test/modules/roms/romIndexer.test.ts similarity index 100% rename from test/modules/romIndexer.test.ts rename to test/modules/roms/romIndexer.test.ts diff --git a/test/modules/romScanner.test.ts b/test/modules/roms/romScanner.test.ts similarity index 94% rename from test/modules/romScanner.test.ts rename to test/modules/roms/romScanner.test.ts index 75165d029..6bae4540c 100644 --- a/test/modules/romScanner.test.ts +++ b/test/modules/roms/romScanner.test.ts @@ -1,16 +1,16 @@ import os from 'node:os'; import path from 'node:path'; -import Temp from '../../src/globals/temp.js'; -import ROMScanner from '../../src/modules/romScanner.js'; -import ArrayPoly from '../../src/polyfill/arrayPoly.js'; -import fsPoly from '../../src/polyfill/fsPoly.js'; -import ArchiveEntry from '../../src/types/files/archives/archiveEntry.js'; -import FileCache from '../../src/types/files/fileCache.js'; -import { ChecksumBitmask } from '../../src/types/files/fileChecksums.js'; -import FileFactory from '../../src/types/files/fileFactory.js'; -import Options, { OptionsProps } from '../../src/types/options.js'; -import ProgressBarFake from '../console/progressBarFake.js'; +import Temp from '../../../src/globals/temp.js'; +import ROMScanner from '../../../src/modules/roms/romScanner.js'; +import ArrayPoly from '../../../src/polyfill/arrayPoly.js'; +import fsPoly from '../../../src/polyfill/fsPoly.js'; +import ArchiveEntry from '../../../src/types/files/archives/archiveEntry.js'; +import FileCache from '../../../src/types/files/fileCache.js'; +import { ChecksumBitmask } from '../../../src/types/files/fileChecksums.js'; +import FileFactory from '../../../src/types/files/fileFactory.js'; +import Options, { OptionsProps } from '../../../src/types/options.js'; +import ProgressBarFake from '../../console/progressBarFake.js'; function createRomScanner(input: string[], inputExclude: string[] = []): ROMScanner { return new ROMScanner( diff --git a/test/modules/statusGenerator.test.ts b/test/modules/statusGenerator.test.ts index fa19eb722..34e1657c1 100644 --- a/test/modules/statusGenerator.test.ts +++ b/test/modules/statusGenerator.test.ts @@ -1,6 +1,6 @@ import stripAnsi from 'strip-ansi'; -import CandidatePreferer from '../../src/modules/candidatePreferer.js'; +import CandidatePreferer from '../../src/modules/candidates/candidatePreferer.js'; import StatusGenerator from '../../src/modules/statusGenerator.js'; import Game from '../../src/types/dats/game.js'; import Header from '../../src/types/dats/logiqx/header.js'; diff --git a/test/types/files/archives/archiveEntry.test.ts b/test/types/files/archives/archiveEntry.test.ts index 095b04d24..58c70d44a 100644 --- a/test/types/files/archives/archiveEntry.test.ts +++ b/test/types/files/archives/archiveEntry.test.ts @@ -1,7 +1,7 @@ import path from 'node:path'; import Temp from '../../../../src/globals/temp.js'; -import ROMScanner from '../../../../src/modules/romScanner.js'; +import ROMScanner from '../../../../src/modules/roms/romScanner.js'; import ArrayPoly from '../../../../src/polyfill/arrayPoly.js'; import bufferPoly from '../../../../src/polyfill/bufferPoly.js'; import fsPoly from '../../../../src/polyfill/fsPoly.js'; diff --git a/test/types/files/archives/zip.test.ts b/test/types/files/archives/zip.test.ts index e4e73b2c2..918f69a1e 100644 --- a/test/types/files/archives/zip.test.ts +++ b/test/types/files/archives/zip.test.ts @@ -1,7 +1,7 @@ import path from 'node:path'; import Temp from '../../../../src/globals/temp.js'; -import ROMScanner from '../../../../src/modules/romScanner.js'; +import ROMScanner from '../../../../src/modules/roms/romScanner.js'; import fsPoly from '../../../../src/polyfill/fsPoly.js'; import ArchiveEntry from '../../../../src/types/files/archives/archiveEntry.js'; import Zip from '../../../../src/types/files/archives/zip.js'; diff --git a/test/types/files/file.test.ts b/test/types/files/file.test.ts index 684a5e7f9..f4cf97f6b 100644 --- a/test/types/files/file.test.ts +++ b/test/types/files/file.test.ts @@ -1,7 +1,7 @@ import path from 'node:path'; import Temp from '../../../src/globals/temp.js'; -import ROMScanner from '../../../src/modules/romScanner.js'; +import ROMScanner from '../../../src/modules/roms/romScanner.js'; import bufferPoly from '../../../src/polyfill/bufferPoly.js'; import FilePoly from '../../../src/polyfill/filePoly.js'; import fsPoly from '../../../src/polyfill/fsPoly.js'; diff --git a/test/types/files/romHeader.test.ts b/test/types/files/romHeader.test.ts index 20cb6fbfb..20c103813 100644 --- a/test/types/files/romHeader.test.ts +++ b/test/types/files/romHeader.test.ts @@ -1,4 +1,4 @@ -import ROMScanner from '../../../src/modules/romScanner.js'; +import ROMScanner from '../../../src/modules/roms/romScanner.js'; import FileCache from '../../../src/types/files/fileCache.js'; import FileFactory from '../../../src/types/files/fileFactory.js'; import ROMHeader from '../../../src/types/files/romHeader.js';