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.
Files changed (154) hide show
  1. package/cli/jhipster-command.js +2 -2
  2. package/cli/program.js +31 -29
  3. package/generators/app/index.js +30 -25
  4. package/generators/aws/index.js +8 -8
  5. package/generators/aws/lib/eb.js +1 -1
  6. package/generators/azure-app-service/index.js +13 -9
  7. package/generators/azure-spring-cloud/index.js +13 -9
  8. package/generators/bootstrap/index.js +49 -59
  9. package/generators/ci-cd/index.js +10 -8
  10. package/generators/client/files-common.js +6 -2
  11. package/generators/client/files-react.js +10 -1
  12. package/generators/client/files-vue.js +40 -1
  13. package/generators/client/index.js +42 -31
  14. package/generators/client/needle-api/needle-client-vue.js +1 -1
  15. package/generators/client/templates/angular/.eslintrc.json.ejs +1 -0
  16. package/generators/client/templates/angular/package.json +14 -14
  17. package/generators/client/templates/angular/src/main/webapp/app/admin/metrics/blocks/jvm-memory/jvm-memory.component.html.ejs +2 -2
  18. package/generators/client/templates/common/package.json +3 -3
  19. package/generators/client/templates/common/webpack/webpack.microfrontend.js.jhi.ejs +56 -0
  20. package/generators/client/templates/react/.eslintrc.json.ejs +1 -0
  21. package/generators/client/templates/react/package.json +44 -43
  22. package/generators/client/templates/react/package.json.ejs +3 -0
  23. package/generators/client/templates/react/src/main/webapp/app/app.scss.ejs +0 -3
  24. package/generators/client/templates/react/src/main/webapp/app/modules/administration/configuration/configuration.tsx.ejs +2 -2
  25. package/generators/client/templates/react/src/main/webapp/app/modules/administration/gateway/gateway.tsx.ejs +2 -2
  26. package/generators/client/templates/react/src/main/webapp/app/modules/administration/metrics/metrics.tsx.ejs +6 -6
  27. package/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management.tsx.ejs +8 -8
  28. package/generators/client/templates/react/src/main/webapp/app/modules/home/home.tsx.ejs +1 -1
  29. package/generators/client/templates/react/src/main/webapp/app/shared/layout/header/header.tsx.ejs +1 -1
  30. package/generators/client/templates/react/src/main/webapp/app/shared/layout/menus/account.tsx.ejs +3 -3
  31. package/generators/client/templates/react/src/main/webapp/app/shared/layout/menus/admin.tsx.ejs +7 -7
  32. package/generators/client/templates/react/src/main/webapp/app/shared/layout/menus/menu-components.tsx.ejs +1 -1
  33. package/generators/client/templates/react/webpack/webpack.dev.js.ejs +17 -1
  34. package/generators/client/templates/react/webpack/webpack.prod.js.ejs +13 -1
  35. package/generators/client/templates/vue/.eslintrc.js.ejs +8 -5
  36. package/generators/client/templates/vue/package.json +31 -38
  37. package/generators/client/templates/vue/package.json.ejs +8 -10
  38. package/generators/client/templates/vue/src/main/webapp/app/account/account.service.ts.ejs +1 -2
  39. package/generators/client/templates/vue/src/main/webapp/app/account/settings/settings.vue.ejs +7 -1
  40. package/generators/client/templates/vue/src/main/webapp/app/admin/configuration/configuration.vue.ejs +1 -1
  41. package/generators/client/templates/vue/src/main/webapp/app/admin/metrics/metrics.component.ts.ejs +1 -1
  42. package/generators/client/templates/vue/src/main/webapp/app/core/jhi-navbar/jhi-navbar.component.ts.ejs +12 -1
  43. package/generators/client/templates/vue/src/main/webapp/app/core/jhi-navbar/jhi-navbar.vue.ejs +6 -0
  44. package/generators/client/templates/vue/src/main/webapp/app/declarations.d.ts.ejs +41 -0
  45. package/generators/client/templates/vue/src/main/webapp/app/entities/entities-menu.component.ts.ejs +34 -0
  46. package/generators/client/templates/vue/src/main/webapp/app/entities/entities-menu.vue.ejs +13 -0
  47. package/generators/client/templates/vue/src/main/webapp/app/entities/entities.component.ts.ejs +12 -0
  48. package/generators/client/templates/vue/src/main/webapp/app/entities/entities.vue.ejs +5 -0
  49. package/generators/client/templates/vue/src/main/webapp/app/index.ts.ejs +19 -0
  50. package/generators/client/templates/vue/src/main/webapp/app/locale/translation.service.ts.ejs +25 -8
  51. package/generators/client/templates/vue/src/main/webapp/app/main.ts.ejs +9 -4
  52. package/generators/client/templates/vue/src/main/webapp/app/router/entities.ts.ejs +44 -1
  53. package/generators/client/templates/vue/src/main/webapp/app/router/index.ts.ejs +11 -0
  54. package/generators/client/templates/vue/src/main/webapp/app/shims-vue.d.ts.ejs +0 -10
  55. package/generators/client/templates/vue/src/test/javascript/jest.conf.js.ejs +19 -8
  56. package/generators/client/templates/vue/src/test/javascript/spec/app/entities/entities-menu.spec.ts.ejs +52 -0
  57. package/generators/client/templates/vue/src/test/javascript/spec/app/microfrontends/entities-menu.component.ts.ejs +4 -0
  58. package/generators/client/templates/vue/src/test/javascript/spec/app/microfrontends/entities-menu.vue.ejs +7 -0
  59. package/generators/client/templates/vue/src/test/javascript/spec/app/microfrontends/entities-router.ts.ejs +1 -0
  60. package/generators/client/templates/vue/tsconfig.json.ejs +5 -9
  61. package/generators/client/templates/vue/tsconfig.spec.json.ejs +37 -0
  62. package/generators/client/templates/vue/webpack/config.js.ejs +2 -0
  63. package/generators/client/templates/vue/webpack/vue.utils.js.ejs +13 -12
  64. package/generators/client/templates/vue/webpack/webpack.common.js.ejs +64 -50
  65. package/generators/client/templates/vue/webpack/webpack.dev.js.ejs +17 -68
  66. package/generators/client/templates/vue/webpack/webpack.microfrontend.js.jhi.vue.ejs +77 -0
  67. package/generators/client/templates/vue/webpack/webpack.prod.js.ejs +1 -30
  68. package/generators/cloudfoundry/index.js +9 -9
  69. package/generators/common/index.js +12 -10
  70. package/generators/common/templates/package.json +4 -4
  71. package/generators/cypress/index.js +12 -9
  72. package/generators/cypress/templates/cypress.json.ejs +3 -0
  73. package/generators/cypress/templates/src/test/javascript/cypress/plugins/index.ts.ejs +3 -3
  74. package/generators/cypress/templates/src/test/javascript/cypress/support/entity.ts.ejs +2 -2
  75. package/generators/database-changelog/index.js +33 -22
  76. package/generators/database-changelog-liquibase/index.js +12 -8
  77. package/generators/docker-compose/index.js +11 -12
  78. package/generators/entities/index.js +35 -26
  79. package/generators/entities-client/index.js +10 -7
  80. package/generators/entity/index.js +25 -28
  81. package/generators/entity-client/files.js +6 -11
  82. package/generators/entity-client/index.js +9 -7
  83. package/generators/entity-client/templates/common/src/test/javascript/cypress/integration/entity/entity.spec.ts.ejs +4 -4
  84. package/generators/entity-client/templates/react/src/main/webapp/app/entities/entity-update.tsx.ejs +1 -1
  85. package/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs +7 -7
  86. package/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity.component.ts.ejs +2 -1
  87. package/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity.service.ts.ejs +2 -6
  88. package/generators/entity-i18n/index.js +7 -4
  89. package/generators/entity-server/index.js +11 -8
  90. package/generators/entity-server/templates/src/main/java/package/web/rest/EntityResource.java.ejs +39 -41
  91. package/generators/gae/index.js +10 -10
  92. package/generators/generator-base-blueprint.js +7 -44
  93. package/generators/generator-base.js +7 -0
  94. package/generators/generator-constants.js +20 -18
  95. package/generators/generator-transforms.js +27 -23
  96. package/generators/heroku/index.js +12 -10
  97. package/generators/init/constants.cjs +1 -1
  98. package/generators/kubernetes/files.js +3 -0
  99. package/generators/kubernetes/index.js +10 -10
  100. package/generators/kubernetes/templates/db/couchbase.yml.ejs +1 -1
  101. package/generators/kubernetes/templates/deployment.yml.ejs +8 -3
  102. package/generators/kubernetes/templates/istio/destination-rule.yml.ejs +1 -1
  103. package/generators/kubernetes/templates/istio/gateway/grafana-gateway.yml.ejs +5 -2
  104. package/generators/kubernetes/templates/istio/gateway/jhipster-grafana-gateway.yml.ejs +5 -2
  105. package/generators/kubernetes/templates/istio/gateway/kiali-gateway.yml.ejs +10 -8
  106. package/generators/kubernetes/templates/istio/gateway/zipkin-gateway.yml.ejs +5 -2
  107. package/generators/kubernetes/templates/istio/gateway.yml.ejs +7 -5
  108. package/generators/kubernetes/templates/secret/couchbase-secret.yml.ejs +9 -0
  109. package/generators/kubernetes-base.js +1 -0
  110. package/generators/kubernetes-helm/files.js +3 -8
  111. package/generators/kubernetes-helm/index.js +10 -10
  112. package/generators/kubernetes-helm/templates/README-KUBERNETES-HELM.md.ejs +0 -1
  113. package/generators/kubernetes-helm/templates/app/Chart.yml.ejs +5 -0
  114. package/generators/kubernetes-helm/templates/app/helpers.tpl.ejs +0 -11
  115. package/generators/kubernetes-helm/templates/app/requirements.yml.ejs +5 -0
  116. package/generators/kubernetes-helm/templates/app/values.yml.ejs +68 -5
  117. package/generators/kubernetes-helm/templates/csvc/Chart.yml.ejs +1 -1
  118. package/generators/kubernetes-helm/templates/csvc/requirements.yml.ejs +1 -1
  119. package/generators/kubernetes-knative/index.js +10 -10
  120. package/generators/kubernetes-knative/templates/istio/gateway.yml.ejs +6 -4
  121. package/generators/kubernetes-knative/templates/service.yml.ejs +1 -1
  122. package/generators/languages/index.js +13 -13
  123. package/generators/openapi-client/index.js +13 -10
  124. package/generators/openshift/index.js +10 -11
  125. package/generators/openshift/templates/deployment.yml.ejs +1 -1
  126. package/generators/page/index.js +12 -10
  127. package/generators/server/__snapshots__/generator.spec.mjs.snap +12 -0
  128. package/generators/server/files.js +12 -0
  129. package/generators/server/index.js +32 -18
  130. package/generators/server/templates/gradle.properties.ejs +10 -10
  131. package/generators/server/templates/pom.xml.ejs +6 -6
  132. package/generators/server/templates/src/main/docker/app.yml.ejs +1 -1
  133. package/generators/server/templates/src/main/java/package/config/SecurityConfiguration_reactive.java.ejs +2 -2
  134. package/generators/server/templates/src/main/java/package/config/WebConfigurer.java.ejs +0 -1
  135. package/generators/server/templates/src/main/java/package/management/SecurityMetersService.java.ejs +68 -0
  136. package/generators/server/templates/src/main/java/package/security/jwt/TokenProvider.java.ejs +29 -4
  137. package/generators/server/templates/src/main/java/package/security/oauth2/CustomClaimConverter.java.ejs +21 -9
  138. package/generators/server/templates/src/main/java/package/service/UserService.java.ejs +13 -5
  139. package/generators/server/templates/src/main/resources/static/microservices_index.html.ejs +1 -1
  140. package/generators/server/templates/src/test/java/package/management/SecurityMetersServiceTests.java.ejs +113 -0
  141. package/generators/server/templates/src/test/java/package/security/jwt/JWTFilterTest.java.ejs +6 -1
  142. package/generators/server/templates/src/test/java/package/security/jwt/TokenProviderSecurityMetersTests.java.ejs +198 -0
  143. package/generators/server/templates/src/test/java/package/security/jwt/TokenProviderTest.java.ejs +13 -3
  144. package/generators/server/templates/src/test/java/package/security/oauth2/AuthorizationHeaderUtilTest.java.ejs +16 -2
  145. package/generators/server/templates/src/test/java/package/security/oauth2/CustomClaimConverterIT.java.ejs +63 -0
  146. package/generators/spring-controller/index.js +9 -7
  147. package/generators/spring-service/index.js +10 -7
  148. package/generators/upgrade/index.js +3 -4
  149. package/generators/utils.js +2 -2
  150. package/generators/workspaces/index.js +16 -7
  151. package/jdl/jhipster/default-application-options.js +9 -7
  152. package/package.json +15 -15
  153. package/utils/entity.js +14 -0
  154. package/utils/multi-step-transform/index.js +8 -8
