generator-jhipster 8.5.0 → 8.6.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 (211) hide show
  1. package/README.md +3 -4
  2. package/dist/cli/commands.mjs +2 -0
  3. package/dist/cli/environment-builder.mjs +5 -0
  4. package/dist/cli/program.mjs +10 -4
  5. package/dist/generators/angular/entity-files-angular.js +6 -7
  6. package/dist/generators/angular/resources/package.json +17 -17
  7. package/dist/generators/angular/templates/src/main/webapp/app/account/activate/activate.component.spec.ts.ejs +4 -3
  8. package/dist/generators/angular/templates/src/main/webapp/app/account/activate/activate.service.spec.ts.ejs +3 -2
  9. package/dist/generators/angular/templates/src/main/webapp/app/account/password/password.component.spec.ts.ejs +4 -5
  10. package/dist/generators/angular/templates/src/main/webapp/app/account/password/password.service.spec.ts.ejs +3 -2
  11. package/dist/generators/angular/templates/src/main/webapp/app/account/password-reset/finish/password-reset-finish.component.spec.ts.ejs +4 -3
  12. package/dist/generators/angular/templates/src/main/webapp/app/account/password-reset/finish/password-reset-finish.service.spec.ts.ejs +3 -2
  13. package/dist/generators/angular/templates/src/main/webapp/app/account/password-reset/init/password-reset-init.component.spec.ts.ejs +3 -3
  14. package/dist/generators/angular/templates/src/main/webapp/app/account/password-reset/init/password-reset-init.service.spec.ts.ejs +3 -2
  15. package/dist/generators/angular/templates/src/main/webapp/app/account/register/register.component.spec.ts.ejs +2 -3
  16. package/dist/generators/angular/templates/src/main/webapp/app/account/register/register.service.spec.ts.ejs +3 -2
  17. package/dist/generators/angular/templates/src/main/webapp/app/account/sessions/sessions.component.spec.ts.ejs +3 -3
  18. package/dist/generators/angular/templates/src/main/webapp/app/account/settings/settings.component.spec.ts.ejs +3 -4
  19. package/dist/generators/angular/templates/src/main/webapp/app/admin/configuration/configuration.component.spec.ts.ejs +3 -3
  20. package/dist/generators/angular/templates/src/main/webapp/app/admin/configuration/configuration.service.spec.ts.ejs +3 -2
  21. package/dist/generators/angular/templates/src/main/webapp/app/admin/health/health.component.spec.ts.ejs +4 -4
  22. package/dist/generators/angular/templates/src/main/webapp/app/admin/health/health.service.spec.ts.ejs +3 -2
  23. package/dist/generators/angular/templates/src/main/webapp/app/admin/health/modal/health-modal.component.spec.ts.ejs +3 -3
  24. package/dist/generators/angular/templates/src/main/webapp/app/admin/logs/logs.component.spec.ts.ejs +4 -3
  25. package/dist/generators/angular/templates/src/main/webapp/app/admin/logs/logs.service.spec.ts.ejs +3 -2
  26. package/dist/generators/angular/templates/src/main/webapp/app/admin/metrics/blocks/jvm-threads/jvm-threads.component.ts.ejs +1 -1
  27. package/dist/generators/angular/templates/src/main/webapp/app/admin/metrics/blocks/metrics-modal-threads/metrics-modal-threads.component.spec.ts.ejs +3 -3
  28. package/dist/generators/angular/templates/src/main/webapp/app/admin/metrics/metrics.component.spec.ts.ejs +3 -2
  29. package/dist/generators/angular/templates/src/main/webapp/app/admin/metrics/metrics.service.spec.ts.ejs +3 -2
  30. package/dist/generators/angular/templates/src/main/webapp/app/admin/user-management/delete/user-management-delete-dialog.component.spec.ts.ejs +3 -3
  31. package/dist/generators/angular/templates/src/main/webapp/app/admin/user-management/list/user-management.component.html.ejs +1 -1
  32. package/dist/generators/angular/templates/src/main/webapp/app/admin/user-management/list/user-management.component.spec.ts.ejs +3 -4
  33. package/dist/generators/angular/templates/src/main/webapp/app/admin/user-management/service/user-management.service.spec.ts.ejs +3 -3
  34. package/dist/generators/angular/templates/src/main/webapp/app/admin/user-management/update/user-management-update.component.spec.ts.ejs +3 -2
  35. package/dist/generators/angular/templates/src/main/webapp/app/app-page-title-strategy.ts.ejs +1 -1
  36. package/dist/generators/angular/templates/src/main/webapp/app/app.component.ts.ejs +0 -1
  37. package/dist/generators/angular/templates/src/main/webapp/app/app.config.ts.ejs +2 -2
  38. package/dist/generators/angular/templates/src/main/webapp/app/config/uib-pagination.config.ts.ejs +1 -1
  39. package/dist/generators/angular/templates/src/main/webapp/app/core/auth/account.service.spec.ts.ejs +7 -5
  40. package/dist/generators/angular/templates/src/main/webapp/app/core/auth/auth-jwt.service.spec.ts.ejs +3 -2
  41. package/dist/generators/angular/templates/src/main/webapp/app/core/interceptor/auth-expired.interceptor.ts.ejs +3 -3
  42. package/dist/generators/angular/templates/src/main/webapp/app/core/interceptor/auth.interceptor.ts.ejs +2 -2
  43. package/dist/generators/angular/templates/src/main/webapp/app/core/interceptor/error-handler.interceptor.ts.ejs +1 -1
  44. package/dist/generators/angular/templates/src/main/webapp/app/core/util/alert.service.spec.ts.ejs +6 -6
  45. package/dist/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/delete/_entityFile_-delete-dialog.component.spec.ts.ejs +3 -4
  46. package/dist/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/list/_entityFile_.component.html.ejs +1 -1
  47. package/dist/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/list/_entityFile_.component.spec.ts.ejs +2 -3
  48. package/dist/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/list/_entityFile_.component.ts.ejs +2 -2
  49. package/dist/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/route/_entityFile_-routing-resolve.service.spec.ts.ejs +2 -3
  50. package/dist/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/service/_entityFile_.service.spec.ts.ejs +5 -3
  51. package/dist/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/update/_entityFile_-update.component.spec.ts.ejs +2 -3
  52. package/dist/generators/angular/templates/src/main/webapp/app/layouts/error/error.component.ts.ejs +2 -2
  53. package/dist/generators/angular/templates/src/main/webapp/app/layouts/navbar/active-menu.directive.ts.ejs +3 -3
  54. package/dist/generators/angular/templates/src/main/webapp/app/layouts/navbar/navbar.component.spec.ts.ejs +3 -3
  55. package/dist/generators/angular/templates/src/main/webapp/app/layouts/profiles/page-ribbon.component.spec.ts.ejs +3 -2
  56. package/dist/generators/angular/templates/src/main/webapp/app/shared/auth/has-any-authority.directive.spec.ts.ejs +3 -3
  57. package/dist/generators/angular/templates/src/main/webapp/app/shared/language/find-language-from-key.pipe.ts.ejs +1 -1
  58. package/dist/generators/angular/templates/src/main/webapp/app/shared/language/translation.module.ts.ejs +2 -2
  59. package/dist/generators/angular/templates/src/main/webapp/app/shared/sort/sort-by.directive.spec.ts.ejs +10 -10
  60. package/dist/generators/angular/templates/src/main/webapp/app/shared/sort/sort-by.directive.ts.ejs +6 -7
  61. package/dist/generators/angular/templates/src/main/webapp/app/shared/sort/sort.directive.spec.ts.ejs +4 -4
  62. package/dist/generators/angular/templates/src/main/webapp/content/scss/global.scss.ejs +2 -0
  63. package/dist/generators/base/command.js +1 -0
  64. package/dist/generators/base/generator.js +7 -12
  65. package/dist/generators/base/internal/command.js +13 -0
  66. package/dist/generators/base/internal/index.js +1 -0
  67. package/dist/generators/base/shared-data.js +74 -2
  68. package/dist/generators/base/support/config.js +1 -1
  69. package/dist/generators/base/support/jhipster7-context.js +155 -52
  70. package/dist/generators/base-application/generator.js +1 -1
  71. package/dist/generators/base-core/generator.js +93 -55
  72. package/dist/generators/bootstrap/generator.js +1 -1
  73. package/dist/generators/bootstrap/support/eslint-worker.js +14 -12
  74. package/dist/generators/bootstrap/support/multi-step-transform/template-file.js +6 -1
  75. package/dist/generators/bootstrap-application/generator.js +1 -1
  76. package/dist/generators/bootstrap-application-client/generator.js +5 -1
  77. package/dist/generators/ci-cd/generator.js +1 -1
  78. package/dist/generators/ci-cd/templates/docker-registry.yml.ejs +0 -1
  79. package/dist/generators/ci-cd/templates/jenkins/jenkins.yml.ejs +0 -1
  80. package/dist/generators/client/generator.js +2 -3
  81. package/dist/generators/client/resources/package.json +3 -3
  82. package/dist/generators/client/support/filter-entities.js +1 -1
  83. package/dist/generators/client/templates/.eslintignore.ejs +9 -5
  84. package/dist/generators/client/templates/README.md.jhi.client.ejs +29 -20
  85. package/dist/generators/client/templates/src/main/webapp/index.html.ejs +1 -1
  86. package/dist/generators/common/resources/package.json +1 -1
  87. package/dist/generators/docker/templates/docker/keycloak.yml.ejs +2 -1
  88. package/dist/generators/docker/templates/docker/mariadb.yml.ejs +1 -1
  89. package/dist/generators/docker/templates/docker/mysql.yml.ejs +1 -2
  90. package/dist/generators/docker/templates/docker/realm-config/keycloak-health-check.sh +2 -2
  91. package/dist/generators/docker-compose/templates/docker-compose.yml.ejs +1 -0
  92. package/dist/generators/docker-compose/templates/realm-config/keycloak-health-check.sh +2 -2
  93. package/dist/generators/feign-client/templates/src/main/java/_package_/client/AuthorizationHeaderUtil.java.ejs +1 -1
  94. package/dist/generators/gatling/generator.js +0 -1
  95. package/dist/generators/generate-blueprint/files.js +3 -1
  96. package/dist/generators/generate-blueprint/generator.js +17 -7
  97. package/dist/generators/generate-blueprint/resources/package.json +2 -0
  98. package/dist/generators/generate-blueprint/templates/.blueprint/github-build-matrix/generator.mjs.ejs +2 -6
  99. package/dist/generators/generate-blueprint/templates/.github/workflows/build-cache.yml.ejs +39 -0
  100. package/dist/generators/generate-blueprint/templates/.github/workflows/samples.yml.ejs +105 -0
  101. package/dist/generators/generate-blueprint/templates/.prettierignore.jhi.blueprint.ejs +1 -1
  102. package/dist/generators/generate-blueprint/templates/eslint.config.js.ejs +33 -0
  103. package/dist/generators/generator-constants.js +2 -2
  104. package/dist/generators/gradle/templates/gradle/wrapper/gradle-wrapper.properties +1 -1
  105. package/dist/generators/heroku/generator.js +1 -1
  106. package/dist/generators/info/support/extract-info.js +60 -0
  107. package/dist/generators/info/support/index.js +1 -0
  108. package/dist/generators/init/resources/.node-version +1 -1
  109. package/dist/generators/init/resources/package.json +2 -2
  110. package/dist/generators/java/generators/bootstrap/generator.js +9 -2
  111. package/dist/generators/java/generators/build-tool/command.js +2 -2
  112. package/dist/generators/java/generators/node/templates/npmw +1 -5
  113. package/dist/generators/java/support/add-java-annotation.js +1 -1
  114. package/dist/generators/jdl/generator.js +6 -6
  115. package/dist/generators/kubernetes/templates/db/mysql.yml.ejs +1 -0
  116. package/dist/generators/languages/generator.js +1 -0
  117. package/dist/generators/liquibase/templates/src/main/java/_package_/config/LiquibaseConfiguration.java.ejs +1 -1
  118. package/dist/generators/maven/command.js +15 -0
  119. package/dist/generators/maven/generator.js +6 -1
  120. package/dist/generators/maven/index.js +1 -0
  121. package/dist/generators/maven/internal/xml-store.js +7 -6
  122. package/dist/generators/maven/support/pom-store.js +24 -9
  123. package/dist/generators/maven/templates/.mvn/wrapper/maven-wrapper.properties +1 -1
  124. package/dist/generators/react/entity-files-react.js +7 -7
  125. package/dist/generators/react/resources/package.json +12 -12
  126. package/dist/generators/react/templates/src/main/webapp/app/app.tsx.ejs +9 -0
  127. package/dist/generators/react/templates/src/main/webapp/app/config/translation.ts.ejs +4 -0
  128. package/dist/generators/react/templates/src/main/webapp/app/modules/home/home.tsx.ejs +15 -1
  129. package/dist/generators/react/templates/src/main/webapp/app/modules/login/login-redirect.tsx.ejs +4 -0
  130. package/dist/generators/react/templates/src/main/webapp/app/modules/login/logout.tsx.ejs +5 -3
  131. package/dist/generators/react/templates/src/main/webapp/app/routes.tsx.ejs +1 -1
  132. package/dist/generators/react/templates/src/main/webapp/app/shared/auth/private-route.spec.tsx.ejs +1 -1
  133. package/dist/generators/react/templates/src/main/webapp/app/shared/auth/private-route.tsx.ejs +1 -1
  134. package/dist/generators/react/templates/src/main/webapp/app/shared/layout/header/header.tsx.ejs +0 -9
  135. package/dist/generators/react/templates/src/main/webapp/app/shared/layout/menus/account.spec.tsx.ejs +1 -3
  136. package/dist/generators/react/templates/src/main/webapp/app/shared/layout/menus/account.tsx.ejs +29 -6
  137. package/dist/generators/react/templates/src/main/webapp/app/shared/util/url-utils.ts.ejs +1 -1
  138. package/dist/generators/server/generator.js +7 -5
  139. package/dist/generators/server/resources/Dockerfile +5 -5
  140. package/dist/generators/server/resources/gradle/libs.versions.toml +5 -5
  141. package/dist/generators/server/resources/pom.xml +11 -11
  142. package/dist/generators/server/templates/gradle/profile_dev.gradle.ejs +1 -1
  143. package/dist/generators/server/templates/gradle/profile_prod.gradle.ejs +1 -1
  144. package/dist/generators/server/templates/pom.xml.ejs +0 -26
  145. package/dist/generators/server/templates/src/main/java/_package_/config/AsyncConfiguration.java.ejs +1 -1
  146. package/dist/generators/server/templates/src/main/java/_package_/config/SecurityJwtConfiguration.java.ejs +1 -1
  147. package/dist/generators/server/templates/src/main/java/_package_/config/WebConfigurer.java.ejs +1 -1
  148. package/dist/generators/server/templates/src/main/java/_package_/security/DomainUserDetailsService.java.ejs +1 -1
  149. package/dist/generators/server/templates/src/main/java/_package_/security/PersistentTokenRememberMeServices.java.ejs +1 -1
  150. package/dist/generators/server/templates/src/main/java/_package_/security/oauth2/AudienceValidator.java.ejs +1 -1
  151. package/dist/generators/server/templates/src/main/java/_package_/service/MailService.java.ejs +1 -1
  152. package/dist/generators/server/templates/src/main/java/_package_/service/dto/UserDTO.java.ejs +11 -0
  153. package/dist/generators/server/templates/src/main/java/_package_/web/rest/AccountResource.java.ejs +1 -1
  154. package/dist/generators/server/templates/src/main/java/_package_/web/rest/AccountResource_oauth2.java.ejs +1 -1
  155. package/dist/generators/server/templates/src/main/java/_package_/web/rest/AccountResource_skipUserManagement.java.ejs +1 -1
  156. package/dist/generators/server/templates/src/main/java/_package_/web/rest/AuthenticateController.java.ejs +1 -1
  157. package/dist/generators/server/templates/src/main/resources/config/application-dev.yml.ejs +1 -1
  158. package/dist/generators/server/templates/src/main/resources/config/application.yml.ejs +1 -1
  159. package/dist/generators/server/templates/src/main/resources/config/bootstrap.yml.ejs +1 -1
  160. package/dist/generators/spring-boot/generator.js +4 -2
  161. package/dist/generators/spring-boot/resources/spring-boot-dependencies.pom +105 -105
  162. package/dist/generators/spring-boot/templates/src/main/java/_package_/_entityPackage_/service/UserService.java.ejs +1 -1
  163. package/dist/generators/spring-boot/templates/src/main/java/_package_/_entityPackage_/service/_entityClass_QueryService.java.ejs +1 -1
  164. package/dist/generators/spring-boot/templates/src/main/java/_package_/_entityPackage_/service/impl/_entityClass_ServiceImpl.java.ejs +1 -1
  165. package/dist/generators/spring-boot/templates/src/main/java/_package_/_entityPackage_/web/rest/PublicUserResource.java.ejs +1 -1
  166. package/dist/generators/spring-boot/templates/src/main/java/_package_/_entityPackage_/web/rest/UserResource.java.ejs +1 -1
  167. package/dist/generators/spring-boot/templates/src/main/java/_package_/_entityPackage_/web/rest/_entityClass_Resource.java.ejs +1 -1
  168. package/dist/generators/spring-cache/resources/gradle/libs.versions.toml +1 -1
  169. package/dist/generators/spring-cache/templates/src/main/java/_package_/config/CacheConfiguration.java.ejs +3 -3
  170. package/dist/generators/spring-cloud/generators/gateway/command.js +5 -0
  171. package/dist/generators/spring-cloud-stream/generators/kafka/templates/src/main/java/_package_/broker/KafkaConsumer_imperative.java.ejs +1 -1
  172. package/dist/generators/spring-cloud-stream/generators/kafka/templates/src/main/java/_package_/broker/KafkaConsumer_reactive.java.ejs +1 -1
  173. package/dist/generators/spring-cloud-stream/generators/kafka/templates/src/main/java/_package_/web/rest/KafkaResource_imperative.java.ejs +1 -1
  174. package/dist/generators/spring-cloud-stream/generators/kafka/templates/src/main/java/_package_/web/rest/KafkaResource_reactive.java.ejs +1 -1
  175. package/dist/generators/spring-data-couchbase/templates/src/main/java/_package_/config/DatabaseConfiguration.java.ejs +1 -1
  176. package/dist/generators/spring-data-neo4j/templates/src/main/java/_package_/config/DatabaseConfiguration.java_neo4j.ejs +18 -2
  177. package/dist/generators/spring-data-relational/templates/src/main/java/_package_/config/DatabaseConfiguration.java.ejs +1 -1
  178. package/dist/generators/vue/entity-files-vue.js +7 -7
  179. package/dist/generators/vue/resources/package.json +11 -11
  180. package/dist/generators/vue/templates/.eslintrc.cjs.ejs +7 -0
  181. package/dist/lib/eslint/base.js +25 -0
  182. package/dist/lib/eslint/recommended.js +22 -0
  183. package/dist/testing/github.js +32 -0
  184. package/dist/testing/helpers.js +9 -0
  185. package/dist/testing/index.js +2 -0
  186. package/dist/testing/sample-config.js +31 -0
  187. package/dist/types/cli/commands.d.mts +2 -0
  188. package/dist/types/cli/environment-builder.d.mts +1 -0
  189. package/dist/types/generators/base/api.d.ts +14 -7
  190. package/dist/types/generators/base/internal/command.d.ts +2 -0
  191. package/dist/types/generators/base/internal/index.d.ts +1 -0
  192. package/dist/types/generators/base/shared-data.d.ts +10 -1
  193. package/dist/types/generators/base/types.d.ts +12 -0
  194. package/dist/types/generators/base-application/types.d.ts +11 -0
  195. package/dist/types/generators/base-core/generator.d.ts +2 -1
  196. package/dist/types/generators/generator-constants.d.ts +1 -1
  197. package/dist/types/generators/info/support/extract-info.d.ts +14 -0
  198. package/dist/types/generators/info/support/index.d.ts +1 -0
  199. package/dist/types/generators/java/types.d.ts +12 -0
  200. package/dist/types/generators/maven/internal/xml-store.d.ts +3 -2
  201. package/dist/types/generators/maven/support/pom-store.d.ts +5 -2
  202. package/dist/types/generators/maven/types.d.ts +1 -0
  203. package/dist/types/generators/server/types.d.ts +2 -1
  204. package/dist/types/lib/eslint/base.d.ts +20 -0
  205. package/dist/types/lib/eslint/recommended.d.ts +20 -0
  206. package/dist/types/testing/github.d.ts +11 -0
  207. package/dist/types/testing/helpers.d.ts +8 -0
  208. package/dist/types/testing/index.d.ts +2 -0
  209. package/dist/types/testing/sample-config.d.ts +4 -0
  210. package/package.json +22 -18
  211. package/dist/generators/generate-blueprint/templates/.eslintrc.json.ejs +0 -35
