generator-jhipster 7.3.0 → 7.5.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 (340) hide show
  1. package/cli/import-jdl.js +3 -2
  2. package/cli/jhipster-command.js +2 -2
  3. package/cli/program.js +32 -29
  4. package/generators/app/index.js +46 -27
  5. package/generators/aws/index.js +8 -8
  6. package/generators/aws/lib/eb.js +1 -1
  7. package/generators/azure-app-service/index.js +16 -9
  8. package/generators/azure-app-service/templates/github/workflows/azure-app-service.yml.ejs +2 -2
  9. package/generators/azure-spring-cloud/index.js +16 -9
  10. package/generators/azure-spring-cloud/templates/github/workflows/azure-spring-cloud.yml.ejs +2 -2
  11. package/generators/bootstrap/index.js +57 -62
  12. package/generators/ci-cd/index.js +11 -8
  13. package/generators/ci-cd/templates/github-actions.yml.ejs +1 -1
  14. package/generators/ci-cd/templates/travis.yml.ejs +9 -4
  15. package/generators/cleanup.js +27 -171
  16. package/generators/client/files-angular.js +12 -1
  17. package/generators/client/files-common.js +6 -2
  18. package/generators/client/files-react.js +13 -2
  19. package/generators/client/files-vue.js +59 -7
  20. package/generators/client/index.js +46 -32
  21. package/generators/client/needle-api/needle-client-angular.js +1 -1
  22. package/generators/client/needle-api/needle-client-vue.js +57 -7
  23. package/generators/client/templates/angular/.eslintrc.json.ejs +1 -0
  24. package/generators/client/templates/angular/angular.json.ejs +5 -0
  25. package/generators/client/templates/angular/jest.conf.js.ejs +2 -0
  26. package/generators/client/templates/angular/package.json +29 -29
  27. package/generators/client/templates/angular/package.json.ejs +3 -1
  28. package/generators/client/templates/angular/src/main/webapp/app/account/activate/activate.component.spec.ts.ejs +52 -54
  29. package/generators/client/templates/angular/src/main/webapp/app/account/activate/activate.component.ts.ejs +4 -4
  30. package/generators/client/templates/angular/src/main/webapp/app/account/activate/activate.service.spec.ts.ejs +65 -0
  31. package/generators/client/templates/angular/src/main/webapp/app/account/password/password-strength-bar/password-strength-bar.component.spec.ts.ejs +35 -37
  32. package/generators/client/templates/angular/src/main/webapp/app/account/password/password-strength-bar/password-strength-bar.component.ts.ejs +1 -1
  33. package/generators/client/templates/angular/src/main/webapp/app/account/password/password.component.spec.ts.ejs +78 -80
  34. package/generators/client/templates/angular/src/main/webapp/app/account/password/password.component.ts.ejs +4 -4
  35. package/generators/client/templates/angular/src/main/webapp/app/account/password/password.service.spec.ts.ejs +41 -0
  36. package/generators/client/templates/angular/src/main/webapp/app/account/password-reset/finish/password-reset-finish.component.spec.ts.ejs +73 -75
  37. package/generators/client/templates/angular/src/main/webapp/app/account/password-reset/finish/password-reset-finish.component.ts.ejs +4 -4
  38. package/generators/client/templates/angular/src/main/webapp/app/account/password-reset/finish/password-reset-finish.service.spec.ts.ejs +62 -0
  39. package/generators/client/templates/angular/src/main/webapp/app/account/password-reset/init/password-reset-init.component.spec.ts.ejs +44 -46
  40. package/generators/client/templates/angular/src/main/webapp/app/account/password-reset/init/password-reset-init.service.spec.ts.ejs +61 -0
  41. package/generators/client/templates/angular/src/main/webapp/app/account/register/register.component.spec.ts.ejs +122 -123
  42. package/generators/client/templates/angular/src/main/webapp/app/account/register/register.component.ts.ejs +1 -1
  43. package/generators/client/templates/angular/src/main/webapp/app/account/register/register.service.spec.ts.ejs +66 -0
  44. package/generators/client/templates/angular/src/main/webapp/app/account/sessions/sessions.component.spec.ts.ejs +75 -77
  45. package/generators/client/templates/angular/src/main/webapp/app/account/settings/settings.component.spec.ts.ejs +80 -80
  46. package/generators/client/templates/angular/src/main/webapp/app/admin/configuration/configuration.component.spec.ts.ejs +48 -50
  47. package/generators/client/templates/angular/src/main/webapp/app/admin/health/health.component.spec.ts.ejs +45 -47
  48. package/generators/client/templates/angular/src/main/webapp/app/admin/health/health.component.ts.ejs +4 -4
  49. package/generators/client/templates/angular/src/main/webapp/app/admin/health/health.service.spec.ts.ejs +66 -0
  50. package/generators/client/templates/angular/src/main/webapp/app/admin/health/modal/health-modal.component.spec.ts.ejs +99 -101
  51. package/generators/client/templates/angular/src/main/webapp/app/admin/logs/logs.component.spec.ts.ejs +61 -63
  52. package/generators/client/templates/angular/src/main/webapp/app/admin/metrics/blocks/jvm-memory/jvm-memory.component.html.ejs +2 -2
  53. package/generators/client/templates/angular/src/main/webapp/app/admin/metrics/metrics.component.spec.ts.ejs +28 -30
  54. package/generators/client/templates/angular/src/main/webapp/app/admin/user-management/delete/user-management-delete-dialog.component.spec.ts.ejs +35 -37
  55. package/generators/client/templates/angular/src/main/webapp/app/admin/user-management/detail/user-management-detail.component.spec.ts.ejs +40 -42
  56. package/generators/client/templates/angular/src/main/webapp/app/admin/user-management/list/user-management.component.spec.ts.ejs +89 -91
  57. package/generators/client/templates/angular/src/main/webapp/app/admin/user-management/list/user-management.component.ts.ejs +4 -4
  58. package/generators/client/templates/angular/src/main/webapp/app/admin/user-management/update/user-management-update.component.spec.ts.ejs +81 -83
  59. package/generators/client/templates/angular/src/main/webapp/app/admin/user-management/update/user-management-update.component.ts.ejs +8 -8
  60. package/generators/client/templates/angular/src/main/webapp/app/app-routing.module.ts.ejs +14 -3
  61. package/generators/client/templates/angular/src/main/webapp/app/app.module.ts.ejs +8 -29
  62. package/generators/client/templates/angular/src/main/webapp/app/config/datepicker-adapter.ts.ejs +1 -1
  63. package/generators/client/templates/angular/src/main/webapp/app/config/dayjs.ts.ejs +4 -4
  64. package/generators/client/templates/angular/src/main/webapp/app/core/auth/account.service.spec.ts.ejs +14 -9
  65. package/generators/client/templates/angular/src/main/webapp/app/core/tracker/tracker.service.ts.ejs +6 -6
  66. package/generators/client/templates/angular/src/main/webapp/app/core/util/parse-links.service.ts.ejs +1 -1
  67. package/generators/client/templates/angular/src/main/webapp/app/entities/entity-navbar-items.ts.ejs +29 -0
  68. package/generators/client/templates/angular/src/main/webapp/app/home/home.component.spec.ts.ejs +106 -98
  69. package/generators/client/templates/angular/src/main/webapp/app/layouts/main/main.component.spec.ts.ejs +166 -168
  70. package/generators/client/templates/angular/src/main/webapp/app/layouts/main/main.component.ts.ejs +1 -1
  71. package/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/navbar.component.html.ejs +20 -0
  72. package/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/navbar.component.spec.ts.ejs +74 -70
  73. package/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/navbar.component.ts.ejs +41 -2
  74. package/generators/client/templates/angular/src/main/webapp/app/layouts/profiles/page-ribbon.component.spec.ts.ejs +27 -29
  75. package/generators/client/templates/angular/src/main/webapp/app/login/login.component.spec.ts.ejs +114 -115
  76. package/generators/client/templates/angular/src/main/webapp/app/login/login.component.ts.ejs +4 -4
  77. package/generators/client/templates/angular/src/main/webapp/app/shared/alert/alert-error.component.spec.ts.ejs +132 -134
  78. package/generators/client/templates/angular/src/main/webapp/app/shared/alert/alert.component.spec.ts.ejs +29 -31
  79. package/generators/client/templates/angular/src/main/webapp/app/shared/auth/has-any-authority.directive.spec.ts.ejs +4 -4
  80. package/generators/client/templates/angular/src/main/webapp/app/shared/date/duration.pipe.ts.ejs +1 -1
  81. package/generators/client/templates/angular/src/main/webapp/app/shared/date/format-medium-date.pipe.spec.ts.ejs +1 -1
  82. package/generators/client/templates/angular/src/main/webapp/app/shared/date/format-medium-date.pipe.ts.ejs +1 -1
  83. package/generators/client/templates/angular/src/main/webapp/app/shared/date/format-medium-datetime.pipe.spec.ts.ejs +1 -1
  84. package/generators/client/templates/angular/src/main/webapp/app/shared/date/format-medium-datetime.pipe.ts.ejs +1 -1
  85. package/generators/client/templates/angular/src/main/webapp/app/shared/language/translate.directive.ts.ejs +6 -6
  86. package/generators/client/templates/angular/src/main/webapp/app/shared/language/translation.module.ts.ejs +83 -0
  87. package/generators/client/templates/angular/src/main/webapp/declarations.d.ts.ejs +16 -2
  88. package/generators/client/templates/angular/tsconfig.json.ejs +2 -0
  89. package/generators/client/templates/angular/tsconfig.spec.json.ejs +0 -1
  90. package/generators/client/templates/angular/webpack/proxy.conf.js.ejs +0 -2
  91. package/generators/client/templates/angular/webpack/webpack.custom.js.ejs +0 -16
  92. package/generators/client/templates/angular/webpack/webpack.microfrontend.js.ejs +12 -5
  93. package/generators/client/templates/common/package.json +6 -6
  94. package/generators/client/templates/common/src/main/webapp/robots.txt.ejs +0 -1
  95. package/generators/client/templates/common/src/main/webapp/swagger-ui/index.html.ejs +86 -56
  96. package/generators/client/templates/common/webpack/webpack.microfrontend.js.jhi.ejs +56 -0
  97. package/generators/client/templates/react/.eslintrc.json.ejs +1 -0
  98. package/generators/client/templates/react/package.json +54 -53
  99. package/generators/client/templates/react/package.json.ejs +6 -1
  100. package/generators/client/templates/react/src/main/webapp/app/app.scss.ejs +0 -3
  101. package/generators/client/templates/react/src/main/webapp/app/config/axios-interceptor.spec.ts.ejs +3 -2
  102. package/generators/client/templates/react/src/main/webapp/app/modules/account/password/password.tsx.ejs +2 -2
  103. package/generators/client/templates/react/src/main/webapp/app/modules/administration/configuration/configuration.tsx.ejs +2 -2
  104. package/generators/client/templates/react/src/main/webapp/app/modules/administration/gateway/gateway.tsx.ejs +2 -2
  105. package/generators/client/templates/react/src/main/webapp/app/modules/administration/metrics/metrics.tsx.ejs +6 -6
  106. package/generators/client/templates/react/src/main/webapp/app/modules/administration/user-management/user-management.tsx.ejs +8 -8
  107. package/generators/client/templates/react/src/main/webapp/app/modules/home/home.tsx.ejs +1 -1
  108. package/generators/client/templates/react/src/main/webapp/app/shared/layout/header/header.scss.ejs +9 -0
  109. package/generators/client/templates/react/src/main/webapp/app/shared/layout/header/header.tsx.ejs +2 -2
  110. package/generators/client/templates/react/src/main/webapp/app/shared/layout/menus/account.tsx.ejs +3 -3
  111. package/generators/client/templates/react/src/main/webapp/app/shared/layout/menus/admin.tsx.ejs +7 -7
  112. package/generators/client/templates/react/src/main/webapp/app/shared/layout/menus/menu-components.tsx.ejs +1 -1
  113. package/generators/client/templates/react/src/main/webapp/app/shared/reducers/authentication.spec.ts.ejs +1 -1
  114. package/generators/client/templates/react/webpack/webpack.dev.js.ejs +17 -3
  115. package/generators/client/templates/react/webpack/webpack.prod.js.ejs +13 -1
  116. package/generators/client/templates/vue/.eslintrc.js.ejs +8 -5
  117. package/generators/client/templates/vue/package.json +40 -49
  118. package/generators/client/templates/vue/package.json.ejs +13 -17
  119. package/generators/client/templates/vue/src/main/webapp/app/account/account.service.ts.ejs +23 -12
  120. package/generators/client/templates/vue/src/main/webapp/app/account/settings/settings.vue.ejs +7 -1
  121. package/generators/client/templates/vue/src/main/webapp/app/admin/configuration/configuration.vue.ejs +1 -1
  122. package/generators/client/templates/vue/src/main/webapp/app/admin/metrics/metrics.component.ts.ejs +1 -1
  123. package/generators/client/templates/vue/src/main/webapp/app/constants.ts.ejs +16 -6
  124. package/generators/client/templates/vue/src/main/webapp/app/core/jhi-navbar/jhi-navbar.component.ts.ejs +27 -8
  125. package/generators/client/templates/vue/src/main/webapp/app/core/jhi-navbar/jhi-navbar.vue.ejs +6 -0
  126. package/generators/client/templates/vue/src/main/webapp/app/declarations.d.ts.ejs +41 -0
  127. package/generators/client/templates/vue/src/main/webapp/app/entities/entities-menu.component.ts.ejs +34 -0
  128. package/generators/client/templates/vue/src/main/webapp/app/entities/entities-menu.vue.ejs +13 -0
  129. package/generators/client/templates/vue/src/main/webapp/app/entities/entities.component.ts.ejs +20 -0
  130. package/generators/client/templates/vue/src/main/webapp/app/entities/entities.vue.ejs +5 -0
  131. package/generators/client/templates/vue/src/main/webapp/app/entities/user/{user.oauth2.service.ts.ejs → user.service.ts.ejs} +1 -1
  132. package/generators/client/templates/vue/{webpack/utils.js.ejs → src/main/webapp/app/index.ts.ejs} +1 -12
  133. package/generators/client/templates/vue/src/main/webapp/app/locale/translation.service.ts.ejs +26 -9
  134. package/generators/client/templates/vue/src/main/webapp/app/main.ts.ejs +20 -18
  135. package/generators/client/templates/vue/src/main/webapp/app/router/entities.ts.ejs +45 -3
  136. package/generators/client/templates/vue/src/main/webapp/app/router/index.ts.ejs +19 -3
  137. package/generators/client/templates/vue/src/main/webapp/app/shared/config/axios-interceptor.ts.ejs +0 -2
  138. package/generators/client/templates/vue/src/main/webapp/app/shared/data/data-utils.service.ts.ejs +3 -1
  139. package/generators/client/templates/vue/src/main/webapp/app/shims-vue.d.ts.ejs +17 -3
  140. package/generators/client/templates/vue/src/test/javascript/jest.conf.js.ejs +25 -10
  141. package/generators/client/templates/vue/src/test/javascript/spec/app/account/login-form/login-form.component.spec.ts.ejs +2 -2
  142. package/generators/client/templates/vue/src/test/javascript/spec/app/admin/user-management/user-management-edit.component.spec.ts.ejs +6 -4
  143. package/generators/client/templates/vue/src/test/javascript/spec/app/admin/user-management/user-management.component.spec.ts.ejs +4 -2
  144. package/generators/client/templates/vue/src/test/javascript/spec/app/core/jhi-navbar/jhi-navbar.component.spec.ts.ejs +10 -4
  145. package/generators/client/templates/vue/src/test/javascript/spec/app/entities/entities-menu.spec.ts.ejs +52 -0
  146. package/generators/client/templates/vue/src/test/javascript/spec/app/microfrontends/entities-menu.component.ts.ejs +4 -0
  147. package/generators/client/templates/vue/src/test/javascript/spec/app/microfrontends/entities-menu.vue.ejs +7 -0
  148. package/generators/client/templates/vue/src/test/javascript/spec/app/microfrontends/entities-router.ts.ejs +1 -0
  149. package/generators/client/templates/vue/src/test/javascript/spec/app/shared/config/axios-interceptor.spec.ts.ejs +0 -1
  150. package/generators/client/templates/vue/tsconfig.json.ejs +6 -10
  151. package/generators/client/templates/vue/tsconfig.spec.json.ejs +37 -0
  152. package/generators/client/templates/vue/webpack/config.js.ejs +50 -0
  153. package/generators/client/templates/vue/webpack/vue.utils.js.ejs +33 -32
  154. package/generators/client/templates/vue/webpack/webpack.common.js.ejs +150 -126
  155. package/generators/client/templates/vue/webpack/webpack.dev.js.ejs +19 -76
  156. package/generators/client/templates/vue/webpack/webpack.microfrontend.js.jhi.vue.ejs +77 -0
  157. package/generators/client/templates/vue/webpack/webpack.prod.js.ejs +5 -41
  158. package/generators/cloudfoundry/index.js +9 -9
  159. package/generators/common/index.js +12 -10
  160. package/generators/common/templates/.prettierrc.ejs +1 -1
  161. package/generators/common/templates/README.md.jhi.ejs +19 -0
  162. package/generators/common/templates/package.json +4 -4
  163. package/generators/cypress/index.js +12 -9
  164. package/generators/cypress/templates/cypress.json.ejs +16 -2
  165. package/generators/cypress/templates/src/test/javascript/cypress/integration/account/login-page.spec.ts.ejs +3 -14
  166. package/generators/cypress/templates/src/test/javascript/cypress/integration/account/password-page.spec.ts.ejs +33 -39
  167. package/generators/cypress/templates/src/test/javascript/cypress/integration/account/register-page.spec.ts.ejs +52 -62
  168. package/generators/cypress/templates/src/test/javascript/cypress/integration/account/reset-password-page.spec.ts.ejs +2 -10
  169. package/generators/cypress/templates/src/test/javascript/cypress/integration/account/settings-page.spec.ts.ejs +25 -34
  170. package/generators/cypress/templates/src/test/javascript/cypress/integration/administration/administration.spec.ts.ejs +1 -22
  171. package/generators/cypress/templates/src/test/javascript/cypress/plugins/index.ts.ejs +4 -4
  172. package/generators/cypress/templates/src/test/javascript/cypress/support/commands.ts.ejs +67 -7
  173. package/generators/cypress/templates/src/test/javascript/cypress/support/entity.ts.ejs +4 -4
  174. package/generators/cypress/templates/src/test/javascript/cypress/support/index.ts.ejs +1 -6
  175. package/generators/cypress/templates/src/test/javascript/cypress/support/management.ts.ejs +1 -1
  176. package/generators/cypress/templates/src/test/javascript/cypress/support/navbar.ts.ejs +8 -8
  177. package/generators/cypress/templates/src/test/javascript/cypress/support/oauth2.ts.ejs +0 -9
  178. package/generators/database-changelog/index.js +33 -22
  179. package/generators/database-changelog-liquibase/index.js +12 -8
  180. package/generators/database-changelog-liquibase/templates/src/main/resources/config/liquibase/changelog/updated_entity_constraints.xml.ejs +1 -1
  181. package/generators/docker-compose/index.js +11 -12
  182. package/generators/docker-compose/templates/realm-config/jhipster-realm.json.ejs +1 -1
  183. package/generators/entities/index.js +35 -26
  184. package/generators/entities-client/index.js +10 -7
  185. package/generators/entity/index.js +81 -32
  186. package/generators/entity-client/files.js +7 -16
  187. package/generators/entity-client/index.js +22 -12
  188. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/delete/entity-management-delete-dialog.component.spec.ts.ejs +42 -44
  189. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/detail/entity-management-detail.component.html.ejs +1 -1
  190. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/detail/entity-management-detail.component.spec.ts.ejs +58 -60
  191. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity-management.module.ts.ejs +1 -35
  192. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/entity.model.ts.ejs +1 -1
  193. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/list/entity-management.component.html.ejs +4 -4
  194. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/list/entity-management.component.spec.ts.ejs +110 -112
  195. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/list/entity-management.component.ts.ejs +9 -2
  196. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/list/infinite-scroll-template.ejs +8 -8
  197. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/list/no-pagination-template.ejs +8 -8
  198. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/list/pagination-template.ejs +8 -8
  199. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/route/entity-management-routing-resolve.service.spec.ts.ejs +15 -6
  200. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/route/entity-management-routing.module.ts.ejs +1 -1
  201. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/service/entity.service.spec.ts.ejs +1 -1
  202. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/service/entity.service.ts.ejs +1 -1
  203. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/update/entity-management-update.component.spec.ts.ejs +203 -198
  204. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/update/entity-management-update.component.ts.ejs +5 -5
  205. package/generators/entity-client/templates/angular/src/test/javascript/e2e/entities/entity.spec.ts.ejs +1 -1
  206. package/generators/entity-client/templates/common/src/test/javascript/cypress/integration/entity/entity.spec.ts.ejs +264 -127
  207. package/generators/entity-client/templates/react/src/main/webapp/app/entities/entity-update.tsx.ejs +17 -14
  208. package/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.reducer.ts.ejs +5 -4
  209. package/generators/entity-client/templates/react/src/main/webapp/app/entities/entity.tsx.ejs +11 -13
  210. package/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity-update.component.ts.ejs +32 -25
  211. package/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity-update.vue.ejs +6 -9
  212. package/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity.component.ts.ejs +2 -1
  213. package/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity.model.ts.ejs +1 -1
  214. package/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity.service.ts.ejs +2 -6
  215. package/generators/entity-client/templates/vue/src/test/javascript/spec/app/entities/entity-update.component.spec.ts.ejs +10 -7
  216. package/generators/entity-client/templates/vue/src/test/javascript/spec/app/entities/entity.component.spec.ts.ejs +5 -1
  217. package/generators/entity-client/templates/vue/src/test/javascript/spec/app/entities/entity.service.spec.ts.ejs +1 -1
  218. package/generators/entity-i18n/index.js +7 -4
  219. package/generators/entity-server/files.js +14 -0
  220. package/generators/entity-server/index.js +12 -8
  221. package/generators/entity-server/templates/src/main/java/package/common/get_all_template.ejs +2 -2
  222. package/generators/entity-server/templates/src/main/java/package/common/search_template.ejs +1 -1
  223. package/generators/entity-server/templates/src/main/java/package/domain/Entity.java.jhi.ejs +9 -8
  224. package/generators/entity-server/templates/src/main/java/package/repository/EntityRepositoryInternalImpl_reactive.java.ejs +16 -29
  225. package/generators/entity-server/templates/src/main/java/package/repository/EntityRepository_reactive.java.ejs +3 -3
  226. package/generators/entity-server/templates/src/main/java/package/repository/EntitySqlHelper_reactive.java.ejs +46 -0
  227. package/generators/entity-server/templates/src/main/java/package/repository/rowmapper/EntityRowMapper.java.ejs +1 -1
  228. package/generators/entity-server/templates/src/main/java/package/repository/search/EntitySearchRepository.java.ejs +18 -2
  229. package/generators/entity-server/templates/src/main/java/package/repository/search/SortToFieldSortBuilderConverter.java.ejs +24 -0
  230. package/generators/entity-server/templates/src/main/java/package/service/dto/EntityDTO.java.ejs +8 -6
  231. package/generators/entity-server/templates/src/main/java/package/service/mapper/EntityMapper.java.ejs +5 -1
  232. package/generators/entity-server/templates/src/main/java/package/web/rest/EntityResource.java.ejs +41 -43
  233. package/generators/entity-server/templates/src/test/java/package/web/rest/EntityResourceIT.java.ejs +3 -3
  234. package/generators/gae/index.js +10 -10
  235. package/generators/generator-base-blueprint.js +14 -46
  236. package/generators/generator-base-private.js +44 -23
  237. package/generators/generator-base.js +58 -18
  238. package/generators/generator-constants.js +30 -23
  239. package/generators/generator-transforms.js +39 -27
  240. package/generators/heroku/index.js +14 -33
  241. package/generators/init/constants.cjs +1 -1
  242. package/generators/java/constants.cjs +1 -1
  243. package/generators/kubernetes/files.js +3 -0
  244. package/generators/kubernetes/index.js +10 -10
  245. package/generators/kubernetes/templates/db/couchbase.yml.ejs +1 -1
  246. package/generators/kubernetes/templates/deployment.yml.ejs +8 -3
  247. package/generators/kubernetes/templates/istio/destination-rule.yml.ejs +1 -1
  248. package/generators/kubernetes/templates/istio/gateway/grafana-gateway.yml.ejs +5 -2
  249. package/generators/kubernetes/templates/istio/gateway/jhipster-grafana-gateway.yml.ejs +5 -2
  250. package/generators/kubernetes/templates/istio/gateway/kiali-gateway.yml.ejs +10 -8
  251. package/generators/kubernetes/templates/istio/gateway/zipkin-gateway.yml.ejs +5 -2
  252. package/generators/kubernetes/templates/istio/gateway.yml.ejs +7 -5
  253. package/generators/kubernetes/templates/secret/couchbase-secret.yml.ejs +9 -0
  254. package/generators/kubernetes-base.js +1 -0
  255. package/generators/kubernetes-helm/files.js +3 -8
  256. package/generators/kubernetes-helm/index.js +10 -10
  257. package/generators/kubernetes-helm/templates/README-KUBERNETES-HELM.md.ejs +0 -1
  258. package/generators/kubernetes-helm/templates/app/Chart.yml.ejs +5 -0
  259. package/generators/kubernetes-helm/templates/app/helpers.tpl.ejs +0 -11
  260. package/generators/kubernetes-helm/templates/app/requirements.yml.ejs +5 -0
  261. package/generators/kubernetes-helm/templates/app/values.yml.ejs +68 -5
  262. package/generators/kubernetes-helm/templates/csvc/Chart.yml.ejs +1 -1
  263. package/generators/kubernetes-helm/templates/csvc/requirements.yml.ejs +1 -1
  264. package/generators/kubernetes-knative/index.js +10 -10
  265. package/generators/kubernetes-knative/templates/istio/gateway.yml.ejs +6 -4
  266. package/generators/kubernetes-knative/templates/service.yml.ejs +1 -1
  267. package/generators/languages/index.js +13 -13
  268. package/generators/languages/templates/src/main/webapp/i18n/vi/login.json +1 -1
  269. package/generators/openapi-client/index.js +13 -10
  270. package/generators/openshift/index.js +10 -11
  271. package/generators/openshift/templates/deployment.yml.ejs +1 -1
  272. package/generators/page/index.js +12 -10
  273. package/generators/server/__snapshots__/generator.spec.mjs.snap +28 -15
  274. package/generators/server/cleanup.js +151 -0
  275. package/generators/server/files-sql.js +52 -0
  276. package/generators/server/files.js +31 -14
  277. package/generators/server/index.js +86 -33
  278. package/generators/server/templates/build.gradle.ejs +231 -189
  279. package/generators/server/templates/gradle.properties.ejs +12 -12
  280. package/generators/server/templates/npmw +8 -6
  281. package/generators/server/templates/npmw.cmd +13 -8
  282. package/generators/server/templates/pom.xml.ejs +425 -217
  283. package/generators/server/templates/sql/reactive/src/main/java/package/repository/UserSqlHelper.java.ejs +48 -0
  284. package/generators/server/templates/src/main/docker/app.yml.ejs +1 -1
  285. package/generators/server/templates/src/main/docker/config/realm-config/jhipster-realm.json.ejs +2 -2
  286. package/generators/server/templates/src/main/java/package/config/LocaleConfiguration.java.ejs +3 -2
  287. package/generators/server/templates/src/main/java/package/config/OpenApiConfiguration.java.ejs +17 -54
  288. package/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs +5 -5
  289. package/generators/server/templates/src/main/java/package/config/SecurityConfiguration_reactive.java.ejs +4 -6
  290. package/generators/server/templates/src/main/java/package/config/WebConfigurer.java.ejs +0 -3
  291. package/generators/server/templates/src/main/java/package/config/neo4j/Neo4jMigrations.java.ejs +19 -9
  292. package/generators/server/templates/src/main/java/package/management/SecurityMetersService.java.ejs +68 -0
  293. package/generators/server/templates/src/main/java/package/repository/AuthorityRepository.java.ejs +2 -2
  294. package/generators/server/templates/src/main/java/package/repository/UserRepository.java.ejs +0 -25
  295. package/generators/server/templates/src/main/java/package/security/jwt/TokenProvider.java.ejs +31 -4
  296. package/generators/server/templates/src/main/java/package/security/oauth2/CustomClaimConverter.java.ejs +23 -11
  297. package/generators/server/templates/src/main/java/package/service/UserService.java.ejs +16 -8
  298. package/generators/server/templates/src/main/java/package/service/dto/UserDTO.java.ejs +6 -6
  299. package/generators/server/templates/src/main/java/package/web/filter/ModifyServersOpenApiFilter.java.ejs +3 -2
  300. package/generators/server/templates/src/main/java/package/web/filter/SpaWebFilter.java.ejs +1 -1
  301. package/generators/server/templates/src/main/java/package/web/rest/PublicUserResource.java.ejs +2 -2
  302. package/generators/server/templates/src/main/java/package/web/rest/UserResource.java.ejs +2 -2
  303. package/generators/server/templates/src/main/resources/config/application.yml.ejs +22 -8
  304. package/generators/server/templates/src/main/resources/logback-spring.xml.ejs +1 -2
  305. package/generators/server/templates/src/main/resources/static/microservices_index.html.ejs +1 -1
  306. package/generators/server/templates/src/test/java/package/cucumber/CucumberIT.java.ejs +2 -6
  307. package/generators/server/templates/src/test/java/package/cucumber/CucumberTestContextConfiguration.java.ejs +2 -3
  308. package/generators/server/templates/src/test/java/package/cucumber/stepdefs/UserStepDefs.java.ejs +41 -6
  309. package/generators/server/templates/src/test/java/package/management/SecurityMetersServiceTests.java.ejs +113 -0
  310. package/generators/server/templates/src/test/java/package/security/jwt/JWTFilterTest.java.ejs +6 -1
  311. package/generators/server/templates/src/test/java/package/security/jwt/TokenProviderSecurityMetersTests.java.ejs +198 -0
  312. package/generators/server/templates/src/test/java/package/security/jwt/TokenProviderTest.java.ejs +13 -3
  313. package/generators/server/templates/src/test/java/package/security/oauth2/AuthorizationHeaderUtilTest.java.ejs +17 -3
  314. package/generators/server/templates/src/test/java/package/security/oauth2/CustomClaimConverterIT.java.ejs +63 -0
  315. package/generators/server/templates/src/test/java/package/service/MailServiceIT.java.ejs +1 -1
  316. package/generators/server/templates/src/test/java/package/web/rest/AccountResourceIT.java.ejs +2 -3
  317. package/generators/server/templates/src/test/java/package/web/rest/ClientForwardControllerTest.java.ejs +9 -0
  318. package/generators/server/templates/src/test/resources/junit-platform.properties.ejs +2 -0
  319. package/generators/server/templates/src/test/resources/logback.xml.ejs +1 -1
  320. package/generators/server/templates/src/test/{features → resources/package/features}/gitkeep +0 -0
  321. package/generators/server/templates/src/test/{features → resources/package/features}/user/user.feature.ejs +0 -0
  322. package/generators/spring-controller/index.js +9 -7
  323. package/generators/spring-controller/templates/src/test/java/package/web/rest/ResourceIT.java.ejs +1 -1
  324. package/generators/spring-service/index.js +10 -7
  325. package/generators/upgrade/index.js +4 -5
  326. package/generators/utils.js +2 -2
  327. package/generators/workspaces/index.js +16 -7
  328. package/jdl/jhipster/default-application-options.js +9 -7
  329. package/package.json +22 -22
  330. package/utils/entity.js +17 -4
  331. package/utils/field.js +11 -1
  332. package/utils/multi-step-transform/index.js +8 -8
  333. package/generators/client/templates/react/.npmrc.ejs +0 -1
  334. package/generators/client/templates/vue/webpack/dev.env.js.ejs +0 -17
  335. package/generators/client/templates/vue/webpack/env.js.ejs +0 -67
  336. package/generators/client/templates/vue/webpack/loader.conf.js.ejs +0 -20
  337. package/generators/client/templates/vue/webpack/prod.env.js.ejs +0 -15
  338. package/generators/server/templates/src/main/java/package/config/apidocs/GatewaySwaggerResourcesProvider.java.ejs +0 -91
  339. package/generators/server/templates/src/test/java/package/config/apidocs/GatewaySwaggerResourcesProviderTest.java.ejs +0 -79
  340. package/generators/server/templates/src/test/resources/cucumber.properties.ejs +0 -1
