generator-begcode
Version:
Spring Boot + Angular/React/Vue in one handy generator
75 lines (74 loc) • 4.5 kB
TypeScript
import type { BaseEnvironmentOptions, GetGeneratorConstructor, BaseGenerator as YeomanGenerator } from '@yeoman/types';
import { YeomanTest, RunContext, RunContextSettings, RunResult } from 'yeoman-test';
import type { JHipsterGeneratorOptions } from '../generators/base/api.js';
import type { JSONEntity } from '../jdl/converters/types.js';
import CoreGenerator from '../generators/base-core/generator.js';
type BaseEntity = {
name: string;
} & JSONEntity;
type GeneratorTestType = YeomanGenerator<JHipsterGeneratorOptions>;
type GeneratorTestOptions = JHipsterGeneratorOptions;
type JHipsterRunResult<GeneratorType extends CoreGenerator = CoreGenerator> = RunResult<GeneratorType> & {
sourceCallsArg: Record<string, unknown[]>;
composedMockedGenerators: string[];
};
declare const runResult: JHipsterRunResult<CoreGenerator>;
export { runResult, runResult as result };
export declare const defineDefaults: ({ mockFactory }?: {
mockFactory?: any;
}) => Promise<void>;
export declare const createJHipsterConfigFiles: (configuration: Record<string, unknown>, entities?: BaseEntity[]) => {
[x: string]: BaseEntity | {
'generator-jhipster': Record<string, unknown>;
};
};
export type FakeBlueprintOptions = {
packageJson?: any;
generator?: string | string[];
generatorContent?: string;
files?: Record<string, unknown>;
};
export declare const createBlueprintFiles: (blueprintPackage: string, { packageJson, generator, generatorContent, files }?: FakeBlueprintOptions) => {
[x: string]: any;
};
declare class JHipsterRunContext extends RunContext<GeneratorTestType> {
sharedSource: Record<string, any>;
private sharedData;
private sharedApplication;
private sharedControl;
private workspaceApplications;
private commonWorkspacesConfig;
private generateApplicationsSet;
withOptions(options: Partial<Omit<JHipsterGeneratorOptions, 'env' | 'resolved' | 'namespace'> & Record<string, any>>): this;
withJHipsterConfig(configuration?: Record<string, unknown>, entities?: BaseEntity[]): this;
withSkipWritingPriorities(): this;
withWorkspacesCommonConfig(commonWorkspacesConfig: Record<string, unknown>): this;
withWorkspaceApplicationAtFolder(workspaceFolder: string, configuration: Record<string, unknown>, entities?: BaseEntity[]): this;
withWorkspaceApplication(configuration: Record<string, unknown>, entities?: BaseEntity[]): this;
withWorkspacesSamples(...appNames: string[]): this;
withGenerateWorkspaceApplications(generateWorkspaces?: boolean): this;
withJHipsterLookup(): this;
withParentBlueprintLookup(lookups?: string[]): this;
withFakeTestBlueprint(blueprintPackage: string, { packageJson, generator }?: FakeBlueprintOptions): this;
withMockedSource(): this;
withControl(sharedControl: Record<string, any>): this;
withSharedApplication(sharedApplication: Record<string, any>): this;
withMockedJHipsterGenerators(exceptList?: string[]): this;
withGradleBuildTool(): this;
private withSharedData;
run(): Promise<RunResult<GeneratorTestType>>;
}
declare class JHipsterTest extends YeomanTest {
constructor();
run<GeneratorType extends YeomanGenerator<GeneratorTestOptions> = YeomanGenerator<GeneratorTestOptions>>(GeneratorOrNamespace: string | GetGeneratorConstructor<GeneratorType>, settings?: RunContextSettings | undefined, envOptions?: BaseEnvironmentOptions | undefined): JHipsterRunContext;
runJHipster(jhipsterGenerator: string, settings?: RunContextSettings | undefined, envOptions?: BaseEnvironmentOptions | undefined): JHipsterRunContext;
runTestBlueprintGenerator(): JHipsterRunContext;
create<GeneratorType extends YeomanGenerator<GeneratorTestOptions> = YeomanGenerator<GeneratorTestOptions>>(GeneratorOrNamespace: string | GetGeneratorConstructor<GeneratorType>, settings?: RunContextSettings | undefined, envOptions?: BaseEnvironmentOptions | undefined): JHipsterRunContext;
createJHipster(jhipsterGenerator: string, settings?: RunContextSettings | undefined, envOptions?: BaseEnvironmentOptions | undefined): JHipsterRunContext;
generateDeploymentWorkspaces(commonConfig?: Record<string, unknown>): JHipsterRunContext;
}
export declare function createTestHelpers(options?: any): JHipsterTest;
export declare const basicHelpers: JHipsterTest;
export declare const defaultHelpers: JHipsterTest;
export declare const skipPrettierHelpers: JHipsterTest;
export declare const dryRunHelpers: JHipsterTest;