@@ -25,7 +25,7 @@ import assert from 'assert';
25
25
  import { requireNamespace } from '@yeoman/namespace';
26
26
  import chalk from 'chalk';
27
27
  import { parse as parseYaml, stringify as stringifyYaml } from 'yaml';
28
- import { kebabCase, snakeCase, merge, get, set, defaults } from 'lodash-es';
28
+ import { kebabCase, snakeCase, merge, get, set, defaults, mergeWith } from 'lodash-es';
29
29
  import { simpleGit } from 'simple-git';
30
30
  import semver, { lt as semverLessThan } from 'semver';
31
31
  import YeomanGenerator from 'yeoman-generator';
@@ -42,6 +42,7 @@ import { convertConfigToOption } from '../../lib/internal/index.js';
42
42
  import { getGradleLibsVersionsProperties } from '../gradle/support/dependabot-gradle.js';
43
43
  import { dockerPlaceholderGenerator } from '../docker/utils.js';
44
44
  import { getConfigWithDefaults } from '../../jdl/index.js';
45
+ import { extractArgumentsFromConfigs } from '../base/internal/command.js';
45
46
  const { INITIALIZING, PROMPTING, CONFIGURING, COMPOSING, COMPOSING_COMPONENT, LOADING, PREPARING, POST_PREPARING, DEFAULT, WRITING, POST_WRITING, INSTALL, POST_INSTALL, END, } = PRIORITY_NAMES;
