generator-jhipster 7.6.0 → 7.7.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 (310) hide show
  1. package/README.md +1 -3
  2. package/cli/commands.js +3 -0
  3. package/cli/environment-builder.js +53 -18
  4. package/cli/import-jdl.js +3 -0
  5. package/cli/index.mjs +20 -0
  6. package/cli/jhipster.js +19 -11
  7. package/cli/program.js +94 -38
  8. package/generators/app/esm.mjs +1 -3
  9. package/generators/app/index.js +1 -16
  10. package/generators/aws/esm.mjs +1 -3
  11. package/generators/azure-app-service/esm.mjs +1 -3
  12. package/generators/azure-spring-cloud/esm.mjs +1 -3
  13. package/generators/base/esm.mjs +1 -3
  14. package/generators/bootstrap/esm.mjs +1 -3
  15. package/generators/bootstrap/index.js +36 -86
  16. package/generators/bootstrap-application/esm.mjs +19 -0
  17. package/generators/bootstrap-application/generator.mjs +353 -0
  18. package/generators/bootstrap-application/index.mjs +19 -0
  19. package/generators/ci-cd/esm.mjs +1 -3
  20. package/generators/ci-cd/prompts.js +1 -1
  21. package/generators/ci-cd/templates/github-actions.yml.ejs +2 -2
  22. package/generators/client/esm.mjs +5 -3
  23. package/generators/client/files-angular.js +9 -0
  24. package/generators/client/files-common.js +8 -7
  25. package/generators/client/files-vue.js +7 -6
  26. package/generators/client/index.js +2 -1
  27. package/generators/client/templates/angular/angular.json.ejs +1 -1
  28. package/generators/client/templates/angular/package.json +25 -22
  29. package/generators/client/templates/angular/package.json.ejs +5 -1
  30. package/generators/client/templates/angular/src/main/webapp/app/account/activate/activate.component.html.ejs +1 -1
  31. package/generators/client/templates/angular/src/main/webapp/app/account/password/password.component.html.ejs +7 -7
  32. package/generators/client/templates/angular/src/main/webapp/app/account/password-reset/finish/password-reset-finish.component.html.ejs +5 -5
  33. package/generators/client/templates/angular/src/main/webapp/app/account/password-reset/init/password-reset-init.component.html.ejs +3 -3
  34. package/generators/client/templates/angular/src/main/webapp/app/account/register/register.component.html.ejs +10 -10
  35. package/generators/client/templates/angular/src/main/webapp/app/account/settings/settings.component.html.ejs +8 -8
  36. package/generators/client/templates/angular/src/main/webapp/app/admin/configuration/configuration.component.html.ejs +2 -2
  37. package/generators/client/templates/angular/src/main/webapp/app/admin/gateway/gateway.component.html.ejs +5 -5
  38. package/generators/client/templates/angular/src/main/webapp/app/admin/health/health.component.html.ejs +1 -1
  39. package/generators/client/templates/angular/src/main/webapp/app/admin/health/health.component.spec.ts.ejs +2 -2
  40. package/generators/client/templates/angular/src/main/webapp/app/admin/health/health.component.ts.ejs +2 -2
  41. package/generators/client/templates/angular/src/main/webapp/app/admin/health/modal/health-modal.component.html.ejs +6 -6
  42. package/generators/client/templates/angular/src/main/webapp/app/admin/logs/logs.component.html.ejs +51 -49
  43. package/generators/client/templates/angular/src/main/webapp/app/admin/metrics/blocks/metrics-cache/metrics-cache.component.html.ejs +16 -16
  44. package/generators/client/templates/angular/src/main/webapp/app/admin/metrics/blocks/metrics-datasource/metrics-datasource.component.html.ejs +32 -32
  45. package/generators/client/templates/angular/src/main/webapp/app/admin/metrics/blocks/metrics-endpoints-requests/metrics-endpoints-requests.component.html.ejs +4 -4
  46. package/generators/client/templates/angular/src/main/webapp/app/admin/metrics/blocks/metrics-garbagecollector/metrics-garbagecollector.component.html.ejs +18 -18
  47. package/generators/client/templates/angular/src/main/webapp/app/admin/metrics/blocks/metrics-modal-threads/metrics-modal-threads.component.html.ejs +12 -12
  48. package/generators/client/templates/angular/src/main/webapp/app/admin/metrics/blocks/metrics-modal-threads/metrics-modal-threads.component.ts.ejs +4 -4
  49. package/generators/client/templates/angular/src/main/webapp/app/admin/metrics/blocks/metrics-request/metrics-request.component.html.ejs +4 -4
  50. package/generators/client/templates/angular/src/main/webapp/app/admin/metrics/blocks/metrics-system/metrics-system.component.html.ejs +8 -8
  51. package/generators/client/templates/angular/src/main/webapp/app/admin/metrics/metrics.component.html.ejs +1 -1
  52. package/generators/client/templates/angular/src/main/webapp/app/admin/user-management/delete/user-management-delete-dialog.component.html.ejs +1 -1
  53. package/generators/client/templates/angular/src/main/webapp/app/admin/user-management/detail/user-management-detail.component.html.ejs +4 -4
  54. package/generators/client/templates/angular/src/main/webapp/app/admin/user-management/list/user-management.component.html.ejs +5 -5
  55. package/generators/client/templates/angular/src/main/webapp/app/admin/user-management/update/user-management-update.component.html.ejs +11 -11
  56. package/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/navbar.component.html.ejs +4 -2
  57. package/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/navbar.component.scss.ejs +0 -6
  58. package/generators/client/templates/angular/src/main/webapp/app/layouts/profiles/page-ribbon.component.scss.ejs +0 -6
  59. package/generators/client/templates/angular/src/main/webapp/app/login/login.component.html.ejs +3 -3
  60. package/generators/client/templates/angular/src/main/webapp/content/scss/_bootstrap-variables.scss.ejs +5 -5
  61. package/generators/client/templates/angular/src/main/webapp/content/scss/global.scss.ejs +29 -0
  62. package/generators/client/templates/angular/src/main/webapp/content/scss/vendor.scss.ejs +0 -4
  63. package/generators/client/templates/angular/webpack/webpack.custom.js.ejs +19 -0
  64. package/generators/client/templates/common/package.json +2 -2
  65. package/generators/client/templates/common/src/main/webapp/swagger-ui/index.html.ejs +1 -7
  66. package/generators/client/templates/react/package.json +33 -33
  67. package/generators/client/templates/vue/package.json +23 -23
  68. package/generators/client/templates/vue/src/main/webapp/app/core/jhi-navbar/jhi-navbar.component.ts.ejs +3 -3
  69. package/generators/client/templates/vue/src/main/webapp/app/entities/user/user.service.ts.ejs +0 -0
  70. package/generators/client/templates/vue/src/main/webapp/app/main.ts.ejs +29 -1
  71. package/generators/client/templates/vue/src/main/webapp/app/shared/config/axios-interceptor.ts.ejs +2 -2
  72. package/generators/client/templates/vue/src/main/webapp/app/shared/config/config.ts.ejs +0 -4
  73. package/generators/cloudfoundry/esm.mjs +1 -3
  74. package/generators/common/esm.mjs +2 -3
  75. package/generators/common/files.js +1 -2
  76. package/generators/common/index.js +6 -0
  77. package/generators/common/templates/.husky/{pre-commit → pre-commit.ejs} +4 -0
  78. package/generators/common/templates/README.md.jhi.ejs +3 -1
  79. package/generators/common/templates/package.json +3 -3
  80. package/generators/common/templates/sonar-project.properties.ejs +1 -1
  81. package/generators/cypress/esm.mjs +2 -3
  82. package/generators/cypress/files.js +2 -1
  83. package/generators/cypress/templates/src/test/javascript/cypress/integration/account/settings-page.spec.ts.ejs +18 -14
  84. package/generators/database-changelog/esm.mjs +1 -3
  85. package/generators/database-changelog/index.js +1 -1
  86. package/generators/database-changelog-liquibase/esm.mjs +2 -3
  87. package/generators/docker-compose/esm.mjs +1 -3
  88. package/generators/entities/esm.mjs +1 -3
  89. package/generators/entities/index.js +2 -2
  90. package/generators/entities-client/esm.mjs +1 -3
  91. package/generators/entity/esm.mjs +1 -3
  92. package/generators/entity/index.js +11 -15
  93. package/generators/entity/prompts.js +4 -1
  94. package/generators/entity-client/esm.mjs +2 -3
  95. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/delete/entity-management-delete-dialog.component.html.ejs +1 -1
  96. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/detail/entity-management-detail.component.html.ejs +2 -2
  97. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/list/entity-management.component.html.ejs +20 -21
  98. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/update/entity-management-update.component.html.ejs +14 -16
  99. package/generators/entity-client/templates/angular/src/main/webapp/app/entities/update/entity-management-update.component.ts.ejs +2 -2
  100. package/generators/entity-client/templates/common/src/test/javascript/cypress/integration/entity/entity.spec.ts.ejs +1 -1
  101. package/generators/entity-client/templates/react/src/main/webapp/app/entities/entity-reducer.spec.ts.ejs +1 -1
  102. package/generators/entity-client/templates/react/src/main/webapp/app/entities/entity-update.tsx.ejs +1 -1
  103. package/generators/entity-client/templates/react/src/test/javascript/e2e/entities/entity-update-page-object.ts.ejs +1 -1
  104. package/generators/entity-client/templates/vue/src/test/javascript/e2e/entities/entity-update-page-object.ts.ejs +1 -1
  105. package/generators/entity-client/templates/vue/src/test/javascript/e2e/entities/entity.spec.ts.ejs +1 -1
  106. package/generators/entity-i18n/esm.mjs +2 -3
  107. package/generators/entity-server/esm.mjs +2 -3
  108. package/generators/entity-server/files-couchbase.js +23 -2
  109. package/generators/entity-server/files.js +16 -2
  110. package/generators/entity-server/index.js +8 -1
  111. package/generators/entity-server/templates/couchbase/src/main/java/package/domain/Entity.java.jhi.spring_data_couchbase.ejs +11 -13
  112. package/generators/entity-server/templates/couchbase/src/main/java/package/repository/EntityRepository.java.ejs +23 -59
  113. package/generators/entity-server/templates/couchbase/src/main/resources/config/couchmove/changelog/entity.fts.ejs +5 -6
  114. package/generators/entity-server/templates/couchbase/src/main/resources/config/couchmove/changelog/entity.n1ql.ejs +5 -0
  115. package/generators/entity-server/templates/partials/it_patch_update.partial.java.ejs +2 -2
  116. package/generators/entity-server/templates/partials/save_template.ejs +1 -1
  117. package/generators/entity-server/templates/src/main/java/package/common/get_all_template.ejs +1 -1
  118. package/generators/entity-server/templates/src/main/java/package/common/inject_template.ejs +4 -4
  119. package/generators/entity-server/templates/src/main/java/package/common/patch_template.ejs +3 -3
  120. package/generators/entity-server/templates/src/main/java/package/common/search_stream_template.ejs +1 -1
  121. package/generators/entity-server/templates/src/main/java/package/common/search_template.ejs +1 -1
  122. package/generators/entity-server/templates/src/main/java/package/domain/Entity.java.jhi.ejs +2 -2
  123. package/generators/entity-server/templates/src/main/java/package/repository/EntityRepository.java.ejs +31 -18
  124. package/generators/entity-server/templates/src/main/java/package/repository/EntityRepositoryInternalImpl_reactive.java.ejs +3 -3
  125. package/generators/entity-server/templates/src/main/java/package/repository/EntityRepositoryWithBagRelationships.java.ejs +37 -0
  126. package/generators/entity-server/templates/src/main/java/package/repository/EntityRepositoryWithBagRelationshipsImpl.java.ejs +90 -0
  127. package/generators/entity-server/templates/src/main/java/package/repository/EntityRepository_reactive.java.ejs +2 -2
  128. package/generators/entity-server/templates/src/main/java/package/repository/rowmapper/EntityRowMapper.java.ejs +1 -1
  129. package/generators/entity-server/templates/src/main/java/package/repository/search/EntitySearchRepository.java.ejs +3 -5
  130. package/generators/entity-server/templates/src/main/java/package/repository/search/{SortToFieldSortBuilderConverter.java.ejs → SortToSortBuilderListConverter.java.ejs} +4 -3
  131. package/generators/entity-server/templates/src/main/java/package/service/criteria/EntityCriteria.java.ejs +8 -6
  132. package/generators/entity-server/templates/src/main/java/package/service/impl/EntityServiceImpl.java.ejs +1 -1
  133. package/generators/entity-server/templates/src/main/java/package/service/mapper/EntityMapper.java.ejs +6 -6
  134. package/generators/entity-server/templates/src/main/java/package/web/rest/EntityResource.java.ejs +1 -1
  135. package/generators/entity-server/templates/src/test/java/package/web/rest/EntityResourceIT.java.ejs +5 -5
  136. package/generators/export-jdl/esm.mjs +1 -3
  137. package/generators/gae/esm.mjs +1 -3
  138. package/generators/generate-blueprint/constants.mjs +146 -0
  139. package/generators/generate-blueprint/esm.mjs +19 -0
  140. package/generators/generate-blueprint/files.mjs +81 -0
  141. package/generators/generate-blueprint/generator.mjs +363 -0
  142. package/generators/generate-blueprint/index.mjs +20 -0
  143. package/generators/generate-blueprint/templates/.eslintrc.json.ejs +41 -0
  144. package/generators/generate-blueprint/templates/.github/workflows/generator.yml.ejs +32 -0
  145. package/generators/generate-blueprint/templates/.mocharc.cjs.ejs +29 -0
  146. package/generators/{server/templates/couchbase/src/main/java/package/config/couchbase/package-info.java.ejs → generate-blueprint/templates/.prettierignore.jhi.blueprint.ejs} +4 -7
  147. package/generators/generate-blueprint/templates/README.md.ejs +75 -0
  148. package/generators/generate-blueprint/templates/cli/cli.mjs.ejs +35 -0
  149. package/generators/generate-blueprint/templates/cli/commands.cjs.ejs +25 -0
  150. package/generators/generate-blueprint/templates/generators/generator/generator.mjs.jhi.ejs +98 -0
  151. package/generators/generate-blueprint/templates/generators/generator/generator.spec.mjs.ejs +42 -0
  152. package/generators/generate-blueprint/templates/generators/generator/index.mjs.ejs +19 -0
  153. package/generators/generate-blueprint/templates/generators/generator/templates/template-file.ejs +0 -0
  154. package/generators/generate-blueprint/templates/test/utils.mjs.ejs +17 -0
  155. package/generators/generator-base-blueprint.js +29 -0
  156. package/generators/generator-base-docker.js +1 -0
  157. package/generators/generator-base-entities.cjs +368 -0
  158. package/generators/generator-base.js +128 -23
  159. package/generators/generator-constants.js +18 -16
  160. package/generators/generator-list.js +2 -0
  161. package/generators/gradle/esm.mjs +19 -0
  162. package/generators/heroku/esm.mjs +1 -3
  163. package/generators/info/esm.mjs +1 -3
  164. package/generators/init/esm.mjs +19 -0
  165. package/generators/init/files.cjs +9 -3
  166. package/generators/init/index.cjs +5 -0
  167. package/generators/init/templates/.gitignore.jhi.ejs +5 -0
  168. package/generators/init/templates/{.lintstagedrc.js.ejs → .lintstagedrc.cjs.ejs} +0 -0
  169. package/generators/java/esm.mjs +19 -0
  170. package/generators/java/index.cjs +58 -2
  171. package/generators/kubernetes/esm.mjs +1 -3
  172. package/generators/kubernetes-helm/esm.mjs +1 -3
  173. package/generators/kubernetes-knative/esm.mjs +1 -3
  174. package/generators/languages/esm.mjs +2 -3
  175. package/generators/languages/templates/src/test/resources/i18n/messages_fr.properties.ejs +4 -1
  176. package/generators/maven/esm.mjs +19 -0
  177. package/generators/openapi-client/esm.mjs +1 -3
  178. package/generators/openapi-client/index.js +11 -4
  179. package/generators/openshift/esm.mjs +1 -3
  180. package/generators/page/esm.mjs +1 -3
  181. package/generators/project-name/esm.mjs +19 -0
  182. package/generators/server/esm.mjs +2 -2
  183. package/generators/server/files-couchbase.js +28 -31
  184. package/generators/server/files.js +14 -1
  185. package/generators/server/index.js +13 -13
  186. package/generators/server/needle-api/needle-server-maven.js +1 -1
  187. package/generators/server/templates/couchbase/src/main/java/package/repository/CouchbaseSearchRepository.java.ejs +91 -0
  188. package/generators/server/templates/couchbase/src/main/java/package/repository/JHipsterCouchbaseRepository.java.ejs +43 -64
  189. package/generators/server/templates/couchbase/src/main/java/package/repository/PersistentTokenRepository_couchbase.java.ejs +2 -2
  190. package/generators/server/templates/couchbase/src/main/resources/config/couchmove/changelog/V0.1__initial_setup/authority/ROLE_ADMIN.json.ejs +3 -0
  191. package/generators/server/templates/couchbase/src/main/resources/config/couchmove/changelog/V0.1__initial_setup/authority/ROLE_USER.json.ejs +3 -0
  192. package/generators/server/templates/couchbase/src/main/resources/config/couchmove/changelog/V0.1__initial_setup/{user__admin.json.ejs → user/admin.json.ejs} +2 -2
  193. package/generators/server/templates/couchbase/src/main/resources/config/couchmove/changelog/V0.1__initial_setup/{user__user.json.ejs → user/user.json.ejs} +2 -2
  194. package/generators/server/templates/couchbase/src/main/resources/config/couchmove/changelog/V0.2__create_indexes.n1ql.ejs +34 -0
  195. package/generators/server/templates/couchbase/src/main/resources/config/couchmove/changelog/V0__create_collections.n1ql.ejs +8 -0
  196. package/generators/server/templates/couchbase/src/test/java/package/CouchbaseTestContainerExtension.java.ejs +4 -3
  197. package/generators/server/templates/couchbase/src/test/java/package/repository/{JHipsterCouchbaseRepositoryTest.java.ejs → CouchbaseSearchRepositoryTest.java.ejs} +2 -2
  198. package/generators/server/templates/gradle/profile_prod.gradle.ejs +4 -0
  199. package/generators/server/templates/gradle.properties.ejs +6 -6
  200. package/generators/server/templates/npmw +14 -5
  201. package/generators/server/templates/pom.xml.ejs +47 -42
  202. package/generators/server/templates/src/main/docker/app.yml.ejs +4 -2
  203. package/generators/server/templates/src/main/docker/zipkin.yml.ejs +25 -0
  204. package/generators/server/templates/src/main/java/package/config/DatabaseConfiguration_couchbase.java.ejs +26 -16
  205. package/generators/server/templates/src/main/java/package/config/LocaleConfiguration_reactive.java.ejs +1 -1
  206. package/generators/server/templates/src/main/java/package/config/SecurityConfiguration_reactive.java.ejs +2 -1
  207. package/generators/server/templates/src/main/java/package/domain/Authority.java.ejs +11 -0
  208. package/generators/server/templates/src/main/java/package/domain/PersistentToken.java.ejs +6 -6
  209. package/generators/server/templates/src/main/java/package/domain/User.java.ejs +9 -7
  210. package/generators/server/templates/src/main/java/package/repository/AuthorityRepository.java.ejs +1 -11
  211. package/generators/server/templates/src/main/java/package/repository/UserRepository.java.ejs +48 -72
  212. package/generators/server/templates/src/main/java/package/security/oauth2/CustomClaimConverter.java.ejs +1 -1
  213. package/generators/server/templates/src/main/java/package/service/UserService.java.ejs +8 -6
  214. package/generators/server/templates/src/main/java/package/web/filter/OAuth2ReactiveRefreshTokensWebFilter.java.ejs +0 -1
  215. package/generators/server/templates/src/main/java/package/web/rest/AccountResource.java.ejs +1 -1
  216. package/generators/server/templates/src/main/java/package/web/rest/LogoutResource_reactive.java.ejs +1 -1
  217. package/generators/server/templates/src/main/java/package/web/rest/PublicUserResource.java.ejs +2 -2
  218. package/generators/server/templates/src/main/resources/config/application-dev.yml.ejs +8 -0
  219. package/generators/server/templates/src/main/resources/config/application-prod.yml.ejs +6 -0
  220. package/generators/server/templates/src/main/resources/config/application.yml.ejs +2 -0
  221. package/generators/server/templates/src/test/java/package/IntegrationTest.java.ejs +3 -1
  222. package/generators/server/templates/src/test/java/package/TechnicalStructureTest.java.ejs +21 -15
  223. package/generators/server/templates/src/test/java/package/config/JHipsterBlockHoundIntegration.java.ejs +2 -0
  224. package/generators/server/templates/src/test/java/package/cucumber/stepdefs/StepDefs.java.ejs +8 -0
  225. package/generators/server/templates/src/test/java/package/cucumber/stepdefs/UserStepDefs.java.ejs +17 -3
  226. package/generators/server/templates/src/test/java/package/security/SecurityUtilsUnitTest_reactive.java.ejs +1 -1
  227. package/generators/server/templates/src/test/java/package/security/oauth2/CustomClaimConverterIT.java.ejs +1 -1
  228. package/generators/server/templates/src/test/java/package/service/mapper/UserMapperTest.java.ejs +1 -1
  229. package/generators/server/templates/src/test/java/package/web/rest/AccountResourceIT.java.ejs +13 -6
  230. package/generators/server/templates/src/test/java/package/web/rest/TestUtil.java.ejs +1 -6
  231. package/generators/server/templates/src/test/java/package/web/rest/UserResourceIT.java.ejs +40 -42
  232. package/generators/server/templates/src/test/java/package/web/rest/errors/ExceptionTranslatorIT_reactive.java.ejs +1 -1
  233. package/generators/spring-boot/esm.mjs +19 -0
  234. package/generators/spring-controller/esm.mjs +1 -3
  235. package/generators/spring-service/esm.mjs +1 -3
  236. package/generators/upgrade/esm.mjs +1 -3
  237. package/generators/upgrade-config/esm.mjs +1 -3
  238. package/generators/workspaces/esm.mjs +1 -3
  239. package/lib/constants/logo.cjs +30 -0
  240. package/lib/constants/priorities.cjs +216 -2
  241. package/lib/constants/priorities.mjs +29 -1
  242. package/lib/index.mjs +6 -0
  243. package/lib/support/mixin.cjs +5 -1
  244. package/lib/support/shared-data.cjs +34 -1
  245. package/package.json +27 -23
  246. package/utils/entity.js +19 -2
  247. package/utils/faker.js +3 -3
  248. package/utils/field.js +61 -49
  249. package/utils/relationship.js +5 -3
  250. package/utils/user.js +109 -0
  251. package/generators/app/generator.spec.mjs +0 -47
  252. package/generators/aws/generator.spec.mjs +0 -47
  253. package/generators/azure-app-service/generator.spec.mjs +0 -47
  254. package/generators/azure-spring-cloud/generator.spec.mjs +0 -47
  255. package/generators/base/generator.spec.mjs +0 -44
  256. package/generators/bootstrap/generator.spec.mjs +0 -44
  257. package/generators/ci-cd/generator.spec.mjs +0 -47
  258. package/generators/client/__workflow/devserver-angular.json +0 -13
  259. package/generators/client/__workflow/devserver-react.json +0 -13
  260. package/generators/client/__workflow/devserver-vue.json +0 -13
  261. package/generators/client/generator.spec.mjs +0 -47
  262. package/generators/cloudfoundry/generator.spec.mjs +0 -47
  263. package/generators/common/generator.spec.mjs +0 -47
  264. package/generators/cypress/generator.spec.mjs +0 -47
  265. package/generators/database-changelog/generator.spec.mjs +0 -47
  266. package/generators/database-changelog-liquibase/generator.spec.mjs +0 -47
  267. package/generators/docker-compose/generator.spec.mjs +0 -44
  268. package/generators/entities/generator.spec.mjs +0 -47
  269. package/generators/entities-client/generator.spec.mjs +0 -47
  270. package/generators/entity/generator.spec.mjs +0 -47
  271. package/generators/entity-client/generator.spec.mjs +0 -47
  272. package/generators/entity-i18n/generator.spec.mjs +0 -47
  273. package/generators/entity-server/generator.spec.mjs +0 -47
  274. package/generators/export-jdl/generator.spec.mjs +0 -44
  275. package/generators/gae/generator.spec.mjs +0 -47
  276. package/generators/gradle/__snapshots__/generator.spec.cjs.snap +0 -59
  277. package/generators/gradle/generator.spec.cjs +0 -71
  278. package/generators/heroku/generator.spec.mjs +0 -47
  279. package/generators/info/generator.spec.mjs +0 -44
  280. package/generators/init/__snapshots__/generator.spec.cjs.snap +0 -65
  281. package/generators/init/generator.spec.cjs +0 -112
  282. package/generators/java/__snapshots__/generator.spec.cjs.snap +0 -118
  283. package/generators/java/generator.spec.cjs +0 -87
  284. package/generators/kubernetes/generator.spec.mjs +0 -44
  285. package/generators/kubernetes-helm/generator.spec.mjs +0 -44
  286. package/generators/kubernetes-knative/generator.spec.mjs +0 -44
  287. package/generators/languages/generator.spec.mjs +0 -47
  288. package/generators/maven/__snapshots__/generator.spec.cjs.snap +0 -53
  289. package/generators/maven/generator.spec.cjs +0 -78
  290. package/generators/openapi-client/generator.spec.mjs +0 -47
  291. package/generators/openshift/generator.spec.mjs +0 -44
  292. package/generators/page/generator.spec.mjs +0 -47
  293. package/generators/project-name/generator.spec.cjs +0 -43
  294. package/generators/server/__snapshots__/generator.spec.mjs.snap +0 -1931
  295. package/generators/server/generator.spec.mjs +0 -52
  296. package/generators/server/templates/couchbase/src/main/java/package/config/couchbase/CustomCouchbaseRepositoryFactory.java.ejs +0 -83
  297. package/generators/server/templates/couchbase/src/main/java/package/config/couchbase/CustomCouchbaseRepositoryFactoryBean.java.ejs +0 -40
  298. package/generators/server/templates/couchbase/src/main/java/package/config/couchbase/CustomCouchbaseRepositoryQuery.java.ejs +0 -44
  299. package/generators/server/templates/couchbase/src/main/java/package/config/couchbase/CustomN1qlQueryCreator.java.ejs +0 -162
  300. package/generators/server/templates/couchbase/src/main/java/package/config/couchbase/CustomN1qlRepositoryQueryExecutor.java.ejs +0 -104
  301. package/generators/server/templates/couchbase/src/main/resources/config/couchmove/changelog/V0.1__initial_setup/ROLE_ADMIN.json.ejs +0 -3
  302. package/generators/server/templates/couchbase/src/main/resources/config/couchmove/changelog/V0.1__initial_setup/ROLE_USER.json.ejs +0 -3
  303. package/generators/server/templates/couchbase/src/main/resources/config/couchmove/changelog/V0__create_indexes.n1ql.ejs +0 -19
  304. package/generators/spring-boot/__snapshots__/generator.spec.cjs.snap +0 -80
  305. package/generators/spring-boot/generator.spec.cjs +0 -64
  306. package/generators/spring-controller/generator.spec.mjs +0 -47
  307. package/generators/spring-service/generator.spec.mjs +0 -47
  308. package/generators/upgrade/generator.spec.mjs +0 -44
  309. package/generators/upgrade-config/generator.spec.mjs +0 -44
  310. package/generators/workspaces/generator.spec.mjs +0 -47
