generator-jhipster 7.3.1 → 7.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/jhipster-command.js +2 -2
- package/cli/program.js +31 -29
- package/generators/app/index.js +30 -25
- package/generators/aws/index.js +8 -8
- package/generators/aws/lib/eb.js +1 -1
- package/generators/azure-app-service/index.js +13 -9
- package/generators/azure-spring-cloud/index.js +13 -9
- package/generators/bootstrap/index.js +49 -59
- package/generators/ci-cd/index.js +10 -8
- package/generators/client/files-common.js +6 -2
- package/generators/client/files-react.js +10 -1
- package/generators/client/files-vue.js +40 -1
- package/generators/client/index.js +42 -31
- package/generators/client/needle-api/needle-client-vue.js +1 -1
- package/generators/client/templates/angular/.eslintrc.json.ejs +1 -0
- package/generators/client/templates/angular/package.json +14 -14
- package/generators/client/templates/angular/src/main/webapp/app/admin/metrics/blocks/jvm-memory/jvm-memory.component.html.ejs +2 -2
- package/generators/client/templates/common/package.json +3 -3
- package/generators/client/templates/common/webpack/webpack.microfrontend.js.jhi.ejs +56 -0
- package/generators/client/templates/react/.eslintrc.json.ejs +1 -0
- package/generators/client/templates/react/package.json +44 -43
- package/generators/client/templates/react/package.json.ejs +3 -0
- package/generators/client/templates/react/src/main/webapp/app/app.scss.ejs +0 -3
- package/generators/client/templates/react/src/main/webapp/app/modules/administration/configuration/configuration.tsx.ejs +2 -2
- package/generators/client/templates/react/src/main/webapp/app/modules/administration/gateway/gateway.tsx.ejs +2 -2
- package/generators/client/templates/react/src/main/webapp/app/modules/administration/metrics/metrics.tsx.ejs +6 -6
- package/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management.tsx.ejs +8 -8
- package/generators/client/templates/react/src/main/webapp/app/modules/home/home.tsx.ejs +1 -1
- package/generators/client/templates/react/src/main/webapp/app/shared/layout/header/header.tsx.ejs +1 -1
- package/generators/client/templates/react/src/main/webapp/app/shared/layout/menus/account.tsx.ejs +3 -3
- package/generators/client/templates/react/src/main/webapp/app/shared/layout/menus/admin.tsx.ejs +7 -7
- package/generators/client/templates/react/src/main/webapp/app/shared/layout/menus/menu-components.tsx.ejs +1 -1
- package/generators/client/templates/react/webpack/webpack.dev.js.ejs +17 -1
- package/generators/client/templates/react/webpack/webpack.prod.js.ejs +13 -1
- package/generators/client/templates/vue/.eslintrc.js.ejs +8 -5
- package/generators/client/templates/vue/package.json +31 -38
- package/generators/client/templates/vue/package.json.ejs +8 -10
- package/generators/client/templates/vue/src/main/webapp/app/account/account.service.ts.ejs +1 -2
- package/generators/client/templates/vue/src/main/webapp/app/account/settings/settings.vue.ejs +7 -1
- package/generators/client/templates/vue/src/main/webapp/app/admin/configuration/configuration.vue.ejs +1 -1
- package/generators/client/templates/vue/src/main/webapp/app/admin/metrics/metrics.component.ts.ejs +1 -1
- package/generators/client/templates/vue/src/main/webapp/app/core/jhi-navbar/jhi-navbar.component.ts.ejs +12 -1
- package/generators/client/templates/vue/src/main/webapp/app/core/jhi-navbar/jhi-navbar.vue.ejs +6 -0
- package/generators/client/templates/vue/src/main/webapp/app/declarations.d.ts.ejs +41 -0
- package/generators/client/templates/vue/src/main/webapp/app/entities/entities-menu.component.ts.ejs +34 -0
- package/generators/client/templates/vue/src/main/webapp/app/entities/entities-menu.vue.ejs +13 -0
- package/generators/client/templates/vue/src/main/webapp/app/entities/entities.component.ts.ejs +12 -0
- package/generators/client/templates/vue/src/main/webapp/app/entities/entities.vue.ejs +5 -0
- package/generators/client/templates/vue/src/main/webapp/app/index.ts.ejs +19 -0
- package/generators/client/templates/vue/src/main/webapp/app/locale/translation.service.ts.ejs +25 -8
- package/generators/client/templates/vue/src/main/webapp/app/main.ts.ejs +9 -4
- package/generators/client/templates/vue/src/main/webapp/app/router/entities.ts.ejs +44 -1
- package/generators/client/templates/vue/src/main/webapp/app/router/index.ts.ejs +11 -0
- package/generators/client/templates/vue/src/main/webapp/app/shims-vue.d.ts.ejs +0 -10
- package/generators/client/templates/vue/src/test/javascript/jest.conf.js.ejs +19 -8
- package/generators/client/templates/vue/src/test/javascript/spec/app/entities/entities-menu.spec.ts.ejs +52 -0
- package/generators/client/templates/vue/src/test/javascript/spec/app/microfrontends/entities-menu.component.ts.ejs +4 -0
- package/generators/client/templates/vue/src/test/javascript/spec/app/microfrontends/entities-menu.vue.ejs +7 -0
- package/generators/client/templates/vue/src/test/javascript/spec/app/microfrontends/entities-router.ts.ejs +1 -0
- package/generators/client/templates/vue/tsconfig.json.ejs +5 -9
- package/generators/client/templates/vue/tsconfig.spec.json.ejs +37 -0
- package/generators/client/templates/vue/webpack/config.js.ejs +2 -0
- package/generators/client/templates/vue/webpack/vue.utils.js.ejs +13 -12
- package/generators/client/templates/vue/webpack/webpack.common.js.ejs +64 -50
- package/generators/client/templates/vue/webpack/webpack.dev.js.ejs +17 -68
- package/generators/client/templates/vue/webpack/webpack.microfrontend.js.jhi.vue.ejs +77 -0
- package/generators/client/templates/vue/webpack/webpack.prod.js.ejs +1 -30
- package/generators/cloudfoundry/index.js +9 -9
- package/generators/common/index.js +12 -10
- package/generators/common/templates/package.json +4 -4
- package/generators/cypress/index.js +12 -9
- package/generators/cypress/templates/cypress.json.ejs +3 -0
- package/generators/cypress/templates/src/test/javascript/cypress/plugins/index.ts.ejs +3 -3
- package/generators/cypress/templates/src/test/javascript/cypress/support/entity.ts.ejs +2 -2
- package/generators/database-changelog/index.js +33 -22
- package/generators/database-changelog-liquibase/index.js +12 -8
- package/generators/docker-compose/index.js +11 -12
- package/generators/entities/index.js +35 -26
- package/generators/entities-client/index.js +10 -7
- package/generators/entity/index.js +25 -28
- package/generators/entity-client/files.js +6 -11
- package/generators/entity-client/index.js +9 -7
- package/generators/entity-client/templates/common/src/test/javascript/cypress/integration/entity/entity.spec.ts.ejs +4 -4
- package/generators/entity-client/templates/react/src/main/webapp/app/entities/entity-update.tsx.ejs +1 -1
- package/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs +7 -7
- package/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity.component.ts.ejs +2 -1
- package/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity.service.ts.ejs +2 -6
- package/generators/entity-i18n/index.js +7 -4
- package/generators/entity-server/index.js +11 -8
- package/generators/entity-server/templates/src/main/java/package/web/rest/EntityResource.java.ejs +39 -41
- package/generators/gae/index.js +10 -10
- package/generators/generator-base-blueprint.js +7 -44
- package/generators/generator-base.js +7 -0
- package/generators/generator-constants.js +20 -18
- package/generators/generator-transforms.js +27 -23
- package/generators/heroku/index.js +12 -10
- package/generators/init/constants.cjs +1 -1
- package/generators/kubernetes/files.js +3 -0
- package/generators/kubernetes/index.js +10 -10
- package/generators/kubernetes/templates/db/couchbase.yml.ejs +1 -1
- package/generators/kubernetes/templates/deployment.yml.ejs +8 -3
- package/generators/kubernetes/templates/istio/destination-rule.yml.ejs +1 -1
- package/generators/kubernetes/templates/istio/gateway/grafana-gateway.yml.ejs +5 -2
- package/generators/kubernetes/templates/istio/gateway/jhipster-grafana-gateway.yml.ejs +5 -2
- package/generators/kubernetes/templates/istio/gateway/kiali-gateway.yml.ejs +10 -8
- package/generators/kubernetes/templates/istio/gateway/zipkin-gateway.yml.ejs +5 -2
- package/generators/kubernetes/templates/istio/gateway.yml.ejs +7 -5
- package/generators/kubernetes/templates/secret/couchbase-secret.yml.ejs +9 -0
- package/generators/kubernetes-base.js +1 -0
- package/generators/kubernetes-helm/files.js +3 -8
- package/generators/kubernetes-helm/index.js +10 -10
- package/generators/kubernetes-helm/templates/README-KUBERNETES-HELM.md.ejs +0 -1
- package/generators/kubernetes-helm/templates/app/Chart.yml.ejs +5 -0
- package/generators/kubernetes-helm/templates/app/helpers.tpl.ejs +0 -11
- package/generators/kubernetes-helm/templates/app/requirements.yml.ejs +5 -0
- package/generators/kubernetes-helm/templates/app/values.yml.ejs +68 -5
- package/generators/kubernetes-helm/templates/csvc/Chart.yml.ejs +1 -1
- package/generators/kubernetes-helm/templates/csvc/requirements.yml.ejs +1 -1
- package/generators/kubernetes-knative/index.js +10 -10
- package/generators/kubernetes-knative/templates/istio/gateway.yml.ejs +6 -4
- package/generators/kubernetes-knative/templates/service.yml.ejs +1 -1
- package/generators/languages/index.js +13 -13
- package/generators/openapi-client/index.js +13 -10
- package/generators/openshift/index.js +10 -11
- package/generators/openshift/templates/deployment.yml.ejs +1 -1
- package/generators/page/index.js +12 -10
- package/generators/server/__snapshots__/generator.spec.mjs.snap +12 -0
- package/generators/server/files.js +12 -0
- package/generators/server/index.js +32 -18
- package/generators/server/templates/gradle.properties.ejs +10 -10
- package/generators/server/templates/pom.xml.ejs +6 -6
- package/generators/server/templates/src/main/docker/app.yml.ejs +1 -1
- package/generators/server/templates/src/main/java/package/config/SecurityConfiguration_reactive.java.ejs +2 -2
- package/generators/server/templates/src/main/java/package/config/WebConfigurer.java.ejs +0 -1
- package/generators/server/templates/src/main/java/package/management/SecurityMetersService.java.ejs +68 -0
- package/generators/server/templates/src/main/java/package/security/jwt/TokenProvider.java.ejs +29 -4
- package/generators/server/templates/src/main/java/package/security/oauth2/CustomClaimConverter.java.ejs +21 -9
- package/generators/server/templates/src/main/java/package/service/UserService.java.ejs +13 -5
- package/generators/server/templates/src/main/resources/static/microservices_index.html.ejs +1 -1
- package/generators/server/templates/src/test/java/package/management/SecurityMetersServiceTests.java.ejs +113 -0
- package/generators/server/templates/src/test/java/package/security/jwt/JWTFilterTest.java.ejs +6 -1
- package/generators/server/templates/src/test/java/package/security/jwt/TokenProviderSecurityMetersTests.java.ejs +198 -0
- package/generators/server/templates/src/test/java/package/security/jwt/TokenProviderTest.java.ejs +13 -3
- package/generators/server/templates/src/test/java/package/security/oauth2/AuthorizationHeaderUtilTest.java.ejs +16 -2
- package/generators/server/templates/src/test/java/package/security/oauth2/CustomClaimConverterIT.java.ejs +63 -0
- package/generators/spring-controller/index.js +9 -7
- package/generators/spring-service/index.js +10 -7
- package/generators/upgrade/index.js +3 -4
- package/generators/utils.js +2 -2
- package/generators/workspaces/index.js +16 -7
- package/jdl/jhipster/default-application-options.js +9 -7
- package/package.json +15 -15
- package/utils/entity.js +14 -0
- package/utils/multi-step-transform/index.js +8 -8
package/cli/jhipster-command.js
CHANGED
|
@@ -74,9 +74,9 @@ class JHipsterCommand extends Command {
|
|
|
74
74
|
* @private
|
|
75
75
|
* Override _parseCommand to execute a callback before parsing.
|
|
76
76
|
*/
|
|
77
|
-
_parseCommand(operands, unknown) {
|
|
77
|
+
async _parseCommand(operands, unknown) {
|
|
78
78
|
if (this._lazyBuildCommandCallBack) {
|
|
79
|
-
this._lazyBuildCommandCallBack(operands, unknown);
|
|
79
|
+
await this._lazyBuildCommandCallBack(operands, unknown);
|
|
80
80
|
}
|
|
81
81
|
return super._parseCommand(operands, unknown);
|
|
82
82
|
}
|
package/cli/program.js
CHANGED
|
@@ -93,7 +93,7 @@ const buildCommands = ({ program, commands = {}, envBuilder, env, loadCommand })
|
|
|
93
93
|
.excessArgumentsCallback(function (receivedArgs) {
|
|
94
94
|
rejectExtraArgs(program, this.name(), receivedArgs);
|
|
95
95
|
})
|
|
96
|
-
.lazyBuildCommand(function (operands) {
|
|
96
|
+
.lazyBuildCommand(async function (operands) {
|
|
97
97
|
logger.debug(`cmd: lazyBuildCommand ${cmdName} ${operands}`);
|
|
98
98
|
const command = this;
|
|
99
99
|
if (cmdName === 'run') {
|
|
@@ -103,25 +103,27 @@ const buildCommands = ({ program, commands = {}, envBuilder, env, loadCommand })
|
|
|
103
103
|
namespace => `${namespace.startsWith(JHIPSTER_NS) ? '' : `${JHIPSTER_NS}-`}${namespace}`
|
|
104
104
|
);
|
|
105
105
|
envBuilder.lookupGenerators(command.generatorNamespaces.map(namespace => `generator-${namespace.split(':')[0]}`));
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
106
|
+
await Promise.all(
|
|
107
|
+
command.generatorNamespaces.map(async namespace => {
|
|
108
|
+
if (!(await env.getPackagePath(namespace))) {
|
|
109
|
+
logger.fatal(chalk.red(`\nGenerator ${namespace} not found.\n`));
|
|
110
|
+
}
|
|
111
|
+
const generator = await env.create(namespace, { options: { help: true } });
|
|
112
|
+
this.addGeneratorArguments(generator._arguments).addGeneratorOptions(generator._options);
|
|
113
|
+
})
|
|
114
|
+
);
|
|
113
115
|
return;
|
|
114
116
|
}
|
|
115
117
|
if (!opts.cliOnly || cmdName === 'jdl') {
|
|
116
118
|
if (opts.blueprint) {
|
|
117
119
|
// Blueprint only command.
|
|
118
|
-
const generator = env.create(`${packageNameToNamespace(opts.blueprint)}:${cmdName}`, { options: { help: true } });
|
|
120
|
+
const generator = await env.create(`${packageNameToNamespace(opts.blueprint)}:${cmdName}`, { options: { help: true } });
|
|
119
121
|
command.addGeneratorArguments(generator._arguments).addGeneratorOptions(generator._options);
|
|
120
122
|
} else {
|
|
121
123
|
const generatorName = cmdName === 'jdl' ? 'app' : cmdName;
|
|
122
124
|
// Register jhipster upstream options.
|
|
123
125
|
if (cmdName !== 'jdl') {
|
|
124
|
-
const generator = env.create(`${JHIPSTER_NS}:${cmdName}`, { options: { help: true } });
|
|
126
|
+
const generator = await env.create(`${JHIPSTER_NS}:${cmdName}`, { options: { help: true } });
|
|
125
127
|
command.addGeneratorArguments(generator._arguments).addGeneratorOptions(generator._options);
|
|
126
128
|
|
|
127
129
|
const usagePath = path.resolve(generator.sourceRoot(), '../USAGE');
|
|
@@ -130,34 +132,34 @@ const buildCommands = ({ program, commands = {}, envBuilder, env, loadCommand })
|
|
|
130
132
|
}
|
|
131
133
|
}
|
|
132
134
|
if (cmdName === 'jdl' || program.opts().fromJdl) {
|
|
133
|
-
const appGenerator = env.create(`${JHIPSTER_NS}:app`, { options: { help: true } });
|
|
135
|
+
const appGenerator = await env.create(`${JHIPSTER_NS}:app`, { options: { help: true } });
|
|
134
136
|
command.addGeneratorOptions(appGenerator._options, chalk.gray(' (application)'));
|
|
135
137
|
|
|
136
|
-
const workspacesGenerator = env.create(`${JHIPSTER_NS}:workspaces`, { options: { help: true } });
|
|
138
|
+
const workspacesGenerator = await env.create(`${JHIPSTER_NS}:workspaces`, { options: { help: true } });
|
|
137
139
|
command.addGeneratorOptions(workspacesGenerator._options, chalk.gray(' (workspaces)'));
|
|
138
140
|
}
|
|
139
141
|
|
|
140
142
|
// Register blueprint specific options.
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
chalk.yellow(` (blueprint option: ${blueprintName})`)
|
|
151
|
-
)
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}
|
|
155
|
-
|
|
143
|
+
await Promise.all(
|
|
144
|
+
envBuilder.getBlueprintsNamespaces().map(async blueprintNamespace => {
|
|
145
|
+
const generatorNamespace = `${blueprintNamespace}:${generatorName}`;
|
|
146
|
+
if (!(await env.get(generatorNamespace))) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
const blueprintName = blueprintNamespace.replace(/^jhipster-/, '');
|
|
150
|
+
const blueprintGenerator = await env.create(generatorNamespace, { options: { help: true } });
|
|
151
|
+
try {
|
|
152
|
+
command.addGeneratorOptions(blueprintGenerator._options, chalk.yellow(` (blueprint option: ${blueprintName})`));
|
|
153
|
+
} catch (error) {
|
|
154
|
+
logger.info(`Error parsing options for generator ${generatorNamespace}, error: ${error}`);
|
|
155
|
+
}
|
|
156
|
+
})
|
|
157
|
+
);
|
|
156
158
|
}
|
|
157
159
|
}
|
|
158
160
|
command.addHelpText('after', moreInfo);
|
|
159
161
|
})
|
|
160
|
-
.action((...everything) => {
|
|
162
|
+
.action(async (...everything) => {
|
|
161
163
|
logger.debug('cmd: action');
|
|
162
164
|
// [args, opts, command]
|
|
163
165
|
const command = everything.pop();
|
|
@@ -177,7 +179,7 @@ const buildCommands = ({ program, commands = {}, envBuilder, env, loadCommand })
|
|
|
177
179
|
logger.debug('Executing CLI only script');
|
|
178
180
|
return loadCommand(cmdName)(args, options, env, envBuilder);
|
|
179
181
|
}
|
|
180
|
-
env.composeWith('jhipster:bootstrap', options);
|
|
182
|
+
await env.composeWith('jhipster:bootstrap', options);
|
|
181
183
|
|
|
182
184
|
if (cmdName === 'run') {
|
|
183
185
|
return Promise.all(command.generatorNamespaces.map(generator => env.run(generator, options))).then(
|
package/generators/app/index.js
CHANGED
|
@@ -25,6 +25,7 @@ const prompts = require('./prompts');
|
|
|
25
25
|
const packagejs = require('../../package.json');
|
|
26
26
|
const statistics = require('../statistics');
|
|
27
27
|
const { appDefaultConfig } = require('../generator-defaults');
|
|
28
|
+
const { GENERATOR_APP } = require('../generator-list');
|
|
28
29
|
const { JHIPSTER_CONFIG_DIR, GENERATOR_JHIPSTER } = require('../generator-constants');
|
|
29
30
|
const { MICROSERVICE } = require('../../jdl/jhipster/application-types');
|
|
30
31
|
const { OptionNames } = require('../../jdl/jhipster/application-options');
|
|
@@ -39,8 +40,6 @@ const {
|
|
|
39
40
|
GENERATOR_SERVER,
|
|
40
41
|
} = require('../generator-list');
|
|
41
42
|
|
|
42
|
-
let useBlueprints;
|
|
43
|
-
|
|
44
43
|
module.exports = class JHipsterAppGenerator extends BaseBlueprintGenerator {
|
|
45
44
|
constructor(args, options, features) {
|
|
46
45
|
super(args, options, { unique: 'namespace', ...features });
|
|
@@ -293,8 +292,12 @@ module.exports = class JHipsterAppGenerator extends BaseBlueprintGenerator {
|
|
|
293
292
|
this.existingProject = this.jhipsterConfig.baseName !== undefined && this.jhipsterConfig.applicationType !== undefined;
|
|
294
293
|
// preserve old jhipsterVersion value for cleanup which occurs after new config is written into disk
|
|
295
294
|
this.jhipsterOldVersion = this.jhipsterConfig.jhipsterVersion;
|
|
295
|
+
}
|
|
296
296
|
|
|
297
|
-
|
|
297
|
+
async _postConstruct() {
|
|
298
|
+
if (!this.fromBlueprint) {
|
|
299
|
+
await this.composeWithBlueprints(GENERATOR_APP);
|
|
300
|
+
}
|
|
298
301
|
}
|
|
299
302
|
|
|
300
303
|
_initializing() {
|
|
@@ -343,7 +346,7 @@ module.exports = class JHipsterAppGenerator extends BaseBlueprintGenerator {
|
|
|
343
346
|
}
|
|
344
347
|
|
|
345
348
|
get initializing() {
|
|
346
|
-
if (
|
|
349
|
+
if (this.delegateToBlueprint) {
|
|
347
350
|
return;
|
|
348
351
|
}
|
|
349
352
|
return this._initializing();
|
|
@@ -358,7 +361,7 @@ module.exports = class JHipsterAppGenerator extends BaseBlueprintGenerator {
|
|
|
358
361
|
}
|
|
359
362
|
|
|
360
363
|
get prompting() {
|
|
361
|
-
if (
|
|
364
|
+
if (this.delegateToBlueprint) return;
|
|
362
365
|
return this._prompting();
|
|
363
366
|
}
|
|
364
367
|
|
|
@@ -385,7 +388,7 @@ module.exports = class JHipsterAppGenerator extends BaseBlueprintGenerator {
|
|
|
385
388
|
}
|
|
386
389
|
|
|
387
390
|
get configuring() {
|
|
388
|
-
if (
|
|
391
|
+
if (this.delegateToBlueprint) return;
|
|
389
392
|
return this._configuring();
|
|
390
393
|
}
|
|
391
394
|
|
|
@@ -402,16 +405,16 @@ module.exports = class JHipsterAppGenerator extends BaseBlueprintGenerator {
|
|
|
402
405
|
* When composing in different tasks the result would be:
|
|
403
406
|
* - composeCommon (app) -> initializing (common) -> prompting (common) -> ... -> composeServer (app) -> initializing (server) -> ...
|
|
404
407
|
*/
|
|
405
|
-
compose() {
|
|
406
|
-
this.composeWithJHipster(GENERATOR_COMMON, true);
|
|
408
|
+
async compose() {
|
|
409
|
+
await this.composeWithJHipster(GENERATOR_COMMON, true);
|
|
407
410
|
if (!this.jhipsterConfig.skipServer) {
|
|
408
|
-
this.composeWithJHipster(GENERATOR_SERVER, true);
|
|
411
|
+
await this.composeWithJHipster(GENERATOR_SERVER, true);
|
|
409
412
|
}
|
|
410
413
|
if (!this.jhipsterConfig.skipClient) {
|
|
411
|
-
this.composeWithJHipster(GENERATOR_CLIENT, true);
|
|
414
|
+
await this.composeWithJHipster(GENERATOR_CLIENT, true);
|
|
412
415
|
}
|
|
413
416
|
if (!this.configOptions.skipI18n) {
|
|
414
|
-
this.composeWithJHipster(
|
|
417
|
+
await this.composeWithJHipster(
|
|
415
418
|
GENERATOR_LANGUAGES,
|
|
416
419
|
{
|
|
417
420
|
regenerate: true,
|
|
@@ -441,26 +444,28 @@ module.exports = class JHipsterAppGenerator extends BaseBlueprintGenerator {
|
|
|
441
444
|
this.config.set(config);
|
|
442
445
|
},
|
|
443
446
|
|
|
444
|
-
composeEntities() {
|
|
447
|
+
async composeEntities() {
|
|
445
448
|
if (!this.options.withEntities) return;
|
|
446
|
-
this.composeWithJHipster(GENERATOR_ENTITIES, { skipInstall: true }, true);
|
|
449
|
+
await this.composeWithJHipster(GENERATOR_ENTITIES, { skipInstall: true }, true);
|
|
447
450
|
},
|
|
448
451
|
|
|
449
|
-
composePages() {
|
|
452
|
+
async composePages() {
|
|
450
453
|
if (!this.jhipsterConfig.pages || this.jhipsterConfig.pages.length === 0 || this.configOptions.skipComposePage) return;
|
|
451
454
|
this.configOptions.skipComposePage = true;
|
|
452
|
-
|
|
453
|
-
this.
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
455
|
+
await Promise.all(
|
|
456
|
+
this.jhipsterConfig.pages.map(page => {
|
|
457
|
+
return this.composeWithJHipster(page.generator || GENERATOR_PAGE, [page.name], {
|
|
458
|
+
skipInstall: true,
|
|
459
|
+
page,
|
|
460
|
+
});
|
|
461
|
+
})
|
|
462
|
+
);
|
|
458
463
|
},
|
|
459
464
|
};
|
|
460
465
|
}
|
|
461
466
|
|
|
462
467
|
get composing() {
|
|
463
|
-
if (
|
|
468
|
+
if (this.delegateToBlueprint) return;
|
|
464
469
|
return this._composing();
|
|
465
470
|
}
|
|
466
471
|
|
|
@@ -479,7 +484,7 @@ module.exports = class JHipsterAppGenerator extends BaseBlueprintGenerator {
|
|
|
479
484
|
}
|
|
480
485
|
|
|
481
486
|
get default() {
|
|
482
|
-
if (
|
|
487
|
+
if (this.delegateToBlueprint) return;
|
|
483
488
|
return this._default();
|
|
484
489
|
}
|
|
485
490
|
|
|
@@ -495,7 +500,7 @@ module.exports = class JHipsterAppGenerator extends BaseBlueprintGenerator {
|
|
|
495
500
|
}
|
|
496
501
|
|
|
497
502
|
get writing() {
|
|
498
|
-
if (
|
|
503
|
+
if (this.delegateToBlueprint) return;
|
|
499
504
|
return this._writing();
|
|
500
505
|
}
|
|
501
506
|
|
|
@@ -512,7 +517,7 @@ module.exports = class JHipsterAppGenerator extends BaseBlueprintGenerator {
|
|
|
512
517
|
}
|
|
513
518
|
|
|
514
519
|
get install() {
|
|
515
|
-
if (
|
|
520
|
+
if (this.delegateToBlueprint) return;
|
|
516
521
|
return this._install();
|
|
517
522
|
}
|
|
518
523
|
|
|
@@ -556,7 +561,7 @@ module.exports = class JHipsterAppGenerator extends BaseBlueprintGenerator {
|
|
|
556
561
|
}
|
|
557
562
|
|
|
558
563
|
get end() {
|
|
559
|
-
if (
|
|
564
|
+
if (this.delegateToBlueprint) return;
|
|
560
565
|
return this._end();
|
|
561
566
|
}
|
|
562
567
|
|
package/generators/aws/index.js
CHANGED
|
@@ -28,12 +28,12 @@ const { BUILD_TOOL, BASE_NAME, PROD_DATABASE_TYPE } = OptionNames;
|
|
|
28
28
|
|
|
29
29
|
const { MYSQL, POSTGRESQL, MARIADB } = require('../../jdl/jhipster/database-types');
|
|
30
30
|
|
|
31
|
-
let useBlueprints;
|
|
32
31
|
/* eslint-disable consistent-return */
|
|
33
32
|
module.exports = class extends BaseBlueprintGenerator {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
async _postConstruct() {
|
|
34
|
+
if (!this.fromBlueprint) {
|
|
35
|
+
await this.composeWithBlueprints(GENERATOR_AWS);
|
|
36
|
+
}
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
_initializing() {
|
|
@@ -90,7 +90,7 @@ module.exports = class extends BaseBlueprintGenerator {
|
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
get initializing() {
|
|
93
|
-
if (
|
|
93
|
+
if (this.delegateToBlueprint) return {};
|
|
94
94
|
return this._initializing();
|
|
95
95
|
}
|
|
96
96
|
|
|
@@ -99,7 +99,7 @@ module.exports = class extends BaseBlueprintGenerator {
|
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
get prompting() {
|
|
102
|
-
if (
|
|
102
|
+
if (this.delegateToBlueprint) return {};
|
|
103
103
|
return this._prompting();
|
|
104
104
|
}
|
|
105
105
|
|
|
@@ -128,7 +128,7 @@ module.exports = class extends BaseBlueprintGenerator {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
get configuring() {
|
|
131
|
-
if (
|
|
131
|
+
if (this.delegateToBlueprint) return {};
|
|
132
132
|
return this._configuring();
|
|
133
133
|
}
|
|
134
134
|
|
|
@@ -286,7 +286,7 @@ module.exports = class extends BaseBlueprintGenerator {
|
|
|
286
286
|
}
|
|
287
287
|
|
|
288
288
|
get default() {
|
|
289
|
-
if (
|
|
289
|
+
if (this.delegateToBlueprint) return {};
|
|
290
290
|
return this._default();
|
|
291
291
|
}
|
|
292
292
|
};
|
package/generators/aws/lib/eb.js
CHANGED
|
@@ -36,7 +36,6 @@ const AZURE_WEBAPP_MAVEN_PLUGIN_VERSION = '1.8.0';
|
|
|
36
36
|
const AZURE_WEBAPP_RUNTIME = 'JAVA|11-java11';
|
|
37
37
|
const AZURE_APP_INSIGHTS_STARTER_VERSION = '2.5.1';
|
|
38
38
|
|
|
39
|
-
let useBlueprints;
|
|
40
39
|
/* eslint-disable consistent-return */
|
|
41
40
|
module.exports = class extends BaseBlueprintGenerator {
|
|
42
41
|
constructor(args, options, features) {
|
|
@@ -63,7 +62,12 @@ module.exports = class extends BaseBlueprintGenerator {
|
|
|
63
62
|
this.azureSpringCloudSkipBuild = this.options.skipBuild;
|
|
64
63
|
this.azureSpringCloudSkipDeploy = this.options.skipDeploy || this.options.skipBuild;
|
|
65
64
|
this.azureSpringCloudSkipInsights = this.options.skipInsights;
|
|
66
|
-
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async _postConstruct() {
|
|
68
|
+
if (!this.fromBlueprint) {
|
|
69
|
+
await this.composeWithBlueprints(GENERATOR_AZURE_APP_SERVICE);
|
|
70
|
+
}
|
|
67
71
|
}
|
|
68
72
|
|
|
69
73
|
_initializing() {
|
|
@@ -99,7 +103,7 @@ module.exports = class extends BaseBlueprintGenerator {
|
|
|
99
103
|
}
|
|
100
104
|
|
|
101
105
|
get initializing() {
|
|
102
|
-
if (
|
|
106
|
+
if (this.delegateToBlueprint) return {};
|
|
103
107
|
return this._initializing();
|
|
104
108
|
}
|
|
105
109
|
|
|
@@ -246,7 +250,7 @@ ${chalk.red('https://docs.microsoft.com/en-us/cli/azure/install-azure-cli/?WT.mc
|
|
|
246
250
|
}
|
|
247
251
|
|
|
248
252
|
get prompting() {
|
|
249
|
-
if (
|
|
253
|
+
if (this.delegateToBlueprint) return {};
|
|
250
254
|
return this._prompting();
|
|
251
255
|
}
|
|
252
256
|
|
|
@@ -265,7 +269,7 @@ ${chalk.red('https://docs.microsoft.com/en-us/cli/azure/install-azure-cli/?WT.mc
|
|
|
265
269
|
}
|
|
266
270
|
|
|
267
271
|
get configuring() {
|
|
268
|
-
if (
|
|
272
|
+
if (this.delegateToBlueprint) return {};
|
|
269
273
|
return this._configuring();
|
|
270
274
|
}
|
|
271
275
|
|
|
@@ -485,7 +489,7 @@ which is free for the first 30 days`);
|
|
|
485
489
|
}
|
|
486
490
|
|
|
487
491
|
get default() {
|
|
488
|
-
if (
|
|
492
|
+
if (this.delegateToBlueprint) return {};
|
|
489
493
|
return this._default();
|
|
490
494
|
}
|
|
491
495
|
|
|
@@ -506,7 +510,7 @@ which is free for the first 30 days`);
|
|
|
506
510
|
}
|
|
507
511
|
|
|
508
512
|
get loading() {
|
|
509
|
-
if (
|
|
513
|
+
if (this.delegateToBlueprint) return {};
|
|
510
514
|
return this._loading();
|
|
511
515
|
}
|
|
512
516
|
|
|
@@ -524,7 +528,7 @@ which is free for the first 30 days`);
|
|
|
524
528
|
}
|
|
525
529
|
|
|
526
530
|
get writing() {
|
|
527
|
-
if (
|
|
531
|
+
if (this.delegateToBlueprint) return {};
|
|
528
532
|
return this._writing();
|
|
529
533
|
}
|
|
530
534
|
|
|
@@ -648,7 +652,7 @@ You need a GitHub project correctly configured in order to use GitHub Actions.`
|
|
|
648
652
|
}
|
|
649
653
|
|
|
650
654
|
get end() {
|
|
651
|
-
if (
|
|
655
|
+
if (this.delegateToBlueprint) return {};
|
|
652
656
|
return this._end();
|
|
653
657
|
}
|
|
654
658
|
};
|
|
@@ -32,7 +32,6 @@ const NO_CACHE_PROVIDER = cacheTypes.NO;
|
|
|
32
32
|
const { MAVEN } = require('../../jdl/jhipster/build-tool-types');
|
|
33
33
|
const { GENERATOR_AZURE_SPRING_CLOUD } = require('../generator-list');
|
|
34
34
|
|
|
35
|
-
let useBlueprints;
|
|
36
35
|
/* eslint-disable consistent-return */
|
|
37
36
|
module.exports = class extends BaseBlueprintGenerator {
|
|
38
37
|
constructor(args, options, features) {
|
|
@@ -52,7 +51,12 @@ module.exports = class extends BaseBlueprintGenerator {
|
|
|
52
51
|
|
|
53
52
|
this.azureSpringCloudSkipBuild = this.options.skipBuild;
|
|
54
53
|
this.azureSpringCloudSkipDeploy = this.options.skipDeploy || this.options.skipBuild;
|
|
55
|
-
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async _postConstruct() {
|
|
57
|
+
if (!this.fromBlueprint) {
|
|
58
|
+
await this.composeWithBlueprints(GENERATOR_AZURE_SPRING_CLOUD);
|
|
59
|
+
}
|
|
56
60
|
}
|
|
57
61
|
|
|
58
62
|
_initializing() {
|
|
@@ -89,7 +93,7 @@ module.exports = class extends BaseBlueprintGenerator {
|
|
|
89
93
|
}
|
|
90
94
|
|
|
91
95
|
get initializing() {
|
|
92
|
-
if (
|
|
96
|
+
if (this.delegateToBlueprint) return {};
|
|
93
97
|
return this._initializing();
|
|
94
98
|
}
|
|
95
99
|
|
|
@@ -255,7 +259,7 @@ ${chalk.red('az extension add --name spring-cloud')}`
|
|
|
255
259
|
}
|
|
256
260
|
|
|
257
261
|
get prompting() {
|
|
258
|
-
if (
|
|
262
|
+
if (this.delegateToBlueprint) return {};
|
|
259
263
|
return this._prompting();
|
|
260
264
|
}
|
|
261
265
|
|
|
@@ -272,7 +276,7 @@ ${chalk.red('az extension add --name spring-cloud')}`
|
|
|
272
276
|
}
|
|
273
277
|
|
|
274
278
|
get configuring() {
|
|
275
|
-
if (
|
|
279
|
+
if (this.delegateToBlueprint) return {};
|
|
276
280
|
return this._configuring();
|
|
277
281
|
}
|
|
278
282
|
|
|
@@ -315,7 +319,7 @@ ${chalk.red('az extension add --name spring-cloud')}`
|
|
|
315
319
|
}
|
|
316
320
|
|
|
317
321
|
get default() {
|
|
318
|
-
if (
|
|
322
|
+
if (this.delegateToBlueprint) return {};
|
|
319
323
|
return this._default();
|
|
320
324
|
}
|
|
321
325
|
|
|
@@ -331,7 +335,7 @@ ${chalk.red('az extension add --name spring-cloud')}`
|
|
|
331
335
|
}
|
|
332
336
|
|
|
333
337
|
get loading() {
|
|
334
|
-
if (
|
|
338
|
+
if (this.delegateToBlueprint) return {};
|
|
335
339
|
return this._loading();
|
|
336
340
|
}
|
|
337
341
|
|
|
@@ -359,7 +363,7 @@ ${chalk.red('az extension add --name spring-cloud')}`
|
|
|
359
363
|
}
|
|
360
364
|
|
|
361
365
|
get writing() {
|
|
362
|
-
if (
|
|
366
|
+
if (this.delegateToBlueprint) return {};
|
|
363
367
|
return this._writing();
|
|
364
368
|
}
|
|
365
369
|
|
|
@@ -485,7 +489,7 @@ for more detailed information.`
|
|
|
485
489
|
}
|
|
486
490
|
|
|
487
491
|
get end() {
|
|
488
|
-
if (
|
|
492
|
+
if (this.delegateToBlueprint) return {};
|
|
489
493
|
return this._end();
|
|
490
494
|
}
|
|
491
495
|
};
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
* limitations under the License.
|
|
18
18
|
*/
|
|
19
19
|
const { State } = require('mem-fs-editor');
|
|
20
|
-
const filter = require('gulp-filter');
|
|
21
20
|
const _ = require('lodash');
|
|
22
|
-
const path = require('path');
|
|
23
21
|
const {
|
|
24
|
-
|
|
22
|
+
createConflicterCheckTransform,
|
|
25
23
|
createConflicterStatusTransform,
|
|
26
24
|
createYoRcTransform,
|
|
27
25
|
createYoResolveTransform,
|
|
28
|
-
|
|
26
|
+
patternFilter,
|
|
27
|
+
patternSpy,
|
|
28
|
+
} = require('yeoman-environment/transform');
|
|
29
29
|
|
|
30
30
|
const { hasState, setModifiedFileState } = State;
|
|
31
31
|
|
|
@@ -101,17 +101,17 @@ module.exports = class extends BaseGenerator {
|
|
|
101
101
|
this.debug('Skipping commit prettier');
|
|
102
102
|
return;
|
|
103
103
|
}
|
|
104
|
-
await this._commitSharedFs(this.env.sharedFs.stream().pipe(
|
|
104
|
+
await this._commitSharedFs(this.env.sharedFs.stream().pipe(patternFilter('**/{.prettierrc**,.prettierignore}')), true);
|
|
105
105
|
},
|
|
106
106
|
async commitFiles() {
|
|
107
107
|
if (this.options.skipCommit) {
|
|
108
108
|
this.debug('Skipping commit files');
|
|
109
109
|
return;
|
|
110
110
|
}
|
|
111
|
-
await this._commitSharedFs();
|
|
112
111
|
this.env.sharedFs.once('change', () => {
|
|
113
112
|
this._queueCommit();
|
|
114
113
|
});
|
|
114
|
+
await this._commitSharedFs();
|
|
115
115
|
},
|
|
116
116
|
};
|
|
117
117
|
}
|
|
@@ -128,11 +128,11 @@ module.exports = class extends BaseGenerator {
|
|
|
128
128
|
this.queueTask(
|
|
129
129
|
{
|
|
130
130
|
method: async () => {
|
|
131
|
-
await this._commitSharedFs();
|
|
132
131
|
this.debug('Adding queueCommit event listener');
|
|
133
132
|
this.env.sharedFs.once('change', () => {
|
|
134
133
|
this._queueCommit();
|
|
135
134
|
});
|
|
135
|
+
await this._commitSharedFs();
|
|
136
136
|
},
|
|
137
137
|
},
|
|
138
138
|
{
|
|
@@ -147,63 +147,53 @@ module.exports = class extends BaseGenerator {
|
|
|
147
147
|
* @param {Stream} [stream] - files stream, defaults to this.sharedFs.stream().
|
|
148
148
|
* @return {Promise}
|
|
149
149
|
*/
|
|
150
|
-
_commitSharedFs(stream = this.env.sharedFs.stream(), skipPrettier = this.options.skipPrettier) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
(
|
|
156
|
-
(path.extname(file.path) === '.json' && path.basename(path.dirname(file.path)) === '.jhipster'))
|
|
157
|
-
) {
|
|
158
|
-
if (!hasState(file) && !this.options.reproducibleTests) {
|
|
159
|
-
setModifiedFileState(file);
|
|
160
|
-
}
|
|
150
|
+
async _commitSharedFs(stream = this.env.sharedFs.stream(), skipPrettier = this.options.skipPrettier) {
|
|
151
|
+
// JDL writes directly to disk, set the file as modified so prettier will be applied
|
|
152
|
+
stream = stream.pipe(
|
|
153
|
+
patternSpy(file => {
|
|
154
|
+
if (file.contents && !hasState(file) && !this.options.reproducibleTests) {
|
|
155
|
+
setModifiedFileState(file);
|
|
161
156
|
}
|
|
162
|
-
})
|
|
163
|
-
|
|
164
|
-
const transformStreams = [
|
|
165
|
-
// multi-step changes the file path, should be executed earlier in the pipeline
|
|
166
|
-
new MultiStepTransform(),
|
|
167
|
-
...yoResolveTranform,
|
|
168
|
-
createYoRcTransform(),
|
|
169
|
-
createEachFileTransform(file => {
|
|
170
|
-
if (path.extname(file.path) === '.json' && path.basename(path.dirname(file.path)) === '.jhipster') {
|
|
171
|
-
file.conflicter = 'force';
|
|
172
|
-
}
|
|
173
|
-
return file;
|
|
174
|
-
}),
|
|
175
|
-
];
|
|
176
|
-
|
|
177
|
-
if (this.jhipsterConfig.withGeneratedFlag) {
|
|
178
|
-
transformStreams.push(generatedAnnotationTransform(this));
|
|
179
|
-
}
|
|
157
|
+
}, '**/{.yo-rc.json,.jhipster/*.json}').name('jhipster:config-files:modify')
|
|
158
|
+
);
|
|
180
159
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
160
|
+
const conflicterStatus = {
|
|
161
|
+
fileActions: [
|
|
162
|
+
{
|
|
163
|
+
key: 'i',
|
|
164
|
+
name: 'ignore, do not overwrite and remember (experimental)',
|
|
165
|
+
value: ({ relativeFilePath }) => {
|
|
166
|
+
this.env.fs.append(`${this.env.cwd}/.yo-resolve`, `${relativeFilePath} skip`, { create: true });
|
|
167
|
+
return 'skip';
|
|
168
|
+
},
|
|
169
|
+
},
|
|
170
|
+
],
|
|
171
|
+
};
|
|
190
172
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
)
|
|
173
|
+
const yoResolveTranform = this.options.skipYoResolve ? [] : [createYoResolveTransform(this.env.conflicter)];
|
|
174
|
+
const transformStreams = [
|
|
175
|
+
// multi-step changes the file path, should be executed earlier in the pipeline
|
|
176
|
+
new MultiStepTransform(),
|
|
177
|
+
...yoResolveTranform,
|
|
178
|
+
createYoRcTransform(),
|
|
179
|
+
patternSpy(file => {
|
|
180
|
+
file.conflicter = 'force';
|
|
181
|
+
}, '**/.jhipster/*.json').name('jhipster:config-files:force'),
|
|
182
|
+
];
|
|
183
|
+
|
|
184
|
+
if (this.jhipsterConfig.withGeneratedFlag) {
|
|
185
|
+
transformStreams.push(generatedAnnotationTransform(this));
|
|
186
|
+
}
|
|
195
187
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
188
|
+
if (!skipPrettier) {
|
|
189
|
+
const prettierOptions = { packageJson: true, java: !this.skipServer && !this.jhipsterConfig.skipServer };
|
|
190
|
+
// Prettier is clever, it uses correct rules and correct parser according to file extension.
|
|
191
|
+
transformStreams.push(prettierTransform(prettierOptions, this, this.options.ignoreErrors));
|
|
192
|
+
}
|
|
201
193
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
});
|
|
206
|
-
});
|
|
194
|
+
transformStreams.push(createConflicterCheckTransform(this.env.conflicter, conflicterStatus), createConflicterStatusTransform());
|
|
195
|
+
|
|
196
|
+
await this.env.fs.commit(transformStreams, stream);
|
|
207
197
|
}
|
|
208
198
|
|
|
209
199
|
_createUserManagementEntities() {
|