diff --git a/generators/generate-blueprint/templates/generators/generator/command.mjs.ejs b/generators/generate-blueprint/templates/generators/generator/command.mjs.ejs index 36f29dc995b4..046bebeece2a 100644 --- a/generators/generate-blueprint/templates/generators/generator/command.mjs.ejs +++ b/generators/generate-blueprint/templates/generators/generator/command.mjs.ejs @@ -16,29 +16,25 @@ See the License for the specific language governing permissions and limitations under the License. -%> +import { asCommand } from 'generator-jhipster'; <%_ if (!sbs && !customGenerator) { _%> import { command as jhipsterCommand } from 'generator-jhipster/generators/<%- subGenerator %>'; - <%_ } _%> -/** - * @type {import('generator-jhipster').JHipsterCommandDefinition} - */ -const command = { - options: { + +export default asCommand({ <%_ if (!sbs && !customGenerator) { _%> + options: { ...jhipsterCommand.options, -<%_ } _%> }, +<%_ } _%> configs: { <%_ if (!sbs && !customGenerator) { _%> ...jhipsterCommand.configs, <%_ } _%> }, - arguments: { <%_ if (!sbs && !customGenerator) { _%> + arguments: { ...jhipsterCommand.arguments, -<%_ } _%> }, -}; - -export default command; +<%_ } _%> +}); diff --git a/generators/generate-blueprint/templates/generators/generator/generator.mjs.jhi.ejs b/generators/generate-blueprint/templates/generators/generator/generator.mjs.jhi.ejs index a31274532275..7f44f41d6fc7 100644 --- a/generators/generate-blueprint/templates/generators/generator/generator.mjs.jhi.ejs +++ b/generators/generate-blueprint/templates/generators/generator/generator.mjs.jhi.ejs @@ -48,21 +48,21 @@ export async function createGenerator(env) { <%_ } else { _%> export default class extends <%= generatorClass %>Generator { <%_ } _%> -<%_ if (sbs) { _%> - constructor(args, opts, features) { - super(args, opts, { ...features, sbsBlueprint: true }); - } - -<%_ } else if (!customGenerator) { _%> constructor(args, opts, features) { super(args, opts, { ...features, + queueCommandTasks: true, +<%_ if (sbs) { _%> + sbsBlueprint: true, +<%_ } else if (!customGenerator) { _%> checkBlueprint: true, // Dropped it once migration is done. jhipster7Migration: true, +<%_ } _%> }); } +<%_ if (!sbs && !customGenerator) { _%> async beforeQueue() { await super.beforeQueue(); } @@ -82,10 +82,7 @@ export default class extends <%= generatorClass %>Generator { { application } <%_ } _%> ) { - <%_ if (priority.name === 'initializing') { _%> - this.parseJHipsterArguments(command.arguments); - this.parseJHipsterOptions(command.options); - <%_ } else if (priority.name === 'writing') { _%> + <%_ if (priority.name === 'writing') { _%> await this.writeFiles({ sections: { files: [ diff --git a/generators/generate-blueprint/templates/generators/generator/index.mjs.ejs b/generators/generate-blueprint/templates/generators/generator/index.mjs.ejs index 9969e170d894..dcdc7a41add3 100644 --- a/generators/generate-blueprint/templates/generators/generator/index.mjs.ejs +++ b/generators/generate-blueprint/templates/generators/generator/index.mjs.ejs @@ -17,6 +17,4 @@ limitations under the License. -%> export { <%- application.dynamic ? 'createGenerator' : 'default' %> } from './generator.<%- js ? '' : 'm' %>js'; -<%_ if (priorities.find(priority => priority.name === 'initializing')) { _%> export { default as command } from './command.<%- js ? '' : 'm' %>js'; -<%_ } _%>