UNPKG

gen-jhipster

Version:

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

117 lines (116 loc) 4.44 kB
import Environment from 'yeoman-environment'; import { type Blueprint } from '../generators/base/internal/index.ts'; import type { CliCommand } from './types.d.ts'; export declare const generatorsLookup: string[]; export declare const jhipsterGeneratorsLookup: string[]; type EnvironmentOptions = ConstructorParameters<typeof Environment>[0]; export default class EnvironmentBuilder { env: Environment; devBlueprintPath?: string; localBlueprintPath?: string; localBlueprintExists?: boolean; _blueprintsWithVersion: Record<string, string | undefined>; /** * Creates a new EnvironmentBuilder with a new Environment. */ static create(options?: EnvironmentOptions): 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(); */ static createEnv(...args: Parameters<typeof EnvironmentBuilder.createDefaultBuilder>): Promise<Environment>; /** * Creates a new EnvironmentBuilder with a new Environment and load jhipster, blueprints and sharedOptions. */ static createDefaultBuilder(...args: Parameters<typeof EnvironmentBuilder.create>): Promise<EnvironmentBuilder>; static run(args: Parameters<Environment['run']>[0], generatorOptions?: Parameters<Environment['run']>[1] & Record<string, unknown>, envOptions?: Parameters<typeof EnvironmentBuilder.create>[0]): 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: Environment); prepare({ blueprints, lookups, devBlueprintPath, }?: { blueprints?: Record<string, string | undefined>; lookups?: Parameters<Environment['lookup']>[0][]; devBlueprintPath?: string; }): Promise<this>; getBlueprintsNamespaces(): string[]; /** * Construct blueprint option value. * * @return {String} */ getBlueprintsOption(): string; updateJHipsterGenerators(): Promise<void>; /** * @private * Lookup current jhipster generators. */ _lookupJHipster(): Promise<this>; _lookupLocalBlueprint(): Promise<this>; _lookupDevBlueprint(): Promise<this>; _lookups(lookups?: Parameters<Environment['lookup']>[0][]): Promise<this>; /** * @private * Load blueprints from argv, .yo-rc.json. */ _loadBlueprints(blueprints: Record<string, string | undefined> | undefined): this; /** * @private * Lookup current loaded blueprints. */ _lookupBlueprints(options?: Parameters<Environment['lookup']>[0]): Promise<this>; /** * Lookup for generators. */ lookupGenerators(generators: string[], options?: Parameters<Environment['lookup']>[0]): Promise<this>; /** * @private * Load sharedOptions from jhipster and blueprints. */ _loadSharedOptions(): Promise<this>; /** * Get blueprints commands. */ getBlueprintCommands(): Promise<Record<string, CliCommand> | undefined>; /** * Get the environment. */ getEnvironment(): Environment; /** * Load blueprints from argv. * At this point, commander has not parsed yet because we are building it. */ private _getBlueprintsFromArgv; /** * Load blueprints from .yo-rc.json. */ _getBlueprintsFromYoRc(): Blueprint[]; /** * @private * Creates a 'blueprintName: blueprintVersion' object from argv and .yo-rc.json blueprints. */ _getAllBlueprintsWithVersion(): Record<string, string | undefined>; /** * @private * Get packagePaths from current loaded blueprints. */ _getBlueprintPackagePaths(): Promise<[string, string | undefined][] | undefined>; /** * @private * Get blueprints commands. */ _getBlueprintCommands(blueprintPackagePaths: [string, string | undefined][] | undefined): Promise<Record<string, CliCommand> | undefined>; /** * @private * Get blueprints sharedOptions. */ _getSharedOptions(blueprintPackagePaths: [string, string | undefined][] | undefined): Promise<any>; } export {};