@@ -29,8 +29,6 @@ const { GENERATOR_CI_CD } = require('../generator-list');
29
29
 
30
30
  const REACT = constants.SUPPORTED_CLIENT_FRAMEWORKS.REACT;
31
31
 
32
- let useBlueprints;
33
-
34
32
  module.exports = class extends BaseBlueprintGenerator {
35
33
  constructor(args, options, features) {
36
34
  super(args, options, features);
@@ -76,8 +74,12 @@ module.exports = class extends BaseBlueprintGenerator {
76
74
  defaults: false,
77
75
  description: 'Automatically configure CircleCI',
78
76
  });
77
+ }
79
78
 
80
- useBlueprints = !this.fromBlueprint && this.instantiateBlueprints(GENERATOR_CI_CD);
79
+ async _postConstruct() {
80
+ if (!this.fromBlueprint) {
81
+ await this.composeWithBlueprints(GENERATOR_CI_CD);
82
+ }
81
83
  }
82
84
 
83
85
  // Public API method used by the getter and also by Blueprints
@@ -130,7 +132,7 @@ module.exports = class extends BaseBlueprintGenerator {
130
132
  }
131
133
 
132
134
  get initializing() {
133
- if (useBlueprints) return;
135
+ if (this.delegateToBlueprint) return {};
134
136
  return this._initializing();
135
137
  }
