Skip to content

Commit

Permalink
refactor(cli): rename files
Browse files Browse the repository at this point in the history
  • Loading branch information
juanrgm committed Dec 13, 2023
1 parent 78a4b88 commit 38a3b2e
Show file tree
Hide file tree
Showing 45 changed files with 93 additions and 93 deletions.
6 changes: 3 additions & 3 deletions packages/cli/src/Config/PackageRepositoryConfig.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import {
DatatruckPackageRepositoryConfig,
datatruckRepositoryName,
} from "../Repository/DatatruckRepository";
} from "../repositories/DatatruckRepository";
import {
GitPackageRepositoryConfig,
gitRepositoryName,
} from "../Repository/GitRepository";
} from "../repositories/GitRepository";
import {
ResticPackageRepositoryConfig,
resticRepositoryName,
} from "../Repository/ResticRepository";
} from "../repositories/ResticRepository";

export type PackageRepositoryConfig = {
names?: string[];
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/Config/PrunePolicyConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PruneActionsOptions } from "../Action/PruneAction";
import { PruneActionsOptions } from "../actions/PruneAction";

export type PrunePolicyConfig = Pick<
PruneActionsOptions,
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/Config/RepositoryConfig.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import {
DatatruckRepositoryConfig,
datatruckRepositoryName,
} from "../Repository/DatatruckRepository";
} from "../repositories/DatatruckRepository";
import {
GitRepositoryConfig,
gitRepositoryName,
} from "../Repository/GitRepository";
} from "../repositories/GitRepository";
import {
ResticRepositoryConfig,
resticRepositoryName,
} from "../Repository/ResticRepository";
} from "../repositories/ResticRepository";

export type RepositoryConfigType = RepositoryConfig["type"];

Expand Down
12 changes: 6 additions & 6 deletions packages/cli/src/Config/TaskConfig.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { GitTaskConfig, gitTaskName } from "../Task/GitTask";
import { MariadbTaskConfig, mariadbTaskName } from "../Task/MariadbTask";
import { MssqlTaskConfig, mssqlTaskName } from "../Task/MssqlTask";
import { MysqlDumpTaskConfig, mysqlDumpTaskName } from "../Task/MysqlDumpTask";
import { GitTaskConfig, gitTaskName } from "../tasks/GitTask";
import { MariadbTaskConfig, mariadbTaskName } from "../tasks/MariadbTask";
import { MssqlTaskConfig, mssqlTaskName } from "../tasks/MssqlTask";
import { MysqlDumpTaskConfig, mysqlDumpTaskName } from "../tasks/MysqlDumpTask";
import {
PostgresqlDumpTaskConfig,
postgresqlDumpTaskName,
} from "../Task/PostgresqlDumpTask";
import { ScriptTaskConfig, scriptTaskName } from "../Task/ScriptTask";
} from "../tasks/PostgresqlDumpTask";
import { ScriptTaskConfig, scriptTaskName } from "../tasks/ScriptTask";

