generator-jhipster 7.9.2 → 7.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/environment-builder.js +15 -1
- package/generators/app/index.js +12 -1
- package/generators/bootstrap/index.js +33 -1
- package/generators/ci-cd/templates/circle.yml.ejs +3 -13
- package/generators/client/files-angular.js +1 -1
- package/generators/client/files-react.js +5 -2
- package/generators/client/files-vue.js +3 -2
- package/generators/client/templates/angular/jest.conf.js.ejs +6 -3
- package/generators/client/templates/angular/package.json +18 -18
- package/generators/client/templates/angular/package.json.ejs +3 -7
- package/generators/client/templates/angular/src/main/webapp/app/admin/admin-routing.module.ts.ejs +1 -1
- package/generators/client/templates/angular/src/main/webapp/app/admin/health/health.model.ts.ejs +1 -1
- package/generators/client/templates/angular/src/main/webapp/app/admin/user-management/update/user-management-update.component.ts.ejs +17 -15
- package/generators/client/templates/angular/src/main/webapp/app/admin/user-management/user-management.model.ts.ejs +2 -2
- package/generators/client/templates/angular/src/main/webapp/app/admin/user-management/user-management.route.ts.ejs +4 -4
- package/generators/client/templates/angular/src/main/webapp/app/core/request/request-util.ts.ejs +4 -2
- package/generators/client/templates/angular/src/main/webapp/app/core/util/data-util.service.ts.ejs +1 -1
- package/generators/client/templates/angular/src/main/webapp/app/core/util/parse-links.service.ts.ejs +1 -1
- package/generators/client/templates/angular/src/main/webapp/app/layouts/navbar/navbar.component.html.ejs +1 -1
- package/generators/client/templates/angular/src/main/webapp/app/shared/filter/filter.component.html.ejs +8 -6
- package/generators/client/templates/angular/src/main/webapp/app/shared/filter/filter.component.ts.ejs +6 -11
- package/generators/client/templates/angular/src/main/webapp/app/shared/filter/filter.model.spec.ts.ejs +227 -25
- package/generators/client/templates/angular/src/main/webapp/app/shared/filter/filter.model.ts.ejs +104 -43
- package/generators/client/templates/angular/src/main/webapp/content/scss/global.scss.ejs +8 -0
- package/generators/client/templates/angular/tsconfig.json.ejs +0 -1
- package/generators/client/templates/angular/tsconfig.spec.json.ejs +2 -3
- package/generators/client/templates/angular/webpack/webpack.microfrontend.js.ejs +0 -3
- package/generators/client/templates/common/package.json +4 -4
- package/generators/client/templates/common/src/main/webapp/swagger-ui/index.html.ejs +1 -1
- package/generators/client/templates/react/jest.conf.js.ejs +2 -2
- package/generators/client/templates/react/package.json +23 -23
- package/generators/client/templates/react/package.json.ejs +3 -7
- package/generators/client/templates/react/src/main/webapp/app/config/store.ts.ejs +0 -6
- package/generators/client/templates/react/src/main/webapp/app/modules/administration/administration.reducer.spec.ts.ejs +7 -7
- package/generators/client/templates/react/src/main/webapp/app/modules/administration/administration.reducer.ts.ejs +6 -6
- package/generators/client/templates/react/src/main/webapp/app/modules/administration/index.tsx.ejs +2 -2
- package/generators/client/templates/react/src/main/webapp/app/shared/layout/menus/admin.tsx.ejs +1 -1
- package/generators/client/templates/react/src/main/webapp/app/shared/reducers/authentication.spec.ts.ejs +17 -8
- package/generators/client/templates/react/src/main/webapp/app/shared/reducers/authentication.ts.ejs +1 -1
- package/generators/client/templates/react/src/main/webapp/app/shared/reducers/locale.spec.ts.ejs +176 -19
- package/generators/client/templates/react/src/main/webapp/app/shared/reducers/locale.ts.ejs +46 -13
- package/generators/client/templates/react/webpack/webpack.microfrontend.js.jhi.react.ejs +1 -1
- package/generators/client/templates/vue/package.json +17 -17
- package/generators/client/templates/vue/package.json.ejs +3 -7
- package/generators/client/templates/vue/src/main/webapp/app/core/jhi-navbar/jhi-navbar.component.ts.ejs +2 -1
- package/generators/client/templates/vue/src/main/webapp/app/core/jhi-navbar/jhi-navbar.vue.ejs +1 -1
- package/generators/client/templates/vue/src/main/webapp/app/main.ts.ejs +2 -2
- package/generators/client/templates/vue/src/main/webapp/app/router/admin.ts.ejs +2 -2
- package/generators/client/templates/vue/src/test/javascript/e2e/modules/administration/administration.spec.ts.ejs +1 -1
- package/generators/client/templates/vue/src/test/javascript/e2e/page-objects/administration-page.ts.ejs +1 -1
- package/generators/client/templates/vue/src/test/javascript/e2e/page-objects/navbar-page.ts.ejs +2 -2
- package/generators/client/templates/vue/src/test/javascript/jest.conf.js.ejs +5 -6
- package/generators/client/templates/vue/src/test/javascript/spec/app/account/account.service.spec.ts.ejs +4 -0
- package/generators/client/templates/vue/src/test/javascript/spec/app/shared/alert/alert.service.spec.ts.ejs +106 -3
- package/generators/client/templates/vue/src/test/javascript/spec/app/shared/config/axios-interceptor.spec.ts.ejs +12 -0
- package/generators/client/templates/vue/src/test/javascript/spec/app/shared/config/formatter.spec.ts.ejs +6 -0
- package/generators/client/templates/vue/src/test/javascript/spec/app/shared/sort/sorts.spec.ts.ejs +10 -0
- package/generators/client/templates/vue/webpack/webpack.common.js.ejs +1 -1
- package/generators/client/templates/vue/webpack/webpack.dev.js.ejs +2 -2
- package/generators/common/files.js +5 -4
- package/generators/common/templates/package.json +1 -1
- package/generators/common/templates/sonar-project.properties.ejs +19 -11
- package/generators/cypress/index.js +1 -1
- package/generators/docker-compose/templates/README-DOCKER-COMPOSE.md.ejs +3 -3
- package/generators/docker-compose/templates/docker-compose.yml.ejs +1 -1
- package/generators/docker-compose/templates/realm-config/jhipster-realm.json.ejs +32 -14
- package/generators/entity/index.js +4 -3
- package/generators/entity-client/templates/angular/src/main/webapp/app/entities/detail/entity-management-detail.component.html.ejs +1 -1
- package/generators/entity-client/templates/angular/src/main/webapp/app/entities/list/entity-management.component.html.ejs +18 -6
- package/generators/entity-client/templates/angular/src/main/webapp/app/entities/list/entity-management.component.spec.ts.ejs +1 -1
- package/generators/entity-client/templates/angular/src/main/webapp/app/entities/list/entity-management.component.ts.ejs +23 -19
- package/generators/entity-client/templates/angular/src/main/webapp/app/entities/service/entity.service.spec.ts.ejs +3 -1
- package/generators/entity-client/templates/angular/src/main/webapp/app/entities/service/entity.service.ts.ejs +1 -1
- package/generators/entity-client/templates/angular/src/main/webapp/app/entities/update/entity-form.service.ts.ejs +1 -1
- package/generators/entity-client/templates/vue/src/main/webapp/app/entities/entity.component.ts.ejs +2 -2
- package/generators/entity-server/templates/src/main/java/package/common/delete_template.ejs +7 -3
- package/generators/entity-server/templates/src/main/java/package/common/get_all_template.ejs +2 -2
- package/generators/entity-server/templates/src/main/java/package/domain/Entity.java.jhi.ejs +15 -5
- package/generators/entity-server/templates/src/main/java/package/domain/Entity.java.jhi.spring_data_persistable.ejs +8 -1
- package/generators/entity-server/templates/src/main/java/package/repository/EntityRepositoryInternalImpl_reactive.java.ejs +5 -0
- package/generators/entity-server/templates/src/main/java/package/service/EntityQueryService.java.ejs +4 -4
- package/generators/entity-server/templates/src/main/java/package/service/EntityService.java.ejs +6 -4
- package/generators/entity-server/templates/src/main/java/package/service/criteria/EntityCriteria.java.ejs +3 -26
- package/generators/entity-server/templates/src/main/java/package/service/dto/EntityDTO.java.ejs +1 -0
- package/generators/entity-server/templates/src/main/java/package/service/impl/EntityServiceImpl.java.ejs +1 -1
- package/generators/entity-server/templates/src/test/java/package/web/rest/EntityResourceIT.java.ejs +33 -28
- package/generators/generate-blueprint/constants.mjs +46 -6
- package/generators/generate-blueprint/files.mjs +7 -5
- package/generators/generate-blueprint/generator.mjs +73 -19
- package/generators/generate-blueprint/templates/generators/generator/generator.spec.mjs.ejs +1 -1
- package/generators/generator-base-blueprint.js +23 -1
- package/generators/generator-base-entities.cjs +5 -1
- package/generators/generator-base.js +82 -15
- package/generators/generator-constants.js +17 -23
- package/generators/kubernetes/templates/deployment.yml.ejs +1 -1
- package/generators/kubernetes/templates/ingress.yml.ejs +1 -1
- package/generators/kubernetes/templates/istio/gateway.yml.ejs +1 -1
- package/generators/kubernetes/templates/kustomize/kustomization.yml.ejs +1 -1
- package/generators/kubernetes/templates/service.yml.ejs +1 -1
- package/generators/kubernetes-knative/templates/istio/gateway.yml.ejs +1 -1
- package/generators/kubernetes-knative/templates/service.yml.ejs +3 -3
- package/generators/languages/templates/src/main/webapp/i18n/al/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/ar-ly/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/bg/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/bn/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/by/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/ca/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/cs/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/da/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/de/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/el/activate.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/el/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/el/password.json +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/el/register.json +3 -3
- package/generators/languages/templates/src/main/webapp/i18n/el/tracker.json +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/el/user-management.json +9 -9
- package/generators/languages/templates/src/main/webapp/i18n/en/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/es/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/et/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/fa/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/fi/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/fr/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/gl/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/hi/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/hr/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/hu/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/hy/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/in/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/it/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/ja/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/ko/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/mr/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/my/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/nl/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/pa/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/pl/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/pt-br/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/pt-pt/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/ro/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/ru/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/si/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/sk/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/sr/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/sv/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/ta/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/te/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/th/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/tr/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/ua/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/uz-Latn-uz/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/vi/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/zh-cn/health.json.ejs +1 -1
- package/generators/languages/templates/src/main/webapp/i18n/zh-tw/health.json.ejs +1 -1
- package/generators/openshift/templates/deployment.yml.ejs +2 -2
- package/generators/server/cleanup-elasticsearch.js +5 -0
- package/generators/server/files.js +17 -8
- package/generators/server/index.js +0 -2
- package/generators/server/templates/build.gradle.ejs +6 -14
- package/generators/server/templates/gradle/profile_dev.gradle.ejs +1 -1
- package/generators/server/templates/gradle/profile_prod.gradle.ejs +1 -1
- package/generators/server/templates/gradle.properties.ejs +6 -4
- package/generators/server/templates/npmw.cmd +31 -29
- package/generators/server/templates/package.json.ejs +2 -2
- package/generators/server/templates/pom.xml.ejs +12 -23
- package/generators/server/templates/sql/common/src/test/java/package/config/MsSqlTestContainer.java.ejs +2 -3
- package/generators/server/templates/src/main/docker/app.yml.ejs +7 -1
- package/generators/server/templates/src/main/docker/config/realm-config/jhipster-realm.json.ejs +32 -14
- package/generators/server/templates/src/main/docker/jhipster-control-center.yml.ejs +1 -1
- package/generators/server/templates/src/main/docker/prometheus/prometheus.yml.ejs +1 -1
- package/generators/server/templates/src/main/java/package/Application.java.ejs +11 -4
- package/generators/server/templates/src/main/java/package/config/CRLFLogConverter.java.ejs +57 -0
- package/generators/server/templates/src/main/java/package/config/EurekaWorkaroundConfiguration.java.ejs +49 -0
- package/generators/server/templates/src/main/java/package/config/LoggingConfiguration.java.ejs +4 -4
- package/generators/server/templates/src/main/java/package/config/SecurityConfiguration.java.ejs +17 -18
- package/generators/server/templates/src/main/java/package/config/SecurityConfiguration_reactive.java.ejs +13 -5
- package/generators/server/templates/src/main/java/package/domain/AbstractAuditingEntity.java.ejs +5 -6
- package/generators/server/templates/src/main/java/package/domain/User.java.ejs +1 -1
- package/generators/server/templates/src/main/java/package/repository/UserRepository.java.ejs +1 -1
- package/generators/server/templates/src/main/java/package/security/oauth2/CustomClaimConverter.java.ejs +13 -6
- package/generators/server/templates/src/main/java/package/service/dto/AdminUserDTO.java.ejs +3 -1
- package/generators/server/templates/src/main/java/package/service/dto/PasswordChangeDTO.java.ejs +5 -1
- package/generators/server/templates/src/main/java/package/service/dto/UserDTO.java.ejs +3 -1
- package/generators/server/templates/src/main/java/package/web/rest/UserResource.java.ejs +15 -42
- package/generators/server/templates/src/main/java/package/web/rest/errors/BadRequestAlertException.java.ejs +1 -0
- package/generators/server/templates/src/main/java/package/web/rest/errors/EmailAlreadyUsedException.java.ejs +1 -0
- package/generators/server/templates/src/main/java/package/web/rest/errors/InvalidPasswordException.java.ejs +1 -0
- package/generators/server/templates/src/main/java/package/web/rest/errors/LoginAlreadyUsedException.java.ejs +1 -0
- package/generators/server/templates/src/main/resources/config/application-dev.yml.ejs +1 -1
- package/generators/server/templates/src/main/resources/config/application-prod.yml.ejs +2 -2
- package/generators/server/templates/src/main/resources/config/application.yml.ejs +4 -2
- package/generators/server/templates/src/main/resources/config/liquibase/master.xml.ejs +3 -8
- package/generators/server/templates/src/main/resources/logback-spring.xml.ejs +5 -0
- package/generators/server/templates/src/test/java/package/config/{ElasticsearchReactiveTestConfiguration.java.ejs → ElasticsearchTestConfiguration.java.ejs} +3 -3
- package/generators/server/templates/src/test/java/package/config/ElasticsearchTestContainer.java.ejs +1 -0
- package/generators/server/templates/src/test/java/package/config/JHipsterBlockHoundIntegration.java.ejs +3 -0
- package/generators/server/templates/src/test/java/package/config/TestContainersSpringContextCustomizerFactory.java.ejs +2 -2
- package/generators/sql-constants.js +5 -2
- package/generators/utils.js +43 -3
- package/generators/workspaces/index.js +2 -1
- package/jdl/exporters/jdl-exporter.js +6 -1
- package/jdl/jhipster/application-options.js +2 -1
- package/jdl/jhipster/binary-options.js +2 -2
- package/jdl/jhipster/default-application-options.js +11 -8
- package/jdl/jhipster/entity-options.js +1 -0
- package/jdl/jhipster/search-engine-types.js +1 -0
- package/lib/constants/priorities.cjs +16 -0
- package/lib/constants/priorities.mjs +1 -0
- package/lib/index.js +2 -0
- package/lib/support/base.cjs +2 -1
- package/package.json +7 -6
- package/utils/blueprint.js +10 -0
- package/utils/field.js +3 -1
- package/generators/client/templates/react/src/main/webapp/app/config/translation-middleware.ts.ejs +0 -58
- package/generators/server/templates/.npmrc.ejs +0 -1
|
@@ -24,6 +24,9 @@ const databaseData = {
|
|
|
24
24
|
[MSSQL]: {
|
|
25
25
|
protocolSuffix: 'sqlserver://',
|
|
26
26
|
port: ':1433;database=',
|
|
27
|
+
jdbc: {
|
|
28
|
+
extraOptions: ';encrypt=false',
|
|
29
|
+
},
|
|
27
30
|
r2dbc: {
|
|
28
31
|
protocolSuffix: 'mssql://',
|
|
29
32
|
port: ':1433/',
|
|
@@ -66,14 +69,14 @@ const databaseData = {
|
|
|
66
69
|
[H2_DISK]: {
|
|
67
70
|
protocolSuffix: 'h2:file:',
|
|
68
71
|
useDirectory: true,
|
|
69
|
-
extraOptions: ';DB_CLOSE_DELAY=-1',
|
|
72
|
+
extraOptions: ';DB_CLOSE_DELAY=-1;MODE=LEGACY',
|
|
70
73
|
r2dbc: {
|
|
71
74
|
protocolSuffix: 'h2:file://',
|
|
72
75
|
},
|
|
73
76
|
},
|
|
74
77
|
[H2_MEMORY]: {
|
|
75
78
|
protocolSuffix: 'h2:mem:',
|
|
76
|
-
extraOptions: ';DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE',
|
|
79
|
+
extraOptions: ';DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE;MODE=LEGACY',
|
|
77
80
|
r2dbc: {
|
|
78
81
|
protocolSuffix: 'h2:mem:///',
|
|
79
82
|
},
|
package/generators/utils.js
CHANGED
|
@@ -32,6 +32,8 @@ const FileUtils = require('../jdl/utils/file-utils');
|
|
|
32
32
|
const LANGUAGES_MAIN_SRC_DIR = `${__dirname}/languages/templates/${constants.CLIENT_MAIN_SRC_DIR}`;
|
|
33
33
|
|
|
34
34
|
module.exports = {
|
|
35
|
+
detectCrLf,
|
|
36
|
+
normalizeLineEndings,
|
|
35
37
|
rewrite,
|
|
36
38
|
rewriteFile,
|
|
37
39
|
replaceContent,
|
|
@@ -131,11 +133,49 @@ function escapeRegExp(str) {
|
|
|
131
133
|
* @param {string} str string
|
|
132
134
|
* @returns {string} string where CRLF is replaced with LF in Windows
|
|
133
135
|
*/
|
|
134
|
-
function
|
|
136
|
+
function normalizeWindowsLineEndings(str) {
|
|
135
137
|
const isWin32 = os.platform() === 'win32';
|
|
136
138
|
return isWin32 ? str.replace(/\r\n/g, '\n') : str;
|
|
137
139
|
}
|
|
138
140
|
|
|
141
|
+
/**
|
|
142
|
+
* Replace line endings with the specified one.
|
|
143
|
+
*
|
|
144
|
+
* @param {string} str
|
|
145
|
+
* @param {string} lineEnding
|
|
146
|
+
* @returns {string} normalized line ending string
|
|
147
|
+
*/
|
|
148
|
+
function normalizeLineEndings(str, lineEnding) {
|
|
149
|
+
return str.replace(/\r\n|\r|\n/g, lineEnding);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Detect the file first line endings
|
|
154
|
+
*
|
|
155
|
+
* @param {string} filePath
|
|
156
|
+
* @returns {boolean|undefined} true in case of crlf, false in case of lf, undefined for a single line file
|
|
157
|
+
*/
|
|
158
|
+
function detectCrLf(filePath) {
|
|
159
|
+
return new Promise((resolve, reject) => {
|
|
160
|
+
let isCrlf;
|
|
161
|
+
const rs = fs.createReadStream(filePath, { encoding: 'utf8' });
|
|
162
|
+
rs.on('data', function (chunk) {
|
|
163
|
+
const n = chunk.indexOf('\n');
|
|
164
|
+
const r = chunk.indexOf('\r');
|
|
165
|
+
if (n !== -1 || r !== -1) {
|
|
166
|
+
isCrlf = n === -1 || (r !== -1 && r < n);
|
|
167
|
+
rs.close();
|
|
168
|
+
}
|
|
169
|
+
})
|
|
170
|
+
.on('close', function () {
|
|
171
|
+
resolve(isCrlf);
|
|
172
|
+
})
|
|
173
|
+
.on('error', function (err) {
|
|
174
|
+
reject(err);
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
|
|
139
179
|
/**
|
|
140
180
|
* Change spaces sequences and '>' to allow any number of spaces or new line prefix
|
|
141
181
|
*
|
|
@@ -167,7 +207,7 @@ function rewrite(args) {
|
|
|
167
207
|
re = escapeRegExp(re);
|
|
168
208
|
}
|
|
169
209
|
} else {
|
|
170
|
-
re = args.splicable.map(line => `\\s*${escapeRegExp(
|
|
210
|
+
re = args.splicable.map(line => `\\s*${escapeRegExp(normalizeWindowsLineEndings(line))}`).join('\n');
|
|
171
211
|
}
|
|
172
212
|
if (!re.test) {
|
|
173
213
|
if (args.prettierAware) {
|
|
@@ -176,7 +216,7 @@ function rewrite(args) {
|
|
|
176
216
|
re = new RegExp(re);
|
|
177
217
|
}
|
|
178
218
|
|
|
179
|
-
if (re.test(
|
|
219
|
+
if (re.test(normalizeWindowsLineEndings(args.haystack))) {
|
|
180
220
|
return args.haystack;
|
|
181
221
|
}
|
|
182
222
|
|
|
@@ -238,7 +238,8 @@ module.exports = class extends BaseBlueprintGenerator {
|
|
|
238
238
|
_getOtherScripts() {
|
|
239
239
|
if (this.dockerCompose) {
|
|
240
240
|
return {
|
|
241
|
-
'
|
|
241
|
+
'docker-compose': 'docker-compose -f docker-compose/docker-compose.yml up -d',
|
|
242
|
+
'ci:e2e:prepare': 'npm run docker-compose',
|
|
242
243
|
'ci:e2e:teardown': 'docker-compose -f docker-compose/docker-compose.yml down -v',
|
|
243
244
|
};
|
|
244
245
|
}
|
|
@@ -27,10 +27,15 @@ module.exports = {
|
|
|
27
27
|
* Writes down the given JDL to a file.
|
|
28
28
|
* @param jdl the JDL to write.
|
|
29
29
|
* @param path the path where the file will be written.
|
|
30
|
+
* @returns {string} file contents
|
|
30
31
|
*/
|
|
31
32
|
function exportToJDL(jdl, path = 'app.jdl') {
|
|
32
33
|
if (!jdl) {
|
|
33
34
|
throw new Error('A JDLObject has to be passed to be exported.');
|
|
34
35
|
}
|
|
35
|
-
|
|
36
|
+
const fileContents = jdl.toString();
|
|
37
|
+
if (path) {
|
|
38
|
+
fs.writeFileSync(path, fileContents);
|
|
39
|
+
}
|
|
40
|
+
return fileContents;
|
|
36
41
|
}
|
|
@@ -45,7 +45,7 @@ const cacheTypes = require('./cache-types');
|
|
|
45
45
|
const NO_CACHE_PROVIDER = cacheTypes.NO;
|
|
46
46
|
|
|
47
47
|
const { PROTRACTOR, CYPRESS, CUCUMBER, GATLING } = require('./test-framework-types');
|
|
48
|
-
const { ANGULAR_X, ANGULAR, REACT, VUE, SVELTE } = require('./client-framework-types');
|
|
48
|
+
const { ANGULAR_X, ANGULAR, REACT, VUE, SVELTE, NO } = require('./client-framework-types');
|
|
49
49
|
const { ELASTICSEARCH } = require('./search-engine-types');
|
|
50
50
|
const searchEngines = require('./search-engine-types');
|
|
51
51
|
|
|
@@ -161,6 +161,7 @@ const optionValues = {
|
|
|
161
161
|
[REACT]: REACT,
|
|
162
162
|
[VUE]: VUE,
|
|
163
163
|
[SVELTE]: SVELTE,
|
|
164
|
+
[NO]: NO,
|
|
164
165
|
},
|
|
165
166
|
[optionNames.CLIENT_PACKAGE_MANAGER]: {
|
|
166
167
|
npm: 'npm',
|
|
@@ -27,7 +27,7 @@ const NO_SERVICE = ServiceTypes.NO;
|
|
|
27
27
|
const { PAGINATION, INFINITE_SCROLL } = PaginationTypes;
|
|
28
28
|
const NO_PAGINATION = PaginationTypes.NO;
|
|
29
29
|
|
|
30
|
-
const { ELASTICSEARCH, COUCHBASE } = SearchTypes;
|
|
30
|
+
const { ELASTICSEARCH, COUCHBASE, NO: NO_SEARCH } = SearchTypes;
|
|
31
31
|
|
|
32
32
|
const Options = {
|
|
33
33
|
DTO: 'dto',
|
|
@@ -49,7 +49,7 @@ const Values = {
|
|
|
49
49
|
'INFINITE-SCROLL': INFINITE_SCROLL,
|
|
50
50
|
NO: NO_PAGINATION,
|
|
51
51
|
},
|
|
52
|
-
[Options.SEARCH]: { ELASTICSEARCH, COUCHBASE },
|
|
52
|
+
[Options.SEARCH]: { ELASTICSEARCH, COUCHBASE, NO: NO_SEARCH },
|
|
53
53
|
};
|
|
54
54
|
|
|
55
55
|
const DefaultValues = {
|
|
@@ -35,7 +35,7 @@ const serviceDiscoveryTypes = require('./service-discovery-types');
|
|
|
35
35
|
|
|
36
36
|
const NO_SERVICE_DISCOVERY = serviceDiscoveryTypes.NO;
|
|
37
37
|
|
|
38
|
-
const { ANGULAR, ANGULAR_X } = require('./client-framework-types');
|
|
38
|
+
const { ANGULAR, ANGULAR_X, NO: NO_CLIENT_FRAMEWORK } = require('./client-framework-types');
|
|
39
39
|
|
|
40
40
|
const { MAVEN } = require('./build-tool-types');
|
|
41
41
|
|
|
@@ -118,7 +118,9 @@ function getConfigForMonolithApplication(customOptions = {}) {
|
|
|
118
118
|
if (options[AUTHENTICATION_TYPE] === OAUTH2) {
|
|
119
119
|
options[SKIP_USER_MANAGEMENT] = true;
|
|
120
120
|
}
|
|
121
|
-
|
|
121
|
+
if (options[SKIP_CLIENT]) {
|
|
122
|
+
options[CLIENT_FRAMEWORK] = NO_CLIENT_FRAMEWORK;
|
|
123
|
+
}
|
|
122
124
|
return {
|
|
123
125
|
...options,
|
|
124
126
|
[APPLICATION_TYPE]: MONOLITH,
|
|
@@ -169,12 +171,11 @@ function getConfigForMicroserviceApplication(customOptions = {}) {
|
|
|
169
171
|
[SKIP_USER_MANAGEMENT]: true,
|
|
170
172
|
...customOptions,
|
|
171
173
|
};
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
skipClient = options[CLIENT_FRAMEWORK] === undefined;
|
|
174
|
+
if (options[SKIP_CLIENT] === undefined) {
|
|
175
|
+
options[SKIP_CLIENT] = options[CLIENT_FRAMEWORK] === undefined || options[CLIENT_FRAMEWORK] === NO_CLIENT_FRAMEWORK;
|
|
175
176
|
}
|
|
176
|
-
if (
|
|
177
|
-
|
|
177
|
+
if (options[SKIP_CLIENT]) {
|
|
178
|
+
options[CLIENT_FRAMEWORK] = NO_CLIENT_FRAMEWORK;
|
|
178
179
|
delete options[SKIP_SERVER];
|
|
179
180
|
}
|
|
180
181
|
delete options[CLIENT_THEME];
|
|
@@ -192,7 +193,6 @@ function getConfigForMicroserviceApplication(customOptions = {}) {
|
|
|
192
193
|
return {
|
|
193
194
|
...options,
|
|
194
195
|
[APPLICATION_TYPE]: MICROSERVICE,
|
|
195
|
-
[SKIP_CLIENT]: skipClient,
|
|
196
196
|
};
|
|
197
197
|
}
|
|
198
198
|
|
|
@@ -227,6 +227,9 @@ function getDefaultConfigForNewApplication(customOptions = {}) {
|
|
|
227
227
|
if (!options[PACKAGE_FOLDER] && options[PACKAGE_NAME]) {
|
|
228
228
|
options[PACKAGE_FOLDER] = options[PACKAGE_NAME].replace(/\./g, '/');
|
|
229
229
|
}
|
|
230
|
+
if (options[SKIP_CLIENT]) {
|
|
231
|
+
options[CLIENT_FRAMEWORK] = NO_CLIENT_FRAMEWORK;
|
|
232
|
+
}
|
|
230
233
|
if (options[CLIENT_FRAMEWORK] === ANGULAR) {
|
|
231
234
|
options[CLIENT_FRAMEWORK] = ANGULAR_X;
|
|
232
235
|
}
|
|
@@ -101,6 +101,10 @@ const POST_WRITING_ENTITIES = 'postWritingEntities';
|
|
|
101
101
|
const POST_WRITING_ENTITIES_PRIORITY = `${PRIORITY_PREFIX}${POST_WRITING_ENTITIES}`;
|
|
102
102
|
const POST_WRITING_ENTITIES_QUEUE = `${QUEUE_PREFIX}${POST_WRITING_ENTITIES}`;
|
|
103
103
|
|
|
104
|
+
const POST_INSTALL = 'postInstall';
|
|
105
|
+
const POST_INSTALL_PRIORITY = `${PRIORITY_PREFIX}${POST_INSTALL}`;
|
|
106
|
+
const POST_INSTALL_QUEUE = `${QUEUE_PREFIX}${POST_INSTALL}`;
|
|
107
|
+
|
|
104
108
|
/** @private */
|
|
105
109
|
const PRE_CONFLICTS = 'preConflicts';
|
|
106
110
|
/** @private */
|
|
@@ -168,6 +172,12 @@ const CUSTOM_PRIORITIES = [
|
|
|
168
172
|
args: generator => generator.getArgsForPriority(INSTALL),
|
|
169
173
|
edit: true,
|
|
170
174
|
},
|
|
175
|
+
{
|
|
176
|
+
priorityName: POST_INSTALL,
|
|
177
|
+
queueName: POST_INSTALL_QUEUE,
|
|
178
|
+
before: END,
|
|
179
|
+
args: generator => generator.getArgsForPriority(POST_INSTALL),
|
|
180
|
+
},
|
|
171
181
|
{
|
|
172
182
|
priorityName: END,
|
|
173
183
|
args: generator => generator.getArgsForPriority(END),
|
|
@@ -200,6 +210,7 @@ const compat = {
|
|
|
200
210
|
POST_WRITING_ENTITIES_PRIORITY: POST_WRITING_ENTITIES,
|
|
201
211
|
PRE_CONFLICTS_PRIORITY: PRE_CONFLICTS,
|
|
202
212
|
INSTALL_PRIORITY: INSTALL,
|
|
213
|
+
POST_INSTALL_PRIORITY: POST_INSTALL,
|
|
203
214
|
END_PRIORITY: END,
|
|
204
215
|
};
|
|
205
216
|
|
|
@@ -227,6 +238,7 @@ const PRIORITY_NAMES = {
|
|
|
227
238
|
POST_WRITING_ENTITIES,
|
|
228
239
|
PRE_CONFLICTS,
|
|
229
240
|
INSTALL,
|
|
241
|
+
POST_INSTALL,
|
|
230
242
|
END,
|
|
231
243
|
};
|
|
232
244
|
|
|
@@ -241,6 +253,7 @@ const BASE_PRIORITY_NAMES = [
|
|
|
241
253
|
WRITING,
|
|
242
254
|
POST_WRITING,
|
|
243
255
|
INSTALL,
|
|
256
|
+
POST_INSTALL,
|
|
244
257
|
END,
|
|
245
258
|
];
|
|
246
259
|
|
|
@@ -318,6 +331,7 @@ const QUEUES = {
|
|
|
318
331
|
POST_WRITING_ENTITIES_QUEUE,
|
|
319
332
|
PRE_CONFLICTS_QUEUE,
|
|
320
333
|
INSTALL_QUEUE: INSTALL,
|
|
334
|
+
POST_INSTALL_QUEUE,
|
|
321
335
|
END_QUEUE: END,
|
|
322
336
|
};
|
|
323
337
|
|
|
@@ -334,6 +348,7 @@ const ENTITY_PRIORITY_NAMES = [
|
|
|
334
348
|
WRITING,
|
|
335
349
|
POST_WRITING,
|
|
336
350
|
INSTALL,
|
|
351
|
+
POST_INSTALL,
|
|
337
352
|
END,
|
|
338
353
|
];
|
|
339
354
|
|
|
@@ -382,5 +397,6 @@ module.exports = {
|
|
|
382
397
|
POST_WRITING_ENTITIES_PRIORITY,
|
|
383
398
|
PRE_CONFLICTS_PRIORITY,
|
|
384
399
|
INSTALL_PRIORITY,
|
|
400
|
+
POST_INSTALL_PRIORITY,
|
|
385
401
|
END_PRIORITY,
|
|
386
402
|
};
|
package/lib/index.js
CHANGED
|
@@ -2,6 +2,7 @@ const constants = require('../generators/generator-constants');
|
|
|
2
2
|
|
|
3
3
|
const GeneratorBase = require('../generators/generator-base');
|
|
4
4
|
const GeneratorBaseBlueprint = require('../generators/generator-base-blueprint');
|
|
5
|
+
const GeneratorBaseEntities = require('../generators/generator-base-entities.cjs');
|
|
5
6
|
|
|
6
7
|
const AppGenerator = require('../generators/app');
|
|
7
8
|
const ClientGenerator = require('../generators/client');
|
|
@@ -23,6 +24,7 @@ module.exports = {
|
|
|
23
24
|
|
|
24
25
|
GeneratorBase,
|
|
25
26
|
GeneratorBaseBlueprint,
|
|
27
|
+
GeneratorBaseEntities,
|
|
26
28
|
|
|
27
29
|
AppGenerator,
|
|
28
30
|
ClientGenerator,
|
package/lib/support/base.cjs
CHANGED
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
* limitations under the License.
|
|
18
18
|
*/
|
|
19
19
|
const { platform } = require('os');
|
|
20
|
+
const { normalizeLineEndings } = require('../../generators/utils');
|
|
20
21
|
|
|
21
22
|
const isWin32 = platform() === 'win32';
|
|
22
23
|
|
|
@@ -29,7 +30,7 @@ const isWin32 = platform() === 'win32';
|
|
|
29
30
|
const joinCallbacks = (...callbacks) => {
|
|
30
31
|
return function (content, filePath) {
|
|
31
32
|
if (isWin32 && content.match(/\r\n/)) {
|
|
32
|
-
callbacks = [ct => ct
|
|
33
|
+
callbacks = [ct => normalizeLineEndings(ct, '\n')].concat(callbacks).concat(ct => normalizeLineEndings(ct, '\r\n'));
|
|
33
34
|
}
|
|
34
35
|
for (const callback of callbacks) {
|
|
35
36
|
content = callback.call(this, content, filePath);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "generator-jhipster",
|
|
3
|
-
"version": "7.9.
|
|
3
|
+
"version": "7.9.3",
|
|
4
4
|
"description": "Spring Boot + Angular/React/Vue in one handy generator",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yeoman-generator",
|
|
@@ -84,10 +84,10 @@
|
|
|
84
84
|
},
|
|
85
85
|
"dependencies": {
|
|
86
86
|
"@faker-js/faker": "5.5.3",
|
|
87
|
-
"aws-sdk": "2.
|
|
87
|
+
"aws-sdk": "2.1204.0",
|
|
88
88
|
"axios": "0.27.2",
|
|
89
89
|
"chalk": "4.1.2",
|
|
90
|
-
"chevrotain": "10.
|
|
90
|
+
"chevrotain": "10.3.0",
|
|
91
91
|
"commander": "9.4.0",
|
|
92
92
|
"conf": "10.2.0",
|
|
93
93
|
"debug": "4.3.4",
|
|
@@ -96,9 +96,10 @@
|
|
|
96
96
|
"escape-string-regexp": "4.0.0",
|
|
97
97
|
"glob": "8.0.3",
|
|
98
98
|
"insight": "0.11.1",
|
|
99
|
+
"isbinaryfile": "4.0.10",
|
|
99
100
|
"js-yaml": "4.1.0",
|
|
100
101
|
"lodash": "4.17.21",
|
|
101
|
-
"mem-fs-editor": "9.
|
|
102
|
+
"mem-fs-editor": "9.5.0",
|
|
102
103
|
"minimatch": "5.1.0",
|
|
103
104
|
"normalize-path": "3.0.0",
|
|
104
105
|
"os-locale": "5.0.0",
|
|
@@ -113,7 +114,7 @@
|
|
|
113
114
|
"randexp": "0.5.3",
|
|
114
115
|
"semver": "7.3.7",
|
|
115
116
|
"shelljs": "0.8.5",
|
|
116
|
-
"simple-git": "3.
|
|
117
|
+
"simple-git": "3.13.0",
|
|
117
118
|
"then-request": "6.0.2",
|
|
118
119
|
"uuid": "8.3.2",
|
|
119
120
|
"winston": "3.8.1",
|
|
@@ -123,7 +124,7 @@
|
|
|
123
124
|
"devDependencies": {
|
|
124
125
|
"chai": "4.3.6",
|
|
125
126
|
"ejs-lint": "1.2.2",
|
|
126
|
-
"eslint": "8.
|
|
127
|
+
"eslint": "8.23.0",
|
|
127
128
|
"eslint-config-airbnb-base": "15.0.0",
|
|
128
129
|
"eslint-config-prettier": "8.5.0",
|
|
129
130
|
"eslint-plugin-chai-friendly": "0.7.2",
|
package/utils/blueprint.js
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* See the License for the specific language governing permissions and
|
|
17
17
|
* limitations under the License.
|
|
18
18
|
*/
|
|
19
|
+
const YeomanNamespace = require('yeoman-environment/lib/util/namespace');
|
|
19
20
|
|
|
20
21
|
module.exports = {
|
|
21
22
|
mergeBlueprints,
|
|
@@ -134,6 +135,15 @@ function parseBlueprintInfo(blueprint) {
|
|
|
134
135
|
* @returns {string} the normalized blueprint name
|
|
135
136
|
*/
|
|
136
137
|
function normalizeBlueprintName(blueprint) {
|
|
138
|
+
try {
|
|
139
|
+
const parsed = YeomanNamespace.parse(blueprint);
|
|
140
|
+
if (parsed.unscoped.startsWith('generator-jhipster-')) {
|
|
141
|
+
return blueprint;
|
|
142
|
+
}
|
|
143
|
+
const namespace = new YeomanNamespace(parsed);
|
|
144
|
+
return namespace.with({ unscoped: `generator-jhipster-${namespace.unscoped}` }).toString();
|
|
145
|
+
// eslint-disable-next-line no-empty
|
|
146
|
+
} catch (e) {}
|
|
137
147
|
if (blueprint && blueprint.startsWith('@')) {
|
|
138
148
|
return blueprint;
|
|
139
149
|
}
|
package/utils/field.js
CHANGED
|
@@ -326,7 +326,9 @@ function prepareFieldForTemplates(entityWithConfig, field, generator) {
|
|
|
326
326
|
}
|
|
327
327
|
|
|
328
328
|
field.fieldValidate = Array.isArray(field.fieldValidateRules) && field.fieldValidateRules.length >= 1;
|
|
329
|
-
|
|
329
|
+
_.defaults(field, {
|
|
330
|
+
nullable: !(field.fieldValidate === true && field.fieldValidateRules.includes(REQUIRED)),
|
|
331
|
+
});
|
|
330
332
|
field.unique = field.fieldValidate === true && field.fieldValidateRules.includes(UNIQUE);
|
|
331
333
|
if (field.unique) {
|
|
332
334
|
field.uniqueConstraintName = generator.getUXConstraintName(
|
package/generators/client/templates/react/src/main/webapp/app/config/translation-middleware.ts.ejs
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
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 { createListenerMiddleware } from '@reduxjs/toolkit';
|
|
20
|
-
import { updateLocale, addTranslationSourcePrefix, loadLocale, loaded } from 'app/shared/reducers/locale';
|
|
21
|
-
import getStore from './store';
|
|
22
|
-
|
|
23
|
-
const listenerMiddleware = createListenerMiddleware();
|
|
24
|
-
|
|
25
|
-
listenerMiddleware.startListening({
|
|
26
|
-
actionCreator: updateLocale,
|
|
27
|
-
async effect(action) {
|
|
28
|
-
const store = getStore();
|
|
29
|
-
const { sourcePrefixes, loadedKeys } = store.getState().locale;
|
|
30
|
-
const keys = (
|
|
31
|
-
await Promise.all(
|
|
32
|
-
[''].concat(sourcePrefixes).map(async sourcePrefix => {
|
|
33
|
-
const key = `${sourcePrefix}${action.payload}`;
|
|
34
|
-
if (loadedKeys.includes(key)) return;
|
|
35
|
-
await loadLocale(action.payload, sourcePrefix);
|
|
36
|
-
return key;
|
|
37
|
-
})
|
|
38
|
-
)
|
|
39
|
-
).filter(Boolean);
|
|
40
|
-
store.dispatch(loaded(keys));
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
listenerMiddleware.startListening({
|
|
45
|
-
actionCreator: addTranslationSourcePrefix,
|
|
46
|
-
async effect(action) {
|
|
47
|
-
const store = getStore();
|
|
48
|
-
const { currentLocale, loadedKeys } = store.getState().locale;
|
|
49
|
-
const key = `${action.payload}${currentLocale}`;
|
|
50
|
-
|
|
51
|
-
if (!loadedKeys.includes(key)) {
|
|
52
|
-
await loadLocale(currentLocale, action.payload);
|
|
53
|
-
}
|
|
54
|
-
store.dispatch(loaded(key));
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
export default listenerMiddleware.middleware;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
script-shell=bash
|