136
138
 
@@ -143,7 +145,7 @@ module.exports = class extends BaseBlueprintGenerator {
143
145
  }
144
146
 
145
147
  get prompting() {
146
- if (useBlueprints) return;
148
+ if (this.delegateToBlueprint) return {};
147
149
  return this._prompting();
148
150
  }
149
151
 
@@ -172,7 +174,7 @@ module.exports = class extends BaseBlueprintGenerator {
172
174
  }
173
175
 
174
176
  get configuring() {
175
- if (useBlueprints) return;
177
+ if (this.delegateToBlueprint) return {};
176
178
  return this._configuring();
177
179
  }
178
180
 
@@ -203,7 +205,7 @@ module.exports = class extends BaseBlueprintGenerator {
203
205
  }
204
206
 
205
207
  get loading() {
206
- if (useBlueprints) return;
208
+ if (this.delegateToBlueprint) return {};
207
209
  return this._loading();
208
210
  }
209
211
 
@@ -255,7 +257,7 @@ module.exports = class extends BaseBlueprintGenerator {
255
257
  }
256
258
 
257
259
  get writing() {
258
- if (useBlueprints) return;
260
+ if (this.delegateToBlueprint) return {};
259
261
  return this._writing();
260
262
  }
261
263
  };
@@ -62,14 +62,18 @@ const commonFiles = {
62
62
  ],