export type GitTaskConfigItem = {
name: typeof gitTaskName;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Config } from "../Config/Config";
import { PackageConfig } from "../Config/PackageConfig";
import { RepositoryConfig } from "../Config/RepositoryConfig";
import { PreSnapshot } from "../Repository/RepositoryAbstract";
import { PreSnapshot } from "../repositories/RepositoryAbstract";
import { DataFormat } from "../utils/DataFormat";
import { renderError, renderObject, renderResult } from "../utils/cli";
import {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GlobalOptions } from "../Command/CommandAbstract";
import type { Config } from "../Config/Config";
import { RepositoryConfig } from "../Config/RepositoryConfig";
import { GlobalOptions } from "../commands/CommandAbstract";
import { configSchema } from "../config.schema";
import { findRepositoryOrFail } from "../utils/datatruck/config";
import { AppError } from "../utils/datatruck/error";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Config } from "../Config/Config";
import { Snapshot } from "../Repository/RepositoryAbstract";
import { Snapshot } from "../repositories/RepositoryAbstract";
import { DataFormat } from "../utils/DataFormat";
import { renderError, renderObject, renderResult } from "../utils/cli";
import {
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Config } from "../Config/Config";
import { PackageConfig } from "../Config/PackageConfig";
import { Snapshot } from "../Repository/RepositoryAbstract";
import { TaskAbstract } from "../Task/TaskAbstract";
import { Snapshot } from "../repositories/RepositoryAbstract";
import { TaskAbstract } from "../tasks/TaskAbstract";
import { DataFormat } from "../utils/DataFormat";
import { renderError, renderObject, renderResult } from "../utils/cli";
import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Config } from "../Config/Config";
import { RepositoryConfigEnabledAction } from "../Config/RepositoryConfig";
import { Snapshot } from "../Repository/RepositoryAbstract";
import { Snapshot } from "../repositories/RepositoryAbstract";
import { filterRepository } from "../utils/datatruck/config";
import { createRepo } from "../utils/datatruck/repository";
import { groupAndFilter } from "../utils/datatruck/snapshot";
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ConfigAction } from "./Action/ConfigAction";
import { GlobalOptions } from "./Command/CommandAbstract";
import { ConfigAction } from "./actions/ConfigAction";
import { GlobalOptions } from "./commands/CommandAbstract";
import globalData from "./globalData";
import { DataFormatType } from "./utils/DataFormat";
import { OptionsConfig, showCursorCommand } from "./utils/cli";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BackupAction } from "../Action/BackupAction";
import { ConfigAction } from "../Action/ConfigAction";
import { RepositoryConfig } from "../Config/RepositoryConfig";
import { BackupAction } from "../actions/BackupAction";
import { ConfigAction } from "../actions/ConfigAction";
import { parseStringList } from "../utils/string";
import { If } from "../utils/ts";
import { CommandAbstract } from "./CommandAbstract";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CleanCacheAction } from "../Action/CleanCacheAction";
import { CleanCacheAction } from "../actions/CleanCacheAction";
import { DataFormat } from "../utils/DataFormat";
import { formatBytes } from "../utils/bytes";
import { CommandAbstract } from "./CommandAbstract";
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ConfigAction } from "../Action/ConfigAction";
import { RepositoryConfig } from "../Config/RepositoryConfig";
import { ConfigAction } from "../actions/ConfigAction";
import { DataFormat } from "../utils/DataFormat";
import { filterPackages } from "../utils/datatruck/config";
import { parseStringList } from "../utils/string";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ConfigAction } from "../Action/ConfigAction";
import { CopyAction } from "../Action/CopyAction";
import { ConfigAction } from "../actions/ConfigAction";
import { CopyAction } from "../actions/CopyAction";
import { parseStringList } from "../utils/string";
import { If } from "../utils/ts";
import { CommandAbstract } from "./CommandAbstract";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ConfigAction } from "../Action/ConfigAction";
import { InitAction } from "../Action/InitAction";
import { RepositoryConfig } from "../Config/RepositoryConfig";
import { ConfigAction } from "../actions/ConfigAction";
import { InitAction } from "../actions/InitAction";
import { DataFormat } from "../utils/DataFormat";
import { renderError, renderResult } from "../utils/cli";
import { parseStringList } from "../utils/string";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ConfigAction } from "../Action/ConfigAction";
import { PruneAction } from "../Action/PruneAction";
import { SnapshotGroupByType } from "../Action/SnapshotsAction";
import { RepositoryConfig } from "../Config/RepositoryConfig";
import { ConfigAction } from "../actions/ConfigAction";
import { PruneAction } from "../actions/PruneAction";
import { SnapshotGroupByType } from "../actions/SnapshotsAction";
import { DataFormat } from "../utils/DataFormat";
import { confirm } from "../utils/cli";
import { KeepObject } from "../utils/date";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ConfigAction } from "../Action/ConfigAction";
import { RestoreAction } from "../Action/RestoreAction";
import { RepositoryConfig } from "../Config/RepositoryConfig";
import { ConfigAction } from "../actions/ConfigAction";
import { RestoreAction } from "../actions/RestoreAction";
import { parseStringList } from "../utils/string";
import { If } from "../utils/ts";
import { CommandAbstract } from "./CommandAbstract";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ConfigAction } from "../Action/ConfigAction";
import { SnapshotsAction } from "../Action/SnapshotsAction";
import { RepositoryConfig } from "../Config/RepositoryConfig";
import { ConfigAction } from "../actions/ConfigAction";
import { SnapshotsAction } from "../actions/SnapshotsAction";
import { DataFormat } from "../utils/DataFormat";
import { formatBytes } from "../utils/bytes";
import { parseStringList } from "../utils/string";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ConfigAction } from "../Action/ConfigAction";
import { ConfigAction } from "../actions/ConfigAction";
import { createCronServer } from "../utils/datatruck/cron-server";
import { createDatatruckRepositoryServer } from "../utils/datatruck/repository-server";
import { CommandAbstract } from "./CommandAbstract";
Expand Down
34 changes: 17 additions & 17 deletions packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,33 @@ export type { PackageRepositoryConfig } from "./Config/PackageRepositoryConfig";
export type { PrunePolicyConfig } from "./Config/PrunePolicyConfig";

