gen-jhipster
Version:
Spring Boot + Angular/React/Vue in one handy generator
275 lines (274 loc) • 10.6 kB
TypeScript
import type { ComposeOptions } from 'yeoman-generator';
import CoreGenerator from '../base-core/index.js';
import type { TaskTypes as BaseTaskTypes, GenericTaskGroup } from '../../lib/types/base/tasks.js';
import type { JHipsterGeneratorFeatures, JHipsterGeneratorOptions } from './api.js';
/**
* Base class that contains blueprints support.
*/
export default class JHipsterBaseBlueprintGenerator<TaskTypes extends BaseTaskTypes = BaseTaskTypes> extends CoreGenerator {
fromBlueprint: boolean;
sbsBlueprint?: boolean;
delegateToBlueprint?: boolean;
blueprintConfig?: Record<string, any>;
jhipsterContext?: any;
constructor(args: string | string[], options: JHipsterGeneratorOptions, features: JHipsterGeneratorFeatures);
/**
* Filter generator's tasks in case the blueprint should be responsible on queueing those tasks.
*/
delegateTasksToBlueprint<TaskGroupType>(tasksGetter: () => TaskGroupType): TaskGroupType;
/**
* Utility method to get typed objects for autocomplete.
*/
asAnyTaskGroup<const K extends string>(taskGroup: GenericTaskGroup<this, any, K>): GenericTaskGroup<any, any, K>;
/**
* Priority API stub for blueprints.
*
* Initializing priority is used to show logo and tasks related to preparing for prompts, like loading constants.
*/
get initializing(): GenericTaskGroup<any, TaskTypes["InitializingTaskParam"], never>;
/**
* @deprecated
* Public API method used by the getter and also by Blueprints
*/
_initializing(): {};
/**
* Utility method to get typed objects for autocomplete.
*/
asInitializingTaskGroup<const K extends string>(taskGroup: GenericTaskGroup<this, TaskTypes['InitializingTaskParam'], K>): GenericTaskGroup<any, TaskTypes['InitializingTaskParam'], K>;
/**
* Priority API stub for blueprints.
*
* Prompting priority is used to prompt users for configuration values.
*/
get prompting(): {};
/**
* @deprecated
* Public API method used by the getter and also by Blueprints
*/
_prompting(): {};
/**
* Utility method to get typed objects for autocomplete.
*/
asPromptingTaskGroup<const K extends string>(taskGroup: GenericTaskGroup<this, TaskTypes['PromptingTaskParam'], K>): GenericTaskGroup<any, TaskTypes['PromptingTaskParam'], K>;
/**
* Priority API stub for blueprints.
*
* Configuring priority is used to customize and validate the configuration.
*/
get configuring(): {};
/**
* @deprecated
* Public API method used by the getter and also by Blueprints
*/
_configuring(): {};
/**
* Utility method to get typed objects for autocomplete.
*/
asConfiguringTaskGroup<const K extends string>(taskGroup: GenericTaskGroup<this, TaskTypes['ConfiguringTaskParam'], K>): GenericTaskGroup<any, TaskTypes['ConfiguringTaskParam'], K>;
/**
* Priority API stub for blueprints.
*
* Composing should be used to compose with others generators.
*/
get composing(): {};
/**
* @deprecated
* Public API method used by the getter and also by Blueprints
*/
_composing(): {};
/**
* Utility method to get typed objects for autocomplete.
*/
asComposingTaskGroup<const K extends string>(taskGroup: GenericTaskGroup<this, TaskTypes['ComposingTaskParam'], K>): GenericTaskGroup<any, TaskTypes['ComposingTaskParam'], K>;
/**
* Priority API stub for blueprints.
*
* ComposingComponent priority should be used to handle component configuration order.
*/
get composingComponent(): any;
/**
* Utility method to get typed objects for autocomplete.
*/
asComposingComponentTaskGroup<const K extends string>(taskGroup: GenericTaskGroup<this, TaskTypes['ComposingTaskParam'], K>): GenericTaskGroup<any, TaskTypes['ComposingTaskParam'], K>;
/**
* Priority API stub for blueprints.
*
* Loading should be used to load application configuration from jhipster configuration.
* Before this priority the configuration should be considered dirty, while each generator configures itself at configuring priority, another generator composed at composing priority can still change it.
*/
get loading(): any;
/**
* @deprecated
* Public API method used by the getter and also by Blueprints
*/
_loading(): {};
/**
* Utility method to get typed objects for autocomplete.
*/
asLoadingTaskGroup<const K extends string>(taskGroup: GenericTaskGroup<this, TaskTypes['LoadingTaskParam'], K>): GenericTaskGroup<any, TaskTypes['LoadingTaskParam'], K>;
/**
* Priority API stub for blueprints.
*
* Preparing should be used to generate derived properties.
*/
get preparing(): {};
/**
* @deprecated
* Public API method used by the getter and also by Blueprints
*/
_preparing(): {};
/**
* Utility method to get typed objects for autocomplete.
*/
asPreparingTaskGroup<const K extends string>(taskGroup: GenericTaskGroup<this, TaskTypes['PreparingTaskParam'], K>): GenericTaskGroup<any, TaskTypes['PreparingTaskParam'], K>;
/**
* Priority API stub for blueprints.
*
* Preparing should be used to generate derived properties.
*/
get postPreparing(): {};
/**
* Utility method to get typed objects for autocomplete.
*/
asPostPreparingTaskGroup<const K extends string>(taskGroup: GenericTaskGroup<this, TaskTypes['PostPreparingTaskParam'], K>): GenericTaskGroup<any, TaskTypes['PostPreparingTaskParam'], K>;
/**
* Priority API stub for blueprints.
*
* Default priority should used as misc customizations.
*/
get default(): {};
/**
* @deprecated
* Public API method used by the getter and also by Blueprints
*/
_default(): {};
/**
* Utility method to get typed objects for autocomplete.
*/
asDefaultTaskGroup<const K extends string>(taskGroup: GenericTaskGroup<this, TaskTypes['DefaultTaskParam'], K>): GenericTaskGroup<any, TaskTypes['DefaultTaskParam'], K>;
/**
* Priority API stub for blueprints.
*
* Writing priority should used to write files.
*/
get writing(): {};
/**
* @deprecated
* Public API method used by the getter and also by Blueprints
*/
_writing(): {};
/**
* Utility method to get typed objects for autocomplete.
*/
asWritingTaskGroup<const K extends string>(taskGroup: GenericTaskGroup<this, TaskTypes['WritingTaskParam'], K>): GenericTaskGroup<any, TaskTypes['WritingTaskParam'], K>;
/**
* Priority API stub for blueprints.
*
* PostWriting priority should used to customize files.
*/
get postWriting(): {};
/**
* @deprecated
* Public API method used by the getter and also by Blueprints
*/
_postWriting(): {};
/**
* Utility method to get typed objects for autocomplete.
*/
asPostWritingTaskGroup<const K extends string>(taskGroup: GenericTaskGroup<this, TaskTypes['PostWritingTaskParam'], K>): GenericTaskGroup<any, TaskTypes['PostWritingTaskParam'], K>;
/**
* Priority API stub for blueprints.
*
* Install priority should used to prepare the project.
*/
get install(): {};
/**
* @deprecated
* Public API method used by the getter and also by Blueprints
*/
_install(): {};
/**
* Utility method to get typed objects for autocomplete.
*/
asInstallTaskGroup<const K extends string>(taskGroup: GenericTaskGroup<this, TaskTypes['InstallTaskParam'], K>): GenericTaskGroup<any, TaskTypes['InstallTaskParam'], K>;
/**
* Priority API stub for blueprints.
*
* PostWriting priority should used to customize files.
*/
get postInstall(): {};
/**
* @deprecated
* Public API method used by the getter and also by Blueprints
*/
_postInstall(): {};
/**
* Utility method to get typed objects for autocomplete.
*/
asPostInstallTaskGroup<const K extends string>(taskGroup: GenericTaskGroup<this, TaskTypes['PostInstallTaskParam'], K>): GenericTaskGroup<any, TaskTypes['PostInstallTaskParam'], K>;
/**
* Priority API stub for blueprints.
*
* End priority should used to say good bye and print instructions.
*/
get end(): {};
/**
* @deprecated
* Public API method used by the getter and also by Blueprints
*/
_end(): {};
/**
* Utility method to get typed objects for autocomplete.
*/
asEndTaskGroup<const K extends string>(taskGroup: GenericTaskGroup<this, TaskTypes['EndTaskParam'], K>): GenericTaskGroup<any, TaskTypes['EndTaskParam'], K>;
/**
* @protected
* Composes with blueprint generators, if any.
*/
protected composeWithBlueprints(subGen?: string, options?: ComposeOptions): Promise<any[]>;
/**
* Check if the blueprint implements every priority implemented by the parent generator
* @param {BaseGenerator} blueprintGenerator
*/
private checkBlueprintImplementsPriorities;
/**
* @private
* Configure blueprints.
*/
private _configureBlueprints;
/**
* @private
* Compose external blueprint module
* @param {string} blueprint - name of the blueprint
* @param {string} subGen - sub generator
* @param {any} [extraOptions] - options to pass to blueprint generator
* @return {Generator|undefined}
*/
private _composeBlueprint;
/**
* @private
* Try to retrieve the package.json of the blueprint used, as an object.
* @param {string} blueprintPkgName - generator name
* @return {object} packageJson - retrieved package.json as an object or undefined if not found
*/
private _findBlueprintPackageJson;
/**
* @private
* Try to retrieve the version of the blueprint used.
* @param {string} blueprintPkgName - generator name
* @return {string} version - retrieved version or empty string if not found
*/
private _findBlueprintVersion;
/**
* @private
* Check if the generator specified as blueprint is installed.
* @param {string} blueprint - generator name
*/
protected _checkBlueprint(blueprint: any): void;
/**
* @private
* Check if the generator specified as blueprint has a version compatible with current JHipster.
* @param {string} blueprintPkgName - generator name
*/
protected _checkJHipsterBlueprintVersion(blueprintPkgName: any): void;
}