graphql-cli-prepare
Version:
Plugin for graphql-cli to bundle schemas and generate bindings
57 lines (56 loc) • 1.97 kB
TypeScript
/// <reference types="yargs" />
import { Arguments } from 'yargs';
export declare class Prepare {
private context;
private argv;
private config;
private bundleExtensionConfig;
private projectName;
private project;
constructor(context: any, argv: Arguments);
handle(): Promise<void>;
private setCurrentProject(project, projectName);
private bindings();
private bundle();
private save();
private getProjectConfig();
private processBundle();
private processBindings(schemaPath);
private saveConfig();
/**
* Determine input schema path for binding. It uses the resulting schema from bundling (if available),
* then looks at bundle extension (in case bundling ran before), then takes the project schemaPath.
* Also checks if the file exists, otherwise it throws and error.
*
* @param {(string | undefined)} schemaPath Schema path from bundling
* @returns {string} Input schema path to be used for binding generatio.
*/
private determineInputSchema(schemaPath);
/**
* Determine input schema path for bundling.
*
* @returns {string} Input schema path for bundling
*/
private determineSchemaPath();
/**
* Determine generator. Provided generator takes precedence over value from config
*
* @param {string} generator Command line parameter for generator
* @returns {string} Generator to be used
*/
private determineGenerator();
/**
* Determine output path for binding. Provided path takes precedence over value from config
*
* @param {string} extension File extension for output file
* @returns Output path
*/
private determineBindingOutputPath(extension);
/**
* Determine output path for bundle. Provided path takes precedence over value from config
*
* @returns Output path
*/
private determineBundleOutputPath();
private projectDisplayName;
}