@@ -17,7 +17,6 @@
17
17
  * limitations under the License.
18
18
  */
19
19
  const { State } = require('mem-fs-editor');
20
- const _ = require('lodash');
21
20
  const {
22
21
  createConflicterCheckTransform,
23
22
  createConflicterStatusTransform,
@@ -30,24 +29,37 @@ const {
30
29
  const { hasState, setModifiedFileState } = State;
31
30
 
32
31
  const BaseGenerator = require('../generator-base');
33
- const { LOADING_PRIORITY } = require('../../lib/constants/priorities.cjs').compat;
32
+ const { LOADING_PRIORITY, PRE_CONFLICTS_PRIORITY } = require('../../lib/constants/priorities.cjs').compat;
34
33
 
35
34
  const { MultiStepTransform } = require('../../utils/multi-step-transform');
36
- const { defaultConfig } = require('../generator-defaults');
35
+ const { GENERATOR_UPGRADE } = require('../generator-list');
37
36
  const { prettierTransform, generatedAnnotationTransform } = require('../generator-transforms');
38
37
  const { formatDateForChangelog, prepareFieldForLiquibaseTemplates } = require('../../utils/liquibase');
39
- const { prepareEntityForTemplates, prepareEntityPrimaryKeyForTemplates, loadRequiredConfigIntoEntity } = require('../../utils/entity');
38
+ const {
39
+ prepareEntityForTemplates,
40
+ prepareEntityServerDomainForTemplates,
41
+ prepareEntityPrimaryKeyForTemplates,
42
+ } = require('../../utils/entity');
40
43
  const { prepareFieldForTemplates } = require('../../utils/field');
44
+ const { createUserEntity } = require('../../utils/user');
41
45
  const { OAUTH2 } = require('../../jdl/jhipster/authentication-types');
42
- const { SQL } = require('../../jdl/jhipster/database-types');
43
46
  const { CommonDBTypes } = require('../../jdl/jhipster/field-types');
44
47
 
45
- const { STRING: TYPE_STRING, LONG: TYPE_LONG } = CommonDBTypes;
48
+ const { LONG: TYPE_LONG } = CommonDBTypes;
46
49
 
47
50
  module.exports = class extends BaseGenerator {
48
51
  constructor(args, options, features) {
49
52
  super(args, options, { unique: 'namespace', customCommitTask: true, ...features });
50
53
 
54
+ if (this.options.help) return;
55
+
56
+ if (!this.options.upgradeCommand) {
57
+ const { commandName } = this.options;
58
+ this.options.upgradeCommand = commandName === GENERATOR_UPGRADE;
59
+ }
60
+ }
61
+
62
+ _postConstruct() {
51
63
  /*
52
64
  * When testing a generator with yeoman-test using 'withLocalConfig(localConfig)', it instantiates the
53
65
  * generator and then executes generator.config.defaults(localConfig).
@@ -67,12 +79,10 @@ module.exports = class extends BaseGenerator {
67
79
  this.config.set(this.options.localConfig);
68
80
  }
69
81
 
70
- if (this.options.withGeneratedFlag !== undefined) {
71
- this.jhipsterConfig.withGeneratedFlag = this.options.withGeneratedFlag;
72
- }
73
-
74
82
  if (this.options.help) return;
75
83
 
84
+ this.loadStoredAppOptions();
85
+
76
86
  // Load common runtime options.
77
87
  this.parseCommonRuntimeOptions();
78
88
  }
@@ -82,7 +92,6 @@ module.exports = class extends BaseGenerator {
82
92
  createUserManagementEntities() {
83
93
  this._createUserManagementEntities();
84
94
  },
85
-
86
95
  loadClientPackageManager() {
87
96
  if (this.jhipsterConfig.clientPackageManager) {
88
97
  this.env.options.nodePackageManager = this.jhipsterConfig.clientPackageManager;
@@ -118,7 +127,7 @@ module.exports = class extends BaseGenerator {
118
127
  };
119
128
  }
120
129
 
121
- get preConflicts() {
130
+ get [PRE_CONFLICTS_PRIORITY]() {
122
131
  return this._preConflicts();
123
132
  }
124
133
 
@@ -154,13 +163,16 @@ module.exports = class extends BaseGenerator {
154
163
  const { withGeneratedFlag } = this.jhipsterConfig;
155
164
 
156
165
  // JDL writes directly to disk, set the file as modified so prettier will be applied
157
- stream = stream.pipe(
158
- patternSpy(file => {
159
- if (file.contents && !hasState(file) && !this.options.reproducibleTests) {
160
- setModifiedFileState(file);
161
- }
162
- }, '**/{.yo-rc.json,.jhipster/*.json}').name('jhipster:config-files:modify')
163
- );
166
+ const { upgradeCommand, ignoreErrors } = this.options;
167
+ if (!upgradeCommand) {
168
+ stream = stream.pipe(
169
+ patternSpy(file => {
170
+ if (file.contents && !hasState(file) && !this.options.reproducibleTests) {
171
+ setModifiedFileState(file);
172
+ }
173
+ }, '**/{.yo-rc.json,.jhipster/*.json}').name('jhipster:config-files:modify')
174
+ );
175
+ }
164
176
 
165
177
  const conflicterStatus = {
166
178
  fileActions: [
@@ -178,8 +190,7 @@ module.exports = class extends BaseGenerator {
178
190
  const createApplyPrettierTransform = () => {
179
191
  const prettierOptions = { packageJson: true, java: !this.skipServer && !this.jhipsterConfig.skipServer };
180
192
  // Prettier is clever, it uses correct rules and correct parser according to file extension.
181
- const ignoreErrors = this.options.commandName === 'upgrade' || this.options.ignoreErrors;
182
- return prettierTransform(prettierOptions, this, ignoreErrors);
193
+ return prettierTransform(prettierOptions, this, upgradeCommand || ignoreErrors);
183
194
  };
184
195
 
185
196
  const createForceWriteConfigFiles = () =>
@@ -215,73 +226,10 @@ module.exports = class extends BaseGenerator {
215
226
  const changelogDateDate = this.jhipsterConfig.creationTimestamp ? new Date(this.jhipsterConfig.creationTimestamp) : new Date();
216
227
  const changelogDate = formatDateForChangelog(changelogDateDate);
217
228
 
218
- const userEntityDefinition = this.readEntityJson('User');
219
- if (userEntityDefinition) {
220
- if (userEntityDefinition.relationships && userEntityDefinition.relationships.length > 0) {
221
- this.warning('Relationships on the User entity side will be disregarded');
222
- }
223
- if (userEntityDefinition.fields && userEntityDefinition.fields.some(field => field.fieldName !== 'id')) {
224
- this.warning('Fields on the User entity side (other than id) will be disregarded');
225
- }
226
- }
227
-
228
- // Create entity definition for built-in entity to make easier to deal with relationships.
229
- const user = {
230
- name: 'User',
231
- builtIn: true,
232
- entityTableName: `${this.getTableName(this.jhipsterConfig.jhiPrefix)}_user`,
233
- relationships: [],
234
- changelogDate,
235
- fields: userEntityDefinition ? userEntityDefinition.fields || [] : [],
236
- dto: true,
237
- };
238
-
239
- loadRequiredConfigIntoEntity(user, this.jhipsterConfig);
240
- // Fallback to defaults for test cases.
241
- loadRequiredConfigIntoEntity(user, defaultConfig);
242
-
243
- const oauth2 = user.authenticationType === OAUTH2;
244
- const userIdType = oauth2 || user.databaseType !== SQL ? TYPE_STRING : this.getPkType(user.databaseType);
245
- const fieldValidateRulesMaxlength = userIdType === TYPE_STRING ? 100 : undefined;
246
-
247
- let idField = user.fields.find(field => field.fieldName === 'id');
248
- if (!idField) {
249
- idField = {};
250
- user.fields.unshift(idField);
251
- }
252
- _.defaults(idField, {
253
- fieldName: 'id',
254
- fieldType: userIdType,
255
- fieldValidateRulesMaxlength,
256
- fieldTranslationKey: 'global.field.id',
257
- fieldNameHumanized: 'ID',
258
- id: true,
259
- builtIn: true,
260
- });
261
-
262
- if (!user.fields.some(field => field.fieldName === 'login')) {
263
- user.fields.push({
264
- fieldName: 'login',
265
- fieldType: TYPE_STRING,
266
- builtIn: true,
267
- });
268
- }
269
-
270
- if (!user.fields.some(field => field.fieldName === 'firstName')) {
271
- user.fields.push({
272
- fieldName: 'firstName',
273
- fieldType: TYPE_STRING,
274
- });
275
- }
276
-
277
- if (!user.fields.some(field => field.fieldName === 'lastName')) {
278
- user.fields.push({
279
- fieldName: 'lastName',
280
- fieldType: TYPE_STRING,
281
- });
282
- }
229
+ const user = createUserEntity.call(this, { changelogDate });
283
230
 
284
231
  prepareEntityForTemplates(user, this);
232
+ prepareEntityServerDomainForTemplates(user);
285
233
  prepareEntityPrimaryKeyForTemplates(user, this);
286
234
 
287
235
  user.fields.forEach(field => {
@@ -290,6 +238,8 @@ module.exports = class extends BaseGenerator {
290
238
  });
291
239
  this.configOptions.sharedEntities.User = user;
292
240
 
241
+ const oauth2 = user.authenticationType === OAUTH2;
242
+ const userIdType = user.primaryKey.type;
293
243
  const liquibaseFakeData = oauth2
294
244
  ? []
295
245
  : [
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Copyright 2013-2022 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
+ export { default } from './index.mjs';
@@ -0,0 +1,353 @@
1
+ /**
2
+ * Copyright 2013-2022 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
+ import assert from 'assert';
20
+ import lodash from 'lodash';
21
+
22
+ import BaseEntityGenerator from '../generator-base-entities.cjs';
23
+ import {
24
+ PRIORITY_PREFIX,
25
+ LOADING_PRIORITY,
26
+ PREPARING_PRIORITY,
27
+ CONFIGURING_EACH_ENTITY_PRIORITY,
28
+ LOADING_EACH_ENTITY_PRIORITY,
29
+ PREPARING_EACH_ENTITY_PRIORITY,
30
+ PREPARING_EACH_ENTITY_FIELD_PRIORITY,
31
+ PREPARING_EACH_ENTITY_RELATIONSHIP_PRIORITY,
32
+ POST_PREPARING_EACH_ENTITY_PRIORITY,
33
+ } from '../../lib/constants/priorities.mjs';
34
+
35
+ import validations from '../../jdl/jhipster/validations.js';
36
+ import fieldTypes from '../../jdl/jhipster/field-types.js';
37
+ import authenticationType from '../../jdl/jhipster/authentication-types.js';
38
+ import constants from '../generator-constants.js';
39
+ import utils from '../../utils/index.js';
40
+ import entityUtils from '../../utils/entity.js';
41
+ import fieldUtils from '../../utils/field.js';
42
+ import relationshipUtils from '../../utils/relationship.js';
43
+ import { createUserEntity } from '../../utils/user.js';
44
+
45
+ const { sortedUniq, intersection, upperFirst } = lodash;
46
+ const { prepareFieldForTemplates, fieldIsEnum } = fieldUtils;
47
+ const { prepareRelationshipForTemplates } = relationshipUtils;
48
+ const { OAUTH2 } = authenticationType;
49
+
50
+ const { CommonDBTypes, RelationalOnlyDBTypes, BlobTypes } = fieldTypes;
51
+
52
+ const { BIG_DECIMAL, BOOLEAN, DURATION, INSTANT, LOCAL_DATE, UUID, ZONED_DATE_TIME } = CommonDBTypes;
53
+ const { BYTES, BYTE_BUFFER } = RelationalOnlyDBTypes;
54
+ const { IMAGE, TEXT } = BlobTypes;
55
+
56
+ const { prepareEntityForTemplates, prepareEntityPrimaryKeyForTemplates, derivedPrimaryKeyProperties, loadRequiredConfigIntoEntity } =
57
+ entityUtils;
58
+
59
+ const { MAX, MIN, MAXLENGTH, MINLENGTH, MAXBYTES, MINBYTES, PATTERN } = validations;
60
+ const { SUPPORTED_VALIDATION_RULES } = constants;
61
+ const { stringify } = utils;
62
+
63
+ export default class extends BaseEntityGenerator {
64
+ constructor(args, options, features) {
65
+ super(args, options, { unique: 'namespace', taskPrefix: PRIORITY_PREFIX, ...features });
66
+
67
+ if (this.options.help) return;
68
+
69
+ this.loadStoredAppOptions();
70
+ this.loadRuntimeOptions();
71
+ }
72
+
73
+ get loading() {
74
+ return {
75
+ loadApplication({ application }) {
76
+ this.loadAppConfig(undefined, application);
77
+ this.loadClientConfig(undefined, application);
78
+ this.loadServerConfig(undefined, application);
79
+ this.loadTranslationConfig(undefined, application);
80
+ this.loadPlatformConfig(undefined, application);
81
+ },
82
+ loadUser() {
83
+ if (this.jhipsterConfig.skipUserManagement && this.jhipsterConfig.authenticationType !== OAUTH2) {
84
+ return;
85
+ }
86
+ if (this.sharedData.hasEntity('User')) {
87
+ throw new Error("Fail to bootstrap 'User', already exists.");
88
+ }
89
+
90
+ this.sharedData.setEntity('User', createUserEntity.call(this));
91
+ },
92
+ };
93
+ }
94
+
95
+ get [LOADING_PRIORITY]() {
96
+ return this.loading;
97
+ }
98
+
99
+ get preparing() {
100
+ return {
101
+ prepareApplication({ application }) {
102
+ this.loadDerivedAppConfig(application);
103
+ this.loadDerivedClientConfig(application);
104
+ this.loadDerivedServerConfig(application);
105
+ this.loadDerivedPlatformConfig(application);
106
+ },
107
+ };
108
+ }
109
+
110
+ get [PREPARING_PRIORITY]() {
111
+ return this.preparing;
112
+ }
113
+
114
+ get configuringEachEntity() {
115
+ return {
116
+ configureEntity({ entityStorage, entityConfig }) {
117
+ entityStorage.defaults({ fields: [], relationships: [] });
118
+
119
+ if (entityConfig.changelogDate === undefined) {
120
+ entityConfig.changelogDate = this.dateFormatForLiquibase();
121
+ }
122
+ },
123
+ configureFields({ entityName, entityConfig }) {
124
+ entityConfig.fields.forEach(field => {
125
+ const { fieldName, fieldType, fieldValidateRules } = field;
126
+
127
+ assert(fieldName, `fieldName is missing in .jhipster/${entityName}.json for field ${stringify(field)}`);
128
+ assert(fieldType, `fieldType is missing in .jhipster/${entityName}.json for field ${stringify(field)}`);
129
+
130
+ if (fieldValidateRules !== undefined) {
131
+ assert(
132
+ Array.isArray(fieldValidateRules),
133
+ `fieldValidateRules is not an array in .jhipster/${entityName}.json for field ${stringify(field)}`
134
+ );
135
+ fieldValidateRules.forEach(fieldValidateRule => {
136
+ assert(
137
+ SUPPORTED_VALIDATION_RULES.includes(fieldValidateRule),
138
+ `fieldValidateRules contains unknown validation rule ${fieldValidateRule} in .jhipster/${entityName}.json for field ${stringify(
139
+ field
140
+ )} [supported validation rules ${SUPPORTED_VALIDATION_RULES}]`
141
+ );
142
+ });
143
+ assert(
144
+ !fieldValidateRules.includes(MAX) || field.fieldValidateRulesMax !== undefined,
145
+ `fieldValidateRulesMax is missing in .jhipster/${entityName}.json for field ${stringify(field)}`
146
+ );
147
+ assert(
148
+ !fieldValidateRules.includes(MIN) || field.fieldValidateRulesMin !== undefined,
149
+ `fieldValidateRulesMin is missing in .jhipster/${entityName}.json for field ${stringify(field)}`
150
+ );
151
+ assert(
152
+ !fieldValidateRules.includes(MAXLENGTH) || field.fieldValidateRulesMaxlength !== undefined,
153
+ `fieldValidateRulesMaxlength is missing in .jhipster/${entityName}.json for field ${stringify(field)}`
154
+ );
155
+ assert(
156
+ !fieldValidateRules.includes(MINLENGTH) || field.fieldValidateRulesMinlength !== undefined,
157
+ `fieldValidateRulesMinlength is missing in .jhipster/${entityName}.json for field ${stringify(field)}`
158
+ );
159
+ assert(
160
+ !fieldValidateRules.includes(MAXBYTES) || field.fieldValidateRulesMaxbytes !== undefined,
161
+ `fieldValidateRulesMaxbytes is missing in .jhipster/${entityName}.json for field ${stringify(field)}`
162
+ );
163
+ assert(
164
+ !fieldValidateRules.includes(MINBYTES) || field.fieldValidateRulesMinbytes !== undefined,
165
+ `fieldValidateRulesMinbytes is missing in .jhipster/${entityName}.json for field ${stringify(field)}`
166
+ );
167
+ assert(
168
+ !fieldValidateRules.includes(PATTERN) || field.fieldValidateRulesPattern !== undefined,
169
+ `fieldValidateRulesPattern is missing in .jhipster/${entityName}.json for field ${stringify(field)}`
170
+ );
171
+ }
172
+ });
173
+ },
174
+ configureRelationships({ entityName, entityStorage, entityConfig }) {
175
+ // Validate entity json relationship content
176
+ entityConfig.relationships.forEach(relationship => {
177
+ const { otherEntityName, relationshipType } = relationship;
178
+
179
+ assert(otherEntityName, `otherEntityName is missing in .jhipster/${entityName}.json for relationship ${stringify(relationship)}`);
180
+ assert(
181
+ relationshipType,
182
+ `relationshipType is missing in .jhipster/${entityName}.json for relationship ${stringify(relationship)}`
183
+ );
184
+
185
+ if (relationship.relationshipName === undefined) {
186
+ relationship.relationshipName = otherEntityName;
187
+ this.warning(
188
+ `relationshipName is missing in .jhipster/${entityName}.json for relationship ${stringify(relationship)}, using ${
189
+ relationship.otherEntityName
190
+ } as fallback`
191
+ );
192
+ }
193
+ });
194
+ entityStorage.save();
195
+ },
196
+ };
197
+ }
198
+
199
+ get [CONFIGURING_EACH_ENTITY_PRIORITY]() {
200
+ return this.configuringEachEntity;
201
+ }
202
+
203
+ get loadingEachEntity() {
204
+ return {
205
+ loadingEntities({ application, entityName, entityStorage }) {
206
+ // if already loaded, let the entity generator to initialize entities.
207
+ if (this.sharedData.hasEntity(entityName)) {
208
+ throw new Error(`Fail to bootstrap '${entityName}', already exists.`);
209
+ }
210
+ const entity = entityStorage.getAll();
211
+ this.sharedData.setEntity(entityName, entity);
212
+ loadRequiredConfigIntoEntity(entity, application);
213
+ },
214
+ };
215
+ }
216
+
217
+ get [LOADING_EACH_ENTITY_PRIORITY]() {
218
+ return this.loadingEachEntity;
219
+ }
220
+
221
+ get preparingEachEntity() {
222
+ return {
223
+ preparingEachEntity({ entity }) {
224
+ prepareEntityForTemplates(entity, this);
225
+ },
226
+ };
227
+ }
228
+
229
+ get [PREPARING_EACH_ENTITY_PRIORITY]() {
230
+ return this.preparingEachEntity;
231
+ }
232
+
233
+ get preparingEachEntityField() {
234
+ return {
235
+ loadAnnotations({ entity, field }) {
236
+ if (field.options) {
237
+ Object.assign(field, field.options);
238
+ }
239
+ },
240
+
241
+ // If primaryKey doesn't exist, create it.
242
+ preparePrimaryKey({ entity }) {
243
+ if (!entity.embedded && !entity.primaryKey) {
244
+ prepareEntityPrimaryKeyForTemplates(entity, this);
245
+ }
246
+ },
247
+
248
+ prepareFieldsForTemplates({ entity, field }) {
249
+ prepareFieldForTemplates(entity, field, this);
250
+ },
251
+ };
252
+ }
253
+
254
+ get [PREPARING_EACH_ENTITY_FIELD_PRIORITY]() {
255
+ return this.preparingEachEntityField;
256
+ }
257
+
258
+ get preparingEachEntityRelationship() {
259
+ return {
260
+ prepareRelationship({ entity, relationship, entityName }) {
261
+ const { otherEntityName, options } = relationship;
262
+ if (options) {
263
+ Object.assign(relationship, options);
264
+ }
265
+ relationship.otherEntity = this.sharedData.getEntity(upperFirst(otherEntityName));
266
+ },
267
+
268
+ prepareRelationshipsForTemplates({ entity, relationship }) {
269
+ prepareRelationshipForTemplates(entity, relationship, this);
270
+ },
271
+ };
272
+ }
273
+
274
+ get [PREPARING_EACH_ENTITY_RELATIONSHIP_PRIORITY]() {
275
+ return this.preparingEachEntityRelationship;
276
+ }
277
+
278
+ get postPreparingEachEntity() {
279
+ return {
280
+ processEntityPrimaryKeysDerivedProperties({ entity }) {
281
+ if (!entity.primaryKey) return;
282
+ derivedPrimaryKeyProperties(entity.primaryKey);
283
+ },
284
+
285
+ prepareEntityFieldsDerivedProperties({ entity }) {
286
+ const { fields } = entity;
287
+ const fieldsType = sortedUniq(fields.map(({ fieldType }) => fieldType).filter(fieldType => !fieldIsEnum(fieldType)));
288
+
289
+ // TODO move to react generator
290
+ entity.fieldsIsReactAvField = intersection(fieldsType, [INSTANT, ZONED_DATE_TIME, BOOLEAN]).length > 0;
291
+
292
+ entity.i18nToLoad = fields.filter(({ fieldType }) => fieldIsEnum(fieldType)).map(({ enumInstance }) => enumInstance);
293
+
294
+ // TODO move to server generator
295
+ entity.haveFieldWithJavadoc = entity.fields.some(({ javadoc }) => javadoc);
296
+
297
+ entity.fieldsContainZonedDateTime = fieldsType.includes(ZONED_DATE_TIME);
298
+ entity.fieldsContainInstant = fieldsType.includes(INSTANT);
299
+ entity.fieldsContainDuration = fieldsType.includes(DURATION);
300
+ entity.fieldsContainLocalDate = fieldsType.includes(LOCAL_DATE);
301
+ entity.fieldsContainBigDecimal = fieldsType.includes(BIG_DECIMAL);
302
+ entity.fieldsContainUUID = fieldsType.includes(UUID);
303
+ entity.fieldsContainDate = intersection(fieldsType, [ZONED_DATE_TIME, INSTANT, LOCAL_DATE]).length > 0;
304
+
305
+ entity.fieldsContainBlob = intersection(fieldsType, [BYTES, BYTE_BUFFER]).length > 0;
306
+ if (entity.fieldsContainBlob) {
307
+ entity.blobFields = fields.filter(({ fieldType }) => [BYTES, BYTE_BUFFER].includes(fieldType));
308
+ const blobFieldsContentType = sortedUniq(entity.blobFields.map(({ fieldTypeBlobContent }) => fieldTypeBlobContent));
309
+ entity.fieldsContainImageBlob = blobFieldsContentType.includes(IMAGE);
310
+ entity.fieldsContainBlobOrImage = blobFieldsContentType.some(fieldTypeBlobContent => fieldTypeBlobContent !== TEXT);
311
+ entity.fieldsContainTextBlob = blobFieldsContentType.includes(TEXT);
312
+ }
313
+
314
+ entity.validation = entity.validation || fields.some(({ fieldValidate }) => fieldValidate);
315
+ },
316
+
317
+ prepareEntityRelationshipsDerivedProperties({ entity }) {
318
+ const { relationships } = entity;
319
+ const oneToOneRelationships = relationships.filter(({ relationshipType }) => relationshipType === 'one-to-one');
320
+ entity.fieldsContainNoOwnerOneToOne = oneToOneRelationships.some(({ ownerSide }) => !ownerSide);
321
+ entity.fieldsContainOwnerOneToOne = oneToOneRelationships.some(({ ownerSide }) => ownerSide);
322
+
323
+ entity.fieldsContainManyToOne = relationships.some(({ relationshipType }) => relationshipType === 'many-to-one');
324
+ entity.fieldsContainOneToMany = relationships.some(({ relationshipType }) => relationshipType === 'one-to-many');
325
+
326
+ entity.fieldsContainOwnerManyToMany = relationships.some(
327
+ ({ relationshipType, ownerSide }) => ownerSide && relationshipType === 'many-to-many'
328
+ );
329
+
330
+ entity.fieldsContainEmbedded = relationships.some(({ otherEntityIsEmbedded }) => otherEntityIsEmbedded);
331
+ entity.validation = entity.validation || relationships.some(({ relationshipValidate }) => relationshipValidate);
332
+
333
+ const relationshipsByType = relationships
334
+ .map(relationship => [relationship.otherEntity.entityNameCapitalized, relationship])
335
+ .reduce((relationshipsByType, [type, relationship]) => {
336
+ if (!relationshipsByType[type]) {
337
+ relationshipsByType[type] = [relationship];
338
+ } else {
339
+ relationshipsByType[type].push(relationship);
340
+ }
341
+ return relationshipsByType;
342
+ }, {});
343
+
344
+ entity.differentTypes = Object.keys(relationshipsByType);
345
+ entity.differentRelationships = relationshipsByType;
346
+ },
347
+ };
348
+ }
349
+
350
+ get [POST_PREPARING_EACH_ENTITY_PRIORITY]() {
351
+ return this.postPreparingEachEntity;
352
+ }
353
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Copyright 2013-2022 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
+ export { default } from './generator.mjs';
@@ -16,6 +16,4 @@
16
16
  * See the License for the specific language governing permissions and
17
17
  * limitations under the License.
18
18
  */
19
- import generator from './index.js';
20
-
21
- export default generator;
19
+ export { default } from './index.js';
@@ -123,7 +123,7 @@ async function askIntegrations() {
123
123
  }
124
124
 
125
125
  const integrationChoices = [];
126
- if (['jenkins', 'gitlab', 'github'].includes(this.pipeline)) {
126
+ if (['jenkins', 'gitlab'].includes(this.pipeline)) {
127
127
  integrationChoices.push({ name: `Deploy your application to an ${chalk.yellow('*Artifactory*')}`, value: 'deploy' });
128
128
  }
129
129
  if (['jenkins', 'gitlab', 'travis', 'github'].includes(this.pipeline)) {
@@ -143,9 +143,9 @@ if (cicdIntegrationsHeroku) { _%>
143
143
  GIT_TAG=:${GITHUB_REF#refs/tags/}
144
144
  DOCKER_TAG=${GIT_TAG#:refs/heads/main}
145
145
  <%_ if (buildToolMaven) { _%>
146
- ./mvnw -ntp jib:build -Djib.to.image=<%= dockerImage %>${DOCKER_TAG} -Djib.to.auth.username="${{ secrets.DOCKER_USERNAME }}" -Djib.to.auth.password="${{ secrets.DOCKER_PASSWORD }}"
146
+ ./mvnw -ntp jib:build -Djib.to.image=<%= dockerImage %>${DOCKER_TAG} -Djib.to.auth.username="${{ secrets.DOCKER_USERNAME }}" -Djib.to.auth.password="${{ secrets.DOCKER_PASSWORD }}" -Pprod
147
147
  <%_ } else if (buildToolGradle) { _%>
148
- ./gradlew jib -Djib.to.image=<%= dockerImage %>${DOCKER_TAG} -Djib.to.auth.username="${{ secrets.DOCKER_USERNAME }}" -Djib.to.auth.password="${{ secrets.DOCKER_PASSWORD }}"
148
+ ./gradlew jib -Djib.to.image=<%= dockerImage %>${DOCKER_TAG} -Djib.to.auth.username="${{ secrets.DOCKER_USERNAME }}" -Djib.to.auth.password="${{ secrets.DOCKER_PASSWORD }}" -Pprod
149
149
  <%_ } _%>
150
150
  <%_ } _%>
151
151
  <%_ if (cypressTests || protractorTests) {
@@ -16,6 +16,8 @@
16
16
  * See the License for the specific language governing permissions and
17
17
  * limitations under the License.
18
18
  */
19
- import generator from './index.js';
20
-
21
- export default generator;
19
+ export { default } from './index.js';
20
+ export { files as angularFiles } from './files-angular.js';
21
+ export { files as commonFiles } from './files-common.js';
22
+ export { files as reactFiles } from './files-react.js';
23
+ export { files as vueFiles } from './files-vue.js';
@@ -516,7 +516,16 @@ const files = {
516
516
  ],
517
517
  };
518
518
 
519
+ function cleanup() {
520
+ if (!this.clientFrameworkAngular) return;
521
+
522
+ if (this.isJhipsterVersionLessThan('7.6.1')) {
523
+ this.removeFile(`${CLIENT_MAIN_SRC_DIR}content/scss/rtl.scss`);
524
+ }
525
+ }
526
+
519
527
  module.exports = {
528
+ cleanup,
520
529
  writeFiles,
521
530
  files,
522
531
  };