UNPKG

gen-jhipster

Version:

Spring Boot + Angular/React/Vue in one handy generator

145 lines (144 loc) 4.67 kB
export default class EnvironmentBuilder { /** * Creates a new EnvironmentBuilder with a new Environment. * * @param {any} [args] - Arguments passed to Environment.createEnv(). * @param {Object} [options] - options passed to Environment.createEnv(). * @param [adapter] - adapter passed to Environment.createEnv(). * @return {EnvironmentBuilder} envBuilder */ static create(options?: any): EnvironmentBuilder; /** * Creates a new Environment with blueprints. * * Can be used to create a new test environment (requires yeoman-test >= 2.6.0): * @example * const promise = require('yeoman-test').create('jhipster:app', {}, {createEnv: EnvironmentBuilder.createEnv}).run(); * * @param {...any} args - Arguments passed to Environment.createEnv(). * @return {Promise<Environment>} envBuilder */ static createEnv(...args: any[]): Promise<Environment>; /** * Creates a new EnvironmentBuilder with a new Environment and load jhipster, blueprints and sharedOptions. * * @param {...any} args - Arguments passed to Environment.createEnv(). * @return {EnvironmentBuilder} envBuilder */ static createDefaultBuilder(...args: any[]): EnvironmentBuilder; static run(args: any, generatorOptions?: {}, envOptions?: {}): Promise<void>; /** * Class to manipulate yeoman environment for jhipster needs. * - Registers jhipster generators. * - Loads blueprints from argv and .yo-rc.json. * - Installs blueprints if not found. * - Loads sharedOptions. */ constructor(env: any); /** @type {Environment} */ env: Environment; devBlueprintPath: any; localBlueprintPath: any; localBlueprintExists: any; prepare({ blueprints, lookups, devBlueprintPath }?: { devBlueprintPath?: string | undefined; }): Promise<this>; getBlueprintsNamespaces(): any[]; /** * Construct blueprint option value. * * @return {String} */ getBlueprintsOption(): string; /** * @private * Lookup current jhipster generators. * * @return {EnvironmentBuilder} this for chaining. */ private _lookupJHipster; _lookupLocalBlueprint(): Promise<this>; _lookupDevBlueprint(): Promise<this>; _lookups(lookups?: any[]): Promise<this>; /** * @private * Load blueprints from argv, .yo-rc.json. * * @return {EnvironmentBuilder} this for chaining. */ private _loadBlueprints; _blueprintsWithVersion: any; /** * @private * Lookup current loaded blueprints. * * @param {Object} [options] - forwarded to Environment lookup. * @return {EnvironmentBuilder} this for chaining. */ private _lookupBlueprints; /** * Lookup for generators. * * @param {string[]} [generators] - generators to lookup. * @param {Object} [options] - forwarded to Environment lookup. * @return {EnvironmentBuilder} this for chaining. */ lookupGenerators(generators?: string[], options?: any): EnvironmentBuilder; /** * @private * Load sharedOptions from jhipster and blueprints. * * @return {Promise<EnvironmentBuilder>} this for chaining. */ private _loadSharedOptions; /** * Get blueprints commands. * * @return {Record<string, import('./types.js').CliCommand>} blueprint commands. */ getBlueprintCommands(): Record<string, import("./types.js").CliCommand>; /** * Get the environment. * * @return {Environment} the yeoman environment. */ getEnvironment(): Environment; /** * @private * Load blueprints from argv. * At this point, commander has not parsed yet because we are building it. * @returns {Blueprint[]} */ private _getBlueprintsFromArgv; /** * @private * Load blueprints from .yo-rc.json. * @returns {Blueprint[]} */ private _getBlueprintsFromYoRc; /** * @private * Creates a 'blueprintName: blueprintVersion' object from argv and .yo-rc.json blueprints. */ private _getAllBlueprintsWithVersion; /** * @private * Get packagePaths from current loaded blueprints. */ private _getBlueprintPackagePaths; /** * @private * Get blueprints commands. * * @return {Record<string, import('./types.js').CliCommand>} commands. */ private _getBlueprintCommands; /** * @private * Get blueprints sharedOptions. * * @return {Object} sharedOptions. */ private _getSharedOptions; } import Environment from 'yeoman-environment';