46
47
  const __filename = fileURLToPath(import.meta.url);
47
48
  const __dirname = dirname(__filename);
@@ -50,6 +51,7 @@ const relativeDir = (from, to) => {
50
51
  const rel = posixRelative(from, to);
51
52
  return rel ? `${rel}/` : '';
52
53
  };
54
+ const deepMerge = (source1, source2) => mergeWith({}, source1, source2, (a, b) => (Array.isArray(a) ? a.concat(b) : undefined));
53
55
  /**
54
56
  * This is the base class for a generator for every generator.
55
57
  */
@@ -71,6 +73,7 @@ export default class CoreGenerator extends YeomanGenerator {
71
73
  static END = asPriority(END);
72
74
  useVersionPlaceholders;
73
75
  skipChecks;
76
+ ignoreNeedlesError;
74
77
  experimental;
75
78
  debugEnabled;
76
79
  jhipster7Migration;
@@ -101,14 +104,12 @@ export default class CoreGenerator extends YeomanGenerator {
101
104
  unique: 'namespace',
102
105
  ...features,
103
106
  });
104
- let jhipsterOldVersion = null;
105
107
  if (!this.options.help) {
106
108
  /* Force config to use 'generator-jhipster' namespace. */
107
109
  this._config = this._getStorage('generator-jhipster');
108
110
  /* JHipster config using proxy mode used as a plain object instead of using get/set. */
109
111
  this.jhipsterConfig = this.config.createProxy();
110
- jhipsterOldVersion = this.jhipsterConfig.jhipsterVersion ?? null;
111
- this.sharedData = this.createSharedData({ jhipsterOldVersion, help: this.options.help });
112
+ this.sharedData = this.createSharedData({ help: this.options.help });
112
113
  /* Options parsing must be executed after forcing jhipster storage namespace and after sharedData have been populated */
113
114
  this.parseJHipsterOptions(command.options);
114
115
  // Don't write jhipsterVersion to .yo-rc.json when reproducible
@@ -297,7 +298,7 @@ You can ignore this error by passing '--skip-checks' to jhipster command.`);
297
298
  context[name] = context[name] ?? config?.[name] ?? this.config.get(name) ?? def.default;
298
299
  }
299
300
  if (def.scope === 'generator') {
300
- context[name] = context[name] ?? this[name] ?? def.default;
301
+ this[name] = this[name] ?? this.options[name] ?? def.default;
301
302
  }
302
303
  if (def.scope === 'blueprint') {
303
304
  context[name] = context[name] ?? this.blueprintStorage?.get(name) ?? def.default;
@@ -323,15 +324,7 @@ You can ignore this error by passing '--skip-checks' to jhipster command.`);
323
324
  this.parseJHipsterArguments(commandDef.arguments);
