diff --git a/package.json b/package.json index 0434a808..a364c154 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "devDependencies": { "@arkweid/lefthook": "^0.7.7", "@types/jest": "^28.1.6", - "@types/node": "^18.6.4", + "@types/node": "^18.7.13", "@types/semver": "^7.3.9", "@typescript-eslint/parser": "5.32.0", "@vercel/ncc": "^0.33.3", diff --git a/src/commands/command/unity/build-command.ts b/src/command/build/unity-build-command.ts similarity index 77% rename from src/commands/command/unity/build-command.ts rename to src/command/build/unity-build-command.ts index 06d46051..2a7090a4 100644 --- a/src/commands/command/unity/build-command.ts +++ b/src/command/build/unity-build-command.ts @@ -1,10 +1,10 @@ import { CommandInterface } from '../command-interface.ts'; -import { Action, Cache, Docker, ImageTag, Input, Output } from '../../../model/index.ts'; -import PlatformSetup from '../../../model/platform-setup.ts'; -import MacBuilder from '../../../model/mac-builder.ts'; -import { CommandBase } from './command-base.ts'; +import { Action, Cache, Docker, ImageTag, Input, Output } from '../../model/index.ts'; +import PlatformSetup from '../../model/platform-setup.ts'; +import MacBuilder from '../../model/mac-builder.ts'; +import { CommandBase } from '../command-base.ts'; -export class BuildCommand extends CommandBase implements CommandInterface { +export class UnityBuildCommand extends CommandBase implements CommandInterface { public async validate() { await super.validate(); } diff --git a/src/commands/command/unity/command-base.ts b/src/command/command-base.ts similarity index 76% rename from src/commands/command/unity/command-base.ts rename to src/command/command-base.ts index e4095812..841201bb 100644 --- a/src/commands/command/unity/command-base.ts +++ b/src/command/command-base.ts @@ -1,6 +1,6 @@ -import { Options } from '../../../config/options.ts'; -import { Input } from '../../../model/index.ts'; -import Parameters from '../../../model/parameters.ts'; +import { Options } from '../config/options.ts'; +import { Input } from '../model/index.ts'; +import Parameters from '../model/parameters.ts'; export class CommandBase { public readonly name: string; diff --git a/src/commands/command-factory.ts b/src/command/command-factory.ts similarity index 63% rename from src/commands/command-factory.ts rename to src/command/command-factory.ts index 1991de39..846c32d2 100644 --- a/src/commands/command-factory.ts +++ b/src/command/command-factory.ts @@ -1,7 +1,7 @@ -import { NonExistentCommand } from './command/non-existent-command.ts'; -import { BuildCommand } from './command/unity/build-command.ts'; -import { BuildRemoteCommand } from './command/unity/build-remote-command.ts'; -import { CommandInterface } from './command/command-interface.ts'; +import { NonExistentCommand } from './null/non-existent-command.ts'; +import { UnityBuildCommand } from './build/unity-build-command.ts'; +import { CommandInterface } from './command-interface.ts'; +import { UnityRemoteBuildCommand } from './remote/unity-remote-build-command.ts'; export class CommandFactory { constructor() {} @@ -25,9 +25,9 @@ export class CommandFactory { private createUnityCommand(commandName: string) { switch (commandName) { case 'build': - return new BuildCommand(commandName); + return new UnityBuildCommand(commandName); case 'build-remote': - return new BuildRemoteCommand(commandName); + return new UnityRemoteBuildCommand(commandName); default: return new NonExistentCommand(commandName); } diff --git a/src/commands/command/command-interface.ts b/src/command/command-interface.ts similarity index 63% rename from src/commands/command/command-interface.ts rename to src/command/command-interface.ts index 7d7c6c20..3edf98fa 100644 --- a/src/commands/command/command-interface.ts +++ b/src/command/command-interface.ts @@ -1,6 +1,6 @@ -import { Options } from '../../config/options.ts'; -import Parameters from '../../model/parameters.ts'; -import { Input } from '../../model/index.ts'; +import { Options } from '../config/options.ts'; +import Parameters from '../model/parameters.ts'; +import { Input } from '../model/index.ts'; export interface CommandInterface { name: string; diff --git a/src/commands/command/non-existent-command.ts b/src/command/null/non-existent-command.ts similarity index 85% rename from src/commands/command/non-existent-command.ts rename to src/command/null/non-existent-command.ts index ea3bee45..d69244fd 100644 --- a/src/commands/command/non-existent-command.ts +++ b/src/command/null/non-existent-command.ts @@ -1,4 +1,4 @@ -import { CommandInterface } from './command-interface.ts'; +import { CommandInterface } from '../command-interface.ts'; import { Options } from '../../config/options.ts'; export class NonExistentCommand implements CommandInterface { diff --git a/src/commands/command/unity/build-remote-command.ts b/src/command/remote/unity-remote-build-command.ts similarity index 75% rename from src/commands/command/unity/build-remote-command.ts rename to src/command/remote/unity-remote-build-command.ts index b702a363..5ef65cb1 100644 --- a/src/commands/command/unity/build-remote-command.ts +++ b/src/command/remote/unity-remote-build-command.ts @@ -1,17 +1,17 @@ import { CommandInterface } from '../command-interface.ts'; -import { Options } from '../../../config/options.ts'; -import { CloudRunner, ImageTag, Input, Output } from '../../../model/index.ts'; -import { core, nanoid } from '../../../dependencies.ts'; -import Parameters from '../../../model/parameters.ts'; -import { GitRepoReader } from '../../../model/input-readers/git-repo.ts'; -import { Cli } from '../../../model/cli/cli.ts'; -import CloudRunnerConstants from '../../../model/cloud-runner/services/cloud-runner-constants.ts'; -import CloudRunnerBuildGuid from '../../../model/cloud-runner/services/cloud-runner-guid.ts'; -import { GithubCliReader } from '../../../model/input-readers/github-cli.ts'; -import { CommandBase } from './command-base.ts'; +import { Options } from '../../config/options.ts'; +import { CloudRunner, ImageTag, Input, Output } from '../../model/index.ts'; +import { core, nanoid } from '../../dependencies.ts'; +import Parameters from '../../model/parameters.ts'; +import { GitRepoReader } from '../../model/input-readers/git-repo.ts'; +import { Cli } from '../../model/cli/cli.ts'; +import CloudRunnerConstants from '../../model/cloud-runner/services/cloud-runner-constants.ts'; +import CloudRunnerBuildGuid from '../../model/cloud-runner/services/cloud-runner-guid.ts'; +import { GithubCliReader } from '../../model/input-readers/github-cli.ts'; +import { CommandBase } from '../command-base.ts'; // Todo - Verify this entire flow -export class BuildRemoteCommand extends CommandBase implements CommandInterface { +export class UnityRemoteBuildCommand extends CommandBase implements CommandInterface { public async validate() { await super.validate(); } diff --git a/src/config/options.ts b/src/config/options.ts index 1ebe0e0b..cef90ca8 100644 --- a/src/config/options.ts +++ b/src/config/options.ts @@ -1,6 +1,6 @@ import { CliArguments } from '../core/cli/cli-arguments.ts'; import { Parameters, Input } from '../model/index.ts'; -import { CommandInterface } from '../commands/command/command-interface.ts'; +import { CommandInterface } from '../command/command-interface.ts'; import { Environment } from '../core/env/environment.ts'; export class Options { diff --git a/src/dependencies.ts b/src/dependencies.ts index 398d81b0..e68c5bbd 100644 --- a/src/dependencies.ts +++ b/src/dependencies.ts @@ -22,9 +22,9 @@ import { Buffer } from 'https://deno.land/std@0.151.0/io/buffer.ts'; import { config, configSync } from 'https://deno.land/std@0.151.0/dotenv/mod.ts'; // Internally managed packages -import waitUntil from './modules/wait-until.ts'; -import { core } from './modules/actions/index.ts'; -import { dedent } from './modules/dedent.ts'; +import waitUntil from './module/wait-until.ts'; +import { core } from './module/actions/index.ts'; +import { dedent } from './module/dedent.ts'; // Polyfill for https://github.com/tc39/proposal-string-dedent String.dedent = dedent; diff --git a/src/index.ts b/src/index.ts index 12ab1167..ee645e24 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,11 +1,10 @@ import { configSync } from './dependencies.ts'; import { configureLogger } from './core/logger/index.ts'; import { Options } from './config/options.ts'; -import { CommandFactory } from './commands/command-factory.ts'; +import { CommandFactory } from './command/command-factory.ts'; import { ArgumentsParser } from './core/cli/arguments-parser.ts'; import { Environment } from './core/env/environment.ts'; import { EngineDetector } from './core/engine/engine-detector.ts'; -import { ParameterOptions } from './model/parameter-options.ts'; export class GameCI { private readonly env: Environment; diff --git a/src/model/parameters.ts b/src/model/parameters.ts index 5f8cfc0f..1c21b2b2 100644 --- a/src/model/parameters.ts +++ b/src/model/parameters.ts @@ -5,7 +5,7 @@ import Platform from './platform.ts'; import UnityVersioning from './unity-versioning.ts'; import Versioning from './versioning.ts'; import { GitRepoReader } from './input-readers/git-repo.ts'; -import { CommandInterface } from '../commands/command/command-interface.ts'; +import { CommandInterface } from '../command/command-interface.ts'; import { Environment } from '../core/env/environment.ts'; import { Parameter } from './parameter.ts'; @@ -168,7 +168,7 @@ class Parameters { return filename; } - static getUnitySerial() { + private getUnitySerial() { let unitySerial = this.get('unitySerial'); if (!unitySerial && this.env.getOS() === 'windows') { @@ -180,7 +180,7 @@ class Parameters { return unitySerial; } - static getSerialFromLicense(license) { + private getSerialFromLicense(license) { if (!license) { throw new Error(String.dedent` Missing Unity License File and no Unity Serial was found. If this is a personal license, diff --git a/src/modules/actions/core.ts b/src/module/actions/core.ts similarity index 100% rename from src/modules/actions/core.ts rename to src/module/actions/core.ts diff --git a/src/modules/actions/index.ts b/src/module/actions/index.ts similarity index 100% rename from src/modules/actions/index.ts rename to src/module/actions/index.ts diff --git a/src/modules/dedent.ts b/src/module/dedent.ts similarity index 100% rename from src/modules/dedent.ts rename to src/module/dedent.ts diff --git a/src/modules/wait-until.ts b/src/module/wait-until.ts similarity index 100% rename from src/modules/wait-until.ts rename to src/module/wait-until.ts diff --git a/yarn.lock b/yarn.lock index 55cca640..698a4d11 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1254,10 +1254,10 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.60.tgz#35f3d6213daed95da7f0f73e75bcc6980e90597b" integrity sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw== -"@types/node@^18.6.4": - version "18.6.4" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.6.4.tgz#fd26723a8a3f8f46729812a7f9b4fc2d1608ed39" - integrity sha512-I4BD3L+6AWiUobfxZ49DlU43gtI+FTHSv9pE2Zekg6KjMpre4ByusaljW3vYSLJrvQ1ck1hUaeVu8HVlY3vzHg== +"@types/node@^18.7.13": + version "18.7.13" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.13.tgz#23e6c5168333480d454243378b69e861ab5c011a" + integrity sha512-46yIhxSe5xEaJZXWdIBP7GU4HDTG8/eo0qd9atdiL+lFpA03y8KS+lkTN834TWJj5767GbWv4n/P6efyTFt1Dw== "@types/normalize-package-data@^2.4.0": version "2.4.0"