export type { RepositoryConfig } from "./Config/RepositoryConfig";
export { type ResticRepositoryConfig } from "./Repository/ResticRepository";
export { type DatatruckRepositoryConfig } from "./Repository/DatatruckRepository";
export { type GitRepositoryConfig } from "./Repository/GitRepository";
export { type ResticRepositoryConfig } from "./repositories/ResticRepository";
export { type DatatruckRepositoryConfig } from "./repositories/DatatruckRepository";
export { type GitRepositoryConfig } from "./repositories/GitRepository";

export type { TaskConfig } from "./Config/TaskConfig";
export { type GitTaskConfig } from "./Task/GitTask";
export { type MariadbTaskConfig } from "./Task/MariadbTask";
export { type MssqlTaskConfig } from "./Task/MssqlTask";
export { type MysqlDumpTaskConfig } from "./Task/MysqlDumpTask";
export { type PostgresqlDumpTaskConfig } from "./Task/PostgresqlDumpTask";
export { type ScriptTaskConfig } from "./Task/ScriptTask";
export { type GitTaskConfig } from "./tasks/GitTask";
export { type MariadbTaskConfig } from "./tasks/MariadbTask";
export { type MssqlTaskConfig } from "./tasks/MssqlTask";
export { type MysqlDumpTaskConfig } from "./tasks/MysqlDumpTask";
export { type PostgresqlDumpTaskConfig } from "./tasks/PostgresqlDumpTask";
export { type ScriptTaskConfig } from "./tasks/ScriptTask";