324
325
  }
325
326
  else if (commandDef.configs) {
326
- this.parseJHipsterArguments(Object.fromEntries(Object.entries(commandDef.configs)
327
- .filter(([_name, def]) => def.argument)
328
- .map(([name, def]) => [
329
- name,
330
- {
331
- description: def.description,
332
- ...def.argument,
333
- },
334
- ])));
327
+ this.parseJHipsterArguments(extractArgumentsFromConfigs(commandDef.configs));
335
328
  }
336
329
  if (commandDef.options || commandDef.configs) {
337
330
  this.parseJHipsterOptions(commandDef.options, commandDef.configs);
@@ -626,7 +619,12 @@ You can ignore this error by passing '--skip-checks' to jhipster command.`);
626
619
  // Convert to any because ejs types doesn't support string[] https://github.com/DefinitelyTyped/DefinitelyTyped/pull/63315
627
620
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
628
621
  const root = this.jhipsterTemplatesFolders ?? this.templatePath();
629
- return this.renderTemplate(source, destination, data, { root, ...options }, { noGlob: true, ...copyOptions });
622
+ try {
623
+ return this.renderTemplate(source, destination, data, { root, ...options }, { noGlob: true, ...copyOptions });
624
+ }
625
+ catch (error) {
626
+ throw new Error(`Error writing file ${source} to ${destination}: ${error}`, { cause: error });
627
+ }
630
628
  }
631
629
  /**
632
630
  * write the given files using provided options.
@@ -635,10 +633,15 @@ You can ignore this error by passing '--skip-checks' to jhipster command.`);
635
633
  const paramCount = Object.keys(options).filter(key => ['sections', 'blocks', 'templates'].includes(key)).length;
636
634
  assert(paramCount > 0, 'One of sections, blocks or templates is required');
637
635
  assert(paramCount === 1, 'Only one of sections, blocks or templates must be provided');
638
- const { sections, blocks, templates, rootTemplatesPath, context = this, transform: methodTransform = [] } = options;
636
+ const { sections, blocks, context = this, templates } = options;
637
+ const { rootTemplatesPath, customizeTemplatePath = file => file, transform: methodTransform = [] } = options;
639
638
  const { _: commonSpec = {} } = sections || {};
640
639
  const { transform: sectionTransform = [] } = commonSpec;
641
640
  const startTime = new Date().getMilliseconds();