@@ -3,155 +3,179 @@ const path = require('path');
3
3
  const { merge } = require('webpack-merge');
4
4
  const { VueLoaderPlugin } = require('vue-loader');
5
5
  const CopyWebpackPlugin = require('copy-webpack-plugin');
6
+ const HtmlWebpackPlugin = require('html-webpack-plugin');
6
7
  <%_ if (enableTranslation) { _%>
7
8
  const { hashElement } = require('folder-hash');
8
9
  const MergeJsonWebpackPlugin = require('merge-jsons-webpack-plugin');
9
10
  <%_ } _%>
10
- const { DefinePlugin } = require('webpack');
11
- const vueLoaderConfig = require('./loader.conf');
12
11
 
13
- function resolve(dir) {
12
+ const { DefinePlugin, EnvironmentPlugin } = require('webpack');
13
+ const { vueLoaderConfig } = require('./vue.utils');
14
+ const config = require('./config');
15
+
16
+ function resolve(dir = '') {
14
17
  return path.join(__dirname, '..', dir);
15
18
  }
16
19
 
17
- module.exports = async env => {
20
+ module.exports = async (env, options) => {
21
+ const development = options.mode === 'development';
18
22
  <%_ if (enableTranslation) { _%>
19
- const languagesHash = await hashElement(path.resolve(__dirname, '../<%= MAIN_SRC_DIR %>i18n'), {
23
+ const languagesHash = await hashElement(resolve('<%= MAIN_SRC_DIR %>i18n'), {
20
24
  algo: 'md5',
21
25
  encoding: 'hex',
22
26
  files: { include: ['*.json'] },
23
27
  });
24
28
 
25
29
  <%_ } _%>
26
-
27
30
  return merge(
28
- {
29
- mode: 'development',
30
- context: path.resolve(__dirname, '../'),
31
- entry: {
32
- app: './<%= CLIENT_MAIN_SRC_DIR %>app/main.ts'
33
- },
34
- resolve: {
35
- extensions: ['.ts', '.js', '.vue', '.json'],
36
- alias: {
37
- vue$: 'vue/dist/vue.esm.js',
38
- '@': resolve('<%= CLIENT_MAIN_SRC_DIR %>app')
39
- },
40
- fallback: {
41
- // prevent webpack from injecting useless setImmediate polyfill because Vue
42
- // source contains it (although only uses it if it's native).
43
- setImmediate: false,
44
- // prevent webpack from injecting mocks to Node native modules
45
- // that does not make sense for the client
46
- dgram: 'empty',
47
- fs: 'empty',
48
- net: 'empty',
49
- tls: 'empty',
50
- child_process: 'empty',
51
- },
52
- },
53
- cache: {
54
- // 1. Set cache type to filesystem
55
- type: 'filesystem',
56
- cacheDirectory: path.resolve(__dirname, '../<%= buildDir %>webpack'),
57
- buildDependencies: {
58
- // 2. Add your config as buildDependency to get cache invalidation on config change
59
- config: [
60
- __filename,
61
- path.resolve(__dirname, `webpack.${env.env == 'development' ? 'dev' : 'prod'}.js`),
62
- path.resolve(__dirname, 'utils.js'),
63
- path.resolve(__dirname, '../.postcssrc.js'),
64
- path.resolve(__dirname, '../tsconfig.json')
65
- ],
66
- },
67
- },
68
- module: {
69
- rules: [
70
- {
71
- test: /\.vue$/,
72
- loader: 'vue-loader',
73
- options: vueLoaderConfig
31
+ {
32
+ mode: options.mode,
33
+ context: resolve(),
34
+ <%_ if (applicationTypeGateway && microfrontend) { _%>
35
+ experiments: {
36
+ topLevelAwait: true,
37
+ },
38
+ <%_ } _%>
39
+ entry: {
40
+ app: './<%= CLIENT_MAIN_SRC_DIR %>app/<%= microfrontend ? 'index' : 'main' %>.ts',
41
+ },
42
+ output: {
43
+ path: resolve('<%= DIST_DIR %>'),
74
44
  },
75
- {
76
- test: /\.ts$/,
77
- use: [
45
+ resolve: {
46
+ extensions: ['.ts', '.js', '.vue', '.json'],
47
+ alias: {
48
+ vue$: 'vue/dist/vue.esm.js',
49
+ '@': resolve('<%= CLIENT_MAIN_SRC_DIR %>app'),
50
+ },
51
+ },
52
+ devServer: {
53
+ <%_ if (microfrontend) { _%>
54
+ hot: config.dev.hotReload,
55
+ <%_ } _%>
56
+ static: {
57
+ directory: './<%= DIST_DIR %>',
58
+ },
59
+ port: <%= devServerPort %>,
60
+ proxy: [
78
61
  {
79
- loader: 'ts-loader',
80
- options: {
81
- appendTsSuffixTo: ['\\.vue$'],
82
- happyPackMode: true,
83
- transpileOnly: true
84
- }
62
+ context: [
63
+ '/api',
64
+ '/services',
65
+ '/management',
66
+ '/v3/api-docs',
67
+ '/h2-console',
68
+ <%_ if (authenticationTypeOauth2) { _%>
69
+ '/oauth2',
70
+ '/login',
71
+ <%_ } _%>
72
+ '/auth'
73
+ ],
74
+ target: 'http://localhost:<%= this.applicationTypeMicroservice ? gatewayServerPort : serverPort %>',
75
+ secure: false,
76
+ },
77
+ <%_ if (communicationSpringWebsocket) { _%>
78
+ {
79
+ context: [
80
+ '/websocket'
81
+ ],
82
+ target: 'ws://localhost:<%= this.applicationTypeMicroservice ? gatewayServerPort : serverPort %>',
83
+ ws: true
85
84
  }
85
+ <%_ } _%>
86
86
  ],
87
- include: [resolve('src'), resolve('test')]
87
+ historyApiFallback: true
88
88
  },
89
- {
90
- test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
91
- loader: 'url-loader',
92
- options: {
93
- limit: 10000,
94
- name: 'content/[hash].[ext]',
95
- publicPath: "../"
96
- }
89
+ cache: {
90
+ // 1. Set cache type to filesystem
91
+ type: 'filesystem',
92
+ cacheDirectory: resolve('<%= buildDir %>webpack'),
93
+ buildDependencies: {
94
+ // 2. Add your config as buildDependency to get cache invalidation on config change
95
+ config: [
96
+ __filename,
97
+ path.resolve(__dirname, 'config.js'),
98
+ path.resolve(__dirname, 'vue.utils.js'),
99
+ path.resolve(__dirname, `webpack.${development ? 'dev' : 'prod'}.js`),
100
+ path.resolve(__dirname, '../.postcssrc.js'),
101
+ path.resolve(__dirname, '../tsconfig.json'),
102
+ ],
103
+ },
97
104
  },
98
- {
99
- test: /\.(mp4|webm|ogg|mp3|wav|flac|aac)(\?.*)?$/,
100
- loader: 'url-loader',
101
- options: {
102
- limit: 10000,
103
- name: 'content/[hash].[ext]',
104
- publicPath: "../"
105
- }
105
+ module: {
106
+ rules: [
107
+ {
108
+ test: /\.vue$/,
109
+ loader: 'vue-loader',
110
+ options: vueLoaderConfig(!development),
111
+ },
112
+ {
113
+ test: /\.ts$/,
114
+ use: [
115
+ {
116
+ loader: 'ts-loader',
117
+ options: {
118
+ appendTsSuffixTo: ['\\.vue$'],
119
+ happyPackMode: true,
120
+ transpileOnly: true,
121
+ },
122
+ },
123
+ ],
124
+ include: [resolve('src'), resolve('test')],
125
+ },
126
+ {
127
+ test: /\.(png|jpe?g|gif|svg|mp4|webm|ogg|mp3|wav|flac|aac|woff2?|eot|ttf|otf)/,
128
+ type: 'asset/resource',
129
+ },
130
+ ],
106
131
  },
107
- {
108
- test: /\.(woff2?|eot|ttf|otf)(\?.*)?$/,
109
- loader: 'url-loader',
110
- options: {
111
- limit: 10000,
112
- name: 'content/[hash].[ext]',
113
- publicPath: "../"
114
- }
115
- }
116
- ]
117
- },
118
- plugins: [
119
- new DefinePlugin({
132
+ plugins: [
133
+ new EnvironmentPlugin({
134
+ // Required by vuelidate https://github.com/vuelidate/vuelidate/issues/365
135
+ BUILD: 'web',
136
+ }),
137
+ new DefinePlugin({
120
138
  <%_ if (enableTranslation) { _%>
121
- I18N_HASH: JSON.stringify(languagesHash.hash),
139
+ I18N_HASH: JSON.stringify(languagesHash.hash),
122
140
  <%_ } _%>
123
- 'process.env': require(env.env == 'development' ? './dev.env' : './prod.env'),
124
- }),
125
- new VueLoaderPlugin(),
126
- new CopyWebpackPlugin({
127
- patterns: [
128
- {
129
- context: './node_modules/swagger-ui-dist/',
130
- from: '*.{js,css,html,png}',
131
- to: 'swagger-ui/',
132
- globOptions: { ignore: ['**/index.html'] },
133
- },
134
- { from: './node_modules/axios/dist/axios.min.js', to: 'swagger-ui/' },
135
- { from: './<%= CLIENT_MAIN_SRC_DIR %>swagger-ui/', to: 'swagger-ui/' },
136
- { from: './<%= CLIENT_MAIN_SRC_DIR %>content/', to: 'content/' },
137
- { from: './<%= CLIENT_MAIN_SRC_DIR %>favicon.ico', to: 'favicon.ico' },
138
- {
139
- from: './<%= CLIENT_MAIN_SRC_DIR %>manifest.webapp',
140
- to: 'manifest.webapp',
141
- },
142
- // jhipster-needle-add-assets-to-webpack - JHipster will add/remove third-party resources in this array
143
- { from: './<%= CLIENT_MAIN_SRC_DIR %>robots.txt', to: 'robots.txt' },
144
- ]
145
- })<% if (enableTranslation) { %>,
146
- new MergeJsonWebpackPlugin({
147
- output: {
148
- groupBy: [
149
- // jhipster-needle-i18n-language-webpack - JHipster will add/remove languages in this array
150
- ]
151
- }
152
- })<% } %>
153
- ]
154
- }
155
- // jhipster-needle-add-webpack-config - JHipster will add custom config
156
- );
141
+ VERSION: JSON.stringify(config.version),
142
+ SERVER_API_URL: JSON.stringify(config.serverApiUrl),
143
+ }),
144
+ new HtmlWebpackPlugin({
145
+ base: '/',
146
+ template: './<%= MAIN_SRC_DIR %>index.html',
147
+ }),
148
+ new VueLoaderPlugin(),
149
+ new CopyWebpackPlugin({
150
+ patterns: [
151
+ {
152
+ context: './node_modules/swagger-ui-dist/',
153
+ from: '*.{js,css,html,png}',
154
+ to: 'swagger-ui/',
155
+ globOptions: { ignore: ['**/index.html'] },
156
+ },
157
+ { from: './node_modules/axios/dist/axios.min.js', to: 'swagger-ui/' },
158
+ { from: './<%= CLIENT_MAIN_SRC_DIR %>swagger-ui/', to: 'swagger-ui/' },
159
+ { from: './<%= CLIENT_MAIN_SRC_DIR %>content/', to: 'content/' },
160
+ { from: './<%= CLIENT_MAIN_SRC_DIR %>favicon.ico', to: 'favicon.ico' },
161
+ {
162
+ from: './<%= CLIENT_MAIN_SRC_DIR %>manifest.webapp',
163
+ to: 'manifest.webapp',
164
+ },
165
+ // jhipster-needle-add-assets-to-webpack - JHipster will add/remove third-party resources in this array
166
+ { from: './<%= CLIENT_MAIN_SRC_DIR %>robots.txt', to: 'robots.txt' },
167
+ ],
168
+ })<% if (enableTranslation) { %>,
169
+ new MergeJsonWebpackPlugin({
170
+ output: {
171
+ groupBy: [
172
+ // jhipster-needle-i18n-language-webpack - JHipster will add/remove languages in this array
173
+ ],
174
+ },
175
+ }),<% } %>
176
+ ],
177
+ },
178
+ await require(`./webpack.${development ? 'dev' : 'prod'}`)(env, options)
179
+ // jhipster-needle-add-webpack-config - JHipster will add custom config
180
+ );
157
181
  };
@@ -18,89 +18,31 @@
18
18
  -%>
19
19
  'use strict';
20
20
  const BrowserSyncPlugin = require('browser-sync-webpack-plugin');
21
- const portfinder = require('portfinder');
22
21
  const webpack = require('webpack');
23
- const { merge: webpackMerge } = require('webpack-merge');
24
- const HtmlWebpackPlugin = require('html-webpack-plugin');
25
22
 
26
- const utils = require('./vue.utils');
27
- const config = require('./env');
28
- const commonConfig = require('./webpack.common');
29
- const jhiUtils = require('./utils.js');
30
- const MODE = 'development';
23
+ const { styleLoaders } = require('./vue.utils');
24
+ const config = require('./config');
31
25
 
32
- module.exports = async env => webpackMerge(await commonConfig({ env: MODE }), {
33
- mode: MODE,
34
- module: {
35
- rules: utils.styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
36
- },
37
- // cheap-module-eval-source-map is faster for development
38
- devtool: config.dev.devtool,
39
- entry: {
40
- global: './<%= MAIN_SRC_DIR %>content/scss/global.scss',
41
- main: './<%= MAIN_SRC_DIR %>app/main'
42
- },
43
- output: {
44
- path: jhiUtils.root('<%= DIST_DIR %>'),
45
- filename: 'app/[contenthash].bundle.js',
46
- chunkFilename: 'app/[id].chunk.js'
47
- },
48
- optimization: {
49
- moduleIds: 'named',
50
- },
51
- devServer: {
52
- static: {
53
- directory: './<%= DIST_DIR %>',
26
+ module.exports = (env, options) => {
27
+ const devConfig = {
28
+ module: {
29
+ rules: styleLoaders({ sourceMap: config.dev.cssSourceMap, usePostCSS: true })
54
30
  },
55
- port: <%= devServerPort %>,
56
- proxy: [
57
- {
58
- context: [
59
- '/api',
60
- '/services',
61
- '/management',
62
- '/swagger-resources',
63
- '/v2/api-docs',
64
- '/v3/api-docs',
65
- '/h2-console',
66
- <%_ if (authenticationTypeOauth2) { _%>
67
- '/oauth2',
68
- '/login',
69
- <%_ } _%>
70
- '/auth'
71
- ],
72
- target: 'http://127.0.0.1:<%= serverPort %>',
73
- secure: false,
74
- headers: { host: 'localhost:9000' }
75
- },
76
- <%_ if (communicationSpringWebsocket) { _%>
77
- {
78
- context: [
79
- '/websocket'
80
- ],
81
- target: 'ws://127.0.0.1:<%= serverPort %>',
82
- ws: true
83
- }
84
- <%_ } _%>
85
- ],
86
- historyApiFallback: true
87
- },
88
- plugins: [
89
- new webpack.HotModuleReplacementPlugin(),
90
- new webpack.NoEmitOnErrorsPlugin(),
91
- new HtmlWebpackPlugin({
92
- base: '/',
93
- template: './<%= MAIN_SRC_DIR %>index.html',
94
- chunks: ['vendors', 'main', 'global'],
95
- chunksSortMode: 'manual',
96
- inject: true
97
- }),
31
+ // cheap-module-eval-source-map is faster for development
32
+ devtool: config.dev.devtool,
33
+ optimization: {
34
+ moduleIds: 'named',
35
+ },
36
+ plugins: [],
37
+ };
38
+ if (!options.env.WEBPACK_SERVE) return devConfig;
39
+ devConfig.plugins.push(
98
40
  new BrowserSyncPlugin(
99
41
  {
100
42
  host: 'localhost',
101
43
  port: 9000,
102
44
  proxy: {
103
- target: 'http://localhost:<%= devServerPort %>',
45
+ target: `http://localhost:${options.watch ? '<%= this.applicationTypeMicroservice ? gatewayServerPort : serverPort %>' : '<%= devServerPort %>'}`,
104
46
  <%_ if (communicationSpringWebsocket) { _%>
105
47
  ws: true,
106
48
  <%_ } _%>
@@ -122,5 +64,6 @@ module.exports = async env => webpackMerge(await commonConfig({ env: MODE }), {
122
64
  reload: true
123
65
  }
124
66
  )
125
- ]
126
- });
67
+ );
68
+ return devConfig;
69
+ };
@@ -0,0 +1,77 @@
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
+ <&_ if (fragment.importsSection) { -&>
20
+ <%_ if (applicationTypeMicroservice) { _%>
21
+ const { DefinePlugin } = require('webpack');
22
+ <%_ } _%>
23
+ <&_ } -&>
24
+ <&_ if (fragment.moduleFederationSection) { -&>
25
+ <%_ if (applicationTypeGateway) { _%>
26
+ remotes: {
27
+ <%_ for (const remote of microfrontends) { _%>
28
+ '@<%= remote.lowercaseBaseName %>': `<%= remote.lowercaseBaseName %>@/<%= remote.endpointPrefix %>/remoteEntry.js`,
29
+ <%_ } _%>
30
+ },
31
+ <%_ } _%>
32
+ <%_ if (applicationTypeMicroservice) { _%>
33
+ exposes: {
34
+ './entities-router': './<%= CLIENT_MAIN_SRC_DIR %>app/router/entities',
35
+ './entities-menu': './<%= CLIENT_MAIN_SRC_DIR %>app/entities/entities-menu',
36
+ },
37
+ <%_ } _%>
38
+ shared: {
39
+ axios: { singleton: true, shareScope: 'default' },
40
+ 'vue-loader': { eager: true, singleton: false, shareScope: 'default' },
41
+ 'bootstrap-vue': { singleton: true, shareScope: 'default' },
42
+ vue: { singleton: true, shareScope: 'default' },
43
+ vuelidate: { singleton: true, shareScope: 'default' },
44
+ 'vue-class-component': { singleton: true, shareScope: 'default' },
45
+ 'vue-i18n': { singleton: true, shareScope: 'default' },
46
+ 'vue-router': { singleton: true, shareScope: 'default' },
47
+ 'vue2-filters': { singleton: true, shareScope: 'default' },
48
+ vuex: { singleton: true, shareScope: 'default' },
49
+ 'vue-property-decorator': { singleton: true, shareScope: 'default' },
50
+ '@/shared/security/authority': {
51
+ singleton: true,
52
+ shareScope: 'default',
53
+ import: '@/shared/security/authority',
54
+ requiredVersion: appVersion,
55
+ },
56
+ '@/shared/alert/alert.service': {
57
+ singleton: true,
58
+ shareScope: 'default',
59
+ import: '@/shared/alert/alert.service',
60
+ requiredVersion: appVersion,
61
+ },
62
+ '@/locale/translation.service': {
63
+ singleton: true,
64
+ shareScope: 'default',
65
+ import: '@/locale/translation.service',
66
+ requiredVersion: appVersion,
67
+ },
68
+ },
69
+ <&_ } -&>
70
+ <&_ if (fragment.pluginsSection) { -&>
71
+ <%_ if (applicationTypeMicroservice) { _%>
72
+ new DefinePlugin({
73
+ <%= _.upperCase(baseName) %>_I18N_RESOURCES_PREFIX: JSON.stringify(''),
74
+ }),
75
+ <%_ } _%>
76
+ <&_ } -&>
77
+
@@ -18,40 +18,24 @@
18
18
  -%>
19
19
  'use strict';
20
20
  const webpack = require('webpack');
21
- const webpackMerge = require('webpack-merge').merge;
22
- const HtmlWebpackPlugin = require('html-webpack-plugin');
23
21
  const MiniCssExtractPlugin = require('mini-css-extract-plugin');
24
22
  const CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
25
23
  const WorkboxPlugin = require('workbox-webpack-plugin');
26
24
  const TerserPlugin = require('terser-webpack-plugin');
27
25
  const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin');
28
26
 
29
- const utils = require('./vue.utils');
30
- const config = require('./env');
31
- const baseWebpackConfig = require('./webpack.common');
32
- const jhiUtils = require('./utils.js');
33
-
34
- const MODE = 'production';
27
+ const { styleLoaders } = require('./vue.utils');
28
+ const config = require('./config');
35
29
 
36
30
  const webpackConfig = {
37
- mode: MODE,
38
31
  module: {
39
- rules: utils.styleLoaders({
32
+ rules: styleLoaders({
40
33
  sourceMap: config.build.productionSourceMap,
41
34
  extract: true,
42
35
  usePostCSS: true
43
36
  })
44
37
  },
45
38
  devtool: config.build.productionSourceMap ? config.build.devtool : false,
46
- entry: {
47
- global: './<%= MAIN_SRC_DIR %>content/scss/global.scss',
48
- main: './<%= MAIN_SRC_DIR %>app/main'
49
- },
50
- output: {
51
- path: jhiUtils.root('<%= DIST_DIR %>'),
52
- filename: 'app/[name].[contenthash].bundle.js',
53
- chunkFilename: 'app/[id].[chunkhash].chunk.js'
54
- },
55
39
  optimization: {
56
40
  moduleIds: 'deterministic',
57
41
  minimizer: [
@@ -106,27 +90,7 @@ const webpackConfig = {
106
90
  extractComments: false,
107
91
  }),
108
92
  // extract css into its own file
109
- new MiniCssExtractPlugin({
110
- filename: 'content/[name].[contenthash].css',
111
- chunkFilename: 'content/[id].css'
112
- }),
113
- // generate dist index.html with correct asset hash for caching.
114
- // you can customize output by editing /index.html
115
- // see https://github.com/ampedandwired/html-webpack-plugin
116
- new HtmlWebpackPlugin({
117
- base: '/',
118
- template: './<%= MAIN_SRC_DIR %>index.html',
119
- chunks: ['vendors', 'main', 'global'],
120
- chunksSortMode: 'manual',
121
- inject: true,
122
- minify: {
123
- removeComments: true,
124
- collapseWhitespace: true,
125
- removeAttributeQuotes: true
126
- // more options:
127
- // https://github.com/kangax/html-minifier#options-quick-reference
128
- },
129
- }),
93
+ new MiniCssExtractPlugin(),
130
94
  // keep module.id stable when vendor modules does not change
131
95
  new ForkTsCheckerWebpackPlugin(
132
96
  {
@@ -170,4 +134,4 @@ if (config.build.bundleAnalyzerReport) {
170
134
  webpackConfig.plugins.push(new BundleAnalyzerPlugin());
171
135
  }
172
136
 
173
- module.exports = async () => webpackMerge(await baseWebpackConfig({ env: MODE }), webpackConfig);
137
+ module.exports = async () => webpackConfig;
@@ -35,12 +35,12 @@ const NO_DATABASE_TYPE = databaseTypes.NO;
35
35
 
36
36
  const exec = childProcess.exec;
37
37
 
38
- let useBlueprints;
39
38
  /* eslint-disable consistent-return */
40
39
  module.exports = class extends BaseBlueprintGenerator {
41
- constructor(args, options, features) {
42
- super(args, options, features);
43
- useBlueprints = !this.fromBlueprint && this.instantiateBlueprints(GENERATOR_CLOUDFOUNDRY);
40
+ async _postConstruct() {
41
+ if (!this.fromBlueprint) {
42
+ await this.composeWithBlueprints(GENERATOR_CLOUDFOUNDRY);
43
+ }
44
44
  }
45
45
 
46
46
  _initializing() {
@@ -66,7 +66,7 @@ module.exports = class extends BaseBlueprintGenerator {
66
66
  }
67
67
 
68
68
  get initializing() {
69
- if (useBlueprints) return;
69
+ if (this.delegateToBlueprint) return {};
70
70
  return this._initializing();
71
71
  }
72
72
 
@@ -75,7 +75,7 @@ module.exports = class extends BaseBlueprintGenerator {
75
75
  }
76
76
 
77
77
  get prompting() {
78
- if (useBlueprints) return;
78
+ if (this.delegateToBlueprint) return {};
79
79
  return this._prompting();
80
80
  }
81
81
 
@@ -115,7 +115,7 @@ module.exports = class extends BaseBlueprintGenerator {
115
115
  }
116
116
 
117
117
  get configuring() {
118
- if (useBlueprints) return;
118
+ if (this.delegateToBlueprint) return {};
119
119
  return this._configuring();
120
120
  }
121
121
 
@@ -182,7 +182,7 @@ module.exports = class extends BaseBlueprintGenerator {
182
182
  }
183
183
 
184
184
  get default() {
185
- if (useBlueprints) return;
185
+ if (this.delegateToBlueprint) return {};
186
186
  return this._default();
187
187
  }
188
188
 
@@ -232,7 +232,7 @@ module.exports = class extends BaseBlueprintGenerator {
232
232
  }
233
233
 
234
234
  get end() {
235
- if (useBlueprints) return;
235
+ if (this.delegateToBlueprint) return {};
236
236
  return this._end();
237
237
  }
238
238
  };