UNPKG

@graphql-mesh/migrate-config-cli

Version:
27 lines (26 loc) 829 B
import type { YamlConfig } from '@graphql-mesh/types'; export type MigrationMessage = { level: 'error' | 'warn' | 'info'; message: string; }; export type ResolvedPluginImport = { moduleName: string; importName: string; factoryName: string; }; export type ResolveLegacyPlugin = (args: { name: string; cwd?: string; }) => Promise<ResolvedPluginImport | undefined>; export interface MigrateLegacyConfigOptions { cwd?: string; resolvePlugin?: ResolveLegacyPlugin; } export interface MigrateLegacyConfigResult { code: string; addedPackages: string[]; removedPackages: string[]; messages: MigrationMessage[]; fatal: boolean; } export declare function migrateLegacyConfig(legacyConfig: YamlConfig.Config, options?: MigrateLegacyConfigOptions): Promise<MigrateLegacyConfigResult>;