Skip to content

Commit

Permalink
generate-blueprint: enable queueCommandTasks (#27384)
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Sep 23, 2024
1 parent fd86720 commit 2253efa
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
<%_ } _%>
});
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
<%_ } _%>

0 comments on commit 2253efa

Please sign in to comment.