export { BackupAction, type BackupActionOptions } from "./Action/BackupAction";
export { BackupAction, type BackupActionOptions } from "./actions/BackupAction";
export {
CleanCacheAction,
type CleanCacheActionOptions,
} from "./Action/CleanCacheAction";
export { ConfigAction, type ConfigActionOptions } from "./Action/ConfigAction";
export { CopyAction, type CopyActionOptions } from "./Action/CopyAction";
export { InitAction, type InitActionOptions } from "./Action/InitAction";
export { PruneAction, type PruneActionsOptions } from "./Action/PruneAction";
} from "./actions/CleanCacheAction";
export { ConfigAction, type ConfigActionOptions } from "./actions/ConfigAction";
export { CopyAction, type CopyActionOptions } from "./actions/CopyAction";
export { InitAction, type InitActionOptions } from "./actions/InitAction";
export { PruneAction, type PruneActionsOptions } from "./actions/PruneAction";
export {
RestoreAction,
type RestoreActionOptions,
} from "./Action/RestoreAction";
} from "./actions/RestoreAction";
export {
SnapshotsAction,
type SnapshotsActionOptions,
} from "./Action/SnapshotsAction";
} from "./actions/SnapshotsAction";
export { parseArgs } from "./cli";
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { BackupActionOptions } from "../Action/BackupAction";
import type { InitActionOptions } from "../Action/InitAction";
import type { RestoreActionOptions } from "../Action/RestoreAction";
import type { PackageConfig } from "../Config/PackageConfig";
import type { RepositoryConfig } from "../Config/RepositoryConfig";
import type { BackupActionOptions } from "../actions/BackupAction";
import type { InitActionOptions } from "../actions/InitAction";
import type { RestoreActionOptions } from "../actions/RestoreAction";
import type {
ExtendedSnapshot,
SnapshotsActionOptions,
} from "../Action/SnapshotsAction";
import type { PackageConfig } from "../Config/PackageConfig";
import type { RepositoryConfig } from "../Config/RepositoryConfig";
} from "../actions/SnapshotsAction";
import { ensureFreeDiskSpace, type DiskStats } from "../utils/fs";
import type { Progress } from "../utils/progress";

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PackageConfig } from "../Config/PackageConfig";
import { PreSnapshot } from "../Repository/RepositoryAbstract";
import { PreSnapshot } from "../repositories/RepositoryAbstract";
import { ProcessEnv } from "../utils/process";
import { SpawnStep, runSpawnSteps } from "../utils/spawnSteps";
import { mkTmpDir } from "../utils/temp";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BackupActionOptions } from "../Action/BackupAction";
import { RestoreActionOptions } from "../Action/RestoreAction";
import { PackageConfig } from "../Config/PackageConfig";
import { PreSnapshot } from "../Repository/RepositoryAbstract";
import { BackupActionOptions } from "../actions/BackupAction";
import { RestoreActionOptions } from "../actions/RestoreAction";
import { PreSnapshot } from "../repositories/RepositoryAbstract";
import { Progress } from "../utils/progress";

type TaskCommonData = {
Expand Down
20 changes: 10 additions & 10 deletions packages/cli/src/utils/datatruck/command.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { BackupCommand } from "../../Command/BackupCommand";
import { CleanCacheCommand } from "../../Command/CleanCacheCommand";
import { GlobalOptions } from "../../Command/CommandAbstract";
import { ConfigCommand } from "../../Command/ConfigCommand";
import { CopyCommand } from "../../Command/CopyCommand";
import { InitCommand } from "../../Command/InitCommand";
import { PruneCommand } from "../../Command/PruneCommand";
import { RestoreCommand } from "../../Command/RestoreCommand";
import { SnapshotsCommand } from "../../Command/SnapshotsCommand";
import { StartServerCommand } from "../../Command/StartServerCommand";
import { BackupCommand } from "../../commands/BackupCommand";
import { CleanCacheCommand } from "../../commands/CleanCacheCommand";
import { GlobalOptions } from "../../commands/CommandAbstract";
import { ConfigCommand } from "../../commands/ConfigCommand";
import { CopyCommand } from "../../commands/CopyCommand";
import { InitCommand } from "../../commands/InitCommand";
import { PruneCommand } from "../../commands/PruneCommand";
import { RestoreCommand } from "../../commands/RestoreCommand";
import { SnapshotsCommand } from "../../commands/SnapshotsCommand";
import { StartServerCommand } from "../../commands/StartServerCommand";
import { Streams } from "../stream";
import { AppError } from "./error";
import { Writable } from "stream";
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/utils/datatruck/cron-server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BackupCommandOptions } from "../../Command/BackupCommand";
import { CopyCommandOptionsType } from "../../Command/CopyCommand";
import { BackupCommandOptions } from "../../commands/BackupCommand";
import { CopyCommandOptionsType } from "../../commands/CopyCommand";
import { stringifyOptions } from "../cli";
import { exec } from "../process";
import { datatruckCommandMap } from "./command";
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/utils/datatruck/paths.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PackageConfig } from "../../Config/PackageConfig";
import { PreSnapshot } from "../../Repository/RepositoryAbstract";
import { PreSnapshot } from "../../repositories/RepositoryAbstract";
import { SpawnStep, runSpawnSteps } from "../spawnSteps";