641
+ const { customizeTemplatePaths: contextCustomizeTemplatePaths = [] } = context;
642
+ const templateData = this.jhipster7Migration
643
+ ? createJHipster7Context(this, context, { log: this.jhipster7Migration === 'verbose' ? msg => this.log.info(msg) : () => { } })
644
+ : context;
642
645
  /* Build lookup order first has preference.
643
646
  * Example
644
647
  * rootTemplatesPath = ['reactive', 'common']
@@ -673,7 +676,7 @@ You can ignore this error by passing '--skip-checks' to jhipster command.`);
673
676
  return val;
674
677
  }
675
678
  if (typeof val === 'function') {
676
- return val.call(this, context) || false;
679
+ return val.call(this, templateData) || false;
677
680
  }
678
681
  throw new Error(`Type not supported ${val}`);
679
682
  };
@@ -681,7 +684,6 @@ You can ignore this error by passing '--skip-checks' to jhipster command.`);
681
684
  const extension = extname(sourceFile);
682
685
  const isBinary = binary || ['.png', '.jpg', '.gif', '.svg', '.ico'].includes(extension);
683
686
  const appendEjs = noEjs === undefined ? !isBinary && extension !== '.ejs' : !noEjs;
684
- const ejsFile = appendEjs || extension === '.ejs';
685
687
  let targetFile;
686
688
  if (typeof destinationFile === 'function') {
687
689
  targetFile = resolveCallback(destinationFile);
@@ -692,9 +694,14 @@ You can ignore this error by passing '--skip-checks' to jhipster command.`);
692
694
  let sourceFileFrom;
693
695
  if (Array.isArray(rootTemplatesAbsolutePath)) {
694
696
  // Look for existing templates
695
- const existingTemplates = rootTemplatesAbsolutePath
697
+ let existingTemplates = rootTemplatesAbsolutePath
696
698
  .map(rootPath => this.templatePath(rootPath, sourceFile))
697
699
  .filter(templateFile => existsSync(appendEjs ? `${templateFile}.ejs` : templateFile));
700
+ if (existingTemplates.length === 0 && this.getFeatures().jhipster7Migration) {
701
+ existingTemplates = rootTemplatesAbsolutePath
702
+ .map(rootPath => this.templatePath(rootPath, appendEjs ? sourceFile : `${sourceFile}.ejs`))
703
+ .filter(templateFile => existsSync(templateFile));
704
+ }
698
705
  if (existingTemplates.length > 1) {
699
706
  const moreThanOneMessage = `Multiples templates were found for file ${sourceFile}, using the first
700
707
  templates: ${JSON.stringify(existingTemplates, null, 2)}`;
@@ -716,43 +723,68 @@ templates: ${JSON.stringify(existingTemplates, null, 2)}`;
716
723
  else {
717
724
  sourceFileFrom = this.templatePath(sourceFile);
718
725
  }
719
- if (appendEjs) {
720
- sourceFileFrom = `${sourceFileFrom}.ejs`;
726
+ const file = customizeTemplatePath({ sourceFile, resolvedSourceFile: sourceFileFrom, destinationFile: targetFile });
727
+ if (!file) {
728
+ return undefined;
721
729
  }
722
- if (!ejsFile) {
723
- await this.copyTemplateAsync(sourceFileFrom, targetFile);
724
- }
725
- else {
726
- let useAsync = true;
727
- if (context.entityClass) {
728
- if (!context.baseName) {
729
- throw new Error('baseName is require at templates context');
730
- }
731
- const sourceBasename = basename(sourceFileFrom);
732
- const seed = `${context.entityClass}-${sourceBasename}${context.fakerSeed ?? ''}`;
733
- Object.values(this.sharedData.getApplication()?.sharedEntities ?? {}).forEach((entity) => {
734
- entity.resetFakerSeed(seed);
735
- });
736
- // Async calls will make the render method to be scheduled, allowing the faker key to change in the meantime.
737
- useAsync = false;
730
+ sourceFileFrom = file.resolvedSourceFile;
731
+ targetFile = file.destinationFile;
732
+ let templatesRoots = [].concat(rootTemplatesAbsolutePath);
733
+ for (const contextCustomizeTemplatePath of contextCustomizeTemplatePaths) {
734
+ const file = contextCustomizeTemplatePath({
735
+ namespace: this.options.namespace,
736
+ sourceFile,
737
+ resolvedSourceFile: sourceFileFrom,
738
+ destinationFile: targetFile,
739
+ templatesRoots,
740
+ });
741
+ if (!file) {
742
+ return undefined;
738
743
  }
739
- const renderOptions = {
740
- ...(options?.renderOptions ?? {}),
741
- // Set root for ejs to lookup for partials.
742
- root: rootTemplatesAbsolutePath,
743
- // ejs caching cause problem https://github.com/jhipster/generator-jhipster/pull/20757
744
- cache: false,
745
- };
746
- const copyOptions = { noGlob: true };
747
- // TODO drop for v8 final release
748
- const data = this.jhipster7Migration ? createJHipster7Context(this, context, { ignoreWarnings: true }) : context;
749
- if (useAsync) {
750
- await this.renderTemplateAsync(sourceFileFrom, targetFile, data, renderOptions, copyOptions);
744
+ sourceFileFrom = file.resolvedSourceFile;
745
+ targetFile = file.destinationFile;
746
+ templatesRoots = file.templatesRoots;
747
+ }
748
+ try {
749
+ if (!appendEjs && extname(sourceFileFrom) !== '.ejs') {
750
+ await this.copyTemplateAsync(sourceFileFrom, targetFile);
751
751
  }
752
752
  else {
753
- this.renderTemplate(sourceFileFrom, targetFile, data, renderOptions, copyOptions);
753
+ let useAsync = true;
754
+ if (context.entityClass) {
755
+ if (!context.baseName) {
756
+ throw new Error('baseName is required at templates context');
757
+ }
758
+ const sourceBasename = basename(sourceFileFrom);
759
+ const seed = `${context.entityClass}-${sourceBasename}${context.fakerSeed ?? ''}`;
760
+ Object.values(this.sharedData.getApplication()?.sharedEntities ?? {}).forEach((entity) => {
761
+ entity.resetFakerSeed(seed);
762
+ });
763
+ // Async calls will make the render method to be scheduled, allowing the faker key to change in the meantime.
764
+ useAsync = false;
765
+ }
766
+ const renderOptions = {
767
+ ...(options?.renderOptions ?? {}),
768
+ // Set root for ejs to lookup for partials.
769
+ root: templatesRoots,
770
+ // ejs caching cause problem https://github.com/jhipster/generator-jhipster/pull/20757
771
+ cache: false,
772
+ };
773
+ const copyOptions = { noGlob: true };
774
+ if (appendEjs) {
775
+ sourceFileFrom = `${sourceFileFrom}.ejs`;
776
+ }
777
+ if (useAsync) {
778
+ await this.renderTemplateAsync(sourceFileFrom, targetFile, templateData, renderOptions, copyOptions);
779
+ }
780
+ else {
781
+ this.renderTemplate(sourceFileFrom, targetFile, templateData, renderOptions, copyOptions);
782
+ }
754
783
  }
755
784
  }
785
+ catch (error) {
786
+ throw new Error(`Error rendering template ${sourceFileFrom} to ${targetFile}: ${error}`, { cause: error });
787
+ }
756
788
  if (!isBinary && transform && transform.length) {
757
789
  this.editFile(targetFile, ...transform);
758
790
  }
@@ -898,7 +930,7 @@ templates: ${JSON.stringify(existingTemplates, null, 2)}`;
898
930
  if (!originalContent) {
899
931
  const { ignoreNonExisting, create } = actualOptions;
900
932
  const errorMessage = typeof ignoreNonExisting === 'string' ? ` ${ignoreNonExisting}.` : '';
901
- if (ignoreNonExisting) {
933
+ if (ignoreNonExisting || (!create && this.ignoreNeedlesError)) {
902
934
  this.log(`${chalk.yellow('\nUnable to find ')}${filePath}.${chalk.yellow(errorMessage)}\n`);
903
935
  // return a noop.
904
936
  const noop = () => noop;
@@ -915,7 +947,11 @@ templates: ${JSON.stringify(existingTemplates, null, 2)}`;
915
947
  try {
916
948
  newContent = joinCallbacks(...callbacks).call(this, newContent, filePath);
917
949
  if (actualOptions.assertModified && originalContent === newContent) {
918
- throw new Error(`Fail to edit file '${file}'.`);
950
+ const errorMessage = `${chalk.yellow('Fail to modify ')}${filePath}.`;
951
+ if (!this.ignoreNeedlesError) {
952
+ throw new Error(errorMessage);
953
+ }
954
+ this.log(errorMessage);
919
955
  }
920
956
  this.writeDestination(filePath, newContent);
921
957
  }
@@ -950,7 +986,9 @@ templates: ${JSON.stringify(existingTemplates, null, 2)}`;
950
986
  }
951
987
  return true;
952
988
  });
953
- return headerComments.join('\n').concat('\n', stringifyYaml(merge(parseYaml(content), value)));
989
+ const mergedContent = stringifyYaml(deepMerge(parseYaml(content), value));
990
+ const header = headerComments.length > 0 ? headerComments.join('\n').concat('\n') : '';
991
+ return `${header}${mergedContent}`;
954
992
  });
955
993
  }
956
994
  /**
@@ -1091,7 +1129,7 @@ templates: ${JSON.stringify(existingTemplates, null, 2)}`;
1091
1129
  getSharedApplication(applicationFolder = this.destinationPath()) {
1092
1130
  return this.options.sharedData.applications?.[this.calculateApplicationId(applicationFolder)];
1093
1131
  }
1094
- createSharedData({ jhipsterOldVersion, help, }) {
1132
+ createSharedData({ help }) {
1095
1133
  const applicationId = this.options.applicationId ?? this.calculateApplicationId(this.destinationPath());
1096
1134
  if (this.options.sharedData.applications === undefined) {
1097
1135
  this.options.sharedData.applications = {};
@@ -1101,6 +1139,6 @@ templates: ${JSON.stringify(existingTemplates, null, 2)}`;
1101
1139
  sharedApplications[applicationId] = {};
1102
1140
  }
1103
1141
  const { ignoreNeedlesError } = this.options;
1104
- return new SharedData(sharedApplications[applicationId], { jhipsterOldVersion, ignoreNeedlesError });
1142
+ return new SharedData(sharedApplications[applicationId], { destinationPath: this.destinationPath(), memFs: this.env.sharedFs, log: this.log, logCwd: this.env.logCwd }, { ignoreNeedlesError });
1105
1143
  }
1106
1144
  }
@@ -157,7 +157,7 @@ export default class BootstrapGenerator extends BaseGenerator {
157
157
  const prettierTransforms = [];
158
158
  if (!this.skipPrettier) {
159
159
  const ignoreErrors = this.options.ignoreErrors || this.upgradeCommand;
160
- prettierTransforms.push(createESLintTransform.call(this, { ignoreErrors, extensions: 'ts,js' }), createRemoveUnusedImportsTransform.call(this, { ignoreErrors }), await createPrettierTransform.call(this, {
160
+ prettierTransforms.push(createESLintTransform.call(this, { ignoreErrors, extensions: 'ts,js,cjs,mjs' }), createRemoveUnusedImportsTransform.call(this, { ignoreErrors }), await createPrettierTransform.call(this, {
161
161
  ignoreErrors,
162
162
  prettierPackageJson: true,
163
163
  prettierJava: !this.jhipsterConfig.skipServer,
@@ -1,8 +1,15 @@
1
- import ESLint from 'eslint';
2
- let eslint;
1
+ import eslint from 'eslint';
2
+ import { baseRules } from '../../../lib/eslint/base.js';
3
+ let eslintInstance;
4
+ /* Flat config based eslint
5
+ Blocked by https://github.com/import-js/eslint-plugin-import/issues/2556
6
+ import eslint from 'eslint/use-at-your-own-risk';
7
+ const { languageOptions, plugins: tseslintPlugins } = tseslint.configs.base;
8
+ new eslint.FlatESLint({ fix: true, overrideConfigFile: true, cwd, plugins, baseConfig: { languageOptions, rules } });
9
+ */
3
10
  export default async ({ resolvePluginsRelativeTo, filePath, fileContents }) => {
4
- if (!eslint) {
5
- eslint = new ESLint.ESLint({
11
+ if (!eslintInstance) {
12
+ eslintInstance = new eslint.ESLint({
6
13
  fix: true,
7
14
  // Disable destination configs. We should apply plugins and rules which jhipster depends on.
8
15
  useEslintrc: false,
@@ -14,20 +21,15 @@ export default async ({ resolvePluginsRelativeTo, filePath, fileContents }) => {
14
21
  sourceType: 'module',
15
22
  ecmaVersion: 'latest',
16
23
  },
17
- rules: {
18
- 'import/order': 'error',
19
- 'import/no-duplicates': 'error',
20
- 'unused-imports/no-unused-imports': 'error',
21
- 'unused-imports/no-unused-vars': ['warn', { vars: 'all', varsIgnorePattern: '^_', args: 'after-used', argsIgnorePattern: '^_' }],
22
- },
24
+ rules: baseRules,
23
25
  },
24
26
  });
25
27
  }
26
- if (await eslint.isPathIgnored(filePath)) {
28
+ if (await eslintInstance.isPathIgnored(filePath)) {
27
29
  return { result: fileContents };
28
30
  }
29
31
  try {
30
- const [result] = await eslint.lintText(fileContents, { filePath });
32
+ const [result] = await eslintInstance.lintText(fileContents, { filePath });
31
33
  return { result: result.output ?? fileContents };
32
34
  }
33
35
  catch (error) {
@@ -36,7 +36,12 @@ export default class TemplateFile {
36
36
  this._debug('======');
37
37
  this._debug(contents);
38
38
  }
39
- this._compiled = ejs.compile(contents, options);
39
+ try {
40
+ this._compiled = ejs.compile(contents, options);
41
+ }
42
+ catch (error) {
43
+ throw new Error(`Error compiling ${this._filename}, with contents:\n${contents}`, { cause: error });
44
+ }
40
45
  }
41
46
  addFragment(templateFile) {
42
47
  assert(templateFile, 'templateFile is required');
@@ -48,7 +48,7 @@ export default class BootstrapApplicationGenerator extends BaseApplicationGenera
48
48
  application.skipUserManagement = true;
49
49
  }
50
50
  applicationDefaults({
51
- useNpmWrapper: application => application.clientFrameworkAny && application.backendTypeSpringBoot,
51
+ useNpmWrapper: application => application.clientFrameworkAny && application.backendTypeJavaAny,
52
52
  documentationArchiveUrl: ({ jhipsterVersion }) => `${JHIPSTER_DOCUMENTATION_URL}${JHIPSTER_DOCUMENTATION_ARCHIVE_PATH}v${jhipsterVersion}`,
53
53
  });
54
54
  let prettierExtensions = 'md,json,yml,html';
@@ -16,7 +16,7 @@
16
16
  * See the License for the specific language governing permissions and
17
17
  * limitations under the License.
18
18
  */
19
- import { loadClientConfig, loadDerivedClientConfig, preparePostEntityClientDerivedProperties } from '../client/support/index.js';
19
+ import { loadClientConfig, loadDerivedClientConfig, preparePostEntityClientDerivedProperties, filterEntitiesAndPropertiesForClient, filterEntitiesForClient, } from '../client/support/index.js';
20
20
  import BaseApplicationGenerator from '../base-application/index.js';
21
21
  import { loadStoredAppOptions } from '../app/support/index.js';
22
22
  import clientCommand from '../client/command.js';
@@ -61,6 +61,10 @@ export default class BootStrapApplicationClient extends BaseApplicationGenerator
61
61
  }
62
62
  get postPreparingEachEntity() {
63
63
  return this.asPostPreparingEachEntityTaskGroup({
64
+ control({ control }) {
65
+ control.filterEntitiesAndPropertiesForClient = filterEntitiesAndPropertiesForClient;
66
+ control.filterEntitiesForClient = filterEntitiesForClient;
67
+ },
64
68
  postPreparingEntity({ entity }) {
65
69
  preparePostEntityClientDerivedProperties(entity);
66
70
  },
@@ -153,7 +153,7 @@ export default class CiCdGenerator extends BaseApplicationGenerator {
153
153
  postWriting({ application }) {
154
154
  if (application.ciCdIntegrations.includes('deploy')) {
155
155
  if (application.buildToolMaven) {
156
- createPomStorage(this).addDistributionManagement({
156
+ createPomStorage(this, { sortFile: false }).addDistributionManagement({
157
157
  releasesId: application.artifactoryReleasesId,
158
158
  releasesUrl: application.artifactoryReleasesUrl,
159
159
  snapshotsId: application.artifactorySnapshotsId,
@@ -17,7 +17,6 @@
17
17
  limitations under the License.
18
18
  -%>
19
19
  # Documentation at https://docs.docker.com/registry/deploying
20
- version: '2'
21
20
  services:
22
21
  registry:
23
22
  image: registry:2
@@ -16,7 +16,6 @@
16
16
  See the License for the specific language governing permissions and
17
17
  limitations under the License.
18
18
  -%>
19
- version: '2'
20
19
  services:
21
20
  jenkins:
22
21
  image: <%- dockerContainers.jenkins %>
@@ -26,7 +26,6 @@ import { testFrameworkTypes, clientFrameworkTypes } from '../../jdl/jhipster/ind
26
26
  import { createNeedleCallback } from '../base/support/index.js';
27
27
  import { loadStoredAppOptions } from '../app/support/index.js';
28
28
  import command from './command.js';
29
- import { filterEntitiesAndPropertiesForClient } from './support/index.js';
30
29
  const { ANGULAR, VUE, REACT, NO: CLIENT_FRAMEWORK_NO } = clientFrameworkTypes;
31
30
  const { CYPRESS } = testFrameworkTypes;
32
31
  export default class JHipsterClientGenerator extends BaseApplicationGenerator {
@@ -189,11 +188,11 @@ export default class JHipsterClientGenerator extends BaseApplicationGenerator {
189
188
  }
190
189
  get writingEntities() {
191
190
  return this.asWritingEntitiesTaskGroup({
192
- async writeEnumerationFiles({ application, entities }) {
191
+ async writeEnumerationFiles({ control, application, entities }) {
193
192
  if (!application.webappEnumerationsDir || ![ANGULAR, VUE, REACT].includes(application.clientFramework)) {
194
193
  return;
195
194
  }
196
- for (const entity of filterEntitiesAndPropertiesForClient(entities)) {
195
+ for (const entity of (control.filterEntitiesAndPropertiesForClient ?? (entities => entities))(entities)) {
197
196
  await addEnumerationFiles.call(this, { application, entity });
198
197
  }
199
198
  },
@@ -6,11 +6,11 @@
6
6
  "@cypress/code-coverage": "3.12.39",
7
7
  "babel-loader": "9.1.3",
8
8
  "babel-plugin-istanbul": "6.1.1",
9
- "cypress": "13.10.0",
9
+ "cypress": "13.12.0",
10
10
  "cypress-audit": "1.1.0",
11
11
  "eslint-plugin-cypress": "3.3.0",
12
- "lighthouse": "12.0.0",
13
- "nyc": "15.1.0",
12
+ "lighthouse": "12.1.0",
13
+ "nyc": "17.0.0",
14
14
  "swagger-ui-dist": "5.17.14"
15
15
  }
16
16
  }
@@ -5,7 +5,7 @@
5
5
  export const filterEntityPropertiesForClient = (entity) => ({
6
6
  ...entity,
7
7
  fields: entity.fields.filter(field => !field.skipClient),
8
- relationships: entity.relationships.filter(rel => !rel.skipClient && (rel.persistableRelationship || rel.relationshipEagerLoad)),
8
+ relationships: entity.relationships.filter(rel => !(rel.skipClient ?? !(rel.persistableRelationship || rel.relationshipEagerLoad || rel.otherEntity?.jpaMetamodelFiltering))),
9
9
  });
10
10
  /**
11
11
  * Filter entities for frontend templates.
@@ -17,12 +17,16 @@
17
17
  limitations under the License.
18
18
  -%>
19
19
  node_modules/
20
- src/main/docker/
21
- <%= !clientFrameworkVue ? '' : clientTestDir %>jest.conf.js
20
+ <%- dockerServicesDir %>
21
+ <%_ if (!clientFrameworkVue) { _%>
22
+ jest.conf.js
23
+ <%_ } _%>
24
+ <%_ if (!clientFrameworkVue || microfrontend) { _%>
22
25
  webpack/
23
- target/
24
- build/
25
- node/
26
+ <%_ } _%>
27
+ <%- temporaryDir %>
26
28
  coverage/
29
+ <%_ if (clientFrameworkReact) { _%>
27
30
  postcss.config.js
31
+ <%_ } _%>
28
32
  <%- this.relativeDir(clientRootDir, clientDistDir) %>
@@ -28,21 +28,28 @@
28
28
  _&>
29
29
  <%_
30
30
  let clientPackageMngrName = 'Npm';
31
+ let clientPackageMngrWrapper = useNpmWrapper ? './npmw' : clientPackageManager;
31
32
  let clientPackageMngrAddGlobal = 'install -g';
32
33
  let clientPackageMngrAdd = 'install --save --save-exact';
33
34
  let clientPackageMngrAddDev = 'install --save-dev --save-exact';
34
35
  -%>
35
36
  <&_ if (fragment.developmentSection) { -&>
37
+ <%_ if (useNpmWrapper) { _%>
38
+ The build system will install automatically the recommended version of Node and <%= clientPackageManager %>.
39
+
40
+ We provide a wrapper to launch <%= clientPackageManager %>.
41
+ <%_ } else { _%>
36
42
  Before you can build this project, you must install and configure the following dependencies on your machine:
37
43
 
38
- 1. [Node.js](https://nodejs.org/): We use Node to run a development web server and build the project.
44
+ 1. [Node.js](https://nodejs.org/): Node is used to run a development web server and build the project.
39
45
  Depending on your system, you can install Node either from source or as a pre-packaged bundle.
40
46
 
41
47
  After installing Node, you should be able to run the following command to install development tools.
48
+ <%_ } _%>
42
49
  You will only need to run this command when dependencies change in [package.json](package.json).
43
50
 
44
51
  ```
45
- <%= clientPackageManager %> install
52
+ <%= clientPackageMngrWrapper %> install
46
53
  ```
47
54
 
48
55
  We use <%= clientPackageManager %> scripts and <&- fragments.customCliSection(' ') &>[Webpack][] as our build system.
@@ -58,14 +65,16 @@ docker compose -f src/main/docker/<%= cacheProviderHazelcast?'hazelcast-manageme
58
65
  <%_ if (cacheProviderRedis) { _%>
59
66
 
60
67
  The cache can also be turned off by adding to the application yaml:
61
- ```
68
+
69
+ ```yaml
62
70
  spring:
63
71
  cache:
64
72
  type: none
65
73
  ```
74
+
66
75
  See [here](https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-caching.html#boot-features-caching-provider-none) for details.
67
76
 
68
- **WARNING**: If you using second level hibernate cache and disabling the spring cache, you have to disable the second level hibernate cache as well since they are using
77
+ **WARNING**: If you're using the second level Hibernate cache and disabling the Spring cache, you have to disable the second level Hibernate cache as well since they are using
69
78
  the same CacheManager.
70
79
  <%_ } _%>
71
80
  <%_ } _%>
@@ -80,14 +89,14 @@ auto-refreshes when files change on your hard drive.
80
89
  <%_ if (buildToolGradle) { _%>
81
90
  ./gradlew -x webapp
82
91
  <%_ } _%>
83
- <%= clientPackageManager %> start
92
+ <%= clientPackageMngrWrapper %> start
84
93
  ```
85
94
 
86
95
  <%= clientPackageMngrName %> is also used to manage CSS and JavaScript dependencies used in this application. You can upgrade dependencies by
87
- specifying a newer version in [package.json](package.json). You can also run `<%= clientPackageManager %> update` and `<%= clientPackageManager %> install` to manage dependencies.
88
- Add the `help` flag on any command to see how you can use it. For example, `<%= clientPackageManager %> help update`.
96
+ specifying a newer version in [package.json](package.json). You can also run `<%= clientPackageMngrWrapper %> update` and `<%= clientPackageMngrWrapper %> install` to manage dependencies.
97
+ Add the `help` flag on any command to see how you can use it. For example, `<%= clientPackageMngrWrapper %> help update`.
89
98
 
90
- The `<%= clientPackageManager %> run` command will list all of the scripts available to run for this project.
99
+ The `<%= clientPackageMngrWrapper %> run` command will list all the scripts available to run for this project.
91
100
 
92
101
  ### PWA Support
93
102
 
@@ -121,13 +130,13 @@ ServiceWorkerModule.register('ngsw-worker.js', { enabled: false }),
121
130
  For example, to add [Leaflet][] library as a runtime dependency of your application, you would run following command:
122
131
 
123
132
  ```
124
- <%= clientPackageManager %> <%= clientPackageMngrAdd %> leaflet
133
+ <%= clientPackageMngrWrapper %> <%= clientPackageMngrAdd %> leaflet
125
134
  ```
126
135
 
127
136
  To benefit from TypeScript type definitions from [DefinitelyTyped][] repository in development, you would run following command:
128
137
 
129
138
  ```
130
- <%= clientPackageManager %> <%= clientPackageMngrAddDev %> @types/leaflet
139
+ <%= clientPackageMngrWrapper %> <%= clientPackageMngrAddDev %> @types/leaflet
131
140
  ```
132
141
 
133
142
  Then you would import the JS and CSS files specified in library's installation instructions so that [Webpack][] knows about them:
@@ -159,9 +168,9 @@ Start gateway from source:
159
168
 
160
169
  ```
161
170
  cd gateway
162
- npm run docker:db:up # start database if necessary
163
- npm run docker:others:up # start service discovery and authentication service if necessary
164
- npm run app:start # alias for ./(mvnw|gradlew)
171
+ <%= clientPackageMngrWrapper %> run docker:db:up # start database if necessary
172
+ <%= clientPackageMngrWrapper %> run docker:others:up # start service discovery and authentication service if necessary
173
+ <%= clientPackageMngrWrapper %> run app:start # alias for ./(mvnw|gradlew)
165
174
  ```
166
175
 
167
176
  Microfrontend's `build-watch` script is configured to watch and compile microfrontend's sources and synchronizes with gateway's frontend.
@@ -169,16 +178,16 @@ Start it using:
169
178
 
170
179
  ```
171
180
  cd microfrontend
172
- npm run docker:db:up # start database if necessary
173
- npm run build-watch
181
+ <%= clientPackageMngrWrapper %> run docker:db:up # start database if necessary
182
+ <%= clientPackageMngrWrapper %> run build-watch
174
183
  ```
175
184
 
176
185
  It's possible to run microfrontend's frontend standalone using:
177
186
 
178
187
  ```
179
188
  cd microfrontend
180
- npm run docker:db:up # start database if necessary
181
- npm watch # alias for `npm start` and `npm run backend:start` in parallel
189
+ <%= clientPackageMngrWrapper %> run docker:db:up # start database if necessary
190
+ <%= clientPackageMngrWrapper %> watch # alias for `npm start` and `npm run backend:start` in parallel
182
191
  ```
183
192
 
184
193
  <%_ } -%>
@@ -190,16 +199,16 @@ npm watch # alias for `npm start` and `npm run backend:start` in parallel
190
199
  Unit tests are run by [Jest][]. They're located in [<%= clientTestDir %>](<%= clientTestDir %>) and can be run with:
191
200
 
192
201
  ```
193
- <%= clientPackageManager %> test
202
+ <%= clientPackageMngrWrapper %> test
194
203
  ```
195
204
 
196
205
  <%_ if (cypressTests) { _%>
197
206
  UI end-to-end tests are powered by [Cypress][]. They're located in [<%= clientTestDir %>cypress](<%= clientTestDir %>cypress)
198
- and can be run by starting Spring Boot in one terminal (`<% if (buildToolMaven) { %>./mvnw spring-boot:run<% } else { %>./gradlew bootRun<% } %>`) and running the tests (`<%= clientPackageManager %> run e2e`) in a second one.
207
+ and can be run by starting Spring Boot in one terminal (`<% if (buildToolMaven) { %>./mvnw spring-boot:run<% } else { %>./gradlew bootRun<% } %>`) and running the tests (`<%= clientPackageMngrWrapper %> run e2e`) in a second one.
199
208
 
200
209
  #### Lighthouse audits
201
210
 
202
- You can execute automated [lighthouse audits][https://developers.google.com/web/tools/lighthouse/] with [cypress audits][https://github.com/mfrachet/cypress-audit] by running `<%= clientPackageManager %> run e2e:cypress:audits`.
211
+ You can execute automated [Lighthouse audits](https://developers.google.com/web/tools/lighthouse/) with [cypress-audit](https://github.com/mfrachet/cypress-audit) by running `<%= clientPackageMngrWrapper %> run e2e:cypress:audits`.
203
212
  You should only run the audits when your application is packaged with the production profile.
204
213
  The lighthouse report is created in <% if (buildToolMaven) { %>`target/cypress/lhreport.html`<% } else { %>`build/cypress/lhreport.html`<% } %>
205
214
  <%_ } _%>
@@ -17,7 +17,7 @@
17
17
  limitations under the License.
18
18
  -%>
19
19
  <!DOCTYPE html>
20
- <html class="no-js" lang="<%= nativeLanguage %>" dir="ltr">
20
+ <html class="no-js" lang="<%= nativeLanguage %>" dir="<%- nativeLanguageDefinition.rtl ? 'rtl' : 'ltr' %>">
21
21
  <head>
22
22
  <meta charset="utf-8" />
23
23
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />