Skip to content

Commit 6746d8a

Browse files
authored
Refactor: sort modules into groups (#1332)
1 parent f7865f7 commit 6746d8a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+434
-434
lines changed

src/igir.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,31 @@ import ProgressBar, { ProgressBarSymbol } from './console/progressBar.js';
1010
import ProgressBarCLI from './console/progressBarCli.js';
1111
import Package from './globals/package.js';
1212
import Temp from './globals/temp.js';
13-
import CandidateArchiveFileHasher from './modules/candidateArchiveFileHasher.js';
14-
import CandidateCombiner from './modules/candidateCombiner.js';
15-
import CandidateExtensionCorrector from './modules/candidateExtensionCorrector.js';
16-
import CandidateGenerator from './modules/candidateGenerator.js';
17-
import CandidateMergeSplitValidator from './modules/candidateMergeSplitValidator.js';
18-
import CandidatePatchGenerator from './modules/candidatePatchGenerator.js';
19-
import CandidatePostProcessor from './modules/candidatePostProcessor.js';
20-
import CandidatePreferer from './modules/candidatePreferer.js';
21-
import CandidateValidator from './modules/candidateValidator.js';
22-
import CandidateWriter from './modules/candidateWriter.js';
23-
import DATCombiner from './modules/datCombiner.js';
24-
import DATFilter from './modules/datFilter.js';
25-
import DATGameInferrer from './modules/datGameInferrer.js';
26-
import DATMergerSplitter from './modules/datMergerSplitter.js';
27-
import DATParentInferrer from './modules/datParentInferrer.js';
28-
import DATScanner from './modules/datScanner.js';
13+
import CandidateArchiveFileHasher from './modules/candidates/candidateArchiveFileHasher.js';
14+
import CandidateCombiner from './modules/candidates/candidateCombiner.js';
15+
import CandidateExtensionCorrector from './modules/candidates/candidateExtensionCorrector.js';
16+
import CandidateGenerator from './modules/candidates/candidateGenerator.js';
17+
import CandidateMergeSplitValidator from './modules/candidates/candidateMergeSplitValidator.js';
18+
import CandidatePatchGenerator from './modules/candidates/candidatePatchGenerator.js';
19+
import CandidatePostProcessor from './modules/candidates/candidatePostProcessor.js';
20+
import CandidatePreferer from './modules/candidates/candidatePreferer.js';
21+
import CandidateValidator from './modules/candidates/candidateValidator.js';
22+
import CandidateWriter from './modules/candidates/candidateWriter.js';
23+
import DATCombiner from './modules/dats/datCombiner.js';
24+
import DATFilter from './modules/dats/datFilter.js';
25+
import DATGameInferrer from './modules/dats/datGameInferrer.js';
26+
import DATMergerSplitter from './modules/dats/datMergerSplitter.js';
27+
import DATParentInferrer from './modules/dats/datParentInferrer.js';
28+
import DATScanner from './modules/dats/datScanner.js';
2929
import Dir2DatCreator from './modules/dir2DatCreator.js';
3030
import DirectoryCleaner from './modules/directoryCleaner.js';
3131
import FixdatCreator from './modules/fixdatCreator.js';
3232
import MovedROMDeleter from './modules/movedRomDeleter.js';
3333
import PatchScanner from './modules/patchScanner.js';
3434
import ReportGenerator from './modules/reportGenerator.js';
35-
import ROMHeaderProcessor from './modules/romHeaderProcessor.js';
36-
import ROMIndexer from './modules/romIndexer.js';
37-
import ROMScanner from './modules/romScanner.js';
35+
import ROMHeaderProcessor from './modules/roms/romHeaderProcessor.js';
36+
import ROMIndexer from './modules/roms/romIndexer.js';
37+
import ROMScanner from './modules/roms/romScanner.js';
3838
import StatusGenerator from './modules/statusGenerator.js';
3939
import ArrayPoly from './polyfill/arrayPoly.js';
4040
import FsPoly from './polyfill/fsPoly.js';

src/modules/candidateArchiveFileHasher.ts renamed to src/modules/candidates/candidateArchiveFileHasher.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import ProgressBar, { ProgressBarSymbol } from '../console/progressBar.js';
2-
import DriveSemaphore from '../driveSemaphore.js';
3-
import DAT from '../types/dats/dat.js';
4-
import Parent from '../types/dats/parent.js';
5-
import ArchiveFile from '../types/files/archives/archiveFile.js';
6-
import FileFactory from '../types/files/fileFactory.js';
7-
import Options from '../types/options.js';
8-
import ReleaseCandidate from '../types/releaseCandidate.js';
9-
import Module from './module.js';
1+
import ProgressBar, { ProgressBarSymbol } from '../../console/progressBar.js';
2+
import DriveSemaphore from '../../driveSemaphore.js';
3+
import DAT from '../../types/dats/dat.js';
4+
import Parent from '../../types/dats/parent.js';
5+
import ArchiveFile from '../../types/files/archives/archiveFile.js';
6+
import FileFactory from '../../types/files/fileFactory.js';
7+
import Options from '../../types/options.js';
8+
import ReleaseCandidate from '../../types/releaseCandidate.js';
9+
import Module from '../module.js';
1010

1111
/**
1212
* Calculate checksums for {@link ArchiveFile}s (which were skipped in {@link CandidateGenerator}).

src/modules/candidateCombiner.ts renamed to src/modules/candidates/candidateCombiner.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import path from 'node:path';
22

3-
import ProgressBar, { ProgressBarSymbol } from '../console/progressBar.js';
4-
import DAT from '../types/dats/dat.js';
5-
import Game from '../types/dats/game.js';
6-
import Parent from '../types/dats/parent.js';
7-
import ROM from '../types/dats/rom.js';
8-
import ArchiveEntry from '../types/files/archives/archiveEntry.js';
9-
import Options from '../types/options.js';
10-
import ReleaseCandidate from '../types/releaseCandidate.js';
11-
import Module from './module.js';
3+
import ProgressBar, { ProgressBarSymbol } from '../../console/progressBar.js';
4+
import DAT from '../../types/dats/dat.js';
5+
import Game from '../../types/dats/game.js';
6+
import Parent from '../../types/dats/parent.js';
7+
import ROM from '../../types/dats/rom.js';
8+
import ArchiveEntry from '../../types/files/archives/archiveEntry.js';
9+
import Options from '../../types/options.js';
10+
import ReleaseCandidate from '../../types/releaseCandidate.js';
11+
import Module from '../module.js';
1212

1313
/**
1414
* Combine every {@link Parent} and its {@link ReleaseCandidate}s for a {@link DAT} into a single

src/modules/candidateExtensionCorrector.ts renamed to src/modules/candidates/candidateExtensionCorrector.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ import path from 'node:path';
22

33
import { Semaphore } from 'async-mutex';
44

5-
import ProgressBar, { ProgressBarSymbol } from '../console/progressBar.js';
6-
import DAT from '../types/dats/dat.js';
7-
import Parent from '../types/dats/parent.js';
8-
import ROM from '../types/dats/rom.js';
9-
import ArchiveEntry from '../types/files/archives/archiveEntry.js';
10-
import Chd from '../types/files/archives/chd/chd.js';
11-
import FileFactory from '../types/files/fileFactory.js';
12-
import FileSignature from '../types/files/fileSignature.js';
13-
import Options, { FixExtension } from '../types/options.js';
14-
import OutputFactory from '../types/outputFactory.js';
15-
import ReleaseCandidate from '../types/releaseCandidate.js';
16-
import ROMWithFiles from '../types/romWithFiles.js';
17-
import Module from './module.js';
5+
import ProgressBar, { ProgressBarSymbol } from '../../console/progressBar.js';
6+
import DAT from '../../types/dats/dat.js';
7+
import Parent from '../../types/dats/parent.js';
8+
import ROM from '../../types/dats/rom.js';
9+
import ArchiveEntry from '../../types/files/archives/archiveEntry.js';
10+
import Chd from '../../types/files/archives/chd/chd.js';
11+
import FileFactory from '../../types/files/fileFactory.js';
12+
import FileSignature from '../../types/files/fileSignature.js';
13+
import Options, { FixExtension } from '../../types/options.js';
14+
import OutputFactory from '../../types/outputFactory.js';
15+
import ReleaseCandidate from '../../types/releaseCandidate.js';
16+
import ROMWithFiles from '../../types/romWithFiles.js';
17+
import Module from '../module.js';
1818

1919
/**
2020
* Correct the extensions of output {@link File}s when:

src/modules/candidateGenerator.ts renamed to src/modules/candidates/candidateGenerator.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@ import path from 'node:path';
22

33
import { Semaphore } from 'async-mutex';
44

5-
import ProgressBar, { ProgressBarSymbol } from '../console/progressBar.js';
6-
import ArrayPoly from '../polyfill/arrayPoly.js';
7-
import fsPoly from '../polyfill/fsPoly.js';
8-
import DAT from '../types/dats/dat.js';
9-
import Game from '../types/dats/game.js';
10-
import Parent from '../types/dats/parent.js';
11-
import Release from '../types/dats/release.js';
12-
import ROM from '../types/dats/rom.js';
13-
import Archive from '../types/files/archives/archive.js';
14-
import ArchiveEntry from '../types/files/archives/archiveEntry.js';
15-
import ArchiveFile from '../types/files/archives/archiveFile.js';
16-
import Chd from '../types/files/archives/chd/chd.js';
17-
import Zip from '../types/files/archives/zip.js';
18-
import File from '../types/files/file.js';
19-
import IndexedFiles from '../types/indexedFiles.js';
20-
import Options from '../types/options.js';
21-
import OutputFactory, { OutputPath } from '../types/outputFactory.js';
22-
import ReleaseCandidate from '../types/releaseCandidate.js';
23-
import ROMWithFiles from '../types/romWithFiles.js';
24-
import Module from './module.js';
5+
import ProgressBar, { ProgressBarSymbol } from '../../console/progressBar.js';
6+
import ArrayPoly from '../../polyfill/arrayPoly.js';
7+
import fsPoly from '../../polyfill/fsPoly.js';
8+
import DAT from '../../types/dats/dat.js';
9+
import Game from '../../types/dats/game.js';
10+
import Parent from '../../types/dats/parent.js';
11+
import Release from '../../types/dats/release.js';
12+
import ROM from '../../types/dats/rom.js';
13+
import Archive from '../../types/files/archives/archive.js';
14+
import ArchiveEntry from '../../types/files/archives/archiveEntry.js';
15+
import ArchiveFile from '../../types/files/archives/archiveFile.js';
16+
import Chd from '../../types/files/archives/chd/chd.js';
17+
import Zip from '../../types/files/archives/zip.js';
18+
import File from '../../types/files/file.js';
19+
import IndexedFiles from '../../types/indexedFiles.js';
20+
import Options from '../../types/options.js';
21+
import OutputFactory, { OutputPath } from '../../types/outputFactory.js';
22+
import ReleaseCandidate from '../../types/releaseCandidate.js';
23+
import ROMWithFiles from '../../types/romWithFiles.js';
24+
import Module from '../module.js';
2525

2626
/**
2727
* For every {@link Parent} in the {@link DAT}, look for its {@link ROM}s in the scanned ROM list,

src/modules/candidateMergeSplitValidator.ts renamed to src/modules/candidates/candidateMergeSplitValidator.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import ProgressBar, { ProgressBarSymbol } from '../console/progressBar.js';
2-
import ArrayPoly from '../polyfill/arrayPoly.js';
3-
import DAT from '../types/dats/dat.js';
4-
import Game from '../types/dats/game.js';
5-
import Machine from '../types/dats/mame/machine.js';
6-
import Parent from '../types/dats/parent.js';
7-
import Options, { MergeMode } from '../types/options.js';
8-
import ReleaseCandidate from '../types/releaseCandidate.js';
9-
import Module from './module.js';
1+
import ProgressBar, { ProgressBarSymbol } from '../../console/progressBar.js';
2+
import ArrayPoly from '../../polyfill/arrayPoly.js';
3+
import DAT from '../../types/dats/dat.js';
4+
import Game from '../../types/dats/game.js';
5+
import Machine from '../../types/dats/mame/machine.js';
6+
import Parent from '../../types/dats/parent.js';
7+
import Options, { MergeMode } from '../../types/options.js';
8+
import ReleaseCandidate from '../../types/releaseCandidate.js';
9+
import Module from '../module.js';
1010

1111
/**
1212
* Validate un-merged, split, and merged ROM sets for playability after all generation and filtering

src/modules/candidatePatchGenerator.ts renamed to src/modules/candidates/candidatePatchGenerator.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
import path from 'node:path';
22

3-
import ProgressBar, { ProgressBarSymbol } from '../console/progressBar.js';
4-
import DAT from '../types/dats/dat.js';
5-
import Game from '../types/dats/game.js';
6-
import Parent from '../types/dats/parent.js';
7-
import Release from '../types/dats/release.js';
8-
import ROM from '../types/dats/rom.js';
9-
import ArchiveEntry from '../types/files/archives/archiveEntry.js';
10-
import File from '../types/files/file.js';
11-
import Patch from '../types/patches/patch.js';
12-
import ReleaseCandidate from '../types/releaseCandidate.js';
13-
import ROMWithFiles from '../types/romWithFiles.js';
14-
import Module from './module.js';
3+
import ProgressBar, { ProgressBarSymbol } from '../../console/progressBar.js';
4+
import DAT from '../../types/dats/dat.js';
5+
import Game from '../../types/dats/game.js';
6+
import Parent from '../../types/dats/parent.js';
7+
import Release from '../../types/dats/release.js';
8+
import ROM from '../../types/dats/rom.js';
9+
import ArchiveEntry from '../../types/files/archives/archiveEntry.js';
10+
import File from '../../types/files/file.js';
11+
import Patch from '../../types/patches/patch.js';
12+
import ReleaseCandidate from '../../types/releaseCandidate.js';
13+
import ROMWithFiles from '../../types/romWithFiles.js';
14+
import Module from '../module.js';
1515

1616
/**
1717
* For each {@link Patch} that matches a {@link ROM}, generate a new {@link Parent} and

src/modules/candidatePostProcessor.ts renamed to src/modules/candidates/candidatePostProcessor.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import ProgressBar, { ProgressBarSymbol } from '../console/progressBar.js';
2-
import DAT from '../types/dats/dat.js';
3-
import Parent from '../types/dats/parent.js';
4-
import Options from '../types/options.js';
5-
import OutputFactory from '../types/outputFactory.js';
6-
import ReleaseCandidate from '../types/releaseCandidate.js';
7-
import ROMWithFiles from '../types/romWithFiles.js';
8-
import Module from './module.js';
1+
import ProgressBar, { ProgressBarSymbol } from '../../console/progressBar.js';
2+
import DAT from '../../types/dats/dat.js';
3+
import Parent from '../../types/dats/parent.js';
4+
import Options from '../../types/options.js';
5+
import OutputFactory from '../../types/outputFactory.js';
6+
import ReleaseCandidate from '../../types/releaseCandidate.js';
7+
import ROMWithFiles from '../../types/romWithFiles.js';
8+
import Module from '../module.js';
99

1010
/**
1111
* Perform any {@link Parent} and {@link ReleaseCandidate} manipulations needed after candidates

src/modules/candidatePreferer.ts renamed to src/modules/candidates/candidatePreferer.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import ProgressBar, { ProgressBarSymbol } from '../console/progressBar.js';
2-
import fsPoly from '../polyfill/fsPoly.js';
3-
import DAT from '../types/dats/dat.js';
4-
import Parent from '../types/dats/parent.js';
5-
import Options, { PreferRevision } from '../types/options.js';
6-
import ReleaseCandidate from '../types/releaseCandidate.js';
7-
import Module from './module.js';
1+
import ProgressBar, { ProgressBarSymbol } from '../../console/progressBar.js';
2+
import fsPoly from '../../polyfill/fsPoly.js';
3+
import DAT from '../../types/dats/dat.js';
4+
import Parent from '../../types/dats/parent.js';
5+
import Options, { PreferRevision } from '../../types/options.js';
6+
import ReleaseCandidate from '../../types/releaseCandidate.js';
7+
import Module from '../module.js';
88

99
/**
1010
* Apply any specified preference options to the {@link ReleaseCandidate}s for each

src/modules/candidateValidator.ts renamed to src/modules/candidates/candidateValidator.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import ProgressBar, { ProgressBarSymbol } from '../console/progressBar.js';
2-
import ArrayPoly from '../polyfill/arrayPoly.js';
3-
import DAT from '../types/dats/dat.js';
4-
import Parent from '../types/dats/parent.js';
5-
import ReleaseCandidate from '../types/releaseCandidate.js';
6-
import Module from './module.js';
1+
import ProgressBar, { ProgressBarSymbol } from '../../console/progressBar.js';
2+
import ArrayPoly from '../../polyfill/arrayPoly.js';
3+
import DAT from '../../types/dats/dat.js';
4+
import Parent from '../../types/dats/parent.js';
5+
import ReleaseCandidate from '../../types/releaseCandidate.js';
6+
import Module from '../module.js';
77

88
/**
99
* Validate candidates for write-ability after all generation and filtering has happened.

0 commit comments

Comments
 (0)