export type ParsePathsOptions = {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/utils/datatruck/repository-server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ConfigAction } from "../../Action/ConfigAction";
import { ConfigAction } from "../../actions/ConfigAction";
import { readRequestData } from "../http";
import { LocalFs } from "../virtual-fs";
import { createReadStream, createWriteStream } from "fs";
Expand Down
8 changes: 4 additions & 4 deletions packages/cli/src/utils/datatruck/repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import type { RepositoryConfig } from "../../Config/RepositoryConfig";
import {
DatatruckRepository,
datatruckRepositoryName,
} from "../../Repository/DatatruckRepository";
} from "../../repositories/DatatruckRepository";
import {
GitRepository,
gitRepositoryName,
} from "../../Repository/GitRepository";
import type { RepositoryAbstract } from "../../Repository/RepositoryAbstract";
} from "../../repositories/GitRepository";
import type { RepositoryAbstract } from "../../repositories/RepositoryAbstract";
import {
ResticRepository,
resticRepositoryName,
} from "../../Repository/ResticRepository";
} from "../../repositories/ResticRepository";
import { AppError } from "./error";

export function createRepo(
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/utils/datatruck/snapshot.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SnapshotGroupByType } from "../../Action/SnapshotsAction";
import { Snapshot } from "../../Repository/RepositoryAbstract";
import { SnapshotGroupByType } from "../../actions/SnapshotsAction";
import { Snapshot } from "../../repositories/RepositoryAbstract";
import { filterByLast, FilterByLastOptions } from "../date";
import { groupBy } from "../object";

Expand Down
14 changes: 7 additions & 7 deletions packages/cli/src/utils/datatruck/task.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { TaskConfig } from "../../Config/TaskConfig";
import { GitTask, gitTaskName } from "../../Task/GitTask";
import { MariadbTask, mariadbTaskName } from "../../Task/MariadbTask";
import { MssqlTask, mssqlTaskName } from "../../Task/MssqlTask";
import { MysqlDumpTask, mysqlDumpTaskName } from "../../Task/MysqlDumpTask";
import { GitTask, gitTaskName } from "../../tasks/GitTask";
import { MariadbTask, mariadbTaskName } from "../../tasks/MariadbTask";
import { MssqlTask, mssqlTaskName } from "../../tasks/MssqlTask";
import { MysqlDumpTask, mysqlDumpTaskName } from "../../tasks/MysqlDumpTask";
import {
PostgresqlDumpTask,
postgresqlDumpTaskName,
} from "../../Task/PostgresqlDumpTask";
import { ScriptTask, scriptTaskName } from "../../Task/ScriptTask";
import type { TaskAbstract } from "../../Task/TaskAbstract";
} from "../../tasks/PostgresqlDumpTask";
import { ScriptTask, scriptTaskName } from "../../tasks/ScriptTask";
import type { TaskAbstract } from "../../tasks/TaskAbstract";
import { AppError } from "./error";

export function createTask(task: TaskConfig): TaskAbstract {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/expect.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { RestoreCommandOptions } from "../src/Command/RestoreCommand";
import { RestoreCommandOptions } from "../src/commands/RestoreCommand";
import { createCommands } from "../src/utils/datatruck/command";
import "./toEqualMessage";
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/script-task.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { scriptTaskCode } from "../src/Task/ScriptTask";
import { scriptTaskCode } from "../src/tasks/ScriptTask";
import { createCommands } from "../src/utils/datatruck/command";
import { parseStringList } from "../src/utils/string";
import { mkTmpDir } from "../src/utils/temp";
Expand Down

0 comments on commit 38a3b2e

Please sign in to comment.