From a3d0f4364ff17e2b7d0330587f45d70a286cb239 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erdem=20K=C3=B6=C5=9Fk?= Date: Mon, 11 Dec 2023 00:50:28 +0300 Subject: [PATCH] [refactor] Change file structure --- bin/index.ts | 4 ++-- lib/command/{Command.ts => command.ts} | 0 lib/command/commandFactory.ts | 16 ++++++++-------- .../{CommandInvoker.ts => commandInvoker.ts} | 2 +- .../{CompareCommand.ts => compareCommand.ts} | 2 +- .../commandTypes/{LsCommand.ts => lsCommand.ts} | 2 +- .../{RestoreCommand.ts => restoreCommand.ts} | 2 +- .../{RevertCommand.ts => revertCommand.ts} | 2 +- .../{SyncCommand.ts => syncCommand.ts} | 2 +- .../{UpdateAllCommand.ts => updateAllCommand.ts} | 2 +- .../{UpdateCommand.ts => updateCommand.ts} | 2 +- 11 files changed, 18 insertions(+), 18 deletions(-) rename lib/command/{Command.ts => command.ts} (100%) rename lib/command/{CommandInvoker.ts => commandInvoker.ts} (83%) rename lib/command/commandTypes/{CompareCommand.ts => compareCommand.ts} (98%) rename lib/command/commandTypes/{LsCommand.ts => lsCommand.ts} (97%) rename lib/command/commandTypes/{RestoreCommand.ts => restoreCommand.ts} (95%) rename lib/command/commandTypes/{RevertCommand.ts => revertCommand.ts} (98%) rename lib/command/commandTypes/{SyncCommand.ts => syncCommand.ts} (95%) rename lib/command/commandTypes/{UpdateAllCommand.ts => updateAllCommand.ts} (97%) rename lib/command/commandTypes/{UpdateCommand.ts => updateCommand.ts} (97%) diff --git a/bin/index.ts b/bin/index.ts index ca7be00..7a9022c 100755 --- a/bin/index.ts +++ b/bin/index.ts @@ -6,8 +6,8 @@ import packages from '../package.json' import CommandFactory from '../lib/command/commandFactory' -import type Command from '../lib/command/Command' -import CommandInvoker from '../lib/command/CommandInvoker' +import type Command from '../lib/command/command' +import CommandInvoker from '../lib/command/commandInvoker' import { CommandTypes } from '../lib/const' const program = new CommanderCommand() diff --git a/lib/command/Command.ts b/lib/command/command.ts similarity index 100% rename from lib/command/Command.ts rename to lib/command/command.ts diff --git a/lib/command/commandFactory.ts b/lib/command/commandFactory.ts index ffa3788..a7ddfb6 100644 --- a/lib/command/commandFactory.ts +++ b/lib/command/commandFactory.ts @@ -1,12 +1,12 @@ import { CommandTypes } from '../const' -import type Command from './Command' -import CompareCommand from './commandTypes/CompareCommand' -import LsCommand from './commandTypes/LsCommand' -import RestoreCommand from './commandTypes/RestoreCommand' -import RevertCommand from './commandTypes/RevertCommand' -import SyncCommand from './commandTypes/SyncCommand' -import UpdateAllCommand from './commandTypes/UpdateAllCommand' -import UpdateCommand from './commandTypes/UpdateCommand' +import type Command from './command' +import CompareCommand from './commandTypes/compareCommand' +import LsCommand from './commandTypes/lsCommand' +import RestoreCommand from './commandTypes/restoreCommand' +import RevertCommand from './commandTypes/revertCommand' +import SyncCommand from './commandTypes/syncCommand' +import UpdateAllCommand from './commandTypes/updateAllCommand' +import UpdateCommand from './commandTypes/updateCommand' export default class CommandFactory { createCommand (commandType: number): Command | null { diff --git a/lib/command/CommandInvoker.ts b/lib/command/commandInvoker.ts similarity index 83% rename from lib/command/CommandInvoker.ts rename to lib/command/commandInvoker.ts index 7e77957..581b3ab 100644 --- a/lib/command/CommandInvoker.ts +++ b/lib/command/commandInvoker.ts @@ -1,4 +1,4 @@ -import type Command from './Command' +import type Command from './command' // eslint-disable-next-line @typescript-eslint/no-extraneous-class export default class CommandInvoker { diff --git a/lib/command/commandTypes/CompareCommand.ts b/lib/command/commandTypes/compareCommand.ts similarity index 98% rename from lib/command/commandTypes/CompareCommand.ts rename to lib/command/commandTypes/compareCommand.ts index 648d814..f3d7185 100644 --- a/lib/command/commandTypes/CompareCommand.ts +++ b/lib/command/commandTypes/compareCommand.ts @@ -1,4 +1,4 @@ -import Command from '../Command' +import Command from '../command' import { compareEnvFiles } from '../../handler/envHandler' import { getEnvFilesRecursively } from '../../handler/fileHandler' import Table from 'cli-table3' diff --git a/lib/command/commandTypes/LsCommand.ts b/lib/command/commandTypes/lsCommand.ts similarity index 97% rename from lib/command/commandTypes/LsCommand.ts rename to lib/command/commandTypes/lsCommand.ts index cb1a1f5..6e4481f 100644 --- a/lib/command/commandTypes/LsCommand.ts +++ b/lib/command/commandTypes/lsCommand.ts @@ -1,4 +1,4 @@ -import Command from '../Command' +import Command from '../command' import { getValuesInEnv } from '../../handler/envHandler' import { getEnvFilesRecursively } from '../../handler/fileHandler' import Table from 'cli-table3' diff --git a/lib/command/commandTypes/RestoreCommand.ts b/lib/command/commandTypes/restoreCommand.ts similarity index 95% rename from lib/command/commandTypes/RestoreCommand.ts rename to lib/command/commandTypes/restoreCommand.ts index d07ee21..ed2ca84 100644 --- a/lib/command/commandTypes/RestoreCommand.ts +++ b/lib/command/commandTypes/restoreCommand.ts @@ -1,4 +1,4 @@ -import Command from '../Command' +import Command from '../command' import { restoreEnvFile } from '../../handler/envHandler' import chalk from 'chalk' import { consola } from 'consola' diff --git a/lib/command/commandTypes/RevertCommand.ts b/lib/command/commandTypes/revertCommand.ts similarity index 98% rename from lib/command/commandTypes/RevertCommand.ts rename to lib/command/commandTypes/revertCommand.ts index 781ab52..3b9bddc 100644 --- a/lib/command/commandTypes/RevertCommand.ts +++ b/lib/command/commandTypes/revertCommand.ts @@ -1,4 +1,4 @@ -import Command from '../Command' +import Command from '../command' import { updateEnvFile, getUniqueEnvNames } from '../../handler/envHandler' import { getEnvFilesRecursively } from '../../handler/fileHandler' import { getEnvVersions } from '../../handler/historyHandler' diff --git a/lib/command/commandTypes/SyncCommand.ts b/lib/command/commandTypes/syncCommand.ts similarity index 95% rename from lib/command/commandTypes/SyncCommand.ts rename to lib/command/commandTypes/syncCommand.ts index 3331498..ee24333 100644 --- a/lib/command/commandTypes/SyncCommand.ts +++ b/lib/command/commandTypes/syncCommand.ts @@ -1,4 +1,4 @@ -import Command from '../Command' +import Command from '../command' import { syncEnvFile } from '../../handler/envHandler' import chalk from 'chalk' import { consola } from 'consola' diff --git a/lib/command/commandTypes/UpdateAllCommand.ts b/lib/command/commandTypes/updateAllCommand.ts similarity index 97% rename from lib/command/commandTypes/UpdateAllCommand.ts rename to lib/command/commandTypes/updateAllCommand.ts index 8c65f5e..c4ef8b3 100644 --- a/lib/command/commandTypes/UpdateAllCommand.ts +++ b/lib/command/commandTypes/updateAllCommand.ts @@ -1,4 +1,4 @@ -import Command from '../Command' +import Command from '../command' import { updateAllEnvFile, promptForEnvVariable } from '../../handler/envHandler' import chalk from 'chalk' import inquirer from 'inquirer' diff --git a/lib/command/commandTypes/UpdateCommand.ts b/lib/command/commandTypes/updateCommand.ts similarity index 97% rename from lib/command/commandTypes/UpdateCommand.ts rename to lib/command/commandTypes/updateCommand.ts index e88580e..9d954ff 100644 --- a/lib/command/commandTypes/UpdateCommand.ts +++ b/lib/command/commandTypes/updateCommand.ts @@ -1,4 +1,4 @@ -import Command from '../Command' +import Command from '../command' import { getUniqueEnvNames, updateEnvFile } from '../../handler/envHandler' import { getEnvFilesRecursively } from '../../handler/fileHandler' import chalk from 'chalk'