63
63
  },
64
64
  {
65
- condition: generator => generator.enableI18nRTL,
65
+ condition: generator => generator.enableI18nRTL && !generator.clientFrameworkReact,
66
66
  path: CLIENT_MAIN_SRC_DIR,
67
67
  templates: ['content/scss/rtl.scss'],
68
68
  },
69
+ {
70
+ condition: generator => generator.microfrontend,
71
+ templates: ['webpack/webpack.microfrontend.js.jhi'],
72
+ },
69
73
  ],
70
74
  swagger: [
71
75
  {
72
- condition: generator => !generator.applicationTypeMicroservice,
76
+ condition: generator => !generator.applicationTypeMicroservice || generator.microfrontend,
73
77
  path: CLIENT_MAIN_SRC_DIR,
74
78
  templates: ['swagger-ui/index.html', { file: 'swagger-ui/dist/images/throbber.gif', method: 'copy' }],
75
79
  },
@@ -21,7 +21,7 @@ const { OAUTH2, SESSION } = require('../../jdl/jhipster/authentication-types');
21
21
  const { GATEWAY } = require('../../jdl/jhipster/application-types');
22
22
  const constants = require('../generator-constants');
23
23
 
24
- const { CLIENT_TEST_SRC_DIR, REACT_DIR } = constants;
24
+ const { CLIENT_MAIN_SRC_DIR, CLIENT_TEST_SRC_DIR, REACT_DIR } = constants;
25
25
 
26
26
  /**
27
27
  * The default is to use a file path string. It implies use of the template method.
@@ -338,8 +338,17 @@ const files = {
338
338
  module.exports = {
339
339
  writeFiles,
340
340
  files,
341
+ cleanup,
341
342
  };
342
343
 
344
+ function cleanup() {
345
+ if (!this.clientFrameworkReact) return;
346
+
347
+ if (this.isJhipsterVersionLessThan('7.4.0') && this.enableI18nRTL) {
348
+ this.removeFile(`${CLIENT_MAIN_SRC_DIR}content/scss/rtl.scss`);
349
+ }
350
+ }
351
+
343
352
  function writeFiles() {
344
353
  // write React files
345
354
  return this.writeFilesToDisk(files, 'react');
@@ -36,6 +36,7 @@ const vueFiles = {
36
36
  templates: [
37
37
  'package.json',
38
38
  'tsconfig.json',
39
+ 'tsconfig.spec.json',
39
40
  '.postcssrc.js',
40
41
  '.eslintrc.js',
41
42
  'webpack/config.js',
@@ -50,6 +51,43 @@ const vueFiles = {
50
51
  templates: ['tsconfig.e2e.json'],
51
52
  },
52
53
  ],
54
+ entities: [
55
+ {
56
+ path: VUE_DIR,
57
+ templates: [
58
+ 'entities/entities.component.ts',
59
+ 'entities/entities.vue',
60
+ 'entities/entities-menu.component.ts',
61
+ 'entities/entities-menu.vue',
62
+ 'router/entities.ts',
63
+ ],
64
+ },
65
+ ],
66
+ microfrontend: [
67
+ {
68
+ condition: generator => generator.microfrontend,
69
+ templates: ['webpack/webpack.microfrontend.js.jhi.vue'],
70
+ },
71
+ {
72
+ condition: generator => generator.microfrontend,
73
+ path: VUE_DIR,
74
+ templates: ['index.ts'],
75
+ },
76
+ {
77
+ condition: generator => generator.microfrontend,
78
+ path: CLIENT_TEST_SRC_DIR,
79
+ templates: [
80
+ 'spec/app/microfrontends/entities-menu.component.ts',
81
+ 'spec/app/microfrontends/entities-menu.vue',
82
+ 'spec/app/microfrontends/entities-router.ts',
83
+ ],
84
+ },
85
+ {
86
+ condition: generator => generator.applicationTypeMicroservice,
87
+ path: CLIENT_TEST_SRC_DIR,
88
+ templates: ['spec/app/entities/entities-menu.spec.ts'],
89
+ },
90
+ ],
53
91
  sass: [
54
92
  {
55
93
  path: CLIENT_MAIN_SRC_DIR,
@@ -64,6 +102,7 @@ const vueFiles = {
64
102
  'app.component.ts',
65
103
  'shims-vue.d.ts',
66
104
  'constants.ts',
105
+ 'declarations.d.ts',
67
106
  'main.ts',
68
107
  'shared/alert/alert.service.ts',
69
108
  'shared/config/axios-interceptor.ts',
@@ -74,7 +113,6 @@ const vueFiles = {
74
113
  'shared/security/authority.ts',
75
114
  'router/index.ts',
76
115
  'router/admin.ts',
77
- 'router/entities.ts',
78
116
  'router/pages.ts',
79
117
  ],
80
118
  },
@@ -347,6 +385,7 @@ function customizeFiles() {
347
385
  'app/core/jhi-navbar/jhi-navbar.vue',
348
386
  'app/core/ribbon/ribbon.vue',
349
387
  'app/shared/jhi-item-count.vue',
388
+ 'app/entities/entities-menu.vue',
350
389
  ]);
351
390
  if (this.withAdminUi) {
352
391
  utils.vueReplaceTranslation(this, [
@@ -22,7 +22,7 @@ const _ = require('lodash');
22
22
  const BaseBlueprintGenerator = require('../generator-base-blueprint');
23
23
  const prompts = require('./prompts');
24
24
  const writeAngularFiles = require('./files-angular').writeFiles;
25
- const writeReactFiles = require('./files-react').writeFiles;
25
+ const { cleanup: cleanupReact, writeFiles: writeReactFiles } = require('./files-react');
26
26
  const { cleanup: cleanupVue, writeFiles: writeVueFiles, customizeFiles: customizeVueFiles } = require('./files-vue');
27
27
  const writeCommonFiles = require('./files-common').writeFiles;
28
28
  const { clientI18nFiles } = require('../languages/files');
@@ -44,8 +44,6 @@ const { CommonDBTypes } = require('../../jdl/jhipster/field-types');
44
44
  const TYPE_STRING = CommonDBTypes.STRING;
45
45
  const TYPE_UUID = CommonDBTypes.UUID;
46
46
 
47
- let useBlueprints;
48
-
49
47
  module.exports = class JHipsterClientGenerator extends BaseBlueprintGenerator {
50
48
  constructor(args, options, features) {
51
49
  super(args, options, { unique: 'namespace', ...features });
@@ -76,8 +74,12 @@ module.exports = class JHipsterClientGenerator extends BaseBlueprintGenerator {
76
74
  this.loadRuntimeOptions();
77
75
 
78
76
  this.existingProject = !!this.jhipsterConfig.clientFramework;
77
+ }
79
78
 
80
- useBlueprints = !this.fromBlueprint && this.instantiateBlueprints(GENERATOR_CLIENT);
79
+ async _postConstruct() {
80
+ if (!this.fromBlueprint) {
81
+ await this.composeWithBlueprints(GENERATOR_CLIENT);
82
+ }
81
83
  }
82
84
 
83
85
  // Public API method used by the getter and also by Blueprints
@@ -108,7 +110,7 @@ module.exports = class JHipsterClientGenerator extends BaseBlueprintGenerator {
108
110
  }
109
111
 
110
112
  get initializing() {
111
- if (useBlueprints) return;
113
+ if (this.delegateToBlueprint) return {};
112
114
  return this._initializing();
113
115
  }
114
116
 
@@ -124,7 +126,7 @@ module.exports = class JHipsterClientGenerator extends BaseBlueprintGenerator {
124
126
  }
125
127
 
126
128
  get prompting() {
127
- if (useBlueprints) return;
129
+ if (this.delegateToBlueprint) return {};
128
130
  return this._prompting();
129
131
  }
130
132
 
@@ -160,32 +162,32 @@ module.exports = class JHipsterClientGenerator extends BaseBlueprintGenerator {
160
162
  }
161
163
 
162
164
  get configuring() {
163
- if (useBlueprints) return;
165
+ if (this.delegateToBlueprint) return {};
164
166
  return this._configuring();
165
167
  }
166
168
 
167
169
  // Public API method used by the getter and also by Blueprints
168
170
  _composing() {
169
171
  return {
170
- composeCommon() {
171
- this.composeWithJHipster(GENERATOR_COMMON, true);
172
+ async composeCommon() {
173
+ await this.composeWithJHipster(GENERATOR_COMMON, true);
172
174
  },
173
- composeCypress() {
175
+ async composeCypress() {
174
176
  const testFrameworks = this.jhipsterConfig.testFrameworks;
175
177
  if (!Array.isArray(testFrameworks) || !testFrameworks.includes(CYPRESS)) return;
176
- this.composeWithJHipster(GENERATOR_CYPRESS, { existingProject: this.existingProject }, true);
178
+ await this.composeWithJHipster(GENERATOR_CYPRESS, { existingProject: this.existingProject }, true);
177
179
  },
178
- composeLanguages() {
180
+ async composeLanguages() {
179
181
  // We don't expose client/server to cli, composing with languages is used for test purposes.
180
182
  if (this.jhipsterConfig.enableTranslation === false) return;
181
183
 
182
- this.composeWithJHipster(GENERATOR_LANGUAGES, true);
184
+ await this.composeWithJHipster(GENERATOR_LANGUAGES, true);
183
185
  },
184
186
  };
185
187
  }
186
188
 
187
189
  get composing() {
188
- if (useBlueprints) return;
190
+ if (this.delegateToBlueprint) return {};
189
191
  return this._composing();
190
192
  }
191
193
 
@@ -202,12 +204,6 @@ module.exports = class JHipsterClientGenerator extends BaseBlueprintGenerator {
202
204
  this.loadTranslationConfig();
203
205
  },
204
206
 
205
- checkMicrofrontend() {
206
- if (this.microfrontend && !this.clientFrameworkAngular) {
207
- throw new Error(`Microfrontend requires ${ANGULAR} client framework.`);
208
- }
209
- },
210
-
211
207
  validateSkipServer() {
212
208
  if (
213
209
  this.jhipsterConfig.skipServer &&
@@ -243,7 +239,7 @@ module.exports = class JHipsterClientGenerator extends BaseBlueprintGenerator {
243
239
  }
244
240
 
245
241
  get loading() {
246
- if (useBlueprints) return;
242
+ if (this.delegateToBlueprint) return {};
247
243
  return this._loading();
248
244
  }
249
245
 
@@ -283,7 +279,7 @@ module.exports = class JHipsterClientGenerator extends BaseBlueprintGenerator {
283
279
  }
284
280
 
285
281
  get preparing() {
286
- if (useBlueprints) return;
282
+ if (this.delegateToBlueprint) return {};
287
283
  return this._preparing();
288
284
  }
289
285
 
@@ -300,6 +296,14 @@ module.exports = class JHipsterClientGenerator extends BaseBlueprintGenerator {
300
296
  this.userPrimaryKeyTypeUUID = this.user.primaryKey.type === TYPE_UUID;
301
297
  },
302
298
 
299
+ loadEntities() {
300
+ if (!this.configOptions.sharedEntities || (this.applicationTypeGateway && this.microfrontend)) {
301
+ this.localEntities = [];
302
+ return;
303
+ }
304
+ this.localEntities = Object.values(this.configOptions.sharedEntities).filter(entity => !entity.builtIn);
305
+ },
306
+
303
307
  insight() {
304
308
  statistics.sendSubGenEvent('generator', GENERATOR_CLIENT, {
305
309
  app: {
@@ -314,31 +318,32 @@ module.exports = class JHipsterClientGenerator extends BaseBlueprintGenerator {
314
318
  }
315
319
 
316
320
  get default() {
317
- if (useBlueprints) return;
321
+ if (this.delegateToBlueprint) return {};
318
322
  return this._default();
319
323
  }
320
324
 
321
325
  // Public API method used by the getter and also by Blueprints
322
326
  _writing() {
323
327
  return {
328
+ cleanupReact,
324
329
  cleanupVue,
325
330
 
326
331
  write() {
327
332
  if (this.skipClient) return;
328
333
  switch (this.clientFramework) {
329
334
  case ANGULAR:
330
- return writeAngularFiles.call(this, useBlueprints);
335
+ return writeAngularFiles.call(this);
331
336
  case REACT:
332
- return writeReactFiles.call(this, useBlueprints);
337
+ return writeReactFiles.call(this);
333
338
  case VUE:
334
- return writeVueFiles.call(this, useBlueprints);
339
+ return writeVueFiles.call(this);
335
340
  default:
336
341
  // do nothing by default
337
342
  }
338
343
  },
339
344
  writeCommonFiles() {
340
345
  if (this.skipClient) return;
341
- return writeCommonFiles.call(this, useBlueprints);
346
+ return writeCommonFiles.call(this);
342
347
  },
343
348
 
344
349
  ...super._missingPostWriting(),
@@ -346,7 +351,7 @@ module.exports = class JHipsterClientGenerator extends BaseBlueprintGenerator {
346
351
  }
347
352
 
348
353
  get writing() {
349
- if (useBlueprints) return;
354
+ if (this.delegateToBlueprint) return {};
350
355
  return this._writing();
351
356
  }
352
357
 
@@ -385,13 +390,19 @@ module.exports = class JHipsterClientGenerator extends BaseBlueprintGenerator {
385
390
 
386
391
  microfrontend() {
387
392
  if (!this.microfrontend) return;
388
- this.addWebpackConfig("require('./webpack.microfrontend')(config, options, targetOptions)");
393
+ if (this.clientFrameworkAngular) {
394
+ this.addWebpackConfig("require('./webpack.microfrontend')(config, options, targetOptions)");
395
+ } else if (this.clientFrameworkVue) {
396
+ this.addWebpackConfig("require('./webpack.microfrontend')({ serve: options.env.WEBPACK_SERVE })");
397
+ } else {
398
+ throw new Error(`Client framework ${this.clientFramework} doesn't support microfrontends`);
399
+ }
389
400
  },
390
401
  };
391
402
  }
392
403
 
393
404
  get postWriting() {
394
- if (useBlueprints) return;
405
+ if (this.delegateToBlueprint) return {};
395
406
  return this._postWriting();
396
407
  }
397
408
 
@@ -413,7 +424,7 @@ module.exports = class JHipsterClientGenerator extends BaseBlueprintGenerator {
413
424
  }
414
425
 
415
426
  get end() {
416
- if (useBlueprints) return;
427
+ if (this.delegateToBlueprint) return {};
417
428
  return this._end();
418
429
  }
419
430
 
@@ -24,7 +24,7 @@ const needleClientBase = require('./needle-client');
24
24
  module.exports = class extends needleClientBase {
25
25
  addEntityToMenu(routerName, enableTranslation, entityTranslationKeyMenu, entityTranslationValue = _.startCase(routerName)) {
26
26
  const errorMessage = `${chalk.yellow('Reference to ') + routerName} ${chalk.yellow('not added to menu.\n')}`;
27
- const filePath = `${this.CLIENT_MAIN_SRC_DIR}/app/core/jhi-navbar/jhi-navbar.vue`;
27
+ const filePath = `${this.CLIENT_MAIN_SRC_DIR}/app/entities/entities-menu.vue`;
28
28
  const menuI18nTitle = enableTranslation ? ` v-text="$t('global.menu.entities.${entityTranslationKeyMenu}')"` : '';
29
29
  const entityEntry =
30
30
  // prettier-ignore
@@ -92,6 +92,7 @@
92
92
  "@typescript-eslint/no-parameter-properties": ["warn", { "allows": ["public", "private", "protected"] }],
93
93
  "@typescript-eslint/no-shadow": ["error"],
94
94
  "@typescript-eslint/no-unnecessary-condition": "error",
95
+ "@typescript-eslint/no-unsafe-argument": "off",
95
96
  "@typescript-eslint/no-unsafe-assignment": "off",
96
97
  "@typescript-eslint/no-unsafe-call": "off",
97
98
  "@typescript-eslint/no-unsafe-member-access": "off",
@@ -1,38 +1,38 @@
1
1
  {
2
2
  "dependencies": {
3
- "@angular/common": "12.2.10",
4
- "bootstrap": "4.6.0",
3
+ "@angular/common": "12.2.12",
4
+ "bootstrap": "4.6.1",
5
5
  "@fortawesome/angular-fontawesome": "0.9.0",
6
6
  "@fortawesome/fontawesome-svg-core": "1.2.36",
7
7
  "@fortawesome/free-solid-svg-icons": "5.15.4",
8
8
  "@ng-bootstrap/ng-bootstrap": "10.0.0",
9
9
  "@ngx-translate/core": "13.0.0",
10
10
  "@ngx-translate/http-loader": "6.0.0",
11
- "ngx-cookie-service": "12.0.3",
11
+ "ngx-cookie-service": "13.0.0",
12
12
  "ngx-infinite-scroll": "10.0.1",
13
13
  "ngx-webstorage": "8.0.0",
14
14
  "rxjs": "6.6.7",
15
- "swagger-ui-dist": "3.52.5",
15
+ "swagger-ui-dist": "4.1.0",
16
16
  "tslib": "2.3.1",
17
17
  "zone.js": "0.11.4"
18
18
  },
19
19
  "devDependencies": {
20
- "@angular/cli": "12.2.10",
20
+ "@angular/cli": "12.2.12",
21
21
  "@angular-builders/custom-webpack": "12.1.3",
22
22
  "@angular-builders/jest": "12.1.2",
23
- "@angular-eslint/eslint-plugin": "12.5.0",
24
- "@types/node": "16.11.1",
25
- "@types/jest": "27.0.2",
26
- "@typescript-eslint/eslint-plugin": "4.33.0",
27
- "browser-sync": "2.27.5",
23
+ "@angular-eslint/eslint-plugin": "12.6.1",
24
+ "@types/node": "16.11.7",
25
+ "@types/jest": "27.0.3",
26
+ "@typescript-eslint/eslint-plugin": "5.4.0",
27
+ "browser-sync": "2.27.7",
28
28
  "browser-sync-webpack-plugin": "2.3.0",
29
- "copy-webpack-plugin": "9.0.1",
29
+ "copy-webpack-plugin": "10.0.0",
30
30
  "eslint": "7.32.0",
31
31
  "eslint-config-prettier": "8.3.0",
32
- "eslint-webpack-plugin": "3.0.1",
32
+ "eslint-webpack-plugin": "3.1.1",
33
33
  "folder-hash": "4.0.1",
34
- "jest": "27.3.0",
35
- "jest-preset-angular": "10.0.1",
34
+ "jest": "27.3.1",
35
+ "jest-preset-angular": "10.1.0",
36
36
  "jest-date-mock": "1.0.8",
37
37
  "jest-junit": "13.0.0",
38
38
  "jest-sonar-reporter": "2.0.0",
@@ -20,7 +20,7 @@
20
20
 
21
21
  <div *ngIf="!updating && jvmMemoryMetrics">
22
22
  <div *ngFor="let entry of jvmMemoryMetrics | keyvalue">
23
- <span *ngIf="entry.value.max != -1; else other">
23
+ <span *ngIf="entry.value.max !== -1; else other">
24
24
  <span>{{ entry.key }}</span>
25
25
  ({{ entry.value.used / 1048576 | number: '1.0-0' }}M / {{ entry.value.max / 1048576 | number: '1.0-0' }}M)
26
26
  </span>
@@ -30,7 +30,7 @@
30
30
  <ng-template #other><span><span>{{ entry.key }}</span> {{ entry.value.used / 1048576 | number: '1.0-0' }}M</span></ng-template>
31
31
 
32
32
  <ngb-progressbar
33
- *ngIf="entry.value.max != -1"
33
+ *ngIf="entry.value.max !== -1"
34
34
  type="success"
35
35
  [value]="(100 * entry.value.used) / entry.value.max"
36
36
  [striped]="true"
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "devDependencies": {
3
3
  "@cypress/code-coverage": "3.9.11",
4
- "babel-loader": "8.2.2",
4
+ "babel-loader": "8.2.3",
5
5
  "babel-plugin-istanbul": "6.1.1",
6
- "cypress": "8.6.0",
6
+ "cypress": "9.0.0",
7
7
  "eslint-plugin-cypress": "2.12.1",
8
8
  "cypress-audit": "1.1.0",
9
- "lighthouse": "8.5.1",
9
+ "lighthouse": "9.0.0",
10
10
  "nyc": "15.1.0"
11
11
  },
12
12
  "dependencies": {
@@ -0,0 +1,56 @@
1
+ <%#
2
+ Copyright 2013-2021 the original author or authors from the JHipster project.
3
+
4
+ This file is part of the JHipster project, see https://www.jhipster.tech/
5
+ for more information.
6
+
7
+ Licensed under the Apache License, Version 2.0 (the "License");
8
+ you may not use this file except in compliance with the License.
9
+ You may obtain a copy of the License at
10
+
11
+ https://www.apache.org/licenses/LICENSE-2.0
12
+
13
+ Unless required by applicable law or agreed to in writing, software
14
+ distributed under the License is distributed on an "AS IS" BASIS,
15
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ See the License for the specific language governing permissions and
17
+ limitations under the License.
18
+ -%>
19
+ <&_
20
+ // Register sections and max allowed fragments, 0 for unlimited.
21
+ fragments.registerSections({
22
+ importsSection:0,
23
+ moduleFederationSection: 0,
24
+ pluginsSection: 0,
25
+ });
26
+ _&>
27
+
28
+ const ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin');
29
+ <&- fragments.importsSection() &>
30
+ const packageJson = require('../package.json');
31
+ const appVersion = packageJson.version;
32
+
33
+ module.exports = ({ serve }) => {
34
+ return {
35
+ optimization: {
36
+ moduleIds: 'named',
37
+ },
38
+ plugins: [
39
+ new ModuleFederationPlugin({
40
+ <%_ if (applicationTypeMicroservice) { _%>
41
+ name: '<%= lowercaseBaseName %>',
42
+ filename: 'remoteEntry.js',
43
+ <%_ } _%>
44
+ shareScope: 'default',
45
+ <&- fragments.moduleFederationSection() &>
46
+ }),
47
+ <&- fragments.pluginsSection() &>
48
+ ],
49
+ output: {
50
+ publicPath: 'auto',
51
+ },
52
+ optimization: {
53
+ runtimeChunk: false,
54
+ },
55
+ };
56
+ };
@@ -62,6 +62,7 @@
62
62
  "@typescript-eslint/explicit-member-accessibility": "off",
63
63
  "@typescript-eslint/explicit-function-return-type": "off",
64
64
  "@typescript-eslint/no-explicit-any": "off",
65
+ "@typescript-eslint/no-unsafe-argument": "off",
65
66
  "@typescript-eslint/no-unsafe-return": "off",
66
67
  "@typescript-eslint/no-unsafe-member-access":"off",
67
68
  "@typescript-eslint/no-unsafe-call": "off",