Skip to content

Commit

Permalink
Refactor: rename constants directory (#1192)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmercm authored Jun 28, 2024
1 parent dda552b commit eca2260
Show file tree
Hide file tree
Showing 52 changed files with 53 additions and 53 deletions.
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import semver from 'semver';

import Logger from './src/console/logger.js';
import ProgressBarCLI from './src/console/progressBarCli.js';
import Package from './src/constants/package.js';
import Package from './src/globals/package.js';
import Igir from './src/igir.js';
import ArgumentsParser from './src/modules/argumentsParser.js';
import EndOfLifeChecker from './src/modules/endOfLifeChecker.js';
Expand Down
2 changes: 1 addition & 1 deletion package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import yargs from 'yargs';

import Logger from './src/console/logger.js';
import LogLevel from './src/console/logLevel.js';
import Package from './src/constants/package.js';
import Package from './src/globals/package.js';
import FsPoly from './src/polyfill/fsPoly.js';

interface FileFilter extends GlobOptions {
Expand Down
2 changes: 1 addition & 1 deletion src/console/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import chalk from 'chalk';
import figlet from 'figlet';
import moment from 'moment';

import Package from '../constants/package.js';
import Package from '../globals/package.js';
import LogLevel from './logLevel.js';
import ProgressBar, { ProgressBarSymbol } from './progressBar.js';
import ProgressBarCLI from './progressBarCli.js';
Expand Down
2 changes: 1 addition & 1 deletion src/driveSemaphore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import path from 'node:path';
import async, { AsyncResultCallback } from 'async';
import { Mutex, Semaphore } from 'async-mutex';

import Defaults from './constants/defaults.js';
import Defaults from './globals/defaults.js';
import FsPoly from './polyfill/fsPoly.js';
import File from './types/files/file.js';

Expand Down
2 changes: 1 addition & 1 deletion src/constants/defaults.ts → src/globals/defaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ process.once('beforeExit', async () => {
});

/**
* A static class of constants that are determined at startup, to be used widely.
* A static class of globals that are determined at startup, to be used widely.
*/
export default class Defaults {
static readonly GLOBAL_TEMP_DIR = GLOBAL_TEMP_DIR;
Expand Down
2 changes: 1 addition & 1 deletion src/constants/package.ts → src/globals/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const PACKAGE_JSON = JSON.parse(
);

/**
* A static class of constants that are parsed from `package.json` at startup, to be used widely.
* A static class of globals that are parsed from `package.json` at startup, to be used widely.
*/
export default class Package {
static readonly DIRECTORY = path.dirname(PACKAGE_JSON_PATH);
Expand Down
4 changes: 2 additions & 2 deletions src/igir.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import isAdmin from 'is-admin';
import Logger from './console/logger.js';
import ProgressBar, { ProgressBarSymbol } from './console/progressBar.js';
import ProgressBarCLI from './console/progressBarCli.js';
import Defaults from './constants/defaults.js';
import Package from './constants/package.js';
import Defaults from './globals/defaults.js';
import Package from './globals/package.js';
import CandidateArchiveFileHasher from './modules/candidateArchiveFileHasher.js';
import CandidateCombiner from './modules/candidateCombiner.js';
import CandidateGenerator from './modules/candidateGenerator.js';
Expand Down
4 changes: 2 additions & 2 deletions src/modules/argumentsParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import fs from 'node:fs';
import yargs, { Argv } from 'yargs';

import Logger from '../console/logger.js';
import Defaults from '../constants/defaults.js';
import Package from '../constants/package.js';
import Defaults from '../globals/defaults.js';
import Package from '../globals/package.js';
import ArrayPoly from '../polyfill/arrayPoly.js';
import ConsolePoly from '../polyfill/consolePoly.js';
import { ChecksumBitmask } from '../types/files/fileChecksums.js';
Expand Down
2 changes: 1 addition & 1 deletion src/modules/candidateWriter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import path from 'node:path';
import { Semaphore } from 'async-mutex';

import ProgressBar, { ProgressBarSymbol } from '../console/progressBar.js';
import Defaults from '../constants/defaults.js';
import ElasticSemaphore from '../elasticSemaphore.js';
import Defaults from '../globals/defaults.js';
import ArrayPoly from '../polyfill/arrayPoly.js';
import fsPoly from '../polyfill/fsPoly.js';
import DAT from '../types/dats/dat.js';
Expand Down
2 changes: 1 addition & 1 deletion src/modules/datCombiner.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import moment from 'moment';

import ProgressBar from '../console/progressBar.js';
import Package from '../constants/package.js';
import Package from '../globals/package.js';
import DAT from '../types/dats/dat.js';
import Header from '../types/dats/logiqx/header.js';
import LogiqxDAT from '../types/dats/logiqx/logiqxDat.js';
Expand Down
2 changes: 1 addition & 1 deletion src/modules/datGameInferrer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import path from 'node:path';
import moment from 'moment';

import ProgressBar from '../console/progressBar.js';
import Package from '../constants/package.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';
Expand Down
2 changes: 1 addition & 1 deletion src/modules/directoryCleaner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { isNotJunk } from 'junk';
import trash from 'trash';

import ProgressBar, { ProgressBarSymbol } from '../console/progressBar.js';
import Defaults from '../constants/defaults.js';
import Defaults from '../globals/defaults.js';
import ArrayPoly from '../polyfill/arrayPoly.js';
import fsPoly from '../polyfill/fsPoly.js';
import File from '../types/files/file.js';
Expand Down
2 changes: 1 addition & 1 deletion src/modules/fixdatCreator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import path from 'node:path';
import moment from 'moment';

import ProgressBar, { ProgressBarSymbol } from '../console/progressBar.js';
import Package from '../constants/package.js';
import Package from '../globals/package.js';
import fsPoly from '../polyfill/fsPoly.js';
import DAT from '../types/dats/dat.js';
import Header from '../types/dats/logiqx/header.js';
Expand Down
2 changes: 1 addition & 1 deletion src/modules/scanner.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ProgressBar from '../console/progressBar.js';
import Defaults from '../constants/defaults.js';
import DriveSemaphore from '../driveSemaphore.js';
import ElasticSemaphore from '../elasticSemaphore.js';
import Defaults from '../globals/defaults.js';
import ArrayPoly from '../polyfill/arrayPoly.js';
import fsPoly from '../polyfill/fsPoly.js';
import File from '../types/files/file.js';
Expand Down
2 changes: 1 addition & 1 deletion src/modules/updateChecker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import semver from 'semver';
import Logger from '../console/logger.js';
import LogLevel from '../console/logLevel.js';
import ProgressBarCLI from '../console/progressBarCli.js';
import Package from '../constants/package.js';
import Package from '../globals/package.js';
import BufferPoly from '../polyfill/bufferPoly.js';

/**
Expand Down
2 changes: 1 addition & 1 deletion src/polyfill/filePoly.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs, { OpenMode, PathLike } from 'node:fs';
import { FileHandle } from 'node:fs/promises';

import Defaults from '../constants/defaults.js';
import Defaults from '../globals/defaults.js';
import fsPoly from './fsPoly.js';

export default class FilePoly {
Expand Down
2 changes: 1 addition & 1 deletion src/types/files/archives/archive.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'node:path';
import { Readable } from 'node:stream';

import Defaults from '../../../constants/defaults.js';
import Defaults from '../../../globals/defaults.js';
import fsPoly from '../../../polyfill/fsPoly.js';
import File from '../file.js';
import ArchiveEntry from './archiveEntry.js';
Expand Down
2 changes: 1 addition & 1 deletion src/types/files/archives/archiveEntry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
Exclude, Expose, instanceToPlain, plainToClassFromExist,
} from 'class-transformer';

import Defaults from '../../../constants/defaults.js';
import Defaults from '../../../globals/defaults.js';
import fsPoly from '../../../polyfill/fsPoly.js';
import Patch from '../../patches/patch.js';
import File, { FileProps } from '../file.js';
Expand Down
2 changes: 1 addition & 1 deletion src/types/files/archives/rar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import async, { AsyncResultCallback } from 'async';
import { Mutex } from 'async-mutex';
import unrar from 'node-unrar-js';

import Defaults from '../../../constants/defaults.js';
import Defaults from '../../../globals/defaults.js';
import Archive from './archive.js';
import ArchiveEntry from './archiveEntry.js';

Expand Down
2 changes: 1 addition & 1 deletion src/types/files/archives/sevenZip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import _7z, { Result } from '7zip-min';
import async, { AsyncResultCallback } from 'async';
import { Mutex } from 'async-mutex';

import Defaults from '../../../constants/defaults.js';
import Defaults from '../../../globals/defaults.js';
import fsPoly from '../../../polyfill/fsPoly.js';
import Archive from './archive.js';
import ArchiveEntry from './archiveEntry.js';
Expand Down
2 changes: 1 addition & 1 deletion src/types/files/archives/tar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import path from 'node:path';

import tar from 'tar';

import Defaults from '../../../constants/defaults.js';
import Defaults from '../../../globals/defaults.js';
import FsPoly from '../../../polyfill/fsPoly.js';
import FileChecksums from '../fileChecksums.js';
import Archive from './archive.js';
Expand Down
2 changes: 1 addition & 1 deletion src/types/files/archives/zip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import archiver, { Archiver } from 'archiver';
import async, { AsyncResultCallback } from 'async';
import unzipper, { Entry } from 'unzipper';

import Defaults from '../../../constants/defaults.js';
import Defaults from '../../../globals/defaults.js';
import fsPoly from '../../../polyfill/fsPoly.js';
import StreamPoly from '../../../polyfill/streamPoly.js';
import File from '../file.js';
Expand Down
2 changes: 1 addition & 1 deletion src/types/files/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
Exclude, Expose, instanceToPlain, plainToClassFromExist,
} from 'class-transformer';

import Defaults from '../../constants/defaults.js';
import Defaults from '../../globals/defaults.js';
import FilePoly from '../../polyfill/filePoly.js';
import fsPoly from '../../polyfill/fsPoly.js';
import URLPoly from '../../polyfill/urlPoly.js';
Expand Down
2 changes: 1 addition & 1 deletion src/types/files/fileCache.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Defaults from '../../constants/defaults.js';
import Defaults from '../../globals/defaults.js';
import FsPoly from '../../polyfill/fsPoly.js';
import Timer from '../../timer.js';
import Cache from '../cache.js';
Expand Down
2 changes: 1 addition & 1 deletion src/types/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import micromatch from 'micromatch';
import moment from 'moment';

import LogLevel from '../console/logLevel.js';
import Defaults from '../constants/defaults.js';
import Defaults from '../globals/defaults.js';
import ArrayPoly from '../polyfill/arrayPoly.js';
import fsPoly, { FsWalkCallback } from '../polyfill/fsPoly.js';
import URLPoly from '../polyfill/urlPoly.js';
Expand Down
2 changes: 1 addition & 1 deletion test/igir.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import path from 'node:path';

import Logger from '../src/console/logger.js';
import LogLevel from '../src/console/logLevel.js';
import Defaults from '../src/constants/defaults.js';
import Defaults from '../src/globals/defaults.js';
import Igir from '../src/igir.js';
import ArrayPoly from '../src/polyfill/arrayPoly.js';
import fsPoly from '../src/polyfill/fsPoly.js';
Expand Down
2 changes: 1 addition & 1 deletion test/modules/argumentsParser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import path from 'node:path';

import Logger from '../../src/console/logger.js';
import LogLevel from '../../src/console/logLevel.js';
import Defaults from '../../src/constants/defaults.js';
import Defaults from '../../src/globals/defaults.js';
import ArgumentsParser from '../../src/modules/argumentsParser.js';
import FsPoly from '../../src/polyfill/fsPoly.js';
import Header from '../../src/types/dats/logiqx/header.js';
Expand Down
2 changes: 1 addition & 1 deletion test/modules/candidateWriter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import fs, { Stats } from 'node:fs';
import os from 'node:os';
import path from 'node:path';

import Defaults from '../../src/constants/defaults.js';
import Defaults from '../../src/globals/defaults.js';
import CandidateCombiner from '../../src/modules/candidateCombiner.js';
import CandidateGenerator from '../../src/modules/candidateGenerator.js';
import CandidatePatchGenerator from '../../src/modules/candidatePatchGenerator.js';
Expand Down
2 changes: 1 addition & 1 deletion test/modules/directoryCleaner.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'node:path';

import Defaults from '../../src/constants/defaults.js';
import Defaults from '../../src/globals/defaults.js';
import DirectoryCleaner from '../../src/modules/directoryCleaner.js';
import fsPoly from '../../src/polyfill/fsPoly.js';
import File from '../../src/types/files/file.js';
Expand Down
2 changes: 1 addition & 1 deletion test/modules/patchScanner.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os from 'node:os';
import path from 'node:path';

import Defaults from '../../src/constants/defaults.js';
import Defaults from '../../src/globals/defaults.js';
import PatchScanner from '../../src/modules/patchScanner.js';
import fsPoly from '../../src/polyfill/fsPoly.js';
import FileFactory from '../../src/types/files/fileFactory.js';
Expand Down
2 changes: 1 addition & 1 deletion test/modules/reportGenerator.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from 'node:fs';
import path from 'node:path';

import Defaults from '../../src/constants/defaults.js';
import Defaults from '../../src/globals/defaults.js';
import ReportGenerator from '../../src/modules/reportGenerator.js';
import fsPoly from '../../src/polyfill/fsPoly.js';
import Game from '../../src/types/dats/game.js';
Expand Down
2 changes: 1 addition & 1 deletion test/modules/romHeaderProcessor.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'node:path';

import Defaults from '../../src/constants/defaults.js';
import Defaults from '../../src/globals/defaults.js';
import ROMHeaderProcessor from '../../src/modules/romHeaderProcessor.js';
import ROMScanner from '../../src/modules/romScanner.js';
import FsPoly from '../../src/polyfill/fsPoly.js';
Expand Down
2 changes: 1 addition & 1 deletion test/modules/romScanner.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os from 'node:os';
import path from 'node:path';

import Defaults from '../../src/constants/defaults.js';
import Defaults from '../../src/globals/defaults.js';
import ROMScanner from '../../src/modules/romScanner.js';
import fsPoly from '../../src/polyfill/fsPoly.js';
import Options from '../../src/types/options.js';
Expand Down
2 changes: 1 addition & 1 deletion test/outputFactory.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os from 'node:os';
import path from 'node:path';

import Defaults from '../src/constants/defaults.js';
import Defaults from '../src/globals/defaults.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';
Expand Down
2 changes: 1 addition & 1 deletion test/polyfill/filePoly.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from 'node:fs';
import path from 'node:path';

import Defaults from '../../src/constants/defaults.js';
import Defaults from '../../src/globals/defaults.js';
import filePoly from '../../src/polyfill/filePoly.js';
import fsPoly from '../../src/polyfill/fsPoly.js';

Expand Down
2 changes: 1 addition & 1 deletion test/polyfill/fsPoly.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os from 'node:os';
import path from 'node:path';

import Defaults from '../../src/constants/defaults.js';
import Defaults from '../../src/globals/defaults.js';
import fsPoly from '../../src/polyfill/fsPoly.js';

describe('canSymlink', () => {
Expand Down
2 changes: 1 addition & 1 deletion test/types/cache.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'node:path';

import Defaults from '../../src/constants/defaults.js';
import Defaults from '../../src/globals/defaults.js';
import FsPoly from '../../src/polyfill/fsPoly.js';
import Cache from '../../src/types/cache.js';

Expand Down
2 changes: 1 addition & 1 deletion test/types/files/archives/archive.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'node:path';

import Defaults from '../../../../src/constants/defaults.js';
import Defaults from '../../../../src/globals/defaults.js';
import fsPoly from '../../../../src/polyfill/fsPoly.js';
import Archive from '../../../../src/types/files/archives/archive.js';
import ArchiveEntry from '../../../../src/types/files/archives/archiveEntry.js';
Expand Down
2 changes: 1 addition & 1 deletion test/types/files/archives/archiveEntry.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'node:path';

import Defaults from '../../../../src/constants/defaults.js';
import Defaults from '../../../../src/globals/defaults.js';
import ROMScanner from '../../../../src/modules/romScanner.js';
import ArrayPoly from '../../../../src/polyfill/arrayPoly.js';
import bufferPoly from '../../../../src/polyfill/bufferPoly.js';
Expand Down
2 changes: 1 addition & 1 deletion test/types/files/archives/zip.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'node:path';

import Defaults from '../../../../src/constants/defaults.js';
import Defaults from '../../../../src/globals/defaults.js';
import ROMScanner from '../../../../src/modules/romScanner.js';
import fsPoly from '../../../../src/polyfill/fsPoly.js';
import ArchiveEntry from '../../../../src/types/files/archives/archiveEntry.js';
Expand Down
2 changes: 1 addition & 1 deletion test/types/files/file.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'node:path';

import Defaults from '../../../src/constants/defaults.js';
import Defaults from '../../../src/globals/defaults.js';
import ROMScanner from '../../../src/modules/romScanner.js';
import bufferPoly from '../../../src/polyfill/bufferPoly.js';
import FilePoly from '../../../src/polyfill/filePoly.js';
Expand Down
2 changes: 1 addition & 1 deletion test/types/files/fileCache.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'node:path';

import Defaults from '../../../src/constants/defaults.js';
import Defaults from '../../../src/globals/defaults.js';
import FsPoly from '../../../src/polyfill/fsPoly.js';
import Zip from '../../../src/types/files/archives/zip.js';
import FileCache from '../../../src/types/files/fileCache.js';
Expand Down
2 changes: 1 addition & 1 deletion test/types/files/fileFactory.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import path from 'node:path';

import Defaults from '../../../src/constants/defaults.js';
import Defaults from '../../../src/globals/defaults.js';
import FsPoly from '../../../src/polyfill/fsPoly.js';
import ArchiveEntry from '../../../src/types/files/archives/archiveEntry.js';
import FileFactory from '../../../src/types/files/fileFactory.js';
Expand Down
2 changes: 1 addition & 1 deletion test/types/patches/apsGbaPatch.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from 'node:fs';
import path from 'node:path';

import Defaults from '../../../src/constants/defaults.js';
import Defaults from '../../../src/globals/defaults.js';
import bufferPoly from '../../../src/polyfill/bufferPoly.js';
import fsPoly from '../../../src/polyfill/fsPoly.js';
import File from '../../../src/types/files/file.js';
Expand Down
2 changes: 1 addition & 1 deletion test/types/patches/apsN64Patch.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from 'node:fs';
import path from 'node:path';

import Defaults from '../../../src/constants/defaults.js';
import Defaults from '../../../src/globals/defaults.js';
import bufferPoly from '../../../src/polyfill/bufferPoly.js';
import fsPoly from '../../../src/polyfill/fsPoly.js';
import File from '../../../src/types/files/file.js';
Expand Down
Loading

0 comments on commit eca2260

Please sign in to comment.