diff --git a/packages/cli/src/cli.ts b/packages/cli/src/cli.ts index 6aa2ca8..93524b5 100644 --- a/packages/cli/src/cli.ts +++ b/packages/cli/src/cli.ts @@ -70,7 +70,7 @@ Examples: const plugins = [...(config.plugins ?? []), ...(values.plugin ?? [])]; try { - const { default: upCommand } = await import('./up-command.js'); + const { default: upCommand } = await import('./commands/up.js'); await upCommand({ storage, reporter, directory, plugins, dry }); } catch (error) { if (error instanceof ShowUsageError) { @@ -160,7 +160,7 @@ Examples: const name = positionals.join(' ').trim(); try { - const { default: newCommand } = await import('./new-command.js'); + const { default: newCommand } = await import('./commands/new.js'); await newCommand({ directory, template, plugins, extension, reporter }, name); } catch (error) { if (error instanceof ShowUsageError) { diff --git a/packages/cli/src/new-command.ts b/packages/cli/src/commands/new.ts similarity index 94% rename from packages/cli/src/new-command.ts rename to packages/cli/src/commands/new.ts index 6c56c34..a9e6a35 100644 --- a/packages/cli/src/new-command.ts +++ b/packages/cli/src/commands/new.ts @@ -3,11 +3,11 @@ import fs from 'node:fs/promises'; import path from 'node:path'; import { getTimestampPrefix, sanitizeMigrationName, getOrLoadPlugin, getOrLoadReporter } from '@emigrate/plugin-tools'; import { type MigrationMetadata } from '@emigrate/plugin-tools/types'; -import { BadOptionError, MissingArgumentsError, MissingOptionError, UnexpectedError } from './errors.js'; -import { type Config } from './types.js'; -import { withLeadingPeriod } from './with-leading-period.js'; +import { BadOptionError, MissingArgumentsError, MissingOptionError, UnexpectedError } from '../errors.js'; +import { type Config } from '../types.js'; +import { withLeadingPeriod } from '../with-leading-period.js'; -const lazyDefaultReporter = async () => import('./reporters/default.js'); +const lazyDefaultReporter = async () => import('../reporters/default.js'); export default async function newCommand( { directory, template, reporter: reporterConfig, plugins = [], extension }: Config, diff --git a/packages/cli/src/up-command.ts b/packages/cli/src/commands/up.ts similarity index 96% rename from packages/cli/src/up-command.ts rename to packages/cli/src/commands/up.ts index 40cf8f4..22315b6 100644 --- a/packages/cli/src/up-command.ts +++ b/packages/cli/src/commands/up.ts @@ -13,10 +13,10 @@ import { MigrationLoadError, MigrationRunError, MissingOptionError, -} from './errors.js'; -import { type Config } from './types.js'; -import { withLeadingPeriod } from './with-leading-period.js'; -import pluginLoaderJs from './plugin-loader-js.js'; +} from '../errors.js'; +import { type Config } from '../types.js'; +import { withLeadingPeriod } from '../with-leading-period.js'; +import pluginLoaderJs from '../plugin-loader-js.js'; type ExtraFlags = { dry?: boolean; @@ -27,7 +27,7 @@ const getDuration = (start: [number, number]) => { return seconds * 1000 + nanoseconds / 1_000_000; }; -const lazyDefaultReporter = async () => import('./reporters/default.js'); +const lazyDefaultReporter = async () => import('../reporters/default.js'); export default async function upCommand({ storage: storageConfig,